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AAO,EAAe,gBAAgB,EACxC,EAAe,gBAAgB,EAEnC,EACF,GAyCA,SAAS,gBAAgB,CAAC,UAlB1B,SAA+B,CAAG,EAChB,WAAZ,EAAI,GAAG,EACT,AAnBJ,WACE,IAAM,EAAoB,EAAW,aAAa,CAAC,cAAc,YAAY,CAAC,YACxE,EAAiB,CAAC,EAAQ,MAAM,CAChC,EAAqB,EAAe,YAAY,CAAC,QACjD,EAAoB,EAAc,YAAY,CAAC,QAGhD,GAAmB,IAFF,CAAA,GAAsB,CAA5C,GAMA,EAAQ,KAAK,EACf,GASA,EAeF","sources":["","node_modules/@parcel/runtime-js/lib/runtime-601faaa8b4d3eea1.js","node_modules/@parcel/runtime-js/lib/helpers/browser/esm-js-loader.js","src/js/index.js","node_modules/@georapbox/a-tab-group/dist/a-tab-group.js","node_modules/@georapbox/a-tab-group/src/utils/uid.js","node_modules/@georapbox/a-tab-group/src/utils/upgrade-property.js","node_modules/@georapbox/a-tab-group/src/a-tab.js","node_modules/@georapbox/a-tab-group/src/a-tab-panel.js","node_modules/@georapbox/a-tab-group/src/a-tab-group.js","node_modules/@georapbox/web-share-element/dist/web-share-defined.js","node_modules/@georapbox/web-share-element/src/web-share.js","node_modules/@georapbox/web-share-element/src/web-share-defined.js","node_modules/@georapbox/files-dropzone-element/dist/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/src/utils/is-valid-file.js","node_modules/@georapbox/files-dropzone-element/src/utils/files-selector.js","node_modules/@georapbox/files-dropzone-element/src/files-dropzone.js","node_modules/@georapbox/files-dropzone-element/src/files-dropzone-defined.js","node_modules/@georapbox/resize-observer-element/dist/resize-observer-defined.js","node_modules/@georapbox/resize-observer-element/src/resize-observer.js","node_modules/@georapbox/resize-observer-element/src/resize-observer-defined.js","node_modules/@georapbox/modal-element/dist/modal-element-defined.js","node_modules/@georapbox/modal-element/src/modal-element.js","node_modules/@georapbox/modal-element/src/modal-element-defined.js","src/js/constants.js","src/js/services/storage.js","node_modules/idb-keyval/dist/compat.js","src/js/utils/debounce.js","src/js/utils/log.js","src/js/utils/isDialogElementSupported.js","src/js/helpers/renderSupportedFormats.js","src/js/helpers/history.js","src/js/helpers/results.js","src/js/helpers/triggerScanEffects.js","src/js/utils/beep.js","src/js/utils/vibrate.js","src/js/helpers/resizeScanFrame.js","src/js/helpers/BarcodeReader.js","src/js/helpers/initializeSettingsForm.js","src/js/helpers/toggleTorchButtonStatus.js","src/js/components/video-capture.js","src/js/utils/clamp.js","src/js/components/clipboard-copy.js","node_modules/@georapbox/clipboard-copy-element/dist/clipboard-copy.js","node_modules/@georapbox/clipboard-copy-element/src/clipboard-copy.js","src/js/components/scan-result.js","node_modules/@georapbox/web-share-element/dist/is-web-share-supported.js","node_modules/@georapbox/web-share-element/src/is-web-share-supported.js"],"sourcesContent":["\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea202\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea202\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"cw9o9\", function(module, exports) {\n\nvar $hffE7 = parcelRequire(\"hffE7\");\nmodule.exports = $hffE7(\"6z40I\").then(()=>parcelRequire(\"aexh3\"));\n\n});\nparcelRegister(\"hffE7\", function(module, exports) {\n\"use strict\";\n\nfunction $c8dff9588896671a$var$load(id) {\n // eslint-disable-next-line no-undef\n return import((parcelRequire(\"kyEFX\")).resolve(id));\n}\nmodule.exports = $c8dff9588896671a$var$load;\n\n});\n\n\n/*!\n * @georapbox/a-tab-group\n * A custom element to create a group of tabs and tab panels.\n *\n * @version 2.4.1\n * @homepage https://github.com/georapbox/a-tab-group#readme\n * @author George Raptis \n * @license MIT\n */ var $5a53255ef6289be5$var$h = (a = \"\", t = \"\")=>{\n let e = typeof a == \"string\" && a !== \"\" ? a + \"-\" : \"\", s = typeof t == \"string\" && t !== \"\" ? \"-\" + t : \"\", i = Math.random().toString(36).substring(2, 8);\n return `${e}${i}${s}`;\n};\nvar $5a53255ef6289be5$var$b = (a, t)=>{\n if (Object.prototype.hasOwnProperty.call(t, a)) {\n let e = t[a];\n delete t[a], t[a] = e;\n }\n};\nvar $5a53255ef6289be5$var$E = 0, $5a53255ef6289be5$var$C = `\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`, $5a53255ef6289be5$var$w = document.createElement(\"template\");\n$5a53255ef6289be5$var$w.innerHTML = `\n \n\n
\n \n
\n`;\nvar $5a53255ef6289be5$export$6824c350c20eab3a = class a extends HTMLElement {\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($5a53255ef6289be5$var$w.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"selected\",\n \"disabled\",\n \"closable\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n if (t === \"selected\" && e !== s && (this.setAttribute(\"aria-selected\", this.selected.toString()), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\")), t === \"disabled\" && e !== s && (this.setAttribute(\"aria-disabled\", this.disabled.toString()), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\")), t === \"closable\" && e !== s) {\n if (this.closable) {\n let i = document.createElement(\"span\");\n i.className = \"tab__close\", i.setAttribute(\"part\", \"close-tab\"), i.innerHTML = '', this.shadowRoot?.querySelector(\".tab\")?.appendChild(i), i.addEventListener(\"click\", this.#e);\n } else {\n let i = this.shadowRoot?.querySelector(\".tab__close\");\n i?.removeEventListener(\"click\", this.#e), i?.remove();\n }\n }\n }\n connectedCallback() {\n this.#s(\"selected\"), this.#s(\"disabled\"), this.#s(\"closable\"), this.id || (this.id = $5a53255ef6289be5$var$h(\"tab\", (++$5a53255ef6289be5$var$E).toString())), this.setAttribute(\"slot\", \"tab\"), this.setAttribute(\"role\", \"tab\"), this.setAttribute(\"aria-selected\", \"false\"), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\");\n }\n disconnectedCallback() {\n this.shadowRoot?.querySelector(\".tab__close\")?.removeEventListener(\"click\", this.#e);\n }\n get selected() {\n return this.hasAttribute(\"selected\");\n }\n set selected(t) {\n this.toggleAttribute(\"selected\", !!t);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get closable() {\n return this.hasAttribute(\"closable\");\n }\n set closable(t) {\n this.toggleAttribute(\"closable\", !!t);\n }\n #e = (t)=>{\n t.stopPropagation(), this.dispatchEvent(new CustomEvent(\"a-tab-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: this.id\n }\n }));\n };\n #s(t) {\n return $5a53255ef6289be5$var$b(t, this);\n }\n static defineCustomElement(t = \"a-tab\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$5a53255ef6289be5$export$6824c350c20eab3a.defineCustomElement();\nvar $5a53255ef6289be5$var$L = 0, $5a53255ef6289be5$var$S = `\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`, $5a53255ef6289be5$var$T = document.createElement(\"template\");\n$5a53255ef6289be5$var$T.innerHTML = `\n \n\n
\n \n
\n`;\nvar $5a53255ef6289be5$export$185adf5fa2c760b1 = class a extends HTMLElement {\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($5a53255ef6289be5$var$T.content.cloneNode(!0));\n }\n connectedCallback() {\n this.setAttribute(\"slot\", \"panel\"), this.setAttribute(\"role\", \"tabpanel\"), this.setAttribute(\"hidden\", \"\"), this.id || (this.id = $5a53255ef6289be5$var$h(\"panel\", (++$5a53255ef6289be5$var$L).toString()));\n }\n static defineCustomElement(t = \"a-tab-panel\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$5a53255ef6289be5$export$185adf5fa2c760b1.defineCustomElement();\nvar $5a53255ef6289be5$var$y = 200, $5a53255ef6289be5$var$n = {\n TOP: \"top\",\n BOTTOM: \"bottom\",\n START: \"start\",\n END: \"end\"\n}, $5a53255ef6289be5$var$l = {\n LTR: \"ltr\",\n RTL: \"rtl\"\n}, $5a53255ef6289be5$var$R = Object.entries($5a53255ef6289be5$var$n).map(([, a])=>a), $5a53255ef6289be5$var$r = {\n AUTO: \"auto\",\n MANUAL: \"manual\"\n}, $5a53255ef6289be5$var$c = {\n DOWN: \"ArrowDown\",\n LEFT: \"ArrowLeft\",\n RIGHT: \"ArrowRight\",\n UP: \"ArrowUp\",\n HOME: \"Home\",\n END: \"End\",\n ENTER: \"Enter\",\n SPACE: \" \"\n}, $5a53255ef6289be5$var$x = `\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${$5a53255ef6289be5$var$l.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${$5a53255ef6289be5$var$l.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${$5a53255ef6289be5$var$l.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${$5a53255ef6289be5$var$l.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${$5a53255ef6289be5$var$n.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${$5a53255ef6289be5$var$n.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${$5a53255ef6289be5$var$n.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${$5a53255ef6289be5$var$n.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`, $5a53255ef6289be5$var$A = document.createElement(\"template\");\n$5a53255ef6289be5$var$A.innerHTML = `\n \n\n
\n
\n \n\n
\n \n
\n\n \n
\n\n
\n \n
\n
\n`;\nvar $5a53255ef6289be5$export$4ac05a649254e913 = class a extends HTMLElement {\n #e = null;\n #s = null;\n #l = !1;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($5a53255ef6289be5$var$A.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"placement\",\n \"no-scroll-controls\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n t === \"placement\" && e !== s && this.#i(), t === \"no-scroll-controls\" && e !== s && this.#i();\n }\n get placement() {\n return this.getAttribute(\"placement\") || $5a53255ef6289be5$var$n.TOP;\n }\n set placement(t) {\n t != null && this.setAttribute(\"placement\", t);\n }\n get noScrollControls() {\n return this.hasAttribute(\"no-scroll-controls\");\n }\n set noScrollControls(t) {\n this.toggleAttribute(\"no-scroll-controls\", !!t);\n }\n get scrollDistance() {\n let t = Number(this.getAttribute(\"scroll-distance\"));\n return Math.abs(t) || $5a53255ef6289be5$var$y;\n }\n set scrollDistance(t) {\n this.setAttribute(\"scroll-distance\", Math.abs(t).toString() || $5a53255ef6289be5$var$y.toString());\n }\n get activation() {\n return this.getAttribute(\"activation\") || $5a53255ef6289be5$var$r.AUTO;\n }\n set activation(t) {\n this.setAttribute(\"activation\", t || $5a53255ef6289be5$var$r.AUTO);\n }\n get noTabCycling() {\n return this.hasAttribute(\"no-tab-cycling\");\n }\n set noTabCycling(t) {\n this.toggleAttribute(\"no-tab-cycling\", !!t);\n }\n connectedCallback() {\n this.#o(\"placement\"), this.#o(\"noScrollControls\"), this.#o(\"scrollDistance\"), this.#o(\"activation\"), this.#o(\"noTabCycling\");\n let t = this.shadowRoot?.querySelector(\"slot[name=tab]\"), e = this.shadowRoot?.querySelector(\"slot[name=panel]\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\"), i = this.shadowRoot?.querySelector(\".tab-group__nav\"), o = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n t?.addEventListener(\"slotchange\", this.#n), e?.addEventListener(\"slotchange\", this.#n), s?.addEventListener(\"click\", this.#g), s?.addEventListener(\"keydown\", this.#p), o.forEach((d)=>d.addEventListener(\"click\", this.#f)), this.addEventListener(\"a-tab-close\", this.#m), \"ResizeObserver\" in window && (this.#e = new ResizeObserver((d)=>{\n this.#s = window.requestAnimationFrame(()=>{\n let v = d?.[0]?.target, g = v?.scrollWidth > v?.clientWidth;\n o.forEach((_)=>_.toggleAttribute(\"hidden\", !g)), i?.part.toggle(\"nav--has-scroll-controls\", g), i?.classList.toggle(\"tab-group__nav--has-scroll-controls\", g);\n });\n })), this.#h(), this.#i();\n }\n disconnectedCallback() {\n let t = this.shadowRoot?.querySelector(\"slot[name=tab]\"), e = this.shadowRoot?.querySelector(\"slot[name=panel]\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\"), i = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n t?.removeEventListener(\"slotchange\", this.#n), e?.removeEventListener(\"slotchange\", this.#n), s?.removeEventListener(\"click\", this.#g), s?.removeEventListener(\"keydown\", this.#p), i.forEach((o)=>o.removeEventListener(\"click\", this.#f)), this.removeEventListener(\"a-tab-close\", this.#m), this.#c();\n }\n #v() {\n if (!this.#e) return;\n let t = this.shadowRoot?.querySelector(\".tab-group__tabs\");\n t && (this.#e.unobserve(t), this.#e.observe(t));\n }\n #c() {\n this.#e && (this.#e.disconnect(), this.#s !== null && (window.cancelAnimationFrame(this.#s), this.#s = null));\n }\n #d() {\n return window.CSS.supports(\"selector(:dir(ltr))\") ? this.matches(\":dir(ltr)\") ? $5a53255ef6289be5$var$l.LTR : $5a53255ef6289be5$var$l.RTL : window.getComputedStyle(this).direction || $5a53255ef6289be5$var$l.LTR;\n }\n #h() {\n this.hidden = this.#t().length === 0;\n }\n #w() {\n let t = this.#t();\n this.#h(), t.forEach((e)=>{\n let s = e.nextElementSibling;\n if (!s || s.tagName.toLowerCase() !== \"a-tab-panel\") return console.error(`Tab #${e.id} is not a sibling of a `);\n e.setAttribute(\"aria-controls\", s.id), s.setAttribute(\"aria-labelledby\", e.id);\n });\n }\n #T() {\n return Array.from(this.querySelectorAll(\"a-tab-panel\"));\n }\n #t() {\n return Array.from(this.querySelectorAll(\"a-tab\"));\n }\n #b(t) {\n let e = t.getAttribute(\"aria-controls\");\n return this.querySelector(`#${e}`);\n }\n #y() {\n return this.#t().find((e)=>!e.disabled) || null;\n }\n #A() {\n let t = this.#t();\n for(let e = t.length - 1; e >= 0; e--)if (!t[e].disabled) return t[e];\n return null;\n }\n #a() {\n let t = this.#t(), e = this.activation === $5a53255ef6289be5$var$r.MANUAL ? t.findIndex((s)=>s.matches(\":focus\")) - 1 : t.findIndex((s)=>s.selected) - 1;\n for(; t[(e + t.length) % t.length].disabled;)e--;\n return this.noTabCycling && e < 0 ? null : t[(e + t.length) % t.length];\n }\n #r() {\n let t = this.#t(), e = this.activation === $5a53255ef6289be5$var$r.MANUAL ? t.findIndex((s)=>s.matches(\":focus\")) + 1 : t.findIndex((s)=>s.selected) + 1;\n for(; t[e % t.length].disabled;)e++;\n return this.noTabCycling && e >= t.length ? null : t[e % t.length];\n }\n #_() {\n let t = this.#t(), e = this.#T();\n t.forEach((s)=>s.selected = !1), e.forEach((s)=>s.hidden = !0);\n }\n #i() {\n let t = this.shadowRoot?.querySelector(\".tab-group__nav\"), e = this.shadowRoot?.querySelector(\".tab-group__tabs\"), s = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n this.noScrollControls || this.placement === $5a53255ef6289be5$var$n.START || this.placement === $5a53255ef6289be5$var$n.END ? (this.#c(), s.forEach((i)=>i.hidden = !0), t?.part.remove(\"nav--has-scroll-controls\"), t?.classList.remove(\"tab-group__nav--has-scroll-controls\"), e?.setAttribute(\"aria-orientation\", \"vertical\")) : (this.#v(), s.forEach((i)=>i.hidden = !1), e?.setAttribute(\"aria-orientation\", \"horizontal\"));\n }\n #E() {\n let t = this.#t(), e = t.find((s)=>s.selected && !s.disabled) || t.find((s)=>!s.disabled);\n e && (this.#l && !e.selected && this.dispatchEvent(new CustomEvent(\"a-tab-show\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n })), this.#u(e));\n }\n #u(t) {\n this.#_(), t && (t.selected = !0);\n let e = this.#b(t);\n e && (e.hidden = !1);\n }\n #n = (t)=>{\n this.#w(), this.#i(), this.#E(), t.target.name === \"tab\" && (this.#l = !0);\n };\n #p = (t)=>{\n if (t.target.tagName.toLowerCase() !== \"a-tab\" || t.altKey) return;\n let e = $5a53255ef6289be5$var$R.includes(this.placement || \"\") ? this.placement : $5a53255ef6289be5$var$n.TOP, s = [\n $5a53255ef6289be5$var$n.TOP,\n $5a53255ef6289be5$var$n.BOTTOM\n ].includes(e || \"\") ? \"horizontal\" : \"vertical\", i = this.#d(), o = null;\n switch(t.key){\n case $5a53255ef6289be5$var$c.LEFT:\n s === \"horizontal\" && (o = i === $5a53255ef6289be5$var$l.LTR ? this.#a() : this.#r(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $5a53255ef6289be5$var$c.RIGHT:\n s === \"horizontal\" && (o = i === $5a53255ef6289be5$var$l.LTR ? this.#r() : this.#a(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $5a53255ef6289be5$var$c.UP:\n s === \"vertical\" && (o = this.#a(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $5a53255ef6289be5$var$c.DOWN:\n s === \"vertical\" && (o = this.#r(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $5a53255ef6289be5$var$c.HOME:\n o = this.#y(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o));\n break;\n case $5a53255ef6289be5$var$c.END:\n o = this.#A(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o));\n break;\n case $5a53255ef6289be5$var$c.ENTER:\n case $5a53255ef6289be5$var$c.SPACE:\n o = t.target, o && this.selectTab(o);\n break;\n default:\n return;\n }\n t.preventDefault();\n };\n #g = (t)=>{\n let e = t.target.closest(\"a-tab\");\n e && this.selectTab(e);\n };\n #f = (t)=>{\n let e = t.target.closest(\".tab-group__scroll-button\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\");\n if (!e || !s) return;\n let i = e.classList.contains(\"tab-group__scroll-button--start\"), o = this.#d() === $5a53255ef6289be5$var$l.LTR, d = i ? o ? -1 : 1 : o ? 1 : -1, m = s.scrollLeft;\n s.scrollTo({\n left: m + d * this.scrollDistance\n });\n };\n #m = (t)=>{\n let e = t.target, s = this.#b(e);\n e && (e.remove(), e.selected && this.dispatchEvent(new CustomEvent(\"a-tab-hide\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n }))), s && s.tagName.toLowerCase() === \"a-tab-panel\" && s.remove();\n };\n #o(t) {\n return $5a53255ef6289be5$var$b(t, this);\n }\n selectTabByIndex(t) {\n let s = this.#t()[t];\n s && this.selectTab(s);\n }\n selectTabById(t) {\n let s = this.#t().find((i)=>i.id === t);\n s && this.selectTab(s);\n }\n selectTab(t) {\n let e = this.#t().find((s)=>s.selected);\n !t || t.disabled || t.selected || t.tagName.toLowerCase() !== \"a-tab\" || (this.#u(t), window.requestAnimationFrame(()=>{\n t.scrollIntoView({\n inline: \"nearest\",\n block: \"nearest\"\n }), t.focus();\n }), e && this.dispatchEvent(new CustomEvent(\"a-tab-hide\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n })), this.dispatchEvent(new CustomEvent(\"a-tab-show\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: t.id\n }\n })));\n }\n static defineCustomElement(t = \"a-tab-group\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$5a53255ef6289be5$export$4ac05a649254e913.defineCustomElement();\n\n\n/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */ var $cd62c5572235e737$var$h = `\n :host {\n display: inline-block;\n }\n`, $cd62c5572235e737$var$r = document.createElement(\"template\");\n$cd62c5572235e737$var$r.innerHTML = `\n \n \n`;\nvar $cd62c5572235e737$export$30b344bef3e55b67 = class a extends HTMLElement {\n #e;\n #t;\n #r = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($cd62c5572235e737$var$r.content.cloneNode(!0)), this.#e = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null, this.#t = this.#h();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, e, i) {\n t === \"disabled\" && e !== i && this.#t && (this.#t.toggleAttribute(\"disabled\", this.disabled), this.#t.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#t.part && this.#t.part.contains(\"button\") && this.#t.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#s(\"shareUrl\"), this.#s(\"shareTitle\"), this.#s(\"shareText\"), this.#s(\"shareFiles\"), this.#s(\"disabled\"), this.#e?.addEventListener(\"slotchange\", this.#a), this.#t?.addEventListener(\"click\", this.#i);\n }\n disconnectedCallback() {\n this.#e?.removeEventListener(\"slotchange\", this.#a), this.#t?.removeEventListener(\"click\", this.#i);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(t) {\n this.setAttribute(\"share-url\", t);\n }\n get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(t) {\n this.setAttribute(\"share-title\", t);\n }\n get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(t) {\n this.setAttribute(\"share-text\", t);\n }\n get shareFiles() {\n return this.#r;\n }\n set shareFiles(t) {\n Array.isArray(t) && t.length > 0 && (this.#r = t);\n }\n async share() {\n if (!this.disabled) try {\n let t = {};\n this.shareUrl && (t.url = this.shareUrl), this.shareTitle && (t.title = this.shareTitle), this.shareText && (t.text = this.shareText), Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n }) && (t.files = this.shareFiles), await navigator.share(t), this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: !0,\n composed: !0,\n detail: {\n shareData: t\n }\n }));\n } catch (t) {\n if (t instanceof Error && t.name === \"AbortError\") {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #i = (t)=>{\n t.preventDefault(), !this.disabled && this.share();\n };\n #a = (t)=>{\n t.target && t.target.name === \"button\" && (this.#t?.removeEventListener(\"click\", this.#i), this.#t = this.#h(), this.#t && (this.#t.addEventListener(\"click\", this.#i), this.#t.nodeName !== \"BUTTON\" && !this.#t.hasAttribute(\"role\") && this.#t.setAttribute(\"role\", \"button\")));\n };\n #h() {\n return this.#e && this.#e.assignedElements({\n flatten: !0\n }).find((t)=>t.nodeName === \"BUTTON\" || t.getAttribute(\"slot\") === \"button\") || null;\n }\n #s(t) {\n let e = this;\n if (Object.prototype.hasOwnProperty.call(e, t)) {\n let i = e[t];\n delete e[t], e[t] = i;\n }\n }\n static defineCustomElement(t = \"web-share\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$cd62c5572235e737$export$30b344bef3e55b67.defineCustomElement();\n\n\n/*!\n * @georapbox/files-dropzone-element\n * A custom element that creates a drag and drop zone for files\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/files-dropzone-element#readme\n * @author George Raptis \n * @license MIT\n */ function $9351176e8d763a78$var$u(o, e = \"\") {\n if (!e) return !0;\n let t = [\n ...new Set(e.split(\",\").map((r)=>r.trim()).filter(Boolean))\n ], i = o.type, s = i.replace(/\\/.*$/, \"\");\n for (let r of t)if (r.charAt(0) === \".\") {\n if (o.name.toLowerCase().indexOf(r.toLowerCase(), o.name.length - r.length) !== -1) return !0;\n } else if (/\\/\\*$/.test(r)) {\n if (s === r.replace(/\\/.*$/, \"\")) return !0;\n } else if (i === r) return !0;\n return !1;\n}\nvar $9351176e8d763a78$var$x = new Map([\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]), $9351176e8d763a78$var$b = [\n \".DS_Store\",\n \"Thumbs.db\"\n], $9351176e8d763a78$var$y = (o)=>{\n let { name: e } = o;\n if (e && e.lastIndexOf(\".\") !== -1 && !o.type) {\n let i = (e.split(\".\").pop() || \"\").toLowerCase(), s = $9351176e8d763a78$var$x.get(i);\n s && Object.defineProperty(o, \"type\", {\n value: s,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return o;\n}, $9351176e8d763a78$var$g = (o, e)=>{\n let t = $9351176e8d763a78$var$y(o);\n if (typeof t.path != \"string\") {\n let { webkitRelativePath: i } = o;\n Object.defineProperty(t, \"path\", {\n value: typeof e == \"string\" ? e : i || o.name,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return t;\n}, $9351176e8d763a78$var$m = async (o)=>await new Promise((e, t)=>{\n o.readEntries(e, t);\n }), $9351176e8d763a78$var$w = async (o)=>{\n let e = [], t = await $9351176e8d763a78$var$m(o);\n for(; t.length > 0;)e.push(...t), t = await $9351176e8d763a78$var$m(o);\n return e;\n}, $9351176e8d763a78$var$E = (o)=>new Promise((e, t)=>{\n o.file((i)=>e($9351176e8d763a78$var$g(i, o.fullPath)), t);\n }), $9351176e8d763a78$var$F = async (o)=>{\n let e = [], t = [];\n for (let i of o){\n if (i.kind !== \"file\") continue;\n let s = i.getAsEntry ? i.getAsEntry() : i.webkitGetAsEntry();\n t.push(s);\n }\n for(; t.length > 0;){\n let i = t.shift();\n if (i) {\n if (i.isFile) {\n let s = await $9351176e8d763a78$var$E(i);\n $9351176e8d763a78$var$b.indexOf(s.name) === -1 && e.push(s);\n } else i.isDirectory && t.push(...await $9351176e8d763a78$var$w(i.createReader()));\n } else continue;\n }\n return e;\n}, $9351176e8d763a78$var$f = async (o)=>{\n let e = [];\n for (let t of o)$9351176e8d763a78$var$b.indexOf(t.name) === -1 && e.push($9351176e8d763a78$var$g(t));\n return e;\n}, $9351176e8d763a78$var$l = async (o)=>o.dataTransfer ? o.dataTransfer.items ? await $9351176e8d763a78$var$F(o.dataTransfer.items) : await $9351176e8d763a78$var$f(o.dataTransfer.files) : await $9351176e8d763a78$var$f(o.target.files);\nvar $9351176e8d763a78$var$n = \"files-dropzone\", $9351176e8d763a78$var$v = \"TOO_MANY_FILES\", $9351176e8d763a78$var$L = \"FILE_TOO_LARGE\", $9351176e8d763a78$var$k = \"FILE_TOO_SMALL\", $9351176e8d763a78$var$A = \"INVALID_MIME_TYPE\", $9351176e8d763a78$var$z = document.createElement(\"template\"), $9351176e8d763a78$var$S = `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$9351176e8d763a78$var$z.innerHTML = `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\nvar $9351176e8d763a78$export$6ccd1735166caad9 = class o extends HTMLElement {\n #t = null;\n #e = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($9351176e8d763a78$var$z.content.cloneNode(!0)), this.shadowRoot && (this.#t = this.shadowRoot.getElementById(\"file-input\"), this.#e = this.shadowRoot.getElementById(\"dropzone\"));\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n e === \"accept\" && t !== i && this.#t && (this.#t.accept = this.accept), e === \"disabled\" && t !== i && this.#t && (this.#t.disabled = this.disabled, this.disabled ? (this.#e?.removeAttribute(\"tabindex\"), this.#e?.setAttribute(\"aria-disabled\", \"true\")) : (this.#e?.setAttribute(\"tabindex\", \"0\"), this.#e?.setAttribute(\"aria-disabled\", \"false\"))), e === \"multiple\" && t !== i && this.#t && (this.#t.multiple = this.multiple);\n }\n connectedCallback() {\n this.#o(\"accept\"), this.#o(\"disabled\"), this.#o(\"maxFiles\"), this.#o(\"maxSize\"), this.#o(\"minSize\"), this.#o(\"multiple\"), this.#o(\"autoFocus\"), this.#o(\"noStyle\"), this.#t?.addEventListener(\"change\", this.#i), this.#e?.addEventListener(\"dragenter\", this.#r), this.#e?.addEventListener(\"dragover\", this.#s), this.#e?.addEventListener(\"dragleave\", this.#n), this.#e?.addEventListener(\"drop\", this.#a), this.#e?.addEventListener(\"click\", this.#d), this.#e?.addEventListener(\"keyup\", this.#l), this.autoFocus && this.#e?.focus();\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"change\", this.#i), this.#e?.removeEventListener(\"dragenter\", this.#r), this.#e?.removeEventListener(\"dragover\", this.#s), this.#e?.removeEventListener(\"dragleave\", this.#n), this.#e?.removeEventListener(\"drop\", this.#a), this.#e?.removeEventListener(\"click\", this.#d), this.#e?.removeEventListener(\"keyup\", this.#l);\n }\n get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(e) {\n this.setAttribute(\"accept\", e != null ? e.toString() : e);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n get maxFiles() {\n let e = Number(this.getAttribute(\"max-files\")) || 0;\n return e <= 0 ? 1 / 0 : Math.floor(Math.abs(e));\n }\n set maxFiles(e) {\n this.setAttribute(\"max-files\", e != null ? e.toString() : e);\n }\n get maxSize() {\n let e = this.getAttribute(\"max-size\");\n if (e === null) return 1 / 0;\n let t = Number(e);\n return Number.isNaN(t) ? 1 / 0 : t;\n }\n set maxSize(e) {\n this.setAttribute(\"max-size\", e != null ? e.toString() : e);\n }\n get minSize() {\n let e = this.getAttribute(\"min-size\");\n if (e === null) return 0;\n let t = Number(e);\n return Number.isNaN(t) ? 0 : t;\n }\n set minSize(e) {\n this.setAttribute(\"min-size\", e != null ? e.toString() : e);\n }\n get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(e) {\n this.toggleAttribute(\"multiple\", !!e);\n }\n get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(e) {\n this.toggleAttribute(\"auto-focus\", !!e);\n }\n get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(e) {\n this.toggleAttribute(\"no-style\", !!e);\n }\n #i = async (e)=>{\n try {\n this.#c(await $9351176e8d763a78$var$l(e));\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n };\n #r = ()=>{\n this.disabled || this.dispatchEvent(new Event(`${$9351176e8d763a78$var$n}-dragenter`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #s = (e)=>{\n if (e.preventDefault(), this.disabled) {\n e.dataTransfer.dropEffect = \"none\";\n return;\n }\n e.dataTransfer.dropEffect = \"copy\", this.#e && (this.#e.classList.add(\"dropzone--dragover\"), this.#e.part.add(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$9351176e8d763a78$var$n}-dragover`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #n = ()=>{\n this.disabled || (this.#e && (this.#e.classList.remove(\"dropzone--dragover\"), this.#e.part.remove(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$9351176e8d763a78$var$n}-dragleave`, {\n bubbles: !0,\n composed: !0\n })));\n };\n #a = async (e)=>{\n if (!this.disabled) {\n e.preventDefault(), this.#e && (this.#e.classList.remove(\"dropzone--dragover\"), this.#e.part.remove(\"dropzone--dragover\"));\n try {\n this.#c(await $9351176e8d763a78$var$l(e));\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n };\n #d = ()=>{\n this.disabled || this.#t?.click();\n };\n #l = (e)=>{\n this.disabled || (e.key === \" \" || e.key === \"Enter\") && this.#t?.click();\n };\n #c(e) {\n if (!Array.isArray(e) || !e.length) return;\n let t = [], i = [], s = e.length;\n if (!this.multiple && s > 1) for (let r of e)i.push({\n file: r,\n errors: [\n {\n code: $9351176e8d763a78$var$v,\n message: \"Too many files selected. Only 1 file is allowed.\"\n }\n ]\n });\n else if (this.multiple && s > this.maxFiles) for (let r of e)i.push({\n file: r,\n errors: [\n {\n code: $9351176e8d763a78$var$v,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else for (let r of e){\n let c = $9351176e8d763a78$var$u(r, this.accept), p = r.size > this.maxSize, h = r.size < this.minSize;\n if (c && !p && !h) t.push(r);\n else {\n let a = [];\n c || a.push({\n code: $9351176e8d763a78$var$A,\n message: `File type \"${r.type}\" is not accepted.`\n }), p && a.push({\n code: $9351176e8d763a78$var$L,\n message: `File size ${r.size} exceeds the maximum size of ${this.maxSize}.`\n }), h && a.push({\n code: $9351176e8d763a78$var$k,\n message: `File size ${r.size} is smaller than the minimum size of ${this.minSize}.`\n }), i.push({\n file: r,\n errors: a\n });\n }\n }\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-drop`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t,\n rejectedFiles: i\n }\n })), t.length > 0 && this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-drop-accepted`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t\n }\n })), i.length > 0 && this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-drop-rejected`, {\n bubbles: !0,\n composed: !0,\n detail: {\n rejectedFiles: i\n }\n })), this.#t && (this.#t.value = this.#t.defaultValue);\n }\n openFileDialog() {\n this.disabled || this.#t?.click();\n }\n #o(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n static defineCustomElement(e = $9351176e8d763a78$var$n) {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, o);\n }\n};\n$9351176e8d763a78$export$6ccd1735166caad9.defineCustomElement();\n\n\n/*!\n * @georapbox/resize-observer-element\n * A custom element that offers a declarative interface to the ResizeObserver API.\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/resize-observer-element#readme\n * @author George Raptis \n * @license MIT\n */ var $1c2cbcdf680d66d4$var$d = \":host { display: contents; }\", $1c2cbcdf680d66d4$var$o = document.createElement(\"template\");\n$1c2cbcdf680d66d4$var$o.innerHTML = `\n \n \n`;\nvar $1c2cbcdf680d66d4$export$f0e45424cc896229 = class n extends HTMLElement {\n #e = null;\n #t = null;\n #s = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($1c2cbcdf680d66d4$var$o.content.cloneNode(!0)), this.#e = this.shadowRoot?.querySelector(\"slot\") ?? null;\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n e === \"disabled\" && t !== i && (this.disabled ? this.#o() : this.#i());\n }\n connectedCallback() {\n this.#d(\"disabled\"), \"ResizeObserver\" in window && (this.#t = new ResizeObserver((e)=>{\n this.dispatchEvent(new CustomEvent(\"resize-observer:resize\", {\n bubbles: !0,\n composed: !0,\n detail: {\n entries: e\n }\n }));\n }), this.disabled || this.#i(), this.#e?.addEventListener(\"slotchange\", this.#n));\n }\n disconnectedCallback() {\n this.#o(), this.#e?.removeEventListener(\"slotchange\", this.#n);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n #i() {\n !this.#e || !this.#t || (this.#s.forEach((e)=>this.#t?.unobserve(e)), this.#s = [], this.#e.assignedElements().forEach((e)=>{\n this.#t?.observe(e), this.#s.push(e);\n }));\n }\n #o() {\n this.#t?.disconnect();\n }\n #n = ()=>{\n this.disabled || this.#i();\n };\n #d(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n static defineCustomElement(e = \"resize-observer\") {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, n);\n }\n};\n$1c2cbcdf680d66d4$export$f0e45424cc896229.defineCustomElement();\n\n\n/*!\n * @georapbox/modal-element\n * A custom element to create a modal, using the native dialog element under the hood.\n *\n * @version 1.8.0\n * @homepage https://github.com/georapbox/modal-element#readme\n * @author George Raptis \n * @license MIT\n */ var $d9c5053bade2d3f8$var$n = document.createElement(\"template\"), $d9c5053bade2d3f8$var$r = `\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: 300ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;\n$d9c5053bade2d3f8$var$n.innerHTML = `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\nvar $d9c5053bade2d3f8$export$32589115725b904b = class s extends HTMLElement {\n #e = null;\n #i = null;\n #a = null;\n #o = void 0;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($d9c5053bade2d3f8$var$n.content.cloneNode(!0)), this.shadowRoot && (this.#e = this.shadowRoot.querySelector(\"dialog\"), this.#i = this.shadowRoot.querySelector('slot[name=\"footer\"]'), this.#a = this.shadowRoot.querySelector('slot[name=\"close\"]'));\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\",\n \"close-label\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n if (this.#e !== null) {\n if (e === \"open\" && t !== i && (this.open ? (this.#e.showModal(), this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n })), document.body && !this.preserveOverflow && (document.body.style.overflow = \"hidden\")) : this.#e.close()), e === \"no-header\" && t !== i) {\n let o = this.#e.querySelector(\".dialog__header\");\n o !== null && (o.hidden = this.noHeader);\n }\n if (e === \"no-animations\" && t !== i && this.#e.classList.toggle(\"dialog--no-animations\", this.noAnimations), e === \"no-close-button\" && t !== i) {\n let o = this.#e.querySelector(\".dialog__close\");\n o !== null && (o.hidden = this.noCloseButton);\n }\n e === \"close-label\" && t !== i && this.#r();\n }\n }\n connectedCallback() {\n this.#t(\"open\"), this.#t(\"staticBackdrop\"), this.#t(\"noHeader\"), this.#t(\"noAnimations\"), this.#t(\"noCloseButton\"), this.#t(\"fullscreen\"), this.#t(\"preserveOverflow\"), this.#t(\"placement\"), this.#t(\"closeLabel\"), this.#e?.addEventListener(\"click\", this.#h), this.#e?.addEventListener(\"close\", this.#l), this.#e?.addEventListener(\"cancel\", this.#d), this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#c), this.#i?.addEventListener(\"slotchange\", this.#m), this.#a?.addEventListener(\"slotchange\", this.#g);\n }\n disconnectedCallback() {\n this.#o && clearTimeout(this.#o), this.#e?.addEventListener(\"click\", this.#h), this.#e?.removeEventListener(\"close\", this.#l), this.#e?.removeEventListener(\"cancel\", this.#d), this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#c), this.#i?.removeEventListener(\"slotchange\", this.#m), this.#a?.removeEventListener(\"slotchange\", this.#g);\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(e) {\n this.toggleAttribute(\"open\", !!e);\n }\n get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(e) {\n this.toggleAttribute(\"static-backdrop\", !!e);\n }\n get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(e) {\n this.toggleAttribute(\"no-header\", !!e);\n }\n get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(e) {\n this.toggleAttribute(\"no-animations\", !!e);\n }\n get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(e) {\n this.toggleAttribute(\"no-close-button\", !!e);\n }\n get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(e) {\n this.toggleAttribute(\"fullscreen\", !!e);\n }\n get preserveOverflow() {\n return this.hasAttribute(\"preserve-overflow\");\n }\n set preserveOverflow(e) {\n this.toggleAttribute(\"preserve-overflow\", !!e);\n }\n get placement() {\n return this.getAttribute(\"placement\") || \"center\";\n }\n set placement(e) {\n this.setAttribute(\"placement\", e != null ? e.toString() : e);\n }\n get closeLabel() {\n return this.getAttribute(\"close-label\") || \"Close\";\n }\n set closeLabel(e) {\n this.setAttribute(\"close-label\", e != null ? e.toString() : e);\n }\n #r() {\n if (this.#e === null) return;\n let e = this.#e.querySelector(\".dialog__close\");\n if (e === null) return;\n (this.#a?.assignedElements() || [])?.some((o)=>o.textContent?.replace(/\\s/g, \"\") !== \"\") ? e.removeAttribute(\"aria-label\") : e.setAttribute(\"aria-label\", this.closeLabel);\n }\n #n() {\n this.#o || (this.#e?.classList.add(\"dialog--pulse\"), this.#o = setTimeout(()=>{\n this.#e?.classList.remove(\"dialog--pulse\"), clearTimeout(this.#o), this.#o = void 0;\n }, 300));\n }\n #l = ()=>{\n this.open = !1, this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n })), document.body && !this.preserveOverflow && (document.body.style.overflow = \"\");\n };\n #d = (e)=>{\n let t = this.#s(\"escape-key\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), !this.noAnimations && this.#n());\n };\n #c = (e)=>{\n let t = this.#s(\"close-button\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), !this.noAnimations && this.#n());\n };\n #h = (e)=>{\n let t = e.target, i = e.currentTarget;\n if (t === i) {\n let o = this.#s(\"backdrop-click\");\n this.dispatchEvent(o), o.defaultPrevented || this.staticBackdrop ? !this.noAnimations && this.#n() : this.hide();\n }\n if (t instanceof HTMLElement && t.closest(\"[data-me-close]\") !== null) {\n let o = this.#s(\"external-invoker\");\n this.dispatchEvent(o), o.defaultPrevented ? !this.noAnimations && this.#n() : this.hide();\n }\n };\n #m = ()=>{\n if (this.#e === null) return;\n let e = this.#e.querySelector(\".dialog__footer\");\n if (e === null) return;\n let t = this.#i?.assignedNodes(), i = t ? t.length > 0 : !1;\n e.hidden = !i;\n };\n #g = ()=>{\n this.#r();\n };\n #s(e) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: !0,\n composed: !0,\n cancelable: !0,\n detail: {\n reason: e,\n element: this\n }\n });\n }\n #t(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n show() {\n this.open || (this.open = !0);\n }\n hide() {\n this.open && (this.open = !1);\n }\n static defineCustomElement(e = \"modal-element\") {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, s);\n }\n};\n$d9c5053bade2d3f8$export$32589115725b904b.defineCustomElement();\n\n\nconst $65136e012e05e2d7$export$d726fc97fa83318d = \"experimental\";\nconst $65136e012e05e2d7$export$c263bd68c6f5ce7a = \"No barcode detected\";\nconst $65136e012e05e2d7$export$63e7bed68b07a85c = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\"\n];\n\n\nfunction $dc2f4a51b83babfd$var$_slicedToArray(arr, i) {\n return $dc2f4a51b83babfd$var$_arrayWithHoles(arr) || $dc2f4a51b83babfd$var$_iterableToArrayLimit(arr, i) || $dc2f4a51b83babfd$var$_unsupportedIterableToArray(arr, i) || $dc2f4a51b83babfd$var$_nonIterableRest();\n}\nfunction $dc2f4a51b83babfd$var$_nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction $dc2f4a51b83babfd$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $dc2f4a51b83babfd$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $dc2f4a51b83babfd$var$_arrayLikeToArray(o, minLen);\n}\nfunction $dc2f4a51b83babfd$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $dc2f4a51b83babfd$var$_iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction $dc2f4a51b83babfd$var$_arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction $dc2f4a51b83babfd$export$b327150396135fe7(request) {\n return new Promise(function(resolve, reject) {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = function() {\n return resolve(request.result);\n }; // @ts-ignore - file size hacks\n request.onabort = request.onerror = function() {\n return reject(request.error);\n };\n });\n}\nfunction $dc2f4a51b83babfd$export$f51a9068ac82ea43(dbName, storeName) {\n var request = indexedDB.open(dbName);\n request.onupgradeneeded = function() {\n return request.result.createObjectStore(storeName);\n };\n var dbp = $dc2f4a51b83babfd$export$b327150396135fe7(request);\n return function(txMode, callback) {\n return dbp.then(function(db) {\n return callback(db.transaction(storeName, txMode).objectStore(storeName));\n });\n };\n}\nvar $dc2f4a51b83babfd$var$defaultGetStoreFunc;\nfunction $dc2f4a51b83babfd$var$defaultGetStore() {\n if (!$dc2f4a51b83babfd$var$defaultGetStoreFunc) $dc2f4a51b83babfd$var$defaultGetStoreFunc = $dc2f4a51b83babfd$export$f51a9068ac82ea43(\"keyval-store\", \"keyval\");\n return $dc2f4a51b83babfd$var$defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$3988ae62b71be9a3(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.get(key));\n });\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$adaa4cf7ef1b65be(key, value) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.put(value, key);\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$daa0a5170277c7a8(entries) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n entries.forEach(function(entry) {\n return store.put(entry[1], entry[0]);\n });\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$5df405cccea42673(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n return Promise.all(keys.map(function(key) {\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.get(key));\n }));\n });\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$722fbec263ad908a(key, updater) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n return(// If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise(function(resolve, reject) {\n store.get(key).onsuccess = function() {\n try {\n store.put(updater(this.result), key);\n resolve($dc2f4a51b83babfd$export$b327150396135fe7(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n }));\n });\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$1d2f21e549771e67(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.delete(key);\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$c8aa84257229cac8(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n keys.forEach(function(key) {\n return store.delete(key);\n });\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$42ffd38884aecdac() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.clear();\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\nfunction $dc2f4a51b83babfd$var$eachCursor(store, callback) {\n store.openCursor().onsuccess = function() {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$ed97f33186d4b816() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n if (store.getAllKeys) return $dc2f4a51b83babfd$export$b327150396135fe7(store.getAllKeys());\n var items = [];\n return $dc2f4a51b83babfd$var$eachCursor(store, function(cursor) {\n return items.push(cursor.key);\n }).then(function() {\n return items;\n });\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$68c286be0e7e55b7() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n if (store.getAll) return $dc2f4a51b83babfd$export$b327150396135fe7(store.getAll());\n var items = [];\n return $dc2f4a51b83babfd$var$eachCursor(store, function(cursor) {\n return items.push(cursor.value);\n }).then(function() {\n return items;\n });\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$3e9f948b41964866() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) return Promise.all([\n $dc2f4a51b83babfd$export$b327150396135fe7(store.getAllKeys()),\n $dc2f4a51b83babfd$export$b327150396135fe7(store.getAll())\n ]).then(function(_ref) {\n var _ref2 = $dc2f4a51b83babfd$var$_slicedToArray(_ref, 2), keys = _ref2[0], values = _ref2[1];\n return keys.map(function(key, i) {\n return [\n key,\n values[i]\n ];\n });\n });\n var items = [];\n return customStore(\"readonly\", function(store) {\n return $dc2f4a51b83babfd$var$eachCursor(store, function(cursor) {\n return items.push([\n cursor.key,\n cursor.value\n ]);\n }).then(function() {\n return items;\n });\n });\n });\n}\n\n\nconst $0eb43b201e9f90c7$var$STORAGE_PREFIX = \"barcode-scanner/\";\nconst $0eb43b201e9f90c7$var$SETTINGS_STORAGE_KEY = \"settings\";\nconst $0eb43b201e9f90c7$var$HISTORY_STORAGE_KEY = \"history\";\n/**\n * Gets an item from the storage.\n *\n * @param {string} key - The key to get the item from.\n * @returns {Promise<[ error: any, value: any ]>} The item and an error if occurred.\n */ const $0eb43b201e9f90c7$var$getItem = async (key)=>{\n try {\n return [\n null,\n await (0, $dc2f4a51b83babfd$export$3988ae62b71be9a3)(key)\n ];\n } catch (error) {\n return [\n error,\n void 0\n ];\n }\n};\n/**\n * Sets an item in the storage.\n *\n * @param {string} key - The key to set the item to.\n * @param {any} data - The data to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */ const $0eb43b201e9f90c7$var$setItem = async (key, data)=>{\n try {\n await (0, $dc2f4a51b83babfd$export$adaa4cf7ef1b65be)(key, data);\n return [\n null\n ];\n } catch (error) {\n return [\n error\n ];\n }\n};\nconst $0eb43b201e9f90c7$export$4a647155031ece = async ()=>{\n return $0eb43b201e9f90c7$var$getItem($0eb43b201e9f90c7$var$STORAGE_PREFIX + $0eb43b201e9f90c7$var$SETTINGS_STORAGE_KEY);\n};\nconst $0eb43b201e9f90c7$export$dc86d17a64679bc7 = async (data)=>{\n return $0eb43b201e9f90c7$var$setItem($0eb43b201e9f90c7$var$STORAGE_PREFIX + $0eb43b201e9f90c7$var$SETTINGS_STORAGE_KEY, data);\n};\nconst $0eb43b201e9f90c7$export$f9582a3c130d9538 = async ()=>{\n return $0eb43b201e9f90c7$var$getItem($0eb43b201e9f90c7$var$STORAGE_PREFIX + $0eb43b201e9f90c7$var$HISTORY_STORAGE_KEY);\n};\nconst $0eb43b201e9f90c7$export$96fe1132eb44c325 = async (data)=>{\n return $0eb43b201e9f90c7$var$setItem($0eb43b201e9f90c7$var$STORAGE_PREFIX + $0eb43b201e9f90c7$var$HISTORY_STORAGE_KEY, data);\n};\n\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * 'n' milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {function} fn The function to be executed.\n * @param {Number} [wait=0] Time of delay in milliseconds. It is required if `immediate` is used.\n * @param {Boolean} [immediate=false] If true or any truthy value, triggers the function on the leading edge.\n * @throws {TypeError} If `fn` is not function.\n * @returns {function} A new debounced function.\n * @example\n *\n * const debouncedHandler = debounce(() => {\n * // Do your thing here...\n * }, 250);\n *\n * window.addEventListener('resize', debouncedHandler, false);\n */ const $4481690a5b2e12d6$export$61fc7d43ac8f84b0 = (fn, wait = 0, immediate = false)=>{\n let timerId = null;\n if (typeof fn !== \"function\") throw new TypeError(\"Expected a function for first argument\");\n return (...args)=>{\n clearTimeout(timerId);\n if (immediate && !timerId) fn(...args);\n timerId = setTimeout(()=>{\n timerId = null;\n if (!immediate) fn(...args);\n }, wait);\n };\n};\n\n\n/**\n * Log to console only in development mode.\n *\n * @param {...any} args - Arguments to log\n */ function $6dda9643863448b4$export$bef1f36f5486a6a3(...args) {}\n\n\n/**\n * Check if the dialog element is supported.\n *\n * @returns {boolean} - Returns true if the dialog element is supported.\n */ const $2d4d0eca101a8031$export$c694186e9d94f0 = ()=>{\n return typeof HTMLDialogElement === \"function\";\n};\n\n\n/**\n * Renders the supported formats.\n *\n * @param {Array} formats - Supported barcode formats\n */ function $73d553880699f8aa$export$f6bb24723b821792(formats) {\n if (!Array.isArray(formats) || formats.length === 0) return;\n const supportedFormatsEl = document.getElementById(\"supportedFormats\");\n if (!supportedFormatsEl) return;\n supportedFormatsEl.textContent = `Supported formats: ${formats.join(\", \")}`;\n}\n\n\n\nfunction $32121209e73f30cc$export$fa9e3380e441c420(data) {\n const historyList = document.getElementById(\"historyList\");\n if (!historyList) return;\n const emptyHistoryBtn = document.getElementById(\"emptyHistoryBtn\");\n historyList.replaceChildren();\n if (!Array.isArray(data) || data.length === 0) {\n historyList.innerHTML = \"
  • There are no saved items in history.
  • \";\n emptyHistoryBtn.hidden = true;\n } else {\n emptyHistoryBtn.hidden = false;\n data.forEach((item, index)=>{\n const li = document.createElement(\"li\");\n li.setAttribute(\"data-value\", item);\n let historyItem;\n try {\n new URL(item);\n historyItem = document.createElement(\"a\");\n historyItem.href = item;\n historyItem.setAttribute(\"target\", \"_blank\");\n historyItem.setAttribute(\"rel\", \"noreferrer noopener\");\n } catch {\n historyItem = document.createElement(\"span\");\n }\n historyItem.textContent = item;\n historyItem.setAttribute(\"id\", `historyItem-${index}`);\n const actionsEl = document.createElement(\"div\");\n actionsEl.className = \"history-modal__actions\";\n const copyBtn = document.createElement(\"custom-clipboard-copy\");\n copyBtn.setAttribute(\"id\", `copyHistoryItem-${index}`);\n copyBtn.setAttribute(\"aria-label\", \"Copy to clipboard\");\n copyBtn.setAttribute(\"aria-labelledby\", `copyHistoryItem-${index} historyItem-${index}`);\n copyBtn.setAttribute(\"only-icon\", \"\");\n copyBtn.setAttribute(\"value\", item);\n actionsEl.appendChild(copyBtn);\n const removeBtn = document.createElement(\"button\");\n removeBtn.type = \"button\";\n removeBtn.className = \"history-modal__delete-action\";\n removeBtn.setAttribute(\"data-action\", \"delete\");\n removeBtn.setAttribute(\"id\", `removeHistoryItem-${index}`);\n removeBtn.setAttribute(\"aria-label\", \"Remove from history\");\n removeBtn.setAttribute(\"aria-labelledby\", `removeHistoryItem-${index} historyItem-${index}`);\n removeBtn.innerHTML = /* html */ `\n \n \n \n `;\n actionsEl.appendChild(removeBtn);\n li.appendChild(historyItem);\n li.appendChild(actionsEl);\n historyList.appendChild(li);\n });\n }\n}\nasync function $32121209e73f30cc$export$7a6a9d84993ff4e(item) {\n const [, settings] = await (0, $0eb43b201e9f90c7$export$4a647155031ece)();\n if (!item || !settings?.addToHistory) return;\n const [getHistoryError, history = []] = await (0, $0eb43b201e9f90c7$export$f9582a3c130d9538)();\n if (!getHistoryError && Array.isArray(history) && !history.find((h)=>h === item)) {\n const data = [\n ...history,\n item\n ];\n const [setHistoryError] = await (0, $0eb43b201e9f90c7$export$96fe1132eb44c325)(data);\n if (!setHistoryError) $32121209e73f30cc$export$fa9e3380e441c420(data);\n }\n}\nasync function $32121209e73f30cc$export$3a61248021dae916(item) {\n if (!item) return;\n const [getHistoryError, history = []] = await (0, $0eb43b201e9f90c7$export$f9582a3c130d9538)();\n if (!getHistoryError && Array.isArray(history)) {\n const data = history.filter((el)=>el !== item);\n const [setHistoryError] = await (0, $0eb43b201e9f90c7$export$96fe1132eb44c325)(data);\n if (!setHistoryError) $32121209e73f30cc$export$fa9e3380e441c420(data);\n }\n}\nasync function $32121209e73f30cc$export$9f74b61e5d33cda2() {\n const [setHistoryError] = await (0, $0eb43b201e9f90c7$export$96fe1132eb44c325)([]);\n if (!setHistoryError) $32121209e73f30cc$export$fa9e3380e441c420([]);\n}\n\n\n/**\n * Removes the scanned result from the element where it is shown.\n *\n * @param {HTMLElement} element - The element to remove the result from.\n */ function $c6f06ef952a10e5f$export$ad20350fbdf13c97(element) {\n if (!element) return;\n const scanResultEl = element.querySelector(\"scan-result\");\n scanResultEl?.remove();\n}\nasync function $c6f06ef952a10e5f$export$97c08f0895810b94(element, value) {\n if (!element || !value) return;\n const oldScanResultEl = element.querySelector(\"scan-result\");\n if (oldScanResultEl) oldScanResultEl.setAttribute(\"value\", value);\n else {\n const newScanResultEl = document.createElement(\"scan-result\");\n newScanResultEl.setAttribute(\"value\", value);\n newScanResultEl.setAttribute(\"role\", \"alert\");\n newScanResultEl.setAttribute(\"aria-live\", \"assertive\");\n newScanResultEl.setAttribute(\"aria-atomic\", \"true\");\n element.appendChild(newScanResultEl);\n }\n}\n\n\n\n/**\n * Beep sound using the `AudioContext` interface.\n *\n * @param {Object} options\n * @param {Number} options.duration - Duration in milliseconds\n * @param {Number} options.frequency - Frequency in Hz\n * @param {Number} options.volume - Volume\n * @param {String} options.type - Type of oscillator\n * @param {Function} options.onEnded - Callback function when the sound ends\n */ const $db31dc56898b80b8$export$d6c943e433460aae = (()=>{\n const audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext)();\n if (!audioCtx) return;\n return (options)=>{\n const { duration: duration, frequency: frequency, volume: volume, type: type, onEnded: onEnded } = options;\n const oscillator = audioCtx.createOscillator();\n const gainNode = audioCtx.createGain();\n oscillator.connect(gainNode);\n gainNode.connect(audioCtx.destination);\n if (volume) gainNode.gain.value = volume;\n if (frequency) oscillator.frequency.value = frequency;\n if (type) oscillator.type = type;\n if (typeof onEnded === \"function\") oscillator.onended = onEnded;\n oscillator.start(audioCtx.currentTime);\n oscillator.stop(audioCtx.currentTime + (duration || 500) / 1000);\n };\n})();\n\n\n/**\n * Vibrate the device.\n * If the device does not support vibration, this function will fail silently.\n *\n * @param {Number} [duration=0] - Duration in milliseconds\n */ async function $03fe6bc65045924f$export$3ca8e905da0a0ca8(duration = 0) {\n if (typeof window.navigator.vibrate !== \"function\") return;\n try {\n window.navigator.vibrate(duration);\n } catch {\n // Fail silently...\n }\n}\n\n\nasync function $a6838ab1dc4817e7$export$9b466d13e2031a67(options = {}) {\n const { success: success = true } = options;\n const [, settings] = await (0, $0eb43b201e9f90c7$export$4a647155031ece)();\n if (!settings) return;\n const beepConfig = success ? {\n duration: 200,\n frequency: 860,\n volume: 0.03,\n type: \"square\"\n } : {\n duration: 300,\n frequency: 200,\n volume: 0.05,\n type: \"sawtooth\"\n };\n settings.beep && (0, $db31dc56898b80b8$export$d6c943e433460aae)(beepConfig);\n settings.vibrate && (0, $03fe6bc65045924f$export$3ca8e905da0a0ca8)(success ? 100 : 200);\n}\n\n\n/**\n * Resizes the scan frame to match the video element's dimensions.\n *\n * @param {HTMLVideoElement} videoEl - Video element\n * @param {HTMLElement} scanFrameEl - Scan frame element\n */ function $451e357ed50655d6$export$1404f0e91c73fec(videoEl, scanFrameEl) {\n if (!videoEl || !scanFrameEl) return;\n const rect = videoEl.getBoundingClientRect();\n scanFrameEl.style.cssText = `width: ${rect.width}px; height: ${rect.height}px`;\n}\n\n\n\n\n/**\n * BarcodeReader class to detect barcodes from images or videos.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector\n */ class $8510600959e31c2c$export$f21d9483ebeee00a {\n static async polyfill() {\n if (!(\"BarcodeDetector\" in window)) try {\n await (parcelRequire(\"cw9o9\"));\n (0, $6dda9643863448b4$export$bef1f36f5486a6a3)(\"Using BarcodeDetector polyfill.\");\n } catch {\n throw new Error(\"BarcodeDetector API is not supported by your browser.\");\n }\n else (0, $6dda9643863448b4$export$bef1f36f5486a6a3)(\"Using the native BarcodeDetector API.\");\n }\n /**\n * Get the supported barcode formats.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/getSupportedFormats\n * @returns {Promise>} - Supported barcode formats\n */ static async getSupportedFormats() {\n return await window.BarcodeDetector.getSupportedFormats();\n }\n /**\n * Create a new BarcodeReader instance.\n *\n * @returns {Promise} - New BarcodeReader instance\n */ static async create() {\n const formats = await window.BarcodeDetector.getSupportedFormats();\n return new $8510600959e31c2c$export$f21d9483ebeee00a(formats);\n }\n /**\n * Initialize the BarcodeReader.\n *\n * @returns {Promise<{ barcodeReader: BarcodeReader, barcodeFormats: Array, barcodeReaderError: Error }>} - BarcodeReader instance, supported formats, and error\n */ static async init() {\n try {\n await $8510600959e31c2c$export$f21d9483ebeee00a.polyfill();\n const barcodeReader = await $8510600959e31c2c$export$f21d9483ebeee00a.create();\n const barcodeFormats = await $8510600959e31c2c$export$f21d9483ebeee00a.getSupportedFormats();\n return {\n barcodeReader: barcodeReader,\n barcodeFormats: barcodeFormats,\n barcodeReaderError: null\n };\n } catch (error) {\n return {\n barcodeReader: null,\n barcodeFormats: [],\n barcodeReaderError: error\n };\n }\n }\n /**\n * Create a new BarcodeReader instance.\n *\n * @param {Array} formats - Supported barcode formats\n */ constructor(formats){\n this.barcodeReader = new window.BarcodeDetector({\n formats: formats\n });\n }\n /**\n * Detect barcodes from the provided source.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/detect\n * @param {HTMLImageElement|HTMLVideoElement|ImageBitmap} source - Image or video element or ImageBitmap\n * @returns {Promise} - Barcode detection result\n */ async detect(source) {\n if (!this.barcodeReader) throw new Error(\"BarcodeReader is not initialized.\");\n const results = await this.barcodeReader.detect(source);\n if (Array.isArray(results) && results.length > 0) return results[0];\n else throw new Error(\"Could not detect barcode from provided source.\");\n }\n}\n\n\n\nasync function $6d6ffe9300b4c5f8$export$9d22ef9ff8e481fe(form) {\n const [, settings = {}] = await (0, $0eb43b201e9f90c7$export$4a647155031ece)();\n Object.entries(settings).forEach(([key, value])=>{\n const settingInput = form.querySelector(`[name=\"${key}\"]`);\n if (!settingInput) return;\n settingInput.checked = value;\n });\n}\n\n\n/**\n * Toggles the torch button status.\n * The torch button has two icons, one for on and one for off.\n * This function toggles the visibility of the icons based on the torch state and updates the button title.\n *\n * @param {HTMLButtonElement} buttonEl - The torch button element.\n * @param {boolean} isTorchOn - The torch state.\n */ function $ac0619973d2d242a$export$d1bd0b12fe0d046(options = {}) {\n const defaults = {\n el: document.getElementById(\"torchButton\"),\n isTorchOn: false\n };\n const { el: el, isTorchOn: isTorchOn } = {\n ...defaults,\n ...options\n };\n const iconPaths = el.querySelectorAll(\"svg path\");\n if (iconPaths.length !== 2) return;\n iconPaths[0].style.display = isTorchOn ? \"none\" : \"block\";\n iconPaths[1].style.display = isTorchOn ? \"block\" : \"none\";\n el.setAttribute(\"title\", `Turn ${isTorchOn ? \"off\" : \"on\"} flash`);\n}\n\n\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */ const $f39ac7e49ce95944$export$7d15b64cf5a3a4c4 = (value, lower, upper)=>{\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n\n\nconst $40cc5a5311c08f52$var$COMPONENT_NAME = \"video-capture\";\nconst $40cc5a5311c08f52$var$styles = /* css */ `\n :host { display: block; box-sizing: border-box; }\n :host *, :host *::before, :host *::after { box-sizing: inherit;}\n :host([hidden]), [hidden], ::slotted([hidden]) { display: none; }\n video { display: block; }\n #output:empty { display: none; }\n`;\nconst $40cc5a5311c08f52$var$template = document.createElement(\"template\");\n$40cc5a5311c08f52$var$template.innerHTML = /* html */ `\n \n \n
    \n \n`;\nclass $40cc5a5311c08f52$export$682e9ed90a89bb4a extends HTMLElement {\n #supportedConstraints = {};\n #stream = null;\n #videoElement = null;\n constructor(){\n super();\n this.#supportedConstraints = this.getSupportedConstraints();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($40cc5a5311c08f52$var$template.content.cloneNode(true));\n }\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"pan\",\n \"tilt\",\n \"zoom\",\n \"torch\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n const trackCapabilities = this.getTrackCapabilities();\n if (name === \"zoom\" && oldValue !== newValue && \"zoom\" in this.#supportedConstraints) {\n const zoomInAllowedRange = \"zoom\" in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max : false;\n if (typeof this.zoom === \"number\" && zoomInAllowedRange) this.#applyConstraint(\"zoom\", this.zoom);\n }\n if (name === \"torch\" && oldValue !== newValue && \"torch\" in this.#supportedConstraints) this.#applyConstraint(\"torch\", this.torch);\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ async connectedCallback() {\n this.#upgradeProperty(\"autoPlay\");\n this.#upgradeProperty(\"facingMode\");\n this.#upgradeProperty(\"zoom\");\n this.#upgradeProperty(\"torch\");\n this.#videoElement = this.shadowRoot?.querySelector(\"video\") || null;\n this.#videoElement?.addEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n if (!$40cc5a5311c08f52$export$682e9ed90a89bb4a.isSupported()) return this.dispatchEvent(new CustomEvent(`${$40cc5a5311c08f52$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n if (this.autoPlay) this.startVideoStream();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.stopVideoStream();\n this.#videoElement?.removeEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n }\n get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(value) {\n this.toggleAttribute(\"auto-play\", !!value);\n }\n get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(value) {\n this.setAttribute(\"facing-mode\", value);\n }\n get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(value) {\n this.setAttribute(\"zoom\", value != null ? value.toString() : value);\n }\n get torch() {\n return this.hasAttribute(\"torch\");\n }\n set torch(value) {\n this.toggleAttribute(\"torch\", !!value);\n }\n get loading() {\n return this.hasAttribute(\"loading\");\n }\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {Event} evt - The event object.\n */ #onVideoLoadedMetaData = (evt)=>{\n const video = evt.target;\n video.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$40cc5a5311c08f52$var$COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: {\n video: video\n }\n }));\n }).catch((error)=>{\n this.dispatchEvent(new CustomEvent(`${$40cc5a5311c08f52$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n /**\n * Applies a constraint to the video track.\n *\n * @param {string} constraint - The name of the constraint.\n * @param {any} value - The value of the constraint.\n */ #applyConstraint(constraint, value) {\n if (!this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n const constraintValue = constraint === \"pan\" || constraint === \"tilt\" || constraint === \"zoom\" ? (0, $f39ac7e49ce95944$export$7d15b64cf5a3a4c4)(Number(value), trackCapabilities[constraint]?.min || 1, trackCapabilities[constraint]?.max || 1) : value;\n if (constraint in trackSettings) track.applyConstraints({\n advanced: [\n {\n [constraint]: constraintValue\n }\n ]\n }).catch(()=>{\n // Fail silently...\n });\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n /**\n * Starts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n * @returns Promise\n */ async startVideoStream(videoInputId) {\n if (!$40cc5a5311c08f52$export$682e9ed90a89bb4a.isSupported() || this.#stream) return;\n this.setAttribute(\"loading\", \"\");\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: true,\n tilt: true,\n zoom: true,\n torch: this.torch\n },\n audio: false\n };\n if (typeof videoInputId === \"string\" && videoInputId.trim().length > 0) constraints.video.deviceId = {\n exact: videoInputId\n };\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.#videoElement) this.#videoElement.srcObject = this.#stream;\n this.#applyConstraint(\"pan\", this.pan);\n this.#applyConstraint(\"tilt\", this.tilt);\n this.#applyConstraint(\"zoom\", this.zoom);\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$40cc5a5311c08f52$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n /**\n * Restarts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n */ restartVideoStream(videoInputId) {\n if (this.#stream && this.#videoElement) this.stopVideoStream();\n this.startVideoStream(videoInputId);\n }\n /**\n * Stops the video stream.\n */ stopVideoStream() {\n if (!this.#videoElement || !this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */ getSupportedConstraints() {\n if (!$40cc5a5311c08f52$export$682e9ed90a89bb4a.isSupported()) return {};\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */ getTrackCapabilities() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getCapabilities === \"function\") return track.getCapabilities() || {};\n return {};\n }\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */ getTrackSettings() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getSettings === \"function\") return track.getSettings() || {};\n return {};\n }\n /**\n * Returns the available video input devices.\n *\n * @returns {Promise}\n */ static async getVideoInputDevices() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) return [];\n const devices = await navigator.mediaDevices.enumerateDevices() || [];\n return devices.filter((device)=>device.kind === \"videoinput\" && !!device.deviceId);\n }\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */ static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='video-capture'] - The name of the custom element.\n */ static defineCustomElement(elementName = $40cc5a5311c08f52$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $40cc5a5311c08f52$export$682e9ed90a89bb4a);\n }\n}\n\n\n/*!\n * @georapbox/clipboard-copy-element\n * A custom element that implements the Clipboard API to copy text content from elements or input values to the clipboard.\n *\n * @version 3.0.2\n * @homepage https://github.com/georapbox/clipboard-copy-element#readme\n * @author George Raptis \n * @license MIT\n */ var $449da37d108ee4fe$var$i = \"clipboard-copy\";\nvar $449da37d108ee4fe$var$o = \"success\", $449da37d108ee4fe$var$n = \"error\", $449da37d108ee4fe$var$h = document.createElement(\"template\"), $449da37d108ee4fe$var$a = `\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;\n$449da37d108ee4fe$var$h.innerHTML = `\n \n \n`;\nvar $449da37d108ee4fe$export$ea3b71af1761ff40 = class d extends HTMLElement {\n #e = void 0;\n #t = null;\n #s = null;\n #i = null;\n #o = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($449da37d108ee4fe$var$h.content.cloneNode(!0)), this.shadowRoot && (this.#t = this.shadowRoot.querySelector(\"button\"), this.#s = this.shadowRoot.querySelector('slot[name=\"copy\"]'), this.#i = this.shadowRoot.querySelector('slot[name=\"success\"]'), this.#o = this.shadowRoot.querySelector('slot[name=\"error\"]'));\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, s, e) {\n t === \"disabled\" && s !== e && this.#t && (this.#t.disabled = this.disabled, this.#t.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#t.part.contains(\"button\") && this.#t.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#n(\"value\"), this.#n(\"from\"), this.#n(\"disabled\"), this.#n(\"feedbackDuration\"), this.#t?.addEventListener(\"click\", this.#r);\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"click\", this.#r), this.#a();\n }\n get value() {\n return this.getAttribute(\"value\") || \"\";\n }\n set value(t) {\n this.setAttribute(\"value\", t != null ? t.toString() : t);\n }\n get from() {\n return this.getAttribute(\"from\") || \"\";\n }\n set from(t) {\n this.setAttribute(\"from\", t != null ? t.toString() : t);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get feedbackDuration() {\n return Number(this.getAttribute(\"feedback-duration\")) || 1e3;\n }\n set feedbackDuration(t) {\n this.setAttribute(\"feedback-duration\", t != null ? t.toString() : t);\n }\n async #d() {\n if (!(!this.value && !this.from)) try {\n let t = \"\";\n if (this.value) t = this.value;\n else if (this.from) {\n let s = \"getRootNode\" in Element.prototype ? this.#t?.getRootNode({\n composed: !0\n }) : this.#t?.ownerDocument;\n if (!s || !(s instanceof Document || s instanceof ShadowRoot)) return;\n let e = s.querySelector(this.from);\n if (!e) return;\n e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement ? t = e.value : e instanceof HTMLAnchorElement && e.hasAttribute(\"href\") ? t = e.href : t = e.textContent || \"\";\n }\n await navigator.clipboard.writeText(t), this.#h($449da37d108ee4fe$var$o), this.dispatchEvent(new CustomEvent(`${$449da37d108ee4fe$var$i}-success`, {\n bubbles: !0,\n composed: !0,\n detail: {\n value: t\n }\n }));\n } catch (t) {\n this.#h($449da37d108ee4fe$var$n), this.dispatchEvent(new CustomEvent(`${$449da37d108ee4fe$var$i}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #r = (t)=>{\n t.preventDefault(), !(this.disabled || this.#e) && this.#d();\n };\n #h(t) {\n this.#s && (this.#s.hidden = !0), this.#i && (this.#i.hidden = t !== $449da37d108ee4fe$var$o), this.#o && (this.#o.hidden = t !== $449da37d108ee4fe$var$n), this.#t?.part.remove(\"button--success\"), this.#t?.part.remove(\"button--error\"), this.#t?.part.add(`button--${t}`), this.#e && clearTimeout(this.#e), this.#e = setTimeout(()=>{\n this.#s && (this.#s.hidden = !1), this.#i && (this.#i.hidden = !0), this.#o && (this.#o.hidden = !0), this.#t?.part.remove(`button--${t}`), this.#e = void 0;\n }, this.feedbackDuration);\n }\n #a() {\n this.#e && clearTimeout(this.#e), this.#e = void 0, this.#s && (this.#s.hidden = !1), this.#i && (this.#i.hidden = !0), this.#o && (this.#o.hidden = !0), this.#t?.part.remove(\"button--success\"), this.#t?.part.remove(\"button--error\");\n }\n #n(t) {\n let s = this;\n if (Object.prototype.hasOwnProperty.call(s, t)) {\n let e = s[t];\n delete s[t], s[t] = e;\n }\n }\n static defineCustomElement(t = $449da37d108ee4fe$var$i) {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, d);\n }\n};\n\n\n/**\n * Extends the `ClipboardCopy` element to override the default `copy` and `success` slots,\n * in order to avoid repetition of the same markup throughout the application.\n * It also adds aditional properties and attributes, specific to the application.\n *\n * @class CustomClipboardCopy\n * @extends ClipboardCopy\n */ class $3d31f226494869e5$var$CustomClipboardCopy extends (0, $449da37d108ee4fe$export$ea3b71af1761ff40) {\n constructor(){\n super();\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n copySlot.innerHTML = /* html */ `\n \n \n \n \n Copy\n `;\n successSlot.innerHTML = /* html */ `\n \n \n \n \n \n Copied!\n `;\n }\n static get observedAttributes() {\n return [\n ...super.observedAttributes,\n \"only-icon\"\n ];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name === \"only-icon\" && oldValue !== newValue) {\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n const copyText = copySlot.querySelector(\".text\");\n const successText = successSlot.querySelector(\".text\");\n if (copyText) copyText.hidden = this.onlyIcon;\n if (successText) successText.hidden = this.onlyIcon;\n }\n }\n get onlyIcon() {\n return this.hasAttribute(\"only-icon\");\n }\n set onlyIcon(value) {\n if (value) this.setAttribute(\"only-icon\", \"\");\n else this.removeAttribute(\"only-icon\");\n }\n connectedCallback() {\n super.connectedCallback();\n this.#upgradeProperty(\"onlyIcon\");\n if (!this.hasAttribute(\"feedback-duration\")) this.setAttribute(\"feedback-duration\", \"1500\");\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"custom-clipboard-copy\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $3d31f226494869e5$var$CustomClipboardCopy);\n }\n}\n$3d31f226494869e5$var$CustomClipboardCopy.defineCustomElement();\n\n\n/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */ function $7a2aca835bb05064$export$c37129e465f64ef0(a) {\n return a !== null && typeof a == \"object\" ? \"share\" in navigator && \"canShare\" in navigator && navigator.canShare(a) : \"share\" in navigator;\n}\n\n\n\n\nconst $678371674e4a782c$var$styles = /* css */ `\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n .result {\n position: relative;\n width: 100%;\n border: 1px solid var(--focus);\n border-radius: 6px;\n margin: 1.5rem 0 0 0;\n padding: 1rem;\n background-color: var(--background-alt);\n text-align: center;\n }\n\n .result__item {\n word-wrap: break-word;\n word-break: break-word;\n }\n\n a.result__item {\n color: var(--links);\n text-decoration: none;\n }\n\n a.result__item:hover {\n text-decoration: underline;\n }\n\n .result__item--no-barcode {\n color: var(--error-color);\n }\n\n .result__actions {\n display: flex;\n align-items: center;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .result web-share button,\n .result custom-clipboard-copy::part(button) {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n margin: 0.75rem 0 0 0;\n padding: 0.25rem;\n background-color: transparent;\n border: 0;\n border-radius: var(--border-radius);\n color: inherit;\n line-height: 1;\n font-family: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n`;\nconst $678371674e4a782c$var$template = document.createElement(\"template\");\n$678371674e4a782c$var$template.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n \n \n \n
    \n
    \n`;\nclass $678371674e4a782c$var$ScanResult extends HTMLElement {\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($678371674e4a782c$var$template.content.cloneNode(true));\n }\n }\n get value() {\n return this.getAttribute(\"value\");\n }\n set value(value) {\n this.setAttribute(\"value\", value);\n }\n static get observedAttributes() {\n return [\n \"value\"\n ];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"value\" && oldValue !== newValue) this.#handleValueChange(this.value);\n }\n connectedCallback() {\n this.#upgradeProperty(\"value\");\n if (!(0, $7a2aca835bb05064$export$c37129e465f64ef0)()) {\n const webShareEl = this.shadowRoot.querySelector(\"web-share\");\n if (webShareEl) webShareEl.hidden = true;\n }\n }\n async #handleValueChange(value) {\n const baseEl = this.shadowRoot.querySelector(\".result\");\n const resultActionsEl = baseEl?.querySelector(\".result__actions\");\n const oldResultItem = baseEl?.querySelector(\".result__item\");\n let resultItem;\n if (oldResultItem) oldResultItem.remove();\n try {\n const [, settings] = await (0, $0eb43b201e9f90c7$export$4a647155031ece)();\n new URL(value);\n resultItem = document.createElement(\"a\");\n resultItem.href = value;\n window.requestAnimationFrame(()=>resultItem.focus());\n if (!settings?.openWebPageSameTab) {\n resultItem.setAttribute(\"target\", \"_blank\");\n resultItem.setAttribute(\"rel\", \"noreferrer noopener\");\n }\n if (settings?.openWebPage) resultItem.click();\n } catch {\n resultItem = document.createElement(\"span\");\n }\n resultItem.className = \"result__item\";\n resultItem.classList.toggle(\"result__item--no-barcode\", value === (0, $65136e012e05e2d7$export$c263bd68c6f5ce7a));\n resultItem.textContent = value;\n baseEl?.insertBefore(resultItem, resultActionsEl);\n const isValidValue = value !== (0, $65136e012e05e2d7$export$c263bd68c6f5ce7a);\n const clipboarCopyEl = baseEl?.querySelector(\"custom-clipboard-copy\");\n const webShareEl = baseEl?.querySelector(\"web-share\");\n if (clipboarCopyEl && isValidValue) {\n clipboarCopyEl.setAttribute(\"value\", value);\n clipboarCopyEl.hidden = false;\n } else {\n clipboarCopyEl.hidden = true;\n clipboarCopyEl.removeAttribute(\"value\");\n }\n if (webShareEl && (0, $7a2aca835bb05064$export$c37129e465f64ef0)() && isValidValue) {\n webShareEl.setAttribute(\"share-text\", value);\n webShareEl.hidden = false;\n } else {\n webShareEl.hidden = true;\n webShareEl.removeAttribute(\"share-text\");\n }\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"scan-result\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $678371674e4a782c$var$ScanResult);\n }\n}\n$678371674e4a782c$var$ScanResult.defineCustomElement();\n\n\n(async function() {\n const hasExperimentalFlag = new URLSearchParams(window.location.search).has((0, $65136e012e05e2d7$export$d726fc97fa83318d));\n const tabGroupEl = document.querySelector(\"a-tab-group\");\n const videoCaptureEl = document.querySelector(\"video-capture\");\n const cameraPanel = document.getElementById(\"cameraPanel\");\n const filePanel = document.getElementById(\"filePanel\");\n const scanInstructionsEl = document.getElementById(\"scanInstructions\");\n const scanBtn = document.getElementById(\"scanBtn\");\n const dropzoneEl = document.getElementById(\"dropzone\");\n const resizeObserverEl = document.querySelector(\"resize-observer\");\n const scanFrameEl = document.getElementById(\"scanFrame\");\n const facingModeButton = document.getElementById(\"facingModeButton\");\n const torchButton = document.getElementById(\"torchButton\");\n const globalActionsEl = document.getElementById(\"globalActions\");\n const historyBtn = document.getElementById(\"historyBtn\");\n const historyDialog = document.getElementById(\"historyDialog\");\n const settingsBtn = document.getElementById(\"settingsBtn\");\n const settingsDialog = document.getElementById(\"settingsDialog\");\n const settingsForm = document.forms[\"settings-form\"];\n const cameraSelect = document.getElementById(\"cameraSelect\");\n let shouldScan = true;\n let rafId;\n // By default the dialog elements are hidden for browsers that don't support the dialog element.\n // If the dialog element is supported, we remove the hidden attribute and the dialogs' visibility\n // is controlled by using the `showModal()` and `close()` methods.\n if ((0, $2d4d0eca101a8031$export$c694186e9d94f0)()) {\n globalActionsEl.hidden = false;\n historyDialog.hidden = false;\n settingsDialog.hidden = false;\n }\n const { barcodeReader: barcodeReader, barcodeFormats: barcodeFormats, barcodeReaderError: barcodeReaderError } = await (0, $8510600959e31c2c$export$f21d9483ebeee00a).init();\n if (barcodeReaderError) {\n const alertEl = document.getElementById(\"barcodeReaderError\");\n shouldScan = false;\n globalActionsEl.hidden = true;\n tabGroupEl.hidden = true;\n alertEl.hidden = false;\n alertEl.textContent = barcodeReaderError?.message;\n return; // Stop the script execution as BarcodeDetector API is not supported.\n }\n videoCaptureEl.addEventListener(\"video-capture:video-play\", handleVideoCapturePlay, {\n once: true\n });\n videoCaptureEl.addEventListener(\"video-capture:error\", handleVideoCaptureError, {\n once: true\n });\n (0, $40cc5a5311c08f52$export$682e9ed90a89bb4a).defineCustomElement();\n const videoCaptureVideoEl = videoCaptureEl?.shadowRoot?.querySelector(\"video\");\n dropzoneEl.accept = (0, $65136e012e05e2d7$export$63e7bed68b07a85c).join(\",\");\n (0, $6d6ffe9300b4c5f8$export$9d22ef9ff8e481fe)(settingsForm);\n (0, $73d553880699f8aa$export$f6bb24723b821792)(barcodeFormats);\n (0, $32121209e73f30cc$export$fa9e3380e441c420)((await (0, $0eb43b201e9f90c7$export$f9582a3c130d9538)())[1] || []);\n /**\n * Scans for barcodes.\n * If a barcode is detected, it stops scanning and displays the result.\n *\n * @returns {Promise} - A Promise that resolves when the barcode is detected.\n */ async function scan() {\n (0, $6dda9643863448b4$export$bef1f36f5486a6a3)(\"Scanning...\");\n scanInstructionsEl.hidden = false;\n try {\n const barcode = await barcodeReader.detect(videoCaptureVideoEl);\n const barcodeValue = barcode?.rawValue ?? \"\";\n if (!barcodeValue) throw new Error((0, $65136e012e05e2d7$export$c263bd68c6f5ce7a));\n window.cancelAnimationFrame(rafId);\n (0, $c6f06ef952a10e5f$export$97c08f0895810b94)(cameraPanel, barcodeValue);\n (0, $32121209e73f30cc$export$7a6a9d84993ff4e)(barcodeValue);\n scanInstructionsEl.hidden = true;\n scanBtn.hidden = false;\n scanFrameEl.hidden = true;\n (0, $a6838ab1dc4817e7$export$9b466d13e2031a67)();\n return;\n } catch {\n // If no barcode is detected, the error is caught here.\n // We can ignore the error and continue scanning.\n }\n if (shouldScan) rafId = window.requestAnimationFrame(()=>scan());\n }\n /**\n * Handles the click event on the scan button.\n * It is responsible for clearing previous results and starting the scan process again.\n */ function handleScanButtonClick() {\n scanBtn.hidden = true;\n scanFrameEl.hidden = false;\n (0, $c6f06ef952a10e5f$export$ad20350fbdf13c97)(cameraPanel);\n scan();\n }\n /**\n * Handles the tab show event.\n * It is responsible for starting or stopping the scan process based on the selected tab.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleTabShow(evt) {\n const tabId = evt.detail.tabId;\n const videoCaptureEl = document.querySelector(\"video-capture\"); // Get the latest instance of video-capture element to ensure we don't use the cached one.\n if (tabId === \"cameraTab\") {\n shouldScan = true;\n if (!videoCaptureEl) return;\n if (!videoCaptureEl.loading && !cameraPanel.querySelector(\"scan-result\")) scan();\n if (typeof videoCaptureEl.startVideoStream === \"function\") videoCaptureEl.startVideoStream();\n } else if (tabId === \"fileTab\") {\n shouldScan = false;\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === \"function\") videoCaptureEl.stopVideoStream();\n }\n }\n /**\n * Handles the selection of a file.\n * It is responsible for displaying the selected file in the dropzone.\n *\n * @param {File} file - The selected file.\n */ function handleFileSelect(file) {\n if (!file) return;\n const image = new Image();\n const reader = new FileReader();\n reader.onload = (evt)=>{\n const data = evt.target.result;\n image.onload = async ()=>{\n try {\n const barcode = await barcodeReader.detect(image);\n const barcodeValue = barcode?.rawValue ?? \"\";\n if (!barcodeValue) throw new Error((0, $65136e012e05e2d7$export$c263bd68c6f5ce7a));\n (0, $c6f06ef952a10e5f$export$97c08f0895810b94)(filePanel, barcodeValue);\n (0, $32121209e73f30cc$export$7a6a9d84993ff4e)(barcodeValue);\n (0, $a6838ab1dc4817e7$export$9b466d13e2031a67)();\n } catch (err) {\n (0, $6dda9643863448b4$export$bef1f36f5486a6a3)(err);\n (0, $c6f06ef952a10e5f$export$97c08f0895810b94)(filePanel, (0, $65136e012e05e2d7$export$c263bd68c6f5ce7a));\n (0, $a6838ab1dc4817e7$export$9b466d13e2031a67)({\n success: false\n });\n }\n };\n image.src = data;\n image.alt = \"Image preview\";\n dropzoneEl.replaceChildren();\n const preview = document.createElement(\"div\");\n preview.className = \"dropzone-preview\";\n preview.setAttribute(\"aria-hidden\", \"true\");\n const imageWrapper = document.createElement(\"div\");\n imageWrapper.className = \"dropzone-preview__image-wrapper\";\n const fileNameWrapper = document.createElement(\"div\");\n fileNameWrapper.className = \"dropzone-preview__file-name\";\n fileNameWrapper.textContent = file.name;\n imageWrapper.appendChild(image);\n preview.appendChild(imageWrapper);\n preview.appendChild(fileNameWrapper);\n dropzoneEl.prepend(preview);\n };\n reader.readAsDataURL(file);\n }\n /**\n * Handles the drop event on the dropzone.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleFileDrop(evt) {\n const file = evt.detail.acceptedFiles[0];\n handleFileSelect(file);\n }\n /**\n * Handles the resize event on the video-capture element.\n * It is responsible for resizing the scan frame based on the video element.\n */ function handleVideoCaptureResize() {\n (0, $451e357ed50655d6$export$1404f0e91c73fec)(videoCaptureEl.shadowRoot.querySelector(\"video\"), scanFrameEl);\n }\n /**\n * Handles the video play event on the video-capture element.\n * It is responsible for displaying the scan frame and starting the scan process.\n * It also handles the zoom controls if the browser supports it.\n *\n * @param {CustomEvent} evt - The event object.\n */ async function handleVideoCapturePlay(evt) {\n scanFrameEl.hidden = false;\n (0, $451e357ed50655d6$export$1404f0e91c73fec)(evt.detail.video, scanFrameEl);\n scan();\n const trackSettings = evt.target.getTrackSettings();\n const trackCapabilities = evt.target.getTrackCapabilities();\n const zoomLevelEl = document.getElementById(\"zoomLevel\");\n if (\"facingMode\" in trackSettings) facingModeButton.hidden = false;\n if (trackCapabilities?.torch) {\n torchButton.hidden = false;\n if (videoCaptureEl.hasAttribute(\"torch\")) (0, $ac0619973d2d242a$export$d1bd0b12fe0d046)({\n el: torchButton,\n isTorchOn: true\n });\n }\n if (trackSettings?.zoom && trackCapabilities?.zoom) {\n const zoomControls = document.getElementById(\"zoomControls\");\n const minZoom = trackCapabilities?.zoom?.min || 0;\n const maxZoom = trackCapabilities?.zoom?.max || 10;\n let currentZoom = trackSettings?.zoom || 1;\n zoomControls.hidden = false;\n zoomLevelEl.textContent = currentZoom;\n const handleZoomControlsClick = (evt)=>{\n const zoomInBtn = evt.target.closest('[data-action=\"zoom-in\"]');\n const zoomOutBtn = evt.target.closest('[data-action=\"zoom-out\"]');\n if (zoomInBtn && currentZoom < maxZoom) currentZoom += 0.5;\n if (zoomOutBtn && currentZoom > minZoom) currentZoom -= 0.5;\n zoomLevelEl.textContent = currentZoom;\n videoCaptureEl.zoom = currentZoom;\n };\n zoomControls.addEventListener(\"click\", handleZoomControlsClick);\n }\n if (hasExperimentalFlag) {\n const videoInputDevices = await (0, $40cc5a5311c08f52$export$682e9ed90a89bb4a).getVideoInputDevices();\n videoInputDevices.forEach((device, index)=>{\n const option = document.createElement(\"option\");\n option.value = device.deviceId;\n option.textContent = device.label || `Camera ${index + 1}`;\n cameraSelect.appendChild(option);\n });\n cameraSelect.hidden = false;\n videoInputDevices.length;\n }\n }\n /**\n * Handles the error event on the video-capture element.\n * It is responsible for displaying an error message if the camera cannot be accessed or permission is denied.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleVideoCaptureError(evt) {\n const error = evt.detail.error;\n if (error.name === \"NotFoundError\") // If the browser cannot find all media tracks with the specified types that meet the constraints given.\n return;\n const errorMessage = error.name === \"NotAllowedError\" ? \"Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.\" : error.message;\n cameraPanel.innerHTML = /* html */ `
    ${errorMessage}
    `;\n }\n /**\n * Handles the settings button click event.\n * It is responsible for displaying the settings dialog.\n */ function handleSettingsButtonClick() {\n settingsDialog.open = true;\n }\n /**\n * Handles the change event on the settings form.\n * It is responsible for saving the settings to persistent storage and updating the settings.\n *\n * @param {Event} evt - The event object.\n */ function handleSettingsFormChange(evt) {\n const settings = {};\n const checkboxes = evt.currentTarget.querySelectorAll('input[type=\"checkbox\"]');\n checkboxes.forEach((item)=>settings[item.name] = item.checked);\n (0, $0eb43b201e9f90c7$export$dc86d17a64679bc7)(settings);\n }\n /**\n * Handles the click event on the history button.\n * It is responsible for displaying the history dialog.\n */ function handleHistoryButtonClick() {\n historyDialog.open = true;\n }\n /**\n * Handles the click event on the history dialog.\n * It is responsible for closing the dialog, deleting an item from the history, or emptying the history.\n *\n * @param {MouseEvent} evt - The event object.\n */ function handleHistoryDialogClick(evt) {\n const target = evt.target;\n // Handle delete action\n if (target.closest('[data-action=\"delete\"]')) {\n const value = target.closest(\"li\").dataset.value;\n if (window.confirm(`Delete history item ${value}?`)) {\n (0, $32121209e73f30cc$export$3a61248021dae916)(value);\n return;\n }\n }\n // Handle empty history action\n if (target.closest(\"#emptyHistoryBtn\")) {\n if (window.confirm(\"Empty history? This action cannot be undone.\")) {\n (0, $32121209e73f30cc$export$9f74b61e5d33cda2)();\n return;\n }\n }\n }\n /**\n * Handles the click event on the facing mode button.\n * It is responsible for toggling the camera facing mode.\n */ function handleFacingModeButtonClick() {\n const facingMode = videoCaptureEl.facingMode === \"user\" ? \"environment\" : \"user\";\n videoCaptureEl.facingMode = facingMode;\n if (typeof videoCaptureEl.restartVideoStream === \"function\") videoCaptureEl.restartVideoStream(cameraSelect?.value || undefined);\n }\n /**\n * Handles the click event on the torch button.\n * It is responsible for toggling the torch on and off.\n *\n * @param {MouseEvent} evt - The event object.\n */ function handleTorchButtonClick(evt) {\n videoCaptureEl.torch = !videoCaptureEl.torch;\n (0, $ac0619973d2d242a$export$d1bd0b12fe0d046)({\n el: evt.currentTarget,\n isTorchOn: videoCaptureEl.hasAttribute(\"torch\")\n });\n }\n /**\n * Handles the change event on the camera select element.\n * It is responsible for restarting the video stream with the selected video input device id.\n *\n * @param {Event} evt - The event object.\n */ function handleCameraSelectChange(evt) {\n const videoDeviceId = evt.target.value || undefined;\n if (typeof videoCaptureEl.restartVideoStream === \"function\") videoCaptureEl.restartVideoStream(videoDeviceId);\n }\n /**\n * Handles the visibility change event on the document.\n * It is responsible for stopping the scan process when the document is not visible.\n */ function handleDocumentVisibilityChange() {\n const selectedTab = tabGroupEl.querySelector(\"[selected]\");\n const tabId = selectedTab.getAttribute(\"id\");\n if (tabId !== \"cameraTab\") return;\n if (document.visibilityState === \"hidden\") {\n shouldScan = false;\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === \"function\") videoCaptureEl.stopVideoStream();\n } else {\n shouldScan = true;\n // Get the latest instance of video-capture element to ensure we don't use the cached one.\n const videoCaptureEl = document.querySelector(\"video-capture\");\n if (!videoCaptureEl) return;\n if (!videoCaptureEl.loading && !cameraPanel.querySelector(\"scan-result\")) scan();\n if (typeof videoCaptureEl.startVideoStream === \"function\") videoCaptureEl.startVideoStream();\n }\n }\n /**\n * Handles the escape key press event on the document.\n * It is responsible for triggering the scan button click event if there is already a barcode detected.\n */ function handleDocumentEscapeKey() {\n const cameraTabSelected = tabGroupEl.querySelector(\"#cameraTab\").hasAttribute(\"selected\");\n const scanBtnVisible = !scanBtn.hidden;\n const settingsDialogOpen = settingsDialog.hasAttribute(\"open\");\n const historyDialogOpen = historyDialog.hasAttribute(\"open\");\n const anyDialogOpen = settingsDialogOpen || historyDialogOpen;\n if (!scanBtnVisible || !cameraTabSelected || anyDialogOpen) return;\n scanBtn.click();\n }\n /**\n * Handles the key down event on the document.\n */ function handleDocumentKeyDown(evt) {\n if (evt.key === \"Escape\") handleDocumentEscapeKey();\n }\n scanBtn.addEventListener(\"click\", handleScanButtonClick);\n tabGroupEl.addEventListener(\"a-tab-show\", (0, $4481690a5b2e12d6$export$61fc7d43ac8f84b0)(handleTabShow, 250));\n dropzoneEl.addEventListener(\"files-dropzone-drop\", handleFileDrop);\n resizeObserverEl.addEventListener(\"resize-observer:resize\", handleVideoCaptureResize);\n settingsBtn.addEventListener(\"click\", handleSettingsButtonClick);\n settingsForm.addEventListener(\"change\", handleSettingsFormChange);\n historyBtn.addEventListener(\"click\", handleHistoryButtonClick);\n historyDialog.addEventListener(\"click\", handleHistoryDialogClick);\n facingModeButton.addEventListener(\"click\", handleFacingModeButtonClick);\n torchButton.addEventListener(\"click\", handleTorchButtonClick);\n hasExperimentalFlag && cameraSelect.addEventListener(\"change\", handleCameraSelectChange);\n document.addEventListener(\"visibilitychange\", handleDocumentVisibilityChange);\n document.addEventListener(\"keydown\", handleDocumentKeyDown);\n})();\n\n\n//# sourceMappingURL=index.0a6e9ff0.js.map\n","let load = require('./helpers/browser/esm-js-loader');\nmodule.exports = (load(\"6z40I\")).then(() => parcelRequire('aexh3'));","\"use strict\";\n\nfunction load(id) {\n // eslint-disable-next-line no-undef\n return __parcel__import__(require('../bundle-manifest').resolve(id));\n}\nmodule.exports = load;","import '@georapbox/a-tab-group/dist/a-tab-group.js';\nimport '@georapbox/web-share-element/dist/web-share-defined.js';\nimport '@georapbox/files-dropzone-element/dist/files-dropzone-defined.js';\nimport '@georapbox/resize-observer-element/dist/resize-observer-defined.js';\nimport '@georapbox/modal-element/dist/modal-element-defined.js';\nimport { EXPERIMENTAL_FLAG, NO_BARCODE_DETECTED, ACCEPTED_MIME_TYPES } from './constants.js';\nimport { getHistory, setSettings } from './services/storage.js';\nimport { debounce } from './utils/debounce.js';\nimport { log } from './utils/log.js';\nimport { isDialogElementSupported } from './utils/isDialogElementSupported.js';\nimport { renderSupportedFormats } from './helpers/renderSupportedFormats.js';\nimport {\n addToHistory,\n removeFromHistory,\n emptyHistory,\n renderHistoryList\n} from './helpers/history.js';\nimport { hideResult, showResult } from './helpers/results.js';\nimport { triggerScanEffects } from './helpers/triggerScanEffects.js';\nimport { resizeScanFrame } from './helpers/resizeScanFrame.js';\nimport { BarcodeReader } from './helpers/BarcodeReader.js';\nimport { initializeSettingsForm } from './helpers/initializeSettingsForm.js';\nimport { toggleTorchButtonStatus } from './helpers/toggleTorchButtonStatus.js';\nimport { VideoCapture } from './components/video-capture.js';\nimport './components/clipboard-copy.js';\nimport './components/scan-result.js';\n\n(async function () {\n const hasExperimentalFlag = new URLSearchParams(window.location.search).has(EXPERIMENTAL_FLAG);\n const tabGroupEl = document.querySelector('a-tab-group');\n const videoCaptureEl = document.querySelector('video-capture');\n const cameraPanel = document.getElementById('cameraPanel');\n const filePanel = document.getElementById('filePanel');\n const scanInstructionsEl = document.getElementById('scanInstructions');\n const scanBtn = document.getElementById('scanBtn');\n const dropzoneEl = document.getElementById('dropzone');\n const resizeObserverEl = document.querySelector('resize-observer');\n const scanFrameEl = document.getElementById('scanFrame');\n const facingModeButton = document.getElementById('facingModeButton');\n const torchButton = document.getElementById('torchButton');\n const globalActionsEl = document.getElementById('globalActions');\n const historyBtn = document.getElementById('historyBtn');\n const historyDialog = document.getElementById('historyDialog');\n const settingsBtn = document.getElementById('settingsBtn');\n const settingsDialog = document.getElementById('settingsDialog');\n const settingsForm = document.forms['settings-form'];\n const cameraSelect = document.getElementById('cameraSelect');\n let shouldScan = true;\n let rafId;\n\n // By default the dialog elements are hidden for browsers that don't support the dialog element.\n // If the dialog element is supported, we remove the hidden attribute and the dialogs' visibility\n // is controlled by using the `showModal()` and `close()` methods.\n if (isDialogElementSupported()) {\n globalActionsEl.hidden = false;\n historyDialog.hidden = false;\n settingsDialog.hidden = false;\n }\n\n const { barcodeReader, barcodeFormats, barcodeReaderError } = await BarcodeReader.init();\n\n if (barcodeReaderError) {\n const alertEl = document.getElementById('barcodeReaderError');\n\n shouldScan = false;\n globalActionsEl.hidden = true;\n tabGroupEl.hidden = true;\n alertEl.hidden = false;\n alertEl.textContent = barcodeReaderError?.message;\n return; // Stop the script execution as BarcodeDetector API is not supported.\n }\n\n videoCaptureEl.addEventListener('video-capture:video-play', handleVideoCapturePlay, {\n once: true\n });\n\n videoCaptureEl.addEventListener('video-capture:error', handleVideoCaptureError, {\n once: true\n });\n\n VideoCapture.defineCustomElement();\n\n const videoCaptureVideoEl = videoCaptureEl?.shadowRoot?.querySelector('video');\n\n dropzoneEl.accept = ACCEPTED_MIME_TYPES.join(',');\n initializeSettingsForm(settingsForm);\n renderSupportedFormats(barcodeFormats);\n renderHistoryList((await getHistory())[1] || []);\n\n /**\n * Scans for barcodes.\n * If a barcode is detected, it stops scanning and displays the result.\n *\n * @returns {Promise} - A Promise that resolves when the barcode is detected.\n */\n async function scan() {\n log('Scanning...');\n\n scanInstructionsEl.hidden = false;\n\n try {\n const barcode = await barcodeReader.detect(videoCaptureVideoEl);\n const barcodeValue = barcode?.rawValue ?? '';\n\n if (!barcodeValue) {\n throw new Error(NO_BARCODE_DETECTED);\n }\n\n window.cancelAnimationFrame(rafId);\n showResult(cameraPanel, barcodeValue);\n addToHistory(barcodeValue);\n scanInstructionsEl.hidden = true;\n scanBtn.hidden = false;\n scanFrameEl.hidden = true;\n triggerScanEffects();\n return;\n } catch {\n // If no barcode is detected, the error is caught here.\n // We can ignore the error and continue scanning.\n }\n\n if (shouldScan) {\n rafId = window.requestAnimationFrame(() => scan());\n }\n }\n\n /**\n * Handles the click event on the scan button.\n * It is responsible for clearing previous results and starting the scan process again.\n */\n function handleScanButtonClick() {\n scanBtn.hidden = true;\n scanFrameEl.hidden = false;\n hideResult(cameraPanel);\n scan();\n }\n\n /**\n * Handles the tab show event.\n * It is responsible for starting or stopping the scan process based on the selected tab.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleTabShow(evt) {\n const tabId = evt.detail.tabId;\n const videoCaptureEl = document.querySelector('video-capture'); // Get the latest instance of video-capture element to ensure we don't use the cached one.\n\n if (tabId === 'cameraTab') {\n shouldScan = true;\n\n if (!videoCaptureEl) {\n return;\n }\n\n if (!videoCaptureEl.loading && !cameraPanel.querySelector('scan-result')) {\n scan();\n }\n\n if (typeof videoCaptureEl.startVideoStream === 'function') {\n videoCaptureEl.startVideoStream();\n }\n } else if (tabId === 'fileTab') {\n shouldScan = false;\n\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === 'function') {\n videoCaptureEl.stopVideoStream();\n }\n }\n }\n\n /**\n * Handles the selection of a file.\n * It is responsible for displaying the selected file in the dropzone.\n *\n * @param {File} file - The selected file.\n */\n function handleFileSelect(file) {\n if (!file) {\n return;\n }\n\n const image = new Image();\n const reader = new FileReader();\n\n reader.onload = evt => {\n const data = evt.target.result;\n\n image.onload = async () => {\n try {\n const barcode = await barcodeReader.detect(image);\n const barcodeValue = barcode?.rawValue ?? '';\n\n if (!barcodeValue) {\n throw new Error(NO_BARCODE_DETECTED);\n }\n\n showResult(filePanel, barcodeValue);\n addToHistory(barcodeValue);\n triggerScanEffects();\n } catch (err) {\n log(err);\n showResult(filePanel, NO_BARCODE_DETECTED);\n triggerScanEffects({ success: false });\n }\n };\n\n image.src = data;\n image.alt = 'Image preview';\n\n dropzoneEl.replaceChildren();\n\n const preview = document.createElement('div');\n preview.className = 'dropzone-preview';\n preview.setAttribute('aria-hidden', 'true');\n\n const imageWrapper = document.createElement('div');\n imageWrapper.className = 'dropzone-preview__image-wrapper';\n\n const fileNameWrapper = document.createElement('div');\n fileNameWrapper.className = 'dropzone-preview__file-name';\n fileNameWrapper.textContent = file.name;\n\n imageWrapper.appendChild(image);\n preview.appendChild(imageWrapper);\n preview.appendChild(fileNameWrapper);\n dropzoneEl.prepend(preview);\n };\n\n reader.readAsDataURL(file);\n }\n\n /**\n * Handles the drop event on the dropzone.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleFileDrop(evt) {\n const file = evt.detail.acceptedFiles[0];\n handleFileSelect(file);\n }\n\n /**\n * Handles the resize event on the video-capture element.\n * It is responsible for resizing the scan frame based on the video element.\n */\n function handleVideoCaptureResize() {\n resizeScanFrame(videoCaptureEl.shadowRoot.querySelector('video'), scanFrameEl);\n }\n\n /**\n * Handles the video play event on the video-capture element.\n * It is responsible for displaying the scan frame and starting the scan process.\n * It also handles the zoom controls if the browser supports it.\n *\n * @param {CustomEvent} evt - The event object.\n */\n async function handleVideoCapturePlay(evt) {\n scanFrameEl.hidden = false;\n resizeScanFrame(evt.detail.video, scanFrameEl);\n scan();\n\n const trackSettings = evt.target.getTrackSettings();\n const trackCapabilities = evt.target.getTrackCapabilities();\n const zoomLevelEl = document.getElementById('zoomLevel');\n\n if ('facingMode' in trackSettings) {\n facingModeButton.hidden = false;\n }\n\n if (trackCapabilities?.torch) {\n torchButton.hidden = false;\n\n if (videoCaptureEl.hasAttribute('torch')) {\n toggleTorchButtonStatus({ el: torchButton, isTorchOn: true });\n }\n }\n\n if (trackSettings?.zoom && trackCapabilities?.zoom) {\n const zoomControls = document.getElementById('zoomControls');\n const minZoom = trackCapabilities?.zoom?.min || 0;\n const maxZoom = trackCapabilities?.zoom?.max || 10;\n let currentZoom = trackSettings?.zoom || 1;\n\n zoomControls.hidden = false;\n zoomLevelEl.textContent = currentZoom;\n\n const handleZoomControlsClick = evt => {\n const zoomInBtn = evt.target.closest('[data-action=\"zoom-in\"]');\n const zoomOutBtn = evt.target.closest('[data-action=\"zoom-out\"]');\n\n if (zoomInBtn && currentZoom < maxZoom) {\n currentZoom += 0.5;\n }\n\n if (zoomOutBtn && currentZoom > minZoom) {\n currentZoom -= 0.5;\n }\n\n zoomLevelEl.textContent = currentZoom;\n videoCaptureEl.zoom = currentZoom;\n };\n\n zoomControls.addEventListener('click', handleZoomControlsClick);\n }\n\n if (hasExperimentalFlag) {\n const videoInputDevices = await VideoCapture.getVideoInputDevices();\n\n videoInputDevices.forEach((device, index) => {\n const option = document.createElement('option');\n option.value = device.deviceId;\n option.textContent = device.label || `Camera ${index + 1}`;\n cameraSelect.appendChild(option);\n });\n\n cameraSelect.hidden = false;\n if (videoInputDevices.length > 1) {\n }\n }\n }\n\n /**\n * Handles the error event on the video-capture element.\n * It is responsible for displaying an error message if the camera cannot be accessed or permission is denied.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleVideoCaptureError(evt) {\n const error = evt.detail.error;\n\n if (error.name === 'NotFoundError') {\n // If the browser cannot find all media tracks with the specified types that meet the constraints given.\n return;\n }\n\n const errorMessage =\n error.name === 'NotAllowedError'\n ? 'Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.'\n : error.message;\n\n cameraPanel.innerHTML = /* html */ `
    ${errorMessage}
    `;\n }\n\n /**\n * Handles the settings button click event.\n * It is responsible for displaying the settings dialog.\n */\n function handleSettingsButtonClick() {\n settingsDialog.open = true;\n }\n\n /**\n * Handles the change event on the settings form.\n * It is responsible for saving the settings to persistent storage and updating the settings.\n *\n * @param {Event} evt - The event object.\n */\n function handleSettingsFormChange(evt) {\n const settings = {};\n const checkboxes = evt.currentTarget.querySelectorAll('input[type=\"checkbox\"]');\n\n checkboxes.forEach(item => (settings[item.name] = item.checked));\n setSettings(settings);\n }\n\n /**\n * Handles the click event on the history button.\n * It is responsible for displaying the history dialog.\n */\n function handleHistoryButtonClick() {\n historyDialog.open = true;\n }\n\n /**\n * Handles the click event on the history dialog.\n * It is responsible for closing the dialog, deleting an item from the history, or emptying the history.\n *\n * @param {MouseEvent} evt - The event object.\n */\n function handleHistoryDialogClick(evt) {\n const target = evt.target;\n\n // Handle delete action\n if (target.closest('[data-action=\"delete\"]')) {\n const value = target.closest('li').dataset.value;\n\n if (window.confirm(`Delete history item ${value}?`)) {\n removeFromHistory(value);\n return;\n }\n }\n\n // Handle empty history action\n if (target.closest('#emptyHistoryBtn')) {\n if (window.confirm('Empty history? This action cannot be undone.')) {\n emptyHistory();\n return;\n }\n }\n }\n\n /**\n * Handles the click event on the facing mode button.\n * It is responsible for toggling the camera facing mode.\n */\n function handleFacingModeButtonClick() {\n const facingMode = videoCaptureEl.facingMode === 'user' ? 'environment' : 'user';\n\n videoCaptureEl.facingMode = facingMode;\n\n if (typeof videoCaptureEl.restartVideoStream === 'function') {\n videoCaptureEl.restartVideoStream(cameraSelect?.value || undefined);\n }\n }\n\n /**\n * Handles the click event on the torch button.\n * It is responsible for toggling the torch on and off.\n *\n * @param {MouseEvent} evt - The event object.\n */\n function handleTorchButtonClick(evt) {\n videoCaptureEl.torch = !videoCaptureEl.torch;\n\n toggleTorchButtonStatus({\n el: evt.currentTarget,\n isTorchOn: videoCaptureEl.hasAttribute('torch')\n });\n }\n\n /**\n * Handles the change event on the camera select element.\n * It is responsible for restarting the video stream with the selected video input device id.\n *\n * @param {Event} evt - The event object.\n */\n function handleCameraSelectChange(evt) {\n const videoDeviceId = evt.target.value || undefined;\n\n if (typeof videoCaptureEl.restartVideoStream === 'function') {\n videoCaptureEl.restartVideoStream(videoDeviceId);\n }\n }\n\n /**\n * Handles the visibility change event on the document.\n * It is responsible for stopping the scan process when the document is not visible.\n */\n function handleDocumentVisibilityChange() {\n const selectedTab = tabGroupEl.querySelector('[selected]');\n const tabId = selectedTab.getAttribute('id');\n\n if (tabId !== 'cameraTab') {\n return;\n }\n\n if (document.visibilityState === 'hidden') {\n shouldScan = false;\n\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === 'function') {\n videoCaptureEl.stopVideoStream();\n }\n } else {\n shouldScan = true;\n\n // Get the latest instance of video-capture element to ensure we don't use the cached one.\n const videoCaptureEl = document.querySelector('video-capture');\n\n if (!videoCaptureEl) {\n return;\n }\n\n if (!videoCaptureEl.loading && !cameraPanel.querySelector('scan-result')) {\n scan();\n }\n\n if (typeof videoCaptureEl.startVideoStream === 'function') {\n videoCaptureEl.startVideoStream();\n }\n }\n }\n\n /**\n * Handles the escape key press event on the document.\n * It is responsible for triggering the scan button click event if there is already a barcode detected.\n */\n function handleDocumentEscapeKey() {\n const cameraTabSelected = tabGroupEl.querySelector('#cameraTab').hasAttribute('selected');\n const scanBtnVisible = !scanBtn.hidden;\n const settingsDialogOpen = settingsDialog.hasAttribute('open');\n const historyDialogOpen = historyDialog.hasAttribute('open');\n const anyDialogOpen = settingsDialogOpen || historyDialogOpen;\n\n if (!scanBtnVisible || !cameraTabSelected || anyDialogOpen) {\n return;\n }\n\n scanBtn.click();\n }\n\n /**\n * Handles the key down event on the document.\n */\n function handleDocumentKeyDown(evt) {\n if (evt.key === 'Escape') {\n handleDocumentEscapeKey();\n }\n }\n\n scanBtn.addEventListener('click', handleScanButtonClick);\n tabGroupEl.addEventListener('a-tab-show', debounce(handleTabShow, 250));\n dropzoneEl.addEventListener('files-dropzone-drop', handleFileDrop);\n resizeObserverEl.addEventListener('resize-observer:resize', handleVideoCaptureResize);\n settingsBtn.addEventListener('click', handleSettingsButtonClick);\n settingsForm.addEventListener('change', handleSettingsFormChange);\n historyBtn.addEventListener('click', handleHistoryButtonClick);\n historyDialog.addEventListener('click', handleHistoryDialogClick);\n facingModeButton.addEventListener('click', handleFacingModeButtonClick);\n torchButton.addEventListener('click', handleTorchButtonClick);\n hasExperimentalFlag && cameraSelect.addEventListener('change', handleCameraSelectChange);\n document.addEventListener('visibilitychange', handleDocumentVisibilityChange);\n document.addEventListener('keydown', handleDocumentKeyDown);\n})();\n","/*!\n * @georapbox/a-tab-group\n * A custom element to create a group of tabs and tab panels.\n *\n * @version 2.4.1\n * @homepage https://github.com/georapbox/a-tab-group#readme\n * @author George Raptis \n * @license MIT\n */\nvar h=(a=\"\",t=\"\")=>{let e=typeof a==\"string\"&&a!==\"\"?a+\"-\":\"\",s=typeof t==\"string\"&&t!==\"\"?\"-\"+t:\"\",i=Math.random().toString(36).substring(2,8);return`${e}${i}${s}`};var b=(a,t)=>{if(Object.prototype.hasOwnProperty.call(t,a)){let e=t[a];delete t[a],t[a]=e}};var E=0,C=`\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`,w=document.createElement(\"template\");w.innerHTML=`\n \n\n
    \n \n
    \n`;var u=class a extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(w.content.cloneNode(!0))}static get observedAttributes(){return[\"selected\",\"disabled\",\"closable\"]}attributeChangedCallback(t,e,s){if(t===\"selected\"&&e!==s&&(this.setAttribute(\"aria-selected\",this.selected.toString()),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")),t===\"disabled\"&&e!==s&&(this.setAttribute(\"aria-disabled\",this.disabled.toString()),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")),t===\"closable\"&&e!==s)if(this.closable){let i=document.createElement(\"span\");i.className=\"tab__close\",i.setAttribute(\"part\",\"close-tab\"),i.innerHTML='',this.shadowRoot?.querySelector(\".tab\")?.appendChild(i),i.addEventListener(\"click\",this.#e)}else{let i=this.shadowRoot?.querySelector(\".tab__close\");i?.removeEventListener(\"click\",this.#e),i?.remove()}}connectedCallback(){this.#s(\"selected\"),this.#s(\"disabled\"),this.#s(\"closable\"),this.id||(this.id=h(\"tab\",(++E).toString())),this.setAttribute(\"slot\",\"tab\"),this.setAttribute(\"role\",\"tab\"),this.setAttribute(\"aria-selected\",\"false\"),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")}disconnectedCallback(){this.shadowRoot?.querySelector(\".tab__close\")?.removeEventListener(\"click\",this.#e)}get selected(){return this.hasAttribute(\"selected\")}set selected(t){this.toggleAttribute(\"selected\",!!t)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get closable(){return this.hasAttribute(\"closable\")}set closable(t){this.toggleAttribute(\"closable\",!!t)}#e=t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent(\"a-tab-close\",{bubbles:!0,composed:!0,detail:{tabId:this.id}}))};#s(t){return b(t,this)}static defineCustomElement(t=\"a-tab\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};u.defineCustomElement();var L=0,S=`\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`,T=document.createElement(\"template\");T.innerHTML=`\n \n\n
    \n \n
    \n`;var p=class a extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(T.content.cloneNode(!0))}connectedCallback(){this.setAttribute(\"slot\",\"panel\"),this.setAttribute(\"role\",\"tabpanel\"),this.setAttribute(\"hidden\",\"\"),this.id||(this.id=h(\"panel\",(++L).toString()))}static defineCustomElement(t=\"a-tab-panel\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};p.defineCustomElement();var y=200,n={TOP:\"top\",BOTTOM:\"bottom\",START:\"start\",END:\"end\"},l={LTR:\"ltr\",RTL:\"rtl\"},R=Object.entries(n).map(([,a])=>a),r={AUTO:\"auto\",MANUAL:\"manual\"},c={DOWN:\"ArrowDown\",LEFT:\"ArrowLeft\",RIGHT:\"ArrowRight\",UP:\"ArrowUp\",HOME:\"Home\",END:\"End\",ENTER:\"Enter\",SPACE:\" \"},x=`\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${l.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${l.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${l.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${l.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${n.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${n.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${n.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${n.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${n.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${n.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${n.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`,A=document.createElement(\"template\");A.innerHTML=`\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;var f=class a extends HTMLElement{#e=null;#s=null;#l=!1;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(A.content.cloneNode(!0))}static get observedAttributes(){return[\"placement\",\"no-scroll-controls\"]}attributeChangedCallback(t,e,s){t===\"placement\"&&e!==s&&this.#i(),t===\"no-scroll-controls\"&&e!==s&&this.#i()}get placement(){return this.getAttribute(\"placement\")||n.TOP}set placement(t){t!=null&&this.setAttribute(\"placement\",t)}get noScrollControls(){return this.hasAttribute(\"no-scroll-controls\")}set noScrollControls(t){this.toggleAttribute(\"no-scroll-controls\",!!t)}get scrollDistance(){let t=Number(this.getAttribute(\"scroll-distance\"));return Math.abs(t)||y}set scrollDistance(t){this.setAttribute(\"scroll-distance\",Math.abs(t).toString()||y.toString())}get activation(){return this.getAttribute(\"activation\")||r.AUTO}set activation(t){this.setAttribute(\"activation\",t||r.AUTO)}get noTabCycling(){return this.hasAttribute(\"no-tab-cycling\")}set noTabCycling(t){this.toggleAttribute(\"no-tab-cycling\",!!t)}connectedCallback(){this.#o(\"placement\"),this.#o(\"noScrollControls\"),this.#o(\"scrollDistance\"),this.#o(\"activation\"),this.#o(\"noTabCycling\");let t=this.shadowRoot?.querySelector(\"slot[name=tab]\"),e=this.shadowRoot?.querySelector(\"slot[name=panel]\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\"),i=this.shadowRoot?.querySelector(\".tab-group__nav\"),o=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);t?.addEventListener(\"slotchange\",this.#n),e?.addEventListener(\"slotchange\",this.#n),s?.addEventListener(\"click\",this.#g),s?.addEventListener(\"keydown\",this.#p),o.forEach(d=>d.addEventListener(\"click\",this.#f)),this.addEventListener(\"a-tab-close\",this.#m),\"ResizeObserver\"in window&&(this.#e=new ResizeObserver(d=>{this.#s=window.requestAnimationFrame(()=>{let v=d?.[0]?.target,g=v?.scrollWidth>v?.clientWidth;o.forEach(_=>_.toggleAttribute(\"hidden\",!g)),i?.part.toggle(\"nav--has-scroll-controls\",g),i?.classList.toggle(\"tab-group__nav--has-scroll-controls\",g)})})),this.#h(),this.#i()}disconnectedCallback(){let t=this.shadowRoot?.querySelector(\"slot[name=tab]\"),e=this.shadowRoot?.querySelector(\"slot[name=panel]\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\"),i=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);t?.removeEventListener(\"slotchange\",this.#n),e?.removeEventListener(\"slotchange\",this.#n),s?.removeEventListener(\"click\",this.#g),s?.removeEventListener(\"keydown\",this.#p),i.forEach(o=>o.removeEventListener(\"click\",this.#f)),this.removeEventListener(\"a-tab-close\",this.#m),this.#c()}#v(){if(!this.#e)return;let t=this.shadowRoot?.querySelector(\".tab-group__tabs\");t&&(this.#e.unobserve(t),this.#e.observe(t))}#c(){this.#e&&(this.#e.disconnect(),this.#s!==null&&(window.cancelAnimationFrame(this.#s),this.#s=null))}#d(){return window.CSS.supports(\"selector(:dir(ltr))\")?this.matches(\":dir(ltr)\")?l.LTR:l.RTL:window.getComputedStyle(this).direction||l.LTR}#h(){this.hidden=this.#t().length===0}#w(){let t=this.#t();this.#h(),t.forEach(e=>{let s=e.nextElementSibling;if(!s||s.tagName.toLowerCase()!==\"a-tab-panel\")return console.error(`Tab #${e.id} is not a sibling of a `);e.setAttribute(\"aria-controls\",s.id),s.setAttribute(\"aria-labelledby\",e.id)})}#T(){return Array.from(this.querySelectorAll(\"a-tab-panel\"))}#t(){return Array.from(this.querySelectorAll(\"a-tab\"))}#b(t){let e=t.getAttribute(\"aria-controls\");return this.querySelector(`#${e}`)}#y(){return this.#t().find(e=>!e.disabled)||null}#A(){let t=this.#t();for(let e=t.length-1;e>=0;e--)if(!t[e].disabled)return t[e];return null}#a(){let t=this.#t(),e=this.activation===r.MANUAL?t.findIndex(s=>s.matches(\":focus\"))-1:t.findIndex(s=>s.selected)-1;for(;t[(e+t.length)%t.length].disabled;)e--;return this.noTabCycling&&e<0?null:t[(e+t.length)%t.length]}#r(){let t=this.#t(),e=this.activation===r.MANUAL?t.findIndex(s=>s.matches(\":focus\"))+1:t.findIndex(s=>s.selected)+1;for(;t[e%t.length].disabled;)e++;return this.noTabCycling&&e>=t.length?null:t[e%t.length]}#_(){let t=this.#t(),e=this.#T();t.forEach(s=>s.selected=!1),e.forEach(s=>s.hidden=!0)}#i(){let t=this.shadowRoot?.querySelector(\".tab-group__nav\"),e=this.shadowRoot?.querySelector(\".tab-group__tabs\"),s=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);this.noScrollControls||this.placement===n.START||this.placement===n.END?(this.#c(),s.forEach(i=>i.hidden=!0),t?.part.remove(\"nav--has-scroll-controls\"),t?.classList.remove(\"tab-group__nav--has-scroll-controls\"),e?.setAttribute(\"aria-orientation\",\"vertical\")):(this.#v(),s.forEach(i=>i.hidden=!1),e?.setAttribute(\"aria-orientation\",\"horizontal\"))}#E(){let t=this.#t(),e=t.find(s=>s.selected&&!s.disabled)||t.find(s=>!s.disabled);e&&(this.#l&&!e.selected&&this.dispatchEvent(new CustomEvent(\"a-tab-show\",{bubbles:!0,composed:!0,detail:{tabId:e.id}})),this.#u(e))}#u(t){this.#_(),t&&(t.selected=!0);let e=this.#b(t);e&&(e.hidden=!1)}#n=t=>{this.#w(),this.#i(),this.#E(),t.target.name===\"tab\"&&(this.#l=!0)};#p=t=>{if(t.target.tagName.toLowerCase()!==\"a-tab\"||t.altKey)return;let e=R.includes(this.placement||\"\")?this.placement:n.TOP,s=[n.TOP,n.BOTTOM].includes(e||\"\")?\"horizontal\":\"vertical\",i=this.#d(),o=null;switch(t.key){case c.LEFT:s===\"horizontal\"&&(o=i===l.LTR?this.#a():this.#r(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.RIGHT:s===\"horizontal\"&&(o=i===l.LTR?this.#r():this.#a(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.UP:s===\"vertical\"&&(o=this.#a(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.DOWN:s===\"vertical\"&&(o=this.#r(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.HOME:o=this.#y(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o));break;case c.END:o=this.#A(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o));break;case c.ENTER:case c.SPACE:o=t.target,o&&this.selectTab(o);break;default:return}t.preventDefault()};#g=t=>{let e=t.target.closest(\"a-tab\");e&&this.selectTab(e)};#f=t=>{let e=t.target.closest(\".tab-group__scroll-button\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\");if(!e||!s)return;let i=e.classList.contains(\"tab-group__scroll-button--start\"),o=this.#d()===l.LTR,d=i?o?-1:1:o?1:-1,m=s.scrollLeft;s.scrollTo({left:m+d*this.scrollDistance})};#m=t=>{let e=t.target,s=this.#b(e);e&&(e.remove(),e.selected&&this.dispatchEvent(new CustomEvent(\"a-tab-hide\",{bubbles:!0,composed:!0,detail:{tabId:e.id}}))),s&&s.tagName.toLowerCase()===\"a-tab-panel\"&&s.remove()};#o(t){return b(t,this)}selectTabByIndex(t){let s=this.#t()[t];s&&this.selectTab(s)}selectTabById(t){let s=this.#t().find(i=>i.id===t);s&&this.selectTab(s)}selectTab(t){let e=this.#t().find(s=>s.selected);!t||t.disabled||t.selected||t.tagName.toLowerCase()!==\"a-tab\"||(this.#u(t),window.requestAnimationFrame(()=>{t.scrollIntoView({inline:\"nearest\",block:\"nearest\"}),t.focus()}),e&&this.dispatchEvent(new CustomEvent(\"a-tab-hide\",{bubbles:!0,composed:!0,detail:{tabId:e.id}})),this.dispatchEvent(new CustomEvent(\"a-tab-show\",{bubbles:!0,composed:!0,detail:{tabId:t.id}})))}static defineCustomElement(t=\"a-tab-group\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};f.defineCustomElement();export{u as ATab,f as ATabGroup,p as ATabPanel};\n//# sourceMappingURL=a-tab-group.js.map\n","// @ts-check\n\n/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */\nconst uid = (prefix = '', suffix = '') => {\n const prefixString = typeof prefix === 'string' && prefix !== '' ? prefix + '-' : '';\n const suffixString = typeof suffix === 'string' && suffix !== '' ? '-' + suffix : '';\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n\n return `${prefixString}${randomString}${suffixString}`;\n};\n\nexport { uid };\n","// @ts-check\n\n/**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n * @param {any} instance - The instance of the tab.\n */\nconst upgradeProperty = (prop, instance) => {\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n};\n\nexport { upgradeProperty };\n","// @ts-check\n\nimport { uid } from './utils/uid.js';\nimport { upgradeProperty } from './utils/upgrade-property.js';\n\nlet tabCounter = 0;\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n \n
    \n`;\n\n/**\n * @summary\n * This is a tab for a tab panel.\n * `` should always be used with `role=heading` in the markup so that the semantics remain useable when JavaScript is failing.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab\n * @extends HTMLElement\n *\n * @property {boolean} selected - Whether the tab is selected.\n * @property {boolean} disabled - Whether the tab is disabled.\n * @property {boolean} closable - Whether the tab is closable.\n *\n * @attribute selected - Reflects the selected property.\n * @attribute disabled - Reflects the disabled property.\n * @attribute closable - Reflects the closable property.\n *\n * @csspart base - The component's base wrapper.\n * @csspart close-tab - The close button.\n * @csspart close-tab-icon - The close button icon.\n *\n * @slot - The tab's content.\n *\n * @event a-tab-close - Fires when the tab's close button is clicked.\n */\nclass ATab extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['selected', 'disabled', 'closable'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'selected' && oldValue !== newValue) {\n this.setAttribute('aria-selected', this.selected.toString());\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n if (name === 'disabled' && oldValue !== newValue) {\n this.setAttribute('aria-disabled', this.disabled.toString());\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n if (name === 'closable' && oldValue !== newValue) {\n if (this.closable) {\n const closeButton = document.createElement('span');\n closeButton.className = 'tab__close';\n closeButton.setAttribute('part', 'close-tab');\n closeButton.innerHTML = /* html */ ``;\n this.shadowRoot?.querySelector('.tab')?.appendChild(closeButton);\n closeButton.addEventListener('click', this.#handleCloseButtonClick);\n } else {\n const closeButton = this.shadowRoot?.querySelector('.tab__close');\n closeButton?.removeEventListener('click', this.#handleCloseButtonClick);\n closeButton?.remove();\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('selected');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('closable');\n\n if (!this.id) {\n this.id = uid('tab', (++tabCounter).toString());\n }\n\n this.setAttribute('slot', 'tab');\n this.setAttribute('role', 'tab');\n this.setAttribute('aria-selected', 'false');\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n /**\n * Lifecycle method that is called when the element is disconnected from the DOM.\n */\n disconnectedCallback() {\n const closeButton = this.shadowRoot?.querySelector('.tab__close');\n closeButton?.removeEventListener('click', this.#handleCloseButtonClick);\n }\n\n /**\n * @type {boolean} - Whether the tab is selected.\n * @default false\n * @attribute selected - Reflects the selected property.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n set selected(value) {\n this.toggleAttribute('selected', !!value);\n }\n\n /**\n * @type {boolean} - Whether the tab is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {boolean} - Whether the tab is closable.\n * @default false\n * @attribute closable - Reflects the closable property.\n */\n get closable() {\n return this.hasAttribute('closable');\n }\n\n set closable(value) {\n this.toggleAttribute('closable', !!value);\n }\n\n /**\n * Handles the click event on the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n evt.stopPropagation();\n\n this.dispatchEvent(\n new CustomEvent(`a-tab-close`, {\n bubbles: true,\n composed: true,\n detail: { tabId: this.id }\n })\n );\n };\n\n /**\n * Wrapper for the `upgradeProperty` function.\n *\n * @param {'selected' | 'disabled' | 'closable'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n return upgradeProperty(prop, this);\n }\n\n static defineCustomElement(elementName = 'a-tab') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATab);\n }\n }\n}\n\nATab.defineCustomElement();\n\nexport { ATab };\n","// @ts-check\n\nimport { uid } from './utils/uid.js';\n\nlet panelCounter = 0;\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n \n
    \n`;\n\n/**\n * @summary This is a panel for a `` tab panel.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab-panel\n * @extends HTMLElement\n *\n * @csspart base - The component's base wrapper.\n *\n * @slot - The content of the tab panel.\n */\nclass ATabPanel extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.setAttribute('slot', 'panel');\n this.setAttribute('role', 'tabpanel');\n this.setAttribute('hidden', '');\n\n if (!this.id) {\n this.id = uid('panel', (++panelCounter).toString());\n }\n }\n\n static defineCustomElement(elementName = 'a-tab-panel') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATabPanel);\n }\n }\n}\n\nATabPanel.defineCustomElement();\n\nexport { ATabPanel };\n","// @ts-check\n\n/**\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/** @typedef {import('./a-tab').ATab} Tab */\n/** @typedef {import('./a-tab-panel').ATabPanel} TabPanel */\n\nexport { ATab } from './a-tab.js';\nexport { ATabPanel } from './a-tab-panel.js';\nimport { upgradeProperty } from './utils/upgrade-property.js';\n\n/**\n * The default scroll distance in pixels that the\n * tabs will scroll when the scroll buttons are clicked.\n */\nconst DEFAULT_SCROLL_DISTANCE = 200;\n\n/**\n * The available placements for the tabs.\n */\nconst PLACEMENT = {\n TOP: 'top',\n BOTTOM: 'bottom',\n START: 'start',\n END: 'end'\n};\n\n/**\n * The available directionality values for the tab group.\n */\nconst DIR = {\n LTR: 'ltr',\n RTL: 'rtl'\n};\n\n/**\n * The valid placements for the tabs.\n */\nconst validPlacements = Object.entries(PLACEMENT).map(([, value]) => value);\n\n/**\n * The available activation modes for the tabs.\n */\nconst ACTIVATION = {\n AUTO: 'auto',\n MANUAL: 'manual'\n};\n\n/**\n * Defines key codes to help with handling keyboard events.\n */\nconst KEYCODE = {\n DOWN: 'ArrowDown',\n LEFT: 'ArrowLeft',\n RIGHT: 'ArrowRight',\n UP: 'ArrowUp',\n HOME: 'Home',\n END: 'End',\n ENTER: 'Enter',\n SPACE: ' '\n};\n\nconst styles = /* css */ `\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${DIR.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${DIR.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${DIR.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${DIR.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${PLACEMENT.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${PLACEMENT.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${PLACEMENT.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;\n\n/**\n * @summary Container element for tabs and panels. All children of should be either `` or ``.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab-group\n * @extends HTMLElement\n *\n * @property {string} placement - The placement of the tabs.\n * @property {boolean} noScrollControls - Whether or not the scroll controls are enabled.\n * @property {number} scrollDistance - The distance in pixels that the tabs will scroll when the scroll buttons are clicked.\n * @property {string} activation - The activation mode of the tabs.\n * @property {boolean} noTabCycling - Whether or not the tabs should cycle when reaching the first or last tab using the keyboard.\n *\n * @attribute placement - Reflects the placement property.\n * @attribute no-scroll-controls - Reflects the noScrollControls property.\n * @attribute scroll-distance - Reflects the scrollDistance property.\n * @attribute activation - Reflects the activation property.\n * @attribute no-tab-cycling - Reflects the noTabCycling property.\n *\n * @slot tab - Used for groupping tabs in the tab group. Must be elements.\n * @slot panel - Used for groupping tab panels in the tab group. Must be elements.\n *\n * @csspart base - The component's base wrapper.\n * @csspart nav - The nav container.\n * @csspart nav--has-scroll-controls - The nav container when the scroll controls are enabled and visible.\n * @csspart scroll-button - The scroll button.\n * @csspart scroll-button--start - The scroll button for scrolling towards the start.\n * @csspart scroll-button--end - The scroll button for scrolling towards the end.\n * @csspart scroll-button-icon - The scroll button icon.\n * @csspart tabs - The tabs container.\n * @csspart panels - The panels container.\n *\n * @cssproperty --selected-tab-color - The color of the selected tab.\n * @cssproperty --selected-tab-bg-color - The background color of the selected tab.\n * @cssproperty --tabs-scroll-behavior - The scroll behavior of the tabs container.\n * @cssproperty --scroll-button-width - The width of the scroll buttons.\n * @cssproperty --scroll-button-height - The height of the scroll buttons.\n * @cssproperty --scroll-button-inline-offset - The inline offset of the scroll buttons.\n *\n * @event a-tab-show - Fired when a tab is shown.\n * @event a-tab-hide - Fired when a tab is shown.\n *\n * @method selectTabByIndex - Selects the tab at the given index.\n * @method selectTabById - Selects the tab with the given id.\n * @method selectTab - Selects the given tab.\n */\nclass ATabGroup extends HTMLElement {\n /** @type {Nullable} */\n #resizeObserver = null;\n\n /** @type {Nullable} */\n #rafId = null;\n\n /** @type {boolean} */\n #hasTabSlotChangedOnce = false;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['placement', 'no-scroll-controls'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'placement' && oldValue !== newValue) {\n this.#syncNav();\n }\n\n if (name === 'no-scroll-controls' && oldValue !== newValue) {\n this.#syncNav();\n }\n }\n\n /**\n * @type {Nullable} - The placement of the tabs.\n * @default 'top'\n * @attribute placement - Reflects the placement property.\n */\n get placement() {\n return this.getAttribute('placement') || PLACEMENT.TOP;\n }\n\n set placement(value) {\n if (value != null) {\n this.setAttribute('placement', value);\n }\n }\n\n /**\n * @type {boolean} - Whether or not the scroll controls are enabled.\n * @default false\n * @attribute no-scroll-controls - Reflects the noScrollControls property.\n */\n get noScrollControls() {\n return this.hasAttribute('no-scroll-controls');\n }\n\n set noScrollControls(value) {\n this.toggleAttribute('no-scroll-controls', !!value);\n }\n\n /**\n * @type {number} - The distance in pixels that the tabs will scroll when the scroll buttons are clicked.\n * @default 200\n * @attribute scroll-distance - Reflects the scrollDistance property.\n */\n get scrollDistance() {\n const value = Number(this.getAttribute('scroll-distance'));\n return Math.abs(value) || DEFAULT_SCROLL_DISTANCE;\n }\n\n set scrollDistance(value) {\n this.setAttribute('scroll-distance', Math.abs(value).toString() || DEFAULT_SCROLL_DISTANCE.toString());\n }\n\n /**\n * @type {string} - The activation mode of the tabs.\n * @default 'auto'\n * @attribute activation - Reflects the activation property.\n */\n get activation() {\n return this.getAttribute('activation') || ACTIVATION.AUTO;\n }\n\n set activation(value) {\n this.setAttribute('activation', value || ACTIVATION.AUTO);\n }\n\n /**\n * @type {boolean} - Whether or not the tabs should cycle when reaching the first or last tab using the keyboard.\n * @default false\n * @attribute no-tab-cycling - Reflects the noTabCycling property.\n */\n get noTabCycling() {\n return this.hasAttribute('no-tab-cycling');\n }\n\n set noTabCycling(value) {\n this.toggleAttribute('no-tab-cycling', !!value);\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('placement');\n this.#upgradeProperty('noScrollControls');\n this.#upgradeProperty('scrollDistance');\n this.#upgradeProperty('activation');\n this.#upgradeProperty('noTabCycling');\n\n const tabSlot = this.shadowRoot?.querySelector('slot[name=tab]');\n const panelSlot = this.shadowRoot?.querySelector('slot[name=panel]');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n const navContainer = this.shadowRoot?.querySelector('.tab-group__nav');\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n tabSlot?.addEventListener('slotchange', this.#handleSlotChange);\n panelSlot?.addEventListener('slotchange', this.#handleSlotChange);\n tabsContainer?.addEventListener('click', this.#handleTabClick);\n tabsContainer?.addEventListener('keydown', this.#handleKeyDown);\n scrollButtons.forEach(el => el.addEventListener('click', this.#handleScrollButtonClick));\n this.addEventListener('a-tab-close', this.#handleTabClose);\n\n if ('ResizeObserver' in window) {\n this.#resizeObserver = new ResizeObserver(entries => {\n this.#rafId = window.requestAnimationFrame(() => {\n const entry = entries?.[0];\n const targetElement = entry?.target;\n const isElementScrollable = targetElement?.scrollWidth > targetElement?.clientWidth;\n scrollButtons.forEach(el => el.toggleAttribute('hidden', !isElementScrollable));\n navContainer?.part.toggle('nav--has-scroll-controls', isElementScrollable);\n navContainer?.classList.toggle('tab-group__nav--has-scroll-controls', isElementScrollable);\n });\n });\n }\n\n this.#hideEmptyTabGroup();\n this.#syncNav();\n }\n\n /**\n * Lifecycle method that is called when the element is disconnected from the DOM.\n */\n disconnectedCallback() {\n const tabSlot = this.shadowRoot?.querySelector('slot[name=tab]');\n const panelSlot = this.shadowRoot?.querySelector('slot[name=panel]');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n tabSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n panelSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n tabsContainer?.removeEventListener('click', this.#handleTabClick);\n tabsContainer?.removeEventListener('keydown', this.#handleKeyDown);\n scrollButtons.forEach(el => el.removeEventListener('click', this.#handleScrollButtonClick));\n this.removeEventListener('a-tab-close', this.#handleTabClose);\n this.#stopResizeObserver();\n }\n\n /**\n * Starts observing the tabs container for resize events.\n */\n #startResizeObserver() {\n if (!this.#resizeObserver) {\n return;\n }\n\n const scrollElement = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n if (scrollElement) {\n this.#resizeObserver.unobserve(scrollElement);\n this.#resizeObserver.observe(scrollElement);\n }\n }\n\n /**\n * Stops observing the tabs container for resize events.\n */\n #stopResizeObserver() {\n if (!this.#resizeObserver) {\n return;\n }\n\n this.#resizeObserver.disconnect();\n\n if (this.#rafId !== null) {\n window.cancelAnimationFrame(this.#rafId);\n this.#rafId = null;\n }\n }\n\n /**\n * Gets the directionality of the tab group.\n *\n * @returns {'ltr' | 'rtl'} - The direction of the tab group.\n */\n #getDirectionality() {\n return /** @type {'ltr' | 'rtl'} */ (\n window.CSS.supports('selector(:dir(ltr))')\n ? this.matches(':dir(ltr)')\n ? DIR.LTR\n : DIR.RTL\n : window.getComputedStyle(this).direction || DIR.LTR\n );\n }\n\n /**\n * Hides the tab group if there are no tabs.\n */\n #hideEmptyTabGroup() {\n this.hidden = this.#allTabs().length === 0;\n }\n\n /**\n * Links up tabs with their adjacent panels using `aria-controls` and `aria-labelledby`.\n * This method makes sure only one tab is selected at a time.\n */\n #linkPanels() {\n const tabs = this.#allTabs();\n\n this.#hideEmptyTabGroup();\n\n // Give each panel a `aria-labelledby` attribute that refers to the tab that controls it.\n tabs.forEach(tab => {\n const panel = tab.nextElementSibling;\n\n if (!panel || panel.tagName.toLowerCase() !== 'a-tab-panel') {\n return console.error(`Tab #${tab.id} is not a sibling of a `);\n }\n\n tab.setAttribute('aria-controls', panel.id);\n panel.setAttribute('aria-labelledby', tab.id);\n });\n }\n\n /**\n * Get all panels in the tab group.\n *\n * @returns {TabPanel[]} - All the panels in the tab group.\n */\n #allPanels() {\n return Array.from(this.querySelectorAll('a-tab-panel'));\n }\n\n /**\n * Get all tabs in the tab group.\n *\n * @returns {Tab[]} - All the tabs in the tab group.\n */\n #allTabs() {\n return Array.from(this.querySelectorAll('a-tab'));\n }\n\n /**\n * Get the panel for the given tab.\n *\n * @param {Tab} tab - The tab whose panel is to be returned.\n * @returns {Nullable} - The panel controlled by the given tab.\n */\n #panelForTab(tab) {\n const panelId = tab.getAttribute('aria-controls');\n return this.querySelector(`#${panelId}`);\n }\n\n /**\n * Get the first non-disabled tab in the tab group.\n *\n * @returns {Nullable} - The first tab in the tab group.\n */\n #firstTab() {\n const tabs = this.#allTabs();\n return tabs.find(tab => !tab.disabled) || null;\n }\n\n /**\n * Get the last non-disabled tab in the tab group.\n *\n * @returns {Nullable} - The last tab in the tab group.\n */\n #lastTab() {\n const tabs = this.#allTabs();\n\n for (let i = tabs.length - 1; i >= 0; i--) {\n if (!tabs[i].disabled) {\n return tabs[i];\n }\n }\n\n return null;\n }\n\n /**\n * Get the tab that comes before the currently selected one, wrapping around when reaching the first tab.\n * If the currently selected tab is disabled, the method will skip it.\n *\n * @returns {Nullable} - The previous tab.\n */\n #prevTab() {\n const tabs = this.#allTabs();\n let newIdx =\n this.activation === ACTIVATION.MANUAL\n ? tabs.findIndex(tab => tab.matches(':focus')) - 1\n : tabs.findIndex(tab => tab.selected) - 1;\n\n // Keep looping until we find a non-disabled tab.\n while (tabs[(newIdx + tabs.length) % tabs.length].disabled) {\n newIdx--;\n }\n\n // Stop cycling through tabs if we reach the beginning and tab cycling is disabled.\n if (this.noTabCycling && newIdx < 0) {\n return null;\n }\n\n // Add `tabs.length` to make sure the index is a positive number and get the modulus to wrap around if necessary.\n return tabs[(newIdx + tabs.length) % tabs.length];\n }\n\n /**\n * Get the tab that comes after the currently selected one, wrapping around when reaching the last tab.\n * If the currently selected tab is disabled, the method will skip it.\n *\n * @returns {Nullable} - The next tab.\n */\n #nextTab() {\n const tabs = this.#allTabs();\n let newIdx =\n this.activation === ACTIVATION.MANUAL\n ? tabs.findIndex(tab => tab.matches(':focus')) + 1\n : tabs.findIndex(tab => tab.selected) + 1;\n\n // Keep looping until we find a non-disabled tab.\n while (tabs[newIdx % tabs.length].disabled) {\n newIdx++;\n }\n\n // Stop cycling through tabs if we reach the end and tab cycling is disabled.\n if (this.noTabCycling && newIdx >= tabs.length) {\n return null;\n }\n\n return tabs[newIdx % tabs.length];\n }\n\n /**\n * Marks all tabs as unselected and hides all the panels.\n * This is called every time the user selects a new tab.\n */\n #reset() {\n const tabs = this.#allTabs();\n const panels = this.#allPanels();\n\n tabs.forEach(tab => (tab.selected = false));\n panels.forEach(panel => (panel.hidden = true));\n }\n\n /**\n * Syncs the tab group navigation with the current state of the tab group.\n *\n * This is called every time the user:\n * - adds or removes a tab or panel\n * - changes the placement of the tabs\n * - enables or disables the scroll controls\n *\n * If the tabs container is scrollable and the scroll controls are enabled,\n * the scroll buttons are displayed and the resize observer is started,\n * otherwise they are hidden and the resize observer is stopped.\n */\n #syncNav() {\n const navContainer = this.shadowRoot?.querySelector('.tab-group__nav');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n /** @type {HTMLButtonElement[]} */\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n if (this.noScrollControls || this.placement === PLACEMENT.START || this.placement === PLACEMENT.END) {\n this.#stopResizeObserver();\n scrollButtons.forEach(el => (el.hidden = true));\n navContainer?.part.remove('nav--has-scroll-controls');\n navContainer?.classList.remove('tab-group__nav--has-scroll-controls');\n tabsContainer?.setAttribute('aria-orientation', 'vertical');\n } else {\n this.#startResizeObserver();\n scrollButtons.forEach(el => (el.hidden = false));\n tabsContainer?.setAttribute('aria-orientation', 'horizontal');\n }\n }\n\n /**\n * Sets the selected tab when the slot changes.\n * This is called every time the user adds or removes a tab or panel.\n * This is useful when the user closes the selected tab and we need to select a new one.\n */\n #setSelectedTabOnSlotChange() {\n const tabs = this.#allTabs();\n\n // Get the selected non-disabled tab, or the first non-disabled tab.\n const tab = tabs.find(tab => tab.selected && !tab.disabled) || tabs.find(tab => !tab.disabled);\n\n if (tab) {\n if (this.#hasTabSlotChangedOnce && !tab.selected) {\n this.dispatchEvent(\n new CustomEvent('a-tab-show', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n\n this.#setSelectedTab(tab);\n }\n }\n\n /**\n * Sets the given tab as selected and shows the panel corresponding to the given tab.\n * Differentiates from `selectTab()` in that it does not emit any events or focus the tab.\n * Used internally to set the selected tab when a tab is selected by a side effect,\n * eg. when a tabs and panels are added or removeda and there is a need to select a new tab.\n *\n * @param {Tab} tab - The tab to be selected.\n */\n #setSelectedTab(tab) {\n this.#reset();\n\n if (tab) {\n tab.selected = true;\n }\n\n const panel = this.#panelForTab(tab);\n\n if (panel) {\n panel.hidden = false;\n }\n }\n\n /**\n * Handles the slotchange event on the tab group.\n * This is called every time the user adds or removes a tab or panel.\n *\n * @param {any} evt - The slotchange event.\n */\n #handleSlotChange = evt => {\n this.#linkPanels();\n this.#syncNav();\n this.#setSelectedTabOnSlotChange();\n\n if (evt.target.name === 'tab') {\n this.#hasTabSlotChangedOnce = true;\n }\n };\n\n /**\n * Handles key events on the tab group.\n *\n * @param {any} evt - The keydown event.\n */\n #handleKeyDown = evt => {\n if (\n evt.target.tagName.toLowerCase() !== 'a-tab' || // Ignore any key presses that have a modifier.\n evt.altKey // Don’t handle modifier shortcuts typically used by assistive technology.\n ) {\n return;\n }\n\n const placement = validPlacements.includes(this.placement || '') ? this.placement : PLACEMENT.TOP;\n const orientation = [PLACEMENT.TOP, PLACEMENT.BOTTOM].includes(placement || '') ? 'horizontal' : 'vertical';\n const directionality = this.#getDirectionality();\n let tab = null;\n\n switch (evt.key) {\n case KEYCODE.LEFT:\n if (orientation === 'horizontal') {\n tab = directionality === DIR.LTR ? this.#prevTab() : this.#nextTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.RIGHT:\n if (orientation === 'horizontal') {\n tab = directionality === DIR.LTR ? this.#nextTab() : this.#prevTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.UP:\n if (orientation === 'vertical') {\n tab = this.#prevTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.DOWN:\n if (orientation === 'vertical') {\n tab = this.#nextTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.HOME:\n tab = this.#firstTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n break;\n case KEYCODE.END:\n tab = this.#lastTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n break;\n case KEYCODE.ENTER:\n case KEYCODE.SPACE:\n tab = evt.target;\n if (tab) {\n this.selectTab(tab);\n }\n break;\n default:\n // Any other key press is ignored and passed back to the browser.\n return;\n }\n\n // The browser might have some native functionality bound to the arrow keys, home or end.\n // `preventDefault()` is called to prevent the browser from taking any actions.\n evt.preventDefault();\n };\n\n /**\n * Handles click events on the tab group.\n *\n * @param {any} evt - The click event.\n */\n #handleTabClick = evt => {\n const tab = evt.target.closest('a-tab');\n\n if (tab) {\n this.selectTab(tab);\n }\n };\n\n /**\n * Handles the scroll button click event.\n *\n * @param {any} evt - The click event.\n */\n #handleScrollButtonClick = evt => {\n const scrollButton = evt.target.closest('.tab-group__scroll-button');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n if (!scrollButton || !tabsContainer) {\n return;\n }\n\n const isStartButton = scrollButton.classList.contains('tab-group__scroll-button--start');\n const isLTR = this.#getDirectionality() === DIR.LTR;\n const sign = isStartButton ? (isLTR ? -1 : 1) : isLTR ? 1 : -1;\n const offsetLeft = tabsContainer.scrollLeft;\n\n tabsContainer.scrollTo({\n left: offsetLeft + sign * this.scrollDistance\n });\n };\n\n /**\n * Handles the tab close button click event.\n *\n * @param {any} evt - The click event.\n */\n #handleTabClose = evt => {\n const tab = evt.target;\n const panel = this.#panelForTab(tab);\n\n if (tab) {\n tab.remove();\n\n if (tab.selected) {\n this.dispatchEvent(\n new CustomEvent('a-tab-hide', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n }\n\n if (panel && panel.tagName.toLowerCase() === 'a-tab-panel') {\n panel.remove();\n }\n };\n\n /**\n * Wrapper for the `upgradeProperty` function.\n *\n * @param {'placement' | 'noScrollControls' | 'scrollDistance' | 'activation' | 'noTabCycling'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n return upgradeProperty(prop, this);\n }\n\n /**\n * Selects the tab at the given index.\n * If the tab at the given index is disabled or already selected, this method does nothing.\n *\n * @param {number} index - The index of the tab to be selected.\n */\n selectTabByIndex(index) {\n const tabs = this.#allTabs();\n const tab = tabs[index];\n\n if (tab) {\n this.selectTab(tab);\n }\n }\n\n /**\n * Selects the tab with the given id.\n * If the tab with the given id is disabled or already selected, this method does nothing.\n *\n * @param {string} id - The id of the tab to be selected.\n */\n selectTabById(id) {\n const tabs = this.#allTabs();\n const tab = tabs.find(tab => tab.id === id);\n\n if (tab) {\n this.selectTab(tab);\n }\n }\n\n /**\n * Selects the given tab.\n * If the given tab is disabled or already selected, this method does nothing.\n *\n * @param {Tab} tab - The tab to be selected.\n */\n selectTab(tab) {\n const oldTab = this.#allTabs().find(t => t.selected);\n\n if (!tab || tab.disabled || tab.selected || tab.tagName.toLowerCase() !== 'a-tab') {\n return;\n }\n\n this.#setSelectedTab(tab);\n\n // Queue a microtask to ensure that the tab is focused on the next tick.\n window.requestAnimationFrame(() => {\n tab.scrollIntoView({ inline: 'nearest', block: 'nearest' });\n tab.focus();\n });\n\n if (oldTab) {\n this.dispatchEvent(\n new CustomEvent('a-tab-hide', {\n bubbles: true,\n composed: true,\n detail: { tabId: oldTab.id }\n })\n );\n }\n\n this.dispatchEvent(\n new CustomEvent('a-tab-show', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n\n static defineCustomElement(elementName = 'a-tab-group') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATabGroup);\n }\n }\n}\n\nATabGroup.defineCustomElement();\n\nexport { ATabGroup };\n","/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar h=`\n :host {\n display: inline-block;\n }\n`,r=document.createElement(\"template\");r.innerHTML=`\n \n \n`;var s=class a extends HTMLElement{#e;#t;#r=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(r.content.cloneNode(!0)),this.#e=this.shadowRoot?.querySelector('slot[name=\"button\"]')||null,this.#t=this.#h()}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,e,i){t===\"disabled\"&&e!==i&&this.#t&&(this.#t.toggleAttribute(\"disabled\",this.disabled),this.#t.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#t.part&&this.#t.part.contains(\"button\")&&this.#t.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#s(\"shareUrl\"),this.#s(\"shareTitle\"),this.#s(\"shareText\"),this.#s(\"shareFiles\"),this.#s(\"disabled\"),this.#e?.addEventListener(\"slotchange\",this.#a),this.#t?.addEventListener(\"click\",this.#i)}disconnectedCallback(){this.#e?.removeEventListener(\"slotchange\",this.#a),this.#t?.removeEventListener(\"click\",this.#i)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get shareUrl(){return this.getAttribute(\"share-url\")||\"\"}set shareUrl(t){this.setAttribute(\"share-url\",t)}get shareTitle(){return this.getAttribute(\"share-title\")||\"\"}set shareTitle(t){this.setAttribute(\"share-title\",t)}get shareText(){return this.getAttribute(\"share-text\")||\"\"}set shareText(t){this.setAttribute(\"share-text\",t)}get shareFiles(){return this.#r}set shareFiles(t){Array.isArray(t)&&t.length>0&&(this.#r=t)}async share(){if(!this.disabled)try{let t={};this.shareUrl&&(t.url=this.shareUrl),this.shareTitle&&(t.title=this.shareTitle),this.shareText&&(t.text=this.shareText),Array.isArray(this.shareFiles)&&this.shareFiles.length>0&&navigator.canShare&&navigator.canShare({files:this.shareFiles})&&(t.files=this.shareFiles),await navigator.share(t),this.dispatchEvent(new CustomEvent(\"web-share:success\",{bubbles:!0,composed:!0,detail:{shareData:t}}))}catch(t){if(t instanceof Error&&t.name===\"AbortError\"){this.dispatchEvent(new CustomEvent(\"web-share:abort\",{bubbles:!0,composed:!0,detail:{error:t}}));return}this.dispatchEvent(new CustomEvent(\"web-share:error\",{bubbles:!0,composed:!0,detail:{error:t}}))}}#i=t=>{t.preventDefault(),!this.disabled&&this.share()};#a=t=>{t.target&&t.target.name===\"button\"&&(this.#t?.removeEventListener(\"click\",this.#i),this.#t=this.#h(),this.#t&&(this.#t.addEventListener(\"click\",this.#i),this.#t.nodeName!==\"BUTTON\"&&!this.#t.hasAttribute(\"role\")&&this.#t.setAttribute(\"role\",\"button\")))};#h(){return this.#e&&this.#e.assignedElements({flatten:!0}).find(t=>t.nodeName===\"BUTTON\"||t.getAttribute(\"slot\")===\"button\")||null}#s(t){let e=this;if(Object.prototype.hasOwnProperty.call(e,t)){let i=e[t];delete e[t],e[t]=i}}static defineCustomElement(t=\"web-share\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};s.defineCustomElement();export{s as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */\n\nconst styles = /* css */ `\n :host {\n display: inline-block;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element#readme\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */\nclass WebShare extends HTMLElement {\n /** @type {Nullable} */\n #buttonSlot;\n\n /** @type {Nullable} */\n #buttonEl;\n\n /** @type {File[]} */\n #files = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute('disabled', this.disabled);\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part && this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('shareUrl');\n this.#upgradeProperty('shareTitle');\n this.#upgradeProperty('shareText');\n this.#upgradeProperty('shareFiles');\n this.#upgradeProperty('disabled');\n\n this.#buttonSlot?.addEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n }\n\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */\n get shareUrl() {\n return this.getAttribute('share-url') || '';\n }\n\n set shareUrl(value) {\n this.setAttribute('share-url', value);\n }\n\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */\n get shareTitle() {\n return this.getAttribute('share-title') || '';\n }\n\n set shareTitle(value) {\n this.setAttribute('share-title', value);\n }\n\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */\n get shareText() {\n return this.getAttribute('share-text') || '';\n }\n\n set shareText(value) {\n this.setAttribute('share-text', value);\n }\n\n /**\n * @type {File[]} - The files to share.\n */\n get shareFiles() {\n return this.#files;\n }\n\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) {\n this.#files = value;\n }\n }\n\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */\n async share() {\n if (this.disabled) {\n return;\n }\n\n try {\n /** @type {ShareData} */\n const shareData = {};\n\n if (this.shareUrl) {\n shareData.url = this.shareUrl;\n }\n\n if (this.shareTitle) {\n shareData.title = this.shareTitle;\n }\n\n if (this.shareText) {\n shareData.text = this.shareText;\n }\n\n if (\n Array.isArray(this.shareFiles) &&\n this.shareFiles.length > 0 &&\n navigator.canShare &&\n navigator.canShare({ files: this.shareFiles })\n ) {\n shareData.files = this.shareFiles;\n }\n\n await navigator.share(shareData);\n\n this.dispatchEvent(\n new CustomEvent('web-share:success', {\n bubbles: true,\n composed: true,\n detail: { shareData }\n })\n );\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n this.dispatchEvent(\n new CustomEvent('web-share:abort', {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent('web-share:error', {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n }\n\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.share();\n };\n\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */\n #handleSlotChange = evt => {\n if (evt.target && evt.target.name === 'button') {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n this.#buttonEl = this.#getButton();\n\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener('click', this.#handleClick);\n\n if (this.#buttonEl.nodeName !== 'BUTTON' && !this.#buttonEl.hasAttribute('role')) {\n this.#buttonEl.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */\n #getButton() {\n if (!this.#buttonSlot) {\n return null;\n }\n\n return (\n this.#buttonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'button';\n }) || null\n );\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='web-share'] - The name of the custom element.\n * @example\n *\n * ClipboardCopy.defineCustomElement('my-web-share');\n */\n static defineCustomElement(elementName = 'web-share') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, WebShare);\n }\n }\n}\n\nexport { WebShare };\n","import { WebShare } from './web-share.js';\n\nWebShare.defineCustomElement();\n\nexport { WebShare };\n","/*!\n * @georapbox/files-dropzone-element\n * A custom element that creates a drag and drop zone for files\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/files-dropzone-element#readme\n * @author George Raptis \n * @license MIT\n */\nfunction u(o,e=\"\"){if(!e)return!0;let t=[...new Set(e.split(\",\").map(r=>r.trim()).filter(Boolean))],i=o.type,s=i.replace(/\\/.*$/,\"\");for(let r of t)if(r.charAt(0)===\".\"){if(o.name.toLowerCase().indexOf(r.toLowerCase(),o.name.length-r.length)!==-1)return!0}else if(/\\/\\*$/.test(r)){if(s===r.replace(/\\/.*$/,\"\"))return!0}else if(i===r)return!0;return!1}var x=new Map([[\"aac\",\"audio/aac\"],[\"abw\",\"application/x-abiword\"],[\"arc\",\"application/x-freearc\"],[\"avif\",\"image/avif\"],[\"avi\",\"video/x-msvideo\"],[\"azw\",\"application/vnd.amazon.ebook\"],[\"bin\",\"application/octet-stream\"],[\"bmp\",\"image/bmp\"],[\"bz\",\"application/x-bzip\"],[\"bz2\",\"application/x-bzip2\"],[\"cda\",\"application/x-cdf\"],[\"csh\",\"application/x-csh\"],[\"css\",\"text/css\"],[\"csv\",\"text/csv\"],[\"doc\",\"application/msword\"],[\"docx\",\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"],[\"eot\",\"application/vnd.ms-fontobject\"],[\"epub\",\"application/epub+zip\"],[\"gz\",\"application/gzip\"],[\"gif\",\"image/gif\"],[\"heic\",\"image/heic\"],[\"heif\",\"image/heif\"],[\"htm\",\"text/html\"],[\"html\",\"text/html\"],[\"ico\",\"image/vnd.microsoft.icon\"],[\"ics\",\"text/calendar\"],[\"jar\",\"application/java-archive\"],[\"jpeg\",\"image/jpeg\"],[\"jpg\",\"image/jpeg\"],[\"jxl\",\"image/jxl\"],[\"js\",\"text/javascript\"],[\"json\",\"application/json\"],[\"jsonld\",\"application/ld+json\"],[\"markdown\",\"text/markdown\"],[\"md\",\"text/markdown\"],[\"mid\",\"audio/midi\"],[\"midi\",\"audio/midi\"],[\"mjs\",\"text/javascript\"],[\"mp3\",\"audio/mpeg\"],[\"mp4\",\"video/mp4\"],[\"mpeg\",\"video/mpeg\"],[\"mpkg\",\"application/vnd.apple.installer+xml\"],[\"odp\",\"application/vnd.oasis.opendocument.presentation\"],[\"ods\",\"application/vnd.oasis.opendocument.spreadsheet\"],[\"odt\",\"application/vnd.oasis.opendocument.text\"],[\"oga\",\"audio/ogg\"],[\"ogv\",\"video/ogg\"],[\"ogx\",\"application/ogg\"],[\"opus\",\"audio/opus\"],[\"otf\",\"font/otf\"],[\"png\",\"image/png\"],[\"pdf\",\"application/pdf\"],[\"php\",\"application/x-httpd-php\"],[\"ppt\",\"application/vnd.ms-powerpoint\"],[\"pptx\",\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"],[\"rar\",\"application/vnd.rar\"],[\"rtf\",\"application/rtf\"],[\"sh\",\"application/x-sh\"],[\"svg\",\"image/svg+xml\"],[\"swf\",\"application/x-shockwave-flash\"],[\"tar\",\"application/x-tar\"],[\"tif\",\"image/tiff\"],[\"tiff\",\"image/tiff\"],[\"ts\",\"video/mp2t\"],[\"ttf\",\"font/ttf\"],[\"txt\",\"text/plain\"],[\"vsd\",\"application/vnd.visio\"],[\"wav\",\"audio/wav\"],[\"weba\",\"audio/webm\"],[\"webm\",\"video/webm\"],[\"webp\",\"image/webp\"],[\"woff\",\"font/woff\"],[\"woff2\",\"font/woff2\"],[\"xhtml\",\"application/xhtml+xml\"],[\"xls\",\"application/vnd.ms-excel\"],[\"xlsx\",\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"],[\"xml\",\"application/xml\"],[\"xul\",\"application/vnd.mozilla.xul+xml\"],[\"zip\",\"application/zip\"],[\"7z\",\"application/x-7z-compressed\"],[\"mkv\",\"video/x-matroska\"],[\"mov\",\"video/quicktime\"],[\"msg\",\"application/vnd.ms-outlook\"]]),b=[\".DS_Store\",\"Thumbs.db\"],y=o=>{let{name:e}=o;if(e&&e.lastIndexOf(\".\")!==-1&&!o.type){let i=(e.split(\".\").pop()||\"\").toLowerCase(),s=x.get(i);s&&Object.defineProperty(o,\"type\",{value:s,writable:!1,configurable:!1,enumerable:!0})}return o},g=(o,e)=>{let t=y(o);if(typeof t.path!=\"string\"){let{webkitRelativePath:i}=o;Object.defineProperty(t,\"path\",{value:typeof e==\"string\"?e:i||o.name,writable:!1,configurable:!1,enumerable:!0})}return t},m=async o=>await new Promise((e,t)=>{o.readEntries(e,t)}),w=async o=>{let e=[],t=await m(o);for(;t.length>0;)e.push(...t),t=await m(o);return e},E=o=>new Promise((e,t)=>{o.file(i=>e(g(i,o.fullPath)),t)}),F=async o=>{let e=[],t=[];for(let i of o){if(i.kind!==\"file\")continue;let s=i.getAsEntry?i.getAsEntry():i.webkitGetAsEntry();t.push(s)}for(;t.length>0;){let i=t.shift();if(i)if(i.isFile){let s=await E(i);b.indexOf(s.name)===-1&&e.push(s)}else i.isDirectory&&t.push(...await w(i.createReader()));else continue}return e},f=async o=>{let e=[];for(let t of o)b.indexOf(t.name)===-1&&e.push(g(t));return e},l=async o=>o.dataTransfer?o.dataTransfer.items?await F(o.dataTransfer.items):await f(o.dataTransfer.files):await f(o.target.files);var n=\"files-dropzone\",v=\"TOO_MANY_FILES\",L=\"FILE_TOO_LARGE\",k=\"FILE_TOO_SMALL\",A=\"INVALID_MIME_TYPE\",z=document.createElement(\"template\"),S=`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;z.innerHTML=`\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;var d=class o extends HTMLElement{#t=null;#e=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(z.content.cloneNode(!0)),this.shadowRoot&&(this.#t=this.shadowRoot.getElementById(\"file-input\"),this.#e=this.shadowRoot.getElementById(\"dropzone\"))}static get observedAttributes(){return[\"accept\",\"disabled\",\"multiple\"]}attributeChangedCallback(e,t,i){e===\"accept\"&&t!==i&&this.#t&&(this.#t.accept=this.accept),e===\"disabled\"&&t!==i&&this.#t&&(this.#t.disabled=this.disabled,this.disabled?(this.#e?.removeAttribute(\"tabindex\"),this.#e?.setAttribute(\"aria-disabled\",\"true\")):(this.#e?.setAttribute(\"tabindex\",\"0\"),this.#e?.setAttribute(\"aria-disabled\",\"false\"))),e===\"multiple\"&&t!==i&&this.#t&&(this.#t.multiple=this.multiple)}connectedCallback(){this.#o(\"accept\"),this.#o(\"disabled\"),this.#o(\"maxFiles\"),this.#o(\"maxSize\"),this.#o(\"minSize\"),this.#o(\"multiple\"),this.#o(\"autoFocus\"),this.#o(\"noStyle\"),this.#t?.addEventListener(\"change\",this.#i),this.#e?.addEventListener(\"dragenter\",this.#r),this.#e?.addEventListener(\"dragover\",this.#s),this.#e?.addEventListener(\"dragleave\",this.#n),this.#e?.addEventListener(\"drop\",this.#a),this.#e?.addEventListener(\"click\",this.#d),this.#e?.addEventListener(\"keyup\",this.#l),this.autoFocus&&this.#e?.focus()}disconnectedCallback(){this.#t?.removeEventListener(\"change\",this.#i),this.#e?.removeEventListener(\"dragenter\",this.#r),this.#e?.removeEventListener(\"dragover\",this.#s),this.#e?.removeEventListener(\"dragleave\",this.#n),this.#e?.removeEventListener(\"drop\",this.#a),this.#e?.removeEventListener(\"click\",this.#d),this.#e?.removeEventListener(\"keyup\",this.#l)}get accept(){return this.getAttribute(\"accept\")||\"\"}set accept(e){this.setAttribute(\"accept\",e!=null?e.toString():e)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}get maxFiles(){let e=Number(this.getAttribute(\"max-files\"))||0;return e<=0?1/0:Math.floor(Math.abs(e))}set maxFiles(e){this.setAttribute(\"max-files\",e!=null?e.toString():e)}get maxSize(){let e=this.getAttribute(\"max-size\");if(e===null)return 1/0;let t=Number(e);return Number.isNaN(t)?1/0:t}set maxSize(e){this.setAttribute(\"max-size\",e!=null?e.toString():e)}get minSize(){let e=this.getAttribute(\"min-size\");if(e===null)return 0;let t=Number(e);return Number.isNaN(t)?0:t}set minSize(e){this.setAttribute(\"min-size\",e!=null?e.toString():e)}get multiple(){return this.hasAttribute(\"multiple\")}set multiple(e){this.toggleAttribute(\"multiple\",!!e)}get autoFocus(){return this.hasAttribute(\"auto-focus\")}set autoFocus(e){this.toggleAttribute(\"auto-focus\",!!e)}get noStyle(){return this.hasAttribute(\"no-style\")}set noStyle(e){this.toggleAttribute(\"no-style\",!!e)}#i=async e=>{try{this.#c(await l(e))}catch(t){this.dispatchEvent(new CustomEvent(`${n}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}};#r=()=>{this.disabled||this.dispatchEvent(new Event(`${n}-dragenter`,{bubbles:!0,composed:!0}))};#s=e=>{if(e.preventDefault(),this.disabled){e.dataTransfer.dropEffect=\"none\";return}e.dataTransfer.dropEffect=\"copy\",this.#e&&(this.#e.classList.add(\"dropzone--dragover\"),this.#e.part.add(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${n}-dragover`,{bubbles:!0,composed:!0}))};#n=()=>{this.disabled||(this.#e&&(this.#e.classList.remove(\"dropzone--dragover\"),this.#e.part.remove(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${n}-dragleave`,{bubbles:!0,composed:!0})))};#a=async e=>{if(!this.disabled){e.preventDefault(),this.#e&&(this.#e.classList.remove(\"dropzone--dragover\"),this.#e.part.remove(\"dropzone--dragover\"));try{this.#c(await l(e))}catch(t){this.dispatchEvent(new CustomEvent(`${n}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}};#d=()=>{this.disabled||this.#t?.click()};#l=e=>{this.disabled||(e.key===\" \"||e.key===\"Enter\")&&this.#t?.click()};#c(e){if(!Array.isArray(e)||!e.length)return;let t=[],i=[],s=e.length;if(!this.multiple&&s>1)for(let r of e)i.push({file:r,errors:[{code:v,message:\"Too many files selected. Only 1 file is allowed.\"}]});else if(this.multiple&&s>this.maxFiles)for(let r of e)i.push({file:r,errors:[{code:v,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?\"files are\":\"file is\"} allowed.`}]});else for(let r of e){let c=u(r,this.accept),p=r.size>this.maxSize,h=r.size0&&this.dispatchEvent(new CustomEvent(`${n}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:t}})),i.length>0&&this.dispatchEvent(new CustomEvent(`${n}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:i}})),this.#t&&(this.#t.value=this.#t.defaultValue)}openFileDialog(){this.disabled||this.#t?.click()}#o(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}static defineCustomElement(e=n){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,o)}};d.defineCustomElement();export{d as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","// @ts-check\n\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */\nexport function isValidFile(file, acceptedTypeSpecifiers = '') {\n if (!acceptedTypeSpecifiers) {\n return true;\n }\n\n const acceptedMimeTypesList = [\n ...new Set(\n acceptedTypeSpecifiers\n .split(',')\n .map(v => v.trim())\n .filter(Boolean)\n )\n ];\n\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, '');\n\n for (const validType of acceptedMimeTypesList) {\n if (validType.charAt(0) === '.') {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, '')) {\n return true;\n }\n } else {\n if (fileMimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n}\n","// @ts-check\n\n/**\n * A map of common file extensions and their associated MIME types.\n */\nconst COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['jxl', 'image/jxl'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['markdown', 'text/markdown'],\n ['md', 'text/markdown'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */\nconst toFileWithMimeType = file => {\n const { name } = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const extension = (name.split('.').pop() || '').toLowerCase();\n const type = COMMON_MIME_TYPES.get(extension);\n\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n};\n\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */\nconst toFileWithPath = (file, path) => {\n const fileWithMimeType = toFileWithMimeType(file);\n\n // @ts-ignore\n if (typeof fileWithMimeType.path !== 'string') {\n const { webkitRelativePath } = file;\n\n Object.defineProperty(fileWithMimeType, 'path', {\n value: typeof path === 'string' ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return fileWithMimeType;\n};\n\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readEntriesPromise = async directoryReader => {\n return await new Promise((resolve, reject) => {\n directoryReader.readEntries(resolve, reject);\n });\n};\n\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readAllDirectoryEntries = async directoryReader => {\n const entries = [];\n let readEntries = await readEntriesPromise(directoryReader);\n\n while (readEntries.length > 0) {\n entries.push(...readEntries);\n readEntries = await readEntriesPromise(directoryReader);\n }\n\n return entries;\n};\n\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */\nconst getFileFromFileEntry = fileEntry => {\n return new Promise((resolve, reject) => {\n fileEntry.file(file => resolve(toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromDataTransferItemList = async dataTransferItemList => {\n const files = [];\n\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n\n for (const item of dataTransferItemList) {\n if (item.kind !== 'file') {\n // Ignore non-file items, such as links.\n continue;\n }\n\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n\n queue.push(entry);\n }\n\n while (queue.length > 0) {\n const entry = queue.shift();\n\n if (!entry) {\n continue;\n } else if (entry.isFile) {\n const file = await getFileFromFileEntry(entry);\n\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(file);\n }\n } else if (entry.isDirectory) {\n queue.push(...(await readAllDirectoryEntries(entry.createReader())));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromFileList = async fileList => {\n const files = [];\n\n for (const file of fileList) {\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(toFileWithPath(file));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from an event.\n * This function supports both `drop` and `change` events.\n *\n * @param {*} evt - The event to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nexport const getFilesFromEvent = async evt => {\n if (evt.dataTransfer) {\n return evt.dataTransfer.items\n ? await getFilesFromDataTransferItemList(evt.dataTransfer.items)\n : await getFilesFromFileList(evt.dataTransfer.files);\n }\n\n return await getFilesFromFileList(evt.target.files);\n};\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nimport { isValidFile } from './utils/is-valid-file.js';\nimport { getFilesFromEvent } from './utils/files-selector.js';\n\nconst COMPONENT_NAME = 'files-dropzone';\nconst TOO_MANY_FILES = 'TOO_MANY_FILES';\nconst FILE_TOO_LARGE = 'FILE_TOO_LARGE';\nconst FILE_TOO_SMALL = 'FILE_TOO_SMALL';\nconst INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;\n\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */\nclass FilesDropzone extends HTMLElement {\n /** @type {Nullable} */\n #fileInput = null;\n\n /** @type {Nullable} */\n #dropzoneEl = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */ (this.shadowRoot.getElementById('file-input'));\n this.#dropzoneEl = this.shadowRoot.getElementById('dropzone');\n }\n }\n\n static get observedAttributes() {\n return ['accept', 'disabled', 'multiple'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'accept' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.accept = this.accept;\n }\n\n if (name === 'disabled' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n\n if (this.disabled) {\n this.#dropzoneEl?.removeAttribute('tabindex');\n this.#dropzoneEl?.setAttribute('aria-disabled', 'true');\n } else {\n this.#dropzoneEl?.setAttribute('tabindex', '0');\n this.#dropzoneEl?.setAttribute('aria-disabled', 'false');\n }\n }\n\n if (name === 'multiple' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.multiple = this.multiple;\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('accept');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('maxFiles');\n this.#upgradeProperty('maxSize');\n this.#upgradeProperty('minSize');\n this.#upgradeProperty('multiple');\n this.#upgradeProperty('autoFocus');\n this.#upgradeProperty('noStyle');\n\n this.#fileInput?.addEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.addEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.addEventListener('click', this.#handleClick);\n this.#dropzoneEl?.addEventListener('keyup', this.#handleKeyUp);\n\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#fileInput?.removeEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.removeEventListener('click', this.#handleClick);\n this.#dropzoneEl?.removeEventListener('keyup', this.#handleKeyUp);\n }\n\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */\n get accept() {\n return this.getAttribute('accept') || '';\n }\n\n set accept(value) {\n this.setAttribute('accept', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */\n get maxFiles() {\n const num = Number(this.getAttribute('max-files')) || 0;\n\n if (num <= 0) {\n return Infinity;\n }\n\n return Math.floor(Math.abs(num));\n }\n\n set maxFiles(value) {\n this.setAttribute('max-files', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */\n get maxSize() {\n const value = this.getAttribute('max-size');\n\n if (value === null) {\n return Infinity;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? Infinity : num;\n }\n\n set maxSize(value) {\n this.setAttribute('max-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */\n get minSize() {\n const value = this.getAttribute('min-size');\n\n if (value === null) {\n return 0;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? 0 : num;\n }\n\n set minSize(value) {\n this.setAttribute('min-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */\n get multiple() {\n return this.hasAttribute('multiple');\n }\n\n set multiple(value) {\n this.toggleAttribute('multiple', !!value);\n }\n\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */\n get autoFocus() {\n return this.hasAttribute('auto-focus');\n }\n\n set autoFocus(value) {\n this.toggleAttribute('auto-focus', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */\n get noStyle() {\n return this.hasAttribute('no-style');\n }\n\n set noStyle(value) {\n this.toggleAttribute('no-style', !!value);\n }\n\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */\n #handleFileInputChange = async evt => {\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n };\n\n /**\n * Handles the dragenter event of the dropzone.\n */\n #handleDragEnter = () => {\n if (this.disabled) {\n return;\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDragOver = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n evt.dataTransfer.dropEffect = 'none';\n return;\n }\n\n evt.dataTransfer.dropEffect = 'copy';\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add('dropzone--dragover');\n this.#dropzoneEl.part.add('dropzone--dragover');\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the dragleave event of the dropzone.\n */\n #handleDragLeave = () => {\n if (this.disabled) {\n return;\n }\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDrop = async evt => {\n if (this.disabled) {\n return;\n }\n\n evt.preventDefault();\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n };\n\n /**\n * Handles the click event of the dropzone.\n */\n #handleClick = () => {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n };\n\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleKeyUp = evt => {\n if (this.disabled) {\n return;\n }\n\n if (evt.key === ' ' || evt.key === 'Enter') {\n this.#fileInput?.click();\n }\n };\n\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */\n #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) {\n return;\n }\n\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) {\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [\n {\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }\n ]\n });\n }\n } else if (this.multiple && filesLength > this.maxFiles) {\n // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [\n {\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? 'files are' : 'file is'} allowed.`\n }\n ]\n });\n }\n } else {\n // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files) {\n const fileHasValidType = isValidFile(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) {\n acceptedFiles.push(file);\n } else {\n const errors = [];\n\n if (!fileHasValidType) {\n errors.push({\n code: INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n }\n\n if (fileExceedsMaxSize) {\n errors.push({\n code: FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n }\n\n if (fileIsSmallerThanMinSize) {\n errors.push({\n code: FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n }\n\n rejectedFiles.push({ file, errors });\n }\n }\n }\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles,\n rejectedFiles\n }\n })\n );\n\n if (acceptedFiles.length > 0) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles\n }\n })\n );\n }\n\n if (rejectedFiles.length > 0) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles\n }\n })\n );\n }\n\n if (this.#fileInput) {\n this.#fileInput.value = this.#fileInput.defaultValue;\n }\n }\n\n /**\n * Opens the file dialog programmatically.\n */\n openFileDialog() {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, FilesDropzone);\n }\n }\n}\n\nexport { FilesDropzone };\n","import { FilesDropzone } from './files-dropzone.js';\n\nFilesDropzone.defineCustomElement();\n\nexport { FilesDropzone };\n","/*!\n * @georapbox/resize-observer-element\n * A custom element that offers a declarative interface to the ResizeObserver API.\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/resize-observer-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar d=\":host { display: contents; }\",o=document.createElement(\"template\");o.innerHTML=`\n \n \n`;var s=class n extends HTMLElement{#e=null;#t=null;#s=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(o.content.cloneNode(!0)),this.#e=this.shadowRoot?.querySelector(\"slot\")??null}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(e,t,i){e===\"disabled\"&&t!==i&&(this.disabled?this.#o():this.#i())}connectedCallback(){this.#d(\"disabled\"),\"ResizeObserver\"in window&&(this.#t=new ResizeObserver(e=>{this.dispatchEvent(new CustomEvent(\"resize-observer:resize\",{bubbles:!0,composed:!0,detail:{entries:e}}))}),this.disabled||this.#i(),this.#e?.addEventListener(\"slotchange\",this.#n))}disconnectedCallback(){this.#o(),this.#e?.removeEventListener(\"slotchange\",this.#n)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}#i(){!this.#e||!this.#t||(this.#s.forEach(e=>this.#t?.unobserve(e)),this.#s=[],this.#e.assignedElements().forEach(e=>{this.#t?.observe(e),this.#s.push(e)}))}#o(){this.#t?.disconnect()}#n=()=>{this.disabled||this.#i()};#d(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}static defineCustomElement(e=\"resize-observer\"){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,n)}};s.defineCustomElement();export{s as ResizeObserverElement};\n//# sourceMappingURL=resize-observer-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst styles = /* css */ `:host { display: contents; }`;\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that offers a declarative interface to the ResizeObserver API.\n * @documentation https://github.com/georapbox/resize-observer-element#readme\n *\n * @tagname resize-observer - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Whether the resize observer is disabled.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n *\n * @slot - The default slot where the elements to observe are placed.\n *\n * @event resize-observer:resize - Dispatched when the observed elements are resized.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n */\nclass ResizeObserverElement extends HTMLElement {\n /** @type {Nullable} */\n #slotEl = null;\n\n /** @type {Nullable} */\n #resizeObserver = null;\n\n /** @type {Element[]} */\n #observedElements = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#slotEl = this.shadowRoot?.querySelector('slot') ?? null;\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue) {\n this.disabled ? this.#stopObserver() : this.#startObserver();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('disabled');\n\n if ('ResizeObserver' in window) {\n this.#resizeObserver = new ResizeObserver(entries => {\n this.dispatchEvent(\n new CustomEvent('resize-observer:resize', {\n bubbles: true,\n composed: true,\n detail: { entries }\n })\n );\n });\n\n if (!this.disabled) {\n this.#startObserver();\n }\n\n this.#slotEl?.addEventListener('slotchange', this.#handleSlotChange);\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#stopObserver();\n this.#slotEl?.removeEventListener('slotchange', this.#handleSlotChange);\n }\n\n /**\n * @type {boolean} - Whether the resize observer is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * Starts observing the elements in the slot.\n */\n #startObserver() {\n if (!this.#slotEl || !this.#resizeObserver) {\n return;\n }\n\n this.#observedElements.forEach(el => this.#resizeObserver?.unobserve(el));\n this.#observedElements = [];\n\n this.#slotEl.assignedElements().forEach(el => {\n this.#resizeObserver?.observe(el);\n this.#observedElements.push(el);\n });\n }\n\n /**\n * Stops observing the elements in the slot.\n */\n #stopObserver() {\n this.#resizeObserver?.disconnect();\n }\n\n /**\n * Handles slot change event.\n */\n #handleSlotChange = () => {\n if (!this.disabled) {\n this.#startObserver();\n }\n };\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='resize-observer'] - The name of the custom element.\n * @example\n *\n * ResizeObserverElement.defineCustomElement('my-resize-observer');\n */\n static defineCustomElement(elementName = 'resize-observer') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ResizeObserverElement);\n }\n }\n}\n\nexport { ResizeObserverElement };\n","import { ResizeObserverElement } from './resize-observer.js';\n\nResizeObserverElement.defineCustomElement();\n\nexport { ResizeObserverElement };\n","/*!\n * @georapbox/modal-element\n * A custom element to create a modal, using the native dialog element under the hood.\n *\n * @version 1.8.0\n * @homepage https://github.com/georapbox/modal-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar n=document.createElement(\"template\"),r=`\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: 300ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;n.innerHTML=`\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;var a=class s extends HTMLElement{#e=null;#i=null;#a=null;#o=void 0;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(n.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.querySelector(\"dialog\"),this.#i=this.shadowRoot.querySelector('slot[name=\"footer\"]'),this.#a=this.shadowRoot.querySelector('slot[name=\"close\"]'))}static get observedAttributes(){return[\"open\",\"no-header\",\"no-animations\",\"no-close-button\",\"close-label\"]}attributeChangedCallback(e,t,i){if(this.#e!==null){if(e===\"open\"&&t!==i&&(this.open?(this.#e.showModal(),this.dispatchEvent(new CustomEvent(\"me-open\",{bubbles:!0,composed:!0,detail:{element:this}})),document.body&&!this.preserveOverflow&&(document.body.style.overflow=\"hidden\")):this.#e.close()),e===\"no-header\"&&t!==i){let o=this.#e.querySelector(\".dialog__header\");o!==null&&(o.hidden=this.noHeader)}if(e===\"no-animations\"&&t!==i&&this.#e.classList.toggle(\"dialog--no-animations\",this.noAnimations),e===\"no-close-button\"&&t!==i){let o=this.#e.querySelector(\".dialog__close\");o!==null&&(o.hidden=this.noCloseButton)}e===\"close-label\"&&t!==i&&this.#r()}}connectedCallback(){this.#t(\"open\"),this.#t(\"staticBackdrop\"),this.#t(\"noHeader\"),this.#t(\"noAnimations\"),this.#t(\"noCloseButton\"),this.#t(\"fullscreen\"),this.#t(\"preserveOverflow\"),this.#t(\"placement\"),this.#t(\"closeLabel\"),this.#e?.addEventListener(\"click\",this.#h),this.#e?.addEventListener(\"close\",this.#l),this.#e?.addEventListener(\"cancel\",this.#d),this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\",this.#c),this.#i?.addEventListener(\"slotchange\",this.#m),this.#a?.addEventListener(\"slotchange\",this.#g)}disconnectedCallback(){this.#o&&clearTimeout(this.#o),this.#e?.addEventListener(\"click\",this.#h),this.#e?.removeEventListener(\"close\",this.#l),this.#e?.removeEventListener(\"cancel\",this.#d),this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\",this.#c),this.#i?.removeEventListener(\"slotchange\",this.#m),this.#a?.removeEventListener(\"slotchange\",this.#g)}get open(){return this.hasAttribute(\"open\")}set open(e){this.toggleAttribute(\"open\",!!e)}get staticBackdrop(){return this.hasAttribute(\"static-backdrop\")}set staticBackdrop(e){this.toggleAttribute(\"static-backdrop\",!!e)}get noHeader(){return this.hasAttribute(\"no-header\")}set noHeader(e){this.toggleAttribute(\"no-header\",!!e)}get noAnimations(){return this.hasAttribute(\"no-animations\")}set noAnimations(e){this.toggleAttribute(\"no-animations\",!!e)}get noCloseButton(){return this.hasAttribute(\"no-close-button\")}set noCloseButton(e){this.toggleAttribute(\"no-close-button\",!!e)}get fullscreen(){return this.hasAttribute(\"fullscreen\")}set fullscreen(e){this.toggleAttribute(\"fullscreen\",!!e)}get preserveOverflow(){return this.hasAttribute(\"preserve-overflow\")}set preserveOverflow(e){this.toggleAttribute(\"preserve-overflow\",!!e)}get placement(){return this.getAttribute(\"placement\")||\"center\"}set placement(e){this.setAttribute(\"placement\",e!=null?e.toString():e)}get closeLabel(){return this.getAttribute(\"close-label\")||\"Close\"}set closeLabel(e){this.setAttribute(\"close-label\",e!=null?e.toString():e)}#r(){if(this.#e===null)return;let e=this.#e.querySelector(\".dialog__close\");if(e===null)return;(this.#a?.assignedElements()||[])?.some(o=>o.textContent?.replace(/\\s/g,\"\")!==\"\")?e.removeAttribute(\"aria-label\"):e.setAttribute(\"aria-label\",this.closeLabel)}#n(){this.#o||(this.#e?.classList.add(\"dialog--pulse\"),this.#o=setTimeout(()=>{this.#e?.classList.remove(\"dialog--pulse\"),clearTimeout(this.#o),this.#o=void 0},300))}#l=()=>{this.open=!1,this.dispatchEvent(new CustomEvent(\"me-close\",{bubbles:!0,composed:!0,detail:{element:this}})),document.body&&!this.preserveOverflow&&(document.body.style.overflow=\"\")};#d=e=>{let t=this.#s(\"escape-key\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),!this.noAnimations&&this.#n())};#c=e=>{let t=this.#s(\"close-button\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),!this.noAnimations&&this.#n())};#h=e=>{let t=e.target,i=e.currentTarget;if(t===i){let o=this.#s(\"backdrop-click\");this.dispatchEvent(o),o.defaultPrevented||this.staticBackdrop?!this.noAnimations&&this.#n():this.hide()}if(t instanceof HTMLElement&&t.closest(\"[data-me-close]\")!==null){let o=this.#s(\"external-invoker\");this.dispatchEvent(o),o.defaultPrevented?!this.noAnimations&&this.#n():this.hide()}};#m=()=>{if(this.#e===null)return;let e=this.#e.querySelector(\".dialog__footer\");if(e===null)return;let t=this.#i?.assignedNodes(),i=t?t.length>0:!1;e.hidden=!i};#g=()=>{this.#r()};#s(e){return new CustomEvent(\"me-request-close\",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,element:this}})}#t(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}show(){this.open||(this.open=!0)}hide(){this.open&&(this.open=!1)}static defineCustomElement(e=\"modal-element\"){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,s)}};a.defineCustomElement();export{a as ModalElement};\n//# sourceMappingURL=modal-element-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Available values for the request close reason.\n *\n * @typedef {'close-button' | 'escape-key' | 'backdrop-click' | 'external-invoker'} CloseRequestReason\n */\n\nconst PULSE_ANIMATION_DURATION = 300; // milliseconds\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: ${PULSE_ANIMATION_DURATION}ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;\n\n/**\n * @summary A custom element that renders a modal dialog.\n * @documentation https://github.com/georapbox/modal-element\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines whether the modal is open or not.\n * @property {boolean} staticBackdrop - Determines whether the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines whether the modal should have a header or not.\n * @property {boolean} noAnimations - Determines whether the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines whether the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines whether the modal should be fullscreen or not.\n * @property {boolean} preserveOverflow - Determines whether the overflow of the body should be preserved when the modal is open.\n * @property {string} placement - Determines the placement of the modal.\n * @property {string} closeLabel - The label of the default close button, used as the aria-label attribute of the close button.\n *\n * @attribute {boolean} open - Reflects the open property.\n * @attribute {boolean} static-backdrop - Reflects the staticBackdrop property.\n * @attribute {boolean} no-header - Reflects the noHeader property.\n * @attribute {boolean} no-animations - Reflects the noAnimations property.\n * @attribute {boolean} no-close-button - Reflects the noCloseButton property.\n * @attribute {boolean} fullscreen - Reflects the fullscreen property.\n * @attribute {boolean} preserve-overflow - Reflects the preserveOverflow property.\n * @attribute {string} placement - Reflects the placement property.\n * @attribute {string} close-label - Reflects the closeLabel property.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal.\n * @cssproperty --me-height - The height of the modal.\n * @cssproperty --me-border-color - The border color of the modal.\n * @cssproperty --me-border-style - The border style of the modal.\n * @cssproperty --me-border-width - The border width of the modal.\n * @cssproperty --me-border-radius - The border radius of the modal.\n * @cssproperty --me-box-shadow - The box shadow of the modal.\n * @cssproperty --me-background-color - The background color of the modal.\n * @cssproperty --me-color - The foreground color of the modal.\n * @cssproperty --me-header-spacing - The spacing of the header.\n * @cssproperty --me-header-background-color - The background color of the header.\n * @cssproperty --me-header-color - The foreground color of the header.\n * @cssproperty --me-body-spacing - The spacing of the body.\n * @cssproperty --me-body-background-color - The background color of the body.\n * @cssproperty --me-body-color - The foreground color of the body.\n * @cssproperty --me-footer-spacing - The spacing of the footer.\n * @cssproperty --me-footer-background-color - The background color of the footer.\n * @cssproperty --me-footer-color - The foreground color of the footer.\n * @cssproperty --me-close-padding - The padding of the close button.\n * @cssproperty --me-close-border - The border shorthand property of the close button.\n * @cssproperty --me-close-border-radius - The border radius shorthand property of the close button.\n * @cssproperty --me-close-background-color - The background color of the close button.\n * @cssproperty --me-close-color - The foreground color of the close button.\n * @cssproperty --me-close-font-size - The font size of the close button.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop.\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart close - The default close button rendered in the modal's header.\n * @csspart close-icon - The close icon of the default close button.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n */\nclass ModalElement extends HTMLElement {\n /** @type {Nullable} */\n #dialogEl = null;\n\n /** @type {Nullable} */\n #footerSlotEl = null;\n\n /** @type {Nullable} */\n #closeSlotEl = null;\n\n /** @type {ReturnType | undefined} */\n #pulseAnimationTimeout = void 0;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector('dialog');\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n this.#closeSlotEl = this.shadowRoot.querySelector('slot[name=\"close\"]');\n }\n }\n\n static get observedAttributes() {\n return ['open', 'no-header', 'no-animations', 'no-close-button', 'close-label'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) {\n return;\n }\n\n if (name === 'open' && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n\n this.dispatchEvent(\n new CustomEvent('me-open', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n })\n );\n\n if (document.body && !this.preserveOverflow) {\n document.body.style.overflow = 'hidden';\n }\n } else {\n this.#dialogEl.close();\n }\n }\n\n if (name === 'no-header' && oldValue !== newValue) {\n /** @type {Nullable} */\n const headerEl = this.#dialogEl.querySelector('.dialog__header');\n\n if (headerEl !== null) {\n headerEl.hidden = this.noHeader;\n }\n }\n\n if (name === 'no-animations' && oldValue !== newValue) {\n this.#dialogEl.classList.toggle('dialog--no-animations', this.noAnimations);\n }\n\n if (name === 'no-close-button' && oldValue !== newValue) {\n /** @type {Nullable} */\n const closeBtnEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeBtnEl !== null) {\n closeBtnEl.hidden = this.noCloseButton;\n }\n }\n\n if (name === 'close-label' && oldValue !== newValue) {\n this.#updateCloseLabel();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('open');\n this.#upgradeProperty('staticBackdrop');\n this.#upgradeProperty('noHeader');\n this.#upgradeProperty('noAnimations');\n this.#upgradeProperty('noCloseButton');\n this.#upgradeProperty('fullscreen');\n this.#upgradeProperty('preserveOverflow');\n this.#upgradeProperty('placement');\n this.#upgradeProperty('closeLabel');\n\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.addEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.addEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener('slotchange', this.#handleFooterSlotChange);\n this.#closeSlotEl?.addEventListener('slotchange', this.#handleCloseSlotChange);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.removeEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.removeEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener('slotchange', this.#handleFooterSlotChange);\n this.#closeSlotEl?.removeEventListener('slotchange', this.#handleCloseSlotChange);\n }\n\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */\n get open() {\n return this.hasAttribute('open');\n }\n\n set open(value) {\n this.toggleAttribute('open', !!value);\n }\n\n /**\n * Determines whether the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */\n get staticBackdrop() {\n return this.hasAttribute('static-backdrop');\n }\n\n set staticBackdrop(value) {\n this.toggleAttribute('static-backdrop', !!value);\n }\n\n /**\n * Determines whether the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */\n get noHeader() {\n return this.hasAttribute('no-header');\n }\n\n set noHeader(value) {\n this.toggleAttribute('no-header', !!value);\n }\n\n /**\n * Determines whether the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */\n get noAnimations() {\n return this.hasAttribute('no-animations');\n }\n\n set noAnimations(value) {\n this.toggleAttribute('no-animations', !!value);\n }\n\n /**\n * Determines whether the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */\n get noCloseButton() {\n return this.hasAttribute('no-close-button');\n }\n\n set noCloseButton(value) {\n this.toggleAttribute('no-close-button', !!value);\n }\n\n /**\n * Determines whether the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */\n get fullscreen() {\n return this.hasAttribute('fullscreen');\n }\n\n set fullscreen(value) {\n this.toggleAttribute('fullscreen', !!value);\n }\n\n /**\n * Determines whether the overflow of the body should be preserved when the modal is open.\n *\n * @type {boolean} - True if the overflow of the body should be preserved, otherwise false.\n * @default false\n * @attribute preserve-overflow - Reflects the preserveOverflow property.\n */\n get preserveOverflow() {\n return this.hasAttribute('preserve-overflow');\n }\n\n set preserveOverflow(value) {\n this.toggleAttribute('preserve-overflow', !!value);\n }\n\n /**\n * Determines the placement of the modal.\n * Possible values are 'top-start', 'top-center', 'top-end', 'center-start', 'center', 'center-end', 'bottom-start', 'bottom-center', 'bottom-end'.\n *\n * @type {string}\n * @default 'center'\n * @attribute placement - Reflects the placement property.\n */\n get placement() {\n return this.getAttribute('placement') || 'center';\n }\n\n set placement(value) {\n this.setAttribute('placement', value != null ? value.toString() : value);\n }\n\n /**\n * The label of the default close button, used as the aria-label attribute of the close button.\n * If user provides text content for the close button using the `close` slot, this property is ignored and the aria-label attribute is removed.\n *\n * @type {string}\n * @default 'Close'\n * @attribute close-label - Reflects the closeLabel property.\n */\n get closeLabel() {\n return this.getAttribute('close-label') || 'Close';\n }\n\n set closeLabel(value) {\n this.setAttribute('close-label', value != null ? value.toString() : value);\n }\n\n /**\n * Updates the aria-label attribute of the close button.\n * If the slot for the close button has text content, the aria-label attribute is removed to allow the text content to be used as the label.\n * Otherwise, the aria-label attribute is set to the `closeLabel` property.\n *\n * @returns\n */\n #updateCloseLabel() {\n if (this.#dialogEl === null) {\n return;\n }\n\n const closeButtonEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeButtonEl === null) {\n return;\n }\n\n const assignedElements = this.#closeSlotEl?.assignedElements() || [];\n const hasTextContent = assignedElements?.some(el => el.textContent?.replace(/\\s/g, '') !== '');\n\n hasTextContent\n ? closeButtonEl.removeAttribute('aria-label')\n : closeButtonEl.setAttribute('aria-label', this.closeLabel);\n }\n\n /**\n * Applies a pulse effect on the dialog.\n */\n #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) {\n return;\n }\n\n this.#dialogEl?.classList.add('dialog--pulse');\n\n this.#pulseAnimationTimeout = setTimeout(() => {\n this.#dialogEl?.classList.remove('dialog--pulse');\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, PULSE_ANIMATION_DURATION);\n }\n\n /**\n * Handles the close event of the dialog.\n */\n #handleDialogClose = () => {\n // This is required because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n\n this.dispatchEvent(\n new CustomEvent('me-close', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n })\n );\n\n if (document.body && !this.preserveOverflow) {\n document.body.style.overflow = '';\n }\n };\n\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */\n #handleDialogCancel = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('escape-key');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('close-button');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleDialogClick = evt => {\n const target = evt.target;\n const currentTarget = evt.currentTarget;\n\n // Close the dialog when the backdrop is clicked.\n if (target === currentTarget) {\n const requestCloseEvent = this.#createRequestCloseEvent('backdrop-click');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n } else {\n this.hide();\n }\n }\n\n // Close the dialog when external invoker is clicked.\n if (target instanceof HTMLElement && target.closest('[data-me-close]') !== null) {\n const requestCloseEvent = this.#createRequestCloseEvent('external-invoker');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n } else {\n this.hide();\n }\n }\n };\n\n /**\n * Handles the slotchange event of the footer slot.\n */\n #handleFooterSlotChange = () => {\n if (this.#dialogEl === null) {\n return;\n }\n\n /** @type {Nullable} */\n const footerEl = this.#dialogEl.querySelector('.dialog__footer');\n\n if (footerEl === null) {\n return;\n }\n\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n\n footerEl.hidden = !hasFooterSlotNodes;\n };\n\n /**\n * Handles the slotchange event of the close slot.\n */\n #handleCloseSlotChange = () => {\n this.#updateCloseLabel();\n };\n\n /**\n * Creates a request close event.\n *\n * @param {CloseRequestReason} reason - The reason that the modal is about to close.\n */\n #createRequestCloseEvent(reason) {\n return new CustomEvent('me-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason,\n element: this\n }\n });\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen' | 'preserveOverflow' | 'placement' | 'closeLabel'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */\n show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n }\n\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */\n hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */\n static defineCustomElement(elementName = 'modal-element') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ModalElement);\n }\n }\n}\n\nexport { ModalElement };\n","import { ModalElement } from './modal-element.js';\n\nModalElement.defineCustomElement();\n\nexport { ModalElement };\n","export const EXPERIMENTAL_FLAG = 'experimental';\n\nexport const NO_BARCODE_DETECTED = 'No barcode detected';\n\nexport const ACCEPTED_MIME_TYPES = [\n 'image/jpg',\n 'image/jpeg',\n 'image/png',\n 'image/apng',\n 'image/gif',\n 'image/webp',\n 'image/avif'\n];\n","import { set, get } from 'idb-keyval';\n\nconst STORAGE_PREFIX = 'barcode-scanner/';\nconst SETTINGS_STORAGE_KEY = 'settings';\nconst HISTORY_STORAGE_KEY = 'history';\n\n/**\n * Gets an item from the storage.\n *\n * @param {string} key - The key to get the item from.\n * @returns {Promise<[ error: any, value: any ]>} The item and an error if occurred.\n */\nconst getItem = async key => {\n try {\n return [null, await get(key)];\n } catch (error) {\n return [error, void 0];\n }\n};\n\n/**\n * Sets an item in the storage.\n *\n * @param {string} key - The key to set the item to.\n * @param {any} data - The data to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nconst setItem = async (key, data) => {\n try {\n await set(key, data);\n\n return [null];\n } catch (error) {\n return [error];\n }\n};\n\n/**\n * Gets the settings from the storage.\n *\n * @returns {Promise<[ error: any, value: any ]>} The settings and an error if occurred.\n */\nexport const getSettings = async () => {\n return getItem(STORAGE_PREFIX + SETTINGS_STORAGE_KEY);\n};\n\n/**\n * Sets the settings in the storage.\n *\n * @param {any} data - The settings to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nexport const setSettings = async data => {\n return setItem(STORAGE_PREFIX + SETTINGS_STORAGE_KEY, data);\n};\n\n/**\n * Gets the history from the storage.\n *\n * @returns {Promise<[ error: any, value: any ]>} The history and an error if occurred.\n */\nexport const getHistory = async () => {\n return getItem(STORAGE_PREFIX + HISTORY_STORAGE_KEY);\n};\n\n/**\n * Sets the history in the storage.\n *\n * @param {any} data - The history to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nexport const setHistory = async data => {\n return setItem(STORAGE_PREFIX + HISTORY_STORAGE_KEY, data);\n};\n","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction promisifyRequest(request) {\n return new Promise(function (resolve, reject) {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = function () {\n return resolve(request.result);\n }; // @ts-ignore - file size hacks\n\n\n request.onabort = request.onerror = function () {\n return reject(request.error);\n };\n });\n}\n\nfunction createStore(dbName, storeName) {\n var request = indexedDB.open(dbName);\n\n request.onupgradeneeded = function () {\n return request.result.createObjectStore(storeName);\n };\n\n var dbp = promisifyRequest(request);\n return function (txMode, callback) {\n return dbp.then(function (db) {\n return callback(db.transaction(storeName, txMode).objectStore(storeName));\n });\n };\n}\n\nvar defaultGetStoreFunc;\n\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction get(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readonly', function (store) {\n return promisifyRequest(store.get(key));\n });\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction set(key, value) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction setMany(entries) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n entries.forEach(function (entry) {\n return store.put(entry[1], entry[0]);\n });\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction getMany(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readonly', function (store) {\n return Promise.all(keys.map(function (key) {\n return promisifyRequest(store.get(key));\n }));\n });\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction update(key, updater) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();\n return customStore('readwrite', function (store) {\n return (// Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise(function (resolve, reject) {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n })\n );\n });\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction del(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction delMany(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n keys.forEach(function (key) {\n return store.delete(key);\n });\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction clear() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\n\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction keys() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n\n var items = [];\n return eachCursor(store, function (cursor) {\n return items.push(cursor.key);\n }).then(function () {\n return items;\n });\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction values() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n\n var items = [];\n return eachCursor(store, function (cursor) {\n return items.push(cursor.value);\n }).then(function () {\n return items;\n });\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction entries() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([promisifyRequest(store.getAllKeys()), promisifyRequest(store.getAll())]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n keys = _ref2[0],\n values = _ref2[1];\n\n return keys.map(function (key, i) {\n return [key, values[i]];\n });\n });\n }\n\n var items = [];\n return customStore('readonly', function (store) {\n return eachCursor(store, function (cursor) {\n return items.push([cursor.key, cursor.value]);\n }).then(function () {\n return items;\n });\n });\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * 'n' milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {function} fn The function to be executed.\n * @param {Number} [wait=0] Time of delay in milliseconds. It is required if `immediate` is used.\n * @param {Boolean} [immediate=false] If true or any truthy value, triggers the function on the leading edge.\n * @throws {TypeError} If `fn` is not function.\n * @returns {function} A new debounced function.\n * @example\n *\n * const debouncedHandler = debounce(() => {\n * // Do your thing here...\n * }, 250);\n *\n * window.addEventListener('resize', debouncedHandler, false);\n */\nconst debounce = (fn, wait = 0, immediate = false) => {\n let timerId = null;\n\n if (typeof fn !== 'function') {\n throw new TypeError('Expected a function for first argument');\n }\n\n return (...args) => {\n clearTimeout(timerId);\n\n if (immediate && !timerId) {\n fn(...args);\n }\n\n timerId = setTimeout(() => {\n timerId = null;\n if (!immediate) {\n fn(...args);\n }\n }, wait);\n };\n};\n\nexport { debounce };\n","/**\n * Log to console only in development mode.\n *\n * @param {...any} args - Arguments to log\n */\nexport function log(...args) {\n process.env.NODE_ENV === 'development' && console.log(...args);\n}\n","/**\n * Check if the dialog element is supported.\n *\n * @returns {boolean} - Returns true if the dialog element is supported.\n */\nexport const isDialogElementSupported = () => {\n return typeof HTMLDialogElement === 'function';\n};\n","/**\n * Renders the supported formats.\n *\n * @param {Array} formats - Supported barcode formats\n */\nexport function renderSupportedFormats(formats) {\n if (!Array.isArray(formats) || formats.length === 0) {\n return;\n }\n\n const supportedFormatsEl = document.getElementById('supportedFormats');\n\n if (!supportedFormatsEl) {\n return;\n }\n\n supportedFormatsEl.textContent = `Supported formats: ${formats.join(', ')}`;\n}\n","import { getHistory, setHistory, getSettings } from '../services/storage.js';\n\n/**\n * Renders the history list. If there are no items in history, it will show a message.\n *\n * @param {Array} data - Hidsoty data as an array of strings\n */\nexport function renderHistoryList(data) {\n const historyList = document.getElementById('historyList');\n\n if (!historyList) {\n return;\n }\n\n const emptyHistoryBtn = document.getElementById('emptyHistoryBtn');\n\n historyList.replaceChildren();\n\n if (!Array.isArray(data) || data.length === 0) {\n historyList.innerHTML = '
  • There are no saved items in history.
  • ';\n emptyHistoryBtn.hidden = true;\n } else {\n emptyHistoryBtn.hidden = false;\n\n data.forEach((item, index) => {\n const li = document.createElement('li');\n li.setAttribute('data-value', item);\n\n let historyItem;\n\n try {\n new URL(item);\n historyItem = document.createElement('a');\n historyItem.href = item;\n historyItem.setAttribute('target', '_blank');\n historyItem.setAttribute('rel', 'noreferrer noopener');\n } catch {\n historyItem = document.createElement('span');\n }\n\n historyItem.textContent = item;\n historyItem.setAttribute('id', `historyItem-${index}`);\n\n const actionsEl = document.createElement('div');\n actionsEl.className = 'history-modal__actions';\n\n const copyBtn = document.createElement('custom-clipboard-copy');\n copyBtn.setAttribute('id', `copyHistoryItem-${index}`);\n copyBtn.setAttribute('aria-label', 'Copy to clipboard');\n copyBtn.setAttribute('aria-labelledby', `copyHistoryItem-${index} historyItem-${index}`);\n copyBtn.setAttribute('only-icon', '');\n copyBtn.setAttribute('value', item);\n actionsEl.appendChild(copyBtn);\n\n const removeBtn = document.createElement('button');\n removeBtn.type = 'button';\n removeBtn.className = 'history-modal__delete-action';\n removeBtn.setAttribute('data-action', 'delete');\n removeBtn.setAttribute('id', `removeHistoryItem-${index}`);\n removeBtn.setAttribute('aria-label', 'Remove from history');\n removeBtn.setAttribute('aria-labelledby', `removeHistoryItem-${index} historyItem-${index}`);\n removeBtn.innerHTML = /* html */ `\n \n \n \n `;\n actionsEl.appendChild(removeBtn);\n\n li.appendChild(historyItem);\n li.appendChild(actionsEl);\n historyList.appendChild(li);\n });\n }\n}\n\n/**\n * Adds an item to the history.\n * If the item is already in history, it will not be added.\n *\n * @param {string} item - Item to add to history\n */\nexport async function addToHistory(item) {\n const [, settings] = await getSettings();\n\n if (!item || !settings?.addToHistory) {\n return;\n }\n\n const [getHistoryError, history = []] = await getHistory();\n\n if (!getHistoryError && Array.isArray(history) && !history.find(h => h === item)) {\n const data = [...history, item];\n\n const [setHistoryError] = await setHistory(data);\n\n if (!setHistoryError) {\n renderHistoryList(data);\n }\n }\n}\n\n/**\n * Removes an item from the history.\n *\n * @param {string} item - Item to remove from history\n */\nexport async function removeFromHistory(item) {\n if (!item) {\n return;\n }\n\n const [getHistoryError, history = []] = await getHistory();\n\n if (!getHistoryError && Array.isArray(history)) {\n const data = history.filter(el => el !== item);\n const [setHistoryError] = await setHistory(data);\n\n if (!setHistoryError) {\n renderHistoryList(data);\n }\n }\n}\n\n/**\n * Removes all items from the history.\n */\nexport async function emptyHistory() {\n const [setHistoryError] = await setHistory([]);\n\n if (!setHistoryError) {\n renderHistoryList([]);\n }\n}\n","/**\n * Removes the scanned result from the element where it is shown.\n *\n * @param {HTMLElement} element - The element to remove the result from.\n */\nexport function hideResult(element) {\n if (!element) {\n return;\n }\n\n const scanResultEl = element.querySelector('scan-result');\n scanResultEl?.remove();\n}\n\n/**\n * Creates and shows the scanned result inside the given element.\n *\n * @param {HTMLElement} element - The element to show the result in.\n * @param {string} value - The value to create the result with.\n */\nexport async function showResult(element, value) {\n if (!element || !value) {\n return;\n }\n\n const oldScanResultEl = element.querySelector('scan-result');\n\n if (oldScanResultEl) {\n oldScanResultEl.setAttribute('value', value);\n } else {\n const newScanResultEl = document.createElement('scan-result');\n newScanResultEl.setAttribute('value', value);\n newScanResultEl.setAttribute('role', 'alert');\n newScanResultEl.setAttribute('aria-live', 'assertive');\n newScanResultEl.setAttribute('aria-atomic', 'true');\n element.appendChild(newScanResultEl);\n }\n}\n","import { getSettings } from '../services/storage.js';\nimport { beep } from '../utils/beep.js';\nimport { vibrate } from '../utils/vibrate.js';\n\n/**\n * Triggers the scan effects like beep and vibrate.\n *\n * @param {Object} options\n * @param {boolean} [options.success=true] - Whether to trigger the success or error effects.\n */\nexport async function triggerScanEffects(options = {}) {\n const { success = true } = options;\n const [, settings] = await getSettings();\n\n if (!settings) {\n return;\n }\n\n const beepConfig = success\n ? { duration: 200, frequency: 860, volume: 0.03, type: 'square' }\n : { duration: 300, frequency: 200, volume: 0.05, type: 'sawtooth' };\n\n settings.beep && beep(beepConfig);\n settings.vibrate && vibrate(success ? 100 : 200);\n}\n","/**\n * Beep sound using the `AudioContext` interface.\n *\n * @param {Object} options\n * @param {Number} options.duration - Duration in milliseconds\n * @param {Number} options.frequency - Frequency in Hz\n * @param {Number} options.volume - Volume\n * @param {String} options.type - Type of oscillator\n * @param {Function} options.onEnded - Callback function when the sound ends\n */\nexport const beep = (() => {\n const audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext)();\n\n if (!audioCtx) {\n return;\n }\n\n return options => {\n const { duration, frequency, volume, type, onEnded } = options;\n const oscillator = audioCtx.createOscillator();\n const gainNode = audioCtx.createGain();\n\n oscillator.connect(gainNode);\n gainNode.connect(audioCtx.destination);\n\n if (volume) {\n gainNode.gain.value = volume;\n }\n\n if (frequency) {\n oscillator.frequency.value = frequency;\n }\n\n if (type) {\n oscillator.type = type;\n }\n\n if (typeof onEnded === 'function') {\n oscillator.onended = onEnded;\n }\n\n oscillator.start(audioCtx.currentTime);\n oscillator.stop(audioCtx.currentTime + (duration || 500) / 1000);\n };\n})();\n","/**\n * Vibrate the device.\n * If the device does not support vibration, this function will fail silently.\n *\n * @param {Number} [duration=0] - Duration in milliseconds\n */\nexport async function vibrate(duration = 0) {\n if (typeof window.navigator.vibrate !== 'function') {\n return;\n }\n\n try {\n window.navigator.vibrate(duration);\n } catch {\n // Fail silently...\n }\n}\n","/**\n * Resizes the scan frame to match the video element's dimensions.\n *\n * @param {HTMLVideoElement} videoEl - Video element\n * @param {HTMLElement} scanFrameEl - Scan frame element\n */\nexport function resizeScanFrame(videoEl, scanFrameEl) {\n if (!videoEl || !scanFrameEl) {\n return;\n }\n\n const rect = videoEl.getBoundingClientRect();\n\n scanFrameEl.style.cssText = `width: ${rect.width}px; height: ${rect.height}px`;\n}\n","import { log } from '../utils/log.js';\n\n/**\n * BarcodeReader class to detect barcodes from images or videos.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector\n */\nclass BarcodeReader {\n static async polyfill() {\n if (!('BarcodeDetector' in window)) {\n try {\n await import('barcode-detector');\n log('Using BarcodeDetector polyfill.');\n } catch {\n throw new Error('BarcodeDetector API is not supported by your browser.');\n }\n } else {\n log('Using the native BarcodeDetector API.');\n }\n }\n\n /**\n * Get the supported barcode formats.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/getSupportedFormats\n * @returns {Promise>} - Supported barcode formats\n */\n static async getSupportedFormats() {\n return await window.BarcodeDetector.getSupportedFormats();\n }\n\n /**\n * Create a new BarcodeReader instance.\n *\n * @returns {Promise} - New BarcodeReader instance\n */\n static async create() {\n const formats = await window.BarcodeDetector.getSupportedFormats();\n return new BarcodeReader(formats);\n }\n\n /**\n * Initialize the BarcodeReader.\n *\n * @returns {Promise<{ barcodeReader: BarcodeReader, barcodeFormats: Array, barcodeReaderError: Error }>} - BarcodeReader instance, supported formats, and error\n */\n static async init() {\n try {\n await BarcodeReader.polyfill();\n const barcodeReader = await BarcodeReader.create();\n const barcodeFormats = await BarcodeReader.getSupportedFormats();\n return { barcodeReader, barcodeFormats, barcodeReaderError: null };\n } catch (error) {\n return {\n barcodeReader: null,\n barcodeFormats: [],\n barcodeReaderError: error\n };\n }\n }\n\n /**\n * Create a new BarcodeReader instance.\n *\n * @param {Array} formats - Supported barcode formats\n */\n constructor(formats) {\n this.barcodeReader = new window.BarcodeDetector({ formats });\n }\n\n /**\n * Detect barcodes from the provided source.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/detect\n * @param {HTMLImageElement|HTMLVideoElement|ImageBitmap} source - Image or video element or ImageBitmap\n * @returns {Promise} - Barcode detection result\n */\n async detect(source) {\n if (!this.barcodeReader) {\n throw new Error('BarcodeReader is not initialized.');\n }\n\n const results = await this.barcodeReader.detect(source);\n\n if (Array.isArray(results) && results.length > 0) {\n return results[0];\n } else {\n throw new Error('Could not detect barcode from provided source.');\n }\n }\n}\n\nexport { BarcodeReader };\n","import { getSettings } from '../services/storage.js';\n\n/**\n * Initialize the settings form with the saved settings.\n * If a setting is not found, it will be ignored.\n *\n * @param {HTMLFormElement} form - The settings form to initialize.\n */\nexport async function initializeSettingsForm(form) {\n const [, settings = {}] = await getSettings();\n\n Object.entries(settings).forEach(([key, value]) => {\n const settingInput = form.querySelector(`[name=\"${key}\"]`);\n\n if (!settingInput) {\n return;\n }\n\n settingInput.checked = value;\n });\n}\n","/**\n * Toggles the torch button status.\n * The torch button has two icons, one for on and one for off.\n * This function toggles the visibility of the icons based on the torch state and updates the button title.\n *\n * @param {HTMLButtonElement} buttonEl - The torch button element.\n * @param {boolean} isTorchOn - The torch state.\n */\nexport function toggleTorchButtonStatus(options = {}) {\n const defaults = {\n el: document.getElementById('torchButton'),\n isTorchOn: false\n };\n const { el, isTorchOn } = { ...defaults, ...options };\n const iconPaths = el.querySelectorAll('svg path');\n\n if (iconPaths.length !== 2) {\n return;\n }\n\n iconPaths[0].style.display = isTorchOn ? 'none' : 'block';\n iconPaths[1].style.display = isTorchOn ? 'block' : 'none';\n el.setAttribute('title', `Turn ${isTorchOn ? 'off' : 'on'} flash`);\n}\n","import { clamp } from '../utils/clamp.js';\n\nconst COMPONENT_NAME = 'video-capture';\n\nconst styles = /* css */ `\n :host { display: block; box-sizing: border-box; }\n :host *, :host *::before, :host *::after { box-sizing: inherit;}\n :host([hidden]), [hidden], ::slotted([hidden]) { display: none; }\n video { display: block; }\n #output:empty { display: none; }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n
    \n \n`;\n\nclass VideoCapture extends HTMLElement {\n #supportedConstraints = {};\n #stream = null;\n #videoElement = null;\n\n constructor() {\n super();\n\n this.#supportedConstraints = this.getSupportedConstraints();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['no-image', 'pan', 'tilt', 'zoom', 'torch'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) {\n return;\n }\n\n const trackCapabilities = this.getTrackCapabilities();\n\n if (name === 'zoom' && oldValue !== newValue && 'zoom' in this.#supportedConstraints) {\n const zoomInAllowedRange =\n 'zoom' in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max\n ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max\n : false;\n\n if (typeof this.zoom === 'number' && zoomInAllowedRange) {\n this.#applyConstraint('zoom', this.zoom);\n }\n }\n\n if (name === 'torch' && oldValue !== newValue && 'torch' in this.#supportedConstraints) {\n this.#applyConstraint('torch', this.torch);\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n async connectedCallback() {\n this.#upgradeProperty('autoPlay');\n this.#upgradeProperty('facingMode');\n this.#upgradeProperty('zoom');\n this.#upgradeProperty('torch');\n\n this.#videoElement = this.shadowRoot?.querySelector('video') || null;\n\n this.#videoElement?.addEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n\n if (!VideoCapture.isSupported()) {\n return this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: 'NotSupportedError',\n message: 'Not supported'\n }\n }\n })\n );\n }\n\n if (this.autoPlay) {\n this.startVideoStream();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.stopVideoStream();\n this.#videoElement?.removeEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n }\n\n get autoPlay() {\n return this.hasAttribute('auto-play');\n }\n\n set autoPlay(value) {\n this.toggleAttribute('auto-play', !!value);\n }\n\n get facingMode() {\n return this.getAttribute('facing-mode') || 'user';\n }\n\n set facingMode(value) {\n this.setAttribute('facing-mode', value);\n }\n\n get zoom() {\n return Number(this.getAttribute('zoom')) || 1;\n }\n\n set zoom(value) {\n this.setAttribute('zoom', value != null ? value.toString() : value);\n }\n\n get torch() {\n return this.hasAttribute('torch');\n }\n\n set torch(value) {\n this.toggleAttribute('torch', !!value);\n }\n\n get loading() {\n return this.hasAttribute('loading');\n }\n\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {Event} evt - The event object.\n */\n #onVideoLoadedMetaData = evt => {\n const video = evt.target;\n\n video\n .play()\n .then(() => {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: { video }\n })\n );\n })\n .catch(error => {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n })\n .finally(() => {\n this.removeAttribute('loading');\n });\n };\n\n /**\n * Applies a constraint to the video track.\n *\n * @param {string} constraint - The name of the constraint.\n * @param {any} value - The value of the constraint.\n */\n #applyConstraint(constraint, value) {\n if (!this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n const constraintValue =\n constraint === 'pan' || constraint === 'tilt' || constraint === 'zoom'\n ? clamp(\n Number(value),\n trackCapabilities[constraint]?.min || 1,\n trackCapabilities[constraint]?.max || 1\n )\n : value;\n\n if (constraint in trackSettings) {\n track\n .applyConstraints({\n advanced: [{ [constraint]: constraintValue }]\n })\n .catch(() => {\n // Fail silently...\n });\n }\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n\n /**\n * Starts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n * @returns Promise\n */\n async startVideoStream(videoInputId) {\n if (!VideoCapture.isSupported() || this.#stream) {\n return;\n }\n\n this.setAttribute('loading', '');\n\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || 'user'\n },\n pan: true,\n tilt: true,\n zoom: true,\n torch: this.torch\n },\n audio: false\n };\n\n if (typeof videoInputId === 'string' && videoInputId.trim().length > 0) {\n constraints.video.deviceId = { exact: videoInputId };\n }\n\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n\n if (this.#videoElement) {\n this.#videoElement.srcObject = this.#stream;\n }\n\n this.#applyConstraint('pan', this.pan);\n this.#applyConstraint('tilt', this.tilt);\n this.#applyConstraint('zoom', this.zoom);\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n } finally {\n this.removeAttribute('loading');\n }\n }\n\n /**\n * Restarts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n */\n restartVideoStream(videoInputId) {\n if (this.#stream && this.#videoElement) {\n this.stopVideoStream();\n }\n\n this.startVideoStream(videoInputId);\n }\n\n /**\n * Stops the video stream.\n */\n stopVideoStream() {\n if (!this.#videoElement || !this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */\n getSupportedConstraints() {\n if (!VideoCapture.isSupported()) {\n return {};\n }\n\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */\n getTrackCapabilities() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getCapabilities === 'function') {\n return track.getCapabilities() || {};\n }\n\n return {};\n }\n\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */\n getTrackSettings() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getSettings === 'function') {\n return track.getSettings() || {};\n }\n\n return {};\n }\n\n /**\n * Returns the available video input devices.\n *\n * @returns {Promise}\n */\n static async getVideoInputDevices() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {\n return [];\n }\n\n const devices = (await navigator.mediaDevices.enumerateDevices()) || [];\n return devices.filter(device => device.kind === 'videoinput' && !!device.deviceId);\n }\n\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */\n static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='video-capture'] - The name of the custom element.\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, VideoCapture);\n }\n }\n}\n\nexport { VideoCapture };\n","/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */\nexport const clamp = (value, lower, upper) => {\n if (Number.isNaN(lower)) {\n lower = 0;\n }\n\n if (Number.isNaN(upper)) {\n upper = 0;\n }\n\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n","import { ClipboardCopy } from '@georapbox/clipboard-copy-element/dist/clipboard-copy.js';\n\n/**\n * Extends the `ClipboardCopy` element to override the default `copy` and `success` slots,\n * in order to avoid repetition of the same markup throughout the application.\n * It also adds aditional properties and attributes, specific to the application.\n *\n * @class CustomClipboardCopy\n * @extends ClipboardCopy\n */\nclass CustomClipboardCopy extends ClipboardCopy {\n constructor() {\n super();\n\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n\n copySlot.innerHTML = /* html */ `\n \n \n \n \n Copy\n `;\n\n successSlot.innerHTML = /* html */ `\n \n \n \n \n \n Copied!\n `;\n }\n\n static get observedAttributes() {\n return [...super.observedAttributes, 'only-icon'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n\n if (name === 'only-icon' && oldValue !== newValue) {\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n\n const copyText = copySlot.querySelector('.text');\n const successText = successSlot.querySelector('.text');\n\n if (copyText) {\n copyText.hidden = this.onlyIcon;\n }\n\n if (successText) {\n successText.hidden = this.onlyIcon;\n }\n }\n }\n\n get onlyIcon() {\n return this.hasAttribute('only-icon');\n }\n\n set onlyIcon(value) {\n if (value) {\n this.setAttribute('only-icon', '');\n } else {\n this.removeAttribute('only-icon');\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.#upgradeProperty('onlyIcon');\n\n if (!this.hasAttribute('feedback-duration')) {\n this.setAttribute('feedback-duration', '1500');\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'custom-clipboard-copy') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, CustomClipboardCopy);\n }\n }\n}\n\nCustomClipboardCopy.defineCustomElement();\n","/*!\n * @georapbox/clipboard-copy-element\n * A custom element that implements the Clipboard API to copy text content from elements or input values to the clipboard.\n *\n * @version 3.0.2\n * @homepage https://github.com/georapbox/clipboard-copy-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar i=\"clipboard-copy\";var o=\"success\",n=\"error\",h=document.createElement(\"template\"),a=`\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;h.innerHTML=`\n \n \n`;var r=class d extends HTMLElement{#e=void 0;#t=null;#s=null;#i=null;#o=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(h.content.cloneNode(!0)),this.shadowRoot&&(this.#t=this.shadowRoot.querySelector(\"button\"),this.#s=this.shadowRoot.querySelector('slot[name=\"copy\"]'),this.#i=this.shadowRoot.querySelector('slot[name=\"success\"]'),this.#o=this.shadowRoot.querySelector('slot[name=\"error\"]'))}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,s,e){t===\"disabled\"&&s!==e&&this.#t&&(this.#t.disabled=this.disabled,this.#t.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#t.part.contains(\"button\")&&this.#t.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#n(\"value\"),this.#n(\"from\"),this.#n(\"disabled\"),this.#n(\"feedbackDuration\"),this.#t?.addEventListener(\"click\",this.#r)}disconnectedCallback(){this.#t?.removeEventListener(\"click\",this.#r),this.#a()}get value(){return this.getAttribute(\"value\")||\"\"}set value(t){this.setAttribute(\"value\",t!=null?t.toString():t)}get from(){return this.getAttribute(\"from\")||\"\"}set from(t){this.setAttribute(\"from\",t!=null?t.toString():t)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get feedbackDuration(){return Number(this.getAttribute(\"feedback-duration\"))||1e3}set feedbackDuration(t){this.setAttribute(\"feedback-duration\",t!=null?t.toString():t)}async#d(){if(!(!this.value&&!this.from))try{let t=\"\";if(this.value)t=this.value;else if(this.from){let s=\"getRootNode\"in Element.prototype?this.#t?.getRootNode({composed:!0}):this.#t?.ownerDocument;if(!s||!(s instanceof Document||s instanceof ShadowRoot))return;let e=s.querySelector(this.from);if(!e)return;e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?t=e.value:e instanceof HTMLAnchorElement&&e.hasAttribute(\"href\")?t=e.href:t=e.textContent||\"\"}await navigator.clipboard.writeText(t),this.#h(o),this.dispatchEvent(new CustomEvent(`${i}-success`,{bubbles:!0,composed:!0,detail:{value:t}}))}catch(t){this.#h(n),this.dispatchEvent(new CustomEvent(`${i}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}#r=t=>{t.preventDefault(),!(this.disabled||this.#e)&&this.#d()};#h(t){this.#s&&(this.#s.hidden=!0),this.#i&&(this.#i.hidden=t!==o),this.#o&&(this.#o.hidden=t!==n),this.#t?.part.remove(\"button--success\"),this.#t?.part.remove(\"button--error\"),this.#t?.part.add(`button--${t}`),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.#s&&(this.#s.hidden=!1),this.#i&&(this.#i.hidden=!0),this.#o&&(this.#o.hidden=!0),this.#t?.part.remove(`button--${t}`),this.#e=void 0},this.feedbackDuration)}#a(){this.#e&&clearTimeout(this.#e),this.#e=void 0,this.#s&&(this.#s.hidden=!1),this.#i&&(this.#i.hidden=!0),this.#o&&(this.#o.hidden=!0),this.#t?.part.remove(\"button--success\"),this.#t?.part.remove(\"button--error\")}#n(t){let s=this;if(Object.prototype.hasOwnProperty.call(s,t)){let e=s[t];delete s[t],s[t]=e}}static defineCustomElement(t=i){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,d)}};export{r as ClipboardCopy};\n//# sourceMappingURL=clipboard-copy.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst COMPONENT_NAME = 'clipboard-copy';\nconst DEFAULT_FEEDBACK_DURATION = 1000;\nconst SUCCESS_STATUS = 'success';\nconst ERROR_STATUS = 'error';\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element for copying text to the clipboard.\n * @documentation https://github.com/georapbox/clipboard-copy-element#readme\n *\n * @tagname clipboard-copy - This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {string} value - The value to be copied to clipboard.\n * @property {string} from - The CSS selector of the element to copy from.\n * @property {boolean} disabled - Whether the copy to clipboard button is disabled.\n * @property {number} feedbackDuration - The duration for displaying the success or error status.\n *\n * @attribute {string} value - Reflects the value property.\n * @attribute {string} from - Reflects the from property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} feedback-duration - Reflects the feedbackDuration property.\n *\n * @slot copy - The default slot for the copy button.\n * @slot success - The slot for the success status message.\n * @slot error - The slot for the error status message.\n *\n * @csspart button - The button element.\n * @csspart button--success - The button element when the copy operation is successful.\n * @csspart button--error - The button element when the copy operation fails.\n * @csspart button--disabled - The button element when the disabled attribute is set.\n *\n * @fires clipboard-copy-success - Dispatched when the copy operation is successful.\n * @fires clipboard-copy-error - Dispatched when the copy operation fails.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n */\nclass ClipboardCopy extends HTMLElement {\n /** @type {ReturnType | undefined} */\n #timeout = void 0;\n\n /** @type {Nullable} */\n #buttonEl = null;\n\n /** @type {Nullable} */\n #copySlot = null;\n\n /** @type {Nullable} */\n #successSlot = null;\n\n /** @type {Nullable} */\n #errorSlot = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#buttonEl = this.shadowRoot.querySelector('button');\n this.#copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n this.#successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n this.#errorSlot = this.shadowRoot.querySelector('slot[name=\"error\"]');\n }\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue) {\n if (this.#buttonEl) {\n this.#buttonEl.disabled = this.disabled;\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('value');\n this.#upgradeProperty('from');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('feedbackDuration');\n\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n\n // `disconnectedCallback` is also called when the element is moved to a different document,\n // via `Document: adoptNode()` method, therefore we reset the component to its initial state.\n this.#forceResetStatus();\n }\n\n /**\n * The value to be copied to clipboard.\n *\n * @type {string}\n * @attribute value - Reflects the value property.\n */\n get value() {\n return this.getAttribute('value') || '';\n }\n\n set value(value) {\n this.setAttribute('value', value != null ? value.toString() : value);\n }\n\n /**\n * The CSS selector of the element to copy from.\n *\n * @type {string}\n * @attribute from - Reflects the from property.\n */\n get from() {\n return this.getAttribute('from') || '';\n }\n\n set from(value) {\n this.setAttribute('from', value != null ? value.toString() : value);\n }\n\n /**\n * Whether the copy to clipboard button is disabled.\n *\n * @type {boolean}\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * The duration for displaying the success or error status.\n *\n * @type {number}\n * @attribute feedback-duration - Reflects the feedbackDuration property.\n */\n get feedbackDuration() {\n return Number(this.getAttribute('feedback-duration')) || DEFAULT_FEEDBACK_DURATION;\n }\n\n set feedbackDuration(value) {\n this.setAttribute('feedback-duration', value != null ? value.toString() : value);\n }\n\n /**\n * Copies the value to the clipboard and handles success or error states.\n */\n async #copy() {\n if (!this.value && !this.from) {\n return;\n }\n\n try {\n let copyValue = '';\n\n if (this.value) {\n copyValue = this.value;\n } else if (this.from) {\n const root =\n 'getRootNode' in Element.prototype\n ? this.#buttonEl?.getRootNode({ composed: true })\n : this.#buttonEl?.ownerDocument;\n\n if (!root || !(root instanceof Document || root instanceof ShadowRoot)) {\n return;\n }\n\n const element = root.querySelector(this.from);\n\n if (!element) {\n return;\n }\n\n if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {\n copyValue = element.value;\n } else if (element instanceof HTMLAnchorElement && element.hasAttribute('href')) {\n copyValue = element.href;\n } else {\n copyValue = element.textContent || '';\n }\n }\n\n await navigator.clipboard.writeText(copyValue);\n\n this.#showStatus(SUCCESS_STATUS);\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-success`, {\n bubbles: true,\n composed: true,\n detail: { value: copyValue }\n })\n );\n } catch (error) {\n this.#showStatus(ERROR_STATUS);\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n }\n\n /**\n * Handles the button click event.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled || this.#timeout) {\n return;\n }\n\n this.#copy();\n };\n\n /**\n * Displays the success or error status.\n *\n * @param {string} status - The status to display.\n */\n #showStatus(status) {\n if (this.#copySlot) {\n this.#copySlot.hidden = true;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = status !== SUCCESS_STATUS;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = status !== ERROR_STATUS;\n }\n\n this.#buttonEl?.part.remove('button--success');\n this.#buttonEl?.part.remove('button--error');\n this.#buttonEl?.part.add(`button--${status}`);\n\n this.#timeout && clearTimeout(this.#timeout);\n\n this.#timeout = setTimeout(() => {\n if (this.#copySlot) {\n this.#copySlot.hidden = false;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = true;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = true;\n }\n\n this.#buttonEl?.part.remove(`button--${status}`);\n\n this.#timeout = void 0;\n }, this.feedbackDuration);\n }\n\n /**\n * Resets the status to the initial state.\n * Clears the feedback timeout, hides the success or error slots and shows the copy slot.\n */\n #forceResetStatus() {\n this.#timeout && clearTimeout(this.#timeout);\n this.#timeout = void 0;\n\n if (this.#copySlot) {\n this.#copySlot.hidden = false;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = true;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = true;\n }\n\n this.#buttonEl?.part.remove('button--success');\n this.#buttonEl?.part.remove('button--error');\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'value' | 'from' | 'disabled' | 'feedbackDuration'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='clipboard-copy'] - The name of the custom element.\n * @example\n *\n * ClipboardCopy.defineCustomElement('my-clipboard-copy');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ClipboardCopy);\n }\n }\n}\n\nexport { ClipboardCopy };\n","import { isWebShareSupported } from '@georapbox/web-share-element/dist/is-web-share-supported.js';\nimport { getSettings } from '../services/storage.js';\nimport { NO_BARCODE_DETECTED } from '../constants.js';\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n .result {\n position: relative;\n width: 100%;\n border: 1px solid var(--focus);\n border-radius: 6px;\n margin: 1.5rem 0 0 0;\n padding: 1rem;\n background-color: var(--background-alt);\n text-align: center;\n }\n\n .result__item {\n word-wrap: break-word;\n word-break: break-word;\n }\n\n a.result__item {\n color: var(--links);\n text-decoration: none;\n }\n\n a.result__item:hover {\n text-decoration: underline;\n }\n\n .result__item--no-barcode {\n color: var(--error-color);\n }\n\n .result__actions {\n display: flex;\n align-items: center;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .result web-share button,\n .result custom-clipboard-copy::part(button) {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n margin: 0.75rem 0 0 0;\n padding: 0.25rem;\n background-color: transparent;\n border: 0;\n border-radius: var(--border-radius);\n color: inherit;\n line-height: 1;\n font-family: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n \n \n \n
    \n
    \n`;\n\nclass ScanResult extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n get value() {\n return this.getAttribute('value');\n }\n\n set value(value) {\n this.setAttribute('value', value);\n }\n\n static get observedAttributes() {\n return ['value'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'value' && oldValue !== newValue) {\n this.#handleValueChange(this.value);\n }\n }\n\n connectedCallback() {\n this.#upgradeProperty('value');\n\n if (!isWebShareSupported()) {\n const webShareEl = this.shadowRoot.querySelector('web-share');\n\n if (webShareEl) {\n webShareEl.hidden = true;\n }\n }\n }\n\n async #handleValueChange(value) {\n const baseEl = this.shadowRoot.querySelector('.result');\n const resultActionsEl = baseEl?.querySelector('.result__actions');\n const oldResultItem = baseEl?.querySelector('.result__item');\n let resultItem;\n\n if (oldResultItem) {\n oldResultItem.remove();\n }\n\n try {\n const [, settings] = await getSettings();\n\n new URL(value);\n resultItem = document.createElement('a');\n resultItem.href = value;\n window.requestAnimationFrame(() => resultItem.focus());\n\n if (!settings?.openWebPageSameTab) {\n resultItem.setAttribute('target', '_blank');\n resultItem.setAttribute('rel', 'noreferrer noopener');\n }\n\n if (settings?.openWebPage) {\n resultItem.click();\n }\n } catch {\n resultItem = document.createElement('span');\n }\n\n resultItem.className = 'result__item';\n resultItem.classList.toggle('result__item--no-barcode', value === NO_BARCODE_DETECTED);\n resultItem.textContent = value;\n\n baseEl?.insertBefore(resultItem, resultActionsEl);\n\n const isValidValue = value !== NO_BARCODE_DETECTED;\n const clipboarCopyEl = baseEl?.querySelector('custom-clipboard-copy');\n const webShareEl = baseEl?.querySelector('web-share');\n\n if (clipboarCopyEl && isValidValue) {\n clipboarCopyEl.setAttribute('value', value);\n clipboarCopyEl.hidden = false;\n } else {\n clipboarCopyEl.hidden = true;\n clipboarCopyEl.removeAttribute('value');\n }\n\n if (webShareEl && isWebShareSupported() && isValidValue) {\n webShareEl.setAttribute('share-text', value);\n webShareEl.hidden = false;\n } else {\n webShareEl.hidden = true;\n webShareEl.removeAttribute('share-text');\n }\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'scan-result') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ScanResult);\n }\n }\n}\n\nScanResult.defineCustomElement();\n","/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */\nfunction r(a){return a!==null&&typeof a==\"object\"?\"share\"in navigator&&\"canShare\"in navigator&&navigator.canShare(a):\"share\"in navigator}export{r as isWebShareSupported};\n//# sourceMappingURL=is-web-share-supported.js.map\n","// @ts-check\n\n/**\n * Check if Web Share API is supported by the platform.\n *\n * @param {import('./web-share').ShareData} [options]\n * @returns {boolean} Returns `true` if Web Share API is supported; otherwise `false`.\n */\nfunction isWebShareSupported(options) {\n if (options !== null && typeof options === 'object') {\n return 'share' in navigator && 'canShare' in navigator && navigator.canShare(options);\n }\n\n return 'share' in navigator;\n}\n\nexport { isWebShareSupported };\n"],"names":["$dc2f4a51b83babfd$var$defaultGetStoreFunc","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$hffE7","then","resolve","$5a53255ef6289be5$var$h","a","t","i","Math","random","toString","substring","$5a53255ef6289be5$var$b","Object","prototype","hasOwnProperty","e","$5a53255ef6289be5$var$E","$5a53255ef6289be5$var$C","$5a53255ef6289be5$var$w","document","createElement","innerHTML","$5a53255ef6289be5$export$6824c350c20eab3a","HTMLElement","constructor","shadowRoot","attachShadow","mode","appendChild","content","cloneNode","observedAttributes","attributeChangedCallback","s","setAttribute","selected","disabled","closable","className","querySelector","addEventListener","removeEventListener","remove","connectedCallback","disconnectedCallback","hasAttribute","toggleAttribute","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","detail","tabId","defineCustomElement","customElements","get","define","$5a53255ef6289be5$var$L","$5a53255ef6289be5$var$S","$5a53255ef6289be5$var$T","$5a53255ef6289be5$export$185adf5fa2c760b1","$5a53255ef6289be5$var$n","TOP","BOTTOM","START","END","$5a53255ef6289be5$var$l","LTR","RTL","$5a53255ef6289be5$var$R","entries","map","$5a53255ef6289be5$var$r","AUTO","MANUAL","$5a53255ef6289be5$var$c","DOWN","LEFT","RIGHT","UP","HOME","ENTER","SPACE","$5a53255ef6289be5$var$x","$5a53255ef6289be5$var$A","$5a53255ef6289be5$export$4ac05a649254e913","l","placement","getAttribute","noScrollControls","scrollDistance","abs","Number","$5a53255ef6289be5$var$y","activation","noTabCycling","o","Array","from","querySelectorAll","n","g","p","forEach","d","f","m","ResizeObserver","requestAnimationFrame","v","target","scrollWidth","clientWidth","_","part","toggle","classList","h","c","unobserve","observe","disconnect","cancelAnimationFrame","CSS","supports","matches","getComputedStyle","direction","hidden","length","w","nextElementSibling","tagName","toLowerCase","console","error","T","b","y","find","A","findIndex","r","E","u","name","altKey","includes","key","focus","selectTab","preventDefault","closest","contains","scrollLeft","scrollTo","left","selectTabByIndex","selectTabById","scrollIntoView","inline","block","$cd62c5572235e737$var$h","$cd62c5572235e737$var$r","$cd62c5572235e737$export$30b344bef3e55b67","delegatesFocus","shareUrl","shareTitle","shareText","shareFiles","isArray","share","url","title","text","navigator","canShare","files","shareData","nodeName","assignedElements","flatten","$9351176e8d763a78$var$x","Map","$9351176e8d763a78$var$b","$9351176e8d763a78$var$y","lastIndexOf","type","split","pop","defineProperty","value","writable","configurable","enumerable","$9351176e8d763a78$var$g","path","webkitRelativePath","$9351176e8d763a78$var$m","Promise","readEntries","$9351176e8d763a78$var$w","push","$9351176e8d763a78$var$E","file","fullPath","$9351176e8d763a78$var$F","kind","getAsEntry","webkitGetAsEntry","shift","isFile","indexOf","isDirectory","createReader","$9351176e8d763a78$var$f","$9351176e8d763a78$var$l","dataTransfer","items","$9351176e8d763a78$var$n","$9351176e8d763a78$var$v","$9351176e8d763a78$var$z","$9351176e8d763a78$var$S","$9351176e8d763a78$export$6ccd1735166caad9","getElementById","accept","removeAttribute","multiple","autoFocus","maxFiles","floor","maxSize","isNaN","minSize","noStyle","Event","dropEffect","add","click","errors","message","$9351176e8d763a78$var$u","Set","trim","filter","Boolean","replace","charAt","test","size","acceptedFiles","rejectedFiles","defaultValue","openFileDialog","$1c2cbcdf680d66d4$var$o","$1c2cbcdf680d66d4$export$f0e45424cc896229","$d9c5053bade2d3f8$var$n","$d9c5053bade2d3f8$var$r","$d9c5053bade2d3f8$export$32589115725b904b","open","showModal","element","body","preserveOverflow","style","overflow","close","noHeader","noAnimations","noCloseButton","clearTimeout","staticBackdrop","fullscreen","closeLabel","some","textContent","setTimeout","defaultPrevented","currentTarget","hide","assignedNodes","cancelable","reason","show","$65136e012e05e2d7$export$c263bd68c6f5ce7a","$65136e012e05e2d7$export$63e7bed68b07a85c","$dc2f4a51b83babfd$export$b327150396135fe7","request","reject","oncomplete","onsuccess","result","onabort","onerror","$dc2f4a51b83babfd$var$defaultGetStore","dbName","storeName","dbp","indexedDB","onupgradeneeded","createObjectStore","txMode","callback","db","transaction","objectStore","$0eb43b201e9f90c7$var$STORAGE_PREFIX","$0eb43b201e9f90c7$var$SETTINGS_STORAGE_KEY","$0eb43b201e9f90c7$var$HISTORY_STORAGE_KEY","$0eb43b201e9f90c7$var$getItem","customStore","arguments","undefined","store","$0eb43b201e9f90c7$var$setItem","data","put","$0eb43b201e9f90c7$export$4a647155031ece","$0eb43b201e9f90c7$export$dc86d17a64679bc7","$0eb43b201e9f90c7$export$f9582a3c130d9538","$0eb43b201e9f90c7$export$96fe1132eb44c325","$4481690a5b2e12d6$export$61fc7d43ac8f84b0","fn","wait","immediate","timerId","TypeError","args","$2d4d0eca101a8031$export$c694186e9d94f0","HTMLDialogElement","$32121209e73f30cc$export$fa9e3380e441c420","historyList","emptyHistoryBtn","replaceChildren","item","index","historyItem","li","URL","href","actionsEl","copyBtn","removeBtn","$32121209e73f30cc$export$7a6a9d84993ff4e","settings","addToHistory","getHistoryError","history","setHistoryError","$32121209e73f30cc$export$3a61248021dae916","el","$32121209e73f30cc$export$9f74b61e5d33cda2","$c6f06ef952a10e5f$export$97c08f0895810b94","oldScanResultEl","newScanResultEl","$db31dc56898b80b8$export$d6c943e433460aae","audioCtx","AudioContext","webkitAudioContext","audioContext","options","duration","frequency","volume","onEnded","oscillator","createOscillator","gainNode","createGain","connect","destination","gain","onended","start","currentTime","stop","$03fe6bc65045924f$export$3ca8e905da0a0ca8","vibrate","$a6838ab1dc4817e7$export$9b466d13e2031a67","success","beep","$451e357ed50655d6$export$1404f0e91c73fec","videoEl","scanFrameEl","rect","getBoundingClientRect","cssText","width","height","$8510600959e31c2c$export$f21d9483ebeee00a","polyfill","getSupportedFormats","BarcodeDetector","create","barcodeReader","barcodeFormats","barcodeReaderError","formats","detect","source","results","$6d6ffe9300b4c5f8$export$9d22ef9ff8e481fe","form","settingInput","checked","$ac0619973d2d242a$export$d1bd0b12fe0d046","isTorchOn","iconPaths","display","$f39ac7e49ce95944$export$7d15b64cf5a3a4c4","lower","upper","min","max","$40cc5a5311c08f52$var$COMPONENT_NAME","$40cc5a5311c08f52$var$styles","$40cc5a5311c08f52$var$template","$40cc5a5311c08f52$export$682e9ed90a89bb4a","supportedConstraints","stream","videoElement","getSupportedConstraints","oldValue","newValue","isConnected","trackCapabilities","getTrackCapabilities","zoomInAllowedRange","zoom","applyConstraint","torch","upgradeProperty","onVideoLoadedMetaData","isSupported","autoPlay","startVideoStream","stopVideoStream","facingMode","loading","evt","video","play","catch","finally","constraint","track","getVideoTracks","trackSettings","getTrackSettings","constraintValue","applyConstraints","advanced","prop","videoInputId","constraints","ideal","pan","tilt","audio","deviceId","exact","cameraResolution","x","mediaDevices","getUserMedia","srcObject","restartVideoStream","getCapabilities","getSettings","getVideoInputDevices","enumerateDevices","devices","device","elementName","$449da37d108ee4fe$var$i","$449da37d108ee4fe$var$o","$449da37d108ee4fe$var$n","$449da37d108ee4fe$var$h","$449da37d108ee4fe$var$a","$449da37d108ee4fe$export$ea3b71af1761ff40","feedbackDuration","Element","getRootNode","ownerDocument","Document","ShadowRoot","HTMLInputElement","HTMLTextAreaElement","HTMLAnchorElement","clipboard","writeText","$3d31f226494869e5$var$CustomClipboardCopy","copySlot","successSlot","copyText","successText","onlyIcon","$7a2aca835bb05064$export$c37129e465f64ef0","$678371674e4a782c$var$styles","$678371674e4a782c$var$template","$678371674e4a782c$var$ScanResult","handleValueChange","webShareEl","resultItem","baseEl","resultActionsEl","oldResultItem","openWebPageSameTab","openWebPage","insertBefore","isValidValue","clipboarCopyEl","instance","rafId","hasExperimentalFlag","URLSearchParams","location","search","has","tabGroupEl","videoCaptureEl","cameraPanel","filePanel","scanInstructionsEl","scanBtn","dropzoneEl","resizeObserverEl","facingModeButton","torchButton","globalActionsEl","historyBtn","historyDialog","settingsBtn","settingsDialog","settingsForm","forms","cameraSelect","shouldScan","alertEl","handleVideoCapturePlay","once","errorMessage","videoCaptureVideoEl","scan","barcode","barcodeValue","rawValue","zoomLevelEl","zoomControls","minZoom","maxZoom","currentZoom","zoomInBtn","zoomOutBtn","videoInputDevices","option","label","join","supportedFormatsEl","scanResultEl","handleFileSelect","image","Image","reader","FileReader","onload","src","alt","preview","imageWrapper","fileNameWrapper","prepend","readAsDataURL","checkboxes","dataset","confirm","videoDeviceId","selectedTab","visibilityState","handleDocumentEscapeKey","cameraTabSelected","scanBtnVisible","settingsDialogOpen","historyDialogOpen","uid","prefix","suffix","prefixString","suffixString","randomString","tabCounter","styles","template","ATab","_ATab","closeButton","#handleCloseButtonClick","#upgradeProperty","panelCounter","ATabPanel","_ATabPanel","DEFAULT_SCROLL_DISTANCE","PLACEMENT","DIR","validPlacements","ACTIVATION","KEYCODE","ATabGroup","_ATabGroup","#resizeObserver","#rafId","#hasTabSlotChangedOnce","#syncNav","tabSlot","panelSlot","tabsContainer","navContainer","scrollButtons","#handleSlotChange","#handleTabClick","#handleKeyDown","#handleScrollButtonClick","#handleTabClose","targetElement","isElementScrollable","#hideEmptyTabGroup","#stopResizeObserver","#startResizeObserver","scrollElement","#getDirectionality","#allTabs","#linkPanels","tabs","tab","panel","#allPanels","#panelForTab","panelId","#firstTab","#lastTab","#prevTab","newIdx","#nextTab","#reset","panels","#setSelectedTabOnSlotChange","#setSelectedTab","orientation","directionality","scrollButton","isStartButton","isLTR","sign","offsetLeft","oldTab","WebShare","_WebShare","#buttonSlot","#buttonEl","#files","#getButton","#handleClick","isValidFile","acceptedTypeSpecifiers","acceptedMimeTypesList","fileMimeType","baseMimeType","validType","COMMON_MIME_TYPES","FILES_TO_IGNORE","toFileWithMimeType","extension","toFileWithPath","fileWithMimeType","readEntriesPromise","directoryReader","readAllDirectoryEntries","getFileFromFileEntry","fileEntry","getFilesFromDataTransferItemList","dataTransferItemList","queue","entry","getFilesFromFileList","fileList","getFilesFromEvent","COMPONENT_NAME","TOO_MANY_FILES","FILE_TOO_LARGE","FILE_TOO_SMALL","INVALID_MIME_TYPE","FilesDropzone","_FilesDropzone","#fileInput","#dropzoneEl","#handleFileInputChange","#handleDragEnter","#handleDragOver","#handleDragLeave","#handleDrop","#handleKeyUp","num","#handleFilesSelect","filesLength","fileHasValidType","fileExceedsMaxSize","fileIsSmallerThanMinSize","ResizeObserverElement","_ResizeObserverElement","#slotEl","#observedElements","#stopObserver","#startObserver","ModalElement","_ModalElement","#dialogEl","#footerSlotEl","#closeSlotEl","#pulseAnimationTimeout","headerEl","closeBtnEl","#updateCloseLabel","#handleDialogClick","#handleDialogClose","#handleDialogCancel","#handleFooterSlotChange","#handleCloseSlotChange","closeButtonEl","#applyPulseEffectOnDialog","requestCloseEvent","#createRequestCloseEvent","footerEl","footerSlotNodes","hasFooterSlotNodes","SUCCESS_STATUS","ERROR_STATUS","ClipboardCopy","_ClipboardCopy","#timeout","#copySlot","#successSlot","#errorSlot","#forceResetStatus","#copy","copyValue","root","#showStatus","status","isWebShareSupported"],"version":3,"file":"index.0a6e9ff0.js.map"} \ No newline at end of file diff --git a/index.65ac40f6.js.map b/index.65ac40f6.js.map deleted file mode 100644 index 676eff3..0000000 --- a/index.65ac40f6.js.map +++ /dev/null @@ -1 +0,0 @@ -{"mappings":"C,A,W,I2ByCI,E,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,C,E,Q,S,C,C,C,E1BzCJ,EAAA,OAAA,CAAkB,AAAA,EAAA,SAAuC,AAAA,EAAA,SAAA,OAAA,CAA6C,UAAW,IAAI,CAAC,IAAM,EAAc,S,G,E,Q,S,C,C,C,E,I,E,E,QCG1I,CAAA,EAAA,OAAA,CAAiB,EAAY,SAAU,CAAM,EAC3C,OAAO,IAAI,QAAQ,SAAU,CAAO,CAAE,CAAM,EAG1C,GAAI,EAAE,CAAC,MAAM,CADS,SAAS,oBAAoB,CAAC,WACrB,IAAI,CAAC,SAAyB,CAAM,EACjE,OAAO,EAAO,GAAG,GAAK,CACxB,GAAI,CACF,IACA,MACF,CACA,IAAI,EAAc,SAAS,aAAa,CAAC,OACzC,CAAA,EAAY,IAAI,CAAG,EACnB,EAAY,GAAG,CAAG,UAClB,EAAY,EAAE,CAAG,SACjB,SAAS,IAAI,CAAC,WAAW,CAAC,GAC1B,IAAI,EAAS,SAAS,aAAa,CAAC,SACpC,CAAA,EAAO,KAAK,CAAG,CAAA,EACf,EAAO,IAAI,CAAG,kBACd,EAAO,GAAG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E,EAAe,eAAe,OAE3B,CACL,EAAa,CAAA,EAGb,IAAM,EAAiB,SAAS,aAAa,CAAC,iBAE9C,GAAI,CAAC,EACH,MAGG,CAAA,EAAe,OAAO,EAAK,EAAY,aAAa,CAAC,gBACxD,IAG6C,YAA3C,OAAO,EAAe,gBAAgB,EACxC,EAAe,gBAAgB,EAEnC,EACF,GAyCA,SAAS,gBAAgB,CAAC,UAlB1B,SAA+B,CAAG,EAChB,WAAZ,EAAI,GAAG,EACT,AAnBJ,WACE,IAAM,EAAoB,EAAW,aAAa,CAAC,cAAc,YAAY,CAAC,YACxE,EAAiB,CAAC,EAAQ,MAAM,CAChC,EAAqB,EAAe,YAAY,CAAC,QACjD,EAAoB,EAAc,YAAY,CAAC,QAGhD,GAAmB,IAFF,CAAA,GAAsB,CAA5C,GAMA,EAAQ,KAAK,EACf,GASA,EAeF,G","sources":["","node_modules/@parcel/runtime-js/lib/runtime-48ad16d961f6463a.js","node_modules/@parcel/runtime-js/lib/helpers/browser/js-loader.js","node_modules/@parcel/runtime-js/lib/helpers/cacheLoader.js","src/js/index.js","node_modules/@georapbox/a-tab-group/dist/a-tab-group.js","node_modules/@georapbox/a-tab-group/src/utils/uid.js","node_modules/@georapbox/a-tab-group/src/utils/upgrade-property.js","node_modules/@georapbox/a-tab-group/src/a-tab.js","node_modules/@georapbox/a-tab-group/src/a-tab-panel.js","node_modules/@georapbox/a-tab-group/src/a-tab-group.js","node_modules/@georapbox/web-share-element/dist/web-share-defined.js","node_modules/@georapbox/web-share-element/src/web-share.js","node_modules/@georapbox/web-share-element/src/web-share-defined.js","node_modules/@georapbox/files-dropzone-element/dist/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/src/utils/is-valid-file.js","node_modules/@georapbox/files-dropzone-element/src/utils/files-selector.js","node_modules/@georapbox/files-dropzone-element/src/files-dropzone.js","node_modules/@georapbox/files-dropzone-element/src/files-dropzone-defined.js","node_modules/@georapbox/resize-observer-element/dist/resize-observer-defined.js","node_modules/@georapbox/resize-observer-element/src/resize-observer.js","node_modules/@georapbox/resize-observer-element/src/resize-observer-defined.js","node_modules/@georapbox/modal-element/dist/modal-element-defined.js","node_modules/@georapbox/modal-element/src/modal-element.js","node_modules/@georapbox/modal-element/src/modal-element-defined.js","src/js/constants.js","src/js/services/storage.js","node_modules/idb-keyval/dist/compat.js","src/js/utils/debounce.js","src/js/utils/log.js","src/js/utils/isDialogElementSupported.js","src/js/helpers/renderSupportedFormats.js","src/js/helpers/history.js","src/js/helpers/results.js","src/js/helpers/triggerScanEffects.js","src/js/utils/beep.js","src/js/utils/vibrate.js","src/js/helpers/resizeScanFrame.js","src/js/helpers/BarcodeReader.js","src/js/helpers/initializeSettingsForm.js","src/js/helpers/toggleTorchButtonStatus.js","src/js/components/video-capture.js","src/js/utils/clamp.js","src/js/components/clipboard-copy.js","node_modules/@georapbox/clipboard-copy-element/dist/clipboard-copy.js","node_modules/@georapbox/clipboard-copy-element/src/clipboard-copy.js","src/js/components/scan-result.js","node_modules/@georapbox/web-share-element/dist/is-web-share-supported.js","node_modules/@georapbox/web-share-element/src/is-web-share-supported.js"],"sourcesContent":["(function () {\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea202\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea202\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"bkcP3\", function(module, exports) {\n\n\nmodule.exports = (parcelRequire(\"4WKyX\"))((parcelRequire(\"iE7OH\")).resolve(\"iqysf\")).then(()=>parcelRequire(\"dZsGG\"));\n\n});\nparcelRegister(\"4WKyX\", function(module, exports) {\n\"use strict\";\n\nvar $2prpb = parcelRequire(\"2prpb\");\nmodule.exports = $2prpb(function(bundle) {\n return new Promise(function(resolve, reject) {\n // Don't insert the same script twice (e.g. if it was already in the HTML)\n var existingScripts = document.getElementsByTagName(\"script\");\n if ([].concat(existingScripts).some(function isCurrentBundle(script) {\n return script.src === bundle;\n })) {\n resolve();\n return;\n }\n var preloadLink = document.createElement(\"link\");\n preloadLink.href = bundle;\n preloadLink.rel = \"preload\";\n preloadLink.as = \"script\";\n document.head.appendChild(preloadLink);\n var script = document.createElement(\"script\");\n script.async = true;\n script.type = \"text/javascript\";\n script.src = bundle;\n script.onerror = function(e) {\n var error = new TypeError(\"Failed to fetch dynamically imported module: \".concat(bundle, \". Error: \").concat(e.message));\n script.onerror = script.onload = null;\n script.remove();\n reject(error);\n };\n script.onload = function() {\n script.onerror = script.onload = null;\n resolve();\n };\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n });\n});\n\n});\nparcelRegister(\"2prpb\", function(module, exports) {\n\"use strict\";\nvar $1c132cac09cd18d9$var$cachedBundles = {};\nvar $1c132cac09cd18d9$var$cachedPreloads = {};\nvar $1c132cac09cd18d9$var$cachedPrefetches = {};\nfunction $1c132cac09cd18d9$var$getCache(type) {\n switch(type){\n case \"preload\":\n return $1c132cac09cd18d9$var$cachedPreloads;\n case \"prefetch\":\n return $1c132cac09cd18d9$var$cachedPrefetches;\n default:\n return $1c132cac09cd18d9$var$cachedBundles;\n }\n}\nmodule.exports = function(loader, type) {\n return function(bundle) {\n var cache = $1c132cac09cd18d9$var$getCache(type);\n if (cache[bundle]) return cache[bundle];\n return cache[bundle] = loader.apply(null, arguments).catch(function(e) {\n delete cache[bundle];\n throw e;\n });\n };\n};\n\n});\n\n\n\n/*!\n * @georapbox/a-tab-group\n * A custom element to create a group of tabs and tab panels.\n *\n * @version 2.4.1\n * @homepage https://github.com/georapbox/a-tab-group#readme\n * @author George Raptis \n * @license MIT\n */ var $c172d40c323f9126$var$h = (a = \"\", t = \"\")=>{\n let e = typeof a == \"string\" && a !== \"\" ? a + \"-\" : \"\", s = typeof t == \"string\" && t !== \"\" ? \"-\" + t : \"\", i = Math.random().toString(36).substring(2, 8);\n return `${e}${i}${s}`;\n};\nvar $c172d40c323f9126$var$b = (a, t)=>{\n if (Object.prototype.hasOwnProperty.call(t, a)) {\n let e = t[a];\n delete t[a], t[a] = e;\n }\n};\nvar $c172d40c323f9126$var$E = 0, $c172d40c323f9126$var$C = `\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`, $c172d40c323f9126$var$w = document.createElement(\"template\");\n$c172d40c323f9126$var$w.innerHTML = `\n \n\n
    \n \n
    \n`;\nvar $c172d40c323f9126$export$6824c350c20eab3a = class a extends HTMLElement {\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($c172d40c323f9126$var$w.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"selected\",\n \"disabled\",\n \"closable\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n if (t === \"selected\" && e !== s && (this.setAttribute(\"aria-selected\", this.selected.toString()), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\")), t === \"disabled\" && e !== s && (this.setAttribute(\"aria-disabled\", this.disabled.toString()), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\")), t === \"closable\" && e !== s) {\n if (this.closable) {\n let i = document.createElement(\"span\");\n i.className = \"tab__close\", i.setAttribute(\"part\", \"close-tab\"), i.innerHTML = '', this.shadowRoot?.querySelector(\".tab\")?.appendChild(i), i.addEventListener(\"click\", this.#e);\n } else {\n let i = this.shadowRoot?.querySelector(\".tab__close\");\n i?.removeEventListener(\"click\", this.#e), i?.remove();\n }\n }\n }\n connectedCallback() {\n this.#s(\"selected\"), this.#s(\"disabled\"), this.#s(\"closable\"), this.id || (this.id = $c172d40c323f9126$var$h(\"tab\", (++$c172d40c323f9126$var$E).toString())), this.setAttribute(\"slot\", \"tab\"), this.setAttribute(\"role\", \"tab\"), this.setAttribute(\"aria-selected\", \"false\"), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\");\n }\n disconnectedCallback() {\n this.shadowRoot?.querySelector(\".tab__close\")?.removeEventListener(\"click\", this.#e);\n }\n get selected() {\n return this.hasAttribute(\"selected\");\n }\n set selected(t) {\n this.toggleAttribute(\"selected\", !!t);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get closable() {\n return this.hasAttribute(\"closable\");\n }\n set closable(t) {\n this.toggleAttribute(\"closable\", !!t);\n }\n #e = (t)=>{\n t.stopPropagation(), this.dispatchEvent(new CustomEvent(\"a-tab-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: this.id\n }\n }));\n };\n #s(t) {\n return $c172d40c323f9126$var$b(t, this);\n }\n static defineCustomElement(t = \"a-tab\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$c172d40c323f9126$export$6824c350c20eab3a.defineCustomElement();\nvar $c172d40c323f9126$var$L = 0, $c172d40c323f9126$var$S = `\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`, $c172d40c323f9126$var$T = document.createElement(\"template\");\n$c172d40c323f9126$var$T.innerHTML = `\n \n\n
    \n \n
    \n`;\nvar $c172d40c323f9126$export$185adf5fa2c760b1 = class a extends HTMLElement {\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($c172d40c323f9126$var$T.content.cloneNode(!0));\n }\n connectedCallback() {\n this.setAttribute(\"slot\", \"panel\"), this.setAttribute(\"role\", \"tabpanel\"), this.setAttribute(\"hidden\", \"\"), this.id || (this.id = $c172d40c323f9126$var$h(\"panel\", (++$c172d40c323f9126$var$L).toString()));\n }\n static defineCustomElement(t = \"a-tab-panel\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$c172d40c323f9126$export$185adf5fa2c760b1.defineCustomElement();\nvar $c172d40c323f9126$var$y = 200, $c172d40c323f9126$var$n = {\n TOP: \"top\",\n BOTTOM: \"bottom\",\n START: \"start\",\n END: \"end\"\n}, $c172d40c323f9126$var$l = {\n LTR: \"ltr\",\n RTL: \"rtl\"\n}, $c172d40c323f9126$var$R = Object.entries($c172d40c323f9126$var$n).map(([, a])=>a), $c172d40c323f9126$var$r = {\n AUTO: \"auto\",\n MANUAL: \"manual\"\n}, $c172d40c323f9126$var$c = {\n DOWN: \"ArrowDown\",\n LEFT: \"ArrowLeft\",\n RIGHT: \"ArrowRight\",\n UP: \"ArrowUp\",\n HOME: \"Home\",\n END: \"End\",\n ENTER: \"Enter\",\n SPACE: \" \"\n}, $c172d40c323f9126$var$x = `\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${$c172d40c323f9126$var$l.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${$c172d40c323f9126$var$l.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${$c172d40c323f9126$var$l.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${$c172d40c323f9126$var$l.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${$c172d40c323f9126$var$n.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${$c172d40c323f9126$var$n.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${$c172d40c323f9126$var$n.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${$c172d40c323f9126$var$n.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`, $c172d40c323f9126$var$A = document.createElement(\"template\");\n$c172d40c323f9126$var$A.innerHTML = `\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;\nvar $c172d40c323f9126$export$4ac05a649254e913 = class a extends HTMLElement {\n #e = null;\n #s = null;\n #l = !1;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($c172d40c323f9126$var$A.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"placement\",\n \"no-scroll-controls\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n t === \"placement\" && e !== s && this.#i(), t === \"no-scroll-controls\" && e !== s && this.#i();\n }\n get placement() {\n return this.getAttribute(\"placement\") || $c172d40c323f9126$var$n.TOP;\n }\n set placement(t) {\n t != null && this.setAttribute(\"placement\", t);\n }\n get noScrollControls() {\n return this.hasAttribute(\"no-scroll-controls\");\n }\n set noScrollControls(t) {\n this.toggleAttribute(\"no-scroll-controls\", !!t);\n }\n get scrollDistance() {\n let t = Number(this.getAttribute(\"scroll-distance\"));\n return Math.abs(t) || $c172d40c323f9126$var$y;\n }\n set scrollDistance(t) {\n this.setAttribute(\"scroll-distance\", Math.abs(t).toString() || $c172d40c323f9126$var$y.toString());\n }\n get activation() {\n return this.getAttribute(\"activation\") || $c172d40c323f9126$var$r.AUTO;\n }\n set activation(t) {\n this.setAttribute(\"activation\", t || $c172d40c323f9126$var$r.AUTO);\n }\n get noTabCycling() {\n return this.hasAttribute(\"no-tab-cycling\");\n }\n set noTabCycling(t) {\n this.toggleAttribute(\"no-tab-cycling\", !!t);\n }\n connectedCallback() {\n this.#o(\"placement\"), this.#o(\"noScrollControls\"), this.#o(\"scrollDistance\"), this.#o(\"activation\"), this.#o(\"noTabCycling\");\n let t = this.shadowRoot?.querySelector(\"slot[name=tab]\"), e = this.shadowRoot?.querySelector(\"slot[name=panel]\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\"), i = this.shadowRoot?.querySelector(\".tab-group__nav\"), o = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n t?.addEventListener(\"slotchange\", this.#n), e?.addEventListener(\"slotchange\", this.#n), s?.addEventListener(\"click\", this.#g), s?.addEventListener(\"keydown\", this.#p), o.forEach((d)=>d.addEventListener(\"click\", this.#f)), this.addEventListener(\"a-tab-close\", this.#m), \"ResizeObserver\" in window && (this.#e = new ResizeObserver((d)=>{\n this.#s = window.requestAnimationFrame(()=>{\n let v = d?.[0]?.target, g = v?.scrollWidth > v?.clientWidth;\n o.forEach((_)=>_.toggleAttribute(\"hidden\", !g)), i?.part.toggle(\"nav--has-scroll-controls\", g), i?.classList.toggle(\"tab-group__nav--has-scroll-controls\", g);\n });\n })), this.#h(), this.#i();\n }\n disconnectedCallback() {\n let t = this.shadowRoot?.querySelector(\"slot[name=tab]\"), e = this.shadowRoot?.querySelector(\"slot[name=panel]\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\"), i = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n t?.removeEventListener(\"slotchange\", this.#n), e?.removeEventListener(\"slotchange\", this.#n), s?.removeEventListener(\"click\", this.#g), s?.removeEventListener(\"keydown\", this.#p), i.forEach((o)=>o.removeEventListener(\"click\", this.#f)), this.removeEventListener(\"a-tab-close\", this.#m), this.#c();\n }\n #v() {\n if (!this.#e) return;\n let t = this.shadowRoot?.querySelector(\".tab-group__tabs\");\n t && (this.#e.unobserve(t), this.#e.observe(t));\n }\n #c() {\n this.#e && (this.#e.disconnect(), this.#s !== null && (window.cancelAnimationFrame(this.#s), this.#s = null));\n }\n #d() {\n return window.CSS.supports(\"selector(:dir(ltr))\") ? this.matches(\":dir(ltr)\") ? $c172d40c323f9126$var$l.LTR : $c172d40c323f9126$var$l.RTL : window.getComputedStyle(this).direction || $c172d40c323f9126$var$l.LTR;\n }\n #h() {\n this.hidden = this.#t().length === 0;\n }\n #w() {\n let t = this.#t();\n this.#h(), t.forEach((e)=>{\n let s = e.nextElementSibling;\n if (!s || s.tagName.toLowerCase() !== \"a-tab-panel\") return console.error(`Tab #${e.id} is not a sibling of a `);\n e.setAttribute(\"aria-controls\", s.id), s.setAttribute(\"aria-labelledby\", e.id);\n });\n }\n #T() {\n return Array.from(this.querySelectorAll(\"a-tab-panel\"));\n }\n #t() {\n return Array.from(this.querySelectorAll(\"a-tab\"));\n }\n #b(t) {\n let e = t.getAttribute(\"aria-controls\");\n return this.querySelector(`#${e}`);\n }\n #y() {\n return this.#t().find((e)=>!e.disabled) || null;\n }\n #A() {\n let t = this.#t();\n for(let e = t.length - 1; e >= 0; e--)if (!t[e].disabled) return t[e];\n return null;\n }\n #a() {\n let t = this.#t(), e = this.activation === $c172d40c323f9126$var$r.MANUAL ? t.findIndex((s)=>s.matches(\":focus\")) - 1 : t.findIndex((s)=>s.selected) - 1;\n for(; t[(e + t.length) % t.length].disabled;)e--;\n return this.noTabCycling && e < 0 ? null : t[(e + t.length) % t.length];\n }\n #r() {\n let t = this.#t(), e = this.activation === $c172d40c323f9126$var$r.MANUAL ? t.findIndex((s)=>s.matches(\":focus\")) + 1 : t.findIndex((s)=>s.selected) + 1;\n for(; t[e % t.length].disabled;)e++;\n return this.noTabCycling && e >= t.length ? null : t[e % t.length];\n }\n #_() {\n let t = this.#t(), e = this.#T();\n t.forEach((s)=>s.selected = !1), e.forEach((s)=>s.hidden = !0);\n }\n #i() {\n let t = this.shadowRoot?.querySelector(\".tab-group__nav\"), e = this.shadowRoot?.querySelector(\".tab-group__tabs\"), s = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n this.noScrollControls || this.placement === $c172d40c323f9126$var$n.START || this.placement === $c172d40c323f9126$var$n.END ? (this.#c(), s.forEach((i)=>i.hidden = !0), t?.part.remove(\"nav--has-scroll-controls\"), t?.classList.remove(\"tab-group__nav--has-scroll-controls\"), e?.setAttribute(\"aria-orientation\", \"vertical\")) : (this.#v(), s.forEach((i)=>i.hidden = !1), e?.setAttribute(\"aria-orientation\", \"horizontal\"));\n }\n #E() {\n let t = this.#t(), e = t.find((s)=>s.selected && !s.disabled) || t.find((s)=>!s.disabled);\n e && (this.#l && !e.selected && this.dispatchEvent(new CustomEvent(\"a-tab-show\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n })), this.#u(e));\n }\n #u(t) {\n this.#_(), t && (t.selected = !0);\n let e = this.#b(t);\n e && (e.hidden = !1);\n }\n #n = (t)=>{\n this.#w(), this.#i(), this.#E(), t.target.name === \"tab\" && (this.#l = !0);\n };\n #p = (t)=>{\n if (t.target.tagName.toLowerCase() !== \"a-tab\" || t.altKey) return;\n let e = $c172d40c323f9126$var$R.includes(this.placement || \"\") ? this.placement : $c172d40c323f9126$var$n.TOP, s = [\n $c172d40c323f9126$var$n.TOP,\n $c172d40c323f9126$var$n.BOTTOM\n ].includes(e || \"\") ? \"horizontal\" : \"vertical\", i = this.#d(), o = null;\n switch(t.key){\n case $c172d40c323f9126$var$c.LEFT:\n s === \"horizontal\" && (o = i === $c172d40c323f9126$var$l.LTR ? this.#a() : this.#r(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $c172d40c323f9126$var$c.RIGHT:\n s === \"horizontal\" && (o = i === $c172d40c323f9126$var$l.LTR ? this.#r() : this.#a(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $c172d40c323f9126$var$c.UP:\n s === \"vertical\" && (o = this.#a(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $c172d40c323f9126$var$c.DOWN:\n s === \"vertical\" && (o = this.#r(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $c172d40c323f9126$var$c.HOME:\n o = this.#y(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o));\n break;\n case $c172d40c323f9126$var$c.END:\n o = this.#A(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o));\n break;\n case $c172d40c323f9126$var$c.ENTER:\n case $c172d40c323f9126$var$c.SPACE:\n o = t.target, o && this.selectTab(o);\n break;\n default:\n return;\n }\n t.preventDefault();\n };\n #g = (t)=>{\n let e = t.target.closest(\"a-tab\");\n e && this.selectTab(e);\n };\n #f = (t)=>{\n let e = t.target.closest(\".tab-group__scroll-button\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\");\n if (!e || !s) return;\n let i = e.classList.contains(\"tab-group__scroll-button--start\"), o = this.#d() === $c172d40c323f9126$var$l.LTR, d = i ? o ? -1 : 1 : o ? 1 : -1, m = s.scrollLeft;\n s.scrollTo({\n left: m + d * this.scrollDistance\n });\n };\n #m = (t)=>{\n let e = t.target, s = this.#b(e);\n e && (e.remove(), e.selected && this.dispatchEvent(new CustomEvent(\"a-tab-hide\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n }))), s && s.tagName.toLowerCase() === \"a-tab-panel\" && s.remove();\n };\n #o(t) {\n return $c172d40c323f9126$var$b(t, this);\n }\n selectTabByIndex(t) {\n let s = this.#t()[t];\n s && this.selectTab(s);\n }\n selectTabById(t) {\n let s = this.#t().find((i)=>i.id === t);\n s && this.selectTab(s);\n }\n selectTab(t) {\n let e = this.#t().find((s)=>s.selected);\n !t || t.disabled || t.selected || t.tagName.toLowerCase() !== \"a-tab\" || (this.#u(t), window.requestAnimationFrame(()=>{\n t.scrollIntoView({\n inline: \"nearest\",\n block: \"nearest\"\n }), t.focus();\n }), e && this.dispatchEvent(new CustomEvent(\"a-tab-hide\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n })), this.dispatchEvent(new CustomEvent(\"a-tab-show\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: t.id\n }\n })));\n }\n static defineCustomElement(t = \"a-tab-group\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$c172d40c323f9126$export$4ac05a649254e913.defineCustomElement();\n\n\n/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */ var $4f74a8126e204146$var$h = `\n :host {\n display: inline-block;\n }\n`, $4f74a8126e204146$var$r = document.createElement(\"template\");\n$4f74a8126e204146$var$r.innerHTML = `\n \n \n`;\nvar $4f74a8126e204146$export$30b344bef3e55b67 = class a extends HTMLElement {\n #e;\n #t;\n #r = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($4f74a8126e204146$var$r.content.cloneNode(!0)), this.#e = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null, this.#t = this.#h();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, e, i) {\n t === \"disabled\" && e !== i && this.#t && (this.#t.toggleAttribute(\"disabled\", this.disabled), this.#t.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#t.part && this.#t.part.contains(\"button\") && this.#t.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#s(\"shareUrl\"), this.#s(\"shareTitle\"), this.#s(\"shareText\"), this.#s(\"shareFiles\"), this.#s(\"disabled\"), this.#e?.addEventListener(\"slotchange\", this.#a), this.#t?.addEventListener(\"click\", this.#i);\n }\n disconnectedCallback() {\n this.#e?.removeEventListener(\"slotchange\", this.#a), this.#t?.removeEventListener(\"click\", this.#i);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(t) {\n this.setAttribute(\"share-url\", t);\n }\n get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(t) {\n this.setAttribute(\"share-title\", t);\n }\n get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(t) {\n this.setAttribute(\"share-text\", t);\n }\n get shareFiles() {\n return this.#r;\n }\n set shareFiles(t) {\n Array.isArray(t) && t.length > 0 && (this.#r = t);\n }\n async share() {\n if (!this.disabled) try {\n let t = {};\n this.shareUrl && (t.url = this.shareUrl), this.shareTitle && (t.title = this.shareTitle), this.shareText && (t.text = this.shareText), Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n }) && (t.files = this.shareFiles), await navigator.share(t), this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: !0,\n composed: !0,\n detail: {\n shareData: t\n }\n }));\n } catch (t) {\n if (t instanceof Error && t.name === \"AbortError\") {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #i = (t)=>{\n t.preventDefault(), !this.disabled && this.share();\n };\n #a = (t)=>{\n t.target && t.target.name === \"button\" && (this.#t?.removeEventListener(\"click\", this.#i), this.#t = this.#h(), this.#t && (this.#t.addEventListener(\"click\", this.#i), this.#t.nodeName !== \"BUTTON\" && !this.#t.hasAttribute(\"role\") && this.#t.setAttribute(\"role\", \"button\")));\n };\n #h() {\n return this.#e && this.#e.assignedElements({\n flatten: !0\n }).find((t)=>t.nodeName === \"BUTTON\" || t.getAttribute(\"slot\") === \"button\") || null;\n }\n #s(t) {\n let e = this;\n if (Object.prototype.hasOwnProperty.call(e, t)) {\n let i = e[t];\n delete e[t], e[t] = i;\n }\n }\n static defineCustomElement(t = \"web-share\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$4f74a8126e204146$export$30b344bef3e55b67.defineCustomElement();\n\n\n/*!\n * @georapbox/files-dropzone-element\n * A custom element that creates a drag and drop zone for files\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/files-dropzone-element#readme\n * @author George Raptis \n * @license MIT\n */ function $7aad62ebc3d6fae8$var$u(o, e = \"\") {\n if (!e) return !0;\n let t = [\n ...new Set(e.split(\",\").map((r)=>r.trim()).filter(Boolean))\n ], i = o.type, s = i.replace(/\\/.*$/, \"\");\n for (let r of t)if (r.charAt(0) === \".\") {\n if (o.name.toLowerCase().indexOf(r.toLowerCase(), o.name.length - r.length) !== -1) return !0;\n } else if (/\\/\\*$/.test(r)) {\n if (s === r.replace(/\\/.*$/, \"\")) return !0;\n } else if (i === r) return !0;\n return !1;\n}\nvar $7aad62ebc3d6fae8$var$x = new Map([\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]), $7aad62ebc3d6fae8$var$b = [\n \".DS_Store\",\n \"Thumbs.db\"\n], $7aad62ebc3d6fae8$var$y = (o)=>{\n let { name: e } = o;\n if (e && e.lastIndexOf(\".\") !== -1 && !o.type) {\n let i = (e.split(\".\").pop() || \"\").toLowerCase(), s = $7aad62ebc3d6fae8$var$x.get(i);\n s && Object.defineProperty(o, \"type\", {\n value: s,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return o;\n}, $7aad62ebc3d6fae8$var$g = (o, e)=>{\n let t = $7aad62ebc3d6fae8$var$y(o);\n if (typeof t.path != \"string\") {\n let { webkitRelativePath: i } = o;\n Object.defineProperty(t, \"path\", {\n value: typeof e == \"string\" ? e : i || o.name,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return t;\n}, $7aad62ebc3d6fae8$var$m = async (o)=>await new Promise((e, t)=>{\n o.readEntries(e, t);\n }), $7aad62ebc3d6fae8$var$w = async (o)=>{\n let e = [], t = await $7aad62ebc3d6fae8$var$m(o);\n for(; t.length > 0;)e.push(...t), t = await $7aad62ebc3d6fae8$var$m(o);\n return e;\n}, $7aad62ebc3d6fae8$var$E = (o)=>new Promise((e, t)=>{\n o.file((i)=>e($7aad62ebc3d6fae8$var$g(i, o.fullPath)), t);\n }), $7aad62ebc3d6fae8$var$F = async (o)=>{\n let e = [], t = [];\n for (let i of o){\n if (i.kind !== \"file\") continue;\n let s = i.getAsEntry ? i.getAsEntry() : i.webkitGetAsEntry();\n t.push(s);\n }\n for(; t.length > 0;){\n let i = t.shift();\n if (i) {\n if (i.isFile) {\n let s = await $7aad62ebc3d6fae8$var$E(i);\n $7aad62ebc3d6fae8$var$b.indexOf(s.name) === -1 && e.push(s);\n } else i.isDirectory && t.push(...await $7aad62ebc3d6fae8$var$w(i.createReader()));\n } else continue;\n }\n return e;\n}, $7aad62ebc3d6fae8$var$f = async (o)=>{\n let e = [];\n for (let t of o)$7aad62ebc3d6fae8$var$b.indexOf(t.name) === -1 && e.push($7aad62ebc3d6fae8$var$g(t));\n return e;\n}, $7aad62ebc3d6fae8$var$l = async (o)=>o.dataTransfer ? o.dataTransfer.items ? await $7aad62ebc3d6fae8$var$F(o.dataTransfer.items) : await $7aad62ebc3d6fae8$var$f(o.dataTransfer.files) : await $7aad62ebc3d6fae8$var$f(o.target.files);\nvar $7aad62ebc3d6fae8$var$n = \"files-dropzone\", $7aad62ebc3d6fae8$var$v = \"TOO_MANY_FILES\", $7aad62ebc3d6fae8$var$L = \"FILE_TOO_LARGE\", $7aad62ebc3d6fae8$var$k = \"FILE_TOO_SMALL\", $7aad62ebc3d6fae8$var$A = \"INVALID_MIME_TYPE\", $7aad62ebc3d6fae8$var$z = document.createElement(\"template\"), $7aad62ebc3d6fae8$var$S = `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$7aad62ebc3d6fae8$var$z.innerHTML = `\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;\nvar $7aad62ebc3d6fae8$export$6ccd1735166caad9 = class o extends HTMLElement {\n #t = null;\n #e = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($7aad62ebc3d6fae8$var$z.content.cloneNode(!0)), this.shadowRoot && (this.#t = this.shadowRoot.getElementById(\"file-input\"), this.#e = this.shadowRoot.getElementById(\"dropzone\"));\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n e === \"accept\" && t !== i && this.#t && (this.#t.accept = this.accept), e === \"disabled\" && t !== i && this.#t && (this.#t.disabled = this.disabled, this.disabled ? (this.#e?.removeAttribute(\"tabindex\"), this.#e?.setAttribute(\"aria-disabled\", \"true\")) : (this.#e?.setAttribute(\"tabindex\", \"0\"), this.#e?.setAttribute(\"aria-disabled\", \"false\"))), e === \"multiple\" && t !== i && this.#t && (this.#t.multiple = this.multiple);\n }\n connectedCallback() {\n this.#o(\"accept\"), this.#o(\"disabled\"), this.#o(\"maxFiles\"), this.#o(\"maxSize\"), this.#o(\"minSize\"), this.#o(\"multiple\"), this.#o(\"autoFocus\"), this.#o(\"noStyle\"), this.#t?.addEventListener(\"change\", this.#i), this.#e?.addEventListener(\"dragenter\", this.#r), this.#e?.addEventListener(\"dragover\", this.#s), this.#e?.addEventListener(\"dragleave\", this.#n), this.#e?.addEventListener(\"drop\", this.#a), this.#e?.addEventListener(\"click\", this.#d), this.#e?.addEventListener(\"keyup\", this.#l), this.autoFocus && this.#e?.focus();\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"change\", this.#i), this.#e?.removeEventListener(\"dragenter\", this.#r), this.#e?.removeEventListener(\"dragover\", this.#s), this.#e?.removeEventListener(\"dragleave\", this.#n), this.#e?.removeEventListener(\"drop\", this.#a), this.#e?.removeEventListener(\"click\", this.#d), this.#e?.removeEventListener(\"keyup\", this.#l);\n }\n get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(e) {\n this.setAttribute(\"accept\", e != null ? e.toString() : e);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n get maxFiles() {\n let e = Number(this.getAttribute(\"max-files\")) || 0;\n return e <= 0 ? 1 / 0 : Math.floor(Math.abs(e));\n }\n set maxFiles(e) {\n this.setAttribute(\"max-files\", e != null ? e.toString() : e);\n }\n get maxSize() {\n let e = this.getAttribute(\"max-size\");\n if (e === null) return 1 / 0;\n let t = Number(e);\n return Number.isNaN(t) ? 1 / 0 : t;\n }\n set maxSize(e) {\n this.setAttribute(\"max-size\", e != null ? e.toString() : e);\n }\n get minSize() {\n let e = this.getAttribute(\"min-size\");\n if (e === null) return 0;\n let t = Number(e);\n return Number.isNaN(t) ? 0 : t;\n }\n set minSize(e) {\n this.setAttribute(\"min-size\", e != null ? e.toString() : e);\n }\n get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(e) {\n this.toggleAttribute(\"multiple\", !!e);\n }\n get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(e) {\n this.toggleAttribute(\"auto-focus\", !!e);\n }\n get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(e) {\n this.toggleAttribute(\"no-style\", !!e);\n }\n #i = async (e)=>{\n try {\n this.#c(await $7aad62ebc3d6fae8$var$l(e));\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n };\n #r = ()=>{\n this.disabled || this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$n}-dragenter`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #s = (e)=>{\n if (e.preventDefault(), this.disabled) {\n e.dataTransfer.dropEffect = \"none\";\n return;\n }\n e.dataTransfer.dropEffect = \"copy\", this.#e && (this.#e.classList.add(\"dropzone--dragover\"), this.#e.part.add(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$n}-dragover`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #n = ()=>{\n this.disabled || (this.#e && (this.#e.classList.remove(\"dropzone--dragover\"), this.#e.part.remove(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$n}-dragleave`, {\n bubbles: !0,\n composed: !0\n })));\n };\n #a = async (e)=>{\n if (!this.disabled) {\n e.preventDefault(), this.#e && (this.#e.classList.remove(\"dropzone--dragover\"), this.#e.part.remove(\"dropzone--dragover\"));\n try {\n this.#c(await $7aad62ebc3d6fae8$var$l(e));\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n };\n #d = ()=>{\n this.disabled || this.#t?.click();\n };\n #l = (e)=>{\n this.disabled || (e.key === \" \" || e.key === \"Enter\") && this.#t?.click();\n };\n #c(e) {\n if (!Array.isArray(e) || !e.length) return;\n let t = [], i = [], s = e.length;\n if (!this.multiple && s > 1) for (let r of e)i.push({\n file: r,\n errors: [\n {\n code: $7aad62ebc3d6fae8$var$v,\n message: \"Too many files selected. Only 1 file is allowed.\"\n }\n ]\n });\n else if (this.multiple && s > this.maxFiles) for (let r of e)i.push({\n file: r,\n errors: [\n {\n code: $7aad62ebc3d6fae8$var$v,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else for (let r of e){\n let c = $7aad62ebc3d6fae8$var$u(r, this.accept), p = r.size > this.maxSize, h = r.size < this.minSize;\n if (c && !p && !h) t.push(r);\n else {\n let a = [];\n c || a.push({\n code: $7aad62ebc3d6fae8$var$A,\n message: `File type \"${r.type}\" is not accepted.`\n }), p && a.push({\n code: $7aad62ebc3d6fae8$var$L,\n message: `File size ${r.size} exceeds the maximum size of ${this.maxSize}.`\n }), h && a.push({\n code: $7aad62ebc3d6fae8$var$k,\n message: `File size ${r.size} is smaller than the minimum size of ${this.minSize}.`\n }), i.push({\n file: r,\n errors: a\n });\n }\n }\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-drop`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t,\n rejectedFiles: i\n }\n })), t.length > 0 && this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-drop-accepted`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t\n }\n })), i.length > 0 && this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-drop-rejected`, {\n bubbles: !0,\n composed: !0,\n detail: {\n rejectedFiles: i\n }\n })), this.#t && (this.#t.value = this.#t.defaultValue);\n }\n openFileDialog() {\n this.disabled || this.#t?.click();\n }\n #o(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n static defineCustomElement(e = $7aad62ebc3d6fae8$var$n) {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, o);\n }\n};\n$7aad62ebc3d6fae8$export$6ccd1735166caad9.defineCustomElement();\n\n\n/*!\n * @georapbox/resize-observer-element\n * A custom element that offers a declarative interface to the ResizeObserver API.\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/resize-observer-element#readme\n * @author George Raptis \n * @license MIT\n */ var $81b28a4cd686838b$var$d = \":host { display: contents; }\", $81b28a4cd686838b$var$o = document.createElement(\"template\");\n$81b28a4cd686838b$var$o.innerHTML = `\n \n \n`;\nvar $81b28a4cd686838b$export$f0e45424cc896229 = class n extends HTMLElement {\n #e = null;\n #t = null;\n #s = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($81b28a4cd686838b$var$o.content.cloneNode(!0)), this.#e = this.shadowRoot?.querySelector(\"slot\") ?? null;\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n e === \"disabled\" && t !== i && (this.disabled ? this.#o() : this.#i());\n }\n connectedCallback() {\n this.#d(\"disabled\"), \"ResizeObserver\" in window && (this.#t = new ResizeObserver((e)=>{\n this.dispatchEvent(new CustomEvent(\"resize-observer:resize\", {\n bubbles: !0,\n composed: !0,\n detail: {\n entries: e\n }\n }));\n }), this.disabled || this.#i(), this.#e?.addEventListener(\"slotchange\", this.#n));\n }\n disconnectedCallback() {\n this.#o(), this.#e?.removeEventListener(\"slotchange\", this.#n);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n #i() {\n !this.#e || !this.#t || (this.#s.forEach((e)=>this.#t?.unobserve(e)), this.#s = [], this.#e.assignedElements().forEach((e)=>{\n this.#t?.observe(e), this.#s.push(e);\n }));\n }\n #o() {\n this.#t?.disconnect();\n }\n #n = ()=>{\n this.disabled || this.#i();\n };\n #d(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n static defineCustomElement(e = \"resize-observer\") {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, n);\n }\n};\n$81b28a4cd686838b$export$f0e45424cc896229.defineCustomElement();\n\n\n/*!\n * @georapbox/modal-element\n * A custom element to create a modal, using the native dialog element under the hood.\n *\n * @version 1.8.0\n * @homepage https://github.com/georapbox/modal-element#readme\n * @author George Raptis \n * @license MIT\n */ var $4da30046ce6d9325$var$n = document.createElement(\"template\"), $4da30046ce6d9325$var$r = `\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: 300ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;\n$4da30046ce6d9325$var$n.innerHTML = `\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;\nvar $4da30046ce6d9325$export$32589115725b904b = class s extends HTMLElement {\n #e = null;\n #i = null;\n #a = null;\n #o = void 0;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($4da30046ce6d9325$var$n.content.cloneNode(!0)), this.shadowRoot && (this.#e = this.shadowRoot.querySelector(\"dialog\"), this.#i = this.shadowRoot.querySelector('slot[name=\"footer\"]'), this.#a = this.shadowRoot.querySelector('slot[name=\"close\"]'));\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\",\n \"close-label\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n if (this.#e !== null) {\n if (e === \"open\" && t !== i && (this.open ? (this.#e.showModal(), this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n })), document.body && !this.preserveOverflow && (document.body.style.overflow = \"hidden\")) : this.#e.close()), e === \"no-header\" && t !== i) {\n let o = this.#e.querySelector(\".dialog__header\");\n o !== null && (o.hidden = this.noHeader);\n }\n if (e === \"no-animations\" && t !== i && this.#e.classList.toggle(\"dialog--no-animations\", this.noAnimations), e === \"no-close-button\" && t !== i) {\n let o = this.#e.querySelector(\".dialog__close\");\n o !== null && (o.hidden = this.noCloseButton);\n }\n e === \"close-label\" && t !== i && this.#r();\n }\n }\n connectedCallback() {\n this.#t(\"open\"), this.#t(\"staticBackdrop\"), this.#t(\"noHeader\"), this.#t(\"noAnimations\"), this.#t(\"noCloseButton\"), this.#t(\"fullscreen\"), this.#t(\"preserveOverflow\"), this.#t(\"placement\"), this.#t(\"closeLabel\"), this.#e?.addEventListener(\"click\", this.#h), this.#e?.addEventListener(\"close\", this.#l), this.#e?.addEventListener(\"cancel\", this.#d), this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#c), this.#i?.addEventListener(\"slotchange\", this.#m), this.#a?.addEventListener(\"slotchange\", this.#g);\n }\n disconnectedCallback() {\n this.#o && clearTimeout(this.#o), this.#e?.addEventListener(\"click\", this.#h), this.#e?.removeEventListener(\"close\", this.#l), this.#e?.removeEventListener(\"cancel\", this.#d), this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#c), this.#i?.removeEventListener(\"slotchange\", this.#m), this.#a?.removeEventListener(\"slotchange\", this.#g);\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(e) {\n this.toggleAttribute(\"open\", !!e);\n }\n get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(e) {\n this.toggleAttribute(\"static-backdrop\", !!e);\n }\n get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(e) {\n this.toggleAttribute(\"no-header\", !!e);\n }\n get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(e) {\n this.toggleAttribute(\"no-animations\", !!e);\n }\n get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(e) {\n this.toggleAttribute(\"no-close-button\", !!e);\n }\n get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(e) {\n this.toggleAttribute(\"fullscreen\", !!e);\n }\n get preserveOverflow() {\n return this.hasAttribute(\"preserve-overflow\");\n }\n set preserveOverflow(e) {\n this.toggleAttribute(\"preserve-overflow\", !!e);\n }\n get placement() {\n return this.getAttribute(\"placement\") || \"center\";\n }\n set placement(e) {\n this.setAttribute(\"placement\", e != null ? e.toString() : e);\n }\n get closeLabel() {\n return this.getAttribute(\"close-label\") || \"Close\";\n }\n set closeLabel(e) {\n this.setAttribute(\"close-label\", e != null ? e.toString() : e);\n }\n #r() {\n if (this.#e === null) return;\n let e = this.#e.querySelector(\".dialog__close\");\n if (e === null) return;\n (this.#a?.assignedElements() || [])?.some((o)=>o.textContent?.replace(/\\s/g, \"\") !== \"\") ? e.removeAttribute(\"aria-label\") : e.setAttribute(\"aria-label\", this.closeLabel);\n }\n #n() {\n this.#o || (this.#e?.classList.add(\"dialog--pulse\"), this.#o = setTimeout(()=>{\n this.#e?.classList.remove(\"dialog--pulse\"), clearTimeout(this.#o), this.#o = void 0;\n }, 300));\n }\n #l = ()=>{\n this.open = !1, this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n })), document.body && !this.preserveOverflow && (document.body.style.overflow = \"\");\n };\n #d = (e)=>{\n let t = this.#s(\"escape-key\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), !this.noAnimations && this.#n());\n };\n #c = (e)=>{\n let t = this.#s(\"close-button\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), !this.noAnimations && this.#n());\n };\n #h = (e)=>{\n let t = e.target, i = e.currentTarget;\n if (t === i) {\n let o = this.#s(\"backdrop-click\");\n this.dispatchEvent(o), o.defaultPrevented || this.staticBackdrop ? !this.noAnimations && this.#n() : this.hide();\n }\n if (t instanceof HTMLElement && t.closest(\"[data-me-close]\") !== null) {\n let o = this.#s(\"external-invoker\");\n this.dispatchEvent(o), o.defaultPrevented ? !this.noAnimations && this.#n() : this.hide();\n }\n };\n #m = ()=>{\n if (this.#e === null) return;\n let e = this.#e.querySelector(\".dialog__footer\");\n if (e === null) return;\n let t = this.#i?.assignedNodes(), i = t ? t.length > 0 : !1;\n e.hidden = !i;\n };\n #g = ()=>{\n this.#r();\n };\n #s(e) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: !0,\n composed: !0,\n cancelable: !0,\n detail: {\n reason: e,\n element: this\n }\n });\n }\n #t(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n show() {\n this.open || (this.open = !0);\n }\n hide() {\n this.open && (this.open = !1);\n }\n static defineCustomElement(e = \"modal-element\") {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, s);\n }\n};\n$4da30046ce6d9325$export$32589115725b904b.defineCustomElement();\n\n\nconst $33dea9d9a6da4c9a$export$d726fc97fa83318d = \"experimental\";\nconst $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a = \"No barcode detected\";\nconst $33dea9d9a6da4c9a$export$63e7bed68b07a85c = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\"\n];\n\n\nfunction $e92a13782f6c06ba$var$_slicedToArray(arr, i) {\n return $e92a13782f6c06ba$var$_arrayWithHoles(arr) || $e92a13782f6c06ba$var$_iterableToArrayLimit(arr, i) || $e92a13782f6c06ba$var$_unsupportedIterableToArray(arr, i) || $e92a13782f6c06ba$var$_nonIterableRest();\n}\nfunction $e92a13782f6c06ba$var$_nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction $e92a13782f6c06ba$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $e92a13782f6c06ba$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $e92a13782f6c06ba$var$_arrayLikeToArray(o, minLen);\n}\nfunction $e92a13782f6c06ba$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $e92a13782f6c06ba$var$_iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction $e92a13782f6c06ba$var$_arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction $e92a13782f6c06ba$export$b327150396135fe7(request) {\n return new Promise(function(resolve, reject) {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = function() {\n return resolve(request.result);\n }; // @ts-ignore - file size hacks\n request.onabort = request.onerror = function() {\n return reject(request.error);\n };\n });\n}\nfunction $e92a13782f6c06ba$export$f51a9068ac82ea43(dbName, storeName) {\n var request = indexedDB.open(dbName);\n request.onupgradeneeded = function() {\n return request.result.createObjectStore(storeName);\n };\n var dbp = $e92a13782f6c06ba$export$b327150396135fe7(request);\n return function(txMode, callback) {\n return dbp.then(function(db) {\n return callback(db.transaction(storeName, txMode).objectStore(storeName));\n });\n };\n}\nvar $e92a13782f6c06ba$var$defaultGetStoreFunc;\nfunction $e92a13782f6c06ba$var$defaultGetStore() {\n if (!$e92a13782f6c06ba$var$defaultGetStoreFunc) $e92a13782f6c06ba$var$defaultGetStoreFunc = $e92a13782f6c06ba$export$f51a9068ac82ea43(\"keyval-store\", \"keyval\");\n return $e92a13782f6c06ba$var$defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$3988ae62b71be9a3(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n return $e92a13782f6c06ba$export$b327150396135fe7(store.get(key));\n });\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$adaa4cf7ef1b65be(key, value) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.put(value, key);\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$daa0a5170277c7a8(entries) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n entries.forEach(function(entry) {\n return store.put(entry[1], entry[0]);\n });\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$5df405cccea42673(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n return Promise.all(keys.map(function(key) {\n return $e92a13782f6c06ba$export$b327150396135fe7(store.get(key));\n }));\n });\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$722fbec263ad908a(key, updater) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n return(// If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise(function(resolve, reject) {\n store.get(key).onsuccess = function() {\n try {\n store.put(updater(this.result), key);\n resolve($e92a13782f6c06ba$export$b327150396135fe7(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n }));\n });\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$1d2f21e549771e67(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.delete(key);\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$c8aa84257229cac8(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n keys.forEach(function(key) {\n return store.delete(key);\n });\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$42ffd38884aecdac() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.clear();\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\nfunction $e92a13782f6c06ba$var$eachCursor(store, callback) {\n store.openCursor().onsuccess = function() {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$ed97f33186d4b816() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n if (store.getAllKeys) return $e92a13782f6c06ba$export$b327150396135fe7(store.getAllKeys());\n var items = [];\n return $e92a13782f6c06ba$var$eachCursor(store, function(cursor) {\n return items.push(cursor.key);\n }).then(function() {\n return items;\n });\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$68c286be0e7e55b7() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n if (store.getAll) return $e92a13782f6c06ba$export$b327150396135fe7(store.getAll());\n var items = [];\n return $e92a13782f6c06ba$var$eachCursor(store, function(cursor) {\n return items.push(cursor.value);\n }).then(function() {\n return items;\n });\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$3e9f948b41964866() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) return Promise.all([\n $e92a13782f6c06ba$export$b327150396135fe7(store.getAllKeys()),\n $e92a13782f6c06ba$export$b327150396135fe7(store.getAll())\n ]).then(function(_ref) {\n var _ref2 = $e92a13782f6c06ba$var$_slicedToArray(_ref, 2), keys = _ref2[0], values = _ref2[1];\n return keys.map(function(key, i) {\n return [\n key,\n values[i]\n ];\n });\n });\n var items = [];\n return customStore(\"readonly\", function(store) {\n return $e92a13782f6c06ba$var$eachCursor(store, function(cursor) {\n return items.push([\n cursor.key,\n cursor.value\n ]);\n }).then(function() {\n return items;\n });\n });\n });\n}\n\n\nconst $c96efe8837e99c11$var$STORAGE_PREFIX = \"barcode-scanner/\";\nconst $c96efe8837e99c11$var$SETTINGS_STORAGE_KEY = \"settings\";\nconst $c96efe8837e99c11$var$HISTORY_STORAGE_KEY = \"history\";\n/**\n * Gets an item from the storage.\n *\n * @param {string} key - The key to get the item from.\n * @returns {Promise<[ error: any, value: any ]>} The item and an error if occurred.\n */ const $c96efe8837e99c11$var$getItem = async (key)=>{\n try {\n return [\n null,\n await (0, $e92a13782f6c06ba$export$3988ae62b71be9a3)(key)\n ];\n } catch (error) {\n return [\n error,\n void 0\n ];\n }\n};\n/**\n * Sets an item in the storage.\n *\n * @param {string} key - The key to set the item to.\n * @param {any} data - The data to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */ const $c96efe8837e99c11$var$setItem = async (key, data)=>{\n try {\n await (0, $e92a13782f6c06ba$export$adaa4cf7ef1b65be)(key, data);\n return [\n null\n ];\n } catch (error) {\n return [\n error\n ];\n }\n};\nconst $c96efe8837e99c11$export$4a647155031ece = async ()=>{\n return $c96efe8837e99c11$var$getItem($c96efe8837e99c11$var$STORAGE_PREFIX + $c96efe8837e99c11$var$SETTINGS_STORAGE_KEY);\n};\nconst $c96efe8837e99c11$export$dc86d17a64679bc7 = async (data)=>{\n return $c96efe8837e99c11$var$setItem($c96efe8837e99c11$var$STORAGE_PREFIX + $c96efe8837e99c11$var$SETTINGS_STORAGE_KEY, data);\n};\nconst $c96efe8837e99c11$export$f9582a3c130d9538 = async ()=>{\n return $c96efe8837e99c11$var$getItem($c96efe8837e99c11$var$STORAGE_PREFIX + $c96efe8837e99c11$var$HISTORY_STORAGE_KEY);\n};\nconst $c96efe8837e99c11$export$96fe1132eb44c325 = async (data)=>{\n return $c96efe8837e99c11$var$setItem($c96efe8837e99c11$var$STORAGE_PREFIX + $c96efe8837e99c11$var$HISTORY_STORAGE_KEY, data);\n};\n\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * 'n' milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {function} fn The function to be executed.\n * @param {Number} [wait=0] Time of delay in milliseconds. It is required if `immediate` is used.\n * @param {Boolean} [immediate=false] If true or any truthy value, triggers the function on the leading edge.\n * @throws {TypeError} If `fn` is not function.\n * @returns {function} A new debounced function.\n * @example\n *\n * const debouncedHandler = debounce(() => {\n * // Do your thing here...\n * }, 250);\n *\n * window.addEventListener('resize', debouncedHandler, false);\n */ const $f7942db15ba0cc81$export$61fc7d43ac8f84b0 = (fn, wait = 0, immediate = false)=>{\n let timerId = null;\n if (typeof fn !== \"function\") throw new TypeError(\"Expected a function for first argument\");\n return (...args)=>{\n clearTimeout(timerId);\n if (immediate && !timerId) fn(...args);\n timerId = setTimeout(()=>{\n timerId = null;\n if (!immediate) fn(...args);\n }, wait);\n };\n};\n\n\n/**\n * Log to console only in development mode.\n *\n * @param {...any} args - Arguments to log\n */ function $e3e25c01e64ec360$export$bef1f36f5486a6a3(...args) {}\n\n\n/**\n * Check if the dialog element is supported.\n *\n * @returns {boolean} - Returns true if the dialog element is supported.\n */ const $4840d5fa714b09de$export$c694186e9d94f0 = ()=>{\n return typeof HTMLDialogElement === \"function\";\n};\n\n\n/**\n * Renders the supported formats.\n *\n * @param {Array} formats - Supported barcode formats\n */ function $fe7f448e3206b625$export$f6bb24723b821792(formats) {\n if (!Array.isArray(formats) || formats.length === 0) return;\n const supportedFormatsEl = document.getElementById(\"supportedFormats\");\n if (!supportedFormatsEl) return;\n supportedFormatsEl.textContent = `Supported formats: ${formats.join(\", \")}`;\n}\n\n\n\nfunction $2cce6ab38d28b4d0$export$fa9e3380e441c420(data) {\n const historyList = document.getElementById(\"historyList\");\n if (!historyList) return;\n const emptyHistoryBtn = document.getElementById(\"emptyHistoryBtn\");\n historyList.replaceChildren();\n if (!Array.isArray(data) || data.length === 0) {\n historyList.innerHTML = \"
  • There are no saved items in history.
  • \";\n emptyHistoryBtn.hidden = true;\n } else {\n emptyHistoryBtn.hidden = false;\n data.forEach((item, index)=>{\n const li = document.createElement(\"li\");\n li.setAttribute(\"data-value\", item);\n let historyItem;\n try {\n new URL(item);\n historyItem = document.createElement(\"a\");\n historyItem.href = item;\n historyItem.setAttribute(\"target\", \"_blank\");\n historyItem.setAttribute(\"rel\", \"noreferrer noopener\");\n } catch {\n historyItem = document.createElement(\"span\");\n }\n historyItem.textContent = item;\n historyItem.setAttribute(\"id\", `historyItem-${index}`);\n const actionsEl = document.createElement(\"div\");\n actionsEl.className = \"history-modal__actions\";\n const copyBtn = document.createElement(\"custom-clipboard-copy\");\n copyBtn.setAttribute(\"id\", `copyHistoryItem-${index}`);\n copyBtn.setAttribute(\"aria-label\", \"Copy to clipboard\");\n copyBtn.setAttribute(\"aria-labelledby\", `copyHistoryItem-${index} historyItem-${index}`);\n copyBtn.setAttribute(\"only-icon\", \"\");\n copyBtn.setAttribute(\"value\", item);\n actionsEl.appendChild(copyBtn);\n const removeBtn = document.createElement(\"button\");\n removeBtn.type = \"button\";\n removeBtn.className = \"history-modal__delete-action\";\n removeBtn.setAttribute(\"data-action\", \"delete\");\n removeBtn.setAttribute(\"id\", `removeHistoryItem-${index}`);\n removeBtn.setAttribute(\"aria-label\", \"Remove from history\");\n removeBtn.setAttribute(\"aria-labelledby\", `removeHistoryItem-${index} historyItem-${index}`);\n removeBtn.innerHTML = /* html */ `\n \n \n \n `;\n actionsEl.appendChild(removeBtn);\n li.appendChild(historyItem);\n li.appendChild(actionsEl);\n historyList.appendChild(li);\n });\n }\n}\nasync function $2cce6ab38d28b4d0$export$7a6a9d84993ff4e(item) {\n const [, settings] = await (0, $c96efe8837e99c11$export$4a647155031ece)();\n if (!item || !settings?.addToHistory) return;\n const [getHistoryError, history = []] = await (0, $c96efe8837e99c11$export$f9582a3c130d9538)();\n if (!getHistoryError && Array.isArray(history) && !history.find((h)=>h === item)) {\n const data = [\n ...history,\n item\n ];\n const [setHistoryError] = await (0, $c96efe8837e99c11$export$96fe1132eb44c325)(data);\n if (!setHistoryError) $2cce6ab38d28b4d0$export$fa9e3380e441c420(data);\n }\n}\nasync function $2cce6ab38d28b4d0$export$3a61248021dae916(item) {\n if (!item) return;\n const [getHistoryError, history = []] = await (0, $c96efe8837e99c11$export$f9582a3c130d9538)();\n if (!getHistoryError && Array.isArray(history)) {\n const data = history.filter((el)=>el !== item);\n const [setHistoryError] = await (0, $c96efe8837e99c11$export$96fe1132eb44c325)(data);\n if (!setHistoryError) $2cce6ab38d28b4d0$export$fa9e3380e441c420(data);\n }\n}\nasync function $2cce6ab38d28b4d0$export$9f74b61e5d33cda2() {\n const [setHistoryError] = await (0, $c96efe8837e99c11$export$96fe1132eb44c325)([]);\n if (!setHistoryError) $2cce6ab38d28b4d0$export$fa9e3380e441c420([]);\n}\n\n\n/**\n * Removes the scanned result from the element where it is shown.\n *\n * @param {HTMLElement} element - The element to remove the result from.\n */ function $696a3a8b3e5710f1$export$ad20350fbdf13c97(element) {\n if (!element) return;\n const scanResultEl = element.querySelector(\"scan-result\");\n scanResultEl?.remove();\n}\nasync function $696a3a8b3e5710f1$export$97c08f0895810b94(element, value) {\n if (!element || !value) return;\n const oldScanResultEl = element.querySelector(\"scan-result\");\n if (oldScanResultEl) oldScanResultEl.setAttribute(\"value\", value);\n else {\n const newScanResultEl = document.createElement(\"scan-result\");\n newScanResultEl.setAttribute(\"value\", value);\n newScanResultEl.setAttribute(\"role\", \"alert\");\n newScanResultEl.setAttribute(\"aria-live\", \"assertive\");\n newScanResultEl.setAttribute(\"aria-atomic\", \"true\");\n element.appendChild(newScanResultEl);\n }\n}\n\n\n\n/**\n * Beep sound using the `AudioContext` interface.\n *\n * @param {Object} options\n * @param {Number} options.duration - Duration in milliseconds\n * @param {Number} options.frequency - Frequency in Hz\n * @param {Number} options.volume - Volume\n * @param {String} options.type - Type of oscillator\n * @param {Function} options.onEnded - Callback function when the sound ends\n */ const $19ecce1b28895d1c$export$d6c943e433460aae = (()=>{\n const audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext)();\n if (!audioCtx) return;\n return (options)=>{\n const { duration: duration, frequency: frequency, volume: volume, type: type, onEnded: onEnded } = options;\n const oscillator = audioCtx.createOscillator();\n const gainNode = audioCtx.createGain();\n oscillator.connect(gainNode);\n gainNode.connect(audioCtx.destination);\n if (volume) gainNode.gain.value = volume;\n if (frequency) oscillator.frequency.value = frequency;\n if (type) oscillator.type = type;\n if (typeof onEnded === \"function\") oscillator.onended = onEnded;\n oscillator.start(audioCtx.currentTime);\n oscillator.stop(audioCtx.currentTime + (duration || 500) / 1000);\n };\n})();\n\n\n/**\n * Vibrate the device.\n * If the device does not support vibration, this function will fail silently.\n *\n * @param {Number} [duration=0] - Duration in milliseconds\n */ async function $08aca92dc2b3c75c$export$3ca8e905da0a0ca8(duration = 0) {\n if (typeof window.navigator.vibrate !== \"function\") return;\n try {\n window.navigator.vibrate(duration);\n } catch {\n // Fail silently...\n }\n}\n\n\nasync function $0460f8ef7b1421c2$export$9b466d13e2031a67(options = {}) {\n const { success: success = true } = options;\n const [, settings] = await (0, $c96efe8837e99c11$export$4a647155031ece)();\n if (!settings) return;\n const beepConfig = success ? {\n duration: 200,\n frequency: 860,\n volume: 0.03,\n type: \"square\"\n } : {\n duration: 300,\n frequency: 200,\n volume: 0.05,\n type: \"sawtooth\"\n };\n settings.beep && (0, $19ecce1b28895d1c$export$d6c943e433460aae)(beepConfig);\n settings.vibrate && (0, $08aca92dc2b3c75c$export$3ca8e905da0a0ca8)(success ? 100 : 200);\n}\n\n\n/**\n * Resizes the scan frame to match the video element's dimensions.\n *\n * @param {HTMLVideoElement} videoEl - Video element\n * @param {HTMLElement} scanFrameEl - Scan frame element\n */ function $d335f5b5c097c74d$export$1404f0e91c73fec(videoEl, scanFrameEl) {\n if (!videoEl || !scanFrameEl) return;\n const rect = videoEl.getBoundingClientRect();\n scanFrameEl.style.cssText = `width: ${rect.width}px; height: ${rect.height}px`;\n}\n\n\n\n\n/**\n * BarcodeReader class to detect barcodes from images or videos.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector\n */ class $586e2c3c9ffe53e0$export$f21d9483ebeee00a {\n static async polyfill() {\n if (!(\"BarcodeDetector\" in window)) try {\n await (parcelRequire(\"bkcP3\"));\n (0, $e3e25c01e64ec360$export$bef1f36f5486a6a3)(\"Using BarcodeDetector polyfill.\");\n } catch {\n throw new Error(\"BarcodeDetector API is not supported by your browser.\");\n }\n else (0, $e3e25c01e64ec360$export$bef1f36f5486a6a3)(\"Using the native BarcodeDetector API.\");\n }\n /**\n * Get the supported barcode formats.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/getSupportedFormats\n * @returns {Promise>} - Supported barcode formats\n */ static async getSupportedFormats() {\n return await window.BarcodeDetector.getSupportedFormats();\n }\n /**\n * Create a new BarcodeReader instance.\n *\n * @returns {Promise} - New BarcodeReader instance\n */ static async create() {\n const formats = await window.BarcodeDetector.getSupportedFormats();\n return new $586e2c3c9ffe53e0$export$f21d9483ebeee00a(formats);\n }\n /**\n * Initialize the BarcodeReader.\n *\n * @returns {Promise<{ barcodeReader: BarcodeReader, barcodeFormats: Array, barcodeReaderError: Error }>} - BarcodeReader instance, supported formats, and error\n */ static async init() {\n try {\n await $586e2c3c9ffe53e0$export$f21d9483ebeee00a.polyfill();\n const barcodeReader = await $586e2c3c9ffe53e0$export$f21d9483ebeee00a.create();\n const barcodeFormats = await $586e2c3c9ffe53e0$export$f21d9483ebeee00a.getSupportedFormats();\n return {\n barcodeReader: barcodeReader,\n barcodeFormats: barcodeFormats,\n barcodeReaderError: null\n };\n } catch (error) {\n return {\n barcodeReader: null,\n barcodeFormats: [],\n barcodeReaderError: error\n };\n }\n }\n /**\n * Create a new BarcodeReader instance.\n *\n * @param {Array} formats - Supported barcode formats\n */ constructor(formats){\n this.barcodeReader = new window.BarcodeDetector({\n formats: formats\n });\n }\n /**\n * Detect barcodes from the provided source.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/detect\n * @param {HTMLImageElement|HTMLVideoElement|ImageBitmap} source - Image or video element or ImageBitmap\n * @returns {Promise} - Barcode detection result\n */ async detect(source) {\n if (!this.barcodeReader) throw new Error(\"BarcodeReader is not initialized.\");\n const results = await this.barcodeReader.detect(source);\n if (Array.isArray(results) && results.length > 0) return results[0];\n else throw new Error(\"Could not detect barcode from provided source.\");\n }\n}\n\n\n\nasync function $c8149428128c684b$export$9d22ef9ff8e481fe(form) {\n const [, settings = {}] = await (0, $c96efe8837e99c11$export$4a647155031ece)();\n Object.entries(settings).forEach(([key, value])=>{\n const settingInput = form.querySelector(`[name=\"${key}\"]`);\n if (!settingInput) return;\n settingInput.checked = value;\n });\n}\n\n\n/**\n * Toggles the torch button status.\n * The torch button has two icons, one for on and one for off.\n * This function toggles the visibility of the icons based on the torch state and updates the button title.\n *\n * @param {HTMLButtonElement} buttonEl - The torch button element.\n * @param {boolean} isTorchOn - The torch state.\n */ function $7c034485d4f152a1$export$d1bd0b12fe0d046(options = {}) {\n const defaults = {\n el: document.getElementById(\"torchButton\"),\n isTorchOn: false\n };\n const { el: el, isTorchOn: isTorchOn } = {\n ...defaults,\n ...options\n };\n const iconPaths = el.querySelectorAll(\"svg path\");\n if (iconPaths.length !== 2) return;\n iconPaths[0].style.display = isTorchOn ? \"none\" : \"block\";\n iconPaths[1].style.display = isTorchOn ? \"block\" : \"none\";\n el.setAttribute(\"title\", `Turn ${isTorchOn ? \"off\" : \"on\"} flash`);\n}\n\n\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */ const $52c18c31ba376620$export$7d15b64cf5a3a4c4 = (value, lower, upper)=>{\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n\n\nconst $149eedd8690347fa$var$COMPONENT_NAME = \"video-capture\";\nconst $149eedd8690347fa$var$styles = /* css */ `\n :host { display: block; box-sizing: border-box; }\n :host *, :host *::before, :host *::after { box-sizing: inherit;}\n :host([hidden]), [hidden], ::slotted([hidden]) { display: none; }\n video { display: block; }\n #output:empty { display: none; }\n`;\nconst $149eedd8690347fa$var$template = document.createElement(\"template\");\n$149eedd8690347fa$var$template.innerHTML = /* html */ `\n \n \n
    \n \n`;\nclass $149eedd8690347fa$export$682e9ed90a89bb4a extends HTMLElement {\n #supportedConstraints = {};\n #stream = null;\n #videoElement = null;\n constructor(){\n super();\n this.#supportedConstraints = this.getSupportedConstraints();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($149eedd8690347fa$var$template.content.cloneNode(true));\n }\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"pan\",\n \"tilt\",\n \"zoom\",\n \"torch\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n const trackCapabilities = this.getTrackCapabilities();\n if (name === \"zoom\" && oldValue !== newValue && \"zoom\" in this.#supportedConstraints) {\n const zoomInAllowedRange = \"zoom\" in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max : false;\n if (typeof this.zoom === \"number\" && zoomInAllowedRange) this.#applyConstraint(\"zoom\", this.zoom);\n }\n if (name === \"torch\" && oldValue !== newValue && \"torch\" in this.#supportedConstraints) this.#applyConstraint(\"torch\", this.torch);\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ async connectedCallback() {\n this.#upgradeProperty(\"autoPlay\");\n this.#upgradeProperty(\"facingMode\");\n this.#upgradeProperty(\"zoom\");\n this.#upgradeProperty(\"torch\");\n this.#videoElement = this.shadowRoot?.querySelector(\"video\") || null;\n this.#videoElement?.addEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n if (!$149eedd8690347fa$export$682e9ed90a89bb4a.isSupported()) return this.dispatchEvent(new CustomEvent(`${$149eedd8690347fa$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n if (this.autoPlay) this.startVideoStream();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.stopVideoStream();\n this.#videoElement?.removeEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n }\n get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(value) {\n this.toggleAttribute(\"auto-play\", !!value);\n }\n get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(value) {\n this.setAttribute(\"facing-mode\", value);\n }\n get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(value) {\n this.setAttribute(\"zoom\", value != null ? value.toString() : value);\n }\n get torch() {\n return this.hasAttribute(\"torch\");\n }\n set torch(value) {\n this.toggleAttribute(\"torch\", !!value);\n }\n get loading() {\n return this.hasAttribute(\"loading\");\n }\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {Event} evt - The event object.\n */ #onVideoLoadedMetaData = (evt)=>{\n const video = evt.target;\n video.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$149eedd8690347fa$var$COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: {\n video: video\n }\n }));\n }).catch((error)=>{\n this.dispatchEvent(new CustomEvent(`${$149eedd8690347fa$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n /**\n * Applies a constraint to the video track.\n *\n * @param {string} constraint - The name of the constraint.\n * @param {any} value - The value of the constraint.\n */ #applyConstraint(constraint, value) {\n if (!this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n const constraintValue = constraint === \"pan\" || constraint === \"tilt\" || constraint === \"zoom\" ? (0, $52c18c31ba376620$export$7d15b64cf5a3a4c4)(Number(value), trackCapabilities[constraint]?.min || 1, trackCapabilities[constraint]?.max || 1) : value;\n if (constraint in trackSettings) track.applyConstraints({\n advanced: [\n {\n [constraint]: constraintValue\n }\n ]\n }).catch(()=>{\n // Fail silently...\n });\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n /**\n * Starts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n * @returns Promise\n */ async startVideoStream(videoInputId) {\n if (!$149eedd8690347fa$export$682e9ed90a89bb4a.isSupported() || this.#stream) return;\n this.setAttribute(\"loading\", \"\");\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: true,\n tilt: true,\n zoom: true,\n torch: this.torch\n },\n audio: false\n };\n if (typeof videoInputId === \"string\" && videoInputId.trim().length > 0) constraints.video.deviceId = {\n exact: videoInputId\n };\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.#videoElement) this.#videoElement.srcObject = this.#stream;\n this.#applyConstraint(\"pan\", this.pan);\n this.#applyConstraint(\"tilt\", this.tilt);\n this.#applyConstraint(\"zoom\", this.zoom);\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$149eedd8690347fa$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n /**\n * Restarts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n */ restartVideoStream(videoInputId) {\n if (this.#stream && this.#videoElement) this.stopVideoStream();\n this.startVideoStream(videoInputId);\n }\n /**\n * Stops the video stream.\n */ stopVideoStream() {\n if (!this.#videoElement || !this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */ getSupportedConstraints() {\n if (!$149eedd8690347fa$export$682e9ed90a89bb4a.isSupported()) return {};\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */ getTrackCapabilities() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getCapabilities === \"function\") return track.getCapabilities() || {};\n return {};\n }\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */ getTrackSettings() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getSettings === \"function\") return track.getSettings() || {};\n return {};\n }\n /**\n * Returns the available video input devices.\n *\n * @returns {Promise}\n */ static async getVideoInputDevices() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) return [];\n const devices = await navigator.mediaDevices.enumerateDevices() || [];\n return devices.filter((device)=>device.kind === \"videoinput\" && !!device.deviceId);\n }\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */ static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='video-capture'] - The name of the custom element.\n */ static defineCustomElement(elementName = $149eedd8690347fa$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $149eedd8690347fa$export$682e9ed90a89bb4a);\n }\n}\n\n\n/*!\n * @georapbox/clipboard-copy-element\n * A custom element that implements the Clipboard API to copy text content from elements or input values to the clipboard.\n *\n * @version 3.0.2\n * @homepage https://github.com/georapbox/clipboard-copy-element#readme\n * @author George Raptis \n * @license MIT\n */ var $5e1cbbd957798f18$var$i = \"clipboard-copy\";\nvar $5e1cbbd957798f18$var$o = \"success\", $5e1cbbd957798f18$var$n = \"error\", $5e1cbbd957798f18$var$h = document.createElement(\"template\"), $5e1cbbd957798f18$var$a = `\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;\n$5e1cbbd957798f18$var$h.innerHTML = `\n \n \n`;\nvar $5e1cbbd957798f18$export$ea3b71af1761ff40 = class d extends HTMLElement {\n #e = void 0;\n #t = null;\n #s = null;\n #i = null;\n #o = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($5e1cbbd957798f18$var$h.content.cloneNode(!0)), this.shadowRoot && (this.#t = this.shadowRoot.querySelector(\"button\"), this.#s = this.shadowRoot.querySelector('slot[name=\"copy\"]'), this.#i = this.shadowRoot.querySelector('slot[name=\"success\"]'), this.#o = this.shadowRoot.querySelector('slot[name=\"error\"]'));\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, s, e) {\n t === \"disabled\" && s !== e && this.#t && (this.#t.disabled = this.disabled, this.#t.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#t.part.contains(\"button\") && this.#t.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#n(\"value\"), this.#n(\"from\"), this.#n(\"disabled\"), this.#n(\"feedbackDuration\"), this.#t?.addEventListener(\"click\", this.#r);\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"click\", this.#r), this.#a();\n }\n get value() {\n return this.getAttribute(\"value\") || \"\";\n }\n set value(t) {\n this.setAttribute(\"value\", t != null ? t.toString() : t);\n }\n get from() {\n return this.getAttribute(\"from\") || \"\";\n }\n set from(t) {\n this.setAttribute(\"from\", t != null ? t.toString() : t);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get feedbackDuration() {\n return Number(this.getAttribute(\"feedback-duration\")) || 1e3;\n }\n set feedbackDuration(t) {\n this.setAttribute(\"feedback-duration\", t != null ? t.toString() : t);\n }\n async #d() {\n if (!(!this.value && !this.from)) try {\n let t = \"\";\n if (this.value) t = this.value;\n else if (this.from) {\n let s = \"getRootNode\" in Element.prototype ? this.#t?.getRootNode({\n composed: !0\n }) : this.#t?.ownerDocument;\n if (!s || !(s instanceof Document || s instanceof ShadowRoot)) return;\n let e = s.querySelector(this.from);\n if (!e) return;\n e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement ? t = e.value : e instanceof HTMLAnchorElement && e.hasAttribute(\"href\") ? t = e.href : t = e.textContent || \"\";\n }\n await navigator.clipboard.writeText(t), this.#h($5e1cbbd957798f18$var$o), this.dispatchEvent(new CustomEvent(`${$5e1cbbd957798f18$var$i}-success`, {\n bubbles: !0,\n composed: !0,\n detail: {\n value: t\n }\n }));\n } catch (t) {\n this.#h($5e1cbbd957798f18$var$n), this.dispatchEvent(new CustomEvent(`${$5e1cbbd957798f18$var$i}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #r = (t)=>{\n t.preventDefault(), !(this.disabled || this.#e) && this.#d();\n };\n #h(t) {\n this.#s && (this.#s.hidden = !0), this.#i && (this.#i.hidden = t !== $5e1cbbd957798f18$var$o), this.#o && (this.#o.hidden = t !== $5e1cbbd957798f18$var$n), this.#t?.part.remove(\"button--success\"), this.#t?.part.remove(\"button--error\"), this.#t?.part.add(`button--${t}`), this.#e && clearTimeout(this.#e), this.#e = setTimeout(()=>{\n this.#s && (this.#s.hidden = !1), this.#i && (this.#i.hidden = !0), this.#o && (this.#o.hidden = !0), this.#t?.part.remove(`button--${t}`), this.#e = void 0;\n }, this.feedbackDuration);\n }\n #a() {\n this.#e && clearTimeout(this.#e), this.#e = void 0, this.#s && (this.#s.hidden = !1), this.#i && (this.#i.hidden = !0), this.#o && (this.#o.hidden = !0), this.#t?.part.remove(\"button--success\"), this.#t?.part.remove(\"button--error\");\n }\n #n(t) {\n let s = this;\n if (Object.prototype.hasOwnProperty.call(s, t)) {\n let e = s[t];\n delete s[t], s[t] = e;\n }\n }\n static defineCustomElement(t = $5e1cbbd957798f18$var$i) {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, d);\n }\n};\n\n\n/**\n * Extends the `ClipboardCopy` element to override the default `copy` and `success` slots,\n * in order to avoid repetition of the same markup throughout the application.\n * It also adds aditional properties and attributes, specific to the application.\n *\n * @class CustomClipboardCopy\n * @extends ClipboardCopy\n */ class $9d6e877208021767$var$CustomClipboardCopy extends (0, $5e1cbbd957798f18$export$ea3b71af1761ff40) {\n constructor(){\n super();\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n copySlot.innerHTML = /* html */ `\n \n \n \n \n Copy\n `;\n successSlot.innerHTML = /* html */ `\n \n \n \n \n \n Copied!\n `;\n }\n static get observedAttributes() {\n return [\n ...super.observedAttributes,\n \"only-icon\"\n ];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name === \"only-icon\" && oldValue !== newValue) {\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n const copyText = copySlot.querySelector(\".text\");\n const successText = successSlot.querySelector(\".text\");\n if (copyText) copyText.hidden = this.onlyIcon;\n if (successText) successText.hidden = this.onlyIcon;\n }\n }\n get onlyIcon() {\n return this.hasAttribute(\"only-icon\");\n }\n set onlyIcon(value) {\n if (value) this.setAttribute(\"only-icon\", \"\");\n else this.removeAttribute(\"only-icon\");\n }\n connectedCallback() {\n super.connectedCallback();\n this.#upgradeProperty(\"onlyIcon\");\n if (!this.hasAttribute(\"feedback-duration\")) this.setAttribute(\"feedback-duration\", \"1500\");\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"custom-clipboard-copy\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $9d6e877208021767$var$CustomClipboardCopy);\n }\n}\n$9d6e877208021767$var$CustomClipboardCopy.defineCustomElement();\n\n\n/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */ function $94933cc6427541bd$export$c37129e465f64ef0(a) {\n return a !== null && typeof a == \"object\" ? \"share\" in navigator && \"canShare\" in navigator && navigator.canShare(a) : \"share\" in navigator;\n}\n\n\n\n\nconst $1952518f8eeecdff$var$styles = /* css */ `\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n .result {\n position: relative;\n width: 100%;\n border: 1px solid var(--focus);\n border-radius: 6px;\n margin: 1.5rem 0 0 0;\n padding: 1rem;\n background-color: var(--background-alt);\n text-align: center;\n }\n\n .result__item {\n word-wrap: break-word;\n word-break: break-word;\n }\n\n a.result__item {\n color: var(--links);\n text-decoration: none;\n }\n\n a.result__item:hover {\n text-decoration: underline;\n }\n\n .result__item--no-barcode {\n color: var(--error-color);\n }\n\n .result__actions {\n display: flex;\n align-items: center;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .result web-share button,\n .result custom-clipboard-copy::part(button) {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n margin: 0.75rem 0 0 0;\n padding: 0.25rem;\n background-color: transparent;\n border: 0;\n border-radius: var(--border-radius);\n color: inherit;\n line-height: 1;\n font-family: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n`;\nconst $1952518f8eeecdff$var$template = document.createElement(\"template\");\n$1952518f8eeecdff$var$template.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n \n \n \n
    \n
    \n`;\nclass $1952518f8eeecdff$var$ScanResult extends HTMLElement {\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($1952518f8eeecdff$var$template.content.cloneNode(true));\n }\n }\n get value() {\n return this.getAttribute(\"value\");\n }\n set value(value) {\n this.setAttribute(\"value\", value);\n }\n static get observedAttributes() {\n return [\n \"value\"\n ];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"value\" && oldValue !== newValue) this.#handleValueChange(this.value);\n }\n connectedCallback() {\n this.#upgradeProperty(\"value\");\n if (!(0, $94933cc6427541bd$export$c37129e465f64ef0)()) {\n const webShareEl = this.shadowRoot.querySelector(\"web-share\");\n if (webShareEl) webShareEl.hidden = true;\n }\n }\n async #handleValueChange(value) {\n const baseEl = this.shadowRoot.querySelector(\".result\");\n const resultActionsEl = baseEl?.querySelector(\".result__actions\");\n const oldResultItem = baseEl?.querySelector(\".result__item\");\n let resultItem;\n if (oldResultItem) oldResultItem.remove();\n try {\n const [, settings] = await (0, $c96efe8837e99c11$export$4a647155031ece)();\n new URL(value);\n resultItem = document.createElement(\"a\");\n resultItem.href = value;\n window.requestAnimationFrame(()=>resultItem.focus());\n if (!settings?.openWebPageSameTab) {\n resultItem.setAttribute(\"target\", \"_blank\");\n resultItem.setAttribute(\"rel\", \"noreferrer noopener\");\n }\n if (settings?.openWebPage) resultItem.click();\n } catch {\n resultItem = document.createElement(\"span\");\n }\n resultItem.className = \"result__item\";\n resultItem.classList.toggle(\"result__item--no-barcode\", value === (0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a));\n resultItem.textContent = value;\n baseEl?.insertBefore(resultItem, resultActionsEl);\n const isValidValue = value !== (0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a);\n const clipboarCopyEl = baseEl?.querySelector(\"custom-clipboard-copy\");\n const webShareEl = baseEl?.querySelector(\"web-share\");\n if (clipboarCopyEl && isValidValue) {\n clipboarCopyEl.setAttribute(\"value\", value);\n clipboarCopyEl.hidden = false;\n } else {\n clipboarCopyEl.hidden = true;\n clipboarCopyEl.removeAttribute(\"value\");\n }\n if (webShareEl && (0, $94933cc6427541bd$export$c37129e465f64ef0)() && isValidValue) {\n webShareEl.setAttribute(\"share-text\", value);\n webShareEl.hidden = false;\n } else {\n webShareEl.hidden = true;\n webShareEl.removeAttribute(\"share-text\");\n }\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"scan-result\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $1952518f8eeecdff$var$ScanResult);\n }\n}\n$1952518f8eeecdff$var$ScanResult.defineCustomElement();\n\n\n(async function() {\n const hasExperimentalFlag = new URLSearchParams(window.location.search).has((0, $33dea9d9a6da4c9a$export$d726fc97fa83318d));\n const tabGroupEl = document.querySelector(\"a-tab-group\");\n const videoCaptureEl = document.querySelector(\"video-capture\");\n const cameraPanel = document.getElementById(\"cameraPanel\");\n const filePanel = document.getElementById(\"filePanel\");\n const scanInstructionsEl = document.getElementById(\"scanInstructions\");\n const scanBtn = document.getElementById(\"scanBtn\");\n const dropzoneEl = document.getElementById(\"dropzone\");\n const resizeObserverEl = document.querySelector(\"resize-observer\");\n const scanFrameEl = document.getElementById(\"scanFrame\");\n const facingModeButton = document.getElementById(\"facingModeButton\");\n const torchButton = document.getElementById(\"torchButton\");\n const globalActionsEl = document.getElementById(\"globalActions\");\n const historyBtn = document.getElementById(\"historyBtn\");\n const historyDialog = document.getElementById(\"historyDialog\");\n const settingsBtn = document.getElementById(\"settingsBtn\");\n const settingsDialog = document.getElementById(\"settingsDialog\");\n const settingsForm = document.forms[\"settings-form\"];\n const cameraSelect = document.getElementById(\"cameraSelect\");\n let shouldScan = true;\n let rafId;\n // By default the dialog elements are hidden for browsers that don't support the dialog element.\n // If the dialog element is supported, we remove the hidden attribute and the dialogs' visibility\n // is controlled by using the `showModal()` and `close()` methods.\n if ((0, $4840d5fa714b09de$export$c694186e9d94f0)()) {\n globalActionsEl.hidden = false;\n historyDialog.hidden = false;\n settingsDialog.hidden = false;\n }\n const { barcodeReader: barcodeReader, barcodeFormats: barcodeFormats, barcodeReaderError: barcodeReaderError } = await (0, $586e2c3c9ffe53e0$export$f21d9483ebeee00a).init();\n if (barcodeReaderError) {\n const alertEl = document.getElementById(\"barcodeReaderError\");\n shouldScan = false;\n globalActionsEl.hidden = true;\n tabGroupEl.hidden = true;\n alertEl.hidden = false;\n alertEl.textContent = barcodeReaderError?.message;\n return; // Stop the script execution as BarcodeDetector API is not supported.\n }\n videoCaptureEl.addEventListener(\"video-capture:video-play\", handleVideoCapturePlay, {\n once: true\n });\n videoCaptureEl.addEventListener(\"video-capture:error\", handleVideoCaptureError, {\n once: true\n });\n (0, $149eedd8690347fa$export$682e9ed90a89bb4a).defineCustomElement();\n const videoCaptureVideoEl = videoCaptureEl?.shadowRoot?.querySelector(\"video\");\n dropzoneEl.accept = (0, $33dea9d9a6da4c9a$export$63e7bed68b07a85c).join(\",\");\n (0, $c8149428128c684b$export$9d22ef9ff8e481fe)(settingsForm);\n (0, $fe7f448e3206b625$export$f6bb24723b821792)(barcodeFormats);\n (0, $2cce6ab38d28b4d0$export$fa9e3380e441c420)((await (0, $c96efe8837e99c11$export$f9582a3c130d9538)())[1] || []);\n /**\n * Scans for barcodes.\n * If a barcode is detected, it stops scanning and displays the result.\n *\n * @returns {Promise} - A Promise that resolves when the barcode is detected.\n */ async function scan() {\n (0, $e3e25c01e64ec360$export$bef1f36f5486a6a3)(\"Scanning...\");\n scanInstructionsEl.hidden = false;\n try {\n const barcode = await barcodeReader.detect(videoCaptureVideoEl);\n const barcodeValue = barcode?.rawValue ?? \"\";\n if (!barcodeValue) throw new Error((0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a));\n window.cancelAnimationFrame(rafId);\n (0, $696a3a8b3e5710f1$export$97c08f0895810b94)(cameraPanel, barcodeValue);\n (0, $2cce6ab38d28b4d0$export$7a6a9d84993ff4e)(barcodeValue);\n scanInstructionsEl.hidden = true;\n scanBtn.hidden = false;\n scanFrameEl.hidden = true;\n (0, $0460f8ef7b1421c2$export$9b466d13e2031a67)();\n return;\n } catch {\n // If no barcode is detected, the error is caught here.\n // We can ignore the error and continue scanning.\n }\n if (shouldScan) rafId = window.requestAnimationFrame(()=>scan());\n }\n /**\n * Handles the click event on the scan button.\n * It is responsible for clearing previous results and starting the scan process again.\n */ function handleScanButtonClick() {\n scanBtn.hidden = true;\n scanFrameEl.hidden = false;\n (0, $696a3a8b3e5710f1$export$ad20350fbdf13c97)(cameraPanel);\n scan();\n }\n /**\n * Handles the tab show event.\n * It is responsible for starting or stopping the scan process based on the selected tab.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleTabShow(evt) {\n const tabId = evt.detail.tabId;\n const videoCaptureEl = document.querySelector(\"video-capture\"); // Get the latest instance of video-capture element to ensure we don't use the cached one.\n if (tabId === \"cameraTab\") {\n shouldScan = true;\n if (!videoCaptureEl) return;\n if (!videoCaptureEl.loading && !cameraPanel.querySelector(\"scan-result\")) scan();\n if (typeof videoCaptureEl.startVideoStream === \"function\") videoCaptureEl.startVideoStream();\n } else if (tabId === \"fileTab\") {\n shouldScan = false;\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === \"function\") videoCaptureEl.stopVideoStream();\n }\n }\n /**\n * Handles the selection of a file.\n * It is responsible for displaying the selected file in the dropzone.\n *\n * @param {File} file - The selected file.\n */ function handleFileSelect(file) {\n if (!file) return;\n const image = new Image();\n const reader = new FileReader();\n reader.onload = (evt)=>{\n const data = evt.target.result;\n image.onload = async ()=>{\n try {\n const barcode = await barcodeReader.detect(image);\n const barcodeValue = barcode?.rawValue ?? \"\";\n if (!barcodeValue) throw new Error((0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a));\n (0, $696a3a8b3e5710f1$export$97c08f0895810b94)(filePanel, barcodeValue);\n (0, $2cce6ab38d28b4d0$export$7a6a9d84993ff4e)(barcodeValue);\n (0, $0460f8ef7b1421c2$export$9b466d13e2031a67)();\n } catch (err) {\n (0, $e3e25c01e64ec360$export$bef1f36f5486a6a3)(err);\n (0, $696a3a8b3e5710f1$export$97c08f0895810b94)(filePanel, (0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a));\n (0, $0460f8ef7b1421c2$export$9b466d13e2031a67)({\n success: false\n });\n }\n };\n image.src = data;\n image.alt = \"Image preview\";\n dropzoneEl.replaceChildren();\n const preview = document.createElement(\"div\");\n preview.className = \"dropzone-preview\";\n preview.setAttribute(\"aria-hidden\", \"true\");\n const imageWrapper = document.createElement(\"div\");\n imageWrapper.className = \"dropzone-preview__image-wrapper\";\n const fileNameWrapper = document.createElement(\"div\");\n fileNameWrapper.className = \"dropzone-preview__file-name\";\n fileNameWrapper.textContent = file.name;\n imageWrapper.appendChild(image);\n preview.appendChild(imageWrapper);\n preview.appendChild(fileNameWrapper);\n dropzoneEl.prepend(preview);\n };\n reader.readAsDataURL(file);\n }\n /**\n * Handles the drop event on the dropzone.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleFileDrop(evt) {\n const file = evt.detail.acceptedFiles[0];\n handleFileSelect(file);\n }\n /**\n * Handles the resize event on the video-capture element.\n * It is responsible for resizing the scan frame based on the video element.\n */ function handleVideoCaptureResize() {\n (0, $d335f5b5c097c74d$export$1404f0e91c73fec)(videoCaptureEl.shadowRoot.querySelector(\"video\"), scanFrameEl);\n }\n /**\n * Handles the video play event on the video-capture element.\n * It is responsible for displaying the scan frame and starting the scan process.\n * It also handles the zoom controls if the browser supports it.\n *\n * @param {CustomEvent} evt - The event object.\n */ async function handleVideoCapturePlay(evt) {\n scanFrameEl.hidden = false;\n (0, $d335f5b5c097c74d$export$1404f0e91c73fec)(evt.detail.video, scanFrameEl);\n scan();\n const trackSettings = evt.target.getTrackSettings();\n const trackCapabilities = evt.target.getTrackCapabilities();\n const zoomLevelEl = document.getElementById(\"zoomLevel\");\n if (\"facingMode\" in trackSettings) facingModeButton.hidden = false;\n if (trackCapabilities?.torch) {\n torchButton.hidden = false;\n if (videoCaptureEl.hasAttribute(\"torch\")) (0, $7c034485d4f152a1$export$d1bd0b12fe0d046)({\n el: torchButton,\n isTorchOn: true\n });\n }\n if (trackSettings?.zoom && trackCapabilities?.zoom) {\n const zoomControls = document.getElementById(\"zoomControls\");\n const minZoom = trackCapabilities?.zoom?.min || 0;\n const maxZoom = trackCapabilities?.zoom?.max || 10;\n let currentZoom = trackSettings?.zoom || 1;\n zoomControls.hidden = false;\n zoomLevelEl.textContent = currentZoom;\n const handleZoomControlsClick = (evt)=>{\n const zoomInBtn = evt.target.closest('[data-action=\"zoom-in\"]');\n const zoomOutBtn = evt.target.closest('[data-action=\"zoom-out\"]');\n if (zoomInBtn && currentZoom < maxZoom) currentZoom += 0.5;\n if (zoomOutBtn && currentZoom > minZoom) currentZoom -= 0.5;\n zoomLevelEl.textContent = currentZoom;\n videoCaptureEl.zoom = currentZoom;\n };\n zoomControls.addEventListener(\"click\", handleZoomControlsClick);\n }\n if (hasExperimentalFlag) {\n const videoInputDevices = await (0, $149eedd8690347fa$export$682e9ed90a89bb4a).getVideoInputDevices();\n videoInputDevices.forEach((device, index)=>{\n const option = document.createElement(\"option\");\n option.value = device.deviceId;\n option.textContent = device.label || `Camera ${index + 1}`;\n cameraSelect.appendChild(option);\n });\n cameraSelect.hidden = false;\n videoInputDevices.length;\n }\n }\n /**\n * Handles the error event on the video-capture element.\n * It is responsible for displaying an error message if the camera cannot be accessed or permission is denied.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleVideoCaptureError(evt) {\n const error = evt.detail.error;\n if (error.name === \"NotFoundError\") // If the browser cannot find all media tracks with the specified types that meet the constraints given.\n return;\n const errorMessage = error.name === \"NotAllowedError\" ? \"Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.\" : error.message;\n cameraPanel.innerHTML = /* html */ `
    ${errorMessage}
    `;\n }\n /**\n * Handles the settings button click event.\n * It is responsible for displaying the settings dialog.\n */ function handleSettingsButtonClick() {\n settingsDialog.open = true;\n }\n /**\n * Handles the change event on the settings form.\n * It is responsible for saving the settings to persistent storage and updating the settings.\n *\n * @param {Event} evt - The event object.\n */ function handleSettingsFormChange(evt) {\n const settings = {};\n const checkboxes = evt.currentTarget.querySelectorAll('input[type=\"checkbox\"]');\n checkboxes.forEach((item)=>settings[item.name] = item.checked);\n (0, $c96efe8837e99c11$export$dc86d17a64679bc7)(settings);\n }\n /**\n * Handles the click event on the history button.\n * It is responsible for displaying the history dialog.\n */ function handleHistoryButtonClick() {\n historyDialog.open = true;\n }\n /**\n * Handles the click event on the history dialog.\n * It is responsible for closing the dialog, deleting an item from the history, or emptying the history.\n *\n * @param {MouseEvent} evt - The event object.\n */ function handleHistoryDialogClick(evt) {\n const target = evt.target;\n // Handle delete action\n if (target.closest('[data-action=\"delete\"]')) {\n const value = target.closest(\"li\").dataset.value;\n if (window.confirm(`Delete history item ${value}?`)) {\n (0, $2cce6ab38d28b4d0$export$3a61248021dae916)(value);\n return;\n }\n }\n // Handle empty history action\n if (target.closest(\"#emptyHistoryBtn\")) {\n if (window.confirm(\"Empty history? This action cannot be undone.\")) {\n (0, $2cce6ab38d28b4d0$export$9f74b61e5d33cda2)();\n return;\n }\n }\n }\n /**\n * Handles the click event on the facing mode button.\n * It is responsible for toggling the camera facing mode.\n */ function handleFacingModeButtonClick() {\n const facingMode = videoCaptureEl.facingMode === \"user\" ? \"environment\" : \"user\";\n videoCaptureEl.facingMode = facingMode;\n if (typeof videoCaptureEl.restartVideoStream === \"function\") videoCaptureEl.restartVideoStream(cameraSelect?.value || undefined);\n }\n /**\n * Handles the click event on the torch button.\n * It is responsible for toggling the torch on and off.\n *\n * @param {MouseEvent} evt - The event object.\n */ function handleTorchButtonClick(evt) {\n videoCaptureEl.torch = !videoCaptureEl.torch;\n (0, $7c034485d4f152a1$export$d1bd0b12fe0d046)({\n el: evt.currentTarget,\n isTorchOn: videoCaptureEl.hasAttribute(\"torch\")\n });\n }\n /**\n * Handles the change event on the camera select element.\n * It is responsible for restarting the video stream with the selected video input device id.\n *\n * @param {Event} evt - The event object.\n */ function handleCameraSelectChange(evt) {\n const videoDeviceId = evt.target.value || undefined;\n if (typeof videoCaptureEl.restartVideoStream === \"function\") videoCaptureEl.restartVideoStream(videoDeviceId);\n }\n /**\n * Handles the visibility change event on the document.\n * It is responsible for stopping the scan process when the document is not visible.\n */ function handleDocumentVisibilityChange() {\n const selectedTab = tabGroupEl.querySelector(\"[selected]\");\n const tabId = selectedTab.getAttribute(\"id\");\n if (tabId !== \"cameraTab\") return;\n if (document.visibilityState === \"hidden\") {\n shouldScan = false;\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === \"function\") videoCaptureEl.stopVideoStream();\n } else {\n shouldScan = true;\n // Get the latest instance of video-capture element to ensure we don't use the cached one.\n const videoCaptureEl = document.querySelector(\"video-capture\");\n if (!videoCaptureEl) return;\n if (!videoCaptureEl.loading && !cameraPanel.querySelector(\"scan-result\")) scan();\n if (typeof videoCaptureEl.startVideoStream === \"function\") videoCaptureEl.startVideoStream();\n }\n }\n /**\n * Handles the escape key press event on the document.\n * It is responsible for triggering the scan button click event if there is already a barcode detected.\n */ function handleDocumentEscapeKey() {\n const cameraTabSelected = tabGroupEl.querySelector(\"#cameraTab\").hasAttribute(\"selected\");\n const scanBtnVisible = !scanBtn.hidden;\n const settingsDialogOpen = settingsDialog.hasAttribute(\"open\");\n const historyDialogOpen = historyDialog.hasAttribute(\"open\");\n const anyDialogOpen = settingsDialogOpen || historyDialogOpen;\n if (!scanBtnVisible || !cameraTabSelected || anyDialogOpen) return;\n scanBtn.click();\n }\n /**\n * Handles the key down event on the document.\n */ function handleDocumentKeyDown(evt) {\n if (evt.key === \"Escape\") handleDocumentEscapeKey();\n }\n scanBtn.addEventListener(\"click\", handleScanButtonClick);\n tabGroupEl.addEventListener(\"a-tab-show\", (0, $f7942db15ba0cc81$export$61fc7d43ac8f84b0)(handleTabShow, 250));\n dropzoneEl.addEventListener(\"files-dropzone-drop\", handleFileDrop);\n resizeObserverEl.addEventListener(\"resize-observer:resize\", handleVideoCaptureResize);\n settingsBtn.addEventListener(\"click\", handleSettingsButtonClick);\n settingsForm.addEventListener(\"change\", handleSettingsFormChange);\n historyBtn.addEventListener(\"click\", handleHistoryButtonClick);\n historyDialog.addEventListener(\"click\", handleHistoryDialogClick);\n facingModeButton.addEventListener(\"click\", handleFacingModeButtonClick);\n torchButton.addEventListener(\"click\", handleTorchButtonClick);\n hasExperimentalFlag && cameraSelect.addEventListener(\"change\", handleCameraSelectChange);\n document.addEventListener(\"visibilitychange\", handleDocumentVisibilityChange);\n document.addEventListener(\"keydown\", handleDocumentKeyDown);\n})();\n\n})();\n//# sourceMappingURL=index.65ac40f6.js.map\n","module.exports = (require(\"./helpers/browser/js-loader\")(require('./helpers/bundle-manifest').resolve(\"iqysf\"))).then(() => parcelRequire('dZsGG'));","\"use strict\";\n\nvar cacheLoader = require('../cacheLoader');\nmodule.exports = cacheLoader(function (bundle) {\n return new Promise(function (resolve, reject) {\n // Don't insert the same script twice (e.g. if it was already in the HTML)\n var existingScripts = document.getElementsByTagName('script');\n if ([].concat(existingScripts).some(function isCurrentBundle(script) {\n return script.src === bundle;\n })) {\n resolve();\n return;\n }\n var preloadLink = document.createElement('link');\n preloadLink.href = bundle;\n preloadLink.rel = 'preload';\n preloadLink.as = 'script';\n document.head.appendChild(preloadLink);\n var script = document.createElement('script');\n script.async = true;\n script.type = 'text/javascript';\n script.src = bundle;\n script.onerror = function (e) {\n var error = new TypeError(\"Failed to fetch dynamically imported module: \".concat(bundle, \". Error: \").concat(e.message));\n script.onerror = script.onload = null;\n script.remove();\n reject(error);\n };\n script.onload = function () {\n script.onerror = script.onload = null;\n resolve();\n };\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n});","\"use strict\";\n\nvar cachedBundles = {};\nvar cachedPreloads = {};\nvar cachedPrefetches = {};\nfunction getCache(type) {\n switch (type) {\n case 'preload':\n return cachedPreloads;\n case 'prefetch':\n return cachedPrefetches;\n default:\n return cachedBundles;\n }\n}\nmodule.exports = function (loader, type) {\n return function (bundle) {\n var cache = getCache(type);\n if (cache[bundle]) {\n return cache[bundle];\n }\n return cache[bundle] = loader.apply(null, arguments).catch(function (e) {\n delete cache[bundle];\n throw e;\n });\n };\n};","import '@georapbox/a-tab-group/dist/a-tab-group.js';\nimport '@georapbox/web-share-element/dist/web-share-defined.js';\nimport '@georapbox/files-dropzone-element/dist/files-dropzone-defined.js';\nimport '@georapbox/resize-observer-element/dist/resize-observer-defined.js';\nimport '@georapbox/modal-element/dist/modal-element-defined.js';\nimport { EXPERIMENTAL_FLAG, NO_BARCODE_DETECTED, ACCEPTED_MIME_TYPES } from './constants.js';\nimport { getHistory, setSettings } from './services/storage.js';\nimport { debounce } from './utils/debounce.js';\nimport { log } from './utils/log.js';\nimport { isDialogElementSupported } from './utils/isDialogElementSupported.js';\nimport { renderSupportedFormats } from './helpers/renderSupportedFormats.js';\nimport {\n addToHistory,\n removeFromHistory,\n emptyHistory,\n renderHistoryList\n} from './helpers/history.js';\nimport { hideResult, showResult } from './helpers/results.js';\nimport { triggerScanEffects } from './helpers/triggerScanEffects.js';\nimport { resizeScanFrame } from './helpers/resizeScanFrame.js';\nimport { BarcodeReader } from './helpers/BarcodeReader.js';\nimport { initializeSettingsForm } from './helpers/initializeSettingsForm.js';\nimport { toggleTorchButtonStatus } from './helpers/toggleTorchButtonStatus.js';\nimport { VideoCapture } from './components/video-capture.js';\nimport './components/clipboard-copy.js';\nimport './components/scan-result.js';\n\n(async function () {\n const hasExperimentalFlag = new URLSearchParams(window.location.search).has(EXPERIMENTAL_FLAG);\n const tabGroupEl = document.querySelector('a-tab-group');\n const videoCaptureEl = document.querySelector('video-capture');\n const cameraPanel = document.getElementById('cameraPanel');\n const filePanel = document.getElementById('filePanel');\n const scanInstructionsEl = document.getElementById('scanInstructions');\n const scanBtn = document.getElementById('scanBtn');\n const dropzoneEl = document.getElementById('dropzone');\n const resizeObserverEl = document.querySelector('resize-observer');\n const scanFrameEl = document.getElementById('scanFrame');\n const facingModeButton = document.getElementById('facingModeButton');\n const torchButton = document.getElementById('torchButton');\n const globalActionsEl = document.getElementById('globalActions');\n const historyBtn = document.getElementById('historyBtn');\n const historyDialog = document.getElementById('historyDialog');\n const settingsBtn = document.getElementById('settingsBtn');\n const settingsDialog = document.getElementById('settingsDialog');\n const settingsForm = document.forms['settings-form'];\n const cameraSelect = document.getElementById('cameraSelect');\n let shouldScan = true;\n let rafId;\n\n // By default the dialog elements are hidden for browsers that don't support the dialog element.\n // If the dialog element is supported, we remove the hidden attribute and the dialogs' visibility\n // is controlled by using the `showModal()` and `close()` methods.\n if (isDialogElementSupported()) {\n globalActionsEl.hidden = false;\n historyDialog.hidden = false;\n settingsDialog.hidden = false;\n }\n\n const { barcodeReader, barcodeFormats, barcodeReaderError } = await BarcodeReader.init();\n\n if (barcodeReaderError) {\n const alertEl = document.getElementById('barcodeReaderError');\n\n shouldScan = false;\n globalActionsEl.hidden = true;\n tabGroupEl.hidden = true;\n alertEl.hidden = false;\n alertEl.textContent = barcodeReaderError?.message;\n return; // Stop the script execution as BarcodeDetector API is not supported.\n }\n\n videoCaptureEl.addEventListener('video-capture:video-play', handleVideoCapturePlay, {\n once: true\n });\n\n videoCaptureEl.addEventListener('video-capture:error', handleVideoCaptureError, {\n once: true\n });\n\n VideoCapture.defineCustomElement();\n\n const videoCaptureVideoEl = videoCaptureEl?.shadowRoot?.querySelector('video');\n\n dropzoneEl.accept = ACCEPTED_MIME_TYPES.join(',');\n initializeSettingsForm(settingsForm);\n renderSupportedFormats(barcodeFormats);\n renderHistoryList((await getHistory())[1] || []);\n\n /**\n * Scans for barcodes.\n * If a barcode is detected, it stops scanning and displays the result.\n *\n * @returns {Promise} - A Promise that resolves when the barcode is detected.\n */\n async function scan() {\n log('Scanning...');\n\n scanInstructionsEl.hidden = false;\n\n try {\n const barcode = await barcodeReader.detect(videoCaptureVideoEl);\n const barcodeValue = barcode?.rawValue ?? '';\n\n if (!barcodeValue) {\n throw new Error(NO_BARCODE_DETECTED);\n }\n\n window.cancelAnimationFrame(rafId);\n showResult(cameraPanel, barcodeValue);\n addToHistory(barcodeValue);\n scanInstructionsEl.hidden = true;\n scanBtn.hidden = false;\n scanFrameEl.hidden = true;\n triggerScanEffects();\n return;\n } catch {\n // If no barcode is detected, the error is caught here.\n // We can ignore the error and continue scanning.\n }\n\n if (shouldScan) {\n rafId = window.requestAnimationFrame(() => scan());\n }\n }\n\n /**\n * Handles the click event on the scan button.\n * It is responsible for clearing previous results and starting the scan process again.\n */\n function handleScanButtonClick() {\n scanBtn.hidden = true;\n scanFrameEl.hidden = false;\n hideResult(cameraPanel);\n scan();\n }\n\n /**\n * Handles the tab show event.\n * It is responsible for starting or stopping the scan process based on the selected tab.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleTabShow(evt) {\n const tabId = evt.detail.tabId;\n const videoCaptureEl = document.querySelector('video-capture'); // Get the latest instance of video-capture element to ensure we don't use the cached one.\n\n if (tabId === 'cameraTab') {\n shouldScan = true;\n\n if (!videoCaptureEl) {\n return;\n }\n\n if (!videoCaptureEl.loading && !cameraPanel.querySelector('scan-result')) {\n scan();\n }\n\n if (typeof videoCaptureEl.startVideoStream === 'function') {\n videoCaptureEl.startVideoStream();\n }\n } else if (tabId === 'fileTab') {\n shouldScan = false;\n\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === 'function') {\n videoCaptureEl.stopVideoStream();\n }\n }\n }\n\n /**\n * Handles the selection of a file.\n * It is responsible for displaying the selected file in the dropzone.\n *\n * @param {File} file - The selected file.\n */\n function handleFileSelect(file) {\n if (!file) {\n return;\n }\n\n const image = new Image();\n const reader = new FileReader();\n\n reader.onload = evt => {\n const data = evt.target.result;\n\n image.onload = async () => {\n try {\n const barcode = await barcodeReader.detect(image);\n const barcodeValue = barcode?.rawValue ?? '';\n\n if (!barcodeValue) {\n throw new Error(NO_BARCODE_DETECTED);\n }\n\n showResult(filePanel, barcodeValue);\n addToHistory(barcodeValue);\n triggerScanEffects();\n } catch (err) {\n log(err);\n showResult(filePanel, NO_BARCODE_DETECTED);\n triggerScanEffects({ success: false });\n }\n };\n\n image.src = data;\n image.alt = 'Image preview';\n\n dropzoneEl.replaceChildren();\n\n const preview = document.createElement('div');\n preview.className = 'dropzone-preview';\n preview.setAttribute('aria-hidden', 'true');\n\n const imageWrapper = document.createElement('div');\n imageWrapper.className = 'dropzone-preview__image-wrapper';\n\n const fileNameWrapper = document.createElement('div');\n fileNameWrapper.className = 'dropzone-preview__file-name';\n fileNameWrapper.textContent = file.name;\n\n imageWrapper.appendChild(image);\n preview.appendChild(imageWrapper);\n preview.appendChild(fileNameWrapper);\n dropzoneEl.prepend(preview);\n };\n\n reader.readAsDataURL(file);\n }\n\n /**\n * Handles the drop event on the dropzone.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleFileDrop(evt) {\n const file = evt.detail.acceptedFiles[0];\n handleFileSelect(file);\n }\n\n /**\n * Handles the resize event on the video-capture element.\n * It is responsible for resizing the scan frame based on the video element.\n */\n function handleVideoCaptureResize() {\n resizeScanFrame(videoCaptureEl.shadowRoot.querySelector('video'), scanFrameEl);\n }\n\n /**\n * Handles the video play event on the video-capture element.\n * It is responsible for displaying the scan frame and starting the scan process.\n * It also handles the zoom controls if the browser supports it.\n *\n * @param {CustomEvent} evt - The event object.\n */\n async function handleVideoCapturePlay(evt) {\n scanFrameEl.hidden = false;\n resizeScanFrame(evt.detail.video, scanFrameEl);\n scan();\n\n const trackSettings = evt.target.getTrackSettings();\n const trackCapabilities = evt.target.getTrackCapabilities();\n const zoomLevelEl = document.getElementById('zoomLevel');\n\n if ('facingMode' in trackSettings) {\n facingModeButton.hidden = false;\n }\n\n if (trackCapabilities?.torch) {\n torchButton.hidden = false;\n\n if (videoCaptureEl.hasAttribute('torch')) {\n toggleTorchButtonStatus({ el: torchButton, isTorchOn: true });\n }\n }\n\n if (trackSettings?.zoom && trackCapabilities?.zoom) {\n const zoomControls = document.getElementById('zoomControls');\n const minZoom = trackCapabilities?.zoom?.min || 0;\n const maxZoom = trackCapabilities?.zoom?.max || 10;\n let currentZoom = trackSettings?.zoom || 1;\n\n zoomControls.hidden = false;\n zoomLevelEl.textContent = currentZoom;\n\n const handleZoomControlsClick = evt => {\n const zoomInBtn = evt.target.closest('[data-action=\"zoom-in\"]');\n const zoomOutBtn = evt.target.closest('[data-action=\"zoom-out\"]');\n\n if (zoomInBtn && currentZoom < maxZoom) {\n currentZoom += 0.5;\n }\n\n if (zoomOutBtn && currentZoom > minZoom) {\n currentZoom -= 0.5;\n }\n\n zoomLevelEl.textContent = currentZoom;\n videoCaptureEl.zoom = currentZoom;\n };\n\n zoomControls.addEventListener('click', handleZoomControlsClick);\n }\n\n if (hasExperimentalFlag) {\n const videoInputDevices = await VideoCapture.getVideoInputDevices();\n\n videoInputDevices.forEach((device, index) => {\n const option = document.createElement('option');\n option.value = device.deviceId;\n option.textContent = device.label || `Camera ${index + 1}`;\n cameraSelect.appendChild(option);\n });\n\n cameraSelect.hidden = false;\n if (videoInputDevices.length > 1) {\n }\n }\n }\n\n /**\n * Handles the error event on the video-capture element.\n * It is responsible for displaying an error message if the camera cannot be accessed or permission is denied.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleVideoCaptureError(evt) {\n const error = evt.detail.error;\n\n if (error.name === 'NotFoundError') {\n // If the browser cannot find all media tracks with the specified types that meet the constraints given.\n return;\n }\n\n const errorMessage =\n error.name === 'NotAllowedError'\n ? 'Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.'\n : error.message;\n\n cameraPanel.innerHTML = /* html */ `
    ${errorMessage}
    `;\n }\n\n /**\n * Handles the settings button click event.\n * It is responsible for displaying the settings dialog.\n */\n function handleSettingsButtonClick() {\n settingsDialog.open = true;\n }\n\n /**\n * Handles the change event on the settings form.\n * It is responsible for saving the settings to persistent storage and updating the settings.\n *\n * @param {Event} evt - The event object.\n */\n function handleSettingsFormChange(evt) {\n const settings = {};\n const checkboxes = evt.currentTarget.querySelectorAll('input[type=\"checkbox\"]');\n\n checkboxes.forEach(item => (settings[item.name] = item.checked));\n setSettings(settings);\n }\n\n /**\n * Handles the click event on the history button.\n * It is responsible for displaying the history dialog.\n */\n function handleHistoryButtonClick() {\n historyDialog.open = true;\n }\n\n /**\n * Handles the click event on the history dialog.\n * It is responsible for closing the dialog, deleting an item from the history, or emptying the history.\n *\n * @param {MouseEvent} evt - The event object.\n */\n function handleHistoryDialogClick(evt) {\n const target = evt.target;\n\n // Handle delete action\n if (target.closest('[data-action=\"delete\"]')) {\n const value = target.closest('li').dataset.value;\n\n if (window.confirm(`Delete history item ${value}?`)) {\n removeFromHistory(value);\n return;\n }\n }\n\n // Handle empty history action\n if (target.closest('#emptyHistoryBtn')) {\n if (window.confirm('Empty history? This action cannot be undone.')) {\n emptyHistory();\n return;\n }\n }\n }\n\n /**\n * Handles the click event on the facing mode button.\n * It is responsible for toggling the camera facing mode.\n */\n function handleFacingModeButtonClick() {\n const facingMode = videoCaptureEl.facingMode === 'user' ? 'environment' : 'user';\n\n videoCaptureEl.facingMode = facingMode;\n\n if (typeof videoCaptureEl.restartVideoStream === 'function') {\n videoCaptureEl.restartVideoStream(cameraSelect?.value || undefined);\n }\n }\n\n /**\n * Handles the click event on the torch button.\n * It is responsible for toggling the torch on and off.\n *\n * @param {MouseEvent} evt - The event object.\n */\n function handleTorchButtonClick(evt) {\n videoCaptureEl.torch = !videoCaptureEl.torch;\n\n toggleTorchButtonStatus({\n el: evt.currentTarget,\n isTorchOn: videoCaptureEl.hasAttribute('torch')\n });\n }\n\n /**\n * Handles the change event on the camera select element.\n * It is responsible for restarting the video stream with the selected video input device id.\n *\n * @param {Event} evt - The event object.\n */\n function handleCameraSelectChange(evt) {\n const videoDeviceId = evt.target.value || undefined;\n\n if (typeof videoCaptureEl.restartVideoStream === 'function') {\n videoCaptureEl.restartVideoStream(videoDeviceId);\n }\n }\n\n /**\n * Handles the visibility change event on the document.\n * It is responsible for stopping the scan process when the document is not visible.\n */\n function handleDocumentVisibilityChange() {\n const selectedTab = tabGroupEl.querySelector('[selected]');\n const tabId = selectedTab.getAttribute('id');\n\n if (tabId !== 'cameraTab') {\n return;\n }\n\n if (document.visibilityState === 'hidden') {\n shouldScan = false;\n\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === 'function') {\n videoCaptureEl.stopVideoStream();\n }\n } else {\n shouldScan = true;\n\n // Get the latest instance of video-capture element to ensure we don't use the cached one.\n const videoCaptureEl = document.querySelector('video-capture');\n\n if (!videoCaptureEl) {\n return;\n }\n\n if (!videoCaptureEl.loading && !cameraPanel.querySelector('scan-result')) {\n scan();\n }\n\n if (typeof videoCaptureEl.startVideoStream === 'function') {\n videoCaptureEl.startVideoStream();\n }\n }\n }\n\n /**\n * Handles the escape key press event on the document.\n * It is responsible for triggering the scan button click event if there is already a barcode detected.\n */\n function handleDocumentEscapeKey() {\n const cameraTabSelected = tabGroupEl.querySelector('#cameraTab').hasAttribute('selected');\n const scanBtnVisible = !scanBtn.hidden;\n const settingsDialogOpen = settingsDialog.hasAttribute('open');\n const historyDialogOpen = historyDialog.hasAttribute('open');\n const anyDialogOpen = settingsDialogOpen || historyDialogOpen;\n\n if (!scanBtnVisible || !cameraTabSelected || anyDialogOpen) {\n return;\n }\n\n scanBtn.click();\n }\n\n /**\n * Handles the key down event on the document.\n */\n function handleDocumentKeyDown(evt) {\n if (evt.key === 'Escape') {\n handleDocumentEscapeKey();\n }\n }\n\n scanBtn.addEventListener('click', handleScanButtonClick);\n tabGroupEl.addEventListener('a-tab-show', debounce(handleTabShow, 250));\n dropzoneEl.addEventListener('files-dropzone-drop', handleFileDrop);\n resizeObserverEl.addEventListener('resize-observer:resize', handleVideoCaptureResize);\n settingsBtn.addEventListener('click', handleSettingsButtonClick);\n settingsForm.addEventListener('change', handleSettingsFormChange);\n historyBtn.addEventListener('click', handleHistoryButtonClick);\n historyDialog.addEventListener('click', handleHistoryDialogClick);\n facingModeButton.addEventListener('click', handleFacingModeButtonClick);\n torchButton.addEventListener('click', handleTorchButtonClick);\n hasExperimentalFlag && cameraSelect.addEventListener('change', handleCameraSelectChange);\n document.addEventListener('visibilitychange', handleDocumentVisibilityChange);\n document.addEventListener('keydown', handleDocumentKeyDown);\n})();\n","/*!\n * @georapbox/a-tab-group\n * A custom element to create a group of tabs and tab panels.\n *\n * @version 2.4.1\n * @homepage https://github.com/georapbox/a-tab-group#readme\n * @author George Raptis \n * @license MIT\n */\nvar h=(a=\"\",t=\"\")=>{let e=typeof a==\"string\"&&a!==\"\"?a+\"-\":\"\",s=typeof t==\"string\"&&t!==\"\"?\"-\"+t:\"\",i=Math.random().toString(36).substring(2,8);return`${e}${i}${s}`};var b=(a,t)=>{if(Object.prototype.hasOwnProperty.call(t,a)){let e=t[a];delete t[a],t[a]=e}};var E=0,C=`\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`,w=document.createElement(\"template\");w.innerHTML=`\n \n\n
    \n \n
    \n`;var u=class a extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(w.content.cloneNode(!0))}static get observedAttributes(){return[\"selected\",\"disabled\",\"closable\"]}attributeChangedCallback(t,e,s){if(t===\"selected\"&&e!==s&&(this.setAttribute(\"aria-selected\",this.selected.toString()),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")),t===\"disabled\"&&e!==s&&(this.setAttribute(\"aria-disabled\",this.disabled.toString()),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")),t===\"closable\"&&e!==s)if(this.closable){let i=document.createElement(\"span\");i.className=\"tab__close\",i.setAttribute(\"part\",\"close-tab\"),i.innerHTML='',this.shadowRoot?.querySelector(\".tab\")?.appendChild(i),i.addEventListener(\"click\",this.#e)}else{let i=this.shadowRoot?.querySelector(\".tab__close\");i?.removeEventListener(\"click\",this.#e),i?.remove()}}connectedCallback(){this.#s(\"selected\"),this.#s(\"disabled\"),this.#s(\"closable\"),this.id||(this.id=h(\"tab\",(++E).toString())),this.setAttribute(\"slot\",\"tab\"),this.setAttribute(\"role\",\"tab\"),this.setAttribute(\"aria-selected\",\"false\"),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")}disconnectedCallback(){this.shadowRoot?.querySelector(\".tab__close\")?.removeEventListener(\"click\",this.#e)}get selected(){return this.hasAttribute(\"selected\")}set selected(t){this.toggleAttribute(\"selected\",!!t)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get closable(){return this.hasAttribute(\"closable\")}set closable(t){this.toggleAttribute(\"closable\",!!t)}#e=t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent(\"a-tab-close\",{bubbles:!0,composed:!0,detail:{tabId:this.id}}))};#s(t){return b(t,this)}static defineCustomElement(t=\"a-tab\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};u.defineCustomElement();var L=0,S=`\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`,T=document.createElement(\"template\");T.innerHTML=`\n \n\n
    \n \n
    \n`;var p=class a extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(T.content.cloneNode(!0))}connectedCallback(){this.setAttribute(\"slot\",\"panel\"),this.setAttribute(\"role\",\"tabpanel\"),this.setAttribute(\"hidden\",\"\"),this.id||(this.id=h(\"panel\",(++L).toString()))}static defineCustomElement(t=\"a-tab-panel\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};p.defineCustomElement();var y=200,n={TOP:\"top\",BOTTOM:\"bottom\",START:\"start\",END:\"end\"},l={LTR:\"ltr\",RTL:\"rtl\"},R=Object.entries(n).map(([,a])=>a),r={AUTO:\"auto\",MANUAL:\"manual\"},c={DOWN:\"ArrowDown\",LEFT:\"ArrowLeft\",RIGHT:\"ArrowRight\",UP:\"ArrowUp\",HOME:\"Home\",END:\"End\",ENTER:\"Enter\",SPACE:\" \"},x=`\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${l.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${l.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${l.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${l.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${n.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${n.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${n.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${n.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${n.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${n.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${n.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`,A=document.createElement(\"template\");A.innerHTML=`\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;var f=class a extends HTMLElement{#e=null;#s=null;#l=!1;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(A.content.cloneNode(!0))}static get observedAttributes(){return[\"placement\",\"no-scroll-controls\"]}attributeChangedCallback(t,e,s){t===\"placement\"&&e!==s&&this.#i(),t===\"no-scroll-controls\"&&e!==s&&this.#i()}get placement(){return this.getAttribute(\"placement\")||n.TOP}set placement(t){t!=null&&this.setAttribute(\"placement\",t)}get noScrollControls(){return this.hasAttribute(\"no-scroll-controls\")}set noScrollControls(t){this.toggleAttribute(\"no-scroll-controls\",!!t)}get scrollDistance(){let t=Number(this.getAttribute(\"scroll-distance\"));return Math.abs(t)||y}set scrollDistance(t){this.setAttribute(\"scroll-distance\",Math.abs(t).toString()||y.toString())}get activation(){return this.getAttribute(\"activation\")||r.AUTO}set activation(t){this.setAttribute(\"activation\",t||r.AUTO)}get noTabCycling(){return this.hasAttribute(\"no-tab-cycling\")}set noTabCycling(t){this.toggleAttribute(\"no-tab-cycling\",!!t)}connectedCallback(){this.#o(\"placement\"),this.#o(\"noScrollControls\"),this.#o(\"scrollDistance\"),this.#o(\"activation\"),this.#o(\"noTabCycling\");let t=this.shadowRoot?.querySelector(\"slot[name=tab]\"),e=this.shadowRoot?.querySelector(\"slot[name=panel]\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\"),i=this.shadowRoot?.querySelector(\".tab-group__nav\"),o=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);t?.addEventListener(\"slotchange\",this.#n),e?.addEventListener(\"slotchange\",this.#n),s?.addEventListener(\"click\",this.#g),s?.addEventListener(\"keydown\",this.#p),o.forEach(d=>d.addEventListener(\"click\",this.#f)),this.addEventListener(\"a-tab-close\",this.#m),\"ResizeObserver\"in window&&(this.#e=new ResizeObserver(d=>{this.#s=window.requestAnimationFrame(()=>{let v=d?.[0]?.target,g=v?.scrollWidth>v?.clientWidth;o.forEach(_=>_.toggleAttribute(\"hidden\",!g)),i?.part.toggle(\"nav--has-scroll-controls\",g),i?.classList.toggle(\"tab-group__nav--has-scroll-controls\",g)})})),this.#h(),this.#i()}disconnectedCallback(){let t=this.shadowRoot?.querySelector(\"slot[name=tab]\"),e=this.shadowRoot?.querySelector(\"slot[name=panel]\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\"),i=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);t?.removeEventListener(\"slotchange\",this.#n),e?.removeEventListener(\"slotchange\",this.#n),s?.removeEventListener(\"click\",this.#g),s?.removeEventListener(\"keydown\",this.#p),i.forEach(o=>o.removeEventListener(\"click\",this.#f)),this.removeEventListener(\"a-tab-close\",this.#m),this.#c()}#v(){if(!this.#e)return;let t=this.shadowRoot?.querySelector(\".tab-group__tabs\");t&&(this.#e.unobserve(t),this.#e.observe(t))}#c(){this.#e&&(this.#e.disconnect(),this.#s!==null&&(window.cancelAnimationFrame(this.#s),this.#s=null))}#d(){return window.CSS.supports(\"selector(:dir(ltr))\")?this.matches(\":dir(ltr)\")?l.LTR:l.RTL:window.getComputedStyle(this).direction||l.LTR}#h(){this.hidden=this.#t().length===0}#w(){let t=this.#t();this.#h(),t.forEach(e=>{let s=e.nextElementSibling;if(!s||s.tagName.toLowerCase()!==\"a-tab-panel\")return console.error(`Tab #${e.id} is not a sibling of a `);e.setAttribute(\"aria-controls\",s.id),s.setAttribute(\"aria-labelledby\",e.id)})}#T(){return Array.from(this.querySelectorAll(\"a-tab-panel\"))}#t(){return Array.from(this.querySelectorAll(\"a-tab\"))}#b(t){let e=t.getAttribute(\"aria-controls\");return this.querySelector(`#${e}`)}#y(){return this.#t().find(e=>!e.disabled)||null}#A(){let t=this.#t();for(let e=t.length-1;e>=0;e--)if(!t[e].disabled)return t[e];return null}#a(){let t=this.#t(),e=this.activation===r.MANUAL?t.findIndex(s=>s.matches(\":focus\"))-1:t.findIndex(s=>s.selected)-1;for(;t[(e+t.length)%t.length].disabled;)e--;return this.noTabCycling&&e<0?null:t[(e+t.length)%t.length]}#r(){let t=this.#t(),e=this.activation===r.MANUAL?t.findIndex(s=>s.matches(\":focus\"))+1:t.findIndex(s=>s.selected)+1;for(;t[e%t.length].disabled;)e++;return this.noTabCycling&&e>=t.length?null:t[e%t.length]}#_(){let t=this.#t(),e=this.#T();t.forEach(s=>s.selected=!1),e.forEach(s=>s.hidden=!0)}#i(){let t=this.shadowRoot?.querySelector(\".tab-group__nav\"),e=this.shadowRoot?.querySelector(\".tab-group__tabs\"),s=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);this.noScrollControls||this.placement===n.START||this.placement===n.END?(this.#c(),s.forEach(i=>i.hidden=!0),t?.part.remove(\"nav--has-scroll-controls\"),t?.classList.remove(\"tab-group__nav--has-scroll-controls\"),e?.setAttribute(\"aria-orientation\",\"vertical\")):(this.#v(),s.forEach(i=>i.hidden=!1),e?.setAttribute(\"aria-orientation\",\"horizontal\"))}#E(){let t=this.#t(),e=t.find(s=>s.selected&&!s.disabled)||t.find(s=>!s.disabled);e&&(this.#l&&!e.selected&&this.dispatchEvent(new CustomEvent(\"a-tab-show\",{bubbles:!0,composed:!0,detail:{tabId:e.id}})),this.#u(e))}#u(t){this.#_(),t&&(t.selected=!0);let e=this.#b(t);e&&(e.hidden=!1)}#n=t=>{this.#w(),this.#i(),this.#E(),t.target.name===\"tab\"&&(this.#l=!0)};#p=t=>{if(t.target.tagName.toLowerCase()!==\"a-tab\"||t.altKey)return;let e=R.includes(this.placement||\"\")?this.placement:n.TOP,s=[n.TOP,n.BOTTOM].includes(e||\"\")?\"horizontal\":\"vertical\",i=this.#d(),o=null;switch(t.key){case c.LEFT:s===\"horizontal\"&&(o=i===l.LTR?this.#a():this.#r(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.RIGHT:s===\"horizontal\"&&(o=i===l.LTR?this.#r():this.#a(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.UP:s===\"vertical\"&&(o=this.#a(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.DOWN:s===\"vertical\"&&(o=this.#r(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.HOME:o=this.#y(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o));break;case c.END:o=this.#A(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o));break;case c.ENTER:case c.SPACE:o=t.target,o&&this.selectTab(o);break;default:return}t.preventDefault()};#g=t=>{let e=t.target.closest(\"a-tab\");e&&this.selectTab(e)};#f=t=>{let e=t.target.closest(\".tab-group__scroll-button\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\");if(!e||!s)return;let i=e.classList.contains(\"tab-group__scroll-button--start\"),o=this.#d()===l.LTR,d=i?o?-1:1:o?1:-1,m=s.scrollLeft;s.scrollTo({left:m+d*this.scrollDistance})};#m=t=>{let e=t.target,s=this.#b(e);e&&(e.remove(),e.selected&&this.dispatchEvent(new CustomEvent(\"a-tab-hide\",{bubbles:!0,composed:!0,detail:{tabId:e.id}}))),s&&s.tagName.toLowerCase()===\"a-tab-panel\"&&s.remove()};#o(t){return b(t,this)}selectTabByIndex(t){let s=this.#t()[t];s&&this.selectTab(s)}selectTabById(t){let s=this.#t().find(i=>i.id===t);s&&this.selectTab(s)}selectTab(t){let e=this.#t().find(s=>s.selected);!t||t.disabled||t.selected||t.tagName.toLowerCase()!==\"a-tab\"||(this.#u(t),window.requestAnimationFrame(()=>{t.scrollIntoView({inline:\"nearest\",block:\"nearest\"}),t.focus()}),e&&this.dispatchEvent(new CustomEvent(\"a-tab-hide\",{bubbles:!0,composed:!0,detail:{tabId:e.id}})),this.dispatchEvent(new CustomEvent(\"a-tab-show\",{bubbles:!0,composed:!0,detail:{tabId:t.id}})))}static defineCustomElement(t=\"a-tab-group\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};f.defineCustomElement();export{u as ATab,f as ATabGroup,p as ATabPanel};\n//# sourceMappingURL=a-tab-group.js.map\n","// @ts-check\n\n/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */\nconst uid = (prefix = '', suffix = '') => {\n const prefixString = typeof prefix === 'string' && prefix !== '' ? prefix + '-' : '';\n const suffixString = typeof suffix === 'string' && suffix !== '' ? '-' + suffix : '';\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n\n return `${prefixString}${randomString}${suffixString}`;\n};\n\nexport { uid };\n","// @ts-check\n\n/**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n * @param {any} instance - The instance of the tab.\n */\nconst upgradeProperty = (prop, instance) => {\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n};\n\nexport { upgradeProperty };\n","// @ts-check\n\nimport { uid } from './utils/uid.js';\nimport { upgradeProperty } from './utils/upgrade-property.js';\n\nlet tabCounter = 0;\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n \n
    \n`;\n\n/**\n * @summary\n * This is a tab for a tab panel.\n * `` should always be used with `role=heading` in the markup so that the semantics remain useable when JavaScript is failing.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab\n * @extends HTMLElement\n *\n * @property {boolean} selected - Whether the tab is selected.\n * @property {boolean} disabled - Whether the tab is disabled.\n * @property {boolean} closable - Whether the tab is closable.\n *\n * @attribute selected - Reflects the selected property.\n * @attribute disabled - Reflects the disabled property.\n * @attribute closable - Reflects the closable property.\n *\n * @csspart base - The component's base wrapper.\n * @csspart close-tab - The close button.\n * @csspart close-tab-icon - The close button icon.\n *\n * @slot - The tab's content.\n *\n * @event a-tab-close - Fires when the tab's close button is clicked.\n */\nclass ATab extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['selected', 'disabled', 'closable'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'selected' && oldValue !== newValue) {\n this.setAttribute('aria-selected', this.selected.toString());\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n if (name === 'disabled' && oldValue !== newValue) {\n this.setAttribute('aria-disabled', this.disabled.toString());\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n if (name === 'closable' && oldValue !== newValue) {\n if (this.closable) {\n const closeButton = document.createElement('span');\n closeButton.className = 'tab__close';\n closeButton.setAttribute('part', 'close-tab');\n closeButton.innerHTML = /* html */ ``;\n this.shadowRoot?.querySelector('.tab')?.appendChild(closeButton);\n closeButton.addEventListener('click', this.#handleCloseButtonClick);\n } else {\n const closeButton = this.shadowRoot?.querySelector('.tab__close');\n closeButton?.removeEventListener('click', this.#handleCloseButtonClick);\n closeButton?.remove();\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('selected');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('closable');\n\n if (!this.id) {\n this.id = uid('tab', (++tabCounter).toString());\n }\n\n this.setAttribute('slot', 'tab');\n this.setAttribute('role', 'tab');\n this.setAttribute('aria-selected', 'false');\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n /**\n * Lifecycle method that is called when the element is disconnected from the DOM.\n */\n disconnectedCallback() {\n const closeButton = this.shadowRoot?.querySelector('.tab__close');\n closeButton?.removeEventListener('click', this.#handleCloseButtonClick);\n }\n\n /**\n * @type {boolean} - Whether the tab is selected.\n * @default false\n * @attribute selected - Reflects the selected property.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n set selected(value) {\n this.toggleAttribute('selected', !!value);\n }\n\n /**\n * @type {boolean} - Whether the tab is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {boolean} - Whether the tab is closable.\n * @default false\n * @attribute closable - Reflects the closable property.\n */\n get closable() {\n return this.hasAttribute('closable');\n }\n\n set closable(value) {\n this.toggleAttribute('closable', !!value);\n }\n\n /**\n * Handles the click event on the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n evt.stopPropagation();\n\n this.dispatchEvent(\n new CustomEvent(`a-tab-close`, {\n bubbles: true,\n composed: true,\n detail: { tabId: this.id }\n })\n );\n };\n\n /**\n * Wrapper for the `upgradeProperty` function.\n *\n * @param {'selected' | 'disabled' | 'closable'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n return upgradeProperty(prop, this);\n }\n\n static defineCustomElement(elementName = 'a-tab') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATab);\n }\n }\n}\n\nATab.defineCustomElement();\n\nexport { ATab };\n","// @ts-check\n\nimport { uid } from './utils/uid.js';\n\nlet panelCounter = 0;\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n \n
    \n`;\n\n/**\n * @summary This is a panel for a `` tab panel.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab-panel\n * @extends HTMLElement\n *\n * @csspart base - The component's base wrapper.\n *\n * @slot - The content of the tab panel.\n */\nclass ATabPanel extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.setAttribute('slot', 'panel');\n this.setAttribute('role', 'tabpanel');\n this.setAttribute('hidden', '');\n\n if (!this.id) {\n this.id = uid('panel', (++panelCounter).toString());\n }\n }\n\n static defineCustomElement(elementName = 'a-tab-panel') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATabPanel);\n }\n }\n}\n\nATabPanel.defineCustomElement();\n\nexport { ATabPanel };\n","// @ts-check\n\n/**\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/** @typedef {import('./a-tab').ATab} Tab */\n/** @typedef {import('./a-tab-panel').ATabPanel} TabPanel */\n\nexport { ATab } from './a-tab.js';\nexport { ATabPanel } from './a-tab-panel.js';\nimport { upgradeProperty } from './utils/upgrade-property.js';\n\n/**\n * The default scroll distance in pixels that the\n * tabs will scroll when the scroll buttons are clicked.\n */\nconst DEFAULT_SCROLL_DISTANCE = 200;\n\n/**\n * The available placements for the tabs.\n */\nconst PLACEMENT = {\n TOP: 'top',\n BOTTOM: 'bottom',\n START: 'start',\n END: 'end'\n};\n\n/**\n * The available directionality values for the tab group.\n */\nconst DIR = {\n LTR: 'ltr',\n RTL: 'rtl'\n};\n\n/**\n * The valid placements for the tabs.\n */\nconst validPlacements = Object.entries(PLACEMENT).map(([, value]) => value);\n\n/**\n * The available activation modes for the tabs.\n */\nconst ACTIVATION = {\n AUTO: 'auto',\n MANUAL: 'manual'\n};\n\n/**\n * Defines key codes to help with handling keyboard events.\n */\nconst KEYCODE = {\n DOWN: 'ArrowDown',\n LEFT: 'ArrowLeft',\n RIGHT: 'ArrowRight',\n UP: 'ArrowUp',\n HOME: 'Home',\n END: 'End',\n ENTER: 'Enter',\n SPACE: ' '\n};\n\nconst styles = /* css */ `\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${DIR.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${DIR.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${DIR.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${DIR.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${PLACEMENT.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${PLACEMENT.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${PLACEMENT.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;\n\n/**\n * @summary Container element for tabs and panels. All children of should be either `` or ``.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab-group\n * @extends HTMLElement\n *\n * @property {string} placement - The placement of the tabs.\n * @property {boolean} noScrollControls - Whether or not the scroll controls are enabled.\n * @property {number} scrollDistance - The distance in pixels that the tabs will scroll when the scroll buttons are clicked.\n * @property {string} activation - The activation mode of the tabs.\n * @property {boolean} noTabCycling - Whether or not the tabs should cycle when reaching the first or last tab using the keyboard.\n *\n * @attribute placement - Reflects the placement property.\n * @attribute no-scroll-controls - Reflects the noScrollControls property.\n * @attribute scroll-distance - Reflects the scrollDistance property.\n * @attribute activation - Reflects the activation property.\n * @attribute no-tab-cycling - Reflects the noTabCycling property.\n *\n * @slot tab - Used for groupping tabs in the tab group. Must be elements.\n * @slot panel - Used for groupping tab panels in the tab group. Must be elements.\n *\n * @csspart base - The component's base wrapper.\n * @csspart nav - The nav container.\n * @csspart nav--has-scroll-controls - The nav container when the scroll controls are enabled and visible.\n * @csspart scroll-button - The scroll button.\n * @csspart scroll-button--start - The scroll button for scrolling towards the start.\n * @csspart scroll-button--end - The scroll button for scrolling towards the end.\n * @csspart scroll-button-icon - The scroll button icon.\n * @csspart tabs - The tabs container.\n * @csspart panels - The panels container.\n *\n * @cssproperty --selected-tab-color - The color of the selected tab.\n * @cssproperty --selected-tab-bg-color - The background color of the selected tab.\n * @cssproperty --tabs-scroll-behavior - The scroll behavior of the tabs container.\n * @cssproperty --scroll-button-width - The width of the scroll buttons.\n * @cssproperty --scroll-button-height - The height of the scroll buttons.\n * @cssproperty --scroll-button-inline-offset - The inline offset of the scroll buttons.\n *\n * @event a-tab-show - Fired when a tab is shown.\n * @event a-tab-hide - Fired when a tab is shown.\n *\n * @method selectTabByIndex - Selects the tab at the given index.\n * @method selectTabById - Selects the tab with the given id.\n * @method selectTab - Selects the given tab.\n */\nclass ATabGroup extends HTMLElement {\n /** @type {Nullable} */\n #resizeObserver = null;\n\n /** @type {Nullable} */\n #rafId = null;\n\n /** @type {boolean} */\n #hasTabSlotChangedOnce = false;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['placement', 'no-scroll-controls'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'placement' && oldValue !== newValue) {\n this.#syncNav();\n }\n\n if (name === 'no-scroll-controls' && oldValue !== newValue) {\n this.#syncNav();\n }\n }\n\n /**\n * @type {Nullable} - The placement of the tabs.\n * @default 'top'\n * @attribute placement - Reflects the placement property.\n */\n get placement() {\n return this.getAttribute('placement') || PLACEMENT.TOP;\n }\n\n set placement(value) {\n if (value != null) {\n this.setAttribute('placement', value);\n }\n }\n\n /**\n * @type {boolean} - Whether or not the scroll controls are enabled.\n * @default false\n * @attribute no-scroll-controls - Reflects the noScrollControls property.\n */\n get noScrollControls() {\n return this.hasAttribute('no-scroll-controls');\n }\n\n set noScrollControls(value) {\n this.toggleAttribute('no-scroll-controls', !!value);\n }\n\n /**\n * @type {number} - The distance in pixels that the tabs will scroll when the scroll buttons are clicked.\n * @default 200\n * @attribute scroll-distance - Reflects the scrollDistance property.\n */\n get scrollDistance() {\n const value = Number(this.getAttribute('scroll-distance'));\n return Math.abs(value) || DEFAULT_SCROLL_DISTANCE;\n }\n\n set scrollDistance(value) {\n this.setAttribute('scroll-distance', Math.abs(value).toString() || DEFAULT_SCROLL_DISTANCE.toString());\n }\n\n /**\n * @type {string} - The activation mode of the tabs.\n * @default 'auto'\n * @attribute activation - Reflects the activation property.\n */\n get activation() {\n return this.getAttribute('activation') || ACTIVATION.AUTO;\n }\n\n set activation(value) {\n this.setAttribute('activation', value || ACTIVATION.AUTO);\n }\n\n /**\n * @type {boolean} - Whether or not the tabs should cycle when reaching the first or last tab using the keyboard.\n * @default false\n * @attribute no-tab-cycling - Reflects the noTabCycling property.\n */\n get noTabCycling() {\n return this.hasAttribute('no-tab-cycling');\n }\n\n set noTabCycling(value) {\n this.toggleAttribute('no-tab-cycling', !!value);\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('placement');\n this.#upgradeProperty('noScrollControls');\n this.#upgradeProperty('scrollDistance');\n this.#upgradeProperty('activation');\n this.#upgradeProperty('noTabCycling');\n\n const tabSlot = this.shadowRoot?.querySelector('slot[name=tab]');\n const panelSlot = this.shadowRoot?.querySelector('slot[name=panel]');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n const navContainer = this.shadowRoot?.querySelector('.tab-group__nav');\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n tabSlot?.addEventListener('slotchange', this.#handleSlotChange);\n panelSlot?.addEventListener('slotchange', this.#handleSlotChange);\n tabsContainer?.addEventListener('click', this.#handleTabClick);\n tabsContainer?.addEventListener('keydown', this.#handleKeyDown);\n scrollButtons.forEach(el => el.addEventListener('click', this.#handleScrollButtonClick));\n this.addEventListener('a-tab-close', this.#handleTabClose);\n\n if ('ResizeObserver' in window) {\n this.#resizeObserver = new ResizeObserver(entries => {\n this.#rafId = window.requestAnimationFrame(() => {\n const entry = entries?.[0];\n const targetElement = entry?.target;\n const isElementScrollable = targetElement?.scrollWidth > targetElement?.clientWidth;\n scrollButtons.forEach(el => el.toggleAttribute('hidden', !isElementScrollable));\n navContainer?.part.toggle('nav--has-scroll-controls', isElementScrollable);\n navContainer?.classList.toggle('tab-group__nav--has-scroll-controls', isElementScrollable);\n });\n });\n }\n\n this.#hideEmptyTabGroup();\n this.#syncNav();\n }\n\n /**\n * Lifecycle method that is called when the element is disconnected from the DOM.\n */\n disconnectedCallback() {\n const tabSlot = this.shadowRoot?.querySelector('slot[name=tab]');\n const panelSlot = this.shadowRoot?.querySelector('slot[name=panel]');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n tabSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n panelSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n tabsContainer?.removeEventListener('click', this.#handleTabClick);\n tabsContainer?.removeEventListener('keydown', this.#handleKeyDown);\n scrollButtons.forEach(el => el.removeEventListener('click', this.#handleScrollButtonClick));\n this.removeEventListener('a-tab-close', this.#handleTabClose);\n this.#stopResizeObserver();\n }\n\n /**\n * Starts observing the tabs container for resize events.\n */\n #startResizeObserver() {\n if (!this.#resizeObserver) {\n return;\n }\n\n const scrollElement = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n if (scrollElement) {\n this.#resizeObserver.unobserve(scrollElement);\n this.#resizeObserver.observe(scrollElement);\n }\n }\n\n /**\n * Stops observing the tabs container for resize events.\n */\n #stopResizeObserver() {\n if (!this.#resizeObserver) {\n return;\n }\n\n this.#resizeObserver.disconnect();\n\n if (this.#rafId !== null) {\n window.cancelAnimationFrame(this.#rafId);\n this.#rafId = null;\n }\n }\n\n /**\n * Gets the directionality of the tab group.\n *\n * @returns {'ltr' | 'rtl'} - The direction of the tab group.\n */\n #getDirectionality() {\n return /** @type {'ltr' | 'rtl'} */ (\n window.CSS.supports('selector(:dir(ltr))')\n ? this.matches(':dir(ltr)')\n ? DIR.LTR\n : DIR.RTL\n : window.getComputedStyle(this).direction || DIR.LTR\n );\n }\n\n /**\n * Hides the tab group if there are no tabs.\n */\n #hideEmptyTabGroup() {\n this.hidden = this.#allTabs().length === 0;\n }\n\n /**\n * Links up tabs with their adjacent panels using `aria-controls` and `aria-labelledby`.\n * This method makes sure only one tab is selected at a time.\n */\n #linkPanels() {\n const tabs = this.#allTabs();\n\n this.#hideEmptyTabGroup();\n\n // Give each panel a `aria-labelledby` attribute that refers to the tab that controls it.\n tabs.forEach(tab => {\n const panel = tab.nextElementSibling;\n\n if (!panel || panel.tagName.toLowerCase() !== 'a-tab-panel') {\n return console.error(`Tab #${tab.id} is not a sibling of a `);\n }\n\n tab.setAttribute('aria-controls', panel.id);\n panel.setAttribute('aria-labelledby', tab.id);\n });\n }\n\n /**\n * Get all panels in the tab group.\n *\n * @returns {TabPanel[]} - All the panels in the tab group.\n */\n #allPanels() {\n return Array.from(this.querySelectorAll('a-tab-panel'));\n }\n\n /**\n * Get all tabs in the tab group.\n *\n * @returns {Tab[]} - All the tabs in the tab group.\n */\n #allTabs() {\n return Array.from(this.querySelectorAll('a-tab'));\n }\n\n /**\n * Get the panel for the given tab.\n *\n * @param {Tab} tab - The tab whose panel is to be returned.\n * @returns {Nullable} - The panel controlled by the given tab.\n */\n #panelForTab(tab) {\n const panelId = tab.getAttribute('aria-controls');\n return this.querySelector(`#${panelId}`);\n }\n\n /**\n * Get the first non-disabled tab in the tab group.\n *\n * @returns {Nullable} - The first tab in the tab group.\n */\n #firstTab() {\n const tabs = this.#allTabs();\n return tabs.find(tab => !tab.disabled) || null;\n }\n\n /**\n * Get the last non-disabled tab in the tab group.\n *\n * @returns {Nullable} - The last tab in the tab group.\n */\n #lastTab() {\n const tabs = this.#allTabs();\n\n for (let i = tabs.length - 1; i >= 0; i--) {\n if (!tabs[i].disabled) {\n return tabs[i];\n }\n }\n\n return null;\n }\n\n /**\n * Get the tab that comes before the currently selected one, wrapping around when reaching the first tab.\n * If the currently selected tab is disabled, the method will skip it.\n *\n * @returns {Nullable} - The previous tab.\n */\n #prevTab() {\n const tabs = this.#allTabs();\n let newIdx =\n this.activation === ACTIVATION.MANUAL\n ? tabs.findIndex(tab => tab.matches(':focus')) - 1\n : tabs.findIndex(tab => tab.selected) - 1;\n\n // Keep looping until we find a non-disabled tab.\n while (tabs[(newIdx + tabs.length) % tabs.length].disabled) {\n newIdx--;\n }\n\n // Stop cycling through tabs if we reach the beginning and tab cycling is disabled.\n if (this.noTabCycling && newIdx < 0) {\n return null;\n }\n\n // Add `tabs.length` to make sure the index is a positive number and get the modulus to wrap around if necessary.\n return tabs[(newIdx + tabs.length) % tabs.length];\n }\n\n /**\n * Get the tab that comes after the currently selected one, wrapping around when reaching the last tab.\n * If the currently selected tab is disabled, the method will skip it.\n *\n * @returns {Nullable} - The next tab.\n */\n #nextTab() {\n const tabs = this.#allTabs();\n let newIdx =\n this.activation === ACTIVATION.MANUAL\n ? tabs.findIndex(tab => tab.matches(':focus')) + 1\n : tabs.findIndex(tab => tab.selected) + 1;\n\n // Keep looping until we find a non-disabled tab.\n while (tabs[newIdx % tabs.length].disabled) {\n newIdx++;\n }\n\n // Stop cycling through tabs if we reach the end and tab cycling is disabled.\n if (this.noTabCycling && newIdx >= tabs.length) {\n return null;\n }\n\n return tabs[newIdx % tabs.length];\n }\n\n /**\n * Marks all tabs as unselected and hides all the panels.\n * This is called every time the user selects a new tab.\n */\n #reset() {\n const tabs = this.#allTabs();\n const panels = this.#allPanels();\n\n tabs.forEach(tab => (tab.selected = false));\n panels.forEach(panel => (panel.hidden = true));\n }\n\n /**\n * Syncs the tab group navigation with the current state of the tab group.\n *\n * This is called every time the user:\n * - adds or removes a tab or panel\n * - changes the placement of the tabs\n * - enables or disables the scroll controls\n *\n * If the tabs container is scrollable and the scroll controls are enabled,\n * the scroll buttons are displayed and the resize observer is started,\n * otherwise they are hidden and the resize observer is stopped.\n */\n #syncNav() {\n const navContainer = this.shadowRoot?.querySelector('.tab-group__nav');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n /** @type {HTMLButtonElement[]} */\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n if (this.noScrollControls || this.placement === PLACEMENT.START || this.placement === PLACEMENT.END) {\n this.#stopResizeObserver();\n scrollButtons.forEach(el => (el.hidden = true));\n navContainer?.part.remove('nav--has-scroll-controls');\n navContainer?.classList.remove('tab-group__nav--has-scroll-controls');\n tabsContainer?.setAttribute('aria-orientation', 'vertical');\n } else {\n this.#startResizeObserver();\n scrollButtons.forEach(el => (el.hidden = false));\n tabsContainer?.setAttribute('aria-orientation', 'horizontal');\n }\n }\n\n /**\n * Sets the selected tab when the slot changes.\n * This is called every time the user adds or removes a tab or panel.\n * This is useful when the user closes the selected tab and we need to select a new one.\n */\n #setSelectedTabOnSlotChange() {\n const tabs = this.#allTabs();\n\n // Get the selected non-disabled tab, or the first non-disabled tab.\n const tab = tabs.find(tab => tab.selected && !tab.disabled) || tabs.find(tab => !tab.disabled);\n\n if (tab) {\n if (this.#hasTabSlotChangedOnce && !tab.selected) {\n this.dispatchEvent(\n new CustomEvent('a-tab-show', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n\n this.#setSelectedTab(tab);\n }\n }\n\n /**\n * Sets the given tab as selected and shows the panel corresponding to the given tab.\n * Differentiates from `selectTab()` in that it does not emit any events or focus the tab.\n * Used internally to set the selected tab when a tab is selected by a side effect,\n * eg. when a tabs and panels are added or removeda and there is a need to select a new tab.\n *\n * @param {Tab} tab - The tab to be selected.\n */\n #setSelectedTab(tab) {\n this.#reset();\n\n if (tab) {\n tab.selected = true;\n }\n\n const panel = this.#panelForTab(tab);\n\n if (panel) {\n panel.hidden = false;\n }\n }\n\n /**\n * Handles the slotchange event on the tab group.\n * This is called every time the user adds or removes a tab or panel.\n *\n * @param {any} evt - The slotchange event.\n */\n #handleSlotChange = evt => {\n this.#linkPanels();\n this.#syncNav();\n this.#setSelectedTabOnSlotChange();\n\n if (evt.target.name === 'tab') {\n this.#hasTabSlotChangedOnce = true;\n }\n };\n\n /**\n * Handles key events on the tab group.\n *\n * @param {any} evt - The keydown event.\n */\n #handleKeyDown = evt => {\n if (\n evt.target.tagName.toLowerCase() !== 'a-tab' || // Ignore any key presses that have a modifier.\n evt.altKey // Don’t handle modifier shortcuts typically used by assistive technology.\n ) {\n return;\n }\n\n const placement = validPlacements.includes(this.placement || '') ? this.placement : PLACEMENT.TOP;\n const orientation = [PLACEMENT.TOP, PLACEMENT.BOTTOM].includes(placement || '') ? 'horizontal' : 'vertical';\n const directionality = this.#getDirectionality();\n let tab = null;\n\n switch (evt.key) {\n case KEYCODE.LEFT:\n if (orientation === 'horizontal') {\n tab = directionality === DIR.LTR ? this.#prevTab() : this.#nextTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.RIGHT:\n if (orientation === 'horizontal') {\n tab = directionality === DIR.LTR ? this.#nextTab() : this.#prevTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.UP:\n if (orientation === 'vertical') {\n tab = this.#prevTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.DOWN:\n if (orientation === 'vertical') {\n tab = this.#nextTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.HOME:\n tab = this.#firstTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n break;\n case KEYCODE.END:\n tab = this.#lastTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n break;\n case KEYCODE.ENTER:\n case KEYCODE.SPACE:\n tab = evt.target;\n if (tab) {\n this.selectTab(tab);\n }\n break;\n default:\n // Any other key press is ignored and passed back to the browser.\n return;\n }\n\n // The browser might have some native functionality bound to the arrow keys, home or end.\n // `preventDefault()` is called to prevent the browser from taking any actions.\n evt.preventDefault();\n };\n\n /**\n * Handles click events on the tab group.\n *\n * @param {any} evt - The click event.\n */\n #handleTabClick = evt => {\n const tab = evt.target.closest('a-tab');\n\n if (tab) {\n this.selectTab(tab);\n }\n };\n\n /**\n * Handles the scroll button click event.\n *\n * @param {any} evt - The click event.\n */\n #handleScrollButtonClick = evt => {\n const scrollButton = evt.target.closest('.tab-group__scroll-button');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n if (!scrollButton || !tabsContainer) {\n return;\n }\n\n const isStartButton = scrollButton.classList.contains('tab-group__scroll-button--start');\n const isLTR = this.#getDirectionality() === DIR.LTR;\n const sign = isStartButton ? (isLTR ? -1 : 1) : isLTR ? 1 : -1;\n const offsetLeft = tabsContainer.scrollLeft;\n\n tabsContainer.scrollTo({\n left: offsetLeft + sign * this.scrollDistance\n });\n };\n\n /**\n * Handles the tab close button click event.\n *\n * @param {any} evt - The click event.\n */\n #handleTabClose = evt => {\n const tab = evt.target;\n const panel = this.#panelForTab(tab);\n\n if (tab) {\n tab.remove();\n\n if (tab.selected) {\n this.dispatchEvent(\n new CustomEvent('a-tab-hide', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n }\n\n if (panel && panel.tagName.toLowerCase() === 'a-tab-panel') {\n panel.remove();\n }\n };\n\n /**\n * Wrapper for the `upgradeProperty` function.\n *\n * @param {'placement' | 'noScrollControls' | 'scrollDistance' | 'activation' | 'noTabCycling'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n return upgradeProperty(prop, this);\n }\n\n /**\n * Selects the tab at the given index.\n * If the tab at the given index is disabled or already selected, this method does nothing.\n *\n * @param {number} index - The index of the tab to be selected.\n */\n selectTabByIndex(index) {\n const tabs = this.#allTabs();\n const tab = tabs[index];\n\n if (tab) {\n this.selectTab(tab);\n }\n }\n\n /**\n * Selects the tab with the given id.\n * If the tab with the given id is disabled or already selected, this method does nothing.\n *\n * @param {string} id - The id of the tab to be selected.\n */\n selectTabById(id) {\n const tabs = this.#allTabs();\n const tab = tabs.find(tab => tab.id === id);\n\n if (tab) {\n this.selectTab(tab);\n }\n }\n\n /**\n * Selects the given tab.\n * If the given tab is disabled or already selected, this method does nothing.\n *\n * @param {Tab} tab - The tab to be selected.\n */\n selectTab(tab) {\n const oldTab = this.#allTabs().find(t => t.selected);\n\n if (!tab || tab.disabled || tab.selected || tab.tagName.toLowerCase() !== 'a-tab') {\n return;\n }\n\n this.#setSelectedTab(tab);\n\n // Queue a microtask to ensure that the tab is focused on the next tick.\n window.requestAnimationFrame(() => {\n tab.scrollIntoView({ inline: 'nearest', block: 'nearest' });\n tab.focus();\n });\n\n if (oldTab) {\n this.dispatchEvent(\n new CustomEvent('a-tab-hide', {\n bubbles: true,\n composed: true,\n detail: { tabId: oldTab.id }\n })\n );\n }\n\n this.dispatchEvent(\n new CustomEvent('a-tab-show', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n\n static defineCustomElement(elementName = 'a-tab-group') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATabGroup);\n }\n }\n}\n\nATabGroup.defineCustomElement();\n\nexport { ATabGroup };\n","/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar h=`\n :host {\n display: inline-block;\n }\n`,r=document.createElement(\"template\");r.innerHTML=`\n \n \n`;var s=class a extends HTMLElement{#e;#t;#r=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(r.content.cloneNode(!0)),this.#e=this.shadowRoot?.querySelector('slot[name=\"button\"]')||null,this.#t=this.#h()}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,e,i){t===\"disabled\"&&e!==i&&this.#t&&(this.#t.toggleAttribute(\"disabled\",this.disabled),this.#t.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#t.part&&this.#t.part.contains(\"button\")&&this.#t.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#s(\"shareUrl\"),this.#s(\"shareTitle\"),this.#s(\"shareText\"),this.#s(\"shareFiles\"),this.#s(\"disabled\"),this.#e?.addEventListener(\"slotchange\",this.#a),this.#t?.addEventListener(\"click\",this.#i)}disconnectedCallback(){this.#e?.removeEventListener(\"slotchange\",this.#a),this.#t?.removeEventListener(\"click\",this.#i)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get shareUrl(){return this.getAttribute(\"share-url\")||\"\"}set shareUrl(t){this.setAttribute(\"share-url\",t)}get shareTitle(){return this.getAttribute(\"share-title\")||\"\"}set shareTitle(t){this.setAttribute(\"share-title\",t)}get shareText(){return this.getAttribute(\"share-text\")||\"\"}set shareText(t){this.setAttribute(\"share-text\",t)}get shareFiles(){return this.#r}set shareFiles(t){Array.isArray(t)&&t.length>0&&(this.#r=t)}async share(){if(!this.disabled)try{let t={};this.shareUrl&&(t.url=this.shareUrl),this.shareTitle&&(t.title=this.shareTitle),this.shareText&&(t.text=this.shareText),Array.isArray(this.shareFiles)&&this.shareFiles.length>0&&navigator.canShare&&navigator.canShare({files:this.shareFiles})&&(t.files=this.shareFiles),await navigator.share(t),this.dispatchEvent(new CustomEvent(\"web-share:success\",{bubbles:!0,composed:!0,detail:{shareData:t}}))}catch(t){if(t instanceof Error&&t.name===\"AbortError\"){this.dispatchEvent(new CustomEvent(\"web-share:abort\",{bubbles:!0,composed:!0,detail:{error:t}}));return}this.dispatchEvent(new CustomEvent(\"web-share:error\",{bubbles:!0,composed:!0,detail:{error:t}}))}}#i=t=>{t.preventDefault(),!this.disabled&&this.share()};#a=t=>{t.target&&t.target.name===\"button\"&&(this.#t?.removeEventListener(\"click\",this.#i),this.#t=this.#h(),this.#t&&(this.#t.addEventListener(\"click\",this.#i),this.#t.nodeName!==\"BUTTON\"&&!this.#t.hasAttribute(\"role\")&&this.#t.setAttribute(\"role\",\"button\")))};#h(){return this.#e&&this.#e.assignedElements({flatten:!0}).find(t=>t.nodeName===\"BUTTON\"||t.getAttribute(\"slot\")===\"button\")||null}#s(t){let e=this;if(Object.prototype.hasOwnProperty.call(e,t)){let i=e[t];delete e[t],e[t]=i}}static defineCustomElement(t=\"web-share\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};s.defineCustomElement();export{s as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */\n\nconst styles = /* css */ `\n :host {\n display: inline-block;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element#readme\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */\nclass WebShare extends HTMLElement {\n /** @type {Nullable} */\n #buttonSlot;\n\n /** @type {Nullable} */\n #buttonEl;\n\n /** @type {File[]} */\n #files = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute('disabled', this.disabled);\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part && this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('shareUrl');\n this.#upgradeProperty('shareTitle');\n this.#upgradeProperty('shareText');\n this.#upgradeProperty('shareFiles');\n this.#upgradeProperty('disabled');\n\n this.#buttonSlot?.addEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n }\n\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */\n get shareUrl() {\n return this.getAttribute('share-url') || '';\n }\n\n set shareUrl(value) {\n this.setAttribute('share-url', value);\n }\n\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */\n get shareTitle() {\n return this.getAttribute('share-title') || '';\n }\n\n set shareTitle(value) {\n this.setAttribute('share-title', value);\n }\n\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */\n get shareText() {\n return this.getAttribute('share-text') || '';\n }\n\n set shareText(value) {\n this.setAttribute('share-text', value);\n }\n\n /**\n * @type {File[]} - The files to share.\n */\n get shareFiles() {\n return this.#files;\n }\n\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) {\n this.#files = value;\n }\n }\n\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */\n async share() {\n if (this.disabled) {\n return;\n }\n\n try {\n /** @type {ShareData} */\n const shareData = {};\n\n if (this.shareUrl) {\n shareData.url = this.shareUrl;\n }\n\n if (this.shareTitle) {\n shareData.title = this.shareTitle;\n }\n\n if (this.shareText) {\n shareData.text = this.shareText;\n }\n\n if (\n Array.isArray(this.shareFiles) &&\n this.shareFiles.length > 0 &&\n navigator.canShare &&\n navigator.canShare({ files: this.shareFiles })\n ) {\n shareData.files = this.shareFiles;\n }\n\n await navigator.share(shareData);\n\n this.dispatchEvent(\n new CustomEvent('web-share:success', {\n bubbles: true,\n composed: true,\n detail: { shareData }\n })\n );\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n this.dispatchEvent(\n new CustomEvent('web-share:abort', {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent('web-share:error', {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n }\n\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.share();\n };\n\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */\n #handleSlotChange = evt => {\n if (evt.target && evt.target.name === 'button') {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n this.#buttonEl = this.#getButton();\n\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener('click', this.#handleClick);\n\n if (this.#buttonEl.nodeName !== 'BUTTON' && !this.#buttonEl.hasAttribute('role')) {\n this.#buttonEl.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */\n #getButton() {\n if (!this.#buttonSlot) {\n return null;\n }\n\n return (\n this.#buttonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'button';\n }) || null\n );\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='web-share'] - The name of the custom element.\n * @example\n *\n * ClipboardCopy.defineCustomElement('my-web-share');\n */\n static defineCustomElement(elementName = 'web-share') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, WebShare);\n }\n }\n}\n\nexport { WebShare };\n","import { WebShare } from './web-share.js';\n\nWebShare.defineCustomElement();\n\nexport { WebShare };\n","/*!\n * @georapbox/files-dropzone-element\n * A custom element that creates a drag and drop zone for files\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/files-dropzone-element#readme\n * @author George Raptis \n * @license MIT\n */\nfunction u(o,e=\"\"){if(!e)return!0;let t=[...new Set(e.split(\",\").map(r=>r.trim()).filter(Boolean))],i=o.type,s=i.replace(/\\/.*$/,\"\");for(let r of t)if(r.charAt(0)===\".\"){if(o.name.toLowerCase().indexOf(r.toLowerCase(),o.name.length-r.length)!==-1)return!0}else if(/\\/\\*$/.test(r)){if(s===r.replace(/\\/.*$/,\"\"))return!0}else if(i===r)return!0;return!1}var x=new Map([[\"aac\",\"audio/aac\"],[\"abw\",\"application/x-abiword\"],[\"arc\",\"application/x-freearc\"],[\"avif\",\"image/avif\"],[\"avi\",\"video/x-msvideo\"],[\"azw\",\"application/vnd.amazon.ebook\"],[\"bin\",\"application/octet-stream\"],[\"bmp\",\"image/bmp\"],[\"bz\",\"application/x-bzip\"],[\"bz2\",\"application/x-bzip2\"],[\"cda\",\"application/x-cdf\"],[\"csh\",\"application/x-csh\"],[\"css\",\"text/css\"],[\"csv\",\"text/csv\"],[\"doc\",\"application/msword\"],[\"docx\",\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"],[\"eot\",\"application/vnd.ms-fontobject\"],[\"epub\",\"application/epub+zip\"],[\"gz\",\"application/gzip\"],[\"gif\",\"image/gif\"],[\"heic\",\"image/heic\"],[\"heif\",\"image/heif\"],[\"htm\",\"text/html\"],[\"html\",\"text/html\"],[\"ico\",\"image/vnd.microsoft.icon\"],[\"ics\",\"text/calendar\"],[\"jar\",\"application/java-archive\"],[\"jpeg\",\"image/jpeg\"],[\"jpg\",\"image/jpeg\"],[\"jxl\",\"image/jxl\"],[\"js\",\"text/javascript\"],[\"json\",\"application/json\"],[\"jsonld\",\"application/ld+json\"],[\"markdown\",\"text/markdown\"],[\"md\",\"text/markdown\"],[\"mid\",\"audio/midi\"],[\"midi\",\"audio/midi\"],[\"mjs\",\"text/javascript\"],[\"mp3\",\"audio/mpeg\"],[\"mp4\",\"video/mp4\"],[\"mpeg\",\"video/mpeg\"],[\"mpkg\",\"application/vnd.apple.installer+xml\"],[\"odp\",\"application/vnd.oasis.opendocument.presentation\"],[\"ods\",\"application/vnd.oasis.opendocument.spreadsheet\"],[\"odt\",\"application/vnd.oasis.opendocument.text\"],[\"oga\",\"audio/ogg\"],[\"ogv\",\"video/ogg\"],[\"ogx\",\"application/ogg\"],[\"opus\",\"audio/opus\"],[\"otf\",\"font/otf\"],[\"png\",\"image/png\"],[\"pdf\",\"application/pdf\"],[\"php\",\"application/x-httpd-php\"],[\"ppt\",\"application/vnd.ms-powerpoint\"],[\"pptx\",\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"],[\"rar\",\"application/vnd.rar\"],[\"rtf\",\"application/rtf\"],[\"sh\",\"application/x-sh\"],[\"svg\",\"image/svg+xml\"],[\"swf\",\"application/x-shockwave-flash\"],[\"tar\",\"application/x-tar\"],[\"tif\",\"image/tiff\"],[\"tiff\",\"image/tiff\"],[\"ts\",\"video/mp2t\"],[\"ttf\",\"font/ttf\"],[\"txt\",\"text/plain\"],[\"vsd\",\"application/vnd.visio\"],[\"wav\",\"audio/wav\"],[\"weba\",\"audio/webm\"],[\"webm\",\"video/webm\"],[\"webp\",\"image/webp\"],[\"woff\",\"font/woff\"],[\"woff2\",\"font/woff2\"],[\"xhtml\",\"application/xhtml+xml\"],[\"xls\",\"application/vnd.ms-excel\"],[\"xlsx\",\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"],[\"xml\",\"application/xml\"],[\"xul\",\"application/vnd.mozilla.xul+xml\"],[\"zip\",\"application/zip\"],[\"7z\",\"application/x-7z-compressed\"],[\"mkv\",\"video/x-matroska\"],[\"mov\",\"video/quicktime\"],[\"msg\",\"application/vnd.ms-outlook\"]]),b=[\".DS_Store\",\"Thumbs.db\"],y=o=>{let{name:e}=o;if(e&&e.lastIndexOf(\".\")!==-1&&!o.type){let i=(e.split(\".\").pop()||\"\").toLowerCase(),s=x.get(i);s&&Object.defineProperty(o,\"type\",{value:s,writable:!1,configurable:!1,enumerable:!0})}return o},g=(o,e)=>{let t=y(o);if(typeof t.path!=\"string\"){let{webkitRelativePath:i}=o;Object.defineProperty(t,\"path\",{value:typeof e==\"string\"?e:i||o.name,writable:!1,configurable:!1,enumerable:!0})}return t},m=async o=>await new Promise((e,t)=>{o.readEntries(e,t)}),w=async o=>{let e=[],t=await m(o);for(;t.length>0;)e.push(...t),t=await m(o);return e},E=o=>new Promise((e,t)=>{o.file(i=>e(g(i,o.fullPath)),t)}),F=async o=>{let e=[],t=[];for(let i of o){if(i.kind!==\"file\")continue;let s=i.getAsEntry?i.getAsEntry():i.webkitGetAsEntry();t.push(s)}for(;t.length>0;){let i=t.shift();if(i)if(i.isFile){let s=await E(i);b.indexOf(s.name)===-1&&e.push(s)}else i.isDirectory&&t.push(...await w(i.createReader()));else continue}return e},f=async o=>{let e=[];for(let t of o)b.indexOf(t.name)===-1&&e.push(g(t));return e},l=async o=>o.dataTransfer?o.dataTransfer.items?await F(o.dataTransfer.items):await f(o.dataTransfer.files):await f(o.target.files);var n=\"files-dropzone\",v=\"TOO_MANY_FILES\",L=\"FILE_TOO_LARGE\",k=\"FILE_TOO_SMALL\",A=\"INVALID_MIME_TYPE\",z=document.createElement(\"template\"),S=`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;z.innerHTML=`\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;var d=class o extends HTMLElement{#t=null;#e=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(z.content.cloneNode(!0)),this.shadowRoot&&(this.#t=this.shadowRoot.getElementById(\"file-input\"),this.#e=this.shadowRoot.getElementById(\"dropzone\"))}static get observedAttributes(){return[\"accept\",\"disabled\",\"multiple\"]}attributeChangedCallback(e,t,i){e===\"accept\"&&t!==i&&this.#t&&(this.#t.accept=this.accept),e===\"disabled\"&&t!==i&&this.#t&&(this.#t.disabled=this.disabled,this.disabled?(this.#e?.removeAttribute(\"tabindex\"),this.#e?.setAttribute(\"aria-disabled\",\"true\")):(this.#e?.setAttribute(\"tabindex\",\"0\"),this.#e?.setAttribute(\"aria-disabled\",\"false\"))),e===\"multiple\"&&t!==i&&this.#t&&(this.#t.multiple=this.multiple)}connectedCallback(){this.#o(\"accept\"),this.#o(\"disabled\"),this.#o(\"maxFiles\"),this.#o(\"maxSize\"),this.#o(\"minSize\"),this.#o(\"multiple\"),this.#o(\"autoFocus\"),this.#o(\"noStyle\"),this.#t?.addEventListener(\"change\",this.#i),this.#e?.addEventListener(\"dragenter\",this.#r),this.#e?.addEventListener(\"dragover\",this.#s),this.#e?.addEventListener(\"dragleave\",this.#n),this.#e?.addEventListener(\"drop\",this.#a),this.#e?.addEventListener(\"click\",this.#d),this.#e?.addEventListener(\"keyup\",this.#l),this.autoFocus&&this.#e?.focus()}disconnectedCallback(){this.#t?.removeEventListener(\"change\",this.#i),this.#e?.removeEventListener(\"dragenter\",this.#r),this.#e?.removeEventListener(\"dragover\",this.#s),this.#e?.removeEventListener(\"dragleave\",this.#n),this.#e?.removeEventListener(\"drop\",this.#a),this.#e?.removeEventListener(\"click\",this.#d),this.#e?.removeEventListener(\"keyup\",this.#l)}get accept(){return this.getAttribute(\"accept\")||\"\"}set accept(e){this.setAttribute(\"accept\",e!=null?e.toString():e)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}get maxFiles(){let e=Number(this.getAttribute(\"max-files\"))||0;return e<=0?1/0:Math.floor(Math.abs(e))}set maxFiles(e){this.setAttribute(\"max-files\",e!=null?e.toString():e)}get maxSize(){let e=this.getAttribute(\"max-size\");if(e===null)return 1/0;let t=Number(e);return Number.isNaN(t)?1/0:t}set maxSize(e){this.setAttribute(\"max-size\",e!=null?e.toString():e)}get minSize(){let e=this.getAttribute(\"min-size\");if(e===null)return 0;let t=Number(e);return Number.isNaN(t)?0:t}set minSize(e){this.setAttribute(\"min-size\",e!=null?e.toString():e)}get multiple(){return this.hasAttribute(\"multiple\")}set multiple(e){this.toggleAttribute(\"multiple\",!!e)}get autoFocus(){return this.hasAttribute(\"auto-focus\")}set autoFocus(e){this.toggleAttribute(\"auto-focus\",!!e)}get noStyle(){return this.hasAttribute(\"no-style\")}set noStyle(e){this.toggleAttribute(\"no-style\",!!e)}#i=async e=>{try{this.#c(await l(e))}catch(t){this.dispatchEvent(new CustomEvent(`${n}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}};#r=()=>{this.disabled||this.dispatchEvent(new Event(`${n}-dragenter`,{bubbles:!0,composed:!0}))};#s=e=>{if(e.preventDefault(),this.disabled){e.dataTransfer.dropEffect=\"none\";return}e.dataTransfer.dropEffect=\"copy\",this.#e&&(this.#e.classList.add(\"dropzone--dragover\"),this.#e.part.add(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${n}-dragover`,{bubbles:!0,composed:!0}))};#n=()=>{this.disabled||(this.#e&&(this.#e.classList.remove(\"dropzone--dragover\"),this.#e.part.remove(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${n}-dragleave`,{bubbles:!0,composed:!0})))};#a=async e=>{if(!this.disabled){e.preventDefault(),this.#e&&(this.#e.classList.remove(\"dropzone--dragover\"),this.#e.part.remove(\"dropzone--dragover\"));try{this.#c(await l(e))}catch(t){this.dispatchEvent(new CustomEvent(`${n}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}};#d=()=>{this.disabled||this.#t?.click()};#l=e=>{this.disabled||(e.key===\" \"||e.key===\"Enter\")&&this.#t?.click()};#c(e){if(!Array.isArray(e)||!e.length)return;let t=[],i=[],s=e.length;if(!this.multiple&&s>1)for(let r of e)i.push({file:r,errors:[{code:v,message:\"Too many files selected. Only 1 file is allowed.\"}]});else if(this.multiple&&s>this.maxFiles)for(let r of e)i.push({file:r,errors:[{code:v,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?\"files are\":\"file is\"} allowed.`}]});else for(let r of e){let c=u(r,this.accept),p=r.size>this.maxSize,h=r.size0&&this.dispatchEvent(new CustomEvent(`${n}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:t}})),i.length>0&&this.dispatchEvent(new CustomEvent(`${n}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:i}})),this.#t&&(this.#t.value=this.#t.defaultValue)}openFileDialog(){this.disabled||this.#t?.click()}#o(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}static defineCustomElement(e=n){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,o)}};d.defineCustomElement();export{d as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","// @ts-check\n\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */\nexport function isValidFile(file, acceptedTypeSpecifiers = '') {\n if (!acceptedTypeSpecifiers) {\n return true;\n }\n\n const acceptedMimeTypesList = [\n ...new Set(\n acceptedTypeSpecifiers\n .split(',')\n .map(v => v.trim())\n .filter(Boolean)\n )\n ];\n\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, '');\n\n for (const validType of acceptedMimeTypesList) {\n if (validType.charAt(0) === '.') {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, '')) {\n return true;\n }\n } else {\n if (fileMimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n}\n","// @ts-check\n\n/**\n * A map of common file extensions and their associated MIME types.\n */\nconst COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['jxl', 'image/jxl'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['markdown', 'text/markdown'],\n ['md', 'text/markdown'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */\nconst toFileWithMimeType = file => {\n const { name } = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const extension = (name.split('.').pop() || '').toLowerCase();\n const type = COMMON_MIME_TYPES.get(extension);\n\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n};\n\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */\nconst toFileWithPath = (file, path) => {\n const fileWithMimeType = toFileWithMimeType(file);\n\n // @ts-ignore\n if (typeof fileWithMimeType.path !== 'string') {\n const { webkitRelativePath } = file;\n\n Object.defineProperty(fileWithMimeType, 'path', {\n value: typeof path === 'string' ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return fileWithMimeType;\n};\n\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readEntriesPromise = async directoryReader => {\n return await new Promise((resolve, reject) => {\n directoryReader.readEntries(resolve, reject);\n });\n};\n\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readAllDirectoryEntries = async directoryReader => {\n const entries = [];\n let readEntries = await readEntriesPromise(directoryReader);\n\n while (readEntries.length > 0) {\n entries.push(...readEntries);\n readEntries = await readEntriesPromise(directoryReader);\n }\n\n return entries;\n};\n\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */\nconst getFileFromFileEntry = fileEntry => {\n return new Promise((resolve, reject) => {\n fileEntry.file(file => resolve(toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromDataTransferItemList = async dataTransferItemList => {\n const files = [];\n\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n\n for (const item of dataTransferItemList) {\n if (item.kind !== 'file') {\n // Ignore non-file items, such as links.\n continue;\n }\n\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n\n queue.push(entry);\n }\n\n while (queue.length > 0) {\n const entry = queue.shift();\n\n if (!entry) {\n continue;\n } else if (entry.isFile) {\n const file = await getFileFromFileEntry(entry);\n\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(file);\n }\n } else if (entry.isDirectory) {\n queue.push(...(await readAllDirectoryEntries(entry.createReader())));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromFileList = async fileList => {\n const files = [];\n\n for (const file of fileList) {\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(toFileWithPath(file));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from an event.\n * This function supports both `drop` and `change` events.\n *\n * @param {*} evt - The event to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nexport const getFilesFromEvent = async evt => {\n if (evt.dataTransfer) {\n return evt.dataTransfer.items\n ? await getFilesFromDataTransferItemList(evt.dataTransfer.items)\n : await getFilesFromFileList(evt.dataTransfer.files);\n }\n\n return await getFilesFromFileList(evt.target.files);\n};\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nimport { isValidFile } from './utils/is-valid-file.js';\nimport { getFilesFromEvent } from './utils/files-selector.js';\n\nconst COMPONENT_NAME = 'files-dropzone';\nconst TOO_MANY_FILES = 'TOO_MANY_FILES';\nconst FILE_TOO_LARGE = 'FILE_TOO_LARGE';\nconst FILE_TOO_SMALL = 'FILE_TOO_SMALL';\nconst INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;\n\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */\nclass FilesDropzone extends HTMLElement {\n /** @type {Nullable} */\n #fileInput = null;\n\n /** @type {Nullable} */\n #dropzoneEl = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */ (this.shadowRoot.getElementById('file-input'));\n this.#dropzoneEl = this.shadowRoot.getElementById('dropzone');\n }\n }\n\n static get observedAttributes() {\n return ['accept', 'disabled', 'multiple'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'accept' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.accept = this.accept;\n }\n\n if (name === 'disabled' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n\n if (this.disabled) {\n this.#dropzoneEl?.removeAttribute('tabindex');\n this.#dropzoneEl?.setAttribute('aria-disabled', 'true');\n } else {\n this.#dropzoneEl?.setAttribute('tabindex', '0');\n this.#dropzoneEl?.setAttribute('aria-disabled', 'false');\n }\n }\n\n if (name === 'multiple' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.multiple = this.multiple;\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('accept');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('maxFiles');\n this.#upgradeProperty('maxSize');\n this.#upgradeProperty('minSize');\n this.#upgradeProperty('multiple');\n this.#upgradeProperty('autoFocus');\n this.#upgradeProperty('noStyle');\n\n this.#fileInput?.addEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.addEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.addEventListener('click', this.#handleClick);\n this.#dropzoneEl?.addEventListener('keyup', this.#handleKeyUp);\n\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#fileInput?.removeEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.removeEventListener('click', this.#handleClick);\n this.#dropzoneEl?.removeEventListener('keyup', this.#handleKeyUp);\n }\n\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */\n get accept() {\n return this.getAttribute('accept') || '';\n }\n\n set accept(value) {\n this.setAttribute('accept', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */\n get maxFiles() {\n const num = Number(this.getAttribute('max-files')) || 0;\n\n if (num <= 0) {\n return Infinity;\n }\n\n return Math.floor(Math.abs(num));\n }\n\n set maxFiles(value) {\n this.setAttribute('max-files', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */\n get maxSize() {\n const value = this.getAttribute('max-size');\n\n if (value === null) {\n return Infinity;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? Infinity : num;\n }\n\n set maxSize(value) {\n this.setAttribute('max-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */\n get minSize() {\n const value = this.getAttribute('min-size');\n\n if (value === null) {\n return 0;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? 0 : num;\n }\n\n set minSize(value) {\n this.setAttribute('min-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */\n get multiple() {\n return this.hasAttribute('multiple');\n }\n\n set multiple(value) {\n this.toggleAttribute('multiple', !!value);\n }\n\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */\n get autoFocus() {\n return this.hasAttribute('auto-focus');\n }\n\n set autoFocus(value) {\n this.toggleAttribute('auto-focus', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */\n get noStyle() {\n return this.hasAttribute('no-style');\n }\n\n set noStyle(value) {\n this.toggleAttribute('no-style', !!value);\n }\n\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */\n #handleFileInputChange = async evt => {\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n };\n\n /**\n * Handles the dragenter event of the dropzone.\n */\n #handleDragEnter = () => {\n if (this.disabled) {\n return;\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDragOver = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n evt.dataTransfer.dropEffect = 'none';\n return;\n }\n\n evt.dataTransfer.dropEffect = 'copy';\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add('dropzone--dragover');\n this.#dropzoneEl.part.add('dropzone--dragover');\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the dragleave event of the dropzone.\n */\n #handleDragLeave = () => {\n if (this.disabled) {\n return;\n }\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDrop = async evt => {\n if (this.disabled) {\n return;\n }\n\n evt.preventDefault();\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n };\n\n /**\n * Handles the click event of the dropzone.\n */\n #handleClick = () => {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n };\n\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleKeyUp = evt => {\n if (this.disabled) {\n return;\n }\n\n if (evt.key === ' ' || evt.key === 'Enter') {\n this.#fileInput?.click();\n }\n };\n\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */\n #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) {\n return;\n }\n\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) {\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [\n {\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }\n ]\n });\n }\n } else if (this.multiple && filesLength > this.maxFiles) {\n // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [\n {\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? 'files are' : 'file is'} allowed.`\n }\n ]\n });\n }\n } else {\n // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files) {\n const fileHasValidType = isValidFile(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) {\n acceptedFiles.push(file);\n } else {\n const errors = [];\n\n if (!fileHasValidType) {\n errors.push({\n code: INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n }\n\n if (fileExceedsMaxSize) {\n errors.push({\n code: FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n }\n\n if (fileIsSmallerThanMinSize) {\n errors.push({\n code: FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n }\n\n rejectedFiles.push({ file, errors });\n }\n }\n }\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles,\n rejectedFiles\n }\n })\n );\n\n if (acceptedFiles.length > 0) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles\n }\n })\n );\n }\n\n if (rejectedFiles.length > 0) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles\n }\n })\n );\n }\n\n if (this.#fileInput) {\n this.#fileInput.value = this.#fileInput.defaultValue;\n }\n }\n\n /**\n * Opens the file dialog programmatically.\n */\n openFileDialog() {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, FilesDropzone);\n }\n }\n}\n\nexport { FilesDropzone };\n","import { FilesDropzone } from './files-dropzone.js';\n\nFilesDropzone.defineCustomElement();\n\nexport { FilesDropzone };\n","/*!\n * @georapbox/resize-observer-element\n * A custom element that offers a declarative interface to the ResizeObserver API.\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/resize-observer-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar d=\":host { display: contents; }\",o=document.createElement(\"template\");o.innerHTML=`\n \n \n`;var s=class n extends HTMLElement{#e=null;#t=null;#s=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(o.content.cloneNode(!0)),this.#e=this.shadowRoot?.querySelector(\"slot\")??null}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(e,t,i){e===\"disabled\"&&t!==i&&(this.disabled?this.#o():this.#i())}connectedCallback(){this.#d(\"disabled\"),\"ResizeObserver\"in window&&(this.#t=new ResizeObserver(e=>{this.dispatchEvent(new CustomEvent(\"resize-observer:resize\",{bubbles:!0,composed:!0,detail:{entries:e}}))}),this.disabled||this.#i(),this.#e?.addEventListener(\"slotchange\",this.#n))}disconnectedCallback(){this.#o(),this.#e?.removeEventListener(\"slotchange\",this.#n)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}#i(){!this.#e||!this.#t||(this.#s.forEach(e=>this.#t?.unobserve(e)),this.#s=[],this.#e.assignedElements().forEach(e=>{this.#t?.observe(e),this.#s.push(e)}))}#o(){this.#t?.disconnect()}#n=()=>{this.disabled||this.#i()};#d(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}static defineCustomElement(e=\"resize-observer\"){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,n)}};s.defineCustomElement();export{s as ResizeObserverElement};\n//# sourceMappingURL=resize-observer-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst styles = /* css */ `:host { display: contents; }`;\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that offers a declarative interface to the ResizeObserver API.\n * @documentation https://github.com/georapbox/resize-observer-element#readme\n *\n * @tagname resize-observer - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Whether the resize observer is disabled.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n *\n * @slot - The default slot where the elements to observe are placed.\n *\n * @event resize-observer:resize - Dispatched when the observed elements are resized.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n */\nclass ResizeObserverElement extends HTMLElement {\n /** @type {Nullable} */\n #slotEl = null;\n\n /** @type {Nullable} */\n #resizeObserver = null;\n\n /** @type {Element[]} */\n #observedElements = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#slotEl = this.shadowRoot?.querySelector('slot') ?? null;\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue) {\n this.disabled ? this.#stopObserver() : this.#startObserver();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('disabled');\n\n if ('ResizeObserver' in window) {\n this.#resizeObserver = new ResizeObserver(entries => {\n this.dispatchEvent(\n new CustomEvent('resize-observer:resize', {\n bubbles: true,\n composed: true,\n detail: { entries }\n })\n );\n });\n\n if (!this.disabled) {\n this.#startObserver();\n }\n\n this.#slotEl?.addEventListener('slotchange', this.#handleSlotChange);\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#stopObserver();\n this.#slotEl?.removeEventListener('slotchange', this.#handleSlotChange);\n }\n\n /**\n * @type {boolean} - Whether the resize observer is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * Starts observing the elements in the slot.\n */\n #startObserver() {\n if (!this.#slotEl || !this.#resizeObserver) {\n return;\n }\n\n this.#observedElements.forEach(el => this.#resizeObserver?.unobserve(el));\n this.#observedElements = [];\n\n this.#slotEl.assignedElements().forEach(el => {\n this.#resizeObserver?.observe(el);\n this.#observedElements.push(el);\n });\n }\n\n /**\n * Stops observing the elements in the slot.\n */\n #stopObserver() {\n this.#resizeObserver?.disconnect();\n }\n\n /**\n * Handles slot change event.\n */\n #handleSlotChange = () => {\n if (!this.disabled) {\n this.#startObserver();\n }\n };\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='resize-observer'] - The name of the custom element.\n * @example\n *\n * ResizeObserverElement.defineCustomElement('my-resize-observer');\n */\n static defineCustomElement(elementName = 'resize-observer') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ResizeObserverElement);\n }\n }\n}\n\nexport { ResizeObserverElement };\n","import { ResizeObserverElement } from './resize-observer.js';\n\nResizeObserverElement.defineCustomElement();\n\nexport { ResizeObserverElement };\n","/*!\n * @georapbox/modal-element\n * A custom element to create a modal, using the native dialog element under the hood.\n *\n * @version 1.8.0\n * @homepage https://github.com/georapbox/modal-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar n=document.createElement(\"template\"),r=`\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: 300ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;n.innerHTML=`\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;var a=class s extends HTMLElement{#e=null;#i=null;#a=null;#o=void 0;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(n.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.querySelector(\"dialog\"),this.#i=this.shadowRoot.querySelector('slot[name=\"footer\"]'),this.#a=this.shadowRoot.querySelector('slot[name=\"close\"]'))}static get observedAttributes(){return[\"open\",\"no-header\",\"no-animations\",\"no-close-button\",\"close-label\"]}attributeChangedCallback(e,t,i){if(this.#e!==null){if(e===\"open\"&&t!==i&&(this.open?(this.#e.showModal(),this.dispatchEvent(new CustomEvent(\"me-open\",{bubbles:!0,composed:!0,detail:{element:this}})),document.body&&!this.preserveOverflow&&(document.body.style.overflow=\"hidden\")):this.#e.close()),e===\"no-header\"&&t!==i){let o=this.#e.querySelector(\".dialog__header\");o!==null&&(o.hidden=this.noHeader)}if(e===\"no-animations\"&&t!==i&&this.#e.classList.toggle(\"dialog--no-animations\",this.noAnimations),e===\"no-close-button\"&&t!==i){let o=this.#e.querySelector(\".dialog__close\");o!==null&&(o.hidden=this.noCloseButton)}e===\"close-label\"&&t!==i&&this.#r()}}connectedCallback(){this.#t(\"open\"),this.#t(\"staticBackdrop\"),this.#t(\"noHeader\"),this.#t(\"noAnimations\"),this.#t(\"noCloseButton\"),this.#t(\"fullscreen\"),this.#t(\"preserveOverflow\"),this.#t(\"placement\"),this.#t(\"closeLabel\"),this.#e?.addEventListener(\"click\",this.#h),this.#e?.addEventListener(\"close\",this.#l),this.#e?.addEventListener(\"cancel\",this.#d),this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\",this.#c),this.#i?.addEventListener(\"slotchange\",this.#m),this.#a?.addEventListener(\"slotchange\",this.#g)}disconnectedCallback(){this.#o&&clearTimeout(this.#o),this.#e?.addEventListener(\"click\",this.#h),this.#e?.removeEventListener(\"close\",this.#l),this.#e?.removeEventListener(\"cancel\",this.#d),this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\",this.#c),this.#i?.removeEventListener(\"slotchange\",this.#m),this.#a?.removeEventListener(\"slotchange\",this.#g)}get open(){return this.hasAttribute(\"open\")}set open(e){this.toggleAttribute(\"open\",!!e)}get staticBackdrop(){return this.hasAttribute(\"static-backdrop\")}set staticBackdrop(e){this.toggleAttribute(\"static-backdrop\",!!e)}get noHeader(){return this.hasAttribute(\"no-header\")}set noHeader(e){this.toggleAttribute(\"no-header\",!!e)}get noAnimations(){return this.hasAttribute(\"no-animations\")}set noAnimations(e){this.toggleAttribute(\"no-animations\",!!e)}get noCloseButton(){return this.hasAttribute(\"no-close-button\")}set noCloseButton(e){this.toggleAttribute(\"no-close-button\",!!e)}get fullscreen(){return this.hasAttribute(\"fullscreen\")}set fullscreen(e){this.toggleAttribute(\"fullscreen\",!!e)}get preserveOverflow(){return this.hasAttribute(\"preserve-overflow\")}set preserveOverflow(e){this.toggleAttribute(\"preserve-overflow\",!!e)}get placement(){return this.getAttribute(\"placement\")||\"center\"}set placement(e){this.setAttribute(\"placement\",e!=null?e.toString():e)}get closeLabel(){return this.getAttribute(\"close-label\")||\"Close\"}set closeLabel(e){this.setAttribute(\"close-label\",e!=null?e.toString():e)}#r(){if(this.#e===null)return;let e=this.#e.querySelector(\".dialog__close\");if(e===null)return;(this.#a?.assignedElements()||[])?.some(o=>o.textContent?.replace(/\\s/g,\"\")!==\"\")?e.removeAttribute(\"aria-label\"):e.setAttribute(\"aria-label\",this.closeLabel)}#n(){this.#o||(this.#e?.classList.add(\"dialog--pulse\"),this.#o=setTimeout(()=>{this.#e?.classList.remove(\"dialog--pulse\"),clearTimeout(this.#o),this.#o=void 0},300))}#l=()=>{this.open=!1,this.dispatchEvent(new CustomEvent(\"me-close\",{bubbles:!0,composed:!0,detail:{element:this}})),document.body&&!this.preserveOverflow&&(document.body.style.overflow=\"\")};#d=e=>{let t=this.#s(\"escape-key\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),!this.noAnimations&&this.#n())};#c=e=>{let t=this.#s(\"close-button\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),!this.noAnimations&&this.#n())};#h=e=>{let t=e.target,i=e.currentTarget;if(t===i){let o=this.#s(\"backdrop-click\");this.dispatchEvent(o),o.defaultPrevented||this.staticBackdrop?!this.noAnimations&&this.#n():this.hide()}if(t instanceof HTMLElement&&t.closest(\"[data-me-close]\")!==null){let o=this.#s(\"external-invoker\");this.dispatchEvent(o),o.defaultPrevented?!this.noAnimations&&this.#n():this.hide()}};#m=()=>{if(this.#e===null)return;let e=this.#e.querySelector(\".dialog__footer\");if(e===null)return;let t=this.#i?.assignedNodes(),i=t?t.length>0:!1;e.hidden=!i};#g=()=>{this.#r()};#s(e){return new CustomEvent(\"me-request-close\",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,element:this}})}#t(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}show(){this.open||(this.open=!0)}hide(){this.open&&(this.open=!1)}static defineCustomElement(e=\"modal-element\"){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,s)}};a.defineCustomElement();export{a as ModalElement};\n//# sourceMappingURL=modal-element-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Available values for the request close reason.\n *\n * @typedef {'close-button' | 'escape-key' | 'backdrop-click' | 'external-invoker'} CloseRequestReason\n */\n\nconst PULSE_ANIMATION_DURATION = 300; // milliseconds\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: ${PULSE_ANIMATION_DURATION}ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;\n\n/**\n * @summary A custom element that renders a modal dialog.\n * @documentation https://github.com/georapbox/modal-element\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines whether the modal is open or not.\n * @property {boolean} staticBackdrop - Determines whether the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines whether the modal should have a header or not.\n * @property {boolean} noAnimations - Determines whether the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines whether the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines whether the modal should be fullscreen or not.\n * @property {boolean} preserveOverflow - Determines whether the overflow of the body should be preserved when the modal is open.\n * @property {string} placement - Determines the placement of the modal.\n * @property {string} closeLabel - The label of the default close button, used as the aria-label attribute of the close button.\n *\n * @attribute {boolean} open - Reflects the open property.\n * @attribute {boolean} static-backdrop - Reflects the staticBackdrop property.\n * @attribute {boolean} no-header - Reflects the noHeader property.\n * @attribute {boolean} no-animations - Reflects the noAnimations property.\n * @attribute {boolean} no-close-button - Reflects the noCloseButton property.\n * @attribute {boolean} fullscreen - Reflects the fullscreen property.\n * @attribute {boolean} preserve-overflow - Reflects the preserveOverflow property.\n * @attribute {string} placement - Reflects the placement property.\n * @attribute {string} close-label - Reflects the closeLabel property.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal.\n * @cssproperty --me-height - The height of the modal.\n * @cssproperty --me-border-color - The border color of the modal.\n * @cssproperty --me-border-style - The border style of the modal.\n * @cssproperty --me-border-width - The border width of the modal.\n * @cssproperty --me-border-radius - The border radius of the modal.\n * @cssproperty --me-box-shadow - The box shadow of the modal.\n * @cssproperty --me-background-color - The background color of the modal.\n * @cssproperty --me-color - The foreground color of the modal.\n * @cssproperty --me-header-spacing - The spacing of the header.\n * @cssproperty --me-header-background-color - The background color of the header.\n * @cssproperty --me-header-color - The foreground color of the header.\n * @cssproperty --me-body-spacing - The spacing of the body.\n * @cssproperty --me-body-background-color - The background color of the body.\n * @cssproperty --me-body-color - The foreground color of the body.\n * @cssproperty --me-footer-spacing - The spacing of the footer.\n * @cssproperty --me-footer-background-color - The background color of the footer.\n * @cssproperty --me-footer-color - The foreground color of the footer.\n * @cssproperty --me-close-padding - The padding of the close button.\n * @cssproperty --me-close-border - The border shorthand property of the close button.\n * @cssproperty --me-close-border-radius - The border radius shorthand property of the close button.\n * @cssproperty --me-close-background-color - The background color of the close button.\n * @cssproperty --me-close-color - The foreground color of the close button.\n * @cssproperty --me-close-font-size - The font size of the close button.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop.\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart close - The default close button rendered in the modal's header.\n * @csspart close-icon - The close icon of the default close button.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n */\nclass ModalElement extends HTMLElement {\n /** @type {Nullable} */\n #dialogEl = null;\n\n /** @type {Nullable} */\n #footerSlotEl = null;\n\n /** @type {Nullable} */\n #closeSlotEl = null;\n\n /** @type {ReturnType | undefined} */\n #pulseAnimationTimeout = void 0;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector('dialog');\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n this.#closeSlotEl = this.shadowRoot.querySelector('slot[name=\"close\"]');\n }\n }\n\n static get observedAttributes() {\n return ['open', 'no-header', 'no-animations', 'no-close-button', 'close-label'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) {\n return;\n }\n\n if (name === 'open' && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n\n this.dispatchEvent(\n new CustomEvent('me-open', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n })\n );\n\n if (document.body && !this.preserveOverflow) {\n document.body.style.overflow = 'hidden';\n }\n } else {\n this.#dialogEl.close();\n }\n }\n\n if (name === 'no-header' && oldValue !== newValue) {\n /** @type {Nullable} */\n const headerEl = this.#dialogEl.querySelector('.dialog__header');\n\n if (headerEl !== null) {\n headerEl.hidden = this.noHeader;\n }\n }\n\n if (name === 'no-animations' && oldValue !== newValue) {\n this.#dialogEl.classList.toggle('dialog--no-animations', this.noAnimations);\n }\n\n if (name === 'no-close-button' && oldValue !== newValue) {\n /** @type {Nullable} */\n const closeBtnEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeBtnEl !== null) {\n closeBtnEl.hidden = this.noCloseButton;\n }\n }\n\n if (name === 'close-label' && oldValue !== newValue) {\n this.#updateCloseLabel();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('open');\n this.#upgradeProperty('staticBackdrop');\n this.#upgradeProperty('noHeader');\n this.#upgradeProperty('noAnimations');\n this.#upgradeProperty('noCloseButton');\n this.#upgradeProperty('fullscreen');\n this.#upgradeProperty('preserveOverflow');\n this.#upgradeProperty('placement');\n this.#upgradeProperty('closeLabel');\n\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.addEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.addEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener('slotchange', this.#handleFooterSlotChange);\n this.#closeSlotEl?.addEventListener('slotchange', this.#handleCloseSlotChange);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.removeEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.removeEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener('slotchange', this.#handleFooterSlotChange);\n this.#closeSlotEl?.removeEventListener('slotchange', this.#handleCloseSlotChange);\n }\n\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */\n get open() {\n return this.hasAttribute('open');\n }\n\n set open(value) {\n this.toggleAttribute('open', !!value);\n }\n\n /**\n * Determines whether the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */\n get staticBackdrop() {\n return this.hasAttribute('static-backdrop');\n }\n\n set staticBackdrop(value) {\n this.toggleAttribute('static-backdrop', !!value);\n }\n\n /**\n * Determines whether the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */\n get noHeader() {\n return this.hasAttribute('no-header');\n }\n\n set noHeader(value) {\n this.toggleAttribute('no-header', !!value);\n }\n\n /**\n * Determines whether the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */\n get noAnimations() {\n return this.hasAttribute('no-animations');\n }\n\n set noAnimations(value) {\n this.toggleAttribute('no-animations', !!value);\n }\n\n /**\n * Determines whether the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */\n get noCloseButton() {\n return this.hasAttribute('no-close-button');\n }\n\n set noCloseButton(value) {\n this.toggleAttribute('no-close-button', !!value);\n }\n\n /**\n * Determines whether the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */\n get fullscreen() {\n return this.hasAttribute('fullscreen');\n }\n\n set fullscreen(value) {\n this.toggleAttribute('fullscreen', !!value);\n }\n\n /**\n * Determines whether the overflow of the body should be preserved when the modal is open.\n *\n * @type {boolean} - True if the overflow of the body should be preserved, otherwise false.\n * @default false\n * @attribute preserve-overflow - Reflects the preserveOverflow property.\n */\n get preserveOverflow() {\n return this.hasAttribute('preserve-overflow');\n }\n\n set preserveOverflow(value) {\n this.toggleAttribute('preserve-overflow', !!value);\n }\n\n /**\n * Determines the placement of the modal.\n * Possible values are 'top-start', 'top-center', 'top-end', 'center-start', 'center', 'center-end', 'bottom-start', 'bottom-center', 'bottom-end'.\n *\n * @type {string}\n * @default 'center'\n * @attribute placement - Reflects the placement property.\n */\n get placement() {\n return this.getAttribute('placement') || 'center';\n }\n\n set placement(value) {\n this.setAttribute('placement', value != null ? value.toString() : value);\n }\n\n /**\n * The label of the default close button, used as the aria-label attribute of the close button.\n * If user provides text content for the close button using the `close` slot, this property is ignored and the aria-label attribute is removed.\n *\n * @type {string}\n * @default 'Close'\n * @attribute close-label - Reflects the closeLabel property.\n */\n get closeLabel() {\n return this.getAttribute('close-label') || 'Close';\n }\n\n set closeLabel(value) {\n this.setAttribute('close-label', value != null ? value.toString() : value);\n }\n\n /**\n * Updates the aria-label attribute of the close button.\n * If the slot for the close button has text content, the aria-label attribute is removed to allow the text content to be used as the label.\n * Otherwise, the aria-label attribute is set to the `closeLabel` property.\n *\n * @returns\n */\n #updateCloseLabel() {\n if (this.#dialogEl === null) {\n return;\n }\n\n const closeButtonEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeButtonEl === null) {\n return;\n }\n\n const assignedElements = this.#closeSlotEl?.assignedElements() || [];\n const hasTextContent = assignedElements?.some(el => el.textContent?.replace(/\\s/g, '') !== '');\n\n hasTextContent\n ? closeButtonEl.removeAttribute('aria-label')\n : closeButtonEl.setAttribute('aria-label', this.closeLabel);\n }\n\n /**\n * Applies a pulse effect on the dialog.\n */\n #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) {\n return;\n }\n\n this.#dialogEl?.classList.add('dialog--pulse');\n\n this.#pulseAnimationTimeout = setTimeout(() => {\n this.#dialogEl?.classList.remove('dialog--pulse');\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, PULSE_ANIMATION_DURATION);\n }\n\n /**\n * Handles the close event of the dialog.\n */\n #handleDialogClose = () => {\n // This is required because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n\n this.dispatchEvent(\n new CustomEvent('me-close', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n })\n );\n\n if (document.body && !this.preserveOverflow) {\n document.body.style.overflow = '';\n }\n };\n\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */\n #handleDialogCancel = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('escape-key');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('close-button');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleDialogClick = evt => {\n const target = evt.target;\n const currentTarget = evt.currentTarget;\n\n // Close the dialog when the backdrop is clicked.\n if (target === currentTarget) {\n const requestCloseEvent = this.#createRequestCloseEvent('backdrop-click');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n } else {\n this.hide();\n }\n }\n\n // Close the dialog when external invoker is clicked.\n if (target instanceof HTMLElement && target.closest('[data-me-close]') !== null) {\n const requestCloseEvent = this.#createRequestCloseEvent('external-invoker');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n } else {\n this.hide();\n }\n }\n };\n\n /**\n * Handles the slotchange event of the footer slot.\n */\n #handleFooterSlotChange = () => {\n if (this.#dialogEl === null) {\n return;\n }\n\n /** @type {Nullable} */\n const footerEl = this.#dialogEl.querySelector('.dialog__footer');\n\n if (footerEl === null) {\n return;\n }\n\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n\n footerEl.hidden = !hasFooterSlotNodes;\n };\n\n /**\n * Handles the slotchange event of the close slot.\n */\n #handleCloseSlotChange = () => {\n this.#updateCloseLabel();\n };\n\n /**\n * Creates a request close event.\n *\n * @param {CloseRequestReason} reason - The reason that the modal is about to close.\n */\n #createRequestCloseEvent(reason) {\n return new CustomEvent('me-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason,\n element: this\n }\n });\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen' | 'preserveOverflow' | 'placement' | 'closeLabel'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */\n show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n }\n\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */\n hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */\n static defineCustomElement(elementName = 'modal-element') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ModalElement);\n }\n }\n}\n\nexport { ModalElement };\n","import { ModalElement } from './modal-element.js';\n\nModalElement.defineCustomElement();\n\nexport { ModalElement };\n","export const EXPERIMENTAL_FLAG = 'experimental';\n\nexport const NO_BARCODE_DETECTED = 'No barcode detected';\n\nexport const ACCEPTED_MIME_TYPES = [\n 'image/jpg',\n 'image/jpeg',\n 'image/png',\n 'image/apng',\n 'image/gif',\n 'image/webp',\n 'image/avif'\n];\n","import { set, get } from 'idb-keyval';\n\nconst STORAGE_PREFIX = 'barcode-scanner/';\nconst SETTINGS_STORAGE_KEY = 'settings';\nconst HISTORY_STORAGE_KEY = 'history';\n\n/**\n * Gets an item from the storage.\n *\n * @param {string} key - The key to get the item from.\n * @returns {Promise<[ error: any, value: any ]>} The item and an error if occurred.\n */\nconst getItem = async key => {\n try {\n return [null, await get(key)];\n } catch (error) {\n return [error, void 0];\n }\n};\n\n/**\n * Sets an item in the storage.\n *\n * @param {string} key - The key to set the item to.\n * @param {any} data - The data to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nconst setItem = async (key, data) => {\n try {\n await set(key, data);\n\n return [null];\n } catch (error) {\n return [error];\n }\n};\n\n/**\n * Gets the settings from the storage.\n *\n * @returns {Promise<[ error: any, value: any ]>} The settings and an error if occurred.\n */\nexport const getSettings = async () => {\n return getItem(STORAGE_PREFIX + SETTINGS_STORAGE_KEY);\n};\n\n/**\n * Sets the settings in the storage.\n *\n * @param {any} data - The settings to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nexport const setSettings = async data => {\n return setItem(STORAGE_PREFIX + SETTINGS_STORAGE_KEY, data);\n};\n\n/**\n * Gets the history from the storage.\n *\n * @returns {Promise<[ error: any, value: any ]>} The history and an error if occurred.\n */\nexport const getHistory = async () => {\n return getItem(STORAGE_PREFIX + HISTORY_STORAGE_KEY);\n};\n\n/**\n * Sets the history in the storage.\n *\n * @param {any} data - The history to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nexport const setHistory = async data => {\n return setItem(STORAGE_PREFIX + HISTORY_STORAGE_KEY, data);\n};\n","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction promisifyRequest(request) {\n return new Promise(function (resolve, reject) {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = function () {\n return resolve(request.result);\n }; // @ts-ignore - file size hacks\n\n\n request.onabort = request.onerror = function () {\n return reject(request.error);\n };\n });\n}\n\nfunction createStore(dbName, storeName) {\n var request = indexedDB.open(dbName);\n\n request.onupgradeneeded = function () {\n return request.result.createObjectStore(storeName);\n };\n\n var dbp = promisifyRequest(request);\n return function (txMode, callback) {\n return dbp.then(function (db) {\n return callback(db.transaction(storeName, txMode).objectStore(storeName));\n });\n };\n}\n\nvar defaultGetStoreFunc;\n\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction get(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readonly', function (store) {\n return promisifyRequest(store.get(key));\n });\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction set(key, value) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction setMany(entries) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n entries.forEach(function (entry) {\n return store.put(entry[1], entry[0]);\n });\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction getMany(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readonly', function (store) {\n return Promise.all(keys.map(function (key) {\n return promisifyRequest(store.get(key));\n }));\n });\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction update(key, updater) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();\n return customStore('readwrite', function (store) {\n return (// Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise(function (resolve, reject) {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n })\n );\n });\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction del(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction delMany(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n keys.forEach(function (key) {\n return store.delete(key);\n });\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction clear() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\n\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction keys() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n\n var items = [];\n return eachCursor(store, function (cursor) {\n return items.push(cursor.key);\n }).then(function () {\n return items;\n });\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction values() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n\n var items = [];\n return eachCursor(store, function (cursor) {\n return items.push(cursor.value);\n }).then(function () {\n return items;\n });\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction entries() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([promisifyRequest(store.getAllKeys()), promisifyRequest(store.getAll())]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n keys = _ref2[0],\n values = _ref2[1];\n\n return keys.map(function (key, i) {\n return [key, values[i]];\n });\n });\n }\n\n var items = [];\n return customStore('readonly', function (store) {\n return eachCursor(store, function (cursor) {\n return items.push([cursor.key, cursor.value]);\n }).then(function () {\n return items;\n });\n });\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * 'n' milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {function} fn The function to be executed.\n * @param {Number} [wait=0] Time of delay in milliseconds. It is required if `immediate` is used.\n * @param {Boolean} [immediate=false] If true or any truthy value, triggers the function on the leading edge.\n * @throws {TypeError} If `fn` is not function.\n * @returns {function} A new debounced function.\n * @example\n *\n * const debouncedHandler = debounce(() => {\n * // Do your thing here...\n * }, 250);\n *\n * window.addEventListener('resize', debouncedHandler, false);\n */\nconst debounce = (fn, wait = 0, immediate = false) => {\n let timerId = null;\n\n if (typeof fn !== 'function') {\n throw new TypeError('Expected a function for first argument');\n }\n\n return (...args) => {\n clearTimeout(timerId);\n\n if (immediate && !timerId) {\n fn(...args);\n }\n\n timerId = setTimeout(() => {\n timerId = null;\n if (!immediate) {\n fn(...args);\n }\n }, wait);\n };\n};\n\nexport { debounce };\n","/**\n * Log to console only in development mode.\n *\n * @param {...any} args - Arguments to log\n */\nexport function log(...args) {\n process.env.NODE_ENV === 'development' && console.log(...args);\n}\n","/**\n * Check if the dialog element is supported.\n *\n * @returns {boolean} - Returns true if the dialog element is supported.\n */\nexport const isDialogElementSupported = () => {\n return typeof HTMLDialogElement === 'function';\n};\n","/**\n * Renders the supported formats.\n *\n * @param {Array} formats - Supported barcode formats\n */\nexport function renderSupportedFormats(formats) {\n if (!Array.isArray(formats) || formats.length === 0) {\n return;\n }\n\n const supportedFormatsEl = document.getElementById('supportedFormats');\n\n if (!supportedFormatsEl) {\n return;\n }\n\n supportedFormatsEl.textContent = `Supported formats: ${formats.join(', ')}`;\n}\n","import { getHistory, setHistory, getSettings } from '../services/storage.js';\n\n/**\n * Renders the history list. If there are no items in history, it will show a message.\n *\n * @param {Array} data - Hidsoty data as an array of strings\n */\nexport function renderHistoryList(data) {\n const historyList = document.getElementById('historyList');\n\n if (!historyList) {\n return;\n }\n\n const emptyHistoryBtn = document.getElementById('emptyHistoryBtn');\n\n historyList.replaceChildren();\n\n if (!Array.isArray(data) || data.length === 0) {\n historyList.innerHTML = '
  • There are no saved items in history.
  • ';\n emptyHistoryBtn.hidden = true;\n } else {\n emptyHistoryBtn.hidden = false;\n\n data.forEach((item, index) => {\n const li = document.createElement('li');\n li.setAttribute('data-value', item);\n\n let historyItem;\n\n try {\n new URL(item);\n historyItem = document.createElement('a');\n historyItem.href = item;\n historyItem.setAttribute('target', '_blank');\n historyItem.setAttribute('rel', 'noreferrer noopener');\n } catch {\n historyItem = document.createElement('span');\n }\n\n historyItem.textContent = item;\n historyItem.setAttribute('id', `historyItem-${index}`);\n\n const actionsEl = document.createElement('div');\n actionsEl.className = 'history-modal__actions';\n\n const copyBtn = document.createElement('custom-clipboard-copy');\n copyBtn.setAttribute('id', `copyHistoryItem-${index}`);\n copyBtn.setAttribute('aria-label', 'Copy to clipboard');\n copyBtn.setAttribute('aria-labelledby', `copyHistoryItem-${index} historyItem-${index}`);\n copyBtn.setAttribute('only-icon', '');\n copyBtn.setAttribute('value', item);\n actionsEl.appendChild(copyBtn);\n\n const removeBtn = document.createElement('button');\n removeBtn.type = 'button';\n removeBtn.className = 'history-modal__delete-action';\n removeBtn.setAttribute('data-action', 'delete');\n removeBtn.setAttribute('id', `removeHistoryItem-${index}`);\n removeBtn.setAttribute('aria-label', 'Remove from history');\n removeBtn.setAttribute('aria-labelledby', `removeHistoryItem-${index} historyItem-${index}`);\n removeBtn.innerHTML = /* html */ `\n \n \n \n `;\n actionsEl.appendChild(removeBtn);\n\n li.appendChild(historyItem);\n li.appendChild(actionsEl);\n historyList.appendChild(li);\n });\n }\n}\n\n/**\n * Adds an item to the history.\n * If the item is already in history, it will not be added.\n *\n * @param {string} item - Item to add to history\n */\nexport async function addToHistory(item) {\n const [, settings] = await getSettings();\n\n if (!item || !settings?.addToHistory) {\n return;\n }\n\n const [getHistoryError, history = []] = await getHistory();\n\n if (!getHistoryError && Array.isArray(history) && !history.find(h => h === item)) {\n const data = [...history, item];\n\n const [setHistoryError] = await setHistory(data);\n\n if (!setHistoryError) {\n renderHistoryList(data);\n }\n }\n}\n\n/**\n * Removes an item from the history.\n *\n * @param {string} item - Item to remove from history\n */\nexport async function removeFromHistory(item) {\n if (!item) {\n return;\n }\n\n const [getHistoryError, history = []] = await getHistory();\n\n if (!getHistoryError && Array.isArray(history)) {\n const data = history.filter(el => el !== item);\n const [setHistoryError] = await setHistory(data);\n\n if (!setHistoryError) {\n renderHistoryList(data);\n }\n }\n}\n\n/**\n * Removes all items from the history.\n */\nexport async function emptyHistory() {\n const [setHistoryError] = await setHistory([]);\n\n if (!setHistoryError) {\n renderHistoryList([]);\n }\n}\n","/**\n * Removes the scanned result from the element where it is shown.\n *\n * @param {HTMLElement} element - The element to remove the result from.\n */\nexport function hideResult(element) {\n if (!element) {\n return;\n }\n\n const scanResultEl = element.querySelector('scan-result');\n scanResultEl?.remove();\n}\n\n/**\n * Creates and shows the scanned result inside the given element.\n *\n * @param {HTMLElement} element - The element to show the result in.\n * @param {string} value - The value to create the result with.\n */\nexport async function showResult(element, value) {\n if (!element || !value) {\n return;\n }\n\n const oldScanResultEl = element.querySelector('scan-result');\n\n if (oldScanResultEl) {\n oldScanResultEl.setAttribute('value', value);\n } else {\n const newScanResultEl = document.createElement('scan-result');\n newScanResultEl.setAttribute('value', value);\n newScanResultEl.setAttribute('role', 'alert');\n newScanResultEl.setAttribute('aria-live', 'assertive');\n newScanResultEl.setAttribute('aria-atomic', 'true');\n element.appendChild(newScanResultEl);\n }\n}\n","import { getSettings } from '../services/storage.js';\nimport { beep } from '../utils/beep.js';\nimport { vibrate } from '../utils/vibrate.js';\n\n/**\n * Triggers the scan effects like beep and vibrate.\n *\n * @param {Object} options\n * @param {boolean} [options.success=true] - Whether to trigger the success or error effects.\n */\nexport async function triggerScanEffects(options = {}) {\n const { success = true } = options;\n const [, settings] = await getSettings();\n\n if (!settings) {\n return;\n }\n\n const beepConfig = success\n ? { duration: 200, frequency: 860, volume: 0.03, type: 'square' }\n : { duration: 300, frequency: 200, volume: 0.05, type: 'sawtooth' };\n\n settings.beep && beep(beepConfig);\n settings.vibrate && vibrate(success ? 100 : 200);\n}\n","/**\n * Beep sound using the `AudioContext` interface.\n *\n * @param {Object} options\n * @param {Number} options.duration - Duration in milliseconds\n * @param {Number} options.frequency - Frequency in Hz\n * @param {Number} options.volume - Volume\n * @param {String} options.type - Type of oscillator\n * @param {Function} options.onEnded - Callback function when the sound ends\n */\nexport const beep = (() => {\n const audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext)();\n\n if (!audioCtx) {\n return;\n }\n\n return options => {\n const { duration, frequency, volume, type, onEnded } = options;\n const oscillator = audioCtx.createOscillator();\n const gainNode = audioCtx.createGain();\n\n oscillator.connect(gainNode);\n gainNode.connect(audioCtx.destination);\n\n if (volume) {\n gainNode.gain.value = volume;\n }\n\n if (frequency) {\n oscillator.frequency.value = frequency;\n }\n\n if (type) {\n oscillator.type = type;\n }\n\n if (typeof onEnded === 'function') {\n oscillator.onended = onEnded;\n }\n\n oscillator.start(audioCtx.currentTime);\n oscillator.stop(audioCtx.currentTime + (duration || 500) / 1000);\n };\n})();\n","/**\n * Vibrate the device.\n * If the device does not support vibration, this function will fail silently.\n *\n * @param {Number} [duration=0] - Duration in milliseconds\n */\nexport async function vibrate(duration = 0) {\n if (typeof window.navigator.vibrate !== 'function') {\n return;\n }\n\n try {\n window.navigator.vibrate(duration);\n } catch {\n // Fail silently...\n }\n}\n","/**\n * Resizes the scan frame to match the video element's dimensions.\n *\n * @param {HTMLVideoElement} videoEl - Video element\n * @param {HTMLElement} scanFrameEl - Scan frame element\n */\nexport function resizeScanFrame(videoEl, scanFrameEl) {\n if (!videoEl || !scanFrameEl) {\n return;\n }\n\n const rect = videoEl.getBoundingClientRect();\n\n scanFrameEl.style.cssText = `width: ${rect.width}px; height: ${rect.height}px`;\n}\n","import { log } from '../utils/log.js';\n\n/**\n * BarcodeReader class to detect barcodes from images or videos.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector\n */\nclass BarcodeReader {\n static async polyfill() {\n if (!('BarcodeDetector' in window)) {\n try {\n await import('barcode-detector');\n log('Using BarcodeDetector polyfill.');\n } catch {\n throw new Error('BarcodeDetector API is not supported by your browser.');\n }\n } else {\n log('Using the native BarcodeDetector API.');\n }\n }\n\n /**\n * Get the supported barcode formats.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/getSupportedFormats\n * @returns {Promise>} - Supported barcode formats\n */\n static async getSupportedFormats() {\n return await window.BarcodeDetector.getSupportedFormats();\n }\n\n /**\n * Create a new BarcodeReader instance.\n *\n * @returns {Promise} - New BarcodeReader instance\n */\n static async create() {\n const formats = await window.BarcodeDetector.getSupportedFormats();\n return new BarcodeReader(formats);\n }\n\n /**\n * Initialize the BarcodeReader.\n *\n * @returns {Promise<{ barcodeReader: BarcodeReader, barcodeFormats: Array, barcodeReaderError: Error }>} - BarcodeReader instance, supported formats, and error\n */\n static async init() {\n try {\n await BarcodeReader.polyfill();\n const barcodeReader = await BarcodeReader.create();\n const barcodeFormats = await BarcodeReader.getSupportedFormats();\n return { barcodeReader, barcodeFormats, barcodeReaderError: null };\n } catch (error) {\n return {\n barcodeReader: null,\n barcodeFormats: [],\n barcodeReaderError: error\n };\n }\n }\n\n /**\n * Create a new BarcodeReader instance.\n *\n * @param {Array} formats - Supported barcode formats\n */\n constructor(formats) {\n this.barcodeReader = new window.BarcodeDetector({ formats });\n }\n\n /**\n * Detect barcodes from the provided source.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/detect\n * @param {HTMLImageElement|HTMLVideoElement|ImageBitmap} source - Image or video element or ImageBitmap\n * @returns {Promise} - Barcode detection result\n */\n async detect(source) {\n if (!this.barcodeReader) {\n throw new Error('BarcodeReader is not initialized.');\n }\n\n const results = await this.barcodeReader.detect(source);\n\n if (Array.isArray(results) && results.length > 0) {\n return results[0];\n } else {\n throw new Error('Could not detect barcode from provided source.');\n }\n }\n}\n\nexport { BarcodeReader };\n","import { getSettings } from '../services/storage.js';\n\n/**\n * Initialize the settings form with the saved settings.\n * If a setting is not found, it will be ignored.\n *\n * @param {HTMLFormElement} form - The settings form to initialize.\n */\nexport async function initializeSettingsForm(form) {\n const [, settings = {}] = await getSettings();\n\n Object.entries(settings).forEach(([key, value]) => {\n const settingInput = form.querySelector(`[name=\"${key}\"]`);\n\n if (!settingInput) {\n return;\n }\n\n settingInput.checked = value;\n });\n}\n","/**\n * Toggles the torch button status.\n * The torch button has two icons, one for on and one for off.\n * This function toggles the visibility of the icons based on the torch state and updates the button title.\n *\n * @param {HTMLButtonElement} buttonEl - The torch button element.\n * @param {boolean} isTorchOn - The torch state.\n */\nexport function toggleTorchButtonStatus(options = {}) {\n const defaults = {\n el: document.getElementById('torchButton'),\n isTorchOn: false\n };\n const { el, isTorchOn } = { ...defaults, ...options };\n const iconPaths = el.querySelectorAll('svg path');\n\n if (iconPaths.length !== 2) {\n return;\n }\n\n iconPaths[0].style.display = isTorchOn ? 'none' : 'block';\n iconPaths[1].style.display = isTorchOn ? 'block' : 'none';\n el.setAttribute('title', `Turn ${isTorchOn ? 'off' : 'on'} flash`);\n}\n","import { clamp } from '../utils/clamp.js';\n\nconst COMPONENT_NAME = 'video-capture';\n\nconst styles = /* css */ `\n :host { display: block; box-sizing: border-box; }\n :host *, :host *::before, :host *::after { box-sizing: inherit;}\n :host([hidden]), [hidden], ::slotted([hidden]) { display: none; }\n video { display: block; }\n #output:empty { display: none; }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n
    \n \n`;\n\nclass VideoCapture extends HTMLElement {\n #supportedConstraints = {};\n #stream = null;\n #videoElement = null;\n\n constructor() {\n super();\n\n this.#supportedConstraints = this.getSupportedConstraints();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['no-image', 'pan', 'tilt', 'zoom', 'torch'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) {\n return;\n }\n\n const trackCapabilities = this.getTrackCapabilities();\n\n if (name === 'zoom' && oldValue !== newValue && 'zoom' in this.#supportedConstraints) {\n const zoomInAllowedRange =\n 'zoom' in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max\n ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max\n : false;\n\n if (typeof this.zoom === 'number' && zoomInAllowedRange) {\n this.#applyConstraint('zoom', this.zoom);\n }\n }\n\n if (name === 'torch' && oldValue !== newValue && 'torch' in this.#supportedConstraints) {\n this.#applyConstraint('torch', this.torch);\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n async connectedCallback() {\n this.#upgradeProperty('autoPlay');\n this.#upgradeProperty('facingMode');\n this.#upgradeProperty('zoom');\n this.#upgradeProperty('torch');\n\n this.#videoElement = this.shadowRoot?.querySelector('video') || null;\n\n this.#videoElement?.addEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n\n if (!VideoCapture.isSupported()) {\n return this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: 'NotSupportedError',\n message: 'Not supported'\n }\n }\n })\n );\n }\n\n if (this.autoPlay) {\n this.startVideoStream();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.stopVideoStream();\n this.#videoElement?.removeEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n }\n\n get autoPlay() {\n return this.hasAttribute('auto-play');\n }\n\n set autoPlay(value) {\n this.toggleAttribute('auto-play', !!value);\n }\n\n get facingMode() {\n return this.getAttribute('facing-mode') || 'user';\n }\n\n set facingMode(value) {\n this.setAttribute('facing-mode', value);\n }\n\n get zoom() {\n return Number(this.getAttribute('zoom')) || 1;\n }\n\n set zoom(value) {\n this.setAttribute('zoom', value != null ? value.toString() : value);\n }\n\n get torch() {\n return this.hasAttribute('torch');\n }\n\n set torch(value) {\n this.toggleAttribute('torch', !!value);\n }\n\n get loading() {\n return this.hasAttribute('loading');\n }\n\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {Event} evt - The event object.\n */\n #onVideoLoadedMetaData = evt => {\n const video = evt.target;\n\n video\n .play()\n .then(() => {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: { video }\n })\n );\n })\n .catch(error => {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n })\n .finally(() => {\n this.removeAttribute('loading');\n });\n };\n\n /**\n * Applies a constraint to the video track.\n *\n * @param {string} constraint - The name of the constraint.\n * @param {any} value - The value of the constraint.\n */\n #applyConstraint(constraint, value) {\n if (!this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n const constraintValue =\n constraint === 'pan' || constraint === 'tilt' || constraint === 'zoom'\n ? clamp(\n Number(value),\n trackCapabilities[constraint]?.min || 1,\n trackCapabilities[constraint]?.max || 1\n )\n : value;\n\n if (constraint in trackSettings) {\n track\n .applyConstraints({\n advanced: [{ [constraint]: constraintValue }]\n })\n .catch(() => {\n // Fail silently...\n });\n }\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n\n /**\n * Starts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n * @returns Promise\n */\n async startVideoStream(videoInputId) {\n if (!VideoCapture.isSupported() || this.#stream) {\n return;\n }\n\n this.setAttribute('loading', '');\n\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || 'user'\n },\n pan: true,\n tilt: true,\n zoom: true,\n torch: this.torch\n },\n audio: false\n };\n\n if (typeof videoInputId === 'string' && videoInputId.trim().length > 0) {\n constraints.video.deviceId = { exact: videoInputId };\n }\n\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n\n if (this.#videoElement) {\n this.#videoElement.srcObject = this.#stream;\n }\n\n this.#applyConstraint('pan', this.pan);\n this.#applyConstraint('tilt', this.tilt);\n this.#applyConstraint('zoom', this.zoom);\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n } finally {\n this.removeAttribute('loading');\n }\n }\n\n /**\n * Restarts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n */\n restartVideoStream(videoInputId) {\n if (this.#stream && this.#videoElement) {\n this.stopVideoStream();\n }\n\n this.startVideoStream(videoInputId);\n }\n\n /**\n * Stops the video stream.\n */\n stopVideoStream() {\n if (!this.#videoElement || !this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */\n getSupportedConstraints() {\n if (!VideoCapture.isSupported()) {\n return {};\n }\n\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */\n getTrackCapabilities() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getCapabilities === 'function') {\n return track.getCapabilities() || {};\n }\n\n return {};\n }\n\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */\n getTrackSettings() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getSettings === 'function') {\n return track.getSettings() || {};\n }\n\n return {};\n }\n\n /**\n * Returns the available video input devices.\n *\n * @returns {Promise}\n */\n static async getVideoInputDevices() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {\n return [];\n }\n\n const devices = (await navigator.mediaDevices.enumerateDevices()) || [];\n return devices.filter(device => device.kind === 'videoinput' && !!device.deviceId);\n }\n\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */\n static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='video-capture'] - The name of the custom element.\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, VideoCapture);\n }\n }\n}\n\nexport { VideoCapture };\n","/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */\nexport const clamp = (value, lower, upper) => {\n if (Number.isNaN(lower)) {\n lower = 0;\n }\n\n if (Number.isNaN(upper)) {\n upper = 0;\n }\n\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n","import { ClipboardCopy } from '@georapbox/clipboard-copy-element/dist/clipboard-copy.js';\n\n/**\n * Extends the `ClipboardCopy` element to override the default `copy` and `success` slots,\n * in order to avoid repetition of the same markup throughout the application.\n * It also adds aditional properties and attributes, specific to the application.\n *\n * @class CustomClipboardCopy\n * @extends ClipboardCopy\n */\nclass CustomClipboardCopy extends ClipboardCopy {\n constructor() {\n super();\n\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n\n copySlot.innerHTML = /* html */ `\n \n \n \n \n Copy\n `;\n\n successSlot.innerHTML = /* html */ `\n \n \n \n \n \n Copied!\n `;\n }\n\n static get observedAttributes() {\n return [...super.observedAttributes, 'only-icon'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n\n if (name === 'only-icon' && oldValue !== newValue) {\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n\n const copyText = copySlot.querySelector('.text');\n const successText = successSlot.querySelector('.text');\n\n if (copyText) {\n copyText.hidden = this.onlyIcon;\n }\n\n if (successText) {\n successText.hidden = this.onlyIcon;\n }\n }\n }\n\n get onlyIcon() {\n return this.hasAttribute('only-icon');\n }\n\n set onlyIcon(value) {\n if (value) {\n this.setAttribute('only-icon', '');\n } else {\n this.removeAttribute('only-icon');\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.#upgradeProperty('onlyIcon');\n\n if (!this.hasAttribute('feedback-duration')) {\n this.setAttribute('feedback-duration', '1500');\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'custom-clipboard-copy') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, CustomClipboardCopy);\n }\n }\n}\n\nCustomClipboardCopy.defineCustomElement();\n","/*!\n * @georapbox/clipboard-copy-element\n * A custom element that implements the Clipboard API to copy text content from elements or input values to the clipboard.\n *\n * @version 3.0.2\n * @homepage https://github.com/georapbox/clipboard-copy-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar i=\"clipboard-copy\";var o=\"success\",n=\"error\",h=document.createElement(\"template\"),a=`\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;h.innerHTML=`\n \n \n`;var r=class d extends HTMLElement{#e=void 0;#t=null;#s=null;#i=null;#o=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(h.content.cloneNode(!0)),this.shadowRoot&&(this.#t=this.shadowRoot.querySelector(\"button\"),this.#s=this.shadowRoot.querySelector('slot[name=\"copy\"]'),this.#i=this.shadowRoot.querySelector('slot[name=\"success\"]'),this.#o=this.shadowRoot.querySelector('slot[name=\"error\"]'))}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,s,e){t===\"disabled\"&&s!==e&&this.#t&&(this.#t.disabled=this.disabled,this.#t.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#t.part.contains(\"button\")&&this.#t.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#n(\"value\"),this.#n(\"from\"),this.#n(\"disabled\"),this.#n(\"feedbackDuration\"),this.#t?.addEventListener(\"click\",this.#r)}disconnectedCallback(){this.#t?.removeEventListener(\"click\",this.#r),this.#a()}get value(){return this.getAttribute(\"value\")||\"\"}set value(t){this.setAttribute(\"value\",t!=null?t.toString():t)}get from(){return this.getAttribute(\"from\")||\"\"}set from(t){this.setAttribute(\"from\",t!=null?t.toString():t)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get feedbackDuration(){return Number(this.getAttribute(\"feedback-duration\"))||1e3}set feedbackDuration(t){this.setAttribute(\"feedback-duration\",t!=null?t.toString():t)}async#d(){if(!(!this.value&&!this.from))try{let t=\"\";if(this.value)t=this.value;else if(this.from){let s=\"getRootNode\"in Element.prototype?this.#t?.getRootNode({composed:!0}):this.#t?.ownerDocument;if(!s||!(s instanceof Document||s instanceof ShadowRoot))return;let e=s.querySelector(this.from);if(!e)return;e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?t=e.value:e instanceof HTMLAnchorElement&&e.hasAttribute(\"href\")?t=e.href:t=e.textContent||\"\"}await navigator.clipboard.writeText(t),this.#h(o),this.dispatchEvent(new CustomEvent(`${i}-success`,{bubbles:!0,composed:!0,detail:{value:t}}))}catch(t){this.#h(n),this.dispatchEvent(new CustomEvent(`${i}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}#r=t=>{t.preventDefault(),!(this.disabled||this.#e)&&this.#d()};#h(t){this.#s&&(this.#s.hidden=!0),this.#i&&(this.#i.hidden=t!==o),this.#o&&(this.#o.hidden=t!==n),this.#t?.part.remove(\"button--success\"),this.#t?.part.remove(\"button--error\"),this.#t?.part.add(`button--${t}`),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.#s&&(this.#s.hidden=!1),this.#i&&(this.#i.hidden=!0),this.#o&&(this.#o.hidden=!0),this.#t?.part.remove(`button--${t}`),this.#e=void 0},this.feedbackDuration)}#a(){this.#e&&clearTimeout(this.#e),this.#e=void 0,this.#s&&(this.#s.hidden=!1),this.#i&&(this.#i.hidden=!0),this.#o&&(this.#o.hidden=!0),this.#t?.part.remove(\"button--success\"),this.#t?.part.remove(\"button--error\")}#n(t){let s=this;if(Object.prototype.hasOwnProperty.call(s,t)){let e=s[t];delete s[t],s[t]=e}}static defineCustomElement(t=i){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,d)}};export{r as ClipboardCopy};\n//# sourceMappingURL=clipboard-copy.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst COMPONENT_NAME = 'clipboard-copy';\nconst DEFAULT_FEEDBACK_DURATION = 1000;\nconst SUCCESS_STATUS = 'success';\nconst ERROR_STATUS = 'error';\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element for copying text to the clipboard.\n * @documentation https://github.com/georapbox/clipboard-copy-element#readme\n *\n * @tagname clipboard-copy - This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {string} value - The value to be copied to clipboard.\n * @property {string} from - The CSS selector of the element to copy from.\n * @property {boolean} disabled - Whether the copy to clipboard button is disabled.\n * @property {number} feedbackDuration - The duration for displaying the success or error status.\n *\n * @attribute {string} value - Reflects the value property.\n * @attribute {string} from - Reflects the from property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} feedback-duration - Reflects the feedbackDuration property.\n *\n * @slot copy - The default slot for the copy button.\n * @slot success - The slot for the success status message.\n * @slot error - The slot for the error status message.\n *\n * @csspart button - The button element.\n * @csspart button--success - The button element when the copy operation is successful.\n * @csspart button--error - The button element when the copy operation fails.\n * @csspart button--disabled - The button element when the disabled attribute is set.\n *\n * @fires clipboard-copy-success - Dispatched when the copy operation is successful.\n * @fires clipboard-copy-error - Dispatched when the copy operation fails.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n */\nclass ClipboardCopy extends HTMLElement {\n /** @type {ReturnType | undefined} */\n #timeout = void 0;\n\n /** @type {Nullable} */\n #buttonEl = null;\n\n /** @type {Nullable} */\n #copySlot = null;\n\n /** @type {Nullable} */\n #successSlot = null;\n\n /** @type {Nullable} */\n #errorSlot = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#buttonEl = this.shadowRoot.querySelector('button');\n this.#copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n this.#successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n this.#errorSlot = this.shadowRoot.querySelector('slot[name=\"error\"]');\n }\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue) {\n if (this.#buttonEl) {\n this.#buttonEl.disabled = this.disabled;\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('value');\n this.#upgradeProperty('from');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('feedbackDuration');\n\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n\n // `disconnectedCallback` is also called when the element is moved to a different document,\n // via `Document: adoptNode()` method, therefore we reset the component to its initial state.\n this.#forceResetStatus();\n }\n\n /**\n * The value to be copied to clipboard.\n *\n * @type {string}\n * @attribute value - Reflects the value property.\n */\n get value() {\n return this.getAttribute('value') || '';\n }\n\n set value(value) {\n this.setAttribute('value', value != null ? value.toString() : value);\n }\n\n /**\n * The CSS selector of the element to copy from.\n *\n * @type {string}\n * @attribute from - Reflects the from property.\n */\n get from() {\n return this.getAttribute('from') || '';\n }\n\n set from(value) {\n this.setAttribute('from', value != null ? value.toString() : value);\n }\n\n /**\n * Whether the copy to clipboard button is disabled.\n *\n * @type {boolean}\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * The duration for displaying the success or error status.\n *\n * @type {number}\n * @attribute feedback-duration - Reflects the feedbackDuration property.\n */\n get feedbackDuration() {\n return Number(this.getAttribute('feedback-duration')) || DEFAULT_FEEDBACK_DURATION;\n }\n\n set feedbackDuration(value) {\n this.setAttribute('feedback-duration', value != null ? value.toString() : value);\n }\n\n /**\n * Copies the value to the clipboard and handles success or error states.\n */\n async #copy() {\n if (!this.value && !this.from) {\n return;\n }\n\n try {\n let copyValue = '';\n\n if (this.value) {\n copyValue = this.value;\n } else if (this.from) {\n const root =\n 'getRootNode' in Element.prototype\n ? this.#buttonEl?.getRootNode({ composed: true })\n : this.#buttonEl?.ownerDocument;\n\n if (!root || !(root instanceof Document || root instanceof ShadowRoot)) {\n return;\n }\n\n const element = root.querySelector(this.from);\n\n if (!element) {\n return;\n }\n\n if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {\n copyValue = element.value;\n } else if (element instanceof HTMLAnchorElement && element.hasAttribute('href')) {\n copyValue = element.href;\n } else {\n copyValue = element.textContent || '';\n }\n }\n\n await navigator.clipboard.writeText(copyValue);\n\n this.#showStatus(SUCCESS_STATUS);\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-success`, {\n bubbles: true,\n composed: true,\n detail: { value: copyValue }\n })\n );\n } catch (error) {\n this.#showStatus(ERROR_STATUS);\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n }\n\n /**\n * Handles the button click event.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled || this.#timeout) {\n return;\n }\n\n this.#copy();\n };\n\n /**\n * Displays the success or error status.\n *\n * @param {string} status - The status to display.\n */\n #showStatus(status) {\n if (this.#copySlot) {\n this.#copySlot.hidden = true;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = status !== SUCCESS_STATUS;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = status !== ERROR_STATUS;\n }\n\n this.#buttonEl?.part.remove('button--success');\n this.#buttonEl?.part.remove('button--error');\n this.#buttonEl?.part.add(`button--${status}`);\n\n this.#timeout && clearTimeout(this.#timeout);\n\n this.#timeout = setTimeout(() => {\n if (this.#copySlot) {\n this.#copySlot.hidden = false;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = true;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = true;\n }\n\n this.#buttonEl?.part.remove(`button--${status}`);\n\n this.#timeout = void 0;\n }, this.feedbackDuration);\n }\n\n /**\n * Resets the status to the initial state.\n * Clears the feedback timeout, hides the success or error slots and shows the copy slot.\n */\n #forceResetStatus() {\n this.#timeout && clearTimeout(this.#timeout);\n this.#timeout = void 0;\n\n if (this.#copySlot) {\n this.#copySlot.hidden = false;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = true;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = true;\n }\n\n this.#buttonEl?.part.remove('button--success');\n this.#buttonEl?.part.remove('button--error');\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'value' | 'from' | 'disabled' | 'feedbackDuration'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='clipboard-copy'] - The name of the custom element.\n * @example\n *\n * ClipboardCopy.defineCustomElement('my-clipboard-copy');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ClipboardCopy);\n }\n }\n}\n\nexport { ClipboardCopy };\n","import { isWebShareSupported } from '@georapbox/web-share-element/dist/is-web-share-supported.js';\nimport { getSettings } from '../services/storage.js';\nimport { NO_BARCODE_DETECTED } from '../constants.js';\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n .result {\n position: relative;\n width: 100%;\n border: 1px solid var(--focus);\n border-radius: 6px;\n margin: 1.5rem 0 0 0;\n padding: 1rem;\n background-color: var(--background-alt);\n text-align: center;\n }\n\n .result__item {\n word-wrap: break-word;\n word-break: break-word;\n }\n\n a.result__item {\n color: var(--links);\n text-decoration: none;\n }\n\n a.result__item:hover {\n text-decoration: underline;\n }\n\n .result__item--no-barcode {\n color: var(--error-color);\n }\n\n .result__actions {\n display: flex;\n align-items: center;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .result web-share button,\n .result custom-clipboard-copy::part(button) {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n margin: 0.75rem 0 0 0;\n padding: 0.25rem;\n background-color: transparent;\n border: 0;\n border-radius: var(--border-radius);\n color: inherit;\n line-height: 1;\n font-family: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n \n \n \n
    \n
    \n`;\n\nclass ScanResult extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n get value() {\n return this.getAttribute('value');\n }\n\n set value(value) {\n this.setAttribute('value', value);\n }\n\n static get observedAttributes() {\n return ['value'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'value' && oldValue !== newValue) {\n this.#handleValueChange(this.value);\n }\n }\n\n connectedCallback() {\n this.#upgradeProperty('value');\n\n if (!isWebShareSupported()) {\n const webShareEl = this.shadowRoot.querySelector('web-share');\n\n if (webShareEl) {\n webShareEl.hidden = true;\n }\n }\n }\n\n async #handleValueChange(value) {\n const baseEl = this.shadowRoot.querySelector('.result');\n const resultActionsEl = baseEl?.querySelector('.result__actions');\n const oldResultItem = baseEl?.querySelector('.result__item');\n let resultItem;\n\n if (oldResultItem) {\n oldResultItem.remove();\n }\n\n try {\n const [, settings] = await getSettings();\n\n new URL(value);\n resultItem = document.createElement('a');\n resultItem.href = value;\n window.requestAnimationFrame(() => resultItem.focus());\n\n if (!settings?.openWebPageSameTab) {\n resultItem.setAttribute('target', '_blank');\n resultItem.setAttribute('rel', 'noreferrer noopener');\n }\n\n if (settings?.openWebPage) {\n resultItem.click();\n }\n } catch {\n resultItem = document.createElement('span');\n }\n\n resultItem.className = 'result__item';\n resultItem.classList.toggle('result__item--no-barcode', value === NO_BARCODE_DETECTED);\n resultItem.textContent = value;\n\n baseEl?.insertBefore(resultItem, resultActionsEl);\n\n const isValidValue = value !== NO_BARCODE_DETECTED;\n const clipboarCopyEl = baseEl?.querySelector('custom-clipboard-copy');\n const webShareEl = baseEl?.querySelector('web-share');\n\n if (clipboarCopyEl && isValidValue) {\n clipboarCopyEl.setAttribute('value', value);\n clipboarCopyEl.hidden = false;\n } else {\n clipboarCopyEl.hidden = true;\n clipboarCopyEl.removeAttribute('value');\n }\n\n if (webShareEl && isWebShareSupported() && isValidValue) {\n webShareEl.setAttribute('share-text', value);\n webShareEl.hidden = false;\n } else {\n webShareEl.hidden = true;\n webShareEl.removeAttribute('share-text');\n }\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'scan-result') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ScanResult);\n }\n }\n}\n\nScanResult.defineCustomElement();\n","/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */\nfunction r(a){return a!==null&&typeof a==\"object\"?\"share\"in navigator&&\"canShare\"in navigator&&navigator.canShare(a):\"share\"in navigator}export{r as isWebShareSupported};\n//# sourceMappingURL=is-web-share-supported.js.map\n","// @ts-check\n\n/**\n * Check if Web Share API is supported by the platform.\n *\n * @param {import('./web-share').ShareData} [options]\n * @returns {boolean} Returns `true` if Web Share API is supported; otherwise `false`.\n */\nfunction isWebShareSupported(options) {\n if (options !== null && typeof options === 'object') {\n return 'share' in navigator && 'canShare' in navigator && navigator.canShare(options);\n }\n\n return 'share' in navigator;\n}\n\nexport { isWebShareSupported };\n"],"names":["$e92a13782f6c06ba$var$defaultGetStoreFunc","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","resolve","then","$2prpb","bundle","Promise","reject","concat","document","getElementsByTagName","some","script","src","preloadLink","createElement","href","rel","as","head","appendChild","async","type","onerror","e","error","TypeError","message","onload","remove","$1c132cac09cd18d9$var$cachedBundles","$1c132cac09cd18d9$var$cachedPreloads","$1c132cac09cd18d9$var$cachedPrefetches","loader","cache","$1c132cac09cd18d9$var$getCache","apply","arguments","catch","$c172d40c323f9126$var$h","a","t","i","Math","random","toString","substring","$c172d40c323f9126$var$b","Object","prototype","hasOwnProperty","$c172d40c323f9126$var$E","$c172d40c323f9126$var$C","$c172d40c323f9126$var$w","innerHTML","$c172d40c323f9126$export$6824c350c20eab3a","HTMLElement","constructor","shadowRoot","attachShadow","mode","content","cloneNode","observedAttributes","attributeChangedCallback","s","setAttribute","selected","disabled","closable","className","querySelector","addEventListener","removeEventListener","connectedCallback","disconnectedCallback","hasAttribute","toggleAttribute","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","detail","tabId","defineCustomElement","customElements","get","define","$c172d40c323f9126$var$L","$c172d40c323f9126$var$S","$c172d40c323f9126$var$T","$c172d40c323f9126$export$185adf5fa2c760b1","$c172d40c323f9126$var$n","TOP","BOTTOM","START","END","$c172d40c323f9126$var$l","LTR","RTL","$c172d40c323f9126$var$R","entries","map","$c172d40c323f9126$var$r","AUTO","MANUAL","$c172d40c323f9126$var$c","DOWN","LEFT","RIGHT","UP","HOME","ENTER","SPACE","$c172d40c323f9126$var$x","$c172d40c323f9126$var$A","$c172d40c323f9126$export$4ac05a649254e913","l","placement","getAttribute","noScrollControls","scrollDistance","abs","Number","$c172d40c323f9126$var$y","activation","noTabCycling","o","Array","from","querySelectorAll","n","g","p","forEach","d","f","m","ResizeObserver","requestAnimationFrame","v","target","scrollWidth","clientWidth","_","part","toggle","classList","h","c","unobserve","observe","disconnect","cancelAnimationFrame","CSS","supports","matches","getComputedStyle","direction","hidden","length","w","nextElementSibling","tagName","toLowerCase","console","T","b","y","find","A","findIndex","r","E","u","name","altKey","includes","key","focus","selectTab","preventDefault","closest","contains","scrollLeft","scrollTo","left","selectTabByIndex","selectTabById","scrollIntoView","inline","block","$4f74a8126e204146$var$h","$4f74a8126e204146$var$r","$4f74a8126e204146$export$30b344bef3e55b67","delegatesFocus","shareUrl","shareTitle","shareText","shareFiles","isArray","share","url","title","text","navigator","canShare","files","shareData","nodeName","assignedElements","flatten","$7aad62ebc3d6fae8$var$x","Map","$7aad62ebc3d6fae8$var$b","$7aad62ebc3d6fae8$var$y","lastIndexOf","split","pop","defineProperty","value","writable","configurable","enumerable","$7aad62ebc3d6fae8$var$g","path","webkitRelativePath","$7aad62ebc3d6fae8$var$m","readEntries","$7aad62ebc3d6fae8$var$w","push","$7aad62ebc3d6fae8$var$E","file","fullPath","$7aad62ebc3d6fae8$var$F","kind","getAsEntry","webkitGetAsEntry","shift","isFile","indexOf","isDirectory","createReader","$7aad62ebc3d6fae8$var$f","$7aad62ebc3d6fae8$var$l","dataTransfer","items","$7aad62ebc3d6fae8$var$n","$7aad62ebc3d6fae8$var$v","$7aad62ebc3d6fae8$var$z","$7aad62ebc3d6fae8$var$S","$7aad62ebc3d6fae8$export$6ccd1735166caad9","getElementById","accept","removeAttribute","multiple","autoFocus","maxFiles","floor","maxSize","isNaN","minSize","noStyle","Event","dropEffect","add","click","errors","$7aad62ebc3d6fae8$var$u","Set","trim","filter","Boolean","replace","charAt","test","size","acceptedFiles","rejectedFiles","defaultValue","openFileDialog","$81b28a4cd686838b$var$o","$81b28a4cd686838b$export$f0e45424cc896229","$4da30046ce6d9325$var$n","$4da30046ce6d9325$var$r","$4da30046ce6d9325$export$32589115725b904b","open","showModal","element","body","preserveOverflow","style","overflow","close","noHeader","noAnimations","noCloseButton","clearTimeout","staticBackdrop","fullscreen","closeLabel","textContent","setTimeout","defaultPrevented","currentTarget","hide","assignedNodes","cancelable","reason","show","$33dea9d9a6da4c9a$export$c263bd68c6f5ce7a","$33dea9d9a6da4c9a$export$63e7bed68b07a85c","$e92a13782f6c06ba$export$b327150396135fe7","request","oncomplete","onsuccess","result","onabort","$e92a13782f6c06ba$var$defaultGetStore","dbName","storeName","dbp","indexedDB","onupgradeneeded","createObjectStore","txMode","callback","db","transaction","objectStore","$c96efe8837e99c11$var$STORAGE_PREFIX","$c96efe8837e99c11$var$SETTINGS_STORAGE_KEY","$c96efe8837e99c11$var$HISTORY_STORAGE_KEY","$c96efe8837e99c11$var$getItem","customStore","undefined","store","$c96efe8837e99c11$var$setItem","data","put","$c96efe8837e99c11$export$4a647155031ece","$c96efe8837e99c11$export$dc86d17a64679bc7","$c96efe8837e99c11$export$f9582a3c130d9538","$c96efe8837e99c11$export$96fe1132eb44c325","$f7942db15ba0cc81$export$61fc7d43ac8f84b0","fn","wait","immediate","timerId","args","$4840d5fa714b09de$export$c694186e9d94f0","HTMLDialogElement","$2cce6ab38d28b4d0$export$fa9e3380e441c420","historyList","emptyHistoryBtn","replaceChildren","item","index","historyItem","li","URL","actionsEl","copyBtn","removeBtn","$2cce6ab38d28b4d0$export$7a6a9d84993ff4e","settings","addToHistory","getHistoryError","history","setHistoryError","$2cce6ab38d28b4d0$export$3a61248021dae916","el","$2cce6ab38d28b4d0$export$9f74b61e5d33cda2","$696a3a8b3e5710f1$export$97c08f0895810b94","oldScanResultEl","newScanResultEl","$19ecce1b28895d1c$export$d6c943e433460aae","audioCtx","AudioContext","webkitAudioContext","audioContext","options","duration","frequency","volume","onEnded","oscillator","createOscillator","gainNode","createGain","connect","destination","gain","onended","start","currentTime","stop","$08aca92dc2b3c75c$export$3ca8e905da0a0ca8","vibrate","$0460f8ef7b1421c2$export$9b466d13e2031a67","success","beep","$d335f5b5c097c74d$export$1404f0e91c73fec","videoEl","scanFrameEl","rect","getBoundingClientRect","cssText","width","height","$586e2c3c9ffe53e0$export$f21d9483ebeee00a","polyfill","getSupportedFormats","BarcodeDetector","create","barcodeReader","barcodeFormats","barcodeReaderError","formats","detect","source","results","$c8149428128c684b$export$9d22ef9ff8e481fe","form","settingInput","checked","$7c034485d4f152a1$export$d1bd0b12fe0d046","isTorchOn","iconPaths","display","$52c18c31ba376620$export$7d15b64cf5a3a4c4","lower","upper","min","max","$149eedd8690347fa$var$COMPONENT_NAME","$149eedd8690347fa$var$styles","$149eedd8690347fa$var$template","$149eedd8690347fa$export$682e9ed90a89bb4a","supportedConstraints","stream","videoElement","getSupportedConstraints","oldValue","newValue","isConnected","trackCapabilities","getTrackCapabilities","zoomInAllowedRange","zoom","applyConstraint","torch","upgradeProperty","onVideoLoadedMetaData","isSupported","autoPlay","startVideoStream","stopVideoStream","facingMode","loading","evt","video","play","finally","constraint","track","getVideoTracks","trackSettings","getTrackSettings","constraintValue","applyConstraints","advanced","prop","videoInputId","constraints","ideal","pan","tilt","audio","deviceId","exact","cameraResolution","x","mediaDevices","getUserMedia","srcObject","restartVideoStream","getCapabilities","getSettings","getVideoInputDevices","enumerateDevices","devices","device","elementName","$5e1cbbd957798f18$var$i","$5e1cbbd957798f18$var$o","$5e1cbbd957798f18$var$n","$5e1cbbd957798f18$var$h","$5e1cbbd957798f18$var$a","$5e1cbbd957798f18$export$ea3b71af1761ff40","feedbackDuration","Element","getRootNode","ownerDocument","Document","ShadowRoot","HTMLInputElement","HTMLTextAreaElement","HTMLAnchorElement","clipboard","writeText","$9d6e877208021767$var$CustomClipboardCopy","copySlot","successSlot","copyText","successText","onlyIcon","$94933cc6427541bd$export$c37129e465f64ef0","$1952518f8eeecdff$var$styles","$1952518f8eeecdff$var$template","$1952518f8eeecdff$var$ScanResult","handleValueChange","webShareEl","resultItem","baseEl","resultActionsEl","oldResultItem","openWebPageSameTab","openWebPage","insertBefore","isValidValue","clipboarCopyEl","instance","rafId","hasExperimentalFlag","URLSearchParams","location","search","has","tabGroupEl","videoCaptureEl","cameraPanel","filePanel","scanInstructionsEl","scanBtn","dropzoneEl","resizeObserverEl","facingModeButton","torchButton","globalActionsEl","historyBtn","historyDialog","settingsBtn","settingsDialog","settingsForm","forms","cameraSelect","shouldScan","alertEl","handleVideoCapturePlay","once","errorMessage","videoCaptureVideoEl","scan","barcode","barcodeValue","rawValue","zoomLevelEl","zoomControls","minZoom","maxZoom","currentZoom","zoomInBtn","zoomOutBtn","videoInputDevices","option","label","join","supportedFormatsEl","scanResultEl","handleFileSelect","image","Image","reader","FileReader","alt","preview","imageWrapper","fileNameWrapper","prepend","readAsDataURL","checkboxes","dataset","confirm","videoDeviceId","selectedTab","visibilityState","handleDocumentEscapeKey","cameraTabSelected","scanBtnVisible","settingsDialogOpen","historyDialogOpen","uid","prefix","suffix","prefixString","suffixString","randomString","tabCounter","styles","template","ATab","_ATab","closeButton","#handleCloseButtonClick","#upgradeProperty","panelCounter","ATabPanel","_ATabPanel","DEFAULT_SCROLL_DISTANCE","PLACEMENT","DIR","validPlacements","ACTIVATION","KEYCODE","ATabGroup","_ATabGroup","#resizeObserver","#rafId","#hasTabSlotChangedOnce","#syncNav","tabSlot","panelSlot","tabsContainer","navContainer","scrollButtons","#handleSlotChange","#handleTabClick","#handleKeyDown","#handleScrollButtonClick","#handleTabClose","targetElement","isElementScrollable","#hideEmptyTabGroup","#stopResizeObserver","#startResizeObserver","scrollElement","#getDirectionality","#allTabs","#linkPanels","tabs","tab","panel","#allPanels","#panelForTab","panelId","#firstTab","#lastTab","#prevTab","newIdx","#nextTab","#reset","panels","#setSelectedTabOnSlotChange","#setSelectedTab","orientation","directionality","scrollButton","isStartButton","isLTR","sign","offsetLeft","oldTab","WebShare","_WebShare","#buttonSlot","#buttonEl","#files","#getButton","#handleClick","isValidFile","acceptedTypeSpecifiers","acceptedMimeTypesList","fileMimeType","baseMimeType","validType","COMMON_MIME_TYPES","FILES_TO_IGNORE","toFileWithMimeType","extension","toFileWithPath","fileWithMimeType","readEntriesPromise","directoryReader","readAllDirectoryEntries","getFileFromFileEntry","fileEntry","getFilesFromDataTransferItemList","dataTransferItemList","queue","entry","getFilesFromFileList","fileList","getFilesFromEvent","COMPONENT_NAME","TOO_MANY_FILES","FILE_TOO_LARGE","FILE_TOO_SMALL","INVALID_MIME_TYPE","FilesDropzone","_FilesDropzone","#fileInput","#dropzoneEl","#handleFileInputChange","#handleDragEnter","#handleDragOver","#handleDragLeave","#handleDrop","#handleKeyUp","num","#handleFilesSelect","filesLength","fileHasValidType","fileExceedsMaxSize","fileIsSmallerThanMinSize","ResizeObserverElement","_ResizeObserverElement","#slotEl","#observedElements","#stopObserver","#startObserver","ModalElement","_ModalElement","#dialogEl","#footerSlotEl","#closeSlotEl","#pulseAnimationTimeout","headerEl","closeBtnEl","#updateCloseLabel","#handleDialogClick","#handleDialogClose","#handleDialogCancel","#handleFooterSlotChange","#handleCloseSlotChange","closeButtonEl","#applyPulseEffectOnDialog","requestCloseEvent","#createRequestCloseEvent","footerEl","footerSlotNodes","hasFooterSlotNodes","SUCCESS_STATUS","ERROR_STATUS","ClipboardCopy","_ClipboardCopy","#timeout","#copySlot","#successSlot","#errorSlot","#forceResetStatus","#copy","copyValue","root","#showStatus","status","isWebShareSupported"],"version":3,"file":"index.65ac40f6.js.map"} \ No newline at end of file diff --git a/index.65ac40f6.js b/index.a88fc2f6.js similarity index 95% rename from index.65ac40f6.js rename to index.a88fc2f6.js index 02a5e8c..2a5da58 100644 --- a/index.65ac40f6.js +++ b/index.a88fc2f6.js @@ -787,5 +787,5 @@ -`;class tz extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}).appendChild(tT.content.cloneNode(!0))}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}static get observedAttributes(){return["value"]}attributeChangedCallback(t,e,o){"value"===t&&e!==o&&this.#R(this.value)}connectedCallback(){if(this.#L("value"),!tC()){let t=this.shadowRoot.querySelector("web-share");t&&(t.hidden=!0)}}async #R(t){let e;let o=this.shadowRoot.querySelector(".result"),i=o?.querySelector(".result__actions"),r=o?.querySelector(".result__item");r&&r.remove();try{let[,o]=await Y();new URL(t),(e=document.createElement("a")).href=t,window.requestAnimationFrame(()=>e.focus()),o?.openWebPageSameTab||(e.setAttribute("target","_blank"),e.setAttribute("rel","noreferrer noopener")),o?.openWebPage&&e.click()}catch{e=document.createElement("span")}e.className="result__item",e.classList.toggle("result__item--no-barcode",t===F),e.textContent=t,o?.insertBefore(e,i);let s=t!==F,a=o?.querySelector("custom-clipboard-copy"),n=o?.querySelector("web-share");a&&s?(a.setAttribute("value",t),a.hidden=!1):(a.hidden=!0,a.removeAttribute("value")),n&&tC()&&s?(n.setAttribute("share-text",t),n.hidden=!1):(n.hidden=!0,n.removeAttribute("share-text"))}#L(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t="scan-result"){"undefined"==typeof window||window.customElements.get(t)||window.customElements.define(t,tz)}}tz.defineCustomElement(),async function(){let t;let e=new URLSearchParams(window.location.search).has("experimental"),o=document.querySelector("a-tab-group"),i=document.querySelector("video-capture"),r=document.getElementById("cameraPanel"),s=document.getElementById("filePanel"),a=document.getElementById("scanInstructions"),n=document.getElementById("scanBtn"),l=document.getElementById("dropzone"),d=document.querySelector("resize-observer"),c=document.getElementById("scanFrame"),h=document.getElementById("facingModeButton"),u=document.getElementById("torchButton"),m=document.getElementById("globalActions"),p=document.getElementById("historyBtn"),b=document.getElementById("historyDialog"),g=document.getElementById("settingsBtn"),f=document.getElementById("settingsDialog"),v=document.forms["settings-form"],y=document.getElementById("cameraSelect"),w=!0;tt()&&(m.hidden=!1,b.hidden=!1,f.hidden=!1);let{barcodeReader:E,barcodeFormats:A,barcodeReaderError:x}=await tc.init();if(x){let t=document.getElementById("barcodeReaderError");w=!1,m.hidden=!0,o.hidden=!0,t.hidden=!1,t.textContent=x?.message;return}i.addEventListener("video-capture:video-play",S,{once:!0}),i.addEventListener("video-capture:error",function(t){let e=t.detail.error;if("NotFoundError"===e.name)return;let o="NotAllowedError"===e.name?"Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.":e.message;r.innerHTML=``},{once:!0}),tf.defineCustomElement();let k=i?.shadowRoot?.querySelector("video");async function C(){a.hidden=!1;try{let e=await E.detect(k),o=e?.rawValue??"";if(!o)throw Error(F);window.cancelAnimationFrame(t),ts(r,o),to(o),a.hidden=!0,n.hidden=!1,c.hidden=!0,tl();return}catch{}w&&(t=window.requestAnimationFrame(()=>C()))}async function S(t){c.hidden=!1,td(t.detail.video,c),C();let o=t.target.getTrackSettings(),r=t.target.getTrackCapabilities(),s=document.getElementById("zoomLevel");if("facingMode"in o&&(h.hidden=!1),r?.torch&&(u.hidden=!1,i.hasAttribute("torch")&&tu({el:u,isTorchOn:!0})),o?.zoom&&r?.zoom){let t=document.getElementById("zoomControls"),e=r?.zoom?.min||0,a=r?.zoom?.max||10,n=o?.zoom||1;t.hidden=!1,s.textContent=n,t.addEventListener("click",t=>{let o=t.target.closest('[data-action="zoom-in"]'),r=t.target.closest('[data-action="zoom-out"]');o&&ne&&(n-=.5),s.textContent=n,i.zoom=n})}if(e){let t=await tf.getVideoInputDevices();t.forEach((t,e)=>{let o=document.createElement("option");o.value=t.deviceId,o.textContent=t.label||`Camera ${e+1}`,y.appendChild(o)}),y.hidden=!1,t.length}}l.accept=H.join(","),th(v),function(t){if(!Array.isArray(t)||0===t.length)return;let e=document.getElementById("supportedFormats");e&&(e.textContent=`Supported formats: ${t.join(", ")}`)}(A),te((await X())[1]||[]),n.addEventListener("click",function(){n.hidden=!0,c.hidden=!1,function(t){if(!t)return;let e=t.querySelector("scan-result");e?.remove()}(r),C()}),o.addEventListener("a-tab-show",Q(function(t){let e=t.detail.tabId,o=document.querySelector("video-capture");if("cameraTab"===e){if(w=!0,!o)return;o.loading||r.querySelector("scan-result")||C(),"function"==typeof o.startVideoStream&&o.startVideoStream()}else"fileTab"===e&&(w=!1,null!=o&&"function"==typeof o.stopVideoStream&&o.stopVideoStream())},250)),l.addEventListener("files-dropzone-drop",function(t){!function(t){if(!t)return;let e=new Image,o=new FileReader;o.onload=o=>{let i=o.target.result;e.onload=async()=>{try{let t=await E.detect(e),o=t?.rawValue??"";if(!o)throw Error(F);ts(s,o),to(o),tl()}catch(t){ts(s,F),tl({success:!1})}},e.src=i,e.alt="Image preview",l.replaceChildren();let r=document.createElement("div");r.className="dropzone-preview",r.setAttribute("aria-hidden","true");let a=document.createElement("div");a.className="dropzone-preview__image-wrapper";let n=document.createElement("div");n.className="dropzone-preview__file-name",n.textContent=t.name,a.appendChild(e),r.appendChild(a),r.appendChild(n),l.prepend(r)},o.readAsDataURL(t)}(t.detail.acceptedFiles[0])}),d.addEventListener("resize-observer:resize",function(){td(i.shadowRoot.querySelector("video"),c)}),g.addEventListener("click",function(){f.open=!0}),v.addEventListener("change",function(t){let e={};t.currentTarget.querySelectorAll('input[type="checkbox"]').forEach(t=>e[t.name]=t.checked),K(e)}),p.addEventListener("click",function(){b.open=!0}),b.addEventListener("click",function(t){let e=t.target;if(e.closest('[data-action="delete"]')){let t=e.closest("li").dataset.value;if(window.confirm(`Delete history item ${t}?`)){ti(t);return}}if(e.closest("#emptyHistoryBtn")&&window.confirm("Empty history? This action cannot be undone.")){tr();return}}),h.addEventListener("click",function(){let t="user"===i.facingMode?"environment":"user";i.facingMode=t,"function"==typeof i.restartVideoStream&&i.restartVideoStream(y?.value||void 0)}),u.addEventListener("click",function(t){i.torch=!i.torch,tu({el:t.currentTarget,isTorchOn:i.hasAttribute("torch")})}),e&&y.addEventListener("change",function(t){let e=t.target.value||void 0;"function"==typeof i.restartVideoStream&&i.restartVideoStream(e)}),document.addEventListener("visibilitychange",function(){if("cameraTab"===o.querySelector("[selected]").getAttribute("id")){if("hidden"===document.visibilityState)w=!1,null!=i&&"function"==typeof i.stopVideoStream&&i.stopVideoStream();else{w=!0;let t=document.querySelector("video-capture");if(!t)return;t.loading||r.querySelector("scan-result")||C(),"function"==typeof t.startVideoStream&&t.startVideoStream()}}}),document.addEventListener("keydown",function(t){"Escape"===t.key&&function(){let t=o.querySelector("#cameraTab").hasAttribute("selected"),e=!n.hidden,i=f.hasAttribute("open"),r=b.hasAttribute("open");e&&t&&!(i||r)&&n.click()}()})}()}(); -//# sourceMappingURL=index.65ac40f6.js.map +`;class tz extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}).appendChild(tT.content.cloneNode(!0))}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}static get observedAttributes(){return["value"]}attributeChangedCallback(t,e,o){"value"===t&&e!==o&&this.#R(this.value)}connectedCallback(){if(this.#L("value"),!tC()){let t=this.shadowRoot.querySelector("web-share");t&&(t.hidden=!0)}}async #R(t){let e;let o=this.shadowRoot.querySelector(".result"),i=o?.querySelector(".result__actions"),r=o?.querySelector(".result__item");r&&r.remove();try{let[,o]=await Y();new URL(t),(e=document.createElement("a")).href=t,window.requestAnimationFrame(()=>e.focus()),o?.openWebPageSameTab||(e.setAttribute("target","_blank"),e.setAttribute("rel","noreferrer noopener")),o?.openWebPage&&e.click()}catch{e=document.createElement("span")}e.className="result__item",e.classList.toggle("result__item--no-barcode",t===F),e.textContent=t,o?.insertBefore(e,i);let s=t!==F,a=o?.querySelector("custom-clipboard-copy"),n=o?.querySelector("web-share");a&&s?(a.setAttribute("value",t),a.hidden=!1):(a.hidden=!0,a.removeAttribute("value")),n&&tC()&&s?(n.setAttribute("share-text",t),n.hidden=!1):(n.hidden=!0,n.removeAttribute("share-text"))}#L(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t="scan-result"){"undefined"==typeof window||window.customElements.get(t)||window.customElements.define(t,tz)}}tz.defineCustomElement(),async function(){let t;let e=new URLSearchParams(window.location.search).has("experimental"),o=document.querySelector("a-tab-group"),i=document.querySelector("video-capture"),r=document.getElementById("cameraPanel"),s=document.getElementById("filePanel"),a=document.getElementById("scanInstructions"),n=document.getElementById("scanBtn"),l=document.getElementById("dropzone"),d=document.querySelector("resize-observer"),c=document.getElementById("scanFrame"),h=document.getElementById("facingModeButton"),u=document.getElementById("torchButton"),m=document.getElementById("globalActions"),p=document.getElementById("historyBtn"),b=document.getElementById("historyDialog"),g=document.getElementById("settingsBtn"),f=document.getElementById("settingsDialog"),v=document.forms["settings-form"],y=document.getElementById("cameraSelect"),w=!0;tt()&&(m.hidden=!1,b.hidden=!1,f.hidden=!1);let{barcodeReader:E,barcodeFormats:A,barcodeReaderError:x}=await tc.init();if(x){let t=document.getElementById("barcodeReaderError");w=!1,m.hidden=!0,o.hidden=!0,t.hidden=!1,t.textContent=x?.message;return}i.addEventListener("video-capture:video-play",S,{once:!0}),i.addEventListener("video-capture:error",function(t){let e=t.detail.error;if("NotFoundError"===e.name)return;let o="NotAllowedError"===e.name?"Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.":e.message;r.innerHTML=``},{once:!0}),tf.defineCustomElement();let k=i?.shadowRoot?.querySelector("video");async function C(){a.hidden=!1;try{let e=await E.detect(k),o=e?.rawValue??"";if(!o)throw Error(F);window.cancelAnimationFrame(t),ts(r,o),to(o),a.hidden=!0,n.hidden=!1,c.hidden=!0,tl();return}catch{}w&&(t=window.requestAnimationFrame(()=>C()))}async function S(t){c.hidden=!1,td(t.detail.video,c),C();let o=t.target.getTrackSettings(),r=t.target.getTrackCapabilities(),s=document.getElementById("zoomLevel");if("facingMode"in o&&(h.hidden=!1),r?.torch&&(u.hidden=!1,i.hasAttribute("torch")&&tu({el:u,isTorchOn:!0})),o?.zoom&&r?.zoom){let t=document.getElementById("zoomControls"),e=r?.zoom?.min||0,a=r?.zoom?.max||10,n=o?.zoom||1;t.hidden=!1,s.textContent=n,t.addEventListener("click",t=>{let o=t.target.closest('[data-action="zoom-in"]'),r=t.target.closest('[data-action="zoom-out"]');o&&ne&&(n-=.5),s.textContent=n,i.zoom=n})}if(e){let t=await tf.getVideoInputDevices();t.forEach((t,e)=>{let o=document.createElement("option");o.value=t.deviceId,o.textContent=t.label||`Camera ${e+1}`,y.appendChild(o)}),t.length>1&&(y.hidden=!1)}}l.accept=H.join(","),th(v),function(t){if(!Array.isArray(t)||0===t.length)return;let e=document.getElementById("supportedFormats");e&&(e.textContent=`Supported formats: ${t.join(", ")}`)}(A),te((await X())[1]||[]),n.addEventListener("click",function(){n.hidden=!0,c.hidden=!1,function(t){if(!t)return;let e=t.querySelector("scan-result");e?.remove()}(r),C()}),o.addEventListener("a-tab-show",Q(function(t){let e=t.detail.tabId,o=document.querySelector("video-capture");if("cameraTab"===e){if(w=!0,!o)return;o.loading||r.querySelector("scan-result")||C(),"function"==typeof o.startVideoStream&&o.startVideoStream()}else"fileTab"===e&&(w=!1,null!=o&&"function"==typeof o.stopVideoStream&&o.stopVideoStream())},250)),l.addEventListener("files-dropzone-drop",function(t){!function(t){if(!t)return;let e=new Image,o=new FileReader;o.onload=o=>{let i=o.target.result;e.onload=async()=>{try{let t=await E.detect(e),o=t?.rawValue??"";if(!o)throw Error(F);ts(s,o),to(o),tl()}catch(t){ts(s,F),tl({success:!1})}},e.src=i,e.alt="Image preview",l.replaceChildren();let r=document.createElement("div");r.className="dropzone-preview",r.setAttribute("aria-hidden","true");let a=document.createElement("div");a.className="dropzone-preview__image-wrapper";let n=document.createElement("div");n.className="dropzone-preview__file-name",n.textContent=t.name,a.appendChild(e),r.appendChild(a),r.appendChild(n),l.prepend(r)},o.readAsDataURL(t)}(t.detail.acceptedFiles[0])}),d.addEventListener("resize-observer:resize",function(){td(i.shadowRoot.querySelector("video"),c)}),g.addEventListener("click",function(){f.open=!0}),v.addEventListener("change",function(t){let e={};t.currentTarget.querySelectorAll('input[type="checkbox"]').forEach(t=>e[t.name]=t.checked),K(e)}),p.addEventListener("click",function(){b.open=!0}),b.addEventListener("click",function(t){let e=t.target;if(e.closest('[data-action="delete"]')){let t=e.closest("li").dataset.value;if(window.confirm(`Delete history item ${t}?`)){ti(t);return}}if(e.closest("#emptyHistoryBtn")&&window.confirm("Empty history? This action cannot be undone.")){tr();return}}),h.addEventListener("click",function(){let t="user"===i.facingMode?"environment":"user";i.facingMode=t,"function"==typeof i.restartVideoStream&&i.restartVideoStream(y?.value||void 0)}),u.addEventListener("click",function(t){i.torch=!i.torch,tu({el:t.currentTarget,isTorchOn:i.hasAttribute("torch")})}),e&&y.addEventListener("change",function(t){let e=t.target.value||void 0;"function"==typeof i.restartVideoStream&&i.restartVideoStream(e)}),document.addEventListener("visibilitychange",function(){if("cameraTab"===o.querySelector("[selected]").getAttribute("id")){if("hidden"===document.visibilityState)w=!1,null!=i&&"function"==typeof i.stopVideoStream&&i.stopVideoStream();else{w=!0;let t=document.querySelector("video-capture");if(!t)return;t.loading||r.querySelector("scan-result")||C(),"function"==typeof t.startVideoStream&&t.startVideoStream()}}}),document.addEventListener("keydown",function(t){"Escape"===t.key&&function(){let t=o.querySelector("#cameraTab").hasAttribute("selected"),e=!n.hidden,i=f.hasAttribute("open"),r=b.hasAttribute("open");e&&t&&!(i||r)&&n.click()}()})}()}(); +//# sourceMappingURL=index.a88fc2f6.js.map diff --git a/index.a88fc2f6.js.map b/index.a88fc2f6.js.map new file mode 100644 index 0000000..8d3df4c --- /dev/null +++ b/index.a88fc2f6.js.map @@ -0,0 +1 @@ +{"mappings":"C,A,W,I2ByCI,E,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,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AAG,EACT,AAnBJ,WACE,IAAM,EAAoB,EAAW,aAAa,CAAC,cAAc,YAAY,CAAC,YACxE,EAAiB,CAAC,EAAQ,MAAM,CAChC,EAAqB,EAAe,YAAY,CAAC,QACjD,EAAoB,EAAc,YAAY,CAAC,QAGhD,GAAmB,IAFF,CAAA,GAAsB,CAA5C,GAMA,EAAQ,KAAK,EACf,GASA,EAeF,G","sources":["","node_modules/@parcel/runtime-js/lib/runtime-48ad16d961f6463a.js","node_modules/@parcel/runtime-js/lib/helpers/browser/js-loader.js","node_modules/@parcel/runtime-js/lib/helpers/cacheLoader.js","src/js/index.js","node_modules/@georapbox/a-tab-group/dist/a-tab-group.js","node_modules/@georapbox/a-tab-group/src/utils/uid.js","node_modules/@georapbox/a-tab-group/src/utils/upgrade-property.js","node_modules/@georapbox/a-tab-group/src/a-tab.js","node_modules/@georapbox/a-tab-group/src/a-tab-panel.js","node_modules/@georapbox/a-tab-group/src/a-tab-group.js","node_modules/@georapbox/web-share-element/dist/web-share-defined.js","node_modules/@georapbox/web-share-element/src/web-share.js","node_modules/@georapbox/web-share-element/src/web-share-defined.js","node_modules/@georapbox/files-dropzone-element/dist/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/src/utils/is-valid-file.js","node_modules/@georapbox/files-dropzone-element/src/utils/files-selector.js","node_modules/@georapbox/files-dropzone-element/src/files-dropzone.js","node_modules/@georapbox/files-dropzone-element/src/files-dropzone-defined.js","node_modules/@georapbox/resize-observer-element/dist/resize-observer-defined.js","node_modules/@georapbox/resize-observer-element/src/resize-observer.js","node_modules/@georapbox/resize-observer-element/src/resize-observer-defined.js","node_modules/@georapbox/modal-element/dist/modal-element-defined.js","node_modules/@georapbox/modal-element/src/modal-element.js","node_modules/@georapbox/modal-element/src/modal-element-defined.js","src/js/constants.js","src/js/services/storage.js","node_modules/idb-keyval/dist/compat.js","src/js/utils/debounce.js","src/js/utils/log.js","src/js/utils/isDialogElementSupported.js","src/js/helpers/renderSupportedFormats.js","src/js/helpers/history.js","src/js/helpers/results.js","src/js/helpers/triggerScanEffects.js","src/js/utils/beep.js","src/js/utils/vibrate.js","src/js/helpers/resizeScanFrame.js","src/js/helpers/BarcodeReader.js","src/js/helpers/initializeSettingsForm.js","src/js/helpers/toggleTorchButtonStatus.js","src/js/components/video-capture.js","src/js/utils/clamp.js","src/js/components/clipboard-copy.js","node_modules/@georapbox/clipboard-copy-element/dist/clipboard-copy.js","node_modules/@georapbox/clipboard-copy-element/src/clipboard-copy.js","src/js/components/scan-result.js","node_modules/@georapbox/web-share-element/dist/is-web-share-supported.js","node_modules/@georapbox/web-share-element/src/is-web-share-supported.js"],"sourcesContent":["(function () {\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea202\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea202\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"bkcP3\", function(module, exports) {\n\n\nmodule.exports = (parcelRequire(\"4WKyX\"))((parcelRequire(\"iE7OH\")).resolve(\"iqysf\")).then(()=>parcelRequire(\"dZsGG\"));\n\n});\nparcelRegister(\"4WKyX\", function(module, exports) {\n\"use strict\";\n\nvar $2prpb = parcelRequire(\"2prpb\");\nmodule.exports = $2prpb(function(bundle) {\n return new Promise(function(resolve, reject) {\n // Don't insert the same script twice (e.g. if it was already in the HTML)\n var existingScripts = document.getElementsByTagName(\"script\");\n if ([].concat(existingScripts).some(function isCurrentBundle(script) {\n return script.src === bundle;\n })) {\n resolve();\n return;\n }\n var preloadLink = document.createElement(\"link\");\n preloadLink.href = bundle;\n preloadLink.rel = \"preload\";\n preloadLink.as = \"script\";\n document.head.appendChild(preloadLink);\n var script = document.createElement(\"script\");\n script.async = true;\n script.type = \"text/javascript\";\n script.src = bundle;\n script.onerror = function(e) {\n var error = new TypeError(\"Failed to fetch dynamically imported module: \".concat(bundle, \". Error: \").concat(e.message));\n script.onerror = script.onload = null;\n script.remove();\n reject(error);\n };\n script.onload = function() {\n script.onerror = script.onload = null;\n resolve();\n };\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n });\n});\n\n});\nparcelRegister(\"2prpb\", function(module, exports) {\n\"use strict\";\nvar $1c132cac09cd18d9$var$cachedBundles = {};\nvar $1c132cac09cd18d9$var$cachedPreloads = {};\nvar $1c132cac09cd18d9$var$cachedPrefetches = {};\nfunction $1c132cac09cd18d9$var$getCache(type) {\n switch(type){\n case \"preload\":\n return $1c132cac09cd18d9$var$cachedPreloads;\n case \"prefetch\":\n return $1c132cac09cd18d9$var$cachedPrefetches;\n default:\n return $1c132cac09cd18d9$var$cachedBundles;\n }\n}\nmodule.exports = function(loader, type) {\n return function(bundle) {\n var cache = $1c132cac09cd18d9$var$getCache(type);\n if (cache[bundle]) return cache[bundle];\n return cache[bundle] = loader.apply(null, arguments).catch(function(e) {\n delete cache[bundle];\n throw e;\n });\n };\n};\n\n});\n\n\n\n/*!\n * @georapbox/a-tab-group\n * A custom element to create a group of tabs and tab panels.\n *\n * @version 2.4.1\n * @homepage https://github.com/georapbox/a-tab-group#readme\n * @author George Raptis \n * @license MIT\n */ var $c172d40c323f9126$var$h = (a = \"\", t = \"\")=>{\n let e = typeof a == \"string\" && a !== \"\" ? a + \"-\" : \"\", s = typeof t == \"string\" && t !== \"\" ? \"-\" + t : \"\", i = Math.random().toString(36).substring(2, 8);\n return `${e}${i}${s}`;\n};\nvar $c172d40c323f9126$var$b = (a, t)=>{\n if (Object.prototype.hasOwnProperty.call(t, a)) {\n let e = t[a];\n delete t[a], t[a] = e;\n }\n};\nvar $c172d40c323f9126$var$E = 0, $c172d40c323f9126$var$C = `\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`, $c172d40c323f9126$var$w = document.createElement(\"template\");\n$c172d40c323f9126$var$w.innerHTML = `\n \n\n
    \n \n
    \n`;\nvar $c172d40c323f9126$export$6824c350c20eab3a = class a extends HTMLElement {\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($c172d40c323f9126$var$w.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"selected\",\n \"disabled\",\n \"closable\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n if (t === \"selected\" && e !== s && (this.setAttribute(\"aria-selected\", this.selected.toString()), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\")), t === \"disabled\" && e !== s && (this.setAttribute(\"aria-disabled\", this.disabled.toString()), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\")), t === \"closable\" && e !== s) {\n if (this.closable) {\n let i = document.createElement(\"span\");\n i.className = \"tab__close\", i.setAttribute(\"part\", \"close-tab\"), i.innerHTML = '', this.shadowRoot?.querySelector(\".tab\")?.appendChild(i), i.addEventListener(\"click\", this.#e);\n } else {\n let i = this.shadowRoot?.querySelector(\".tab__close\");\n i?.removeEventListener(\"click\", this.#e), i?.remove();\n }\n }\n }\n connectedCallback() {\n this.#s(\"selected\"), this.#s(\"disabled\"), this.#s(\"closable\"), this.id || (this.id = $c172d40c323f9126$var$h(\"tab\", (++$c172d40c323f9126$var$E).toString())), this.setAttribute(\"slot\", \"tab\"), this.setAttribute(\"role\", \"tab\"), this.setAttribute(\"aria-selected\", \"false\"), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\");\n }\n disconnectedCallback() {\n this.shadowRoot?.querySelector(\".tab__close\")?.removeEventListener(\"click\", this.#e);\n }\n get selected() {\n return this.hasAttribute(\"selected\");\n }\n set selected(t) {\n this.toggleAttribute(\"selected\", !!t);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get closable() {\n return this.hasAttribute(\"closable\");\n }\n set closable(t) {\n this.toggleAttribute(\"closable\", !!t);\n }\n #e = (t)=>{\n t.stopPropagation(), this.dispatchEvent(new CustomEvent(\"a-tab-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: this.id\n }\n }));\n };\n #s(t) {\n return $c172d40c323f9126$var$b(t, this);\n }\n static defineCustomElement(t = \"a-tab\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$c172d40c323f9126$export$6824c350c20eab3a.defineCustomElement();\nvar $c172d40c323f9126$var$L = 0, $c172d40c323f9126$var$S = `\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`, $c172d40c323f9126$var$T = document.createElement(\"template\");\n$c172d40c323f9126$var$T.innerHTML = `\n \n\n
    \n \n
    \n`;\nvar $c172d40c323f9126$export$185adf5fa2c760b1 = class a extends HTMLElement {\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($c172d40c323f9126$var$T.content.cloneNode(!0));\n }\n connectedCallback() {\n this.setAttribute(\"slot\", \"panel\"), this.setAttribute(\"role\", \"tabpanel\"), this.setAttribute(\"hidden\", \"\"), this.id || (this.id = $c172d40c323f9126$var$h(\"panel\", (++$c172d40c323f9126$var$L).toString()));\n }\n static defineCustomElement(t = \"a-tab-panel\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$c172d40c323f9126$export$185adf5fa2c760b1.defineCustomElement();\nvar $c172d40c323f9126$var$y = 200, $c172d40c323f9126$var$n = {\n TOP: \"top\",\n BOTTOM: \"bottom\",\n START: \"start\",\n END: \"end\"\n}, $c172d40c323f9126$var$l = {\n LTR: \"ltr\",\n RTL: \"rtl\"\n}, $c172d40c323f9126$var$R = Object.entries($c172d40c323f9126$var$n).map(([, a])=>a), $c172d40c323f9126$var$r = {\n AUTO: \"auto\",\n MANUAL: \"manual\"\n}, $c172d40c323f9126$var$c = {\n DOWN: \"ArrowDown\",\n LEFT: \"ArrowLeft\",\n RIGHT: \"ArrowRight\",\n UP: \"ArrowUp\",\n HOME: \"Home\",\n END: \"End\",\n ENTER: \"Enter\",\n SPACE: \" \"\n}, $c172d40c323f9126$var$x = `\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${$c172d40c323f9126$var$l.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${$c172d40c323f9126$var$l.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${$c172d40c323f9126$var$l.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${$c172d40c323f9126$var$l.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${$c172d40c323f9126$var$n.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${$c172d40c323f9126$var$n.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${$c172d40c323f9126$var$n.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${$c172d40c323f9126$var$n.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${$c172d40c323f9126$var$n.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`, $c172d40c323f9126$var$A = document.createElement(\"template\");\n$c172d40c323f9126$var$A.innerHTML = `\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;\nvar $c172d40c323f9126$export$4ac05a649254e913 = class a extends HTMLElement {\n #e = null;\n #s = null;\n #l = !1;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($c172d40c323f9126$var$A.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"placement\",\n \"no-scroll-controls\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n t === \"placement\" && e !== s && this.#i(), t === \"no-scroll-controls\" && e !== s && this.#i();\n }\n get placement() {\n return this.getAttribute(\"placement\") || $c172d40c323f9126$var$n.TOP;\n }\n set placement(t) {\n t != null && this.setAttribute(\"placement\", t);\n }\n get noScrollControls() {\n return this.hasAttribute(\"no-scroll-controls\");\n }\n set noScrollControls(t) {\n this.toggleAttribute(\"no-scroll-controls\", !!t);\n }\n get scrollDistance() {\n let t = Number(this.getAttribute(\"scroll-distance\"));\n return Math.abs(t) || $c172d40c323f9126$var$y;\n }\n set scrollDistance(t) {\n this.setAttribute(\"scroll-distance\", Math.abs(t).toString() || $c172d40c323f9126$var$y.toString());\n }\n get activation() {\n return this.getAttribute(\"activation\") || $c172d40c323f9126$var$r.AUTO;\n }\n set activation(t) {\n this.setAttribute(\"activation\", t || $c172d40c323f9126$var$r.AUTO);\n }\n get noTabCycling() {\n return this.hasAttribute(\"no-tab-cycling\");\n }\n set noTabCycling(t) {\n this.toggleAttribute(\"no-tab-cycling\", !!t);\n }\n connectedCallback() {\n this.#o(\"placement\"), this.#o(\"noScrollControls\"), this.#o(\"scrollDistance\"), this.#o(\"activation\"), this.#o(\"noTabCycling\");\n let t = this.shadowRoot?.querySelector(\"slot[name=tab]\"), e = this.shadowRoot?.querySelector(\"slot[name=panel]\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\"), i = this.shadowRoot?.querySelector(\".tab-group__nav\"), o = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n t?.addEventListener(\"slotchange\", this.#n), e?.addEventListener(\"slotchange\", this.#n), s?.addEventListener(\"click\", this.#g), s?.addEventListener(\"keydown\", this.#p), o.forEach((d)=>d.addEventListener(\"click\", this.#f)), this.addEventListener(\"a-tab-close\", this.#m), \"ResizeObserver\" in window && (this.#e = new ResizeObserver((d)=>{\n this.#s = window.requestAnimationFrame(()=>{\n let v = d?.[0]?.target, g = v?.scrollWidth > v?.clientWidth;\n o.forEach((_)=>_.toggleAttribute(\"hidden\", !g)), i?.part.toggle(\"nav--has-scroll-controls\", g), i?.classList.toggle(\"tab-group__nav--has-scroll-controls\", g);\n });\n })), this.#h(), this.#i();\n }\n disconnectedCallback() {\n let t = this.shadowRoot?.querySelector(\"slot[name=tab]\"), e = this.shadowRoot?.querySelector(\"slot[name=panel]\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\"), i = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n t?.removeEventListener(\"slotchange\", this.#n), e?.removeEventListener(\"slotchange\", this.#n), s?.removeEventListener(\"click\", this.#g), s?.removeEventListener(\"keydown\", this.#p), i.forEach((o)=>o.removeEventListener(\"click\", this.#f)), this.removeEventListener(\"a-tab-close\", this.#m), this.#c();\n }\n #v() {\n if (!this.#e) return;\n let t = this.shadowRoot?.querySelector(\".tab-group__tabs\");\n t && (this.#e.unobserve(t), this.#e.observe(t));\n }\n #c() {\n this.#e && (this.#e.disconnect(), this.#s !== null && (window.cancelAnimationFrame(this.#s), this.#s = null));\n }\n #d() {\n return window.CSS.supports(\"selector(:dir(ltr))\") ? this.matches(\":dir(ltr)\") ? $c172d40c323f9126$var$l.LTR : $c172d40c323f9126$var$l.RTL : window.getComputedStyle(this).direction || $c172d40c323f9126$var$l.LTR;\n }\n #h() {\n this.hidden = this.#t().length === 0;\n }\n #w() {\n let t = this.#t();\n this.#h(), t.forEach((e)=>{\n let s = e.nextElementSibling;\n if (!s || s.tagName.toLowerCase() !== \"a-tab-panel\") return console.error(`Tab #${e.id} is not a sibling of a `);\n e.setAttribute(\"aria-controls\", s.id), s.setAttribute(\"aria-labelledby\", e.id);\n });\n }\n #T() {\n return Array.from(this.querySelectorAll(\"a-tab-panel\"));\n }\n #t() {\n return Array.from(this.querySelectorAll(\"a-tab\"));\n }\n #b(t) {\n let e = t.getAttribute(\"aria-controls\");\n return this.querySelector(`#${e}`);\n }\n #y() {\n return this.#t().find((e)=>!e.disabled) || null;\n }\n #A() {\n let t = this.#t();\n for(let e = t.length - 1; e >= 0; e--)if (!t[e].disabled) return t[e];\n return null;\n }\n #a() {\n let t = this.#t(), e = this.activation === $c172d40c323f9126$var$r.MANUAL ? t.findIndex((s)=>s.matches(\":focus\")) - 1 : t.findIndex((s)=>s.selected) - 1;\n for(; t[(e + t.length) % t.length].disabled;)e--;\n return this.noTabCycling && e < 0 ? null : t[(e + t.length) % t.length];\n }\n #r() {\n let t = this.#t(), e = this.activation === $c172d40c323f9126$var$r.MANUAL ? t.findIndex((s)=>s.matches(\":focus\")) + 1 : t.findIndex((s)=>s.selected) + 1;\n for(; t[e % t.length].disabled;)e++;\n return this.noTabCycling && e >= t.length ? null : t[e % t.length];\n }\n #_() {\n let t = this.#t(), e = this.#T();\n t.forEach((s)=>s.selected = !1), e.forEach((s)=>s.hidden = !0);\n }\n #i() {\n let t = this.shadowRoot?.querySelector(\".tab-group__nav\"), e = this.shadowRoot?.querySelector(\".tab-group__tabs\"), s = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n this.noScrollControls || this.placement === $c172d40c323f9126$var$n.START || this.placement === $c172d40c323f9126$var$n.END ? (this.#c(), s.forEach((i)=>i.hidden = !0), t?.part.remove(\"nav--has-scroll-controls\"), t?.classList.remove(\"tab-group__nav--has-scroll-controls\"), e?.setAttribute(\"aria-orientation\", \"vertical\")) : (this.#v(), s.forEach((i)=>i.hidden = !1), e?.setAttribute(\"aria-orientation\", \"horizontal\"));\n }\n #E() {\n let t = this.#t(), e = t.find((s)=>s.selected && !s.disabled) || t.find((s)=>!s.disabled);\n e && (this.#l && !e.selected && this.dispatchEvent(new CustomEvent(\"a-tab-show\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n })), this.#u(e));\n }\n #u(t) {\n this.#_(), t && (t.selected = !0);\n let e = this.#b(t);\n e && (e.hidden = !1);\n }\n #n = (t)=>{\n this.#w(), this.#i(), this.#E(), t.target.name === \"tab\" && (this.#l = !0);\n };\n #p = (t)=>{\n if (t.target.tagName.toLowerCase() !== \"a-tab\" || t.altKey) return;\n let e = $c172d40c323f9126$var$R.includes(this.placement || \"\") ? this.placement : $c172d40c323f9126$var$n.TOP, s = [\n $c172d40c323f9126$var$n.TOP,\n $c172d40c323f9126$var$n.BOTTOM\n ].includes(e || \"\") ? \"horizontal\" : \"vertical\", i = this.#d(), o = null;\n switch(t.key){\n case $c172d40c323f9126$var$c.LEFT:\n s === \"horizontal\" && (o = i === $c172d40c323f9126$var$l.LTR ? this.#a() : this.#r(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $c172d40c323f9126$var$c.RIGHT:\n s === \"horizontal\" && (o = i === $c172d40c323f9126$var$l.LTR ? this.#r() : this.#a(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $c172d40c323f9126$var$c.UP:\n s === \"vertical\" && (o = this.#a(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $c172d40c323f9126$var$c.DOWN:\n s === \"vertical\" && (o = this.#r(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $c172d40c323f9126$var$c.HOME:\n o = this.#y(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o));\n break;\n case $c172d40c323f9126$var$c.END:\n o = this.#A(), o && (this.activation === $c172d40c323f9126$var$r.MANUAL ? o.focus() : this.selectTab(o));\n break;\n case $c172d40c323f9126$var$c.ENTER:\n case $c172d40c323f9126$var$c.SPACE:\n o = t.target, o && this.selectTab(o);\n break;\n default:\n return;\n }\n t.preventDefault();\n };\n #g = (t)=>{\n let e = t.target.closest(\"a-tab\");\n e && this.selectTab(e);\n };\n #f = (t)=>{\n let e = t.target.closest(\".tab-group__scroll-button\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\");\n if (!e || !s) return;\n let i = e.classList.contains(\"tab-group__scroll-button--start\"), o = this.#d() === $c172d40c323f9126$var$l.LTR, d = i ? o ? -1 : 1 : o ? 1 : -1, m = s.scrollLeft;\n s.scrollTo({\n left: m + d * this.scrollDistance\n });\n };\n #m = (t)=>{\n let e = t.target, s = this.#b(e);\n e && (e.remove(), e.selected && this.dispatchEvent(new CustomEvent(\"a-tab-hide\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n }))), s && s.tagName.toLowerCase() === \"a-tab-panel\" && s.remove();\n };\n #o(t) {\n return $c172d40c323f9126$var$b(t, this);\n }\n selectTabByIndex(t) {\n let s = this.#t()[t];\n s && this.selectTab(s);\n }\n selectTabById(t) {\n let s = this.#t().find((i)=>i.id === t);\n s && this.selectTab(s);\n }\n selectTab(t) {\n let e = this.#t().find((s)=>s.selected);\n !t || t.disabled || t.selected || t.tagName.toLowerCase() !== \"a-tab\" || (this.#u(t), window.requestAnimationFrame(()=>{\n t.scrollIntoView({\n inline: \"nearest\",\n block: \"nearest\"\n }), t.focus();\n }), e && this.dispatchEvent(new CustomEvent(\"a-tab-hide\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n })), this.dispatchEvent(new CustomEvent(\"a-tab-show\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: t.id\n }\n })));\n }\n static defineCustomElement(t = \"a-tab-group\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$c172d40c323f9126$export$4ac05a649254e913.defineCustomElement();\n\n\n/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */ var $4f74a8126e204146$var$h = `\n :host {\n display: inline-block;\n }\n`, $4f74a8126e204146$var$r = document.createElement(\"template\");\n$4f74a8126e204146$var$r.innerHTML = `\n \n \n`;\nvar $4f74a8126e204146$export$30b344bef3e55b67 = class a extends HTMLElement {\n #e;\n #t;\n #r = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($4f74a8126e204146$var$r.content.cloneNode(!0)), this.#e = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null, this.#t = this.#h();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, e, i) {\n t === \"disabled\" && e !== i && this.#t && (this.#t.toggleAttribute(\"disabled\", this.disabled), this.#t.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#t.part && this.#t.part.contains(\"button\") && this.#t.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#s(\"shareUrl\"), this.#s(\"shareTitle\"), this.#s(\"shareText\"), this.#s(\"shareFiles\"), this.#s(\"disabled\"), this.#e?.addEventListener(\"slotchange\", this.#a), this.#t?.addEventListener(\"click\", this.#i);\n }\n disconnectedCallback() {\n this.#e?.removeEventListener(\"slotchange\", this.#a), this.#t?.removeEventListener(\"click\", this.#i);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(t) {\n this.setAttribute(\"share-url\", t);\n }\n get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(t) {\n this.setAttribute(\"share-title\", t);\n }\n get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(t) {\n this.setAttribute(\"share-text\", t);\n }\n get shareFiles() {\n return this.#r;\n }\n set shareFiles(t) {\n Array.isArray(t) && t.length > 0 && (this.#r = t);\n }\n async share() {\n if (!this.disabled) try {\n let t = {};\n this.shareUrl && (t.url = this.shareUrl), this.shareTitle && (t.title = this.shareTitle), this.shareText && (t.text = this.shareText), Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n }) && (t.files = this.shareFiles), await navigator.share(t), this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: !0,\n composed: !0,\n detail: {\n shareData: t\n }\n }));\n } catch (t) {\n if (t instanceof Error && t.name === \"AbortError\") {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #i = (t)=>{\n t.preventDefault(), !this.disabled && this.share();\n };\n #a = (t)=>{\n t.target && t.target.name === \"button\" && (this.#t?.removeEventListener(\"click\", this.#i), this.#t = this.#h(), this.#t && (this.#t.addEventListener(\"click\", this.#i), this.#t.nodeName !== \"BUTTON\" && !this.#t.hasAttribute(\"role\") && this.#t.setAttribute(\"role\", \"button\")));\n };\n #h() {\n return this.#e && this.#e.assignedElements({\n flatten: !0\n }).find((t)=>t.nodeName === \"BUTTON\" || t.getAttribute(\"slot\") === \"button\") || null;\n }\n #s(t) {\n let e = this;\n if (Object.prototype.hasOwnProperty.call(e, t)) {\n let i = e[t];\n delete e[t], e[t] = i;\n }\n }\n static defineCustomElement(t = \"web-share\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$4f74a8126e204146$export$30b344bef3e55b67.defineCustomElement();\n\n\n/*!\n * @georapbox/files-dropzone-element\n * A custom element that creates a drag and drop zone for files\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/files-dropzone-element#readme\n * @author George Raptis \n * @license MIT\n */ function $7aad62ebc3d6fae8$var$u(o, e = \"\") {\n if (!e) return !0;\n let t = [\n ...new Set(e.split(\",\").map((r)=>r.trim()).filter(Boolean))\n ], i = o.type, s = i.replace(/\\/.*$/, \"\");\n for (let r of t)if (r.charAt(0) === \".\") {\n if (o.name.toLowerCase().indexOf(r.toLowerCase(), o.name.length - r.length) !== -1) return !0;\n } else if (/\\/\\*$/.test(r)) {\n if (s === r.replace(/\\/.*$/, \"\")) return !0;\n } else if (i === r) return !0;\n return !1;\n}\nvar $7aad62ebc3d6fae8$var$x = new Map([\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]), $7aad62ebc3d6fae8$var$b = [\n \".DS_Store\",\n \"Thumbs.db\"\n], $7aad62ebc3d6fae8$var$y = (o)=>{\n let { name: e } = o;\n if (e && e.lastIndexOf(\".\") !== -1 && !o.type) {\n let i = (e.split(\".\").pop() || \"\").toLowerCase(), s = $7aad62ebc3d6fae8$var$x.get(i);\n s && Object.defineProperty(o, \"type\", {\n value: s,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return o;\n}, $7aad62ebc3d6fae8$var$g = (o, e)=>{\n let t = $7aad62ebc3d6fae8$var$y(o);\n if (typeof t.path != \"string\") {\n let { webkitRelativePath: i } = o;\n Object.defineProperty(t, \"path\", {\n value: typeof e == \"string\" ? e : i || o.name,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return t;\n}, $7aad62ebc3d6fae8$var$m = async (o)=>await new Promise((e, t)=>{\n o.readEntries(e, t);\n }), $7aad62ebc3d6fae8$var$w = async (o)=>{\n let e = [], t = await $7aad62ebc3d6fae8$var$m(o);\n for(; t.length > 0;)e.push(...t), t = await $7aad62ebc3d6fae8$var$m(o);\n return e;\n}, $7aad62ebc3d6fae8$var$E = (o)=>new Promise((e, t)=>{\n o.file((i)=>e($7aad62ebc3d6fae8$var$g(i, o.fullPath)), t);\n }), $7aad62ebc3d6fae8$var$F = async (o)=>{\n let e = [], t = [];\n for (let i of o){\n if (i.kind !== \"file\") continue;\n let s = i.getAsEntry ? i.getAsEntry() : i.webkitGetAsEntry();\n t.push(s);\n }\n for(; t.length > 0;){\n let i = t.shift();\n if (i) {\n if (i.isFile) {\n let s = await $7aad62ebc3d6fae8$var$E(i);\n $7aad62ebc3d6fae8$var$b.indexOf(s.name) === -1 && e.push(s);\n } else i.isDirectory && t.push(...await $7aad62ebc3d6fae8$var$w(i.createReader()));\n } else continue;\n }\n return e;\n}, $7aad62ebc3d6fae8$var$f = async (o)=>{\n let e = [];\n for (let t of o)$7aad62ebc3d6fae8$var$b.indexOf(t.name) === -1 && e.push($7aad62ebc3d6fae8$var$g(t));\n return e;\n}, $7aad62ebc3d6fae8$var$l = async (o)=>o.dataTransfer ? o.dataTransfer.items ? await $7aad62ebc3d6fae8$var$F(o.dataTransfer.items) : await $7aad62ebc3d6fae8$var$f(o.dataTransfer.files) : await $7aad62ebc3d6fae8$var$f(o.target.files);\nvar $7aad62ebc3d6fae8$var$n = \"files-dropzone\", $7aad62ebc3d6fae8$var$v = \"TOO_MANY_FILES\", $7aad62ebc3d6fae8$var$L = \"FILE_TOO_LARGE\", $7aad62ebc3d6fae8$var$k = \"FILE_TOO_SMALL\", $7aad62ebc3d6fae8$var$A = \"INVALID_MIME_TYPE\", $7aad62ebc3d6fae8$var$z = document.createElement(\"template\"), $7aad62ebc3d6fae8$var$S = `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$7aad62ebc3d6fae8$var$z.innerHTML = `\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;\nvar $7aad62ebc3d6fae8$export$6ccd1735166caad9 = class o extends HTMLElement {\n #t = null;\n #e = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($7aad62ebc3d6fae8$var$z.content.cloneNode(!0)), this.shadowRoot && (this.#t = this.shadowRoot.getElementById(\"file-input\"), this.#e = this.shadowRoot.getElementById(\"dropzone\"));\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n e === \"accept\" && t !== i && this.#t && (this.#t.accept = this.accept), e === \"disabled\" && t !== i && this.#t && (this.#t.disabled = this.disabled, this.disabled ? (this.#e?.removeAttribute(\"tabindex\"), this.#e?.setAttribute(\"aria-disabled\", \"true\")) : (this.#e?.setAttribute(\"tabindex\", \"0\"), this.#e?.setAttribute(\"aria-disabled\", \"false\"))), e === \"multiple\" && t !== i && this.#t && (this.#t.multiple = this.multiple);\n }\n connectedCallback() {\n this.#o(\"accept\"), this.#o(\"disabled\"), this.#o(\"maxFiles\"), this.#o(\"maxSize\"), this.#o(\"minSize\"), this.#o(\"multiple\"), this.#o(\"autoFocus\"), this.#o(\"noStyle\"), this.#t?.addEventListener(\"change\", this.#i), this.#e?.addEventListener(\"dragenter\", this.#r), this.#e?.addEventListener(\"dragover\", this.#s), this.#e?.addEventListener(\"dragleave\", this.#n), this.#e?.addEventListener(\"drop\", this.#a), this.#e?.addEventListener(\"click\", this.#d), this.#e?.addEventListener(\"keyup\", this.#l), this.autoFocus && this.#e?.focus();\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"change\", this.#i), this.#e?.removeEventListener(\"dragenter\", this.#r), this.#e?.removeEventListener(\"dragover\", this.#s), this.#e?.removeEventListener(\"dragleave\", this.#n), this.#e?.removeEventListener(\"drop\", this.#a), this.#e?.removeEventListener(\"click\", this.#d), this.#e?.removeEventListener(\"keyup\", this.#l);\n }\n get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(e) {\n this.setAttribute(\"accept\", e != null ? e.toString() : e);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n get maxFiles() {\n let e = Number(this.getAttribute(\"max-files\")) || 0;\n return e <= 0 ? 1 / 0 : Math.floor(Math.abs(e));\n }\n set maxFiles(e) {\n this.setAttribute(\"max-files\", e != null ? e.toString() : e);\n }\n get maxSize() {\n let e = this.getAttribute(\"max-size\");\n if (e === null) return 1 / 0;\n let t = Number(e);\n return Number.isNaN(t) ? 1 / 0 : t;\n }\n set maxSize(e) {\n this.setAttribute(\"max-size\", e != null ? e.toString() : e);\n }\n get minSize() {\n let e = this.getAttribute(\"min-size\");\n if (e === null) return 0;\n let t = Number(e);\n return Number.isNaN(t) ? 0 : t;\n }\n set minSize(e) {\n this.setAttribute(\"min-size\", e != null ? e.toString() : e);\n }\n get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(e) {\n this.toggleAttribute(\"multiple\", !!e);\n }\n get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(e) {\n this.toggleAttribute(\"auto-focus\", !!e);\n }\n get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(e) {\n this.toggleAttribute(\"no-style\", !!e);\n }\n #i = async (e)=>{\n try {\n this.#c(await $7aad62ebc3d6fae8$var$l(e));\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n };\n #r = ()=>{\n this.disabled || this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$n}-dragenter`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #s = (e)=>{\n if (e.preventDefault(), this.disabled) {\n e.dataTransfer.dropEffect = \"none\";\n return;\n }\n e.dataTransfer.dropEffect = \"copy\", this.#e && (this.#e.classList.add(\"dropzone--dragover\"), this.#e.part.add(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$n}-dragover`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #n = ()=>{\n this.disabled || (this.#e && (this.#e.classList.remove(\"dropzone--dragover\"), this.#e.part.remove(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$n}-dragleave`, {\n bubbles: !0,\n composed: !0\n })));\n };\n #a = async (e)=>{\n if (!this.disabled) {\n e.preventDefault(), this.#e && (this.#e.classList.remove(\"dropzone--dragover\"), this.#e.part.remove(\"dropzone--dragover\"));\n try {\n this.#c(await $7aad62ebc3d6fae8$var$l(e));\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n };\n #d = ()=>{\n this.disabled || this.#t?.click();\n };\n #l = (e)=>{\n this.disabled || (e.key === \" \" || e.key === \"Enter\") && this.#t?.click();\n };\n #c(e) {\n if (!Array.isArray(e) || !e.length) return;\n let t = [], i = [], s = e.length;\n if (!this.multiple && s > 1) for (let r of e)i.push({\n file: r,\n errors: [\n {\n code: $7aad62ebc3d6fae8$var$v,\n message: \"Too many files selected. Only 1 file is allowed.\"\n }\n ]\n });\n else if (this.multiple && s > this.maxFiles) for (let r of e)i.push({\n file: r,\n errors: [\n {\n code: $7aad62ebc3d6fae8$var$v,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else for (let r of e){\n let c = $7aad62ebc3d6fae8$var$u(r, this.accept), p = r.size > this.maxSize, h = r.size < this.minSize;\n if (c && !p && !h) t.push(r);\n else {\n let a = [];\n c || a.push({\n code: $7aad62ebc3d6fae8$var$A,\n message: `File type \"${r.type}\" is not accepted.`\n }), p && a.push({\n code: $7aad62ebc3d6fae8$var$L,\n message: `File size ${r.size} exceeds the maximum size of ${this.maxSize}.`\n }), h && a.push({\n code: $7aad62ebc3d6fae8$var$k,\n message: `File size ${r.size} is smaller than the minimum size of ${this.minSize}.`\n }), i.push({\n file: r,\n errors: a\n });\n }\n }\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-drop`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t,\n rejectedFiles: i\n }\n })), t.length > 0 && this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-drop-accepted`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t\n }\n })), i.length > 0 && this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$n}-drop-rejected`, {\n bubbles: !0,\n composed: !0,\n detail: {\n rejectedFiles: i\n }\n })), this.#t && (this.#t.value = this.#t.defaultValue);\n }\n openFileDialog() {\n this.disabled || this.#t?.click();\n }\n #o(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n static defineCustomElement(e = $7aad62ebc3d6fae8$var$n) {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, o);\n }\n};\n$7aad62ebc3d6fae8$export$6ccd1735166caad9.defineCustomElement();\n\n\n/*!\n * @georapbox/resize-observer-element\n * A custom element that offers a declarative interface to the ResizeObserver API.\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/resize-observer-element#readme\n * @author George Raptis \n * @license MIT\n */ var $81b28a4cd686838b$var$d = \":host { display: contents; }\", $81b28a4cd686838b$var$o = document.createElement(\"template\");\n$81b28a4cd686838b$var$o.innerHTML = `\n \n \n`;\nvar $81b28a4cd686838b$export$f0e45424cc896229 = class n extends HTMLElement {\n #e = null;\n #t = null;\n #s = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($81b28a4cd686838b$var$o.content.cloneNode(!0)), this.#e = this.shadowRoot?.querySelector(\"slot\") ?? null;\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n e === \"disabled\" && t !== i && (this.disabled ? this.#o() : this.#i());\n }\n connectedCallback() {\n this.#d(\"disabled\"), \"ResizeObserver\" in window && (this.#t = new ResizeObserver((e)=>{\n this.dispatchEvent(new CustomEvent(\"resize-observer:resize\", {\n bubbles: !0,\n composed: !0,\n detail: {\n entries: e\n }\n }));\n }), this.disabled || this.#i(), this.#e?.addEventListener(\"slotchange\", this.#n));\n }\n disconnectedCallback() {\n this.#o(), this.#e?.removeEventListener(\"slotchange\", this.#n);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n #i() {\n !this.#e || !this.#t || (this.#s.forEach((e)=>this.#t?.unobserve(e)), this.#s = [], this.#e.assignedElements().forEach((e)=>{\n this.#t?.observe(e), this.#s.push(e);\n }));\n }\n #o() {\n this.#t?.disconnect();\n }\n #n = ()=>{\n this.disabled || this.#i();\n };\n #d(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n static defineCustomElement(e = \"resize-observer\") {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, n);\n }\n};\n$81b28a4cd686838b$export$f0e45424cc896229.defineCustomElement();\n\n\n/*!\n * @georapbox/modal-element\n * A custom element to create a modal, using the native dialog element under the hood.\n *\n * @version 1.8.0\n * @homepage https://github.com/georapbox/modal-element#readme\n * @author George Raptis \n * @license MIT\n */ var $4da30046ce6d9325$var$n = document.createElement(\"template\"), $4da30046ce6d9325$var$r = `\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: 300ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;\n$4da30046ce6d9325$var$n.innerHTML = `\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;\nvar $4da30046ce6d9325$export$32589115725b904b = class s extends HTMLElement {\n #e = null;\n #i = null;\n #a = null;\n #o = void 0;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($4da30046ce6d9325$var$n.content.cloneNode(!0)), this.shadowRoot && (this.#e = this.shadowRoot.querySelector(\"dialog\"), this.#i = this.shadowRoot.querySelector('slot[name=\"footer\"]'), this.#a = this.shadowRoot.querySelector('slot[name=\"close\"]'));\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\",\n \"close-label\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n if (this.#e !== null) {\n if (e === \"open\" && t !== i && (this.open ? (this.#e.showModal(), this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n })), document.body && !this.preserveOverflow && (document.body.style.overflow = \"hidden\")) : this.#e.close()), e === \"no-header\" && t !== i) {\n let o = this.#e.querySelector(\".dialog__header\");\n o !== null && (o.hidden = this.noHeader);\n }\n if (e === \"no-animations\" && t !== i && this.#e.classList.toggle(\"dialog--no-animations\", this.noAnimations), e === \"no-close-button\" && t !== i) {\n let o = this.#e.querySelector(\".dialog__close\");\n o !== null && (o.hidden = this.noCloseButton);\n }\n e === \"close-label\" && t !== i && this.#r();\n }\n }\n connectedCallback() {\n this.#t(\"open\"), this.#t(\"staticBackdrop\"), this.#t(\"noHeader\"), this.#t(\"noAnimations\"), this.#t(\"noCloseButton\"), this.#t(\"fullscreen\"), this.#t(\"preserveOverflow\"), this.#t(\"placement\"), this.#t(\"closeLabel\"), this.#e?.addEventListener(\"click\", this.#h), this.#e?.addEventListener(\"close\", this.#l), this.#e?.addEventListener(\"cancel\", this.#d), this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#c), this.#i?.addEventListener(\"slotchange\", this.#m), this.#a?.addEventListener(\"slotchange\", this.#g);\n }\n disconnectedCallback() {\n this.#o && clearTimeout(this.#o), this.#e?.addEventListener(\"click\", this.#h), this.#e?.removeEventListener(\"close\", this.#l), this.#e?.removeEventListener(\"cancel\", this.#d), this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#c), this.#i?.removeEventListener(\"slotchange\", this.#m), this.#a?.removeEventListener(\"slotchange\", this.#g);\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(e) {\n this.toggleAttribute(\"open\", !!e);\n }\n get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(e) {\n this.toggleAttribute(\"static-backdrop\", !!e);\n }\n get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(e) {\n this.toggleAttribute(\"no-header\", !!e);\n }\n get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(e) {\n this.toggleAttribute(\"no-animations\", !!e);\n }\n get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(e) {\n this.toggleAttribute(\"no-close-button\", !!e);\n }\n get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(e) {\n this.toggleAttribute(\"fullscreen\", !!e);\n }\n get preserveOverflow() {\n return this.hasAttribute(\"preserve-overflow\");\n }\n set preserveOverflow(e) {\n this.toggleAttribute(\"preserve-overflow\", !!e);\n }\n get placement() {\n return this.getAttribute(\"placement\") || \"center\";\n }\n set placement(e) {\n this.setAttribute(\"placement\", e != null ? e.toString() : e);\n }\n get closeLabel() {\n return this.getAttribute(\"close-label\") || \"Close\";\n }\n set closeLabel(e) {\n this.setAttribute(\"close-label\", e != null ? e.toString() : e);\n }\n #r() {\n if (this.#e === null) return;\n let e = this.#e.querySelector(\".dialog__close\");\n if (e === null) return;\n (this.#a?.assignedElements() || [])?.some((o)=>o.textContent?.replace(/\\s/g, \"\") !== \"\") ? e.removeAttribute(\"aria-label\") : e.setAttribute(\"aria-label\", this.closeLabel);\n }\n #n() {\n this.#o || (this.#e?.classList.add(\"dialog--pulse\"), this.#o = setTimeout(()=>{\n this.#e?.classList.remove(\"dialog--pulse\"), clearTimeout(this.#o), this.#o = void 0;\n }, 300));\n }\n #l = ()=>{\n this.open = !1, this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n })), document.body && !this.preserveOverflow && (document.body.style.overflow = \"\");\n };\n #d = (e)=>{\n let t = this.#s(\"escape-key\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), !this.noAnimations && this.#n());\n };\n #c = (e)=>{\n let t = this.#s(\"close-button\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), !this.noAnimations && this.#n());\n };\n #h = (e)=>{\n let t = e.target, i = e.currentTarget;\n if (t === i) {\n let o = this.#s(\"backdrop-click\");\n this.dispatchEvent(o), o.defaultPrevented || this.staticBackdrop ? !this.noAnimations && this.#n() : this.hide();\n }\n if (t instanceof HTMLElement && t.closest(\"[data-me-close]\") !== null) {\n let o = this.#s(\"external-invoker\");\n this.dispatchEvent(o), o.defaultPrevented ? !this.noAnimations && this.#n() : this.hide();\n }\n };\n #m = ()=>{\n if (this.#e === null) return;\n let e = this.#e.querySelector(\".dialog__footer\");\n if (e === null) return;\n let t = this.#i?.assignedNodes(), i = t ? t.length > 0 : !1;\n e.hidden = !i;\n };\n #g = ()=>{\n this.#r();\n };\n #s(e) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: !0,\n composed: !0,\n cancelable: !0,\n detail: {\n reason: e,\n element: this\n }\n });\n }\n #t(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n show() {\n this.open || (this.open = !0);\n }\n hide() {\n this.open && (this.open = !1);\n }\n static defineCustomElement(e = \"modal-element\") {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, s);\n }\n};\n$4da30046ce6d9325$export$32589115725b904b.defineCustomElement();\n\n\nconst $33dea9d9a6da4c9a$export$d726fc97fa83318d = \"experimental\";\nconst $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a = \"No barcode detected\";\nconst $33dea9d9a6da4c9a$export$63e7bed68b07a85c = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\"\n];\n\n\nfunction $e92a13782f6c06ba$var$_slicedToArray(arr, i) {\n return $e92a13782f6c06ba$var$_arrayWithHoles(arr) || $e92a13782f6c06ba$var$_iterableToArrayLimit(arr, i) || $e92a13782f6c06ba$var$_unsupportedIterableToArray(arr, i) || $e92a13782f6c06ba$var$_nonIterableRest();\n}\nfunction $e92a13782f6c06ba$var$_nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction $e92a13782f6c06ba$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $e92a13782f6c06ba$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $e92a13782f6c06ba$var$_arrayLikeToArray(o, minLen);\n}\nfunction $e92a13782f6c06ba$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $e92a13782f6c06ba$var$_iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction $e92a13782f6c06ba$var$_arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction $e92a13782f6c06ba$export$b327150396135fe7(request) {\n return new Promise(function(resolve, reject) {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = function() {\n return resolve(request.result);\n }; // @ts-ignore - file size hacks\n request.onabort = request.onerror = function() {\n return reject(request.error);\n };\n });\n}\nfunction $e92a13782f6c06ba$export$f51a9068ac82ea43(dbName, storeName) {\n var request = indexedDB.open(dbName);\n request.onupgradeneeded = function() {\n return request.result.createObjectStore(storeName);\n };\n var dbp = $e92a13782f6c06ba$export$b327150396135fe7(request);\n return function(txMode, callback) {\n return dbp.then(function(db) {\n return callback(db.transaction(storeName, txMode).objectStore(storeName));\n });\n };\n}\nvar $e92a13782f6c06ba$var$defaultGetStoreFunc;\nfunction $e92a13782f6c06ba$var$defaultGetStore() {\n if (!$e92a13782f6c06ba$var$defaultGetStoreFunc) $e92a13782f6c06ba$var$defaultGetStoreFunc = $e92a13782f6c06ba$export$f51a9068ac82ea43(\"keyval-store\", \"keyval\");\n return $e92a13782f6c06ba$var$defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$3988ae62b71be9a3(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n return $e92a13782f6c06ba$export$b327150396135fe7(store.get(key));\n });\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$adaa4cf7ef1b65be(key, value) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.put(value, key);\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$daa0a5170277c7a8(entries) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n entries.forEach(function(entry) {\n return store.put(entry[1], entry[0]);\n });\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$5df405cccea42673(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n return Promise.all(keys.map(function(key) {\n return $e92a13782f6c06ba$export$b327150396135fe7(store.get(key));\n }));\n });\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$722fbec263ad908a(key, updater) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n return(// If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise(function(resolve, reject) {\n store.get(key).onsuccess = function() {\n try {\n store.put(updater(this.result), key);\n resolve($e92a13782f6c06ba$export$b327150396135fe7(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n }));\n });\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$1d2f21e549771e67(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.delete(key);\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$c8aa84257229cac8(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n keys.forEach(function(key) {\n return store.delete(key);\n });\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$42ffd38884aecdac() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.clear();\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n });\n}\nfunction $e92a13782f6c06ba$var$eachCursor(store, callback) {\n store.openCursor().onsuccess = function() {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n return $e92a13782f6c06ba$export$b327150396135fe7(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$ed97f33186d4b816() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n if (store.getAllKeys) return $e92a13782f6c06ba$export$b327150396135fe7(store.getAllKeys());\n var items = [];\n return $e92a13782f6c06ba$var$eachCursor(store, function(cursor) {\n return items.push(cursor.key);\n }).then(function() {\n return items;\n });\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$68c286be0e7e55b7() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n if (store.getAll) return $e92a13782f6c06ba$export$b327150396135fe7(store.getAll());\n var items = [];\n return $e92a13782f6c06ba$var$eachCursor(store, function(cursor) {\n return items.push(cursor.value);\n }).then(function() {\n return items;\n });\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $e92a13782f6c06ba$export$3e9f948b41964866() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $e92a13782f6c06ba$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) return Promise.all([\n $e92a13782f6c06ba$export$b327150396135fe7(store.getAllKeys()),\n $e92a13782f6c06ba$export$b327150396135fe7(store.getAll())\n ]).then(function(_ref) {\n var _ref2 = $e92a13782f6c06ba$var$_slicedToArray(_ref, 2), keys = _ref2[0], values = _ref2[1];\n return keys.map(function(key, i) {\n return [\n key,\n values[i]\n ];\n });\n });\n var items = [];\n return customStore(\"readonly\", function(store) {\n return $e92a13782f6c06ba$var$eachCursor(store, function(cursor) {\n return items.push([\n cursor.key,\n cursor.value\n ]);\n }).then(function() {\n return items;\n });\n });\n });\n}\n\n\nconst $c96efe8837e99c11$var$STORAGE_PREFIX = \"barcode-scanner/\";\nconst $c96efe8837e99c11$var$SETTINGS_STORAGE_KEY = \"settings\";\nconst $c96efe8837e99c11$var$HISTORY_STORAGE_KEY = \"history\";\n/**\n * Gets an item from the storage.\n *\n * @param {string} key - The key to get the item from.\n * @returns {Promise<[ error: any, value: any ]>} The item and an error if occurred.\n */ const $c96efe8837e99c11$var$getItem = async (key)=>{\n try {\n return [\n null,\n await (0, $e92a13782f6c06ba$export$3988ae62b71be9a3)(key)\n ];\n } catch (error) {\n return [\n error,\n void 0\n ];\n }\n};\n/**\n * Sets an item in the storage.\n *\n * @param {string} key - The key to set the item to.\n * @param {any} data - The data to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */ const $c96efe8837e99c11$var$setItem = async (key, data)=>{\n try {\n await (0, $e92a13782f6c06ba$export$adaa4cf7ef1b65be)(key, data);\n return [\n null\n ];\n } catch (error) {\n return [\n error\n ];\n }\n};\nconst $c96efe8837e99c11$export$4a647155031ece = async ()=>{\n return $c96efe8837e99c11$var$getItem($c96efe8837e99c11$var$STORAGE_PREFIX + $c96efe8837e99c11$var$SETTINGS_STORAGE_KEY);\n};\nconst $c96efe8837e99c11$export$dc86d17a64679bc7 = async (data)=>{\n return $c96efe8837e99c11$var$setItem($c96efe8837e99c11$var$STORAGE_PREFIX + $c96efe8837e99c11$var$SETTINGS_STORAGE_KEY, data);\n};\nconst $c96efe8837e99c11$export$f9582a3c130d9538 = async ()=>{\n return $c96efe8837e99c11$var$getItem($c96efe8837e99c11$var$STORAGE_PREFIX + $c96efe8837e99c11$var$HISTORY_STORAGE_KEY);\n};\nconst $c96efe8837e99c11$export$96fe1132eb44c325 = async (data)=>{\n return $c96efe8837e99c11$var$setItem($c96efe8837e99c11$var$STORAGE_PREFIX + $c96efe8837e99c11$var$HISTORY_STORAGE_KEY, data);\n};\n\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * 'n' milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {function} fn The function to be executed.\n * @param {Number} [wait=0] Time of delay in milliseconds. It is required if `immediate` is used.\n * @param {Boolean} [immediate=false] If true or any truthy value, triggers the function on the leading edge.\n * @throws {TypeError} If `fn` is not function.\n * @returns {function} A new debounced function.\n * @example\n *\n * const debouncedHandler = debounce(() => {\n * // Do your thing here...\n * }, 250);\n *\n * window.addEventListener('resize', debouncedHandler, false);\n */ const $f7942db15ba0cc81$export$61fc7d43ac8f84b0 = (fn, wait = 0, immediate = false)=>{\n let timerId = null;\n if (typeof fn !== \"function\") throw new TypeError(\"Expected a function for first argument\");\n return (...args)=>{\n clearTimeout(timerId);\n if (immediate && !timerId) fn(...args);\n timerId = setTimeout(()=>{\n timerId = null;\n if (!immediate) fn(...args);\n }, wait);\n };\n};\n\n\n/**\n * Log to console only in development mode.\n *\n * @param {...any} args - Arguments to log\n */ function $e3e25c01e64ec360$export$bef1f36f5486a6a3(...args) {}\n\n\n/**\n * Check if the dialog element is supported.\n *\n * @returns {boolean} - Returns true if the dialog element is supported.\n */ const $4840d5fa714b09de$export$c694186e9d94f0 = ()=>{\n return typeof HTMLDialogElement === \"function\";\n};\n\n\n/**\n * Renders the supported formats.\n *\n * @param {Array} formats - Supported barcode formats\n */ function $fe7f448e3206b625$export$f6bb24723b821792(formats) {\n if (!Array.isArray(formats) || formats.length === 0) return;\n const supportedFormatsEl = document.getElementById(\"supportedFormats\");\n if (!supportedFormatsEl) return;\n supportedFormatsEl.textContent = `Supported formats: ${formats.join(\", \")}`;\n}\n\n\n\nfunction $2cce6ab38d28b4d0$export$fa9e3380e441c420(data) {\n const historyList = document.getElementById(\"historyList\");\n if (!historyList) return;\n const emptyHistoryBtn = document.getElementById(\"emptyHistoryBtn\");\n historyList.replaceChildren();\n if (!Array.isArray(data) || data.length === 0) {\n historyList.innerHTML = \"
  • There are no saved items in history.
  • \";\n emptyHistoryBtn.hidden = true;\n } else {\n emptyHistoryBtn.hidden = false;\n data.forEach((item, index)=>{\n const li = document.createElement(\"li\");\n li.setAttribute(\"data-value\", item);\n let historyItem;\n try {\n new URL(item);\n historyItem = document.createElement(\"a\");\n historyItem.href = item;\n historyItem.setAttribute(\"target\", \"_blank\");\n historyItem.setAttribute(\"rel\", \"noreferrer noopener\");\n } catch {\n historyItem = document.createElement(\"span\");\n }\n historyItem.textContent = item;\n historyItem.setAttribute(\"id\", `historyItem-${index}`);\n const actionsEl = document.createElement(\"div\");\n actionsEl.className = \"history-modal__actions\";\n const copyBtn = document.createElement(\"custom-clipboard-copy\");\n copyBtn.setAttribute(\"id\", `copyHistoryItem-${index}`);\n copyBtn.setAttribute(\"aria-label\", \"Copy to clipboard\");\n copyBtn.setAttribute(\"aria-labelledby\", `copyHistoryItem-${index} historyItem-${index}`);\n copyBtn.setAttribute(\"only-icon\", \"\");\n copyBtn.setAttribute(\"value\", item);\n actionsEl.appendChild(copyBtn);\n const removeBtn = document.createElement(\"button\");\n removeBtn.type = \"button\";\n removeBtn.className = \"history-modal__delete-action\";\n removeBtn.setAttribute(\"data-action\", \"delete\");\n removeBtn.setAttribute(\"id\", `removeHistoryItem-${index}`);\n removeBtn.setAttribute(\"aria-label\", \"Remove from history\");\n removeBtn.setAttribute(\"aria-labelledby\", `removeHistoryItem-${index} historyItem-${index}`);\n removeBtn.innerHTML = /* html */ `\n \n \n \n `;\n actionsEl.appendChild(removeBtn);\n li.appendChild(historyItem);\n li.appendChild(actionsEl);\n historyList.appendChild(li);\n });\n }\n}\nasync function $2cce6ab38d28b4d0$export$7a6a9d84993ff4e(item) {\n const [, settings] = await (0, $c96efe8837e99c11$export$4a647155031ece)();\n if (!item || !settings?.addToHistory) return;\n const [getHistoryError, history = []] = await (0, $c96efe8837e99c11$export$f9582a3c130d9538)();\n if (!getHistoryError && Array.isArray(history) && !history.find((h)=>h === item)) {\n const data = [\n ...history,\n item\n ];\n const [setHistoryError] = await (0, $c96efe8837e99c11$export$96fe1132eb44c325)(data);\n if (!setHistoryError) $2cce6ab38d28b4d0$export$fa9e3380e441c420(data);\n }\n}\nasync function $2cce6ab38d28b4d0$export$3a61248021dae916(item) {\n if (!item) return;\n const [getHistoryError, history = []] = await (0, $c96efe8837e99c11$export$f9582a3c130d9538)();\n if (!getHistoryError && Array.isArray(history)) {\n const data = history.filter((el)=>el !== item);\n const [setHistoryError] = await (0, $c96efe8837e99c11$export$96fe1132eb44c325)(data);\n if (!setHistoryError) $2cce6ab38d28b4d0$export$fa9e3380e441c420(data);\n }\n}\nasync function $2cce6ab38d28b4d0$export$9f74b61e5d33cda2() {\n const [setHistoryError] = await (0, $c96efe8837e99c11$export$96fe1132eb44c325)([]);\n if (!setHistoryError) $2cce6ab38d28b4d0$export$fa9e3380e441c420([]);\n}\n\n\n/**\n * Removes the scanned result from the element where it is shown.\n *\n * @param {HTMLElement} element - The element to remove the result from.\n */ function $696a3a8b3e5710f1$export$ad20350fbdf13c97(element) {\n if (!element) return;\n const scanResultEl = element.querySelector(\"scan-result\");\n scanResultEl?.remove();\n}\nasync function $696a3a8b3e5710f1$export$97c08f0895810b94(element, value) {\n if (!element || !value) return;\n const oldScanResultEl = element.querySelector(\"scan-result\");\n if (oldScanResultEl) oldScanResultEl.setAttribute(\"value\", value);\n else {\n const newScanResultEl = document.createElement(\"scan-result\");\n newScanResultEl.setAttribute(\"value\", value);\n newScanResultEl.setAttribute(\"role\", \"alert\");\n newScanResultEl.setAttribute(\"aria-live\", \"assertive\");\n newScanResultEl.setAttribute(\"aria-atomic\", \"true\");\n element.appendChild(newScanResultEl);\n }\n}\n\n\n\n/**\n * Beep sound using the `AudioContext` interface.\n *\n * @param {Object} options\n * @param {Number} options.duration - Duration in milliseconds\n * @param {Number} options.frequency - Frequency in Hz\n * @param {Number} options.volume - Volume\n * @param {String} options.type - Type of oscillator\n * @param {Function} options.onEnded - Callback function when the sound ends\n */ const $19ecce1b28895d1c$export$d6c943e433460aae = (()=>{\n const audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext)();\n if (!audioCtx) return;\n return (options)=>{\n const { duration: duration, frequency: frequency, volume: volume, type: type, onEnded: onEnded } = options;\n const oscillator = audioCtx.createOscillator();\n const gainNode = audioCtx.createGain();\n oscillator.connect(gainNode);\n gainNode.connect(audioCtx.destination);\n if (volume) gainNode.gain.value = volume;\n if (frequency) oscillator.frequency.value = frequency;\n if (type) oscillator.type = type;\n if (typeof onEnded === \"function\") oscillator.onended = onEnded;\n oscillator.start(audioCtx.currentTime);\n oscillator.stop(audioCtx.currentTime + (duration || 500) / 1000);\n };\n})();\n\n\n/**\n * Vibrate the device.\n * If the device does not support vibration, this function will fail silently.\n *\n * @param {Number} [duration=0] - Duration in milliseconds\n */ async function $08aca92dc2b3c75c$export$3ca8e905da0a0ca8(duration = 0) {\n if (typeof window.navigator.vibrate !== \"function\") return;\n try {\n window.navigator.vibrate(duration);\n } catch {\n // Fail silently...\n }\n}\n\n\nasync function $0460f8ef7b1421c2$export$9b466d13e2031a67(options = {}) {\n const { success: success = true } = options;\n const [, settings] = await (0, $c96efe8837e99c11$export$4a647155031ece)();\n if (!settings) return;\n const beepConfig = success ? {\n duration: 200,\n frequency: 860,\n volume: 0.03,\n type: \"square\"\n } : {\n duration: 300,\n frequency: 200,\n volume: 0.05,\n type: \"sawtooth\"\n };\n settings.beep && (0, $19ecce1b28895d1c$export$d6c943e433460aae)(beepConfig);\n settings.vibrate && (0, $08aca92dc2b3c75c$export$3ca8e905da0a0ca8)(success ? 100 : 200);\n}\n\n\n/**\n * Resizes the scan frame to match the video element's dimensions.\n *\n * @param {HTMLVideoElement} videoEl - Video element\n * @param {HTMLElement} scanFrameEl - Scan frame element\n */ function $d335f5b5c097c74d$export$1404f0e91c73fec(videoEl, scanFrameEl) {\n if (!videoEl || !scanFrameEl) return;\n const rect = videoEl.getBoundingClientRect();\n scanFrameEl.style.cssText = `width: ${rect.width}px; height: ${rect.height}px`;\n}\n\n\n\n\n/**\n * BarcodeReader class to detect barcodes from images or videos.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector\n */ class $586e2c3c9ffe53e0$export$f21d9483ebeee00a {\n static async polyfill() {\n if (!(\"BarcodeDetector\" in window)) try {\n await (parcelRequire(\"bkcP3\"));\n (0, $e3e25c01e64ec360$export$bef1f36f5486a6a3)(\"Using BarcodeDetector polyfill.\");\n } catch {\n throw new Error(\"BarcodeDetector API is not supported by your browser.\");\n }\n else (0, $e3e25c01e64ec360$export$bef1f36f5486a6a3)(\"Using the native BarcodeDetector API.\");\n }\n /**\n * Get the supported barcode formats.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/getSupportedFormats\n * @returns {Promise>} - Supported barcode formats\n */ static async getSupportedFormats() {\n return await window.BarcodeDetector.getSupportedFormats();\n }\n /**\n * Create a new BarcodeReader instance.\n *\n * @returns {Promise} - New BarcodeReader instance\n */ static async create() {\n const formats = await window.BarcodeDetector.getSupportedFormats();\n return new $586e2c3c9ffe53e0$export$f21d9483ebeee00a(formats);\n }\n /**\n * Initialize the BarcodeReader.\n *\n * @returns {Promise<{ barcodeReader: BarcodeReader, barcodeFormats: Array, barcodeReaderError: Error }>} - BarcodeReader instance, supported formats, and error\n */ static async init() {\n try {\n await $586e2c3c9ffe53e0$export$f21d9483ebeee00a.polyfill();\n const barcodeReader = await $586e2c3c9ffe53e0$export$f21d9483ebeee00a.create();\n const barcodeFormats = await $586e2c3c9ffe53e0$export$f21d9483ebeee00a.getSupportedFormats();\n return {\n barcodeReader: barcodeReader,\n barcodeFormats: barcodeFormats,\n barcodeReaderError: null\n };\n } catch (error) {\n return {\n barcodeReader: null,\n barcodeFormats: [],\n barcodeReaderError: error\n };\n }\n }\n /**\n * Create a new BarcodeReader instance.\n *\n * @param {Array} formats - Supported barcode formats\n */ constructor(formats){\n this.barcodeReader = new window.BarcodeDetector({\n formats: formats\n });\n }\n /**\n * Detect barcodes from the provided source.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/detect\n * @param {HTMLImageElement|HTMLVideoElement|ImageBitmap} source - Image or video element or ImageBitmap\n * @returns {Promise} - Barcode detection result\n */ async detect(source) {\n if (!this.barcodeReader) throw new Error(\"BarcodeReader is not initialized.\");\n const results = await this.barcodeReader.detect(source);\n if (Array.isArray(results) && results.length > 0) return results[0];\n else throw new Error(\"Could not detect barcode from provided source.\");\n }\n}\n\n\n\nasync function $c8149428128c684b$export$9d22ef9ff8e481fe(form) {\n const [, settings = {}] = await (0, $c96efe8837e99c11$export$4a647155031ece)();\n Object.entries(settings).forEach(([key, value])=>{\n const settingInput = form.querySelector(`[name=\"${key}\"]`);\n if (!settingInput) return;\n settingInput.checked = value;\n });\n}\n\n\n/**\n * Toggles the torch button status.\n * The torch button has two icons, one for on and one for off.\n * This function toggles the visibility of the icons based on the torch state and updates the button title.\n *\n * @param {HTMLButtonElement} buttonEl - The torch button element.\n * @param {boolean} isTorchOn - The torch state.\n */ function $7c034485d4f152a1$export$d1bd0b12fe0d046(options = {}) {\n const defaults = {\n el: document.getElementById(\"torchButton\"),\n isTorchOn: false\n };\n const { el: el, isTorchOn: isTorchOn } = {\n ...defaults,\n ...options\n };\n const iconPaths = el.querySelectorAll(\"svg path\");\n if (iconPaths.length !== 2) return;\n iconPaths[0].style.display = isTorchOn ? \"none\" : \"block\";\n iconPaths[1].style.display = isTorchOn ? \"block\" : \"none\";\n el.setAttribute(\"title\", `Turn ${isTorchOn ? \"off\" : \"on\"} flash`);\n}\n\n\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */ const $52c18c31ba376620$export$7d15b64cf5a3a4c4 = (value, lower, upper)=>{\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n\n\nconst $149eedd8690347fa$var$COMPONENT_NAME = \"video-capture\";\nconst $149eedd8690347fa$var$styles = /* css */ `\n :host { display: block; box-sizing: border-box; }\n :host *, :host *::before, :host *::after { box-sizing: inherit;}\n :host([hidden]), [hidden], ::slotted([hidden]) { display: none; }\n video { display: block; }\n #output:empty { display: none; }\n`;\nconst $149eedd8690347fa$var$template = document.createElement(\"template\");\n$149eedd8690347fa$var$template.innerHTML = /* html */ `\n \n \n
    \n \n`;\nclass $149eedd8690347fa$export$682e9ed90a89bb4a extends HTMLElement {\n #supportedConstraints = {};\n #stream = null;\n #videoElement = null;\n constructor(){\n super();\n this.#supportedConstraints = this.getSupportedConstraints();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($149eedd8690347fa$var$template.content.cloneNode(true));\n }\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"pan\",\n \"tilt\",\n \"zoom\",\n \"torch\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n const trackCapabilities = this.getTrackCapabilities();\n if (name === \"zoom\" && oldValue !== newValue && \"zoom\" in this.#supportedConstraints) {\n const zoomInAllowedRange = \"zoom\" in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max : false;\n if (typeof this.zoom === \"number\" && zoomInAllowedRange) this.#applyConstraint(\"zoom\", this.zoom);\n }\n if (name === \"torch\" && oldValue !== newValue && \"torch\" in this.#supportedConstraints) this.#applyConstraint(\"torch\", this.torch);\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ async connectedCallback() {\n this.#upgradeProperty(\"autoPlay\");\n this.#upgradeProperty(\"facingMode\");\n this.#upgradeProperty(\"zoom\");\n this.#upgradeProperty(\"torch\");\n this.#videoElement = this.shadowRoot?.querySelector(\"video\") || null;\n this.#videoElement?.addEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n if (!$149eedd8690347fa$export$682e9ed90a89bb4a.isSupported()) return this.dispatchEvent(new CustomEvent(`${$149eedd8690347fa$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n if (this.autoPlay) this.startVideoStream();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.stopVideoStream();\n this.#videoElement?.removeEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n }\n get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(value) {\n this.toggleAttribute(\"auto-play\", !!value);\n }\n get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(value) {\n this.setAttribute(\"facing-mode\", value);\n }\n get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(value) {\n this.setAttribute(\"zoom\", value != null ? value.toString() : value);\n }\n get torch() {\n return this.hasAttribute(\"torch\");\n }\n set torch(value) {\n this.toggleAttribute(\"torch\", !!value);\n }\n get loading() {\n return this.hasAttribute(\"loading\");\n }\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {Event} evt - The event object.\n */ #onVideoLoadedMetaData = (evt)=>{\n const video = evt.target;\n video.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$149eedd8690347fa$var$COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: {\n video: video\n }\n }));\n }).catch((error)=>{\n this.dispatchEvent(new CustomEvent(`${$149eedd8690347fa$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n /**\n * Applies a constraint to the video track.\n *\n * @param {string} constraint - The name of the constraint.\n * @param {any} value - The value of the constraint.\n */ #applyConstraint(constraint, value) {\n if (!this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n const constraintValue = constraint === \"pan\" || constraint === \"tilt\" || constraint === \"zoom\" ? (0, $52c18c31ba376620$export$7d15b64cf5a3a4c4)(Number(value), trackCapabilities[constraint]?.min || 1, trackCapabilities[constraint]?.max || 1) : value;\n if (constraint in trackSettings) track.applyConstraints({\n advanced: [\n {\n [constraint]: constraintValue\n }\n ]\n }).catch(()=>{\n // Fail silently...\n });\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n /**\n * Starts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n * @returns Promise\n */ async startVideoStream(videoInputId) {\n if (!$149eedd8690347fa$export$682e9ed90a89bb4a.isSupported() || this.#stream) return;\n this.setAttribute(\"loading\", \"\");\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: true,\n tilt: true,\n zoom: true,\n torch: this.torch\n },\n audio: false\n };\n if (typeof videoInputId === \"string\" && videoInputId.trim().length > 0) constraints.video.deviceId = {\n exact: videoInputId\n };\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.#videoElement) this.#videoElement.srcObject = this.#stream;\n this.#applyConstraint(\"pan\", this.pan);\n this.#applyConstraint(\"tilt\", this.tilt);\n this.#applyConstraint(\"zoom\", this.zoom);\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$149eedd8690347fa$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n /**\n * Restarts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n */ restartVideoStream(videoInputId) {\n if (this.#stream && this.#videoElement) this.stopVideoStream();\n this.startVideoStream(videoInputId);\n }\n /**\n * Stops the video stream.\n */ stopVideoStream() {\n if (!this.#videoElement || !this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */ getSupportedConstraints() {\n if (!$149eedd8690347fa$export$682e9ed90a89bb4a.isSupported()) return {};\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */ getTrackCapabilities() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getCapabilities === \"function\") return track.getCapabilities() || {};\n return {};\n }\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */ getTrackSettings() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getSettings === \"function\") return track.getSettings() || {};\n return {};\n }\n /**\n * Returns the available video input devices.\n *\n * @returns {Promise}\n */ static async getVideoInputDevices() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) return [];\n const devices = await navigator.mediaDevices.enumerateDevices() || [];\n return devices.filter((device)=>device.kind === \"videoinput\" && !!device.deviceId);\n }\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */ static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='video-capture'] - The name of the custom element.\n */ static defineCustomElement(elementName = $149eedd8690347fa$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $149eedd8690347fa$export$682e9ed90a89bb4a);\n }\n}\n\n\n/*!\n * @georapbox/clipboard-copy-element\n * A custom element that implements the Clipboard API to copy text content from elements or input values to the clipboard.\n *\n * @version 3.0.2\n * @homepage https://github.com/georapbox/clipboard-copy-element#readme\n * @author George Raptis \n * @license MIT\n */ var $5e1cbbd957798f18$var$i = \"clipboard-copy\";\nvar $5e1cbbd957798f18$var$o = \"success\", $5e1cbbd957798f18$var$n = \"error\", $5e1cbbd957798f18$var$h = document.createElement(\"template\"), $5e1cbbd957798f18$var$a = `\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;\n$5e1cbbd957798f18$var$h.innerHTML = `\n \n \n`;\nvar $5e1cbbd957798f18$export$ea3b71af1761ff40 = class d extends HTMLElement {\n #e = void 0;\n #t = null;\n #s = null;\n #i = null;\n #o = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($5e1cbbd957798f18$var$h.content.cloneNode(!0)), this.shadowRoot && (this.#t = this.shadowRoot.querySelector(\"button\"), this.#s = this.shadowRoot.querySelector('slot[name=\"copy\"]'), this.#i = this.shadowRoot.querySelector('slot[name=\"success\"]'), this.#o = this.shadowRoot.querySelector('slot[name=\"error\"]'));\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, s, e) {\n t === \"disabled\" && s !== e && this.#t && (this.#t.disabled = this.disabled, this.#t.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#t.part.contains(\"button\") && this.#t.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#n(\"value\"), this.#n(\"from\"), this.#n(\"disabled\"), this.#n(\"feedbackDuration\"), this.#t?.addEventListener(\"click\", this.#r);\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"click\", this.#r), this.#a();\n }\n get value() {\n return this.getAttribute(\"value\") || \"\";\n }\n set value(t) {\n this.setAttribute(\"value\", t != null ? t.toString() : t);\n }\n get from() {\n return this.getAttribute(\"from\") || \"\";\n }\n set from(t) {\n this.setAttribute(\"from\", t != null ? t.toString() : t);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get feedbackDuration() {\n return Number(this.getAttribute(\"feedback-duration\")) || 1e3;\n }\n set feedbackDuration(t) {\n this.setAttribute(\"feedback-duration\", t != null ? t.toString() : t);\n }\n async #d() {\n if (!(!this.value && !this.from)) try {\n let t = \"\";\n if (this.value) t = this.value;\n else if (this.from) {\n let s = \"getRootNode\" in Element.prototype ? this.#t?.getRootNode({\n composed: !0\n }) : this.#t?.ownerDocument;\n if (!s || !(s instanceof Document || s instanceof ShadowRoot)) return;\n let e = s.querySelector(this.from);\n if (!e) return;\n e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement ? t = e.value : e instanceof HTMLAnchorElement && e.hasAttribute(\"href\") ? t = e.href : t = e.textContent || \"\";\n }\n await navigator.clipboard.writeText(t), this.#h($5e1cbbd957798f18$var$o), this.dispatchEvent(new CustomEvent(`${$5e1cbbd957798f18$var$i}-success`, {\n bubbles: !0,\n composed: !0,\n detail: {\n value: t\n }\n }));\n } catch (t) {\n this.#h($5e1cbbd957798f18$var$n), this.dispatchEvent(new CustomEvent(`${$5e1cbbd957798f18$var$i}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #r = (t)=>{\n t.preventDefault(), !(this.disabled || this.#e) && this.#d();\n };\n #h(t) {\n this.#s && (this.#s.hidden = !0), this.#i && (this.#i.hidden = t !== $5e1cbbd957798f18$var$o), this.#o && (this.#o.hidden = t !== $5e1cbbd957798f18$var$n), this.#t?.part.remove(\"button--success\"), this.#t?.part.remove(\"button--error\"), this.#t?.part.add(`button--${t}`), this.#e && clearTimeout(this.#e), this.#e = setTimeout(()=>{\n this.#s && (this.#s.hidden = !1), this.#i && (this.#i.hidden = !0), this.#o && (this.#o.hidden = !0), this.#t?.part.remove(`button--${t}`), this.#e = void 0;\n }, this.feedbackDuration);\n }\n #a() {\n this.#e && clearTimeout(this.#e), this.#e = void 0, this.#s && (this.#s.hidden = !1), this.#i && (this.#i.hidden = !0), this.#o && (this.#o.hidden = !0), this.#t?.part.remove(\"button--success\"), this.#t?.part.remove(\"button--error\");\n }\n #n(t) {\n let s = this;\n if (Object.prototype.hasOwnProperty.call(s, t)) {\n let e = s[t];\n delete s[t], s[t] = e;\n }\n }\n static defineCustomElement(t = $5e1cbbd957798f18$var$i) {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, d);\n }\n};\n\n\n/**\n * Extends the `ClipboardCopy` element to override the default `copy` and `success` slots,\n * in order to avoid repetition of the same markup throughout the application.\n * It also adds aditional properties and attributes, specific to the application.\n *\n * @class CustomClipboardCopy\n * @extends ClipboardCopy\n */ class $9d6e877208021767$var$CustomClipboardCopy extends (0, $5e1cbbd957798f18$export$ea3b71af1761ff40) {\n constructor(){\n super();\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n copySlot.innerHTML = /* html */ `\n \n \n \n \n Copy\n `;\n successSlot.innerHTML = /* html */ `\n \n \n \n \n \n Copied!\n `;\n }\n static get observedAttributes() {\n return [\n ...super.observedAttributes,\n \"only-icon\"\n ];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name === \"only-icon\" && oldValue !== newValue) {\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n const copyText = copySlot.querySelector(\".text\");\n const successText = successSlot.querySelector(\".text\");\n if (copyText) copyText.hidden = this.onlyIcon;\n if (successText) successText.hidden = this.onlyIcon;\n }\n }\n get onlyIcon() {\n return this.hasAttribute(\"only-icon\");\n }\n set onlyIcon(value) {\n if (value) this.setAttribute(\"only-icon\", \"\");\n else this.removeAttribute(\"only-icon\");\n }\n connectedCallback() {\n super.connectedCallback();\n this.#upgradeProperty(\"onlyIcon\");\n if (!this.hasAttribute(\"feedback-duration\")) this.setAttribute(\"feedback-duration\", \"1500\");\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"custom-clipboard-copy\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $9d6e877208021767$var$CustomClipboardCopy);\n }\n}\n$9d6e877208021767$var$CustomClipboardCopy.defineCustomElement();\n\n\n/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */ function $94933cc6427541bd$export$c37129e465f64ef0(a) {\n return a !== null && typeof a == \"object\" ? \"share\" in navigator && \"canShare\" in navigator && navigator.canShare(a) : \"share\" in navigator;\n}\n\n\n\n\nconst $1952518f8eeecdff$var$styles = /* css */ `\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n .result {\n position: relative;\n width: 100%;\n border: 1px solid var(--focus);\n border-radius: 6px;\n margin: 1.5rem 0 0 0;\n padding: 1rem;\n background-color: var(--background-alt);\n text-align: center;\n }\n\n .result__item {\n word-wrap: break-word;\n word-break: break-word;\n }\n\n a.result__item {\n color: var(--links);\n text-decoration: none;\n }\n\n a.result__item:hover {\n text-decoration: underline;\n }\n\n .result__item--no-barcode {\n color: var(--error-color);\n }\n\n .result__actions {\n display: flex;\n align-items: center;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .result web-share button,\n .result custom-clipboard-copy::part(button) {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n margin: 0.75rem 0 0 0;\n padding: 0.25rem;\n background-color: transparent;\n border: 0;\n border-radius: var(--border-radius);\n color: inherit;\n line-height: 1;\n font-family: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n`;\nconst $1952518f8eeecdff$var$template = document.createElement(\"template\");\n$1952518f8eeecdff$var$template.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n \n \n \n
    \n
    \n`;\nclass $1952518f8eeecdff$var$ScanResult extends HTMLElement {\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($1952518f8eeecdff$var$template.content.cloneNode(true));\n }\n }\n get value() {\n return this.getAttribute(\"value\");\n }\n set value(value) {\n this.setAttribute(\"value\", value);\n }\n static get observedAttributes() {\n return [\n \"value\"\n ];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"value\" && oldValue !== newValue) this.#handleValueChange(this.value);\n }\n connectedCallback() {\n this.#upgradeProperty(\"value\");\n if (!(0, $94933cc6427541bd$export$c37129e465f64ef0)()) {\n const webShareEl = this.shadowRoot.querySelector(\"web-share\");\n if (webShareEl) webShareEl.hidden = true;\n }\n }\n async #handleValueChange(value) {\n const baseEl = this.shadowRoot.querySelector(\".result\");\n const resultActionsEl = baseEl?.querySelector(\".result__actions\");\n const oldResultItem = baseEl?.querySelector(\".result__item\");\n let resultItem;\n if (oldResultItem) oldResultItem.remove();\n try {\n const [, settings] = await (0, $c96efe8837e99c11$export$4a647155031ece)();\n new URL(value);\n resultItem = document.createElement(\"a\");\n resultItem.href = value;\n window.requestAnimationFrame(()=>resultItem.focus());\n if (!settings?.openWebPageSameTab) {\n resultItem.setAttribute(\"target\", \"_blank\");\n resultItem.setAttribute(\"rel\", \"noreferrer noopener\");\n }\n if (settings?.openWebPage) resultItem.click();\n } catch {\n resultItem = document.createElement(\"span\");\n }\n resultItem.className = \"result__item\";\n resultItem.classList.toggle(\"result__item--no-barcode\", value === (0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a));\n resultItem.textContent = value;\n baseEl?.insertBefore(resultItem, resultActionsEl);\n const isValidValue = value !== (0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a);\n const clipboarCopyEl = baseEl?.querySelector(\"custom-clipboard-copy\");\n const webShareEl = baseEl?.querySelector(\"web-share\");\n if (clipboarCopyEl && isValidValue) {\n clipboarCopyEl.setAttribute(\"value\", value);\n clipboarCopyEl.hidden = false;\n } else {\n clipboarCopyEl.hidden = true;\n clipboarCopyEl.removeAttribute(\"value\");\n }\n if (webShareEl && (0, $94933cc6427541bd$export$c37129e465f64ef0)() && isValidValue) {\n webShareEl.setAttribute(\"share-text\", value);\n webShareEl.hidden = false;\n } else {\n webShareEl.hidden = true;\n webShareEl.removeAttribute(\"share-text\");\n }\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"scan-result\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $1952518f8eeecdff$var$ScanResult);\n }\n}\n$1952518f8eeecdff$var$ScanResult.defineCustomElement();\n\n\n(async function() {\n const hasExperimentalFlag = new URLSearchParams(window.location.search).has((0, $33dea9d9a6da4c9a$export$d726fc97fa83318d));\n const tabGroupEl = document.querySelector(\"a-tab-group\");\n const videoCaptureEl = document.querySelector(\"video-capture\");\n const cameraPanel = document.getElementById(\"cameraPanel\");\n const filePanel = document.getElementById(\"filePanel\");\n const scanInstructionsEl = document.getElementById(\"scanInstructions\");\n const scanBtn = document.getElementById(\"scanBtn\");\n const dropzoneEl = document.getElementById(\"dropzone\");\n const resizeObserverEl = document.querySelector(\"resize-observer\");\n const scanFrameEl = document.getElementById(\"scanFrame\");\n const facingModeButton = document.getElementById(\"facingModeButton\");\n const torchButton = document.getElementById(\"torchButton\");\n const globalActionsEl = document.getElementById(\"globalActions\");\n const historyBtn = document.getElementById(\"historyBtn\");\n const historyDialog = document.getElementById(\"historyDialog\");\n const settingsBtn = document.getElementById(\"settingsBtn\");\n const settingsDialog = document.getElementById(\"settingsDialog\");\n const settingsForm = document.forms[\"settings-form\"];\n const cameraSelect = document.getElementById(\"cameraSelect\");\n let shouldScan = true;\n let rafId;\n // By default the dialog elements are hidden for browsers that don't support the dialog element.\n // If the dialog element is supported, we remove the hidden attribute and the dialogs' visibility\n // is controlled by using the `showModal()` and `close()` methods.\n if ((0, $4840d5fa714b09de$export$c694186e9d94f0)()) {\n globalActionsEl.hidden = false;\n historyDialog.hidden = false;\n settingsDialog.hidden = false;\n }\n const { barcodeReader: barcodeReader, barcodeFormats: barcodeFormats, barcodeReaderError: barcodeReaderError } = await (0, $586e2c3c9ffe53e0$export$f21d9483ebeee00a).init();\n if (barcodeReaderError) {\n const alertEl = document.getElementById(\"barcodeReaderError\");\n shouldScan = false;\n globalActionsEl.hidden = true;\n tabGroupEl.hidden = true;\n alertEl.hidden = false;\n alertEl.textContent = barcodeReaderError?.message;\n return; // Stop the script execution as BarcodeDetector API is not supported.\n }\n videoCaptureEl.addEventListener(\"video-capture:video-play\", handleVideoCapturePlay, {\n once: true\n });\n videoCaptureEl.addEventListener(\"video-capture:error\", handleVideoCaptureError, {\n once: true\n });\n (0, $149eedd8690347fa$export$682e9ed90a89bb4a).defineCustomElement();\n const videoCaptureVideoEl = videoCaptureEl?.shadowRoot?.querySelector(\"video\");\n dropzoneEl.accept = (0, $33dea9d9a6da4c9a$export$63e7bed68b07a85c).join(\",\");\n (0, $c8149428128c684b$export$9d22ef9ff8e481fe)(settingsForm);\n (0, $fe7f448e3206b625$export$f6bb24723b821792)(barcodeFormats);\n (0, $2cce6ab38d28b4d0$export$fa9e3380e441c420)((await (0, $c96efe8837e99c11$export$f9582a3c130d9538)())[1] || []);\n /**\n * Scans for barcodes.\n * If a barcode is detected, it stops scanning and displays the result.\n *\n * @returns {Promise} - A Promise that resolves when the barcode is detected.\n */ async function scan() {\n (0, $e3e25c01e64ec360$export$bef1f36f5486a6a3)(\"Scanning...\");\n scanInstructionsEl.hidden = false;\n try {\n const barcode = await barcodeReader.detect(videoCaptureVideoEl);\n const barcodeValue = barcode?.rawValue ?? \"\";\n if (!barcodeValue) throw new Error((0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a));\n window.cancelAnimationFrame(rafId);\n (0, $696a3a8b3e5710f1$export$97c08f0895810b94)(cameraPanel, barcodeValue);\n (0, $2cce6ab38d28b4d0$export$7a6a9d84993ff4e)(barcodeValue);\n scanInstructionsEl.hidden = true;\n scanBtn.hidden = false;\n scanFrameEl.hidden = true;\n (0, $0460f8ef7b1421c2$export$9b466d13e2031a67)();\n return;\n } catch {\n // If no barcode is detected, the error is caught here.\n // We can ignore the error and continue scanning.\n }\n if (shouldScan) rafId = window.requestAnimationFrame(()=>scan());\n }\n /**\n * Handles the click event on the scan button.\n * It is responsible for clearing previous results and starting the scan process again.\n */ function handleScanButtonClick() {\n scanBtn.hidden = true;\n scanFrameEl.hidden = false;\n (0, $696a3a8b3e5710f1$export$ad20350fbdf13c97)(cameraPanel);\n scan();\n }\n /**\n * Handles the tab show event.\n * It is responsible for starting or stopping the scan process based on the selected tab.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleTabShow(evt) {\n const tabId = evt.detail.tabId;\n const videoCaptureEl = document.querySelector(\"video-capture\"); // Get the latest instance of video-capture element to ensure we don't use the cached one.\n if (tabId === \"cameraTab\") {\n shouldScan = true;\n if (!videoCaptureEl) return;\n if (!videoCaptureEl.loading && !cameraPanel.querySelector(\"scan-result\")) scan();\n if (typeof videoCaptureEl.startVideoStream === \"function\") videoCaptureEl.startVideoStream();\n } else if (tabId === \"fileTab\") {\n shouldScan = false;\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === \"function\") videoCaptureEl.stopVideoStream();\n }\n }\n /**\n * Handles the selection of a file.\n * It is responsible for displaying the selected file in the dropzone.\n *\n * @param {File} file - The selected file.\n */ function handleFileSelect(file) {\n if (!file) return;\n const image = new Image();\n const reader = new FileReader();\n reader.onload = (evt)=>{\n const data = evt.target.result;\n image.onload = async ()=>{\n try {\n const barcode = await barcodeReader.detect(image);\n const barcodeValue = barcode?.rawValue ?? \"\";\n if (!barcodeValue) throw new Error((0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a));\n (0, $696a3a8b3e5710f1$export$97c08f0895810b94)(filePanel, barcodeValue);\n (0, $2cce6ab38d28b4d0$export$7a6a9d84993ff4e)(barcodeValue);\n (0, $0460f8ef7b1421c2$export$9b466d13e2031a67)();\n } catch (err) {\n (0, $e3e25c01e64ec360$export$bef1f36f5486a6a3)(err);\n (0, $696a3a8b3e5710f1$export$97c08f0895810b94)(filePanel, (0, $33dea9d9a6da4c9a$export$c263bd68c6f5ce7a));\n (0, $0460f8ef7b1421c2$export$9b466d13e2031a67)({\n success: false\n });\n }\n };\n image.src = data;\n image.alt = \"Image preview\";\n dropzoneEl.replaceChildren();\n const preview = document.createElement(\"div\");\n preview.className = \"dropzone-preview\";\n preview.setAttribute(\"aria-hidden\", \"true\");\n const imageWrapper = document.createElement(\"div\");\n imageWrapper.className = \"dropzone-preview__image-wrapper\";\n const fileNameWrapper = document.createElement(\"div\");\n fileNameWrapper.className = \"dropzone-preview__file-name\";\n fileNameWrapper.textContent = file.name;\n imageWrapper.appendChild(image);\n preview.appendChild(imageWrapper);\n preview.appendChild(fileNameWrapper);\n dropzoneEl.prepend(preview);\n };\n reader.readAsDataURL(file);\n }\n /**\n * Handles the drop event on the dropzone.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleFileDrop(evt) {\n const file = evt.detail.acceptedFiles[0];\n handleFileSelect(file);\n }\n /**\n * Handles the resize event on the video-capture element.\n * It is responsible for resizing the scan frame based on the video element.\n */ function handleVideoCaptureResize() {\n (0, $d335f5b5c097c74d$export$1404f0e91c73fec)(videoCaptureEl.shadowRoot.querySelector(\"video\"), scanFrameEl);\n }\n /**\n * Handles the video play event on the video-capture element.\n * It is responsible for displaying the scan frame and starting the scan process.\n * It also handles the zoom controls if the browser supports it.\n *\n * @param {CustomEvent} evt - The event object.\n */ async function handleVideoCapturePlay(evt) {\n scanFrameEl.hidden = false;\n (0, $d335f5b5c097c74d$export$1404f0e91c73fec)(evt.detail.video, scanFrameEl);\n scan();\n const trackSettings = evt.target.getTrackSettings();\n const trackCapabilities = evt.target.getTrackCapabilities();\n const zoomLevelEl = document.getElementById(\"zoomLevel\");\n if (\"facingMode\" in trackSettings) facingModeButton.hidden = false;\n if (trackCapabilities?.torch) {\n torchButton.hidden = false;\n if (videoCaptureEl.hasAttribute(\"torch\")) (0, $7c034485d4f152a1$export$d1bd0b12fe0d046)({\n el: torchButton,\n isTorchOn: true\n });\n }\n if (trackSettings?.zoom && trackCapabilities?.zoom) {\n const zoomControls = document.getElementById(\"zoomControls\");\n const minZoom = trackCapabilities?.zoom?.min || 0;\n const maxZoom = trackCapabilities?.zoom?.max || 10;\n let currentZoom = trackSettings?.zoom || 1;\n zoomControls.hidden = false;\n zoomLevelEl.textContent = currentZoom;\n const handleZoomControlsClick = (evt)=>{\n const zoomInBtn = evt.target.closest('[data-action=\"zoom-in\"]');\n const zoomOutBtn = evt.target.closest('[data-action=\"zoom-out\"]');\n if (zoomInBtn && currentZoom < maxZoom) currentZoom += 0.5;\n if (zoomOutBtn && currentZoom > minZoom) currentZoom -= 0.5;\n zoomLevelEl.textContent = currentZoom;\n videoCaptureEl.zoom = currentZoom;\n };\n zoomControls.addEventListener(\"click\", handleZoomControlsClick);\n }\n if (hasExperimentalFlag) {\n const videoInputDevices = await (0, $149eedd8690347fa$export$682e9ed90a89bb4a).getVideoInputDevices();\n videoInputDevices.forEach((device, index)=>{\n const option = document.createElement(\"option\");\n option.value = device.deviceId;\n option.textContent = device.label || `Camera ${index + 1}`;\n cameraSelect.appendChild(option);\n });\n if (videoInputDevices.length > 1) cameraSelect.hidden = false;\n }\n }\n /**\n * Handles the error event on the video-capture element.\n * It is responsible for displaying an error message if the camera cannot be accessed or permission is denied.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleVideoCaptureError(evt) {\n const error = evt.detail.error;\n if (error.name === \"NotFoundError\") // If the browser cannot find all media tracks with the specified types that meet the constraints given.\n return;\n const errorMessage = error.name === \"NotAllowedError\" ? \"Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.\" : error.message;\n cameraPanel.innerHTML = /* html */ `
    ${errorMessage}
    `;\n }\n /**\n * Handles the settings button click event.\n * It is responsible for displaying the settings dialog.\n */ function handleSettingsButtonClick() {\n settingsDialog.open = true;\n }\n /**\n * Handles the change event on the settings form.\n * It is responsible for saving the settings to persistent storage and updating the settings.\n *\n * @param {Event} evt - The event object.\n */ function handleSettingsFormChange(evt) {\n const settings = {};\n const checkboxes = evt.currentTarget.querySelectorAll('input[type=\"checkbox\"]');\n checkboxes.forEach((item)=>settings[item.name] = item.checked);\n (0, $c96efe8837e99c11$export$dc86d17a64679bc7)(settings);\n }\n /**\n * Handles the click event on the history button.\n * It is responsible for displaying the history dialog.\n */ function handleHistoryButtonClick() {\n historyDialog.open = true;\n }\n /**\n * Handles the click event on the history dialog.\n * It is responsible for closing the dialog, deleting an item from the history, or emptying the history.\n *\n * @param {MouseEvent} evt - The event object.\n */ function handleHistoryDialogClick(evt) {\n const target = evt.target;\n // Handle delete action\n if (target.closest('[data-action=\"delete\"]')) {\n const value = target.closest(\"li\").dataset.value;\n if (window.confirm(`Delete history item ${value}?`)) {\n (0, $2cce6ab38d28b4d0$export$3a61248021dae916)(value);\n return;\n }\n }\n // Handle empty history action\n if (target.closest(\"#emptyHistoryBtn\")) {\n if (window.confirm(\"Empty history? This action cannot be undone.\")) {\n (0, $2cce6ab38d28b4d0$export$9f74b61e5d33cda2)();\n return;\n }\n }\n }\n /**\n * Handles the click event on the facing mode button.\n * It is responsible for toggling the camera facing mode.\n */ function handleFacingModeButtonClick() {\n const facingMode = videoCaptureEl.facingMode === \"user\" ? \"environment\" : \"user\";\n videoCaptureEl.facingMode = facingMode;\n if (typeof videoCaptureEl.restartVideoStream === \"function\") videoCaptureEl.restartVideoStream(cameraSelect?.value || undefined);\n }\n /**\n * Handles the click event on the torch button.\n * It is responsible for toggling the torch on and off.\n *\n * @param {MouseEvent} evt - The event object.\n */ function handleTorchButtonClick(evt) {\n videoCaptureEl.torch = !videoCaptureEl.torch;\n (0, $7c034485d4f152a1$export$d1bd0b12fe0d046)({\n el: evt.currentTarget,\n isTorchOn: videoCaptureEl.hasAttribute(\"torch\")\n });\n }\n /**\n * Handles the change event on the camera select element.\n * It is responsible for restarting the video stream with the selected video input device id.\n *\n * @param {Event} evt - The event object.\n */ function handleCameraSelectChange(evt) {\n const videoDeviceId = evt.target.value || undefined;\n if (typeof videoCaptureEl.restartVideoStream === \"function\") videoCaptureEl.restartVideoStream(videoDeviceId);\n }\n /**\n * Handles the visibility change event on the document.\n * It is responsible for stopping the scan process when the document is not visible.\n */ function handleDocumentVisibilityChange() {\n const selectedTab = tabGroupEl.querySelector(\"[selected]\");\n const tabId = selectedTab.getAttribute(\"id\");\n if (tabId !== \"cameraTab\") return;\n if (document.visibilityState === \"hidden\") {\n shouldScan = false;\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === \"function\") videoCaptureEl.stopVideoStream();\n } else {\n shouldScan = true;\n // Get the latest instance of video-capture element to ensure we don't use the cached one.\n const videoCaptureEl = document.querySelector(\"video-capture\");\n if (!videoCaptureEl) return;\n if (!videoCaptureEl.loading && !cameraPanel.querySelector(\"scan-result\")) scan();\n if (typeof videoCaptureEl.startVideoStream === \"function\") videoCaptureEl.startVideoStream();\n }\n }\n /**\n * Handles the escape key press event on the document.\n * It is responsible for triggering the scan button click event if there is already a barcode detected.\n */ function handleDocumentEscapeKey() {\n const cameraTabSelected = tabGroupEl.querySelector(\"#cameraTab\").hasAttribute(\"selected\");\n const scanBtnVisible = !scanBtn.hidden;\n const settingsDialogOpen = settingsDialog.hasAttribute(\"open\");\n const historyDialogOpen = historyDialog.hasAttribute(\"open\");\n const anyDialogOpen = settingsDialogOpen || historyDialogOpen;\n if (!scanBtnVisible || !cameraTabSelected || anyDialogOpen) return;\n scanBtn.click();\n }\n /**\n * Handles the key down event on the document.\n */ function handleDocumentKeyDown(evt) {\n if (evt.key === \"Escape\") handleDocumentEscapeKey();\n }\n scanBtn.addEventListener(\"click\", handleScanButtonClick);\n tabGroupEl.addEventListener(\"a-tab-show\", (0, $f7942db15ba0cc81$export$61fc7d43ac8f84b0)(handleTabShow, 250));\n dropzoneEl.addEventListener(\"files-dropzone-drop\", handleFileDrop);\n resizeObserverEl.addEventListener(\"resize-observer:resize\", handleVideoCaptureResize);\n settingsBtn.addEventListener(\"click\", handleSettingsButtonClick);\n settingsForm.addEventListener(\"change\", handleSettingsFormChange);\n historyBtn.addEventListener(\"click\", handleHistoryButtonClick);\n historyDialog.addEventListener(\"click\", handleHistoryDialogClick);\n facingModeButton.addEventListener(\"click\", handleFacingModeButtonClick);\n torchButton.addEventListener(\"click\", handleTorchButtonClick);\n hasExperimentalFlag && cameraSelect.addEventListener(\"change\", handleCameraSelectChange);\n document.addEventListener(\"visibilitychange\", handleDocumentVisibilityChange);\n document.addEventListener(\"keydown\", handleDocumentKeyDown);\n})();\n\n})();\n//# sourceMappingURL=index.a88fc2f6.js.map\n","module.exports = (require(\"./helpers/browser/js-loader\")(require('./helpers/bundle-manifest').resolve(\"iqysf\"))).then(() => parcelRequire('dZsGG'));","\"use strict\";\n\nvar cacheLoader = require('../cacheLoader');\nmodule.exports = cacheLoader(function (bundle) {\n return new Promise(function (resolve, reject) {\n // Don't insert the same script twice (e.g. if it was already in the HTML)\n var existingScripts = document.getElementsByTagName('script');\n if ([].concat(existingScripts).some(function isCurrentBundle(script) {\n return script.src === bundle;\n })) {\n resolve();\n return;\n }\n var preloadLink = document.createElement('link');\n preloadLink.href = bundle;\n preloadLink.rel = 'preload';\n preloadLink.as = 'script';\n document.head.appendChild(preloadLink);\n var script = document.createElement('script');\n script.async = true;\n script.type = 'text/javascript';\n script.src = bundle;\n script.onerror = function (e) {\n var error = new TypeError(\"Failed to fetch dynamically imported module: \".concat(bundle, \". Error: \").concat(e.message));\n script.onerror = script.onload = null;\n script.remove();\n reject(error);\n };\n script.onload = function () {\n script.onerror = script.onload = null;\n resolve();\n };\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n});","\"use strict\";\n\nvar cachedBundles = {};\nvar cachedPreloads = {};\nvar cachedPrefetches = {};\nfunction getCache(type) {\n switch (type) {\n case 'preload':\n return cachedPreloads;\n case 'prefetch':\n return cachedPrefetches;\n default:\n return cachedBundles;\n }\n}\nmodule.exports = function (loader, type) {\n return function (bundle) {\n var cache = getCache(type);\n if (cache[bundle]) {\n return cache[bundle];\n }\n return cache[bundle] = loader.apply(null, arguments).catch(function (e) {\n delete cache[bundle];\n throw e;\n });\n };\n};","import '@georapbox/a-tab-group/dist/a-tab-group.js';\nimport '@georapbox/web-share-element/dist/web-share-defined.js';\nimport '@georapbox/files-dropzone-element/dist/files-dropzone-defined.js';\nimport '@georapbox/resize-observer-element/dist/resize-observer-defined.js';\nimport '@georapbox/modal-element/dist/modal-element-defined.js';\nimport { EXPERIMENTAL_FLAG, NO_BARCODE_DETECTED, ACCEPTED_MIME_TYPES } from './constants.js';\nimport { getHistory, setSettings } from './services/storage.js';\nimport { debounce } from './utils/debounce.js';\nimport { log } from './utils/log.js';\nimport { isDialogElementSupported } from './utils/isDialogElementSupported.js';\nimport { renderSupportedFormats } from './helpers/renderSupportedFormats.js';\nimport {\n addToHistory,\n removeFromHistory,\n emptyHistory,\n renderHistoryList\n} from './helpers/history.js';\nimport { hideResult, showResult } from './helpers/results.js';\nimport { triggerScanEffects } from './helpers/triggerScanEffects.js';\nimport { resizeScanFrame } from './helpers/resizeScanFrame.js';\nimport { BarcodeReader } from './helpers/BarcodeReader.js';\nimport { initializeSettingsForm } from './helpers/initializeSettingsForm.js';\nimport { toggleTorchButtonStatus } from './helpers/toggleTorchButtonStatus.js';\nimport { VideoCapture } from './components/video-capture.js';\nimport './components/clipboard-copy.js';\nimport './components/scan-result.js';\n\n(async function () {\n const hasExperimentalFlag = new URLSearchParams(window.location.search).has(EXPERIMENTAL_FLAG);\n const tabGroupEl = document.querySelector('a-tab-group');\n const videoCaptureEl = document.querySelector('video-capture');\n const cameraPanel = document.getElementById('cameraPanel');\n const filePanel = document.getElementById('filePanel');\n const scanInstructionsEl = document.getElementById('scanInstructions');\n const scanBtn = document.getElementById('scanBtn');\n const dropzoneEl = document.getElementById('dropzone');\n const resizeObserverEl = document.querySelector('resize-observer');\n const scanFrameEl = document.getElementById('scanFrame');\n const facingModeButton = document.getElementById('facingModeButton');\n const torchButton = document.getElementById('torchButton');\n const globalActionsEl = document.getElementById('globalActions');\n const historyBtn = document.getElementById('historyBtn');\n const historyDialog = document.getElementById('historyDialog');\n const settingsBtn = document.getElementById('settingsBtn');\n const settingsDialog = document.getElementById('settingsDialog');\n const settingsForm = document.forms['settings-form'];\n const cameraSelect = document.getElementById('cameraSelect');\n let shouldScan = true;\n let rafId;\n\n // By default the dialog elements are hidden for browsers that don't support the dialog element.\n // If the dialog element is supported, we remove the hidden attribute and the dialogs' visibility\n // is controlled by using the `showModal()` and `close()` methods.\n if (isDialogElementSupported()) {\n globalActionsEl.hidden = false;\n historyDialog.hidden = false;\n settingsDialog.hidden = false;\n }\n\n const { barcodeReader, barcodeFormats, barcodeReaderError } = await BarcodeReader.init();\n\n if (barcodeReaderError) {\n const alertEl = document.getElementById('barcodeReaderError');\n\n shouldScan = false;\n globalActionsEl.hidden = true;\n tabGroupEl.hidden = true;\n alertEl.hidden = false;\n alertEl.textContent = barcodeReaderError?.message;\n return; // Stop the script execution as BarcodeDetector API is not supported.\n }\n\n videoCaptureEl.addEventListener('video-capture:video-play', handleVideoCapturePlay, {\n once: true\n });\n\n videoCaptureEl.addEventListener('video-capture:error', handleVideoCaptureError, {\n once: true\n });\n\n VideoCapture.defineCustomElement();\n\n const videoCaptureVideoEl = videoCaptureEl?.shadowRoot?.querySelector('video');\n\n dropzoneEl.accept = ACCEPTED_MIME_TYPES.join(',');\n initializeSettingsForm(settingsForm);\n renderSupportedFormats(barcodeFormats);\n renderHistoryList((await getHistory())[1] || []);\n\n /**\n * Scans for barcodes.\n * If a barcode is detected, it stops scanning and displays the result.\n *\n * @returns {Promise} - A Promise that resolves when the barcode is detected.\n */\n async function scan() {\n log('Scanning...');\n\n scanInstructionsEl.hidden = false;\n\n try {\n const barcode = await barcodeReader.detect(videoCaptureVideoEl);\n const barcodeValue = barcode?.rawValue ?? '';\n\n if (!barcodeValue) {\n throw new Error(NO_BARCODE_DETECTED);\n }\n\n window.cancelAnimationFrame(rafId);\n showResult(cameraPanel, barcodeValue);\n addToHistory(barcodeValue);\n scanInstructionsEl.hidden = true;\n scanBtn.hidden = false;\n scanFrameEl.hidden = true;\n triggerScanEffects();\n return;\n } catch {\n // If no barcode is detected, the error is caught here.\n // We can ignore the error and continue scanning.\n }\n\n if (shouldScan) {\n rafId = window.requestAnimationFrame(() => scan());\n }\n }\n\n /**\n * Handles the click event on the scan button.\n * It is responsible for clearing previous results and starting the scan process again.\n */\n function handleScanButtonClick() {\n scanBtn.hidden = true;\n scanFrameEl.hidden = false;\n hideResult(cameraPanel);\n scan();\n }\n\n /**\n * Handles the tab show event.\n * It is responsible for starting or stopping the scan process based on the selected tab.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleTabShow(evt) {\n const tabId = evt.detail.tabId;\n const videoCaptureEl = document.querySelector('video-capture'); // Get the latest instance of video-capture element to ensure we don't use the cached one.\n\n if (tabId === 'cameraTab') {\n shouldScan = true;\n\n if (!videoCaptureEl) {\n return;\n }\n\n if (!videoCaptureEl.loading && !cameraPanel.querySelector('scan-result')) {\n scan();\n }\n\n if (typeof videoCaptureEl.startVideoStream === 'function') {\n videoCaptureEl.startVideoStream();\n }\n } else if (tabId === 'fileTab') {\n shouldScan = false;\n\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === 'function') {\n videoCaptureEl.stopVideoStream();\n }\n }\n }\n\n /**\n * Handles the selection of a file.\n * It is responsible for displaying the selected file in the dropzone.\n *\n * @param {File} file - The selected file.\n */\n function handleFileSelect(file) {\n if (!file) {\n return;\n }\n\n const image = new Image();\n const reader = new FileReader();\n\n reader.onload = evt => {\n const data = evt.target.result;\n\n image.onload = async () => {\n try {\n const barcode = await barcodeReader.detect(image);\n const barcodeValue = barcode?.rawValue ?? '';\n\n if (!barcodeValue) {\n throw new Error(NO_BARCODE_DETECTED);\n }\n\n showResult(filePanel, barcodeValue);\n addToHistory(barcodeValue);\n triggerScanEffects();\n } catch (err) {\n log(err);\n showResult(filePanel, NO_BARCODE_DETECTED);\n triggerScanEffects({ success: false });\n }\n };\n\n image.src = data;\n image.alt = 'Image preview';\n\n dropzoneEl.replaceChildren();\n\n const preview = document.createElement('div');\n preview.className = 'dropzone-preview';\n preview.setAttribute('aria-hidden', 'true');\n\n const imageWrapper = document.createElement('div');\n imageWrapper.className = 'dropzone-preview__image-wrapper';\n\n const fileNameWrapper = document.createElement('div');\n fileNameWrapper.className = 'dropzone-preview__file-name';\n fileNameWrapper.textContent = file.name;\n\n imageWrapper.appendChild(image);\n preview.appendChild(imageWrapper);\n preview.appendChild(fileNameWrapper);\n dropzoneEl.prepend(preview);\n };\n\n reader.readAsDataURL(file);\n }\n\n /**\n * Handles the drop event on the dropzone.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleFileDrop(evt) {\n const file = evt.detail.acceptedFiles[0];\n handleFileSelect(file);\n }\n\n /**\n * Handles the resize event on the video-capture element.\n * It is responsible for resizing the scan frame based on the video element.\n */\n function handleVideoCaptureResize() {\n resizeScanFrame(videoCaptureEl.shadowRoot.querySelector('video'), scanFrameEl);\n }\n\n /**\n * Handles the video play event on the video-capture element.\n * It is responsible for displaying the scan frame and starting the scan process.\n * It also handles the zoom controls if the browser supports it.\n *\n * @param {CustomEvent} evt - The event object.\n */\n async function handleVideoCapturePlay(evt) {\n scanFrameEl.hidden = false;\n resizeScanFrame(evt.detail.video, scanFrameEl);\n scan();\n\n const trackSettings = evt.target.getTrackSettings();\n const trackCapabilities = evt.target.getTrackCapabilities();\n const zoomLevelEl = document.getElementById('zoomLevel');\n\n if ('facingMode' in trackSettings) {\n facingModeButton.hidden = false;\n }\n\n if (trackCapabilities?.torch) {\n torchButton.hidden = false;\n\n if (videoCaptureEl.hasAttribute('torch')) {\n toggleTorchButtonStatus({ el: torchButton, isTorchOn: true });\n }\n }\n\n if (trackSettings?.zoom && trackCapabilities?.zoom) {\n const zoomControls = document.getElementById('zoomControls');\n const minZoom = trackCapabilities?.zoom?.min || 0;\n const maxZoom = trackCapabilities?.zoom?.max || 10;\n let currentZoom = trackSettings?.zoom || 1;\n\n zoomControls.hidden = false;\n zoomLevelEl.textContent = currentZoom;\n\n const handleZoomControlsClick = evt => {\n const zoomInBtn = evt.target.closest('[data-action=\"zoom-in\"]');\n const zoomOutBtn = evt.target.closest('[data-action=\"zoom-out\"]');\n\n if (zoomInBtn && currentZoom < maxZoom) {\n currentZoom += 0.5;\n }\n\n if (zoomOutBtn && currentZoom > minZoom) {\n currentZoom -= 0.5;\n }\n\n zoomLevelEl.textContent = currentZoom;\n videoCaptureEl.zoom = currentZoom;\n };\n\n zoomControls.addEventListener('click', handleZoomControlsClick);\n }\n\n if (hasExperimentalFlag) {\n const videoInputDevices = await VideoCapture.getVideoInputDevices();\n\n videoInputDevices.forEach((device, index) => {\n const option = document.createElement('option');\n option.value = device.deviceId;\n option.textContent = device.label || `Camera ${index + 1}`;\n cameraSelect.appendChild(option);\n });\n\n if (videoInputDevices.length > 1) {\n cameraSelect.hidden = false;\n }\n }\n }\n\n /**\n * Handles the error event on the video-capture element.\n * It is responsible for displaying an error message if the camera cannot be accessed or permission is denied.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleVideoCaptureError(evt) {\n const error = evt.detail.error;\n\n if (error.name === 'NotFoundError') {\n // If the browser cannot find all media tracks with the specified types that meet the constraints given.\n return;\n }\n\n const errorMessage =\n error.name === 'NotAllowedError'\n ? 'Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.'\n : error.message;\n\n cameraPanel.innerHTML = /* html */ `
    ${errorMessage}
    `;\n }\n\n /**\n * Handles the settings button click event.\n * It is responsible for displaying the settings dialog.\n */\n function handleSettingsButtonClick() {\n settingsDialog.open = true;\n }\n\n /**\n * Handles the change event on the settings form.\n * It is responsible for saving the settings to persistent storage and updating the settings.\n *\n * @param {Event} evt - The event object.\n */\n function handleSettingsFormChange(evt) {\n const settings = {};\n const checkboxes = evt.currentTarget.querySelectorAll('input[type=\"checkbox\"]');\n\n checkboxes.forEach(item => (settings[item.name] = item.checked));\n setSettings(settings);\n }\n\n /**\n * Handles the click event on the history button.\n * It is responsible for displaying the history dialog.\n */\n function handleHistoryButtonClick() {\n historyDialog.open = true;\n }\n\n /**\n * Handles the click event on the history dialog.\n * It is responsible for closing the dialog, deleting an item from the history, or emptying the history.\n *\n * @param {MouseEvent} evt - The event object.\n */\n function handleHistoryDialogClick(evt) {\n const target = evt.target;\n\n // Handle delete action\n if (target.closest('[data-action=\"delete\"]')) {\n const value = target.closest('li').dataset.value;\n\n if (window.confirm(`Delete history item ${value}?`)) {\n removeFromHistory(value);\n return;\n }\n }\n\n // Handle empty history action\n if (target.closest('#emptyHistoryBtn')) {\n if (window.confirm('Empty history? This action cannot be undone.')) {\n emptyHistory();\n return;\n }\n }\n }\n\n /**\n * Handles the click event on the facing mode button.\n * It is responsible for toggling the camera facing mode.\n */\n function handleFacingModeButtonClick() {\n const facingMode = videoCaptureEl.facingMode === 'user' ? 'environment' : 'user';\n\n videoCaptureEl.facingMode = facingMode;\n\n if (typeof videoCaptureEl.restartVideoStream === 'function') {\n videoCaptureEl.restartVideoStream(cameraSelect?.value || undefined);\n }\n }\n\n /**\n * Handles the click event on the torch button.\n * It is responsible for toggling the torch on and off.\n *\n * @param {MouseEvent} evt - The event object.\n */\n function handleTorchButtonClick(evt) {\n videoCaptureEl.torch = !videoCaptureEl.torch;\n\n toggleTorchButtonStatus({\n el: evt.currentTarget,\n isTorchOn: videoCaptureEl.hasAttribute('torch')\n });\n }\n\n /**\n * Handles the change event on the camera select element.\n * It is responsible for restarting the video stream with the selected video input device id.\n *\n * @param {Event} evt - The event object.\n */\n function handleCameraSelectChange(evt) {\n const videoDeviceId = evt.target.value || undefined;\n\n if (typeof videoCaptureEl.restartVideoStream === 'function') {\n videoCaptureEl.restartVideoStream(videoDeviceId);\n }\n }\n\n /**\n * Handles the visibility change event on the document.\n * It is responsible for stopping the scan process when the document is not visible.\n */\n function handleDocumentVisibilityChange() {\n const selectedTab = tabGroupEl.querySelector('[selected]');\n const tabId = selectedTab.getAttribute('id');\n\n if (tabId !== 'cameraTab') {\n return;\n }\n\n if (document.visibilityState === 'hidden') {\n shouldScan = false;\n\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === 'function') {\n videoCaptureEl.stopVideoStream();\n }\n } else {\n shouldScan = true;\n\n // Get the latest instance of video-capture element to ensure we don't use the cached one.\n const videoCaptureEl = document.querySelector('video-capture');\n\n if (!videoCaptureEl) {\n return;\n }\n\n if (!videoCaptureEl.loading && !cameraPanel.querySelector('scan-result')) {\n scan();\n }\n\n if (typeof videoCaptureEl.startVideoStream === 'function') {\n videoCaptureEl.startVideoStream();\n }\n }\n }\n\n /**\n * Handles the escape key press event on the document.\n * It is responsible for triggering the scan button click event if there is already a barcode detected.\n */\n function handleDocumentEscapeKey() {\n const cameraTabSelected = tabGroupEl.querySelector('#cameraTab').hasAttribute('selected');\n const scanBtnVisible = !scanBtn.hidden;\n const settingsDialogOpen = settingsDialog.hasAttribute('open');\n const historyDialogOpen = historyDialog.hasAttribute('open');\n const anyDialogOpen = settingsDialogOpen || historyDialogOpen;\n\n if (!scanBtnVisible || !cameraTabSelected || anyDialogOpen) {\n return;\n }\n\n scanBtn.click();\n }\n\n /**\n * Handles the key down event on the document.\n */\n function handleDocumentKeyDown(evt) {\n if (evt.key === 'Escape') {\n handleDocumentEscapeKey();\n }\n }\n\n scanBtn.addEventListener('click', handleScanButtonClick);\n tabGroupEl.addEventListener('a-tab-show', debounce(handleTabShow, 250));\n dropzoneEl.addEventListener('files-dropzone-drop', handleFileDrop);\n resizeObserverEl.addEventListener('resize-observer:resize', handleVideoCaptureResize);\n settingsBtn.addEventListener('click', handleSettingsButtonClick);\n settingsForm.addEventListener('change', handleSettingsFormChange);\n historyBtn.addEventListener('click', handleHistoryButtonClick);\n historyDialog.addEventListener('click', handleHistoryDialogClick);\n facingModeButton.addEventListener('click', handleFacingModeButtonClick);\n torchButton.addEventListener('click', handleTorchButtonClick);\n hasExperimentalFlag && cameraSelect.addEventListener('change', handleCameraSelectChange);\n document.addEventListener('visibilitychange', handleDocumentVisibilityChange);\n document.addEventListener('keydown', handleDocumentKeyDown);\n})();\n","/*!\n * @georapbox/a-tab-group\n * A custom element to create a group of tabs and tab panels.\n *\n * @version 2.4.1\n * @homepage https://github.com/georapbox/a-tab-group#readme\n * @author George Raptis \n * @license MIT\n */\nvar h=(a=\"\",t=\"\")=>{let e=typeof a==\"string\"&&a!==\"\"?a+\"-\":\"\",s=typeof t==\"string\"&&t!==\"\"?\"-\"+t:\"\",i=Math.random().toString(36).substring(2,8);return`${e}${i}${s}`};var b=(a,t)=>{if(Object.prototype.hasOwnProperty.call(t,a)){let e=t[a];delete t[a],t[a]=e}};var E=0,C=`\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`,w=document.createElement(\"template\");w.innerHTML=`\n \n\n
    \n \n
    \n`;var u=class a extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(w.content.cloneNode(!0))}static get observedAttributes(){return[\"selected\",\"disabled\",\"closable\"]}attributeChangedCallback(t,e,s){if(t===\"selected\"&&e!==s&&(this.setAttribute(\"aria-selected\",this.selected.toString()),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")),t===\"disabled\"&&e!==s&&(this.setAttribute(\"aria-disabled\",this.disabled.toString()),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")),t===\"closable\"&&e!==s)if(this.closable){let i=document.createElement(\"span\");i.className=\"tab__close\",i.setAttribute(\"part\",\"close-tab\"),i.innerHTML='',this.shadowRoot?.querySelector(\".tab\")?.appendChild(i),i.addEventListener(\"click\",this.#e)}else{let i=this.shadowRoot?.querySelector(\".tab__close\");i?.removeEventListener(\"click\",this.#e),i?.remove()}}connectedCallback(){this.#s(\"selected\"),this.#s(\"disabled\"),this.#s(\"closable\"),this.id||(this.id=h(\"tab\",(++E).toString())),this.setAttribute(\"slot\",\"tab\"),this.setAttribute(\"role\",\"tab\"),this.setAttribute(\"aria-selected\",\"false\"),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")}disconnectedCallback(){this.shadowRoot?.querySelector(\".tab__close\")?.removeEventListener(\"click\",this.#e)}get selected(){return this.hasAttribute(\"selected\")}set selected(t){this.toggleAttribute(\"selected\",!!t)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get closable(){return this.hasAttribute(\"closable\")}set closable(t){this.toggleAttribute(\"closable\",!!t)}#e=t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent(\"a-tab-close\",{bubbles:!0,composed:!0,detail:{tabId:this.id}}))};#s(t){return b(t,this)}static defineCustomElement(t=\"a-tab\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};u.defineCustomElement();var L=0,S=`\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`,T=document.createElement(\"template\");T.innerHTML=`\n \n\n
    \n \n
    \n`;var p=class a extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(T.content.cloneNode(!0))}connectedCallback(){this.setAttribute(\"slot\",\"panel\"),this.setAttribute(\"role\",\"tabpanel\"),this.setAttribute(\"hidden\",\"\"),this.id||(this.id=h(\"panel\",(++L).toString()))}static defineCustomElement(t=\"a-tab-panel\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};p.defineCustomElement();var y=200,n={TOP:\"top\",BOTTOM:\"bottom\",START:\"start\",END:\"end\"},l={LTR:\"ltr\",RTL:\"rtl\"},R=Object.entries(n).map(([,a])=>a),r={AUTO:\"auto\",MANUAL:\"manual\"},c={DOWN:\"ArrowDown\",LEFT:\"ArrowLeft\",RIGHT:\"ArrowRight\",UP:\"ArrowUp\",HOME:\"Home\",END:\"End\",ENTER:\"Enter\",SPACE:\" \"},x=`\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${l.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${l.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${l.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${l.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${n.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${n.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${n.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${n.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${n.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${n.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${n.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`,A=document.createElement(\"template\");A.innerHTML=`\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;var f=class a extends HTMLElement{#e=null;#s=null;#l=!1;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(A.content.cloneNode(!0))}static get observedAttributes(){return[\"placement\",\"no-scroll-controls\"]}attributeChangedCallback(t,e,s){t===\"placement\"&&e!==s&&this.#i(),t===\"no-scroll-controls\"&&e!==s&&this.#i()}get placement(){return this.getAttribute(\"placement\")||n.TOP}set placement(t){t!=null&&this.setAttribute(\"placement\",t)}get noScrollControls(){return this.hasAttribute(\"no-scroll-controls\")}set noScrollControls(t){this.toggleAttribute(\"no-scroll-controls\",!!t)}get scrollDistance(){let t=Number(this.getAttribute(\"scroll-distance\"));return Math.abs(t)||y}set scrollDistance(t){this.setAttribute(\"scroll-distance\",Math.abs(t).toString()||y.toString())}get activation(){return this.getAttribute(\"activation\")||r.AUTO}set activation(t){this.setAttribute(\"activation\",t||r.AUTO)}get noTabCycling(){return this.hasAttribute(\"no-tab-cycling\")}set noTabCycling(t){this.toggleAttribute(\"no-tab-cycling\",!!t)}connectedCallback(){this.#o(\"placement\"),this.#o(\"noScrollControls\"),this.#o(\"scrollDistance\"),this.#o(\"activation\"),this.#o(\"noTabCycling\");let t=this.shadowRoot?.querySelector(\"slot[name=tab]\"),e=this.shadowRoot?.querySelector(\"slot[name=panel]\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\"),i=this.shadowRoot?.querySelector(\".tab-group__nav\"),o=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);t?.addEventListener(\"slotchange\",this.#n),e?.addEventListener(\"slotchange\",this.#n),s?.addEventListener(\"click\",this.#g),s?.addEventListener(\"keydown\",this.#p),o.forEach(d=>d.addEventListener(\"click\",this.#f)),this.addEventListener(\"a-tab-close\",this.#m),\"ResizeObserver\"in window&&(this.#e=new ResizeObserver(d=>{this.#s=window.requestAnimationFrame(()=>{let v=d?.[0]?.target,g=v?.scrollWidth>v?.clientWidth;o.forEach(_=>_.toggleAttribute(\"hidden\",!g)),i?.part.toggle(\"nav--has-scroll-controls\",g),i?.classList.toggle(\"tab-group__nav--has-scroll-controls\",g)})})),this.#h(),this.#i()}disconnectedCallback(){let t=this.shadowRoot?.querySelector(\"slot[name=tab]\"),e=this.shadowRoot?.querySelector(\"slot[name=panel]\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\"),i=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);t?.removeEventListener(\"slotchange\",this.#n),e?.removeEventListener(\"slotchange\",this.#n),s?.removeEventListener(\"click\",this.#g),s?.removeEventListener(\"keydown\",this.#p),i.forEach(o=>o.removeEventListener(\"click\",this.#f)),this.removeEventListener(\"a-tab-close\",this.#m),this.#c()}#v(){if(!this.#e)return;let t=this.shadowRoot?.querySelector(\".tab-group__tabs\");t&&(this.#e.unobserve(t),this.#e.observe(t))}#c(){this.#e&&(this.#e.disconnect(),this.#s!==null&&(window.cancelAnimationFrame(this.#s),this.#s=null))}#d(){return window.CSS.supports(\"selector(:dir(ltr))\")?this.matches(\":dir(ltr)\")?l.LTR:l.RTL:window.getComputedStyle(this).direction||l.LTR}#h(){this.hidden=this.#t().length===0}#w(){let t=this.#t();this.#h(),t.forEach(e=>{let s=e.nextElementSibling;if(!s||s.tagName.toLowerCase()!==\"a-tab-panel\")return console.error(`Tab #${e.id} is not a sibling of a `);e.setAttribute(\"aria-controls\",s.id),s.setAttribute(\"aria-labelledby\",e.id)})}#T(){return Array.from(this.querySelectorAll(\"a-tab-panel\"))}#t(){return Array.from(this.querySelectorAll(\"a-tab\"))}#b(t){let e=t.getAttribute(\"aria-controls\");return this.querySelector(`#${e}`)}#y(){return this.#t().find(e=>!e.disabled)||null}#A(){let t=this.#t();for(let e=t.length-1;e>=0;e--)if(!t[e].disabled)return t[e];return null}#a(){let t=this.#t(),e=this.activation===r.MANUAL?t.findIndex(s=>s.matches(\":focus\"))-1:t.findIndex(s=>s.selected)-1;for(;t[(e+t.length)%t.length].disabled;)e--;return this.noTabCycling&&e<0?null:t[(e+t.length)%t.length]}#r(){let t=this.#t(),e=this.activation===r.MANUAL?t.findIndex(s=>s.matches(\":focus\"))+1:t.findIndex(s=>s.selected)+1;for(;t[e%t.length].disabled;)e++;return this.noTabCycling&&e>=t.length?null:t[e%t.length]}#_(){let t=this.#t(),e=this.#T();t.forEach(s=>s.selected=!1),e.forEach(s=>s.hidden=!0)}#i(){let t=this.shadowRoot?.querySelector(\".tab-group__nav\"),e=this.shadowRoot?.querySelector(\".tab-group__tabs\"),s=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);this.noScrollControls||this.placement===n.START||this.placement===n.END?(this.#c(),s.forEach(i=>i.hidden=!0),t?.part.remove(\"nav--has-scroll-controls\"),t?.classList.remove(\"tab-group__nav--has-scroll-controls\"),e?.setAttribute(\"aria-orientation\",\"vertical\")):(this.#v(),s.forEach(i=>i.hidden=!1),e?.setAttribute(\"aria-orientation\",\"horizontal\"))}#E(){let t=this.#t(),e=t.find(s=>s.selected&&!s.disabled)||t.find(s=>!s.disabled);e&&(this.#l&&!e.selected&&this.dispatchEvent(new CustomEvent(\"a-tab-show\",{bubbles:!0,composed:!0,detail:{tabId:e.id}})),this.#u(e))}#u(t){this.#_(),t&&(t.selected=!0);let e=this.#b(t);e&&(e.hidden=!1)}#n=t=>{this.#w(),this.#i(),this.#E(),t.target.name===\"tab\"&&(this.#l=!0)};#p=t=>{if(t.target.tagName.toLowerCase()!==\"a-tab\"||t.altKey)return;let e=R.includes(this.placement||\"\")?this.placement:n.TOP,s=[n.TOP,n.BOTTOM].includes(e||\"\")?\"horizontal\":\"vertical\",i=this.#d(),o=null;switch(t.key){case c.LEFT:s===\"horizontal\"&&(o=i===l.LTR?this.#a():this.#r(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.RIGHT:s===\"horizontal\"&&(o=i===l.LTR?this.#r():this.#a(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.UP:s===\"vertical\"&&(o=this.#a(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.DOWN:s===\"vertical\"&&(o=this.#r(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.HOME:o=this.#y(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o));break;case c.END:o=this.#A(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o));break;case c.ENTER:case c.SPACE:o=t.target,o&&this.selectTab(o);break;default:return}t.preventDefault()};#g=t=>{let e=t.target.closest(\"a-tab\");e&&this.selectTab(e)};#f=t=>{let e=t.target.closest(\".tab-group__scroll-button\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\");if(!e||!s)return;let i=e.classList.contains(\"tab-group__scroll-button--start\"),o=this.#d()===l.LTR,d=i?o?-1:1:o?1:-1,m=s.scrollLeft;s.scrollTo({left:m+d*this.scrollDistance})};#m=t=>{let e=t.target,s=this.#b(e);e&&(e.remove(),e.selected&&this.dispatchEvent(new CustomEvent(\"a-tab-hide\",{bubbles:!0,composed:!0,detail:{tabId:e.id}}))),s&&s.tagName.toLowerCase()===\"a-tab-panel\"&&s.remove()};#o(t){return b(t,this)}selectTabByIndex(t){let s=this.#t()[t];s&&this.selectTab(s)}selectTabById(t){let s=this.#t().find(i=>i.id===t);s&&this.selectTab(s)}selectTab(t){let e=this.#t().find(s=>s.selected);!t||t.disabled||t.selected||t.tagName.toLowerCase()!==\"a-tab\"||(this.#u(t),window.requestAnimationFrame(()=>{t.scrollIntoView({inline:\"nearest\",block:\"nearest\"}),t.focus()}),e&&this.dispatchEvent(new CustomEvent(\"a-tab-hide\",{bubbles:!0,composed:!0,detail:{tabId:e.id}})),this.dispatchEvent(new CustomEvent(\"a-tab-show\",{bubbles:!0,composed:!0,detail:{tabId:t.id}})))}static defineCustomElement(t=\"a-tab-group\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};f.defineCustomElement();export{u as ATab,f as ATabGroup,p as ATabPanel};\n//# sourceMappingURL=a-tab-group.js.map\n","// @ts-check\n\n/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */\nconst uid = (prefix = '', suffix = '') => {\n const prefixString = typeof prefix === 'string' && prefix !== '' ? prefix + '-' : '';\n const suffixString = typeof suffix === 'string' && suffix !== '' ? '-' + suffix : '';\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n\n return `${prefixString}${randomString}${suffixString}`;\n};\n\nexport { uid };\n","// @ts-check\n\n/**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n * @param {any} instance - The instance of the tab.\n */\nconst upgradeProperty = (prop, instance) => {\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n};\n\nexport { upgradeProperty };\n","// @ts-check\n\nimport { uid } from './utils/uid.js';\nimport { upgradeProperty } from './utils/upgrade-property.js';\n\nlet tabCounter = 0;\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n \n
    \n`;\n\n/**\n * @summary\n * This is a tab for a tab panel.\n * `` should always be used with `role=heading` in the markup so that the semantics remain useable when JavaScript is failing.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab\n * @extends HTMLElement\n *\n * @property {boolean} selected - Whether the tab is selected.\n * @property {boolean} disabled - Whether the tab is disabled.\n * @property {boolean} closable - Whether the tab is closable.\n *\n * @attribute selected - Reflects the selected property.\n * @attribute disabled - Reflects the disabled property.\n * @attribute closable - Reflects the closable property.\n *\n * @csspart base - The component's base wrapper.\n * @csspart close-tab - The close button.\n * @csspart close-tab-icon - The close button icon.\n *\n * @slot - The tab's content.\n *\n * @event a-tab-close - Fires when the tab's close button is clicked.\n */\nclass ATab extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['selected', 'disabled', 'closable'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'selected' && oldValue !== newValue) {\n this.setAttribute('aria-selected', this.selected.toString());\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n if (name === 'disabled' && oldValue !== newValue) {\n this.setAttribute('aria-disabled', this.disabled.toString());\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n if (name === 'closable' && oldValue !== newValue) {\n if (this.closable) {\n const closeButton = document.createElement('span');\n closeButton.className = 'tab__close';\n closeButton.setAttribute('part', 'close-tab');\n closeButton.innerHTML = /* html */ ``;\n this.shadowRoot?.querySelector('.tab')?.appendChild(closeButton);\n closeButton.addEventListener('click', this.#handleCloseButtonClick);\n } else {\n const closeButton = this.shadowRoot?.querySelector('.tab__close');\n closeButton?.removeEventListener('click', this.#handleCloseButtonClick);\n closeButton?.remove();\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('selected');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('closable');\n\n if (!this.id) {\n this.id = uid('tab', (++tabCounter).toString());\n }\n\n this.setAttribute('slot', 'tab');\n this.setAttribute('role', 'tab');\n this.setAttribute('aria-selected', 'false');\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n /**\n * Lifecycle method that is called when the element is disconnected from the DOM.\n */\n disconnectedCallback() {\n const closeButton = this.shadowRoot?.querySelector('.tab__close');\n closeButton?.removeEventListener('click', this.#handleCloseButtonClick);\n }\n\n /**\n * @type {boolean} - Whether the tab is selected.\n * @default false\n * @attribute selected - Reflects the selected property.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n set selected(value) {\n this.toggleAttribute('selected', !!value);\n }\n\n /**\n * @type {boolean} - Whether the tab is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {boolean} - Whether the tab is closable.\n * @default false\n * @attribute closable - Reflects the closable property.\n */\n get closable() {\n return this.hasAttribute('closable');\n }\n\n set closable(value) {\n this.toggleAttribute('closable', !!value);\n }\n\n /**\n * Handles the click event on the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n evt.stopPropagation();\n\n this.dispatchEvent(\n new CustomEvent(`a-tab-close`, {\n bubbles: true,\n composed: true,\n detail: { tabId: this.id }\n })\n );\n };\n\n /**\n * Wrapper for the `upgradeProperty` function.\n *\n * @param {'selected' | 'disabled' | 'closable'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n return upgradeProperty(prop, this);\n }\n\n static defineCustomElement(elementName = 'a-tab') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATab);\n }\n }\n}\n\nATab.defineCustomElement();\n\nexport { ATab };\n","// @ts-check\n\nimport { uid } from './utils/uid.js';\n\nlet panelCounter = 0;\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n \n
    \n`;\n\n/**\n * @summary This is a panel for a `` tab panel.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab-panel\n * @extends HTMLElement\n *\n * @csspart base - The component's base wrapper.\n *\n * @slot - The content of the tab panel.\n */\nclass ATabPanel extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.setAttribute('slot', 'panel');\n this.setAttribute('role', 'tabpanel');\n this.setAttribute('hidden', '');\n\n if (!this.id) {\n this.id = uid('panel', (++panelCounter).toString());\n }\n }\n\n static defineCustomElement(elementName = 'a-tab-panel') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATabPanel);\n }\n }\n}\n\nATabPanel.defineCustomElement();\n\nexport { ATabPanel };\n","// @ts-check\n\n/**\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/** @typedef {import('./a-tab').ATab} Tab */\n/** @typedef {import('./a-tab-panel').ATabPanel} TabPanel */\n\nexport { ATab } from './a-tab.js';\nexport { ATabPanel } from './a-tab-panel.js';\nimport { upgradeProperty } from './utils/upgrade-property.js';\n\n/**\n * The default scroll distance in pixels that the\n * tabs will scroll when the scroll buttons are clicked.\n */\nconst DEFAULT_SCROLL_DISTANCE = 200;\n\n/**\n * The available placements for the tabs.\n */\nconst PLACEMENT = {\n TOP: 'top',\n BOTTOM: 'bottom',\n START: 'start',\n END: 'end'\n};\n\n/**\n * The available directionality values for the tab group.\n */\nconst DIR = {\n LTR: 'ltr',\n RTL: 'rtl'\n};\n\n/**\n * The valid placements for the tabs.\n */\nconst validPlacements = Object.entries(PLACEMENT).map(([, value]) => value);\n\n/**\n * The available activation modes for the tabs.\n */\nconst ACTIVATION = {\n AUTO: 'auto',\n MANUAL: 'manual'\n};\n\n/**\n * Defines key codes to help with handling keyboard events.\n */\nconst KEYCODE = {\n DOWN: 'ArrowDown',\n LEFT: 'ArrowLeft',\n RIGHT: 'ArrowRight',\n UP: 'ArrowUp',\n HOME: 'Home',\n END: 'End',\n ENTER: 'Enter',\n SPACE: ' '\n};\n\nconst styles = /* css */ `\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${DIR.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${DIR.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${DIR.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${DIR.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${PLACEMENT.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${PLACEMENT.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${PLACEMENT.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;\n\n/**\n * @summary Container element for tabs and panels. All children of should be either `` or ``.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab-group\n * @extends HTMLElement\n *\n * @property {string} placement - The placement of the tabs.\n * @property {boolean} noScrollControls - Whether or not the scroll controls are enabled.\n * @property {number} scrollDistance - The distance in pixels that the tabs will scroll when the scroll buttons are clicked.\n * @property {string} activation - The activation mode of the tabs.\n * @property {boolean} noTabCycling - Whether or not the tabs should cycle when reaching the first or last tab using the keyboard.\n *\n * @attribute placement - Reflects the placement property.\n * @attribute no-scroll-controls - Reflects the noScrollControls property.\n * @attribute scroll-distance - Reflects the scrollDistance property.\n * @attribute activation - Reflects the activation property.\n * @attribute no-tab-cycling - Reflects the noTabCycling property.\n *\n * @slot tab - Used for groupping tabs in the tab group. Must be elements.\n * @slot panel - Used for groupping tab panels in the tab group. Must be elements.\n *\n * @csspart base - The component's base wrapper.\n * @csspart nav - The nav container.\n * @csspart nav--has-scroll-controls - The nav container when the scroll controls are enabled and visible.\n * @csspart scroll-button - The scroll button.\n * @csspart scroll-button--start - The scroll button for scrolling towards the start.\n * @csspart scroll-button--end - The scroll button for scrolling towards the end.\n * @csspart scroll-button-icon - The scroll button icon.\n * @csspart tabs - The tabs container.\n * @csspart panels - The panels container.\n *\n * @cssproperty --selected-tab-color - The color of the selected tab.\n * @cssproperty --selected-tab-bg-color - The background color of the selected tab.\n * @cssproperty --tabs-scroll-behavior - The scroll behavior of the tabs container.\n * @cssproperty --scroll-button-width - The width of the scroll buttons.\n * @cssproperty --scroll-button-height - The height of the scroll buttons.\n * @cssproperty --scroll-button-inline-offset - The inline offset of the scroll buttons.\n *\n * @event a-tab-show - Fired when a tab is shown.\n * @event a-tab-hide - Fired when a tab is shown.\n *\n * @method selectTabByIndex - Selects the tab at the given index.\n * @method selectTabById - Selects the tab with the given id.\n * @method selectTab - Selects the given tab.\n */\nclass ATabGroup extends HTMLElement {\n /** @type {Nullable} */\n #resizeObserver = null;\n\n /** @type {Nullable} */\n #rafId = null;\n\n /** @type {boolean} */\n #hasTabSlotChangedOnce = false;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['placement', 'no-scroll-controls'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'placement' && oldValue !== newValue) {\n this.#syncNav();\n }\n\n if (name === 'no-scroll-controls' && oldValue !== newValue) {\n this.#syncNav();\n }\n }\n\n /**\n * @type {Nullable} - The placement of the tabs.\n * @default 'top'\n * @attribute placement - Reflects the placement property.\n */\n get placement() {\n return this.getAttribute('placement') || PLACEMENT.TOP;\n }\n\n set placement(value) {\n if (value != null) {\n this.setAttribute('placement', value);\n }\n }\n\n /**\n * @type {boolean} - Whether or not the scroll controls are enabled.\n * @default false\n * @attribute no-scroll-controls - Reflects the noScrollControls property.\n */\n get noScrollControls() {\n return this.hasAttribute('no-scroll-controls');\n }\n\n set noScrollControls(value) {\n this.toggleAttribute('no-scroll-controls', !!value);\n }\n\n /**\n * @type {number} - The distance in pixels that the tabs will scroll when the scroll buttons are clicked.\n * @default 200\n * @attribute scroll-distance - Reflects the scrollDistance property.\n */\n get scrollDistance() {\n const value = Number(this.getAttribute('scroll-distance'));\n return Math.abs(value) || DEFAULT_SCROLL_DISTANCE;\n }\n\n set scrollDistance(value) {\n this.setAttribute('scroll-distance', Math.abs(value).toString() || DEFAULT_SCROLL_DISTANCE.toString());\n }\n\n /**\n * @type {string} - The activation mode of the tabs.\n * @default 'auto'\n * @attribute activation - Reflects the activation property.\n */\n get activation() {\n return this.getAttribute('activation') || ACTIVATION.AUTO;\n }\n\n set activation(value) {\n this.setAttribute('activation', value || ACTIVATION.AUTO);\n }\n\n /**\n * @type {boolean} - Whether or not the tabs should cycle when reaching the first or last tab using the keyboard.\n * @default false\n * @attribute no-tab-cycling - Reflects the noTabCycling property.\n */\n get noTabCycling() {\n return this.hasAttribute('no-tab-cycling');\n }\n\n set noTabCycling(value) {\n this.toggleAttribute('no-tab-cycling', !!value);\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('placement');\n this.#upgradeProperty('noScrollControls');\n this.#upgradeProperty('scrollDistance');\n this.#upgradeProperty('activation');\n this.#upgradeProperty('noTabCycling');\n\n const tabSlot = this.shadowRoot?.querySelector('slot[name=tab]');\n const panelSlot = this.shadowRoot?.querySelector('slot[name=panel]');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n const navContainer = this.shadowRoot?.querySelector('.tab-group__nav');\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n tabSlot?.addEventListener('slotchange', this.#handleSlotChange);\n panelSlot?.addEventListener('slotchange', this.#handleSlotChange);\n tabsContainer?.addEventListener('click', this.#handleTabClick);\n tabsContainer?.addEventListener('keydown', this.#handleKeyDown);\n scrollButtons.forEach(el => el.addEventListener('click', this.#handleScrollButtonClick));\n this.addEventListener('a-tab-close', this.#handleTabClose);\n\n if ('ResizeObserver' in window) {\n this.#resizeObserver = new ResizeObserver(entries => {\n this.#rafId = window.requestAnimationFrame(() => {\n const entry = entries?.[0];\n const targetElement = entry?.target;\n const isElementScrollable = targetElement?.scrollWidth > targetElement?.clientWidth;\n scrollButtons.forEach(el => el.toggleAttribute('hidden', !isElementScrollable));\n navContainer?.part.toggle('nav--has-scroll-controls', isElementScrollable);\n navContainer?.classList.toggle('tab-group__nav--has-scroll-controls', isElementScrollable);\n });\n });\n }\n\n this.#hideEmptyTabGroup();\n this.#syncNav();\n }\n\n /**\n * Lifecycle method that is called when the element is disconnected from the DOM.\n */\n disconnectedCallback() {\n const tabSlot = this.shadowRoot?.querySelector('slot[name=tab]');\n const panelSlot = this.shadowRoot?.querySelector('slot[name=panel]');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n tabSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n panelSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n tabsContainer?.removeEventListener('click', this.#handleTabClick);\n tabsContainer?.removeEventListener('keydown', this.#handleKeyDown);\n scrollButtons.forEach(el => el.removeEventListener('click', this.#handleScrollButtonClick));\n this.removeEventListener('a-tab-close', this.#handleTabClose);\n this.#stopResizeObserver();\n }\n\n /**\n * Starts observing the tabs container for resize events.\n */\n #startResizeObserver() {\n if (!this.#resizeObserver) {\n return;\n }\n\n const scrollElement = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n if (scrollElement) {\n this.#resizeObserver.unobserve(scrollElement);\n this.#resizeObserver.observe(scrollElement);\n }\n }\n\n /**\n * Stops observing the tabs container for resize events.\n */\n #stopResizeObserver() {\n if (!this.#resizeObserver) {\n return;\n }\n\n this.#resizeObserver.disconnect();\n\n if (this.#rafId !== null) {\n window.cancelAnimationFrame(this.#rafId);\n this.#rafId = null;\n }\n }\n\n /**\n * Gets the directionality of the tab group.\n *\n * @returns {'ltr' | 'rtl'} - The direction of the tab group.\n */\n #getDirectionality() {\n return /** @type {'ltr' | 'rtl'} */ (\n window.CSS.supports('selector(:dir(ltr))')\n ? this.matches(':dir(ltr)')\n ? DIR.LTR\n : DIR.RTL\n : window.getComputedStyle(this).direction || DIR.LTR\n );\n }\n\n /**\n * Hides the tab group if there are no tabs.\n */\n #hideEmptyTabGroup() {\n this.hidden = this.#allTabs().length === 0;\n }\n\n /**\n * Links up tabs with their adjacent panels using `aria-controls` and `aria-labelledby`.\n * This method makes sure only one tab is selected at a time.\n */\n #linkPanels() {\n const tabs = this.#allTabs();\n\n this.#hideEmptyTabGroup();\n\n // Give each panel a `aria-labelledby` attribute that refers to the tab that controls it.\n tabs.forEach(tab => {\n const panel = tab.nextElementSibling;\n\n if (!panel || panel.tagName.toLowerCase() !== 'a-tab-panel') {\n return console.error(`Tab #${tab.id} is not a sibling of a `);\n }\n\n tab.setAttribute('aria-controls', panel.id);\n panel.setAttribute('aria-labelledby', tab.id);\n });\n }\n\n /**\n * Get all panels in the tab group.\n *\n * @returns {TabPanel[]} - All the panels in the tab group.\n */\n #allPanels() {\n return Array.from(this.querySelectorAll('a-tab-panel'));\n }\n\n /**\n * Get all tabs in the tab group.\n *\n * @returns {Tab[]} - All the tabs in the tab group.\n */\n #allTabs() {\n return Array.from(this.querySelectorAll('a-tab'));\n }\n\n /**\n * Get the panel for the given tab.\n *\n * @param {Tab} tab - The tab whose panel is to be returned.\n * @returns {Nullable} - The panel controlled by the given tab.\n */\n #panelForTab(tab) {\n const panelId = tab.getAttribute('aria-controls');\n return this.querySelector(`#${panelId}`);\n }\n\n /**\n * Get the first non-disabled tab in the tab group.\n *\n * @returns {Nullable} - The first tab in the tab group.\n */\n #firstTab() {\n const tabs = this.#allTabs();\n return tabs.find(tab => !tab.disabled) || null;\n }\n\n /**\n * Get the last non-disabled tab in the tab group.\n *\n * @returns {Nullable} - The last tab in the tab group.\n */\n #lastTab() {\n const tabs = this.#allTabs();\n\n for (let i = tabs.length - 1; i >= 0; i--) {\n if (!tabs[i].disabled) {\n return tabs[i];\n }\n }\n\n return null;\n }\n\n /**\n * Get the tab that comes before the currently selected one, wrapping around when reaching the first tab.\n * If the currently selected tab is disabled, the method will skip it.\n *\n * @returns {Nullable} - The previous tab.\n */\n #prevTab() {\n const tabs = this.#allTabs();\n let newIdx =\n this.activation === ACTIVATION.MANUAL\n ? tabs.findIndex(tab => tab.matches(':focus')) - 1\n : tabs.findIndex(tab => tab.selected) - 1;\n\n // Keep looping until we find a non-disabled tab.\n while (tabs[(newIdx + tabs.length) % tabs.length].disabled) {\n newIdx--;\n }\n\n // Stop cycling through tabs if we reach the beginning and tab cycling is disabled.\n if (this.noTabCycling && newIdx < 0) {\n return null;\n }\n\n // Add `tabs.length` to make sure the index is a positive number and get the modulus to wrap around if necessary.\n return tabs[(newIdx + tabs.length) % tabs.length];\n }\n\n /**\n * Get the tab that comes after the currently selected one, wrapping around when reaching the last tab.\n * If the currently selected tab is disabled, the method will skip it.\n *\n * @returns {Nullable} - The next tab.\n */\n #nextTab() {\n const tabs = this.#allTabs();\n let newIdx =\n this.activation === ACTIVATION.MANUAL\n ? tabs.findIndex(tab => tab.matches(':focus')) + 1\n : tabs.findIndex(tab => tab.selected) + 1;\n\n // Keep looping until we find a non-disabled tab.\n while (tabs[newIdx % tabs.length].disabled) {\n newIdx++;\n }\n\n // Stop cycling through tabs if we reach the end and tab cycling is disabled.\n if (this.noTabCycling && newIdx >= tabs.length) {\n return null;\n }\n\n return tabs[newIdx % tabs.length];\n }\n\n /**\n * Marks all tabs as unselected and hides all the panels.\n * This is called every time the user selects a new tab.\n */\n #reset() {\n const tabs = this.#allTabs();\n const panels = this.#allPanels();\n\n tabs.forEach(tab => (tab.selected = false));\n panels.forEach(panel => (panel.hidden = true));\n }\n\n /**\n * Syncs the tab group navigation with the current state of the tab group.\n *\n * This is called every time the user:\n * - adds or removes a tab or panel\n * - changes the placement of the tabs\n * - enables or disables the scroll controls\n *\n * If the tabs container is scrollable and the scroll controls are enabled,\n * the scroll buttons are displayed and the resize observer is started,\n * otherwise they are hidden and the resize observer is stopped.\n */\n #syncNav() {\n const navContainer = this.shadowRoot?.querySelector('.tab-group__nav');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n /** @type {HTMLButtonElement[]} */\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n if (this.noScrollControls || this.placement === PLACEMENT.START || this.placement === PLACEMENT.END) {\n this.#stopResizeObserver();\n scrollButtons.forEach(el => (el.hidden = true));\n navContainer?.part.remove('nav--has-scroll-controls');\n navContainer?.classList.remove('tab-group__nav--has-scroll-controls');\n tabsContainer?.setAttribute('aria-orientation', 'vertical');\n } else {\n this.#startResizeObserver();\n scrollButtons.forEach(el => (el.hidden = false));\n tabsContainer?.setAttribute('aria-orientation', 'horizontal');\n }\n }\n\n /**\n * Sets the selected tab when the slot changes.\n * This is called every time the user adds or removes a tab or panel.\n * This is useful when the user closes the selected tab and we need to select a new one.\n */\n #setSelectedTabOnSlotChange() {\n const tabs = this.#allTabs();\n\n // Get the selected non-disabled tab, or the first non-disabled tab.\n const tab = tabs.find(tab => tab.selected && !tab.disabled) || tabs.find(tab => !tab.disabled);\n\n if (tab) {\n if (this.#hasTabSlotChangedOnce && !tab.selected) {\n this.dispatchEvent(\n new CustomEvent('a-tab-show', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n\n this.#setSelectedTab(tab);\n }\n }\n\n /**\n * Sets the given tab as selected and shows the panel corresponding to the given tab.\n * Differentiates from `selectTab()` in that it does not emit any events or focus the tab.\n * Used internally to set the selected tab when a tab is selected by a side effect,\n * eg. when a tabs and panels are added or removeda and there is a need to select a new tab.\n *\n * @param {Tab} tab - The tab to be selected.\n */\n #setSelectedTab(tab) {\n this.#reset();\n\n if (tab) {\n tab.selected = true;\n }\n\n const panel = this.#panelForTab(tab);\n\n if (panel) {\n panel.hidden = false;\n }\n }\n\n /**\n * Handles the slotchange event on the tab group.\n * This is called every time the user adds or removes a tab or panel.\n *\n * @param {any} evt - The slotchange event.\n */\n #handleSlotChange = evt => {\n this.#linkPanels();\n this.#syncNav();\n this.#setSelectedTabOnSlotChange();\n\n if (evt.target.name === 'tab') {\n this.#hasTabSlotChangedOnce = true;\n }\n };\n\n /**\n * Handles key events on the tab group.\n *\n * @param {any} evt - The keydown event.\n */\n #handleKeyDown = evt => {\n if (\n evt.target.tagName.toLowerCase() !== 'a-tab' || // Ignore any key presses that have a modifier.\n evt.altKey // Don’t handle modifier shortcuts typically used by assistive technology.\n ) {\n return;\n }\n\n const placement = validPlacements.includes(this.placement || '') ? this.placement : PLACEMENT.TOP;\n const orientation = [PLACEMENT.TOP, PLACEMENT.BOTTOM].includes(placement || '') ? 'horizontal' : 'vertical';\n const directionality = this.#getDirectionality();\n let tab = null;\n\n switch (evt.key) {\n case KEYCODE.LEFT:\n if (orientation === 'horizontal') {\n tab = directionality === DIR.LTR ? this.#prevTab() : this.#nextTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.RIGHT:\n if (orientation === 'horizontal') {\n tab = directionality === DIR.LTR ? this.#nextTab() : this.#prevTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.UP:\n if (orientation === 'vertical') {\n tab = this.#prevTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.DOWN:\n if (orientation === 'vertical') {\n tab = this.#nextTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.HOME:\n tab = this.#firstTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n break;\n case KEYCODE.END:\n tab = this.#lastTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n break;\n case KEYCODE.ENTER:\n case KEYCODE.SPACE:\n tab = evt.target;\n if (tab) {\n this.selectTab(tab);\n }\n break;\n default:\n // Any other key press is ignored and passed back to the browser.\n return;\n }\n\n // The browser might have some native functionality bound to the arrow keys, home or end.\n // `preventDefault()` is called to prevent the browser from taking any actions.\n evt.preventDefault();\n };\n\n /**\n * Handles click events on the tab group.\n *\n * @param {any} evt - The click event.\n */\n #handleTabClick = evt => {\n const tab = evt.target.closest('a-tab');\n\n if (tab) {\n this.selectTab(tab);\n }\n };\n\n /**\n * Handles the scroll button click event.\n *\n * @param {any} evt - The click event.\n */\n #handleScrollButtonClick = evt => {\n const scrollButton = evt.target.closest('.tab-group__scroll-button');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n if (!scrollButton || !tabsContainer) {\n return;\n }\n\n const isStartButton = scrollButton.classList.contains('tab-group__scroll-button--start');\n const isLTR = this.#getDirectionality() === DIR.LTR;\n const sign = isStartButton ? (isLTR ? -1 : 1) : isLTR ? 1 : -1;\n const offsetLeft = tabsContainer.scrollLeft;\n\n tabsContainer.scrollTo({\n left: offsetLeft + sign * this.scrollDistance\n });\n };\n\n /**\n * Handles the tab close button click event.\n *\n * @param {any} evt - The click event.\n */\n #handleTabClose = evt => {\n const tab = evt.target;\n const panel = this.#panelForTab(tab);\n\n if (tab) {\n tab.remove();\n\n if (tab.selected) {\n this.dispatchEvent(\n new CustomEvent('a-tab-hide', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n }\n\n if (panel && panel.tagName.toLowerCase() === 'a-tab-panel') {\n panel.remove();\n }\n };\n\n /**\n * Wrapper for the `upgradeProperty` function.\n *\n * @param {'placement' | 'noScrollControls' | 'scrollDistance' | 'activation' | 'noTabCycling'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n return upgradeProperty(prop, this);\n }\n\n /**\n * Selects the tab at the given index.\n * If the tab at the given index is disabled or already selected, this method does nothing.\n *\n * @param {number} index - The index of the tab to be selected.\n */\n selectTabByIndex(index) {\n const tabs = this.#allTabs();\n const tab = tabs[index];\n\n if (tab) {\n this.selectTab(tab);\n }\n }\n\n /**\n * Selects the tab with the given id.\n * If the tab with the given id is disabled or already selected, this method does nothing.\n *\n * @param {string} id - The id of the tab to be selected.\n */\n selectTabById(id) {\n const tabs = this.#allTabs();\n const tab = tabs.find(tab => tab.id === id);\n\n if (tab) {\n this.selectTab(tab);\n }\n }\n\n /**\n * Selects the given tab.\n * If the given tab is disabled or already selected, this method does nothing.\n *\n * @param {Tab} tab - The tab to be selected.\n */\n selectTab(tab) {\n const oldTab = this.#allTabs().find(t => t.selected);\n\n if (!tab || tab.disabled || tab.selected || tab.tagName.toLowerCase() !== 'a-tab') {\n return;\n }\n\n this.#setSelectedTab(tab);\n\n // Queue a microtask to ensure that the tab is focused on the next tick.\n window.requestAnimationFrame(() => {\n tab.scrollIntoView({ inline: 'nearest', block: 'nearest' });\n tab.focus();\n });\n\n if (oldTab) {\n this.dispatchEvent(\n new CustomEvent('a-tab-hide', {\n bubbles: true,\n composed: true,\n detail: { tabId: oldTab.id }\n })\n );\n }\n\n this.dispatchEvent(\n new CustomEvent('a-tab-show', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n\n static defineCustomElement(elementName = 'a-tab-group') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATabGroup);\n }\n }\n}\n\nATabGroup.defineCustomElement();\n\nexport { ATabGroup };\n","/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar h=`\n :host {\n display: inline-block;\n }\n`,r=document.createElement(\"template\");r.innerHTML=`\n \n \n`;var s=class a extends HTMLElement{#e;#t;#r=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(r.content.cloneNode(!0)),this.#e=this.shadowRoot?.querySelector('slot[name=\"button\"]')||null,this.#t=this.#h()}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,e,i){t===\"disabled\"&&e!==i&&this.#t&&(this.#t.toggleAttribute(\"disabled\",this.disabled),this.#t.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#t.part&&this.#t.part.contains(\"button\")&&this.#t.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#s(\"shareUrl\"),this.#s(\"shareTitle\"),this.#s(\"shareText\"),this.#s(\"shareFiles\"),this.#s(\"disabled\"),this.#e?.addEventListener(\"slotchange\",this.#a),this.#t?.addEventListener(\"click\",this.#i)}disconnectedCallback(){this.#e?.removeEventListener(\"slotchange\",this.#a),this.#t?.removeEventListener(\"click\",this.#i)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get shareUrl(){return this.getAttribute(\"share-url\")||\"\"}set shareUrl(t){this.setAttribute(\"share-url\",t)}get shareTitle(){return this.getAttribute(\"share-title\")||\"\"}set shareTitle(t){this.setAttribute(\"share-title\",t)}get shareText(){return this.getAttribute(\"share-text\")||\"\"}set shareText(t){this.setAttribute(\"share-text\",t)}get shareFiles(){return this.#r}set shareFiles(t){Array.isArray(t)&&t.length>0&&(this.#r=t)}async share(){if(!this.disabled)try{let t={};this.shareUrl&&(t.url=this.shareUrl),this.shareTitle&&(t.title=this.shareTitle),this.shareText&&(t.text=this.shareText),Array.isArray(this.shareFiles)&&this.shareFiles.length>0&&navigator.canShare&&navigator.canShare({files:this.shareFiles})&&(t.files=this.shareFiles),await navigator.share(t),this.dispatchEvent(new CustomEvent(\"web-share:success\",{bubbles:!0,composed:!0,detail:{shareData:t}}))}catch(t){if(t instanceof Error&&t.name===\"AbortError\"){this.dispatchEvent(new CustomEvent(\"web-share:abort\",{bubbles:!0,composed:!0,detail:{error:t}}));return}this.dispatchEvent(new CustomEvent(\"web-share:error\",{bubbles:!0,composed:!0,detail:{error:t}}))}}#i=t=>{t.preventDefault(),!this.disabled&&this.share()};#a=t=>{t.target&&t.target.name===\"button\"&&(this.#t?.removeEventListener(\"click\",this.#i),this.#t=this.#h(),this.#t&&(this.#t.addEventListener(\"click\",this.#i),this.#t.nodeName!==\"BUTTON\"&&!this.#t.hasAttribute(\"role\")&&this.#t.setAttribute(\"role\",\"button\")))};#h(){return this.#e&&this.#e.assignedElements({flatten:!0}).find(t=>t.nodeName===\"BUTTON\"||t.getAttribute(\"slot\")===\"button\")||null}#s(t){let e=this;if(Object.prototype.hasOwnProperty.call(e,t)){let i=e[t];delete e[t],e[t]=i}}static defineCustomElement(t=\"web-share\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};s.defineCustomElement();export{s as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */\n\nconst styles = /* css */ `\n :host {\n display: inline-block;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element#readme\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */\nclass WebShare extends HTMLElement {\n /** @type {Nullable} */\n #buttonSlot;\n\n /** @type {Nullable} */\n #buttonEl;\n\n /** @type {File[]} */\n #files = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute('disabled', this.disabled);\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part && this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('shareUrl');\n this.#upgradeProperty('shareTitle');\n this.#upgradeProperty('shareText');\n this.#upgradeProperty('shareFiles');\n this.#upgradeProperty('disabled');\n\n this.#buttonSlot?.addEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n }\n\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */\n get shareUrl() {\n return this.getAttribute('share-url') || '';\n }\n\n set shareUrl(value) {\n this.setAttribute('share-url', value);\n }\n\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */\n get shareTitle() {\n return this.getAttribute('share-title') || '';\n }\n\n set shareTitle(value) {\n this.setAttribute('share-title', value);\n }\n\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */\n get shareText() {\n return this.getAttribute('share-text') || '';\n }\n\n set shareText(value) {\n this.setAttribute('share-text', value);\n }\n\n /**\n * @type {File[]} - The files to share.\n */\n get shareFiles() {\n return this.#files;\n }\n\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) {\n this.#files = value;\n }\n }\n\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */\n async share() {\n if (this.disabled) {\n return;\n }\n\n try {\n /** @type {ShareData} */\n const shareData = {};\n\n if (this.shareUrl) {\n shareData.url = this.shareUrl;\n }\n\n if (this.shareTitle) {\n shareData.title = this.shareTitle;\n }\n\n if (this.shareText) {\n shareData.text = this.shareText;\n }\n\n if (\n Array.isArray(this.shareFiles) &&\n this.shareFiles.length > 0 &&\n navigator.canShare &&\n navigator.canShare({ files: this.shareFiles })\n ) {\n shareData.files = this.shareFiles;\n }\n\n await navigator.share(shareData);\n\n this.dispatchEvent(\n new CustomEvent('web-share:success', {\n bubbles: true,\n composed: true,\n detail: { shareData }\n })\n );\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n this.dispatchEvent(\n new CustomEvent('web-share:abort', {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent('web-share:error', {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n }\n\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.share();\n };\n\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */\n #handleSlotChange = evt => {\n if (evt.target && evt.target.name === 'button') {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n this.#buttonEl = this.#getButton();\n\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener('click', this.#handleClick);\n\n if (this.#buttonEl.nodeName !== 'BUTTON' && !this.#buttonEl.hasAttribute('role')) {\n this.#buttonEl.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */\n #getButton() {\n if (!this.#buttonSlot) {\n return null;\n }\n\n return (\n this.#buttonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'button';\n }) || null\n );\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='web-share'] - The name of the custom element.\n * @example\n *\n * ClipboardCopy.defineCustomElement('my-web-share');\n */\n static defineCustomElement(elementName = 'web-share') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, WebShare);\n }\n }\n}\n\nexport { WebShare };\n","import { WebShare } from './web-share.js';\n\nWebShare.defineCustomElement();\n\nexport { WebShare };\n","/*!\n * @georapbox/files-dropzone-element\n * A custom element that creates a drag and drop zone for files\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/files-dropzone-element#readme\n * @author George Raptis \n * @license MIT\n */\nfunction u(o,e=\"\"){if(!e)return!0;let t=[...new Set(e.split(\",\").map(r=>r.trim()).filter(Boolean))],i=o.type,s=i.replace(/\\/.*$/,\"\");for(let r of t)if(r.charAt(0)===\".\"){if(o.name.toLowerCase().indexOf(r.toLowerCase(),o.name.length-r.length)!==-1)return!0}else if(/\\/\\*$/.test(r)){if(s===r.replace(/\\/.*$/,\"\"))return!0}else if(i===r)return!0;return!1}var x=new Map([[\"aac\",\"audio/aac\"],[\"abw\",\"application/x-abiword\"],[\"arc\",\"application/x-freearc\"],[\"avif\",\"image/avif\"],[\"avi\",\"video/x-msvideo\"],[\"azw\",\"application/vnd.amazon.ebook\"],[\"bin\",\"application/octet-stream\"],[\"bmp\",\"image/bmp\"],[\"bz\",\"application/x-bzip\"],[\"bz2\",\"application/x-bzip2\"],[\"cda\",\"application/x-cdf\"],[\"csh\",\"application/x-csh\"],[\"css\",\"text/css\"],[\"csv\",\"text/csv\"],[\"doc\",\"application/msword\"],[\"docx\",\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"],[\"eot\",\"application/vnd.ms-fontobject\"],[\"epub\",\"application/epub+zip\"],[\"gz\",\"application/gzip\"],[\"gif\",\"image/gif\"],[\"heic\",\"image/heic\"],[\"heif\",\"image/heif\"],[\"htm\",\"text/html\"],[\"html\",\"text/html\"],[\"ico\",\"image/vnd.microsoft.icon\"],[\"ics\",\"text/calendar\"],[\"jar\",\"application/java-archive\"],[\"jpeg\",\"image/jpeg\"],[\"jpg\",\"image/jpeg\"],[\"jxl\",\"image/jxl\"],[\"js\",\"text/javascript\"],[\"json\",\"application/json\"],[\"jsonld\",\"application/ld+json\"],[\"markdown\",\"text/markdown\"],[\"md\",\"text/markdown\"],[\"mid\",\"audio/midi\"],[\"midi\",\"audio/midi\"],[\"mjs\",\"text/javascript\"],[\"mp3\",\"audio/mpeg\"],[\"mp4\",\"video/mp4\"],[\"mpeg\",\"video/mpeg\"],[\"mpkg\",\"application/vnd.apple.installer+xml\"],[\"odp\",\"application/vnd.oasis.opendocument.presentation\"],[\"ods\",\"application/vnd.oasis.opendocument.spreadsheet\"],[\"odt\",\"application/vnd.oasis.opendocument.text\"],[\"oga\",\"audio/ogg\"],[\"ogv\",\"video/ogg\"],[\"ogx\",\"application/ogg\"],[\"opus\",\"audio/opus\"],[\"otf\",\"font/otf\"],[\"png\",\"image/png\"],[\"pdf\",\"application/pdf\"],[\"php\",\"application/x-httpd-php\"],[\"ppt\",\"application/vnd.ms-powerpoint\"],[\"pptx\",\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"],[\"rar\",\"application/vnd.rar\"],[\"rtf\",\"application/rtf\"],[\"sh\",\"application/x-sh\"],[\"svg\",\"image/svg+xml\"],[\"swf\",\"application/x-shockwave-flash\"],[\"tar\",\"application/x-tar\"],[\"tif\",\"image/tiff\"],[\"tiff\",\"image/tiff\"],[\"ts\",\"video/mp2t\"],[\"ttf\",\"font/ttf\"],[\"txt\",\"text/plain\"],[\"vsd\",\"application/vnd.visio\"],[\"wav\",\"audio/wav\"],[\"weba\",\"audio/webm\"],[\"webm\",\"video/webm\"],[\"webp\",\"image/webp\"],[\"woff\",\"font/woff\"],[\"woff2\",\"font/woff2\"],[\"xhtml\",\"application/xhtml+xml\"],[\"xls\",\"application/vnd.ms-excel\"],[\"xlsx\",\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"],[\"xml\",\"application/xml\"],[\"xul\",\"application/vnd.mozilla.xul+xml\"],[\"zip\",\"application/zip\"],[\"7z\",\"application/x-7z-compressed\"],[\"mkv\",\"video/x-matroska\"],[\"mov\",\"video/quicktime\"],[\"msg\",\"application/vnd.ms-outlook\"]]),b=[\".DS_Store\",\"Thumbs.db\"],y=o=>{let{name:e}=o;if(e&&e.lastIndexOf(\".\")!==-1&&!o.type){let i=(e.split(\".\").pop()||\"\").toLowerCase(),s=x.get(i);s&&Object.defineProperty(o,\"type\",{value:s,writable:!1,configurable:!1,enumerable:!0})}return o},g=(o,e)=>{let t=y(o);if(typeof t.path!=\"string\"){let{webkitRelativePath:i}=o;Object.defineProperty(t,\"path\",{value:typeof e==\"string\"?e:i||o.name,writable:!1,configurable:!1,enumerable:!0})}return t},m=async o=>await new Promise((e,t)=>{o.readEntries(e,t)}),w=async o=>{let e=[],t=await m(o);for(;t.length>0;)e.push(...t),t=await m(o);return e},E=o=>new Promise((e,t)=>{o.file(i=>e(g(i,o.fullPath)),t)}),F=async o=>{let e=[],t=[];for(let i of o){if(i.kind!==\"file\")continue;let s=i.getAsEntry?i.getAsEntry():i.webkitGetAsEntry();t.push(s)}for(;t.length>0;){let i=t.shift();if(i)if(i.isFile){let s=await E(i);b.indexOf(s.name)===-1&&e.push(s)}else i.isDirectory&&t.push(...await w(i.createReader()));else continue}return e},f=async o=>{let e=[];for(let t of o)b.indexOf(t.name)===-1&&e.push(g(t));return e},l=async o=>o.dataTransfer?o.dataTransfer.items?await F(o.dataTransfer.items):await f(o.dataTransfer.files):await f(o.target.files);var n=\"files-dropzone\",v=\"TOO_MANY_FILES\",L=\"FILE_TOO_LARGE\",k=\"FILE_TOO_SMALL\",A=\"INVALID_MIME_TYPE\",z=document.createElement(\"template\"),S=`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;z.innerHTML=`\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;var d=class o extends HTMLElement{#t=null;#e=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(z.content.cloneNode(!0)),this.shadowRoot&&(this.#t=this.shadowRoot.getElementById(\"file-input\"),this.#e=this.shadowRoot.getElementById(\"dropzone\"))}static get observedAttributes(){return[\"accept\",\"disabled\",\"multiple\"]}attributeChangedCallback(e,t,i){e===\"accept\"&&t!==i&&this.#t&&(this.#t.accept=this.accept),e===\"disabled\"&&t!==i&&this.#t&&(this.#t.disabled=this.disabled,this.disabled?(this.#e?.removeAttribute(\"tabindex\"),this.#e?.setAttribute(\"aria-disabled\",\"true\")):(this.#e?.setAttribute(\"tabindex\",\"0\"),this.#e?.setAttribute(\"aria-disabled\",\"false\"))),e===\"multiple\"&&t!==i&&this.#t&&(this.#t.multiple=this.multiple)}connectedCallback(){this.#o(\"accept\"),this.#o(\"disabled\"),this.#o(\"maxFiles\"),this.#o(\"maxSize\"),this.#o(\"minSize\"),this.#o(\"multiple\"),this.#o(\"autoFocus\"),this.#o(\"noStyle\"),this.#t?.addEventListener(\"change\",this.#i),this.#e?.addEventListener(\"dragenter\",this.#r),this.#e?.addEventListener(\"dragover\",this.#s),this.#e?.addEventListener(\"dragleave\",this.#n),this.#e?.addEventListener(\"drop\",this.#a),this.#e?.addEventListener(\"click\",this.#d),this.#e?.addEventListener(\"keyup\",this.#l),this.autoFocus&&this.#e?.focus()}disconnectedCallback(){this.#t?.removeEventListener(\"change\",this.#i),this.#e?.removeEventListener(\"dragenter\",this.#r),this.#e?.removeEventListener(\"dragover\",this.#s),this.#e?.removeEventListener(\"dragleave\",this.#n),this.#e?.removeEventListener(\"drop\",this.#a),this.#e?.removeEventListener(\"click\",this.#d),this.#e?.removeEventListener(\"keyup\",this.#l)}get accept(){return this.getAttribute(\"accept\")||\"\"}set accept(e){this.setAttribute(\"accept\",e!=null?e.toString():e)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}get maxFiles(){let e=Number(this.getAttribute(\"max-files\"))||0;return e<=0?1/0:Math.floor(Math.abs(e))}set maxFiles(e){this.setAttribute(\"max-files\",e!=null?e.toString():e)}get maxSize(){let e=this.getAttribute(\"max-size\");if(e===null)return 1/0;let t=Number(e);return Number.isNaN(t)?1/0:t}set maxSize(e){this.setAttribute(\"max-size\",e!=null?e.toString():e)}get minSize(){let e=this.getAttribute(\"min-size\");if(e===null)return 0;let t=Number(e);return Number.isNaN(t)?0:t}set minSize(e){this.setAttribute(\"min-size\",e!=null?e.toString():e)}get multiple(){return this.hasAttribute(\"multiple\")}set multiple(e){this.toggleAttribute(\"multiple\",!!e)}get autoFocus(){return this.hasAttribute(\"auto-focus\")}set autoFocus(e){this.toggleAttribute(\"auto-focus\",!!e)}get noStyle(){return this.hasAttribute(\"no-style\")}set noStyle(e){this.toggleAttribute(\"no-style\",!!e)}#i=async e=>{try{this.#c(await l(e))}catch(t){this.dispatchEvent(new CustomEvent(`${n}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}};#r=()=>{this.disabled||this.dispatchEvent(new Event(`${n}-dragenter`,{bubbles:!0,composed:!0}))};#s=e=>{if(e.preventDefault(),this.disabled){e.dataTransfer.dropEffect=\"none\";return}e.dataTransfer.dropEffect=\"copy\",this.#e&&(this.#e.classList.add(\"dropzone--dragover\"),this.#e.part.add(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${n}-dragover`,{bubbles:!0,composed:!0}))};#n=()=>{this.disabled||(this.#e&&(this.#e.classList.remove(\"dropzone--dragover\"),this.#e.part.remove(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${n}-dragleave`,{bubbles:!0,composed:!0})))};#a=async e=>{if(!this.disabled){e.preventDefault(),this.#e&&(this.#e.classList.remove(\"dropzone--dragover\"),this.#e.part.remove(\"dropzone--dragover\"));try{this.#c(await l(e))}catch(t){this.dispatchEvent(new CustomEvent(`${n}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}};#d=()=>{this.disabled||this.#t?.click()};#l=e=>{this.disabled||(e.key===\" \"||e.key===\"Enter\")&&this.#t?.click()};#c(e){if(!Array.isArray(e)||!e.length)return;let t=[],i=[],s=e.length;if(!this.multiple&&s>1)for(let r of e)i.push({file:r,errors:[{code:v,message:\"Too many files selected. Only 1 file is allowed.\"}]});else if(this.multiple&&s>this.maxFiles)for(let r of e)i.push({file:r,errors:[{code:v,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?\"files are\":\"file is\"} allowed.`}]});else for(let r of e){let c=u(r,this.accept),p=r.size>this.maxSize,h=r.size0&&this.dispatchEvent(new CustomEvent(`${n}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:t}})),i.length>0&&this.dispatchEvent(new CustomEvent(`${n}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:i}})),this.#t&&(this.#t.value=this.#t.defaultValue)}openFileDialog(){this.disabled||this.#t?.click()}#o(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}static defineCustomElement(e=n){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,o)}};d.defineCustomElement();export{d as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","// @ts-check\n\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */\nexport function isValidFile(file, acceptedTypeSpecifiers = '') {\n if (!acceptedTypeSpecifiers) {\n return true;\n }\n\n const acceptedMimeTypesList = [\n ...new Set(\n acceptedTypeSpecifiers\n .split(',')\n .map(v => v.trim())\n .filter(Boolean)\n )\n ];\n\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, '');\n\n for (const validType of acceptedMimeTypesList) {\n if (validType.charAt(0) === '.') {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, '')) {\n return true;\n }\n } else {\n if (fileMimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n}\n","// @ts-check\n\n/**\n * A map of common file extensions and their associated MIME types.\n */\nconst COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['jxl', 'image/jxl'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['markdown', 'text/markdown'],\n ['md', 'text/markdown'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */\nconst toFileWithMimeType = file => {\n const { name } = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const extension = (name.split('.').pop() || '').toLowerCase();\n const type = COMMON_MIME_TYPES.get(extension);\n\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n};\n\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */\nconst toFileWithPath = (file, path) => {\n const fileWithMimeType = toFileWithMimeType(file);\n\n // @ts-ignore\n if (typeof fileWithMimeType.path !== 'string') {\n const { webkitRelativePath } = file;\n\n Object.defineProperty(fileWithMimeType, 'path', {\n value: typeof path === 'string' ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return fileWithMimeType;\n};\n\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readEntriesPromise = async directoryReader => {\n return await new Promise((resolve, reject) => {\n directoryReader.readEntries(resolve, reject);\n });\n};\n\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readAllDirectoryEntries = async directoryReader => {\n const entries = [];\n let readEntries = await readEntriesPromise(directoryReader);\n\n while (readEntries.length > 0) {\n entries.push(...readEntries);\n readEntries = await readEntriesPromise(directoryReader);\n }\n\n return entries;\n};\n\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */\nconst getFileFromFileEntry = fileEntry => {\n return new Promise((resolve, reject) => {\n fileEntry.file(file => resolve(toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromDataTransferItemList = async dataTransferItemList => {\n const files = [];\n\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n\n for (const item of dataTransferItemList) {\n if (item.kind !== 'file') {\n // Ignore non-file items, such as links.\n continue;\n }\n\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n\n queue.push(entry);\n }\n\n while (queue.length > 0) {\n const entry = queue.shift();\n\n if (!entry) {\n continue;\n } else if (entry.isFile) {\n const file = await getFileFromFileEntry(entry);\n\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(file);\n }\n } else if (entry.isDirectory) {\n queue.push(...(await readAllDirectoryEntries(entry.createReader())));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromFileList = async fileList => {\n const files = [];\n\n for (const file of fileList) {\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(toFileWithPath(file));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from an event.\n * This function supports both `drop` and `change` events.\n *\n * @param {*} evt - The event to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nexport const getFilesFromEvent = async evt => {\n if (evt.dataTransfer) {\n return evt.dataTransfer.items\n ? await getFilesFromDataTransferItemList(evt.dataTransfer.items)\n : await getFilesFromFileList(evt.dataTransfer.files);\n }\n\n return await getFilesFromFileList(evt.target.files);\n};\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nimport { isValidFile } from './utils/is-valid-file.js';\nimport { getFilesFromEvent } from './utils/files-selector.js';\n\nconst COMPONENT_NAME = 'files-dropzone';\nconst TOO_MANY_FILES = 'TOO_MANY_FILES';\nconst FILE_TOO_LARGE = 'FILE_TOO_LARGE';\nconst FILE_TOO_SMALL = 'FILE_TOO_SMALL';\nconst INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;\n\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */\nclass FilesDropzone extends HTMLElement {\n /** @type {Nullable} */\n #fileInput = null;\n\n /** @type {Nullable} */\n #dropzoneEl = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */ (this.shadowRoot.getElementById('file-input'));\n this.#dropzoneEl = this.shadowRoot.getElementById('dropzone');\n }\n }\n\n static get observedAttributes() {\n return ['accept', 'disabled', 'multiple'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'accept' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.accept = this.accept;\n }\n\n if (name === 'disabled' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n\n if (this.disabled) {\n this.#dropzoneEl?.removeAttribute('tabindex');\n this.#dropzoneEl?.setAttribute('aria-disabled', 'true');\n } else {\n this.#dropzoneEl?.setAttribute('tabindex', '0');\n this.#dropzoneEl?.setAttribute('aria-disabled', 'false');\n }\n }\n\n if (name === 'multiple' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.multiple = this.multiple;\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('accept');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('maxFiles');\n this.#upgradeProperty('maxSize');\n this.#upgradeProperty('minSize');\n this.#upgradeProperty('multiple');\n this.#upgradeProperty('autoFocus');\n this.#upgradeProperty('noStyle');\n\n this.#fileInput?.addEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.addEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.addEventListener('click', this.#handleClick);\n this.#dropzoneEl?.addEventListener('keyup', this.#handleKeyUp);\n\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#fileInput?.removeEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.removeEventListener('click', this.#handleClick);\n this.#dropzoneEl?.removeEventListener('keyup', this.#handleKeyUp);\n }\n\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */\n get accept() {\n return this.getAttribute('accept') || '';\n }\n\n set accept(value) {\n this.setAttribute('accept', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */\n get maxFiles() {\n const num = Number(this.getAttribute('max-files')) || 0;\n\n if (num <= 0) {\n return Infinity;\n }\n\n return Math.floor(Math.abs(num));\n }\n\n set maxFiles(value) {\n this.setAttribute('max-files', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */\n get maxSize() {\n const value = this.getAttribute('max-size');\n\n if (value === null) {\n return Infinity;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? Infinity : num;\n }\n\n set maxSize(value) {\n this.setAttribute('max-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */\n get minSize() {\n const value = this.getAttribute('min-size');\n\n if (value === null) {\n return 0;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? 0 : num;\n }\n\n set minSize(value) {\n this.setAttribute('min-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */\n get multiple() {\n return this.hasAttribute('multiple');\n }\n\n set multiple(value) {\n this.toggleAttribute('multiple', !!value);\n }\n\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */\n get autoFocus() {\n return this.hasAttribute('auto-focus');\n }\n\n set autoFocus(value) {\n this.toggleAttribute('auto-focus', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */\n get noStyle() {\n return this.hasAttribute('no-style');\n }\n\n set noStyle(value) {\n this.toggleAttribute('no-style', !!value);\n }\n\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */\n #handleFileInputChange = async evt => {\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n };\n\n /**\n * Handles the dragenter event of the dropzone.\n */\n #handleDragEnter = () => {\n if (this.disabled) {\n return;\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDragOver = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n evt.dataTransfer.dropEffect = 'none';\n return;\n }\n\n evt.dataTransfer.dropEffect = 'copy';\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add('dropzone--dragover');\n this.#dropzoneEl.part.add('dropzone--dragover');\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the dragleave event of the dropzone.\n */\n #handleDragLeave = () => {\n if (this.disabled) {\n return;\n }\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDrop = async evt => {\n if (this.disabled) {\n return;\n }\n\n evt.preventDefault();\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n };\n\n /**\n * Handles the click event of the dropzone.\n */\n #handleClick = () => {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n };\n\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleKeyUp = evt => {\n if (this.disabled) {\n return;\n }\n\n if (evt.key === ' ' || evt.key === 'Enter') {\n this.#fileInput?.click();\n }\n };\n\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */\n #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) {\n return;\n }\n\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) {\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [\n {\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }\n ]\n });\n }\n } else if (this.multiple && filesLength > this.maxFiles) {\n // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [\n {\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? 'files are' : 'file is'} allowed.`\n }\n ]\n });\n }\n } else {\n // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files) {\n const fileHasValidType = isValidFile(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) {\n acceptedFiles.push(file);\n } else {\n const errors = [];\n\n if (!fileHasValidType) {\n errors.push({\n code: INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n }\n\n if (fileExceedsMaxSize) {\n errors.push({\n code: FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n }\n\n if (fileIsSmallerThanMinSize) {\n errors.push({\n code: FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n }\n\n rejectedFiles.push({ file, errors });\n }\n }\n }\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles,\n rejectedFiles\n }\n })\n );\n\n if (acceptedFiles.length > 0) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles\n }\n })\n );\n }\n\n if (rejectedFiles.length > 0) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles\n }\n })\n );\n }\n\n if (this.#fileInput) {\n this.#fileInput.value = this.#fileInput.defaultValue;\n }\n }\n\n /**\n * Opens the file dialog programmatically.\n */\n openFileDialog() {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, FilesDropzone);\n }\n }\n}\n\nexport { FilesDropzone };\n","import { FilesDropzone } from './files-dropzone.js';\n\nFilesDropzone.defineCustomElement();\n\nexport { FilesDropzone };\n","/*!\n * @georapbox/resize-observer-element\n * A custom element that offers a declarative interface to the ResizeObserver API.\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/resize-observer-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar d=\":host { display: contents; }\",o=document.createElement(\"template\");o.innerHTML=`\n \n \n`;var s=class n extends HTMLElement{#e=null;#t=null;#s=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(o.content.cloneNode(!0)),this.#e=this.shadowRoot?.querySelector(\"slot\")??null}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(e,t,i){e===\"disabled\"&&t!==i&&(this.disabled?this.#o():this.#i())}connectedCallback(){this.#d(\"disabled\"),\"ResizeObserver\"in window&&(this.#t=new ResizeObserver(e=>{this.dispatchEvent(new CustomEvent(\"resize-observer:resize\",{bubbles:!0,composed:!0,detail:{entries:e}}))}),this.disabled||this.#i(),this.#e?.addEventListener(\"slotchange\",this.#n))}disconnectedCallback(){this.#o(),this.#e?.removeEventListener(\"slotchange\",this.#n)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}#i(){!this.#e||!this.#t||(this.#s.forEach(e=>this.#t?.unobserve(e)),this.#s=[],this.#e.assignedElements().forEach(e=>{this.#t?.observe(e),this.#s.push(e)}))}#o(){this.#t?.disconnect()}#n=()=>{this.disabled||this.#i()};#d(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}static defineCustomElement(e=\"resize-observer\"){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,n)}};s.defineCustomElement();export{s as ResizeObserverElement};\n//# sourceMappingURL=resize-observer-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst styles = /* css */ `:host { display: contents; }`;\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that offers a declarative interface to the ResizeObserver API.\n * @documentation https://github.com/georapbox/resize-observer-element#readme\n *\n * @tagname resize-observer - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Whether the resize observer is disabled.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n *\n * @slot - The default slot where the elements to observe are placed.\n *\n * @event resize-observer:resize - Dispatched when the observed elements are resized.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n */\nclass ResizeObserverElement extends HTMLElement {\n /** @type {Nullable} */\n #slotEl = null;\n\n /** @type {Nullable} */\n #resizeObserver = null;\n\n /** @type {Element[]} */\n #observedElements = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#slotEl = this.shadowRoot?.querySelector('slot') ?? null;\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue) {\n this.disabled ? this.#stopObserver() : this.#startObserver();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('disabled');\n\n if ('ResizeObserver' in window) {\n this.#resizeObserver = new ResizeObserver(entries => {\n this.dispatchEvent(\n new CustomEvent('resize-observer:resize', {\n bubbles: true,\n composed: true,\n detail: { entries }\n })\n );\n });\n\n if (!this.disabled) {\n this.#startObserver();\n }\n\n this.#slotEl?.addEventListener('slotchange', this.#handleSlotChange);\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#stopObserver();\n this.#slotEl?.removeEventListener('slotchange', this.#handleSlotChange);\n }\n\n /**\n * @type {boolean} - Whether the resize observer is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * Starts observing the elements in the slot.\n */\n #startObserver() {\n if (!this.#slotEl || !this.#resizeObserver) {\n return;\n }\n\n this.#observedElements.forEach(el => this.#resizeObserver?.unobserve(el));\n this.#observedElements = [];\n\n this.#slotEl.assignedElements().forEach(el => {\n this.#resizeObserver?.observe(el);\n this.#observedElements.push(el);\n });\n }\n\n /**\n * Stops observing the elements in the slot.\n */\n #stopObserver() {\n this.#resizeObserver?.disconnect();\n }\n\n /**\n * Handles slot change event.\n */\n #handleSlotChange = () => {\n if (!this.disabled) {\n this.#startObserver();\n }\n };\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='resize-observer'] - The name of the custom element.\n * @example\n *\n * ResizeObserverElement.defineCustomElement('my-resize-observer');\n */\n static defineCustomElement(elementName = 'resize-observer') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ResizeObserverElement);\n }\n }\n}\n\nexport { ResizeObserverElement };\n","import { ResizeObserverElement } from './resize-observer.js';\n\nResizeObserverElement.defineCustomElement();\n\nexport { ResizeObserverElement };\n","/*!\n * @georapbox/modal-element\n * A custom element to create a modal, using the native dialog element under the hood.\n *\n * @version 1.8.0\n * @homepage https://github.com/georapbox/modal-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar n=document.createElement(\"template\"),r=`\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: 300ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;n.innerHTML=`\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;var a=class s extends HTMLElement{#e=null;#i=null;#a=null;#o=void 0;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(n.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.querySelector(\"dialog\"),this.#i=this.shadowRoot.querySelector('slot[name=\"footer\"]'),this.#a=this.shadowRoot.querySelector('slot[name=\"close\"]'))}static get observedAttributes(){return[\"open\",\"no-header\",\"no-animations\",\"no-close-button\",\"close-label\"]}attributeChangedCallback(e,t,i){if(this.#e!==null){if(e===\"open\"&&t!==i&&(this.open?(this.#e.showModal(),this.dispatchEvent(new CustomEvent(\"me-open\",{bubbles:!0,composed:!0,detail:{element:this}})),document.body&&!this.preserveOverflow&&(document.body.style.overflow=\"hidden\")):this.#e.close()),e===\"no-header\"&&t!==i){let o=this.#e.querySelector(\".dialog__header\");o!==null&&(o.hidden=this.noHeader)}if(e===\"no-animations\"&&t!==i&&this.#e.classList.toggle(\"dialog--no-animations\",this.noAnimations),e===\"no-close-button\"&&t!==i){let o=this.#e.querySelector(\".dialog__close\");o!==null&&(o.hidden=this.noCloseButton)}e===\"close-label\"&&t!==i&&this.#r()}}connectedCallback(){this.#t(\"open\"),this.#t(\"staticBackdrop\"),this.#t(\"noHeader\"),this.#t(\"noAnimations\"),this.#t(\"noCloseButton\"),this.#t(\"fullscreen\"),this.#t(\"preserveOverflow\"),this.#t(\"placement\"),this.#t(\"closeLabel\"),this.#e?.addEventListener(\"click\",this.#h),this.#e?.addEventListener(\"close\",this.#l),this.#e?.addEventListener(\"cancel\",this.#d),this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\",this.#c),this.#i?.addEventListener(\"slotchange\",this.#m),this.#a?.addEventListener(\"slotchange\",this.#g)}disconnectedCallback(){this.#o&&clearTimeout(this.#o),this.#e?.addEventListener(\"click\",this.#h),this.#e?.removeEventListener(\"close\",this.#l),this.#e?.removeEventListener(\"cancel\",this.#d),this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\",this.#c),this.#i?.removeEventListener(\"slotchange\",this.#m),this.#a?.removeEventListener(\"slotchange\",this.#g)}get open(){return this.hasAttribute(\"open\")}set open(e){this.toggleAttribute(\"open\",!!e)}get staticBackdrop(){return this.hasAttribute(\"static-backdrop\")}set staticBackdrop(e){this.toggleAttribute(\"static-backdrop\",!!e)}get noHeader(){return this.hasAttribute(\"no-header\")}set noHeader(e){this.toggleAttribute(\"no-header\",!!e)}get noAnimations(){return this.hasAttribute(\"no-animations\")}set noAnimations(e){this.toggleAttribute(\"no-animations\",!!e)}get noCloseButton(){return this.hasAttribute(\"no-close-button\")}set noCloseButton(e){this.toggleAttribute(\"no-close-button\",!!e)}get fullscreen(){return this.hasAttribute(\"fullscreen\")}set fullscreen(e){this.toggleAttribute(\"fullscreen\",!!e)}get preserveOverflow(){return this.hasAttribute(\"preserve-overflow\")}set preserveOverflow(e){this.toggleAttribute(\"preserve-overflow\",!!e)}get placement(){return this.getAttribute(\"placement\")||\"center\"}set placement(e){this.setAttribute(\"placement\",e!=null?e.toString():e)}get closeLabel(){return this.getAttribute(\"close-label\")||\"Close\"}set closeLabel(e){this.setAttribute(\"close-label\",e!=null?e.toString():e)}#r(){if(this.#e===null)return;let e=this.#e.querySelector(\".dialog__close\");if(e===null)return;(this.#a?.assignedElements()||[])?.some(o=>o.textContent?.replace(/\\s/g,\"\")!==\"\")?e.removeAttribute(\"aria-label\"):e.setAttribute(\"aria-label\",this.closeLabel)}#n(){this.#o||(this.#e?.classList.add(\"dialog--pulse\"),this.#o=setTimeout(()=>{this.#e?.classList.remove(\"dialog--pulse\"),clearTimeout(this.#o),this.#o=void 0},300))}#l=()=>{this.open=!1,this.dispatchEvent(new CustomEvent(\"me-close\",{bubbles:!0,composed:!0,detail:{element:this}})),document.body&&!this.preserveOverflow&&(document.body.style.overflow=\"\")};#d=e=>{let t=this.#s(\"escape-key\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),!this.noAnimations&&this.#n())};#c=e=>{let t=this.#s(\"close-button\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),!this.noAnimations&&this.#n())};#h=e=>{let t=e.target,i=e.currentTarget;if(t===i){let o=this.#s(\"backdrop-click\");this.dispatchEvent(o),o.defaultPrevented||this.staticBackdrop?!this.noAnimations&&this.#n():this.hide()}if(t instanceof HTMLElement&&t.closest(\"[data-me-close]\")!==null){let o=this.#s(\"external-invoker\");this.dispatchEvent(o),o.defaultPrevented?!this.noAnimations&&this.#n():this.hide()}};#m=()=>{if(this.#e===null)return;let e=this.#e.querySelector(\".dialog__footer\");if(e===null)return;let t=this.#i?.assignedNodes(),i=t?t.length>0:!1;e.hidden=!i};#g=()=>{this.#r()};#s(e){return new CustomEvent(\"me-request-close\",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,element:this}})}#t(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}show(){this.open||(this.open=!0)}hide(){this.open&&(this.open=!1)}static defineCustomElement(e=\"modal-element\"){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,s)}};a.defineCustomElement();export{a as ModalElement};\n//# sourceMappingURL=modal-element-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Available values for the request close reason.\n *\n * @typedef {'close-button' | 'escape-key' | 'backdrop-click' | 'external-invoker'} CloseRequestReason\n */\n\nconst PULSE_ANIMATION_DURATION = 300; // milliseconds\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: ${PULSE_ANIMATION_DURATION}ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;\n\n/**\n * @summary A custom element that renders a modal dialog.\n * @documentation https://github.com/georapbox/modal-element\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines whether the modal is open or not.\n * @property {boolean} staticBackdrop - Determines whether the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines whether the modal should have a header or not.\n * @property {boolean} noAnimations - Determines whether the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines whether the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines whether the modal should be fullscreen or not.\n * @property {boolean} preserveOverflow - Determines whether the overflow of the body should be preserved when the modal is open.\n * @property {string} placement - Determines the placement of the modal.\n * @property {string} closeLabel - The label of the default close button, used as the aria-label attribute of the close button.\n *\n * @attribute {boolean} open - Reflects the open property.\n * @attribute {boolean} static-backdrop - Reflects the staticBackdrop property.\n * @attribute {boolean} no-header - Reflects the noHeader property.\n * @attribute {boolean} no-animations - Reflects the noAnimations property.\n * @attribute {boolean} no-close-button - Reflects the noCloseButton property.\n * @attribute {boolean} fullscreen - Reflects the fullscreen property.\n * @attribute {boolean} preserve-overflow - Reflects the preserveOverflow property.\n * @attribute {string} placement - Reflects the placement property.\n * @attribute {string} close-label - Reflects the closeLabel property.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal.\n * @cssproperty --me-height - The height of the modal.\n * @cssproperty --me-border-color - The border color of the modal.\n * @cssproperty --me-border-style - The border style of the modal.\n * @cssproperty --me-border-width - The border width of the modal.\n * @cssproperty --me-border-radius - The border radius of the modal.\n * @cssproperty --me-box-shadow - The box shadow of the modal.\n * @cssproperty --me-background-color - The background color of the modal.\n * @cssproperty --me-color - The foreground color of the modal.\n * @cssproperty --me-header-spacing - The spacing of the header.\n * @cssproperty --me-header-background-color - The background color of the header.\n * @cssproperty --me-header-color - The foreground color of the header.\n * @cssproperty --me-body-spacing - The spacing of the body.\n * @cssproperty --me-body-background-color - The background color of the body.\n * @cssproperty --me-body-color - The foreground color of the body.\n * @cssproperty --me-footer-spacing - The spacing of the footer.\n * @cssproperty --me-footer-background-color - The background color of the footer.\n * @cssproperty --me-footer-color - The foreground color of the footer.\n * @cssproperty --me-close-padding - The padding of the close button.\n * @cssproperty --me-close-border - The border shorthand property of the close button.\n * @cssproperty --me-close-border-radius - The border radius shorthand property of the close button.\n * @cssproperty --me-close-background-color - The background color of the close button.\n * @cssproperty --me-close-color - The foreground color of the close button.\n * @cssproperty --me-close-font-size - The font size of the close button.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop.\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart close - The default close button rendered in the modal's header.\n * @csspart close-icon - The close icon of the default close button.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n */\nclass ModalElement extends HTMLElement {\n /** @type {Nullable} */\n #dialogEl = null;\n\n /** @type {Nullable} */\n #footerSlotEl = null;\n\n /** @type {Nullable} */\n #closeSlotEl = null;\n\n /** @type {ReturnType | undefined} */\n #pulseAnimationTimeout = void 0;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector('dialog');\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n this.#closeSlotEl = this.shadowRoot.querySelector('slot[name=\"close\"]');\n }\n }\n\n static get observedAttributes() {\n return ['open', 'no-header', 'no-animations', 'no-close-button', 'close-label'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) {\n return;\n }\n\n if (name === 'open' && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n\n this.dispatchEvent(\n new CustomEvent('me-open', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n })\n );\n\n if (document.body && !this.preserveOverflow) {\n document.body.style.overflow = 'hidden';\n }\n } else {\n this.#dialogEl.close();\n }\n }\n\n if (name === 'no-header' && oldValue !== newValue) {\n /** @type {Nullable} */\n const headerEl = this.#dialogEl.querySelector('.dialog__header');\n\n if (headerEl !== null) {\n headerEl.hidden = this.noHeader;\n }\n }\n\n if (name === 'no-animations' && oldValue !== newValue) {\n this.#dialogEl.classList.toggle('dialog--no-animations', this.noAnimations);\n }\n\n if (name === 'no-close-button' && oldValue !== newValue) {\n /** @type {Nullable} */\n const closeBtnEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeBtnEl !== null) {\n closeBtnEl.hidden = this.noCloseButton;\n }\n }\n\n if (name === 'close-label' && oldValue !== newValue) {\n this.#updateCloseLabel();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('open');\n this.#upgradeProperty('staticBackdrop');\n this.#upgradeProperty('noHeader');\n this.#upgradeProperty('noAnimations');\n this.#upgradeProperty('noCloseButton');\n this.#upgradeProperty('fullscreen');\n this.#upgradeProperty('preserveOverflow');\n this.#upgradeProperty('placement');\n this.#upgradeProperty('closeLabel');\n\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.addEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.addEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener('slotchange', this.#handleFooterSlotChange);\n this.#closeSlotEl?.addEventListener('slotchange', this.#handleCloseSlotChange);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.removeEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.removeEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener('slotchange', this.#handleFooterSlotChange);\n this.#closeSlotEl?.removeEventListener('slotchange', this.#handleCloseSlotChange);\n }\n\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */\n get open() {\n return this.hasAttribute('open');\n }\n\n set open(value) {\n this.toggleAttribute('open', !!value);\n }\n\n /**\n * Determines whether the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */\n get staticBackdrop() {\n return this.hasAttribute('static-backdrop');\n }\n\n set staticBackdrop(value) {\n this.toggleAttribute('static-backdrop', !!value);\n }\n\n /**\n * Determines whether the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */\n get noHeader() {\n return this.hasAttribute('no-header');\n }\n\n set noHeader(value) {\n this.toggleAttribute('no-header', !!value);\n }\n\n /**\n * Determines whether the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */\n get noAnimations() {\n return this.hasAttribute('no-animations');\n }\n\n set noAnimations(value) {\n this.toggleAttribute('no-animations', !!value);\n }\n\n /**\n * Determines whether the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */\n get noCloseButton() {\n return this.hasAttribute('no-close-button');\n }\n\n set noCloseButton(value) {\n this.toggleAttribute('no-close-button', !!value);\n }\n\n /**\n * Determines whether the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */\n get fullscreen() {\n return this.hasAttribute('fullscreen');\n }\n\n set fullscreen(value) {\n this.toggleAttribute('fullscreen', !!value);\n }\n\n /**\n * Determines whether the overflow of the body should be preserved when the modal is open.\n *\n * @type {boolean} - True if the overflow of the body should be preserved, otherwise false.\n * @default false\n * @attribute preserve-overflow - Reflects the preserveOverflow property.\n */\n get preserveOverflow() {\n return this.hasAttribute('preserve-overflow');\n }\n\n set preserveOverflow(value) {\n this.toggleAttribute('preserve-overflow', !!value);\n }\n\n /**\n * Determines the placement of the modal.\n * Possible values are 'top-start', 'top-center', 'top-end', 'center-start', 'center', 'center-end', 'bottom-start', 'bottom-center', 'bottom-end'.\n *\n * @type {string}\n * @default 'center'\n * @attribute placement - Reflects the placement property.\n */\n get placement() {\n return this.getAttribute('placement') || 'center';\n }\n\n set placement(value) {\n this.setAttribute('placement', value != null ? value.toString() : value);\n }\n\n /**\n * The label of the default close button, used as the aria-label attribute of the close button.\n * If user provides text content for the close button using the `close` slot, this property is ignored and the aria-label attribute is removed.\n *\n * @type {string}\n * @default 'Close'\n * @attribute close-label - Reflects the closeLabel property.\n */\n get closeLabel() {\n return this.getAttribute('close-label') || 'Close';\n }\n\n set closeLabel(value) {\n this.setAttribute('close-label', value != null ? value.toString() : value);\n }\n\n /**\n * Updates the aria-label attribute of the close button.\n * If the slot for the close button has text content, the aria-label attribute is removed to allow the text content to be used as the label.\n * Otherwise, the aria-label attribute is set to the `closeLabel` property.\n *\n * @returns\n */\n #updateCloseLabel() {\n if (this.#dialogEl === null) {\n return;\n }\n\n const closeButtonEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeButtonEl === null) {\n return;\n }\n\n const assignedElements = this.#closeSlotEl?.assignedElements() || [];\n const hasTextContent = assignedElements?.some(el => el.textContent?.replace(/\\s/g, '') !== '');\n\n hasTextContent\n ? closeButtonEl.removeAttribute('aria-label')\n : closeButtonEl.setAttribute('aria-label', this.closeLabel);\n }\n\n /**\n * Applies a pulse effect on the dialog.\n */\n #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) {\n return;\n }\n\n this.#dialogEl?.classList.add('dialog--pulse');\n\n this.#pulseAnimationTimeout = setTimeout(() => {\n this.#dialogEl?.classList.remove('dialog--pulse');\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, PULSE_ANIMATION_DURATION);\n }\n\n /**\n * Handles the close event of the dialog.\n */\n #handleDialogClose = () => {\n // This is required because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n\n this.dispatchEvent(\n new CustomEvent('me-close', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n })\n );\n\n if (document.body && !this.preserveOverflow) {\n document.body.style.overflow = '';\n }\n };\n\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */\n #handleDialogCancel = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('escape-key');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('close-button');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleDialogClick = evt => {\n const target = evt.target;\n const currentTarget = evt.currentTarget;\n\n // Close the dialog when the backdrop is clicked.\n if (target === currentTarget) {\n const requestCloseEvent = this.#createRequestCloseEvent('backdrop-click');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n } else {\n this.hide();\n }\n }\n\n // Close the dialog when external invoker is clicked.\n if (target instanceof HTMLElement && target.closest('[data-me-close]') !== null) {\n const requestCloseEvent = this.#createRequestCloseEvent('external-invoker');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n } else {\n this.hide();\n }\n }\n };\n\n /**\n * Handles the slotchange event of the footer slot.\n */\n #handleFooterSlotChange = () => {\n if (this.#dialogEl === null) {\n return;\n }\n\n /** @type {Nullable} */\n const footerEl = this.#dialogEl.querySelector('.dialog__footer');\n\n if (footerEl === null) {\n return;\n }\n\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n\n footerEl.hidden = !hasFooterSlotNodes;\n };\n\n /**\n * Handles the slotchange event of the close slot.\n */\n #handleCloseSlotChange = () => {\n this.#updateCloseLabel();\n };\n\n /**\n * Creates a request close event.\n *\n * @param {CloseRequestReason} reason - The reason that the modal is about to close.\n */\n #createRequestCloseEvent(reason) {\n return new CustomEvent('me-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason,\n element: this\n }\n });\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen' | 'preserveOverflow' | 'placement' | 'closeLabel'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */\n show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n }\n\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */\n hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */\n static defineCustomElement(elementName = 'modal-element') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ModalElement);\n }\n }\n}\n\nexport { ModalElement };\n","import { ModalElement } from './modal-element.js';\n\nModalElement.defineCustomElement();\n\nexport { ModalElement };\n","export const EXPERIMENTAL_FLAG = 'experimental';\n\nexport const NO_BARCODE_DETECTED = 'No barcode detected';\n\nexport const ACCEPTED_MIME_TYPES = [\n 'image/jpg',\n 'image/jpeg',\n 'image/png',\n 'image/apng',\n 'image/gif',\n 'image/webp',\n 'image/avif'\n];\n","import { set, get } from 'idb-keyval';\n\nconst STORAGE_PREFIX = 'barcode-scanner/';\nconst SETTINGS_STORAGE_KEY = 'settings';\nconst HISTORY_STORAGE_KEY = 'history';\n\n/**\n * Gets an item from the storage.\n *\n * @param {string} key - The key to get the item from.\n * @returns {Promise<[ error: any, value: any ]>} The item and an error if occurred.\n */\nconst getItem = async key => {\n try {\n return [null, await get(key)];\n } catch (error) {\n return [error, void 0];\n }\n};\n\n/**\n * Sets an item in the storage.\n *\n * @param {string} key - The key to set the item to.\n * @param {any} data - The data to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nconst setItem = async (key, data) => {\n try {\n await set(key, data);\n\n return [null];\n } catch (error) {\n return [error];\n }\n};\n\n/**\n * Gets the settings from the storage.\n *\n * @returns {Promise<[ error: any, value: any ]>} The settings and an error if occurred.\n */\nexport const getSettings = async () => {\n return getItem(STORAGE_PREFIX + SETTINGS_STORAGE_KEY);\n};\n\n/**\n * Sets the settings in the storage.\n *\n * @param {any} data - The settings to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nexport const setSettings = async data => {\n return setItem(STORAGE_PREFIX + SETTINGS_STORAGE_KEY, data);\n};\n\n/**\n * Gets the history from the storage.\n *\n * @returns {Promise<[ error: any, value: any ]>} The history and an error if occurred.\n */\nexport const getHistory = async () => {\n return getItem(STORAGE_PREFIX + HISTORY_STORAGE_KEY);\n};\n\n/**\n * Sets the history in the storage.\n *\n * @param {any} data - The history to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nexport const setHistory = async data => {\n return setItem(STORAGE_PREFIX + HISTORY_STORAGE_KEY, data);\n};\n","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction promisifyRequest(request) {\n return new Promise(function (resolve, reject) {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = function () {\n return resolve(request.result);\n }; // @ts-ignore - file size hacks\n\n\n request.onabort = request.onerror = function () {\n return reject(request.error);\n };\n });\n}\n\nfunction createStore(dbName, storeName) {\n var request = indexedDB.open(dbName);\n\n request.onupgradeneeded = function () {\n return request.result.createObjectStore(storeName);\n };\n\n var dbp = promisifyRequest(request);\n return function (txMode, callback) {\n return dbp.then(function (db) {\n return callback(db.transaction(storeName, txMode).objectStore(storeName));\n });\n };\n}\n\nvar defaultGetStoreFunc;\n\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction get(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readonly', function (store) {\n return promisifyRequest(store.get(key));\n });\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction set(key, value) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction setMany(entries) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n entries.forEach(function (entry) {\n return store.put(entry[1], entry[0]);\n });\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction getMany(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readonly', function (store) {\n return Promise.all(keys.map(function (key) {\n return promisifyRequest(store.get(key));\n }));\n });\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction update(key, updater) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();\n return customStore('readwrite', function (store) {\n return (// Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise(function (resolve, reject) {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n })\n );\n });\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction del(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction delMany(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n keys.forEach(function (key) {\n return store.delete(key);\n });\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction clear() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\n\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction keys() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n\n var items = [];\n return eachCursor(store, function (cursor) {\n return items.push(cursor.key);\n }).then(function () {\n return items;\n });\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction values() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n\n var items = [];\n return eachCursor(store, function (cursor) {\n return items.push(cursor.value);\n }).then(function () {\n return items;\n });\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction entries() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([promisifyRequest(store.getAllKeys()), promisifyRequest(store.getAll())]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n keys = _ref2[0],\n values = _ref2[1];\n\n return keys.map(function (key, i) {\n return [key, values[i]];\n });\n });\n }\n\n var items = [];\n return customStore('readonly', function (store) {\n return eachCursor(store, function (cursor) {\n return items.push([cursor.key, cursor.value]);\n }).then(function () {\n return items;\n });\n });\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * 'n' milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {function} fn The function to be executed.\n * @param {Number} [wait=0] Time of delay in milliseconds. It is required if `immediate` is used.\n * @param {Boolean} [immediate=false] If true or any truthy value, triggers the function on the leading edge.\n * @throws {TypeError} If `fn` is not function.\n * @returns {function} A new debounced function.\n * @example\n *\n * const debouncedHandler = debounce(() => {\n * // Do your thing here...\n * }, 250);\n *\n * window.addEventListener('resize', debouncedHandler, false);\n */\nconst debounce = (fn, wait = 0, immediate = false) => {\n let timerId = null;\n\n if (typeof fn !== 'function') {\n throw new TypeError('Expected a function for first argument');\n }\n\n return (...args) => {\n clearTimeout(timerId);\n\n if (immediate && !timerId) {\n fn(...args);\n }\n\n timerId = setTimeout(() => {\n timerId = null;\n if (!immediate) {\n fn(...args);\n }\n }, wait);\n };\n};\n\nexport { debounce };\n","/**\n * Log to console only in development mode.\n *\n * @param {...any} args - Arguments to log\n */\nexport function log(...args) {\n process.env.NODE_ENV === 'development' && console.log(...args);\n}\n","/**\n * Check if the dialog element is supported.\n *\n * @returns {boolean} - Returns true if the dialog element is supported.\n */\nexport const isDialogElementSupported = () => {\n return typeof HTMLDialogElement === 'function';\n};\n","/**\n * Renders the supported formats.\n *\n * @param {Array} formats - Supported barcode formats\n */\nexport function renderSupportedFormats(formats) {\n if (!Array.isArray(formats) || formats.length === 0) {\n return;\n }\n\n const supportedFormatsEl = document.getElementById('supportedFormats');\n\n if (!supportedFormatsEl) {\n return;\n }\n\n supportedFormatsEl.textContent = `Supported formats: ${formats.join(', ')}`;\n}\n","import { getHistory, setHistory, getSettings } from '../services/storage.js';\n\n/**\n * Renders the history list. If there are no items in history, it will show a message.\n *\n * @param {Array} data - Hidsoty data as an array of strings\n */\nexport function renderHistoryList(data) {\n const historyList = document.getElementById('historyList');\n\n if (!historyList) {\n return;\n }\n\n const emptyHistoryBtn = document.getElementById('emptyHistoryBtn');\n\n historyList.replaceChildren();\n\n if (!Array.isArray(data) || data.length === 0) {\n historyList.innerHTML = '
  • There are no saved items in history.
  • ';\n emptyHistoryBtn.hidden = true;\n } else {\n emptyHistoryBtn.hidden = false;\n\n data.forEach((item, index) => {\n const li = document.createElement('li');\n li.setAttribute('data-value', item);\n\n let historyItem;\n\n try {\n new URL(item);\n historyItem = document.createElement('a');\n historyItem.href = item;\n historyItem.setAttribute('target', '_blank');\n historyItem.setAttribute('rel', 'noreferrer noopener');\n } catch {\n historyItem = document.createElement('span');\n }\n\n historyItem.textContent = item;\n historyItem.setAttribute('id', `historyItem-${index}`);\n\n const actionsEl = document.createElement('div');\n actionsEl.className = 'history-modal__actions';\n\n const copyBtn = document.createElement('custom-clipboard-copy');\n copyBtn.setAttribute('id', `copyHistoryItem-${index}`);\n copyBtn.setAttribute('aria-label', 'Copy to clipboard');\n copyBtn.setAttribute('aria-labelledby', `copyHistoryItem-${index} historyItem-${index}`);\n copyBtn.setAttribute('only-icon', '');\n copyBtn.setAttribute('value', item);\n actionsEl.appendChild(copyBtn);\n\n const removeBtn = document.createElement('button');\n removeBtn.type = 'button';\n removeBtn.className = 'history-modal__delete-action';\n removeBtn.setAttribute('data-action', 'delete');\n removeBtn.setAttribute('id', `removeHistoryItem-${index}`);\n removeBtn.setAttribute('aria-label', 'Remove from history');\n removeBtn.setAttribute('aria-labelledby', `removeHistoryItem-${index} historyItem-${index}`);\n removeBtn.innerHTML = /* html */ `\n \n \n \n `;\n actionsEl.appendChild(removeBtn);\n\n li.appendChild(historyItem);\n li.appendChild(actionsEl);\n historyList.appendChild(li);\n });\n }\n}\n\n/**\n * Adds an item to the history.\n * If the item is already in history, it will not be added.\n *\n * @param {string} item - Item to add to history\n */\nexport async function addToHistory(item) {\n const [, settings] = await getSettings();\n\n if (!item || !settings?.addToHistory) {\n return;\n }\n\n const [getHistoryError, history = []] = await getHistory();\n\n if (!getHistoryError && Array.isArray(history) && !history.find(h => h === item)) {\n const data = [...history, item];\n\n const [setHistoryError] = await setHistory(data);\n\n if (!setHistoryError) {\n renderHistoryList(data);\n }\n }\n}\n\n/**\n * Removes an item from the history.\n *\n * @param {string} item - Item to remove from history\n */\nexport async function removeFromHistory(item) {\n if (!item) {\n return;\n }\n\n const [getHistoryError, history = []] = await getHistory();\n\n if (!getHistoryError && Array.isArray(history)) {\n const data = history.filter(el => el !== item);\n const [setHistoryError] = await setHistory(data);\n\n if (!setHistoryError) {\n renderHistoryList(data);\n }\n }\n}\n\n/**\n * Removes all items from the history.\n */\nexport async function emptyHistory() {\n const [setHistoryError] = await setHistory([]);\n\n if (!setHistoryError) {\n renderHistoryList([]);\n }\n}\n","/**\n * Removes the scanned result from the element where it is shown.\n *\n * @param {HTMLElement} element - The element to remove the result from.\n */\nexport function hideResult(element) {\n if (!element) {\n return;\n }\n\n const scanResultEl = element.querySelector('scan-result');\n scanResultEl?.remove();\n}\n\n/**\n * Creates and shows the scanned result inside the given element.\n *\n * @param {HTMLElement} element - The element to show the result in.\n * @param {string} value - The value to create the result with.\n */\nexport async function showResult(element, value) {\n if (!element || !value) {\n return;\n }\n\n const oldScanResultEl = element.querySelector('scan-result');\n\n if (oldScanResultEl) {\n oldScanResultEl.setAttribute('value', value);\n } else {\n const newScanResultEl = document.createElement('scan-result');\n newScanResultEl.setAttribute('value', value);\n newScanResultEl.setAttribute('role', 'alert');\n newScanResultEl.setAttribute('aria-live', 'assertive');\n newScanResultEl.setAttribute('aria-atomic', 'true');\n element.appendChild(newScanResultEl);\n }\n}\n","import { getSettings } from '../services/storage.js';\nimport { beep } from '../utils/beep.js';\nimport { vibrate } from '../utils/vibrate.js';\n\n/**\n * Triggers the scan effects like beep and vibrate.\n *\n * @param {Object} options\n * @param {boolean} [options.success=true] - Whether to trigger the success or error effects.\n */\nexport async function triggerScanEffects(options = {}) {\n const { success = true } = options;\n const [, settings] = await getSettings();\n\n if (!settings) {\n return;\n }\n\n const beepConfig = success\n ? { duration: 200, frequency: 860, volume: 0.03, type: 'square' }\n : { duration: 300, frequency: 200, volume: 0.05, type: 'sawtooth' };\n\n settings.beep && beep(beepConfig);\n settings.vibrate && vibrate(success ? 100 : 200);\n}\n","/**\n * Beep sound using the `AudioContext` interface.\n *\n * @param {Object} options\n * @param {Number} options.duration - Duration in milliseconds\n * @param {Number} options.frequency - Frequency in Hz\n * @param {Number} options.volume - Volume\n * @param {String} options.type - Type of oscillator\n * @param {Function} options.onEnded - Callback function when the sound ends\n */\nexport const beep = (() => {\n const audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext)();\n\n if (!audioCtx) {\n return;\n }\n\n return options => {\n const { duration, frequency, volume, type, onEnded } = options;\n const oscillator = audioCtx.createOscillator();\n const gainNode = audioCtx.createGain();\n\n oscillator.connect(gainNode);\n gainNode.connect(audioCtx.destination);\n\n if (volume) {\n gainNode.gain.value = volume;\n }\n\n if (frequency) {\n oscillator.frequency.value = frequency;\n }\n\n if (type) {\n oscillator.type = type;\n }\n\n if (typeof onEnded === 'function') {\n oscillator.onended = onEnded;\n }\n\n oscillator.start(audioCtx.currentTime);\n oscillator.stop(audioCtx.currentTime + (duration || 500) / 1000);\n };\n})();\n","/**\n * Vibrate the device.\n * If the device does not support vibration, this function will fail silently.\n *\n * @param {Number} [duration=0] - Duration in milliseconds\n */\nexport async function vibrate(duration = 0) {\n if (typeof window.navigator.vibrate !== 'function') {\n return;\n }\n\n try {\n window.navigator.vibrate(duration);\n } catch {\n // Fail silently...\n }\n}\n","/**\n * Resizes the scan frame to match the video element's dimensions.\n *\n * @param {HTMLVideoElement} videoEl - Video element\n * @param {HTMLElement} scanFrameEl - Scan frame element\n */\nexport function resizeScanFrame(videoEl, scanFrameEl) {\n if (!videoEl || !scanFrameEl) {\n return;\n }\n\n const rect = videoEl.getBoundingClientRect();\n\n scanFrameEl.style.cssText = `width: ${rect.width}px; height: ${rect.height}px`;\n}\n","import { log } from '../utils/log.js';\n\n/**\n * BarcodeReader class to detect barcodes from images or videos.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector\n */\nclass BarcodeReader {\n static async polyfill() {\n if (!('BarcodeDetector' in window)) {\n try {\n await import('barcode-detector');\n log('Using BarcodeDetector polyfill.');\n } catch {\n throw new Error('BarcodeDetector API is not supported by your browser.');\n }\n } else {\n log('Using the native BarcodeDetector API.');\n }\n }\n\n /**\n * Get the supported barcode formats.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/getSupportedFormats\n * @returns {Promise>} - Supported barcode formats\n */\n static async getSupportedFormats() {\n return await window.BarcodeDetector.getSupportedFormats();\n }\n\n /**\n * Create a new BarcodeReader instance.\n *\n * @returns {Promise} - New BarcodeReader instance\n */\n static async create() {\n const formats = await window.BarcodeDetector.getSupportedFormats();\n return new BarcodeReader(formats);\n }\n\n /**\n * Initialize the BarcodeReader.\n *\n * @returns {Promise<{ barcodeReader: BarcodeReader, barcodeFormats: Array, barcodeReaderError: Error }>} - BarcodeReader instance, supported formats, and error\n */\n static async init() {\n try {\n await BarcodeReader.polyfill();\n const barcodeReader = await BarcodeReader.create();\n const barcodeFormats = await BarcodeReader.getSupportedFormats();\n return { barcodeReader, barcodeFormats, barcodeReaderError: null };\n } catch (error) {\n return {\n barcodeReader: null,\n barcodeFormats: [],\n barcodeReaderError: error\n };\n }\n }\n\n /**\n * Create a new BarcodeReader instance.\n *\n * @param {Array} formats - Supported barcode formats\n */\n constructor(formats) {\n this.barcodeReader = new window.BarcodeDetector({ formats });\n }\n\n /**\n * Detect barcodes from the provided source.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/detect\n * @param {HTMLImageElement|HTMLVideoElement|ImageBitmap} source - Image or video element or ImageBitmap\n * @returns {Promise} - Barcode detection result\n */\n async detect(source) {\n if (!this.barcodeReader) {\n throw new Error('BarcodeReader is not initialized.');\n }\n\n const results = await this.barcodeReader.detect(source);\n\n if (Array.isArray(results) && results.length > 0) {\n return results[0];\n } else {\n throw new Error('Could not detect barcode from provided source.');\n }\n }\n}\n\nexport { BarcodeReader };\n","import { getSettings } from '../services/storage.js';\n\n/**\n * Initialize the settings form with the saved settings.\n * If a setting is not found, it will be ignored.\n *\n * @param {HTMLFormElement} form - The settings form to initialize.\n */\nexport async function initializeSettingsForm(form) {\n const [, settings = {}] = await getSettings();\n\n Object.entries(settings).forEach(([key, value]) => {\n const settingInput = form.querySelector(`[name=\"${key}\"]`);\n\n if (!settingInput) {\n return;\n }\n\n settingInput.checked = value;\n });\n}\n","/**\n * Toggles the torch button status.\n * The torch button has two icons, one for on and one for off.\n * This function toggles the visibility of the icons based on the torch state and updates the button title.\n *\n * @param {HTMLButtonElement} buttonEl - The torch button element.\n * @param {boolean} isTorchOn - The torch state.\n */\nexport function toggleTorchButtonStatus(options = {}) {\n const defaults = {\n el: document.getElementById('torchButton'),\n isTorchOn: false\n };\n const { el, isTorchOn } = { ...defaults, ...options };\n const iconPaths = el.querySelectorAll('svg path');\n\n if (iconPaths.length !== 2) {\n return;\n }\n\n iconPaths[0].style.display = isTorchOn ? 'none' : 'block';\n iconPaths[1].style.display = isTorchOn ? 'block' : 'none';\n el.setAttribute('title', `Turn ${isTorchOn ? 'off' : 'on'} flash`);\n}\n","import { clamp } from '../utils/clamp.js';\n\nconst COMPONENT_NAME = 'video-capture';\n\nconst styles = /* css */ `\n :host { display: block; box-sizing: border-box; }\n :host *, :host *::before, :host *::after { box-sizing: inherit;}\n :host([hidden]), [hidden], ::slotted([hidden]) { display: none; }\n video { display: block; }\n #output:empty { display: none; }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n
    \n \n`;\n\nclass VideoCapture extends HTMLElement {\n #supportedConstraints = {};\n #stream = null;\n #videoElement = null;\n\n constructor() {\n super();\n\n this.#supportedConstraints = this.getSupportedConstraints();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['no-image', 'pan', 'tilt', 'zoom', 'torch'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) {\n return;\n }\n\n const trackCapabilities = this.getTrackCapabilities();\n\n if (name === 'zoom' && oldValue !== newValue && 'zoom' in this.#supportedConstraints) {\n const zoomInAllowedRange =\n 'zoom' in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max\n ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max\n : false;\n\n if (typeof this.zoom === 'number' && zoomInAllowedRange) {\n this.#applyConstraint('zoom', this.zoom);\n }\n }\n\n if (name === 'torch' && oldValue !== newValue && 'torch' in this.#supportedConstraints) {\n this.#applyConstraint('torch', this.torch);\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n async connectedCallback() {\n this.#upgradeProperty('autoPlay');\n this.#upgradeProperty('facingMode');\n this.#upgradeProperty('zoom');\n this.#upgradeProperty('torch');\n\n this.#videoElement = this.shadowRoot?.querySelector('video') || null;\n\n this.#videoElement?.addEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n\n if (!VideoCapture.isSupported()) {\n return this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: 'NotSupportedError',\n message: 'Not supported'\n }\n }\n })\n );\n }\n\n if (this.autoPlay) {\n this.startVideoStream();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.stopVideoStream();\n this.#videoElement?.removeEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n }\n\n get autoPlay() {\n return this.hasAttribute('auto-play');\n }\n\n set autoPlay(value) {\n this.toggleAttribute('auto-play', !!value);\n }\n\n get facingMode() {\n return this.getAttribute('facing-mode') || 'user';\n }\n\n set facingMode(value) {\n this.setAttribute('facing-mode', value);\n }\n\n get zoom() {\n return Number(this.getAttribute('zoom')) || 1;\n }\n\n set zoom(value) {\n this.setAttribute('zoom', value != null ? value.toString() : value);\n }\n\n get torch() {\n return this.hasAttribute('torch');\n }\n\n set torch(value) {\n this.toggleAttribute('torch', !!value);\n }\n\n get loading() {\n return this.hasAttribute('loading');\n }\n\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {Event} evt - The event object.\n */\n #onVideoLoadedMetaData = evt => {\n const video = evt.target;\n\n video\n .play()\n .then(() => {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: { video }\n })\n );\n })\n .catch(error => {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n })\n .finally(() => {\n this.removeAttribute('loading');\n });\n };\n\n /**\n * Applies a constraint to the video track.\n *\n * @param {string} constraint - The name of the constraint.\n * @param {any} value - The value of the constraint.\n */\n #applyConstraint(constraint, value) {\n if (!this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n const constraintValue =\n constraint === 'pan' || constraint === 'tilt' || constraint === 'zoom'\n ? clamp(\n Number(value),\n trackCapabilities[constraint]?.min || 1,\n trackCapabilities[constraint]?.max || 1\n )\n : value;\n\n if (constraint in trackSettings) {\n track\n .applyConstraints({\n advanced: [{ [constraint]: constraintValue }]\n })\n .catch(() => {\n // Fail silently...\n });\n }\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n\n /**\n * Starts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n * @returns Promise\n */\n async startVideoStream(videoInputId) {\n if (!VideoCapture.isSupported() || this.#stream) {\n return;\n }\n\n this.setAttribute('loading', '');\n\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || 'user'\n },\n pan: true,\n tilt: true,\n zoom: true,\n torch: this.torch\n },\n audio: false\n };\n\n if (typeof videoInputId === 'string' && videoInputId.trim().length > 0) {\n constraints.video.deviceId = { exact: videoInputId };\n }\n\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n\n if (this.#videoElement) {\n this.#videoElement.srcObject = this.#stream;\n }\n\n this.#applyConstraint('pan', this.pan);\n this.#applyConstraint('tilt', this.tilt);\n this.#applyConstraint('zoom', this.zoom);\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n } finally {\n this.removeAttribute('loading');\n }\n }\n\n /**\n * Restarts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n */\n restartVideoStream(videoInputId) {\n if (this.#stream && this.#videoElement) {\n this.stopVideoStream();\n }\n\n this.startVideoStream(videoInputId);\n }\n\n /**\n * Stops the video stream.\n */\n stopVideoStream() {\n if (!this.#videoElement || !this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */\n getSupportedConstraints() {\n if (!VideoCapture.isSupported()) {\n return {};\n }\n\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */\n getTrackCapabilities() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getCapabilities === 'function') {\n return track.getCapabilities() || {};\n }\n\n return {};\n }\n\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */\n getTrackSettings() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getSettings === 'function') {\n return track.getSettings() || {};\n }\n\n return {};\n }\n\n /**\n * Returns the available video input devices.\n *\n * @returns {Promise}\n */\n static async getVideoInputDevices() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {\n return [];\n }\n\n const devices = (await navigator.mediaDevices.enumerateDevices()) || [];\n return devices.filter(device => device.kind === 'videoinput' && !!device.deviceId);\n }\n\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */\n static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='video-capture'] - The name of the custom element.\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, VideoCapture);\n }\n }\n}\n\nexport { VideoCapture };\n","/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */\nexport const clamp = (value, lower, upper) => {\n if (Number.isNaN(lower)) {\n lower = 0;\n }\n\n if (Number.isNaN(upper)) {\n upper = 0;\n }\n\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n","import { ClipboardCopy } from '@georapbox/clipboard-copy-element/dist/clipboard-copy.js';\n\n/**\n * Extends the `ClipboardCopy` element to override the default `copy` and `success` slots,\n * in order to avoid repetition of the same markup throughout the application.\n * It also adds aditional properties and attributes, specific to the application.\n *\n * @class CustomClipboardCopy\n * @extends ClipboardCopy\n */\nclass CustomClipboardCopy extends ClipboardCopy {\n constructor() {\n super();\n\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n\n copySlot.innerHTML = /* html */ `\n \n \n \n \n Copy\n `;\n\n successSlot.innerHTML = /* html */ `\n \n \n \n \n \n Copied!\n `;\n }\n\n static get observedAttributes() {\n return [...super.observedAttributes, 'only-icon'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n\n if (name === 'only-icon' && oldValue !== newValue) {\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n\n const copyText = copySlot.querySelector('.text');\n const successText = successSlot.querySelector('.text');\n\n if (copyText) {\n copyText.hidden = this.onlyIcon;\n }\n\n if (successText) {\n successText.hidden = this.onlyIcon;\n }\n }\n }\n\n get onlyIcon() {\n return this.hasAttribute('only-icon');\n }\n\n set onlyIcon(value) {\n if (value) {\n this.setAttribute('only-icon', '');\n } else {\n this.removeAttribute('only-icon');\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.#upgradeProperty('onlyIcon');\n\n if (!this.hasAttribute('feedback-duration')) {\n this.setAttribute('feedback-duration', '1500');\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'custom-clipboard-copy') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, CustomClipboardCopy);\n }\n }\n}\n\nCustomClipboardCopy.defineCustomElement();\n","/*!\n * @georapbox/clipboard-copy-element\n * A custom element that implements the Clipboard API to copy text content from elements or input values to the clipboard.\n *\n * @version 3.0.2\n * @homepage https://github.com/georapbox/clipboard-copy-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar i=\"clipboard-copy\";var o=\"success\",n=\"error\",h=document.createElement(\"template\"),a=`\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;h.innerHTML=`\n \n \n`;var r=class d extends HTMLElement{#e=void 0;#t=null;#s=null;#i=null;#o=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(h.content.cloneNode(!0)),this.shadowRoot&&(this.#t=this.shadowRoot.querySelector(\"button\"),this.#s=this.shadowRoot.querySelector('slot[name=\"copy\"]'),this.#i=this.shadowRoot.querySelector('slot[name=\"success\"]'),this.#o=this.shadowRoot.querySelector('slot[name=\"error\"]'))}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,s,e){t===\"disabled\"&&s!==e&&this.#t&&(this.#t.disabled=this.disabled,this.#t.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#t.part.contains(\"button\")&&this.#t.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#n(\"value\"),this.#n(\"from\"),this.#n(\"disabled\"),this.#n(\"feedbackDuration\"),this.#t?.addEventListener(\"click\",this.#r)}disconnectedCallback(){this.#t?.removeEventListener(\"click\",this.#r),this.#a()}get value(){return this.getAttribute(\"value\")||\"\"}set value(t){this.setAttribute(\"value\",t!=null?t.toString():t)}get from(){return this.getAttribute(\"from\")||\"\"}set from(t){this.setAttribute(\"from\",t!=null?t.toString():t)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get feedbackDuration(){return Number(this.getAttribute(\"feedback-duration\"))||1e3}set feedbackDuration(t){this.setAttribute(\"feedback-duration\",t!=null?t.toString():t)}async#d(){if(!(!this.value&&!this.from))try{let t=\"\";if(this.value)t=this.value;else if(this.from){let s=\"getRootNode\"in Element.prototype?this.#t?.getRootNode({composed:!0}):this.#t?.ownerDocument;if(!s||!(s instanceof Document||s instanceof ShadowRoot))return;let e=s.querySelector(this.from);if(!e)return;e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?t=e.value:e instanceof HTMLAnchorElement&&e.hasAttribute(\"href\")?t=e.href:t=e.textContent||\"\"}await navigator.clipboard.writeText(t),this.#h(o),this.dispatchEvent(new CustomEvent(`${i}-success`,{bubbles:!0,composed:!0,detail:{value:t}}))}catch(t){this.#h(n),this.dispatchEvent(new CustomEvent(`${i}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}#r=t=>{t.preventDefault(),!(this.disabled||this.#e)&&this.#d()};#h(t){this.#s&&(this.#s.hidden=!0),this.#i&&(this.#i.hidden=t!==o),this.#o&&(this.#o.hidden=t!==n),this.#t?.part.remove(\"button--success\"),this.#t?.part.remove(\"button--error\"),this.#t?.part.add(`button--${t}`),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.#s&&(this.#s.hidden=!1),this.#i&&(this.#i.hidden=!0),this.#o&&(this.#o.hidden=!0),this.#t?.part.remove(`button--${t}`),this.#e=void 0},this.feedbackDuration)}#a(){this.#e&&clearTimeout(this.#e),this.#e=void 0,this.#s&&(this.#s.hidden=!1),this.#i&&(this.#i.hidden=!0),this.#o&&(this.#o.hidden=!0),this.#t?.part.remove(\"button--success\"),this.#t?.part.remove(\"button--error\")}#n(t){let s=this;if(Object.prototype.hasOwnProperty.call(s,t)){let e=s[t];delete s[t],s[t]=e}}static defineCustomElement(t=i){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,d)}};export{r as ClipboardCopy};\n//# sourceMappingURL=clipboard-copy.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst COMPONENT_NAME = 'clipboard-copy';\nconst DEFAULT_FEEDBACK_DURATION = 1000;\nconst SUCCESS_STATUS = 'success';\nconst ERROR_STATUS = 'error';\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element for copying text to the clipboard.\n * @documentation https://github.com/georapbox/clipboard-copy-element#readme\n *\n * @tagname clipboard-copy - This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {string} value - The value to be copied to clipboard.\n * @property {string} from - The CSS selector of the element to copy from.\n * @property {boolean} disabled - Whether the copy to clipboard button is disabled.\n * @property {number} feedbackDuration - The duration for displaying the success or error status.\n *\n * @attribute {string} value - Reflects the value property.\n * @attribute {string} from - Reflects the from property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} feedback-duration - Reflects the feedbackDuration property.\n *\n * @slot copy - The default slot for the copy button.\n * @slot success - The slot for the success status message.\n * @slot error - The slot for the error status message.\n *\n * @csspart button - The button element.\n * @csspart button--success - The button element when the copy operation is successful.\n * @csspart button--error - The button element when the copy operation fails.\n * @csspart button--disabled - The button element when the disabled attribute is set.\n *\n * @fires clipboard-copy-success - Dispatched when the copy operation is successful.\n * @fires clipboard-copy-error - Dispatched when the copy operation fails.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n */\nclass ClipboardCopy extends HTMLElement {\n /** @type {ReturnType | undefined} */\n #timeout = void 0;\n\n /** @type {Nullable} */\n #buttonEl = null;\n\n /** @type {Nullable} */\n #copySlot = null;\n\n /** @type {Nullable} */\n #successSlot = null;\n\n /** @type {Nullable} */\n #errorSlot = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#buttonEl = this.shadowRoot.querySelector('button');\n this.#copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n this.#successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n this.#errorSlot = this.shadowRoot.querySelector('slot[name=\"error\"]');\n }\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue) {\n if (this.#buttonEl) {\n this.#buttonEl.disabled = this.disabled;\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('value');\n this.#upgradeProperty('from');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('feedbackDuration');\n\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n\n // `disconnectedCallback` is also called when the element is moved to a different document,\n // via `Document: adoptNode()` method, therefore we reset the component to its initial state.\n this.#forceResetStatus();\n }\n\n /**\n * The value to be copied to clipboard.\n *\n * @type {string}\n * @attribute value - Reflects the value property.\n */\n get value() {\n return this.getAttribute('value') || '';\n }\n\n set value(value) {\n this.setAttribute('value', value != null ? value.toString() : value);\n }\n\n /**\n * The CSS selector of the element to copy from.\n *\n * @type {string}\n * @attribute from - Reflects the from property.\n */\n get from() {\n return this.getAttribute('from') || '';\n }\n\n set from(value) {\n this.setAttribute('from', value != null ? value.toString() : value);\n }\n\n /**\n * Whether the copy to clipboard button is disabled.\n *\n * @type {boolean}\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * The duration for displaying the success or error status.\n *\n * @type {number}\n * @attribute feedback-duration - Reflects the feedbackDuration property.\n */\n get feedbackDuration() {\n return Number(this.getAttribute('feedback-duration')) || DEFAULT_FEEDBACK_DURATION;\n }\n\n set feedbackDuration(value) {\n this.setAttribute('feedback-duration', value != null ? value.toString() : value);\n }\n\n /**\n * Copies the value to the clipboard and handles success or error states.\n */\n async #copy() {\n if (!this.value && !this.from) {\n return;\n }\n\n try {\n let copyValue = '';\n\n if (this.value) {\n copyValue = this.value;\n } else if (this.from) {\n const root =\n 'getRootNode' in Element.prototype\n ? this.#buttonEl?.getRootNode({ composed: true })\n : this.#buttonEl?.ownerDocument;\n\n if (!root || !(root instanceof Document || root instanceof ShadowRoot)) {\n return;\n }\n\n const element = root.querySelector(this.from);\n\n if (!element) {\n return;\n }\n\n if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {\n copyValue = element.value;\n } else if (element instanceof HTMLAnchorElement && element.hasAttribute('href')) {\n copyValue = element.href;\n } else {\n copyValue = element.textContent || '';\n }\n }\n\n await navigator.clipboard.writeText(copyValue);\n\n this.#showStatus(SUCCESS_STATUS);\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-success`, {\n bubbles: true,\n composed: true,\n detail: { value: copyValue }\n })\n );\n } catch (error) {\n this.#showStatus(ERROR_STATUS);\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n }\n\n /**\n * Handles the button click event.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled || this.#timeout) {\n return;\n }\n\n this.#copy();\n };\n\n /**\n * Displays the success or error status.\n *\n * @param {string} status - The status to display.\n */\n #showStatus(status) {\n if (this.#copySlot) {\n this.#copySlot.hidden = true;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = status !== SUCCESS_STATUS;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = status !== ERROR_STATUS;\n }\n\n this.#buttonEl?.part.remove('button--success');\n this.#buttonEl?.part.remove('button--error');\n this.#buttonEl?.part.add(`button--${status}`);\n\n this.#timeout && clearTimeout(this.#timeout);\n\n this.#timeout = setTimeout(() => {\n if (this.#copySlot) {\n this.#copySlot.hidden = false;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = true;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = true;\n }\n\n this.#buttonEl?.part.remove(`button--${status}`);\n\n this.#timeout = void 0;\n }, this.feedbackDuration);\n }\n\n /**\n * Resets the status to the initial state.\n * Clears the feedback timeout, hides the success or error slots and shows the copy slot.\n */\n #forceResetStatus() {\n this.#timeout && clearTimeout(this.#timeout);\n this.#timeout = void 0;\n\n if (this.#copySlot) {\n this.#copySlot.hidden = false;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = true;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = true;\n }\n\n this.#buttonEl?.part.remove('button--success');\n this.#buttonEl?.part.remove('button--error');\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'value' | 'from' | 'disabled' | 'feedbackDuration'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='clipboard-copy'] - The name of the custom element.\n * @example\n *\n * ClipboardCopy.defineCustomElement('my-clipboard-copy');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ClipboardCopy);\n }\n }\n}\n\nexport { ClipboardCopy };\n","import { isWebShareSupported } from '@georapbox/web-share-element/dist/is-web-share-supported.js';\nimport { getSettings } from '../services/storage.js';\nimport { NO_BARCODE_DETECTED } from '../constants.js';\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n .result {\n position: relative;\n width: 100%;\n border: 1px solid var(--focus);\n border-radius: 6px;\n margin: 1.5rem 0 0 0;\n padding: 1rem;\n background-color: var(--background-alt);\n text-align: center;\n }\n\n .result__item {\n word-wrap: break-word;\n word-break: break-word;\n }\n\n a.result__item {\n color: var(--links);\n text-decoration: none;\n }\n\n a.result__item:hover {\n text-decoration: underline;\n }\n\n .result__item--no-barcode {\n color: var(--error-color);\n }\n\n .result__actions {\n display: flex;\n align-items: center;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .result web-share button,\n .result custom-clipboard-copy::part(button) {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n margin: 0.75rem 0 0 0;\n padding: 0.25rem;\n background-color: transparent;\n border: 0;\n border-radius: var(--border-radius);\n color: inherit;\n line-height: 1;\n font-family: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n \n \n \n
    \n
    \n`;\n\nclass ScanResult extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n get value() {\n return this.getAttribute('value');\n }\n\n set value(value) {\n this.setAttribute('value', value);\n }\n\n static get observedAttributes() {\n return ['value'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'value' && oldValue !== newValue) {\n this.#handleValueChange(this.value);\n }\n }\n\n connectedCallback() {\n this.#upgradeProperty('value');\n\n if (!isWebShareSupported()) {\n const webShareEl = this.shadowRoot.querySelector('web-share');\n\n if (webShareEl) {\n webShareEl.hidden = true;\n }\n }\n }\n\n async #handleValueChange(value) {\n const baseEl = this.shadowRoot.querySelector('.result');\n const resultActionsEl = baseEl?.querySelector('.result__actions');\n const oldResultItem = baseEl?.querySelector('.result__item');\n let resultItem;\n\n if (oldResultItem) {\n oldResultItem.remove();\n }\n\n try {\n const [, settings] = await getSettings();\n\n new URL(value);\n resultItem = document.createElement('a');\n resultItem.href = value;\n window.requestAnimationFrame(() => resultItem.focus());\n\n if (!settings?.openWebPageSameTab) {\n resultItem.setAttribute('target', '_blank');\n resultItem.setAttribute('rel', 'noreferrer noopener');\n }\n\n if (settings?.openWebPage) {\n resultItem.click();\n }\n } catch {\n resultItem = document.createElement('span');\n }\n\n resultItem.className = 'result__item';\n resultItem.classList.toggle('result__item--no-barcode', value === NO_BARCODE_DETECTED);\n resultItem.textContent = value;\n\n baseEl?.insertBefore(resultItem, resultActionsEl);\n\n const isValidValue = value !== NO_BARCODE_DETECTED;\n const clipboarCopyEl = baseEl?.querySelector('custom-clipboard-copy');\n const webShareEl = baseEl?.querySelector('web-share');\n\n if (clipboarCopyEl && isValidValue) {\n clipboarCopyEl.setAttribute('value', value);\n clipboarCopyEl.hidden = false;\n } else {\n clipboarCopyEl.hidden = true;\n clipboarCopyEl.removeAttribute('value');\n }\n\n if (webShareEl && isWebShareSupported() && isValidValue) {\n webShareEl.setAttribute('share-text', value);\n webShareEl.hidden = false;\n } else {\n webShareEl.hidden = true;\n webShareEl.removeAttribute('share-text');\n }\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'scan-result') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ScanResult);\n }\n }\n}\n\nScanResult.defineCustomElement();\n","/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */\nfunction r(a){return a!==null&&typeof a==\"object\"?\"share\"in navigator&&\"canShare\"in navigator&&navigator.canShare(a):\"share\"in navigator}export{r as isWebShareSupported};\n//# sourceMappingURL=is-web-share-supported.js.map\n","// @ts-check\n\n/**\n * Check if Web Share API is supported by the platform.\n *\n * @param {import('./web-share').ShareData} [options]\n * @returns {boolean} Returns `true` if Web Share API is supported; otherwise `false`.\n */\nfunction isWebShareSupported(options) {\n if (options !== null && typeof options === 'object') {\n return 'share' in navigator && 'canShare' in navigator && navigator.canShare(options);\n }\n\n return 'share' in navigator;\n}\n\nexport { isWebShareSupported };\n"],"names":["$e92a13782f6c06ba$var$defaultGetStoreFunc","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","resolve","then","$2prpb","bundle","Promise","reject","concat","document","getElementsByTagName","some","script","src","preloadLink","createElement","href","rel","as","head","appendChild","async","type","onerror","e","error","TypeError","message","onload","remove","$1c132cac09cd18d9$var$cachedBundles","$1c132cac09cd18d9$var$cachedPreloads","$1c132cac09cd18d9$var$cachedPrefetches","loader","cache","$1c132cac09cd18d9$var$getCache","apply","arguments","catch","$c172d40c323f9126$var$h","a","t","i","Math","random","toString","substring","$c172d40c323f9126$var$b","Object","prototype","hasOwnProperty","$c172d40c323f9126$var$E","$c172d40c323f9126$var$C","$c172d40c323f9126$var$w","innerHTML","$c172d40c323f9126$export$6824c350c20eab3a","HTMLElement","constructor","shadowRoot","attachShadow","mode","content","cloneNode","observedAttributes","attributeChangedCallback","s","setAttribute","selected","disabled","closable","className","querySelector","addEventListener","removeEventListener","connectedCallback","disconnectedCallback","hasAttribute","toggleAttribute","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","detail","tabId","defineCustomElement","customElements","get","define","$c172d40c323f9126$var$L","$c172d40c323f9126$var$S","$c172d40c323f9126$var$T","$c172d40c323f9126$export$185adf5fa2c760b1","$c172d40c323f9126$var$n","TOP","BOTTOM","START","END","$c172d40c323f9126$var$l","LTR","RTL","$c172d40c323f9126$var$R","entries","map","$c172d40c323f9126$var$r","AUTO","MANUAL","$c172d40c323f9126$var$c","DOWN","LEFT","RIGHT","UP","HOME","ENTER","SPACE","$c172d40c323f9126$var$x","$c172d40c323f9126$var$A","$c172d40c323f9126$export$4ac05a649254e913","l","placement","getAttribute","noScrollControls","scrollDistance","abs","Number","$c172d40c323f9126$var$y","activation","noTabCycling","o","Array","from","querySelectorAll","n","g","p","forEach","d","f","m","ResizeObserver","requestAnimationFrame","v","target","scrollWidth","clientWidth","_","part","toggle","classList","h","c","unobserve","observe","disconnect","cancelAnimationFrame","CSS","supports","matches","getComputedStyle","direction","hidden","length","w","nextElementSibling","tagName","toLowerCase","console","T","b","y","find","A","findIndex","r","E","u","name","altKey","includes","key","focus","selectTab","preventDefault","closest","contains","scrollLeft","scrollTo","left","selectTabByIndex","selectTabById","scrollIntoView","inline","block","$4f74a8126e204146$var$h","$4f74a8126e204146$var$r","$4f74a8126e204146$export$30b344bef3e55b67","delegatesFocus","shareUrl","shareTitle","shareText","shareFiles","isArray","share","url","title","text","navigator","canShare","files","shareData","nodeName","assignedElements","flatten","$7aad62ebc3d6fae8$var$x","Map","$7aad62ebc3d6fae8$var$b","$7aad62ebc3d6fae8$var$y","lastIndexOf","split","pop","defineProperty","value","writable","configurable","enumerable","$7aad62ebc3d6fae8$var$g","path","webkitRelativePath","$7aad62ebc3d6fae8$var$m","readEntries","$7aad62ebc3d6fae8$var$w","push","$7aad62ebc3d6fae8$var$E","file","fullPath","$7aad62ebc3d6fae8$var$F","kind","getAsEntry","webkitGetAsEntry","shift","isFile","indexOf","isDirectory","createReader","$7aad62ebc3d6fae8$var$f","$7aad62ebc3d6fae8$var$l","dataTransfer","items","$7aad62ebc3d6fae8$var$n","$7aad62ebc3d6fae8$var$v","$7aad62ebc3d6fae8$var$z","$7aad62ebc3d6fae8$var$S","$7aad62ebc3d6fae8$export$6ccd1735166caad9","getElementById","accept","removeAttribute","multiple","autoFocus","maxFiles","floor","maxSize","isNaN","minSize","noStyle","Event","dropEffect","add","click","errors","$7aad62ebc3d6fae8$var$u","Set","trim","filter","Boolean","replace","charAt","test","size","acceptedFiles","rejectedFiles","defaultValue","openFileDialog","$81b28a4cd686838b$var$o","$81b28a4cd686838b$export$f0e45424cc896229","$4da30046ce6d9325$var$n","$4da30046ce6d9325$var$r","$4da30046ce6d9325$export$32589115725b904b","open","showModal","element","body","preserveOverflow","style","overflow","close","noHeader","noAnimations","noCloseButton","clearTimeout","staticBackdrop","fullscreen","closeLabel","textContent","setTimeout","defaultPrevented","currentTarget","hide","assignedNodes","cancelable","reason","show","$33dea9d9a6da4c9a$export$c263bd68c6f5ce7a","$33dea9d9a6da4c9a$export$63e7bed68b07a85c","$e92a13782f6c06ba$export$b327150396135fe7","request","oncomplete","onsuccess","result","onabort","$e92a13782f6c06ba$var$defaultGetStore","dbName","storeName","dbp","indexedDB","onupgradeneeded","createObjectStore","txMode","callback","db","transaction","objectStore","$c96efe8837e99c11$var$STORAGE_PREFIX","$c96efe8837e99c11$var$SETTINGS_STORAGE_KEY","$c96efe8837e99c11$var$HISTORY_STORAGE_KEY","$c96efe8837e99c11$var$getItem","customStore","undefined","store","$c96efe8837e99c11$var$setItem","data","put","$c96efe8837e99c11$export$4a647155031ece","$c96efe8837e99c11$export$dc86d17a64679bc7","$c96efe8837e99c11$export$f9582a3c130d9538","$c96efe8837e99c11$export$96fe1132eb44c325","$f7942db15ba0cc81$export$61fc7d43ac8f84b0","fn","wait","immediate","timerId","args","$4840d5fa714b09de$export$c694186e9d94f0","HTMLDialogElement","$2cce6ab38d28b4d0$export$fa9e3380e441c420","historyList","emptyHistoryBtn","replaceChildren","item","index","historyItem","li","URL","actionsEl","copyBtn","removeBtn","$2cce6ab38d28b4d0$export$7a6a9d84993ff4e","settings","addToHistory","getHistoryError","history","setHistoryError","$2cce6ab38d28b4d0$export$3a61248021dae916","el","$2cce6ab38d28b4d0$export$9f74b61e5d33cda2","$696a3a8b3e5710f1$export$97c08f0895810b94","oldScanResultEl","newScanResultEl","$19ecce1b28895d1c$export$d6c943e433460aae","audioCtx","AudioContext","webkitAudioContext","audioContext","options","duration","frequency","volume","onEnded","oscillator","createOscillator","gainNode","createGain","connect","destination","gain","onended","start","currentTime","stop","$08aca92dc2b3c75c$export$3ca8e905da0a0ca8","vibrate","$0460f8ef7b1421c2$export$9b466d13e2031a67","success","beep","$d335f5b5c097c74d$export$1404f0e91c73fec","videoEl","scanFrameEl","rect","getBoundingClientRect","cssText","width","height","$586e2c3c9ffe53e0$export$f21d9483ebeee00a","polyfill","getSupportedFormats","BarcodeDetector","create","barcodeReader","barcodeFormats","barcodeReaderError","formats","detect","source","results","$c8149428128c684b$export$9d22ef9ff8e481fe","form","settingInput","checked","$7c034485d4f152a1$export$d1bd0b12fe0d046","isTorchOn","iconPaths","display","$52c18c31ba376620$export$7d15b64cf5a3a4c4","lower","upper","min","max","$149eedd8690347fa$var$COMPONENT_NAME","$149eedd8690347fa$var$styles","$149eedd8690347fa$var$template","$149eedd8690347fa$export$682e9ed90a89bb4a","supportedConstraints","stream","videoElement","getSupportedConstraints","oldValue","newValue","isConnected","trackCapabilities","getTrackCapabilities","zoomInAllowedRange","zoom","applyConstraint","torch","upgradeProperty","onVideoLoadedMetaData","isSupported","autoPlay","startVideoStream","stopVideoStream","facingMode","loading","evt","video","play","finally","constraint","track","getVideoTracks","trackSettings","getTrackSettings","constraintValue","applyConstraints","advanced","prop","videoInputId","constraints","ideal","pan","tilt","audio","deviceId","exact","cameraResolution","x","mediaDevices","getUserMedia","srcObject","restartVideoStream","getCapabilities","getSettings","getVideoInputDevices","enumerateDevices","devices","device","elementName","$5e1cbbd957798f18$var$i","$5e1cbbd957798f18$var$o","$5e1cbbd957798f18$var$n","$5e1cbbd957798f18$var$h","$5e1cbbd957798f18$var$a","$5e1cbbd957798f18$export$ea3b71af1761ff40","feedbackDuration","Element","getRootNode","ownerDocument","Document","ShadowRoot","HTMLInputElement","HTMLTextAreaElement","HTMLAnchorElement","clipboard","writeText","$9d6e877208021767$var$CustomClipboardCopy","copySlot","successSlot","copyText","successText","onlyIcon","$94933cc6427541bd$export$c37129e465f64ef0","$1952518f8eeecdff$var$styles","$1952518f8eeecdff$var$template","$1952518f8eeecdff$var$ScanResult","handleValueChange","webShareEl","resultItem","baseEl","resultActionsEl","oldResultItem","openWebPageSameTab","openWebPage","insertBefore","isValidValue","clipboarCopyEl","instance","rafId","hasExperimentalFlag","URLSearchParams","location","search","has","tabGroupEl","videoCaptureEl","cameraPanel","filePanel","scanInstructionsEl","scanBtn","dropzoneEl","resizeObserverEl","facingModeButton","torchButton","globalActionsEl","historyBtn","historyDialog","settingsBtn","settingsDialog","settingsForm","forms","cameraSelect","shouldScan","alertEl","handleVideoCapturePlay","once","errorMessage","videoCaptureVideoEl","scan","barcode","barcodeValue","rawValue","zoomLevelEl","zoomControls","minZoom","maxZoom","currentZoom","zoomInBtn","zoomOutBtn","videoInputDevices","option","label","join","supportedFormatsEl","scanResultEl","handleFileSelect","image","Image","reader","FileReader","alt","preview","imageWrapper","fileNameWrapper","prepend","readAsDataURL","checkboxes","dataset","confirm","videoDeviceId","selectedTab","visibilityState","handleDocumentEscapeKey","cameraTabSelected","scanBtnVisible","settingsDialogOpen","historyDialogOpen","uid","prefix","suffix","prefixString","suffixString","randomString","tabCounter","styles","template","ATab","_ATab","closeButton","#handleCloseButtonClick","#upgradeProperty","panelCounter","ATabPanel","_ATabPanel","DEFAULT_SCROLL_DISTANCE","PLACEMENT","DIR","validPlacements","ACTIVATION","KEYCODE","ATabGroup","_ATabGroup","#resizeObserver","#rafId","#hasTabSlotChangedOnce","#syncNav","tabSlot","panelSlot","tabsContainer","navContainer","scrollButtons","#handleSlotChange","#handleTabClick","#handleKeyDown","#handleScrollButtonClick","#handleTabClose","targetElement","isElementScrollable","#hideEmptyTabGroup","#stopResizeObserver","#startResizeObserver","scrollElement","#getDirectionality","#allTabs","#linkPanels","tabs","tab","panel","#allPanels","#panelForTab","panelId","#firstTab","#lastTab","#prevTab","newIdx","#nextTab","#reset","panels","#setSelectedTabOnSlotChange","#setSelectedTab","orientation","directionality","scrollButton","isStartButton","isLTR","sign","offsetLeft","oldTab","WebShare","_WebShare","#buttonSlot","#buttonEl","#files","#getButton","#handleClick","isValidFile","acceptedTypeSpecifiers","acceptedMimeTypesList","fileMimeType","baseMimeType","validType","COMMON_MIME_TYPES","FILES_TO_IGNORE","toFileWithMimeType","extension","toFileWithPath","fileWithMimeType","readEntriesPromise","directoryReader","readAllDirectoryEntries","getFileFromFileEntry","fileEntry","getFilesFromDataTransferItemList","dataTransferItemList","queue","entry","getFilesFromFileList","fileList","getFilesFromEvent","COMPONENT_NAME","TOO_MANY_FILES","FILE_TOO_LARGE","FILE_TOO_SMALL","INVALID_MIME_TYPE","FilesDropzone","_FilesDropzone","#fileInput","#dropzoneEl","#handleFileInputChange","#handleDragEnter","#handleDragOver","#handleDragLeave","#handleDrop","#handleKeyUp","num","#handleFilesSelect","filesLength","fileHasValidType","fileExceedsMaxSize","fileIsSmallerThanMinSize","ResizeObserverElement","_ResizeObserverElement","#slotEl","#observedElements","#stopObserver","#startObserver","ModalElement","_ModalElement","#dialogEl","#footerSlotEl","#closeSlotEl","#pulseAnimationTimeout","headerEl","closeBtnEl","#updateCloseLabel","#handleDialogClick","#handleDialogClose","#handleDialogCancel","#handleFooterSlotChange","#handleCloseSlotChange","closeButtonEl","#applyPulseEffectOnDialog","requestCloseEvent","#createRequestCloseEvent","footerEl","footerSlotNodes","hasFooterSlotNodes","SUCCESS_STATUS","ERROR_STATUS","ClipboardCopy","_ClipboardCopy","#timeout","#copySlot","#successSlot","#errorSlot","#forceResetStatus","#copy","copyValue","root","#showStatus","status","isWebShareSupported"],"version":3,"file":"index.a88fc2f6.js.map"} \ No newline at end of file diff --git a/index.0a6e9ff0.js b/index.e93d0af3.js similarity index 95% rename from index.0a6e9ff0.js rename to index.e93d0af3.js index 38c665e..ab97470 100644 --- a/index.0a6e9ff0.js +++ b/index.e93d0af3.js @@ -787,5 +787,5 @@ var t,e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self: -`;class tL extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}).appendChild(tz.content.cloneNode(!0))}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}static get observedAttributes(){return["value"]}attributeChangedCallback(t,e,o){"value"===t&&e!==o&&this.#R(this.value)}connectedCallback(){if(this.#T("value"),!tC()){let t=this.shadowRoot.querySelector("web-share");t&&(t.hidden=!0)}}async #R(t){let e;let o=this.shadowRoot.querySelector(".result"),i=o?.querySelector(".result__actions"),r=o?.querySelector(".result__item");r&&r.remove();try{let[,o]=await Y();new URL(t),(e=document.createElement("a")).href=t,window.requestAnimationFrame(()=>e.focus()),o?.openWebPageSameTab||(e.setAttribute("target","_blank"),e.setAttribute("rel","noreferrer noopener")),o?.openWebPage&&e.click()}catch{e=document.createElement("span")}e.className="result__item",e.classList.toggle("result__item--no-barcode",t===F),e.textContent=t,o?.insertBefore(e,i);let s=t!==F,a=o?.querySelector("custom-clipboard-copy"),n=o?.querySelector("web-share");a&&s?(a.setAttribute("value",t),a.hidden=!1):(a.hidden=!0,a.removeAttribute("value")),n&&tC()&&s?(n.setAttribute("share-text",t),n.hidden=!1):(n.hidden=!0,n.removeAttribute("share-text"))}#T(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t="scan-result"){"undefined"==typeof window||window.customElements.get(t)||window.customElements.define(t,tL)}}tL.defineCustomElement(),async function(){let t;let e=new URLSearchParams(window.location.search).has("experimental"),o=document.querySelector("a-tab-group"),i=document.querySelector("video-capture"),r=document.getElementById("cameraPanel"),s=document.getElementById("filePanel"),a=document.getElementById("scanInstructions"),n=document.getElementById("scanBtn"),l=document.getElementById("dropzone"),d=document.querySelector("resize-observer"),c=document.getElementById("scanFrame"),h=document.getElementById("facingModeButton"),u=document.getElementById("torchButton"),m=document.getElementById("globalActions"),p=document.getElementById("historyBtn"),b=document.getElementById("historyDialog"),g=document.getElementById("settingsBtn"),v=document.getElementById("settingsDialog"),f=document.forms["settings-form"],y=document.getElementById("cameraSelect"),w=!0;tt()&&(m.hidden=!1,b.hidden=!1,v.hidden=!1);let{barcodeReader:E,barcodeFormats:A,barcodeReaderError:x}=await tc.init();if(x){let t=document.getElementById("barcodeReaderError");w=!1,m.hidden=!0,o.hidden=!0,t.hidden=!1,t.textContent=x?.message;return}i.addEventListener("video-capture:video-play",S,{once:!0}),i.addEventListener("video-capture:error",function(t){let e=t.detail.error;if("NotFoundError"===e.name)return;let o="NotAllowedError"===e.name?"Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.":e.message;r.innerHTML=``},{once:!0}),tv.defineCustomElement();let k=i?.shadowRoot?.querySelector("video");async function C(){a.hidden=!1;try{let e=await E.detect(k),o=e?.rawValue??"";if(!o)throw Error(F);window.cancelAnimationFrame(t),ts(r,o),to(o),a.hidden=!0,n.hidden=!1,c.hidden=!0,tl();return}catch{}w&&(t=window.requestAnimationFrame(()=>C()))}async function S(t){c.hidden=!1,td(t.detail.video,c),C();let o=t.target.getTrackSettings(),r=t.target.getTrackCapabilities(),s=document.getElementById("zoomLevel");if("facingMode"in o&&(h.hidden=!1),r?.torch&&(u.hidden=!1,i.hasAttribute("torch")&&tu({el:u,isTorchOn:!0})),o?.zoom&&r?.zoom){let t=document.getElementById("zoomControls"),e=r?.zoom?.min||0,a=r?.zoom?.max||10,n=o?.zoom||1;t.hidden=!1,s.textContent=n,t.addEventListener("click",t=>{let o=t.target.closest('[data-action="zoom-in"]'),r=t.target.closest('[data-action="zoom-out"]');o&&ne&&(n-=.5),s.textContent=n,i.zoom=n})}if(e){let t=await tv.getVideoInputDevices();t.forEach((t,e)=>{let o=document.createElement("option");o.value=t.deviceId,o.textContent=t.label||`Camera ${e+1}`,y.appendChild(o)}),y.hidden=!1,t.length}}l.accept=H.join(","),th(f),function(t){if(!Array.isArray(t)||0===t.length)return;let e=document.getElementById("supportedFormats");e&&(e.textContent=`Supported formats: ${t.join(", ")}`)}(A),te((await K())[1]||[]),n.addEventListener("click",function(){n.hidden=!0,c.hidden=!1,function(t){if(!t)return;let e=t.querySelector("scan-result");e?.remove()}(r),C()}),o.addEventListener("a-tab-show",Q(function(t){let e=t.detail.tabId,o=document.querySelector("video-capture");if("cameraTab"===e){if(w=!0,!o)return;o.loading||r.querySelector("scan-result")||C(),"function"==typeof o.startVideoStream&&o.startVideoStream()}else"fileTab"===e&&(w=!1,null!=o&&"function"==typeof o.stopVideoStream&&o.stopVideoStream())},250)),l.addEventListener("files-dropzone-drop",function(t){!function(t){if(!t)return;let e=new Image,o=new FileReader;o.onload=o=>{let i=o.target.result;e.onload=async()=>{try{let t=await E.detect(e),o=t?.rawValue??"";if(!o)throw Error(F);ts(s,o),to(o),tl()}catch(t){ts(s,F),tl({success:!1})}},e.src=i,e.alt="Image preview",l.replaceChildren();let r=document.createElement("div");r.className="dropzone-preview",r.setAttribute("aria-hidden","true");let a=document.createElement("div");a.className="dropzone-preview__image-wrapper";let n=document.createElement("div");n.className="dropzone-preview__file-name",n.textContent=t.name,a.appendChild(e),r.appendChild(a),r.appendChild(n),l.prepend(r)},o.readAsDataURL(t)}(t.detail.acceptedFiles[0])}),d.addEventListener("resize-observer:resize",function(){td(i.shadowRoot.querySelector("video"),c)}),g.addEventListener("click",function(){v.open=!0}),f.addEventListener("change",function(t){let e={};t.currentTarget.querySelectorAll('input[type="checkbox"]').forEach(t=>e[t.name]=t.checked),X(e)}),p.addEventListener("click",function(){b.open=!0}),b.addEventListener("click",function(t){let e=t.target;if(e.closest('[data-action="delete"]')){let t=e.closest("li").dataset.value;if(window.confirm(`Delete history item ${t}?`)){ti(t);return}}if(e.closest("#emptyHistoryBtn")&&window.confirm("Empty history? This action cannot be undone.")){tr();return}}),h.addEventListener("click",function(){let t="user"===i.facingMode?"environment":"user";i.facingMode=t,"function"==typeof i.restartVideoStream&&i.restartVideoStream(y?.value||void 0)}),u.addEventListener("click",function(t){i.torch=!i.torch,tu({el:t.currentTarget,isTorchOn:i.hasAttribute("torch")})}),e&&y.addEventListener("change",function(t){let e=t.target.value||void 0;"function"==typeof i.restartVideoStream&&i.restartVideoStream(e)}),document.addEventListener("visibilitychange",function(){if("cameraTab"===o.querySelector("[selected]").getAttribute("id")){if("hidden"===document.visibilityState)w=!1,null!=i&&"function"==typeof i.stopVideoStream&&i.stopVideoStream();else{w=!0;let t=document.querySelector("video-capture");if(!t)return;t.loading||r.querySelector("scan-result")||C(),"function"==typeof t.startVideoStream&&t.startVideoStream()}}}),document.addEventListener("keydown",function(t){"Escape"===t.key&&function(){let t=o.querySelector("#cameraTab").hasAttribute("selected"),e=!n.hidden,i=v.hasAttribute("open"),r=b.hasAttribute("open");e&&t&&!(i||r)&&n.click()}()})}(); -//# sourceMappingURL=index.0a6e9ff0.js.map +`;class tL extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}).appendChild(tz.content.cloneNode(!0))}get value(){return this.getAttribute("value")}set value(t){this.setAttribute("value",t)}static get observedAttributes(){return["value"]}attributeChangedCallback(t,e,o){"value"===t&&e!==o&&this.#R(this.value)}connectedCallback(){if(this.#T("value"),!tC()){let t=this.shadowRoot.querySelector("web-share");t&&(t.hidden=!0)}}async #R(t){let e;let o=this.shadowRoot.querySelector(".result"),i=o?.querySelector(".result__actions"),r=o?.querySelector(".result__item");r&&r.remove();try{let[,o]=await Y();new URL(t),(e=document.createElement("a")).href=t,window.requestAnimationFrame(()=>e.focus()),o?.openWebPageSameTab||(e.setAttribute("target","_blank"),e.setAttribute("rel","noreferrer noopener")),o?.openWebPage&&e.click()}catch{e=document.createElement("span")}e.className="result__item",e.classList.toggle("result__item--no-barcode",t===F),e.textContent=t,o?.insertBefore(e,i);let s=t!==F,a=o?.querySelector("custom-clipboard-copy"),n=o?.querySelector("web-share");a&&s?(a.setAttribute("value",t),a.hidden=!1):(a.hidden=!0,a.removeAttribute("value")),n&&tC()&&s?(n.setAttribute("share-text",t),n.hidden=!1):(n.hidden=!0,n.removeAttribute("share-text"))}#T(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t="scan-result"){"undefined"==typeof window||window.customElements.get(t)||window.customElements.define(t,tL)}}tL.defineCustomElement(),async function(){let t;let e=new URLSearchParams(window.location.search).has("experimental"),o=document.querySelector("a-tab-group"),i=document.querySelector("video-capture"),r=document.getElementById("cameraPanel"),s=document.getElementById("filePanel"),a=document.getElementById("scanInstructions"),n=document.getElementById("scanBtn"),l=document.getElementById("dropzone"),d=document.querySelector("resize-observer"),c=document.getElementById("scanFrame"),h=document.getElementById("facingModeButton"),u=document.getElementById("torchButton"),m=document.getElementById("globalActions"),p=document.getElementById("historyBtn"),b=document.getElementById("historyDialog"),g=document.getElementById("settingsBtn"),v=document.getElementById("settingsDialog"),f=document.forms["settings-form"],y=document.getElementById("cameraSelect"),w=!0;tt()&&(m.hidden=!1,b.hidden=!1,v.hidden=!1);let{barcodeReader:E,barcodeFormats:A,barcodeReaderError:x}=await tc.init();if(x){let t=document.getElementById("barcodeReaderError");w=!1,m.hidden=!0,o.hidden=!0,t.hidden=!1,t.textContent=x?.message;return}i.addEventListener("video-capture:video-play",S,{once:!0}),i.addEventListener("video-capture:error",function(t){let e=t.detail.error;if("NotFoundError"===e.name)return;let o="NotAllowedError"===e.name?"Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.":e.message;r.innerHTML=``},{once:!0}),tv.defineCustomElement();let k=i?.shadowRoot?.querySelector("video");async function C(){a.hidden=!1;try{let e=await E.detect(k),o=e?.rawValue??"";if(!o)throw Error(F);window.cancelAnimationFrame(t),ts(r,o),to(o),a.hidden=!0,n.hidden=!1,c.hidden=!0,tl();return}catch{}w&&(t=window.requestAnimationFrame(()=>C()))}async function S(t){c.hidden=!1,td(t.detail.video,c),C();let o=t.target.getTrackSettings(),r=t.target.getTrackCapabilities(),s=document.getElementById("zoomLevel");if("facingMode"in o&&(h.hidden=!1),r?.torch&&(u.hidden=!1,i.hasAttribute("torch")&&tu({el:u,isTorchOn:!0})),o?.zoom&&r?.zoom){let t=document.getElementById("zoomControls"),e=r?.zoom?.min||0,a=r?.zoom?.max||10,n=o?.zoom||1;t.hidden=!1,s.textContent=n,t.addEventListener("click",t=>{let o=t.target.closest('[data-action="zoom-in"]'),r=t.target.closest('[data-action="zoom-out"]');o&&ne&&(n-=.5),s.textContent=n,i.zoom=n})}if(e){let t=await tv.getVideoInputDevices();t.forEach((t,e)=>{let o=document.createElement("option");o.value=t.deviceId,o.textContent=t.label||`Camera ${e+1}`,y.appendChild(o)}),t.length>1&&(y.hidden=!1)}}l.accept=H.join(","),th(f),function(t){if(!Array.isArray(t)||0===t.length)return;let e=document.getElementById("supportedFormats");e&&(e.textContent=`Supported formats: ${t.join(", ")}`)}(A),te((await K())[1]||[]),n.addEventListener("click",function(){n.hidden=!0,c.hidden=!1,function(t){if(!t)return;let e=t.querySelector("scan-result");e?.remove()}(r),C()}),o.addEventListener("a-tab-show",Q(function(t){let e=t.detail.tabId,o=document.querySelector("video-capture");if("cameraTab"===e){if(w=!0,!o)return;o.loading||r.querySelector("scan-result")||C(),"function"==typeof o.startVideoStream&&o.startVideoStream()}else"fileTab"===e&&(w=!1,null!=o&&"function"==typeof o.stopVideoStream&&o.stopVideoStream())},250)),l.addEventListener("files-dropzone-drop",function(t){!function(t){if(!t)return;let e=new Image,o=new FileReader;o.onload=o=>{let i=o.target.result;e.onload=async()=>{try{let t=await E.detect(e),o=t?.rawValue??"";if(!o)throw Error(F);ts(s,o),to(o),tl()}catch(t){ts(s,F),tl({success:!1})}},e.src=i,e.alt="Image preview",l.replaceChildren();let r=document.createElement("div");r.className="dropzone-preview",r.setAttribute("aria-hidden","true");let a=document.createElement("div");a.className="dropzone-preview__image-wrapper";let n=document.createElement("div");n.className="dropzone-preview__file-name",n.textContent=t.name,a.appendChild(e),r.appendChild(a),r.appendChild(n),l.prepend(r)},o.readAsDataURL(t)}(t.detail.acceptedFiles[0])}),d.addEventListener("resize-observer:resize",function(){td(i.shadowRoot.querySelector("video"),c)}),g.addEventListener("click",function(){v.open=!0}),f.addEventListener("change",function(t){let e={};t.currentTarget.querySelectorAll('input[type="checkbox"]').forEach(t=>e[t.name]=t.checked),X(e)}),p.addEventListener("click",function(){b.open=!0}),b.addEventListener("click",function(t){let e=t.target;if(e.closest('[data-action="delete"]')){let t=e.closest("li").dataset.value;if(window.confirm(`Delete history item ${t}?`)){ti(t);return}}if(e.closest("#emptyHistoryBtn")&&window.confirm("Empty history? This action cannot be undone.")){tr();return}}),h.addEventListener("click",function(){let t="user"===i.facingMode?"environment":"user";i.facingMode=t,"function"==typeof i.restartVideoStream&&i.restartVideoStream(y?.value||void 0)}),u.addEventListener("click",function(t){i.torch=!i.torch,tu({el:t.currentTarget,isTorchOn:i.hasAttribute("torch")})}),e&&y.addEventListener("change",function(t){let e=t.target.value||void 0;"function"==typeof i.restartVideoStream&&i.restartVideoStream(e)}),document.addEventListener("visibilitychange",function(){if("cameraTab"===o.querySelector("[selected]").getAttribute("id")){if("hidden"===document.visibilityState)w=!1,null!=i&&"function"==typeof i.stopVideoStream&&i.stopVideoStream();else{w=!0;let t=document.querySelector("video-capture");if(!t)return;t.loading||r.querySelector("scan-result")||C(),"function"==typeof t.startVideoStream&&t.startVideoStream()}}}),document.addEventListener("keydown",function(t){"Escape"===t.key&&function(){let t=o.querySelector("#cameraTab").hasAttribute("selected"),e=!n.hidden,i=v.hasAttribute("open"),r=b.hasAttribute("open");e&&t&&!(i||r)&&n.click()}()})}(); +//# sourceMappingURL=index.e93d0af3.js.map diff --git a/index.e93d0af3.js.map b/index.e93d0af3.js.map new file mode 100644 index 0000000..521f1ca --- /dev/null +++ b/index.e93d0af3.js.map @@ -0,0 +1 @@ +{"mappings":"A,I0ByCI,E,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,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/esm-js-loader.js","src/js/index.js","node_modules/@georapbox/a-tab-group/dist/a-tab-group.js","node_modules/@georapbox/a-tab-group/src/utils/uid.js","node_modules/@georapbox/a-tab-group/src/utils/upgrade-property.js","node_modules/@georapbox/a-tab-group/src/a-tab.js","node_modules/@georapbox/a-tab-group/src/a-tab-panel.js","node_modules/@georapbox/a-tab-group/src/a-tab-group.js","node_modules/@georapbox/web-share-element/dist/web-share-defined.js","node_modules/@georapbox/web-share-element/src/web-share.js","node_modules/@georapbox/web-share-element/src/web-share-defined.js","node_modules/@georapbox/files-dropzone-element/dist/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/src/utils/is-valid-file.js","node_modules/@georapbox/files-dropzone-element/src/utils/files-selector.js","node_modules/@georapbox/files-dropzone-element/src/files-dropzone.js","node_modules/@georapbox/files-dropzone-element/src/files-dropzone-defined.js","node_modules/@georapbox/resize-observer-element/dist/resize-observer-defined.js","node_modules/@georapbox/resize-observer-element/src/resize-observer.js","node_modules/@georapbox/resize-observer-element/src/resize-observer-defined.js","node_modules/@georapbox/modal-element/dist/modal-element-defined.js","node_modules/@georapbox/modal-element/src/modal-element.js","node_modules/@georapbox/modal-element/src/modal-element-defined.js","src/js/constants.js","src/js/services/storage.js","node_modules/idb-keyval/dist/compat.js","src/js/utils/debounce.js","src/js/utils/log.js","src/js/utils/isDialogElementSupported.js","src/js/helpers/renderSupportedFormats.js","src/js/helpers/history.js","src/js/helpers/results.js","src/js/helpers/triggerScanEffects.js","src/js/utils/beep.js","src/js/utils/vibrate.js","src/js/helpers/resizeScanFrame.js","src/js/helpers/BarcodeReader.js","src/js/helpers/initializeSettingsForm.js","src/js/helpers/toggleTorchButtonStatus.js","src/js/components/video-capture.js","src/js/utils/clamp.js","src/js/components/clipboard-copy.js","node_modules/@georapbox/clipboard-copy-element/dist/clipboard-copy.js","node_modules/@georapbox/clipboard-copy-element/src/clipboard-copy.js","src/js/components/scan-result.js","node_modules/@georapbox/web-share-element/dist/is-web-share-supported.js","node_modules/@georapbox/web-share-element/src/is-web-share-supported.js"],"sourcesContent":["\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea202\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea202\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"cw9o9\", function(module, exports) {\n\nvar $hffE7 = parcelRequire(\"hffE7\");\nmodule.exports = $hffE7(\"6z40I\").then(()=>parcelRequire(\"aexh3\"));\n\n});\nparcelRegister(\"hffE7\", function(module, exports) {\n\"use strict\";\n\nfunction $c8dff9588896671a$var$load(id) {\n // eslint-disable-next-line no-undef\n return import((parcelRequire(\"kyEFX\")).resolve(id));\n}\nmodule.exports = $c8dff9588896671a$var$load;\n\n});\n\n\n/*!\n * @georapbox/a-tab-group\n * A custom element to create a group of tabs and tab panels.\n *\n * @version 2.4.1\n * @homepage https://github.com/georapbox/a-tab-group#readme\n * @author George Raptis \n * @license MIT\n */ var $5a53255ef6289be5$var$h = (a = \"\", t = \"\")=>{\n let e = typeof a == \"string\" && a !== \"\" ? a + \"-\" : \"\", s = typeof t == \"string\" && t !== \"\" ? \"-\" + t : \"\", i = Math.random().toString(36).substring(2, 8);\n return `${e}${i}${s}`;\n};\nvar $5a53255ef6289be5$var$b = (a, t)=>{\n if (Object.prototype.hasOwnProperty.call(t, a)) {\n let e = t[a];\n delete t[a], t[a] = e;\n }\n};\nvar $5a53255ef6289be5$var$E = 0, $5a53255ef6289be5$var$C = `\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`, $5a53255ef6289be5$var$w = document.createElement(\"template\");\n$5a53255ef6289be5$var$w.innerHTML = `\n \n\n
    \n \n
    \n`;\nvar $5a53255ef6289be5$export$6824c350c20eab3a = class a extends HTMLElement {\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($5a53255ef6289be5$var$w.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"selected\",\n \"disabled\",\n \"closable\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n if (t === \"selected\" && e !== s && (this.setAttribute(\"aria-selected\", this.selected.toString()), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\")), t === \"disabled\" && e !== s && (this.setAttribute(\"aria-disabled\", this.disabled.toString()), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\")), t === \"closable\" && e !== s) {\n if (this.closable) {\n let i = document.createElement(\"span\");\n i.className = \"tab__close\", i.setAttribute(\"part\", \"close-tab\"), i.innerHTML = '', this.shadowRoot?.querySelector(\".tab\")?.appendChild(i), i.addEventListener(\"click\", this.#e);\n } else {\n let i = this.shadowRoot?.querySelector(\".tab__close\");\n i?.removeEventListener(\"click\", this.#e), i?.remove();\n }\n }\n }\n connectedCallback() {\n this.#s(\"selected\"), this.#s(\"disabled\"), this.#s(\"closable\"), this.id || (this.id = $5a53255ef6289be5$var$h(\"tab\", (++$5a53255ef6289be5$var$E).toString())), this.setAttribute(\"slot\", \"tab\"), this.setAttribute(\"role\", \"tab\"), this.setAttribute(\"aria-selected\", \"false\"), this.setAttribute(\"tabindex\", this.disabled || !this.selected ? \"-1\" : \"0\");\n }\n disconnectedCallback() {\n this.shadowRoot?.querySelector(\".tab__close\")?.removeEventListener(\"click\", this.#e);\n }\n get selected() {\n return this.hasAttribute(\"selected\");\n }\n set selected(t) {\n this.toggleAttribute(\"selected\", !!t);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get closable() {\n return this.hasAttribute(\"closable\");\n }\n set closable(t) {\n this.toggleAttribute(\"closable\", !!t);\n }\n #e = (t)=>{\n t.stopPropagation(), this.dispatchEvent(new CustomEvent(\"a-tab-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: this.id\n }\n }));\n };\n #s(t) {\n return $5a53255ef6289be5$var$b(t, this);\n }\n static defineCustomElement(t = \"a-tab\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$5a53255ef6289be5$export$6824c350c20eab3a.defineCustomElement();\nvar $5a53255ef6289be5$var$L = 0, $5a53255ef6289be5$var$S = `\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`, $5a53255ef6289be5$var$T = document.createElement(\"template\");\n$5a53255ef6289be5$var$T.innerHTML = `\n \n\n
    \n \n
    \n`;\nvar $5a53255ef6289be5$export$185adf5fa2c760b1 = class a extends HTMLElement {\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($5a53255ef6289be5$var$T.content.cloneNode(!0));\n }\n connectedCallback() {\n this.setAttribute(\"slot\", \"panel\"), this.setAttribute(\"role\", \"tabpanel\"), this.setAttribute(\"hidden\", \"\"), this.id || (this.id = $5a53255ef6289be5$var$h(\"panel\", (++$5a53255ef6289be5$var$L).toString()));\n }\n static defineCustomElement(t = \"a-tab-panel\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$5a53255ef6289be5$export$185adf5fa2c760b1.defineCustomElement();\nvar $5a53255ef6289be5$var$y = 200, $5a53255ef6289be5$var$n = {\n TOP: \"top\",\n BOTTOM: \"bottom\",\n START: \"start\",\n END: \"end\"\n}, $5a53255ef6289be5$var$l = {\n LTR: \"ltr\",\n RTL: \"rtl\"\n}, $5a53255ef6289be5$var$R = Object.entries($5a53255ef6289be5$var$n).map(([, a])=>a), $5a53255ef6289be5$var$r = {\n AUTO: \"auto\",\n MANUAL: \"manual\"\n}, $5a53255ef6289be5$var$c = {\n DOWN: \"ArrowDown\",\n LEFT: \"ArrowLeft\",\n RIGHT: \"ArrowRight\",\n UP: \"ArrowUp\",\n HOME: \"Home\",\n END: \"End\",\n ENTER: \"Enter\",\n SPACE: \" \"\n}, $5a53255ef6289be5$var$x = `\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${$5a53255ef6289be5$var$l.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${$5a53255ef6289be5$var$l.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${$5a53255ef6289be5$var$l.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${$5a53255ef6289be5$var$l.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${$5a53255ef6289be5$var$n.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${$5a53255ef6289be5$var$n.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${$5a53255ef6289be5$var$n.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${$5a53255ef6289be5$var$n.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${$5a53255ef6289be5$var$n.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`, $5a53255ef6289be5$var$A = document.createElement(\"template\");\n$5a53255ef6289be5$var$A.innerHTML = `\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;\nvar $5a53255ef6289be5$export$4ac05a649254e913 = class a extends HTMLElement {\n #e = null;\n #s = null;\n #l = !1;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($5a53255ef6289be5$var$A.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"placement\",\n \"no-scroll-controls\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n t === \"placement\" && e !== s && this.#i(), t === \"no-scroll-controls\" && e !== s && this.#i();\n }\n get placement() {\n return this.getAttribute(\"placement\") || $5a53255ef6289be5$var$n.TOP;\n }\n set placement(t) {\n t != null && this.setAttribute(\"placement\", t);\n }\n get noScrollControls() {\n return this.hasAttribute(\"no-scroll-controls\");\n }\n set noScrollControls(t) {\n this.toggleAttribute(\"no-scroll-controls\", !!t);\n }\n get scrollDistance() {\n let t = Number(this.getAttribute(\"scroll-distance\"));\n return Math.abs(t) || $5a53255ef6289be5$var$y;\n }\n set scrollDistance(t) {\n this.setAttribute(\"scroll-distance\", Math.abs(t).toString() || $5a53255ef6289be5$var$y.toString());\n }\n get activation() {\n return this.getAttribute(\"activation\") || $5a53255ef6289be5$var$r.AUTO;\n }\n set activation(t) {\n this.setAttribute(\"activation\", t || $5a53255ef6289be5$var$r.AUTO);\n }\n get noTabCycling() {\n return this.hasAttribute(\"no-tab-cycling\");\n }\n set noTabCycling(t) {\n this.toggleAttribute(\"no-tab-cycling\", !!t);\n }\n connectedCallback() {\n this.#o(\"placement\"), this.#o(\"noScrollControls\"), this.#o(\"scrollDistance\"), this.#o(\"activation\"), this.#o(\"noTabCycling\");\n let t = this.shadowRoot?.querySelector(\"slot[name=tab]\"), e = this.shadowRoot?.querySelector(\"slot[name=panel]\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\"), i = this.shadowRoot?.querySelector(\".tab-group__nav\"), o = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n t?.addEventListener(\"slotchange\", this.#n), e?.addEventListener(\"slotchange\", this.#n), s?.addEventListener(\"click\", this.#g), s?.addEventListener(\"keydown\", this.#p), o.forEach((d)=>d.addEventListener(\"click\", this.#f)), this.addEventListener(\"a-tab-close\", this.#m), \"ResizeObserver\" in window && (this.#e = new ResizeObserver((d)=>{\n this.#s = window.requestAnimationFrame(()=>{\n let v = d?.[0]?.target, g = v?.scrollWidth > v?.clientWidth;\n o.forEach((_)=>_.toggleAttribute(\"hidden\", !g)), i?.part.toggle(\"nav--has-scroll-controls\", g), i?.classList.toggle(\"tab-group__nav--has-scroll-controls\", g);\n });\n })), this.#h(), this.#i();\n }\n disconnectedCallback() {\n let t = this.shadowRoot?.querySelector(\"slot[name=tab]\"), e = this.shadowRoot?.querySelector(\"slot[name=panel]\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\"), i = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n t?.removeEventListener(\"slotchange\", this.#n), e?.removeEventListener(\"slotchange\", this.#n), s?.removeEventListener(\"click\", this.#g), s?.removeEventListener(\"keydown\", this.#p), i.forEach((o)=>o.removeEventListener(\"click\", this.#f)), this.removeEventListener(\"a-tab-close\", this.#m), this.#c();\n }\n #v() {\n if (!this.#e) return;\n let t = this.shadowRoot?.querySelector(\".tab-group__tabs\");\n t && (this.#e.unobserve(t), this.#e.observe(t));\n }\n #c() {\n this.#e && (this.#e.disconnect(), this.#s !== null && (window.cancelAnimationFrame(this.#s), this.#s = null));\n }\n #d() {\n return window.CSS.supports(\"selector(:dir(ltr))\") ? this.matches(\":dir(ltr)\") ? $5a53255ef6289be5$var$l.LTR : $5a53255ef6289be5$var$l.RTL : window.getComputedStyle(this).direction || $5a53255ef6289be5$var$l.LTR;\n }\n #h() {\n this.hidden = this.#t().length === 0;\n }\n #w() {\n let t = this.#t();\n this.#h(), t.forEach((e)=>{\n let s = e.nextElementSibling;\n if (!s || s.tagName.toLowerCase() !== \"a-tab-panel\") return console.error(`Tab #${e.id} is not a sibling of a `);\n e.setAttribute(\"aria-controls\", s.id), s.setAttribute(\"aria-labelledby\", e.id);\n });\n }\n #T() {\n return Array.from(this.querySelectorAll(\"a-tab-panel\"));\n }\n #t() {\n return Array.from(this.querySelectorAll(\"a-tab\"));\n }\n #b(t) {\n let e = t.getAttribute(\"aria-controls\");\n return this.querySelector(`#${e}`);\n }\n #y() {\n return this.#t().find((e)=>!e.disabled) || null;\n }\n #A() {\n let t = this.#t();\n for(let e = t.length - 1; e >= 0; e--)if (!t[e].disabled) return t[e];\n return null;\n }\n #a() {\n let t = this.#t(), e = this.activation === $5a53255ef6289be5$var$r.MANUAL ? t.findIndex((s)=>s.matches(\":focus\")) - 1 : t.findIndex((s)=>s.selected) - 1;\n for(; t[(e + t.length) % t.length].disabled;)e--;\n return this.noTabCycling && e < 0 ? null : t[(e + t.length) % t.length];\n }\n #r() {\n let t = this.#t(), e = this.activation === $5a53255ef6289be5$var$r.MANUAL ? t.findIndex((s)=>s.matches(\":focus\")) + 1 : t.findIndex((s)=>s.selected) + 1;\n for(; t[e % t.length].disabled;)e++;\n return this.noTabCycling && e >= t.length ? null : t[e % t.length];\n }\n #_() {\n let t = this.#t(), e = this.#T();\n t.forEach((s)=>s.selected = !1), e.forEach((s)=>s.hidden = !0);\n }\n #i() {\n let t = this.shadowRoot?.querySelector(\".tab-group__nav\"), e = this.shadowRoot?.querySelector(\".tab-group__tabs\"), s = Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\") || []);\n this.noScrollControls || this.placement === $5a53255ef6289be5$var$n.START || this.placement === $5a53255ef6289be5$var$n.END ? (this.#c(), s.forEach((i)=>i.hidden = !0), t?.part.remove(\"nav--has-scroll-controls\"), t?.classList.remove(\"tab-group__nav--has-scroll-controls\"), e?.setAttribute(\"aria-orientation\", \"vertical\")) : (this.#v(), s.forEach((i)=>i.hidden = !1), e?.setAttribute(\"aria-orientation\", \"horizontal\"));\n }\n #E() {\n let t = this.#t(), e = t.find((s)=>s.selected && !s.disabled) || t.find((s)=>!s.disabled);\n e && (this.#l && !e.selected && this.dispatchEvent(new CustomEvent(\"a-tab-show\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n })), this.#u(e));\n }\n #u(t) {\n this.#_(), t && (t.selected = !0);\n let e = this.#b(t);\n e && (e.hidden = !1);\n }\n #n = (t)=>{\n this.#w(), this.#i(), this.#E(), t.target.name === \"tab\" && (this.#l = !0);\n };\n #p = (t)=>{\n if (t.target.tagName.toLowerCase() !== \"a-tab\" || t.altKey) return;\n let e = $5a53255ef6289be5$var$R.includes(this.placement || \"\") ? this.placement : $5a53255ef6289be5$var$n.TOP, s = [\n $5a53255ef6289be5$var$n.TOP,\n $5a53255ef6289be5$var$n.BOTTOM\n ].includes(e || \"\") ? \"horizontal\" : \"vertical\", i = this.#d(), o = null;\n switch(t.key){\n case $5a53255ef6289be5$var$c.LEFT:\n s === \"horizontal\" && (o = i === $5a53255ef6289be5$var$l.LTR ? this.#a() : this.#r(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $5a53255ef6289be5$var$c.RIGHT:\n s === \"horizontal\" && (o = i === $5a53255ef6289be5$var$l.LTR ? this.#r() : this.#a(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $5a53255ef6289be5$var$c.UP:\n s === \"vertical\" && (o = this.#a(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $5a53255ef6289be5$var$c.DOWN:\n s === \"vertical\" && (o = this.#r(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o)));\n break;\n case $5a53255ef6289be5$var$c.HOME:\n o = this.#y(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o));\n break;\n case $5a53255ef6289be5$var$c.END:\n o = this.#A(), o && (this.activation === $5a53255ef6289be5$var$r.MANUAL ? o.focus() : this.selectTab(o));\n break;\n case $5a53255ef6289be5$var$c.ENTER:\n case $5a53255ef6289be5$var$c.SPACE:\n o = t.target, o && this.selectTab(o);\n break;\n default:\n return;\n }\n t.preventDefault();\n };\n #g = (t)=>{\n let e = t.target.closest(\"a-tab\");\n e && this.selectTab(e);\n };\n #f = (t)=>{\n let e = t.target.closest(\".tab-group__scroll-button\"), s = this.shadowRoot?.querySelector(\".tab-group__tabs\");\n if (!e || !s) return;\n let i = e.classList.contains(\"tab-group__scroll-button--start\"), o = this.#d() === $5a53255ef6289be5$var$l.LTR, d = i ? o ? -1 : 1 : o ? 1 : -1, m = s.scrollLeft;\n s.scrollTo({\n left: m + d * this.scrollDistance\n });\n };\n #m = (t)=>{\n let e = t.target, s = this.#b(e);\n e && (e.remove(), e.selected && this.dispatchEvent(new CustomEvent(\"a-tab-hide\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n }))), s && s.tagName.toLowerCase() === \"a-tab-panel\" && s.remove();\n };\n #o(t) {\n return $5a53255ef6289be5$var$b(t, this);\n }\n selectTabByIndex(t) {\n let s = this.#t()[t];\n s && this.selectTab(s);\n }\n selectTabById(t) {\n let s = this.#t().find((i)=>i.id === t);\n s && this.selectTab(s);\n }\n selectTab(t) {\n let e = this.#t().find((s)=>s.selected);\n !t || t.disabled || t.selected || t.tagName.toLowerCase() !== \"a-tab\" || (this.#u(t), window.requestAnimationFrame(()=>{\n t.scrollIntoView({\n inline: \"nearest\",\n block: \"nearest\"\n }), t.focus();\n }), e && this.dispatchEvent(new CustomEvent(\"a-tab-hide\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: e.id\n }\n })), this.dispatchEvent(new CustomEvent(\"a-tab-show\", {\n bubbles: !0,\n composed: !0,\n detail: {\n tabId: t.id\n }\n })));\n }\n static defineCustomElement(t = \"a-tab-group\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$5a53255ef6289be5$export$4ac05a649254e913.defineCustomElement();\n\n\n/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */ var $cd62c5572235e737$var$h = `\n :host {\n display: inline-block;\n }\n`, $cd62c5572235e737$var$r = document.createElement(\"template\");\n$cd62c5572235e737$var$r.innerHTML = `\n \n \n`;\nvar $cd62c5572235e737$export$30b344bef3e55b67 = class a extends HTMLElement {\n #e;\n #t;\n #r = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($cd62c5572235e737$var$r.content.cloneNode(!0)), this.#e = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null, this.#t = this.#h();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, e, i) {\n t === \"disabled\" && e !== i && this.#t && (this.#t.toggleAttribute(\"disabled\", this.disabled), this.#t.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#t.part && this.#t.part.contains(\"button\") && this.#t.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#s(\"shareUrl\"), this.#s(\"shareTitle\"), this.#s(\"shareText\"), this.#s(\"shareFiles\"), this.#s(\"disabled\"), this.#e?.addEventListener(\"slotchange\", this.#a), this.#t?.addEventListener(\"click\", this.#i);\n }\n disconnectedCallback() {\n this.#e?.removeEventListener(\"slotchange\", this.#a), this.#t?.removeEventListener(\"click\", this.#i);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(t) {\n this.setAttribute(\"share-url\", t);\n }\n get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(t) {\n this.setAttribute(\"share-title\", t);\n }\n get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(t) {\n this.setAttribute(\"share-text\", t);\n }\n get shareFiles() {\n return this.#r;\n }\n set shareFiles(t) {\n Array.isArray(t) && t.length > 0 && (this.#r = t);\n }\n async share() {\n if (!this.disabled) try {\n let t = {};\n this.shareUrl && (t.url = this.shareUrl), this.shareTitle && (t.title = this.shareTitle), this.shareText && (t.text = this.shareText), Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n }) && (t.files = this.shareFiles), await navigator.share(t), this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: !0,\n composed: !0,\n detail: {\n shareData: t\n }\n }));\n } catch (t) {\n if (t instanceof Error && t.name === \"AbortError\") {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #i = (t)=>{\n t.preventDefault(), !this.disabled && this.share();\n };\n #a = (t)=>{\n t.target && t.target.name === \"button\" && (this.#t?.removeEventListener(\"click\", this.#i), this.#t = this.#h(), this.#t && (this.#t.addEventListener(\"click\", this.#i), this.#t.nodeName !== \"BUTTON\" && !this.#t.hasAttribute(\"role\") && this.#t.setAttribute(\"role\", \"button\")));\n };\n #h() {\n return this.#e && this.#e.assignedElements({\n flatten: !0\n }).find((t)=>t.nodeName === \"BUTTON\" || t.getAttribute(\"slot\") === \"button\") || null;\n }\n #s(t) {\n let e = this;\n if (Object.prototype.hasOwnProperty.call(e, t)) {\n let i = e[t];\n delete e[t], e[t] = i;\n }\n }\n static defineCustomElement(t = \"web-share\") {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, a);\n }\n};\n$cd62c5572235e737$export$30b344bef3e55b67.defineCustomElement();\n\n\n/*!\n * @georapbox/files-dropzone-element\n * A custom element that creates a drag and drop zone for files\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/files-dropzone-element#readme\n * @author George Raptis \n * @license MIT\n */ function $9351176e8d763a78$var$u(o, e = \"\") {\n if (!e) return !0;\n let t = [\n ...new Set(e.split(\",\").map((r)=>r.trim()).filter(Boolean))\n ], i = o.type, s = i.replace(/\\/.*$/, \"\");\n for (let r of t)if (r.charAt(0) === \".\") {\n if (o.name.toLowerCase().indexOf(r.toLowerCase(), o.name.length - r.length) !== -1) return !0;\n } else if (/\\/\\*$/.test(r)) {\n if (s === r.replace(/\\/.*$/, \"\")) return !0;\n } else if (i === r) return !0;\n return !1;\n}\nvar $9351176e8d763a78$var$x = new Map([\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]), $9351176e8d763a78$var$b = [\n \".DS_Store\",\n \"Thumbs.db\"\n], $9351176e8d763a78$var$y = (o)=>{\n let { name: e } = o;\n if (e && e.lastIndexOf(\".\") !== -1 && !o.type) {\n let i = (e.split(\".\").pop() || \"\").toLowerCase(), s = $9351176e8d763a78$var$x.get(i);\n s && Object.defineProperty(o, \"type\", {\n value: s,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return o;\n}, $9351176e8d763a78$var$g = (o, e)=>{\n let t = $9351176e8d763a78$var$y(o);\n if (typeof t.path != \"string\") {\n let { webkitRelativePath: i } = o;\n Object.defineProperty(t, \"path\", {\n value: typeof e == \"string\" ? e : i || o.name,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return t;\n}, $9351176e8d763a78$var$m = async (o)=>await new Promise((e, t)=>{\n o.readEntries(e, t);\n }), $9351176e8d763a78$var$w = async (o)=>{\n let e = [], t = await $9351176e8d763a78$var$m(o);\n for(; t.length > 0;)e.push(...t), t = await $9351176e8d763a78$var$m(o);\n return e;\n}, $9351176e8d763a78$var$E = (o)=>new Promise((e, t)=>{\n o.file((i)=>e($9351176e8d763a78$var$g(i, o.fullPath)), t);\n }), $9351176e8d763a78$var$F = async (o)=>{\n let e = [], t = [];\n for (let i of o){\n if (i.kind !== \"file\") continue;\n let s = i.getAsEntry ? i.getAsEntry() : i.webkitGetAsEntry();\n t.push(s);\n }\n for(; t.length > 0;){\n let i = t.shift();\n if (i) {\n if (i.isFile) {\n let s = await $9351176e8d763a78$var$E(i);\n $9351176e8d763a78$var$b.indexOf(s.name) === -1 && e.push(s);\n } else i.isDirectory && t.push(...await $9351176e8d763a78$var$w(i.createReader()));\n } else continue;\n }\n return e;\n}, $9351176e8d763a78$var$f = async (o)=>{\n let e = [];\n for (let t of o)$9351176e8d763a78$var$b.indexOf(t.name) === -1 && e.push($9351176e8d763a78$var$g(t));\n return e;\n}, $9351176e8d763a78$var$l = async (o)=>o.dataTransfer ? o.dataTransfer.items ? await $9351176e8d763a78$var$F(o.dataTransfer.items) : await $9351176e8d763a78$var$f(o.dataTransfer.files) : await $9351176e8d763a78$var$f(o.target.files);\nvar $9351176e8d763a78$var$n = \"files-dropzone\", $9351176e8d763a78$var$v = \"TOO_MANY_FILES\", $9351176e8d763a78$var$L = \"FILE_TOO_LARGE\", $9351176e8d763a78$var$k = \"FILE_TOO_SMALL\", $9351176e8d763a78$var$A = \"INVALID_MIME_TYPE\", $9351176e8d763a78$var$z = document.createElement(\"template\"), $9351176e8d763a78$var$S = `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$9351176e8d763a78$var$z.innerHTML = `\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;\nvar $9351176e8d763a78$export$6ccd1735166caad9 = class o extends HTMLElement {\n #t = null;\n #e = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($9351176e8d763a78$var$z.content.cloneNode(!0)), this.shadowRoot && (this.#t = this.shadowRoot.getElementById(\"file-input\"), this.#e = this.shadowRoot.getElementById(\"dropzone\"));\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n e === \"accept\" && t !== i && this.#t && (this.#t.accept = this.accept), e === \"disabled\" && t !== i && this.#t && (this.#t.disabled = this.disabled, this.disabled ? (this.#e?.removeAttribute(\"tabindex\"), this.#e?.setAttribute(\"aria-disabled\", \"true\")) : (this.#e?.setAttribute(\"tabindex\", \"0\"), this.#e?.setAttribute(\"aria-disabled\", \"false\"))), e === \"multiple\" && t !== i && this.#t && (this.#t.multiple = this.multiple);\n }\n connectedCallback() {\n this.#o(\"accept\"), this.#o(\"disabled\"), this.#o(\"maxFiles\"), this.#o(\"maxSize\"), this.#o(\"minSize\"), this.#o(\"multiple\"), this.#o(\"autoFocus\"), this.#o(\"noStyle\"), this.#t?.addEventListener(\"change\", this.#i), this.#e?.addEventListener(\"dragenter\", this.#r), this.#e?.addEventListener(\"dragover\", this.#s), this.#e?.addEventListener(\"dragleave\", this.#n), this.#e?.addEventListener(\"drop\", this.#a), this.#e?.addEventListener(\"click\", this.#d), this.#e?.addEventListener(\"keyup\", this.#l), this.autoFocus && this.#e?.focus();\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"change\", this.#i), this.#e?.removeEventListener(\"dragenter\", this.#r), this.#e?.removeEventListener(\"dragover\", this.#s), this.#e?.removeEventListener(\"dragleave\", this.#n), this.#e?.removeEventListener(\"drop\", this.#a), this.#e?.removeEventListener(\"click\", this.#d), this.#e?.removeEventListener(\"keyup\", this.#l);\n }\n get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(e) {\n this.setAttribute(\"accept\", e != null ? e.toString() : e);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n get maxFiles() {\n let e = Number(this.getAttribute(\"max-files\")) || 0;\n return e <= 0 ? 1 / 0 : Math.floor(Math.abs(e));\n }\n set maxFiles(e) {\n this.setAttribute(\"max-files\", e != null ? e.toString() : e);\n }\n get maxSize() {\n let e = this.getAttribute(\"max-size\");\n if (e === null) return 1 / 0;\n let t = Number(e);\n return Number.isNaN(t) ? 1 / 0 : t;\n }\n set maxSize(e) {\n this.setAttribute(\"max-size\", e != null ? e.toString() : e);\n }\n get minSize() {\n let e = this.getAttribute(\"min-size\");\n if (e === null) return 0;\n let t = Number(e);\n return Number.isNaN(t) ? 0 : t;\n }\n set minSize(e) {\n this.setAttribute(\"min-size\", e != null ? e.toString() : e);\n }\n get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(e) {\n this.toggleAttribute(\"multiple\", !!e);\n }\n get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(e) {\n this.toggleAttribute(\"auto-focus\", !!e);\n }\n get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(e) {\n this.toggleAttribute(\"no-style\", !!e);\n }\n #i = async (e)=>{\n try {\n this.#c(await $9351176e8d763a78$var$l(e));\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n };\n #r = ()=>{\n this.disabled || this.dispatchEvent(new Event(`${$9351176e8d763a78$var$n}-dragenter`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #s = (e)=>{\n if (e.preventDefault(), this.disabled) {\n e.dataTransfer.dropEffect = \"none\";\n return;\n }\n e.dataTransfer.dropEffect = \"copy\", this.#e && (this.#e.classList.add(\"dropzone--dragover\"), this.#e.part.add(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$9351176e8d763a78$var$n}-dragover`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #n = ()=>{\n this.disabled || (this.#e && (this.#e.classList.remove(\"dropzone--dragover\"), this.#e.part.remove(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$9351176e8d763a78$var$n}-dragleave`, {\n bubbles: !0,\n composed: !0\n })));\n };\n #a = async (e)=>{\n if (!this.disabled) {\n e.preventDefault(), this.#e && (this.#e.classList.remove(\"dropzone--dragover\"), this.#e.part.remove(\"dropzone--dragover\"));\n try {\n this.#c(await $9351176e8d763a78$var$l(e));\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n };\n #d = ()=>{\n this.disabled || this.#t?.click();\n };\n #l = (e)=>{\n this.disabled || (e.key === \" \" || e.key === \"Enter\") && this.#t?.click();\n };\n #c(e) {\n if (!Array.isArray(e) || !e.length) return;\n let t = [], i = [], s = e.length;\n if (!this.multiple && s > 1) for (let r of e)i.push({\n file: r,\n errors: [\n {\n code: $9351176e8d763a78$var$v,\n message: \"Too many files selected. Only 1 file is allowed.\"\n }\n ]\n });\n else if (this.multiple && s > this.maxFiles) for (let r of e)i.push({\n file: r,\n errors: [\n {\n code: $9351176e8d763a78$var$v,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else for (let r of e){\n let c = $9351176e8d763a78$var$u(r, this.accept), p = r.size > this.maxSize, h = r.size < this.minSize;\n if (c && !p && !h) t.push(r);\n else {\n let a = [];\n c || a.push({\n code: $9351176e8d763a78$var$A,\n message: `File type \"${r.type}\" is not accepted.`\n }), p && a.push({\n code: $9351176e8d763a78$var$L,\n message: `File size ${r.size} exceeds the maximum size of ${this.maxSize}.`\n }), h && a.push({\n code: $9351176e8d763a78$var$k,\n message: `File size ${r.size} is smaller than the minimum size of ${this.minSize}.`\n }), i.push({\n file: r,\n errors: a\n });\n }\n }\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-drop`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t,\n rejectedFiles: i\n }\n })), t.length > 0 && this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-drop-accepted`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t\n }\n })), i.length > 0 && this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$n}-drop-rejected`, {\n bubbles: !0,\n composed: !0,\n detail: {\n rejectedFiles: i\n }\n })), this.#t && (this.#t.value = this.#t.defaultValue);\n }\n openFileDialog() {\n this.disabled || this.#t?.click();\n }\n #o(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n static defineCustomElement(e = $9351176e8d763a78$var$n) {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, o);\n }\n};\n$9351176e8d763a78$export$6ccd1735166caad9.defineCustomElement();\n\n\n/*!\n * @georapbox/resize-observer-element\n * A custom element that offers a declarative interface to the ResizeObserver API.\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/resize-observer-element#readme\n * @author George Raptis \n * @license MIT\n */ var $1c2cbcdf680d66d4$var$d = \":host { display: contents; }\", $1c2cbcdf680d66d4$var$o = document.createElement(\"template\");\n$1c2cbcdf680d66d4$var$o.innerHTML = `\n \n \n`;\nvar $1c2cbcdf680d66d4$export$f0e45424cc896229 = class n extends HTMLElement {\n #e = null;\n #t = null;\n #s = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($1c2cbcdf680d66d4$var$o.content.cloneNode(!0)), this.#e = this.shadowRoot?.querySelector(\"slot\") ?? null;\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n e === \"disabled\" && t !== i && (this.disabled ? this.#o() : this.#i());\n }\n connectedCallback() {\n this.#d(\"disabled\"), \"ResizeObserver\" in window && (this.#t = new ResizeObserver((e)=>{\n this.dispatchEvent(new CustomEvent(\"resize-observer:resize\", {\n bubbles: !0,\n composed: !0,\n detail: {\n entries: e\n }\n }));\n }), this.disabled || this.#i(), this.#e?.addEventListener(\"slotchange\", this.#n));\n }\n disconnectedCallback() {\n this.#o(), this.#e?.removeEventListener(\"slotchange\", this.#n);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n #i() {\n !this.#e || !this.#t || (this.#s.forEach((e)=>this.#t?.unobserve(e)), this.#s = [], this.#e.assignedElements().forEach((e)=>{\n this.#t?.observe(e), this.#s.push(e);\n }));\n }\n #o() {\n this.#t?.disconnect();\n }\n #n = ()=>{\n this.disabled || this.#i();\n };\n #d(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n static defineCustomElement(e = \"resize-observer\") {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, n);\n }\n};\n$1c2cbcdf680d66d4$export$f0e45424cc896229.defineCustomElement();\n\n\n/*!\n * @georapbox/modal-element\n * A custom element to create a modal, using the native dialog element under the hood.\n *\n * @version 1.8.0\n * @homepage https://github.com/georapbox/modal-element#readme\n * @author George Raptis \n * @license MIT\n */ var $d9c5053bade2d3f8$var$n = document.createElement(\"template\"), $d9c5053bade2d3f8$var$r = `\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: 300ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;\n$d9c5053bade2d3f8$var$n.innerHTML = `\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;\nvar $d9c5053bade2d3f8$export$32589115725b904b = class s extends HTMLElement {\n #e = null;\n #i = null;\n #a = null;\n #o = void 0;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($d9c5053bade2d3f8$var$n.content.cloneNode(!0)), this.shadowRoot && (this.#e = this.shadowRoot.querySelector(\"dialog\"), this.#i = this.shadowRoot.querySelector('slot[name=\"footer\"]'), this.#a = this.shadowRoot.querySelector('slot[name=\"close\"]'));\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\",\n \"close-label\"\n ];\n }\n attributeChangedCallback(e, t, i) {\n if (this.#e !== null) {\n if (e === \"open\" && t !== i && (this.open ? (this.#e.showModal(), this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n })), document.body && !this.preserveOverflow && (document.body.style.overflow = \"hidden\")) : this.#e.close()), e === \"no-header\" && t !== i) {\n let o = this.#e.querySelector(\".dialog__header\");\n o !== null && (o.hidden = this.noHeader);\n }\n if (e === \"no-animations\" && t !== i && this.#e.classList.toggle(\"dialog--no-animations\", this.noAnimations), e === \"no-close-button\" && t !== i) {\n let o = this.#e.querySelector(\".dialog__close\");\n o !== null && (o.hidden = this.noCloseButton);\n }\n e === \"close-label\" && t !== i && this.#r();\n }\n }\n connectedCallback() {\n this.#t(\"open\"), this.#t(\"staticBackdrop\"), this.#t(\"noHeader\"), this.#t(\"noAnimations\"), this.#t(\"noCloseButton\"), this.#t(\"fullscreen\"), this.#t(\"preserveOverflow\"), this.#t(\"placement\"), this.#t(\"closeLabel\"), this.#e?.addEventListener(\"click\", this.#h), this.#e?.addEventListener(\"close\", this.#l), this.#e?.addEventListener(\"cancel\", this.#d), this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#c), this.#i?.addEventListener(\"slotchange\", this.#m), this.#a?.addEventListener(\"slotchange\", this.#g);\n }\n disconnectedCallback() {\n this.#o && clearTimeout(this.#o), this.#e?.addEventListener(\"click\", this.#h), this.#e?.removeEventListener(\"close\", this.#l), this.#e?.removeEventListener(\"cancel\", this.#d), this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#c), this.#i?.removeEventListener(\"slotchange\", this.#m), this.#a?.removeEventListener(\"slotchange\", this.#g);\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(e) {\n this.toggleAttribute(\"open\", !!e);\n }\n get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(e) {\n this.toggleAttribute(\"static-backdrop\", !!e);\n }\n get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(e) {\n this.toggleAttribute(\"no-header\", !!e);\n }\n get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(e) {\n this.toggleAttribute(\"no-animations\", !!e);\n }\n get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(e) {\n this.toggleAttribute(\"no-close-button\", !!e);\n }\n get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(e) {\n this.toggleAttribute(\"fullscreen\", !!e);\n }\n get preserveOverflow() {\n return this.hasAttribute(\"preserve-overflow\");\n }\n set preserveOverflow(e) {\n this.toggleAttribute(\"preserve-overflow\", !!e);\n }\n get placement() {\n return this.getAttribute(\"placement\") || \"center\";\n }\n set placement(e) {\n this.setAttribute(\"placement\", e != null ? e.toString() : e);\n }\n get closeLabel() {\n return this.getAttribute(\"close-label\") || \"Close\";\n }\n set closeLabel(e) {\n this.setAttribute(\"close-label\", e != null ? e.toString() : e);\n }\n #r() {\n if (this.#e === null) return;\n let e = this.#e.querySelector(\".dialog__close\");\n if (e === null) return;\n (this.#a?.assignedElements() || [])?.some((o)=>o.textContent?.replace(/\\s/g, \"\") !== \"\") ? e.removeAttribute(\"aria-label\") : e.setAttribute(\"aria-label\", this.closeLabel);\n }\n #n() {\n this.#o || (this.#e?.classList.add(\"dialog--pulse\"), this.#o = setTimeout(()=>{\n this.#e?.classList.remove(\"dialog--pulse\"), clearTimeout(this.#o), this.#o = void 0;\n }, 300));\n }\n #l = ()=>{\n this.open = !1, this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n })), document.body && !this.preserveOverflow && (document.body.style.overflow = \"\");\n };\n #d = (e)=>{\n let t = this.#s(\"escape-key\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), !this.noAnimations && this.#n());\n };\n #c = (e)=>{\n let t = this.#s(\"close-button\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), !this.noAnimations && this.#n());\n };\n #h = (e)=>{\n let t = e.target, i = e.currentTarget;\n if (t === i) {\n let o = this.#s(\"backdrop-click\");\n this.dispatchEvent(o), o.defaultPrevented || this.staticBackdrop ? !this.noAnimations && this.#n() : this.hide();\n }\n if (t instanceof HTMLElement && t.closest(\"[data-me-close]\") !== null) {\n let o = this.#s(\"external-invoker\");\n this.dispatchEvent(o), o.defaultPrevented ? !this.noAnimations && this.#n() : this.hide();\n }\n };\n #m = ()=>{\n if (this.#e === null) return;\n let e = this.#e.querySelector(\".dialog__footer\");\n if (e === null) return;\n let t = this.#i?.assignedNodes(), i = t ? t.length > 0 : !1;\n e.hidden = !i;\n };\n #g = ()=>{\n this.#r();\n };\n #s(e) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: !0,\n composed: !0,\n cancelable: !0,\n detail: {\n reason: e,\n element: this\n }\n });\n }\n #t(e) {\n let t = this;\n if (Object.prototype.hasOwnProperty.call(t, e)) {\n let i = t[e];\n delete t[e], t[e] = i;\n }\n }\n show() {\n this.open || (this.open = !0);\n }\n hide() {\n this.open && (this.open = !1);\n }\n static defineCustomElement(e = \"modal-element\") {\n typeof window < \"u\" && !window.customElements.get(e) && window.customElements.define(e, s);\n }\n};\n$d9c5053bade2d3f8$export$32589115725b904b.defineCustomElement();\n\n\nconst $65136e012e05e2d7$export$d726fc97fa83318d = \"experimental\";\nconst $65136e012e05e2d7$export$c263bd68c6f5ce7a = \"No barcode detected\";\nconst $65136e012e05e2d7$export$63e7bed68b07a85c = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\"\n];\n\n\nfunction $dc2f4a51b83babfd$var$_slicedToArray(arr, i) {\n return $dc2f4a51b83babfd$var$_arrayWithHoles(arr) || $dc2f4a51b83babfd$var$_iterableToArrayLimit(arr, i) || $dc2f4a51b83babfd$var$_unsupportedIterableToArray(arr, i) || $dc2f4a51b83babfd$var$_nonIterableRest();\n}\nfunction $dc2f4a51b83babfd$var$_nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction $dc2f4a51b83babfd$var$_unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return $dc2f4a51b83babfd$var$_arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $dc2f4a51b83babfd$var$_arrayLikeToArray(o, minLen);\n}\nfunction $dc2f4a51b83babfd$var$_arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\nfunction $dc2f4a51b83babfd$var$_iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\nfunction $dc2f4a51b83babfd$var$_arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction $dc2f4a51b83babfd$export$b327150396135fe7(request) {\n return new Promise(function(resolve, reject) {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = function() {\n return resolve(request.result);\n }; // @ts-ignore - file size hacks\n request.onabort = request.onerror = function() {\n return reject(request.error);\n };\n });\n}\nfunction $dc2f4a51b83babfd$export$f51a9068ac82ea43(dbName, storeName) {\n var request = indexedDB.open(dbName);\n request.onupgradeneeded = function() {\n return request.result.createObjectStore(storeName);\n };\n var dbp = $dc2f4a51b83babfd$export$b327150396135fe7(request);\n return function(txMode, callback) {\n return dbp.then(function(db) {\n return callback(db.transaction(storeName, txMode).objectStore(storeName));\n });\n };\n}\nvar $dc2f4a51b83babfd$var$defaultGetStoreFunc;\nfunction $dc2f4a51b83babfd$var$defaultGetStore() {\n if (!$dc2f4a51b83babfd$var$defaultGetStoreFunc) $dc2f4a51b83babfd$var$defaultGetStoreFunc = $dc2f4a51b83babfd$export$f51a9068ac82ea43(\"keyval-store\", \"keyval\");\n return $dc2f4a51b83babfd$var$defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$3988ae62b71be9a3(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.get(key));\n });\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$adaa4cf7ef1b65be(key, value) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.put(value, key);\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$daa0a5170277c7a8(entries) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n entries.forEach(function(entry) {\n return store.put(entry[1], entry[0]);\n });\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$5df405cccea42673(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n return Promise.all(keys.map(function(key) {\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.get(key));\n }));\n });\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$722fbec263ad908a(key, updater) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n return(// If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise(function(resolve, reject) {\n store.get(key).onsuccess = function() {\n try {\n store.put(updater(this.result), key);\n resolve($dc2f4a51b83babfd$export$b327150396135fe7(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n }));\n });\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$1d2f21e549771e67(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.delete(key);\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$c8aa84257229cac8(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n keys.forEach(function(key) {\n return store.delete(key);\n });\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$42ffd38884aecdac() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readwrite\", function(store) {\n store.clear();\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n });\n}\nfunction $dc2f4a51b83babfd$var$eachCursor(store, callback) {\n store.openCursor().onsuccess = function() {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n return $dc2f4a51b83babfd$export$b327150396135fe7(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$ed97f33186d4b816() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n if (store.getAllKeys) return $dc2f4a51b83babfd$export$b327150396135fe7(store.getAllKeys());\n var items = [];\n return $dc2f4a51b83babfd$var$eachCursor(store, function(cursor) {\n return items.push(cursor.key);\n }).then(function() {\n return items;\n });\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$68c286be0e7e55b7() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n if (store.getAll) return $dc2f4a51b83babfd$export$b327150396135fe7(store.getAll());\n var items = [];\n return $dc2f4a51b83babfd$var$eachCursor(store, function(cursor) {\n return items.push(cursor.value);\n }).then(function() {\n return items;\n });\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */ function $dc2f4a51b83babfd$export$3e9f948b41964866() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $dc2f4a51b83babfd$var$defaultGetStore();\n return customStore(\"readonly\", function(store) {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) return Promise.all([\n $dc2f4a51b83babfd$export$b327150396135fe7(store.getAllKeys()),\n $dc2f4a51b83babfd$export$b327150396135fe7(store.getAll())\n ]).then(function(_ref) {\n var _ref2 = $dc2f4a51b83babfd$var$_slicedToArray(_ref, 2), keys = _ref2[0], values = _ref2[1];\n return keys.map(function(key, i) {\n return [\n key,\n values[i]\n ];\n });\n });\n var items = [];\n return customStore(\"readonly\", function(store) {\n return $dc2f4a51b83babfd$var$eachCursor(store, function(cursor) {\n return items.push([\n cursor.key,\n cursor.value\n ]);\n }).then(function() {\n return items;\n });\n });\n });\n}\n\n\nconst $0eb43b201e9f90c7$var$STORAGE_PREFIX = \"barcode-scanner/\";\nconst $0eb43b201e9f90c7$var$SETTINGS_STORAGE_KEY = \"settings\";\nconst $0eb43b201e9f90c7$var$HISTORY_STORAGE_KEY = \"history\";\n/**\n * Gets an item from the storage.\n *\n * @param {string} key - The key to get the item from.\n * @returns {Promise<[ error: any, value: any ]>} The item and an error if occurred.\n */ const $0eb43b201e9f90c7$var$getItem = async (key)=>{\n try {\n return [\n null,\n await (0, $dc2f4a51b83babfd$export$3988ae62b71be9a3)(key)\n ];\n } catch (error) {\n return [\n error,\n void 0\n ];\n }\n};\n/**\n * Sets an item in the storage.\n *\n * @param {string} key - The key to set the item to.\n * @param {any} data - The data to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */ const $0eb43b201e9f90c7$var$setItem = async (key, data)=>{\n try {\n await (0, $dc2f4a51b83babfd$export$adaa4cf7ef1b65be)(key, data);\n return [\n null\n ];\n } catch (error) {\n return [\n error\n ];\n }\n};\nconst $0eb43b201e9f90c7$export$4a647155031ece = async ()=>{\n return $0eb43b201e9f90c7$var$getItem($0eb43b201e9f90c7$var$STORAGE_PREFIX + $0eb43b201e9f90c7$var$SETTINGS_STORAGE_KEY);\n};\nconst $0eb43b201e9f90c7$export$dc86d17a64679bc7 = async (data)=>{\n return $0eb43b201e9f90c7$var$setItem($0eb43b201e9f90c7$var$STORAGE_PREFIX + $0eb43b201e9f90c7$var$SETTINGS_STORAGE_KEY, data);\n};\nconst $0eb43b201e9f90c7$export$f9582a3c130d9538 = async ()=>{\n return $0eb43b201e9f90c7$var$getItem($0eb43b201e9f90c7$var$STORAGE_PREFIX + $0eb43b201e9f90c7$var$HISTORY_STORAGE_KEY);\n};\nconst $0eb43b201e9f90c7$export$96fe1132eb44c325 = async (data)=>{\n return $0eb43b201e9f90c7$var$setItem($0eb43b201e9f90c7$var$STORAGE_PREFIX + $0eb43b201e9f90c7$var$HISTORY_STORAGE_KEY, data);\n};\n\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * 'n' milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {function} fn The function to be executed.\n * @param {Number} [wait=0] Time of delay in milliseconds. It is required if `immediate` is used.\n * @param {Boolean} [immediate=false] If true or any truthy value, triggers the function on the leading edge.\n * @throws {TypeError} If `fn` is not function.\n * @returns {function} A new debounced function.\n * @example\n *\n * const debouncedHandler = debounce(() => {\n * // Do your thing here...\n * }, 250);\n *\n * window.addEventListener('resize', debouncedHandler, false);\n */ const $4481690a5b2e12d6$export$61fc7d43ac8f84b0 = (fn, wait = 0, immediate = false)=>{\n let timerId = null;\n if (typeof fn !== \"function\") throw new TypeError(\"Expected a function for first argument\");\n return (...args)=>{\n clearTimeout(timerId);\n if (immediate && !timerId) fn(...args);\n timerId = setTimeout(()=>{\n timerId = null;\n if (!immediate) fn(...args);\n }, wait);\n };\n};\n\n\n/**\n * Log to console only in development mode.\n *\n * @param {...any} args - Arguments to log\n */ function $6dda9643863448b4$export$bef1f36f5486a6a3(...args) {}\n\n\n/**\n * Check if the dialog element is supported.\n *\n * @returns {boolean} - Returns true if the dialog element is supported.\n */ const $2d4d0eca101a8031$export$c694186e9d94f0 = ()=>{\n return typeof HTMLDialogElement === \"function\";\n};\n\n\n/**\n * Renders the supported formats.\n *\n * @param {Array} formats - Supported barcode formats\n */ function $73d553880699f8aa$export$f6bb24723b821792(formats) {\n if (!Array.isArray(formats) || formats.length === 0) return;\n const supportedFormatsEl = document.getElementById(\"supportedFormats\");\n if (!supportedFormatsEl) return;\n supportedFormatsEl.textContent = `Supported formats: ${formats.join(\", \")}`;\n}\n\n\n\nfunction $32121209e73f30cc$export$fa9e3380e441c420(data) {\n const historyList = document.getElementById(\"historyList\");\n if (!historyList) return;\n const emptyHistoryBtn = document.getElementById(\"emptyHistoryBtn\");\n historyList.replaceChildren();\n if (!Array.isArray(data) || data.length === 0) {\n historyList.innerHTML = \"
  • There are no saved items in history.
  • \";\n emptyHistoryBtn.hidden = true;\n } else {\n emptyHistoryBtn.hidden = false;\n data.forEach((item, index)=>{\n const li = document.createElement(\"li\");\n li.setAttribute(\"data-value\", item);\n let historyItem;\n try {\n new URL(item);\n historyItem = document.createElement(\"a\");\n historyItem.href = item;\n historyItem.setAttribute(\"target\", \"_blank\");\n historyItem.setAttribute(\"rel\", \"noreferrer noopener\");\n } catch {\n historyItem = document.createElement(\"span\");\n }\n historyItem.textContent = item;\n historyItem.setAttribute(\"id\", `historyItem-${index}`);\n const actionsEl = document.createElement(\"div\");\n actionsEl.className = \"history-modal__actions\";\n const copyBtn = document.createElement(\"custom-clipboard-copy\");\n copyBtn.setAttribute(\"id\", `copyHistoryItem-${index}`);\n copyBtn.setAttribute(\"aria-label\", \"Copy to clipboard\");\n copyBtn.setAttribute(\"aria-labelledby\", `copyHistoryItem-${index} historyItem-${index}`);\n copyBtn.setAttribute(\"only-icon\", \"\");\n copyBtn.setAttribute(\"value\", item);\n actionsEl.appendChild(copyBtn);\n const removeBtn = document.createElement(\"button\");\n removeBtn.type = \"button\";\n removeBtn.className = \"history-modal__delete-action\";\n removeBtn.setAttribute(\"data-action\", \"delete\");\n removeBtn.setAttribute(\"id\", `removeHistoryItem-${index}`);\n removeBtn.setAttribute(\"aria-label\", \"Remove from history\");\n removeBtn.setAttribute(\"aria-labelledby\", `removeHistoryItem-${index} historyItem-${index}`);\n removeBtn.innerHTML = /* html */ `\n \n \n \n `;\n actionsEl.appendChild(removeBtn);\n li.appendChild(historyItem);\n li.appendChild(actionsEl);\n historyList.appendChild(li);\n });\n }\n}\nasync function $32121209e73f30cc$export$7a6a9d84993ff4e(item) {\n const [, settings] = await (0, $0eb43b201e9f90c7$export$4a647155031ece)();\n if (!item || !settings?.addToHistory) return;\n const [getHistoryError, history = []] = await (0, $0eb43b201e9f90c7$export$f9582a3c130d9538)();\n if (!getHistoryError && Array.isArray(history) && !history.find((h)=>h === item)) {\n const data = [\n ...history,\n item\n ];\n const [setHistoryError] = await (0, $0eb43b201e9f90c7$export$96fe1132eb44c325)(data);\n if (!setHistoryError) $32121209e73f30cc$export$fa9e3380e441c420(data);\n }\n}\nasync function $32121209e73f30cc$export$3a61248021dae916(item) {\n if (!item) return;\n const [getHistoryError, history = []] = await (0, $0eb43b201e9f90c7$export$f9582a3c130d9538)();\n if (!getHistoryError && Array.isArray(history)) {\n const data = history.filter((el)=>el !== item);\n const [setHistoryError] = await (0, $0eb43b201e9f90c7$export$96fe1132eb44c325)(data);\n if (!setHistoryError) $32121209e73f30cc$export$fa9e3380e441c420(data);\n }\n}\nasync function $32121209e73f30cc$export$9f74b61e5d33cda2() {\n const [setHistoryError] = await (0, $0eb43b201e9f90c7$export$96fe1132eb44c325)([]);\n if (!setHistoryError) $32121209e73f30cc$export$fa9e3380e441c420([]);\n}\n\n\n/**\n * Removes the scanned result from the element where it is shown.\n *\n * @param {HTMLElement} element - The element to remove the result from.\n */ function $c6f06ef952a10e5f$export$ad20350fbdf13c97(element) {\n if (!element) return;\n const scanResultEl = element.querySelector(\"scan-result\");\n scanResultEl?.remove();\n}\nasync function $c6f06ef952a10e5f$export$97c08f0895810b94(element, value) {\n if (!element || !value) return;\n const oldScanResultEl = element.querySelector(\"scan-result\");\n if (oldScanResultEl) oldScanResultEl.setAttribute(\"value\", value);\n else {\n const newScanResultEl = document.createElement(\"scan-result\");\n newScanResultEl.setAttribute(\"value\", value);\n newScanResultEl.setAttribute(\"role\", \"alert\");\n newScanResultEl.setAttribute(\"aria-live\", \"assertive\");\n newScanResultEl.setAttribute(\"aria-atomic\", \"true\");\n element.appendChild(newScanResultEl);\n }\n}\n\n\n\n/**\n * Beep sound using the `AudioContext` interface.\n *\n * @param {Object} options\n * @param {Number} options.duration - Duration in milliseconds\n * @param {Number} options.frequency - Frequency in Hz\n * @param {Number} options.volume - Volume\n * @param {String} options.type - Type of oscillator\n * @param {Function} options.onEnded - Callback function when the sound ends\n */ const $db31dc56898b80b8$export$d6c943e433460aae = (()=>{\n const audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext)();\n if (!audioCtx) return;\n return (options)=>{\n const { duration: duration, frequency: frequency, volume: volume, type: type, onEnded: onEnded } = options;\n const oscillator = audioCtx.createOscillator();\n const gainNode = audioCtx.createGain();\n oscillator.connect(gainNode);\n gainNode.connect(audioCtx.destination);\n if (volume) gainNode.gain.value = volume;\n if (frequency) oscillator.frequency.value = frequency;\n if (type) oscillator.type = type;\n if (typeof onEnded === \"function\") oscillator.onended = onEnded;\n oscillator.start(audioCtx.currentTime);\n oscillator.stop(audioCtx.currentTime + (duration || 500) / 1000);\n };\n})();\n\n\n/**\n * Vibrate the device.\n * If the device does not support vibration, this function will fail silently.\n *\n * @param {Number} [duration=0] - Duration in milliseconds\n */ async function $03fe6bc65045924f$export$3ca8e905da0a0ca8(duration = 0) {\n if (typeof window.navigator.vibrate !== \"function\") return;\n try {\n window.navigator.vibrate(duration);\n } catch {\n // Fail silently...\n }\n}\n\n\nasync function $a6838ab1dc4817e7$export$9b466d13e2031a67(options = {}) {\n const { success: success = true } = options;\n const [, settings] = await (0, $0eb43b201e9f90c7$export$4a647155031ece)();\n if (!settings) return;\n const beepConfig = success ? {\n duration: 200,\n frequency: 860,\n volume: 0.03,\n type: \"square\"\n } : {\n duration: 300,\n frequency: 200,\n volume: 0.05,\n type: \"sawtooth\"\n };\n settings.beep && (0, $db31dc56898b80b8$export$d6c943e433460aae)(beepConfig);\n settings.vibrate && (0, $03fe6bc65045924f$export$3ca8e905da0a0ca8)(success ? 100 : 200);\n}\n\n\n/**\n * Resizes the scan frame to match the video element's dimensions.\n *\n * @param {HTMLVideoElement} videoEl - Video element\n * @param {HTMLElement} scanFrameEl - Scan frame element\n */ function $451e357ed50655d6$export$1404f0e91c73fec(videoEl, scanFrameEl) {\n if (!videoEl || !scanFrameEl) return;\n const rect = videoEl.getBoundingClientRect();\n scanFrameEl.style.cssText = `width: ${rect.width}px; height: ${rect.height}px`;\n}\n\n\n\n\n/**\n * BarcodeReader class to detect barcodes from images or videos.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector\n */ class $8510600959e31c2c$export$f21d9483ebeee00a {\n static async polyfill() {\n if (!(\"BarcodeDetector\" in window)) try {\n await (parcelRequire(\"cw9o9\"));\n (0, $6dda9643863448b4$export$bef1f36f5486a6a3)(\"Using BarcodeDetector polyfill.\");\n } catch {\n throw new Error(\"BarcodeDetector API is not supported by your browser.\");\n }\n else (0, $6dda9643863448b4$export$bef1f36f5486a6a3)(\"Using the native BarcodeDetector API.\");\n }\n /**\n * Get the supported barcode formats.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/getSupportedFormats\n * @returns {Promise>} - Supported barcode formats\n */ static async getSupportedFormats() {\n return await window.BarcodeDetector.getSupportedFormats();\n }\n /**\n * Create a new BarcodeReader instance.\n *\n * @returns {Promise} - New BarcodeReader instance\n */ static async create() {\n const formats = await window.BarcodeDetector.getSupportedFormats();\n return new $8510600959e31c2c$export$f21d9483ebeee00a(formats);\n }\n /**\n * Initialize the BarcodeReader.\n *\n * @returns {Promise<{ barcodeReader: BarcodeReader, barcodeFormats: Array, barcodeReaderError: Error }>} - BarcodeReader instance, supported formats, and error\n */ static async init() {\n try {\n await $8510600959e31c2c$export$f21d9483ebeee00a.polyfill();\n const barcodeReader = await $8510600959e31c2c$export$f21d9483ebeee00a.create();\n const barcodeFormats = await $8510600959e31c2c$export$f21d9483ebeee00a.getSupportedFormats();\n return {\n barcodeReader: barcodeReader,\n barcodeFormats: barcodeFormats,\n barcodeReaderError: null\n };\n } catch (error) {\n return {\n barcodeReader: null,\n barcodeFormats: [],\n barcodeReaderError: error\n };\n }\n }\n /**\n * Create a new BarcodeReader instance.\n *\n * @param {Array} formats - Supported barcode formats\n */ constructor(formats){\n this.barcodeReader = new window.BarcodeDetector({\n formats: formats\n });\n }\n /**\n * Detect barcodes from the provided source.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/detect\n * @param {HTMLImageElement|HTMLVideoElement|ImageBitmap} source - Image or video element or ImageBitmap\n * @returns {Promise} - Barcode detection result\n */ async detect(source) {\n if (!this.barcodeReader) throw new Error(\"BarcodeReader is not initialized.\");\n const results = await this.barcodeReader.detect(source);\n if (Array.isArray(results) && results.length > 0) return results[0];\n else throw new Error(\"Could not detect barcode from provided source.\");\n }\n}\n\n\n\nasync function $6d6ffe9300b4c5f8$export$9d22ef9ff8e481fe(form) {\n const [, settings = {}] = await (0, $0eb43b201e9f90c7$export$4a647155031ece)();\n Object.entries(settings).forEach(([key, value])=>{\n const settingInput = form.querySelector(`[name=\"${key}\"]`);\n if (!settingInput) return;\n settingInput.checked = value;\n });\n}\n\n\n/**\n * Toggles the torch button status.\n * The torch button has two icons, one for on and one for off.\n * This function toggles the visibility of the icons based on the torch state and updates the button title.\n *\n * @param {HTMLButtonElement} buttonEl - The torch button element.\n * @param {boolean} isTorchOn - The torch state.\n */ function $ac0619973d2d242a$export$d1bd0b12fe0d046(options = {}) {\n const defaults = {\n el: document.getElementById(\"torchButton\"),\n isTorchOn: false\n };\n const { el: el, isTorchOn: isTorchOn } = {\n ...defaults,\n ...options\n };\n const iconPaths = el.querySelectorAll(\"svg path\");\n if (iconPaths.length !== 2) return;\n iconPaths[0].style.display = isTorchOn ? \"none\" : \"block\";\n iconPaths[1].style.display = isTorchOn ? \"block\" : \"none\";\n el.setAttribute(\"title\", `Turn ${isTorchOn ? \"off\" : \"on\"} flash`);\n}\n\n\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */ const $f39ac7e49ce95944$export$7d15b64cf5a3a4c4 = (value, lower, upper)=>{\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n\n\nconst $40cc5a5311c08f52$var$COMPONENT_NAME = \"video-capture\";\nconst $40cc5a5311c08f52$var$styles = /* css */ `\n :host { display: block; box-sizing: border-box; }\n :host *, :host *::before, :host *::after { box-sizing: inherit;}\n :host([hidden]), [hidden], ::slotted([hidden]) { display: none; }\n video { display: block; }\n #output:empty { display: none; }\n`;\nconst $40cc5a5311c08f52$var$template = document.createElement(\"template\");\n$40cc5a5311c08f52$var$template.innerHTML = /* html */ `\n \n \n
    \n \n`;\nclass $40cc5a5311c08f52$export$682e9ed90a89bb4a extends HTMLElement {\n #supportedConstraints = {};\n #stream = null;\n #videoElement = null;\n constructor(){\n super();\n this.#supportedConstraints = this.getSupportedConstraints();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($40cc5a5311c08f52$var$template.content.cloneNode(true));\n }\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"pan\",\n \"tilt\",\n \"zoom\",\n \"torch\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n const trackCapabilities = this.getTrackCapabilities();\n if (name === \"zoom\" && oldValue !== newValue && \"zoom\" in this.#supportedConstraints) {\n const zoomInAllowedRange = \"zoom\" in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max : false;\n if (typeof this.zoom === \"number\" && zoomInAllowedRange) this.#applyConstraint(\"zoom\", this.zoom);\n }\n if (name === \"torch\" && oldValue !== newValue && \"torch\" in this.#supportedConstraints) this.#applyConstraint(\"torch\", this.torch);\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ async connectedCallback() {\n this.#upgradeProperty(\"autoPlay\");\n this.#upgradeProperty(\"facingMode\");\n this.#upgradeProperty(\"zoom\");\n this.#upgradeProperty(\"torch\");\n this.#videoElement = this.shadowRoot?.querySelector(\"video\") || null;\n this.#videoElement?.addEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n if (!$40cc5a5311c08f52$export$682e9ed90a89bb4a.isSupported()) return this.dispatchEvent(new CustomEvent(`${$40cc5a5311c08f52$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n if (this.autoPlay) this.startVideoStream();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.stopVideoStream();\n this.#videoElement?.removeEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n }\n get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(value) {\n this.toggleAttribute(\"auto-play\", !!value);\n }\n get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(value) {\n this.setAttribute(\"facing-mode\", value);\n }\n get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(value) {\n this.setAttribute(\"zoom\", value != null ? value.toString() : value);\n }\n get torch() {\n return this.hasAttribute(\"torch\");\n }\n set torch(value) {\n this.toggleAttribute(\"torch\", !!value);\n }\n get loading() {\n return this.hasAttribute(\"loading\");\n }\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {Event} evt - The event object.\n */ #onVideoLoadedMetaData = (evt)=>{\n const video = evt.target;\n video.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$40cc5a5311c08f52$var$COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: {\n video: video\n }\n }));\n }).catch((error)=>{\n this.dispatchEvent(new CustomEvent(`${$40cc5a5311c08f52$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n /**\n * Applies a constraint to the video track.\n *\n * @param {string} constraint - The name of the constraint.\n * @param {any} value - The value of the constraint.\n */ #applyConstraint(constraint, value) {\n if (!this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n const constraintValue = constraint === \"pan\" || constraint === \"tilt\" || constraint === \"zoom\" ? (0, $f39ac7e49ce95944$export$7d15b64cf5a3a4c4)(Number(value), trackCapabilities[constraint]?.min || 1, trackCapabilities[constraint]?.max || 1) : value;\n if (constraint in trackSettings) track.applyConstraints({\n advanced: [\n {\n [constraint]: constraintValue\n }\n ]\n }).catch(()=>{\n // Fail silently...\n });\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n /**\n * Starts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n * @returns Promise\n */ async startVideoStream(videoInputId) {\n if (!$40cc5a5311c08f52$export$682e9ed90a89bb4a.isSupported() || this.#stream) return;\n this.setAttribute(\"loading\", \"\");\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: true,\n tilt: true,\n zoom: true,\n torch: this.torch\n },\n audio: false\n };\n if (typeof videoInputId === \"string\" && videoInputId.trim().length > 0) constraints.video.deviceId = {\n exact: videoInputId\n };\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.#videoElement) this.#videoElement.srcObject = this.#stream;\n this.#applyConstraint(\"pan\", this.pan);\n this.#applyConstraint(\"tilt\", this.tilt);\n this.#applyConstraint(\"zoom\", this.zoom);\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$40cc5a5311c08f52$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n /**\n * Restarts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n */ restartVideoStream(videoInputId) {\n if (this.#stream && this.#videoElement) this.stopVideoStream();\n this.startVideoStream(videoInputId);\n }\n /**\n * Stops the video stream.\n */ stopVideoStream() {\n if (!this.#videoElement || !this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */ getSupportedConstraints() {\n if (!$40cc5a5311c08f52$export$682e9ed90a89bb4a.isSupported()) return {};\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */ getTrackCapabilities() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getCapabilities === \"function\") return track.getCapabilities() || {};\n return {};\n }\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */ getTrackSettings() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getSettings === \"function\") return track.getSettings() || {};\n return {};\n }\n /**\n * Returns the available video input devices.\n *\n * @returns {Promise}\n */ static async getVideoInputDevices() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) return [];\n const devices = await navigator.mediaDevices.enumerateDevices() || [];\n return devices.filter((device)=>device.kind === \"videoinput\" && !!device.deviceId);\n }\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */ static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='video-capture'] - The name of the custom element.\n */ static defineCustomElement(elementName = $40cc5a5311c08f52$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $40cc5a5311c08f52$export$682e9ed90a89bb4a);\n }\n}\n\n\n/*!\n * @georapbox/clipboard-copy-element\n * A custom element that implements the Clipboard API to copy text content from elements or input values to the clipboard.\n *\n * @version 3.0.2\n * @homepage https://github.com/georapbox/clipboard-copy-element#readme\n * @author George Raptis \n * @license MIT\n */ var $449da37d108ee4fe$var$i = \"clipboard-copy\";\nvar $449da37d108ee4fe$var$o = \"success\", $449da37d108ee4fe$var$n = \"error\", $449da37d108ee4fe$var$h = document.createElement(\"template\"), $449da37d108ee4fe$var$a = `\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;\n$449da37d108ee4fe$var$h.innerHTML = `\n \n \n`;\nvar $449da37d108ee4fe$export$ea3b71af1761ff40 = class d extends HTMLElement {\n #e = void 0;\n #t = null;\n #s = null;\n #i = null;\n #o = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($449da37d108ee4fe$var$h.content.cloneNode(!0)), this.shadowRoot && (this.#t = this.shadowRoot.querySelector(\"button\"), this.#s = this.shadowRoot.querySelector('slot[name=\"copy\"]'), this.#i = this.shadowRoot.querySelector('slot[name=\"success\"]'), this.#o = this.shadowRoot.querySelector('slot[name=\"error\"]'));\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, s, e) {\n t === \"disabled\" && s !== e && this.#t && (this.#t.disabled = this.disabled, this.#t.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#t.part.contains(\"button\") && this.#t.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#n(\"value\"), this.#n(\"from\"), this.#n(\"disabled\"), this.#n(\"feedbackDuration\"), this.#t?.addEventListener(\"click\", this.#r);\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"click\", this.#r), this.#a();\n }\n get value() {\n return this.getAttribute(\"value\") || \"\";\n }\n set value(t) {\n this.setAttribute(\"value\", t != null ? t.toString() : t);\n }\n get from() {\n return this.getAttribute(\"from\") || \"\";\n }\n set from(t) {\n this.setAttribute(\"from\", t != null ? t.toString() : t);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get feedbackDuration() {\n return Number(this.getAttribute(\"feedback-duration\")) || 1e3;\n }\n set feedbackDuration(t) {\n this.setAttribute(\"feedback-duration\", t != null ? t.toString() : t);\n }\n async #d() {\n if (!(!this.value && !this.from)) try {\n let t = \"\";\n if (this.value) t = this.value;\n else if (this.from) {\n let s = \"getRootNode\" in Element.prototype ? this.#t?.getRootNode({\n composed: !0\n }) : this.#t?.ownerDocument;\n if (!s || !(s instanceof Document || s instanceof ShadowRoot)) return;\n let e = s.querySelector(this.from);\n if (!e) return;\n e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement ? t = e.value : e instanceof HTMLAnchorElement && e.hasAttribute(\"href\") ? t = e.href : t = e.textContent || \"\";\n }\n await navigator.clipboard.writeText(t), this.#h($449da37d108ee4fe$var$o), this.dispatchEvent(new CustomEvent(`${$449da37d108ee4fe$var$i}-success`, {\n bubbles: !0,\n composed: !0,\n detail: {\n value: t\n }\n }));\n } catch (t) {\n this.#h($449da37d108ee4fe$var$n), this.dispatchEvent(new CustomEvent(`${$449da37d108ee4fe$var$i}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #r = (t)=>{\n t.preventDefault(), !(this.disabled || this.#e) && this.#d();\n };\n #h(t) {\n this.#s && (this.#s.hidden = !0), this.#i && (this.#i.hidden = t !== $449da37d108ee4fe$var$o), this.#o && (this.#o.hidden = t !== $449da37d108ee4fe$var$n), this.#t?.part.remove(\"button--success\"), this.#t?.part.remove(\"button--error\"), this.#t?.part.add(`button--${t}`), this.#e && clearTimeout(this.#e), this.#e = setTimeout(()=>{\n this.#s && (this.#s.hidden = !1), this.#i && (this.#i.hidden = !0), this.#o && (this.#o.hidden = !0), this.#t?.part.remove(`button--${t}`), this.#e = void 0;\n }, this.feedbackDuration);\n }\n #a() {\n this.#e && clearTimeout(this.#e), this.#e = void 0, this.#s && (this.#s.hidden = !1), this.#i && (this.#i.hidden = !0), this.#o && (this.#o.hidden = !0), this.#t?.part.remove(\"button--success\"), this.#t?.part.remove(\"button--error\");\n }\n #n(t) {\n let s = this;\n if (Object.prototype.hasOwnProperty.call(s, t)) {\n let e = s[t];\n delete s[t], s[t] = e;\n }\n }\n static defineCustomElement(t = $449da37d108ee4fe$var$i) {\n typeof window < \"u\" && !window.customElements.get(t) && window.customElements.define(t, d);\n }\n};\n\n\n/**\n * Extends the `ClipboardCopy` element to override the default `copy` and `success` slots,\n * in order to avoid repetition of the same markup throughout the application.\n * It also adds aditional properties and attributes, specific to the application.\n *\n * @class CustomClipboardCopy\n * @extends ClipboardCopy\n */ class $3d31f226494869e5$var$CustomClipboardCopy extends (0, $449da37d108ee4fe$export$ea3b71af1761ff40) {\n constructor(){\n super();\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n copySlot.innerHTML = /* html */ `\n \n \n \n \n Copy\n `;\n successSlot.innerHTML = /* html */ `\n \n \n \n \n \n Copied!\n `;\n }\n static get observedAttributes() {\n return [\n ...super.observedAttributes,\n \"only-icon\"\n ];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name === \"only-icon\" && oldValue !== newValue) {\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n const copyText = copySlot.querySelector(\".text\");\n const successText = successSlot.querySelector(\".text\");\n if (copyText) copyText.hidden = this.onlyIcon;\n if (successText) successText.hidden = this.onlyIcon;\n }\n }\n get onlyIcon() {\n return this.hasAttribute(\"only-icon\");\n }\n set onlyIcon(value) {\n if (value) this.setAttribute(\"only-icon\", \"\");\n else this.removeAttribute(\"only-icon\");\n }\n connectedCallback() {\n super.connectedCallback();\n this.#upgradeProperty(\"onlyIcon\");\n if (!this.hasAttribute(\"feedback-duration\")) this.setAttribute(\"feedback-duration\", \"1500\");\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"custom-clipboard-copy\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $3d31f226494869e5$var$CustomClipboardCopy);\n }\n}\n$3d31f226494869e5$var$CustomClipboardCopy.defineCustomElement();\n\n\n/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */ function $7a2aca835bb05064$export$c37129e465f64ef0(a) {\n return a !== null && typeof a == \"object\" ? \"share\" in navigator && \"canShare\" in navigator && navigator.canShare(a) : \"share\" in navigator;\n}\n\n\n\n\nconst $678371674e4a782c$var$styles = /* css */ `\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n .result {\n position: relative;\n width: 100%;\n border: 1px solid var(--focus);\n border-radius: 6px;\n margin: 1.5rem 0 0 0;\n padding: 1rem;\n background-color: var(--background-alt);\n text-align: center;\n }\n\n .result__item {\n word-wrap: break-word;\n word-break: break-word;\n }\n\n a.result__item {\n color: var(--links);\n text-decoration: none;\n }\n\n a.result__item:hover {\n text-decoration: underline;\n }\n\n .result__item--no-barcode {\n color: var(--error-color);\n }\n\n .result__actions {\n display: flex;\n align-items: center;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .result web-share button,\n .result custom-clipboard-copy::part(button) {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n margin: 0.75rem 0 0 0;\n padding: 0.25rem;\n background-color: transparent;\n border: 0;\n border-radius: var(--border-radius);\n color: inherit;\n line-height: 1;\n font-family: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n`;\nconst $678371674e4a782c$var$template = document.createElement(\"template\");\n$678371674e4a782c$var$template.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n \n \n \n
    \n
    \n`;\nclass $678371674e4a782c$var$ScanResult extends HTMLElement {\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($678371674e4a782c$var$template.content.cloneNode(true));\n }\n }\n get value() {\n return this.getAttribute(\"value\");\n }\n set value(value) {\n this.setAttribute(\"value\", value);\n }\n static get observedAttributes() {\n return [\n \"value\"\n ];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"value\" && oldValue !== newValue) this.#handleValueChange(this.value);\n }\n connectedCallback() {\n this.#upgradeProperty(\"value\");\n if (!(0, $7a2aca835bb05064$export$c37129e465f64ef0)()) {\n const webShareEl = this.shadowRoot.querySelector(\"web-share\");\n if (webShareEl) webShareEl.hidden = true;\n }\n }\n async #handleValueChange(value) {\n const baseEl = this.shadowRoot.querySelector(\".result\");\n const resultActionsEl = baseEl?.querySelector(\".result__actions\");\n const oldResultItem = baseEl?.querySelector(\".result__item\");\n let resultItem;\n if (oldResultItem) oldResultItem.remove();\n try {\n const [, settings] = await (0, $0eb43b201e9f90c7$export$4a647155031ece)();\n new URL(value);\n resultItem = document.createElement(\"a\");\n resultItem.href = value;\n window.requestAnimationFrame(()=>resultItem.focus());\n if (!settings?.openWebPageSameTab) {\n resultItem.setAttribute(\"target\", \"_blank\");\n resultItem.setAttribute(\"rel\", \"noreferrer noopener\");\n }\n if (settings?.openWebPage) resultItem.click();\n } catch {\n resultItem = document.createElement(\"span\");\n }\n resultItem.className = \"result__item\";\n resultItem.classList.toggle(\"result__item--no-barcode\", value === (0, $65136e012e05e2d7$export$c263bd68c6f5ce7a));\n resultItem.textContent = value;\n baseEl?.insertBefore(resultItem, resultActionsEl);\n const isValidValue = value !== (0, $65136e012e05e2d7$export$c263bd68c6f5ce7a);\n const clipboarCopyEl = baseEl?.querySelector(\"custom-clipboard-copy\");\n const webShareEl = baseEl?.querySelector(\"web-share\");\n if (clipboarCopyEl && isValidValue) {\n clipboarCopyEl.setAttribute(\"value\", value);\n clipboarCopyEl.hidden = false;\n } else {\n clipboarCopyEl.hidden = true;\n clipboarCopyEl.removeAttribute(\"value\");\n }\n if (webShareEl && (0, $7a2aca835bb05064$export$c37129e465f64ef0)() && isValidValue) {\n webShareEl.setAttribute(\"share-text\", value);\n webShareEl.hidden = false;\n } else {\n webShareEl.hidden = true;\n webShareEl.removeAttribute(\"share-text\");\n }\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"scan-result\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $678371674e4a782c$var$ScanResult);\n }\n}\n$678371674e4a782c$var$ScanResult.defineCustomElement();\n\n\n(async function() {\n const hasExperimentalFlag = new URLSearchParams(window.location.search).has((0, $65136e012e05e2d7$export$d726fc97fa83318d));\n const tabGroupEl = document.querySelector(\"a-tab-group\");\n const videoCaptureEl = document.querySelector(\"video-capture\");\n const cameraPanel = document.getElementById(\"cameraPanel\");\n const filePanel = document.getElementById(\"filePanel\");\n const scanInstructionsEl = document.getElementById(\"scanInstructions\");\n const scanBtn = document.getElementById(\"scanBtn\");\n const dropzoneEl = document.getElementById(\"dropzone\");\n const resizeObserverEl = document.querySelector(\"resize-observer\");\n const scanFrameEl = document.getElementById(\"scanFrame\");\n const facingModeButton = document.getElementById(\"facingModeButton\");\n const torchButton = document.getElementById(\"torchButton\");\n const globalActionsEl = document.getElementById(\"globalActions\");\n const historyBtn = document.getElementById(\"historyBtn\");\n const historyDialog = document.getElementById(\"historyDialog\");\n const settingsBtn = document.getElementById(\"settingsBtn\");\n const settingsDialog = document.getElementById(\"settingsDialog\");\n const settingsForm = document.forms[\"settings-form\"];\n const cameraSelect = document.getElementById(\"cameraSelect\");\n let shouldScan = true;\n let rafId;\n // By default the dialog elements are hidden for browsers that don't support the dialog element.\n // If the dialog element is supported, we remove the hidden attribute and the dialogs' visibility\n // is controlled by using the `showModal()` and `close()` methods.\n if ((0, $2d4d0eca101a8031$export$c694186e9d94f0)()) {\n globalActionsEl.hidden = false;\n historyDialog.hidden = false;\n settingsDialog.hidden = false;\n }\n const { barcodeReader: barcodeReader, barcodeFormats: barcodeFormats, barcodeReaderError: barcodeReaderError } = await (0, $8510600959e31c2c$export$f21d9483ebeee00a).init();\n if (barcodeReaderError) {\n const alertEl = document.getElementById(\"barcodeReaderError\");\n shouldScan = false;\n globalActionsEl.hidden = true;\n tabGroupEl.hidden = true;\n alertEl.hidden = false;\n alertEl.textContent = barcodeReaderError?.message;\n return; // Stop the script execution as BarcodeDetector API is not supported.\n }\n videoCaptureEl.addEventListener(\"video-capture:video-play\", handleVideoCapturePlay, {\n once: true\n });\n videoCaptureEl.addEventListener(\"video-capture:error\", handleVideoCaptureError, {\n once: true\n });\n (0, $40cc5a5311c08f52$export$682e9ed90a89bb4a).defineCustomElement();\n const videoCaptureVideoEl = videoCaptureEl?.shadowRoot?.querySelector(\"video\");\n dropzoneEl.accept = (0, $65136e012e05e2d7$export$63e7bed68b07a85c).join(\",\");\n (0, $6d6ffe9300b4c5f8$export$9d22ef9ff8e481fe)(settingsForm);\n (0, $73d553880699f8aa$export$f6bb24723b821792)(barcodeFormats);\n (0, $32121209e73f30cc$export$fa9e3380e441c420)((await (0, $0eb43b201e9f90c7$export$f9582a3c130d9538)())[1] || []);\n /**\n * Scans for barcodes.\n * If a barcode is detected, it stops scanning and displays the result.\n *\n * @returns {Promise} - A Promise that resolves when the barcode is detected.\n */ async function scan() {\n (0, $6dda9643863448b4$export$bef1f36f5486a6a3)(\"Scanning...\");\n scanInstructionsEl.hidden = false;\n try {\n const barcode = await barcodeReader.detect(videoCaptureVideoEl);\n const barcodeValue = barcode?.rawValue ?? \"\";\n if (!barcodeValue) throw new Error((0, $65136e012e05e2d7$export$c263bd68c6f5ce7a));\n window.cancelAnimationFrame(rafId);\n (0, $c6f06ef952a10e5f$export$97c08f0895810b94)(cameraPanel, barcodeValue);\n (0, $32121209e73f30cc$export$7a6a9d84993ff4e)(barcodeValue);\n scanInstructionsEl.hidden = true;\n scanBtn.hidden = false;\n scanFrameEl.hidden = true;\n (0, $a6838ab1dc4817e7$export$9b466d13e2031a67)();\n return;\n } catch {\n // If no barcode is detected, the error is caught here.\n // We can ignore the error and continue scanning.\n }\n if (shouldScan) rafId = window.requestAnimationFrame(()=>scan());\n }\n /**\n * Handles the click event on the scan button.\n * It is responsible for clearing previous results and starting the scan process again.\n */ function handleScanButtonClick() {\n scanBtn.hidden = true;\n scanFrameEl.hidden = false;\n (0, $c6f06ef952a10e5f$export$ad20350fbdf13c97)(cameraPanel);\n scan();\n }\n /**\n * Handles the tab show event.\n * It is responsible for starting or stopping the scan process based on the selected tab.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleTabShow(evt) {\n const tabId = evt.detail.tabId;\n const videoCaptureEl = document.querySelector(\"video-capture\"); // Get the latest instance of video-capture element to ensure we don't use the cached one.\n if (tabId === \"cameraTab\") {\n shouldScan = true;\n if (!videoCaptureEl) return;\n if (!videoCaptureEl.loading && !cameraPanel.querySelector(\"scan-result\")) scan();\n if (typeof videoCaptureEl.startVideoStream === \"function\") videoCaptureEl.startVideoStream();\n } else if (tabId === \"fileTab\") {\n shouldScan = false;\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === \"function\") videoCaptureEl.stopVideoStream();\n }\n }\n /**\n * Handles the selection of a file.\n * It is responsible for displaying the selected file in the dropzone.\n *\n * @param {File} file - The selected file.\n */ function handleFileSelect(file) {\n if (!file) return;\n const image = new Image();\n const reader = new FileReader();\n reader.onload = (evt)=>{\n const data = evt.target.result;\n image.onload = async ()=>{\n try {\n const barcode = await barcodeReader.detect(image);\n const barcodeValue = barcode?.rawValue ?? \"\";\n if (!barcodeValue) throw new Error((0, $65136e012e05e2d7$export$c263bd68c6f5ce7a));\n (0, $c6f06ef952a10e5f$export$97c08f0895810b94)(filePanel, barcodeValue);\n (0, $32121209e73f30cc$export$7a6a9d84993ff4e)(barcodeValue);\n (0, $a6838ab1dc4817e7$export$9b466d13e2031a67)();\n } catch (err) {\n (0, $6dda9643863448b4$export$bef1f36f5486a6a3)(err);\n (0, $c6f06ef952a10e5f$export$97c08f0895810b94)(filePanel, (0, $65136e012e05e2d7$export$c263bd68c6f5ce7a));\n (0, $a6838ab1dc4817e7$export$9b466d13e2031a67)({\n success: false\n });\n }\n };\n image.src = data;\n image.alt = \"Image preview\";\n dropzoneEl.replaceChildren();\n const preview = document.createElement(\"div\");\n preview.className = \"dropzone-preview\";\n preview.setAttribute(\"aria-hidden\", \"true\");\n const imageWrapper = document.createElement(\"div\");\n imageWrapper.className = \"dropzone-preview__image-wrapper\";\n const fileNameWrapper = document.createElement(\"div\");\n fileNameWrapper.className = \"dropzone-preview__file-name\";\n fileNameWrapper.textContent = file.name;\n imageWrapper.appendChild(image);\n preview.appendChild(imageWrapper);\n preview.appendChild(fileNameWrapper);\n dropzoneEl.prepend(preview);\n };\n reader.readAsDataURL(file);\n }\n /**\n * Handles the drop event on the dropzone.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleFileDrop(evt) {\n const file = evt.detail.acceptedFiles[0];\n handleFileSelect(file);\n }\n /**\n * Handles the resize event on the video-capture element.\n * It is responsible for resizing the scan frame based on the video element.\n */ function handleVideoCaptureResize() {\n (0, $451e357ed50655d6$export$1404f0e91c73fec)(videoCaptureEl.shadowRoot.querySelector(\"video\"), scanFrameEl);\n }\n /**\n * Handles the video play event on the video-capture element.\n * It is responsible for displaying the scan frame and starting the scan process.\n * It also handles the zoom controls if the browser supports it.\n *\n * @param {CustomEvent} evt - The event object.\n */ async function handleVideoCapturePlay(evt) {\n scanFrameEl.hidden = false;\n (0, $451e357ed50655d6$export$1404f0e91c73fec)(evt.detail.video, scanFrameEl);\n scan();\n const trackSettings = evt.target.getTrackSettings();\n const trackCapabilities = evt.target.getTrackCapabilities();\n const zoomLevelEl = document.getElementById(\"zoomLevel\");\n if (\"facingMode\" in trackSettings) facingModeButton.hidden = false;\n if (trackCapabilities?.torch) {\n torchButton.hidden = false;\n if (videoCaptureEl.hasAttribute(\"torch\")) (0, $ac0619973d2d242a$export$d1bd0b12fe0d046)({\n el: torchButton,\n isTorchOn: true\n });\n }\n if (trackSettings?.zoom && trackCapabilities?.zoom) {\n const zoomControls = document.getElementById(\"zoomControls\");\n const minZoom = trackCapabilities?.zoom?.min || 0;\n const maxZoom = trackCapabilities?.zoom?.max || 10;\n let currentZoom = trackSettings?.zoom || 1;\n zoomControls.hidden = false;\n zoomLevelEl.textContent = currentZoom;\n const handleZoomControlsClick = (evt)=>{\n const zoomInBtn = evt.target.closest('[data-action=\"zoom-in\"]');\n const zoomOutBtn = evt.target.closest('[data-action=\"zoom-out\"]');\n if (zoomInBtn && currentZoom < maxZoom) currentZoom += 0.5;\n if (zoomOutBtn && currentZoom > minZoom) currentZoom -= 0.5;\n zoomLevelEl.textContent = currentZoom;\n videoCaptureEl.zoom = currentZoom;\n };\n zoomControls.addEventListener(\"click\", handleZoomControlsClick);\n }\n if (hasExperimentalFlag) {\n const videoInputDevices = await (0, $40cc5a5311c08f52$export$682e9ed90a89bb4a).getVideoInputDevices();\n videoInputDevices.forEach((device, index)=>{\n const option = document.createElement(\"option\");\n option.value = device.deviceId;\n option.textContent = device.label || `Camera ${index + 1}`;\n cameraSelect.appendChild(option);\n });\n if (videoInputDevices.length > 1) cameraSelect.hidden = false;\n }\n }\n /**\n * Handles the error event on the video-capture element.\n * It is responsible for displaying an error message if the camera cannot be accessed or permission is denied.\n *\n * @param {CustomEvent} evt - The event object.\n */ function handleVideoCaptureError(evt) {\n const error = evt.detail.error;\n if (error.name === \"NotFoundError\") // If the browser cannot find all media tracks with the specified types that meet the constraints given.\n return;\n const errorMessage = error.name === \"NotAllowedError\" ? \"Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.\" : error.message;\n cameraPanel.innerHTML = /* html */ `
    ${errorMessage}
    `;\n }\n /**\n * Handles the settings button click event.\n * It is responsible for displaying the settings dialog.\n */ function handleSettingsButtonClick() {\n settingsDialog.open = true;\n }\n /**\n * Handles the change event on the settings form.\n * It is responsible for saving the settings to persistent storage and updating the settings.\n *\n * @param {Event} evt - The event object.\n */ function handleSettingsFormChange(evt) {\n const settings = {};\n const checkboxes = evt.currentTarget.querySelectorAll('input[type=\"checkbox\"]');\n checkboxes.forEach((item)=>settings[item.name] = item.checked);\n (0, $0eb43b201e9f90c7$export$dc86d17a64679bc7)(settings);\n }\n /**\n * Handles the click event on the history button.\n * It is responsible for displaying the history dialog.\n */ function handleHistoryButtonClick() {\n historyDialog.open = true;\n }\n /**\n * Handles the click event on the history dialog.\n * It is responsible for closing the dialog, deleting an item from the history, or emptying the history.\n *\n * @param {MouseEvent} evt - The event object.\n */ function handleHistoryDialogClick(evt) {\n const target = evt.target;\n // Handle delete action\n if (target.closest('[data-action=\"delete\"]')) {\n const value = target.closest(\"li\").dataset.value;\n if (window.confirm(`Delete history item ${value}?`)) {\n (0, $32121209e73f30cc$export$3a61248021dae916)(value);\n return;\n }\n }\n // Handle empty history action\n if (target.closest(\"#emptyHistoryBtn\")) {\n if (window.confirm(\"Empty history? This action cannot be undone.\")) {\n (0, $32121209e73f30cc$export$9f74b61e5d33cda2)();\n return;\n }\n }\n }\n /**\n * Handles the click event on the facing mode button.\n * It is responsible for toggling the camera facing mode.\n */ function handleFacingModeButtonClick() {\n const facingMode = videoCaptureEl.facingMode === \"user\" ? \"environment\" : \"user\";\n videoCaptureEl.facingMode = facingMode;\n if (typeof videoCaptureEl.restartVideoStream === \"function\") videoCaptureEl.restartVideoStream(cameraSelect?.value || undefined);\n }\n /**\n * Handles the click event on the torch button.\n * It is responsible for toggling the torch on and off.\n *\n * @param {MouseEvent} evt - The event object.\n */ function handleTorchButtonClick(evt) {\n videoCaptureEl.torch = !videoCaptureEl.torch;\n (0, $ac0619973d2d242a$export$d1bd0b12fe0d046)({\n el: evt.currentTarget,\n isTorchOn: videoCaptureEl.hasAttribute(\"torch\")\n });\n }\n /**\n * Handles the change event on the camera select element.\n * It is responsible for restarting the video stream with the selected video input device id.\n *\n * @param {Event} evt - The event object.\n */ function handleCameraSelectChange(evt) {\n const videoDeviceId = evt.target.value || undefined;\n if (typeof videoCaptureEl.restartVideoStream === \"function\") videoCaptureEl.restartVideoStream(videoDeviceId);\n }\n /**\n * Handles the visibility change event on the document.\n * It is responsible for stopping the scan process when the document is not visible.\n */ function handleDocumentVisibilityChange() {\n const selectedTab = tabGroupEl.querySelector(\"[selected]\");\n const tabId = selectedTab.getAttribute(\"id\");\n if (tabId !== \"cameraTab\") return;\n if (document.visibilityState === \"hidden\") {\n shouldScan = false;\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === \"function\") videoCaptureEl.stopVideoStream();\n } else {\n shouldScan = true;\n // Get the latest instance of video-capture element to ensure we don't use the cached one.\n const videoCaptureEl = document.querySelector(\"video-capture\");\n if (!videoCaptureEl) return;\n if (!videoCaptureEl.loading && !cameraPanel.querySelector(\"scan-result\")) scan();\n if (typeof videoCaptureEl.startVideoStream === \"function\") videoCaptureEl.startVideoStream();\n }\n }\n /**\n * Handles the escape key press event on the document.\n * It is responsible for triggering the scan button click event if there is already a barcode detected.\n */ function handleDocumentEscapeKey() {\n const cameraTabSelected = tabGroupEl.querySelector(\"#cameraTab\").hasAttribute(\"selected\");\n const scanBtnVisible = !scanBtn.hidden;\n const settingsDialogOpen = settingsDialog.hasAttribute(\"open\");\n const historyDialogOpen = historyDialog.hasAttribute(\"open\");\n const anyDialogOpen = settingsDialogOpen || historyDialogOpen;\n if (!scanBtnVisible || !cameraTabSelected || anyDialogOpen) return;\n scanBtn.click();\n }\n /**\n * Handles the key down event on the document.\n */ function handleDocumentKeyDown(evt) {\n if (evt.key === \"Escape\") handleDocumentEscapeKey();\n }\n scanBtn.addEventListener(\"click\", handleScanButtonClick);\n tabGroupEl.addEventListener(\"a-tab-show\", (0, $4481690a5b2e12d6$export$61fc7d43ac8f84b0)(handleTabShow, 250));\n dropzoneEl.addEventListener(\"files-dropzone-drop\", handleFileDrop);\n resizeObserverEl.addEventListener(\"resize-observer:resize\", handleVideoCaptureResize);\n settingsBtn.addEventListener(\"click\", handleSettingsButtonClick);\n settingsForm.addEventListener(\"change\", handleSettingsFormChange);\n historyBtn.addEventListener(\"click\", handleHistoryButtonClick);\n historyDialog.addEventListener(\"click\", handleHistoryDialogClick);\n facingModeButton.addEventListener(\"click\", handleFacingModeButtonClick);\n torchButton.addEventListener(\"click\", handleTorchButtonClick);\n hasExperimentalFlag && cameraSelect.addEventListener(\"change\", handleCameraSelectChange);\n document.addEventListener(\"visibilitychange\", handleDocumentVisibilityChange);\n document.addEventListener(\"keydown\", handleDocumentKeyDown);\n})();\n\n\n//# sourceMappingURL=index.e93d0af3.js.map\n","let load = require('./helpers/browser/esm-js-loader');\nmodule.exports = (load(\"6z40I\")).then(() => parcelRequire('aexh3'));","\"use strict\";\n\nfunction load(id) {\n // eslint-disable-next-line no-undef\n return __parcel__import__(require('../bundle-manifest').resolve(id));\n}\nmodule.exports = load;","import '@georapbox/a-tab-group/dist/a-tab-group.js';\nimport '@georapbox/web-share-element/dist/web-share-defined.js';\nimport '@georapbox/files-dropzone-element/dist/files-dropzone-defined.js';\nimport '@georapbox/resize-observer-element/dist/resize-observer-defined.js';\nimport '@georapbox/modal-element/dist/modal-element-defined.js';\nimport { EXPERIMENTAL_FLAG, NO_BARCODE_DETECTED, ACCEPTED_MIME_TYPES } from './constants.js';\nimport { getHistory, setSettings } from './services/storage.js';\nimport { debounce } from './utils/debounce.js';\nimport { log } from './utils/log.js';\nimport { isDialogElementSupported } from './utils/isDialogElementSupported.js';\nimport { renderSupportedFormats } from './helpers/renderSupportedFormats.js';\nimport {\n addToHistory,\n removeFromHistory,\n emptyHistory,\n renderHistoryList\n} from './helpers/history.js';\nimport { hideResult, showResult } from './helpers/results.js';\nimport { triggerScanEffects } from './helpers/triggerScanEffects.js';\nimport { resizeScanFrame } from './helpers/resizeScanFrame.js';\nimport { BarcodeReader } from './helpers/BarcodeReader.js';\nimport { initializeSettingsForm } from './helpers/initializeSettingsForm.js';\nimport { toggleTorchButtonStatus } from './helpers/toggleTorchButtonStatus.js';\nimport { VideoCapture } from './components/video-capture.js';\nimport './components/clipboard-copy.js';\nimport './components/scan-result.js';\n\n(async function () {\n const hasExperimentalFlag = new URLSearchParams(window.location.search).has(EXPERIMENTAL_FLAG);\n const tabGroupEl = document.querySelector('a-tab-group');\n const videoCaptureEl = document.querySelector('video-capture');\n const cameraPanel = document.getElementById('cameraPanel');\n const filePanel = document.getElementById('filePanel');\n const scanInstructionsEl = document.getElementById('scanInstructions');\n const scanBtn = document.getElementById('scanBtn');\n const dropzoneEl = document.getElementById('dropzone');\n const resizeObserverEl = document.querySelector('resize-observer');\n const scanFrameEl = document.getElementById('scanFrame');\n const facingModeButton = document.getElementById('facingModeButton');\n const torchButton = document.getElementById('torchButton');\n const globalActionsEl = document.getElementById('globalActions');\n const historyBtn = document.getElementById('historyBtn');\n const historyDialog = document.getElementById('historyDialog');\n const settingsBtn = document.getElementById('settingsBtn');\n const settingsDialog = document.getElementById('settingsDialog');\n const settingsForm = document.forms['settings-form'];\n const cameraSelect = document.getElementById('cameraSelect');\n let shouldScan = true;\n let rafId;\n\n // By default the dialog elements are hidden for browsers that don't support the dialog element.\n // If the dialog element is supported, we remove the hidden attribute and the dialogs' visibility\n // is controlled by using the `showModal()` and `close()` methods.\n if (isDialogElementSupported()) {\n globalActionsEl.hidden = false;\n historyDialog.hidden = false;\n settingsDialog.hidden = false;\n }\n\n const { barcodeReader, barcodeFormats, barcodeReaderError } = await BarcodeReader.init();\n\n if (barcodeReaderError) {\n const alertEl = document.getElementById('barcodeReaderError');\n\n shouldScan = false;\n globalActionsEl.hidden = true;\n tabGroupEl.hidden = true;\n alertEl.hidden = false;\n alertEl.textContent = barcodeReaderError?.message;\n return; // Stop the script execution as BarcodeDetector API is not supported.\n }\n\n videoCaptureEl.addEventListener('video-capture:video-play', handleVideoCapturePlay, {\n once: true\n });\n\n videoCaptureEl.addEventListener('video-capture:error', handleVideoCaptureError, {\n once: true\n });\n\n VideoCapture.defineCustomElement();\n\n const videoCaptureVideoEl = videoCaptureEl?.shadowRoot?.querySelector('video');\n\n dropzoneEl.accept = ACCEPTED_MIME_TYPES.join(',');\n initializeSettingsForm(settingsForm);\n renderSupportedFormats(barcodeFormats);\n renderHistoryList((await getHistory())[1] || []);\n\n /**\n * Scans for barcodes.\n * If a barcode is detected, it stops scanning and displays the result.\n *\n * @returns {Promise} - A Promise that resolves when the barcode is detected.\n */\n async function scan() {\n log('Scanning...');\n\n scanInstructionsEl.hidden = false;\n\n try {\n const barcode = await barcodeReader.detect(videoCaptureVideoEl);\n const barcodeValue = barcode?.rawValue ?? '';\n\n if (!barcodeValue) {\n throw new Error(NO_BARCODE_DETECTED);\n }\n\n window.cancelAnimationFrame(rafId);\n showResult(cameraPanel, barcodeValue);\n addToHistory(barcodeValue);\n scanInstructionsEl.hidden = true;\n scanBtn.hidden = false;\n scanFrameEl.hidden = true;\n triggerScanEffects();\n return;\n } catch {\n // If no barcode is detected, the error is caught here.\n // We can ignore the error and continue scanning.\n }\n\n if (shouldScan) {\n rafId = window.requestAnimationFrame(() => scan());\n }\n }\n\n /**\n * Handles the click event on the scan button.\n * It is responsible for clearing previous results and starting the scan process again.\n */\n function handleScanButtonClick() {\n scanBtn.hidden = true;\n scanFrameEl.hidden = false;\n hideResult(cameraPanel);\n scan();\n }\n\n /**\n * Handles the tab show event.\n * It is responsible for starting or stopping the scan process based on the selected tab.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleTabShow(evt) {\n const tabId = evt.detail.tabId;\n const videoCaptureEl = document.querySelector('video-capture'); // Get the latest instance of video-capture element to ensure we don't use the cached one.\n\n if (tabId === 'cameraTab') {\n shouldScan = true;\n\n if (!videoCaptureEl) {\n return;\n }\n\n if (!videoCaptureEl.loading && !cameraPanel.querySelector('scan-result')) {\n scan();\n }\n\n if (typeof videoCaptureEl.startVideoStream === 'function') {\n videoCaptureEl.startVideoStream();\n }\n } else if (tabId === 'fileTab') {\n shouldScan = false;\n\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === 'function') {\n videoCaptureEl.stopVideoStream();\n }\n }\n }\n\n /**\n * Handles the selection of a file.\n * It is responsible for displaying the selected file in the dropzone.\n *\n * @param {File} file - The selected file.\n */\n function handleFileSelect(file) {\n if (!file) {\n return;\n }\n\n const image = new Image();\n const reader = new FileReader();\n\n reader.onload = evt => {\n const data = evt.target.result;\n\n image.onload = async () => {\n try {\n const barcode = await barcodeReader.detect(image);\n const barcodeValue = barcode?.rawValue ?? '';\n\n if (!barcodeValue) {\n throw new Error(NO_BARCODE_DETECTED);\n }\n\n showResult(filePanel, barcodeValue);\n addToHistory(barcodeValue);\n triggerScanEffects();\n } catch (err) {\n log(err);\n showResult(filePanel, NO_BARCODE_DETECTED);\n triggerScanEffects({ success: false });\n }\n };\n\n image.src = data;\n image.alt = 'Image preview';\n\n dropzoneEl.replaceChildren();\n\n const preview = document.createElement('div');\n preview.className = 'dropzone-preview';\n preview.setAttribute('aria-hidden', 'true');\n\n const imageWrapper = document.createElement('div');\n imageWrapper.className = 'dropzone-preview__image-wrapper';\n\n const fileNameWrapper = document.createElement('div');\n fileNameWrapper.className = 'dropzone-preview__file-name';\n fileNameWrapper.textContent = file.name;\n\n imageWrapper.appendChild(image);\n preview.appendChild(imageWrapper);\n preview.appendChild(fileNameWrapper);\n dropzoneEl.prepend(preview);\n };\n\n reader.readAsDataURL(file);\n }\n\n /**\n * Handles the drop event on the dropzone.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleFileDrop(evt) {\n const file = evt.detail.acceptedFiles[0];\n handleFileSelect(file);\n }\n\n /**\n * Handles the resize event on the video-capture element.\n * It is responsible for resizing the scan frame based on the video element.\n */\n function handleVideoCaptureResize() {\n resizeScanFrame(videoCaptureEl.shadowRoot.querySelector('video'), scanFrameEl);\n }\n\n /**\n * Handles the video play event on the video-capture element.\n * It is responsible for displaying the scan frame and starting the scan process.\n * It also handles the zoom controls if the browser supports it.\n *\n * @param {CustomEvent} evt - The event object.\n */\n async function handleVideoCapturePlay(evt) {\n scanFrameEl.hidden = false;\n resizeScanFrame(evt.detail.video, scanFrameEl);\n scan();\n\n const trackSettings = evt.target.getTrackSettings();\n const trackCapabilities = evt.target.getTrackCapabilities();\n const zoomLevelEl = document.getElementById('zoomLevel');\n\n if ('facingMode' in trackSettings) {\n facingModeButton.hidden = false;\n }\n\n if (trackCapabilities?.torch) {\n torchButton.hidden = false;\n\n if (videoCaptureEl.hasAttribute('torch')) {\n toggleTorchButtonStatus({ el: torchButton, isTorchOn: true });\n }\n }\n\n if (trackSettings?.zoom && trackCapabilities?.zoom) {\n const zoomControls = document.getElementById('zoomControls');\n const minZoom = trackCapabilities?.zoom?.min || 0;\n const maxZoom = trackCapabilities?.zoom?.max || 10;\n let currentZoom = trackSettings?.zoom || 1;\n\n zoomControls.hidden = false;\n zoomLevelEl.textContent = currentZoom;\n\n const handleZoomControlsClick = evt => {\n const zoomInBtn = evt.target.closest('[data-action=\"zoom-in\"]');\n const zoomOutBtn = evt.target.closest('[data-action=\"zoom-out\"]');\n\n if (zoomInBtn && currentZoom < maxZoom) {\n currentZoom += 0.5;\n }\n\n if (zoomOutBtn && currentZoom > minZoom) {\n currentZoom -= 0.5;\n }\n\n zoomLevelEl.textContent = currentZoom;\n videoCaptureEl.zoom = currentZoom;\n };\n\n zoomControls.addEventListener('click', handleZoomControlsClick);\n }\n\n if (hasExperimentalFlag) {\n const videoInputDevices = await VideoCapture.getVideoInputDevices();\n\n videoInputDevices.forEach((device, index) => {\n const option = document.createElement('option');\n option.value = device.deviceId;\n option.textContent = device.label || `Camera ${index + 1}`;\n cameraSelect.appendChild(option);\n });\n\n if (videoInputDevices.length > 1) {\n cameraSelect.hidden = false;\n }\n }\n }\n\n /**\n * Handles the error event on the video-capture element.\n * It is responsible for displaying an error message if the camera cannot be accessed or permission is denied.\n *\n * @param {CustomEvent} evt - The event object.\n */\n function handleVideoCaptureError(evt) {\n const error = evt.detail.error;\n\n if (error.name === 'NotFoundError') {\n // If the browser cannot find all media tracks with the specified types that meet the constraints given.\n return;\n }\n\n const errorMessage =\n error.name === 'NotAllowedError'\n ? 'Permission to use webcam was denied or video Autoplay is disabled. Reload the page to give appropriate permissions to webcam.'\n : error.message;\n\n cameraPanel.innerHTML = /* html */ `
    ${errorMessage}
    `;\n }\n\n /**\n * Handles the settings button click event.\n * It is responsible for displaying the settings dialog.\n */\n function handleSettingsButtonClick() {\n settingsDialog.open = true;\n }\n\n /**\n * Handles the change event on the settings form.\n * It is responsible for saving the settings to persistent storage and updating the settings.\n *\n * @param {Event} evt - The event object.\n */\n function handleSettingsFormChange(evt) {\n const settings = {};\n const checkboxes = evt.currentTarget.querySelectorAll('input[type=\"checkbox\"]');\n\n checkboxes.forEach(item => (settings[item.name] = item.checked));\n setSettings(settings);\n }\n\n /**\n * Handles the click event on the history button.\n * It is responsible for displaying the history dialog.\n */\n function handleHistoryButtonClick() {\n historyDialog.open = true;\n }\n\n /**\n * Handles the click event on the history dialog.\n * It is responsible for closing the dialog, deleting an item from the history, or emptying the history.\n *\n * @param {MouseEvent} evt - The event object.\n */\n function handleHistoryDialogClick(evt) {\n const target = evt.target;\n\n // Handle delete action\n if (target.closest('[data-action=\"delete\"]')) {\n const value = target.closest('li').dataset.value;\n\n if (window.confirm(`Delete history item ${value}?`)) {\n removeFromHistory(value);\n return;\n }\n }\n\n // Handle empty history action\n if (target.closest('#emptyHistoryBtn')) {\n if (window.confirm('Empty history? This action cannot be undone.')) {\n emptyHistory();\n return;\n }\n }\n }\n\n /**\n * Handles the click event on the facing mode button.\n * It is responsible for toggling the camera facing mode.\n */\n function handleFacingModeButtonClick() {\n const facingMode = videoCaptureEl.facingMode === 'user' ? 'environment' : 'user';\n\n videoCaptureEl.facingMode = facingMode;\n\n if (typeof videoCaptureEl.restartVideoStream === 'function') {\n videoCaptureEl.restartVideoStream(cameraSelect?.value || undefined);\n }\n }\n\n /**\n * Handles the click event on the torch button.\n * It is responsible for toggling the torch on and off.\n *\n * @param {MouseEvent} evt - The event object.\n */\n function handleTorchButtonClick(evt) {\n videoCaptureEl.torch = !videoCaptureEl.torch;\n\n toggleTorchButtonStatus({\n el: evt.currentTarget,\n isTorchOn: videoCaptureEl.hasAttribute('torch')\n });\n }\n\n /**\n * Handles the change event on the camera select element.\n * It is responsible for restarting the video stream with the selected video input device id.\n *\n * @param {Event} evt - The event object.\n */\n function handleCameraSelectChange(evt) {\n const videoDeviceId = evt.target.value || undefined;\n\n if (typeof videoCaptureEl.restartVideoStream === 'function') {\n videoCaptureEl.restartVideoStream(videoDeviceId);\n }\n }\n\n /**\n * Handles the visibility change event on the document.\n * It is responsible for stopping the scan process when the document is not visible.\n */\n function handleDocumentVisibilityChange() {\n const selectedTab = tabGroupEl.querySelector('[selected]');\n const tabId = selectedTab.getAttribute('id');\n\n if (tabId !== 'cameraTab') {\n return;\n }\n\n if (document.visibilityState === 'hidden') {\n shouldScan = false;\n\n if (videoCaptureEl != null && typeof videoCaptureEl.stopVideoStream === 'function') {\n videoCaptureEl.stopVideoStream();\n }\n } else {\n shouldScan = true;\n\n // Get the latest instance of video-capture element to ensure we don't use the cached one.\n const videoCaptureEl = document.querySelector('video-capture');\n\n if (!videoCaptureEl) {\n return;\n }\n\n if (!videoCaptureEl.loading && !cameraPanel.querySelector('scan-result')) {\n scan();\n }\n\n if (typeof videoCaptureEl.startVideoStream === 'function') {\n videoCaptureEl.startVideoStream();\n }\n }\n }\n\n /**\n * Handles the escape key press event on the document.\n * It is responsible for triggering the scan button click event if there is already a barcode detected.\n */\n function handleDocumentEscapeKey() {\n const cameraTabSelected = tabGroupEl.querySelector('#cameraTab').hasAttribute('selected');\n const scanBtnVisible = !scanBtn.hidden;\n const settingsDialogOpen = settingsDialog.hasAttribute('open');\n const historyDialogOpen = historyDialog.hasAttribute('open');\n const anyDialogOpen = settingsDialogOpen || historyDialogOpen;\n\n if (!scanBtnVisible || !cameraTabSelected || anyDialogOpen) {\n return;\n }\n\n scanBtn.click();\n }\n\n /**\n * Handles the key down event on the document.\n */\n function handleDocumentKeyDown(evt) {\n if (evt.key === 'Escape') {\n handleDocumentEscapeKey();\n }\n }\n\n scanBtn.addEventListener('click', handleScanButtonClick);\n tabGroupEl.addEventListener('a-tab-show', debounce(handleTabShow, 250));\n dropzoneEl.addEventListener('files-dropzone-drop', handleFileDrop);\n resizeObserverEl.addEventListener('resize-observer:resize', handleVideoCaptureResize);\n settingsBtn.addEventListener('click', handleSettingsButtonClick);\n settingsForm.addEventListener('change', handleSettingsFormChange);\n historyBtn.addEventListener('click', handleHistoryButtonClick);\n historyDialog.addEventListener('click', handleHistoryDialogClick);\n facingModeButton.addEventListener('click', handleFacingModeButtonClick);\n torchButton.addEventListener('click', handleTorchButtonClick);\n hasExperimentalFlag && cameraSelect.addEventListener('change', handleCameraSelectChange);\n document.addEventListener('visibilitychange', handleDocumentVisibilityChange);\n document.addEventListener('keydown', handleDocumentKeyDown);\n})();\n","/*!\n * @georapbox/a-tab-group\n * A custom element to create a group of tabs and tab panels.\n *\n * @version 2.4.1\n * @homepage https://github.com/georapbox/a-tab-group#readme\n * @author George Raptis \n * @license MIT\n */\nvar h=(a=\"\",t=\"\")=>{let e=typeof a==\"string\"&&a!==\"\"?a+\"-\":\"\",s=typeof t==\"string\"&&t!==\"\"?\"-\"+t:\"\",i=Math.random().toString(36).substring(2,8);return`${e}${i}${s}`};var b=(a,t)=>{if(Object.prototype.hasOwnProperty.call(t,a)){let e=t[a];delete t[a],t[a]=e}};var E=0,C=`\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`,w=document.createElement(\"template\");w.innerHTML=`\n \n\n
    \n \n
    \n`;var u=class a extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(w.content.cloneNode(!0))}static get observedAttributes(){return[\"selected\",\"disabled\",\"closable\"]}attributeChangedCallback(t,e,s){if(t===\"selected\"&&e!==s&&(this.setAttribute(\"aria-selected\",this.selected.toString()),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")),t===\"disabled\"&&e!==s&&(this.setAttribute(\"aria-disabled\",this.disabled.toString()),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")),t===\"closable\"&&e!==s)if(this.closable){let i=document.createElement(\"span\");i.className=\"tab__close\",i.setAttribute(\"part\",\"close-tab\"),i.innerHTML='',this.shadowRoot?.querySelector(\".tab\")?.appendChild(i),i.addEventListener(\"click\",this.#e)}else{let i=this.shadowRoot?.querySelector(\".tab__close\");i?.removeEventListener(\"click\",this.#e),i?.remove()}}connectedCallback(){this.#s(\"selected\"),this.#s(\"disabled\"),this.#s(\"closable\"),this.id||(this.id=h(\"tab\",(++E).toString())),this.setAttribute(\"slot\",\"tab\"),this.setAttribute(\"role\",\"tab\"),this.setAttribute(\"aria-selected\",\"false\"),this.setAttribute(\"tabindex\",this.disabled||!this.selected?\"-1\":\"0\")}disconnectedCallback(){this.shadowRoot?.querySelector(\".tab__close\")?.removeEventListener(\"click\",this.#e)}get selected(){return this.hasAttribute(\"selected\")}set selected(t){this.toggleAttribute(\"selected\",!!t)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get closable(){return this.hasAttribute(\"closable\")}set closable(t){this.toggleAttribute(\"closable\",!!t)}#e=t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent(\"a-tab-close\",{bubbles:!0,composed:!0,detail:{tabId:this.id}}))};#s(t){return b(t,this)}static defineCustomElement(t=\"a-tab\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};u.defineCustomElement();var L=0,S=`\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`,T=document.createElement(\"template\");T.innerHTML=`\n \n\n
    \n \n
    \n`;var p=class a extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(T.content.cloneNode(!0))}connectedCallback(){this.setAttribute(\"slot\",\"panel\"),this.setAttribute(\"role\",\"tabpanel\"),this.setAttribute(\"hidden\",\"\"),this.id||(this.id=h(\"panel\",(++L).toString()))}static defineCustomElement(t=\"a-tab-panel\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};p.defineCustomElement();var y=200,n={TOP:\"top\",BOTTOM:\"bottom\",START:\"start\",END:\"end\"},l={LTR:\"ltr\",RTL:\"rtl\"},R=Object.entries(n).map(([,a])=>a),r={AUTO:\"auto\",MANUAL:\"manual\"},c={DOWN:\"ArrowDown\",LEFT:\"ArrowLeft\",RIGHT:\"ArrowRight\",UP:\"ArrowUp\",HOME:\"Home\",END:\"End\",ENTER:\"Enter\",SPACE:\" \"},x=`\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${l.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${l.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${l.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${l.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${n.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${n.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${n.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${n.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${n.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${n.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${n.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${n.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`,A=document.createElement(\"template\");A.innerHTML=`\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;var f=class a extends HTMLElement{#e=null;#s=null;#l=!1;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(A.content.cloneNode(!0))}static get observedAttributes(){return[\"placement\",\"no-scroll-controls\"]}attributeChangedCallback(t,e,s){t===\"placement\"&&e!==s&&this.#i(),t===\"no-scroll-controls\"&&e!==s&&this.#i()}get placement(){return this.getAttribute(\"placement\")||n.TOP}set placement(t){t!=null&&this.setAttribute(\"placement\",t)}get noScrollControls(){return this.hasAttribute(\"no-scroll-controls\")}set noScrollControls(t){this.toggleAttribute(\"no-scroll-controls\",!!t)}get scrollDistance(){let t=Number(this.getAttribute(\"scroll-distance\"));return Math.abs(t)||y}set scrollDistance(t){this.setAttribute(\"scroll-distance\",Math.abs(t).toString()||y.toString())}get activation(){return this.getAttribute(\"activation\")||r.AUTO}set activation(t){this.setAttribute(\"activation\",t||r.AUTO)}get noTabCycling(){return this.hasAttribute(\"no-tab-cycling\")}set noTabCycling(t){this.toggleAttribute(\"no-tab-cycling\",!!t)}connectedCallback(){this.#o(\"placement\"),this.#o(\"noScrollControls\"),this.#o(\"scrollDistance\"),this.#o(\"activation\"),this.#o(\"noTabCycling\");let t=this.shadowRoot?.querySelector(\"slot[name=tab]\"),e=this.shadowRoot?.querySelector(\"slot[name=panel]\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\"),i=this.shadowRoot?.querySelector(\".tab-group__nav\"),o=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);t?.addEventListener(\"slotchange\",this.#n),e?.addEventListener(\"slotchange\",this.#n),s?.addEventListener(\"click\",this.#g),s?.addEventListener(\"keydown\",this.#p),o.forEach(d=>d.addEventListener(\"click\",this.#f)),this.addEventListener(\"a-tab-close\",this.#m),\"ResizeObserver\"in window&&(this.#e=new ResizeObserver(d=>{this.#s=window.requestAnimationFrame(()=>{let v=d?.[0]?.target,g=v?.scrollWidth>v?.clientWidth;o.forEach(_=>_.toggleAttribute(\"hidden\",!g)),i?.part.toggle(\"nav--has-scroll-controls\",g),i?.classList.toggle(\"tab-group__nav--has-scroll-controls\",g)})})),this.#h(),this.#i()}disconnectedCallback(){let t=this.shadowRoot?.querySelector(\"slot[name=tab]\"),e=this.shadowRoot?.querySelector(\"slot[name=panel]\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\"),i=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);t?.removeEventListener(\"slotchange\",this.#n),e?.removeEventListener(\"slotchange\",this.#n),s?.removeEventListener(\"click\",this.#g),s?.removeEventListener(\"keydown\",this.#p),i.forEach(o=>o.removeEventListener(\"click\",this.#f)),this.removeEventListener(\"a-tab-close\",this.#m),this.#c()}#v(){if(!this.#e)return;let t=this.shadowRoot?.querySelector(\".tab-group__tabs\");t&&(this.#e.unobserve(t),this.#e.observe(t))}#c(){this.#e&&(this.#e.disconnect(),this.#s!==null&&(window.cancelAnimationFrame(this.#s),this.#s=null))}#d(){return window.CSS.supports(\"selector(:dir(ltr))\")?this.matches(\":dir(ltr)\")?l.LTR:l.RTL:window.getComputedStyle(this).direction||l.LTR}#h(){this.hidden=this.#t().length===0}#w(){let t=this.#t();this.#h(),t.forEach(e=>{let s=e.nextElementSibling;if(!s||s.tagName.toLowerCase()!==\"a-tab-panel\")return console.error(`Tab #${e.id} is not a sibling of a `);e.setAttribute(\"aria-controls\",s.id),s.setAttribute(\"aria-labelledby\",e.id)})}#T(){return Array.from(this.querySelectorAll(\"a-tab-panel\"))}#t(){return Array.from(this.querySelectorAll(\"a-tab\"))}#b(t){let e=t.getAttribute(\"aria-controls\");return this.querySelector(`#${e}`)}#y(){return this.#t().find(e=>!e.disabled)||null}#A(){let t=this.#t();for(let e=t.length-1;e>=0;e--)if(!t[e].disabled)return t[e];return null}#a(){let t=this.#t(),e=this.activation===r.MANUAL?t.findIndex(s=>s.matches(\":focus\"))-1:t.findIndex(s=>s.selected)-1;for(;t[(e+t.length)%t.length].disabled;)e--;return this.noTabCycling&&e<0?null:t[(e+t.length)%t.length]}#r(){let t=this.#t(),e=this.activation===r.MANUAL?t.findIndex(s=>s.matches(\":focus\"))+1:t.findIndex(s=>s.selected)+1;for(;t[e%t.length].disabled;)e++;return this.noTabCycling&&e>=t.length?null:t[e%t.length]}#_(){let t=this.#t(),e=this.#T();t.forEach(s=>s.selected=!1),e.forEach(s=>s.hidden=!0)}#i(){let t=this.shadowRoot?.querySelector(\".tab-group__nav\"),e=this.shadowRoot?.querySelector(\".tab-group__tabs\"),s=Array.from(this.shadowRoot?.querySelectorAll(\".tab-group__scroll-button\")||[]);this.noScrollControls||this.placement===n.START||this.placement===n.END?(this.#c(),s.forEach(i=>i.hidden=!0),t?.part.remove(\"nav--has-scroll-controls\"),t?.classList.remove(\"tab-group__nav--has-scroll-controls\"),e?.setAttribute(\"aria-orientation\",\"vertical\")):(this.#v(),s.forEach(i=>i.hidden=!1),e?.setAttribute(\"aria-orientation\",\"horizontal\"))}#E(){let t=this.#t(),e=t.find(s=>s.selected&&!s.disabled)||t.find(s=>!s.disabled);e&&(this.#l&&!e.selected&&this.dispatchEvent(new CustomEvent(\"a-tab-show\",{bubbles:!0,composed:!0,detail:{tabId:e.id}})),this.#u(e))}#u(t){this.#_(),t&&(t.selected=!0);let e=this.#b(t);e&&(e.hidden=!1)}#n=t=>{this.#w(),this.#i(),this.#E(),t.target.name===\"tab\"&&(this.#l=!0)};#p=t=>{if(t.target.tagName.toLowerCase()!==\"a-tab\"||t.altKey)return;let e=R.includes(this.placement||\"\")?this.placement:n.TOP,s=[n.TOP,n.BOTTOM].includes(e||\"\")?\"horizontal\":\"vertical\",i=this.#d(),o=null;switch(t.key){case c.LEFT:s===\"horizontal\"&&(o=i===l.LTR?this.#a():this.#r(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.RIGHT:s===\"horizontal\"&&(o=i===l.LTR?this.#r():this.#a(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.UP:s===\"vertical\"&&(o=this.#a(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.DOWN:s===\"vertical\"&&(o=this.#r(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o)));break;case c.HOME:o=this.#y(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o));break;case c.END:o=this.#A(),o&&(this.activation===r.MANUAL?o.focus():this.selectTab(o));break;case c.ENTER:case c.SPACE:o=t.target,o&&this.selectTab(o);break;default:return}t.preventDefault()};#g=t=>{let e=t.target.closest(\"a-tab\");e&&this.selectTab(e)};#f=t=>{let e=t.target.closest(\".tab-group__scroll-button\"),s=this.shadowRoot?.querySelector(\".tab-group__tabs\");if(!e||!s)return;let i=e.classList.contains(\"tab-group__scroll-button--start\"),o=this.#d()===l.LTR,d=i?o?-1:1:o?1:-1,m=s.scrollLeft;s.scrollTo({left:m+d*this.scrollDistance})};#m=t=>{let e=t.target,s=this.#b(e);e&&(e.remove(),e.selected&&this.dispatchEvent(new CustomEvent(\"a-tab-hide\",{bubbles:!0,composed:!0,detail:{tabId:e.id}}))),s&&s.tagName.toLowerCase()===\"a-tab-panel\"&&s.remove()};#o(t){return b(t,this)}selectTabByIndex(t){let s=this.#t()[t];s&&this.selectTab(s)}selectTabById(t){let s=this.#t().find(i=>i.id===t);s&&this.selectTab(s)}selectTab(t){let e=this.#t().find(s=>s.selected);!t||t.disabled||t.selected||t.tagName.toLowerCase()!==\"a-tab\"||(this.#u(t),window.requestAnimationFrame(()=>{t.scrollIntoView({inline:\"nearest\",block:\"nearest\"}),t.focus()}),e&&this.dispatchEvent(new CustomEvent(\"a-tab-hide\",{bubbles:!0,composed:!0,detail:{tabId:e.id}})),this.dispatchEvent(new CustomEvent(\"a-tab-show\",{bubbles:!0,composed:!0,detail:{tabId:t.id}})))}static defineCustomElement(t=\"a-tab-group\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};f.defineCustomElement();export{u as ATab,f as ATabGroup,p as ATabPanel};\n//# sourceMappingURL=a-tab-group.js.map\n","// @ts-check\n\n/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */\nconst uid = (prefix = '', suffix = '') => {\n const prefixString = typeof prefix === 'string' && prefix !== '' ? prefix + '-' : '';\n const suffixString = typeof suffix === 'string' && suffix !== '' ? '-' + suffix : '';\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n\n return `${prefixString}${randomString}${suffixString}`;\n};\n\nexport { uid };\n","// @ts-check\n\n/**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n * @param {any} instance - The instance of the tab.\n */\nconst upgradeProperty = (prop, instance) => {\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n};\n\nexport { upgradeProperty };\n","// @ts-check\n\nimport { uid } from './utils/uid.js';\nimport { upgradeProperty } from './utils/upgrade-property.js';\n\nlet tabCounter = 0;\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n display: inline-block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.375rem 0.75rem;\n white-space: nowrap;\n cursor: pointer;\n }\n\n :host([disabled]) .tab {\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n :host([selected]) .tab {\n color: var(--selected-tab-color);\n background-color: var(--selected-tab-bg-color);\n }\n\n .tab__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.25rem;\n font-size: inherit;\n cursor: pointer;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n \n
    \n`;\n\n/**\n * @summary\n * This is a tab for a tab panel.\n * `` should always be used with `role=heading` in the markup so that the semantics remain useable when JavaScript is failing.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab\n * @extends HTMLElement\n *\n * @property {boolean} selected - Whether the tab is selected.\n * @property {boolean} disabled - Whether the tab is disabled.\n * @property {boolean} closable - Whether the tab is closable.\n *\n * @attribute selected - Reflects the selected property.\n * @attribute disabled - Reflects the disabled property.\n * @attribute closable - Reflects the closable property.\n *\n * @csspart base - The component's base wrapper.\n * @csspart close-tab - The close button.\n * @csspart close-tab-icon - The close button icon.\n *\n * @slot - The tab's content.\n *\n * @event a-tab-close - Fires when the tab's close button is clicked.\n */\nclass ATab extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['selected', 'disabled', 'closable'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'selected' && oldValue !== newValue) {\n this.setAttribute('aria-selected', this.selected.toString());\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n if (name === 'disabled' && oldValue !== newValue) {\n this.setAttribute('aria-disabled', this.disabled.toString());\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n if (name === 'closable' && oldValue !== newValue) {\n if (this.closable) {\n const closeButton = document.createElement('span');\n closeButton.className = 'tab__close';\n closeButton.setAttribute('part', 'close-tab');\n closeButton.innerHTML = /* html */ ``;\n this.shadowRoot?.querySelector('.tab')?.appendChild(closeButton);\n closeButton.addEventListener('click', this.#handleCloseButtonClick);\n } else {\n const closeButton = this.shadowRoot?.querySelector('.tab__close');\n closeButton?.removeEventListener('click', this.#handleCloseButtonClick);\n closeButton?.remove();\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('selected');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('closable');\n\n if (!this.id) {\n this.id = uid('tab', (++tabCounter).toString());\n }\n\n this.setAttribute('slot', 'tab');\n this.setAttribute('role', 'tab');\n this.setAttribute('aria-selected', 'false');\n this.setAttribute('tabindex', this.disabled || !this.selected ? '-1' : '0');\n }\n\n /**\n * Lifecycle method that is called when the element is disconnected from the DOM.\n */\n disconnectedCallback() {\n const closeButton = this.shadowRoot?.querySelector('.tab__close');\n closeButton?.removeEventListener('click', this.#handleCloseButtonClick);\n }\n\n /**\n * @type {boolean} - Whether the tab is selected.\n * @default false\n * @attribute selected - Reflects the selected property.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n set selected(value) {\n this.toggleAttribute('selected', !!value);\n }\n\n /**\n * @type {boolean} - Whether the tab is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {boolean} - Whether the tab is closable.\n * @default false\n * @attribute closable - Reflects the closable property.\n */\n get closable() {\n return this.hasAttribute('closable');\n }\n\n set closable(value) {\n this.toggleAttribute('closable', !!value);\n }\n\n /**\n * Handles the click event on the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n evt.stopPropagation();\n\n this.dispatchEvent(\n new CustomEvent(`a-tab-close`, {\n bubbles: true,\n composed: true,\n detail: { tabId: this.id }\n })\n );\n };\n\n /**\n * Wrapper for the `upgradeProperty` function.\n *\n * @param {'selected' | 'disabled' | 'closable'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n return upgradeProperty(prop, this);\n }\n\n static defineCustomElement(elementName = 'a-tab') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATab);\n }\n }\n}\n\nATab.defineCustomElement();\n\nexport { ATab };\n","// @ts-check\n\nimport { uid } from './utils/uid.js';\n\nlet panelCounter = 0;\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n \n
    \n`;\n\n/**\n * @summary This is a panel for a `` tab panel.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab-panel\n * @extends HTMLElement\n *\n * @csspart base - The component's base wrapper.\n *\n * @slot - The content of the tab panel.\n */\nclass ATabPanel extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.setAttribute('slot', 'panel');\n this.setAttribute('role', 'tabpanel');\n this.setAttribute('hidden', '');\n\n if (!this.id) {\n this.id = uid('panel', (++panelCounter).toString());\n }\n }\n\n static defineCustomElement(elementName = 'a-tab-panel') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATabPanel);\n }\n }\n}\n\nATabPanel.defineCustomElement();\n\nexport { ATabPanel };\n","// @ts-check\n\n/**\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/** @typedef {import('./a-tab').ATab} Tab */\n/** @typedef {import('./a-tab-panel').ATabPanel} TabPanel */\n\nexport { ATab } from './a-tab.js';\nexport { ATabPanel } from './a-tab-panel.js';\nimport { upgradeProperty } from './utils/upgrade-property.js';\n\n/**\n * The default scroll distance in pixels that the\n * tabs will scroll when the scroll buttons are clicked.\n */\nconst DEFAULT_SCROLL_DISTANCE = 200;\n\n/**\n * The available placements for the tabs.\n */\nconst PLACEMENT = {\n TOP: 'top',\n BOTTOM: 'bottom',\n START: 'start',\n END: 'end'\n};\n\n/**\n * The available directionality values for the tab group.\n */\nconst DIR = {\n LTR: 'ltr',\n RTL: 'rtl'\n};\n\n/**\n * The valid placements for the tabs.\n */\nconst validPlacements = Object.entries(PLACEMENT).map(([, value]) => value);\n\n/**\n * The available activation modes for the tabs.\n */\nconst ACTIVATION = {\n AUTO: 'auto',\n MANUAL: 'manual'\n};\n\n/**\n * Defines key codes to help with handling keyboard events.\n */\nconst KEYCODE = {\n DOWN: 'ArrowDown',\n LEFT: 'ArrowLeft',\n RIGHT: 'ArrowRight',\n UP: 'ArrowUp',\n HOME: 'Home',\n END: 'End',\n ENTER: 'Enter',\n SPACE: ' '\n};\n\nconst styles = /* css */ `\n :host {\n --selected-tab-color: #005fcc;\n --selected-tab-bg-color: transparent;\n --tabs-scroll-behavior: smooth;\n --scroll-button-width: 2.125em;\n --scroll-button-height: 2.125em;\n --scroll-button-inline-offset: 0rem;\n\n box-sizing: border-box;\n display: block;\n contain: content;\n }\n\n @media (prefers-reduced-motion: reduce) {\n :host {\n --tabs-scroll-behavior: auto;\n }\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n .tab-group {\n display: flex;\n width: 100%;\n }\n\n .tab-group__nav {\n position: relative;\n }\n\n .tab-group__nav--has-scroll-controls {\n padding: 0 calc(var(--scroll-button-width) + var(--scroll-button-inline-offset));\n }\n\n .tab-group__scroll-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: var(--scroll-button-width);\n height: var(--scroll-button-height);\n padding: 0; /* Required for iOS, otherwise the svg is not visible: https://stackoverflow.com/questions/66532071/flex-svg-behaving-strange-in-ios-safari-14-0-3 */\n border: 0;\n z-index: 1;\n background-color: transparent;\n font-size: inherit;\n cursor: pointer;\n color: currentColor;\n }\n\n .tab-group__scroll-button--start {\n left: var(--scroll-button-inline-offset);\n }\n\n .tab-group__scroll-button--end {\n right: var(--scroll-button-inline-offset);\n }\n\n :host([dir=\"${DIR.RTL}\"]) .tab-group__scroll-button--start,\n :host(:dir(${DIR.RTL})) .tab-group__scroll-button--start {\n right: var(--scroll-button-inline-offset);\n left: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n :host([dir=\"${DIR.RTL}\"]) .tab-group__scroll-button--end,\n :host(:dir(${DIR.RTL})) .tab-group__scroll-button--end {\n left: var(--scroll-button-inline-offset);\n right: auto;\n transform: translateY(-50%) rotate(180deg);\n }\n\n .tab-group__tabs {\n display: flex;\n padding: 0.25rem;\n overflow-x: auto;\n scroll-behavior: var(--tabs-scroll-behavior);\n scrollbar-width: none;\n }\n\n .tab-group__tabs::-webkit-scrollbar {\n display: none;\n }\n\n .tab-group__panels {\n padding: 1rem 0;\n }\n\n /* placement=\"top\" */\n .tab-group,\n :host([placement=\"${PLACEMENT.TOP}\"]) .tab-group {\n flex-direction: column;\n }\n\n /* placement=\"bottom\" */\n :host([placement=\"${PLACEMENT.BOTTOM}\"]) .tab-group {\n flex-direction: column;\n }\n\n :host([placement=\"${PLACEMENT.BOTTOM}\"]) .tab-group__nav {\n order: 1;\n }\n\n /* placement=\"start\" */\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${PLACEMENT.START}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n\n /* placement=\"end\" */\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group {\n flex-direction: row;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__nav {\n order: 1;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__tabs {\n flex-direction: column;\n align-items: flex-start;\n }\n\n :host([placement=\"${PLACEMENT.END}\"]) .tab-group__panels {\n flex: 1;\n padding: 0 1rem;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n
    \n \n
    \n\n \n
    \n\n
    \n \n
    \n
    \n`;\n\n/**\n * @summary Container element for tabs and panels. All children of should be either `` or ``.\n * @documentation https://github.com/georapbox/a-tab-group\n *\n * @tagname a-tab-group\n * @extends HTMLElement\n *\n * @property {string} placement - The placement of the tabs.\n * @property {boolean} noScrollControls - Whether or not the scroll controls are enabled.\n * @property {number} scrollDistance - The distance in pixels that the tabs will scroll when the scroll buttons are clicked.\n * @property {string} activation - The activation mode of the tabs.\n * @property {boolean} noTabCycling - Whether or not the tabs should cycle when reaching the first or last tab using the keyboard.\n *\n * @attribute placement - Reflects the placement property.\n * @attribute no-scroll-controls - Reflects the noScrollControls property.\n * @attribute scroll-distance - Reflects the scrollDistance property.\n * @attribute activation - Reflects the activation property.\n * @attribute no-tab-cycling - Reflects the noTabCycling property.\n *\n * @slot tab - Used for groupping tabs in the tab group. Must be elements.\n * @slot panel - Used for groupping tab panels in the tab group. Must be elements.\n *\n * @csspart base - The component's base wrapper.\n * @csspart nav - The nav container.\n * @csspart nav--has-scroll-controls - The nav container when the scroll controls are enabled and visible.\n * @csspart scroll-button - The scroll button.\n * @csspart scroll-button--start - The scroll button for scrolling towards the start.\n * @csspart scroll-button--end - The scroll button for scrolling towards the end.\n * @csspart scroll-button-icon - The scroll button icon.\n * @csspart tabs - The tabs container.\n * @csspart panels - The panels container.\n *\n * @cssproperty --selected-tab-color - The color of the selected tab.\n * @cssproperty --selected-tab-bg-color - The background color of the selected tab.\n * @cssproperty --tabs-scroll-behavior - The scroll behavior of the tabs container.\n * @cssproperty --scroll-button-width - The width of the scroll buttons.\n * @cssproperty --scroll-button-height - The height of the scroll buttons.\n * @cssproperty --scroll-button-inline-offset - The inline offset of the scroll buttons.\n *\n * @event a-tab-show - Fired when a tab is shown.\n * @event a-tab-hide - Fired when a tab is shown.\n *\n * @method selectTabByIndex - Selects the tab at the given index.\n * @method selectTabById - Selects the tab with the given id.\n * @method selectTab - Selects the given tab.\n */\nclass ATabGroup extends HTMLElement {\n /** @type {Nullable} */\n #resizeObserver = null;\n\n /** @type {Nullable} */\n #rafId = null;\n\n /** @type {boolean} */\n #hasTabSlotChangedOnce = false;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['placement', 'no-scroll-controls'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'placement' && oldValue !== newValue) {\n this.#syncNav();\n }\n\n if (name === 'no-scroll-controls' && oldValue !== newValue) {\n this.#syncNav();\n }\n }\n\n /**\n * @type {Nullable} - The placement of the tabs.\n * @default 'top'\n * @attribute placement - Reflects the placement property.\n */\n get placement() {\n return this.getAttribute('placement') || PLACEMENT.TOP;\n }\n\n set placement(value) {\n if (value != null) {\n this.setAttribute('placement', value);\n }\n }\n\n /**\n * @type {boolean} - Whether or not the scroll controls are enabled.\n * @default false\n * @attribute no-scroll-controls - Reflects the noScrollControls property.\n */\n get noScrollControls() {\n return this.hasAttribute('no-scroll-controls');\n }\n\n set noScrollControls(value) {\n this.toggleAttribute('no-scroll-controls', !!value);\n }\n\n /**\n * @type {number} - The distance in pixels that the tabs will scroll when the scroll buttons are clicked.\n * @default 200\n * @attribute scroll-distance - Reflects the scrollDistance property.\n */\n get scrollDistance() {\n const value = Number(this.getAttribute('scroll-distance'));\n return Math.abs(value) || DEFAULT_SCROLL_DISTANCE;\n }\n\n set scrollDistance(value) {\n this.setAttribute('scroll-distance', Math.abs(value).toString() || DEFAULT_SCROLL_DISTANCE.toString());\n }\n\n /**\n * @type {string} - The activation mode of the tabs.\n * @default 'auto'\n * @attribute activation - Reflects the activation property.\n */\n get activation() {\n return this.getAttribute('activation') || ACTIVATION.AUTO;\n }\n\n set activation(value) {\n this.setAttribute('activation', value || ACTIVATION.AUTO);\n }\n\n /**\n * @type {boolean} - Whether or not the tabs should cycle when reaching the first or last tab using the keyboard.\n * @default false\n * @attribute no-tab-cycling - Reflects the noTabCycling property.\n */\n get noTabCycling() {\n return this.hasAttribute('no-tab-cycling');\n }\n\n set noTabCycling(value) {\n this.toggleAttribute('no-tab-cycling', !!value);\n }\n\n /**\n * Lifecycle method that is called when the element is first connected to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('placement');\n this.#upgradeProperty('noScrollControls');\n this.#upgradeProperty('scrollDistance');\n this.#upgradeProperty('activation');\n this.#upgradeProperty('noTabCycling');\n\n const tabSlot = this.shadowRoot?.querySelector('slot[name=tab]');\n const panelSlot = this.shadowRoot?.querySelector('slot[name=panel]');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n const navContainer = this.shadowRoot?.querySelector('.tab-group__nav');\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n tabSlot?.addEventListener('slotchange', this.#handleSlotChange);\n panelSlot?.addEventListener('slotchange', this.#handleSlotChange);\n tabsContainer?.addEventListener('click', this.#handleTabClick);\n tabsContainer?.addEventListener('keydown', this.#handleKeyDown);\n scrollButtons.forEach(el => el.addEventListener('click', this.#handleScrollButtonClick));\n this.addEventListener('a-tab-close', this.#handleTabClose);\n\n if ('ResizeObserver' in window) {\n this.#resizeObserver = new ResizeObserver(entries => {\n this.#rafId = window.requestAnimationFrame(() => {\n const entry = entries?.[0];\n const targetElement = entry?.target;\n const isElementScrollable = targetElement?.scrollWidth > targetElement?.clientWidth;\n scrollButtons.forEach(el => el.toggleAttribute('hidden', !isElementScrollable));\n navContainer?.part.toggle('nav--has-scroll-controls', isElementScrollable);\n navContainer?.classList.toggle('tab-group__nav--has-scroll-controls', isElementScrollable);\n });\n });\n }\n\n this.#hideEmptyTabGroup();\n this.#syncNav();\n }\n\n /**\n * Lifecycle method that is called when the element is disconnected from the DOM.\n */\n disconnectedCallback() {\n const tabSlot = this.shadowRoot?.querySelector('slot[name=tab]');\n const panelSlot = this.shadowRoot?.querySelector('slot[name=panel]');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n tabSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n panelSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n tabsContainer?.removeEventListener('click', this.#handleTabClick);\n tabsContainer?.removeEventListener('keydown', this.#handleKeyDown);\n scrollButtons.forEach(el => el.removeEventListener('click', this.#handleScrollButtonClick));\n this.removeEventListener('a-tab-close', this.#handleTabClose);\n this.#stopResizeObserver();\n }\n\n /**\n * Starts observing the tabs container for resize events.\n */\n #startResizeObserver() {\n if (!this.#resizeObserver) {\n return;\n }\n\n const scrollElement = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n if (scrollElement) {\n this.#resizeObserver.unobserve(scrollElement);\n this.#resizeObserver.observe(scrollElement);\n }\n }\n\n /**\n * Stops observing the tabs container for resize events.\n */\n #stopResizeObserver() {\n if (!this.#resizeObserver) {\n return;\n }\n\n this.#resizeObserver.disconnect();\n\n if (this.#rafId !== null) {\n window.cancelAnimationFrame(this.#rafId);\n this.#rafId = null;\n }\n }\n\n /**\n * Gets the directionality of the tab group.\n *\n * @returns {'ltr' | 'rtl'} - The direction of the tab group.\n */\n #getDirectionality() {\n return /** @type {'ltr' | 'rtl'} */ (\n window.CSS.supports('selector(:dir(ltr))')\n ? this.matches(':dir(ltr)')\n ? DIR.LTR\n : DIR.RTL\n : window.getComputedStyle(this).direction || DIR.LTR\n );\n }\n\n /**\n * Hides the tab group if there are no tabs.\n */\n #hideEmptyTabGroup() {\n this.hidden = this.#allTabs().length === 0;\n }\n\n /**\n * Links up tabs with their adjacent panels using `aria-controls` and `aria-labelledby`.\n * This method makes sure only one tab is selected at a time.\n */\n #linkPanels() {\n const tabs = this.#allTabs();\n\n this.#hideEmptyTabGroup();\n\n // Give each panel a `aria-labelledby` attribute that refers to the tab that controls it.\n tabs.forEach(tab => {\n const panel = tab.nextElementSibling;\n\n if (!panel || panel.tagName.toLowerCase() !== 'a-tab-panel') {\n return console.error(`Tab #${tab.id} is not a sibling of a `);\n }\n\n tab.setAttribute('aria-controls', panel.id);\n panel.setAttribute('aria-labelledby', tab.id);\n });\n }\n\n /**\n * Get all panels in the tab group.\n *\n * @returns {TabPanel[]} - All the panels in the tab group.\n */\n #allPanels() {\n return Array.from(this.querySelectorAll('a-tab-panel'));\n }\n\n /**\n * Get all tabs in the tab group.\n *\n * @returns {Tab[]} - All the tabs in the tab group.\n */\n #allTabs() {\n return Array.from(this.querySelectorAll('a-tab'));\n }\n\n /**\n * Get the panel for the given tab.\n *\n * @param {Tab} tab - The tab whose panel is to be returned.\n * @returns {Nullable} - The panel controlled by the given tab.\n */\n #panelForTab(tab) {\n const panelId = tab.getAttribute('aria-controls');\n return this.querySelector(`#${panelId}`);\n }\n\n /**\n * Get the first non-disabled tab in the tab group.\n *\n * @returns {Nullable} - The first tab in the tab group.\n */\n #firstTab() {\n const tabs = this.#allTabs();\n return tabs.find(tab => !tab.disabled) || null;\n }\n\n /**\n * Get the last non-disabled tab in the tab group.\n *\n * @returns {Nullable} - The last tab in the tab group.\n */\n #lastTab() {\n const tabs = this.#allTabs();\n\n for (let i = tabs.length - 1; i >= 0; i--) {\n if (!tabs[i].disabled) {\n return tabs[i];\n }\n }\n\n return null;\n }\n\n /**\n * Get the tab that comes before the currently selected one, wrapping around when reaching the first tab.\n * If the currently selected tab is disabled, the method will skip it.\n *\n * @returns {Nullable} - The previous tab.\n */\n #prevTab() {\n const tabs = this.#allTabs();\n let newIdx =\n this.activation === ACTIVATION.MANUAL\n ? tabs.findIndex(tab => tab.matches(':focus')) - 1\n : tabs.findIndex(tab => tab.selected) - 1;\n\n // Keep looping until we find a non-disabled tab.\n while (tabs[(newIdx + tabs.length) % tabs.length].disabled) {\n newIdx--;\n }\n\n // Stop cycling through tabs if we reach the beginning and tab cycling is disabled.\n if (this.noTabCycling && newIdx < 0) {\n return null;\n }\n\n // Add `tabs.length` to make sure the index is a positive number and get the modulus to wrap around if necessary.\n return tabs[(newIdx + tabs.length) % tabs.length];\n }\n\n /**\n * Get the tab that comes after the currently selected one, wrapping around when reaching the last tab.\n * If the currently selected tab is disabled, the method will skip it.\n *\n * @returns {Nullable} - The next tab.\n */\n #nextTab() {\n const tabs = this.#allTabs();\n let newIdx =\n this.activation === ACTIVATION.MANUAL\n ? tabs.findIndex(tab => tab.matches(':focus')) + 1\n : tabs.findIndex(tab => tab.selected) + 1;\n\n // Keep looping until we find a non-disabled tab.\n while (tabs[newIdx % tabs.length].disabled) {\n newIdx++;\n }\n\n // Stop cycling through tabs if we reach the end and tab cycling is disabled.\n if (this.noTabCycling && newIdx >= tabs.length) {\n return null;\n }\n\n return tabs[newIdx % tabs.length];\n }\n\n /**\n * Marks all tabs as unselected and hides all the panels.\n * This is called every time the user selects a new tab.\n */\n #reset() {\n const tabs = this.#allTabs();\n const panels = this.#allPanels();\n\n tabs.forEach(tab => (tab.selected = false));\n panels.forEach(panel => (panel.hidden = true));\n }\n\n /**\n * Syncs the tab group navigation with the current state of the tab group.\n *\n * This is called every time the user:\n * - adds or removes a tab or panel\n * - changes the placement of the tabs\n * - enables or disables the scroll controls\n *\n * If the tabs container is scrollable and the scroll controls are enabled,\n * the scroll buttons are displayed and the resize observer is started,\n * otherwise they are hidden and the resize observer is stopped.\n */\n #syncNav() {\n const navContainer = this.shadowRoot?.querySelector('.tab-group__nav');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n /** @type {HTMLButtonElement[]} */\n const scrollButtons = Array.from(this.shadowRoot?.querySelectorAll('.tab-group__scroll-button') || []);\n\n if (this.noScrollControls || this.placement === PLACEMENT.START || this.placement === PLACEMENT.END) {\n this.#stopResizeObserver();\n scrollButtons.forEach(el => (el.hidden = true));\n navContainer?.part.remove('nav--has-scroll-controls');\n navContainer?.classList.remove('tab-group__nav--has-scroll-controls');\n tabsContainer?.setAttribute('aria-orientation', 'vertical');\n } else {\n this.#startResizeObserver();\n scrollButtons.forEach(el => (el.hidden = false));\n tabsContainer?.setAttribute('aria-orientation', 'horizontal');\n }\n }\n\n /**\n * Sets the selected tab when the slot changes.\n * This is called every time the user adds or removes a tab or panel.\n * This is useful when the user closes the selected tab and we need to select a new one.\n */\n #setSelectedTabOnSlotChange() {\n const tabs = this.#allTabs();\n\n // Get the selected non-disabled tab, or the first non-disabled tab.\n const tab = tabs.find(tab => tab.selected && !tab.disabled) || tabs.find(tab => !tab.disabled);\n\n if (tab) {\n if (this.#hasTabSlotChangedOnce && !tab.selected) {\n this.dispatchEvent(\n new CustomEvent('a-tab-show', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n\n this.#setSelectedTab(tab);\n }\n }\n\n /**\n * Sets the given tab as selected and shows the panel corresponding to the given tab.\n * Differentiates from `selectTab()` in that it does not emit any events or focus the tab.\n * Used internally to set the selected tab when a tab is selected by a side effect,\n * eg. when a tabs and panels are added or removeda and there is a need to select a new tab.\n *\n * @param {Tab} tab - The tab to be selected.\n */\n #setSelectedTab(tab) {\n this.#reset();\n\n if (tab) {\n tab.selected = true;\n }\n\n const panel = this.#panelForTab(tab);\n\n if (panel) {\n panel.hidden = false;\n }\n }\n\n /**\n * Handles the slotchange event on the tab group.\n * This is called every time the user adds or removes a tab or panel.\n *\n * @param {any} evt - The slotchange event.\n */\n #handleSlotChange = evt => {\n this.#linkPanels();\n this.#syncNav();\n this.#setSelectedTabOnSlotChange();\n\n if (evt.target.name === 'tab') {\n this.#hasTabSlotChangedOnce = true;\n }\n };\n\n /**\n * Handles key events on the tab group.\n *\n * @param {any} evt - The keydown event.\n */\n #handleKeyDown = evt => {\n if (\n evt.target.tagName.toLowerCase() !== 'a-tab' || // Ignore any key presses that have a modifier.\n evt.altKey // Don’t handle modifier shortcuts typically used by assistive technology.\n ) {\n return;\n }\n\n const placement = validPlacements.includes(this.placement || '') ? this.placement : PLACEMENT.TOP;\n const orientation = [PLACEMENT.TOP, PLACEMENT.BOTTOM].includes(placement || '') ? 'horizontal' : 'vertical';\n const directionality = this.#getDirectionality();\n let tab = null;\n\n switch (evt.key) {\n case KEYCODE.LEFT:\n if (orientation === 'horizontal') {\n tab = directionality === DIR.LTR ? this.#prevTab() : this.#nextTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.RIGHT:\n if (orientation === 'horizontal') {\n tab = directionality === DIR.LTR ? this.#nextTab() : this.#prevTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.UP:\n if (orientation === 'vertical') {\n tab = this.#prevTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.DOWN:\n if (orientation === 'vertical') {\n tab = this.#nextTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n }\n break;\n case KEYCODE.HOME:\n tab = this.#firstTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n break;\n case KEYCODE.END:\n tab = this.#lastTab();\n if (tab) {\n this.activation === ACTIVATION.MANUAL ? tab.focus() : this.selectTab(tab);\n }\n break;\n case KEYCODE.ENTER:\n case KEYCODE.SPACE:\n tab = evt.target;\n if (tab) {\n this.selectTab(tab);\n }\n break;\n default:\n // Any other key press is ignored and passed back to the browser.\n return;\n }\n\n // The browser might have some native functionality bound to the arrow keys, home or end.\n // `preventDefault()` is called to prevent the browser from taking any actions.\n evt.preventDefault();\n };\n\n /**\n * Handles click events on the tab group.\n *\n * @param {any} evt - The click event.\n */\n #handleTabClick = evt => {\n const tab = evt.target.closest('a-tab');\n\n if (tab) {\n this.selectTab(tab);\n }\n };\n\n /**\n * Handles the scroll button click event.\n *\n * @param {any} evt - The click event.\n */\n #handleScrollButtonClick = evt => {\n const scrollButton = evt.target.closest('.tab-group__scroll-button');\n const tabsContainer = this.shadowRoot?.querySelector('.tab-group__tabs');\n\n if (!scrollButton || !tabsContainer) {\n return;\n }\n\n const isStartButton = scrollButton.classList.contains('tab-group__scroll-button--start');\n const isLTR = this.#getDirectionality() === DIR.LTR;\n const sign = isStartButton ? (isLTR ? -1 : 1) : isLTR ? 1 : -1;\n const offsetLeft = tabsContainer.scrollLeft;\n\n tabsContainer.scrollTo({\n left: offsetLeft + sign * this.scrollDistance\n });\n };\n\n /**\n * Handles the tab close button click event.\n *\n * @param {any} evt - The click event.\n */\n #handleTabClose = evt => {\n const tab = evt.target;\n const panel = this.#panelForTab(tab);\n\n if (tab) {\n tab.remove();\n\n if (tab.selected) {\n this.dispatchEvent(\n new CustomEvent('a-tab-hide', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n }\n\n if (panel && panel.tagName.toLowerCase() === 'a-tab-panel') {\n panel.remove();\n }\n };\n\n /**\n * Wrapper for the `upgradeProperty` function.\n *\n * @param {'placement' | 'noScrollControls' | 'scrollDistance' | 'activation' | 'noTabCycling'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n return upgradeProperty(prop, this);\n }\n\n /**\n * Selects the tab at the given index.\n * If the tab at the given index is disabled or already selected, this method does nothing.\n *\n * @param {number} index - The index of the tab to be selected.\n */\n selectTabByIndex(index) {\n const tabs = this.#allTabs();\n const tab = tabs[index];\n\n if (tab) {\n this.selectTab(tab);\n }\n }\n\n /**\n * Selects the tab with the given id.\n * If the tab with the given id is disabled or already selected, this method does nothing.\n *\n * @param {string} id - The id of the tab to be selected.\n */\n selectTabById(id) {\n const tabs = this.#allTabs();\n const tab = tabs.find(tab => tab.id === id);\n\n if (tab) {\n this.selectTab(tab);\n }\n }\n\n /**\n * Selects the given tab.\n * If the given tab is disabled or already selected, this method does nothing.\n *\n * @param {Tab} tab - The tab to be selected.\n */\n selectTab(tab) {\n const oldTab = this.#allTabs().find(t => t.selected);\n\n if (!tab || tab.disabled || tab.selected || tab.tagName.toLowerCase() !== 'a-tab') {\n return;\n }\n\n this.#setSelectedTab(tab);\n\n // Queue a microtask to ensure that the tab is focused on the next tick.\n window.requestAnimationFrame(() => {\n tab.scrollIntoView({ inline: 'nearest', block: 'nearest' });\n tab.focus();\n });\n\n if (oldTab) {\n this.dispatchEvent(\n new CustomEvent('a-tab-hide', {\n bubbles: true,\n composed: true,\n detail: { tabId: oldTab.id }\n })\n );\n }\n\n this.dispatchEvent(\n new CustomEvent('a-tab-show', {\n bubbles: true,\n composed: true,\n detail: { tabId: tab.id }\n })\n );\n }\n\n static defineCustomElement(elementName = 'a-tab-group') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ATabGroup);\n }\n }\n}\n\nATabGroup.defineCustomElement();\n\nexport { ATabGroup };\n","/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar h=`\n :host {\n display: inline-block;\n }\n`,r=document.createElement(\"template\");r.innerHTML=`\n \n \n`;var s=class a extends HTMLElement{#e;#t;#r=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(r.content.cloneNode(!0)),this.#e=this.shadowRoot?.querySelector('slot[name=\"button\"]')||null,this.#t=this.#h()}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,e,i){t===\"disabled\"&&e!==i&&this.#t&&(this.#t.toggleAttribute(\"disabled\",this.disabled),this.#t.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#t.part&&this.#t.part.contains(\"button\")&&this.#t.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#s(\"shareUrl\"),this.#s(\"shareTitle\"),this.#s(\"shareText\"),this.#s(\"shareFiles\"),this.#s(\"disabled\"),this.#e?.addEventListener(\"slotchange\",this.#a),this.#t?.addEventListener(\"click\",this.#i)}disconnectedCallback(){this.#e?.removeEventListener(\"slotchange\",this.#a),this.#t?.removeEventListener(\"click\",this.#i)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get shareUrl(){return this.getAttribute(\"share-url\")||\"\"}set shareUrl(t){this.setAttribute(\"share-url\",t)}get shareTitle(){return this.getAttribute(\"share-title\")||\"\"}set shareTitle(t){this.setAttribute(\"share-title\",t)}get shareText(){return this.getAttribute(\"share-text\")||\"\"}set shareText(t){this.setAttribute(\"share-text\",t)}get shareFiles(){return this.#r}set shareFiles(t){Array.isArray(t)&&t.length>0&&(this.#r=t)}async share(){if(!this.disabled)try{let t={};this.shareUrl&&(t.url=this.shareUrl),this.shareTitle&&(t.title=this.shareTitle),this.shareText&&(t.text=this.shareText),Array.isArray(this.shareFiles)&&this.shareFiles.length>0&&navigator.canShare&&navigator.canShare({files:this.shareFiles})&&(t.files=this.shareFiles),await navigator.share(t),this.dispatchEvent(new CustomEvent(\"web-share:success\",{bubbles:!0,composed:!0,detail:{shareData:t}}))}catch(t){if(t instanceof Error&&t.name===\"AbortError\"){this.dispatchEvent(new CustomEvent(\"web-share:abort\",{bubbles:!0,composed:!0,detail:{error:t}}));return}this.dispatchEvent(new CustomEvent(\"web-share:error\",{bubbles:!0,composed:!0,detail:{error:t}}))}}#i=t=>{t.preventDefault(),!this.disabled&&this.share()};#a=t=>{t.target&&t.target.name===\"button\"&&(this.#t?.removeEventListener(\"click\",this.#i),this.#t=this.#h(),this.#t&&(this.#t.addEventListener(\"click\",this.#i),this.#t.nodeName!==\"BUTTON\"&&!this.#t.hasAttribute(\"role\")&&this.#t.setAttribute(\"role\",\"button\")))};#h(){return this.#e&&this.#e.assignedElements({flatten:!0}).find(t=>t.nodeName===\"BUTTON\"||t.getAttribute(\"slot\")===\"button\")||null}#s(t){let e=this;if(Object.prototype.hasOwnProperty.call(e,t)){let i=e[t];delete e[t],e[t]=i}}static defineCustomElement(t=\"web-share\"){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,a)}};s.defineCustomElement();export{s as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */\n\nconst styles = /* css */ `\n :host {\n display: inline-block;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element#readme\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */\nclass WebShare extends HTMLElement {\n /** @type {Nullable} */\n #buttonSlot;\n\n /** @type {Nullable} */\n #buttonEl;\n\n /** @type {File[]} */\n #files = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute('disabled', this.disabled);\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part && this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('shareUrl');\n this.#upgradeProperty('shareTitle');\n this.#upgradeProperty('shareText');\n this.#upgradeProperty('shareFiles');\n this.#upgradeProperty('disabled');\n\n this.#buttonSlot?.addEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n }\n\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */\n get shareUrl() {\n return this.getAttribute('share-url') || '';\n }\n\n set shareUrl(value) {\n this.setAttribute('share-url', value);\n }\n\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */\n get shareTitle() {\n return this.getAttribute('share-title') || '';\n }\n\n set shareTitle(value) {\n this.setAttribute('share-title', value);\n }\n\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */\n get shareText() {\n return this.getAttribute('share-text') || '';\n }\n\n set shareText(value) {\n this.setAttribute('share-text', value);\n }\n\n /**\n * @type {File[]} - The files to share.\n */\n get shareFiles() {\n return this.#files;\n }\n\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) {\n this.#files = value;\n }\n }\n\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */\n async share() {\n if (this.disabled) {\n return;\n }\n\n try {\n /** @type {ShareData} */\n const shareData = {};\n\n if (this.shareUrl) {\n shareData.url = this.shareUrl;\n }\n\n if (this.shareTitle) {\n shareData.title = this.shareTitle;\n }\n\n if (this.shareText) {\n shareData.text = this.shareText;\n }\n\n if (\n Array.isArray(this.shareFiles) &&\n this.shareFiles.length > 0 &&\n navigator.canShare &&\n navigator.canShare({ files: this.shareFiles })\n ) {\n shareData.files = this.shareFiles;\n }\n\n await navigator.share(shareData);\n\n this.dispatchEvent(\n new CustomEvent('web-share:success', {\n bubbles: true,\n composed: true,\n detail: { shareData }\n })\n );\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n this.dispatchEvent(\n new CustomEvent('web-share:abort', {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent('web-share:error', {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n }\n\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.share();\n };\n\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */\n #handleSlotChange = evt => {\n if (evt.target && evt.target.name === 'button') {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n this.#buttonEl = this.#getButton();\n\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener('click', this.#handleClick);\n\n if (this.#buttonEl.nodeName !== 'BUTTON' && !this.#buttonEl.hasAttribute('role')) {\n this.#buttonEl.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */\n #getButton() {\n if (!this.#buttonSlot) {\n return null;\n }\n\n return (\n this.#buttonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'button';\n }) || null\n );\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='web-share'] - The name of the custom element.\n * @example\n *\n * ClipboardCopy.defineCustomElement('my-web-share');\n */\n static defineCustomElement(elementName = 'web-share') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, WebShare);\n }\n }\n}\n\nexport { WebShare };\n","import { WebShare } from './web-share.js';\n\nWebShare.defineCustomElement();\n\nexport { WebShare };\n","/*!\n * @georapbox/files-dropzone-element\n * A custom element that creates a drag and drop zone for files\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/files-dropzone-element#readme\n * @author George Raptis \n * @license MIT\n */\nfunction u(o,e=\"\"){if(!e)return!0;let t=[...new Set(e.split(\",\").map(r=>r.trim()).filter(Boolean))],i=o.type,s=i.replace(/\\/.*$/,\"\");for(let r of t)if(r.charAt(0)===\".\"){if(o.name.toLowerCase().indexOf(r.toLowerCase(),o.name.length-r.length)!==-1)return!0}else if(/\\/\\*$/.test(r)){if(s===r.replace(/\\/.*$/,\"\"))return!0}else if(i===r)return!0;return!1}var x=new Map([[\"aac\",\"audio/aac\"],[\"abw\",\"application/x-abiword\"],[\"arc\",\"application/x-freearc\"],[\"avif\",\"image/avif\"],[\"avi\",\"video/x-msvideo\"],[\"azw\",\"application/vnd.amazon.ebook\"],[\"bin\",\"application/octet-stream\"],[\"bmp\",\"image/bmp\"],[\"bz\",\"application/x-bzip\"],[\"bz2\",\"application/x-bzip2\"],[\"cda\",\"application/x-cdf\"],[\"csh\",\"application/x-csh\"],[\"css\",\"text/css\"],[\"csv\",\"text/csv\"],[\"doc\",\"application/msword\"],[\"docx\",\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"],[\"eot\",\"application/vnd.ms-fontobject\"],[\"epub\",\"application/epub+zip\"],[\"gz\",\"application/gzip\"],[\"gif\",\"image/gif\"],[\"heic\",\"image/heic\"],[\"heif\",\"image/heif\"],[\"htm\",\"text/html\"],[\"html\",\"text/html\"],[\"ico\",\"image/vnd.microsoft.icon\"],[\"ics\",\"text/calendar\"],[\"jar\",\"application/java-archive\"],[\"jpeg\",\"image/jpeg\"],[\"jpg\",\"image/jpeg\"],[\"jxl\",\"image/jxl\"],[\"js\",\"text/javascript\"],[\"json\",\"application/json\"],[\"jsonld\",\"application/ld+json\"],[\"markdown\",\"text/markdown\"],[\"md\",\"text/markdown\"],[\"mid\",\"audio/midi\"],[\"midi\",\"audio/midi\"],[\"mjs\",\"text/javascript\"],[\"mp3\",\"audio/mpeg\"],[\"mp4\",\"video/mp4\"],[\"mpeg\",\"video/mpeg\"],[\"mpkg\",\"application/vnd.apple.installer+xml\"],[\"odp\",\"application/vnd.oasis.opendocument.presentation\"],[\"ods\",\"application/vnd.oasis.opendocument.spreadsheet\"],[\"odt\",\"application/vnd.oasis.opendocument.text\"],[\"oga\",\"audio/ogg\"],[\"ogv\",\"video/ogg\"],[\"ogx\",\"application/ogg\"],[\"opus\",\"audio/opus\"],[\"otf\",\"font/otf\"],[\"png\",\"image/png\"],[\"pdf\",\"application/pdf\"],[\"php\",\"application/x-httpd-php\"],[\"ppt\",\"application/vnd.ms-powerpoint\"],[\"pptx\",\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"],[\"rar\",\"application/vnd.rar\"],[\"rtf\",\"application/rtf\"],[\"sh\",\"application/x-sh\"],[\"svg\",\"image/svg+xml\"],[\"swf\",\"application/x-shockwave-flash\"],[\"tar\",\"application/x-tar\"],[\"tif\",\"image/tiff\"],[\"tiff\",\"image/tiff\"],[\"ts\",\"video/mp2t\"],[\"ttf\",\"font/ttf\"],[\"txt\",\"text/plain\"],[\"vsd\",\"application/vnd.visio\"],[\"wav\",\"audio/wav\"],[\"weba\",\"audio/webm\"],[\"webm\",\"video/webm\"],[\"webp\",\"image/webp\"],[\"woff\",\"font/woff\"],[\"woff2\",\"font/woff2\"],[\"xhtml\",\"application/xhtml+xml\"],[\"xls\",\"application/vnd.ms-excel\"],[\"xlsx\",\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"],[\"xml\",\"application/xml\"],[\"xul\",\"application/vnd.mozilla.xul+xml\"],[\"zip\",\"application/zip\"],[\"7z\",\"application/x-7z-compressed\"],[\"mkv\",\"video/x-matroska\"],[\"mov\",\"video/quicktime\"],[\"msg\",\"application/vnd.ms-outlook\"]]),b=[\".DS_Store\",\"Thumbs.db\"],y=o=>{let{name:e}=o;if(e&&e.lastIndexOf(\".\")!==-1&&!o.type){let i=(e.split(\".\").pop()||\"\").toLowerCase(),s=x.get(i);s&&Object.defineProperty(o,\"type\",{value:s,writable:!1,configurable:!1,enumerable:!0})}return o},g=(o,e)=>{let t=y(o);if(typeof t.path!=\"string\"){let{webkitRelativePath:i}=o;Object.defineProperty(t,\"path\",{value:typeof e==\"string\"?e:i||o.name,writable:!1,configurable:!1,enumerable:!0})}return t},m=async o=>await new Promise((e,t)=>{o.readEntries(e,t)}),w=async o=>{let e=[],t=await m(o);for(;t.length>0;)e.push(...t),t=await m(o);return e},E=o=>new Promise((e,t)=>{o.file(i=>e(g(i,o.fullPath)),t)}),F=async o=>{let e=[],t=[];for(let i of o){if(i.kind!==\"file\")continue;let s=i.getAsEntry?i.getAsEntry():i.webkitGetAsEntry();t.push(s)}for(;t.length>0;){let i=t.shift();if(i)if(i.isFile){let s=await E(i);b.indexOf(s.name)===-1&&e.push(s)}else i.isDirectory&&t.push(...await w(i.createReader()));else continue}return e},f=async o=>{let e=[];for(let t of o)b.indexOf(t.name)===-1&&e.push(g(t));return e},l=async o=>o.dataTransfer?o.dataTransfer.items?await F(o.dataTransfer.items):await f(o.dataTransfer.files):await f(o.target.files);var n=\"files-dropzone\",v=\"TOO_MANY_FILES\",L=\"FILE_TOO_LARGE\",k=\"FILE_TOO_SMALL\",A=\"INVALID_MIME_TYPE\",z=document.createElement(\"template\"),S=`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;z.innerHTML=`\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;var d=class o extends HTMLElement{#t=null;#e=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(z.content.cloneNode(!0)),this.shadowRoot&&(this.#t=this.shadowRoot.getElementById(\"file-input\"),this.#e=this.shadowRoot.getElementById(\"dropzone\"))}static get observedAttributes(){return[\"accept\",\"disabled\",\"multiple\"]}attributeChangedCallback(e,t,i){e===\"accept\"&&t!==i&&this.#t&&(this.#t.accept=this.accept),e===\"disabled\"&&t!==i&&this.#t&&(this.#t.disabled=this.disabled,this.disabled?(this.#e?.removeAttribute(\"tabindex\"),this.#e?.setAttribute(\"aria-disabled\",\"true\")):(this.#e?.setAttribute(\"tabindex\",\"0\"),this.#e?.setAttribute(\"aria-disabled\",\"false\"))),e===\"multiple\"&&t!==i&&this.#t&&(this.#t.multiple=this.multiple)}connectedCallback(){this.#o(\"accept\"),this.#o(\"disabled\"),this.#o(\"maxFiles\"),this.#o(\"maxSize\"),this.#o(\"minSize\"),this.#o(\"multiple\"),this.#o(\"autoFocus\"),this.#o(\"noStyle\"),this.#t?.addEventListener(\"change\",this.#i),this.#e?.addEventListener(\"dragenter\",this.#r),this.#e?.addEventListener(\"dragover\",this.#s),this.#e?.addEventListener(\"dragleave\",this.#n),this.#e?.addEventListener(\"drop\",this.#a),this.#e?.addEventListener(\"click\",this.#d),this.#e?.addEventListener(\"keyup\",this.#l),this.autoFocus&&this.#e?.focus()}disconnectedCallback(){this.#t?.removeEventListener(\"change\",this.#i),this.#e?.removeEventListener(\"dragenter\",this.#r),this.#e?.removeEventListener(\"dragover\",this.#s),this.#e?.removeEventListener(\"dragleave\",this.#n),this.#e?.removeEventListener(\"drop\",this.#a),this.#e?.removeEventListener(\"click\",this.#d),this.#e?.removeEventListener(\"keyup\",this.#l)}get accept(){return this.getAttribute(\"accept\")||\"\"}set accept(e){this.setAttribute(\"accept\",e!=null?e.toString():e)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}get maxFiles(){let e=Number(this.getAttribute(\"max-files\"))||0;return e<=0?1/0:Math.floor(Math.abs(e))}set maxFiles(e){this.setAttribute(\"max-files\",e!=null?e.toString():e)}get maxSize(){let e=this.getAttribute(\"max-size\");if(e===null)return 1/0;let t=Number(e);return Number.isNaN(t)?1/0:t}set maxSize(e){this.setAttribute(\"max-size\",e!=null?e.toString():e)}get minSize(){let e=this.getAttribute(\"min-size\");if(e===null)return 0;let t=Number(e);return Number.isNaN(t)?0:t}set minSize(e){this.setAttribute(\"min-size\",e!=null?e.toString():e)}get multiple(){return this.hasAttribute(\"multiple\")}set multiple(e){this.toggleAttribute(\"multiple\",!!e)}get autoFocus(){return this.hasAttribute(\"auto-focus\")}set autoFocus(e){this.toggleAttribute(\"auto-focus\",!!e)}get noStyle(){return this.hasAttribute(\"no-style\")}set noStyle(e){this.toggleAttribute(\"no-style\",!!e)}#i=async e=>{try{this.#c(await l(e))}catch(t){this.dispatchEvent(new CustomEvent(`${n}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}};#r=()=>{this.disabled||this.dispatchEvent(new Event(`${n}-dragenter`,{bubbles:!0,composed:!0}))};#s=e=>{if(e.preventDefault(),this.disabled){e.dataTransfer.dropEffect=\"none\";return}e.dataTransfer.dropEffect=\"copy\",this.#e&&(this.#e.classList.add(\"dropzone--dragover\"),this.#e.part.add(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${n}-dragover`,{bubbles:!0,composed:!0}))};#n=()=>{this.disabled||(this.#e&&(this.#e.classList.remove(\"dropzone--dragover\"),this.#e.part.remove(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${n}-dragleave`,{bubbles:!0,composed:!0})))};#a=async e=>{if(!this.disabled){e.preventDefault(),this.#e&&(this.#e.classList.remove(\"dropzone--dragover\"),this.#e.part.remove(\"dropzone--dragover\"));try{this.#c(await l(e))}catch(t){this.dispatchEvent(new CustomEvent(`${n}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}};#d=()=>{this.disabled||this.#t?.click()};#l=e=>{this.disabled||(e.key===\" \"||e.key===\"Enter\")&&this.#t?.click()};#c(e){if(!Array.isArray(e)||!e.length)return;let t=[],i=[],s=e.length;if(!this.multiple&&s>1)for(let r of e)i.push({file:r,errors:[{code:v,message:\"Too many files selected. Only 1 file is allowed.\"}]});else if(this.multiple&&s>this.maxFiles)for(let r of e)i.push({file:r,errors:[{code:v,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?\"files are\":\"file is\"} allowed.`}]});else for(let r of e){let c=u(r,this.accept),p=r.size>this.maxSize,h=r.size0&&this.dispatchEvent(new CustomEvent(`${n}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:t}})),i.length>0&&this.dispatchEvent(new CustomEvent(`${n}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:i}})),this.#t&&(this.#t.value=this.#t.defaultValue)}openFileDialog(){this.disabled||this.#t?.click()}#o(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}static defineCustomElement(e=n){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,o)}};d.defineCustomElement();export{d as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","// @ts-check\n\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */\nexport function isValidFile(file, acceptedTypeSpecifiers = '') {\n if (!acceptedTypeSpecifiers) {\n return true;\n }\n\n const acceptedMimeTypesList = [\n ...new Set(\n acceptedTypeSpecifiers\n .split(',')\n .map(v => v.trim())\n .filter(Boolean)\n )\n ];\n\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, '');\n\n for (const validType of acceptedMimeTypesList) {\n if (validType.charAt(0) === '.') {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, '')) {\n return true;\n }\n } else {\n if (fileMimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n}\n","// @ts-check\n\n/**\n * A map of common file extensions and their associated MIME types.\n */\nconst COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['jxl', 'image/jxl'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['markdown', 'text/markdown'],\n ['md', 'text/markdown'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */\nconst toFileWithMimeType = file => {\n const { name } = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const extension = (name.split('.').pop() || '').toLowerCase();\n const type = COMMON_MIME_TYPES.get(extension);\n\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n};\n\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */\nconst toFileWithPath = (file, path) => {\n const fileWithMimeType = toFileWithMimeType(file);\n\n // @ts-ignore\n if (typeof fileWithMimeType.path !== 'string') {\n const { webkitRelativePath } = file;\n\n Object.defineProperty(fileWithMimeType, 'path', {\n value: typeof path === 'string' ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return fileWithMimeType;\n};\n\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readEntriesPromise = async directoryReader => {\n return await new Promise((resolve, reject) => {\n directoryReader.readEntries(resolve, reject);\n });\n};\n\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readAllDirectoryEntries = async directoryReader => {\n const entries = [];\n let readEntries = await readEntriesPromise(directoryReader);\n\n while (readEntries.length > 0) {\n entries.push(...readEntries);\n readEntries = await readEntriesPromise(directoryReader);\n }\n\n return entries;\n};\n\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */\nconst getFileFromFileEntry = fileEntry => {\n return new Promise((resolve, reject) => {\n fileEntry.file(file => resolve(toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromDataTransferItemList = async dataTransferItemList => {\n const files = [];\n\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n\n for (const item of dataTransferItemList) {\n if (item.kind !== 'file') {\n // Ignore non-file items, such as links.\n continue;\n }\n\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n\n queue.push(entry);\n }\n\n while (queue.length > 0) {\n const entry = queue.shift();\n\n if (!entry) {\n continue;\n } else if (entry.isFile) {\n const file = await getFileFromFileEntry(entry);\n\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(file);\n }\n } else if (entry.isDirectory) {\n queue.push(...(await readAllDirectoryEntries(entry.createReader())));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromFileList = async fileList => {\n const files = [];\n\n for (const file of fileList) {\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(toFileWithPath(file));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from an event.\n * This function supports both `drop` and `change` events.\n *\n * @param {*} evt - The event to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nexport const getFilesFromEvent = async evt => {\n if (evt.dataTransfer) {\n return evt.dataTransfer.items\n ? await getFilesFromDataTransferItemList(evt.dataTransfer.items)\n : await getFilesFromFileList(evt.dataTransfer.files);\n }\n\n return await getFilesFromFileList(evt.target.files);\n};\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nimport { isValidFile } from './utils/is-valid-file.js';\nimport { getFilesFromEvent } from './utils/files-selector.js';\n\nconst COMPONENT_NAME = 'files-dropzone';\nconst TOO_MANY_FILES = 'TOO_MANY_FILES';\nconst FILE_TOO_LARGE = 'FILE_TOO_LARGE';\nconst FILE_TOO_SMALL = 'FILE_TOO_SMALL';\nconst INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n user-select: none;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n\n \n\n
    \n Drag 'n' drop files here, or click to select files\n
    \n`;\n\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */\nclass FilesDropzone extends HTMLElement {\n /** @type {Nullable} */\n #fileInput = null;\n\n /** @type {Nullable} */\n #dropzoneEl = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */ (this.shadowRoot.getElementById('file-input'));\n this.#dropzoneEl = this.shadowRoot.getElementById('dropzone');\n }\n }\n\n static get observedAttributes() {\n return ['accept', 'disabled', 'multiple'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'accept' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.accept = this.accept;\n }\n\n if (name === 'disabled' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n\n if (this.disabled) {\n this.#dropzoneEl?.removeAttribute('tabindex');\n this.#dropzoneEl?.setAttribute('aria-disabled', 'true');\n } else {\n this.#dropzoneEl?.setAttribute('tabindex', '0');\n this.#dropzoneEl?.setAttribute('aria-disabled', 'false');\n }\n }\n\n if (name === 'multiple' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.multiple = this.multiple;\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('accept');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('maxFiles');\n this.#upgradeProperty('maxSize');\n this.#upgradeProperty('minSize');\n this.#upgradeProperty('multiple');\n this.#upgradeProperty('autoFocus');\n this.#upgradeProperty('noStyle');\n\n this.#fileInput?.addEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.addEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.addEventListener('click', this.#handleClick);\n this.#dropzoneEl?.addEventListener('keyup', this.#handleKeyUp);\n\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#fileInput?.removeEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.removeEventListener('click', this.#handleClick);\n this.#dropzoneEl?.removeEventListener('keyup', this.#handleKeyUp);\n }\n\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */\n get accept() {\n return this.getAttribute('accept') || '';\n }\n\n set accept(value) {\n this.setAttribute('accept', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */\n get maxFiles() {\n const num = Number(this.getAttribute('max-files')) || 0;\n\n if (num <= 0) {\n return Infinity;\n }\n\n return Math.floor(Math.abs(num));\n }\n\n set maxFiles(value) {\n this.setAttribute('max-files', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */\n get maxSize() {\n const value = this.getAttribute('max-size');\n\n if (value === null) {\n return Infinity;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? Infinity : num;\n }\n\n set maxSize(value) {\n this.setAttribute('max-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */\n get minSize() {\n const value = this.getAttribute('min-size');\n\n if (value === null) {\n return 0;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? 0 : num;\n }\n\n set minSize(value) {\n this.setAttribute('min-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */\n get multiple() {\n return this.hasAttribute('multiple');\n }\n\n set multiple(value) {\n this.toggleAttribute('multiple', !!value);\n }\n\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */\n get autoFocus() {\n return this.hasAttribute('auto-focus');\n }\n\n set autoFocus(value) {\n this.toggleAttribute('auto-focus', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */\n get noStyle() {\n return this.hasAttribute('no-style');\n }\n\n set noStyle(value) {\n this.toggleAttribute('no-style', !!value);\n }\n\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */\n #handleFileInputChange = async evt => {\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n };\n\n /**\n * Handles the dragenter event of the dropzone.\n */\n #handleDragEnter = () => {\n if (this.disabled) {\n return;\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDragOver = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n evt.dataTransfer.dropEffect = 'none';\n return;\n }\n\n evt.dataTransfer.dropEffect = 'copy';\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add('dropzone--dragover');\n this.#dropzoneEl.part.add('dropzone--dragover');\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the dragleave event of the dropzone.\n */\n #handleDragLeave = () => {\n if (this.disabled) {\n return;\n }\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n this.dispatchEvent(\n new Event(`${COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n })\n );\n };\n\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDrop = async evt => {\n if (this.disabled) {\n return;\n }\n\n evt.preventDefault();\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n };\n\n /**\n * Handles the click event of the dropzone.\n */\n #handleClick = () => {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n };\n\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleKeyUp = evt => {\n if (this.disabled) {\n return;\n }\n\n if (evt.key === ' ' || evt.key === 'Enter') {\n this.#fileInput?.click();\n }\n };\n\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */\n #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) {\n return;\n }\n\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) {\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [\n {\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }\n ]\n });\n }\n } else if (this.multiple && filesLength > this.maxFiles) {\n // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [\n {\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? 'files are' : 'file is'} allowed.`\n }\n ]\n });\n }\n } else {\n // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files) {\n const fileHasValidType = isValidFile(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) {\n acceptedFiles.push(file);\n } else {\n const errors = [];\n\n if (!fileHasValidType) {\n errors.push({\n code: INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n }\n\n if (fileExceedsMaxSize) {\n errors.push({\n code: FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n }\n\n if (fileIsSmallerThanMinSize) {\n errors.push({\n code: FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n }\n\n rejectedFiles.push({ file, errors });\n }\n }\n }\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles,\n rejectedFiles\n }\n })\n );\n\n if (acceptedFiles.length > 0) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles\n }\n })\n );\n }\n\n if (rejectedFiles.length > 0) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles\n }\n })\n );\n }\n\n if (this.#fileInput) {\n this.#fileInput.value = this.#fileInput.defaultValue;\n }\n }\n\n /**\n * Opens the file dialog programmatically.\n */\n openFileDialog() {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, FilesDropzone);\n }\n }\n}\n\nexport { FilesDropzone };\n","import { FilesDropzone } from './files-dropzone.js';\n\nFilesDropzone.defineCustomElement();\n\nexport { FilesDropzone };\n","/*!\n * @georapbox/resize-observer-element\n * A custom element that offers a declarative interface to the ResizeObserver API.\n *\n * @version 2.0.1\n * @homepage https://github.com/georapbox/resize-observer-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar d=\":host { display: contents; }\",o=document.createElement(\"template\");o.innerHTML=`\n \n \n`;var s=class n extends HTMLElement{#e=null;#t=null;#s=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(o.content.cloneNode(!0)),this.#e=this.shadowRoot?.querySelector(\"slot\")??null}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(e,t,i){e===\"disabled\"&&t!==i&&(this.disabled?this.#o():this.#i())}connectedCallback(){this.#d(\"disabled\"),\"ResizeObserver\"in window&&(this.#t=new ResizeObserver(e=>{this.dispatchEvent(new CustomEvent(\"resize-observer:resize\",{bubbles:!0,composed:!0,detail:{entries:e}}))}),this.disabled||this.#i(),this.#e?.addEventListener(\"slotchange\",this.#n))}disconnectedCallback(){this.#o(),this.#e?.removeEventListener(\"slotchange\",this.#n)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}#i(){!this.#e||!this.#t||(this.#s.forEach(e=>this.#t?.unobserve(e)),this.#s=[],this.#e.assignedElements().forEach(e=>{this.#t?.observe(e),this.#s.push(e)}))}#o(){this.#t?.disconnect()}#n=()=>{this.disabled||this.#i()};#d(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}static defineCustomElement(e=\"resize-observer\"){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,n)}};s.defineCustomElement();export{s as ResizeObserverElement};\n//# sourceMappingURL=resize-observer-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst styles = /* css */ `:host { display: contents; }`;\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that offers a declarative interface to the ResizeObserver API.\n * @documentation https://github.com/georapbox/resize-observer-element#readme\n *\n * @tagname resize-observer - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Whether the resize observer is disabled.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n *\n * @slot - The default slot where the elements to observe are placed.\n *\n * @event resize-observer:resize - Dispatched when the observed elements are resized.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n */\nclass ResizeObserverElement extends HTMLElement {\n /** @type {Nullable} */\n #slotEl = null;\n\n /** @type {Nullable} */\n #resizeObserver = null;\n\n /** @type {Element[]} */\n #observedElements = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#slotEl = this.shadowRoot?.querySelector('slot') ?? null;\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue) {\n this.disabled ? this.#stopObserver() : this.#startObserver();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('disabled');\n\n if ('ResizeObserver' in window) {\n this.#resizeObserver = new ResizeObserver(entries => {\n this.dispatchEvent(\n new CustomEvent('resize-observer:resize', {\n bubbles: true,\n composed: true,\n detail: { entries }\n })\n );\n });\n\n if (!this.disabled) {\n this.#startObserver();\n }\n\n this.#slotEl?.addEventListener('slotchange', this.#handleSlotChange);\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#stopObserver();\n this.#slotEl?.removeEventListener('slotchange', this.#handleSlotChange);\n }\n\n /**\n * @type {boolean} - Whether the resize observer is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * Starts observing the elements in the slot.\n */\n #startObserver() {\n if (!this.#slotEl || !this.#resizeObserver) {\n return;\n }\n\n this.#observedElements.forEach(el => this.#resizeObserver?.unobserve(el));\n this.#observedElements = [];\n\n this.#slotEl.assignedElements().forEach(el => {\n this.#resizeObserver?.observe(el);\n this.#observedElements.push(el);\n });\n }\n\n /**\n * Stops observing the elements in the slot.\n */\n #stopObserver() {\n this.#resizeObserver?.disconnect();\n }\n\n /**\n * Handles slot change event.\n */\n #handleSlotChange = () => {\n if (!this.disabled) {\n this.#startObserver();\n }\n };\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='resize-observer'] - The name of the custom element.\n * @example\n *\n * ResizeObserverElement.defineCustomElement('my-resize-observer');\n */\n static defineCustomElement(elementName = 'resize-observer') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ResizeObserverElement);\n }\n }\n}\n\nexport { ResizeObserverElement };\n","import { ResizeObserverElement } from './resize-observer.js';\n\nResizeObserverElement.defineCustomElement();\n\nexport { ResizeObserverElement };\n","/*!\n * @georapbox/modal-element\n * A custom element to create a modal, using the native dialog element under the hood.\n *\n * @version 1.8.0\n * @homepage https://github.com/georapbox/modal-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar n=document.createElement(\"template\"),r=`\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: 300ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;n.innerHTML=`\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;var a=class s extends HTMLElement{#e=null;#i=null;#a=null;#o=void 0;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(n.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.querySelector(\"dialog\"),this.#i=this.shadowRoot.querySelector('slot[name=\"footer\"]'),this.#a=this.shadowRoot.querySelector('slot[name=\"close\"]'))}static get observedAttributes(){return[\"open\",\"no-header\",\"no-animations\",\"no-close-button\",\"close-label\"]}attributeChangedCallback(e,t,i){if(this.#e!==null){if(e===\"open\"&&t!==i&&(this.open?(this.#e.showModal(),this.dispatchEvent(new CustomEvent(\"me-open\",{bubbles:!0,composed:!0,detail:{element:this}})),document.body&&!this.preserveOverflow&&(document.body.style.overflow=\"hidden\")):this.#e.close()),e===\"no-header\"&&t!==i){let o=this.#e.querySelector(\".dialog__header\");o!==null&&(o.hidden=this.noHeader)}if(e===\"no-animations\"&&t!==i&&this.#e.classList.toggle(\"dialog--no-animations\",this.noAnimations),e===\"no-close-button\"&&t!==i){let o=this.#e.querySelector(\".dialog__close\");o!==null&&(o.hidden=this.noCloseButton)}e===\"close-label\"&&t!==i&&this.#r()}}connectedCallback(){this.#t(\"open\"),this.#t(\"staticBackdrop\"),this.#t(\"noHeader\"),this.#t(\"noAnimations\"),this.#t(\"noCloseButton\"),this.#t(\"fullscreen\"),this.#t(\"preserveOverflow\"),this.#t(\"placement\"),this.#t(\"closeLabel\"),this.#e?.addEventListener(\"click\",this.#h),this.#e?.addEventListener(\"close\",this.#l),this.#e?.addEventListener(\"cancel\",this.#d),this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\",this.#c),this.#i?.addEventListener(\"slotchange\",this.#m),this.#a?.addEventListener(\"slotchange\",this.#g)}disconnectedCallback(){this.#o&&clearTimeout(this.#o),this.#e?.addEventListener(\"click\",this.#h),this.#e?.removeEventListener(\"close\",this.#l),this.#e?.removeEventListener(\"cancel\",this.#d),this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\",this.#c),this.#i?.removeEventListener(\"slotchange\",this.#m),this.#a?.removeEventListener(\"slotchange\",this.#g)}get open(){return this.hasAttribute(\"open\")}set open(e){this.toggleAttribute(\"open\",!!e)}get staticBackdrop(){return this.hasAttribute(\"static-backdrop\")}set staticBackdrop(e){this.toggleAttribute(\"static-backdrop\",!!e)}get noHeader(){return this.hasAttribute(\"no-header\")}set noHeader(e){this.toggleAttribute(\"no-header\",!!e)}get noAnimations(){return this.hasAttribute(\"no-animations\")}set noAnimations(e){this.toggleAttribute(\"no-animations\",!!e)}get noCloseButton(){return this.hasAttribute(\"no-close-button\")}set noCloseButton(e){this.toggleAttribute(\"no-close-button\",!!e)}get fullscreen(){return this.hasAttribute(\"fullscreen\")}set fullscreen(e){this.toggleAttribute(\"fullscreen\",!!e)}get preserveOverflow(){return this.hasAttribute(\"preserve-overflow\")}set preserveOverflow(e){this.toggleAttribute(\"preserve-overflow\",!!e)}get placement(){return this.getAttribute(\"placement\")||\"center\"}set placement(e){this.setAttribute(\"placement\",e!=null?e.toString():e)}get closeLabel(){return this.getAttribute(\"close-label\")||\"Close\"}set closeLabel(e){this.setAttribute(\"close-label\",e!=null?e.toString():e)}#r(){if(this.#e===null)return;let e=this.#e.querySelector(\".dialog__close\");if(e===null)return;(this.#a?.assignedElements()||[])?.some(o=>o.textContent?.replace(/\\s/g,\"\")!==\"\")?e.removeAttribute(\"aria-label\"):e.setAttribute(\"aria-label\",this.closeLabel)}#n(){this.#o||(this.#e?.classList.add(\"dialog--pulse\"),this.#o=setTimeout(()=>{this.#e?.classList.remove(\"dialog--pulse\"),clearTimeout(this.#o),this.#o=void 0},300))}#l=()=>{this.open=!1,this.dispatchEvent(new CustomEvent(\"me-close\",{bubbles:!0,composed:!0,detail:{element:this}})),document.body&&!this.preserveOverflow&&(document.body.style.overflow=\"\")};#d=e=>{let t=this.#s(\"escape-key\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),!this.noAnimations&&this.#n())};#c=e=>{let t=this.#s(\"close-button\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),!this.noAnimations&&this.#n())};#h=e=>{let t=e.target,i=e.currentTarget;if(t===i){let o=this.#s(\"backdrop-click\");this.dispatchEvent(o),o.defaultPrevented||this.staticBackdrop?!this.noAnimations&&this.#n():this.hide()}if(t instanceof HTMLElement&&t.closest(\"[data-me-close]\")!==null){let o=this.#s(\"external-invoker\");this.dispatchEvent(o),o.defaultPrevented?!this.noAnimations&&this.#n():this.hide()}};#m=()=>{if(this.#e===null)return;let e=this.#e.querySelector(\".dialog__footer\");if(e===null)return;let t=this.#i?.assignedNodes(),i=t?t.length>0:!1;e.hidden=!i};#g=()=>{this.#r()};#s(e){return new CustomEvent(\"me-request-close\",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,element:this}})}#t(e){let t=this;if(Object.prototype.hasOwnProperty.call(t,e)){let i=t[e];delete t[e],t[e]=i}}show(){this.open||(this.open=!0)}hide(){this.open&&(this.open=!1)}static defineCustomElement(e=\"modal-element\"){typeof window<\"u\"&&!window.customElements.get(e)&&window.customElements.define(e,s)}};a.defineCustomElement();export{a as ModalElement};\n//# sourceMappingURL=modal-element-defined.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Available values for the request close reason.\n *\n * @typedef {'close-button' | 'escape-key' | 'backdrop-click' | 'external-invoker'} CloseRequestReason\n */\n\nconst PULSE_ANIMATION_DURATION = 300; // milliseconds\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n :host {\n --me-width: 32rem;\n --me-height: fit-content;\n --me-border-color: initial;\n --me-border-style: solid;\n --me-border-width: initial;\n --me-border-radius: 0;\n --me-box-shadow: none;\n --me-background-color: canvas;\n --me-color: canvastext;\n\n --me-header-spacing: 1rem;\n --me-footer-spacing: 1rem;\n --me-header-background-color: transparent;\n --me-header-color: initial;\n\n --me-body-spacing: 1rem;\n --me-body-background-color: transparent;\n --me-body-color: initial;\n --me-footer-background-color: transparent;\n --me-footer-color: initial;\n\n --me-close-padding: 0.4375rem;\n --me-close-border: none;\n --me-close-border-radius: 0;\n --me-close-background-color: transparent;\n --me-close-color: inherit;\n --me-close-font-size: 1rem;\n\n --me-backdrop-background: rgba(0, 0, 0, 0.5);\n --me-backdrop-filter: none;\n\n display: contents;\n box-sizing: border-box;\n }\n\n :host *,\n :host *:after,\n :host *:before {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n /* Dialog */\n .dialog {\n --dialog-placement-margin: calc((2em + 6px) / 2);\n\n width: var(--me-width);\n height: var(--me-height);\n padding: 0;\n border-color: var(--me-border-color);\n border-style: var(--me-border-style);\n border-width: var(--me-border-width);\n border-radius: var(--me-border-radius);\n box-shadow: var(--me-box-shadow);\n background-color: var(--me-background-color);\n color: var(--me-color);\n }\n\n .dialog[open] {\n display: flex;\n }\n\n :host([fullscreen]) .dialog {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n }\n\n .dialog::backdrop {\n background: var(--me-backdrop-background, rgba(0, 0, 0, 0.5));\n backdrop-filter: var(--me-backdrop-filter, none);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 1;\n }\n\n /* Dialog placement */\n :host(:not([fullscreen])[placement=\"top-start\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-center\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"top-end\"]) .dialog {\n margin-block-start: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center-start\"]) .dialog {\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"center\"]) .dialog {\n margin: auto;\n }\n\n :host(:not([fullscreen])[placement=\"center-end\"]) .dialog {\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-start\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-start: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-center\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n }\n\n :host(:not([fullscreen])[placement=\"bottom-end\"]) .dialog {\n margin-block-end: var(--dialog-placement-margin);\n margin-inline-end: var(--dialog-placement-margin);\n }\n\n /* Dialog animations */\n @media (prefers-reduced-motion: no-preference) {\n .dialog:not(.dialog--no-animations),\n .dialog:not(.dialog--no-animations)::backdrop {\n transition: transform 0.3s, opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;\n }\n\n /* 1. IS-OPEN STATE */\n .dialog[open] {\n transform: scale(1);\n opacity: 1;\n }\n\n /* 2. EXIT STATE */\n .dialog {\n transform: scale(0.95);\n opacity: 0;\n }\n\n /* 0. BEFORE-OPEN STATE */\n @starting-style {\n .dialog[open] {\n transform: scale(0.95);\n opacity: 0;\n }\n\n .dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n .dialog--pulse:not(.dialog--no-animations) {\n animation-name: pulse;\n animation-duration: ${PULSE_ANIMATION_DURATION}ms;\n animation-timing-function: cubic-bezier(0.2, 0, 0.38, 0.9);\n }\n\n @keyframes pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.02); }\n 100% { transform: scale(1); }\n }\n }\n\n /* Dialog panel, header, body, footer */\n .dialog__panel {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n width: 100%;\n }\n\n .dialog__header {\n display: flex;\n align-items: center;\n padding: var(--me-header-spacing);\n column-gap: 0.5rem;\n background-color: var(--me-header-background-color);\n color: var(--me-header-color);\n }\n\n :host([no-close-button]) .dialog__header {\n column-gap: 0;\n }\n\n .dialog__title {\n display: block;\n flex: 1 1 auto;\n padding: 0;\n margin: 0;\n }\n\n .dialog__body {\n display: block;\n flex: 1 1 auto;\n padding: var(--me-body-spacing);\n overflow: auto;\n background-color: var(--me-body-background-color);\n color: var(--me-body-color);\n overscroll-behavior: contain;\n }\n\n .dialog__footer {\n flex: 0 0 auto;\n text-align: end;\n padding: var(--me-footer-spacing);\n background-color: var(--me-footer-background-color);\n color: var(--me-footer-color);\n }\n\n .dialog__close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: var(--me-close-padding);\n border: var(--me-close-border);\n border-radius: var(--me-close-border-radius);\n background-color: var(--me-close-background-color);\n color: var(--me-close-color);\n font-size: var(--me-close-font-size);\n }\n\n .dialog__close:not(:disabled) {\n cursor: pointer;\n }\n\n .dialog__close:disabled {\n cursor: not-allowed;\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n\n \n
    \n
    \n \n\n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n
    \n`;\n\n/**\n * @summary A custom element that renders a modal dialog.\n * @documentation https://github.com/georapbox/modal-element\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines whether the modal is open or not.\n * @property {boolean} staticBackdrop - Determines whether the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines whether the modal should have a header or not.\n * @property {boolean} noAnimations - Determines whether the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines whether the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines whether the modal should be fullscreen or not.\n * @property {boolean} preserveOverflow - Determines whether the overflow of the body should be preserved when the modal is open.\n * @property {string} placement - Determines the placement of the modal.\n * @property {string} closeLabel - The label of the default close button, used as the aria-label attribute of the close button.\n *\n * @attribute {boolean} open - Reflects the open property.\n * @attribute {boolean} static-backdrop - Reflects the staticBackdrop property.\n * @attribute {boolean} no-header - Reflects the noHeader property.\n * @attribute {boolean} no-animations - Reflects the noAnimations property.\n * @attribute {boolean} no-close-button - Reflects the noCloseButton property.\n * @attribute {boolean} fullscreen - Reflects the fullscreen property.\n * @attribute {boolean} preserve-overflow - Reflects the preserveOverflow property.\n * @attribute {string} placement - Reflects the placement property.\n * @attribute {string} close-label - Reflects the closeLabel property.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal.\n * @cssproperty --me-height - The height of the modal.\n * @cssproperty --me-border-color - The border color of the modal.\n * @cssproperty --me-border-style - The border style of the modal.\n * @cssproperty --me-border-width - The border width of the modal.\n * @cssproperty --me-border-radius - The border radius of the modal.\n * @cssproperty --me-box-shadow - The box shadow of the modal.\n * @cssproperty --me-background-color - The background color of the modal.\n * @cssproperty --me-color - The foreground color of the modal.\n * @cssproperty --me-header-spacing - The spacing of the header.\n * @cssproperty --me-header-background-color - The background color of the header.\n * @cssproperty --me-header-color - The foreground color of the header.\n * @cssproperty --me-body-spacing - The spacing of the body.\n * @cssproperty --me-body-background-color - The background color of the body.\n * @cssproperty --me-body-color - The foreground color of the body.\n * @cssproperty --me-footer-spacing - The spacing of the footer.\n * @cssproperty --me-footer-background-color - The background color of the footer.\n * @cssproperty --me-footer-color - The foreground color of the footer.\n * @cssproperty --me-close-padding - The padding of the close button.\n * @cssproperty --me-close-border - The border shorthand property of the close button.\n * @cssproperty --me-close-border-radius - The border radius shorthand property of the close button.\n * @cssproperty --me-close-background-color - The background color of the close button.\n * @cssproperty --me-close-color - The foreground color of the close button.\n * @cssproperty --me-close-font-size - The font size of the close button.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop.\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart close - The default close button rendered in the modal's header.\n * @csspart close-icon - The close icon of the default close button.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n */\nclass ModalElement extends HTMLElement {\n /** @type {Nullable} */\n #dialogEl = null;\n\n /** @type {Nullable} */\n #footerSlotEl = null;\n\n /** @type {Nullable} */\n #closeSlotEl = null;\n\n /** @type {ReturnType | undefined} */\n #pulseAnimationTimeout = void 0;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector('dialog');\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n this.#closeSlotEl = this.shadowRoot.querySelector('slot[name=\"close\"]');\n }\n }\n\n static get observedAttributes() {\n return ['open', 'no-header', 'no-animations', 'no-close-button', 'close-label'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) {\n return;\n }\n\n if (name === 'open' && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n\n this.dispatchEvent(\n new CustomEvent('me-open', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n })\n );\n\n if (document.body && !this.preserveOverflow) {\n document.body.style.overflow = 'hidden';\n }\n } else {\n this.#dialogEl.close();\n }\n }\n\n if (name === 'no-header' && oldValue !== newValue) {\n /** @type {Nullable} */\n const headerEl = this.#dialogEl.querySelector('.dialog__header');\n\n if (headerEl !== null) {\n headerEl.hidden = this.noHeader;\n }\n }\n\n if (name === 'no-animations' && oldValue !== newValue) {\n this.#dialogEl.classList.toggle('dialog--no-animations', this.noAnimations);\n }\n\n if (name === 'no-close-button' && oldValue !== newValue) {\n /** @type {Nullable} */\n const closeBtnEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeBtnEl !== null) {\n closeBtnEl.hidden = this.noCloseButton;\n }\n }\n\n if (name === 'close-label' && oldValue !== newValue) {\n this.#updateCloseLabel();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('open');\n this.#upgradeProperty('staticBackdrop');\n this.#upgradeProperty('noHeader');\n this.#upgradeProperty('noAnimations');\n this.#upgradeProperty('noCloseButton');\n this.#upgradeProperty('fullscreen');\n this.#upgradeProperty('preserveOverflow');\n this.#upgradeProperty('placement');\n this.#upgradeProperty('closeLabel');\n\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.addEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.addEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener('slotchange', this.#handleFooterSlotChange);\n this.#closeSlotEl?.addEventListener('slotchange', this.#handleCloseSlotChange);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.removeEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.removeEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener('slotchange', this.#handleFooterSlotChange);\n this.#closeSlotEl?.removeEventListener('slotchange', this.#handleCloseSlotChange);\n }\n\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */\n get open() {\n return this.hasAttribute('open');\n }\n\n set open(value) {\n this.toggleAttribute('open', !!value);\n }\n\n /**\n * Determines whether the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */\n get staticBackdrop() {\n return this.hasAttribute('static-backdrop');\n }\n\n set staticBackdrop(value) {\n this.toggleAttribute('static-backdrop', !!value);\n }\n\n /**\n * Determines whether the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */\n get noHeader() {\n return this.hasAttribute('no-header');\n }\n\n set noHeader(value) {\n this.toggleAttribute('no-header', !!value);\n }\n\n /**\n * Determines whether the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */\n get noAnimations() {\n return this.hasAttribute('no-animations');\n }\n\n set noAnimations(value) {\n this.toggleAttribute('no-animations', !!value);\n }\n\n /**\n * Determines whether the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */\n get noCloseButton() {\n return this.hasAttribute('no-close-button');\n }\n\n set noCloseButton(value) {\n this.toggleAttribute('no-close-button', !!value);\n }\n\n /**\n * Determines whether the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */\n get fullscreen() {\n return this.hasAttribute('fullscreen');\n }\n\n set fullscreen(value) {\n this.toggleAttribute('fullscreen', !!value);\n }\n\n /**\n * Determines whether the overflow of the body should be preserved when the modal is open.\n *\n * @type {boolean} - True if the overflow of the body should be preserved, otherwise false.\n * @default false\n * @attribute preserve-overflow - Reflects the preserveOverflow property.\n */\n get preserveOverflow() {\n return this.hasAttribute('preserve-overflow');\n }\n\n set preserveOverflow(value) {\n this.toggleAttribute('preserve-overflow', !!value);\n }\n\n /**\n * Determines the placement of the modal.\n * Possible values are 'top-start', 'top-center', 'top-end', 'center-start', 'center', 'center-end', 'bottom-start', 'bottom-center', 'bottom-end'.\n *\n * @type {string}\n * @default 'center'\n * @attribute placement - Reflects the placement property.\n */\n get placement() {\n return this.getAttribute('placement') || 'center';\n }\n\n set placement(value) {\n this.setAttribute('placement', value != null ? value.toString() : value);\n }\n\n /**\n * The label of the default close button, used as the aria-label attribute of the close button.\n * If user provides text content for the close button using the `close` slot, this property is ignored and the aria-label attribute is removed.\n *\n * @type {string}\n * @default 'Close'\n * @attribute close-label - Reflects the closeLabel property.\n */\n get closeLabel() {\n return this.getAttribute('close-label') || 'Close';\n }\n\n set closeLabel(value) {\n this.setAttribute('close-label', value != null ? value.toString() : value);\n }\n\n /**\n * Updates the aria-label attribute of the close button.\n * If the slot for the close button has text content, the aria-label attribute is removed to allow the text content to be used as the label.\n * Otherwise, the aria-label attribute is set to the `closeLabel` property.\n *\n * @returns\n */\n #updateCloseLabel() {\n if (this.#dialogEl === null) {\n return;\n }\n\n const closeButtonEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeButtonEl === null) {\n return;\n }\n\n const assignedElements = this.#closeSlotEl?.assignedElements() || [];\n const hasTextContent = assignedElements?.some(el => el.textContent?.replace(/\\s/g, '') !== '');\n\n hasTextContent\n ? closeButtonEl.removeAttribute('aria-label')\n : closeButtonEl.setAttribute('aria-label', this.closeLabel);\n }\n\n /**\n * Applies a pulse effect on the dialog.\n */\n #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) {\n return;\n }\n\n this.#dialogEl?.classList.add('dialog--pulse');\n\n this.#pulseAnimationTimeout = setTimeout(() => {\n this.#dialogEl?.classList.remove('dialog--pulse');\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, PULSE_ANIMATION_DURATION);\n }\n\n /**\n * Handles the close event of the dialog.\n */\n #handleDialogClose = () => {\n // This is required because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n\n this.dispatchEvent(\n new CustomEvent('me-close', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n })\n );\n\n if (document.body && !this.preserveOverflow) {\n document.body.style.overflow = '';\n }\n };\n\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */\n #handleDialogCancel = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('escape-key');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('close-button');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleDialogClick = evt => {\n const target = evt.target;\n const currentTarget = evt.currentTarget;\n\n // Close the dialog when the backdrop is clicked.\n if (target === currentTarget) {\n const requestCloseEvent = this.#createRequestCloseEvent('backdrop-click');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n } else {\n this.hide();\n }\n }\n\n // Close the dialog when external invoker is clicked.\n if (target instanceof HTMLElement && target.closest('[data-me-close]') !== null) {\n const requestCloseEvent = this.#createRequestCloseEvent('external-invoker');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n } else {\n this.hide();\n }\n }\n };\n\n /**\n * Handles the slotchange event of the footer slot.\n */\n #handleFooterSlotChange = () => {\n if (this.#dialogEl === null) {\n return;\n }\n\n /** @type {Nullable} */\n const footerEl = this.#dialogEl.querySelector('.dialog__footer');\n\n if (footerEl === null) {\n return;\n }\n\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n\n footerEl.hidden = !hasFooterSlotNodes;\n };\n\n /**\n * Handles the slotchange event of the close slot.\n */\n #handleCloseSlotChange = () => {\n this.#updateCloseLabel();\n };\n\n /**\n * Creates a request close event.\n *\n * @param {CloseRequestReason} reason - The reason that the modal is about to close.\n */\n #createRequestCloseEvent(reason) {\n return new CustomEvent('me-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason,\n element: this\n }\n });\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen' | 'preserveOverflow' | 'placement' | 'closeLabel'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */\n show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n }\n\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */\n hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */\n static defineCustomElement(elementName = 'modal-element') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ModalElement);\n }\n }\n}\n\nexport { ModalElement };\n","import { ModalElement } from './modal-element.js';\n\nModalElement.defineCustomElement();\n\nexport { ModalElement };\n","export const EXPERIMENTAL_FLAG = 'experimental';\n\nexport const NO_BARCODE_DETECTED = 'No barcode detected';\n\nexport const ACCEPTED_MIME_TYPES = [\n 'image/jpg',\n 'image/jpeg',\n 'image/png',\n 'image/apng',\n 'image/gif',\n 'image/webp',\n 'image/avif'\n];\n","import { set, get } from 'idb-keyval';\n\nconst STORAGE_PREFIX = 'barcode-scanner/';\nconst SETTINGS_STORAGE_KEY = 'settings';\nconst HISTORY_STORAGE_KEY = 'history';\n\n/**\n * Gets an item from the storage.\n *\n * @param {string} key - The key to get the item from.\n * @returns {Promise<[ error: any, value: any ]>} The item and an error if occurred.\n */\nconst getItem = async key => {\n try {\n return [null, await get(key)];\n } catch (error) {\n return [error, void 0];\n }\n};\n\n/**\n * Sets an item in the storage.\n *\n * @param {string} key - The key to set the item to.\n * @param {any} data - The data to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nconst setItem = async (key, data) => {\n try {\n await set(key, data);\n\n return [null];\n } catch (error) {\n return [error];\n }\n};\n\n/**\n * Gets the settings from the storage.\n *\n * @returns {Promise<[ error: any, value: any ]>} The settings and an error if occurred.\n */\nexport const getSettings = async () => {\n return getItem(STORAGE_PREFIX + SETTINGS_STORAGE_KEY);\n};\n\n/**\n * Sets the settings in the storage.\n *\n * @param {any} data - The settings to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nexport const setSettings = async data => {\n return setItem(STORAGE_PREFIX + SETTINGS_STORAGE_KEY, data);\n};\n\n/**\n * Gets the history from the storage.\n *\n * @returns {Promise<[ error: any, value: any ]>} The history and an error if occurred.\n */\nexport const getHistory = async () => {\n return getItem(STORAGE_PREFIX + HISTORY_STORAGE_KEY);\n};\n\n/**\n * Sets the history in the storage.\n *\n * @param {any} data - The history to set.\n * @returns {Promise<[ error: any ]>} An error if occurred.\n */\nexport const setHistory = async data => {\n return setItem(STORAGE_PREFIX + HISTORY_STORAGE_KEY, data);\n};\n","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction promisifyRequest(request) {\n return new Promise(function (resolve, reject) {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = function () {\n return resolve(request.result);\n }; // @ts-ignore - file size hacks\n\n\n request.onabort = request.onerror = function () {\n return reject(request.error);\n };\n });\n}\n\nfunction createStore(dbName, storeName) {\n var request = indexedDB.open(dbName);\n\n request.onupgradeneeded = function () {\n return request.result.createObjectStore(storeName);\n };\n\n var dbp = promisifyRequest(request);\n return function (txMode, callback) {\n return dbp.then(function (db) {\n return callback(db.transaction(storeName, txMode).objectStore(storeName));\n });\n };\n}\n\nvar defaultGetStoreFunc;\n\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction get(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readonly', function (store) {\n return promisifyRequest(store.get(key));\n });\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction set(key, value) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction setMany(entries) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n entries.forEach(function (entry) {\n return store.put(entry[1], entry[0]);\n });\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction getMany(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readonly', function (store) {\n return Promise.all(keys.map(function (key) {\n return promisifyRequest(store.get(key));\n }));\n });\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction update(key, updater) {\n var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();\n return customStore('readwrite', function (store) {\n return (// Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise(function (resolve, reject) {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n } catch (err) {\n reject(err);\n }\n };\n })\n );\n });\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction del(key) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction delMany(keys) {\n var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();\n return customStore('readwrite', function (store) {\n keys.forEach(function (key) {\n return store.delete(key);\n });\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction clear() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readwrite', function (store) {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\n\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result) return;\n callback(this.result);\n this.result.continue();\n };\n\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction keys() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n\n var items = [];\n return eachCursor(store, function (cursor) {\n return items.push(cursor.key);\n }).then(function () {\n return items;\n });\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction values() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n\n var items = [];\n return eachCursor(store, function (cursor) {\n return items.push(cursor.value);\n }).then(function () {\n return items;\n });\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\n\n\nfunction entries() {\n var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore();\n return customStore('readonly', function (store) {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([promisifyRequest(store.getAllKeys()), promisifyRequest(store.getAll())]).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n keys = _ref2[0],\n values = _ref2[1];\n\n return keys.map(function (key, i) {\n return [key, values[i]];\n });\n });\n }\n\n var items = [];\n return customStore('readonly', function (store) {\n return eachCursor(store, function (cursor) {\n return items.push([cursor.key, cursor.value]);\n }).then(function () {\n return items;\n });\n });\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * 'n' milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n *\n * @param {function} fn The function to be executed.\n * @param {Number} [wait=0] Time of delay in milliseconds. It is required if `immediate` is used.\n * @param {Boolean} [immediate=false] If true or any truthy value, triggers the function on the leading edge.\n * @throws {TypeError} If `fn` is not function.\n * @returns {function} A new debounced function.\n * @example\n *\n * const debouncedHandler = debounce(() => {\n * // Do your thing here...\n * }, 250);\n *\n * window.addEventListener('resize', debouncedHandler, false);\n */\nconst debounce = (fn, wait = 0, immediate = false) => {\n let timerId = null;\n\n if (typeof fn !== 'function') {\n throw new TypeError('Expected a function for first argument');\n }\n\n return (...args) => {\n clearTimeout(timerId);\n\n if (immediate && !timerId) {\n fn(...args);\n }\n\n timerId = setTimeout(() => {\n timerId = null;\n if (!immediate) {\n fn(...args);\n }\n }, wait);\n };\n};\n\nexport { debounce };\n","/**\n * Log to console only in development mode.\n *\n * @param {...any} args - Arguments to log\n */\nexport function log(...args) {\n process.env.NODE_ENV === 'development' && console.log(...args);\n}\n","/**\n * Check if the dialog element is supported.\n *\n * @returns {boolean} - Returns true if the dialog element is supported.\n */\nexport const isDialogElementSupported = () => {\n return typeof HTMLDialogElement === 'function';\n};\n","/**\n * Renders the supported formats.\n *\n * @param {Array} formats - Supported barcode formats\n */\nexport function renderSupportedFormats(formats) {\n if (!Array.isArray(formats) || formats.length === 0) {\n return;\n }\n\n const supportedFormatsEl = document.getElementById('supportedFormats');\n\n if (!supportedFormatsEl) {\n return;\n }\n\n supportedFormatsEl.textContent = `Supported formats: ${formats.join(', ')}`;\n}\n","import { getHistory, setHistory, getSettings } from '../services/storage.js';\n\n/**\n * Renders the history list. If there are no items in history, it will show a message.\n *\n * @param {Array} data - Hidsoty data as an array of strings\n */\nexport function renderHistoryList(data) {\n const historyList = document.getElementById('historyList');\n\n if (!historyList) {\n return;\n }\n\n const emptyHistoryBtn = document.getElementById('emptyHistoryBtn');\n\n historyList.replaceChildren();\n\n if (!Array.isArray(data) || data.length === 0) {\n historyList.innerHTML = '
  • There are no saved items in history.
  • ';\n emptyHistoryBtn.hidden = true;\n } else {\n emptyHistoryBtn.hidden = false;\n\n data.forEach((item, index) => {\n const li = document.createElement('li');\n li.setAttribute('data-value', item);\n\n let historyItem;\n\n try {\n new URL(item);\n historyItem = document.createElement('a');\n historyItem.href = item;\n historyItem.setAttribute('target', '_blank');\n historyItem.setAttribute('rel', 'noreferrer noopener');\n } catch {\n historyItem = document.createElement('span');\n }\n\n historyItem.textContent = item;\n historyItem.setAttribute('id', `historyItem-${index}`);\n\n const actionsEl = document.createElement('div');\n actionsEl.className = 'history-modal__actions';\n\n const copyBtn = document.createElement('custom-clipboard-copy');\n copyBtn.setAttribute('id', `copyHistoryItem-${index}`);\n copyBtn.setAttribute('aria-label', 'Copy to clipboard');\n copyBtn.setAttribute('aria-labelledby', `copyHistoryItem-${index} historyItem-${index}`);\n copyBtn.setAttribute('only-icon', '');\n copyBtn.setAttribute('value', item);\n actionsEl.appendChild(copyBtn);\n\n const removeBtn = document.createElement('button');\n removeBtn.type = 'button';\n removeBtn.className = 'history-modal__delete-action';\n removeBtn.setAttribute('data-action', 'delete');\n removeBtn.setAttribute('id', `removeHistoryItem-${index}`);\n removeBtn.setAttribute('aria-label', 'Remove from history');\n removeBtn.setAttribute('aria-labelledby', `removeHistoryItem-${index} historyItem-${index}`);\n removeBtn.innerHTML = /* html */ `\n \n \n \n `;\n actionsEl.appendChild(removeBtn);\n\n li.appendChild(historyItem);\n li.appendChild(actionsEl);\n historyList.appendChild(li);\n });\n }\n}\n\n/**\n * Adds an item to the history.\n * If the item is already in history, it will not be added.\n *\n * @param {string} item - Item to add to history\n */\nexport async function addToHistory(item) {\n const [, settings] = await getSettings();\n\n if (!item || !settings?.addToHistory) {\n return;\n }\n\n const [getHistoryError, history = []] = await getHistory();\n\n if (!getHistoryError && Array.isArray(history) && !history.find(h => h === item)) {\n const data = [...history, item];\n\n const [setHistoryError] = await setHistory(data);\n\n if (!setHistoryError) {\n renderHistoryList(data);\n }\n }\n}\n\n/**\n * Removes an item from the history.\n *\n * @param {string} item - Item to remove from history\n */\nexport async function removeFromHistory(item) {\n if (!item) {\n return;\n }\n\n const [getHistoryError, history = []] = await getHistory();\n\n if (!getHistoryError && Array.isArray(history)) {\n const data = history.filter(el => el !== item);\n const [setHistoryError] = await setHistory(data);\n\n if (!setHistoryError) {\n renderHistoryList(data);\n }\n }\n}\n\n/**\n * Removes all items from the history.\n */\nexport async function emptyHistory() {\n const [setHistoryError] = await setHistory([]);\n\n if (!setHistoryError) {\n renderHistoryList([]);\n }\n}\n","/**\n * Removes the scanned result from the element where it is shown.\n *\n * @param {HTMLElement} element - The element to remove the result from.\n */\nexport function hideResult(element) {\n if (!element) {\n return;\n }\n\n const scanResultEl = element.querySelector('scan-result');\n scanResultEl?.remove();\n}\n\n/**\n * Creates and shows the scanned result inside the given element.\n *\n * @param {HTMLElement} element - The element to show the result in.\n * @param {string} value - The value to create the result with.\n */\nexport async function showResult(element, value) {\n if (!element || !value) {\n return;\n }\n\n const oldScanResultEl = element.querySelector('scan-result');\n\n if (oldScanResultEl) {\n oldScanResultEl.setAttribute('value', value);\n } else {\n const newScanResultEl = document.createElement('scan-result');\n newScanResultEl.setAttribute('value', value);\n newScanResultEl.setAttribute('role', 'alert');\n newScanResultEl.setAttribute('aria-live', 'assertive');\n newScanResultEl.setAttribute('aria-atomic', 'true');\n element.appendChild(newScanResultEl);\n }\n}\n","import { getSettings } from '../services/storage.js';\nimport { beep } from '../utils/beep.js';\nimport { vibrate } from '../utils/vibrate.js';\n\n/**\n * Triggers the scan effects like beep and vibrate.\n *\n * @param {Object} options\n * @param {boolean} [options.success=true] - Whether to trigger the success or error effects.\n */\nexport async function triggerScanEffects(options = {}) {\n const { success = true } = options;\n const [, settings] = await getSettings();\n\n if (!settings) {\n return;\n }\n\n const beepConfig = success\n ? { duration: 200, frequency: 860, volume: 0.03, type: 'square' }\n : { duration: 300, frequency: 200, volume: 0.05, type: 'sawtooth' };\n\n settings.beep && beep(beepConfig);\n settings.vibrate && vibrate(success ? 100 : 200);\n}\n","/**\n * Beep sound using the `AudioContext` interface.\n *\n * @param {Object} options\n * @param {Number} options.duration - Duration in milliseconds\n * @param {Number} options.frequency - Frequency in Hz\n * @param {Number} options.volume - Volume\n * @param {String} options.type - Type of oscillator\n * @param {Function} options.onEnded - Callback function when the sound ends\n */\nexport const beep = (() => {\n const audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext)();\n\n if (!audioCtx) {\n return;\n }\n\n return options => {\n const { duration, frequency, volume, type, onEnded } = options;\n const oscillator = audioCtx.createOscillator();\n const gainNode = audioCtx.createGain();\n\n oscillator.connect(gainNode);\n gainNode.connect(audioCtx.destination);\n\n if (volume) {\n gainNode.gain.value = volume;\n }\n\n if (frequency) {\n oscillator.frequency.value = frequency;\n }\n\n if (type) {\n oscillator.type = type;\n }\n\n if (typeof onEnded === 'function') {\n oscillator.onended = onEnded;\n }\n\n oscillator.start(audioCtx.currentTime);\n oscillator.stop(audioCtx.currentTime + (duration || 500) / 1000);\n };\n})();\n","/**\n * Vibrate the device.\n * If the device does not support vibration, this function will fail silently.\n *\n * @param {Number} [duration=0] - Duration in milliseconds\n */\nexport async function vibrate(duration = 0) {\n if (typeof window.navigator.vibrate !== 'function') {\n return;\n }\n\n try {\n window.navigator.vibrate(duration);\n } catch {\n // Fail silently...\n }\n}\n","/**\n * Resizes the scan frame to match the video element's dimensions.\n *\n * @param {HTMLVideoElement} videoEl - Video element\n * @param {HTMLElement} scanFrameEl - Scan frame element\n */\nexport function resizeScanFrame(videoEl, scanFrameEl) {\n if (!videoEl || !scanFrameEl) {\n return;\n }\n\n const rect = videoEl.getBoundingClientRect();\n\n scanFrameEl.style.cssText = `width: ${rect.width}px; height: ${rect.height}px`;\n}\n","import { log } from '../utils/log.js';\n\n/**\n * BarcodeReader class to detect barcodes from images or videos.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector\n */\nclass BarcodeReader {\n static async polyfill() {\n if (!('BarcodeDetector' in window)) {\n try {\n await import('barcode-detector');\n log('Using BarcodeDetector polyfill.');\n } catch {\n throw new Error('BarcodeDetector API is not supported by your browser.');\n }\n } else {\n log('Using the native BarcodeDetector API.');\n }\n }\n\n /**\n * Get the supported barcode formats.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/getSupportedFormats\n * @returns {Promise>} - Supported barcode formats\n */\n static async getSupportedFormats() {\n return await window.BarcodeDetector.getSupportedFormats();\n }\n\n /**\n * Create a new BarcodeReader instance.\n *\n * @returns {Promise} - New BarcodeReader instance\n */\n static async create() {\n const formats = await window.BarcodeDetector.getSupportedFormats();\n return new BarcodeReader(formats);\n }\n\n /**\n * Initialize the BarcodeReader.\n *\n * @returns {Promise<{ barcodeReader: BarcodeReader, barcodeFormats: Array, barcodeReaderError: Error }>} - BarcodeReader instance, supported formats, and error\n */\n static async init() {\n try {\n await BarcodeReader.polyfill();\n const barcodeReader = await BarcodeReader.create();\n const barcodeFormats = await BarcodeReader.getSupportedFormats();\n return { barcodeReader, barcodeFormats, barcodeReaderError: null };\n } catch (error) {\n return {\n barcodeReader: null,\n barcodeFormats: [],\n barcodeReaderError: error\n };\n }\n }\n\n /**\n * Create a new BarcodeReader instance.\n *\n * @param {Array} formats - Supported barcode formats\n */\n constructor(formats) {\n this.barcodeReader = new window.BarcodeDetector({ formats });\n }\n\n /**\n * Detect barcodes from the provided source.\n *\n * @see https://developer.mozilla.org/docs/Web/API/BarcodeDetector/detect\n * @param {HTMLImageElement|HTMLVideoElement|ImageBitmap} source - Image or video element or ImageBitmap\n * @returns {Promise} - Barcode detection result\n */\n async detect(source) {\n if (!this.barcodeReader) {\n throw new Error('BarcodeReader is not initialized.');\n }\n\n const results = await this.barcodeReader.detect(source);\n\n if (Array.isArray(results) && results.length > 0) {\n return results[0];\n } else {\n throw new Error('Could not detect barcode from provided source.');\n }\n }\n}\n\nexport { BarcodeReader };\n","import { getSettings } from '../services/storage.js';\n\n/**\n * Initialize the settings form with the saved settings.\n * If a setting is not found, it will be ignored.\n *\n * @param {HTMLFormElement} form - The settings form to initialize.\n */\nexport async function initializeSettingsForm(form) {\n const [, settings = {}] = await getSettings();\n\n Object.entries(settings).forEach(([key, value]) => {\n const settingInput = form.querySelector(`[name=\"${key}\"]`);\n\n if (!settingInput) {\n return;\n }\n\n settingInput.checked = value;\n });\n}\n","/**\n * Toggles the torch button status.\n * The torch button has two icons, one for on and one for off.\n * This function toggles the visibility of the icons based on the torch state and updates the button title.\n *\n * @param {HTMLButtonElement} buttonEl - The torch button element.\n * @param {boolean} isTorchOn - The torch state.\n */\nexport function toggleTorchButtonStatus(options = {}) {\n const defaults = {\n el: document.getElementById('torchButton'),\n isTorchOn: false\n };\n const { el, isTorchOn } = { ...defaults, ...options };\n const iconPaths = el.querySelectorAll('svg path');\n\n if (iconPaths.length !== 2) {\n return;\n }\n\n iconPaths[0].style.display = isTorchOn ? 'none' : 'block';\n iconPaths[1].style.display = isTorchOn ? 'block' : 'none';\n el.setAttribute('title', `Turn ${isTorchOn ? 'off' : 'on'} flash`);\n}\n","import { clamp } from '../utils/clamp.js';\n\nconst COMPONENT_NAME = 'video-capture';\n\nconst styles = /* css */ `\n :host { display: block; box-sizing: border-box; }\n :host *, :host *::before, :host *::after { box-sizing: inherit;}\n :host([hidden]), [hidden], ::slotted([hidden]) { display: none; }\n video { display: block; }\n #output:empty { display: none; }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n
    \n \n`;\n\nclass VideoCapture extends HTMLElement {\n #supportedConstraints = {};\n #stream = null;\n #videoElement = null;\n\n constructor() {\n super();\n\n this.#supportedConstraints = this.getSupportedConstraints();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['no-image', 'pan', 'tilt', 'zoom', 'torch'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) {\n return;\n }\n\n const trackCapabilities = this.getTrackCapabilities();\n\n if (name === 'zoom' && oldValue !== newValue && 'zoom' in this.#supportedConstraints) {\n const zoomInAllowedRange =\n 'zoom' in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max\n ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max\n : false;\n\n if (typeof this.zoom === 'number' && zoomInAllowedRange) {\n this.#applyConstraint('zoom', this.zoom);\n }\n }\n\n if (name === 'torch' && oldValue !== newValue && 'torch' in this.#supportedConstraints) {\n this.#applyConstraint('torch', this.torch);\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n async connectedCallback() {\n this.#upgradeProperty('autoPlay');\n this.#upgradeProperty('facingMode');\n this.#upgradeProperty('zoom');\n this.#upgradeProperty('torch');\n\n this.#videoElement = this.shadowRoot?.querySelector('video') || null;\n\n this.#videoElement?.addEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n\n if (!VideoCapture.isSupported()) {\n return this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: 'NotSupportedError',\n message: 'Not supported'\n }\n }\n })\n );\n }\n\n if (this.autoPlay) {\n this.startVideoStream();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.stopVideoStream();\n this.#videoElement?.removeEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n }\n\n get autoPlay() {\n return this.hasAttribute('auto-play');\n }\n\n set autoPlay(value) {\n this.toggleAttribute('auto-play', !!value);\n }\n\n get facingMode() {\n return this.getAttribute('facing-mode') || 'user';\n }\n\n set facingMode(value) {\n this.setAttribute('facing-mode', value);\n }\n\n get zoom() {\n return Number(this.getAttribute('zoom')) || 1;\n }\n\n set zoom(value) {\n this.setAttribute('zoom', value != null ? value.toString() : value);\n }\n\n get torch() {\n return this.hasAttribute('torch');\n }\n\n set torch(value) {\n this.toggleAttribute('torch', !!value);\n }\n\n get loading() {\n return this.hasAttribute('loading');\n }\n\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {Event} evt - The event object.\n */\n #onVideoLoadedMetaData = evt => {\n const video = evt.target;\n\n video\n .play()\n .then(() => {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: { video }\n })\n );\n })\n .catch(error => {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n })\n .finally(() => {\n this.removeAttribute('loading');\n });\n };\n\n /**\n * Applies a constraint to the video track.\n *\n * @param {string} constraint - The name of the constraint.\n * @param {any} value - The value of the constraint.\n */\n #applyConstraint(constraint, value) {\n if (!this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n const constraintValue =\n constraint === 'pan' || constraint === 'tilt' || constraint === 'zoom'\n ? clamp(\n Number(value),\n trackCapabilities[constraint]?.min || 1,\n trackCapabilities[constraint]?.max || 1\n )\n : value;\n\n if (constraint in trackSettings) {\n track\n .applyConstraints({\n advanced: [{ [constraint]: constraintValue }]\n })\n .catch(() => {\n // Fail silently...\n });\n }\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n\n /**\n * Starts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n * @returns Promise\n */\n async startVideoStream(videoInputId) {\n if (!VideoCapture.isSupported() || this.#stream) {\n return;\n }\n\n this.setAttribute('loading', '');\n\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || 'user'\n },\n pan: true,\n tilt: true,\n zoom: true,\n torch: this.torch\n },\n audio: false\n };\n\n if (typeof videoInputId === 'string' && videoInputId.trim().length > 0) {\n constraints.video.deviceId = { exact: videoInputId };\n }\n\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n\n if (this.#videoElement) {\n this.#videoElement.srcObject = this.#stream;\n }\n\n this.#applyConstraint('pan', this.pan);\n this.#applyConstraint('tilt', this.tilt);\n this.#applyConstraint('zoom', this.zoom);\n } catch (error) {\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n } finally {\n this.removeAttribute('loading');\n }\n }\n\n /**\n * Restarts the video stream.\n *\n * @param {string} [videoInputId] - The video input device ID.\n */\n restartVideoStream(videoInputId) {\n if (this.#stream && this.#videoElement) {\n this.stopVideoStream();\n }\n\n this.startVideoStream(videoInputId);\n }\n\n /**\n * Stops the video stream.\n */\n stopVideoStream() {\n if (!this.#videoElement || !this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */\n getSupportedConstraints() {\n if (!VideoCapture.isSupported()) {\n return {};\n }\n\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */\n getTrackCapabilities() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getCapabilities === 'function') {\n return track.getCapabilities() || {};\n }\n\n return {};\n }\n\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */\n getTrackSettings() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getSettings === 'function') {\n return track.getSettings() || {};\n }\n\n return {};\n }\n\n /**\n * Returns the available video input devices.\n *\n * @returns {Promise}\n */\n static async getVideoInputDevices() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {\n return [];\n }\n\n const devices = (await navigator.mediaDevices.enumerateDevices()) || [];\n return devices.filter(device => device.kind === 'videoinput' && !!device.deviceId);\n }\n\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */\n static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='video-capture'] - The name of the custom element.\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, VideoCapture);\n }\n }\n}\n\nexport { VideoCapture };\n","/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */\nexport const clamp = (value, lower, upper) => {\n if (Number.isNaN(lower)) {\n lower = 0;\n }\n\n if (Number.isNaN(upper)) {\n upper = 0;\n }\n\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n","import { ClipboardCopy } from '@georapbox/clipboard-copy-element/dist/clipboard-copy.js';\n\n/**\n * Extends the `ClipboardCopy` element to override the default `copy` and `success` slots,\n * in order to avoid repetition of the same markup throughout the application.\n * It also adds aditional properties and attributes, specific to the application.\n *\n * @class CustomClipboardCopy\n * @extends ClipboardCopy\n */\nclass CustomClipboardCopy extends ClipboardCopy {\n constructor() {\n super();\n\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n\n copySlot.innerHTML = /* html */ `\n \n \n \n \n Copy\n `;\n\n successSlot.innerHTML = /* html */ `\n \n \n \n \n \n Copied!\n `;\n }\n\n static get observedAttributes() {\n return [...super.observedAttributes, 'only-icon'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n\n if (name === 'only-icon' && oldValue !== newValue) {\n const copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n const successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n\n const copyText = copySlot.querySelector('.text');\n const successText = successSlot.querySelector('.text');\n\n if (copyText) {\n copyText.hidden = this.onlyIcon;\n }\n\n if (successText) {\n successText.hidden = this.onlyIcon;\n }\n }\n }\n\n get onlyIcon() {\n return this.hasAttribute('only-icon');\n }\n\n set onlyIcon(value) {\n if (value) {\n this.setAttribute('only-icon', '');\n } else {\n this.removeAttribute('only-icon');\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.#upgradeProperty('onlyIcon');\n\n if (!this.hasAttribute('feedback-duration')) {\n this.setAttribute('feedback-duration', '1500');\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n if (Object.prototype.hasOwnProperty.call(this, prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'custom-clipboard-copy') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, CustomClipboardCopy);\n }\n }\n}\n\nCustomClipboardCopy.defineCustomElement();\n","/*!\n * @georapbox/clipboard-copy-element\n * A custom element that implements the Clipboard API to copy text content from elements or input values to the clipboard.\n *\n * @version 3.0.2\n * @homepage https://github.com/georapbox/clipboard-copy-element#readme\n * @author George Raptis \n * @license MIT\n */\nvar i=\"clipboard-copy\";var o=\"success\",n=\"error\",h=document.createElement(\"template\"),a=`\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;h.innerHTML=`\n \n \n`;var r=class d extends HTMLElement{#e=void 0;#t=null;#s=null;#i=null;#o=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(h.content.cloneNode(!0)),this.shadowRoot&&(this.#t=this.shadowRoot.querySelector(\"button\"),this.#s=this.shadowRoot.querySelector('slot[name=\"copy\"]'),this.#i=this.shadowRoot.querySelector('slot[name=\"success\"]'),this.#o=this.shadowRoot.querySelector('slot[name=\"error\"]'))}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,s,e){t===\"disabled\"&&s!==e&&this.#t&&(this.#t.disabled=this.disabled,this.#t.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#t.part.contains(\"button\")&&this.#t.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#n(\"value\"),this.#n(\"from\"),this.#n(\"disabled\"),this.#n(\"feedbackDuration\"),this.#t?.addEventListener(\"click\",this.#r)}disconnectedCallback(){this.#t?.removeEventListener(\"click\",this.#r),this.#a()}get value(){return this.getAttribute(\"value\")||\"\"}set value(t){this.setAttribute(\"value\",t!=null?t.toString():t)}get from(){return this.getAttribute(\"from\")||\"\"}set from(t){this.setAttribute(\"from\",t!=null?t.toString():t)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get feedbackDuration(){return Number(this.getAttribute(\"feedback-duration\"))||1e3}set feedbackDuration(t){this.setAttribute(\"feedback-duration\",t!=null?t.toString():t)}async#d(){if(!(!this.value&&!this.from))try{let t=\"\";if(this.value)t=this.value;else if(this.from){let s=\"getRootNode\"in Element.prototype?this.#t?.getRootNode({composed:!0}):this.#t?.ownerDocument;if(!s||!(s instanceof Document||s instanceof ShadowRoot))return;let e=s.querySelector(this.from);if(!e)return;e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?t=e.value:e instanceof HTMLAnchorElement&&e.hasAttribute(\"href\")?t=e.href:t=e.textContent||\"\"}await navigator.clipboard.writeText(t),this.#h(o),this.dispatchEvent(new CustomEvent(`${i}-success`,{bubbles:!0,composed:!0,detail:{value:t}}))}catch(t){this.#h(n),this.dispatchEvent(new CustomEvent(`${i}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}#r=t=>{t.preventDefault(),!(this.disabled||this.#e)&&this.#d()};#h(t){this.#s&&(this.#s.hidden=!0),this.#i&&(this.#i.hidden=t!==o),this.#o&&(this.#o.hidden=t!==n),this.#t?.part.remove(\"button--success\"),this.#t?.part.remove(\"button--error\"),this.#t?.part.add(`button--${t}`),this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.#s&&(this.#s.hidden=!1),this.#i&&(this.#i.hidden=!0),this.#o&&(this.#o.hidden=!0),this.#t?.part.remove(`button--${t}`),this.#e=void 0},this.feedbackDuration)}#a(){this.#e&&clearTimeout(this.#e),this.#e=void 0,this.#s&&(this.#s.hidden=!1),this.#i&&(this.#i.hidden=!0),this.#o&&(this.#o.hidden=!0),this.#t?.part.remove(\"button--success\"),this.#t?.part.remove(\"button--error\")}#n(t){let s=this;if(Object.prototype.hasOwnProperty.call(s,t)){let e=s[t];delete s[t],s[t]=e}}static defineCustomElement(t=i){typeof window<\"u\"&&!window.customElements.get(t)&&window.customElements.define(t,d)}};export{r as ClipboardCopy};\n//# sourceMappingURL=clipboard-copy.js.map\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst COMPONENT_NAME = 'clipboard-copy';\nconst DEFAULT_FEEDBACK_DURATION = 1000;\nconst SUCCESS_STATUS = 'success';\nconst ERROR_STATUS = 'error';\nconst template = document.createElement('template');\n\nconst styles = /* css */ `\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n`;\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element for copying text to the clipboard.\n * @documentation https://github.com/georapbox/clipboard-copy-element#readme\n *\n * @tagname clipboard-copy - This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {string} value - The value to be copied to clipboard.\n * @property {string} from - The CSS selector of the element to copy from.\n * @property {boolean} disabled - Whether the copy to clipboard button is disabled.\n * @property {number} feedbackDuration - The duration for displaying the success or error status.\n *\n * @attribute {string} value - Reflects the value property.\n * @attribute {string} from - Reflects the from property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} feedback-duration - Reflects the feedbackDuration property.\n *\n * @slot copy - The default slot for the copy button.\n * @slot success - The slot for the success status message.\n * @slot error - The slot for the error status message.\n *\n * @csspart button - The button element.\n * @csspart button--success - The button element when the copy operation is successful.\n * @csspart button--error - The button element when the copy operation fails.\n * @csspart button--disabled - The button element when the disabled attribute is set.\n *\n * @fires clipboard-copy-success - Dispatched when the copy operation is successful.\n * @fires clipboard-copy-error - Dispatched when the copy operation fails.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n */\nclass ClipboardCopy extends HTMLElement {\n /** @type {ReturnType | undefined} */\n #timeout = void 0;\n\n /** @type {Nullable} */\n #buttonEl = null;\n\n /** @type {Nullable} */\n #copySlot = null;\n\n /** @type {Nullable} */\n #successSlot = null;\n\n /** @type {Nullable} */\n #errorSlot = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#buttonEl = this.shadowRoot.querySelector('button');\n this.#copySlot = this.shadowRoot.querySelector('slot[name=\"copy\"]');\n this.#successSlot = this.shadowRoot.querySelector('slot[name=\"success\"]');\n this.#errorSlot = this.shadowRoot.querySelector('slot[name=\"error\"]');\n }\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue) {\n if (this.#buttonEl) {\n this.#buttonEl.disabled = this.disabled;\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('value');\n this.#upgradeProperty('from');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('feedbackDuration');\n\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n\n // `disconnectedCallback` is also called when the element is moved to a different document,\n // via `Document: adoptNode()` method, therefore we reset the component to its initial state.\n this.#forceResetStatus();\n }\n\n /**\n * The value to be copied to clipboard.\n *\n * @type {string}\n * @attribute value - Reflects the value property.\n */\n get value() {\n return this.getAttribute('value') || '';\n }\n\n set value(value) {\n this.setAttribute('value', value != null ? value.toString() : value);\n }\n\n /**\n * The CSS selector of the element to copy from.\n *\n * @type {string}\n * @attribute from - Reflects the from property.\n */\n get from() {\n return this.getAttribute('from') || '';\n }\n\n set from(value) {\n this.setAttribute('from', value != null ? value.toString() : value);\n }\n\n /**\n * Whether the copy to clipboard button is disabled.\n *\n * @type {boolean}\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * The duration for displaying the success or error status.\n *\n * @type {number}\n * @attribute feedback-duration - Reflects the feedbackDuration property.\n */\n get feedbackDuration() {\n return Number(this.getAttribute('feedback-duration')) || DEFAULT_FEEDBACK_DURATION;\n }\n\n set feedbackDuration(value) {\n this.setAttribute('feedback-duration', value != null ? value.toString() : value);\n }\n\n /**\n * Copies the value to the clipboard and handles success or error states.\n */\n async #copy() {\n if (!this.value && !this.from) {\n return;\n }\n\n try {\n let copyValue = '';\n\n if (this.value) {\n copyValue = this.value;\n } else if (this.from) {\n const root =\n 'getRootNode' in Element.prototype\n ? this.#buttonEl?.getRootNode({ composed: true })\n : this.#buttonEl?.ownerDocument;\n\n if (!root || !(root instanceof Document || root instanceof ShadowRoot)) {\n return;\n }\n\n const element = root.querySelector(this.from);\n\n if (!element) {\n return;\n }\n\n if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {\n copyValue = element.value;\n } else if (element instanceof HTMLAnchorElement && element.hasAttribute('href')) {\n copyValue = element.href;\n } else {\n copyValue = element.textContent || '';\n }\n }\n\n await navigator.clipboard.writeText(copyValue);\n\n this.#showStatus(SUCCESS_STATUS);\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-success`, {\n bubbles: true,\n composed: true,\n detail: { value: copyValue }\n })\n );\n } catch (error) {\n this.#showStatus(ERROR_STATUS);\n\n this.dispatchEvent(\n new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n })\n );\n }\n }\n\n /**\n * Handles the button click event.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled || this.#timeout) {\n return;\n }\n\n this.#copy();\n };\n\n /**\n * Displays the success or error status.\n *\n * @param {string} status - The status to display.\n */\n #showStatus(status) {\n if (this.#copySlot) {\n this.#copySlot.hidden = true;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = status !== SUCCESS_STATUS;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = status !== ERROR_STATUS;\n }\n\n this.#buttonEl?.part.remove('button--success');\n this.#buttonEl?.part.remove('button--error');\n this.#buttonEl?.part.add(`button--${status}`);\n\n this.#timeout && clearTimeout(this.#timeout);\n\n this.#timeout = setTimeout(() => {\n if (this.#copySlot) {\n this.#copySlot.hidden = false;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = true;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = true;\n }\n\n this.#buttonEl?.part.remove(`button--${status}`);\n\n this.#timeout = void 0;\n }, this.feedbackDuration);\n }\n\n /**\n * Resets the status to the initial state.\n * Clears the feedback timeout, hides the success or error slots and shows the copy slot.\n */\n #forceResetStatus() {\n this.#timeout && clearTimeout(this.#timeout);\n this.#timeout = void 0;\n\n if (this.#copySlot) {\n this.#copySlot.hidden = false;\n }\n\n if (this.#successSlot) {\n this.#successSlot.hidden = true;\n }\n\n if (this.#errorSlot) {\n this.#errorSlot.hidden = true;\n }\n\n this.#buttonEl?.part.remove('button--success');\n this.#buttonEl?.part.remove('button--error');\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'value' | 'from' | 'disabled' | 'feedbackDuration'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='clipboard-copy'] - The name of the custom element.\n * @example\n *\n * ClipboardCopy.defineCustomElement('my-clipboard-copy');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ClipboardCopy);\n }\n }\n}\n\nexport { ClipboardCopy };\n","import { isWebShareSupported } from '@georapbox/web-share-element/dist/is-web-share-supported.js';\nimport { getSettings } from '../services/storage.js';\nimport { NO_BARCODE_DETECTED } from '../constants.js';\n\nconst styles = /* css */ `\n :host {\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none !important;\n }\n\n .result {\n position: relative;\n width: 100%;\n border: 1px solid var(--focus);\n border-radius: 6px;\n margin: 1.5rem 0 0 0;\n padding: 1rem;\n background-color: var(--background-alt);\n text-align: center;\n }\n\n .result__item {\n word-wrap: break-word;\n word-break: break-word;\n }\n\n a.result__item {\n color: var(--links);\n text-decoration: none;\n }\n\n a.result__item:hover {\n text-decoration: underline;\n }\n\n .result__item--no-barcode {\n color: var(--error-color);\n }\n\n .result__actions {\n display: flex;\n align-items: center;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .result web-share button,\n .result custom-clipboard-copy::part(button) {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n margin: 0.75rem 0 0 0;\n padding: 0.25rem;\n background-color: transparent;\n border: 0;\n border-radius: var(--border-radius);\n color: inherit;\n line-height: 1;\n font-family: inherit;\n font-size: 0.9rem;\n cursor: pointer;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n\n
    \n
    \n \n\n \n \n \n
    \n
    \n`;\n\nclass ScanResult extends HTMLElement {\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n get value() {\n return this.getAttribute('value');\n }\n\n set value(value) {\n this.setAttribute('value', value);\n }\n\n static get observedAttributes() {\n return ['value'];\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'value' && oldValue !== newValue) {\n this.#handleValueChange(this.value);\n }\n }\n\n connectedCallback() {\n this.#upgradeProperty('value');\n\n if (!isWebShareSupported()) {\n const webShareEl = this.shadowRoot.querySelector('web-share');\n\n if (webShareEl) {\n webShareEl.hidden = true;\n }\n }\n }\n\n async #handleValueChange(value) {\n const baseEl = this.shadowRoot.querySelector('.result');\n const resultActionsEl = baseEl?.querySelector('.result__actions');\n const oldResultItem = baseEl?.querySelector('.result__item');\n let resultItem;\n\n if (oldResultItem) {\n oldResultItem.remove();\n }\n\n try {\n const [, settings] = await getSettings();\n\n new URL(value);\n resultItem = document.createElement('a');\n resultItem.href = value;\n window.requestAnimationFrame(() => resultItem.focus());\n\n if (!settings?.openWebPageSameTab) {\n resultItem.setAttribute('target', '_blank');\n resultItem.setAttribute('rel', 'noreferrer noopener');\n }\n\n if (settings?.openWebPage) {\n resultItem.click();\n }\n } catch {\n resultItem = document.createElement('span');\n }\n\n resultItem.className = 'result__item';\n resultItem.classList.toggle('result__item--no-barcode', value === NO_BARCODE_DETECTED);\n resultItem.textContent = value;\n\n baseEl?.insertBefore(resultItem, resultActionsEl);\n\n const isValidValue = value !== NO_BARCODE_DETECTED;\n const clipboarCopyEl = baseEl?.querySelector('custom-clipboard-copy');\n const webShareEl = baseEl?.querySelector('web-share');\n\n if (clipboarCopyEl && isValidValue) {\n clipboarCopyEl.setAttribute('value', value);\n clipboarCopyEl.hidden = false;\n } else {\n clipboarCopyEl.hidden = true;\n clipboarCopyEl.removeAttribute('value');\n }\n\n if (webShareEl && isWebShareSupported() && isValidValue) {\n webShareEl.setAttribute('share-text', value);\n webShareEl.hidden = false;\n } else {\n webShareEl.hidden = true;\n webShareEl.removeAttribute('share-text');\n }\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {string} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'scan-result') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ScanResult);\n }\n }\n}\n\nScanResult.defineCustomElement();\n","/*!\n * @georapbox/web-share-element\n * A custom element that implements the Web Share API to share user-defined data.\n *\n * @version 3.1.1\n * @homepage https://github.com/georapbox/web-share-element#readme\n * @author George Raptis \n * @license MIT\n */\nfunction r(a){return a!==null&&typeof a==\"object\"?\"share\"in navigator&&\"canShare\"in navigator&&navigator.canShare(a):\"share\"in navigator}export{r as isWebShareSupported};\n//# sourceMappingURL=is-web-share-supported.js.map\n","// @ts-check\n\n/**\n * Check if Web Share API is supported by the platform.\n *\n * @param {import('./web-share').ShareData} [options]\n * @returns {boolean} Returns `true` if Web Share API is supported; otherwise `false`.\n */\nfunction isWebShareSupported(options) {\n if (options !== null && typeof options === 'object') {\n return 'share' in navigator && 'canShare' in navigator && navigator.canShare(options);\n }\n\n return 'share' in navigator;\n}\n\nexport { isWebShareSupported };\n"],"names":["$dc2f4a51b83babfd$var$defaultGetStoreFunc","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$hffE7","then","resolve","$5a53255ef6289be5$var$h","a","t","i","Math","random","toString","substring","$5a53255ef6289be5$var$b","Object","prototype","hasOwnProperty","e","$5a53255ef6289be5$var$E","$5a53255ef6289be5$var$C","$5a53255ef6289be5$var$w","document","createElement","innerHTML","$5a53255ef6289be5$export$6824c350c20eab3a","HTMLElement","constructor","shadowRoot","attachShadow","mode","appendChild","content","cloneNode","observedAttributes","attributeChangedCallback","s","setAttribute","selected","disabled","closable","className","querySelector","addEventListener","removeEventListener","remove","connectedCallback","disconnectedCallback","hasAttribute","toggleAttribute","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","detail","tabId","defineCustomElement","customElements","get","define","$5a53255ef6289be5$var$L","$5a53255ef6289be5$var$S","$5a53255ef6289be5$var$T","$5a53255ef6289be5$export$185adf5fa2c760b1","$5a53255ef6289be5$var$n","TOP","BOTTOM","START","END","$5a53255ef6289be5$var$l","LTR","RTL","$5a53255ef6289be5$var$R","entries","map","$5a53255ef6289be5$var$r","AUTO","MANUAL","$5a53255ef6289be5$var$c","DOWN","LEFT","RIGHT","UP","HOME","ENTER","SPACE","$5a53255ef6289be5$var$x","$5a53255ef6289be5$var$A","$5a53255ef6289be5$export$4ac05a649254e913","l","placement","getAttribute","noScrollControls","scrollDistance","abs","Number","$5a53255ef6289be5$var$y","activation","noTabCycling","o","Array","from","querySelectorAll","n","g","p","forEach","d","f","m","ResizeObserver","requestAnimationFrame","v","target","scrollWidth","clientWidth","_","part","toggle","classList","h","c","unobserve","observe","disconnect","cancelAnimationFrame","CSS","supports","matches","getComputedStyle","direction","hidden","length","w","nextElementSibling","tagName","toLowerCase","console","error","T","b","y","find","A","findIndex","r","E","u","name","altKey","includes","key","focus","selectTab","preventDefault","closest","contains","scrollLeft","scrollTo","left","selectTabByIndex","selectTabById","scrollIntoView","inline","block","$cd62c5572235e737$var$h","$cd62c5572235e737$var$r","$cd62c5572235e737$export$30b344bef3e55b67","delegatesFocus","shareUrl","shareTitle","shareText","shareFiles","isArray","share","url","title","text","navigator","canShare","files","shareData","nodeName","assignedElements","flatten","$9351176e8d763a78$var$x","Map","$9351176e8d763a78$var$b","$9351176e8d763a78$var$y","lastIndexOf","type","split","pop","defineProperty","value","writable","configurable","enumerable","$9351176e8d763a78$var$g","path","webkitRelativePath","$9351176e8d763a78$var$m","Promise","readEntries","$9351176e8d763a78$var$w","push","$9351176e8d763a78$var$E","file","fullPath","$9351176e8d763a78$var$F","kind","getAsEntry","webkitGetAsEntry","shift","isFile","indexOf","isDirectory","createReader","$9351176e8d763a78$var$f","$9351176e8d763a78$var$l","dataTransfer","items","$9351176e8d763a78$var$n","$9351176e8d763a78$var$v","$9351176e8d763a78$var$z","$9351176e8d763a78$var$S","$9351176e8d763a78$export$6ccd1735166caad9","getElementById","accept","removeAttribute","multiple","autoFocus","maxFiles","floor","maxSize","isNaN","minSize","noStyle","Event","dropEffect","add","click","errors","message","$9351176e8d763a78$var$u","Set","trim","filter","Boolean","replace","charAt","test","size","acceptedFiles","rejectedFiles","defaultValue","openFileDialog","$1c2cbcdf680d66d4$var$o","$1c2cbcdf680d66d4$export$f0e45424cc896229","$d9c5053bade2d3f8$var$n","$d9c5053bade2d3f8$var$r","$d9c5053bade2d3f8$export$32589115725b904b","open","showModal","element","body","preserveOverflow","style","overflow","close","noHeader","noAnimations","noCloseButton","clearTimeout","staticBackdrop","fullscreen","closeLabel","some","textContent","setTimeout","defaultPrevented","currentTarget","hide","assignedNodes","cancelable","reason","show","$65136e012e05e2d7$export$c263bd68c6f5ce7a","$65136e012e05e2d7$export$63e7bed68b07a85c","$dc2f4a51b83babfd$export$b327150396135fe7","request","reject","oncomplete","onsuccess","result","onabort","onerror","$dc2f4a51b83babfd$var$defaultGetStore","dbName","storeName","dbp","indexedDB","onupgradeneeded","createObjectStore","txMode","callback","db","transaction","objectStore","$0eb43b201e9f90c7$var$STORAGE_PREFIX","$0eb43b201e9f90c7$var$SETTINGS_STORAGE_KEY","$0eb43b201e9f90c7$var$HISTORY_STORAGE_KEY","$0eb43b201e9f90c7$var$getItem","customStore","arguments","undefined","store","$0eb43b201e9f90c7$var$setItem","data","put","$0eb43b201e9f90c7$export$4a647155031ece","$0eb43b201e9f90c7$export$dc86d17a64679bc7","$0eb43b201e9f90c7$export$f9582a3c130d9538","$0eb43b201e9f90c7$export$96fe1132eb44c325","$4481690a5b2e12d6$export$61fc7d43ac8f84b0","fn","wait","immediate","timerId","TypeError","args","$2d4d0eca101a8031$export$c694186e9d94f0","HTMLDialogElement","$32121209e73f30cc$export$fa9e3380e441c420","historyList","emptyHistoryBtn","replaceChildren","item","index","historyItem","li","URL","href","actionsEl","copyBtn","removeBtn","$32121209e73f30cc$export$7a6a9d84993ff4e","settings","addToHistory","getHistoryError","history","setHistoryError","$32121209e73f30cc$export$3a61248021dae916","el","$32121209e73f30cc$export$9f74b61e5d33cda2","$c6f06ef952a10e5f$export$97c08f0895810b94","oldScanResultEl","newScanResultEl","$db31dc56898b80b8$export$d6c943e433460aae","audioCtx","AudioContext","webkitAudioContext","audioContext","options","duration","frequency","volume","onEnded","oscillator","createOscillator","gainNode","createGain","connect","destination","gain","onended","start","currentTime","stop","$03fe6bc65045924f$export$3ca8e905da0a0ca8","vibrate","$a6838ab1dc4817e7$export$9b466d13e2031a67","success","beep","$451e357ed50655d6$export$1404f0e91c73fec","videoEl","scanFrameEl","rect","getBoundingClientRect","cssText","width","height","$8510600959e31c2c$export$f21d9483ebeee00a","polyfill","getSupportedFormats","BarcodeDetector","create","barcodeReader","barcodeFormats","barcodeReaderError","formats","detect","source","results","$6d6ffe9300b4c5f8$export$9d22ef9ff8e481fe","form","settingInput","checked","$ac0619973d2d242a$export$d1bd0b12fe0d046","isTorchOn","iconPaths","display","$f39ac7e49ce95944$export$7d15b64cf5a3a4c4","lower","upper","min","max","$40cc5a5311c08f52$var$COMPONENT_NAME","$40cc5a5311c08f52$var$styles","$40cc5a5311c08f52$var$template","$40cc5a5311c08f52$export$682e9ed90a89bb4a","supportedConstraints","stream","videoElement","getSupportedConstraints","oldValue","newValue","isConnected","trackCapabilities","getTrackCapabilities","zoomInAllowedRange","zoom","applyConstraint","torch","upgradeProperty","onVideoLoadedMetaData","isSupported","autoPlay","startVideoStream","stopVideoStream","facingMode","loading","evt","video","play","catch","finally","constraint","track","getVideoTracks","trackSettings","getTrackSettings","constraintValue","applyConstraints","advanced","prop","videoInputId","constraints","ideal","pan","tilt","audio","deviceId","exact","cameraResolution","x","mediaDevices","getUserMedia","srcObject","restartVideoStream","getCapabilities","getSettings","getVideoInputDevices","enumerateDevices","devices","device","elementName","$449da37d108ee4fe$var$i","$449da37d108ee4fe$var$o","$449da37d108ee4fe$var$n","$449da37d108ee4fe$var$h","$449da37d108ee4fe$var$a","$449da37d108ee4fe$export$ea3b71af1761ff40","feedbackDuration","Element","getRootNode","ownerDocument","Document","ShadowRoot","HTMLInputElement","HTMLTextAreaElement","HTMLAnchorElement","clipboard","writeText","$3d31f226494869e5$var$CustomClipboardCopy","copySlot","successSlot","copyText","successText","onlyIcon","$7a2aca835bb05064$export$c37129e465f64ef0","$678371674e4a782c$var$styles","$678371674e4a782c$var$template","$678371674e4a782c$var$ScanResult","handleValueChange","webShareEl","resultItem","baseEl","resultActionsEl","oldResultItem","openWebPageSameTab","openWebPage","insertBefore","isValidValue","clipboarCopyEl","instance","rafId","hasExperimentalFlag","URLSearchParams","location","search","has","tabGroupEl","videoCaptureEl","cameraPanel","filePanel","scanInstructionsEl","scanBtn","dropzoneEl","resizeObserverEl","facingModeButton","torchButton","globalActionsEl","historyBtn","historyDialog","settingsBtn","settingsDialog","settingsForm","forms","cameraSelect","shouldScan","alertEl","handleVideoCapturePlay","once","errorMessage","videoCaptureVideoEl","scan","barcode","barcodeValue","rawValue","zoomLevelEl","zoomControls","minZoom","maxZoom","currentZoom","zoomInBtn","zoomOutBtn","videoInputDevices","option","label","join","supportedFormatsEl","scanResultEl","handleFileSelect","image","Image","reader","FileReader","onload","src","alt","preview","imageWrapper","fileNameWrapper","prepend","readAsDataURL","checkboxes","dataset","confirm","videoDeviceId","selectedTab","visibilityState","handleDocumentEscapeKey","cameraTabSelected","scanBtnVisible","settingsDialogOpen","historyDialogOpen","uid","prefix","suffix","prefixString","suffixString","randomString","tabCounter","styles","template","ATab","_ATab","closeButton","#handleCloseButtonClick","#upgradeProperty","panelCounter","ATabPanel","_ATabPanel","DEFAULT_SCROLL_DISTANCE","PLACEMENT","DIR","validPlacements","ACTIVATION","KEYCODE","ATabGroup","_ATabGroup","#resizeObserver","#rafId","#hasTabSlotChangedOnce","#syncNav","tabSlot","panelSlot","tabsContainer","navContainer","scrollButtons","#handleSlotChange","#handleTabClick","#handleKeyDown","#handleScrollButtonClick","#handleTabClose","targetElement","isElementScrollable","#hideEmptyTabGroup","#stopResizeObserver","#startResizeObserver","scrollElement","#getDirectionality","#allTabs","#linkPanels","tabs","tab","panel","#allPanels","#panelForTab","panelId","#firstTab","#lastTab","#prevTab","newIdx","#nextTab","#reset","panels","#setSelectedTabOnSlotChange","#setSelectedTab","orientation","directionality","scrollButton","isStartButton","isLTR","sign","offsetLeft","oldTab","WebShare","_WebShare","#buttonSlot","#buttonEl","#files","#getButton","#handleClick","isValidFile","acceptedTypeSpecifiers","acceptedMimeTypesList","fileMimeType","baseMimeType","validType","COMMON_MIME_TYPES","FILES_TO_IGNORE","toFileWithMimeType","extension","toFileWithPath","fileWithMimeType","readEntriesPromise","directoryReader","readAllDirectoryEntries","getFileFromFileEntry","fileEntry","getFilesFromDataTransferItemList","dataTransferItemList","queue","entry","getFilesFromFileList","fileList","getFilesFromEvent","COMPONENT_NAME","TOO_MANY_FILES","FILE_TOO_LARGE","FILE_TOO_SMALL","INVALID_MIME_TYPE","FilesDropzone","_FilesDropzone","#fileInput","#dropzoneEl","#handleFileInputChange","#handleDragEnter","#handleDragOver","#handleDragLeave","#handleDrop","#handleKeyUp","num","#handleFilesSelect","filesLength","fileHasValidType","fileExceedsMaxSize","fileIsSmallerThanMinSize","ResizeObserverElement","_ResizeObserverElement","#slotEl","#observedElements","#stopObserver","#startObserver","ModalElement","_ModalElement","#dialogEl","#footerSlotEl","#closeSlotEl","#pulseAnimationTimeout","headerEl","closeBtnEl","#updateCloseLabel","#handleDialogClick","#handleDialogClose","#handleDialogCancel","#handleFooterSlotChange","#handleCloseSlotChange","closeButtonEl","#applyPulseEffectOnDialog","requestCloseEvent","#createRequestCloseEvent","footerEl","footerSlotNodes","hasFooterSlotNodes","SUCCESS_STATUS","ERROR_STATUS","ClipboardCopy","_ClipboardCopy","#timeout","#copySlot","#successSlot","#errorSlot","#forceResetStatus","#copy","copyValue","root","#showStatus","status","isWebShareSupported"],"version":3,"file":"index.e93d0af3.js.map"} \ No newline at end of file diff --git a/index.html b/index.html index 3f0d923..f898732 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Barcode/QR code Scanner
    Use webcam
    Use image Click or drop an image to scan

    \ No newline at end of file +Barcode/QR code Scanner
    Use webcam
    Use image Click or drop an image to scan

    \ No newline at end of file diff --git a/index.runtime.0705da47.js b/index.runtime.6396ce86.js similarity index 90% rename from index.runtime.0705da47.js rename to index.runtime.6396ce86.js index d627192..82b1ce0 100644 --- a/index.runtime.0705da47.js +++ b/index.runtime.6396ce86.js @@ -1,2 +1,2 @@ -function e(e,r,n,t){Object.defineProperty(e,r,{get:n,set:t,enumerable:!0,configurable:!0})}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},t={},o=r.parcelRequirea202;null==o&&((o=function(e){if(e in n)return n[e].exports;if(e in t){var r=t[e];delete t[e];var o={id:e,exports:{}};return n[e]=o,r.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,r){t[e]=r},r.parcelRequirea202=o),(0,o.register)("kyEFX",function(r,n){e(r.exports,"register",function(){return t},function(e){return t=e}),e(r.exports,"resolve",function(){return o},function(e){return o=e});var t,o,i=new Map;t=function(e,r){for(var n=0;n","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/runtime-b4b87e4f21700091.js"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea202\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea202\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"kyEFX\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $ef7689007096c8a0$export$6503ec6e8aabbaf; }, function (v) { return $ef7689007096c8a0$export$6503ec6e8aabbaf = v; });\n$parcel$export(module.exports, \"resolve\", function () { return $ef7689007096c8a0$export$f7ad0328861e2f03; }, function (v) { return $ef7689007096c8a0$export$f7ad0328861e2f03 = v; });\nvar $ef7689007096c8a0$export$6503ec6e8aabbaf;\nvar $ef7689007096c8a0$export$f7ad0328861e2f03;\n\"use strict\";\nvar $ef7689007096c8a0$var$mapping = new Map();\nfunction $ef7689007096c8a0$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$ef7689007096c8a0$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $ef7689007096c8a0$var$resolve(id) {\n var resolved = $ef7689007096c8a0$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$ef7689007096c8a0$export$6503ec6e8aabbaf = $ef7689007096c8a0$var$register;\n$ef7689007096c8a0$export$f7ad0328861e2f03 = $ef7689007096c8a0$var$resolve;\n\n});\n\nvar $e6bdd1867fc4489c$exports = {};\n\n(parcelRequire(\"kyEFX\")).register(new URL(\"\", import.meta.url).toString(), JSON.parse('[\"7bk21\",\"index.0a6e9ff0.js\",\"6z40I\",\"es.f464ecf6.js\"]'));\n\n\n//# sourceMappingURL=index.runtime.0705da47.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","require('./helpers/bundle-manifest').register(new __parcel__URL__(\"\").toString(),JSON.parse(\"[\\\"7bk21\\\",\\\"index.0a6e9ff0.js\\\",\\\"6z40I\\\",\\\"es.f464ecf6.js\\\"]\"));"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$ef7689007096c8a0$export$6503ec6e8aabbaf","$ef7689007096c8a0$export$f7ad0328861e2f03","$ef7689007096c8a0$var$mapping","Map","baseUrl","manifest","i","length","path","resolved","URL","toString","url","JSON","parse"],"version":3,"file":"index.runtime.0705da47.js.map"} \ No newline at end of file +{"mappings":"A,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,A,C,E,E,Q,A,E,Q,S,C,C,C,E,E,E,O,C,W,W,O,C,E,S,C,E,O,E,C,G,E,E,O,C,U,W,O,C,E,S,C,E,O,E,C,GCEA,IAgBA,EACA,EAjBI,EAAU,IAAI,IAgBlB,EAfA,SAAkB,CAAO,CAAE,CAAQ,EACjC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAS,MAAM,CAAG,EAAG,GAAK,EAC5C,EAAQ,GAAG,CAAC,CAAQ,CAAC,EAAE,CAAE,CACvB,QAAS,EACT,KAAM,CAAQ,CAAC,EAAI,EAAE,AACvB,EAEJ,EASA,EARA,SAAiB,CAAE,EACjB,IAAI,EAAW,EAAQ,GAAG,CAAC,GAC3B,GAAI,AAAY,MAAZ,EACF,MAAM,AAAI,MAAM,oCAAsC,GAExD,OAAO,IAAI,IAAI,EAAS,IAAI,CAAE,EAAS,OAAO,EAAE,QAAQ,EAC1D,C,GCjBA,AAAA,EAAA,SAAA,QAAA,CAA8C,IAAA,IAAoB,GAAA,YAAA,GAAA,EAAI,QAAQ,GAAG,KAAK,KAAK,CAAC","sources":["","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/runtime-b4b87e4f21700091.js"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea202\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea202\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"kyEFX\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $ef7689007096c8a0$export$6503ec6e8aabbaf; }, function (v) { return $ef7689007096c8a0$export$6503ec6e8aabbaf = v; });\n$parcel$export(module.exports, \"resolve\", function () { return $ef7689007096c8a0$export$f7ad0328861e2f03; }, function (v) { return $ef7689007096c8a0$export$f7ad0328861e2f03 = v; });\nvar $ef7689007096c8a0$export$6503ec6e8aabbaf;\nvar $ef7689007096c8a0$export$f7ad0328861e2f03;\n\"use strict\";\nvar $ef7689007096c8a0$var$mapping = new Map();\nfunction $ef7689007096c8a0$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$ef7689007096c8a0$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $ef7689007096c8a0$var$resolve(id) {\n var resolved = $ef7689007096c8a0$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$ef7689007096c8a0$export$6503ec6e8aabbaf = $ef7689007096c8a0$var$register;\n$ef7689007096c8a0$export$f7ad0328861e2f03 = $ef7689007096c8a0$var$resolve;\n\n});\n\nvar $e6bdd1867fc4489c$exports = {};\n\n(parcelRequire(\"kyEFX\")).register(new URL(\"\", import.meta.url).toString(), JSON.parse('[\"7bk21\",\"index.e93d0af3.js\",\"6z40I\",\"es.f464ecf6.js\"]'));\n\n\n//# sourceMappingURL=index.runtime.6396ce86.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","require('./helpers/bundle-manifest').register(new __parcel__URL__(\"\").toString(),JSON.parse(\"[\\\"7bk21\\\",\\\"index.e93d0af3.js\\\",\\\"6z40I\\\",\\\"es.f464ecf6.js\\\"]\"));"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$ef7689007096c8a0$export$6503ec6e8aabbaf","$ef7689007096c8a0$export$f7ad0328861e2f03","$ef7689007096c8a0$var$mapping","Map","baseUrl","manifest","i","length","path","resolved","URL","toString","url","JSON","parse"],"version":3,"file":"index.runtime.6396ce86.js.map"} \ No newline at end of file diff --git a/index.runtime.e2efd653.js b/index.runtime.a8de4955.js similarity index 92% rename from index.runtime.e2efd653.js rename to index.runtime.a8de4955.js index 96eb94b..4f1bc35 100644 --- a/index.runtime.e2efd653.js +++ b/index.runtime.a8de4955.js @@ -1,2 +1,2 @@ -!function(){function e(e,r,n,t){Object.defineProperty(e,r,{get:n,set:t,enumerable:!0,configurable:!0})}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},t={},o=r.parcelRequirea202;null==o&&((o=function(e){if(e in n)return n[e].exports;if(e in t){var r=t[e];delete t[e];var o={id:e,exports:{}};return n[e]=o,r.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,r){t[e]=r},r.parcelRequirea202=o);var i=o.register;i("iE7OH",function(r,n){e(r.exports,"register",function(){return t},function(e){return t=e}),e(r.exports,"resolve",function(){return o},function(e){return o=e});var t,o,i=new Map;t=function(e,r){for(var n=0;n","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-a295f2fbbcf40011.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea202\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea202\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"iE7OH\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf; }, function (v) { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf = v; });\n$parcel$export(module.exports, \"resolve\", function () { return $0380ce8f1f064ccc$export$f7ad0328861e2f03; }, function (v) { return $0380ce8f1f064ccc$export$f7ad0328861e2f03 = v; });\nvar $0380ce8f1f064ccc$export$6503ec6e8aabbaf;\nvar $0380ce8f1f064ccc$export$f7ad0328861e2f03;\n\"use strict\";\nvar $0380ce8f1f064ccc$var$mapping = new Map();\nfunction $0380ce8f1f064ccc$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$0380ce8f1f064ccc$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $0380ce8f1f064ccc$var$resolve(id) {\n var resolved = $0380ce8f1f064ccc$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$0380ce8f1f064ccc$export$6503ec6e8aabbaf = $0380ce8f1f064ccc$var$register;\n$0380ce8f1f064ccc$export$f7ad0328861e2f03 = $0380ce8f1f064ccc$var$resolve;\n\n});\n\nparcelRegister(\"aNJCr\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $7dd1ddf6834435ca$export$bdfd709ae4826697; }, function (v) { return $7dd1ddf6834435ca$export$bdfd709ae4826697 = v; });\nvar $7dd1ddf6834435ca$export$bdfd709ae4826697;\nvar $7dd1ddf6834435ca$export$c9e73fbda7da57b6;\nvar $7dd1ddf6834435ca$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $7dd1ddf6834435ca$var$bundleURL = {};\nfunction $7dd1ddf6834435ca$var$getBundleURLCached(id) {\n var value = $7dd1ddf6834435ca$var$bundleURL[id];\n if (!value) {\n value = $7dd1ddf6834435ca$var$getBundleURL();\n $7dd1ddf6834435ca$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $7dd1ddf6834435ca$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $7dd1ddf6834435ca$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $7dd1ddf6834435ca$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $7dd1ddf6834435ca$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$7dd1ddf6834435ca$export$bdfd709ae4826697 = $7dd1ddf6834435ca$var$getBundleURLCached;\n$7dd1ddf6834435ca$export$c9e73fbda7da57b6 = $7dd1ddf6834435ca$var$getBaseURL;\n$7dd1ddf6834435ca$export$5a759dc7a1cfb72a = $7dd1ddf6834435ca$var$getOrigin;\n\n});\n\nvar $c6558c9336295101$exports = {};\n\n\n(parcelRequire(\"iE7OH\")).register((parcelRequire(\"aNJCr\")).getBundleURL(\"9p9yL\"), JSON.parse('[\"9p9yL\",\"index.65ac40f6.js\",\"iqysf\",\"es.ca5c1521.js\"]'));\n\n})();\n//# sourceMappingURL=index.runtime.e2efd653.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('9p9yL'),JSON.parse(\"[\\\"9p9yL\\\",\\\"index.65ac40f6.js\\\",\\\"iqysf\\\",\\\"es.ca5c1521.js\\\"]\"));"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$0380ce8f1f064ccc$export$6503ec6e8aabbaf","$0380ce8f1f064ccc$export$f7ad0328861e2f03","$0380ce8f1f064ccc$var$mapping","Map","baseUrl","manifest","i","length","path","resolved","URL","toString","$7dd1ddf6834435ca$export$bdfd709ae4826697","$7dd1ddf6834435ca$var$bundleURL","value","$7dd1ddf6834435ca$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse"],"version":3,"file":"index.runtime.e2efd653.js.map"} \ No newline at end of file +{"mappings":"C,A,W,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,I,E,E,Q,C,E,Q,S,C,C,C,E,E,E,O,C,W,W,O,C,E,S,C,E,O,E,C,G,E,E,O,C,U,W,O,C,E,S,C,E,O,E,C,GCEA,IAgBA,EACA,EAjBI,EAAU,IAAI,IAgBlB,EAfA,SAAkB,CAAO,CAAE,CAAQ,EACjC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAS,MAAM,CAAG,EAAG,GAAK,EAC5C,EAAQ,GAAG,CAAC,CAAQ,CAAC,EAAE,CAAE,CACvB,QAAS,EACT,KAAM,CAAQ,CAAC,EAAI,EAAE,AACvB,EAEJ,EASA,EARA,SAAiB,CAAE,EACjB,IAAI,EAAW,EAAQ,GAAG,CAAC,GAC3B,GAAI,AAAY,MAAZ,EACF,MAAM,AAAI,MAAM,oCAAsC,GAExD,OAAO,IAAI,IAAI,EAAS,IAAI,CAAE,EAAS,OAAO,EAAE,QAAQ,EAC1D,C,G,E,Q,S,C,C,C,E,E,E,O,C,e,W,O,C,E,S,C,E,O,E,C,GCfA,IAkCA,EAlCI,EAAY,CAAC,EAkCjB,EAjCA,SAA4B,CAAE,EAC5B,IAAI,EAAQ,CAAS,CAAC,EAAG,CAKzB,OAJK,IACH,EAAQ,AAKZ,WACE,GAAI,CACF,MAAM,AAAI,OACZ,CAAE,MAAO,EAAK,CACZ,IAAI,EAAW,AAAA,CAAA,GAAK,EAAI,KAAI,AAAJ,EAAO,KAAK,CAAC,oEACrC,GAAI,EAGF,MAMI,AAAA,CAAA,GANc,CAAO,CAAC,EAAE,AAMnB,EAAK,OAAO,CAAC,0EAA2E,MAAQ,GAJ7G,CACA,MAAO,GACT,IAhBI,CAAS,CAAC,EAAG,CAAG,GAEX,CACT,C,GCVA,AAAA,EAAA,SAAA,QAAA,CAA8C,AAAA,EAAA,SAAA,YAAA,CAA6C,SAAS,KAAK,KAAK,CAAC,4F","sources":["","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-a295f2fbbcf40011.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea202\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea202\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"iE7OH\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf; }, function (v) { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf = v; });\n$parcel$export(module.exports, \"resolve\", function () { return $0380ce8f1f064ccc$export$f7ad0328861e2f03; }, function (v) { return $0380ce8f1f064ccc$export$f7ad0328861e2f03 = v; });\nvar $0380ce8f1f064ccc$export$6503ec6e8aabbaf;\nvar $0380ce8f1f064ccc$export$f7ad0328861e2f03;\n\"use strict\";\nvar $0380ce8f1f064ccc$var$mapping = new Map();\nfunction $0380ce8f1f064ccc$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$0380ce8f1f064ccc$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $0380ce8f1f064ccc$var$resolve(id) {\n var resolved = $0380ce8f1f064ccc$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$0380ce8f1f064ccc$export$6503ec6e8aabbaf = $0380ce8f1f064ccc$var$register;\n$0380ce8f1f064ccc$export$f7ad0328861e2f03 = $0380ce8f1f064ccc$var$resolve;\n\n});\n\nparcelRegister(\"aNJCr\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $7dd1ddf6834435ca$export$bdfd709ae4826697; }, function (v) { return $7dd1ddf6834435ca$export$bdfd709ae4826697 = v; });\nvar $7dd1ddf6834435ca$export$bdfd709ae4826697;\nvar $7dd1ddf6834435ca$export$c9e73fbda7da57b6;\nvar $7dd1ddf6834435ca$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $7dd1ddf6834435ca$var$bundleURL = {};\nfunction $7dd1ddf6834435ca$var$getBundleURLCached(id) {\n var value = $7dd1ddf6834435ca$var$bundleURL[id];\n if (!value) {\n value = $7dd1ddf6834435ca$var$getBundleURL();\n $7dd1ddf6834435ca$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $7dd1ddf6834435ca$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $7dd1ddf6834435ca$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $7dd1ddf6834435ca$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $7dd1ddf6834435ca$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$7dd1ddf6834435ca$export$bdfd709ae4826697 = $7dd1ddf6834435ca$var$getBundleURLCached;\n$7dd1ddf6834435ca$export$c9e73fbda7da57b6 = $7dd1ddf6834435ca$var$getBaseURL;\n$7dd1ddf6834435ca$export$5a759dc7a1cfb72a = $7dd1ddf6834435ca$var$getOrigin;\n\n});\n\nvar $c6558c9336295101$exports = {};\n\n\n(parcelRequire(\"iE7OH\")).register((parcelRequire(\"aNJCr\")).getBundleURL(\"9p9yL\"), JSON.parse('[\"9p9yL\",\"index.a88fc2f6.js\",\"iqysf\",\"es.ca5c1521.js\"]'));\n\n})();\n//# sourceMappingURL=index.runtime.a8de4955.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('9p9yL'),JSON.parse(\"[\\\"9p9yL\\\",\\\"index.a88fc2f6.js\\\",\\\"iqysf\\\",\\\"es.ca5c1521.js\\\"]\"));"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$0380ce8f1f064ccc$export$6503ec6e8aabbaf","$0380ce8f1f064ccc$export$f7ad0328861e2f03","$0380ce8f1f064ccc$var$mapping","Map","baseUrl","manifest","i","length","path","resolved","URL","toString","$7dd1ddf6834435ca$export$bdfd709ae4826697","$7dd1ddf6834435ca$var$bundleURL","value","$7dd1ddf6834435ca$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse"],"version":3,"file":"index.runtime.a8de4955.js.map"} \ No newline at end of file diff --git a/service-worker.js b/service-worker.js index a2ed9e2..f80c5b2 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1,2 +1,2 @@ -if(!self.define){let e,c={};const i=(i,d)=>(i=new URL(i+".js",d).href,c[i]||new Promise((c=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=c,document.head.appendChild(e)}else e=i,importScripts(i),c()})).then((()=>{let e=c[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(d,n)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(c[r])return;let a={};const s=e=>i(e,r),f={module:{uri:r},exports:a,require:s};c[r]=Promise.all(d.map((e=>f[e]||s(e)))).then((e=>(n(...e),a)))}}define(["./workbox-1c3383c2"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"apple-touch-icon.cbfc4d72.png",revision:"032bc7d807514f1eb6efb000f9fdff26"},{url:"camera-scanner.42ef82b0.png",revision:"6379ba2fd5e1e6b16874979a282077b8"},{url:"es.ca5c1521.js",revision:"bdeced2ed83be1a8eb203ed157815830"},{url:"es.ca5c1521.js.map",revision:"968d20e007cc9032d81b9cca55598b26"},{url:"es.f464ecf6.js",revision:"de7f0cea08c219da2a74aebe279d0ee9"},{url:"es.f464ecf6.js.map",revision:"b529129d5c3dae342f534ca5db5596ec"},{url:"favicon.a05bdb0a.ico",revision:"ece89efb9e6bf43b4a1a4bddc3e6c0ee"},{url:"icon-large.cd373832.png",revision:"52b2012c4056f0da66ea3ed518dd8e10"},{url:"icon-medium.ede1e868.png",revision:"03ee967b5d869e1ae1e8e63ed13edbf2"},{url:"icon-small.81a93e10.png",revision:"70955d3c62fbbfeec3ce088f908d6f57"},{url:"image-scanner.82276613.png",revision:"c878ced18794653941259faa24e9d41c"},{url:"index.0a6e9ff0.js",revision:"e66adafae53cc475830c0df99c0a55c1"},{url:"index.0a6e9ff0.js.map",revision:"1c55cd36137e39c07084be23655015f1"},{url:"index.65ac40f6.js",revision:"797a08c9ecd0ba2c3bdb16996eac9d85"},{url:"index.65ac40f6.js.map",revision:"c94ecb2828ba5141d9e715b7148ea5f1"},{url:"index.98a7b582.js",revision:"3fa2ad8d96c4c904414f858a549cdb14"},{url:"index.98a7b582.js.map",revision:"075a517ce0210c3eb84f9da7e2f21645"},{url:"index.bb1ce697.js",revision:"82f689cbc7405307d1eb42c297e81360"},{url:"index.bb1ce697.js.map",revision:"a581e787ac4468ce653d4028ea2d6f76"},{url:"index.f9910dec.css",revision:"e74c361efd14b6bd66529ceb2d0509c8"},{url:"index.f9910dec.css.map",revision:"4d910ee564cda4bf75e25d0e5b921b3d"},{url:"index.html",revision:"a3054a7a99d2a78b22dd6c26f8dc15bd"},{url:"index.runtime.0705da47.js",revision:"ca64393056c1696fdef5b80d35de93b6"},{url:"index.runtime.0705da47.js.map",revision:"b3e90ecd36d81a97cdc773cb87b3161d"},{url:"index.runtime.e2efd653.js",revision:"19e66cd660e72f384683f025433508b4"},{url:"index.runtime.e2efd653.js.map",revision:"3858bf935d67ce2f94f33ae650ed4938"},{url:"manifest.webmanifest",revision:"d7bd1470f20cc3f518b91def065661ae"},{url:"spinner-light.4452ed29.svg",revision:"609c6274c68c19f6badaf5488b6aeef2"}],{})})); +if(!self.define){let e,c={};const i=(i,d)=>(i=new URL(i+".js",d).href,c[i]||new Promise((c=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=c,document.head.appendChild(e)}else e=i,importScripts(i),c()})).then((()=>{let e=c[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(d,n)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(c[r])return;let a={};const s=e=>i(e,r),f={module:{uri:r},exports:a,require:s};c[r]=Promise.all(d.map((e=>f[e]||s(e)))).then((e=>(n(...e),a)))}}define(["./workbox-1c3383c2"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"apple-touch-icon.cbfc4d72.png",revision:"032bc7d807514f1eb6efb000f9fdff26"},{url:"camera-scanner.42ef82b0.png",revision:"6379ba2fd5e1e6b16874979a282077b8"},{url:"es.ca5c1521.js",revision:"bdeced2ed83be1a8eb203ed157815830"},{url:"es.ca5c1521.js.map",revision:"968d20e007cc9032d81b9cca55598b26"},{url:"es.f464ecf6.js",revision:"de7f0cea08c219da2a74aebe279d0ee9"},{url:"es.f464ecf6.js.map",revision:"b529129d5c3dae342f534ca5db5596ec"},{url:"favicon.a05bdb0a.ico",revision:"ece89efb9e6bf43b4a1a4bddc3e6c0ee"},{url:"icon-large.cd373832.png",revision:"52b2012c4056f0da66ea3ed518dd8e10"},{url:"icon-medium.ede1e868.png",revision:"03ee967b5d869e1ae1e8e63ed13edbf2"},{url:"icon-small.81a93e10.png",revision:"70955d3c62fbbfeec3ce088f908d6f57"},{url:"image-scanner.82276613.png",revision:"c878ced18794653941259faa24e9d41c"},{url:"index.98a7b582.js",revision:"3fa2ad8d96c4c904414f858a549cdb14"},{url:"index.98a7b582.js.map",revision:"075a517ce0210c3eb84f9da7e2f21645"},{url:"index.a88fc2f6.js",revision:"231653580a328102ada7f548b073e4ae"},{url:"index.a88fc2f6.js.map",revision:"0852c74d18ef34a6f97e11a87e54239e"},{url:"index.bb1ce697.js",revision:"82f689cbc7405307d1eb42c297e81360"},{url:"index.bb1ce697.js.map",revision:"a581e787ac4468ce653d4028ea2d6f76"},{url:"index.e93d0af3.js",revision:"443fe6705dc3ba2b1b6ac6a6b2735a5e"},{url:"index.e93d0af3.js.map",revision:"4c37bd3298ca286f6b6f6eb052fac6ef"},{url:"index.f9910dec.css",revision:"e74c361efd14b6bd66529ceb2d0509c8"},{url:"index.f9910dec.css.map",revision:"4d910ee564cda4bf75e25d0e5b921b3d"},{url:"index.html",revision:"c8c86e68e4bcf8284c66ff099a9bcddb"},{url:"index.runtime.6396ce86.js",revision:"18bc07404f9e6bce0a0e72564da49825"},{url:"index.runtime.6396ce86.js.map",revision:"8008d4dda6d221149430cbaba6223cb8"},{url:"index.runtime.a8de4955.js",revision:"cb02d76f38cec6eeccbcb4c29cd07039"},{url:"index.runtime.a8de4955.js.map",revision:"98db81f2f90d5aa183fdd83bc3c53fc8"},{url:"manifest.webmanifest",revision:"d7bd1470f20cc3f518b91def065661ae"},{url:"spinner-light.4452ed29.svg",revision:"609c6274c68c19f6badaf5488b6aeef2"}],{})})); //# sourceMappingURL=service-worker.js.map diff --git a/service-worker.js.map b/service-worker.js.map index eec7dde..978ffa3 100644 --- a/service-worker.js.map +++ b/service-worker.js.map @@ -1 +1 @@ -{"version":3,"file":"service-worker.js","sources":["../../../../../private/var/folders/zx/dmx9cv356r96j_n2br2yf6j80000gn/T/e4d41fbe87bc7ef5ebfcb2ac8f709a6a/service-worker.js"],"sourcesContent":["import {clientsClaim as workbox_core_clientsClaim} from '/Users/georgeraptis/Projects/personal/barcode-scanner/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/georgeraptis/Projects/personal/barcode-scanner/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"apple-touch-icon.cbfc4d72.png\",\n \"revision\": \"032bc7d807514f1eb6efb000f9fdff26\"\n },\n {\n \"url\": \"camera-scanner.42ef82b0.png\",\n \"revision\": \"6379ba2fd5e1e6b16874979a282077b8\"\n },\n {\n \"url\": \"es.ca5c1521.js\",\n \"revision\": \"bdeced2ed83be1a8eb203ed157815830\"\n },\n {\n \"url\": \"es.ca5c1521.js.map\",\n \"revision\": \"968d20e007cc9032d81b9cca55598b26\"\n },\n {\n \"url\": \"es.f464ecf6.js\",\n \"revision\": \"de7f0cea08c219da2a74aebe279d0ee9\"\n },\n {\n \"url\": \"es.f464ecf6.js.map\",\n \"revision\": \"b529129d5c3dae342f534ca5db5596ec\"\n },\n {\n \"url\": \"favicon.a05bdb0a.ico\",\n \"revision\": \"ece89efb9e6bf43b4a1a4bddc3e6c0ee\"\n },\n {\n \"url\": \"icon-large.cd373832.png\",\n \"revision\": \"52b2012c4056f0da66ea3ed518dd8e10\"\n },\n {\n \"url\": \"icon-medium.ede1e868.png\",\n \"revision\": \"03ee967b5d869e1ae1e8e63ed13edbf2\"\n },\n {\n \"url\": \"icon-small.81a93e10.png\",\n \"revision\": \"70955d3c62fbbfeec3ce088f908d6f57\"\n },\n {\n \"url\": \"image-scanner.82276613.png\",\n \"revision\": \"c878ced18794653941259faa24e9d41c\"\n },\n {\n \"url\": \"index.0a6e9ff0.js\",\n \"revision\": \"e66adafae53cc475830c0df99c0a55c1\"\n },\n {\n \"url\": \"index.0a6e9ff0.js.map\",\n \"revision\": \"1c55cd36137e39c07084be23655015f1\"\n },\n {\n \"url\": \"index.65ac40f6.js\",\n \"revision\": \"797a08c9ecd0ba2c3bdb16996eac9d85\"\n },\n {\n \"url\": \"index.65ac40f6.js.map\",\n \"revision\": \"c94ecb2828ba5141d9e715b7148ea5f1\"\n },\n {\n \"url\": \"index.98a7b582.js\",\n \"revision\": \"3fa2ad8d96c4c904414f858a549cdb14\"\n },\n {\n \"url\": \"index.98a7b582.js.map\",\n \"revision\": \"075a517ce0210c3eb84f9da7e2f21645\"\n },\n {\n \"url\": \"index.bb1ce697.js\",\n \"revision\": \"82f689cbc7405307d1eb42c297e81360\"\n },\n {\n \"url\": \"index.bb1ce697.js.map\",\n \"revision\": \"a581e787ac4468ce653d4028ea2d6f76\"\n },\n {\n \"url\": \"index.f9910dec.css\",\n \"revision\": \"e74c361efd14b6bd66529ceb2d0509c8\"\n },\n {\n \"url\": \"index.f9910dec.css.map\",\n \"revision\": \"4d910ee564cda4bf75e25d0e5b921b3d\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"a3054a7a99d2a78b22dd6c26f8dc15bd\"\n },\n {\n \"url\": \"index.runtime.0705da47.js\",\n \"revision\": \"ca64393056c1696fdef5b80d35de93b6\"\n },\n {\n \"url\": \"index.runtime.0705da47.js.map\",\n \"revision\": \"b3e90ecd36d81a97cdc773cb87b3161d\"\n },\n {\n \"url\": \"index.runtime.e2efd653.js\",\n \"revision\": \"19e66cd660e72f384683f025433508b4\"\n },\n {\n \"url\": \"index.runtime.e2efd653.js.map\",\n \"revision\": \"3858bf935d67ce2f94f33ae650ed4938\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"d7bd1470f20cc3f518b91def065661ae\"\n },\n {\n \"url\": \"spinner-light.4452ed29.svg\",\n \"revision\": \"609c6274c68c19f6badaf5488b6aeef2\"\n }\n], {});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision"],"mappings":"0nBAoBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,qCAEb,CAAA"} \ No newline at end of file +{"version":3,"file":"service-worker.js","sources":["../../../../../private/var/folders/zx/dmx9cv356r96j_n2br2yf6j80000gn/T/0baeba9d301a2efd5662a34a614cbbbd/service-worker.js"],"sourcesContent":["import {clientsClaim as workbox_core_clientsClaim} from '/Users/georgeraptis/Projects/personal/barcode-scanner/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/georgeraptis/Projects/personal/barcode-scanner/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"apple-touch-icon.cbfc4d72.png\",\n \"revision\": \"032bc7d807514f1eb6efb000f9fdff26\"\n },\n {\n \"url\": \"camera-scanner.42ef82b0.png\",\n \"revision\": \"6379ba2fd5e1e6b16874979a282077b8\"\n },\n {\n \"url\": \"es.ca5c1521.js\",\n \"revision\": \"bdeced2ed83be1a8eb203ed157815830\"\n },\n {\n \"url\": \"es.ca5c1521.js.map\",\n \"revision\": \"968d20e007cc9032d81b9cca55598b26\"\n },\n {\n \"url\": \"es.f464ecf6.js\",\n \"revision\": \"de7f0cea08c219da2a74aebe279d0ee9\"\n },\n {\n \"url\": \"es.f464ecf6.js.map\",\n \"revision\": \"b529129d5c3dae342f534ca5db5596ec\"\n },\n {\n \"url\": \"favicon.a05bdb0a.ico\",\n \"revision\": \"ece89efb9e6bf43b4a1a4bddc3e6c0ee\"\n },\n {\n \"url\": \"icon-large.cd373832.png\",\n \"revision\": \"52b2012c4056f0da66ea3ed518dd8e10\"\n },\n {\n \"url\": \"icon-medium.ede1e868.png\",\n \"revision\": \"03ee967b5d869e1ae1e8e63ed13edbf2\"\n },\n {\n \"url\": \"icon-small.81a93e10.png\",\n \"revision\": \"70955d3c62fbbfeec3ce088f908d6f57\"\n },\n {\n \"url\": \"image-scanner.82276613.png\",\n \"revision\": \"c878ced18794653941259faa24e9d41c\"\n },\n {\n \"url\": \"index.98a7b582.js\",\n \"revision\": \"3fa2ad8d96c4c904414f858a549cdb14\"\n },\n {\n \"url\": \"index.98a7b582.js.map\",\n \"revision\": \"075a517ce0210c3eb84f9da7e2f21645\"\n },\n {\n \"url\": \"index.a88fc2f6.js\",\n \"revision\": \"231653580a328102ada7f548b073e4ae\"\n },\n {\n \"url\": \"index.a88fc2f6.js.map\",\n \"revision\": \"0852c74d18ef34a6f97e11a87e54239e\"\n },\n {\n \"url\": \"index.bb1ce697.js\",\n \"revision\": \"82f689cbc7405307d1eb42c297e81360\"\n },\n {\n \"url\": \"index.bb1ce697.js.map\",\n \"revision\": \"a581e787ac4468ce653d4028ea2d6f76\"\n },\n {\n \"url\": \"index.e93d0af3.js\",\n \"revision\": \"443fe6705dc3ba2b1b6ac6a6b2735a5e\"\n },\n {\n \"url\": \"index.e93d0af3.js.map\",\n \"revision\": \"4c37bd3298ca286f6b6f6eb052fac6ef\"\n },\n {\n \"url\": \"index.f9910dec.css\",\n \"revision\": \"e74c361efd14b6bd66529ceb2d0509c8\"\n },\n {\n \"url\": \"index.f9910dec.css.map\",\n \"revision\": \"4d910ee564cda4bf75e25d0e5b921b3d\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"c8c86e68e4bcf8284c66ff099a9bcddb\"\n },\n {\n \"url\": \"index.runtime.6396ce86.js\",\n \"revision\": \"18bc07404f9e6bce0a0e72564da49825\"\n },\n {\n \"url\": \"index.runtime.6396ce86.js.map\",\n \"revision\": \"8008d4dda6d221149430cbaba6223cb8\"\n },\n {\n \"url\": \"index.runtime.a8de4955.js\",\n \"revision\": \"cb02d76f38cec6eeccbcb4c29cd07039\"\n },\n {\n \"url\": \"index.runtime.a8de4955.js.map\",\n \"revision\": \"98db81f2f90d5aa183fdd83bc3c53fc8\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"d7bd1470f20cc3f518b91def065661ae\"\n },\n {\n \"url\": \"spinner-light.4452ed29.svg\",\n \"revision\": \"609c6274c68c19f6badaf5488b6aeef2\"\n }\n], {});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision"],"mappings":"0nBAoBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,qCAEb,CAAA"} \ No newline at end of file