(()=>{var t={436:t=>{var e;e=()=>{var t=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o={};((e,i)=>{for(var n in i)t(e,n,{get:i[n],enumerable:!0})})(o,{Iti:()=>b,default:()=>w});var s=[["af","93"],["ax","358",1,["18"]],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"]],["cc","61",1,["89162"]],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"]],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"]],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"]],["jo","962"],["kz","7",1,["33","7"]],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"]],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0],["ro","40"],["ru","7",0],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["ug","256"],["ua","380"],["ae","971"],["gb","44",0],["us","1",0],["uy","598"],["vi","1",24,["340"]],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"]],["ye","967"],["zm","260"],["zw","263"]],r=[];for(let t=0;tt.replace(/\D/g,""),m=(t="")=>t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),f=t=>{const e=p(t);if("1"===e.charAt(0)){const t=e.substr(1,3);return-1!==h.indexOf(t)}return!1},g=(t,e,i)=>{const n=document.createElement(t);return e&&Object.entries(e).forEach(([t,e])=>n.setAttribute(t,e)),i&&i.appendChild(n),n},v=(t,...e)=>{const{instances:i}=y;Object.values(i).forEach(i=>i[t](...e))},b=class{constructor(t,e={}){this.id=u++,this.telInput=t,this.highlightedItem=null,this.options=Object.assign({},c,e),this.hadInitialPlaceholder=Boolean(t.getAttribute("placeholder"))}_init(){this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),1===this.options.onlyCountries.length&&(this.options.initialCountry=this.options.onlyCountries[0]),this.options.separateDialCode&&(this.options.nationalMode=!1),!this.options.allowDropdown||this.options.showFlags||this.options.separateDialCode||(this.options.nationalMode=!1),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isAndroid="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),this.isRTL=!!this.telInput.closest("[dir=rtl]");const t=this.options.allowDropdown||this.options.separateDialCode;this.showSelectedCountryOnLeft=this.isRTL?!t:t,this.options.separateDialCode&&(this.isRTL?this.originalPaddingRight=this.telInput.style.paddingRight:this.originalPaddingLeft=this.telInput.style.paddingLeft),this.options.i18n={...l,...this.options.i18n};const e=new Promise((t,e)=>{this.resolveAutoCountryPromise=t,this.rejectAutoCountryPromise=e}),i=new Promise((t,e)=>{this.resolveUtilsScriptPromise=t,this.rejectUtilsScriptPromise=e});this.promise=Promise.all([e,i]),this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}_processCountryData(){this._processAllCountries(),this._processDialCodes(),this._translateCountryNames(),this._sortCountries()}_sortCountries(){this.options.countryOrder&&(this.options.countryOrder=this.options.countryOrder.map(t=>t.toLowerCase())),this.countries.sort((t,e)=>{const{countryOrder:i}=this.options;if(i){const n=i.indexOf(t.iso2),o=i.indexOf(e.iso2),s=n>-1,r=o>-1;if(s||r)return s&&r?n-o:s?-1:1}return t.name.localeCompare(e.name)})}_addToDialCodeMap(t,e,i){e.length>this.dialCodeMaxLen&&(this.dialCodeMaxLen=e.length),this.dialCodeToIso2Map.hasOwnProperty(e)||(this.dialCodeToIso2Map[e]=[]);for(let i=0;it.toLowerCase());this.countries=a.filter(t=>e.indexOf(t.iso2)>-1)}else if(e.length){const t=e.map(t=>t.toLowerCase());this.countries=a.filter(e=>-1===t.indexOf(e.iso2))}else this.countries=a}_translateCountryNames(){for(let t=0;t`),o+=`${e.name}`,o+=`+${e.dialCode}`,n.insertAdjacentHTML("beforeend",o)}}_setInitialState(t=!1){const e=this.telInput.getAttribute("value"),i=this.telInput.value,n=!e||"+"!==e.charAt(0)||i&&"+"===i.charAt(0)?i:e,o=this._getDialCode(n),s=f(n),{initialCountry:r,geoIpLookup:a}=this.options,l="auto"===r&&a;if(o&&!s)this._updateCountryFromNumber(n);else if(!l||t){const t=r?r.toLowerCase():"";t&&this._getCountryData(t,!0)?this._setCountry(t):o&&s?this._setCountry("us"):this._setCountry()}n&&this._updateValFromNumber(n)}_initListeners(){this._initTelInputListeners(),this.options.allowDropdown&&this._initDropdownListeners(),(this.hiddenInput||this.hiddenInputCountry)&&this.telInput.form&&this._initHiddenInputListener()}_initHiddenInputListener(){this._handleHiddenInputSubmit=()=>{this.hiddenInput&&(this.hiddenInput.value=this.getNumber()),this.hiddenInputCountry&&(this.hiddenInputCountry.value=this.getSelectedCountryData().iso2||"")},this.telInput.form?.addEventListener("submit",this._handleHiddenInputSubmit)}_initDropdownListeners(){this._handleLabelClick=t=>{this.dropdownContent.classList.contains("iti__hide")?this.telInput.focus():t.preventDefault()};const t=this.telInput.closest("label");t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedCountry=()=>{!this.dropdownContent.classList.contains("iti__hide")||this.telInput.disabled||this.telInput.readOnly||this._openDropdown()},this.selectedCountry.addEventListener("click",this._handleClickSelectedCountry),this._handleCountryContainerKeydown=t=>{this.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this._openDropdown()),"Tab"===t.key&&this._closeDropdown()},this.countryContainer.addEventListener("keydown",this._handleCountryContainerKeydown)}_initRequests(){let{loadUtilsOnInit:t,utilsScript:e,initialCountry:i,geoIpLookup:n}=this.options;!t&&e&&(t=e),t&&!y.utils?(this._handlePageLoad=()=>{window.removeEventListener("load",this._handlePageLoad),y.loadUtils(t)?.catch(()=>{})},y.documentReady()?this._handlePageLoad():window.addEventListener("load",this._handlePageLoad)):this.resolveUtilsScriptPromise(),"auto"===i&&n&&!this.selectedCountryData.iso2?this._loadAutoCountry():this.resolveAutoCountryPromise()}_loadAutoCountry(){y.autoCountry?this.handleAutoCountry():y.startedLoadingAutoCountry||(y.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((t="")=>{const e=t.toLowerCase();e&&this._getCountryData(e,!0)?(y.autoCountry=e,setTimeout(()=>v("handleAutoCountry"))):(this._setInitialState(!0),v("rejectAutoCountryPromise"))},()=>{this._setInitialState(!0),v("rejectAutoCountryPromise")}))}_openDropdownWithPlus(){this._openDropdown(),this.searchInput.value="+",this._filterCountries("",!0)}_initTelInputListeners(){const{strictMode:t,formatAsYouType:e,separateDialCode:i,formatOnDisplay:n,allowDropdown:o,countrySearch:s}=this.options;let r=!1;/\p{L}/u.test(this.telInput.value)&&(r=!0),this._handleInputEvent=a=>{if(this.isAndroid&&"+"===a?.data&&i&&o&&s){const t=this.telInput.selectionStart||0,e=this.telInput.value.substring(0,t-1),i=this.telInput.value.substring(t);return this.telInput.value=e+i,void this._openDropdownWithPlus()}this._updateCountryFromNumber(this.telInput.value)&&this._triggerCountryChange();const l=a?.data&&/[^+0-9]/.test(a.data),d="insertFromPaste"===a?.inputType&&this.telInput.value;l||d&&!t?r=!0:/[^+0-9]/.test(this.telInput.value)||(r=!1);const u=a?.detail&&a.detail.isSetNumber&&!n;if(e&&!r&&!u){const t=this.telInput.selectionStart||0,e=this.telInput.value.substring(0,t).replace(/[^+0-9]/g,"").length,i="deleteContentForward"===a?.inputType,n=this._formatNumberAsYouType(),o=((t,e,i,n)=>{if(0===i&&!n)return 0;let o=0;for(let i=0;i{if(e.key&&1===e.key.length&&!e.altKey&&!e.ctrlKey&&!e.metaKey){if(i&&o&&s&&"+"===e.key)return e.preventDefault(),void this._openDropdownWithPlus();if(t){const t=this.telInput.value,n="+"===t.charAt(0),o=!n&&0===this.telInput.selectionStart&&"+"===e.key,s=/^[0-9]$/.test(e.key),r=i?s:o||s,a=t.slice(0,this.telInput.selectionStart)+e.key+t.slice(this.telInput.selectionEnd),l=this._getFullNumber(a),d=y.utils.getCoreNumber(l,this.selectedCountryData.iso2),u=this.maxCoreNumberLength&&d.length>this.maxCoreNumberLength;let c=!1;if(n){const t=this.selectedCountryData.iso2;c=this._getCountryFromNumber(l)!==t}r&&(!u||c||o)||e.preventDefault()}}},this.telInput.addEventListener("keydown",this._handleKeydownEvent))}_cap(t){const e=parseInt(this.telInput.getAttribute("maxlength")||"",10);return e&&t.length>e?t.substr(0,e):t}_trigger(t,e={}){const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.telInput.dispatchEvent(i)}_openDropdown(){const{fixDropdownWidth:t,countrySearch:e}=this.options;if(t&&(this.dropdownContent.style.width=`${this.telInput.offsetWidth}px`),this.dropdownContent.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._setDropdownPosition(),e){const t=this.countryList.firstElementChild;t&&(this._highlightListItem(t,!1),this.countryList.scrollTop=0),this.searchInput.focus()}this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}_setDropdownPosition(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){const t=this.telInput.getBoundingClientRect(),e=this.telInput.offsetHeight;this.options.dropdownContainer&&(this.dropdown.style.top=`${t.top+e}px`,this.dropdown.style.left=`${t.left}px`,this._handleWindowScroll=()=>this._closeDropdown(),window.addEventListener("scroll",this._handleWindowScroll))}}_bindDropdownListeners(){this._handleMouseoverCountryList=t=>{const e=t.target?.closest(".iti__country");e&&this._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=t=>{const e=t.target?.closest(".iti__country");e&&this._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);let t=!0;this._handleClickOffToClose=()=>{t||this._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);let e="",i=null;if(this._handleKeydownOnDropdown=t=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key?this._handleUpDownKey(t.key):"Enter"===t.key?this._handleEnterKey():"Escape"===t.key&&this._closeDropdown()),!this.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(t.stopPropagation(),i&&clearTimeout(i),e+=t.key.toLowerCase(),this._searchForCountry(e),i=setTimeout(()=>{e=""},1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){const t=()=>{const t=this.searchInput.value.trim();t?this._filterCountries(t):this._filterCountries("",!0)};let e=null;this._handleSearchChange=()=>{e&&clearTimeout(e),e=setTimeout(()=>{t(),e=null},100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",t=>t.stopPropagation())}}_searchForCountry(t){for(let e=0;et[0]).join("").toLowerCase(),a=`+${o.dialCode}`;if(e||s.includes(n)||a.includes(n)||o.iso2.includes(n)||r.includes(n)){const t=o.nodeById[this.id];t&&this.countryList.appendChild(t),i&&(this._highlightListItem(t,!1),i=!1)}}i&&this._highlightListItem(null,!1),this.countryList.scrollTop=0,this._updateSearchResultsText()}_updateSearchResultsText(){const{i18n:t}=this.options,e=this.countryList.childElementCount;let i;i=0===e?t.zeroSearchResults:1===e?t.oneSearchResult:t.multipleSearchResults.replace("${count}",e.toString()),this.searchResultsA11yText.textContent=i}_handleUpDownKey(t){let e="ArrowUp"===t?this.highlightedItem?.previousElementSibling:this.highlightedItem?.nextElementSibling;!e&&this.countryList.childElementCount>1&&(e="ArrowUp"===t?this.countryList.lastElementChild:this.countryList.firstElementChild),e&&(this._scrollTo(e),this._highlightListItem(e,!1))}_handleEnterKey(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}_updateValFromNumber(t){let e=t;if(this.options.formatOnDisplay&&y.utils&&this.selectedCountryData){const t=this.options.nationalMode||"+"!==e.charAt(0)&&!this.options.separateDialCode,{NATIONAL:i,INTERNATIONAL:n}=y.utils.numberFormat,o=t?i:n;e=y.utils.formatNumber(e,this.selectedCountryData.iso2,o)}e=this._beforeSetNumber(e),this.telInput.value=e}_updateCountryFromNumber(t){const e=this._getCountryFromNumber(t);return null!==e&&this._setCountry(e)}_getCountryFromNumber(t){const e=t.indexOf("+");let i=e?t.substring(e):t;const n=this.selectedCountryData.dialCode;i&&"1"===n&&"+"!==i.charAt(0)&&("1"!==i.charAt(0)&&(i=`1${i}`),i=`+${i}`),this.options.separateDialCode&&n&&"+"!==i.charAt(0)&&(i=`+${n}${i}`);const o=this._getDialCode(i,!0),s=p(i);if(o){const t=this.dialCodeToIso2Map[p(o)],e=-1!==t.indexOf(this.selectedCountryData.iso2)&&s.length<=o.length-1;if(!("1"===n&&f(s)||e))for(let e=0;es){const t=n-r;e.scrollTop=d-t}}_updateDialCode(t){const e=this.telInput.value,i=`+${t}`;let n;if("+"===e.charAt(0)){const t=this._getDialCode(e);n=t?e.replace(t,i):i,this.telInput.value=n}}_getDialCode(t,e){let i="";if("+"===t.charAt(0)){let n="";for(let o=0;o-1){const i=t.substring(0,e),n=this._utilsIsPossibleNumber(i),o=this._utilsIsPossibleNumber(t);return n&&o}return this._utilsIsPossibleNumber(t)}_utilsIsPossibleNumber(t){return y.utils?y.utils.isPossibleNumber(t,this.selectedCountryData.iso2,this.options.validationNumberType):null}isValidNumberPrecise(){if(!this.selectedCountryData.iso2)return!1;const t=this._getFullNumber(),e=t.search(/\p{L}/u);if(e>-1){const i=t.substring(0,e),n=this._utilsIsValidNumber(i),o=this._utilsIsValidNumber(t);return n&&o}return this._utilsIsValidNumber(t)}_utilsIsValidNumber(t){return y.utils?y.utils.isValidNumber(t,this.selectedCountryData.iso2):null}setCountry(t){const e=t?.toLowerCase(),i=this.selectedCountryData.iso2;(t&&e!==i||!t&&i)&&(this._setCountry(e),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}setNumber(t){const e=this._updateCountryFromNumber(t);this._updateValFromNumber(t),e&&this._triggerCountryChange(),this._trigger("input",{isSetNumber:!0})}setPlaceholderNumberType(t){this.options.placeholderNumberType=t,this._updatePlaceholder()}setDisabled(t){this.telInput.disabled=t,t?this.selectedCountry.setAttribute("disabled","true"):this.selectedCountry.removeAttribute("disabled")}},y=Object.assign((t,e)=>{const i=new b(t,e);return i._init(),t.setAttribute("data-intl-tel-input-id",i.id.toString()),y.instances[i.id]=i,i},{defaults:c,documentReady:()=>"complete"===document.readyState,getCountryData:()=>a,getInstance:t=>{const e=t.getAttribute("data-intl-tel-input-id");return e?y.instances[e]:null},instances:{},loadUtils:t=>{if(!y.utils&&!y.startedLoadingUtilsScript){let e;if("string"==typeof t)e=import(t);else{if("function"!=typeof t)return Promise.reject(new TypeError("The argument passed to loadUtils must be a URL string or a function that returns a promise for the utilities module, not "+typeof t));try{e=Promise.resolve(t())}catch(t){return Promise.reject(t)}}return y.startedLoadingUtilsScript=!0,e.then(e=>{const i=e?.default;if(!i||"object"!=typeof i)throw"string"==typeof t?new TypeError(`The module loaded from ${t} did not set utils as its default export.`):new TypeError("The loader function passed to loadUtils did not resolve to a module object with utils as its default export.");return y.utils=i,v("handleUtils"),!0}).catch(t=>{throw v("rejectUtilsScriptPromise",t),t})}return null},startedLoadingUtilsScript:!1,startedLoadingAutoCountry:!1,version:"24.8.2"}),w=y;return d=o,((o,s,r,a)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let l of i(s))n.call(o,l)||l===r||t(o,l,{get:()=>s[l],enumerable:!(a=e(s,l))||a.enumerable});return o})(t({},"__esModule",{value:!0}),d)})();return t.default},t.exports?t.exports=e():window.intlTelInput=e()}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=new(function(){function t(){this._instances={Accordion:{},Carousel:{},Collapse:{},Dial:{},Dismiss:{},Drawer:{},Dropdown:{},Modal:{},Popover:{},Tabs:{},Tooltip:{},InputCounter:{},CopyClipboard:{},Datepicker:{}}}return t.prototype.addInstance=function(t,e,i,n){if(void 0===n&&(n=!1),!this._instances[t])return"Flowbite: Component ".concat(t," does not exist."),!1;!this._instances[t][i]||n?(n&&this._instances[t][i]&&this._instances[t][i].destroyAndRemoveInstance(),this._instances[t][i||this._generateRandomId()]=e):"Flowbite: Instance with ID ".concat(i," already exists.")},t.prototype.getAllInstances=function(){return this._instances},t.prototype.getInstances=function(t){return this._instances[t]?this._instances[t]:("Flowbite: Component ".concat(t," does not exist."),!1)},t.prototype.getInstance=function(t,e){if(this._componentAndInstanceCheck(t,e)){if(this._instances[t][e])return this._instances[t][e];"Flowbite: Instance with ID ".concat(e," does not exist.")}},t.prototype.destroyAndRemoveInstance=function(t,e){this._componentAndInstanceCheck(t,e)&&(this.destroyInstanceObject(t,e),this.removeInstance(t,e))},t.prototype.removeInstance=function(t,e){this._componentAndInstanceCheck(t,e)&&delete this._instances[t][e]},t.prototype.destroyInstanceObject=function(t,e){this._componentAndInstanceCheck(t,e)&&this._instances[t][e].destroy()},t.prototype.instanceExists=function(t,e){return!!this._instances[t]&&!!this._instances[t][e]},t.prototype._generateRandomId=function(){return Math.random().toString(36).substr(2,9)},t.prototype._componentAndInstanceCheck=function(t,e){return this._instances[t]?!!this._instances[t][e]||("Flowbite: Instance with ID ".concat(e," does not exist."),!1):("Flowbite: Component ".concat(t," does not exist."),!1)},t}());const e=t;"undefined"!=typeof window&&(window.FlowbiteInstances=t);var n=function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{t.hide()},2e3),setTimeout(()=>{this.save.classList.remove("opacity-0")},2500)}onAdd(){this.add.classList.remove("hidden");const t=new a(this.add);setTimeout(()=>{t.hide()},2e3),setTimeout(()=>{this.add.classList.remove("opacity-0")},2500)}onRemove(){this.remove.classList.remove("hidden");const t=new a(this.remove);setTimeout(()=>{t.hide()},2e3),setTimeout(()=>{this.remove.classList.remove("opacity-0")},2500)}}var d=i(436),u=i.n(d);function c(t){return!new RegExp("([a-zA-Z0-9]+://)?([a-zA-Z0-9_]+:[a-zA-Z0-9_]+@)?([a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})(:[0-9]+)?(/.*)?").test(t)}var h=function(){return h=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{this.method=e.id}};this.tabs=new g(s,r,a);const l=this.shadowRoot.getElementById("phone");if(l&&this.sms_enabled){if(!l.getAttribute("readonly")){const t=l.getAttribute("data-country")||"US";this.phone_intl=u()(l,{autoPlaceholder:"aggressive",initialCountry:"auto",geoIpLookup:(t,e)=>{fetch("https://ipapi.co/json").then(t=>t.json()).then(e=>t(e.country_code)).catch(()=>e())},countryOrder:[t],utilsScript:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.3.7/build/js/utils.js"})}}}setSaveOrderCallback(t){this.save_order_cb=t}setAddVoucherCallback(t){this.add_voucher_cb=t}setLoading(t){this.loading=t,this.loading?this.save_button.classList.add("loading"):this.save_button.classList.remove("loading")}setForm(t){t.giftnote_to&&this.to&&(this.to.value=t.giftnote_to),t.giftnote_from&&this.from&&(this.from.value=t.giftnote_from),t.giftnote_message&&this.message&&(this.message.value=t.giftnote_message,this.message_count.innerHTML=t.giftnote_message.length.toString()),t.giftnote_email&&this.email&&(this.email.value=t.giftnote_email),t.giftnote_phone&&this.phone_intl&&this.phone_intl.setNumber(t.giftnote_phone),t.giftnote_method&&(this.method=t.giftnote_method,this.tabs.show(this.method),"instant"===t.giftnote_method&&this.instant?(this.instant.checked=!0,this.scheduled.checked=!1,this.tracked.checked=!1):"scheduled"===t.giftnote_method&&this.scheduled?(this.instant.checked=!1,this.scheduled.checked=!0,this.tracked.checked=!1):"tracked"===t.giftnote_method&&this.tracked&&(this.instant.checked=!1,this.scheduled.checked=!1,this.tracked.checked=!0)),t.giftnote_time&&this.date&&(this.date.value=b(y(t.giftnote_time),"yyyy-MM-dd")),t.giftnote_time&&this.time&&(this.time.value=b(y(t.giftnote_time),"HHmm"))}clearForm(){const t=this.shadowRoot.querySelector("#tracked-tab-parent.force-hidden");this.to&&(this.to.value=null),this.from&&(this.from.value=null),this.message&&(this.message.value=null),this.email&&(this.email.value=null),this.phone_intl&&this.phone_intl.setNumber(""),this.tabs&&this.tabs.show(this.voucher?this.default_giftcard_method:this.default_order_method),this.instant&&(this.instant.checked=!!t),this.tracked&&(this.tracked.checked=!t),this.scheduled&&(this.scheduled.checked=!1),this.date&&(this.date.value=this.currentDate),this.time&&(this.time.value=this.currentTime)}attachListeners(){this.to&&this.to.addEventListener("change",()=>this.validateTo()),this.from&&this.from.addEventListener("change",()=>this.validateFrom()),this.message&&this.message.addEventListener("input",()=>this.validateMessage()),this.email&&this.email.addEventListener("change",()=>this.validateEmail()),this.phone&&this.phone.addEventListener("change",()=>this.validatePhone()),this.instant&&this.instant.addEventListener("change",t=>this.methodChange(t)),this.scheduled&&this.scheduled.addEventListener("change",t=>this.methodChange(t)),this.tracked&&this.tracked.addEventListener("change",t=>this.methodChange(t)),this.date&&(this.date.addEventListener("change",()=>this.dateChange()),this.date.addEventListener("input",()=>this.validateTime())),this.time&&this.time.addEventListener("change",()=>this.validateTime()),this.save_button&&this.save_button.addEventListener("click",()=>this.handleSubmit())}methodChange(t){const e=t.currentTarget.value;this.method=e}dateChange(){this.date.value===this.currentDate?(this.currentDate,this.currentTime,this.hideTimeOptions()):this.showTimeOptions(),this.validateTime()}hideTimeOptions(){for(const t of this.time_options){let e=parseInt(t.value);if(!(parseInt(this.currentTime)>e))return void(this.time.value=e.toString());t.classList.add("hidden")}}showTimeOptions(){for(const t of this.time_options)t.classList.remove("hidden")}validateTo(){const t=this.to.value;t.length?c(t)?(this.to_field.classList.remove("required"),this.to_field.classList.remove("invalid"),this.to_field.classList.remove("error")):(this.to_field.classList.remove("required"),this.to_field.classList.add("invalid"),this.to_field.classList.remove("error"),this.valid=!1):(this.to_field.classList.add("required"),this.to_field.classList.remove("invalid"),this.to_field.classList.remove("error"),this.valid=!1)}validateFrom(){const t=this.from.value;t.length?c(t)?(this.from_field.classList.remove("required"),this.from_field.classList.remove("invalid"),this.from_field.classList.remove("error")):(this.from_field.classList.remove("required"),this.from_field.classList.add("invalid"),this.from_field.classList.remove("error"),this.valid=!1):(this.from_field.classList.add("required"),this.from_field.classList.remove("invalid"),this.from_field.classList.remove("error"),this.valid=!1)}validateMessage(){const t=this.message.value;t.length?c(t)?(this.message_field.classList.remove("required"),this.message_field.classList.remove("invalid"),this.message_field.classList.remove("error"),this.message_count.innerHTML=t.length.toString(),t.length>210&&(this.message_count.innerHTML="210",this.message.value=t.slice(0,210))):(this.message_field.classList.remove("required"),this.message_field.classList.add("invalid"),this.message_field.classList.remove("error"),this.valid=!1):(this.message_field.classList.add("required"),this.message_field.classList.remove("invalid"),this.message_field.classList.remove("error"),this.valid=!1)}validateEmail(){const t=this.email.value;var e;t&&(e=t,!new RegExp(/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i).test(e))?(this.email_field.classList.add("invalid"),this.email_field.classList.remove("error"),this.valid=!1):(this.email_field.classList.remove("invalid"),this.email_field.classList.remove("error")),this.medium_error.classList.add("hidden"),this.phone_field.classList.remove("medium-error"),this.email_field.classList.remove("medium-error")}validatePhone(){if(this.phone_intl&&this.sms_enabled){const t=this.phone_intl.getNumber(0),e=this.phone_intl.getNumberType();t&&this.phone_intl.getValidationError()?(this.phone_field.classList.add("invalid"),this.phone_field.classList.remove("mobile"),this.valid=!1):t&&1!==e&&2!==e?(this.phone_field.classList.remove("invalid"),this.phone_field.classList.add("mobile"),this.valid=!1):(this.phone_field.classList.remove("invalid"),this.phone_field.classList.remove("mobile")),this.medium_error.classList.add("hidden"),this.phone_field.classList.remove("medium-error"),this.email_field.classList.remove("medium-error")}}validateMedium(){const t=this.email.value,e=this.phone_intl&&this.sms_enabled?this.phone_intl.getNumber(0):null;this.sms_enabled,this.sms_enabled?t||e?(this.medium_error.classList.add("hidden"),this.phone_field.classList.remove("medium-error"),this.email_field.classList.remove("medium-error")):(this.medium_error.classList.remove("hidden"),this.phone_field.classList.add("medium-error"),this.email_field.classList.add("medium-error"),this.valid=!1):t?(this.medium_error.classList.add("hidden"),this.email_field.classList.remove("medium-error")):(this.medium_error.classList.remove("hidden"),this.email_field.classList.add("medium-error"),this.valid=!1)}validateMethod(){"instant"!==this.method&&"scheduled"!==this.method&&"tracked"!==this.method?(this.method_error.classList.remove("hidden"),this.valid=!1):this.method_error.classList.add("hidden")}validateTime(){var t,e,i,n,o,s,r,a,l,d;if("scheduled"===this.method){const u=null===(e=null===(t=this.date)||void 0===t?void 0:t.value)||void 0===e?void 0:e.trim(),c=null===(n=null===(i=this.time)||void 0===i?void 0:i.value)||void 0===n?void 0:n.trim();if(u?this.date_field.classList.remove("required"):(this.date_field.classList.add("required"),this.date_field.classList.remove("invalid"),this.valid=!1),c?this.time_field.classList.remove("required"):(this.time_field.classList.add("required"),this.time_field.classList.remove("invalid"),this.valid=!1),!u||!c)return void(this.time_iso=null);const h=w(u,"yyyy-MM-dd"),p=w(c,"HHmm");if(isNaN(h.getTime()))return console.error("Invalid date value:",u),this.date_field.classList.remove("required"),this.date_field.classList.add("invalid"),this.valid=!1,void(this.time_iso=null);if(isNaN(p.getTime()))return console.error("Invalid time value:",c),this.time_field.classList.remove("required"),this.time_field.classList.add("invalid"),this.valid=!1,void(this.time_iso=null);const m=(o=h.getFullYear(),s=h.getMonth()+1,r=h.getDate(),a=p.getHours(),l=p.getMinutes(),d=Math.floor(60*Math.random()),new Date(o,s-1,r,a,l,d));if(isNaN(m.getTime()))return console.error("Invalid combined datetime:",m),this.date_field.classList.add("invalid"),this.time_field.classList.add("invalid"),this.valid=!1,void(this.time_iso=null);if(this.time_iso=function(t){if(isNaN(t.getTime()))return console.error("Invalid date passed to toISOStringWithTimezone:",t),null;const e=t.getTimezoneOffset(),i=Math.floor(Math.abs(e)/60),n=Math.abs(e)%60,o=e<=0?"+":"-";return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}T${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}.${String(t.getMilliseconds()).padStart(3,"0")}${o}${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}`}(m),this.time_iso,!this.time_iso)return console.error("Failed to generate time_iso"),this.date_field.classList.add("invalid"),this.time_field.classList.add("invalid"),void(this.valid=!1);(function(t,e){const i=new Date(t);return i.setDate(i.getDate()+e),i})(new Date,-1)>h||_(new Date,6)m?(this.time_field.classList.remove("required"),this.time_field.classList.add("invalid"),this.valid=!1):(this.time_field.classList.remove("required"),this.time_field.classList.remove("invalid"))}else this.date_field.classList.remove("required"),this.date_field.classList.remove("invalid"),this.time_field.classList.remove("required"),this.time_field.classList.remove("invalid")}validateAll(){this.valid=!0,this.validateTo(),this.validateFrom(),this.validateMessage(),this.validateEmail(),this.validatePhone(),this.validateMedium(),this.validateMethod(),this.validateTime()}handleSubmit(){if(this.validateAll(),this.content.classList,this.variant_id,this.content.classList.contains("voucher")&&this.variant_id){const t=this.buildVoucherMessage();if(this.valid){const e=new URLSearchParams(window.location.search).get("variant");this.variant_id,e&&e!==this.variant_id?this.add_voucher_cb(e,t):this.add_voucher_cb(this.variant_id,t)}}else{const t=this.buildOrderMessage();this.valid&&this.save_order_cb(t)}}buildOrderMessage(){const t={};return t.giftnote_to=this.to.value,t.giftnote_from=this.from.value,t.giftnote_message=this.message.value,t.giftnote_method=this.method,t.giftnote_email=this.email.value||void 0,t.giftnote_phone=this.phone_intl&&this.sms_enabled&&this.phone_intl.isValidNumber()?this.phone_intl.getNumber():void 0,t.giftnote_time="scheduled"===this.method?this.time_iso:void 0,t.giftnote_source="theme",t}buildVoucherMessage(){const t={};if(t._giftnote_to=this.to.value,t._giftnote_from=this.from.value,t._giftnote_message=this.message.value,t._giftnote_method=this.method,t._giftnote_email=this.email.value||void 0,t._giftnote_phone=this.phone_intl&&this.sms_enabled&&this.phone_intl.isValidNumber()?this.phone_intl.getNumber():void 0,t._giftnote_time="scheduled"===this.method&&this.time_iso?this.time_iso:void 0,t.To=this.to.value,t.From=this.from.value,t.Message=this.message.value,t.Email=this.email.value||void 0,t.Phone=this.phone_intl&&this.sms_enabled&&this.phone_intl.isValidNumber()?this.phone_intl.getNumber():void 0,"scheduled"===this.method&&this.time_iso){const i=y(this.time_iso);t["Send at"]=isNaN(i.getTime())?void 0:(e=i,isNaN(e.getTime())?(console.error("Invalid date passed to toLocaleStringShort:",e),"Invalid Date"):e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}))}var e;return t}}var A=function(){return A=Object.assign||function(t){for(var e,i=1,n=arguments.length;isummary:first-of-type:not([inert])","details:not([inert])"],T=k.join(","),x="undefined"==typeof Element,D=x?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,P=!x&&Element.prototype.getRootNode?function(t){var e;return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},N=function t(e,i){var n;void 0===i&&(i=!0);var o=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===o||"true"===o||i&&e&&t(e.parentNode)},O=function(t,e,i){if(N(t))return[];var n=Array.prototype.slice.apply(t.querySelectorAll(T));return e&&D.call(t,T)&&n.unshift(t),n=n.filter(i)},M=function t(e,i,n){for(var o=[],s=Array.from(e);s.length;){var r=s.shift();if(!N(r,!1))if("SLOT"===r.tagName){var a=r.assignedElements(),l=t(a.length?a:r.children,!0,n);n.flatten?o.push.apply(o,l):o.push({scopeParent:r,candidates:l})}else{D.call(r,T)&&n.filter(r)&&(i||!e.includes(r))&&o.push(r);var d=r.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(r),u=!N(d,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(r));if(d&&u){var c=t(!0===d?r.children:d.children,!0,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:r,candidates:c})}else s.unshift.apply(s,r.children)}}return o},R=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},B=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(t){var e,i=null==t||null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return""===i||"true"===i}(t))&&!R(t)?0:t.tabIndex},F=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},j=function(t){return"INPUT"===t.tagName},q=function(t){return function(t){return j(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,i=t.form||P(t),n=function(t){return i.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=n(window.CSS.escape(t.name));else try{e=n(t.name)}catch(t){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",t.message),!1}var o=function(t,e){for(var i=0;isummary:first-of-type")?t.parentElement:t;if(D.call(o,"details:not([open]) *"))return!0;if(i&&"full"!==i&&"legacy-full"!==i){if("non-zero-area"===i)return H(t)}else{if("function"==typeof n){for(var s=t;t;){var r=t.parentElement,a=P(t);if(r&&!r.shadowRoot&&!0===n(r))return H(t);t=t.assignedSlot?t.assignedSlot:r||a===t.ownerDocument?r:a.host}t=s}if(function(t){var e,i,n,o,s=t&&P(t),r=null===(e=s)||void 0===e?void 0:e.host,a=!1;if(s&&s!==t)for(a=!!(null!==(i=r)&&void 0!==i&&null!==(n=i.ownerDocument)&&void 0!==n&&n.contains(r)||null!=t&&null!==(o=t.ownerDocument)&&void 0!==o&&o.contains(t));!a&&r;){var l,d,u;a=!(null===(d=r=null===(l=s=P(r))||void 0===l?void 0:l.host)||void 0===d||null===(u=d.ownerDocument)||void 0===u||!u.contains(r))}return a}(t))return!t.getClientRects().length;if("legacy-full"!==i)return!0}return!1},$=function(t,e){return!(e.disabled||N(e)||function(t){return j(t)&&"hidden"===t.type}(e)||z(e,t)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(t){return"SUMMARY"===t.tagName})}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var i=0;i=0)},G=function t(e){var i=[],n=[];return e.forEach(function(e,o){var s=!!e.scopeParent,r=s?e.scopeParent:e,a=function(t,e){var i=B(t);return i<0&&e&&!R(t)?0:i}(r,s),l=s?t(e.candidates):r;0===a?s?i.push.apply(i,l):i.push(r):n.push({documentOrder:o,tabIndex:a,item:e,isScope:s,content:l})}),n.sort(F).reduce(function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t},[]).concat(i)},K=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==D.call(t,T)&&W(e,t)},U=k.concat("iframe").join(","),Y=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==D.call(t,U)&&$(e,t)};function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i0){var i=t[t.length-1];i!==e&&i._setPausedState(!0)}var n=t.indexOf(e);-1===n||t.splice(n,1),t.push(e)},it=function(t,e){var i=t.indexOf(e);-1!==i&&t.splice(i,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)},nt=function(t){return"Tab"===(null==t?void 0:t.key)||9===(null==t?void 0:t.keyCode)},ot=function(t){return nt(t)&&!t.shiftKey},st=function(t){return nt(t)&&t.shiftKey},rt=function(t){return setTimeout(t,0)},at=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:{},i=e.hasFallback,o=void 0!==i&&i,r=e.params,a=void 0===r?[]:r,l=s[t];if("function"==typeof l&&(l=l.apply(void 0,tt(a))),!0===l&&(l=void 0),!l){if(void 0===l||!1===l)return l;throw new Error("`".concat(t,"` was specified but was not a node, or did not return a node"))}var d=l;if("string"==typeof l){try{d=n.querySelector(l)}catch(e){throw new Error("`".concat(t,'` appears to be an invalid selector; error="').concat(e.message,'"'))}if(!d&&!o)throw new Error("`".concat(t,"` as selector refers to no known node"))}return d},u=function(){var t=d("initialFocus",{hasFallback:!0});if(!1===t)return!1;if(void 0===t||t&&!Y(t,s.tabbableOptions))if(l(n.activeElement)>=0)t=n.activeElement;else{var e=r.tabbableGroups[0];t=e&&e.firstTabbableNode||d("fallbackFocus")}else null===t&&(t=d("fallbackFocus"));if(!t)throw new Error("Your focus-trap needs to have at least one focusable element");return t},c=function(){if(r.containerGroups=r.containers.map(function(t){var e=function(t,e){var i;return i=(e=e||{}).getShadowRoot?M([t],e.includeContainer,{filter:W.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:V}):O(t,e.includeContainer,W.bind(null,e)),G(i)}(t,s.tabbableOptions),i=function(t,e){return(e=e||{}).getShadowRoot?M([t],e.includeContainer,{filter:$.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):O(t,e.includeContainer,$.bind(null,e))}(t,s.tabbableOptions),n=e.length>0?e[0]:void 0,o=e.length>0?e[e.length-1]:void 0,r=i.find(function(t){return K(t)}),a=i.slice().reverse().find(function(t){return K(t)}),l=!!e.find(function(t){return B(t)>0});return{container:t,tabbableNodes:e,focusableNodes:i,posTabIndexesFound:l,firstTabbableNode:n,lastTabbableNode:o,firstDomTabbableNode:r,lastDomTabbableNode:a,nextTabbableNode:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=e.indexOf(t);return o<0?n?i.slice(i.indexOf(t)+1).find(function(t){return K(t)}):i.slice(0,i.indexOf(t)).reverse().find(function(t){return K(t)}):e[o+(n?1:-1)]}}}),r.tabbableGroups=r.containerGroups.filter(function(t){return t.tabbableNodes.length>0}),r.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(r.containerGroups.find(function(t){return t.posTabIndexesFound})&&r.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(t){var e=t.activeElement;if(e)return e.shadowRoot&&null!==e.shadowRoot.activeElement?h(e.shadowRoot):e},p=function(t){!1!==t&&t!==h(document)&&(t&&t.focus?(t.focus({preventScroll:!!s.preventScroll}),r.mostRecentlyFocusedNode=t,function(t){return t.tagName&&"input"===t.tagName.toLowerCase()&&"function"==typeof t.select}(t)&&t.select()):p(u()))},m=function(t){var e=d("setReturnFocus",{params:[t]});return e||!1!==e&&t},f=function(t){var e=t.target,i=t.event,n=t.isBackward,o=void 0!==n&&n;e=e||lt(i),c();var a=null;if(r.tabbableGroups.length>0){var u=l(e,i),h=u>=0?r.containerGroups[u]:void 0;if(u<0)a=o?r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:r.tabbableGroups[0].firstTabbableNode;else if(o){var p=r.tabbableGroups.findIndex(function(t){var i=t.firstTabbableNode;return e===i});if(p<0&&(h.container===e||Y(e,s.tabbableOptions)&&!K(e,s.tabbableOptions)&&!h.nextTabbableNode(e,!1))&&(p=u),p>=0){var m=0===p?r.tabbableGroups.length-1:p-1,f=r.tabbableGroups[m];a=B(e)>=0?f.lastTabbableNode:f.lastDomTabbableNode}else nt(i)||(a=h.nextTabbableNode(e,!1))}else{var g=r.tabbableGroups.findIndex(function(t){var i=t.lastTabbableNode;return e===i});if(g<0&&(h.container===e||Y(e,s.tabbableOptions)&&!K(e,s.tabbableOptions)&&!h.nextTabbableNode(e))&&(g=u),g>=0){var v=g===r.tabbableGroups.length-1?0:g+1,b=r.tabbableGroups[v];a=B(e)>=0?b.firstTabbableNode:b.firstDomTabbableNode}else nt(i)||(a=h.nextTabbableNode(e))}}else a=d("fallbackFocus");return a},g=function(t){var e=lt(t);l(e,t)>=0||(at(s.clickOutsideDeactivates,t)?i.deactivate({returnFocus:s.returnFocusOnDeactivate}):at(s.allowOutsideClick,t)||t.preventDefault())},v=function(t){var e=lt(t),i=l(e,t)>=0;if(i||e instanceof Document)i&&(r.mostRecentlyFocusedNode=e);else{var n;t.stopImmediatePropagation();var o=!0;if(r.mostRecentlyFocusedNode)if(B(r.mostRecentlyFocusedNode)>0){var a=l(r.mostRecentlyFocusedNode),d=r.containerGroups[a].tabbableNodes;if(d.length>0){var c=d.findIndex(function(t){return t===r.mostRecentlyFocusedNode});c>=0&&(s.isKeyForward(r.recentNavEvent)?c+1=0&&(n=d[c-1],o=!1))}}else r.containerGroups.some(function(t){return t.tabbableNodes.some(function(t){return B(t)>0})})||(o=!1);else o=!1;o&&(n=f({target:r.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(r.recentNavEvent)})),p(n||(r.mostRecentlyFocusedNode||u()))}r.recentNavEvent=void 0},b=function(t){(s.isKeyForward(t)||s.isKeyBackward(t))&&function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.recentNavEvent=t;var i=f({event:t,isBackward:e});i&&(nt(t)&&t.preventDefault(),p(i))}(t,s.isKeyBackward(t))},y=function(t){var e;"Escape"!==(null==(e=t)?void 0:e.key)&&"Esc"!==(null==e?void 0:e.key)&&27!==(null==e?void 0:e.keyCode)||!1===at(s.escapeDeactivates,t)||(t.preventDefault(),i.deactivate())},w=function(t){var e=lt(t);l(e,t)>=0||at(s.clickOutsideDeactivates,t)||at(s.allowOutsideClick,t)||(t.preventDefault(),t.stopImmediatePropagation())},_=function(){if(r.active)return et(o,i),r.delayInitialFocusTimer=s.delayInitialFocus?rt(function(){p(u())}):p(u()),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",g,{capture:!0,passive:!1}),n.addEventListener("touchstart",g,{capture:!0,passive:!1}),n.addEventListener("click",w,{capture:!0,passive:!1}),n.addEventListener("keydown",b,{capture:!0,passive:!1}),n.addEventListener("keydown",y),i},E=function(){if(r.active)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",g,!0),n.removeEventListener("touchstart",g,!0),n.removeEventListener("click",w,!0),n.removeEventListener("keydown",b,!0),n.removeEventListener("keydown",y),i},A="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(t){t.some(function(t){return Array.from(t.removedNodes).some(function(t){return t===r.mostRecentlyFocusedNode})})&&p(u())}):void 0,L=function(){A&&(A.disconnect(),r.active&&!r.paused&&r.containers.map(function(t){A.observe(t,{subtree:!0,childList:!0})}))};return i={get active(){return r.active},get paused(){return r.paused},activate:function(t){if(r.active)return this;var e=a(t,"onActivate"),i=a(t,"onPostActivate"),o=a(t,"checkCanFocusTrap");o||c(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=h(n),null==e||e();var s=function(){o&&c(),_(),L(),null==i||i()};return o?(o(r.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(t){if(!r.active)return this;var e=Q({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},t);clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,E(),r.active=!1,r.paused=!1,L(),it(o,i);var n=a(e,"onDeactivate"),l=a(e,"onPostDeactivate"),d=a(e,"checkCanReturnFocus"),u=a(e,"returnFocus","returnFocusOnDeactivate");null==n||n();var c=function(){rt(function(){u&&p(m(r.nodeFocusedBeforeActivation)),null==l||l()})};return u&&d?(d(m(r.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(t){return r.active?(r.manuallyPaused=!0,this._setPausedState(!0,t)):this},unpause:function(t){return r.active?(r.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,t)):this},updateContainerElements:function(t){var e=[].concat(t).filter(Boolean);return r.containers=e.map(function(t){return"string"==typeof t?n.querySelector(t):t}),r.active&&c(),L(),this}},Object.defineProperties(i,{_isManuallyPaused:{value:function(){return r.manuallyPaused}},_setPausedState:{value:function(t,e){if(r.paused===t)return this;if(r.paused=t,t){var i=a(e,"onPause"),n=a(e,"onPostPause");null==i||i(),E(),L(),null==n||n()}else{var o=a(e,"onUnpause"),s=a(e,"onPostUnpause");null==o||o(),c(),_(),L(),null==s||s()}return this}}}),i.updateContainerElements(t),i},ct=function(t,e,i,n){return new(i||(i=Promise))(function(o,s){function r(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,a)}l((n=n.apply(t,e||[])).next())})};class ht{constructor(t){this.isOpening=!1,this.isClosing=!1,this.isVisible=!1,this.type="order",this.shadowRoot=t,this.backdrop=this.shadowRoot.getElementById("backdrop"),this.closeButton=this.shadowRoot.getElementById("close-button"),this.content=this.shadowRoot.getElementById("content"),this.backdrop.addEventListener("click",()=>this.close(),!1),this.closeButton.addEventListener("click",()=>this.close(),!1),this.container=this.shadowRoot.getElementById("giftnote-modal"),this.modal=new S(this.container,{backdrop:"static",closable:!0,onShow:()=>{this.isVisible=!0,this.isOpening=!1,document.body.classList.add("gn-overflow-hidden"),document.body.style.touchAction="none",document.body.style.overscrollBehavior="none";const t=window.scrollY;document.body.style.top=`-${t}px`,document.body.setAttribute("data-scroll-y",t.toString())},onHide:()=>{this.isVisible=!1,this.isClosing=!1,document.body.classList.remove("gn-overflow-hidden"),document.body.style.touchAction="",document.body.style.overscrollBehavior="";const t=document.body.getAttribute("data-scroll-y");document.body.style.top="",t&&(window.scrollTo(0,parseInt(t)),document.body.removeAttribute("data-scroll-y"))},onToggle:()=>{this.isVisible,this.isOpening,this.isClosing}}),document.addEventListener("keydown",t=>{"Escape"!==t.key||this.container.classList.contains("hidden")||this.close()}),document.addEventListener("giftnote_voucher_open",()=>this.voucherOpen(),!1),document.addEventListener("giftnote_open",()=>this.open(),!1),document.addEventListener("giftnote_close",()=>this.close(),!1);if("true"!==this.container.getAttribute("data-disable-focus"))try{this.focus_trap=ut(this.content,{onActivate:()=>{this.content.classList.add("is-active")},onDeactivate:()=>{this.content.classList.remove("is-active")},fallbackFocus:()=>this.content||this.shadowRoot.getElementById("content")||void 0,initialFocus:()=>this.shadowRoot.getElementById("to")||void 0,checkCanFocusTrap:t=>ct(this,void 0,void 0,function*(){return this.isVisible,this.isOpening,new Promise((e,i)=>{if(this.isOpening||this.isClosing)return i();if(!this.isVisible)return i();t.some(t=>t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').length>0)?e():i()})}),returnFocusOnDeactivate:!0,preventScroll:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0,tabbableOptions:{getShadowRoot:t=>t.shadowRoot?t.shadowRoot:null}})}catch(t){console.error("Giftnote - Caught error from Focus",t)}"true"===this.container.getAttribute("data-force-open")&&this.open()}open(){this.isOpening||this.isVisible||(this.type="order",this.isOpening=!0,this.content.scrollTop=0,this.modal.show(),requestAnimationFrame(()=>{this.backdrop.classList.remove("opacity-0"),this.content.classList.remove("opacity-0","scale-95"),setTimeout(()=>{if(this.focus_trap&&this.isVisible&&!this.isClosing)try{this.focus_trap.activate()}catch(t){}},200)}))}voucherOpen(){this.isOpening||this.isVisible||(this.type="voucher",this.isOpening=!0,this.content.classList.add("voucher"),this.content.scrollTop=0,this.modal.show(),requestAnimationFrame(()=>{this.backdrop.classList.remove("opacity-0"),this.content.classList.remove("opacity-0","scale-95"),setTimeout(()=>{if(this.focus_trap&&this.isVisible&&!this.isClosing)try{this.focus_trap.activate()}catch(t){}},200)}))}close(){if(this.isClosing||!this.isVisible)return;if(this.isClosing=!0,this.focus_trap)try{this.focus_trap.deactivate()}catch(t){}document.activeElement===this.container&&document.activeElement.blur();const t=this.container.querySelector(":focus");t&&t.blur(),this.backdrop.classList.add("opacity-0"),this.content.classList.add("opacity-0","scale-95"),setTimeout(()=>{if(document.activeElement&&this.container.contains(document.activeElement)&&document.activeElement.blur(),this.modal.hide(),this.content.classList.contains("voucher")){this.content.classList.remove("voucher");const t=new Event("giftnote_voucher_close");document.dispatchEvent(t)}},300)}}class pt extends HTMLElement{constructor(){super(),this.gift_card=!1;try{const t=this.dataset.add,e=this.dataset.edit,i=this.attachShadow({mode:"open",delegatesFocus:!0}),n=document.getElementById("giftnote-button-template");if(!n)throw new Error("Button template not found");const o=n.content;i.appendChild(o.cloneNode(!0)),this.add_label=this.shadowRoot.getElementById("add"),this.edit_label=this.shadowRoot.getElementById("edit"),this.add_label&&t&&(this.add_label.innerText=t),this.edit_label&&t&&(this.edit_label.innerText=e),this.injectStyles();const s=this.shadowRoot.getElementById("button");s.addEventListener("click",t=>{t.stopImmediatePropagation(),this.buttonShowModal()}),document.addEventListener("giftnote_render_edit",()=>this.renderEditButton(),!1),document.addEventListener("giftnote_render_add",()=>this.renderAddButton(),!1),document.addEventListener("giftnote_inject_styles",()=>this.injectStyles(),!1),this.onfocus=t=>{s.focus()}}catch(t){console.error(t)}}connectedCallback(){const t=new Event("giftnote_hydrate");document.dispatchEvent(t)}injectStyles(){const t=this.dataset.styles,e=document.getElementById(t);if(t&&e){const t=this.shadowRoot.lastElementChild;t&&"STYLE"!==t.nodeName&&(this.shadowRoot,this.shadowRoot.appendChild(e.content.cloneNode(!0)))}}buttonShowModal(){const t=new Event("giftnote_open");document.dispatchEvent(t)}renderAddButton(){var t,e,i;null===(t=this.add_label)||void 0===t||t.classList.remove("hidden"),null===(e=this.edit_label)||void 0===e||e.classList.add("hidden"),null===(i=this.send_label)||void 0===i||i.classList.add("hidden"),this.state="add"}renderEditButton(){var t,e,i;null===(t=this.add_label)||void 0===t||t.classList.add("hidden"),null===(e=this.edit_label)||void 0===e||e.classList.remove("hidden"),null===(i=this.send_label)||void 0===i||i.classList.add("hidden"),this.state="edit"}}var mt=function(t,e,i,n){return new(i||(i=Promise))(function(o,s){function r(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,a)}l((n=n.apply(t,e||[])).next())})};class ft{constructor(t){this.gift_card=!1,t&&(this.shop=t)}GetProductInfo(t){return mt(this,void 0,void 0,function*(){let e=window.location.href;if(!e)return!1;if(!e.includes("products"))return!1;const i=yield fetch(window.location.href,{method:"GET",headers:{Accept:"application/json"}}).then(t=>t.json()).then(t=>t.product);"Giftnote Gift Card"===i.vendor&&(this.gift_card=!0),t()})}GetCartAttributes(t){return mt(this,void 0,void 0,function*(){this.cart_attributes=yield fetch("/cart.json").then(t=>t.json()).then(t=>t.attributes),t()})}GetCartId(t){return mt(this,void 0,void 0,function*(){this.cart_id=yield fetch("/cart.json").then(t=>t.json()).then(t=>t&&t.items.length?t.token:null),t()})}AddCartAttributes(t){return mt(this,void 0,void 0,function*(){const e=yield fetch("/cart/update.js",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"xmlhttprequest"},body:JSON.stringify({attributes:Object.assign({},t)})}).then(t=>t.json());this.cart_attributes=e.attributes})}RemoveCartAttributes(){return mt(this,void 0,void 0,function*(){const t=yield fetch("/cart/update.js",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"xmlhttprequest"},body:JSON.stringify({attributes:{giftnote_to:null,giftnote_message:null,giftnote_from:null,giftnote_medium:null,giftnote_email:null,giftnote_phone:null,giftnote_method:null,giftnote_time:null,giftnote_source:null}})}).then(t=>t.json());this.cart_attributes=t.attributes})}AddVoucher(t,e){return mt(this,void 0,void 0,function*(){var i={id:t,quantity:1,sections:"cart-notification-product,cart-notification-button,cart-icon-bubble,cart-drawer",form_type:"product",properties:e};const n=document.querySelector("cart-notification")||document.querySelector("cart-drawer");yield fetch("/cart/add.js",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"xmlhttprequest"},body:JSON.stringify(i)}).then(t=>t.json()).then(e=>{const i={source:"product-form",productVariantId:t,cartData:e};if(window.publish)window.publish("cart-update",i),n&&n.renderContents&&setTimeout(()=>{n.renderContents(e)},400);else{const t=new CustomEvent("cart-update",{bubbles:!0,detail:Object.assign({},i)});document.dispatchEvent(t)}}).catch(t=>{console.error(t)}).finally(()=>{n&&n.classList.contains("is-empty")&&n.classList.remove("is-empty")})})}}class gt extends HTMLElement{constructor(){super(),this.gift_card=!1;try{this.dataset.styles;const t=this.dataset.label,e=this.attachShadow({mode:"open",delegatesFocus:!0}),i=document.getElementById("giftnote-button-template");if(!i)throw new Error("Voucher: Button template not found");const n=i.content;e.appendChild(n.cloneNode(!0)),this.label=this.shadowRoot.getElementById("add"),this.label&&t&&(this.label.innerText=t),this.injectStyles();const o=this.shadowRoot.getElementById("button");o.addEventListener("click",t=>{t.stopImmediatePropagation(),this.showVoucherModal()}),document.addEventListener("giftnote_inject_styles",()=>this.injectStyles(),!1),this.onfocus=t=>{o.focus()}}catch(t){console.error("Giftnote error:",t)}}connectedCallback(){const t=new Event("giftnote_hydrate");document.dispatchEvent(t)}injectStyles(){const t=this.dataset.styles,e=document.getElementById(t);if(t&&e){const t=this.shadowRoot.lastElementChild;t&&"STYLE"!==t.nodeName&&(this.shadowRoot,this.shadowRoot.appendChild(e.content.cloneNode(!0)))}}showVoucherModal(){const t=new Event("giftnote_voucher_open");document.dispatchEvent(t)}}var vt=function(t,e,i,n){return new(i||(i=Promise))(function(o,s){function r(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,a)}l((n=n.apply(t,e||[])).next())})};class bt extends HTMLElement{constructor(){super(),this.gift_card=!1;try{const t=this.dataset.styles,e=this.dataset.label,i=this.attachShadow({mode:"open"}),n=document.getElementById("giftnote-balance-template");if(!n)throw new Error("Button template not found");const o=n.content;i.appendChild(o.cloneNode(!0)),this.balance_label=this.shadowRoot.getElementById("label"),this.balance_label&&e&&(this.balance_label.innerText=e);const s=this.shadowRoot.getElementById("code");this.current_code=s?s.value:"",this.loading=this.shadowRoot.getElementById("loading"),this.not_found=this.shadowRoot.getElementById("not_found"),this.expired=this.shadowRoot.getElementById("expired"),this.success=this.shadowRoot.getElementById("success"),this.balance=this.shadowRoot.getElementById("balance"),this.initial=this.shadowRoot.getElementById("initial"),this.expires_on=this.shadowRoot.getElementById("expires_on"),this.expired_res=this.expired?this.expired.querySelector("span"):null,this.balance_res=this.balance?this.balance.querySelector("span"):null,this.initial_res=this.initial?this.initial.querySelector("span"):null,this.expires_on_res=this.expires_on?this.expires_on.querySelector("span"):null,this.container=this.shadowRoot.getElementById("container");const r=this.container.getAttribute("data-shop"),a=this.shadowRoot.getElementById("form");if(a){a.addEventListener("submit",t=>vt(this,void 0,void 0,function*(){if(t.preventDefault(),t.stopImmediatePropagation(),s&&s.value&&s.value!==this.current_code)try{const t=s.value.replace(/[^a-z0-9]|\s+|\r?\n|\r/gim,"").toLowerCase();if(t.length<8||t.length>20)return void this.renderNotFound();if(t===this.current_code)return;this.current_code=t,this.renderSearching();const e=`${"https://us-central1-giftnote-app.cloudfunctions.net/vouchers-public-balance"}/${r}/${t}`,i=yield fetch(e).then(t=>t.json());if(200===i.status){const t=i.data.currency_symbol,e=i.data.currency,n=t+parseFloat(i.data.balance).toFixed(2)+" "+e,o=t+parseFloat(i.data.initial_value).toFixed(2)+" "+e;let s=null;const r=i.data.expires_on?Date.parse(i.data.expires_on):null;if(r){r.valueOf();const t=r-Date.now();if(!(t>0))return void this.renderExpired(s);s=(new Intl.DateTimeFormat).format(r)}return void this.renderSuccess(n,o,s)}return void this.renderNotFound()}catch(t){this.renderNotFound()}this.renderEmpty()}));const e=document.getElementById(t);if(t&&!e)console.error("Giftnote - Styles not found for button",t,e);else{let t=e.content;i.appendChild(t.cloneNode(!0))}}}catch(t){console.error(t)}}renderEmpty(){var t,e,i,n;null===(t=this.loading)||void 0===t||t.classList.add("hidden"),null===(e=this.not_found)||void 0===e||e.classList.add("hidden"),null===(i=this.success)||void 0===i||i.classList.add("hidden"),null===(n=this.expired)||void 0===n||n.classList.add("hidden")}renderSearching(){var t,e,i,n;null===(t=this.loading)||void 0===t||t.classList.remove("hidden"),null===(e=this.not_found)||void 0===e||e.classList.add("hidden"),null===(i=this.success)||void 0===i||i.classList.add("hidden"),null===(n=this.expired)||void 0===n||n.classList.add("hidden")}renderNotFound(){var t,e,i,n;null===(t=this.loading)||void 0===t||t.classList.add("hidden"),null===(e=this.not_found)||void 0===e||e.classList.remove("hidden"),null===(i=this.success)||void 0===i||i.classList.add("hidden"),null===(n=this.expired)||void 0===n||n.classList.add("hidden")}renderExpired(t){var e,i,n,o;null===(e=this.loading)||void 0===e||e.classList.add("hidden"),null===(i=this.not_found)||void 0===i||i.classList.add("hidden"),null===(n=this.success)||void 0===n||n.classList.add("hidden"),null===(o=this.expired)||void 0===o||o.classList.remove("hidden"),this.expired_res.innerHTML=t}renderSuccess(t,e,i){var n,o,s,r,a;null===(n=this.loading)||void 0===n||n.classList.add("hidden"),null===(o=this.not_found)||void 0===o||o.classList.add("hidden"),null===(s=this.success)||void 0===s||s.classList.remove("hidden"),null===(r=this.expired)||void 0===r||r.classList.add("hidden"),this.balance_res.innerHTML=t,this.initial_res.innerHTML=e,i&&(null===(a=this.expires_on)||void 0===a||a.classList.remove("hidden"),this.expires_on_res.innerHTML=i)}}class yt extends HTMLElement{constructor(){super(),this.gift_card=!1;try{this.dataset.styles;const t=this.dataset.label,e=this.attachShadow({mode:"open",delegatesFocus:!0}),i=document.getElementById("giftnote-button-template");if(!i)throw new Error("Multi Gift: Button template not found");const n=i.content;e.appendChild(n.cloneNode(!0)),this.label=this.shadowRoot.getElementById("add"),this.label&&t&&(this.label.innerText=t),this.injectStyles();const o=this.shadowRoot.getElementById("button");this.shop=o.getAttribute("data-shop"),this.shopify=new ft(this.shop),o.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.shopify.GetCartId(()=>this.cartCallback())}),document.addEventListener("giftnote_inject_styles",()=>this.injectStyles(),!1),this.onfocus=t=>{o.focus()}}catch(t){console.error("Giftnote error:",t)}}connectedCallback(){const t=new Event("giftnote_hydrate");document.dispatchEvent(t)}injectStyles(){const t=this.dataset.styles,e=document.getElementById(t);if(t&&e){const t=this.shadowRoot.lastElementChild;t&&"STYLE"!==t.nodeName&&(this.shadowRoot,this.shadowRoot.appendChild(e.content.cloneNode(!0)))}}cartCallback(){this.shopify.cart_id;var t=new URL(`https://shop.giftnote.com/${this.shop||this.shopify.shop}`);this.shopify.cart_id&&t.searchParams.set("cid",this.shopify.cart_id),t.toString(),window.open(t.toString(),"_blank").focus()}}var wt=Object.defineProperty,_t=t=>{throw TypeError(t)},Et=(t,e,i)=>((t,e,i)=>e in t?wt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),At=(t,e,i)=>e.has(t)||_t("Cannot "+i),Lt=(t,e,i)=>(At(t,e,"read from private field"),i?i.call(t):e.get(t)),Ct=(t,e,i)=>e.has(t)?_t("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),It=(t,e,i,n)=>(At(t,e,"write to private field"),n?n.call(t,i):e.set(t,i),i),St=(t,e,i)=>(At(t,e,"access private method"),i);if(typeof globalThis.window<"u"){let t=!1;document.addEventListener("submit",e=>{if(t)return void(t=!1);let i=e.target;if(i&&"dialog"===i.method){let n=i.closest("el-dialog");if(!n||!("beforeClose"in n))return;let o=n.beforeClose();if(!0===o||(e.preventDefault(),e.stopImmediatePropagation(),!1===o))return;o.then(n=>{n&&(t=!0,i.dispatchEvent(e))}).catch(console.error)}},!0)}var kt=class extends Event{constructor(t,{oldState:e="",newState:i="",...n}={}){super(t,n),Et(this,"oldState"),Et(this,"newState"),this.oldState=String(e||""),this.newState=String(i||"")}},Tt=new WeakMap;function xt(t,e,i){Tt.set(t,setTimeout(()=>{Tt.has(t)&&t.dispatchEvent(new kt("toggle",{cancelable:!1,oldState:e,newState:i}))},0))}var Dt=globalThis.ShadowRoot||function(){},Pt=globalThis.HTMLDialogElement||function(){},Nt=new WeakMap,Ot=new WeakMap,Mt=new WeakMap,Rt=new WeakMap;function Bt(t){return Rt.get(t)||"hidden"}var Ft=new WeakMap;function jt(t){return[...t].pop()}function qt(t,e){return!("auto"!==t.popover&&"manual"!==t.popover&&"hint"!==t.popover||!t.isConnected||e&&"showing"!==Bt(t)||!e&&"hidden"!==Bt(t)||t instanceof Pt&&t.hasAttribute("open")||document.fullscreenElement===t)}function Ht(t){if(!t)return 0;let e=Ot.get(document)||new Set,i=Mt.get(document)||new Set;return i.has(t)?[...i].indexOf(t)+e.size+1:e.has(t)?[...e].indexOf(t)+1:0}function zt(t){let e=Gt(t),i=function(t){for(;t;){let e=t.popoverTargetElement;if(e instanceof HTMLElement)return e;if((t=t.parentElement||Vt(t))instanceof Dt&&(t=t.host),t instanceof Document)return}}(t);return Ht(e)>Ht(i)?e:i}function $t(t){let e,i=Mt.get(t)||new Set,n=Ot.get(t)||new Set,o=i.size>0?i:n.size>0?n:null;return o?(e=jt(o),e.isConnected?e:(o.delete(e),$t(t))):null}function Wt(t){for(let e of t||[]){if(e.isConnected)return e;t.delete(e)}return null}function Vt(t){return"function"==typeof t.getRootNode?t.getRootNode():t.parentNode?Vt(t.parentNode):t}function Gt(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===Rt.get(t))return t;if((t=t instanceof Element&&t.assignedSlot||t.parentElement||Vt(t))instanceof Dt&&(t=t.host),t instanceof Document)return}}function Kt(t,e){let i=new Map,n=0;for(let t of e||[])i.set(t,n),n+=1;i.set(t,n),n+=1;let o=null;return function(e){if(!e)return;let n=!1,s=null,r=null;for(;!n;){if(s=Gt(e)||null,null===s||!i.has(s))return;("hint"===t.popover||"auto"===s.popover)&&(n=!0),n||(e=s.parentElement)}r=i.get(s),(null===o||i.get(o)"u")return;function t(t){return t?.includes(":popover-open")&&(t=t.replace(le,"$1.\\:popover-open")),t}window.ToggleEvent=window.ToggleEvent||kt,ae(Document.prototype,"querySelector",t),ae(Document.prototype,"querySelectorAll",t),ae(Element.prototype,"querySelector",t),ae(Element.prototype,"querySelectorAll",t),ae(Element.prototype,"matches",t),ae(Element.prototype,"closest",t),ae(DocumentFragment.prototype,"querySelectorAll",t),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let t=(this.getAttribute("popover")||"").toLowerCase();return""===t||"auto"==t?"auto":"hint"==t?"hint":"manual"},set(t){null===t?this.removeAttribute("popover"):this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(t={}){Jt(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Xt(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t={}){return"boolean"==typeof t&&(t={force:t}),"showing"===Rt.get(this)&&void 0===t.force||!1===t.force?Xt(this,!0,!0):(void 0===t.force||!0===t.force)&&Jt(this),"showing"===Rt.get(this)}}});let e=Element.prototype.attachShadow;e&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(t){let i=e.call(this,t);return ce(i),i}}});let i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let t=i.call(this);return t.shadowRoot&&ce(t.shadowRoot),t}}});let n=new WeakMap;function o(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),n.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),n.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName||"input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type||this.disabled||this.form&&"submit"===this.type)return null;let t=n.get(this);if(t&&t.isConnected)return t;if(t&&!t.isConnected)return n.delete(this),null;let e=Vt(this),i=this.getAttribute("popovertarget");return(e instanceof Document||e instanceof re)&&i&&e.getElementById(i)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}o(HTMLButtonElement),o(HTMLInputElement);let s=t=>{if(t.defaultPrevented)return;let e=t.composedPath(),i=e[0];if(!(i instanceof Element)||i?.shadowRoot)return;let n=Vt(i);if(!(n instanceof re||n instanceof Document))return;let o=e.find(t=>{var e;return null==(e=t.matches)?void 0:e.call(t,"[popovertargetaction],[popovertarget]")});return o?(function(t){let e=t.popoverTargetElement;if(!(e instanceof HTMLElement))return;let i=Bt(e);"show"===t.popoverTargetAction&&"showing"===i||"hide"===t.popoverTargetAction&&"hidden"===i||("showing"===i?Xt(e,!0,!0):qt(e,!1)&&(Ft.set(e,t),Jt(e)))}(o),void t.preventDefault()):void 0},r=t=>{let e=t.key,i=t.target;!t.defaultPrevented&&i&&("Escape"===e||"Esc"===e)&&ee(i.ownerDocument,!0,!0)};var a;(a=document).addEventListener("click",s),a.addEventListener("keydown",r),a.addEventListener("pointerdown",ne),a.addEventListener("pointerup",ne),ce(document)}(),he(async()=>{if(await async function(t){await async function(){await Promise.all(Array.from(document.querySelectorAll('link[rel="stylesheet"]')).map(t=>t.sheet?Promise.resolve():new Promise(e=>{t.addEventListener("load",()=>e(),{once:!0}),t.addEventListener("error",()=>e(),{once:!0})})))}();for(let e of document.styleSheets)try{for(let i of e.rules)if("CSSLayerStatementRule"===i.constructor.name&&"nameList"in i&&i.nameList.includes(t))return!0}catch{}return!1}("popover-polyfill"))return;let t=document.createElement("style");t.textContent="@layer popover-polyfill;",t.setAttribute("suppressHydrationWarning",""),t.addEventListener("securitypolicyviolation",()=>{}),document.documentElement.prepend(t)})),typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})||function(){function t(t,e,i=!0){Object.defineProperty(t,e,{...Object.getOwnPropertyDescriptor(t,e),enumerable:i})}function e(t){return t&&"function"==typeof t.getRootNode?t.getRootNode():t&&t.parentNode?e(t.parentNode):t}document.addEventListener("invoke",t=>{"invoke"==t.type&&t.isTrusted&&(t.stopImmediatePropagation(),t.preventDefault())},!0),document.addEventListener("command",t=>{"command"==t.type&&t.isTrusted&&(t.stopImmediatePropagation(),t.preventDefault())},!0);let i=new WeakMap,n=new WeakMap;class o extends Event{constructor(t,e={}){super(t,e);let{source:o,command:s}=e;if(null!=o&&!(o instanceof Element))throw new TypeError("source must be an element");i.set(this,o||null),n.set(this,void 0!==s?String(s):"")}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!i.has(this))throw new TypeError("illegal invocation");let t=i.get(this);if(!(t instanceof Element))return null;let n=e(t);return n!==e(this.target||document)?n.host:t}get command(){if(!n.has(this))throw new TypeError("illegal invocation");return n.get(this)}get action(){throw new Error("CommandEvent#action was renamed to CommandEvent#command")}get invoker(){throw new Error("CommandEvent#invoker was renamed to CommandEvent#source")}}t(o.prototype,"source"),t(o.prototype,"command");class s extends Event{constructor(t,e={}){throw super(t,e),new Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}}let r=new WeakMap,a=new WeakMap;function l(t){for(let e of t)e.oncommand=new Function("event",e.getAttribute("oncommand"))}Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return d.takeRecords(),a.get(this)||null},set(t){let e=a.get(this)||null;e&&this.removeEventListener("command",e),a.set(this,"object"==typeof t||"function"==typeof t?t:null),"function"==typeof t&&this.addEventListener("command",t)}}});let d=new MutationObserver(t=>{for(let e of t){let{target:t}=e;"childList"===e.type?l(t.querySelectorAll("[oncommand]")):l([t])}});function u(t){if(t.defaultPrevented||"click"!==t.type)return;let e=t.target.closest("button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]");if(e&&e.matches("input"))throw new Error("Input elements no longer support `commandfor`");let i=t.target.closest("button[commandfor], button[command]");if(!i)return;if(i.form&&"button"!==i.getAttribute("type"))throw t.preventDefault(),new Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(i.hasAttribute("command")!==i.hasAttribute("commandfor")){let t=i.hasAttribute("command")?"command":"commandfor",e=i.hasAttribute("command")?"commandfor":"command";throw new Error(`Element with ${t} attribute must also have a ${e} attribute to function.`)}if("show-popover"!==i.command&&"hide-popover"!==i.command&&"toggle-popover"!==i.command&&"show-modal"!==i.command&&"close"!==i.command&&!i.command.startsWith("--"))return void i.command;let n=i.commandForElement;if(!n)return;let s=new o("command",{command:i.command,source:i,cancelable:!0});if(n.dispatchEvent(s),s.defaultPrevented)return;let r=s.command.toLowerCase();if(n.popover){let t=!n.matches(":popover-open");!t||"toggle-popover"!==r&&"show-popover"!==r?!t&&"hide-popover"===r&&n.hidePopover():n.showPopover({source:i})}else if("dialog"===n.localName){let t=!n.hasAttribute("open");t&&"show-modal"===r?n.showModal():!t&&"close"===r&&n.close()}}function c(t){t.addEventListener("click",u,!0)}var h;d.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),l(document.querySelectorAll("[oncommand]")),h=HTMLButtonElement,Object.defineProperties(h.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(t){if(this.hasAttribute("invokeaction"))throw new TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute("invoketarget"))throw new TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(null===t)this.removeAttribute("commandfor"),r.delete(this);else{if(!(t instanceof Element))throw new TypeError("commandForElement must be an element or null");{this.setAttribute("commandfor","");let i=e(t);e(this)===i||i===this.ownerDocument?r.set(this,t):r.delete(this)}}},get(){if("button"!==this.localName)return null;if(this.hasAttribute("invokeaction")||this.hasAttribute("invoketarget"))return null;if(this.disabled)return null;if(this.form&&"button"!==this.getAttribute("type"))return null;let t=r.get(this);if(t)return t.isConnected?t:(r.delete(this),null);let i=e(this),n=this.getAttribute("commandfor");return(i instanceof Document||i instanceof ShadowRoot)&&n&&i.getElementById(n)||null}},command:{enumerable:!0,configurable:!0,get(){let t=this.getAttribute("command")||"";if(t.startsWith("--"))return t;let e=t.toLowerCase();switch(e){case"show-modal":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return e}return""},set(t){this.setAttribute("command",t)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw new Error("invokeAction is deprecated. It has been renamed to command")},set(t){throw new Error("invokeAction is deprecated. It has been renamed to command")}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")},set(t){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")}}}),function(t,e){let i=t.prototype.attachShadow;t.prototype.attachShadow=function(t){let n=i.call(this,t);return e(n),n};let n=t.prototype.attachInternals;t.prototype.attachInternals=function(){let t=n.call(this);return t.shadowRoot&&e(t.shadowRoot),t}}(HTMLElement,t=>{c(t),d.observe(t,{attributeFilter:["oncommand"]}),l(t.querySelectorAll("[oncommand]"))}),c(document),Object.assign(globalThis,{CommandEvent:o,InvokeEvent:s})}(),function(){if("function"!=typeof HTMLDialogElement)return!1;let t=!1,e=document.createElement("dialog");return e.addEventListener("beforetoggle",e=>{t=!0,e.preventDefault()}),e.show(),t}()||function(){let t=new WeakMap;function e(e){let i=e.open?"closed":"open",n=e.open?"open":"closed";if(t.has(e)){let i=t.get(e);n=i.oldState,clearTimeout(i.id)}t.set(e,{oldState:n,id:setTimeout(()=>{e.dispatchEvent(new ToggleEvent("toggle",{newState:i,oldState:n}))})})}let i=HTMLDialogElement.prototype.show,n=HTMLDialogElement.prototype.showModal,o=HTMLDialogElement.prototype.close;function s(t){let i=new ToggleEvent("beforetoggle",{newState:"closed",oldState:"open",cancelable:!1});t.dispatchEvent(i),t.open&&e(t)}document.addEventListener("submit",t=>{let e=t.target;if("dialog"===e.method){let t=e.closest("dialog");t instanceof HTMLDialogElement&&s(t)}},!0),Object.defineProperties(HTMLDialogElement.prototype,{show:{value(){if(this.open||this.matches(":popover-open, :modal")||!this.ownerDocument)return i.apply(this,arguments);let t=new ToggleEvent("beforetoggle",{newState:"open",oldState:"closed",cancelable:!0});this.dispatchEvent(t)&&(e(this),i.apply(this,arguments))}},showModal:{value(){if(this.open||this.matches(":popover-open, :modal")||!this.isConnected||!this.ownerDocument)return n.apply(this,arguments);let t=new ToggleEvent("beforetoggle",{newState:"open",oldState:"closed",cancelable:!0});return this.dispatchEvent(t)?(e(this),n.apply(this,arguments)):void 0}},close:{value(){return this.open||this.matches(":popover-open, :modal")?(s(this),o.apply(this,arguments)):o.apply(this,arguments)}}})}());var me,fe=!1;if(typeof globalThis.window<"u"){let t;(me=t||(t={}))[me.Keyboard=0]="Keyboard",me[me.Mouse=1]="Mouse",document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(fe=!0,document.documentElement.dataset.focusVisible="")},!0),document.addEventListener("click",t=>{1===t.detail?(fe=!1,delete document.documentElement.dataset.focusVisible):0===t.detail&&(fe=!0,document.documentElement.dataset.focusVisible="")},!0)}typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{});var ge,ve,be,ye=class extends HTMLElement{constructor(){super(...arguments),Ct(this,ge,new AbortController),Ct(this,ve,!1),Ct(this,be,!1)}connectedCallback(){if("observedAttributes"in this.constructor&&"object"==typeof this.constructor.observedAttributes&&Array.isArray(this.constructor.observedAttributes))for(let t of this.constructor.observedAttributes)"string"==typeof t&&(t in this||Object.defineProperty(this,t,{get(){return this.getAttribute(t)},set(e){null!=e&&!1!==e?this.setAttribute(t,e.toString()):this.removeAttribute(t)}}));It(this,ve,!0),queueMicrotask(()=>{if(!Lt(this,ge).signal.aborted)try{this.mount?.(Lt(this,ge).signal)}catch(t){console.error(t)}})}disconnectedCallback(){Lt(this,ge).abort(),It(this,ge,new AbortController)}setAttributeNoCallbacks(t,e){try{It(this,be,!0),this.setAttribute(t,e)}finally{It(this,be,!1)}}removeAttributeNoCallbacks(t){try{It(this,be,!0),this.removeAttribute(t)}finally{It(this,be,!1)}}attributeChangedCallback(t,e,i){Lt(this,ve)&&(Lt(this,be)||e!==i&&this.onAttributeChange?.(t,e,i))}};function we(t,e){typeof globalThis.customElements>"u"||customElements.get(t)===e||customElements.define(t,e)}function _e(){let t=[],e={addEventListener:(t,i,n,o)=>(t.addEventListener(i,n,o),e.add(()=>t.removeEventListener(i,n,o))),requestAnimationFrame(...t){let i=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(i))},nextFrame:(...t)=>e.requestAnimationFrame(()=>e.requestAnimationFrame(...t)),setTimeout(...t){let i=setTimeout(...t);return e.add(()=>clearTimeout(i))},microTask(...t){let i={current:!0};return queueMicrotask(()=>{i.current&&t[0]()}),e.add(()=>{i.current=!1})},style(t,e,i){let n=t.style.getPropertyValue(e);return e.startsWith("--")?t.style.setProperty(e,i):Object.assign(t.style,{[e]:i}),this.add(()=>{e.startsWith("--")?t.style.setProperty(e,n):Object.assign(t.style,{[e]:n})})},add:e=>(t.includes(e)||t.push(e),()=>{let i=t.indexOf(e);if(i>=0)for(let e of t.splice(i,1))e()}),dispose(){for(let e of t.splice(0))e()}};return e}function Ee(t,e=()=>[]){let i=!1,n=null,o=_e();return{start(s,r){let a=[t,...e()];i=!i&&(null!==n&&n!==s),n=s;for(let t of a)Ae(t,()=>{i||("in"===s?(t.dataset.transition="",t.dataset.enter="",t.dataset.closed="",delete t.dataset.leave):"out"===s&&(t.dataset.transition="",t.dataset.leave="",delete t.dataset.enter))},null!==n);o.nextFrame(()=>{for(let t of a)i?"in"===s?(delete t.dataset.enter,delete t.dataset.closed,t.dataset.leave=""):"out"===s&&(delete t.dataset.leave,t.dataset.enter="",t.dataset.closed=""):"in"===s?delete t.dataset.closed:"out"===s&&(t.dataset.closed="");o.requestAnimationFrame(()=>{o.add(function(t,e){let i=_e();if(!t)return i.dispose;let n=!1;i.add(()=>{n=!0});let o=t.getAnimations?.({subtree:!0}).filter(t=>t instanceof CSSTransition)??[];return 0===o.length?(e(),i.dispose):(Promise.allSettled(o.map(t=>t.finished)).then(()=>{n||e()}),i.dispose)}(t,()=>{if(!(i&&"function"==typeof t.getAnimations&&t.getAnimations({subtree:!0}).length>0)){for(let t of a)delete t.dataset.transition,delete t.dataset.enter,delete t.dataset.closed,delete t.dataset.leave;n=null,r?.()}}))})})},abort(){o.dispose(),i=!1,n=null}}}function Ae(t,e,i=!1){if(i)return void e();let n=t.style.transition;t.style.transition="none",e(),t.offsetHeight,t.style.transition=n}ge=new WeakMap,ve=new WeakMap,be=new WeakMap;var Le=Math.min,Ce=Math.max,Ie=Math.round,Se=Math.floor,ke=t=>({x:t,y:t}),Te={left:"right",right:"left",bottom:"top",top:"bottom"},xe={start:"end",end:"start"};function De(t,e,i){return Ce(t,Le(e,i))}function Pe(t,e){return"function"==typeof t?t(e):t}function Ne(t){return t.split("-")[0]}function Oe(t){return t.split("-")[1]}function Me(t){return"x"===t?"y":"x"}function Re(t){return"y"===t?"height":"width"}var Be=new Set(["top","bottom"]);function Fe(t){return Be.has(Ne(t))?"y":"x"}function je(t){return Me(Fe(t))}function qe(t){return t.replace(/start|end/g,t=>xe[t])}var He=["left","right"],ze=["right","left"],$e=["top","bottom"],We=["bottom","top"];function Ve(t,e,i,n){let o=Oe(t),s=function(t,e,i){switch(t){case"top":case"bottom":return i?e?ze:He:e?He:ze;case"left":case"right":return e?$e:We;default:return[]}}(Ne(t),"start"===i,n);return o&&(s=s.map(t=>t+"-"+o),e&&(s=s.concat(s.map(qe)))),s}function Ge(t){return t.replace(/left|right|bottom|top/g,t=>Te[t])}function Ke(t){let{x:e,y:i,width:n,height:o}=t;return{width:n,height:o,top:i,left:e,right:e+n,bottom:i+o,x:e,y:i}}function Ue(t,e,i){let n,{reference:o,floating:s}=t,r=Fe(e),a=je(e),l=Re(a),d=Ne(e),u="y"===r,c=o.x+o.width/2-s.width/2,h=o.y+o.height/2-s.height/2,p=o[l]/2-s[l]/2;switch(d){case"top":n={x:c,y:o.y-s.height};break;case"bottom":n={x:c,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:h};break;case"left":n={x:o.x-s.width,y:h};break;default:n={x:o.x,y:o.y}}switch(Oe(e)){case"start":n[a]-=p*(i&&u?-1:1);break;case"end":n[a]+=p*(i&&u?-1:1)}return n}async function Ye(t,e){var i;void 0===e&&(e={});let{x:n,y:o,platform:s,rects:r,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:c="floating",altBoundary:h=!1,padding:p=0}=Pe(e,t),m=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(p),f=a[h?"floating"===c?"reference":"floating":c],g=Ke(await s.getClippingRect({element:null==(i=await(null==s.isElement?void 0:s.isElement(f)))||i?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:l})),v="floating"===c?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),y=await(null==s.isElement?void 0:s.isElement(b))&&await(null==s.getScale?void 0:s.getScale(b))||{x:1,y:1},w=Ke(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-w.top+m.top)/y.y,bottom:(w.bottom-g.bottom+m.bottom)/y.y,left:(g.left-w.left+m.left)/y.x,right:(w.right-g.right+m.right)/y.x}}function Ze(){return typeof window<"u"}function Je(t){return ti(t)?(t.nodeName||"").toLowerCase():"#document"}function Xe(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Qe(t){var e;return null==(e=(ti(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ti(t){return!!Ze()&&(t instanceof Node||t instanceof Xe(t).Node)}function ei(t){return!!Ze()&&(t instanceof Element||t instanceof Xe(t).Element)}function ii(t){return!!Ze()&&(t instanceof HTMLElement||t instanceof Xe(t).HTMLElement)}function ni(t){return!(!Ze()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof Xe(t).ShadowRoot)}var oi=new Set(["inline","contents"]);function si(t){let{overflow:e,overflowX:i,overflowY:n,display:o}=vi(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+i)&&!oi.has(o)}var ri=new Set(["table","td","th"]);function ai(t){return ri.has(Je(t))}var li=[":popover-open",":modal"];function di(t){return li.some(e=>{try{return t.matches(e)}catch{return!1}})}var ui=["transform","translate","scale","rotate","perspective"],ci=["transform","translate","scale","rotate","perspective","filter"],hi=["paint","layout","strict","content"];function pi(t){let e=mi(),i=ei(t)?vi(t):t;return ui.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||ci.some(t=>(i.willChange||"").includes(t))||hi.some(t=>(i.contain||"").includes(t))}function mi(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}var fi=new Set(["html","body","#document"]);function gi(t){return fi.has(Je(t))}function vi(t){return Xe(t).getComputedStyle(t)}function bi(t){return ei(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function yi(t){if("html"===Je(t))return t;let e=t.assignedSlot||t.parentNode||ni(t)&&t.host||Qe(t);return ni(e)?e.host:e}function wi(t){let e=yi(t);return gi(e)?t.ownerDocument?t.ownerDocument.body:t.body:ii(e)&&si(e)?e:wi(e)}function _i(t,e,i){var n;void 0===e&&(e=[]),void 0===i&&(i=!0);let o=wi(t),s=o===(null==(n=t.ownerDocument)?void 0:n.body),r=Xe(o);if(s){let t=Ei(r);return e.concat(r,r.visualViewport||[],si(o)?o:[],t&&i?_i(t):[])}return e.concat(o,_i(o,[],i))}function Ei(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ai(t){let e=vi(t),i=parseFloat(e.width)||0,n=parseFloat(e.height)||0,o=ii(t),s=o?t.offsetWidth:i,r=o?t.offsetHeight:n,a=Ie(i)!==s||Ie(n)!==r;return a&&(i=s,n=r),{width:i,height:n,$:a}}function Li(t){return ei(t)?t:t.contextElement}function Ci(t){let e=Li(t);if(!ii(e))return ke(1);let i=e.getBoundingClientRect(),{width:n,height:o,$:s}=Ai(e),r=(s?Ie(i.width):i.width)/n,a=(s?Ie(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var Ii=ke(0);function Si(t){let e=Xe(t);return mi()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Ii}function ki(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1);let o=t.getBoundingClientRect(),s=Li(t),r=ke(1);e&&(n?ei(n)&&(r=Ci(n)):r=Ci(t));let a=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Xe(t))&&e}(s,i,n)?Si(s):ke(0),l=(o.left+a.x)/r.x,d=(o.top+a.y)/r.y,u=o.width/r.x,c=o.height/r.y;if(s){let t=Xe(s),e=n&&ei(n)?Xe(n):n,i=t,o=Ei(i);for(;o&&n&&e!==i;){let t=Ci(o),e=o.getBoundingClientRect(),n=vi(o),s=e.left+(o.clientLeft+parseFloat(n.paddingLeft))*t.x,r=e.top+(o.clientTop+parseFloat(n.paddingTop))*t.y;l*=t.x,d*=t.y,u*=t.x,c*=t.y,l+=s,d+=r,i=Xe(o),o=Ei(i)}}return Ke({width:u,height:c,x:l,y:d})}function Ti(t,e){let i=bi(t).scrollLeft;return e?e.left+i:ki(Qe(t)).left+i}function xi(t,e,i){void 0===i&&(i=!1);let n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-(i?0:Ti(t,n)),y:n.top+e.scrollTop}}var Di=new Set(["absolute","fixed"]);function Pi(t,e,i){let n;if("viewport"===e)n=function(t,e){let i=Xe(t),n=Qe(t),o=i.visualViewport,s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;let t=mi();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a,y:l}}(t,i);else if("document"===e)n=function(t){let e=Qe(t),i=bi(t),n=t.ownerDocument.body,o=Ce(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Ce(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),r=-i.scrollLeft+Ti(t),a=-i.scrollTop;return"rtl"===vi(n).direction&&(r+=Ce(e.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:a}}(Qe(t));else if(ei(e))n=function(t,e){let i=ki(t,!0,"fixed"===e),n=i.top+t.clientTop,o=i.left+t.clientLeft,s=ii(t)?Ci(t):ke(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:o*s.x,y:n*s.y}}(e,i);else{let i=Si(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ke(n)}function Ni(t,e){let i=yi(t);return!(i===e||!ei(i)||gi(i))&&("fixed"===vi(i).position||Ni(i,e))}function Oi(t,e){let i=e.get(t);if(i)return i;let n=_i(t,[],!1).filter(t=>ei(t)&&"body"!==Je(t)),o=null,s="fixed"===vi(t).position,r=s?yi(t):t;for(;ei(r)&&!gi(r);){let e=vi(r),i=pi(r);!i&&"fixed"===e.position&&(o=null),(s?!i&&!o:!i&&"static"===e.position&&o&&Di.has(o.position)||si(r)&&!i&&Ni(t,r))?n=n.filter(t=>t!==r):o=e,r=yi(r)}return e.set(t,n),n}function Mi(t,e,i){let n=ii(e),o=Qe(e),s="fixed"===i,r=ki(t,!0,s,e),a={scrollLeft:0,scrollTop:0},l=ke(0);function d(){l.x=Ti(o)}if(n||!n&&!s)if(("body"!==Je(e)||si(o))&&(a=bi(e)),n){let t=ki(e,!0,s,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else o&&d();s&&!n&&o&&d();let u=!o||n||s?ke(0):xi(o,a);return{x:r.left+a.scrollLeft-l.x-u.x,y:r.top+a.scrollTop-l.y-u.y,width:r.width,height:r.height}}function Ri(t){return"static"===vi(t).position}function Bi(t,e){if(!ii(t)||"fixed"===vi(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Qe(t)===i&&(i=i.ownerDocument.body),i}function Fi(t,e){let i=Xe(t);if(di(t))return i;if(!ii(t)){let e=yi(t);for(;e&&!gi(e);){if(ei(e)&&!Ri(e))return e;e=yi(e)}return i}let n=Bi(t,e);for(;n&&ai(n)&&Ri(n);)n=Bi(n,e);return n&&gi(n)&&Ri(n)&&!pi(n)?i:n||function(t){let e=yi(t);for(;ii(e)&&!gi(e);){if(pi(e))return e;if(di(e))return null;e=yi(e)}return null}(t)||i}var ji={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:n,strategy:o}=t,s="fixed"===o,r=Qe(n),a=!!e&&di(e.floating);if(n===r||a&&s)return i;let l={scrollLeft:0,scrollTop:0},d=ke(1),u=ke(0),c=ii(n);if((c||!c&&!s)&&(("body"!==Je(n)||si(r))&&(l=bi(n)),ii(n))){let t=ki(n);d=Ci(n),u.x=t.x+n.clientLeft,u.y=t.y+n.clientTop}let h=!r||c||s?ke(0):xi(r,l,!0);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+u.x+h.x,y:i.y*d.y-l.scrollTop*d.y+u.y+h.y}},getDocumentElement:Qe,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t,s=[..."clippingAncestors"===i?di(e)?[]:Oi(e,this._c):[].concat(i),n],r=s[0],a=s.reduce((t,i)=>{let n=Pi(e,i,o);return t.top=Ce(n.top,t.top),t.right=Le(n.right,t.right),t.bottom=Le(n.bottom,t.bottom),t.left=Ce(n.left,t.left),t},Pi(e,r,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Fi,getElementRects:async function(t){let e=this.getOffsetParent||Fi,i=this.getDimensions,n=await i(t.floating);return{reference:Mi(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){let{width:e,height:i}=Ai(t);return{width:e,height:i}},getScale:Ci,isElement:ei,isRTL:function(t){return"rtl"===vi(t).direction}};function qi(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Hi(t,e,i,n){void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,d=Li(t),u=o||s?[...d?_i(d):[],..._i(e)]:[];u.forEach(t=>{o&&t.addEventListener("scroll",i,{passive:!0}),s&&t.addEventListener("resize",i)});let c=d&&a?function(t,e){let i,n=null,o=Qe(t);function s(){var t;clearTimeout(i),null==(t=n)||t.disconnect(),n=null}return function r(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();let d=t.getBoundingClientRect(),{left:u,top:c,width:h,height:p}=d;if(a||e(),!h||!p)return;let m={rootMargin:-Se(c)+"px "+-Se(o.clientWidth-(u+h))+"px "+-Se(o.clientHeight-(c+p))+"px "+-Se(u)+"px",threshold:Ce(0,Le(1,l))||1},f=!0;function g(e){let n=e[0].intersectionRatio;if(n!==l){if(!f)return r();n?r(!1,n):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1===n&&!qi(d,t.getBoundingClientRect())&&r(),f=!1}try{n=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch{n=new IntersectionObserver(g,m)}n.observe(t)}(!0),s}(d,i):null,h=-1,p=null;r&&(p=new ResizeObserver(t=>{let[n]=t;n&&n.target===d&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e)})),i()}),d&&!l&&p.observe(d),p.observe(e));let m,f=l?ki(t):null;return l&&function e(){let n=ki(t);f&&!qi(f,n)&&i(),f=n,m=requestAnimationFrame(e)}(),i(),()=>{var t;u.forEach(t=>{o&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)}),c?.(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(m)}}var zi=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){let{x:i,y:n,placement:o}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=Pe(t,e),d={x:i,y:n},u=await Ye(e,l),c=Fe(Ne(o)),h=Me(c),p=d[h],m=d[c];if(s){let t="y"===h?"bottom":"right";p=De(p+u["y"===h?"top":"left"],p,p-u[t])}if(r){let t="y"===c?"bottom":"right";m=De(m+u["y"===c?"top":"left"],m,m-u[t])}let f=a.fn({...e,[h]:p,[c]:m});return{...f,data:{x:f.x-i,y:f.y-n,enabled:{[h]:s,[c]:r}}}}}},$i=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,n;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0,...g}=Pe(t,e);if(null!=(i=s.arrow)&&i.alignmentOffset)return{};let v=Ne(o),b=Fe(a),y=Ne(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(d.floating)),_=h||(y||!f?[Ge(a)]:function(t){let e=Ge(t);return[qe(t),e,qe(e)]}(a)),E="none"!==m;!h&&E&&_.push(...Ve(a,f,m,w));let A=[a,..._],L=await Ye(e,g),C=[],I=(null==(n=s.flip)?void 0:n.overflows)||[];if(u&&C.push(L[v]),c){let t=function(t,e,i){void 0===i&&(i=!1);let n=Oe(t),o=je(t),s=Re(o),r="x"===o?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=Ge(r)),[r,Ge(r)]}(o,r,w);C.push(L[t[0]],L[t[1]])}if(I=[...I,{placement:o,overflows:C}],!C.every(t=>t<=0)){var S,k;let t=((null==(S=s.flip)?void 0:S.index)||0)+1,e=A[t];if(e&&("alignment"!==c||b===Fe(e)||I.every(t=>Fe(t.placement)!==b||t.overflows[0]>0)))return{data:{index:t,overflows:I},reset:{placement:e}};let i=null==(k=I.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:k.placement;if(!i)switch(p){case"bestFit":{var T;let t=null==(T=I.filter(t=>{if(E){let e=Fe(t.placement);return e===b||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:T[0];t&&(i=t);break}case"initialPlacement":i=a}if(o!==i)return{reset:{placement:i}}}return{}}}},Wi=(t,e,i)=>{let n=new Map,o={platform:ji,...i},s={...o.platform,_c:n};return(async(t,e,i)=>{let{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,a=s.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e)),d=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:c}=Ue(d,n,l),h=n,p={},m=0;for(let i=0;i{};return function(n){if(i(),!n)return void t.style.removeProperty("position");let o=e();if(!o||!t.hasAttribute("anchor"))return;let s=t.getAttribute("anchor"),r=t.getAttribute("anchor-strategy")||"absolute";"absolute"!==r&&"fixed"!==r&&(r="absolute"),i=Hi(o,t,()=>{let e=Gi(window.getComputedStyle(t).getPropertyValue("--anchor-gap"),t),i=Gi(window.getComputedStyle(t).getPropertyValue("--anchor-offset"),t),n={};switch(s.split(" ")[0]){case"top":case"bottom":n={top:e,left:-1*i,right:i,bottom:e};break;case"left":case"right":n={top:-1*i,bottom:i,left:e,right:e}}Wi(o,t,{strategy:r,placement:s.replace(" ","-"),middleware:[$i({padding:n}),zi({padding:n})]}).then(async({x:e,y:i,placement:n})=>{if(!("showPopover"in HTMLElement.prototype&&HTMLElement.prototype.showPopover.toString().includes("[native code]")||"absolute"!==r)){let n=null;for(let e=t.parentElement;e;e=e.parentElement){let t=getComputedStyle(e).position;if("relative"===t||"absolute"===t||"fixed"===t||"sticky"===t){n=e;break}}if(n){let t=n.getBoundingClientRect();e-=t.left+window.scrollX,i-=t.top+window.scrollY}}let o=`${e}px`,s=`${i}px`;switch(n.split("-")[0]){case"top":s=`calc(${i}px - var(--anchor-gap, 0px))`,o=`calc(${e}px + var(--anchor-offset, 0px))`;break;case"right":o=`calc(${e}px + var(--anchor-gap, 0px))`,s=`calc(${i}px + var(--anchor-offset, 0px))`;break;case"bottom":s=`calc(${i}px + var(--anchor-gap, 0px))`,o=`calc(${e}px + var(--anchor-offset, 0px))`;break;case"left":o=`calc(${e}px - var(--anchor-gap, 0px))`,s=`calc(${i}px + var(--anchor-offset, 0px))`}Object.assign(t.style,{left:o,top:s,position:r}),await(ji.isRTL?.(t))&&Object.assign(t.style,{right:"unset",bottom:"unset"})})})}}function Gi(t,e){let i=document.createElement("div");e.appendChild(i),i.style.setProperty("margin-top","0px","important"),i.style.setProperty("margin-top",t,"important");let n=parseFloat(window.getComputedStyle(i).marginTop)||0;return e.removeChild(i),n}function Ki(t){return Ui(t)&&"tabIndex"in t}function Ui(t){return function(t){return"object"==typeof t&&null!==t&&"nodeType"in t}(t)&&"tagName"in t}function Yi(t){return Ui(t)&&"accessKey"in t}function Zi(t){let e=t.getBoundingClientRect();return!(0===e.x&&0===e.y&&0===e.width&&0===e.height||"hidden"===(t.ownerDocument.defaultView||window).getComputedStyle(t).visibility)}var Ji={get selectRequired(){let t=document.createElement("select");t.setAttribute("required","true");let e=t.validationMessage;return Object.defineProperty(this,"selectRequired",{value:e}),e}};function Xi(t,e,i){function n(){if(!Zi(t)){for(let e of t.children)if(Zi(e))return;i()}}if(typeof ResizeObserver<"u"){let i=new ResizeObserver(n);i.observe(t),e.addEventListener("abort",()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(n);i.observe(t),e.addEventListener("abort",()=>i.disconnect())}}var Qi=!1,tn=!1;typeof navigator<"u"&&(Qi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),tn=navigator.userAgent.toLowerCase().includes("firefox"));var en=!1;function nn(t,e,i,n,o,s){!function(t){if(on.has(t))return;on.add(t);let e=null;t.addEventListener("mousedown",()=>{tn||Qi||!en||(t.body.setAttribute("tabindex","-1"),e&&clearTimeout(e),e=setTimeout(()=>t.body.removeAttribute("tabindex")))},{capture:!0})}(t.ownerDocument);let r=Ee(t),a=Vi(t,i),l=_e();t.setAttribute("popover","");let d=e();function u(){t.hasAttribute("open")&&t.hidePopover()}d&&(d.setAttribute("type","button"),d.setAttribute("aria-haspopup","true"),d.setAttribute("aria-controls",t.id),d.setAttribute("aria-expanded","false"),d.id&&t.setAttribute("aria-labelledby",d.id)),t.hasAttribute("open")&&queueMicrotask(()=>t.showPopover()),t.addEventListener("beforetoggle",e=>{let i=e;a("open"===i.newState);let n=t.hasAttribute("open");"open"!==i.newState||n?"closed"===i.newState&&n&&t.removeAttributeNoCallbacks("open"):t.setAttributeNoCallbacks("open",""),"open"===i.newState?(d?.setAttribute("aria-expanded","true"),o?.(),en=""===t.getAttribute("popover")):(d?.setAttribute("aria-expanded","false"),s?.(),en=!1),"closed"===i.oldState&&"open"===i.newState?(Qi&&(l.dispose(),l=_e()),r.start("in")):"open"===i.oldState&&"closed"===i.newState&&(Qi&&l.style(t,"transition-property","none"),r.start("out"))},{signal:n}),Xi(t,n,u),d&&Xi(d,n,u),n.addEventListener("abort",()=>r.abort())}var on=new WeakSet;function sn(t,e,i,n){function o(){let i=t.getBoundingClientRect();n.style.setProperty(e,i.width+"px")}let s=t.ownerDocument,r=new ResizeObserver(o);r.observe(t),s.addEventListener("transitionend",o,{signal:i}),i.addEventListener("abort",()=>r.disconnect())}var rn=0;function an(t){return`${t}-${rn++}`}function ln(t,e,i,n){un||(un=!0,document.addEventListener("keydown",()=>{dn=Date.now()},{capture:!0})),t.addEventListener(e,t=>{null!==dn&&Date.now()-dn<200||n(t)},{passive:!0,signal:i})}var dn=null,un=!1;var cn=class extends Map{constructor(t){super(),this.factory=t}get(t){let e=super.get(t);return void 0===e&&(e=this.factory(t,this),this.set(t,e)),e}},hn=new cn(()=>({referenceCounter:0,d:_e()}));function pn(t){let e=hn.get(t);if(e.referenceCounter++,1===e.referenceCounter){let i=[/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0?{before({doc:t,d:e}){function i(t){return!!t.closest("[popover], dialog > *")}e.microTask(()=>{if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let i=_e();i.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>i.dispose()))}let n=window.scrollY??window.pageYOffset,o=null;e.addEventListener(t,"click",e=>{if(Ki(e.target))try{let n=e.target.closest("a");if(!n)return;let{hash:s}=new URL(n.href),r=t.querySelector(s);Ki(r)&&!i(r)&&(o=r)}catch{}},!0),e.addEventListener(t,"touchstart",t=>{if(Ki(t.target)&&function(t){return Ui(t)&&"style"in t}(t.target))if(i(t.target)){let n=t.target;for(;n.parentElement&&i(n.parentElement);)n=n.parentElement;e.style(n,"overscrollBehavior","contain")}else e.style(t.target,"touchAction","none")}),e.addEventListener(t,"touchmove",t=>{if(Ki(t.target)){if(function(t){return Yi(t)&&"INPUT"===t.nodeName}(t.target))return;if(i(t.target)){let e=t.target;for(;e.parentElement&&""!==e.dataset.tailwindplusPortal&&!(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);)e=e.parentElement;""===e.dataset.tailwindplusPortal&&t.preventDefault()}else t.preventDefault()}},{passive:!1}),e.add(()=>{let t=window.scrollY??window.pageYOffset;n!==t&&window.scrollTo(0,n),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})},after(){}}:{before(){},after(){}},mn(),{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")},after(){}}];i.forEach(({before:i})=>i({doc:t,d:e.d})),i.forEach(({after:i})=>i({doc:t,d:e.d}))}let i=!1;return()=>{i||(i=!0,e.referenceCounter--,!(e.referenceCounter>0)&&(e.d.dispose(),hn.delete(t)))}}function mn(){let t;return{before({doc:e}){let i=e.documentElement,n=e.defaultView??window;t=Math.max(0,n.innerWidth-i.clientWidth),i.style.setProperty("--el-top-layer-scrollbar-offset","0px")},after({doc:e,d:i}){let n=e.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,t-o);i.style(n,"paddingRight",`${s}px`),i.add(()=>{n.style.setProperty("--el-top-layer-scrollbar-offset",`-${s}px`)})}}}function fn(t,e){let i=null;t.addEventListener("toggle",e=>{"open"===e.newState?i||(i=pn(t.ownerDocument)):i&&(i(),i=null)},{signal:e}),e.addEventListener("abort",()=>{i&&(i(),i=null)})}var gn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(",");function vn(t,e,i){let n=e?t.indexOf(e):null;switch(-1===n&&(n=null),i){case 0:for(let e=0;e=0;e--)if(Zi(t[e]))return t[e];return null;case 2:if(null===n)return vn(t,e,1);for(let e=n-1;e>=0;e--)if(Zi(t[e]))return t[e];return null;case 3:if(null===n)return vn(t,e,0);for(let e=n+1;e{let e=document.getElementById(t);if(e){let t=e.getAttribute("aria-label");return"string"==typeof t?t.trim():yn(e).trim()}return null}).filter(Boolean);if(t.length>0)return t.join(", ")}return yn(t).trim()}var _n,En;_n=new WeakMap,En=new WeakMap,we("el-autocomplete",class extends ye{constructor(){super(...arguments),Ct(this,_n,[]),Ct(this,En,null)}mount(t){let e=this.getInput(),i=this.getButton(),n=this.getOptions();e.id||(e.id=an("autocomplete-input")),i&&(i.id||(i.id=an("autocomplete-button"))),n.id||(n.id=an("autocomplete-listbox")),nn(n,()=>this.getButton(),()=>this.getInput(),t,()=>this.onBeforeOpen(),()=>this.onBeforeClose()),fn(n,t),e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-controls",n.id),e.setAttribute("aria-activedescendant",""),e.setAttribute("autocomplete","off"),i&&(i.setAttribute("type","button"),i.setAttribute("tabindex","-1"),i.setAttribute("aria-expanded","false"),i.setAttribute("aria-haspopup","listbox"),i.setAttribute("popovertarget",n.id)),n.setAttribute("role","listbox"),n.setAttribute("popover","manual");let o=this;function s(){for(let e of n.getItems())"option"!==e.getAttribute("role")&&(e.id||(e.id=an("option")),e.setAttribute("role","option"),e.setAttribute("aria-selected","false"),e.setAttribute("tabIndex","-1"),e.addEventListener("mousedown",t=>{0===t.button&&(t.preventDefault(),o.selectOption(e))},{signal:t}),ln(e,"mouseover",t,()=>o.setActiveItem(e,!1)),ln(e,"mouseout",t,()=>o.clearActiveItem()));o.filterOptions()}s();let r=new MutationObserver(s);r.observe(this,{attributes:!1,childList:!0,subtree:!0}),i&&sn(i,"--button-width",t,this),sn(e,"--input-width",t,this),e.addEventListener("input",()=>{e.matches(":disabled")||(this.filterOptions(),Lt(this,_n).length>0?n.hasAttribute("open")||n.showPopover():n.hidePopover())},{signal:t});let a=()=>{e.matches(":disabled")||(e.focus(),n.hasAttribute("open")?n.hidePopover():(this.filterOptions(),Lt(this,_n).length>0&&n.showPopover()))};e.addEventListener("pointerdown",a,{signal:t}),i&&(i.addEventListener("pointerdown",t=>{t.preventDefault(),a()},{signal:t}),i.addEventListener("click",t=>{t.preventDefault(),t.stopImmediatePropagation()},{signal:t})),e.addEventListener("blur",({relatedTarget:t})=>{t&&this.contains(t)||n.hidePopover()},{signal:t}),e.addEventListener("keydown",t=>{if(!e.matches(":disabled"))switch(t.key){case"ArrowDown":t.preventDefault(),n.hasAttribute("open")||(0===Lt(this,_n).length&&this.filterOptions(),Lt(this,_n).length>0&&n.showPopover()),this.goToItem(3);break;case"ArrowUp":t.preventDefault(),n.hasAttribute("open")||(0===Lt(this,_n).length&&this.filterOptions(),Lt(this,_n).length>0&&n.showPopover()),this.goToItem(2);break;case"Home":case"PageUp":return n.hasAttribute("open")?(t.preventDefault(),t.stopPropagation(),this.goToItem(0)):void 0;case"End":case"PageDown":return n.hasAttribute("open")?(t.preventDefault(),t.stopPropagation(),this.goToItem(1)):void 0;case"Enter":{let e=this.getActiveItem();e&&(t.preventDefault(),this.selectOption(e)),n.hasAttribute("open")&&(t.preventDefault(),n.hidePopover());break}case"Escape":if(!n.hasAttribute("open"))return;t.preventDefault(),n.hidePopover();break;case"Tab":n.hidePopover()}},{signal:t});let l=Array.from(n.querySelectorAll("el-option[disabled]"));for(let t of l)t.setAttribute("aria-disabled","true"),t.setAttribute("aria-selected","false");t.addEventListener("abort",()=>{r.disconnect()})}getInput(){let t=this.querySelector("input");if(!t)throw new Error("`` must contain an input element.");return t}getButton(){return this.querySelector("button")}getOptions(){let t=this.querySelector("el-options");if(!t)throw new Error("`` must contain a `` element.");return t}filterOptions(){let t=this.getInput().value.toLowerCase();Lt(this,En)!==t&&(this.clearActiveItem(),It(this,En,t)),It(this,_n,[]);for(let e of this.getOptions().getItems()){let i=e.getAttribute("value")?.toLowerCase()||"",n=yn(e)?.trim().toLowerCase()??"";""===t||i.includes(t)||n.includes(t)?(Lt(this,_n).push(e),e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.setAttribute("hidden",""),e.setAttribute("aria-hidden","true"))}}getActiveItem(){let t=this.getInput().getAttribute("aria-activedescendant");return t?document.getElementById(t):null}goToItem(t){if(0===Lt(this,_n).length)return;let e=this.getActiveItem(),i=vn(Lt(this,_n),e,t);i&&this.setActiveItem(i)}setActiveItem(t,e=!0){let i=this.getInput(),n=this.getActiveItem();null!==n&&n.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true"),i.setAttribute("aria-activedescendant",t.id),e&&t.scrollIntoView({block:"nearest"})}clearActiveItem(){let t=this.getInput(),e=this.getActiveItem();null!==e&&e.setAttribute("aria-selected","false"),t.setAttribute("aria-activedescendant","")}selectOption(t){let e=this.getInput(),i=t.getAttribute("value");i&&(e.value=i,e.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),this.getOptions().hidePopover())}onBeforeOpen(){let t=this.getInput(),e=this.getButton();t.setAttribute("aria-expanded","true"),e?.setAttribute("aria-expanded","true")}onBeforeClose(){let t=this.getInput(),e=this.getButton();t.setAttribute("aria-expanded","false"),e?.setAttribute("aria-expanded","false"),this.clearActiveItem()}});var An,Ln,Cn,In,Sn,kn;An=new WeakMap,Ln=new WeakMap,Cn=new WeakMap,In=new WeakSet,Sn=function(t=!1){let e=this.getItems(),i=this.getInput().value??"";It(this,An,[]);for(let t of e.getItems()){if(t.closest("el-defaults"))continue;let e=wn(t)??"";""!==i&&Lt(this,Cn).call(this,{query:i,node:t,content:e})?(Lt(this,An).push(t),t.removeAttribute("hidden"),t.removeAttribute("aria-hidden")):(t.setAttribute("hidden",""),t.setAttribute("aria-hidden","true"))}for(let t of this.getGroups())t.getItems().some(t=>!t.hasAttribute("hidden"))?t.removeAttribute("hidden"):t.setAttribute("hidden","");let n=this.getSuggestions();n&&(""===i?(n.removeAttribute("hidden"),It(this,An,n.getItems())):n.setAttribute("hidden",""));let o=this.querySelector("el-no-results");o&&(""===i||Lt(this,An).length>0?o.setAttribute("hidden",""):o.removeAttribute("hidden")),0===Lt(this,An).length?e.setAttribute("hidden",""):e.removeAttribute("hidden"),(!t||""!==i)&&(0===Lt(this,An).length?this.clearActiveItem():Lt(this,Ln)!==i&&this.goToItem(0),It(this,Ln,i))},kn=function(t,e=!0){let i=this.getInput(),n=this.getActiveItem();if(t===n)return;if(null!==n){n.setAttribute("aria-selected","false");let t=this.querySelector(`el-command-preview[for="${n.id}"]`);t&&t.setAttribute("hidden","")}t.setAttribute("aria-selected","true"),i.setAttribute("aria-activedescendant",t.id);let o=this.querySelector(`el-command-preview[for="${t.id}"]`);o&&o.removeAttribute("hidden"),e&&t.scrollIntoView({block:"nearest"}),this.dispatchEvent(new CustomEvent("change",{detail:{relatedTarget:t},bubbles:!1,cancelable:!1}))};we("el-command-palette",class extends ye{constructor(){super(...arguments),Ct(this,In),Ct(this,An,[]),Ct(this,Ln,null),Ct(this,Cn,({query:t,content:e})=>e.toLocaleLowerCase().includes(t.toLocaleLowerCase().trim()))}mount(t){let e=this.getInput(),i=this.getItems();e.id||(e.id=an("command-input")),i.id||(i.id=an("command-items")),e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("autocomplete","off"),e.setAttribute("aria-controls",i.id),i.setAttribute("role","listbox");let n=this;function o(e=!1){var o;for(let e of i.getItems())"option"!==e.getAttribute("role")&&(e.id||(e.id=an("item")),e.setAttribute("role","option"),e.setAttribute("tabIndex","-1"),e.setAttribute("aria-selected","false"),e.hasAttribute("disabled")&&e.setAttribute("aria-disabled","true"),ln(e,"mouseover",t,()=>{var t;return St(t=n,In,kn).call(t,e,!1)}));St(o=n,In,Sn).call(o,e),e||n.goToItem(0)}o(!0);let s=new MutationObserver(()=>o(!1));s.observe(this,{attributes:!1,childList:!0,subtree:!0}),sn(e,"--input-width",t,this),e.addEventListener("input",()=>St(this,In,Sn).call(this),{signal:t}),e.addEventListener("keydown",t=>{switch(t.key){case"ArrowDown":t.preventDefault(),this.goToItem(3);break;case"ArrowUp":t.preventDefault(),this.goToItem(2);break;case"Home":case"PageUp":return t.preventDefault(),t.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return t.preventDefault(),t.stopPropagation(),this.goToItem(1);case"Enter":{let e=this.getActiveItem();e&&(t.preventDefault(),e.click());break}}},{signal:t}),t.addEventListener("abort",()=>{s.disconnect()})}getInput(){let t=this.querySelector("input");if(!t)throw new Error("`` must contain an input element.");return t}getItems(){let t=this.querySelector("el-command-list");if(!t)throw new Error("`` must contain a `` element.");return t}getGroups(){return this.getItems().querySelectorAll("el-command-group")}getSuggestions(){return this.querySelector("el-defaults")}getActiveItem(){let t=this.getInput().getAttribute("aria-activedescendant");return t?document.getElementById(t):null}goToItem(t){if(0===Lt(this,An).length)return;let e=this.getActiveItem(),i=vn(Lt(this,An),e,t);i&&St(this,In,kn).call(this,i)}clearActiveItem(){let t=this.getInput(),e=this.getActiveItem();if(null!==e){e.setAttribute("aria-selected","false");let t=this.querySelector(`el-command-preview[for="${e.id}"]`);t&&t.setAttribute("hidden","")}t.removeAttribute("aria-activedescendant"),this.dispatchEvent(new CustomEvent("change",{detail:{relatedTarget:null},bubbles:!1,cancelable:!1}))}reset(){let t=this.getInput();t.value="",t.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),St(this,In,Sn).call(this,!0),this.clearActiveItem()}setFilterCallback(t){It(this,Cn,t)}}),we("el-command-list",class extends ye{getItems(){return Array.from(this.querySelectorAll(`${gn},[role="option"]`))}}),we("el-defaults",class extends ye{getItems(){return Array.from(this.querySelectorAll(`${gn},[role="option"]`))}}),we("el-no-results",class extends ye{}),we("el-command-group",class extends ye{getItems(){return Array.from(this.querySelectorAll(`${gn},[role="option"]`))}}),we("el-command-preview",class extends ye{});var Tn=[];he(()=>{function t(t){if(t.target===document.body||Tn[0]===t.target)return;let e=t.target;e&&"closest"in e&&(e=e.closest(gn),Tn.unshift(e??t.target),Tn=Tn.filter(t=>null!=t&&t.isConnected),Tn.splice(10))}window.addEventListener("click",t,{capture:!0}),window.addEventListener("pointerdown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("pointerdown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});var xn=null;typeof globalThis.window<"u"&&(xn=HTMLDialogElement.prototype.close,Object.defineProperties(HTMLDialogElement.prototype,{close:{value(){let t=this.closest("el-dialog");if(!(t instanceof Bn))return xn?.apply(this,arguments);let e=t.beforeClose();if(!0===e)return xn?.apply(this,arguments);!1!==e&&e.then(t=>t?xn?.apply(this,arguments):null).catch(console.error)}}}),document.addEventListener("command",t=>{let e=t.target;if(!(e instanceof HTMLDialogElement&&"command"in t&&"close"===t.command))return;let i=e.closest("el-dialog");if(!(i instanceof Bn))return;let n=i.beforeClose();!0!==n&&(t.stopImmediatePropagation(),t.preventDefault(),!1!==n&&n.then(t=>t?xn?.apply(e):null).catch(console.error))},!0));var Dn,Pn,Nn,On,Mn,Rn,Bn=class extends ye{constructor(){super(...arguments),Ct(this,Mn),Ct(this,Dn,null),Ct(this,Pn,null),Ct(this,Nn,!0),Ct(this,On,Ee(this,()=>Array.from(this.querySelectorAll("el-dialog-panel,el-dialog-backdrop"))))}mount(t){let e=this.getNativeDialog();e.removeAttribute("open"),e.style.setProperty("right","var(--el-top-layer-scrollbar-offset, 0px)");let i=this.hasAttribute("open");for(let t of St(this,Mn,Rn).call(this))t.setAttribute("aria-expanded",i.toString());!function(t,e,i){t.addEventListener("keydown",t=>{"Escape"===t.key&&(t.defaultPrevented||i(t))},{signal:e})}(e,t,t=>{t.preventDefault();let i=new Event("cancel",{bubbles:!1,cancelable:!0});!this.dispatchEvent(i)||e.close()}),Xi(this.querySelector("el-dialog-panel")??e,t,()=>{this.hasAttribute("open")&&e.close()});let n=null;e.addEventListener("beforetoggle",t=>{let e=t;"open"===e.newState&&"closed"===e.oldState&&this.beforeOpen();let i=this.hasAttribute("open");if("open"!==e.newState||i?"closed"===e.newState&&i&&(this.dispatchEvent(new CustomEvent("close",{bubbles:!1,cancelable:!1})),this.removeAttribute("open")):(this.dispatchEvent(new CustomEvent("open",{bubbles:!1,cancelable:!1})),this.setAttribute("open","")),"open"===e.newState&&"closed"===e.oldState)Tn.length>0&&!n&&(n=Tn[0]);else if("closed"===e.newState&&"open"===e.oldState){let t=Lt(this,Nn);setTimeout(()=>{t?(n&&n!==document.activeElement&&n.isConnected&&pe(n),n=null):n&&n===document.activeElement&&n.isConnected&&"blur"in n&&"function"==typeof n.blur&&n.blur()})}},{signal:t}),t.addEventListener("abort",()=>{var t;Lt(this,On).abort(),null==(t=Lt(this,Pn))||t.call(this)}),this.hasAttribute("open")&&e.showModal()}onAttributeChange(t,e,i){switch(t){case"open":{let t=this.getNativeDialog();for(let t of St(this,Mn,Rn).call(this))t.setAttribute("aria-expanded",null!==i?"true":"false");null===i?t.close():t.showModal();break}}}getNativeDialog(){let t=this.querySelector("dialog");if(!t)throw new Error("[ElDialog] No `` element found");return t}beforeOpen(){It(this,Nn,!0),Lt(this,Dn)&&(Lt(this,Dn).abort(),It(this,Dn,null)),Lt(this,Pn)||It(this,Pn,pn(this.ownerDocument)),Lt(this,On)&&Lt(this,On).start("in")}beforeClose(){if(Lt(this,Pn)&&(Lt(this,Pn).call(this),It(this,Pn,null)),Lt(this,Dn))return!1;It(this,Dn,new AbortController);let t=Lt(this,Dn).signal;return new Promise(e=>{Lt(this,On)?.start("out",()=>{t.aborted||(It(this,Dn,null),requestAnimationFrame(()=>{let t=this.getNativeDialog(),e=t.style.cssText;t.style.cssText=e+"transition-duration: 0 !important;",xn?.apply(t),requestAnimationFrame(()=>{t.style.cssText=e})}),e(!0))})})}show(){this.getNativeDialog().showModal()}hide({restoreFocus:t=!0}={}){It(this,Nn,t),this.getNativeDialog().close()}};Dn=new WeakMap,Pn=new WeakMap,Nn=new WeakMap,On=new WeakMap,Mn=new WeakSet,Rn=function(){return document.querySelectorAll(`[commandfor="${this.getNativeDialog().id}"]`)},Et(Bn,"observedAttributes",["open"]);we("el-dialog",Bn),we("el-dialog-panel",class extends ye{mount(t){!function(t,e,i){document.addEventListener("click",e=>{if(e.target===t){let{clientX:n,clientY:o}=e,s=t.getBoundingClientRect();if(n>=s.left&&n<=s.right&&o>=s.top&&o<=s.bottom)return;return void i(e)}let n=t.closest("dialog");n&&n.contains(e.target)&&!t.contains(e.target)?i(e):e.target!==e.target.ownerDocument.documentElement||i(e)},{signal:e,capture:!0})}(this,t,()=>{let t=this.getDialog(),e=t.getNativeDialog();if(!e.hasAttribute("open"))return;let i=new Event("cancel",{bubbles:!1,cancelable:!0});!t.dispatchEvent(i)||e.close()})}getDialog(){let t=this.closest("el-dialog");if(!t)throw new Error("[ElDialogPanel] No `` parent found");return t}}),we("el-dialog-backdrop",class extends ye{mount(){this.setAttribute("inert","")}});var Fn,jn,qn,Hn=class extends ye{constructor(){super(...arguments),Ct(this,jn),Ct(this,Fn,Ee(this))}mount(t){this.id||(this.id=an("disclosure")),this.hasAttribute("hidden")?this.removeAttributeNoCallbacks("open"):this.setAttributeNoCallbacks("open","");let e=()=>{this.hasAttribute("open")&&this.hide()},i=!this.hasAttribute("hidden");for(let n of St(this,jn,qn).call(this))Xi(n,t,e),n.setAttribute("aria-expanded",i.toString()),n.setAttribute("aria-controls",this.id);this.addEventListener("command",t=>{if(t.target instanceof HTMLElement&&"command"in t)switch(t.command){case"--show":this.show(),t.preventDefault();break;case"--hide":this.hide(),t.preventDefault();break;case"--toggle":this.toggle(),t.preventDefault()}},{signal:t}),Xi(this,t,e),t.addEventListener("abort",()=>Lt(this,Fn).abort())}onAttributeChange(t,e,i){switch(t){case"hidden":null===i?this.setAttributeNoCallbacks("open",""):this.removeAttributeNoCallbacks("open");for(let t of St(this,jn,qn).call(this))t.setAttribute("aria-expanded",null===i?"true":"false");null===i?Lt(this,Fn).start("in"):Lt(this,Fn).start("out");break;case"open":null===i?this.hide():this.show()}}show(){this.removeAttribute("hidden")}hide(){this.setAttribute("hidden","")}toggle(){this.hasAttribute("hidden")?this.show():this.hide()}};function zn(t,e,i,n,o){let s=null;for(let i of e)i.addEventListener("pointerdown",e=>{0===e.button&&t.classList.contains(":popover-open")&&(s=Date.now()+100)},{signal:n,capture:!0});t.ownerDocument.addEventListener("focusin",n=>{if(!i.hasAttribute("open"))return;let r=n.target,a=n.relatedTarget;null!==r&&(s&&Date.now()t.contains(r))||o(a))},{signal:n})}Fn=new WeakMap,jn=new WeakSet,qn=function(){return document.querySelectorAll(`[commandfor="${this.id}"]`)},Et(Hn,"observedAttributes",["hidden","open"]),we("el-disclosure",Hn);function $n(t,e,i){let n=null,o="",s=null,r=null;t.id||(t.id=an(e.role));let a=e.getButton();function l(){let t=e.getItems(),n={passive:!0,signal:i},o="menu"===e.role?"menuitem":"option";for(let s of t)s.getAttribute("role")!==o&&(s.id||(s.id=an("item")),s.setAttribute("role",o),s.setAttribute("tabIndex","-1"),s.addEventListener("click",()=>e.onItemClick(s),n),ln(s,"mouseover",i,()=>p(s,!1)),ln(s,"mouseout",i,()=>m()))}a.id||(a.id=an(`${e.role}-button`)),nn(t,()=>e.getButton(),()=>e.getButton(),i,()=>e.onBeforeOpen(),()=>{e.onBeforeClose(),m(),o="",s&&(clearTimeout(s),s=null)}),fn(t,i),t.setAttribute("popover","manual"),t.setAttribute("role",e.role),a.setAttribute("popovertarget",t.id),a.setAttribute("aria-haspopup",e.role),l();let d=new MutationObserver(l);d.observe(t,{attributes:!1,childList:!0,subtree:!0}),zn(t,[a],t,i,e=>{null===e&&(r=Date.now()+100),t.hidePopover()});let u=null,c=!1;a.addEventListener("pointerdown",e=>{if(0===e.button&&!a.matches(":disabled")){if("touch"===e.pointerType)return void(c=!0);t.togglePopover(),u=Date.now()}},{signal:i}),document.addEventListener("pointerup",e=>{if(0===e.button&&!a.matches(":disabled")&&t.hasAttribute("open")){if(Date.now()-(u??0)>200){let i=e.composedPath();if(i.includes(t)){if(null!==u){let t=f();t&&t.click()}return}for(let e of i)if(e instanceof Element&&(e.getAttribute("commandfor")||e.getAttribute("popovertarget"))===t.id)return;t.hidePopover()}u=null}},{signal:i,capture:!0}),a.addEventListener("click",t=>{c?c=!1:(t.preventDefault(),t.stopPropagation())},{signal:i});let h=null;function p(e,i=!0){let o=f();null!==o&&o.setAttribute("tabIndex","-1"),t.removeAttribute("tabIndex"),e.setAttribute("tabIndex","0"),e.focus({preventScroll:!0}),n=e,i&&e.scrollIntoView({block:"nearest"})}function m(){let e=f();null!==e&&e.setAttribute("tabIndex","-1"),n=null,t.hasAttribute("open")&&(t.setAttribute("tabIndex","0"),t.focus())}function f(){return n}function g(t,i=!1){if(""===t)return null;let n=e.getItems(),o=t.toLowerCase(),s=f(),r=s?n.indexOf(s):-1;if(!i&&s&&-1!==r&&Zi(s)&&(s.textContent?.trim().toLowerCase()||"").startsWith(o))return s;for(let t=r+1;t{let e=t;"open"===e.newState&&"closed"===e.oldState&&Tn.length>0&&!h&&(h=Tn[0])},{signal:i}),t.addEventListener("toggle",e=>{let i=e;"closed"===i.newState&&"open"===i.oldState&&setTimeout(()=>{!t.contains(document.activeElement)&&document.activeElement!==document.body||r&&Date.now(){s&&(clearTimeout(s),s=null),d.disconnect()}),{ignoreNextFocusRestoration:()=>r=Date.now()+100,setActiveItem:p,clearActiveItem:m,getActiveItem:f,findItemBySearchQuery:g,handleSearchKey:function(t){let e=""===o;s&&(clearTimeout(s),s=null),o+=t.toLowerCase();let i=g(o,e);i&&p(i,!0),s=setTimeout(()=>{o="",s=null},350)},hasActiveSearchQuery:function(){return""!==o}}}var Wn,Vn,Gn,Kn,Un,Yn=class extends ye{constructor(){super(...arguments),Ct(this,Kn),Ct(this,Wn,this.attachInternals()),Ct(this,Vn,""),Ct(this,Gn,null)}mount(t){let e=this.getOptions();this.value=this.getAttribute("value")??this.value??"";let i=this.getButton();i.id||(i.id=an("select-button")),sn(i,"--button-width",t,this),i.addEventListener("keydown",t=>{if(!i.matches(":disabled"))switch(t.key){case"ArrowUp":case"ArrowDown":e.showPopover(),this.goToItem("selected"),t.preventDefault();break;case"Enter":t.preventDefault(),Lt(this,Wn).form&&Lt(this,Wn).form.requestSubmit();break;case" ":if(e.hasAttribute("open")&&Lt(this,Gn)&&Lt(this,Gn).hasActiveSearchQuery()){t.preventDefault(),t.stopPropagation(),Lt(this,Gn).handleSearchKey(t.key);break}t.preventDefault(),e.hasAttribute("open")?e.hidePopover():(e.showPopover(),this.goToItem("selected"));break;default:e.hasAttribute("open")&&1===t.key.length&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&(t.preventDefault(),t.stopPropagation(),this.handleSearchKey(t.key))}},{signal:t});for(let t of Lt(this,Wn).labels)t.setAttribute("for",i.id);It(this,Gn,$n(e,{role:"listbox",getItems:()=>this.getItems(),onItemClick:t=>this.setSelectedOption(t),getButton:()=>this.getButton(),onBeforeOpen:()=>this.onBeforeOpen(),onBeforeClose:()=>this.onBeforeClose()},t)),e.addEventListener("keydown",t=>{switch(t.key){case"ArrowDown":return t.preventDefault(),t.stopPropagation(),this.goToItem(3);case"ArrowUp":return t.preventDefault(),t.stopPropagation(),this.goToItem(2);case"Home":case"PageUp":return t.preventDefault(),t.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return t.preventDefault(),t.stopPropagation(),this.goToItem(1);case" ":if(Lt(this,Gn)&&Lt(this,Gn).hasActiveSearchQuery())return t.preventDefault(),t.stopPropagation(),void Lt(this,Gn).handleSearchKey(t.key);case"Enter":{t.preventDefault(),t.stopPropagation();let i=this.getActiveItem();return void(i?i.click():e.hidePopover())}case"Tab":Lt(this,Gn)&&Lt(this,Gn).ignoreNextFocusRestoration();break;case"Escape":t.preventDefault(),t.stopPropagation(),e.hidePopover(),i.focus();break;default:1===t.key.length&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&(t.preventDefault(),t.stopPropagation(),Lt(this,Gn)&&Lt(this,Gn).handleSearchKey(t.key))}},{signal:t}),e.addEventListener("toggle",t=>{"open"===t.newState&&this.onOpen()},{signal:t});let n=Array.from(e.querySelectorAll("el-option[disabled]"));for(let t of n)t.setAttribute("aria-disabled","true"),t.setAttribute("aria-selected","false")}onAttributeChange(t,e,i){switch(t){case"value":null!==i&&(this.value=i);break;case"required":St(this,Kn,Un).call(this)}}getButton(){let t=this.querySelector("button");if(!t)throw new Error("`` must contain a button element.");return t}getOptions(){let t=this.querySelector("el-options");if(!t)throw new Error("`` must contain a `` element.");return t}setSelectedOption(t){this.value=t.getAttribute("value"),this.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),this.getOptions().hidePopover()}getOptionByName(t){return this.getOptions().getOptionByName(t)}getItems(){return this.getOptions().getItems()}getActiveItem(){return Lt(this,Gn)?.getActiveItem()}getSelectedOption(){return this.getOptionByName(Lt(this,Vn))}goToItem(t=4){let e=this.getItems();if(0===e.length)return;let i=this.getActiveItem();if(null===i&&(2===t||3===t))return void this.goToItem("selected");if("selected"===t){let t=this.getSelectedOption();return void(t&&Zi(t)?this.setActiveItem(t):this.goToItem(0))}let n=vn(e,i,t);n&&this.setActiveItem(n)}setActiveItem(t){Lt(this,Gn)&&Lt(this,Gn).setActiveItem(t)}clearActiveItem(){Lt(this,Gn)&&Lt(this,Gn).clearActiveItem()}onBeforeOpen(){let t=this.getButton(),e=t.dataset.originalTabIndex;e&&(t.dataset.originalTabIndex=e),t.setAttribute("tabIndex","-1")}onOpen(){null===this.getActiveItem()&&this.goToItem("selected")}onBeforeClose(){let t=this.getButton(),e=t.dataset.originalTabIndex;delete t.dataset.originalTabIndex,void 0!==e?t.setAttribute("tabIndex",e):t.removeAttribute("tabIndex");let i=this.getActiveItem();null!==i&&i.setAttribute("tabIndex","-1")}handleSearchKey(t){Lt(this,Gn)&&Lt(this,Gn).handleSearchKey(t)}set value(t){It(this,Vn,t),Lt(this,Wn).setFormValue(t),St(this,Kn,Un).call(this);let e=this.getSelectedOption();if(e){for(let t of this.getItems())t.setAttribute("aria-selected","false");e.setAttribute("aria-selected","true");try{this.querySelectorAll("el-selectedcontent").forEach(t=>t.update())}catch{}}}get value(){return Lt(this,Vn)}};Wn=new WeakMap,Vn=new WeakMap,Gn=new WeakMap,Kn=new WeakSet,Un=function(){this.hasAttribute("required")&&!Lt(this,Vn)?Lt(this,Wn).setValidity({valueMissing:!0},Ji.selectRequired,this.getButton()):Lt(this,Wn).setValidity({})},Et(Yn,"formAssociated",!0),Et(Yn,"observedAttributes",["required"]);we("el-select",Yn),we("el-selectedcontent",class extends ye{mount(){this.update()}update(){let t=this.getSelect().getSelectedOption();if(!t)return;let e=document.createDocumentFragment();for(let i of t.childNodes)e.append(i.cloneNode(!0));this.replaceChildren(e)}getSelect(){let t=this.closest("el-select");if(!t)throw new Error("`` must be inside of a `` element.");return t}});var Zn,Jn=class extends ye{constructor(){super(...arguments),Ct(this,Zn,null)}mount(t){It(this,Zn,$n(this,{role:"menu",getItems:()=>this.getItems(),onItemClick:()=>this.hidePopover(),getButton:()=>this.getDropdown().getButton(),onBeforeOpen:()=>this.onBeforeOpen(),onBeforeClose:()=>this.onBeforeClose()},t));let e=this.getDropdown().getButton();e.addEventListener("keydown",t=>{if(!e.disabled)switch(t.key){case"ArrowDown":this.showPopover(),this.goToItem(0),t.preventDefault();break;case"ArrowUp":this.showPopover(),this.goToItem(1),t.preventDefault();break;case" ":if(this.hasAttribute("open")&&Lt(this,Zn)&&Lt(this,Zn).hasActiveSearchQuery()){t.preventDefault(),t.stopPropagation(),Lt(this,Zn).handleSearchKey(t.key);break}case"Enter":t.preventDefault(),this.hasAttribute("open")?this.hidePopover():(this.showPopover(),this.goToItem(0));break;default:this.hasAttribute("open")&&1===t.key.length&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&(t.preventDefault(),t.stopPropagation(),Lt(this,Zn)&&Lt(this,Zn).handleSearchKey(t.key))}},{signal:t}),this.addEventListener("keydown",t=>{switch(t.key){case"ArrowDown":return t.preventDefault(),t.stopPropagation(),this.goToItem(3);case"ArrowUp":return t.preventDefault(),t.stopPropagation(),this.goToItem(2);case"Home":case"PageUp":return t.preventDefault(),t.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return t.preventDefault(),t.stopPropagation(),this.goToItem(1);case" ":if(Lt(this,Zn)&&Lt(this,Zn).hasActiveSearchQuery())return t.preventDefault(),t.stopPropagation(),void Lt(this,Zn).handleSearchKey(t.key);case"Enter":{t.preventDefault(),t.stopPropagation();let e=this.getActiveItem();return void(e?e.click():this.hidePopover())}case"Tab":Lt(this,Zn)&&Lt(this,Zn).ignoreNextFocusRestoration();break;case"Escape":t.preventDefault(),t.stopPropagation(),this.hidePopover(),e.focus();break;default:1===t.key.length&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&(t.preventDefault(),t.stopPropagation(),Lt(this,Zn)&&Lt(this,Zn).handleSearchKey(t.key))}},{signal:t})}onBeforeOpen(){let t=this.getDropdown().getButton(),e=t.dataset.originalTabIndex;e&&(t.dataset.originalTabIndex=e),t.setAttribute("tabIndex","-1"),null===this.getActiveItem()&&(this.setAttribute("tabIndex","0"),setTimeout(()=>this.focus({preventScroll:!0})))}onBeforeClose(){let t=this.getDropdown().getButton(),e=t.dataset.originalTabIndex;delete t.dataset.originalTabIndex,void 0!==e?t.setAttribute("tabIndex",e):t.removeAttribute("tabIndex");let i=this.getActiveItem();null!==i&&i.setAttribute("tabIndex","-1")}goToItem(t=4){let e=this.getItems();if(0===e.length)return;let i=vn(e,this.getActiveItem(),t);i&&this.setActiveItem(i)}setActiveItem(t){Lt(this,Zn)&&Lt(this,Zn).setActiveItem(t)}clearActiveItem(){Lt(this,Zn)&&Lt(this,Zn).clearActiveItem()}getDropdown(){let t=this.closest("el-dropdown");if(!t)throw new Error("[ElMenu] No `` element found");return t}getItems(){return Array.from(this.querySelectorAll(`${gn},[role="menuitem"]`))}getActiveItem(){return Lt(this,Zn)?.getActiveItem()||null}onAttributeChange(t,e,i){if("open"===t)null===i?this.hidePopover():this.showPopover()}};Zn=new WeakMap,Et(Jn,"observedAttributes",["anchor","open"]),we("el-menu",Jn),we("el-dropdown",class extends ye{getButton(){let t=this.querySelector("button");if(!t)throw new Error("[ElDropdown] No `