diff --git a/assets/js/app.js b/assets/js/app.js index 1f0154aa1..1dcdcfda2 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -17,6 +17,7 @@ import collapseSubSidebar from "./ui/collapsible_sub_sidebar.js"; import fileUpload from "./ui/file_upload.js"; import tags from "./ui/tags.js"; import facetDropdowns from "./ui/facet_dropdowns.js"; +import initSidebarMenu from "./ui/sidebar_menu.js"; // configure htmx htmx.config.defaultFocusScroll = true; @@ -45,6 +46,7 @@ document.addEventListener("DOMContentLoaded", function () { fileUpload(); tags(); facetDropdowns(); + initSidebarMenu(); }); htmx.onLoad(function (el) { diff --git a/assets/js/ui/sidebar_menu.js b/assets/js/ui/sidebar_menu.js new file mode 100644 index 000000000..010855bea --- /dev/null +++ b/assets/js/ui/sidebar_menu.js @@ -0,0 +1,47 @@ +export default function initSidebarMenu() { + const menuButtons = document.querySelectorAll("[data-sidebar-menu] button"); + const contents = document.querySelectorAll("[data-sidebar-content]"); + const closeButtons = document.querySelectorAll("[data-sidebar-close]"); + + menuButtons.forEach((button) => { + button.addEventListener("click", () => { + const targetId = button.getAttribute("data-target-id"); + const targetContent = document.getElementById(targetId); + + // Check if the target content is currently displayed. + if (targetContent.classList.contains("open")) { + // If so, hide it. + targetContent.classList.remove("open"); + button.classList.remove("active"); + } else { + // If not, hide all contents and show the target content. + contents.forEach((content) => { + content.classList.remove("open"); + }); + menuButtons.forEach((btn) => { + btn.classList.remove("active"); + }); + + targetContent.classList.add("open"); + button.classList.add("active"); + } + }); + }); + + closeButtons.forEach((button) => { + button.addEventListener("click", () => { + const parentContent = button.closest("[data-sidebar-content]"); + if (parentContent) { + parentContent.classList.remove("open"); + + // Find the corresponding menu button and remove active class. + const correspondingButton = document.querySelector( + `[data-sidebar-menu] button[data-target="${parentContent.id}"]`, + ); + if (correspondingButton) { + correspondingButton.classList.remove("active"); + } + } + }); + }); +} diff --git a/static/js/app-X5MYBGAE.js b/static/js/app-4WA5PKDO.js similarity index 84% rename from static/js/app-X5MYBGAE.js rename to static/js/app-4WA5PKDO.js index cb6e9423f..1d1ebd871 100644 --- a/static/js/app-X5MYBGAE.js +++ b/static/js/app-4WA5PKDO.js @@ -1,4 +1,4 @@ -(()=>{var ba=Object.create;var gs=Object.defineProperty;var ya=Object.getOwnPropertyDescriptor;var Ea=Object.getOwnPropertyNames;var wa=Object.getPrototypeOf,Ta=Object.prototype.hasOwnProperty;var ps=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var xa=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ea(t))!Ta.call(e,s)&&s!==n&&gs(e,s,{get:()=>t[s],enumerable:!(i=ya(t,s))||i.enumerable});return e};var Sa=(e,t,n)=>(n=e!=null?ba(wa(e)):{},xa(t||!e||!e.__esModule?gs(n,"default",{value:e,enumerable:!0}):n,e));var ha=ps((hs,fs)=>{(function(e,t){typeof hs=="object"&&typeof fs<"u"?fs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).Tagify=t()})(hs,function(){"use strict";function e(o,a){var c=Object.keys(o);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);a&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(o,g).enumerable})),c.push.apply(c,h)}return c}function t(o){for(var a=1;a(o=""+o,a=""+a,h&&(o=o.trim(),a=a.trim()),c?o==a:o.toLowerCase()==a.toLowerCase()),s=(o,a)=>o&&Array.isArray(o)&&o.map(c=>r(c,a));function r(o,a){var c,h={};for(c in o)a.indexOf(c)<0&&(h[c]=o[c]);return h}function l(o){var a=document.createElement("div");return o.replace(/\&#?[0-9a-z]+;/gi,function(c){return a.innerHTML=c,a.innerText})}function u(o){return new DOMParser().parseFromString(o.trim(),"text/html").body.firstElementChild}function d(o,a){for(a=a||"previous";o=o[a+"Sibling"];)if(o.nodeType==3)return o}function f(o){return typeof o=="string"?o.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/`|'/g,"'"):o}function m(o){var a=Object.prototype.toString.call(o).split(" ")[1].slice(0,-1);return o===Object(o)&&a!="Array"&&a!="Function"&&a!="RegExp"&&a!="HTMLUnknownElement"}function p(o,a,c){function h(g,b){for(var v in b)if(b.hasOwnProperty(v)){if(m(b[v])){m(g[v])?h(g[v],b[v]):g[v]=Object.assign({},b[v]);continue}if(Array.isArray(b[v])){g[v]=Object.assign([],b[v]);continue}g[v]=b[v]}}return o instanceof Object||(o={}),h(o,a),c&&h(o,c),o}function E(){let o=[],a={};for(let c of arguments)for(let h of c)m(h)?a[h.value]||(o.push(h),a[h.value]=1):o.includes(h)||o.push(h);return o}function x(o){return String.prototype.normalize?typeof o=="string"?o.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:o}var C=()=>/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent);function T(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,o=>(o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>o/4).toString(16))}function H(o){return o&&o.classList&&o.classList.contains(this.settings.classNames.tag)}var V={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:()=>{},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:"\xA0"},autoComplete:{enabled:!0,rightKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,highlightFirst:!1,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:()=>Promise.resolve(),beforePaste:()=>Promise.resolve(),suggestionClick:()=>Promise.resolve()}};function z(){this.dropdown={};for(let o in this._dropdown)this.dropdown[o]=typeof this._dropdown[o]=="function"?this._dropdown[o].bind(this):this._dropdown[o];this.dropdown.refs()}var k={refs(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs(){return[...this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector)]},show(o){var a,c,h,g=this.settings,b=g.mode=="mix"&&!g.enforceWhitelist,v=!g.whitelist||!g.whitelist.length,y=g.dropdown.position=="manual";if(o=o===void 0?this.state.inputText:o,!(v&&!b&&!g.templates.dropdownItemNoMatch||g.dropdown.enable===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(o),o&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",o),g.templates.dropdownItemNoMatch&&(h=g.templates.dropdownItemNoMatch.call(this,{value:o}))),!h){if(this.suggestedListItems.length)o&&b&&!this.state.editing.scope&&!i(this.suggestedListItems[0].value,o)&&this.suggestedListItems.unshift({value:o});else{if(!o||!b||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:o}]}c=""+(m(a=this.suggestedListItems[0])?a.value:a),g.autoComplete&&c&&c.indexOf(o)==0&&this.input.autocomplete.suggest.call(this,a)}this.dropdown.fill(h),g.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(g.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=o||!0,this.state.dropdown.query=o,this.setStateSelection(),y||setTimeout(()=>{this.dropdown.position(),this.dropdown.render()}),setTimeout(()=>{this.trigger("dropdown:show",this.DOM.dropdown)})}},hide(o){var a=this.DOM,c=a.scope,h=a.dropdown,g=this.settings.dropdown.position=="manual"&&!o;if(h&&document.body.contains(h)&&!g)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),c.setAttribute("aria-expanded",!1),h.parentNode.removeChild(h),setTimeout(()=>{this.state.dropdown.visible=!1},100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",h),this},toggle(o){this.dropdown[this.state.dropdown.visible&&!o?"hide":"show"]()},render(){var o,a,c,h=(o=this.DOM.dropdown,(c=o.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(c),a=c.clientHeight,c.parentNode.removeChild(c),a),g=this.settings;return typeof g.dropdown.enabled=="number"&&g.dropdown.enabled>=0?(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(g.classNames.dropdownInital),this.dropdown.position(h),g.dropdown.appendTarget.appendChild(this.DOM.dropdown),setTimeout(()=>this.DOM.dropdown.classList.remove(g.classNames.dropdownInital))),this):this},fill(o){o=typeof o=="string"?o:this.dropdown.createListHTML(o||this.suggestedListItems);var a,c=this.settings.templates.dropdownContent.call(this,o);this.DOM.dropdown.content.innerHTML=(a=c)?a.replace(/\>[\r\n ]+\<").replace(/(<.*?>)|\s+/g,(h,g)=>g||" "):""},fillHeaderFooter(){this.settings.templates;var o=this.dropdown.filterListItems(this.state.dropdown.query),a=this.parseTemplate("dropdownHeader",[o]),c=this.parseTemplate("dropdownFooter",[o]),h=this.dropdown.getHeaderRef(),g=this.dropdown.getFooterRef();a&&h?.parentNode.replaceChild(a,h),c&&g?.parentNode.replaceChild(c,g)},refilter(o){o=o||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(o),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},position(o){var a=this.settings.dropdown;if(a.position!="manual"){var c,h,g,b,v,y,S=this.DOM.dropdown,D=a.placeAbove,W=a.appendTarget===document.body,O=W?window.pageYOffset:a.appendTarget.scrollTop,A=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,te=A.clientHeight,G=Math.max(A.clientWidth||0,window.innerWidth||0)>480?a.position:"all",J=this.DOM[G=="input"?"input":"scope"];if(o=o||S.clientHeight,this.state.dropdown.visible){if(G=="text"?(g=(c=this.getCaretGlobalPosition()).bottom,h=c.top,b=c.left,v="auto"):(y=function(N){for(var j=0,le=0;N&&N!=A;)j+=N.offsetLeft||0,le+=N.offsetTop||0,N=N.parentNode;return{left:j,top:le}}(a.appendTarget),h=(c=J.getBoundingClientRect()).top-y.top,g=c.bottom-1-y.top,b=c.left-y.left,v=c.width+"px"),!W){let N=function(){for(var j=0,le=a.appendTarget.parentNode;le;)j+=le.scrollTop||0,le=le.parentNode;return j}();h+=N,g+=N}h=Math.floor(h),g=Math.ceil(g),D=D===void 0?te-c.bottom0&&arguments[0]!==void 0)||arguments[0];var a=this.dropdown.events.callbacks,c=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:a.onKeyDown.bind(this),onMouseOver:a.onMouseOver.bind(this),onMouseLeave:a.onMouseLeave.bind(this),onClick:a.onClick.bind(this),onScroll:a.onScroll.bind(this)},h=o?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[h]("scroll",c.position,!0),window[h]("resize",c.position),window[h]("keydown",c.onKeyDown)),this.DOM.dropdown[h]("mouseover",c.onMouseOver),this.DOM.dropdown[h]("mouseleave",c.onMouseLeave),this.DOM.dropdown[h]("mousedown",c.onClick),this.DOM.dropdown.content[h]("scroll",c.onScroll)},callbacks:{onKeyDown(o){if(this.state.hasFocus&&!this.state.composing){var a=this.DOM.dropdown.querySelector(this.settings.classNames.dropdownItemActiveSelector),c=this.dropdown.getSuggestionDataByNode(a);switch(o.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":o.preventDefault();var h=this.dropdown.getAllSuggestionsRefs(),g=o.key=="ArrowUp"||o.key=="Up";a&&(a=this.dropdown.getNextOrPrevOption(a,!g)),a&&a.matches(this.settings.classNames.dropdownItemSelector)||(a=h[g?h.length-1:0]),c=this.dropdown.getSuggestionDataByNode(a),this.dropdown.highlightOption(a,!0);break;case"Escape":case"Esc":this.dropdown.hide();break;case"ArrowRight":if(this.state.actions.ArrowLeft)return;case"Tab":if(this.settings.mode!="mix"&&a&&!this.settings.autoComplete.rightKey&&!this.state.editing){o.preventDefault();var b=this.dropdown.getMappedValue(c);return this.input.autocomplete.set.call(this,b),!1}return!0;case"Enter":o.preventDefault(),this.settings.hooks.suggestionClick(o,{tagify:this,tagData:c,suggestionElm:a}).then(()=>{if(a)return this.dropdown.selectOption(a),a=this.dropdown.getNextOrPrevOption(a,!g),void this.dropdown.highlightOption(a);this.dropdown.hide(),this.settings.mode!="mix"&&this.addTags(this.state.inputText.trim(),!0)}).catch(v=>v);break;case"Backspace":{if(this.settings.mode=="mix"||this.state.editing.scope)return;let v=this.input.raw.call(this);v!=""&&v.charCodeAt(0)!=8203||(this.settings.backspace===!0?this.removeTags():this.settings.backspace=="edit"&&setTimeout(this.editTag.bind(this),0))}}}},onMouseOver(o){var a=o.target.closest(this.settings.classNames.dropdownItemSelector);a&&this.dropdown.highlightOption(a)},onMouseLeave(o){this.dropdown.highlightOption()},onClick(o){if(o.button==0&&o.target!=this.DOM.dropdown&&o.target!=this.DOM.dropdown.content){var a=o.target.closest(this.settings.classNames.dropdownItemSelector),c=this.dropdown.getSuggestionDataByNode(a);this.state.actions.selectOption=!0,setTimeout(()=>this.state.actions.selectOption=!1,50),this.settings.hooks.suggestionClick(o,{tagify:this,tagData:c,suggestionElm:a}).then(()=>{a?this.dropdown.selectOption(a,o):this.dropdown.hide()}).catch(h=>console.warn(h))}},onScroll(o){var a=o.target,c=a.scrollTop/(a.scrollHeight-a.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(c)})}}},getSuggestionDataByNode(o){var a=o&&o.getAttribute("value");return this.suggestedListItems.find(c=>c.value==a)||null},getNextOrPrevOption(o){let a=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];var c=this.dropdown.getAllSuggestionsRefs(),h=c.findIndex(g=>g===o);return a?c[h+1]:c[h-1]},highlightOption(o,a){var c,h=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(h),this.state.ddItemElm.removeAttribute("aria-selected")),!o)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);c=this.dropdown.getSuggestionDataByNode(o),this.state.ddItemData=c,this.state.ddItemElm=o,o.classList.add(h),o.setAttribute("aria-selected",!0),a&&(o.parentNode.scrollTop=o.clientHeight+o.offsetTop-o.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,c),this.dropdown.position())},selectOption(o,a){var c=this.settings.dropdown,h=c.clearOnSelect,g=c.closeOnSelect;if(!o)return this.addTags(this.state.inputText,!0),void(g&&this.dropdown.hide());a=a||{};var b=o.getAttribute("value"),v=b=="noMatch",y=this.suggestedListItems.find(S=>(S.value||S)==b);this.trigger("dropdown:select",{data:y,elm:o,event:a}),b&&(y||v)?(this.state.editing?this.onEditTagDone(null,p({__isValid:!0},this.normalizeTags([y])[0])):this[this.settings.mode=="mix"?"addMixTags":"addTags"]([y||this.input.raw.call(this)],h),this.DOM.input.parentNode&&(setTimeout(()=>{this.DOM.input.focus(),this.toggleFocusClass(!0),this.setRangeAtStartEnd(!1)}),g&&setTimeout(this.dropdown.hide.bind(this)),o.addEventListener("transitionend",()=>{this.dropdown.fillHeaderFooter(),setTimeout(()=>o.remove(),100)},{once:!0}),o.classList.add(this.settings.classNames.dropdownItemHidden))):g&&setTimeout(this.dropdown.hide.bind(this))},selectAll(o){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var a=this.dropdown.filterListItems("");return o||(a=this.state.dropdown.suggestions),this.addTags(a,!0),this},filterListItems(o,a){var c,h,g,b,v,y=this.settings,S=y.dropdown,D=(a=a||{},[]),W=[],O=y.whitelist,A=S.maxItems>=0?S.maxItems:1/0,te=S.searchKeys,G=0;if(!(o=y.mode=="select"&&this.value.length&&this.value[0][y.tagTextProp]==o?"":o)||!te.length)return D=S.includeSelectedTags?O:O.filter(N=>!this.isTagDuplicate(m(N)?N.value:N)),this.state.dropdown.suggestions=D,D.slice(0,A);function J(N,j){return j.toLowerCase().split(" ").every(le=>N.includes(le.toLowerCase()))}for(v=S.caseSensitive?""+o:(""+o).toLowerCase();Gte.includes(Et))?te:["value"];S.fuzzySearch&&!a.exact?(g=le.reduce((Et,Qe)=>Et+" "+(c[Qe]||""),"").toLowerCase().trim(),S.accentedSearch&&(g=x(g),v=x(v)),N=g.indexOf(v)==0,j=g===v,h=J(g,v)):(N=!0,h=le.some(Et=>{var Qe=""+(c[Et]||"");return S.accentedSearch&&(Qe=x(Qe),v=x(v)),S.caseSensitive||(Qe=Qe.toLowerCase()),j=Qe===v,a.exact?Qe===v:Qe.indexOf(v)==0})),b=!S.includeSelectedTags&&this.isTagDuplicate(m(c)?c.value:c),h&&!b&&(j&&N?W.push(c):S.sortby=="startsWith"&&N?D.unshift(c):D.push(c))}return this.state.dropdown.suggestions=W.concat(D),typeof S.sortby=="function"?S.sortby(W.concat(D),v):W.concat(D).slice(0,A)},getMappedValue(o){var a=this.settings.dropdown.mapValueTo;return a?typeof a=="function"?a(o):o[a]||o.value:o.value},createListHTML(o){return p([],o).map((a,c)=>{typeof a!="string"&&typeof a!="number"||(a={value:a});var h=this.dropdown.getMappedValue(a);return h=typeof h=="string"?f(h):h,this.settings.templates.dropdownItem.apply(this,[t(t({},a),{},{mappedValue:h}),this])}).join("")}};let I="@yaireo/tagify/";var ae,Y={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},U={wrapper:(o,a)=>`{var ya=Object.create;var ps=Object.defineProperty;var Ea=Object.getOwnPropertyDescriptor;var wa=Object.getOwnPropertyNames;var Ta=Object.getPrototypeOf,xa=Object.prototype.hasOwnProperty;var ms=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Sa=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of wa(t))!xa.call(e,s)&&s!==n&&ps(e,s,{get:()=>t[s],enumerable:!(i=Ea(t,s))||i.enumerable});return e};var Da=(e,t,n)=>(n=e!=null?ya(Ta(e)):{},Sa(t||!e||!e.__esModule?ps(n,"default",{value:e,enumerable:!0}):n,e));var fa=ms((hs,fs)=>{(function(e,t){typeof hs=="object"&&typeof fs<"u"?fs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).Tagify=t()})(hs,function(){"use strict";function e(o,a){var c=Object.keys(o);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);a&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(o,g).enumerable})),c.push.apply(c,h)}return c}function t(o){for(var a=1;a(o=""+o,a=""+a,h&&(o=o.trim(),a=a.trim()),c?o==a:o.toLowerCase()==a.toLowerCase()),s=(o,a)=>o&&Array.isArray(o)&&o.map(c=>r(c,a));function r(o,a){var c,h={};for(c in o)a.indexOf(c)<0&&(h[c]=o[c]);return h}function l(o){var a=document.createElement("div");return o.replace(/\&#?[0-9a-z]+;/gi,function(c){return a.innerHTML=c,a.innerText})}function u(o){return new DOMParser().parseFromString(o.trim(),"text/html").body.firstElementChild}function d(o,a){for(a=a||"previous";o=o[a+"Sibling"];)if(o.nodeType==3)return o}function f(o){return typeof o=="string"?o.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/`|'/g,"'"):o}function m(o){var a=Object.prototype.toString.call(o).split(" ")[1].slice(0,-1);return o===Object(o)&&a!="Array"&&a!="Function"&&a!="RegExp"&&a!="HTMLUnknownElement"}function p(o,a,c){function h(g,b){for(var v in b)if(b.hasOwnProperty(v)){if(m(b[v])){m(g[v])?h(g[v],b[v]):g[v]=Object.assign({},b[v]);continue}if(Array.isArray(b[v])){g[v]=Object.assign([],b[v]);continue}g[v]=b[v]}}return o instanceof Object||(o={}),h(o,a),c&&h(o,c),o}function E(){let o=[],a={};for(let c of arguments)for(let h of c)m(h)?a[h.value]||(o.push(h),a[h.value]=1):o.includes(h)||o.push(h);return o}function x(o){return String.prototype.normalize?typeof o=="string"?o.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:o}var C=()=>/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent);function T(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,o=>(o^crypto.getRandomValues(new Uint8Array(1))[0]&15>>o/4).toString(16))}function H(o){return o&&o.classList&&o.classList.contains(this.settings.classNames.tag)}var V={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:()=>{},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:"\xA0"},autoComplete:{enabled:!0,rightKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,highlightFirst:!1,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:()=>Promise.resolve(),beforePaste:()=>Promise.resolve(),suggestionClick:()=>Promise.resolve()}};function z(){this.dropdown={};for(let o in this._dropdown)this.dropdown[o]=typeof this._dropdown[o]=="function"?this._dropdown[o].bind(this):this._dropdown[o];this.dropdown.refs()}var k={refs(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs(){return[...this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector)]},show(o){var a,c,h,g=this.settings,b=g.mode=="mix"&&!g.enforceWhitelist,v=!g.whitelist||!g.whitelist.length,y=g.dropdown.position=="manual";if(o=o===void 0?this.state.inputText:o,!(v&&!b&&!g.templates.dropdownItemNoMatch||g.dropdown.enable===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(o),o&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",o),g.templates.dropdownItemNoMatch&&(h=g.templates.dropdownItemNoMatch.call(this,{value:o}))),!h){if(this.suggestedListItems.length)o&&b&&!this.state.editing.scope&&!i(this.suggestedListItems[0].value,o)&&this.suggestedListItems.unshift({value:o});else{if(!o||!b||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:o}]}c=""+(m(a=this.suggestedListItems[0])?a.value:a),g.autoComplete&&c&&c.indexOf(o)==0&&this.input.autocomplete.suggest.call(this,a)}this.dropdown.fill(h),g.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(g.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=o||!0,this.state.dropdown.query=o,this.setStateSelection(),y||setTimeout(()=>{this.dropdown.position(),this.dropdown.render()}),setTimeout(()=>{this.trigger("dropdown:show",this.DOM.dropdown)})}},hide(o){var a=this.DOM,c=a.scope,h=a.dropdown,g=this.settings.dropdown.position=="manual"&&!o;if(h&&document.body.contains(h)&&!g)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),c.setAttribute("aria-expanded",!1),h.parentNode.removeChild(h),setTimeout(()=>{this.state.dropdown.visible=!1},100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",h),this},toggle(o){this.dropdown[this.state.dropdown.visible&&!o?"hide":"show"]()},render(){var o,a,c,h=(o=this.DOM.dropdown,(c=o.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(c),a=c.clientHeight,c.parentNode.removeChild(c),a),g=this.settings;return typeof g.dropdown.enabled=="number"&&g.dropdown.enabled>=0?(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(g.classNames.dropdownInital),this.dropdown.position(h),g.dropdown.appendTarget.appendChild(this.DOM.dropdown),setTimeout(()=>this.DOM.dropdown.classList.remove(g.classNames.dropdownInital))),this):this},fill(o){o=typeof o=="string"?o:this.dropdown.createListHTML(o||this.suggestedListItems);var a,c=this.settings.templates.dropdownContent.call(this,o);this.DOM.dropdown.content.innerHTML=(a=c)?a.replace(/\>[\r\n ]+\<").replace(/(<.*?>)|\s+/g,(h,g)=>g||" "):""},fillHeaderFooter(){this.settings.templates;var o=this.dropdown.filterListItems(this.state.dropdown.query),a=this.parseTemplate("dropdownHeader",[o]),c=this.parseTemplate("dropdownFooter",[o]),h=this.dropdown.getHeaderRef(),g=this.dropdown.getFooterRef();a&&h?.parentNode.replaceChild(a,h),c&&g?.parentNode.replaceChild(c,g)},refilter(o){o=o||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(o),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},position(o){var a=this.settings.dropdown;if(a.position!="manual"){var c,h,g,b,v,y,S=this.DOM.dropdown,D=a.placeAbove,W=a.appendTarget===document.body,O=W?window.pageYOffset:a.appendTarget.scrollTop,A=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,te=A.clientHeight,G=Math.max(A.clientWidth||0,window.innerWidth||0)>480?a.position:"all",J=this.DOM[G=="input"?"input":"scope"];if(o=o||S.clientHeight,this.state.dropdown.visible){if(G=="text"?(g=(c=this.getCaretGlobalPosition()).bottom,h=c.top,b=c.left,v="auto"):(y=function(N){for(var j=0,le=0;N&&N!=A;)j+=N.offsetLeft||0,le+=N.offsetTop||0,N=N.parentNode;return{left:j,top:le}}(a.appendTarget),h=(c=J.getBoundingClientRect()).top-y.top,g=c.bottom-1-y.top,b=c.left-y.left,v=c.width+"px"),!W){let N=function(){for(var j=0,le=a.appendTarget.parentNode;le;)j+=le.scrollTop||0,le=le.parentNode;return j}();h+=N,g+=N}h=Math.floor(h),g=Math.ceil(g),D=D===void 0?te-c.bottom0&&arguments[0]!==void 0)||arguments[0];var a=this.dropdown.events.callbacks,c=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:a.onKeyDown.bind(this),onMouseOver:a.onMouseOver.bind(this),onMouseLeave:a.onMouseLeave.bind(this),onClick:a.onClick.bind(this),onScroll:a.onScroll.bind(this)},h=o?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[h]("scroll",c.position,!0),window[h]("resize",c.position),window[h]("keydown",c.onKeyDown)),this.DOM.dropdown[h]("mouseover",c.onMouseOver),this.DOM.dropdown[h]("mouseleave",c.onMouseLeave),this.DOM.dropdown[h]("mousedown",c.onClick),this.DOM.dropdown.content[h]("scroll",c.onScroll)},callbacks:{onKeyDown(o){if(this.state.hasFocus&&!this.state.composing){var a=this.DOM.dropdown.querySelector(this.settings.classNames.dropdownItemActiveSelector),c=this.dropdown.getSuggestionDataByNode(a);switch(o.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":o.preventDefault();var h=this.dropdown.getAllSuggestionsRefs(),g=o.key=="ArrowUp"||o.key=="Up";a&&(a=this.dropdown.getNextOrPrevOption(a,!g)),a&&a.matches(this.settings.classNames.dropdownItemSelector)||(a=h[g?h.length-1:0]),c=this.dropdown.getSuggestionDataByNode(a),this.dropdown.highlightOption(a,!0);break;case"Escape":case"Esc":this.dropdown.hide();break;case"ArrowRight":if(this.state.actions.ArrowLeft)return;case"Tab":if(this.settings.mode!="mix"&&a&&!this.settings.autoComplete.rightKey&&!this.state.editing){o.preventDefault();var b=this.dropdown.getMappedValue(c);return this.input.autocomplete.set.call(this,b),!1}return!0;case"Enter":o.preventDefault(),this.settings.hooks.suggestionClick(o,{tagify:this,tagData:c,suggestionElm:a}).then(()=>{if(a)return this.dropdown.selectOption(a),a=this.dropdown.getNextOrPrevOption(a,!g),void this.dropdown.highlightOption(a);this.dropdown.hide(),this.settings.mode!="mix"&&this.addTags(this.state.inputText.trim(),!0)}).catch(v=>v);break;case"Backspace":{if(this.settings.mode=="mix"||this.state.editing.scope)return;let v=this.input.raw.call(this);v!=""&&v.charCodeAt(0)!=8203||(this.settings.backspace===!0?this.removeTags():this.settings.backspace=="edit"&&setTimeout(this.editTag.bind(this),0))}}}},onMouseOver(o){var a=o.target.closest(this.settings.classNames.dropdownItemSelector);a&&this.dropdown.highlightOption(a)},onMouseLeave(o){this.dropdown.highlightOption()},onClick(o){if(o.button==0&&o.target!=this.DOM.dropdown&&o.target!=this.DOM.dropdown.content){var a=o.target.closest(this.settings.classNames.dropdownItemSelector),c=this.dropdown.getSuggestionDataByNode(a);this.state.actions.selectOption=!0,setTimeout(()=>this.state.actions.selectOption=!1,50),this.settings.hooks.suggestionClick(o,{tagify:this,tagData:c,suggestionElm:a}).then(()=>{a?this.dropdown.selectOption(a,o):this.dropdown.hide()}).catch(h=>console.warn(h))}},onScroll(o){var a=o.target,c=a.scrollTop/(a.scrollHeight-a.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(c)})}}},getSuggestionDataByNode(o){var a=o&&o.getAttribute("value");return this.suggestedListItems.find(c=>c.value==a)||null},getNextOrPrevOption(o){let a=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];var c=this.dropdown.getAllSuggestionsRefs(),h=c.findIndex(g=>g===o);return a?c[h+1]:c[h-1]},highlightOption(o,a){var c,h=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(h),this.state.ddItemElm.removeAttribute("aria-selected")),!o)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);c=this.dropdown.getSuggestionDataByNode(o),this.state.ddItemData=c,this.state.ddItemElm=o,o.classList.add(h),o.setAttribute("aria-selected",!0),a&&(o.parentNode.scrollTop=o.clientHeight+o.offsetTop-o.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,c),this.dropdown.position())},selectOption(o,a){var c=this.settings.dropdown,h=c.clearOnSelect,g=c.closeOnSelect;if(!o)return this.addTags(this.state.inputText,!0),void(g&&this.dropdown.hide());a=a||{};var b=o.getAttribute("value"),v=b=="noMatch",y=this.suggestedListItems.find(S=>(S.value||S)==b);this.trigger("dropdown:select",{data:y,elm:o,event:a}),b&&(y||v)?(this.state.editing?this.onEditTagDone(null,p({__isValid:!0},this.normalizeTags([y])[0])):this[this.settings.mode=="mix"?"addMixTags":"addTags"]([y||this.input.raw.call(this)],h),this.DOM.input.parentNode&&(setTimeout(()=>{this.DOM.input.focus(),this.toggleFocusClass(!0),this.setRangeAtStartEnd(!1)}),g&&setTimeout(this.dropdown.hide.bind(this)),o.addEventListener("transitionend",()=>{this.dropdown.fillHeaderFooter(),setTimeout(()=>o.remove(),100)},{once:!0}),o.classList.add(this.settings.classNames.dropdownItemHidden))):g&&setTimeout(this.dropdown.hide.bind(this))},selectAll(o){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var a=this.dropdown.filterListItems("");return o||(a=this.state.dropdown.suggestions),this.addTags(a,!0),this},filterListItems(o,a){var c,h,g,b,v,y=this.settings,S=y.dropdown,D=(a=a||{},[]),W=[],O=y.whitelist,A=S.maxItems>=0?S.maxItems:1/0,te=S.searchKeys,G=0;if(!(o=y.mode=="select"&&this.value.length&&this.value[0][y.tagTextProp]==o?"":o)||!te.length)return D=S.includeSelectedTags?O:O.filter(N=>!this.isTagDuplicate(m(N)?N.value:N)),this.state.dropdown.suggestions=D,D.slice(0,A);function J(N,j){return j.toLowerCase().split(" ").every(le=>N.includes(le.toLowerCase()))}for(v=S.caseSensitive?""+o:(""+o).toLowerCase();Gte.includes(Et))?te:["value"];S.fuzzySearch&&!a.exact?(g=le.reduce((Et,Qe)=>Et+" "+(c[Qe]||""),"").toLowerCase().trim(),S.accentedSearch&&(g=x(g),v=x(v)),N=g.indexOf(v)==0,j=g===v,h=J(g,v)):(N=!0,h=le.some(Et=>{var Qe=""+(c[Et]||"");return S.accentedSearch&&(Qe=x(Qe),v=x(v)),S.caseSensitive||(Qe=Qe.toLowerCase()),j=Qe===v,a.exact?Qe===v:Qe.indexOf(v)==0})),b=!S.includeSelectedTags&&this.isTagDuplicate(m(c)?c.value:c),h&&!b&&(j&&N?W.push(c):S.sortby=="startsWith"&&N?D.unshift(c):D.push(c))}return this.state.dropdown.suggestions=W.concat(D),typeof S.sortby=="function"?S.sortby(W.concat(D),v):W.concat(D).slice(0,A)},getMappedValue(o){var a=this.settings.dropdown.mapValueTo;return a?typeof a=="function"?a(o):o[a]||o.value:o.value},createListHTML(o){return p([],o).map((a,c)=>{typeof a!="string"&&typeof a!="number"||(a={value:a});var h=this.dropdown.getMappedValue(a);return h=typeof h=="string"?f(h):h,this.settings.templates.dropdownItem.apply(this,[t(t({},a),{},{mappedValue:h}),this])}).join("")}};let I="@yaireo/tagify/";var ae,Y={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},U={wrapper:(o,a)=>`{h&&h.nodeName=="BR"&&H.call(this,a)&&(this.removeTags(a),this.fixFirefoxLastTagNoCaret())})});var a=this.DOM.input.lastChild;a&&a.nodeValue==""&&a.remove(),a&&a.nodeName=="BR"||this.DOM.input.appendChild(document.createElement("br"))}}};function F(o,a){if(!o){console.warn("Tagify:","input element not found",o);let h=new Proxy(this,{get:()=>()=>h});return h}if(o.__tagify)return console.warn("Tagify: ","input element is already Tagified - Same instance is returned.",o),o.__tagify;var c;p(this,function(h){var g=document.createTextNode("");function b(v,y,S){S&&y.split(/\s+/g).forEach(D=>g[v+"EventListener"].call(g,D,S))}return{off(v,y){return b("remove",v,y),this},on(v,y){return y&&typeof y=="function"&&b("add",v,y),this},trigger(v,y,S){var D;if(S=S||{cloneData:!0},v)if(h.settings.isJQueryPlugin)v=="remove"&&(v="removeTag"),jQuery(h.DOM.originalInput).triggerHandler(v,[y]);else{try{var W=typeof y=="object"?y:{value:y};if((W=S.cloneData?p({},W):W).tagify=this,y.event&&(W.event=this.cloneEvent(y.event)),y instanceof Object)for(var O in y)y[O]instanceof HTMLElement&&(W[O]=y[O]);D=new CustomEvent(v,{detail:W})}catch(A){console.warn(A)}g.dispatchEvent(D)}}}}(this)),this.isFirefox=typeof InstallTrigger<"u",this.isIE=window.document.documentMode,a=a||{},this.getPersistedData=(c=a.id,h=>{let g,b="/"+h;if(localStorage.getItem(I+c+"/v",1)==1)try{g=JSON.parse(localStorage[I+c+b])}catch{}return g}),this.setPersistedData=(h=>h?(localStorage.setItem(I+h+"/v",1),(g,b)=>{let v="/"+b,y=JSON.stringify(g);g&&b&&(localStorage.setItem(I+h+v,y),dispatchEvent(new Event("storage")))}):()=>{})(a.id),this.clearPersistedData=(h=>g=>{let b=I+"/"+h+"/";if(g)localStorage.removeItem(b+g);else for(let v in localStorage)v.includes(b)&&localStorage.removeItem(v)})(a.id),this.applySettings(o,a),this.state={inputText:"",editing:!1,composing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},this.build(o),z.call(this),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),o.autofocus&&this.DOM.input.focus(),o.__tagify=this}return F.prototype={_dropdown:k,helpers:{sameStr:i,removeCollectionProp:s,omit:r,isObject:m,parseHTML:u,escapeHTML:f,extend:p,concatWithoutDups:E,getUID:T,isNodeTag:H},customEventsList:["change","add","remove","invalid","input","click","keydown","focus","blur","edit:input","edit:beforeUpdate","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select","dropdown:updated","dropdown:noMatch","dropdown:scroll"],dataProps:["__isValid","__removed","__originalData","__originalHTML","__tagId"],trim(o){return this.settings.trim&&o&&typeof o=="string"?o.trim():o},parseHTML:u,templates:U,parseTemplate(o,a){return o=this.settings.templates[o]||o,this.parseHTML(o.apply(this,a))},set whitelist(o){let a=o&&Array.isArray(o);this.settings.whitelist=a?o:[],this.setPersistedData(a?o:[],"whitelist")},get whitelist(){return this.settings.whitelist},generateClassSelectors(o){for(let a in o){let c=a;Object.defineProperty(o,c+"Selector",{get(){return"."+this[c].split(" ")[0]}})}},applySettings(o,a){V.templates=this.templates;var c=this.settings=p({},V,a);if(c.disabled=o.hasAttribute("disabled"),c.readonly=c.readonly||o.hasAttribute("readonly"),c.placeholder=f(o.getAttribute("placeholder")||c.placeholder||""),c.required=o.hasAttribute("required"),this.generateClassSelectors(c.classNames),c.dropdown.includeSelectedTags===void 0&&(c.dropdown.includeSelectedTags=c.duplicates),this.isIE&&(c.autoComplete=!1),["whitelist","blacklist"].forEach(g=>{var b=o.getAttribute("data-"+g);b&&(b=b.split(c.delimiters))instanceof Array&&(c[g]=b)}),"autoComplete"in a&&!m(a.autoComplete)&&(c.autoComplete=V.autoComplete,c.autoComplete.enabled=a.autoComplete),c.mode=="mix"&&(c.autoComplete.rightKey=!0,c.delimiters=a.delimiters||null,c.tagTextProp&&!c.dropdown.searchKeys.includes(c.tagTextProp)&&c.dropdown.searchKeys.push(c.tagTextProp)),o.pattern)try{c.pattern=new RegExp(o.pattern)}catch{}if(c.delimiters){c._delimiters=c.delimiters;try{c.delimiters=new RegExp(this.settings.delimiters,"g")}catch{}}c.disabled&&(c.userInput=!1),this.TEXTS=t(t({},Y),c.texts||{}),c.mode!="select"&&c.userInput||(c.dropdown.enabled=0),c.dropdown.appendTarget=a.dropdown&&a.dropdown.appendTarget?a.dropdown.appendTarget:document.body;let h=this.getPersistedData("whitelist");Array.isArray(h)&&(this.whitelist=Array.isArray(c.whitelist)?E(c.whitelist,h):h)},getAttributes(o){var a,c=this.getCustomAttributes(o),h="";for(a in c)h+=" "+a+(o[a]!==void 0?`="${c[a]}"`:"");return h},getCustomAttributes(o){if(!m(o))return"";var a,c={};for(a in o)a.slice(0,2)!="__"&&a!="class"&&o.hasOwnProperty(a)&&o[a]!==void 0&&(c[a]=f(o[a]));return c},setStateSelection(){var o=window.getSelection(),a={anchorOffset:o.anchorOffset,anchorNode:o.anchorNode,range:o.getRangeAt&&o.rangeCount&&o.getRangeAt(0)};return this.state.selection=a,a},getCaretGlobalPosition(){let o=document.getSelection();if(o.rangeCount){let a=o.getRangeAt(0),c=a.startContainer,h=a.startOffset,g,b;if(h>0)return b=document.createRange(),b.setStart(c,h-1),b.setEnd(c,h),g=b.getBoundingClientRect(),{left:g.right,top:g.top,bottom:g.bottom};if(c.getBoundingClientRect)return c.getBoundingClientRect()}return{left:-9999,top:-9999}},getCSSVars(){var o=getComputedStyle(this.DOM.scope,null),a;this.CSSVars={tagHideTransition:(c=>{let h=c.value;return c.unit=="s"?1e3*h:h})(function(c){if(!c)return{};var h=(c=c.trim().split(" ")[0]).split(/\d+/g).filter(g=>g).pop().trim();return{value:+c.split(h).filter(g=>g)[0].trim(),unit:h}}((a="tag-hide-transition",o.getPropertyValue("--"+a))))}},build(o){var a=this.DOM;this.settings.mixMode.integrated?(a.originalInput=null,a.scope=o,a.input=o):(a.originalInput=o,a.originalInput_tabIndex=o.tabIndex,a.scope=this.parseTemplate("wrapper",[o,this.settings]),a.input=a.scope.querySelector(this.settings.classNames.inputSelector),o.parentNode.insertBefore(a.scope,o),o.tabIndex=-1)},destroy(){this.events.unbindGlobal.call(this),this.DOM.scope.parentNode.removeChild(this.DOM.scope),this.DOM.originalInput.tabIndex=this.DOM.originalInput_tabIndex,delete this.DOM.originalInput.__tagify,this.dropdown.hide(!0),clearTimeout(this.dropdownHide__bindEventsTimeout),clearInterval(this.listeners.main.originalInputValueObserverInterval)},loadOriginalValues(o){var a,c=this.settings;if(this.state.blockChangeEvent=!0,o===void 0){let h=this.getPersistedData("value");o=h&&!this.DOM.originalInput.value?h:c.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value}if(this.removeAllTags(),o)if(c.mode=="mix")this.parseMixTags(this.trim(o)),(a=this.DOM.input.lastChild)&&a.tagName=="BR"||this.DOM.input.insertAdjacentHTML("beforeend","
");else{try{JSON.parse(o)instanceof Array&&(o=JSON.parse(o))}catch{}this.addTags(o,!0).forEach(h=>h&&h.classList.add(c.classNames.tagNoAnimation))}else this.postUpdate();this.state.lastOriginalValueReported=c.mixMode.integrated?"":this.DOM.originalInput.value,this.state.blockChangeEvent=!1},cloneEvent(o){var a={};for(var c in o)c!="path"&&(a[c]=o[c]);return a},loading(o){return this.state.isLoading=o,this.DOM.scope.classList[o?"add":"remove"](this.settings.classNames.scopeLoading),this},tagLoading(o,a){return o&&o.classList[a?"add":"remove"](this.settings.classNames.tagLoading),this},toggleClass(o,a){typeof o=="string"&&this.DOM.scope.classList.toggle(o,a)},toggleScopeValidation(o){var a=o===!0||o===void 0;!this.settings.required&&o&&o===this.TEXTS.empty&&(a=!0),this.toggleClass(this.settings.classNames.tagInvalid,!a),this.DOM.scope.title=a?"":o},toggleFocusClass(o){this.toggleClass(this.settings.classNames.focus,!!o)},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var o=this.DOM.originalInput,a=this.state.lastOriginalValueReported!==o.value,c=new CustomEvent("change",{bubbles:!0});a&&(this.state.lastOriginalValueReported=o.value,c.simulated=!0,o._valueTracker&&o._valueTracker.setValue(Math.random()),o.dispatchEvent(c),this.trigger("change",this.state.lastOriginalValueReported),o.value=this.state.lastOriginalValueReported)}},events:Z,fixFirefoxLastTagNoCaret(){},placeCaretAfterNode(o){if(o&&o.parentNode){var a=o,c=window.getSelection(),h=c.getRangeAt(0);c.rangeCount&&(h.setStartAfter(a||o),h.collapse(!0),c.removeAllRanges(),c.addRange(h))}},insertAfterTag(o,a){if(a=a||this.settings.mixMode.insertAfterTag,o&&o.parentNode&&a)return a=typeof a=="string"?document.createTextNode(a):a,o.parentNode.insertBefore(a,o.nextSibling),a},editTagChangeDetected(o){var a=o.__originalData;for(var c in a)if(!this.dataProps.includes(c)&&o[c]!=a[c])return!0;return!1},getTagTextNode(o){return o.querySelector(this.settings.classNames.tagTextSelector)},setTagTextNode(o,a){this.getTagTextNode(o).innerHTML=f(a)},editTag(o,a){o=o||this.getLastTag(),a=a||{},this.dropdown.hide();var c=this.settings,h=this.getTagTextNode(o),g=this.getNodeIndex(o),b=this.tagData(o),v=this.events.callbacks,y=this,S=!0;if(h){if(!(b instanceof Object&&"editable"in b)||b.editable)return b=this.tagData(o,{__originalData:p({},b),__originalHTML:o.cloneNode(!0)}),this.tagData(b.__originalHTML,b.__originalData),h.setAttribute("contenteditable",!0),o.classList.add(c.classNames.tagEditing),h.addEventListener("focus",v.onEditTagFocus.bind(this,o)),h.addEventListener("blur",function(){setTimeout(()=>v.onEditTagBlur.call(y,y.getTagTextNode(o)))}),h.addEventListener("input",v.onEditTagInput.bind(this,h)),h.addEventListener("keydown",D=>v.onEditTagkeydown.call(this,D,o)),h.addEventListener("compositionstart",v.onCompositionStart.bind(this)),h.addEventListener("compositionend",v.onCompositionEnd.bind(this)),a.skipValidation||(S=this.editTagToggleValidity(o)),h.originalIsValid=S,this.trigger("edit:start",{tag:o,index:g,data:b,isValid:S}),h.focus(),this.setRangeAtStartEnd(!1,h),this}else console.warn("Cannot find element in Tag template: .",c.classNames.tagTextSelector)},editTagToggleValidity(o,a){var c;if(a=a||this.tagData(o))return(c=!("__isValid"in a)||a.__isValid===!0)||this.removeTagsFromValue(o),this.update(),o.classList.toggle(this.settings.classNames.tagNotAllowed,!c),a.__isValid;console.warn("tag has no data: ",o,a)},onEditTagDone(o,a){a=a||{};var c={tag:o=o||this.state.editing.scope,index:this.getNodeIndex(o),previousData:this.tagData(o),data:a};this.trigger("edit:beforeUpdate",c,{cloneData:!1}),this.state.editing=!1,delete a.__originalData,delete a.__originalHTML,o&&a[this.settings.tagTextProp]?(o=this.replaceTag(o,a),this.editTagToggleValidity(o,a),this.settings.a11y.focusableTags?o.focus():this.placeCaretAfterNode(o)):o&&this.removeTags(o),this.trigger("edit:updated",c),this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag(o,a){a&&a.value||(a=o.__tagifyTagData),a.__isValid&&a.__isValid!=1&&p(a,this.getInvalidTagAttrs(a,a.__isValid));var c=this.createTagElem(a);return o.parentNode.replaceChild(c,o),this.updateValueByDOMTags(),c},updateValueByDOMTags(){this.value.length=0,[].forEach.call(this.getTagElms(),o=>{o.classList.contains(this.settings.classNames.tagNotAllowed.split(" ")[0])||this.value.push(this.tagData(o))}),this.update()},setRangeAtStartEnd(o,a){o=typeof o=="number"?o:!!o,a=(a=a||this.DOM.input).lastChild||a;var c=document.getSelection();try{c.rangeCount>=1&&["Start","End"].forEach(h=>c.getRangeAt(0)["set"+h](a,o||a.length))}catch{}},injectAtCaret(o,a){return!(a=a||this.state.selection?.range)&&o?(this.appendMixTags(o),this):(typeof o=="string"&&(o=document.createTextNode(o)),a.deleteContents(),a.insertNode(o),this.setRangeAtStartEnd(!1,o),this.updateValueByDOMTags(),this.update(),this)},input:{set(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];var c=this.settings.dropdown.closeOnSelect;this.state.inputText=o,a&&(this.DOM.input.innerHTML=f(""+o)),!o&&c&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw(){return this.DOM.input.textContent},validate(){var o=!this.state.inputText||this.validateTag({value:this.state.inputText})===!0;return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!o),o},normalize(o){var a=o||this.DOM.input,c=[];a.childNodes.forEach(h=>h.nodeType==3&&c.push(h.nodeValue)),c=c.join(` `);try{c=c.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch{}return c=c.replace(/\s/g," "),this.trim(c)},autocomplete:{suggest(o){if(this.settings.autoComplete.enabled){typeof(o=o||{})=="string"&&(o={value:o});var a=o.value?""+o.value:"",c=a.substr(0,this.state.inputText.length).toLowerCase(),h=a.substring(this.state.inputText.length);a&&this.state.inputText&&c==this.state.inputText.toLowerCase()?(this.DOM.input.setAttribute("data-suggest",h),this.state.inputSuggestion=o):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}},set(o){var a=this.DOM.input.getAttribute("data-suggest"),c=o||(a?this.state.inputText+a:null);return!!c&&(this.settings.mode=="mix"?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+c)):(this.input.set.call(this,c),this.setRangeAtStartEnd()),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx(o){return this.value.findIndex(a=>a.__tagId==(o||{}).__tagId)},getNodeIndex(o){var a=0;if(o)for(;o=o.previousElementSibling;)a++;return a},getTagElms(){for(var o=arguments.length,a=new Array(o),c=0;co?(a&&(o.__tagifyTagData=c?a:p({},o.__tagifyTagData||{},a)),o.__tagifyTagData):(console.warn("tag element doesn't exist",o,a),a),isTagDuplicate(o,a,c){var h=0;if(this.settings.mode=="select")return!1;for(let g of this.value)i(this.trim(""+o),g.value,a)&&c!=g.__tagId&&h++;return h},getTagIndexByValue(o){var a=[];return this.getTagElms().forEach((c,h)=>{i(this.trim(c.textContent),o,this.settings.dropdown.caseSensitive)&&a.push(h)}),a},getTagElmByValue(o){var a=this.getTagIndexByValue(o)[0];return this.getTagElms()[a]},flashTag(o){o&&(o.classList.add(this.settings.classNames.tagFlash),setTimeout(()=>{o.classList.remove(this.settings.classNames.tagFlash)},100))},isTagBlacklisted(o){return o=this.trim(o.toLowerCase()),this.settings.blacklist.filter(a=>(""+a).toLowerCase()==o).length},isTagWhitelisted(o){return!!this.getWhitelistItem(o)},getWhitelistItem(o,a,c){a=a||"value";var h,g=this.settings;return(c=c||g.whitelist).some(b=>{var v=typeof b=="string"?b:b[a]||b.value;if(i(v,o,g.dropdown.caseSensitive,g.trim))return h=typeof b=="string"?{value:b}:b,!0}),h||a!="value"||g.tagTextProp=="value"||(h=this.getWhitelistItem(o,g.tagTextProp,c)),h},validateTag(o){var a=this.settings,c="value"in o?"value":a.tagTextProp,h=this.trim(o[c]+"");return(o[c]+"").trim()?a.pattern&&a.pattern instanceof RegExp&&!a.pattern.test(h)?this.TEXTS.pattern:!a.duplicates&&this.isTagDuplicate(h,a.dropdown.caseSensitive,o.__tagId)?this.TEXTS.duplicate:this.isTagBlacklisted(h)||a.enforceWhitelist&&!this.isTagWhitelisted(h)?this.TEXTS.notAllowed:!a.validate||a.validate(o):this.TEXTS.empty},getInvalidTagAttrs(o,a){return{"aria-invalid":!0,class:`${o.class||""} ${this.settings.classNames.tagNotAllowed}`.trim(),title:a}},hasMaxTags(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},setReadonly(o,a){var c=this.settings;document.activeElement.blur(),c[a||"readonly"]=o,this.DOM.scope[(o?"set":"remove")+"Attribute"](a||"readonly",!0),this.setContentEditable(!o)},setContentEditable(o){this.settings.userInput&&(this.DOM.input.contentEditable=o,this.DOM.input.tabIndex=o?0:-1)},setDisabled(o){this.setReadonly(o,"disabled")},normalizeTags(o){var a=this.settings,c=a.whitelist,h=a.delimiters,g=a.mode,b=a.tagTextProp;a.enforceWhitelist;var v=[],y=!!c&&c[0]instanceof Object,S=Array.isArray(o),D=S&&o[0].value,W=O=>(O+"").split(h).filter(A=>A).map(A=>({[b]:this.trim(A),value:this.trim(A)}));if(typeof o=="number"&&(o=o.toString()),typeof o=="string"){if(!o.trim())return[];o=W(o)}else S&&(o=[].concat(...o.map(O=>O.value?O:W(O))));return y&&!D&&(o.forEach(O=>{var A=v.map(J=>J.value),te=this.dropdown.filterListItems.call(this,O[b],{exact:!0});this.settings.duplicates||(te=te.filter(J=>!A.includes(J.value)));var G=te.length>1?this.getWhitelistItem(O[b],b,te):te[0];G&&G instanceof Object?v.push(G):g!="mix"&&(O.value==null&&(O.value=O[b]),v.push(O))}),v.length&&(o=v)),o},parseMixTags(o){var a=this.settings,c=a.mixTagsInterpolator,h=a.duplicates,g=a.transformTag,b=a.enforceWhitelist,v=a.maxTags,y=a.tagTextProp,S=[];return o=o.split(c[0]).map((D,W)=>{var O,A,te,G=D.split(c[1]),J=G[0],N=S.length==v;try{if(J==+J)throw Error;A=JSON.parse(J)}catch{A=this.normalizeTags(J)[0]||{value:J}}if(g.call(this,A),N||!(G.length>1)||b&&!this.isTagWhitelisted(A.value)||!h&&this.isTagDuplicate(A.value)){if(D)return W?c[0]+D:D}else A[O=A[y]?y:"value"]=this.trim(A[O]),te=this.createTagElem(A),S.push(A),te.classList.add(this.settings.classNames.tagNoAnimation),G[0]=te.outerHTML,this.value.push(A);return G.join("")}).join(""),this.DOM.input.innerHTML=o,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize(),this.getTagElms().forEach((D,W)=>this.tagData(D,S[W])),this.update({withoutChangeEvent:!0}),o},replaceTextWithNode(o,a){if(this.state.tag||a){a=a||this.state.tag.prefix+this.state.tag.value;var c,h,g=this.state.selection||window.getSelection(),b=g.anchorNode,v=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return b.splitText(g.anchorOffset-v),(c=b.nodeValue.lastIndexOf(a))==-1||(h=b.splitText(c),o&&b.parentNode.replaceChild(o,h)),!0}},selectTag(o,a){var c=this.settings;if(!c.enforceWhitelist||this.isTagWhitelisted(a.value)){this.input.set.call(this,a[c.tagTextProp]||a.value,!0),this.state.actions.selectOption&&setTimeout(this.setRangeAtStartEnd.bind(this));var h=this.getLastTag();return h?this.replaceTag(h,a):this.appendTag(o),this.value[0]=a,this.update(),this.trigger("add",{tag:o,data:a}),[o]}},addEmptyTag(o){var a=p({value:""},o||{}),c=this.createTagElem(a);this.tagData(c,a),this.appendTag(c),this.editTag(c,{skipValidation:!0})},addTags(o,a,c){var h=[],g=this.settings,b=[],v=document.createDocumentFragment();if(c=c||g.skipInvalid,!o||o.length==0)return h;switch(o=this.normalizeTags(o),g.mode){case"mix":return this.addMixTags(o);case"select":a=!1,this.removeAllTags()}return this.DOM.input.removeAttribute("style"),o.forEach(y=>{var S,D={},W=Object.assign({},y,{value:y.value+""});if(y=Object.assign({},W),g.transformTag.call(this,y),y.__isValid=this.hasMaxTags()||this.validateTag(y),y.__isValid!==!0){if(c)return;if(p(D,this.getInvalidTagAttrs(y,y.__isValid),{__preInvalidData:W}),y.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(y.value)),!g.createInvalidTags)return void b.push(y.value)}if("readonly"in y&&(y.readonly?D["aria-readonly"]=!0:delete y.readonly),S=this.createTagElem(y,D),h.push(S),g.mode=="select")return this.selectTag(S,y);v.appendChild(S),y.__isValid&&y.__isValid===!0?(this.value.push(y),this.trigger("add",{tag:S,index:this.value.length-1,data:y})):(this.trigger("invalid",{data:y,index:this.value.length,tag:S,message:y.__isValid}),g.keepInvalidTags||setTimeout(()=>this.removeTags(S,!0),1e3)),this.dropdown.position()}),this.appendTag(v),this.update(),o.length&&a&&(this.input.set.call(this,g.createInvalidTags?"":b.join(g._delimiters)),this.setRangeAtStartEnd()),g.dropdown.enabled&&this.dropdown.refilter(),h},addMixTags(o){if((o=this.normalizeTags(o))[0].prefix||this.state.tag)return this.prefixedTextToTag(o[0]);typeof o=="string"&&(o=[{value:o}]),this.state.selection;var a=document.createDocumentFragment();return o.forEach(c=>{var h=this.createTagElem(c);a.appendChild(h),this.insertAfterTag(h)}),this.appendMixTags(a),a},appendMixTags(o){var a=!!this.state.selection;a?this.injectAtCaret(o):(this.DOM.input.focus(),(a=this.setStateSelection()).range.setStart(this.DOM.input,a.range.endOffset),a.range.setEnd(this.DOM.input,a.range.endOffset),this.DOM.input.appendChild(o),this.updateValueByDOMTags(),this.update())},prefixedTextToTag(o){var a,c=this.settings,h=this.state.tag.delimiters;if(c.transformTag.call(this,o),o.prefix=o.prefix||this.state.tag?this.state.tag.prefix:(c.pattern.source||c.pattern)[0],a=this.createTagElem(o),this.replaceTextWithNode(a)||this.DOM.input.appendChild(a),setTimeout(()=>a.classList.add(this.settings.classNames.tagNoAnimation),300),this.value.push(o),this.update(),!h){var g=this.insertAfterTag(a)||a;this.placeCaretAfterNode(g)}return this.state.tag=null,this.trigger("add",p({},{tag:a},{data:o})),a},appendTag(o){var a=this.DOM,c=a.input;c===a.input?a.scope.insertBefore(o,c):a.scope.appendChild(o)},createTagElem(o,a){o.__tagId=T();var c,h=p({},o,t({value:f(o.value+"")},a));return function(g){for(var b,v=document.createNodeIterator(g,NodeFilter.SHOW_TEXT,null,!1);b=v.nextNode();)b.textContent.trim()||b.parentNode.removeChild(b)}(c=this.parseTemplate("tag",[h,this])),this.tagData(c,o),c},reCheckInvalidTags(){var o=this.settings;this.getTagElms(o.classNames.tagNotAllowed).forEach((a,c)=>{var h=this.tagData(a),g=this.hasMaxTags(),b=this.validateTag(h),v=b===!0&&!g;if(o.mode=="select"&&this.toggleScopeValidation(b),v)return h=h.__preInvalidData?h.__preInvalidData:{value:h.value},this.replaceTag(a,h);a.title=g||b})},removeTags(o,a,c){var h,g=this.settings;if(o=o&&o instanceof HTMLElement?[o]:o instanceof Array?o:o?[o]:[this.getLastTag()],h=o.reduce((b,v)=>{v&&typeof v=="string"&&(v=this.getTagElmByValue(v));var y=this.tagData(v);return v&&y&&!y.readonly&&b.push({node:v,idx:this.getTagIdx(y),data:this.tagData(v,{__removed:!0})}),b},[]),c=typeof c=="number"?c:this.CSSVars.tagHideTransition,g.mode=="select"&&(c=0,this.input.set.call(this)),h.length==1&&g.mode!="select"&&h[0].node.classList.contains(g.classNames.tagNotAllowed)&&(a=!0),h.length)return g.hooks.beforeRemoveTag(h,{tagify:this}).then(()=>{function b(v){v.node.parentNode&&(v.node.parentNode.removeChild(v.node),a?g.keepInvalidTags&&this.trigger("remove",{tag:v.node,index:v.idx}):(this.trigger("remove",{tag:v.node,index:v.idx,data:v.data}),this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),g.keepInvalidTags&&this.reCheckInvalidTags()))}c&&c>10&&h.length==1?function(v){v.node.style.width=parseFloat(window.getComputedStyle(v.node).width)+"px",document.body.clientTop,v.node.classList.add(g.classNames.tagHide),setTimeout(b.bind(this),c,v)}.call(this,h[0]):h.forEach(b.bind(this)),a||(this.removeTagsFromValue(h.map(v=>v.node)),this.update(),g.mode=="select"&&this.setContentEditable(!0))}).catch(b=>{})},removeTagsFromDOM(){[].slice.call(this.getTagElms()).forEach(o=>o.parentNode.removeChild(o))},removeTagsFromValue(o){(o=Array.isArray(o)?o:[o]).forEach(a=>{var c=this.tagData(a),h=this.getTagIdx(c);h>-1&&this.value.splice(h,1)})},removeAllTags(o){o=o||{},this.value=[],this.settings.mode=="mix"?this.DOM.input.innerHTML="":this.removeTagsFromDOM(),this.dropdown.refilter(),this.dropdown.position(),this.state.dropdown.visible&&setTimeout(()=>{this.DOM.input.focus()}),this.settings.mode=="select"&&(this.input.set.call(this),this.setContentEditable(!0)),this.update(o)},postUpdate(){var o=this.settings,a=o.classNames,c=o.mode=="mix"?o.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(a.hasMaxTags,this.value.length>=o.maxTags),this.toggleClass(a.hasNoTags,!this.value.length),this.toggleClass(a.empty,!c),o.mode=="select"&&this.toggleScopeValidation(this.value?.[0]?.__isValid)},setOriginalInputValue(o){var a=this.DOM.originalInput;this.settings.mixMode.integrated||(a.value=o,a.tagifyValue=a.value,this.setPersistedData(o,"value"))},update(o){var a=this.getInputValue();this.setOriginalInputValue(a),this.postUpdate(),this.settings.onChangeAfterBlur&&(o||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent()},getInputValue(){var o=this.getCleanValue();return this.settings.mode=="mix"?this.getMixedTagsAsString(o):o.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(o):JSON.stringify(o):""},getCleanValue(o){return s(o||this.value,this.dataProps)},getMixedTagsAsString(){var o="",a=this,c=this.settings,h=c.originalInputValueFormat||JSON.stringify,g=c.mixTagsInterpolator;return function b(v){v.childNodes.forEach(y=>{if(y.nodeType==1){let S=a.tagData(y);if(y.tagName=="BR"&&(o+=`\r `),S&&H.call(a,y)){if(S.__removed)return;o+=g[0]+h(r(S,a.dataProps))+g[1]}else y.getAttribute("style")||["B","I","U"].includes(y.tagName)?o+=y.textContent:y.tagName!="DIV"&&y.tagName!="P"||(o+=`\r -`,b(y))}else o+=y.textContent})}(this.DOM.input),o}},F.prototype.removeTag=F.prototype.removeTags,F})});var va=ps(()=>{(function(){function e(t){var n=t.getAttribute("remove-me")||t.getAttribute("data-remove-me");n&&setTimeout(function(){t.parentElement.removeChild(t)},htmx.parseInterval(n))}htmx.defineExtension("remove-me",{onEvent:function(t,n){if(t==="htmx:afterProcessNode"){var i=n.detail.elt;if(i.getAttribute&&(e(i),i.querySelectorAll))for(var s=i.querySelectorAll("[remove-me], [data-remove-me]"),r=0;r]*>|>)([\\s\\S]*?)<\\/${e}>`,t?"gim":"im")}function parseInterval(e){if(e==null)return;let t=NaN;return e.slice(-2)=="ms"?t=parseFloat(e.slice(0,-2)):e.slice(-1)=="s"?t=parseFloat(e.slice(0,-1))*1e3:e.slice(-1)=="m"?t=parseFloat(e.slice(0,-1))*1e3*60:t=parseFloat(e),isNaN(t)?void 0:t}function getRawAttribute(e,t){return e instanceof Element&&e.getAttribute(t)}function hasAttribute(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function getAttributeValue(e,t){return getRawAttribute(e,t)||getRawAttribute(e,"data-"+t)}function parentElt(e){let t=e.parentElement;return!t&&e.parentNode instanceof ShadowRoot?e.parentNode:t}function getDocument(){return document}function getRootNode(e,t){return e.getRootNode?e.getRootNode({composed:t}):getDocument()}function getClosestMatch(e,t){for(;e&&!t(e);)e=parentElt(e);return e||null}function getAttributeValueWithDisinheritance(e,t,n){let i=getAttributeValue(t,n),s=getAttributeValue(t,"hx-disinherit");var r=getAttributeValue(t,"hx-inherit");if(e!==t){if(htmx.config.disableInheritance)return r&&(r==="*"||r.split(" ").indexOf(n)>=0)?i:null;if(s&&(s==="*"||s.split(" ").indexOf(n)>=0))return"unset"}return i}function getClosestAttributeValue(e,t){let n=null;if(getClosestMatch(e,function(i){return!!(n=getAttributeValueWithDisinheritance(e,asElement(i),t))}),n!=="unset")return n}function matches(e,t){let n=e instanceof Element&&(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector);return!!n&&n.call(e,t)}function getStartTag(e){let n=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(e);return n?n[1].toLowerCase():""}function parseHTML(e){return new DOMParser().parseFromString(e,"text/html")}function takeChildrenFor(e,t){for(;t.childNodes.length>0;)e.append(t.childNodes[0])}function duplicateScript(e){let t=getDocument().createElement("script");return forEach(e.attributes,function(n){t.setAttribute(n.name,n.value)}),t.textContent=e.textContent,t.async=!1,htmx.config.inlineScriptNonce&&(t.nonce=htmx.config.inlineScriptNonce),t}function isJavaScriptScriptNode(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function normalizeScriptTags(e){Array.from(e.querySelectorAll("script")).forEach(t=>{if(isJavaScriptScriptNode(t)){let n=duplicateScript(t),i=t.parentNode;try{i.insertBefore(n,t)}catch(s){logError(s)}finally{t.remove()}}})}function makeFragment(e){let t=e.replace(HEAD_TAG_REGEX,""),n=getStartTag(t),i;if(n==="html"){i=new DocumentFragment;let r=parseHTML(e);takeChildrenFor(i,r.body),i.title=r.title}else if(n==="body"){i=new DocumentFragment;let r=parseHTML(t);takeChildrenFor(i,r.body),i.title=r.title}else{let r=parseHTML('");i=r.querySelector("template").content,i.title=r.title;var s=i.querySelector("title");s&&s.parentNode===i&&(s.remove(),i.title=s.innerText)}return i&&(htmx.config.allowScriptTags?normalizeScriptTags(i):i.querySelectorAll("script").forEach(r=>r.remove())),i}function maybeCall(e){e&&e()}function isType(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function isFunction(e){return typeof e=="function"}function isRawObject(e){return isType(e,"Object")}function getInternalData(e){let t="htmx-internal-data",n=e[t];return n||(n=e[t]={}),n}function toArray(e){let t=[];if(e)for(let n=0;n=0}function bodyContains(e){let t=e.getRootNode&&e.getRootNode();return t&&t instanceof window.ShadowRoot?getDocument().body.contains(t.host):getDocument().body.contains(e)}function splitOnWhitespace(e){return e.trim().split(/\s+/)}function mergeObjects(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function parseJSON(e){try{return JSON.parse(e)}catch(t){return logError(t),null}}function canAccessLocalStorage(){let e="htmx:localStorageTest";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch{return!1}}function normalizePath(e){try{let t=new URL(e);return t&&(e=t.pathname+t.search),/^\/$/.test(e)||(e=e.replace(/\/+$/,"")),e}catch{return e}}function internalEval(str){return maybeEval(getDocument().body,function(){return eval(str)})}function onLoadHelper(e){return htmx.on("htmx:load",function(n){e(n.detail.elt)})}function logAll(){htmx.logger=function(e,t,n){console&&console.log(t,e,n)}}function logNone(){htmx.logger=null}function find(e,t){return typeof e!="string"?e.querySelector(t):find(getDocument(),e)}function findAll(e,t){return typeof e!="string"?e.querySelectorAll(t):findAll(getDocument(),e)}function getWindow(){return window}function removeElement(e,t){e=resolveTarget(e),t?getWindow().setTimeout(function(){removeElement(e),e=null},t):parentElt(e).removeChild(e)}function asElement(e){return e instanceof Element?e:null}function asHtmlElement(e){return e instanceof HTMLElement?e:null}function asString(e){return typeof e=="string"?e:null}function asParentNode(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function addClassToElement(e,t,n){e=asElement(resolveTarget(e)),e&&(n?getWindow().setTimeout(function(){addClassToElement(e,t),e=null},n):e.classList&&e.classList.add(t))}function removeClassFromElement(e,t,n){let i=asElement(resolveTarget(e));i&&(n?getWindow().setTimeout(function(){removeClassFromElement(i,t),i=null},n):i.classList&&(i.classList.remove(t),i.classList.length===0&&i.removeAttribute("class")))}function toggleClassOnElement(e,t){e=resolveTarget(e),e.classList.toggle(t)}function takeClassForElement(e,t){e=resolveTarget(e),forEach(e.parentElement.children,function(n){removeClassFromElement(n,t)}),addClassToElement(asElement(e),t)}function closest(e,t){if(e=asElement(resolveTarget(e)),e&&e.closest)return e.closest(t);do if(e==null||matches(e,t))return e;while(e=e&&asElement(parentElt(e)));return null}function startsWith(e,t){return e.substring(0,t.length)===t}function endsWith(e,t){return e.substring(e.length-t.length)===t}function normalizeSelector(e){let t=e.trim();return startsWith(t,"<")&&endsWith(t,"/>")?t.substring(1,t.length-2):t}function querySelectorAllExt(e,t,n){return e=resolveTarget(e),t.indexOf("closest ")===0?[closest(asElement(e),normalizeSelector(t.substr(8)))]:t.indexOf("find ")===0?[find(asParentNode(e),normalizeSelector(t.substr(5)))]:t==="next"?[asElement(e).nextElementSibling]:t.indexOf("next ")===0?[scanForwardQuery(e,normalizeSelector(t.substr(5)),!!n)]:t==="previous"?[asElement(e).previousElementSibling]:t.indexOf("previous ")===0?[scanBackwardsQuery(e,normalizeSelector(t.substr(9)),!!n)]:t==="document"?[document]:t==="window"?[window]:t==="body"?[document.body]:t==="root"?[getRootNode(e,!!n)]:t.indexOf("global ")===0?querySelectorAllExt(e,t.slice(7),!0):toArray(asParentNode(getRootNode(e,!!n)).querySelectorAll(normalizeSelector(t)))}var scanForwardQuery=function(e,t,n){let i=asParentNode(getRootNode(e,n)).querySelectorAll(t);for(let s=0;s=0;s--){let r=i[s];if(r.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING)return r}};function querySelectorExt(e,t){return typeof e!="string"?querySelectorAllExt(e,t)[0]:querySelectorAllExt(getDocument().body,e)[0]}function resolveTarget(e,t){return typeof e=="string"?find(asParentNode(t)||document,e):e}function processEventArgs(e,t,n){return isFunction(t)?{target:getDocument().body,event:asString(e),listener:t}:{target:resolveTarget(e),event:asString(t),listener:n}}function addEventListenerImpl(e,t,n){return ready(function(){let s=processEventArgs(e,t,n);s.target.addEventListener(s.event,s.listener)}),isFunction(t)?t:n}function removeEventListenerImpl(e,t,n){return ready(function(){let i=processEventArgs(e,t,n);i.target.removeEventListener(i.event,i.listener)}),isFunction(t)?t:n}let DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(e,t){let n=getClosestAttributeValue(e,t);if(n){if(n==="this")return[findThisElement(e,t)];{let i=querySelectorAllExt(e,n);return i.length===0?(logError('The selector "'+n+'" on '+t+" returned no matches!"),[DUMMY_ELT]):i}}}function findThisElement(e,t){return asElement(getClosestMatch(e,function(n){return getAttributeValue(asElement(n),t)!=null}))}function getTarget(e){let t=getClosestAttributeValue(e,"hx-target");return t?t==="this"?findThisElement(e,"hx-target"):querySelectorExt(e,t):getInternalData(e).boosted?getDocument().body:e}function shouldSettleAttribute(e){let t=htmx.config.attributesToSettle;for(let n=0;n0?(s=e.substr(0,e.indexOf(":")),i=e.substr(e.indexOf(":")+1,e.length)):s=e);let r=getDocument().querySelectorAll(i);return r?(forEach(r,function(l){let u,d=t.cloneNode(!0);u=getDocument().createDocumentFragment(),u.appendChild(d),isInlineSwap(s,l)||(u=asParentNode(d));let f={shouldSwap:!0,target:l,fragment:u};triggerEvent(l,"htmx:oobBeforeSwap",f)&&(l=f.target,f.shouldSwap&&swapWithStyle(s,l,l,u,n),forEach(n.elts,function(m){triggerEvent(m,"htmx:oobAfterSwap",f)}))}),t.parentNode.removeChild(t)):(t.parentNode.removeChild(t),triggerErrorEvent(getDocument().body,"htmx:oobErrorNoTarget",{content:t})),e}function handlePreservedElements(e){forEach(findAll(e,"[hx-preserve], [data-hx-preserve]"),function(t){let n=getAttributeValue(t,"id"),i=getDocument().getElementById(n);i!=null&&t.parentNode.replaceChild(i,t)})}function handleAttributes(e,t,n){forEach(t.querySelectorAll("[id]"),function(i){let s=getRawAttribute(i,"id");if(s&&s.length>0){let r=s.replace("'","\\'"),l=i.tagName.replace(":","\\:"),u=asParentNode(e),d=u&&u.querySelector(l+"[id='"+r+"']");if(d&&d!==u){let f=i.cloneNode();cloneAttributes(i,d),n.tasks.push(function(){cloneAttributes(i,f)})}}})}function makeAjaxLoadTask(e){return function(){removeClassFromElement(e,htmx.config.addedClass),processNode(asElement(e)),processFocus(asParentNode(e)),triggerEvent(e,"htmx:load")}}function processFocus(e){let t="[autofocus]",n=asHtmlElement(matches(e,t)?e:e.querySelector(t));n?.focus()}function insertNodesBefore(e,t,n,i){for(handleAttributes(e,n,i);n.childNodes.length>0;){let s=n.firstChild;addClassToElement(asElement(s),htmx.config.addedClass),e.insertBefore(s,t),s.nodeType!==Node.TEXT_NODE&&s.nodeType!==Node.COMMENT_NODE&&i.tasks.push(makeAjaxLoadTask(s))}}function stringHash(e,t){let n=0;for(;n0?getWindow().setTimeout(u,n.settleDelay):u()}function handleTriggerHeader(e,t,n){let i=e.getResponseHeader(t);if(i.indexOf("{")===0){let s=parseJSON(i);for(let r in s)if(s.hasOwnProperty(r)){let l=s[r];isRawObject(l)||(l={value:l}),triggerEvent(n,r,l)}}else{let s=i.split(",");for(let r=0;r0;){let l=t[0];if(l==="]"){if(i--,i===0){r===null&&(s=s+"true"),t.shift(),s+=")})";try{let u=maybeEval(e,function(){return Function(s)()},function(){return!0});return u.source=s,u}catch(u){return triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:u,source:s}),null}}}else l==="["&&i++;isPossibleRelativeReference(l,r,n)?s+="(("+n+"."+l+") ? ("+n+"."+l+") : (window."+l+"))":s=s+l,r=t.shift()}}}function consumeUntil(e,t){let n="";for(;e.length>0&&!t.test(e[0]);)n+=e.shift();return n}function consumeCSSSelector(e){let t;return e.length>0&&COMBINED_SELECTOR_START.test(e[0])?(e.shift(),t=consumeUntil(e,COMBINED_SELECTOR_END).trim(),e.shift()):t=consumeUntil(e,WHITESPACE_OR_COMMA),t}let INPUT_SELECTOR="input, textarea, select";function parseAndCacheTrigger(e,t,n){let i=[],s=tokenizeString(t);do{consumeUntil(s,NOT_WHITESPACE);let u=s.length,d=consumeUntil(s,/[,\[\s]/);if(d!=="")if(d==="every"){let f={trigger:"every"};consumeUntil(s,NOT_WHITESPACE),f.pollInterval=parseInterval(consumeUntil(s,/[,\[\s]/)),consumeUntil(s,NOT_WHITESPACE);var r=maybeGenerateConditional(e,s,"event");r&&(f.eventFilter=r),i.push(f)}else{let f={trigger:d};var r=maybeGenerateConditional(e,s,"event");for(r&&(f.eventFilter=r);s.length>0&&s[0]!==",";){consumeUntil(s,NOT_WHITESPACE);let p=s.shift();if(p==="changed")f.changed=!0;else if(p==="once")f.once=!0;else if(p==="consume")f.consume=!0;else if(p==="delay"&&s[0]===":")s.shift(),f.delay=parseInterval(consumeUntil(s,WHITESPACE_OR_COMMA));else if(p==="from"&&s[0]===":"){if(s.shift(),COMBINED_SELECTOR_START.test(s[0]))var l=consumeCSSSelector(s);else{var l=consumeUntil(s,WHITESPACE_OR_COMMA);if(l==="closest"||l==="find"||l==="next"||l==="previous"){s.shift();let x=consumeCSSSelector(s);x.length>0&&(l+=" "+x)}}f.from=l}else p==="target"&&s[0]===":"?(s.shift(),f.target=consumeCSSSelector(s)):p==="throttle"&&s[0]===":"?(s.shift(),f.throttle=parseInterval(consumeUntil(s,WHITESPACE_OR_COMMA))):p==="queue"&&s[0]===":"?(s.shift(),f.queue=consumeUntil(s,WHITESPACE_OR_COMMA)):p==="root"&&s[0]===":"?(s.shift(),f[p]=consumeCSSSelector(s)):p==="threshold"&&s[0]===":"?(s.shift(),f[p]=consumeUntil(s,WHITESPACE_OR_COMMA)):triggerErrorEvent(e,"htmx:syntax:error",{token:s.shift()})}i.push(f)}s.length===u&&triggerErrorEvent(e,"htmx:syntax:error",{token:s.shift()}),consumeUntil(s,NOT_WHITESPACE)}while(s[0]===","&&s.shift());return n&&(n[t]=i),i}function getTriggerSpecs(e){let t=getAttributeValue(e,"hx-trigger"),n=[];if(t){let i=htmx.config.triggerSpecsCache;n=i&&i[t]||parseAndCacheTrigger(e,t,i)}return n.length>0?n:matches(e,"form")?[{trigger:"submit"}]:matches(e,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:matches(e,INPUT_SELECTOR)?[{trigger:"change"}]:[{trigger:"click"}]}function cancelPolling(e){getInternalData(e).cancelled=!0}function processPolling(e,t,n){let i=getInternalData(e);i.timeout=getWindow().setTimeout(function(){bodyContains(e)&&i.cancelled!==!0&&(maybeFilterEvent(n,e,makeEvent("hx:poll:trigger",{triggerSpec:n,target:e}))||t(e),processPolling(e,t,n))},n.pollInterval)}function isLocalLink(e){return location.hostname===e.hostname&&getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")!==0}function eltIsDisabled(e){return closest(e,htmx.config.disableSelector)}function boostElement(e,t,n){if(e instanceof HTMLAnchorElement&&isLocalLink(e)&&(e.target===""||e.target==="_self")||e.tagName==="FORM"){t.boosted=!0;let i,s;if(e.tagName==="A")i="get",s=getRawAttribute(e,"href");else{let r=getRawAttribute(e,"method");i=r?r.toLowerCase():"get",s=getRawAttribute(e,"action")}n.forEach(function(r){addEventListener(e,function(l,u){let d=asElement(l);if(eltIsDisabled(d)){cleanUpElement(d);return}issueAjaxRequest(i,s,d,u)},t,r,!0)})}}function shouldCancel(e,t){let n=asElement(t);return n?!!((e.type==="submit"||e.type==="click")&&(n.tagName==="FORM"||matches(n,'input[type="submit"], button')&&closest(n,"form")!==null||n instanceof HTMLAnchorElement&&n.href&&(n.getAttribute("href")==="#"||n.getAttribute("href").indexOf("#")!==0))):!1}function ignoreBoostedAnchorCtrlClick(e,t){return getInternalData(e).boosted&&e instanceof HTMLAnchorElement&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function maybeFilterEvent(e,t,n){let i=e.eventFilter;if(i)try{return i.call(t,n)!==!0}catch(s){let r=i.source;return triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:s,source:r}),!0}return!1}function addEventListener(e,t,n,i,s){let r=getInternalData(e),l;i.from?l=querySelectorAllExt(e,i.from):l=[e],i.changed&&l.forEach(function(u){let d=getInternalData(u);d.lastValue=u.value}),forEach(l,function(u){let d=function(f){if(!bodyContains(e)){u.removeEventListener(i.trigger,d);return}if(ignoreBoostedAnchorCtrlClick(e,f)||((s||shouldCancel(f,e))&&f.preventDefault(),maybeFilterEvent(i,e,f)))return;let m=getInternalData(f);if(m.triggerSpec=i,m.handledFor==null&&(m.handledFor=[]),m.handledFor.indexOf(e)<0){if(m.handledFor.push(e),i.consume&&f.stopPropagation(),i.target&&f.target&&!matches(asElement(f.target),i.target))return;if(i.once){if(r.triggeredOnce)return;r.triggeredOnce=!0}if(i.changed){let p=getInternalData(u),E=u.value;if(p.lastValue===E)return;p.lastValue=E}if(r.delayed&&clearTimeout(r.delayed),r.throttle)return;i.throttle>0?r.throttle||(t(e,f),r.throttle=getWindow().setTimeout(function(){r.throttle=null},i.throttle)):i.delay>0?r.delayed=getWindow().setTimeout(function(){t(e,f)},i.delay):(triggerEvent(e,"htmx:trigger"),t(e,f))}};n.listenerInfos==null&&(n.listenerInfos=[]),n.listenerInfos.push({trigger:i.trigger,listener:d,on:u}),u.addEventListener(i.trigger,d)})}let windowIsScrolling=!1,scrollHandler=null;function initScrollHandler(){scrollHandler||(scrollHandler=function(){windowIsScrolling=!0},window.addEventListener("scroll",scrollHandler),setInterval(function(){windowIsScrolling&&(windowIsScrolling=!1,forEach(getDocument().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(e){maybeReveal(e)}))},200))}function maybeReveal(e){!hasAttribute(e,"data-hx-revealed")&&isScrolledIntoView(e)&&(e.setAttribute("data-hx-revealed","true"),getInternalData(e).initHash?triggerEvent(e,"revealed"):e.addEventListener("htmx:afterProcessNode",function(){triggerEvent(e,"revealed")},{once:!0}))}function loadImmediately(e,t,n,i){let s=function(){n.loaded||(n.loaded=!0,t(e))};i>0?getWindow().setTimeout(s,i):s()}function processVerbs(e,t,n){let i=!1;return forEach(VERBS,function(s){if(hasAttribute(e,"hx-"+s)){let r=getAttributeValue(e,"hx-"+s);i=!0,t.path=r,t.verb=s,n.forEach(function(l){addTriggerHandler(e,l,t,function(u,d){let f=asElement(u);if(closest(f,htmx.config.disableSelector)){cleanUpElement(f);return}issueAjaxRequest(s,r,f,d)})})}}),i}function addTriggerHandler(e,t,n,i){if(t.trigger==="revealed")initScrollHandler(),addEventListener(e,i,n,t),maybeReveal(asElement(e));else if(t.trigger==="intersect"){let s={};t.root&&(s.root=querySelectorExt(e,t.root)),t.threshold&&(s.threshold=parseFloat(t.threshold)),new IntersectionObserver(function(l){for(let u=0;u0?(n.polling=!0,processPolling(asElement(e),i,t)):addEventListener(e,i,n,t)}function shouldProcessHxOn(e){let t=asElement(e);if(!t)return!1;let n=t.attributes;for(let i=0;i", "+r).join(""))}else return[]}function maybeSetLastButtonClicked(e){let t=closest(asElement(e.target),"button, input[type='submit']"),n=getRelatedFormData(e);n&&(n.lastButtonClicked=t)}function maybeUnsetLastButtonClicked(e){let t=getRelatedFormData(e);t&&(t.lastButtonClicked=null)}function getRelatedFormData(e){let t=closest(asElement(e.target),"button, input[type='submit']");if(!t)return;let n=resolveTarget("#"+getRawAttribute(t,"form"),t.getRootNode())||closest(t,"form");if(n)return getInternalData(n)}function initButtonTracking(e){e.addEventListener("click",maybeSetLastButtonClicked),e.addEventListener("focusin",maybeSetLastButtonClicked),e.addEventListener("focusout",maybeUnsetLastButtonClicked)}function addHxOnEventHandler(e,t,n){let i=getInternalData(e);Array.isArray(i.onHandlers)||(i.onHandlers=[]);let s,r=function(l){maybeEval(e,function(){eltIsDisabled(e)||(s||(s=new Function("event",n)),s.call(e,l))})};e.addEventListener(t,r),i.onHandlers.push({event:t,listener:r})}function processHxOnWildcard(e){deInitOnHandlers(e);for(let t=0;thtmx.config.historyCacheSize;)r.shift();for(;r.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(r));break}catch(u){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:u,cache:r}),r.shift()}}function getCachedHistory(e){if(!canAccessLocalStorage())return null;e=normalizePath(e);let t=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let n=0;n=200&&this.status<400){triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",n);let i=makeFragment(this.response),s=i.querySelector("[hx-history-elt],[data-hx-history-elt]")||i,r=getHistoryElement(),l=makeSettleInfo(r);handleTitle(i.title),swapInnerHTML(r,s,l),settleImmediately(l.tasks),currentPathForHistory=e,triggerEvent(getDocument().body,"htmx:historyRestore",{path:e,cacheMiss:!0,serverResponse:this.response})}else triggerErrorEvent(getDocument().body,"htmx:historyCacheMissLoadError",n)},t.send()}function restoreHistory(e){saveCurrentPageToHistory(),e=e||location.pathname+location.search;let t=getCachedHistory(e);if(t){let n=makeFragment(t.content),i=getHistoryElement(),s=makeSettleInfo(i);handleTitle(n.title),swapInnerHTML(i,n,s),settleImmediately(s.tasks),getWindow().setTimeout(function(){window.scrollTo(0,t.scroll)},0),currentPathForHistory=e,triggerEvent(getDocument().body,"htmx:historyRestore",{path:e,item:t})}else htmx.config.refreshOnHistoryMiss?window.location.reload(!0):loadHistoryFromServer(e)}function addRequestIndicatorClasses(e){let t=findAttributeTargets(e,"hx-indicator");return t==null&&(t=[e]),forEach(t,function(n){let i=getInternalData(n);i.requestCount=(i.requestCount||0)+1,n.classList.add.call(n.classList,htmx.config.requestClass)}),t}function disableElements(e){let t=findAttributeTargets(e,"hx-disabled-elt");return t==null&&(t=[]),forEach(t,function(n){let i=getInternalData(n);i.requestCount=(i.requestCount||0)+1,n.setAttribute("disabled","")}),t}function removeRequestIndicators(e,t){forEach(e,function(n){let i=getInternalData(n);i.requestCount=(i.requestCount||0)-1,i.requestCount===0&&n.classList.remove.call(n.classList,htmx.config.requestClass)}),forEach(t,function(n){let i=getInternalData(n);i.requestCount=(i.requestCount||0)-1,i.requestCount===0&&n.removeAttribute("disabled")})}function haveSeenNode(e,t){for(let n=0;nt.indexOf(s)<0):i=i.filter(s=>s!==t),n.delete(e),forEach(i,s=>n.append(e,s))}}function processInputValue(e,t,n,i,s){if(!(i==null||haveSeenNode(e,i))){if(e.push(i),shouldInclude(i)){let r=getRawAttribute(i,"name"),l=i.value;i instanceof HTMLSelectElement&&i.multiple&&(l=toArray(i.querySelectorAll("option:checked")).map(function(u){return u.value})),i instanceof HTMLInputElement&&i.files&&(l=toArray(i.files)),addValueToFormData(r,l,t),s&&validateElement(i,n)}i instanceof HTMLFormElement&&(forEach(i.elements,function(r){e.indexOf(r)>=0?removeValueFromFormData(r.name,r.value,t):e.push(r),s&&validateElement(r,n)}),new FormData(i).forEach(function(r,l){r instanceof File&&r.name===""||addValueToFormData(l,r,t)}))}}function validateElement(e,t){let n=e;n.willValidate&&(triggerEvent(n,"htmx:validation:validate"),n.checkValidity()||(t.push({elt:n,message:n.validationMessage,validity:n.validity}),triggerEvent(n,"htmx:validation:failed",{message:n.validationMessage,validity:n.validity})))}function overrideFormData(e,t){for(let n of t.keys())e.delete(n),t.getAll(n).forEach(function(i){e.append(n,i)});return e}function getInputValues(e,t){let n=[],i=new FormData,s=new FormData,r=[],l=getInternalData(e);l.lastButtonClicked&&!bodyContains(l.lastButtonClicked)&&(l.lastButtonClicked=null);let u=e instanceof HTMLFormElement&&e.noValidate!==!0||getAttributeValue(e,"hx-validate")==="true";if(l.lastButtonClicked&&(u=u&&l.lastButtonClicked.formNoValidate!==!0),t!=="get"&&processInputValue(n,s,r,closest(e,"form"),u),processInputValue(n,i,r,e,u),l.lastButtonClicked||e.tagName==="BUTTON"||e.tagName==="INPUT"&&getRawAttribute(e,"type")==="submit"){let f=l.lastButtonClicked||e,m=getRawAttribute(f,"name");addValueToFormData(m,f.value,s)}let d=findAttributeTargets(e,"hx-include");return forEach(d,function(f){processInputValue(n,i,r,asElement(f),u),matches(f,"form")||forEach(asParentNode(f).querySelectorAll(INPUT_SELECTOR),function(m){processInputValue(n,i,r,m,u)})}),overrideFormData(i,s),{errors:r,formData:i,values:formDataProxy(i)}}function appendParam(e,t,n){e!==""&&(e+="&"),String(n)==="[object Object]"&&(n=JSON.stringify(n));let i=encodeURIComponent(n);return e+=encodeURIComponent(t)+"="+i,e}function urlEncode(e){e=formDataFromObject(e);let t="";return e.forEach(function(n,i){t=appendParam(t,i,n)}),t}function getHeaders(e,t,n){let i={"HX-Request":"true","HX-Trigger":getRawAttribute(e,"id"),"HX-Trigger-Name":getRawAttribute(e,"name"),"HX-Target":getAttributeValue(t,"id"),"HX-Current-URL":getDocument().location.href};return getValuesForElement(e,"hx-headers",!1,i),n!==void 0&&(i["HX-Prompt"]=n),getInternalData(e).boosted&&(i["HX-Boosted"]="true"),i}function filterValues(e,t){let n=getClosestAttributeValue(t,"hx-params");if(n){if(n==="none")return new FormData;if(n==="*")return e;if(n.indexOf("not ")===0)return forEach(n.substr(4).split(","),function(i){i=i.trim(),e.delete(i)}),e;{let i=new FormData;return forEach(n.split(","),function(s){s=s.trim(),e.has(s)&&e.getAll(s).forEach(function(r){i.append(s,r)})}),i}}else return e}function isAnchorLink(e){return!!getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")>=0}function getSwapSpecification(e,t){let n=t||getClosestAttributeValue(e,"hx-swap"),i={swapStyle:getInternalData(e).boosted?"innerHTML":htmx.config.defaultSwapStyle,swapDelay:htmx.config.defaultSwapDelay,settleDelay:htmx.config.defaultSettleDelay};if(htmx.config.scrollIntoViewOnBoost&&getInternalData(e).boosted&&!isAnchorLink(e)&&(i.show="top"),n){let l=splitOnWhitespace(n);if(l.length>0)for(let u=0;u0?s.join(":"):null;i.scroll=m,i.scrollTarget=r}else if(d.indexOf("show:")===0){var s=d.substr(5).split(":");let p=s.pop();var r=s.length>0?s.join(":"):null;i.show=p,i.showTarget=r}else if(d.indexOf("focus-scroll:")===0){let f=d.substr(13);i.focusScroll=f=="true"}else u==0?i.swapStyle=d:logError("Unknown modifier in hx-swap: "+d)}}return i}function usesFormData(e){return getClosestAttributeValue(e,"hx-encoding")==="multipart/form-data"||matches(e,"form")&&getRawAttribute(e,"enctype")==="multipart/form-data"}function encodeParamsForBody(e,t,n){let i=null;return withExtensions(t,function(s){i==null&&(i=s.encodeParameters(e,n,t))}),i??(usesFormData(t)?overrideFormData(new FormData,formDataFromObject(n)):urlEncode(n))}function makeSettleInfo(e){return{tasks:[],elts:[e]}}function updateScrollState(e,t){let n=e[0],i=e[e.length-1];if(t.scroll){var s=null;t.scrollTarget&&(s=asElement(querySelectorExt(n,t.scrollTarget))),t.scroll==="top"&&(n||s)&&(s=s||n,s.scrollTop=0),t.scroll==="bottom"&&(i||s)&&(s=s||i,s.scrollTop=s.scrollHeight)}if(t.show){var s=null;if(t.showTarget){let l=t.showTarget;t.showTarget==="window"&&(l="body"),s=asElement(querySelectorExt(n,l))}t.show==="top"&&(n||s)&&(s=s||n,s.scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior})),t.show==="bottom"&&(i||s)&&(s=s||i,s.scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior}))}}function getValuesForElement(e,t,n,i){if(i==null&&(i={}),e==null)return i;let s=getAttributeValue(e,t);if(s){let r=s.trim(),l=n;if(r==="unset")return null;r.indexOf("javascript:")===0?(r=r.substr(11),l=!0):r.indexOf("js:")===0&&(r=r.substr(3),l=!0),r.indexOf("{")!==0&&(r="{"+r+"}");let u;l?u=maybeEval(e,function(){return Function("return ("+r+")")()},{}):u=parseJSON(r);for(let d in u)u.hasOwnProperty(d)&&i[d]==null&&(i[d]=u[d])}return getValuesForElement(asElement(parentElt(e)),t,n,i)}function maybeEval(e,t,n){return htmx.config.allowEval?t():(triggerErrorEvent(e,"htmx:evalDisallowedError"),n)}function getHXVarsForElement(e,t){return getValuesForElement(e,"hx-vars",!0,t)}function getHXValsForElement(e,t){return getValuesForElement(e,"hx-vals",!1,t)}function getExpressionVars(e){return mergeObjects(getHXVarsForElement(e),getHXValsForElement(e))}function safelySetHeaderValue(e,t,n){if(n!==null)try{e.setRequestHeader(t,n)}catch{e.setRequestHeader(t,encodeURIComponent(n)),e.setRequestHeader(t+"-URI-AutoEncoded","true")}}function getPathFromResponse(e){if(e.responseURL&&typeof URL<"u")try{let t=new URL(e.responseURL);return t.pathname+t.search}catch{triggerErrorEvent(getDocument().body,"htmx:badResponseUrl",{url:e.responseURL})}}function hasHeader(e,t){return t.test(e.getAllResponseHeaders())}function ajaxHelper(e,t,n){return e=e.toLowerCase(),n?n instanceof Element||typeof n=="string"?issueAjaxRequest(e,t,null,null,{targetOverride:resolveTarget(n),returnPromise:!0}):issueAjaxRequest(e,t,resolveTarget(n.source),n.event,{handler:n.handler,headers:n.headers,values:n.values,targetOverride:resolveTarget(n.target),swapOverride:n.swap,select:n.select,returnPromise:!0}):issueAjaxRequest(e,t,null,null,{returnPromise:!0})}function hierarchyForElt(e){let t=[];for(;e;)t.push(e),e=e.parentElement;return t}function verifyPath(e,t,n){let i,s;return typeof URL=="function"?(s=new URL(t,document.location.href),i=document.location.origin===s.origin):(s=t,i=startsWith(t,document.location.origin)),htmx.config.selfRequestsOnly&&!i?!1:triggerEvent(e,"htmx:validateUrl",mergeObjects({url:s,sameHost:i},n))}function formDataFromObject(e){if(e instanceof FormData)return e;let t=new FormData;for(let n in e)e.hasOwnProperty(n)&&(typeof e[n].forEach=="function"?e[n].forEach(function(i){t.append(n,i)}):typeof e[n]=="object"?t.append(n,JSON.stringify(e[n])):t.append(n,e[n]));return t}function formDataArrayProxy(e,t,n){return new Proxy(n,{get:function(i,s){return typeof s=="number"?i[s]:s==="length"?i.length:s==="push"?function(r){i.push(r),e.append(t,r)}:typeof i[s]=="function"?function(){i[s].apply(i,arguments),e.delete(t),i.forEach(function(r){e.append(t,r)})}:i[s]&&i[s].length===1?i[s][0]:i[s]},set:function(i,s,r){return i[s]=r,e.delete(t),i.forEach(function(l){e.append(t,l)}),!0}})}function formDataProxy(e){return new Proxy(e,{get:function(t,n){if(typeof n=="symbol")return Reflect.get(t,n);if(n==="toJSON")return()=>Object.fromEntries(e);if(n in t)return typeof t[n]=="function"?function(){return e[n].apply(e,arguments)}:t[n];let i=e.getAll(n);if(i.length!==0)return i.length===1?i[0]:formDataArrayProxy(t,n,i)},set:function(t,n,i){return typeof n!="string"?!1:(t.delete(n),typeof i.forEach=="function"?i.forEach(function(s){t.append(n,s)}):t.append(n,i),!0)},deleteProperty:function(t,n){return typeof n=="string"&&t.delete(n),!0},ownKeys:function(t){return Reflect.ownKeys(Object.fromEntries(t))},getOwnPropertyDescriptor:function(t,n){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(t),n)}})}function issueAjaxRequest(e,t,n,i,s,r){let l=null,u=null;if(s=s??{},s.returnPromise&&typeof Promise<"u")var d=new Promise(function(N,j){l=N,u=j});n==null&&(n=getDocument().body);let f=s.handler||handleAjaxResponse,m=s.select||null;if(!bodyContains(n))return maybeCall(l),d;let p=s.targetOverride||asElement(getTarget(n));if(p==null||p==DUMMY_ELT)return triggerErrorEvent(n,"htmx:targetError",{target:getAttributeValue(n,"hx-target")}),maybeCall(u),d;let E=getInternalData(n),x=E.lastButtonClicked;if(x){let N=getRawAttribute(x,"formaction");N!=null&&(t=N);let j=getRawAttribute(x,"formmethod");j!=null&&j.toLowerCase()!=="dialog"&&(e=j)}let C=getClosestAttributeValue(n,"hx-confirm");if(r===void 0&&triggerEvent(n,"htmx:confirm",{target:p,elt:n,path:t,verb:e,triggeringEvent:i,etc:s,issueRequest:function(le){return issueAjaxRequest(e,t,n,i,s,!!le)},question:C})===!1)return maybeCall(l),d;let T=n,H=getClosestAttributeValue(n,"hx-sync"),V=null,z=!1;if(H){let N=H.split(":"),j=N[0].trim();if(j==="this"?T=findThisElement(n,"hx-sync"):T=asElement(querySelectorExt(n,j)),H=(N[1]||"drop").trim(),E=getInternalData(T),H==="drop"&&E.xhr&&E.abortable!==!0)return maybeCall(l),d;if(H==="abort"){if(E.xhr)return maybeCall(l),d;z=!0}else H==="replace"?triggerEvent(T,"htmx:abort"):H.indexOf("queue")===0&&(V=(H.split(" ")[1]||"last").trim())}if(E.xhr)if(E.abortable)triggerEvent(T,"htmx:abort");else{if(V==null){if(i){let N=getInternalData(i);N&&N.triggerSpec&&N.triggerSpec.queue&&(V=N.triggerSpec.queue)}V==null&&(V="last")}return E.queuedRequests==null&&(E.queuedRequests=[]),V==="first"&&E.queuedRequests.length===0?E.queuedRequests.push(function(){issueAjaxRequest(e,t,n,i,s)}):V==="all"?E.queuedRequests.push(function(){issueAjaxRequest(e,t,n,i,s)}):V==="last"&&(E.queuedRequests=[],E.queuedRequests.push(function(){issueAjaxRequest(e,t,n,i,s)})),maybeCall(l),d}let k=new XMLHttpRequest;E.xhr=k,E.abortable=z;let I=function(){E.xhr=null,E.abortable=!1,E.queuedRequests!=null&&E.queuedRequests.length>0&&E.queuedRequests.shift()()},ae=getClosestAttributeValue(n,"hx-prompt");if(ae){var Y=prompt(ae);if(Y===null||!triggerEvent(n,"htmx:prompt",{prompt:Y,target:p}))return maybeCall(l),I(),d}if(C&&!r&&!confirm(C))return maybeCall(l),I(),d;let U=getHeaders(n,p,Y);e!=="get"&&!usesFormData(n)&&(U["Content-Type"]="application/x-www-form-urlencoded"),s.headers&&(U=mergeObjects(U,s.headers));let Z=getInputValues(n,e),F=Z.errors,o=Z.formData;s.values&&overrideFormData(o,formDataFromObject(s.values));let a=formDataFromObject(getExpressionVars(n)),c=overrideFormData(o,a),h=filterValues(c,n);htmx.config.getCacheBusterParam&&e==="get"&&h.set("org.htmx.cache-buster",getRawAttribute(p,"id")||"true"),(t==null||t==="")&&(t=getDocument().location.href);let g=getValuesForElement(n,"hx-request"),b=getInternalData(n).boosted,v=htmx.config.methodsThatUseUrlParams.indexOf(e)>=0,y={boosted:b,useUrlParams:v,formData:h,parameters:formDataProxy(h),unfilteredFormData:c,unfilteredParameters:formDataProxy(c),headers:U,target:p,verb:e,errors:F,withCredentials:s.credentials||g.credentials||htmx.config.withCredentials,timeout:s.timeout||g.timeout||htmx.config.timeout,path:t,triggeringEvent:i};if(!triggerEvent(n,"htmx:configRequest",y))return maybeCall(l),I(),d;if(t=y.path,e=y.verb,U=y.headers,h=formDataFromObject(y.parameters),F=y.errors,v=y.useUrlParams,F&&F.length>0)return triggerEvent(n,"htmx:validation:halted",y),maybeCall(l),I(),d;let S=t.split("#"),D=S[0],W=S[1],O=t;if(v&&(O=D,!h.keys().next().done&&(O.indexOf("?")<0?O+="?":O+="&",O+=urlEncode(h),W&&(O+="#"+W))),!verifyPath(n,O,y))return triggerErrorEvent(n,"htmx:invalidPath",y),maybeCall(u),d;if(k.open(e.toUpperCase(),O,!0),k.overrideMimeType("text/html"),k.withCredentials=y.withCredentials,k.timeout=y.timeout,!g.noHeaders){for(let N in U)if(U.hasOwnProperty(N)){let j=U[N];safelySetHeaderValue(k,N,j)}}let A={xhr:k,target:p,requestConfig:y,etc:s,boosted:b,select:m,pathInfo:{requestPath:t,finalRequestPath:O,responsePath:null,anchor:W}};if(k.onload=function(){try{let N=hierarchyForElt(n);if(A.pathInfo.responsePath=getPathFromResponse(k),f(n,A),removeRequestIndicators(te,G),triggerEvent(n,"htmx:afterRequest",A),triggerEvent(n,"htmx:afterOnLoad",A),!bodyContains(n)){let j=null;for(;N.length>0&&j==null;){let le=N.shift();bodyContains(le)&&(j=le)}j&&(triggerEvent(j,"htmx:afterRequest",A),triggerEvent(j,"htmx:afterOnLoad",A))}maybeCall(l),I()}catch(N){throw triggerErrorEvent(n,"htmx:onLoadError",mergeObjects({error:N},A)),N}},k.onerror=function(){removeRequestIndicators(te,G),triggerErrorEvent(n,"htmx:afterRequest",A),triggerErrorEvent(n,"htmx:sendError",A),maybeCall(u),I()},k.onabort=function(){removeRequestIndicators(te,G),triggerErrorEvent(n,"htmx:afterRequest",A),triggerErrorEvent(n,"htmx:sendAbort",A),maybeCall(u),I()},k.ontimeout=function(){removeRequestIndicators(te,G),triggerErrorEvent(n,"htmx:afterRequest",A),triggerErrorEvent(n,"htmx:timeout",A),maybeCall(u),I()},!triggerEvent(n,"htmx:beforeRequest",A))return maybeCall(l),I(),d;var te=addRequestIndicatorClasses(n),G=disableElements(n);forEach(["loadstart","loadend","progress","abort"],function(N){forEach([k,k.upload],function(j){j.addEventListener(N,function(le){triggerEvent(n,"htmx:xhr:"+N,{lengthComputable:le.lengthComputable,loaded:le.loaded,total:le.total})})})}),triggerEvent(n,"htmx:beforeSend",A);let J=v?null:encodeParamsForBody(k,n,h);return k.send(J),d}function determineHistoryUpdates(e,t){let n=t.xhr,i=null,s=null;if(hasHeader(n,/HX-Push:/i)?(i=n.getResponseHeader("HX-Push"),s="push"):hasHeader(n,/HX-Push-Url:/i)?(i=n.getResponseHeader("HX-Push-Url"),s="push"):hasHeader(n,/HX-Replace-Url:/i)&&(i=n.getResponseHeader("HX-Replace-Url"),s="replace"),i)return i==="false"?{}:{type:s,path:i};let r=t.pathInfo.finalRequestPath,l=t.pathInfo.responsePath,u=getClosestAttributeValue(e,"hx-push-url"),d=getClosestAttributeValue(e,"hx-replace-url"),f=getInternalData(e).boosted,m=null,p=null;return u?(m="push",p=u):d?(m="replace",p=d):f&&(m="push",p=l||r),p?p==="false"?{}:(p==="true"&&(p=l||r),t.pathInfo.anchor&&p.indexOf("#")===-1&&(p=p+"#"+t.pathInfo.anchor),{type:m,path:p}):{}}function codeMatches(e,t){var n=new RegExp(e.code);return n.test(t.toString(10))}function resolveResponseHandling(e){for(var t=0;t0?getWindow().setTimeout(Y,V.swapDelay):Y()}p&&triggerErrorEvent(e,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+n.status+" from "+t.pathInfo.requestPath},t))}}let extensions={};function extensionBase(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return!0},transformResponse:function(e,t,n){return e},isInlineSwap:function(e){return!1},handleSwap:function(e,t,n,i){return!1},encodeParameters:function(e,t,n){return null}}}function defineExtension(e,t){t.init&&t.init(internalAPI),extensions[e]=mergeObjects(extensionBase(),t)}function removeExtension(e){delete extensions[e]}function getExtensions(e,t,n){if(t==null&&(t=[]),e==null)return t;n==null&&(n=[]);let i=getAttributeValue(e,"hx-ext");return i&&forEach(i.split(","),function(s){if(s=s.replace(/ /g,""),s.slice(0,7)=="ignore:"){n.push(s.slice(7));return}if(n.indexOf(s)<0){let r=extensions[s];r&&t.indexOf(r)<0&&t.push(r)}}),getExtensions(asElement(parentElt(e)),t,n)}var isReady=!1;getDocument().addEventListener("DOMContentLoaded",function(){isReady=!0});function ready(e){isReady||getDocument().readyState==="complete"?e():getDocument().addEventListener("DOMContentLoaded",e)}function insertIndicatorStyles(){if(htmx.config.includeIndicatorStyles!==!1){let e=htmx.config.inlineStyleNonce?` nonce="${htmx.config.inlineStyleNonce}"`:"";getDocument().head.insertAdjacentHTML("beforeend"," ."+htmx.config.indicatorClass+"{opacity:0} ."+htmx.config.requestClass+" ."+htmx.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ."+htmx.config.requestClass+"."+htmx.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ")}}function getMetaConfig(){let e=getDocument().querySelector('meta[name="htmx-config"]');return e?parseJSON(e.content):null}function mergeMetaConfig(){let e=getMetaConfig();e&&(htmx.config=mergeObjects(htmx.config,e))}return ready(function(){mergeMetaConfig(),insertIndicatorStyles();let e=getDocument().body;processNode(e);let t=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(i){let s=i.target,r=getInternalData(s);r&&r.xhr&&r.xhr.abort()});let n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(i){i.state&&i.state.htmx?(restoreHistory(),forEach(t,function(s){triggerEvent(s,"htmx:restored",{document:getDocument(),triggerEvent})})):n&&n(i)},getWindow().setTimeout(function(){triggerEvent(e,"htmx:load",{}),e=null},0)}),htmx}(),re=Da;var Ca=Object.defineProperty,Aa=(e,t,n)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t,n)=>(Aa(e,typeof t!="symbol"?t+"":t,n),n),To="aria-describedby",Mn="aria-expanded",kn="aria-hidden",Fn="aria-modal",ms="aria-pressed",ui="aria-selected",Oa="DOMContentLoaded",Li="focus",Ri="focusin",xo="focusout",qn="keydown",Na="keyup",ye="click",So="mousedown",Ia="hover",$n="mouseenter",Pi="mouseleave",Ma="pointerdown",_a="pointermove",Ha="pointerup",Vn="resize",Bn="scroll",ki="touchstart",La="dragstart",Ti="ArrowDown",xi="ArrowUp",vs="ArrowLeft",bs="ArrowRight",Fi="Escape",Ra="transitionDuration",Pa="transitionDelay",hi="transitionend",Do="transitionProperty",ka=navigator.userAgentData,_n=ka,{userAgent:Fa}=navigator,Hn=Fa,ys=/iPhone|iPad|iPod|Android/i;_n?_n.brands.some(e=>ys.test(e.brand)):ys.test(Hn);var Es=/(iPhone|iPod|iPad)/,qa=_n?_n.brands.some(e=>Es.test(e.brand)):Es.test(Hn);Hn&&Hn.includes("Firefox");var{head:Wn}=document;["webkitPerspective","perspective"].some(e=>e in Wn.style);var $a=(e,t,n,i)=>{let s=i||!1;e.addEventListener(t,n,s)},Va=(e,t,n,i)=>{let s=i||!1;e.removeEventListener(t,n,s)},Ba=(e,t,n,i)=>{let s=r=>{(r.target===e||r.currentTarget===e)&&(n.apply(e,[r]),Va(e,t,s,i))};$a(e,t,s,i)},an=()=>{};(()=>{let e=!1;try{let t=Object.defineProperty({},"passive",{get:()=>(e=!0,e)});Ba(document,Oa,an,t)}catch{}return e})();["webkitTransform","transform"].some(e=>e in Wn.style);["webkitAnimation","animation"].some(e=>e in Wn.style);["webkitTransition","transition"].some(e=>e in Wn.style);var ze=(e,t)=>e.getAttribute(t),Ln=(e,t)=>e.hasAttribute(t),Ee=(e,t,n)=>e.setAttribute(t,n),Lt=(e,t)=>e.removeAttribute(t),L=(e,...t)=>{e.classList.add(...t)},X=(e,...t)=>{e.classList.remove(...t)},_=(e,t)=>e.classList.contains(t),cn=e=>e!=null&&typeof e=="object"||!1,pe=e=>cn(e)&&typeof e.nodeType=="number"&&[1,2,3,4,5,6,7,8,9,10,11].some(t=>e.nodeType===t)||!1,ie=e=>pe(e)&&e.nodeType===1||!1,Bt=new Map,jt={data:Bt,set:(e,t,n)=>{ie(e)&&(Bt.has(t)||Bt.set(t,new Map),Bt.get(t).set(e,n))},getAllFor:e=>Bt.get(e)||null,get:(e,t)=>{if(!ie(e)||!t)return null;let n=jt.getAllFor(t);return e&&n&&n.get(e)||null},remove:(e,t)=>{let n=jt.getAllFor(t);!n||!ie(e)||(n.delete(e),n.size===0&&Bt.delete(t))}},Ae=(e,t)=>jt.get(e,t),dn=e=>typeof e=="string"||!1,qi=e=>cn(e)&&e.constructor.name==="Window"||!1,Co=e=>pe(e)&&e.nodeType===9||!1,Q=e=>qi(e)?e.document:Co(e)?e:pe(e)?e.ownerDocument:window.document,nt=(e,...t)=>Object.assign(e,...t),ht=e=>{if(!e)return;if(dn(e))return Q().createElement(e);let{tagName:t}=e,n=ht(t);if(!n)return;let i={...e};return delete i.tagName,nt(n,i)},K=(e,t)=>e.dispatchEvent(t),Ne=(e,t)=>{let n=getComputedStyle(e),i=t.replace("webkit","Webkit").replace(/([A-Z])/g,"-$1").toLowerCase();return n.getPropertyValue(i)},Wa=e=>{let t=Ne(e,Do),n=Ne(e,Pa),i=n.includes("ms")?1:1e3,s=t&&t!=="none"?parseFloat(n)*i:0;return Number.isNaN(s)?0:s},Xt=e=>{let t=Ne(e,Do),n=Ne(e,Ra),i=n.includes("ms")?1:1e3,s=t&&t!=="none"?parseFloat(n)*i:0;return Number.isNaN(s)?0:s},ue=(e,t)=>{let n=0,i=new Event(hi),s=Xt(e),r=Wa(e);if(s){let l=u=>{u.target===e&&(t.apply(e,[u]),e.removeEventListener(hi,l),n=1)};e.addEventListener(hi,l),setTimeout(()=>{n||K(e,i)},s+r+17)}else t.apply(e,[i])},it=(e,t)=>e.focus(t),ws=e=>["true",!0].includes(e)?!0:["false",!1].includes(e)?!1:["null","",null,void 0].includes(e)?null:e!==""&&!Number.isNaN(+e)?+e:e,An=e=>Object.entries(e),zt=e=>e.toLowerCase(),ja=(e,t,n,i)=>{let s={...n},r={...e.dataset},l={...t},u={},d="title";return An(r).forEach(([f,m])=>{let p=i&&typeof f=="string"&&f.includes(i)?f.replace(i,"").replace(/[A-Z]/g,E=>zt(E)):f;u[p]=ws(m)}),An(s).forEach(([f,m])=>{s[f]=ws(m)}),An(t).forEach(([f,m])=>{f in s?l[f]=s[f]:f in u?l[f]=u[f]:l[f]=f===d?ze(e,d):m}),l},Ts=e=>Object.keys(e),ee=(e,t)=>{let n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return cn(t)&&nt(n,t),n},je={passive:!0},kt=e=>e.offsetHeight,me=(e,t)=>{An(t).forEach(([n,i])=>{if(i&&dn(n)&&n.includes("--"))e.style.setProperty(n,i);else{let s={};s[n]=i,nt(e.style,s)}})},Si=e=>cn(e)&&e.constructor.name==="Map"||!1,Ua=e=>typeof e=="number"||!1,ct=new Map,q={set:(e,t,n,i)=>{ie(e)&&(i&&i.length?(ct.has(e)||ct.set(e,new Map),ct.get(e).set(i,setTimeout(t,n))):ct.set(e,setTimeout(t,n)))},get:(e,t)=>{if(!ie(e))return null;let n=ct.get(e);return t&&n&&Si(n)?n.get(t)||null:Ua(n)?n:null},clear:(e,t)=>{if(!ie(e))return;let n=ct.get(e);t&&t.length&&Si(n)?(clearTimeout(n.get(t)),n.delete(t),n.size===0&&ct.delete(e)):(clearTimeout(n),ct.delete(e))}},un=(e,t)=>{let{width:n,height:i,top:s,right:r,bottom:l,left:u}=e.getBoundingClientRect(),d=1,f=1;if(t&&ie(e)){let{offsetWidth:m,offsetHeight:p}=e;d=m>0?Math.round(n)/m:1,f=p>0?Math.round(i)/p:1}return{width:n/d,height:i/f,top:s/f,right:r/d,bottom:l/f,left:u/d,x:u/d,y:s/f}},mt=e=>Q(e).body,st=e=>Q(e).documentElement,Ao=e=>pe(e)&&e.constructor.name==="ShadowRoot"||!1,Xa=e=>e.nodeName==="HTML"?e:ie(e)&&e.assignedSlot||pe(e)&&e.parentNode||Ao(e)&&e.host||st(e),xs=0,Ss=0,Wt=new Map,Oo=(e,t)=>{let n=t?xs:Ss;if(t){let i=Oo(e),s=Wt.get(i)||new Map;Wt.has(i)||Wt.set(i,s),Si(s)&&!s.has(t)?(s.set(t,n),xs+=1):n=s.get(t)}else{let i=e.id||e;Wt.has(i)?n=Wt.get(i):(Wt.set(i,n),Ss+=1)}return n},Gt=e=>{var t;return e?Co(e)?e.defaultView:pe(e)?(t=e?.ownerDocument)==null?void 0:t.defaultView:e:window},za=e=>Array.isArray(e)||!1,No=e=>{if(!pe(e))return!1;let{top:t,bottom:n}=un(e),{clientHeight:i}=st(e);return t<=i&&n>=0},Ya=e=>typeof e=="function"||!1,Ga=e=>cn(e)&&e.constructor.name==="NodeList"||!1,pt=e=>st(e).dir==="rtl",Ka=e=>pe(e)&&["TABLE","TD","TH"].includes(e.nodeName)||!1,we=(e,t)=>e?e.closest(t)||we(e.getRootNode().host,t):null,he=(e,t)=>ie(e)?e:(pe(t)?t:Q()).querySelector(e),$i=(e,t)=>(pe(t)?t:Q()).getElementsByTagName(e),Be=(e,t)=>(pe(t)?t:Q()).querySelectorAll(e),Ze=(e,t)=>(t&&pe(t)?t:Q()).getElementsByClassName(e),Io=(e,t)=>e.matches(t),Ut={},Mo=e=>{let{type:t,currentTarget:n}=e;[...Ut[t]].forEach(([i,s])=>{n===i&&[...s].forEach(([r,l])=>{r.apply(i,[e]),typeof l=="object"&&l.once&&xe(i,t,r,l)})})},Te=(e,t,n,i)=>{Ut[t]||(Ut[t]=new Map);let s=Ut[t];s.has(e)||s.set(e,new Map);let r=s.get(e),{size:l}=r;r.set(n,i),l||e.addEventListener(t,Mo,i)},xe=(e,t,n,i)=>{let s=Ut[t],r=s&&s.get(e),l=r&&r.get(n),u=l!==void 0?l:i;r&&r.has(n)&&r.delete(n),s&&(!r||!r.size)&&s.delete(e),(!s||!s.size)&&delete Ut[t],(!r||!r.size)&&e.removeEventListener(t,Mo,u)},Se="fade",$="show",jn="data-bs-dismiss",Un="alert",_o="Alert",Ja="5.0.9",Qa=Ja,He=class{constructor(t,n){let i=he(t);if(!i)throw dn(t)?Error(`${this.name} Error: "${t}" is not a valid selector.`):Error(`${this.name} Error: your target is not an instance of HTMLElement.`);let s=jt.get(i,this.name);s&&s.dispose(),this.element=i,this.options=this.defaults&&Ts(this.defaults).length?ja(i,this.defaults,n||{},"bs"):{},jt.set(i,this.name,this)}get version(){return Qa}get name(){return"BaseComponent"}get defaults(){return{}}dispose(){jt.remove(this.element,this.name),Ts(this).forEach(t=>{delete this[t]})}},Za=`.${Un}`,el=`[${jn}="${Un}"]`,tl=e=>Ae(e,_o),nl=e=>new wt(e),Ds=ee(`close.bs.${Un}`),il=ee(`closed.bs.${Un}`),Cs=e=>{let{element:t}=e;Di(e),K(t,il),e.dispose(),t.remove()},Di=(e,t)=>{let n=t?Te:xe,{dismiss:i,close:s}=e;i&&n(i,ye,s)},wt=class extends He{constructor(t){super(t),M(this,"dismiss"),M(this,"close",()=>{let{element:n}=this;n&&_(n,$)&&(K(n,Ds),Ds.defaultPrevented||(X(n,$),_(n,Se)?ue(n,()=>Cs(this)):Cs(this)))}),this.dismiss=he(el,this.element),Di(this,!0)}get name(){return _o}dispose(){Di(this),super.dispose()}};M(wt,"selector",Za),M(wt,"init",nl),M(wt,"getInstance",tl);var oe="active",Ye="data-bs-toggle",sl="button",Ho="Button",ol=`[${Ye}="${sl}"]`,rl=e=>Ae(e,Ho),al=e=>new Tt(e),As=(e,t)=>{(t?Te:xe)(e.element,ye,e.toggle)},Tt=class extends He{constructor(t){super(t),M(this,"isActive",!1),M(this,"toggle",i=>{i&&i.preventDefault();let{element:s,isActive:r}=this;!_(s,"disabled")&&!ze(s,"disabled")&&((r?X:L)(s,oe),Ee(s,ms,r?"false":"true"),this.isActive=_(s,oe))});let{element:n}=this;this.isActive=_(n,oe),Ee(n,ms,String(!!this.isActive)),As(this,!0)}get name(){return Ho}dispose(){As(this),super.dispose()}};M(Tt,"selector",ol),M(Tt,"init",al),M(Tt,"getInstance",rl);var Ci="data-bs-target",xt="carousel",Lo="Carousel",Os="data-bs-parent",ll="data-bs-container",Me=e=>{let t=[Ci,Os,ll,"href"],n=Q(e);return t.map(i=>{let s=ze(e,i);return s?i===Os?we(e,s):he(s,n):null}).filter(i=>i)[0]},hn=`[data-bs-ride="${xt}"]`,Fe=`${xt}-item`,Ai="data-bs-slide-to",ut="data-bs-slide",ft="paused",Ns={pause:"hover",keyboard:!1,touch:!0,interval:5e3},ot=e=>Ae(e,Lo),cl=e=>new St(e),on=0,On=0,fi=0,gi=ee(`slide.bs.${xt}`),Oi=ee(`slid.bs.${xt}`),Is=e=>{let{index:t,direction:n,element:i,slides:s,options:r}=e;if(e.isAnimating){let l=Ni(e),u=n==="left"?"next":"prev",d=n==="left"?"start":"end";L(s[t],oe),X(s[t],`${Fe}-${u}`),X(s[t],`${Fe}-${d}`),X(s[l],oe),X(s[l],`${Fe}-${d}`),K(i,Oi),q.clear(i,ut),e.cycle&&!Q(i).hidden&&r.interval&&!e.isPaused&&e.cycle()}};function dl(){let e=ot(this);e&&!e.isPaused&&!q.get(this,ft)&&L(this,ft)}function ul(){let e=ot(this);e&&e.isPaused&&!q.get(this,ft)&&e.cycle()}function hl(e){e.preventDefault();let t=we(this,hn)||Me(this),n=ot(t);if(n&&!n.isAnimating){let i=+(ze(this,Ai)||0);this&&!_(this,oe)&&!Number.isNaN(i)&&n.to(i)}}function fl(e){e.preventDefault();let t=we(this,hn)||Me(this),n=ot(t);if(n&&!n.isAnimating){let i=ze(this,ut);i==="next"?n.next():i==="prev"&&n.prev()}}var gl=({code:e,target:t})=>{let n=Q(t),[i]=[...Be(hn,n)].filter(r=>No(r)),s=ot(i);if(s&&!s.isAnimating&&!/textarea|input/i.test(t.nodeName)){let r=pt(i);e===(r?bs:vs)?s.prev():e===(r?vs:bs)&&s.next()}};function Ms(e){let{target:t}=e,n=ot(this);n&&n.isTouch&&(n.indicator&&!n.indicator.contains(t)||!n.controls.includes(t))&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())}function pl(e){let{target:t}=e,n=ot(this);if(n&&!n.isAnimating&&!n.isTouch){let{controls:i,indicators:s}=n;[...i,...s].every(r=>r===t||r.contains(t))||(on=e.pageX,this.contains(t)&&(n.isTouch=!0,Ro(n,!0)))}}var ml=e=>{On=e.pageX},vl=e=>{var t;let{target:n}=e,i=Q(n),s=[...Be(hn,i)].map(r=>ot(r)).find(r=>r.isTouch);if(s){let{element:r,index:l}=s,u=pt(r);fi=e.pageX,s.isTouch=!1,Ro(s),!((t=i.getSelection())!=null&&t.toString().length)&&r.contains(n)&&Math.abs(on-fi)>120&&(Onon&&s.to(l+(u?1:-1))),on=0,On=0,fi=0}},pi=(e,t)=>{let{indicators:n}=e;[...n].forEach(i=>X(i,oe)),e.indicators[t]&&L(n[t],oe)},Ro=(e,t)=>{let{element:n}=e,i=t?Te:xe;i(Q(n),_a,ml,je),i(Q(n),Ha,vl,je)},_s=(e,t)=>{let{element:n,options:i,slides:s,controls:r,indicators:l}=e,{touch:u,pause:d,interval:f,keyboard:m}=i,p=t?Te:xe;d&&f&&(p(n,$n,dl),p(n,Pi,ul)),u&&s.length>2&&(p(n,Ma,pl,je),p(n,ki,Ms,{passive:!1}),p(n,La,Ms,{passive:!1})),r.length&&r.forEach(E=>{E&&p(E,ye,fl)}),l.length&&l.forEach(E=>{p(E,ye,hl)}),m&&p(Q(n),qn,gl)},Ni=e=>{let{slides:t,element:n}=e,i=he(`.${Fe}.${oe}`,n);return ie(i)?[...t].indexOf(i):-1},St=class extends He{constructor(t,n){super(t,n);let{element:i}=this;this.direction=pt(i)?"right":"left",this.isTouch=!1,this.slides=Ze(Fe,i);let{slides:s}=this;if(s.length>=2){let r=Ni(this),l=[...s].find(f=>Io(f,`.${Fe}-next,.${Fe}-next`));this.index=r;let u=Q(i);this.controls=[...Be(`[${ut}]`,i),...Be(`[${ut}][${Ci}="#${i.id}"]`,u)].filter((f,m,p)=>m===p.indexOf(f)),this.indicator=he(`.${xt}-indicators`,i),this.indicators=[...this.indicator?Be(`[${Ai}]`,this.indicator):[],...Be(`[${Ai}][${Ci}="#${i.id}"]`,u)].filter((f,m,p)=>m===p.indexOf(f));let{options:d}=this;this.options.interval=d.interval===!0?Ns.interval:d.interval,l?this.index=[...s].indexOf(l):r<0&&(this.index=0,L(s[0],oe),this.indicators.length&&pi(this,0)),this.indicators.length&&pi(this,this.index),_s(this,!0),d.interval&&this.cycle()}}get name(){return Lo}get defaults(){return Ns}get isPaused(){return _(this.element,ft)}get isAnimating(){return he(`.${Fe}-next,.${Fe}-prev`,this.element)!==null}cycle(){let{element:t,options:n,isPaused:i,index:s}=this;q.clear(t,xt),i&&(q.clear(t,ft),X(t,ft)),q.set(t,()=>{this.element&&!this.isPaused&&!this.isTouch&&No(t)&&this.to(s+1)},n.interval,xt)}pause(){let{element:t,options:n}=this;!this.isPaused&&n.interval&&(L(t,ft),q.set(t,()=>{},1,ft))}next(){this.isAnimating||this.to(this.index+1)}prev(){this.isAnimating||this.to(this.index-1)}to(t){let{element:n,slides:i,options:s}=this,r=Ni(this),l=pt(n),u=t;if(!this.isAnimating&&r!==u&&!q.get(n,ut)){ru||r===i.length-1&&u===0)&&(this.direction=l?"left":"right");let{direction:d}=this;u<0?u=i.length-1:u>=i.length&&(u=0);let f=d==="left"?"next":"prev",m=d==="left"?"start":"end",p={relatedTarget:i[u],from:r,to:u,direction:d};nt(gi,p),nt(Oi,p),K(n,gi),gi.defaultPrevented||(this.index=u,pi(this,u),Xt(i[u])&&_(n,"slide")?q.set(n,()=>{L(i[u],`${Fe}-${f}`),kt(i[u]),L(i[u],`${Fe}-${m}`),L(i[r],`${Fe}-${m}`),ue(i[u],()=>this.slides&&this.slides.length&&Is(this))},0,ut):(L(i[u],oe),X(i[r],oe),q.set(n,()=>{q.clear(n,ut),n&&s.interval&&!this.isPaused&&this.cycle(),K(n,Oi)},0,ut)))}}dispose(){let{isAnimating:t}=this,n={...this,isAnimating:t};_s(n),super.dispose(),n.isAnimating&&ue(n.slides[n.index],()=>{Is(n)})}};M(St,"selector",hn),M(St,"init",cl),M(St,"getInstance",ot);var Rt="collapsing",Ie="collapse",Po="Collapse",bl=`.${Ie}`,ko=`[${Ye}="${Ie}"]`,yl={parent:null},Rn=e=>Ae(e,Po),El=e=>new Dt(e),Hs=ee(`show.bs.${Ie}`),wl=ee(`shown.bs.${Ie}`),Ls=ee(`hide.bs.${Ie}`),Tl=ee(`hidden.bs.${Ie}`),xl=e=>{let{element:t,parent:n,triggers:i}=e;K(t,Hs),Hs.defaultPrevented||(q.set(t,an,17),n&&q.set(n,an,17),L(t,Rt),X(t,Ie),me(t,{height:`${t.scrollHeight}px`}),ue(t,()=>{q.clear(t),n&&q.clear(n),i.forEach(s=>Ee(s,Mn,"true")),X(t,Rt),L(t,Ie),L(t,$),me(t,{height:""}),K(t,wl)}))},Rs=e=>{let{element:t,parent:n,triggers:i}=e;K(t,Ls),Ls.defaultPrevented||(q.set(t,an,17),n&&q.set(n,an,17),me(t,{height:`${t.scrollHeight}px`}),X(t,Ie),X(t,$),L(t,Rt),kt(t),me(t,{height:"0px"}),ue(t,()=>{q.clear(t),n&&q.clear(n),i.forEach(s=>Ee(s,Mn,"false")),X(t,Rt),L(t,Ie),me(t,{height:""}),K(t,Tl)}))},Ps=(e,t)=>{let n=t?Te:xe,{triggers:i}=e;i.length&&i.forEach(s=>n(s,ye,Sl))},Sl=e=>{let{target:t}=e,n=t&&we(t,ko),i=n&&Me(n),s=i&&Rn(i);s&&s.toggle(),n&&n.tagName==="A"&&e.preventDefault()},Dt=class extends He{constructor(t,n){super(t,n);let{element:i,options:s}=this,r=Q(i);this.triggers=[...Be(ko,r)].filter(l=>Me(l)===i),this.parent=ie(s.parent)?s.parent:dn(s.parent)?Me(i)||he(s.parent,r):null,Ps(this,!0)}get name(){return Po}get defaults(){return yl}toggle(){_(this.element,$)?this.hide():this.show()}hide(){let{triggers:t,element:n}=this;q.get(n)||(Rs(this),t.length&&t.forEach(i=>L(i,`${Ie}d`)))}show(){let{element:t,parent:n,triggers:i}=this,s,r;n&&(s=[...Be(`.${Ie}.${$}`,n)].find(l=>Rn(l)),r=s&&Rn(s)),(!n||!q.get(n))&&!q.get(t)&&(r&&s!==t&&(Rs(r),r.triggers.forEach(l=>{L(l,`${Ie}d`)})),xl(this),i.length&&i.forEach(l=>X(l,`${Ie}d`)))}dispose(){Ps(this),super.dispose()}};M(Dt,"selector",bl),M(Dt,"init",El),M(Dt,"getInstance",Rn);var Pt=["dropdown","dropup","dropstart","dropend"],Fo="Dropdown",qo="dropdown-menu",$o=e=>{let t=we(e,"A");return e.tagName==="A"&&Ln(e,"href")&&ze(e,"href").slice(-1)==="#"||t&&Ln(t,"href")&&ze(t,"href").slice(-1)==="#"},[We,Ii,Mi,_i]=Pt,Vo=`[${Ye}="${We}"]`,Kt=e=>Ae(e,Fo),Dl=e=>new Ct(e),Cl=`${qo}-end`,ks=[We,Ii],Fs=[Mi,_i],qs=["A","BUTTON"],Al={offset:5,display:"dynamic"},mi=ee(`show.bs.${We}`),$s=ee(`shown.bs.${We}`),vi=ee(`hide.bs.${We}`),Vs=ee(`hidden.bs.${We}`),Bo=ee(`updated.bs.${We}`),Wo=e=>{let{element:t,menu:n,parentElement:i,options:s}=e,{offset:r}=s;if(Ne(n,"position")!=="static"){let l=pt(t),u=_(n,Cl);["margin","top","bottom","left","right"].forEach(a=>{let c={};c[a]="",me(n,c)});let d=Pt.find(a=>_(i,a))||We,f={dropdown:[r,0,0],dropup:[0,0,r],dropstart:l?[-1,0,0,r]:[-1,r,0],dropend:l?[-1,r,0]:[-1,0,0,r]},m={dropdown:{top:"100%"},dropup:{top:"auto",bottom:"100%"},dropstart:l?{left:"100%",right:"auto"}:{left:"auto",right:"100%"},dropend:l?{left:"auto",right:"100%"}:{left:"100%",right:"auto"},menuStart:l?{right:"0",left:"auto"}:{right:"auto",left:"0"},menuEnd:l?{right:"auto",left:"0"}:{right:"0",left:"auto"}},{offsetWidth:p,offsetHeight:E}=n,{clientWidth:x,clientHeight:C}=st(t),{left:T,top:H,width:V,height:z}=un(t),k=T-p-r<0,I=T+p+V+r>=x,ae=H+E+r>=C,Y=H+E+z+r>=C,U=H-E-r<0,Z=(!l&&u||l&&!u)&&T+V-p<0,F=(l&&u||!l&&!u)&&T+p>=x;if(Fs.includes(d)&&k&&I&&(d=We),d===Mi&&(l?I:k)&&(d=_i),d===_i&&(l?k:I)&&(d=Mi),d===Ii&&U&&!Y&&(d=We),d===We&&Y&&!U&&(d=Ii),Fs.includes(d)&&ae&&nt(m[d],{top:"auto",bottom:0}),ks.includes(d)&&(Z||F)){let a={left:"auto",right:"auto"};!Z&&F&&!l&&(a={left:"auto",right:0}),Z&&!F&&l&&(a={left:0,right:"auto"}),a&&nt(m[d],a)}let o=f[d];me(n,{...m[d],margin:`${o.map(a=>a&&`${a}px`).join(" ")}`}),ks.includes(d)&&u&&u&&me(n,m[!l&&Z||l&&F?"menuStart":"menuEnd"]),K(i,Bo)}},Ol=e=>[...e.children].map(t=>{if(t&&qs.includes(t.tagName))return t;let{firstElementChild:n}=t;return n&&qs.includes(n.tagName)?n:null}).filter(t=>t),Bs=e=>{let{element:t,options:n}=e,i=e.open?Te:xe,s=Q(t);i(s,ye,js),i(s,Li,js),i(s,qn,Il),i(s,Na,Ml),n.display==="dynamic"&&[Bn,Vn].forEach(r=>{i(Gt(t),r,_l,je)})},Ws=(e,t)=>{(t?Te:xe)(e.element,ye,Nl)},Xn=e=>{let t=[...Pt,"btn-group","input-group"].map(n=>Ze(`${n} ${$}`,Q(e))).find(n=>n.length);if(t&&t.length)return[...t[0].children].find(n=>Pt.some(i=>i===ze(n,Ye)))},js=e=>{let{target:t,type:n}=e;if(t&&ie(t)){let i=Xn(t),s=i&&Kt(i);if(s){let{parentElement:r,menu:l}=s,u=r&&r.contains(t)&&(t.tagName==="form"||we(t,"form")!==null);[ye,So].includes(n)&&$o(t)&&e.preventDefault(),!u&&n!==Li&&t!==i&&t!==l&&s.hide()}}},Nl=e=>{let{target:t}=e,n=t&&we(t,Vo),i=n&&Kt(n);i&&(e.stopPropagation(),i.toggle(),n&&$o(n)&&e.preventDefault())},Il=e=>{[Ti,xi].includes(e.code)&&e.preventDefault()};function Ml(e){let{code:t}=e,n=Xn(this),i=n&&Kt(n),{activeElement:s}=n&&Q(n);if(i&&s){let{menu:r,open:l}=i,u=Ol(r);if(u&&u.length&&[Ti,xi].includes(t)){let d=u.indexOf(s);s===n?d=0:t===xi?d=d>1?d-1:0:t===Ti&&(d=d{u.relatedTarget=t}),K(s,mi),mi.defaultPrevented||(L(i,$),L(s,$),Ee(t,Mn,"true"),Wo(this),this.open=!n,it(t),Bs(this),K(s,$s))}}hide(){let{element:t,open:n,menu:i,parentElement:s}=this;n&&([vi,Vs].forEach(r=>{r.relatedTarget=t}),K(s,vi),vi.defaultPrevented||(X(i,$),X(s,$),Ee(t,Mn,"false"),this.open=!n,Bs(this),K(s,Vs)))}dispose(){this.open&&this.hide(),Ws(this),super.dispose()}};M(Ct,"selector",Vo),M(Ct,"init",Dl),M(Ct,"getInstance",Kt);var Le="modal",Vi="Modal",Bi="Offcanvas",Hl="fixed-top",Ll="fixed-bottom",jo="sticky-top",Uo="position-sticky",Xo=e=>[...Ze(Hl,e),...Ze(Ll,e),...Ze(jo,e),...Ze(Uo,e),...Ze("is-fixed",e)],Rl=e=>{let t=mt(e);me(t,{paddingRight:"",overflow:""});let n=Xo(t);n.length&&n.forEach(i=>{me(i,{paddingRight:"",marginRight:""})})},zo=e=>{let{clientWidth:t}=st(e),{innerWidth:n}=Gt(e);return Math.abs(n-t)},Yo=(e,t)=>{let n=mt(e),i=parseInt(Ne(n,"paddingRight"),10),s=Ne(n,"overflow")==="hidden"&&i?0:zo(e),r=Xo(n);t&&(me(n,{overflow:"hidden",paddingRight:`${i+s}px`}),r.length&&r.forEach(l=>{let u=Ne(l,"paddingRight");if(l.style.paddingRight=`${parseInt(u,10)+s}px`,[jo,Uo].some(d=>_(l,d))){let d=Ne(l,"marginRight");l.style.marginRight=`${parseInt(d,10)-s}px`}}))},qe="offcanvas",gt=ht({tagName:"div",className:"popup-container"}),Go=(e,t)=>{let n=pe(t)&&t.nodeName==="BODY",i=pe(t)&&!n?t:gt,s=n?t:mt(e);pe(e)&&(i===gt&&s.append(gt),i.append(e))},Ko=(e,t)=>{let n=pe(t)&&t.nodeName==="BODY",i=pe(t)&&!n?t:gt;pe(e)&&(e.remove(),i===gt&&!gt.children.length&>.remove())},Wi=(e,t)=>{let n=pe(t)&&t.nodeName!=="BODY"?t:gt;return pe(e)&&n.contains(e)},Jo="backdrop",Us=`${Le}-${Jo}`,Xs=`${qe}-${Jo}`,Qo=`.${Le}.${$}`,ji=`.${qe}.${$}`,fe=ht("div"),Ft=e=>he(`${Qo},${ji}`,Q(e)),Ui=e=>{let t=e?Us:Xs;[Us,Xs].forEach(n=>{X(fe,n)}),L(fe,t)},Zo=(e,t,n)=>{Ui(n),Go(fe,mt(e)),t&&L(fe,Se)},er=()=>{_(fe,$)||(L(fe,$),kt(fe))},zn=()=>{X(fe,$)},tr=e=>{Ft(e)||(X(fe,Se),Ko(fe,mt(e)),Rl(e))},nr=e=>ie(e)&&Ne(e,"visibility")!=="hidden"&&e.offsetParent!==null,Pl=`.${Le}`,ir=`[${Ye}="${Le}"]`,kl=`[${jn}="${Le}"]`,sr=`${Le}-static`,Fl={backdrop:!0,keyboard:!0},fn=e=>Ae(e,Vi),ql=e=>new At(e),Nn=ee(`show.bs.${Le}`),zs=ee(`shown.bs.${Le}`),bi=ee(`hide.bs.${Le}`),Ys=ee(`hidden.bs.${Le}`),or=e=>{let{element:t}=e,n=zo(t),{clientHeight:i,scrollHeight:s}=st(t),{clientHeight:r,scrollHeight:l}=t,u=r!==l;if(!u&&n){let d=pt(t)?"paddingLeft":"paddingRight",f={};f[d]=`${n}px`,me(t,f)}Yo(t,u||i!==s)},rr=(e,t)=>{let n=t?Te:xe,{element:i,update:s}=e;n(i,ye,Bl),n(Gt(i),Vn,s,je),n(Q(i),qn,Vl)},Gs=(e,t)=>{let n=t?Te:xe,{triggers:i}=e;i.length&&i.forEach(s=>n(s,ye,$l))},Ks=e=>{let{triggers:t,element:n,relatedTarget:i}=e;tr(n),me(n,{paddingRight:"",display:""}),rr(e);let s=Nn.relatedTarget||t.find(nr);s&&it(s),Ys.relatedTarget=i,K(n,Ys)},Js=e=>{let{element:t,relatedTarget:n}=e;it(t),rr(e,!0),zs.relatedTarget=n,K(t,zs)},Qs=e=>{let{element:t,hasFade:n}=e;me(t,{display:"block"}),or(e),Ft(t)||me(mt(t),{overflow:"hidden"}),L(t,$),Lt(t,kn),Ee(t,Fn,"true"),n?ue(t,()=>Js(e)):Js(e)},Zs=e=>{let{element:t,options:n,hasFade:i}=e;n.backdrop&&i&&_(fe,$)&&!Ft(t)?(zn(),ue(fe,()=>Ks(e))):Ks(e)},$l=e=>{let{target:t}=e,n=t&&we(t,ir),i=n&&Me(n),s=i&&fn(i);s&&(n&&n.tagName==="A"&&e.preventDefault(),s.relatedTarget=n,s.toggle())},Vl=({code:e,target:t})=>{let n=he(Qo,Q(t)),i=n&&fn(n);if(i){let{options:s}=i;s.keyboard&&e===Fi&&_(n,$)&&(i.relatedTarget=null,i.hide())}};function Bl(e){var t,n;let i=fn(this);if(i&&!q.get(this)){let{options:s,isStatic:r,modalDialog:l}=i,{backdrop:u}=s,{target:d}=e,f=(n=(t=Q(this))==null?void 0:t.getSelection())==null?void 0:n.toString().length,m=l.contains(d),p=d&&we(d,kl);r&&!m?q.set(this,()=>{L(this,sr),ue(l,()=>Wl(i))},17):(p||!f&&!r&&!m&&u)&&(i.relatedTarget=p||null,i.hide(),e.preventDefault())}}var Wl=e=>{let{element:t,modalDialog:n}=e,i=(Xt(n)||0)+17;X(t,sr),q.set(t,()=>q.clear(t),i)},At=class extends He{constructor(t,n){super(t,n),M(this,"update",()=>{_(this.element,$)&&or(this)});let{element:i}=this,s=he(`.${Le}-dialog`,i);s&&(this.modalDialog=s,this.triggers=[...Be(ir,Q(i))].filter(r=>Me(r)===i),this.isStatic=this.options.backdrop==="static",this.hasFade=_(i,Se),this.relatedTarget=null,Gs(this,!0))}get name(){return Vi}get defaults(){return Fl}toggle(){_(this.element,$)?this.hide():this.show()}show(){let{element:t,options:n,hasFade:i,relatedTarget:s}=this,{backdrop:r}=n,l=0;if(!_(t,$)&&(Nn.relatedTarget=s||void 0,K(t,Nn),!Nn.defaultPrevented)){let u=Ft(t);if(u&&u!==t){let d=fn(u)||Ae(u,Bi);d&&d.hide()}r?(Wi(fe)?Ui(!0):Zo(t,i,!0),l=Xt(fe),er(),setTimeout(()=>Qs(this),l)):(Qs(this),u&&_(fe,$)&&zn())}}hide(){let{element:t,hasFade:n,relatedTarget:i}=this;_(t,$)&&(bi.relatedTarget=i||void 0,K(t,bi),bi.defaultPrevented||(X(t,$),Ee(t,kn,"true"),Lt(t,Fn),n?ue(t,()=>Zs(this)):Zs(this)))}dispose(){let t={...this},{element:n,modalDialog:i}=t,s=()=>setTimeout(()=>super.dispose(),17);Gs(t),this.hide(),_(n,"fade")?ue(i,s):s()}};M(At,"selector",Pl),M(At,"init",ql),M(At,"getInstance",fn);var jl=`.${qe}`,Xi=`[${Ye}="${qe}"]`,Ul=`[${jn}="${qe}"]`,Yn=`${qe}-toggling`,Xl={backdrop:!0,keyboard:!0,scroll:!1},gn=e=>Ae(e,Bi),zl=e=>new Ot(e),In=ee(`show.bs.${qe}`),ar=ee(`shown.bs.${qe}`),yi=ee(`hide.bs.${qe}`),lr=ee(`hidden.bs.${qe}`),Yl=e=>{let{element:t}=e,{clientHeight:n,scrollHeight:i}=st(t);Yo(t,n!==i)},eo=(e,t)=>{let n=t?Te:xe;e.triggers.forEach(i=>n(i,ye,Kl))},cr=(e,t)=>{let n=t?Te:xe,i=Q(e.element);n(i,qn,Ql),n(i,ye,Jl)},to=e=>{let{element:t,options:n}=e;n.scroll||(Yl(e),me(mt(t),{overflow:"hidden"})),L(t,Yn),L(t,$),me(t,{visibility:"visible"}),ue(t,()=>Zl(e))},Gl=e=>{let{element:t,options:n}=e,i=Ft(t);t.blur(),!i&&n.backdrop&&_(fe,$)?(zn(),ue(fe,()=>no(e))):no(e)},Kl=e=>{let t=we(e.target,Xi),n=t&&Me(t),i=n&&gn(n);i&&(i.relatedTarget=t,i.toggle(),t&&t.tagName==="A"&&e.preventDefault())},Jl=e=>{let{target:t}=e,n=he(ji,Q(t)),i=he(Ul,n),s=n&&gn(n);if(s){let{options:r,triggers:l}=s,{backdrop:u}=r,d=we(t,Xi),f=Q(n).getSelection();(!fe.contains(t)||u!=="static")&&(!(f&&f.toString().length)&&(!n.contains(t)&&u&&(!d||l.includes(t))||i&&i.contains(t))&&(s.relatedTarget=i&&i.contains(t)?i:null,s.hide()),d&&d.tagName==="A"&&e.preventDefault())}},Ql=({code:e,target:t})=>{let n=he(ji,Q(t)),i=n&&gn(n);i&&i.options.keyboard&&e===Fi&&(i.relatedTarget=null,i.hide())},Zl=e=>{let{element:t}=e;X(t,Yn),Lt(t,kn),Ee(t,Fn,"true"),Ee(t,"role","dialog"),K(t,ar),cr(e,!0),it(t)},no=e=>{let{element:t,triggers:n}=e;Ee(t,kn,"true"),Lt(t,Fn),Lt(t,"role"),me(t,{visibility:""});let i=In.relatedTarget||n.find(nr);i&&it(i),tr(t),K(t,lr),X(t,Yn),Ft(t)||cr(e)},Ot=class extends He{constructor(t,n){super(t,n);let{element:i}=this;this.triggers=[...Be(Xi,Q(i))].filter(s=>Me(s)===i),this.relatedTarget=null,eo(this,!0)}get name(){return Bi}get defaults(){return Xl}toggle(){_(this.element,$)?this.hide():this.show()}show(){let{element:t,options:n,relatedTarget:i}=this,s=0;if(!_(t,$)&&(In.relatedTarget=i||void 0,ar.relatedTarget=i||void 0,K(t,In),!In.defaultPrevented)){let r=Ft(t);if(r&&r!==t){let l=gn(r)||Ae(r,Vi);l&&l.hide()}n.backdrop?(Wi(fe)?Ui():Zo(t,!0),s=Xt(fe),er(),setTimeout(()=>to(this),s)):(to(this),r&&_(fe,$)&&zn())}}hide(){let{element:t,relatedTarget:n}=this;_(t,$)&&(yi.relatedTarget=n||void 0,lr.relatedTarget=n||void 0,K(t,yi),yi.defaultPrevented||(L(t,Yn),X(t,$),Gl(this)))}dispose(){let t={...this},{element:n,options:i}=t,s=i.backdrop?Xt(fe):0,r=()=>setTimeout(()=>super.dispose(),s+17);eo(t),this.hide(),_(n,$)?ue(n,r):r()}};M(Ot,"selector",jl),M(Ot,"init",zl),M(Ot,"getInstance",gn);var Nt="popover",Gn="Popover",tt="tooltip",dr=e=>{let t=e===tt,n=t?`${e}-inner`:`${e}-body`,i=t?"":`

`,s=`
`,r=`
`;return`
${i+s+r}
`},ur={top:"top",bottom:"bottom",left:"start",right:"end"},zi=e=>{let t=/\b(top|bottom|start|end)+/,{element:n,tooltip:i,container:s,options:r,arrow:l}=e;if(i){let u={...ur},d=pt(n);me(i,{top:"",left:"",right:"",bottom:""});let f=e.name===Gn,{offsetWidth:m,offsetHeight:p}=i,{clientWidth:E,clientHeight:x,offsetWidth:C}=st(n),{placement:T}=r,{clientWidth:H,offsetWidth:V}=s,z=Ne(s,"position")==="fixed",k=Math.abs(z?H-V:E-C),I=d&&z?k:0,ae=E-(d?0:k)-1,{width:Y,height:U,left:Z,right:F,top:o}=un(n,!0),{x:a,y:c}={x:Z,y:o};me(l,{top:"",left:"",right:"",bottom:""});let h=0,g="",b=0,v="",y="",S="",D="",W=l.offsetWidth||0,O=l.offsetHeight||0,A=W/2,te=o-p-O<0,G=o+p+U+O>=x,J=Z-m-W=ae,j=["left","right"],le=["top","bottom"];te=j.includes(T)?o+U/2-p/2-O<0:te,G=j.includes(T)?o+p/2+U/2+O>=x:G,J=le.includes(T)?Z+Y/2-m/2=ae:N,T=j.includes(T)&&J&&N?"top":T,T=T==="top"&&te?"bottom":T,T=T==="bottom"&&G?"top":T,T=T==="left"&&J?"right":T,T=T==="right"&&N?"left":T,i.className.includes(T)||(i.className=i.className.replace(t,u[T])),j.includes(T)?(T==="left"?b=a-m-(f?W:0):b=a+Y+(f?W:0),te&&G?(h=0,g=0,y=o+U/2-O/2):te?(h=c,g="",y=U/2-W):G?(h=c-p+U,g="",y=p-U/2-W):(h=c-p/2+U/2,y=p/2-O/2)):le.includes(T)&&(T==="top"?h=c-p-(f?O:0):h=c+U+(f?O:0),J?(b=0,S=a+Y/2-A):N?(b="auto",v=0,D=Y/2+ae-F-A):(b=a-m/2+Y/2,S=m/2-A)),me(i,{top:`${h}px`,bottom:g===""?"":`${g}px`,left:b==="auto"?b:`${b}px`,right:v!==""?`${v}px`:""}),ie(l)&&(y!==""&&(l.style.top=`${y}px`),S!==""?l.style.left=`${S}px`:D!==""&&(l.style.right=`${D}px`));let Et=ee(`updated.bs.${zt(e.name)}`);K(n,Et)}},Hi={template:dr(tt),title:"",customClass:"",trigger:"hover focus",placement:"top",sanitizeFn:void 0,animation:!0,delay:200,container:document.body,content:"",dismissible:!1,btnClose:""},hr="data-original-title",It="Tooltip",dt=(e,t,n)=>{if(dn(t)&&t.length){let i=t.trim();Ya(n)&&(i=n(i));let s=new DOMParser().parseFromString(i,"text/html");e.append(...s.body.childNodes)}else ie(t)?e.append(t):(Ga(t)||za(t)&&t.every(pe))&&e.append(...t)},ec=e=>{let t=e.name===It,{id:n,element:i,options:s}=e,{title:r,placement:l,template:u,animation:d,customClass:f,sanitizeFn:m,dismissible:p,content:E,btnClose:x}=s,C=t?tt:Nt,T={...ur},H=[],V=[];pt(i)&&(T.left="end",T.right="start");let z=`bs-${C}-${T[l]}`,k;if(ie(u))k=u;else{let ae=ht("div");dt(ae,u,m),k=ae.firstChild}e.tooltip=ie(k)?k.cloneNode(!0):void 0;let{tooltip:I}=e;if(I){Ee(I,"id",n),Ee(I,"role",tt);let ae=t?`${tt}-inner`:`${Nt}-body`,Y=t?null:he(`.${Nt}-header`,I),U=he(`.${ae}`,I);e.arrow=he(`.${C}-arrow`,I);let{arrow:Z}=e;if(ie(r))H=[r.cloneNode(!0)];else{let F=ht("div");dt(F,r,m),H=[...F.childNodes]}if(ie(E))V=[E.cloneNode(!0)];else{let F=ht("div");dt(F,E,m),V=[...F.childNodes]}if(p)if(r)if(ie(x))H=[...H,x.cloneNode(!0)];else{let F=ht("div");dt(F,x,m),H=[...H,F.firstChild]}else if(Y&&Y.remove(),ie(x))V=[...V,x.cloneNode(!0)];else{let F=ht("div");dt(F,x,m),V=[...V,F.firstChild]}t?r&&U&&dt(U,r,m):(r&&Y&&dt(Y,H,m),E&&U&&dt(U,V,m),e.btn=he(".btn-close",I)||void 0),L(I,"position-fixed"),L(Z,"position-absolute"),_(I,C)||L(I,C),d&&!_(I,Se)&&L(I,Se),f&&!_(I,f)&&L(I,f),_(I,z)||L(I,z)}},tc=e=>{let t=["HTML","BODY"],n=[],{parentNode:i}=e;for(;i&&!t.includes(i.nodeName);)i=Xa(i),Ao(i)||Ka(i)||n.push(i);return n.find((s,r)=>Ne(s,"position")!=="relative"&&n.slice(r+1).every(l=>Ne(l,"position")==="static")?s:null)||Q(e).body},nc=`[${Ye}="${tt}"],[data-tip="${tt}"]`,fr="title",gr=e=>Ae(e,It),ic=e=>new et(e),sc=e=>{let{element:t,tooltip:n,container:i,offsetParent:s}=e;Lt(t,To),Ko(n,i===s?i:s)},sn=e=>{let{tooltip:t,container:n,offsetParent:i}=e;return t&&Wi(t,n===i?n:i)},oc=(e,t)=>{let{element:n}=e;rn(e),Ln(n,hr)&&e.name===It&&mr(e),t&&t()},pr=(e,t)=>{let n=t?Te:xe,{element:i}=e;n(Q(i),ki,e.handleTouch,je),[Bn,Vn].forEach(s=>{n(Gt(i),s,e.update,je)})},io=e=>{let{element:t}=e,n=ee(`shown.bs.${zt(e.name)}`);pr(e,!0),K(t,n),q.clear(t,"in")},so=e=>{let{element:t}=e,n=ee(`hidden.bs.${zt(e.name)}`);pr(e),sc(e),K(t,n),q.clear(t,"out")},rn=(e,t)=>{let n=t?Te:xe,{element:i,options:s,btn:r}=e,{trigger:l}=s,u=!!(e.name!==It&&s.dismissible);l.includes("manual")||(e.enabled=!!t,l.split(" ").forEach(d=>{d===Ia?(n(i,So,e.handleShow),n(i,$n,e.handleShow),u||(n(i,Pi,e.handleHide),n(Q(i),ki,e.handleTouch,je))):d===ye?n(i,d,u?e.handleShow:e.toggle):d===Li&&(n(i,Ri,e.handleShow),u||n(i,xo,e.handleHide),qa&&n(i,ye,e.handleFocus)),u&&r&&n(r,ye,e.handleHide)}))},oo=(e,t)=>{let n=t?Te:xe,{element:i,container:s,offsetParent:r}=e,{offsetHeight:l,scrollHeight:u}=s,d=we(i,`.${Le}`),f=we(i,`.${qe}`),m=Gt(i),p=s===r&&l!==u?s:m;n(p,Vn,e.update,je),n(p,Bn,e.update,je),d&&n(d,`hide.bs.${Le}`,e.handleHide),f&&n(f,`hide.bs.${qe}`,e.handleHide)},mr=(e,t)=>{let n=[hr,fr],{element:i}=e;Ee(i,n[t?0:1],t||ze(i,n[0])||""),Lt(i,n[t?1:0])},et=class extends He{constructor(t,n){super(t,n),M(this,"handleFocus",()=>it(this.element)),M(this,"handleShow",()=>this.show()),M(this,"handleHide",()=>this.hide()),M(this,"update",()=>{zi(this)}),M(this,"toggle",()=>{let{tooltip:d}=this;d&&!sn(this)?this.show():this.hide()}),M(this,"handleTouch",({target:d})=>{let{tooltip:f,element:m}=this;f&&f.contains(d)||d===m||d&&m.contains(d)||this.hide()});let{element:i}=this,s=this.name===It,r=s?tt:Nt,l=s?It:Gn;gr=d=>Ae(d,l),this.enabled=!0,this.id=`${r}-${Oo(i,r)}`;let{options:u}=this;!u.title&&s||!s&&!u.content||(nt(Hi,{titleAttr:""}),Ln(i,fr)&&s&&typeof u.title=="string"&&mr(this,u.title),this.container=tc(i),this.offsetParent=["sticky","fixed"].some(d=>Ne(this.container,"position")===d)?this.container:Q(this.element).body,ec(this),rn(this,!0))}get name(){return It}get defaults(){return Hi}show(){let{options:t,tooltip:n,element:i,container:s,offsetParent:r,id:l}=this,{animation:u}=t,d=q.get(i,"out"),f=s===r?s:r;q.clear(i,"out"),n&&!d&&!sn(this)&&q.set(i,()=>{let m=ee(`show.bs.${zt(this.name)}`);K(i,m),m.defaultPrevented||(Go(n,f),Ee(i,To,`#${l}`),this.update(),oo(this,!0),_(n,$)||L(n,$),u?ue(n,()=>io(this)):io(this))},17,"in")}hide(){let{options:t,tooltip:n,element:i}=this,{animation:s,delay:r}=t;q.clear(i,"in"),n&&sn(this)&&q.set(i,()=>{let l=ee(`hide.bs.${zt(this.name)}`);K(i,l),l.defaultPrevented||(this.update(),X(n,$),oo(this),s?ue(n,()=>so(this)):so(this))},r+17,"out")}enable(){let{enabled:t}=this;t||(rn(this,!0),this.enabled=!t)}disable(){let{tooltip:t,options:n,enabled:i}=this,{animation:s}=n;i&&(t&&sn(this)&&s?(this.hide(),ue(t,()=>rn(this))):rn(this),this.enabled=!i)}toggleEnabled(){this.enabled?this.disable():this.enable()}dispose(){let{tooltip:t,options:n}=this,i={...this,name:this.name},s=()=>setTimeout(()=>oc(i,()=>super.dispose()),17);n.animation&&sn(i)?(this.options.delay=0,this.hide(),ue(t,s)):s()}};M(et,"selector",nc),M(et,"init",ic),M(et,"getInstance",gr),M(et,"styleTip",zi);var rc=`[${Ye}="${Nt}"],[data-tip="${Nt}"]`,ac=nt({},Hi,{template:dr(Nt),content:"",dismissible:!1,btnClose:''}),lc=e=>Ae(e,Gn),cc=e=>new Xe(e),Xe=class extends et{constructor(t,n){super(t,n),M(this,"show",()=>{super.show();let{options:i,btn:s}=this;i.dismissible&&s&&setTimeout(()=>it(s),17)})}get name(){return Gn}get defaults(){return ac}};M(Xe,"selector",rc),M(Xe,"init",cc),M(Xe,"getInstance",lc),M(Xe,"styleTip",zi);var dc="scrollspy",vr="ScrollSpy",uc='[data-bs-spy="scroll"]',hc={offset:10,target:null},fc=e=>Ae(e,vr),gc=e=>new Mt(e),ro=ee(`activate.bs.${dc}`),pc=e=>{let{target:t,scrollTarget:n,options:i,itemsLength:s,scrollHeight:r,element:l}=e,{offset:u}=i,d=qi(n),f=t&&$i("A",t),m=n?br(n):r;if(e.scrollTop=d?n.scrollY:n.scrollTop,f&&(m!==r||s!==f.length)){let p,E,x;e.items=[],e.offsets=[],e.scrollHeight=m,e.maxScroll=e.scrollHeight-mc(e),[...f].forEach(C=>{p=ze(C,"href"),E=p&&p.charAt(0)==="#"&&p.slice(-1)!=="#"&&he(p,Q(l)),E&&(e.items.push(C),x=un(E),e.offsets.push((d?x.top+e.scrollTop:E.offsetTop)-u))}),e.itemsLength=e.items.length}},br=e=>ie(e)?e.scrollHeight:st(e).scrollHeight,mc=({element:e,scrollTarget:t})=>qi(t)?t.innerHeight:un(e).height,yr=e=>{[...$i("A",e)].forEach(t=>{_(t,oe)&&X(t,oe)})},ao=(e,t)=>{let{target:n,element:i}=e;ie(n)&&yr(n),e.activeItem=t,L(t,oe);let s=[],r=t;for(;r!==mt(i);)r=r.parentElement,(_(r,"nav")||_(r,"dropdown-menu"))&&s.push(r);s.forEach(l=>{let u=l.previousElementSibling;u&&!_(u,oe)&&L(u,oe)}),ro.relatedTarget=t,K(i,ro)},lo=(e,t)=>{(t?Te:xe)(e.scrollTarget,Bn,e.refresh,je)},Mt=class extends He{constructor(t,n){super(t,n),M(this,"refresh",()=>{let{target:r}=this;if(ie(r)&&r.offsetHeight>0){pc(this);let{scrollTop:l,maxScroll:u,itemsLength:d,items:f,activeItem:m}=this;if(l>=u){let E=f[d-1];m!==E&&ao(this,E);return}let{offsets:p}=this;if(m&&l0){this.activeItem=null,r&&yr(r);return}f.forEach((E,x)=>{m!==E&&l>=p[x]&&(typeof p[x+1]>"u"||lAe(e,Er),vc=e=>new _t(e),Ei=ee(`show.bs.${pn}`),co=ee(`shown.bs.${pn}`),wi=ee(`hide.bs.${pn}`),uo=ee(`hidden.bs.${pn}`),ln=new Map,ho=e=>{let{tabContent:t,nav:n}=e;t&&_(t,Rt)&&(t.style.height="",X(t,Rt)),n&&q.clear(n)},fo=e=>{let{element:t,tabContent:n,content:i,nav:s}=e,{tab:r}=ie(s)&&ln.get(s)||{tab:null};if(n&&i&&_(i,Se)){let{currentHeight:l,nextHeight:u}=ln.get(t)||{currentHeight:0,nextHeight:0};l===u?ho(e):setTimeout(()=>{n.style.height=`${u}px`,kt(n),ue(n,()=>ho(e))},50)}else s&&q.clear(s);co.relatedTarget=r,K(t,co)},go=e=>{let{element:t,content:n,tabContent:i,nav:s}=e,{tab:r,content:l}=s&&ln.get(s)||{tab:null,content:null},u=0;if(i&&n&&_(n,Se)&&([l,n].forEach(d=>{ie(d)&&L(d,"overflow-hidden")}),u=ie(l)?l.scrollHeight:0),Ei.relatedTarget=r,uo.relatedTarget=t,K(t,Ei),!Ei.defaultPrevented){if(n&&L(n,oe),l&&X(l,oe),i&&n&&_(n,Se)){let d=n.scrollHeight;ln.set(t,{currentHeight:u,nextHeight:d,tab:null,content:null}),L(i,Rt),i.style.height=`${u}px`,kt(i),[l,n].forEach(f=>{f&&X(f,"overflow-hidden")})}n&&n&&_(n,Se)?setTimeout(()=>{L(n,$),ue(n,()=>{fo(e)})},1):(n&&L(n,$),fo(e)),r&&K(r,uo)}},po=e=>{let{nav:t}=e;if(!ie(t))return{tab:null,content:null};let n=Ze(oe,t),i=null;n.length===1&&!Pt.some(r=>_(n[0].parentElement,r))?[i]=n:n.length>1&&(i=n[n.length-1]);let s=ie(i)?Me(i):null;return{tab:i,content:s}},mo=e=>{if(!ie(e))return null;let t=we(e,`.${Pt.join(",.")}`);return t?he(`.${Pt[0]}-toggle`,t):null},vo=(e,t)=>{(t?Te:xe)(e.element,ye,bc)},bc=e=>{let t=Tr(e.target);t&&(e.preventDefault(),t.show())},_t=class extends He{constructor(t){super(t);let{element:n}=this,i=Me(n);if(i){let s=we(n,".nav"),r=we(i,".tab-content");this.nav=s,this.content=i,this.tabContent=r,this.dropdown=mo(n);let{tab:l}=po(this);if(s&&!l){let u=he(wr,s),d=u&&Me(u);d&&(L(u,oe),L(d,$),L(d,oe),Ee(n,ui,"true"))}vo(this,!0)}}get name(){return Er}show(){let{element:t,content:n,nav:i,dropdown:s}=this;if(!(i&&q.get(i))&&!_(t,oe)){let{tab:r,content:l}=po(this);if(i&&ln.set(i,{tab:r,content:l,currentHeight:0,nextHeight:0}),wi.relatedTarget=t,ie(r)&&(K(r,wi),!wi.defaultPrevented)){L(t,oe),Ee(t,ui,"true");let u=ie(r)&&mo(r);if(u&&_(u,oe)&&X(u,oe),i){let d=()=>{r&&(X(r,oe),Ee(r,ui,"false")),s&&!_(s,oe)&&L(s,oe)};l&&(_(l,Se)||n&&_(n,Se))?q.set(i,d,1):d()}l&&(X(l,$),_(l,Se)?ue(l,()=>go(this)):go(this))}}}dispose(){vo(this),super.dispose()}};M(_t,"selector",wr),M(_t,"init",vc),M(_t,"getInstance",Tr);var $e="toast",xr="Toast",yc=`.${$e}`,Ec=`[${jn}="${$e}"]`,Sr=`[${Ye}="${$e}"]`,Yt="showing",Dr="hide",wc={animation:!0,autohide:!0,delay:5e3},Yi=e=>Ae(e,xr),Tc=e=>new Ht(e),bo=ee(`show.bs.${$e}`),xc=ee(`shown.bs.${$e}`),yo=ee(`hide.bs.${$e}`),Sc=ee(`hidden.bs.${$e}`),Eo=e=>{let{element:t,options:n}=e;X(t,Yt),q.clear(t,Yt),K(t,xc),n.autohide&&q.set(t,()=>e.hide(),n.delay,$e)},wo=e=>{let{element:t}=e;X(t,Yt),X(t,$),L(t,Dr),q.clear(t,$e),K(t,Sc)},Dc=e=>{let{element:t,options:n}=e;L(t,Yt),n.animation?(kt(t),ue(t,()=>wo(e))):wo(e)},Cc=e=>{let{element:t,options:n}=e;q.set(t,()=>{X(t,Dr),kt(t),L(t,$),L(t,Yt),n.animation?ue(t,()=>Eo(e)):Eo(e)},17,Yt)},Cr=(e,t)=>{let n=t?Te:xe,{element:i,triggers:s,dismiss:r,options:l,hide:u}=e;r&&n(r,ye,u),l.autohide&&[Ri,xo,$n,Pi].forEach(d=>n(i,d,Nc)),s.length&&s.forEach(d=>n(d,ye,Oc))},Ac=e=>{q.clear(e.element,$e),Cr(e)},Oc=e=>{let{target:t}=e,n=t&&we(t,Sr),i=n&&Me(n),s=i&&Yi(i);s&&(n&&n.tagName==="A"&&e.preventDefault(),s.relatedTarget=n,s.show())},Nc=e=>{let t=e.target,n=Yi(t),{type:i,relatedTarget:s}=e;n&&t!==s&&!t.contains(s)&&([$n,Ri].includes(i)?q.clear(t,$e):q.set(t,()=>n.hide(),n.options.delay,$e))},Ht=class extends He{constructor(t,n){super(t,n),M(this,"show",()=>{let{element:r,isShown:l}=this;r&&!l&&(K(r,bo),bo.defaultPrevented||Cc(this))}),M(this,"hide",()=>{let{element:r,isShown:l}=this;r&&l&&(K(r,yo),yo.defaultPrevented||Dc(this))});let{element:i,options:s}=this;s.animation&&!_(i,Se)?L(i,Se):!s.animation&&_(i,Se)&&X(i,Se),this.dismiss=he(Ec,i),this.triggers=[...Be(Sr,Q(i))].filter(r=>Me(r)===i),Cr(this,!0)}get name(){return xr}get defaults(){return wc}get isShown(){return _(this.element,$)}dispose(){let{element:t,isShown:n}=this;n&&X(t,$),Ac(this),super.dispose()}};M(Ht,"selector",yc),M(Ht,"init",Tc),M(Ht,"getInstance",Yi);var Ar=new Map;[wt,Tt,St,Dt,Ct,At,Ot,Xe,Mt,_t,Ht,et].forEach(e=>Ar.set(e.prototype.name,e));var Ic=(e,t)=>{[...t].forEach(n=>e(n))};var Pn=e=>{let t=e&&e.nodeName?e:document,n=[...$i("*",t)];Ar.forEach(i=>{let{init:s,selector:r}=i;Ic(s,n.filter(l=>Io(l,r)))})};document.body?Pn():Te(document,"DOMContentLoaded",()=>Pn(),{once:!0});function Or(){document.body.addEventListener("htmx:configRequest",e=>{e.detail.headers["X-CSRF-Token"]=document.querySelector('meta[name="csrf-token"]').content})}function Nr(){let e="Select all",t="Deselect all",n=function(i){let s=i.target,l=s.closest("form").querySelectorAll("input[type='checkbox']"),u=s.textContent==e;l.forEach(d=>d.checked=u),s.textContent=u?t:e};document.querySelectorAll("button.form-check-all").forEach(i=>{i.addEventListener("click",n);let r=i.closest("form").querySelectorAll("input[type='checkbox']"),l=!0;for(let u=0;u{t.addEventListener("click",()=>{navigator.clipboard.writeText(t.dataset.clipboard).then(()=>{let n=t.querySelector(".if"),i=t.querySelector(".btn-text"),s=t.className,r=n.className,l=i.className,u=i.innerText;t.classList.remove("btn-outline-secondary"),t.classList.add("btn-outline-success"),n.classList.remove("if-copy","text-muted"),n.classList.add("if-check","text-success"),i.classList.remove("text-muted"),i.classList.add("text-success"),i.setAttribute("aria-live","polite"),i.innerText="Copied",setTimeout(function(){t.className=s,n.className=r,i.className=l,i.innerText=u},1500)})})})}function Mr(){let e=function(t){t.querySelectorAll("[data-bs-toggle=popover-custom]").forEach(function(n){let i=document.querySelector(n.dataset.popoverContent),s=i.querySelector(".popover-body"),r=i.querySelector(".popover-heading"),l="";r&&(l=r.innerHTML),new Xe(n,{content:s.innerHTML,title:l,delay:1e3})})};re.onLoad(e)}function _r(){class e{constructor(r){this.el=r,this.collapsers=r.querySelectorAll(".c-header-collapse-trigger"),this.collapsed=!1,this.init()}init(){try{let r=JSON.parse(localStorage.getItem(i));t=Object.assign({},t,r)}catch{console.warn("There was an error parsing the saved state for the prototype navigation.")}t.isExpanded?this.show():this.hide(),this.collapsers?.forEach(r=>r.addEventListener("click",this))}handleEvent(r){this.toggle(r)}toggle(r){this.collapsed?this.show():this.collapsed||this.hide()}show(){this.el.dataset.collapsed=!1,this.collapsed=!1,t.isExpanded=!0,this.saveNavState()}saveNavState(){localStorage.setItem(i,JSON.stringify(t))}hide(){this.el.dataset.collapsed=!0,this.collapsed=!0,t.isExpanded=!1,this.saveNavState()}}let t={isExpanded:!1},n=document.querySelectorAll(".c-header-collapsible"),i="bedrockheaderState";n.length&&[...n].map(s=>new e(s))}function Hr(){let e=/^data-tmpl-(.+)/,t=(i,s)=>{Array.from(i.getElementsByTagName("*")).forEach(function(r){if(r.hasAttributes()){let u=r.attributes;for(var l=0;l{let s=function(l){let u=l.target.closest("div.form-values");l.target.closest("div.form-value").remove();let d=Array.from(u.children).length;for(var f=0;f{C.classList.remove("is-invalid")}),t(p,m);let E=f.querySelector("button.form-value-add"),x=E.classList;x.remove("form-value-add"),x.remove("btn-outline-primary"),x.add("btn-link-muted"),x.add("form-value-delete"),x=f.querySelector("i.if-add").classList,x.remove("if-add"),x.add("if-delete"),f.querySelector(".form-value-delete .visually-hidden").textContent="Delete",E.removeEventListener("click",r),E.addEventListener("click",s),f.after(p),re.process(p),p.querySelector("button.form-value-add").addEventListener("click",r),p.dispatchEvent(new CustomEvent("form-value-add",{bubbles:!0}))};i.querySelectorAll("button.form-value-delete").forEach(l=>l.addEventListener("click",s)),i.querySelectorAll("button.form-value-add").forEach(l=>l.addEventListener("click",r))};re.onLoad(n)}function Lr(){document.querySelectorAll("form.form-change-submit").forEach(function(e){e.addEventListener("change",function(t){let n=e.querySelector(".spinner-border");n!==null&&(n.style.display="inline-block",n.style.opacity="1"),e.submit()})}),document.querySelectorAll("form .form-change-submit").forEach(function(e){e.addEventListener("change",function(t){t.target.closest("form").submit()})})}function Rr(){let e=function(t){t.querySelectorAll(".autocomplete").forEach(function(n){document.querySelector(n.dataset.target).addEventListener("keydown",function(s){s.key==="Escape"&&(n.querySelector(".autocomplete-hits").innerHTML="")})}),t.querySelectorAll(".autocomplete-hit").forEach(function(n){n.addEventListener("click",function(){let i=n.closest(".autocomplete").dataset.target,s=n.dataset.value;document.querySelector(i).value=s,n.closest(".autocomplete-hits").innerHTML=""})})};re.onLoad(function(t){e(t)}),document.addEventListener("form-value-add",function(t){e(t.target)})}function Pr(){let e=function(t){let n=document.querySelectorAll(".modal").item(0),i=document.querySelectorAll(".modal-backdrop").item(0);n&&n.classList.remove("show"),i&&i.classList.remove("show"),setTimeout(function(){i&&i.remove(),n&&n.remove()},100)};re.onLoad(function(t){t.querySelectorAll(".modal-close").forEach(function(n){n.addEventListener("click",e)})})}function kr(){let e=function(n){n.currentTarget.closest(".radio-card-group").querySelectorAll(".c-radio-card").forEach(function(r){r.setAttribute("aria-selected","false"),r.classList.remove("c-radio-card--selected")}),n.currentTarget.setAttribute("aria-selected","true"),n.currentTarget.classList.add("c-radio-card--selected")},t=function(n){n.querySelectorAll(".radio-card-group .c-radio-card").forEach(i=>i.addEventListener("click",e))};t(document),re.onLoad(t)}function Fr(){let e=function(t){t.querySelectorAll('.btn-close[data-bs-dismiss="toast"]').forEach(function(n){n.addEventListener("click",()=>{n.closest(".toast").remove()})})};re.onLoad(e)}function qr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function Je(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Hc(e,t){if(e==null)return{};var n=_c(e,t),i,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Lc="1.15.0";function rt(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var lt=rt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Sn=rt(/Edge/i),$r=rt(/firefox/i),yn=rt(/safari/i)&&!rt(/chrome/i)&&!rt(/android/i),Yr=rt(/iP(ad|od|hone)/i),Gr=rt(/chrome/i)&&rt(/android/i),Kr={capture:!1,passive:!1};function se(e,t,n){e.addEventListener(t,n,!lt&&Kr)}function ne(e,t,n){e.removeEventListener(t,n,!lt&&Kr)}function oi(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Rc(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Ge(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&oi(e,t):oi(e,t))||i&&e===n)return e;if(e===n)break}while(e=Rc(e))}return null}var Vr=/\s+/g;function Re(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(Vr," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(Vr," ")}}function R(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function tn(e,t){var n="";if(typeof e=="string")n=e;else do{var i=R(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function Jr(e,t,n){if(e){var i=e.getElementsByTagName(t),s=0,r=i.length;if(n)for(;s=r:l=s<=r,!l)return i;if(i===Ke())break;i=yt(i,!1)}return!1}function nn(e,t,n,i){for(var s=0,r=0,l=e.children;r2&&arguments[2]!==void 0?arguments[2]:{},s=i.evt,r=Hc(i,Wc);Dn.pluginEvent.bind(P)(t,n,Je({dragEl:w,parentEl:ge,ghostEl:B,rootEl:ce,nextEl:Vt,lastDownEl:ti,cloneEl:de,cloneHidden:bt,dragStarted:mn,putSortable:De,activeSortable:P.active,originalEvent:s,oldIndex:en,oldDraggableIndex:wn,newIndex:Pe,newDraggableIndex:vt,hideGhostForTarget:sa,unhideGhostForTarget:oa,cloneNowHidden:function(){bt=!0},cloneNowShown:function(){bt=!1},dispatchSortableEvent:function(u){Oe({sortable:n,name:u,originalEvent:s})}},r))};function Oe(e){Bc(Je({putSortable:De,cloneEl:de,targetEl:w,rootEl:ce,oldIndex:en,oldDraggableIndex:wn,newIndex:Pe,newDraggableIndex:vt},e))}var w,ge,B,ce,Vt,ti,de,bt,en,Pe,wn,vt,Kn,De,Zt=!1,ri=!1,ai=[],qt,Ue,Ji,Qi,jr,Ur,mn,Qt,Tn,xn=!1,Jn=!1,ni,Ce,Zi=[],ss=!1,li=[],di=typeof document<"u",Qn=Yr,Xr=Sn||lt?"cssFloat":"float",jc=di&&!Gr&&!Yr&&"draggable"in document.createElement("div"),ta=function(){if(di){if(lt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),na=function(t,n){var i=R(t),s=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=nn(t,0,n),l=nn(t,1,n),u=r&&R(r),d=l&&R(l),f=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+be(r).width,m=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+be(l).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&u.float&&u.float!=="none"){var p=u.float==="left"?"left":"right";return l&&(d.clear==="both"||d.clear===p)?"vertical":"horizontal"}return r&&(u.display==="block"||u.display==="flex"||u.display==="table"||u.display==="grid"||f>=s&&i[Xr]==="none"||l&&i[Xr]==="none"&&f+m>s)?"vertical":"horizontal"},Uc=function(t,n,i){var s=i?t.left:t.top,r=i?t.right:t.bottom,l=i?t.width:t.height,u=i?n.left:n.top,d=i?n.right:n.bottom,f=i?n.width:n.height;return s===u||r===d||s+l/2===u+f/2},Xc=function(t,n){var i;return ai.some(function(s){var r=s[ke].options.emptyInsertThreshold;if(!(!r||ls(s))){var l=be(s),u=t>=l.left-r&&t<=l.right+r,d=n>=l.top-r&&n<=l.bottom+r;if(u&&d)return i=s}}),i},ia=function(t){function n(r,l){return function(u,d,f,m){var p=u.options.group.name&&d.options.group.name&&u.options.group.name===d.options.group.name;if(r==null&&(l||p))return!0;if(r==null||r===!1)return!1;if(l&&r==="clone")return r;if(typeof r=="function")return n(r(u,d,f,m),l)(u,d,f,m);var E=(l?u:d).options.group.name;return r===!0||typeof r=="string"&&r===E||r.join&&r.indexOf(E)>-1}}var i={},s=t.group;(!s||ei(s)!="object")&&(s={name:s}),i.name=s.name,i.checkPull=n(s.pull,!0),i.checkPut=n(s.put),i.revertClone=s.revertClone,t.group=i},sa=function(){!ta&&B&&R(B,"display","none")},oa=function(){!ta&&B&&R(B,"display","")};di&&!Gr&&document.addEventListener("click",function(e){if(ri)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),ri=!1,!1},!0);var $t=function(t){if(w){t=t.touches?t.touches[0]:t;var n=Xc(t.clientX,t.clientY);if(n){var i={};for(var s in t)t.hasOwnProperty(s)&&(i[s]=t[s]);i.target=i.rootEl=n,i.preventDefault=void 0,i.stopPropagation=void 0,n[ke]._onDragOver(i)}}},zc=function(t){w&&w.parentNode[ke]._isOutsideThisEl(t.target)};function P(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=at({},t),e[ke]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return na(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,u){l.setData("Text",u.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:P.supportPointer!==!1&&"PointerEvent"in window&&!yn,emptyInsertThreshold:5};Dn.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);ia(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:jc,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?se(e,"pointerdown",this._onTapStart):(se(e,"mousedown",this._onTapStart),se(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(se(e,"dragover",this),se(e,"dragenter",this)),ai.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),at(this,qc())}P.prototype={constructor:P,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Qt=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,w):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,i=this.el,s=this.options,r=s.preventOnFilter,l=t.type,u=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,d=(u||t).target,f=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||d,m=s.filter;if(td(i),!w&&!(/mousedown|pointerdown/.test(l)&&t.button!==0||s.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&yn&&d&&d.tagName.toUpperCase()==="SELECT")&&(d=Ge(d,s.draggable,i,!1),!(d&&d.animated)&&ti!==d)){if(en=Ve(d),wn=Ve(d,s.draggable),typeof m=="function"){if(m.call(this,t,d,this)){Oe({sortable:n,rootEl:f,name:"filter",targetEl:d,toEl:i,fromEl:i}),_e("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(m&&(m=m.split(",").some(function(p){if(p=Ge(f,p.trim(),i,!1),p)return Oe({sortable:n,rootEl:p,name:"filter",targetEl:d,fromEl:i,toEl:i}),_e("filter",n,{evt:t}),!0}),m)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!Ge(f,s.handle,i,!1)||this._prepareDragStart(t,u,d)}}},_prepareDragStart:function(t,n,i){var s=this,r=s.el,l=s.options,u=r.ownerDocument,d;if(i&&!w&&i.parentNode===r){var f=be(i);if(ce=r,w=i,ge=w.parentNode,Vt=w.nextSibling,ti=i,Kn=l.group,P.dragged=w,qt={target:w,clientX:(n||t).clientX,clientY:(n||t).clientY},jr=qt.clientX-f.left,Ur=qt.clientY-f.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,w.style["will-change"]="all",d=function(){if(_e("delayEnded",s,{evt:t}),P.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!$r&&s.nativeDraggable&&(w.draggable=!0),s._triggerDragStart(t,n),Oe({sortable:s,name:"choose",originalEvent:t}),Re(w,l.chosenClass,!0)},l.ignore.split(",").forEach(function(m){Jr(w,m.trim(),es)}),se(u,"dragover",$t),se(u,"mousemove",$t),se(u,"touchmove",$t),se(u,"mouseup",s._onDrop),se(u,"touchend",s._onDrop),se(u,"touchcancel",s._onDrop),$r&&this.nativeDraggable&&(this.options.touchStartThreshold=4,w.draggable=!0),_e("delayStart",this,{evt:t}),l.delay&&(!l.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Sn||lt))){if(P.eventCanceled){this._onDrop();return}se(u,"mouseup",s._disableDelayedDrag),se(u,"touchend",s._disableDelayedDrag),se(u,"touchcancel",s._disableDelayedDrag),se(u,"mousemove",s._delayedDragTouchMoveHandler),se(u,"touchmove",s._delayedDragTouchMoveHandler),l.supportPointer&&se(u,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(d,l.delay)}else d()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){w&&es(w),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;ne(t,"mouseup",this._disableDelayedDrag),ne(t,"touchend",this._disableDelayedDrag),ne(t,"touchcancel",this._disableDelayedDrag),ne(t,"mousemove",this._delayedDragTouchMoveHandler),ne(t,"touchmove",this._delayedDragTouchMoveHandler),ne(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?se(document,"pointermove",this._onTouchMove):n?se(document,"touchmove",this._onTouchMove):se(document,"mousemove",this._onTouchMove):(se(w,"dragend",this),se(ce,"dragstart",this._onDragStart));try{document.selection?ii(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Zt=!1,ce&&w){_e("dragStarted",this,{evt:n}),this.nativeDraggable&&se(document,"dragover",zc);var i=this.options;!t&&Re(w,i.dragClass,!1),Re(w,i.ghostClass,!0),P.active=this,t&&this._appendGhost(),Oe({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Ue){this._lastX=Ue.clientX,this._lastY=Ue.clientY,sa();for(var t=document.elementFromPoint(Ue.clientX,Ue.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ue.clientX,Ue.clientY),t!==n);)n=t;if(w.parentNode[ke]._isOutsideThisEl(t),n)do{if(n[ke]){var i=void 0;if(i=n[ke]._onDragOver({clientX:Ue.clientX,clientY:Ue.clientY,target:t,rootEl:n}),i&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);oa()}},_onTouchMove:function(t){if(qt){var n=this.options,i=n.fallbackTolerance,s=n.fallbackOffset,r=t.touches?t.touches[0]:t,l=B&&tn(B,!0),u=B&&l&&l.a,d=B&&l&&l.d,f=Qn&&Ce&&Wr(Ce),m=(r.clientX-qt.clientX+s.x)/(u||1)+(f?f[0]-Zi[0]:0)/(u||1),p=(r.clientY-qt.clientY+s.y)/(d||1)+(f?f[1]-Zi[1]:0)/(d||1);if(!P.active&&!Zt){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))=0&&(Oe({rootEl:ge,name:"add",toEl:ge,fromEl:ce,originalEvent:t}),Oe({sortable:this,name:"remove",toEl:ge,originalEvent:t}),Oe({rootEl:ge,name:"sort",toEl:ge,fromEl:ce,originalEvent:t}),Oe({sortable:this,name:"sort",toEl:ge,originalEvent:t})),De&&De.save()):Pe!==en&&Pe>=0&&(Oe({sortable:this,name:"update",toEl:ge,originalEvent:t}),Oe({sortable:this,name:"sort",toEl:ge,originalEvent:t})),P.active&&((Pe==null||Pe===-1)&&(Pe=en,vt=wn),Oe({sortable:this,name:"end",toEl:ge,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){_e("nulling",this),ce=w=ge=B=Vt=de=ti=bt=qt=Ue=mn=Pe=vt=en=wn=Qt=Tn=De=Kn=P.dragged=P.ghost=P.clone=P.active=null,li.forEach(function(t){t.checked=!0}),li.length=Ji=Qi=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":w&&(this._onDragOver(t),Yc(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,i=this.el.children,s=0,r=i.length,l=this.options;si.right+s||e.clientX<=i.right&&e.clientY>i.bottom&&e.clientX>=i.left:e.clientX>i.right&&e.clientY>i.top||e.clientX<=i.right&&e.clientY>i.bottom+s}function Qc(e,t,n,i,s,r,l,u){var d=i?e.clientY:e.clientX,f=i?n.height:n.width,m=i?n.top:n.left,p=i?n.bottom:n.right,E=!1;if(!l){if(u&&nim+f*r/2:dp-ni)return-Tn}else if(d>m+f*(1-s)/2&&dp-f*r/2)?d>m+f/2?1:-1:0}function Zc(e){return Ve(w){for(var n=t.querySelectorAll(".sortable"),i=0;in.addEventListener("click",e))};t(),re.onLoad(function(n){t()})}function Cn(e){let t=document.querySelector("#modals");if(!t)return;let n=document.querySelector("template.template-modal-error");if(!n)return;let i=n.content.cloneNode(!0);i.querySelector(".modal-close").addEventListener("click",function(){t.innerHTML=""}),i.querySelector(".msg").textContent=e,t.innerHTML="",t.appendChild(i)}function ua(){re.onLoad(function(e){e.querySelectorAll("input[type=file].upload-progress").forEach(t=>{t.addEventListener("change",n=>{let i=Array.from(t.files);if(!i.length)return;let s=i[0],r=t.closest("form"),l=document.querySelector(r.dataset.target),u=JSON.parse(r.dataset.headers),d=parseInt(t.dataset.maxSize),f=t.dataset.maxSizeError;if(!isNaN(d)&&d>0&&t.files[0].size>d){n.preventDefault(),n.stopPropagation(),Cn(f),da(r);return}u["X-HTTP-Method-Override"]="POST",u["X-Upload-Filename"]=encodeURIComponent(s.name),u["Content-Type"]=s.type;let m=new XMLHttpRequest;m.upload.addEventListener("progress",p=>{p.lengthComputable&&us(r,Math.floor(p.loaded/p.total*100))},!1),m.addEventListener("readystatechange",p=>{m.readyState===XMLHttpRequest.DONE&&(da(r),m.status==200||m.status==201?re.swap(l,m.responseText,{swapStyle:"innerHTML"}):m.status==413?Cn(t.dataset.uploadMsgFileTooLarge):m.status==404?Cn(t.dataset.uploadMsgRecordNotFound):Cn(t.dataset.uploadMsgUnexpected))}),id(r),m.open(r.method,r.action);for(let p in u)m.setRequestHeader(p,u[p]);m.send(s)})})})}function id(e){us(e,0),e.querySelectorAll("input").forEach(t=>{t.disabled=!0}),e.querySelector(".file-upload-start").classList.add("d-none"),e.querySelector(".file-upload-busy").classList.remove("d-none")}function da(e){us(e,0),e.querySelectorAll("input").forEach(t=>{t.disabled=!1,t.value=""}),e.querySelector(".file-upload-start").classList.remove("d-none"),e.querySelector(".file-upload-busy").classList.add("d-none")}function us(e,t){let n=e.querySelector(".progress-bar");n.setAttribute("style","width: "+t+"%"),n.setAttribute("aria-valuenow",t);let i=e.querySelector(".progress-bar-percent");i.innerText=t}var fa=Sa(ha());function ga(){let e=function(t,n,i){t.innerHTML="";for(let s=0;s{t.querySelectorAll(".tags").forEach(n=>{let i=n.querySelector(".tags-real-values"),s=n.querySelector(".tags-widget-values"),{inputName:r}=s.dataset;{let f=s.value;try{f=JSON.parse(f),Array.isArray(f)&&e(i,r,f)}catch{}}let l=new fa.default(s,{delimiters:`;| -|\r`,duplicates:!1,pasteAsTags:!0,dropdown:{enabled:!1,caseSensitive:!0}});l.on("change",function(f){e(i,r,f.detail.tagify.value.map(m=>m.value))});let{originalInput:u,input:d}=l.DOM;if(u&&u.id&&d){let f=document.querySelector(`label[for="${u.id}"]`);f&&f.addEventListener("click",()=>{window.setTimeout(()=>d.focus(),0)})}})})}function ma(){document.querySelectorAll("[data-facet-dropdown]").forEach(e=>{let t=e.getAttribute("data-facet-dropdown"),n=e.querySelector("form");if(n){let i=null;e.addEventListener("show.bs.dropdown",function(){i=pa(n,t)}),e.addEventListener("shown.bs.dropdown",function(){n.querySelector("input[type=text]")?.focus()}),e.addEventListener("hidden.bs.dropdown",function(){let s=pa(n,t);i!==null&&i!==s&&n.submit(),i=null})}else console.log(`Could not find form element for facet '${t}'.`)})}function pa(e,t){return Array.from(new FormData(e).entries()).filter(([i])=>i===`f[${t}]`).map(([i,s])=>s).join(",")}re.config.defaultFocusScroll=!0;re.onLoad(Pn);window.htmx=re;va();document.addEventListener("DOMContentLoaded",function(){Or(),Nr(),Mr(),_r(),Hr(),Lr(),Rr(),Pr(),kr(),Fr(),la(),ca(),ua(),ga(),ma()});re.onLoad(function(e){Ir(e)});})(); -/*! For license information please see app-X5MYBGAE.js.LEGAL.txt */ -//# sourceMappingURL=app-X5MYBGAE.js.map +`,b(y))}else o+=y.textContent})}(this.DOM.input),o}},F.prototype.removeTag=F.prototype.removeTags,F})});var ba=ms(()=>{(function(){function e(t){var n=t.getAttribute("remove-me")||t.getAttribute("data-remove-me");n&&setTimeout(function(){t.parentElement.removeChild(t)},htmx.parseInterval(n))}htmx.defineExtension("remove-me",{onEvent:function(t,n){if(t==="htmx:afterProcessNode"){var i=n.detail.elt;if(i.getAttribute&&(e(i),i.querySelectorAll))for(var s=i.querySelectorAll("[remove-me], [data-remove-me]"),r=0;r]*>|>)([\\s\\S]*?)<\\/${e}>`,t?"gim":"im")}function parseInterval(e){if(e==null)return;let t=NaN;return e.slice(-2)=="ms"?t=parseFloat(e.slice(0,-2)):e.slice(-1)=="s"?t=parseFloat(e.slice(0,-1))*1e3:e.slice(-1)=="m"?t=parseFloat(e.slice(0,-1))*1e3*60:t=parseFloat(e),isNaN(t)?void 0:t}function getRawAttribute(e,t){return e instanceof Element&&e.getAttribute(t)}function hasAttribute(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function getAttributeValue(e,t){return getRawAttribute(e,t)||getRawAttribute(e,"data-"+t)}function parentElt(e){let t=e.parentElement;return!t&&e.parentNode instanceof ShadowRoot?e.parentNode:t}function getDocument(){return document}function getRootNode(e,t){return e.getRootNode?e.getRootNode({composed:t}):getDocument()}function getClosestMatch(e,t){for(;e&&!t(e);)e=parentElt(e);return e||null}function getAttributeValueWithDisinheritance(e,t,n){let i=getAttributeValue(t,n),s=getAttributeValue(t,"hx-disinherit");var r=getAttributeValue(t,"hx-inherit");if(e!==t){if(htmx.config.disableInheritance)return r&&(r==="*"||r.split(" ").indexOf(n)>=0)?i:null;if(s&&(s==="*"||s.split(" ").indexOf(n)>=0))return"unset"}return i}function getClosestAttributeValue(e,t){let n=null;if(getClosestMatch(e,function(i){return!!(n=getAttributeValueWithDisinheritance(e,asElement(i),t))}),n!=="unset")return n}function matches(e,t){let n=e instanceof Element&&(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector);return!!n&&n.call(e,t)}function getStartTag(e){let n=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(e);return n?n[1].toLowerCase():""}function parseHTML(e){return new DOMParser().parseFromString(e,"text/html")}function takeChildrenFor(e,t){for(;t.childNodes.length>0;)e.append(t.childNodes[0])}function duplicateScript(e){let t=getDocument().createElement("script");return forEach(e.attributes,function(n){t.setAttribute(n.name,n.value)}),t.textContent=e.textContent,t.async=!1,htmx.config.inlineScriptNonce&&(t.nonce=htmx.config.inlineScriptNonce),t}function isJavaScriptScriptNode(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function normalizeScriptTags(e){Array.from(e.querySelectorAll("script")).forEach(t=>{if(isJavaScriptScriptNode(t)){let n=duplicateScript(t),i=t.parentNode;try{i.insertBefore(n,t)}catch(s){logError(s)}finally{t.remove()}}})}function makeFragment(e){let t=e.replace(HEAD_TAG_REGEX,""),n=getStartTag(t),i;if(n==="html"){i=new DocumentFragment;let r=parseHTML(e);takeChildrenFor(i,r.body),i.title=r.title}else if(n==="body"){i=new DocumentFragment;let r=parseHTML(t);takeChildrenFor(i,r.body),i.title=r.title}else{let r=parseHTML('");i=r.querySelector("template").content,i.title=r.title;var s=i.querySelector("title");s&&s.parentNode===i&&(s.remove(),i.title=s.innerText)}return i&&(htmx.config.allowScriptTags?normalizeScriptTags(i):i.querySelectorAll("script").forEach(r=>r.remove())),i}function maybeCall(e){e&&e()}function isType(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function isFunction(e){return typeof e=="function"}function isRawObject(e){return isType(e,"Object")}function getInternalData(e){let t="htmx-internal-data",n=e[t];return n||(n=e[t]={}),n}function toArray(e){let t=[];if(e)for(let n=0;n=0}function bodyContains(e){let t=e.getRootNode&&e.getRootNode();return t&&t instanceof window.ShadowRoot?getDocument().body.contains(t.host):getDocument().body.contains(e)}function splitOnWhitespace(e){return e.trim().split(/\s+/)}function mergeObjects(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function parseJSON(e){try{return JSON.parse(e)}catch(t){return logError(t),null}}function canAccessLocalStorage(){let e="htmx:localStorageTest";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch{return!1}}function normalizePath(e){try{let t=new URL(e);return t&&(e=t.pathname+t.search),/^\/$/.test(e)||(e=e.replace(/\/+$/,"")),e}catch{return e}}function internalEval(str){return maybeEval(getDocument().body,function(){return eval(str)})}function onLoadHelper(e){return htmx.on("htmx:load",function(n){e(n.detail.elt)})}function logAll(){htmx.logger=function(e,t,n){console&&console.log(t,e,n)}}function logNone(){htmx.logger=null}function find(e,t){return typeof e!="string"?e.querySelector(t):find(getDocument(),e)}function findAll(e,t){return typeof e!="string"?e.querySelectorAll(t):findAll(getDocument(),e)}function getWindow(){return window}function removeElement(e,t){e=resolveTarget(e),t?getWindow().setTimeout(function(){removeElement(e),e=null},t):parentElt(e).removeChild(e)}function asElement(e){return e instanceof Element?e:null}function asHtmlElement(e){return e instanceof HTMLElement?e:null}function asString(e){return typeof e=="string"?e:null}function asParentNode(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function addClassToElement(e,t,n){e=asElement(resolveTarget(e)),e&&(n?getWindow().setTimeout(function(){addClassToElement(e,t),e=null},n):e.classList&&e.classList.add(t))}function removeClassFromElement(e,t,n){let i=asElement(resolveTarget(e));i&&(n?getWindow().setTimeout(function(){removeClassFromElement(i,t),i=null},n):i.classList&&(i.classList.remove(t),i.classList.length===0&&i.removeAttribute("class")))}function toggleClassOnElement(e,t){e=resolveTarget(e),e.classList.toggle(t)}function takeClassForElement(e,t){e=resolveTarget(e),forEach(e.parentElement.children,function(n){removeClassFromElement(n,t)}),addClassToElement(asElement(e),t)}function closest(e,t){if(e=asElement(resolveTarget(e)),e&&e.closest)return e.closest(t);do if(e==null||matches(e,t))return e;while(e=e&&asElement(parentElt(e)));return null}function startsWith(e,t){return e.substring(0,t.length)===t}function endsWith(e,t){return e.substring(e.length-t.length)===t}function normalizeSelector(e){let t=e.trim();return startsWith(t,"<")&&endsWith(t,"/>")?t.substring(1,t.length-2):t}function querySelectorAllExt(e,t,n){return e=resolveTarget(e),t.indexOf("closest ")===0?[closest(asElement(e),normalizeSelector(t.substr(8)))]:t.indexOf("find ")===0?[find(asParentNode(e),normalizeSelector(t.substr(5)))]:t==="next"?[asElement(e).nextElementSibling]:t.indexOf("next ")===0?[scanForwardQuery(e,normalizeSelector(t.substr(5)),!!n)]:t==="previous"?[asElement(e).previousElementSibling]:t.indexOf("previous ")===0?[scanBackwardsQuery(e,normalizeSelector(t.substr(9)),!!n)]:t==="document"?[document]:t==="window"?[window]:t==="body"?[document.body]:t==="root"?[getRootNode(e,!!n)]:t.indexOf("global ")===0?querySelectorAllExt(e,t.slice(7),!0):toArray(asParentNode(getRootNode(e,!!n)).querySelectorAll(normalizeSelector(t)))}var scanForwardQuery=function(e,t,n){let i=asParentNode(getRootNode(e,n)).querySelectorAll(t);for(let s=0;s=0;s--){let r=i[s];if(r.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING)return r}};function querySelectorExt(e,t){return typeof e!="string"?querySelectorAllExt(e,t)[0]:querySelectorAllExt(getDocument().body,e)[0]}function resolveTarget(e,t){return typeof e=="string"?find(asParentNode(t)||document,e):e}function processEventArgs(e,t,n){return isFunction(t)?{target:getDocument().body,event:asString(e),listener:t}:{target:resolveTarget(e),event:asString(t),listener:n}}function addEventListenerImpl(e,t,n){return ready(function(){let s=processEventArgs(e,t,n);s.target.addEventListener(s.event,s.listener)}),isFunction(t)?t:n}function removeEventListenerImpl(e,t,n){return ready(function(){let i=processEventArgs(e,t,n);i.target.removeEventListener(i.event,i.listener)}),isFunction(t)?t:n}let DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(e,t){let n=getClosestAttributeValue(e,t);if(n){if(n==="this")return[findThisElement(e,t)];{let i=querySelectorAllExt(e,n);return i.length===0?(logError('The selector "'+n+'" on '+t+" returned no matches!"),[DUMMY_ELT]):i}}}function findThisElement(e,t){return asElement(getClosestMatch(e,function(n){return getAttributeValue(asElement(n),t)!=null}))}function getTarget(e){let t=getClosestAttributeValue(e,"hx-target");return t?t==="this"?findThisElement(e,"hx-target"):querySelectorExt(e,t):getInternalData(e).boosted?getDocument().body:e}function shouldSettleAttribute(e){let t=htmx.config.attributesToSettle;for(let n=0;n0?(s=e.substr(0,e.indexOf(":")),i=e.substr(e.indexOf(":")+1,e.length)):s=e);let r=getDocument().querySelectorAll(i);return r?(forEach(r,function(l){let u,d=t.cloneNode(!0);u=getDocument().createDocumentFragment(),u.appendChild(d),isInlineSwap(s,l)||(u=asParentNode(d));let f={shouldSwap:!0,target:l,fragment:u};triggerEvent(l,"htmx:oobBeforeSwap",f)&&(l=f.target,f.shouldSwap&&swapWithStyle(s,l,l,u,n),forEach(n.elts,function(m){triggerEvent(m,"htmx:oobAfterSwap",f)}))}),t.parentNode.removeChild(t)):(t.parentNode.removeChild(t),triggerErrorEvent(getDocument().body,"htmx:oobErrorNoTarget",{content:t})),e}function handlePreservedElements(e){forEach(findAll(e,"[hx-preserve], [data-hx-preserve]"),function(t){let n=getAttributeValue(t,"id"),i=getDocument().getElementById(n);i!=null&&t.parentNode.replaceChild(i,t)})}function handleAttributes(e,t,n){forEach(t.querySelectorAll("[id]"),function(i){let s=getRawAttribute(i,"id");if(s&&s.length>0){let r=s.replace("'","\\'"),l=i.tagName.replace(":","\\:"),u=asParentNode(e),d=u&&u.querySelector(l+"[id='"+r+"']");if(d&&d!==u){let f=i.cloneNode();cloneAttributes(i,d),n.tasks.push(function(){cloneAttributes(i,f)})}}})}function makeAjaxLoadTask(e){return function(){removeClassFromElement(e,htmx.config.addedClass),processNode(asElement(e)),processFocus(asParentNode(e)),triggerEvent(e,"htmx:load")}}function processFocus(e){let t="[autofocus]",n=asHtmlElement(matches(e,t)?e:e.querySelector(t));n?.focus()}function insertNodesBefore(e,t,n,i){for(handleAttributes(e,n,i);n.childNodes.length>0;){let s=n.firstChild;addClassToElement(asElement(s),htmx.config.addedClass),e.insertBefore(s,t),s.nodeType!==Node.TEXT_NODE&&s.nodeType!==Node.COMMENT_NODE&&i.tasks.push(makeAjaxLoadTask(s))}}function stringHash(e,t){let n=0;for(;n0?getWindow().setTimeout(u,n.settleDelay):u()}function handleTriggerHeader(e,t,n){let i=e.getResponseHeader(t);if(i.indexOf("{")===0){let s=parseJSON(i);for(let r in s)if(s.hasOwnProperty(r)){let l=s[r];isRawObject(l)||(l={value:l}),triggerEvent(n,r,l)}}else{let s=i.split(",");for(let r=0;r0;){let l=t[0];if(l==="]"){if(i--,i===0){r===null&&(s=s+"true"),t.shift(),s+=")})";try{let u=maybeEval(e,function(){return Function(s)()},function(){return!0});return u.source=s,u}catch(u){return triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:u,source:s}),null}}}else l==="["&&i++;isPossibleRelativeReference(l,r,n)?s+="(("+n+"."+l+") ? ("+n+"."+l+") : (window."+l+"))":s=s+l,r=t.shift()}}}function consumeUntil(e,t){let n="";for(;e.length>0&&!t.test(e[0]);)n+=e.shift();return n}function consumeCSSSelector(e){let t;return e.length>0&&COMBINED_SELECTOR_START.test(e[0])?(e.shift(),t=consumeUntil(e,COMBINED_SELECTOR_END).trim(),e.shift()):t=consumeUntil(e,WHITESPACE_OR_COMMA),t}let INPUT_SELECTOR="input, textarea, select";function parseAndCacheTrigger(e,t,n){let i=[],s=tokenizeString(t);do{consumeUntil(s,NOT_WHITESPACE);let u=s.length,d=consumeUntil(s,/[,\[\s]/);if(d!=="")if(d==="every"){let f={trigger:"every"};consumeUntil(s,NOT_WHITESPACE),f.pollInterval=parseInterval(consumeUntil(s,/[,\[\s]/)),consumeUntil(s,NOT_WHITESPACE);var r=maybeGenerateConditional(e,s,"event");r&&(f.eventFilter=r),i.push(f)}else{let f={trigger:d};var r=maybeGenerateConditional(e,s,"event");for(r&&(f.eventFilter=r);s.length>0&&s[0]!==",";){consumeUntil(s,NOT_WHITESPACE);let p=s.shift();if(p==="changed")f.changed=!0;else if(p==="once")f.once=!0;else if(p==="consume")f.consume=!0;else if(p==="delay"&&s[0]===":")s.shift(),f.delay=parseInterval(consumeUntil(s,WHITESPACE_OR_COMMA));else if(p==="from"&&s[0]===":"){if(s.shift(),COMBINED_SELECTOR_START.test(s[0]))var l=consumeCSSSelector(s);else{var l=consumeUntil(s,WHITESPACE_OR_COMMA);if(l==="closest"||l==="find"||l==="next"||l==="previous"){s.shift();let x=consumeCSSSelector(s);x.length>0&&(l+=" "+x)}}f.from=l}else p==="target"&&s[0]===":"?(s.shift(),f.target=consumeCSSSelector(s)):p==="throttle"&&s[0]===":"?(s.shift(),f.throttle=parseInterval(consumeUntil(s,WHITESPACE_OR_COMMA))):p==="queue"&&s[0]===":"?(s.shift(),f.queue=consumeUntil(s,WHITESPACE_OR_COMMA)):p==="root"&&s[0]===":"?(s.shift(),f[p]=consumeCSSSelector(s)):p==="threshold"&&s[0]===":"?(s.shift(),f[p]=consumeUntil(s,WHITESPACE_OR_COMMA)):triggerErrorEvent(e,"htmx:syntax:error",{token:s.shift()})}i.push(f)}s.length===u&&triggerErrorEvent(e,"htmx:syntax:error",{token:s.shift()}),consumeUntil(s,NOT_WHITESPACE)}while(s[0]===","&&s.shift());return n&&(n[t]=i),i}function getTriggerSpecs(e){let t=getAttributeValue(e,"hx-trigger"),n=[];if(t){let i=htmx.config.triggerSpecsCache;n=i&&i[t]||parseAndCacheTrigger(e,t,i)}return n.length>0?n:matches(e,"form")?[{trigger:"submit"}]:matches(e,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:matches(e,INPUT_SELECTOR)?[{trigger:"change"}]:[{trigger:"click"}]}function cancelPolling(e){getInternalData(e).cancelled=!0}function processPolling(e,t,n){let i=getInternalData(e);i.timeout=getWindow().setTimeout(function(){bodyContains(e)&&i.cancelled!==!0&&(maybeFilterEvent(n,e,makeEvent("hx:poll:trigger",{triggerSpec:n,target:e}))||t(e),processPolling(e,t,n))},n.pollInterval)}function isLocalLink(e){return location.hostname===e.hostname&&getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")!==0}function eltIsDisabled(e){return closest(e,htmx.config.disableSelector)}function boostElement(e,t,n){if(e instanceof HTMLAnchorElement&&isLocalLink(e)&&(e.target===""||e.target==="_self")||e.tagName==="FORM"){t.boosted=!0;let i,s;if(e.tagName==="A")i="get",s=getRawAttribute(e,"href");else{let r=getRawAttribute(e,"method");i=r?r.toLowerCase():"get",s=getRawAttribute(e,"action")}n.forEach(function(r){addEventListener(e,function(l,u){let d=asElement(l);if(eltIsDisabled(d)){cleanUpElement(d);return}issueAjaxRequest(i,s,d,u)},t,r,!0)})}}function shouldCancel(e,t){let n=asElement(t);return n?!!((e.type==="submit"||e.type==="click")&&(n.tagName==="FORM"||matches(n,'input[type="submit"], button')&&closest(n,"form")!==null||n instanceof HTMLAnchorElement&&n.href&&(n.getAttribute("href")==="#"||n.getAttribute("href").indexOf("#")!==0))):!1}function ignoreBoostedAnchorCtrlClick(e,t){return getInternalData(e).boosted&&e instanceof HTMLAnchorElement&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function maybeFilterEvent(e,t,n){let i=e.eventFilter;if(i)try{return i.call(t,n)!==!0}catch(s){let r=i.source;return triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:s,source:r}),!0}return!1}function addEventListener(e,t,n,i,s){let r=getInternalData(e),l;i.from?l=querySelectorAllExt(e,i.from):l=[e],i.changed&&l.forEach(function(u){let d=getInternalData(u);d.lastValue=u.value}),forEach(l,function(u){let d=function(f){if(!bodyContains(e)){u.removeEventListener(i.trigger,d);return}if(ignoreBoostedAnchorCtrlClick(e,f)||((s||shouldCancel(f,e))&&f.preventDefault(),maybeFilterEvent(i,e,f)))return;let m=getInternalData(f);if(m.triggerSpec=i,m.handledFor==null&&(m.handledFor=[]),m.handledFor.indexOf(e)<0){if(m.handledFor.push(e),i.consume&&f.stopPropagation(),i.target&&f.target&&!matches(asElement(f.target),i.target))return;if(i.once){if(r.triggeredOnce)return;r.triggeredOnce=!0}if(i.changed){let p=getInternalData(u),E=u.value;if(p.lastValue===E)return;p.lastValue=E}if(r.delayed&&clearTimeout(r.delayed),r.throttle)return;i.throttle>0?r.throttle||(t(e,f),r.throttle=getWindow().setTimeout(function(){r.throttle=null},i.throttle)):i.delay>0?r.delayed=getWindow().setTimeout(function(){t(e,f)},i.delay):(triggerEvent(e,"htmx:trigger"),t(e,f))}};n.listenerInfos==null&&(n.listenerInfos=[]),n.listenerInfos.push({trigger:i.trigger,listener:d,on:u}),u.addEventListener(i.trigger,d)})}let windowIsScrolling=!1,scrollHandler=null;function initScrollHandler(){scrollHandler||(scrollHandler=function(){windowIsScrolling=!0},window.addEventListener("scroll",scrollHandler),setInterval(function(){windowIsScrolling&&(windowIsScrolling=!1,forEach(getDocument().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(e){maybeReveal(e)}))},200))}function maybeReveal(e){!hasAttribute(e,"data-hx-revealed")&&isScrolledIntoView(e)&&(e.setAttribute("data-hx-revealed","true"),getInternalData(e).initHash?triggerEvent(e,"revealed"):e.addEventListener("htmx:afterProcessNode",function(){triggerEvent(e,"revealed")},{once:!0}))}function loadImmediately(e,t,n,i){let s=function(){n.loaded||(n.loaded=!0,t(e))};i>0?getWindow().setTimeout(s,i):s()}function processVerbs(e,t,n){let i=!1;return forEach(VERBS,function(s){if(hasAttribute(e,"hx-"+s)){let r=getAttributeValue(e,"hx-"+s);i=!0,t.path=r,t.verb=s,n.forEach(function(l){addTriggerHandler(e,l,t,function(u,d){let f=asElement(u);if(closest(f,htmx.config.disableSelector)){cleanUpElement(f);return}issueAjaxRequest(s,r,f,d)})})}}),i}function addTriggerHandler(e,t,n,i){if(t.trigger==="revealed")initScrollHandler(),addEventListener(e,i,n,t),maybeReveal(asElement(e));else if(t.trigger==="intersect"){let s={};t.root&&(s.root=querySelectorExt(e,t.root)),t.threshold&&(s.threshold=parseFloat(t.threshold)),new IntersectionObserver(function(l){for(let u=0;u0?(n.polling=!0,processPolling(asElement(e),i,t)):addEventListener(e,i,n,t)}function shouldProcessHxOn(e){let t=asElement(e);if(!t)return!1;let n=t.attributes;for(let i=0;i", "+r).join(""))}else return[]}function maybeSetLastButtonClicked(e){let t=closest(asElement(e.target),"button, input[type='submit']"),n=getRelatedFormData(e);n&&(n.lastButtonClicked=t)}function maybeUnsetLastButtonClicked(e){let t=getRelatedFormData(e);t&&(t.lastButtonClicked=null)}function getRelatedFormData(e){let t=closest(asElement(e.target),"button, input[type='submit']");if(!t)return;let n=resolveTarget("#"+getRawAttribute(t,"form"),t.getRootNode())||closest(t,"form");if(n)return getInternalData(n)}function initButtonTracking(e){e.addEventListener("click",maybeSetLastButtonClicked),e.addEventListener("focusin",maybeSetLastButtonClicked),e.addEventListener("focusout",maybeUnsetLastButtonClicked)}function addHxOnEventHandler(e,t,n){let i=getInternalData(e);Array.isArray(i.onHandlers)||(i.onHandlers=[]);let s,r=function(l){maybeEval(e,function(){eltIsDisabled(e)||(s||(s=new Function("event",n)),s.call(e,l))})};e.addEventListener(t,r),i.onHandlers.push({event:t,listener:r})}function processHxOnWildcard(e){deInitOnHandlers(e);for(let t=0;thtmx.config.historyCacheSize;)r.shift();for(;r.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(r));break}catch(u){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:u,cache:r}),r.shift()}}function getCachedHistory(e){if(!canAccessLocalStorage())return null;e=normalizePath(e);let t=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let n=0;n=200&&this.status<400){triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",n);let i=makeFragment(this.response),s=i.querySelector("[hx-history-elt],[data-hx-history-elt]")||i,r=getHistoryElement(),l=makeSettleInfo(r);handleTitle(i.title),swapInnerHTML(r,s,l),settleImmediately(l.tasks),currentPathForHistory=e,triggerEvent(getDocument().body,"htmx:historyRestore",{path:e,cacheMiss:!0,serverResponse:this.response})}else triggerErrorEvent(getDocument().body,"htmx:historyCacheMissLoadError",n)},t.send()}function restoreHistory(e){saveCurrentPageToHistory(),e=e||location.pathname+location.search;let t=getCachedHistory(e);if(t){let n=makeFragment(t.content),i=getHistoryElement(),s=makeSettleInfo(i);handleTitle(n.title),swapInnerHTML(i,n,s),settleImmediately(s.tasks),getWindow().setTimeout(function(){window.scrollTo(0,t.scroll)},0),currentPathForHistory=e,triggerEvent(getDocument().body,"htmx:historyRestore",{path:e,item:t})}else htmx.config.refreshOnHistoryMiss?window.location.reload(!0):loadHistoryFromServer(e)}function addRequestIndicatorClasses(e){let t=findAttributeTargets(e,"hx-indicator");return t==null&&(t=[e]),forEach(t,function(n){let i=getInternalData(n);i.requestCount=(i.requestCount||0)+1,n.classList.add.call(n.classList,htmx.config.requestClass)}),t}function disableElements(e){let t=findAttributeTargets(e,"hx-disabled-elt");return t==null&&(t=[]),forEach(t,function(n){let i=getInternalData(n);i.requestCount=(i.requestCount||0)+1,n.setAttribute("disabled","")}),t}function removeRequestIndicators(e,t){forEach(e,function(n){let i=getInternalData(n);i.requestCount=(i.requestCount||0)-1,i.requestCount===0&&n.classList.remove.call(n.classList,htmx.config.requestClass)}),forEach(t,function(n){let i=getInternalData(n);i.requestCount=(i.requestCount||0)-1,i.requestCount===0&&n.removeAttribute("disabled")})}function haveSeenNode(e,t){for(let n=0;nt.indexOf(s)<0):i=i.filter(s=>s!==t),n.delete(e),forEach(i,s=>n.append(e,s))}}function processInputValue(e,t,n,i,s){if(!(i==null||haveSeenNode(e,i))){if(e.push(i),shouldInclude(i)){let r=getRawAttribute(i,"name"),l=i.value;i instanceof HTMLSelectElement&&i.multiple&&(l=toArray(i.querySelectorAll("option:checked")).map(function(u){return u.value})),i instanceof HTMLInputElement&&i.files&&(l=toArray(i.files)),addValueToFormData(r,l,t),s&&validateElement(i,n)}i instanceof HTMLFormElement&&(forEach(i.elements,function(r){e.indexOf(r)>=0?removeValueFromFormData(r.name,r.value,t):e.push(r),s&&validateElement(r,n)}),new FormData(i).forEach(function(r,l){r instanceof File&&r.name===""||addValueToFormData(l,r,t)}))}}function validateElement(e,t){let n=e;n.willValidate&&(triggerEvent(n,"htmx:validation:validate"),n.checkValidity()||(t.push({elt:n,message:n.validationMessage,validity:n.validity}),triggerEvent(n,"htmx:validation:failed",{message:n.validationMessage,validity:n.validity})))}function overrideFormData(e,t){for(let n of t.keys())e.delete(n),t.getAll(n).forEach(function(i){e.append(n,i)});return e}function getInputValues(e,t){let n=[],i=new FormData,s=new FormData,r=[],l=getInternalData(e);l.lastButtonClicked&&!bodyContains(l.lastButtonClicked)&&(l.lastButtonClicked=null);let u=e instanceof HTMLFormElement&&e.noValidate!==!0||getAttributeValue(e,"hx-validate")==="true";if(l.lastButtonClicked&&(u=u&&l.lastButtonClicked.formNoValidate!==!0),t!=="get"&&processInputValue(n,s,r,closest(e,"form"),u),processInputValue(n,i,r,e,u),l.lastButtonClicked||e.tagName==="BUTTON"||e.tagName==="INPUT"&&getRawAttribute(e,"type")==="submit"){let f=l.lastButtonClicked||e,m=getRawAttribute(f,"name");addValueToFormData(m,f.value,s)}let d=findAttributeTargets(e,"hx-include");return forEach(d,function(f){processInputValue(n,i,r,asElement(f),u),matches(f,"form")||forEach(asParentNode(f).querySelectorAll(INPUT_SELECTOR),function(m){processInputValue(n,i,r,m,u)})}),overrideFormData(i,s),{errors:r,formData:i,values:formDataProxy(i)}}function appendParam(e,t,n){e!==""&&(e+="&"),String(n)==="[object Object]"&&(n=JSON.stringify(n));let i=encodeURIComponent(n);return e+=encodeURIComponent(t)+"="+i,e}function urlEncode(e){e=formDataFromObject(e);let t="";return e.forEach(function(n,i){t=appendParam(t,i,n)}),t}function getHeaders(e,t,n){let i={"HX-Request":"true","HX-Trigger":getRawAttribute(e,"id"),"HX-Trigger-Name":getRawAttribute(e,"name"),"HX-Target":getAttributeValue(t,"id"),"HX-Current-URL":getDocument().location.href};return getValuesForElement(e,"hx-headers",!1,i),n!==void 0&&(i["HX-Prompt"]=n),getInternalData(e).boosted&&(i["HX-Boosted"]="true"),i}function filterValues(e,t){let n=getClosestAttributeValue(t,"hx-params");if(n){if(n==="none")return new FormData;if(n==="*")return e;if(n.indexOf("not ")===0)return forEach(n.substr(4).split(","),function(i){i=i.trim(),e.delete(i)}),e;{let i=new FormData;return forEach(n.split(","),function(s){s=s.trim(),e.has(s)&&e.getAll(s).forEach(function(r){i.append(s,r)})}),i}}else return e}function isAnchorLink(e){return!!getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")>=0}function getSwapSpecification(e,t){let n=t||getClosestAttributeValue(e,"hx-swap"),i={swapStyle:getInternalData(e).boosted?"innerHTML":htmx.config.defaultSwapStyle,swapDelay:htmx.config.defaultSwapDelay,settleDelay:htmx.config.defaultSettleDelay};if(htmx.config.scrollIntoViewOnBoost&&getInternalData(e).boosted&&!isAnchorLink(e)&&(i.show="top"),n){let l=splitOnWhitespace(n);if(l.length>0)for(let u=0;u0?s.join(":"):null;i.scroll=m,i.scrollTarget=r}else if(d.indexOf("show:")===0){var s=d.substr(5).split(":");let p=s.pop();var r=s.length>0?s.join(":"):null;i.show=p,i.showTarget=r}else if(d.indexOf("focus-scroll:")===0){let f=d.substr(13);i.focusScroll=f=="true"}else u==0?i.swapStyle=d:logError("Unknown modifier in hx-swap: "+d)}}return i}function usesFormData(e){return getClosestAttributeValue(e,"hx-encoding")==="multipart/form-data"||matches(e,"form")&&getRawAttribute(e,"enctype")==="multipart/form-data"}function encodeParamsForBody(e,t,n){let i=null;return withExtensions(t,function(s){i==null&&(i=s.encodeParameters(e,n,t))}),i??(usesFormData(t)?overrideFormData(new FormData,formDataFromObject(n)):urlEncode(n))}function makeSettleInfo(e){return{tasks:[],elts:[e]}}function updateScrollState(e,t){let n=e[0],i=e[e.length-1];if(t.scroll){var s=null;t.scrollTarget&&(s=asElement(querySelectorExt(n,t.scrollTarget))),t.scroll==="top"&&(n||s)&&(s=s||n,s.scrollTop=0),t.scroll==="bottom"&&(i||s)&&(s=s||i,s.scrollTop=s.scrollHeight)}if(t.show){var s=null;if(t.showTarget){let l=t.showTarget;t.showTarget==="window"&&(l="body"),s=asElement(querySelectorExt(n,l))}t.show==="top"&&(n||s)&&(s=s||n,s.scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior})),t.show==="bottom"&&(i||s)&&(s=s||i,s.scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior}))}}function getValuesForElement(e,t,n,i){if(i==null&&(i={}),e==null)return i;let s=getAttributeValue(e,t);if(s){let r=s.trim(),l=n;if(r==="unset")return null;r.indexOf("javascript:")===0?(r=r.substr(11),l=!0):r.indexOf("js:")===0&&(r=r.substr(3),l=!0),r.indexOf("{")!==0&&(r="{"+r+"}");let u;l?u=maybeEval(e,function(){return Function("return ("+r+")")()},{}):u=parseJSON(r);for(let d in u)u.hasOwnProperty(d)&&i[d]==null&&(i[d]=u[d])}return getValuesForElement(asElement(parentElt(e)),t,n,i)}function maybeEval(e,t,n){return htmx.config.allowEval?t():(triggerErrorEvent(e,"htmx:evalDisallowedError"),n)}function getHXVarsForElement(e,t){return getValuesForElement(e,"hx-vars",!0,t)}function getHXValsForElement(e,t){return getValuesForElement(e,"hx-vals",!1,t)}function getExpressionVars(e){return mergeObjects(getHXVarsForElement(e),getHXValsForElement(e))}function safelySetHeaderValue(e,t,n){if(n!==null)try{e.setRequestHeader(t,n)}catch{e.setRequestHeader(t,encodeURIComponent(n)),e.setRequestHeader(t+"-URI-AutoEncoded","true")}}function getPathFromResponse(e){if(e.responseURL&&typeof URL<"u")try{let t=new URL(e.responseURL);return t.pathname+t.search}catch{triggerErrorEvent(getDocument().body,"htmx:badResponseUrl",{url:e.responseURL})}}function hasHeader(e,t){return t.test(e.getAllResponseHeaders())}function ajaxHelper(e,t,n){return e=e.toLowerCase(),n?n instanceof Element||typeof n=="string"?issueAjaxRequest(e,t,null,null,{targetOverride:resolveTarget(n),returnPromise:!0}):issueAjaxRequest(e,t,resolveTarget(n.source),n.event,{handler:n.handler,headers:n.headers,values:n.values,targetOverride:resolveTarget(n.target),swapOverride:n.swap,select:n.select,returnPromise:!0}):issueAjaxRequest(e,t,null,null,{returnPromise:!0})}function hierarchyForElt(e){let t=[];for(;e;)t.push(e),e=e.parentElement;return t}function verifyPath(e,t,n){let i,s;return typeof URL=="function"?(s=new URL(t,document.location.href),i=document.location.origin===s.origin):(s=t,i=startsWith(t,document.location.origin)),htmx.config.selfRequestsOnly&&!i?!1:triggerEvent(e,"htmx:validateUrl",mergeObjects({url:s,sameHost:i},n))}function formDataFromObject(e){if(e instanceof FormData)return e;let t=new FormData;for(let n in e)e.hasOwnProperty(n)&&(typeof e[n].forEach=="function"?e[n].forEach(function(i){t.append(n,i)}):typeof e[n]=="object"?t.append(n,JSON.stringify(e[n])):t.append(n,e[n]));return t}function formDataArrayProxy(e,t,n){return new Proxy(n,{get:function(i,s){return typeof s=="number"?i[s]:s==="length"?i.length:s==="push"?function(r){i.push(r),e.append(t,r)}:typeof i[s]=="function"?function(){i[s].apply(i,arguments),e.delete(t),i.forEach(function(r){e.append(t,r)})}:i[s]&&i[s].length===1?i[s][0]:i[s]},set:function(i,s,r){return i[s]=r,e.delete(t),i.forEach(function(l){e.append(t,l)}),!0}})}function formDataProxy(e){return new Proxy(e,{get:function(t,n){if(typeof n=="symbol")return Reflect.get(t,n);if(n==="toJSON")return()=>Object.fromEntries(e);if(n in t)return typeof t[n]=="function"?function(){return e[n].apply(e,arguments)}:t[n];let i=e.getAll(n);if(i.length!==0)return i.length===1?i[0]:formDataArrayProxy(t,n,i)},set:function(t,n,i){return typeof n!="string"?!1:(t.delete(n),typeof i.forEach=="function"?i.forEach(function(s){t.append(n,s)}):t.append(n,i),!0)},deleteProperty:function(t,n){return typeof n=="string"&&t.delete(n),!0},ownKeys:function(t){return Reflect.ownKeys(Object.fromEntries(t))},getOwnPropertyDescriptor:function(t,n){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(t),n)}})}function issueAjaxRequest(e,t,n,i,s,r){let l=null,u=null;if(s=s??{},s.returnPromise&&typeof Promise<"u")var d=new Promise(function(N,j){l=N,u=j});n==null&&(n=getDocument().body);let f=s.handler||handleAjaxResponse,m=s.select||null;if(!bodyContains(n))return maybeCall(l),d;let p=s.targetOverride||asElement(getTarget(n));if(p==null||p==DUMMY_ELT)return triggerErrorEvent(n,"htmx:targetError",{target:getAttributeValue(n,"hx-target")}),maybeCall(u),d;let E=getInternalData(n),x=E.lastButtonClicked;if(x){let N=getRawAttribute(x,"formaction");N!=null&&(t=N);let j=getRawAttribute(x,"formmethod");j!=null&&j.toLowerCase()!=="dialog"&&(e=j)}let C=getClosestAttributeValue(n,"hx-confirm");if(r===void 0&&triggerEvent(n,"htmx:confirm",{target:p,elt:n,path:t,verb:e,triggeringEvent:i,etc:s,issueRequest:function(le){return issueAjaxRequest(e,t,n,i,s,!!le)},question:C})===!1)return maybeCall(l),d;let T=n,H=getClosestAttributeValue(n,"hx-sync"),V=null,z=!1;if(H){let N=H.split(":"),j=N[0].trim();if(j==="this"?T=findThisElement(n,"hx-sync"):T=asElement(querySelectorExt(n,j)),H=(N[1]||"drop").trim(),E=getInternalData(T),H==="drop"&&E.xhr&&E.abortable!==!0)return maybeCall(l),d;if(H==="abort"){if(E.xhr)return maybeCall(l),d;z=!0}else H==="replace"?triggerEvent(T,"htmx:abort"):H.indexOf("queue")===0&&(V=(H.split(" ")[1]||"last").trim())}if(E.xhr)if(E.abortable)triggerEvent(T,"htmx:abort");else{if(V==null){if(i){let N=getInternalData(i);N&&N.triggerSpec&&N.triggerSpec.queue&&(V=N.triggerSpec.queue)}V==null&&(V="last")}return E.queuedRequests==null&&(E.queuedRequests=[]),V==="first"&&E.queuedRequests.length===0?E.queuedRequests.push(function(){issueAjaxRequest(e,t,n,i,s)}):V==="all"?E.queuedRequests.push(function(){issueAjaxRequest(e,t,n,i,s)}):V==="last"&&(E.queuedRequests=[],E.queuedRequests.push(function(){issueAjaxRequest(e,t,n,i,s)})),maybeCall(l),d}let k=new XMLHttpRequest;E.xhr=k,E.abortable=z;let I=function(){E.xhr=null,E.abortable=!1,E.queuedRequests!=null&&E.queuedRequests.length>0&&E.queuedRequests.shift()()},ae=getClosestAttributeValue(n,"hx-prompt");if(ae){var Y=prompt(ae);if(Y===null||!triggerEvent(n,"htmx:prompt",{prompt:Y,target:p}))return maybeCall(l),I(),d}if(C&&!r&&!confirm(C))return maybeCall(l),I(),d;let U=getHeaders(n,p,Y);e!=="get"&&!usesFormData(n)&&(U["Content-Type"]="application/x-www-form-urlencoded"),s.headers&&(U=mergeObjects(U,s.headers));let Z=getInputValues(n,e),F=Z.errors,o=Z.formData;s.values&&overrideFormData(o,formDataFromObject(s.values));let a=formDataFromObject(getExpressionVars(n)),c=overrideFormData(o,a),h=filterValues(c,n);htmx.config.getCacheBusterParam&&e==="get"&&h.set("org.htmx.cache-buster",getRawAttribute(p,"id")||"true"),(t==null||t==="")&&(t=getDocument().location.href);let g=getValuesForElement(n,"hx-request"),b=getInternalData(n).boosted,v=htmx.config.methodsThatUseUrlParams.indexOf(e)>=0,y={boosted:b,useUrlParams:v,formData:h,parameters:formDataProxy(h),unfilteredFormData:c,unfilteredParameters:formDataProxy(c),headers:U,target:p,verb:e,errors:F,withCredentials:s.credentials||g.credentials||htmx.config.withCredentials,timeout:s.timeout||g.timeout||htmx.config.timeout,path:t,triggeringEvent:i};if(!triggerEvent(n,"htmx:configRequest",y))return maybeCall(l),I(),d;if(t=y.path,e=y.verb,U=y.headers,h=formDataFromObject(y.parameters),F=y.errors,v=y.useUrlParams,F&&F.length>0)return triggerEvent(n,"htmx:validation:halted",y),maybeCall(l),I(),d;let S=t.split("#"),D=S[0],W=S[1],O=t;if(v&&(O=D,!h.keys().next().done&&(O.indexOf("?")<0?O+="?":O+="&",O+=urlEncode(h),W&&(O+="#"+W))),!verifyPath(n,O,y))return triggerErrorEvent(n,"htmx:invalidPath",y),maybeCall(u),d;if(k.open(e.toUpperCase(),O,!0),k.overrideMimeType("text/html"),k.withCredentials=y.withCredentials,k.timeout=y.timeout,!g.noHeaders){for(let N in U)if(U.hasOwnProperty(N)){let j=U[N];safelySetHeaderValue(k,N,j)}}let A={xhr:k,target:p,requestConfig:y,etc:s,boosted:b,select:m,pathInfo:{requestPath:t,finalRequestPath:O,responsePath:null,anchor:W}};if(k.onload=function(){try{let N=hierarchyForElt(n);if(A.pathInfo.responsePath=getPathFromResponse(k),f(n,A),removeRequestIndicators(te,G),triggerEvent(n,"htmx:afterRequest",A),triggerEvent(n,"htmx:afterOnLoad",A),!bodyContains(n)){let j=null;for(;N.length>0&&j==null;){let le=N.shift();bodyContains(le)&&(j=le)}j&&(triggerEvent(j,"htmx:afterRequest",A),triggerEvent(j,"htmx:afterOnLoad",A))}maybeCall(l),I()}catch(N){throw triggerErrorEvent(n,"htmx:onLoadError",mergeObjects({error:N},A)),N}},k.onerror=function(){removeRequestIndicators(te,G),triggerErrorEvent(n,"htmx:afterRequest",A),triggerErrorEvent(n,"htmx:sendError",A),maybeCall(u),I()},k.onabort=function(){removeRequestIndicators(te,G),triggerErrorEvent(n,"htmx:afterRequest",A),triggerErrorEvent(n,"htmx:sendAbort",A),maybeCall(u),I()},k.ontimeout=function(){removeRequestIndicators(te,G),triggerErrorEvent(n,"htmx:afterRequest",A),triggerErrorEvent(n,"htmx:timeout",A),maybeCall(u),I()},!triggerEvent(n,"htmx:beforeRequest",A))return maybeCall(l),I(),d;var te=addRequestIndicatorClasses(n),G=disableElements(n);forEach(["loadstart","loadend","progress","abort"],function(N){forEach([k,k.upload],function(j){j.addEventListener(N,function(le){triggerEvent(n,"htmx:xhr:"+N,{lengthComputable:le.lengthComputable,loaded:le.loaded,total:le.total})})})}),triggerEvent(n,"htmx:beforeSend",A);let J=v?null:encodeParamsForBody(k,n,h);return k.send(J),d}function determineHistoryUpdates(e,t){let n=t.xhr,i=null,s=null;if(hasHeader(n,/HX-Push:/i)?(i=n.getResponseHeader("HX-Push"),s="push"):hasHeader(n,/HX-Push-Url:/i)?(i=n.getResponseHeader("HX-Push-Url"),s="push"):hasHeader(n,/HX-Replace-Url:/i)&&(i=n.getResponseHeader("HX-Replace-Url"),s="replace"),i)return i==="false"?{}:{type:s,path:i};let r=t.pathInfo.finalRequestPath,l=t.pathInfo.responsePath,u=getClosestAttributeValue(e,"hx-push-url"),d=getClosestAttributeValue(e,"hx-replace-url"),f=getInternalData(e).boosted,m=null,p=null;return u?(m="push",p=u):d?(m="replace",p=d):f&&(m="push",p=l||r),p?p==="false"?{}:(p==="true"&&(p=l||r),t.pathInfo.anchor&&p.indexOf("#")===-1&&(p=p+"#"+t.pathInfo.anchor),{type:m,path:p}):{}}function codeMatches(e,t){var n=new RegExp(e.code);return n.test(t.toString(10))}function resolveResponseHandling(e){for(var t=0;t0?getWindow().setTimeout(Y,V.swapDelay):Y()}p&&triggerErrorEvent(e,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+n.status+" from "+t.pathInfo.requestPath},t))}}let extensions={};function extensionBase(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return!0},transformResponse:function(e,t,n){return e},isInlineSwap:function(e){return!1},handleSwap:function(e,t,n,i){return!1},encodeParameters:function(e,t,n){return null}}}function defineExtension(e,t){t.init&&t.init(internalAPI),extensions[e]=mergeObjects(extensionBase(),t)}function removeExtension(e){delete extensions[e]}function getExtensions(e,t,n){if(t==null&&(t=[]),e==null)return t;n==null&&(n=[]);let i=getAttributeValue(e,"hx-ext");return i&&forEach(i.split(","),function(s){if(s=s.replace(/ /g,""),s.slice(0,7)=="ignore:"){n.push(s.slice(7));return}if(n.indexOf(s)<0){let r=extensions[s];r&&t.indexOf(r)<0&&t.push(r)}}),getExtensions(asElement(parentElt(e)),t,n)}var isReady=!1;getDocument().addEventListener("DOMContentLoaded",function(){isReady=!0});function ready(e){isReady||getDocument().readyState==="complete"?e():getDocument().addEventListener("DOMContentLoaded",e)}function insertIndicatorStyles(){if(htmx.config.includeIndicatorStyles!==!1){let e=htmx.config.inlineStyleNonce?` nonce="${htmx.config.inlineStyleNonce}"`:"";getDocument().head.insertAdjacentHTML("beforeend"," ."+htmx.config.indicatorClass+"{opacity:0} ."+htmx.config.requestClass+" ."+htmx.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ."+htmx.config.requestClass+"."+htmx.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ")}}function getMetaConfig(){let e=getDocument().querySelector('meta[name="htmx-config"]');return e?parseJSON(e.content):null}function mergeMetaConfig(){let e=getMetaConfig();e&&(htmx.config=mergeObjects(htmx.config,e))}return ready(function(){mergeMetaConfig(),insertIndicatorStyles();let e=getDocument().body;processNode(e);let t=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(i){let s=i.target,r=getInternalData(s);r&&r.xhr&&r.xhr.abort()});let n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(i){i.state&&i.state.htmx?(restoreHistory(),forEach(t,function(s){triggerEvent(s,"htmx:restored",{document:getDocument(),triggerEvent})})):n&&n(i)},getWindow().setTimeout(function(){triggerEvent(e,"htmx:load",{}),e=null},0)}),htmx}(),re=Ca;var Aa=Object.defineProperty,Oa=(e,t,n)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t,n)=>(Oa(e,typeof t!="symbol"?t+"":t,n),n),xo="aria-describedby",Mn="aria-expanded",kn="aria-hidden",Fn="aria-modal",vs="aria-pressed",ui="aria-selected",Na="DOMContentLoaded",Li="focus",Ri="focusin",So="focusout",qn="keydown",Ia="keyup",ye="click",Do="mousedown",Ma="hover",$n="mouseenter",Pi="mouseleave",_a="pointerdown",Ha="pointermove",La="pointerup",Vn="resize",Bn="scroll",ki="touchstart",Ra="dragstart",Ti="ArrowDown",xi="ArrowUp",bs="ArrowLeft",ys="ArrowRight",Fi="Escape",Pa="transitionDuration",ka="transitionDelay",hi="transitionend",Co="transitionProperty",Fa=navigator.userAgentData,_n=Fa,{userAgent:qa}=navigator,Hn=qa,Es=/iPhone|iPad|iPod|Android/i;_n?_n.brands.some(e=>Es.test(e.brand)):Es.test(Hn);var ws=/(iPhone|iPod|iPad)/,$a=_n?_n.brands.some(e=>ws.test(e.brand)):ws.test(Hn);Hn&&Hn.includes("Firefox");var{head:Wn}=document;["webkitPerspective","perspective"].some(e=>e in Wn.style);var Va=(e,t,n,i)=>{let s=i||!1;e.addEventListener(t,n,s)},Ba=(e,t,n,i)=>{let s=i||!1;e.removeEventListener(t,n,s)},Wa=(e,t,n,i)=>{let s=r=>{(r.target===e||r.currentTarget===e)&&(n.apply(e,[r]),Ba(e,t,s,i))};Va(e,t,s,i)},an=()=>{};(()=>{let e=!1;try{let t=Object.defineProperty({},"passive",{get:()=>(e=!0,e)});Wa(document,Na,an,t)}catch{}return e})();["webkitTransform","transform"].some(e=>e in Wn.style);["webkitAnimation","animation"].some(e=>e in Wn.style);["webkitTransition","transition"].some(e=>e in Wn.style);var ze=(e,t)=>e.getAttribute(t),Ln=(e,t)=>e.hasAttribute(t),Ee=(e,t,n)=>e.setAttribute(t,n),Lt=(e,t)=>e.removeAttribute(t),L=(e,...t)=>{e.classList.add(...t)},X=(e,...t)=>{e.classList.remove(...t)},_=(e,t)=>e.classList.contains(t),cn=e=>e!=null&&typeof e=="object"||!1,pe=e=>cn(e)&&typeof e.nodeType=="number"&&[1,2,3,4,5,6,7,8,9,10,11].some(t=>e.nodeType===t)||!1,ie=e=>pe(e)&&e.nodeType===1||!1,Bt=new Map,jt={data:Bt,set:(e,t,n)=>{ie(e)&&(Bt.has(t)||Bt.set(t,new Map),Bt.get(t).set(e,n))},getAllFor:e=>Bt.get(e)||null,get:(e,t)=>{if(!ie(e)||!t)return null;let n=jt.getAllFor(t);return e&&n&&n.get(e)||null},remove:(e,t)=>{let n=jt.getAllFor(t);!n||!ie(e)||(n.delete(e),n.size===0&&Bt.delete(t))}},Ae=(e,t)=>jt.get(e,t),dn=e=>typeof e=="string"||!1,qi=e=>cn(e)&&e.constructor.name==="Window"||!1,Ao=e=>pe(e)&&e.nodeType===9||!1,Q=e=>qi(e)?e.document:Ao(e)?e:pe(e)?e.ownerDocument:window.document,nt=(e,...t)=>Object.assign(e,...t),ht=e=>{if(!e)return;if(dn(e))return Q().createElement(e);let{tagName:t}=e,n=ht(t);if(!n)return;let i={...e};return delete i.tagName,nt(n,i)},K=(e,t)=>e.dispatchEvent(t),Ne=(e,t)=>{let n=getComputedStyle(e),i=t.replace("webkit","Webkit").replace(/([A-Z])/g,"-$1").toLowerCase();return n.getPropertyValue(i)},ja=e=>{let t=Ne(e,Co),n=Ne(e,ka),i=n.includes("ms")?1:1e3,s=t&&t!=="none"?parseFloat(n)*i:0;return Number.isNaN(s)?0:s},Xt=e=>{let t=Ne(e,Co),n=Ne(e,Pa),i=n.includes("ms")?1:1e3,s=t&&t!=="none"?parseFloat(n)*i:0;return Number.isNaN(s)?0:s},ue=(e,t)=>{let n=0,i=new Event(hi),s=Xt(e),r=ja(e);if(s){let l=u=>{u.target===e&&(t.apply(e,[u]),e.removeEventListener(hi,l),n=1)};e.addEventListener(hi,l),setTimeout(()=>{n||K(e,i)},s+r+17)}else t.apply(e,[i])},it=(e,t)=>e.focus(t),Ts=e=>["true",!0].includes(e)?!0:["false",!1].includes(e)?!1:["null","",null,void 0].includes(e)?null:e!==""&&!Number.isNaN(+e)?+e:e,An=e=>Object.entries(e),zt=e=>e.toLowerCase(),Ua=(e,t,n,i)=>{let s={...n},r={...e.dataset},l={...t},u={},d="title";return An(r).forEach(([f,m])=>{let p=i&&typeof f=="string"&&f.includes(i)?f.replace(i,"").replace(/[A-Z]/g,E=>zt(E)):f;u[p]=Ts(m)}),An(s).forEach(([f,m])=>{s[f]=Ts(m)}),An(t).forEach(([f,m])=>{f in s?l[f]=s[f]:f in u?l[f]=u[f]:l[f]=f===d?ze(e,d):m}),l},xs=e=>Object.keys(e),ee=(e,t)=>{let n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return cn(t)&&nt(n,t),n},je={passive:!0},kt=e=>e.offsetHeight,me=(e,t)=>{An(t).forEach(([n,i])=>{if(i&&dn(n)&&n.includes("--"))e.style.setProperty(n,i);else{let s={};s[n]=i,nt(e.style,s)}})},Si=e=>cn(e)&&e.constructor.name==="Map"||!1,Xa=e=>typeof e=="number"||!1,ct=new Map,q={set:(e,t,n,i)=>{ie(e)&&(i&&i.length?(ct.has(e)||ct.set(e,new Map),ct.get(e).set(i,setTimeout(t,n))):ct.set(e,setTimeout(t,n)))},get:(e,t)=>{if(!ie(e))return null;let n=ct.get(e);return t&&n&&Si(n)?n.get(t)||null:Xa(n)?n:null},clear:(e,t)=>{if(!ie(e))return;let n=ct.get(e);t&&t.length&&Si(n)?(clearTimeout(n.get(t)),n.delete(t),n.size===0&&ct.delete(e)):(clearTimeout(n),ct.delete(e))}},un=(e,t)=>{let{width:n,height:i,top:s,right:r,bottom:l,left:u}=e.getBoundingClientRect(),d=1,f=1;if(t&&ie(e)){let{offsetWidth:m,offsetHeight:p}=e;d=m>0?Math.round(n)/m:1,f=p>0?Math.round(i)/p:1}return{width:n/d,height:i/f,top:s/f,right:r/d,bottom:l/f,left:u/d,x:u/d,y:s/f}},mt=e=>Q(e).body,st=e=>Q(e).documentElement,Oo=e=>pe(e)&&e.constructor.name==="ShadowRoot"||!1,za=e=>e.nodeName==="HTML"?e:ie(e)&&e.assignedSlot||pe(e)&&e.parentNode||Oo(e)&&e.host||st(e),Ss=0,Ds=0,Wt=new Map,No=(e,t)=>{let n=t?Ss:Ds;if(t){let i=No(e),s=Wt.get(i)||new Map;Wt.has(i)||Wt.set(i,s),Si(s)&&!s.has(t)?(s.set(t,n),Ss+=1):n=s.get(t)}else{let i=e.id||e;Wt.has(i)?n=Wt.get(i):(Wt.set(i,n),Ds+=1)}return n},Gt=e=>{var t;return e?Ao(e)?e.defaultView:pe(e)?(t=e?.ownerDocument)==null?void 0:t.defaultView:e:window},Ya=e=>Array.isArray(e)||!1,Io=e=>{if(!pe(e))return!1;let{top:t,bottom:n}=un(e),{clientHeight:i}=st(e);return t<=i&&n>=0},Ga=e=>typeof e=="function"||!1,Ka=e=>cn(e)&&e.constructor.name==="NodeList"||!1,pt=e=>st(e).dir==="rtl",Ja=e=>pe(e)&&["TABLE","TD","TH"].includes(e.nodeName)||!1,we=(e,t)=>e?e.closest(t)||we(e.getRootNode().host,t):null,he=(e,t)=>ie(e)?e:(pe(t)?t:Q()).querySelector(e),$i=(e,t)=>(pe(t)?t:Q()).getElementsByTagName(e),Be=(e,t)=>(pe(t)?t:Q()).querySelectorAll(e),Ze=(e,t)=>(t&&pe(t)?t:Q()).getElementsByClassName(e),Mo=(e,t)=>e.matches(t),Ut={},_o=e=>{let{type:t,currentTarget:n}=e;[...Ut[t]].forEach(([i,s])=>{n===i&&[...s].forEach(([r,l])=>{r.apply(i,[e]),typeof l=="object"&&l.once&&xe(i,t,r,l)})})},Te=(e,t,n,i)=>{Ut[t]||(Ut[t]=new Map);let s=Ut[t];s.has(e)||s.set(e,new Map);let r=s.get(e),{size:l}=r;r.set(n,i),l||e.addEventListener(t,_o,i)},xe=(e,t,n,i)=>{let s=Ut[t],r=s&&s.get(e),l=r&&r.get(n),u=l!==void 0?l:i;r&&r.has(n)&&r.delete(n),s&&(!r||!r.size)&&s.delete(e),(!s||!s.size)&&delete Ut[t],(!r||!r.size)&&e.removeEventListener(t,_o,u)},Se="fade",$="show",jn="data-bs-dismiss",Un="alert",Ho="Alert",Qa="5.0.9",Za=Qa,He=class{constructor(t,n){let i=he(t);if(!i)throw dn(t)?Error(`${this.name} Error: "${t}" is not a valid selector.`):Error(`${this.name} Error: your target is not an instance of HTMLElement.`);let s=jt.get(i,this.name);s&&s.dispose(),this.element=i,this.options=this.defaults&&xs(this.defaults).length?Ua(i,this.defaults,n||{},"bs"):{},jt.set(i,this.name,this)}get version(){return Za}get name(){return"BaseComponent"}get defaults(){return{}}dispose(){jt.remove(this.element,this.name),xs(this).forEach(t=>{delete this[t]})}},el=`.${Un}`,tl=`[${jn}="${Un}"]`,nl=e=>Ae(e,Ho),il=e=>new wt(e),Cs=ee(`close.bs.${Un}`),sl=ee(`closed.bs.${Un}`),As=e=>{let{element:t}=e;Di(e),K(t,sl),e.dispose(),t.remove()},Di=(e,t)=>{let n=t?Te:xe,{dismiss:i,close:s}=e;i&&n(i,ye,s)},wt=class extends He{constructor(t){super(t),M(this,"dismiss"),M(this,"close",()=>{let{element:n}=this;n&&_(n,$)&&(K(n,Cs),Cs.defaultPrevented||(X(n,$),_(n,Se)?ue(n,()=>As(this)):As(this)))}),this.dismiss=he(tl,this.element),Di(this,!0)}get name(){return Ho}dispose(){Di(this),super.dispose()}};M(wt,"selector",el),M(wt,"init",il),M(wt,"getInstance",nl);var oe="active",Ye="data-bs-toggle",ol="button",Lo="Button",rl=`[${Ye}="${ol}"]`,al=e=>Ae(e,Lo),ll=e=>new Tt(e),Os=(e,t)=>{(t?Te:xe)(e.element,ye,e.toggle)},Tt=class extends He{constructor(t){super(t),M(this,"isActive",!1),M(this,"toggle",i=>{i&&i.preventDefault();let{element:s,isActive:r}=this;!_(s,"disabled")&&!ze(s,"disabled")&&((r?X:L)(s,oe),Ee(s,vs,r?"false":"true"),this.isActive=_(s,oe))});let{element:n}=this;this.isActive=_(n,oe),Ee(n,vs,String(!!this.isActive)),Os(this,!0)}get name(){return Lo}dispose(){Os(this),super.dispose()}};M(Tt,"selector",rl),M(Tt,"init",ll),M(Tt,"getInstance",al);var Ci="data-bs-target",xt="carousel",Ro="Carousel",Ns="data-bs-parent",cl="data-bs-container",Me=e=>{let t=[Ci,Ns,cl,"href"],n=Q(e);return t.map(i=>{let s=ze(e,i);return s?i===Ns?we(e,s):he(s,n):null}).filter(i=>i)[0]},hn=`[data-bs-ride="${xt}"]`,Fe=`${xt}-item`,Ai="data-bs-slide-to",ut="data-bs-slide",ft="paused",Is={pause:"hover",keyboard:!1,touch:!0,interval:5e3},ot=e=>Ae(e,Ro),dl=e=>new St(e),on=0,On=0,fi=0,gi=ee(`slide.bs.${xt}`),Oi=ee(`slid.bs.${xt}`),Ms=e=>{let{index:t,direction:n,element:i,slides:s,options:r}=e;if(e.isAnimating){let l=Ni(e),u=n==="left"?"next":"prev",d=n==="left"?"start":"end";L(s[t],oe),X(s[t],`${Fe}-${u}`),X(s[t],`${Fe}-${d}`),X(s[l],oe),X(s[l],`${Fe}-${d}`),K(i,Oi),q.clear(i,ut),e.cycle&&!Q(i).hidden&&r.interval&&!e.isPaused&&e.cycle()}};function ul(){let e=ot(this);e&&!e.isPaused&&!q.get(this,ft)&&L(this,ft)}function hl(){let e=ot(this);e&&e.isPaused&&!q.get(this,ft)&&e.cycle()}function fl(e){e.preventDefault();let t=we(this,hn)||Me(this),n=ot(t);if(n&&!n.isAnimating){let i=+(ze(this,Ai)||0);this&&!_(this,oe)&&!Number.isNaN(i)&&n.to(i)}}function gl(e){e.preventDefault();let t=we(this,hn)||Me(this),n=ot(t);if(n&&!n.isAnimating){let i=ze(this,ut);i==="next"?n.next():i==="prev"&&n.prev()}}var pl=({code:e,target:t})=>{let n=Q(t),[i]=[...Be(hn,n)].filter(r=>Io(r)),s=ot(i);if(s&&!s.isAnimating&&!/textarea|input/i.test(t.nodeName)){let r=pt(i);e===(r?ys:bs)?s.prev():e===(r?bs:ys)&&s.next()}};function _s(e){let{target:t}=e,n=ot(this);n&&n.isTouch&&(n.indicator&&!n.indicator.contains(t)||!n.controls.includes(t))&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())}function ml(e){let{target:t}=e,n=ot(this);if(n&&!n.isAnimating&&!n.isTouch){let{controls:i,indicators:s}=n;[...i,...s].every(r=>r===t||r.contains(t))||(on=e.pageX,this.contains(t)&&(n.isTouch=!0,Po(n,!0)))}}var vl=e=>{On=e.pageX},bl=e=>{var t;let{target:n}=e,i=Q(n),s=[...Be(hn,i)].map(r=>ot(r)).find(r=>r.isTouch);if(s){let{element:r,index:l}=s,u=pt(r);fi=e.pageX,s.isTouch=!1,Po(s),!((t=i.getSelection())!=null&&t.toString().length)&&r.contains(n)&&Math.abs(on-fi)>120&&(Onon&&s.to(l+(u?1:-1))),on=0,On=0,fi=0}},pi=(e,t)=>{let{indicators:n}=e;[...n].forEach(i=>X(i,oe)),e.indicators[t]&&L(n[t],oe)},Po=(e,t)=>{let{element:n}=e,i=t?Te:xe;i(Q(n),Ha,vl,je),i(Q(n),La,bl,je)},Hs=(e,t)=>{let{element:n,options:i,slides:s,controls:r,indicators:l}=e,{touch:u,pause:d,interval:f,keyboard:m}=i,p=t?Te:xe;d&&f&&(p(n,$n,ul),p(n,Pi,hl)),u&&s.length>2&&(p(n,_a,ml,je),p(n,ki,_s,{passive:!1}),p(n,Ra,_s,{passive:!1})),r.length&&r.forEach(E=>{E&&p(E,ye,gl)}),l.length&&l.forEach(E=>{p(E,ye,fl)}),m&&p(Q(n),qn,pl)},Ni=e=>{let{slides:t,element:n}=e,i=he(`.${Fe}.${oe}`,n);return ie(i)?[...t].indexOf(i):-1},St=class extends He{constructor(t,n){super(t,n);let{element:i}=this;this.direction=pt(i)?"right":"left",this.isTouch=!1,this.slides=Ze(Fe,i);let{slides:s}=this;if(s.length>=2){let r=Ni(this),l=[...s].find(f=>Mo(f,`.${Fe}-next,.${Fe}-next`));this.index=r;let u=Q(i);this.controls=[...Be(`[${ut}]`,i),...Be(`[${ut}][${Ci}="#${i.id}"]`,u)].filter((f,m,p)=>m===p.indexOf(f)),this.indicator=he(`.${xt}-indicators`,i),this.indicators=[...this.indicator?Be(`[${Ai}]`,this.indicator):[],...Be(`[${Ai}][${Ci}="#${i.id}"]`,u)].filter((f,m,p)=>m===p.indexOf(f));let{options:d}=this;this.options.interval=d.interval===!0?Is.interval:d.interval,l?this.index=[...s].indexOf(l):r<0&&(this.index=0,L(s[0],oe),this.indicators.length&&pi(this,0)),this.indicators.length&&pi(this,this.index),Hs(this,!0),d.interval&&this.cycle()}}get name(){return Ro}get defaults(){return Is}get isPaused(){return _(this.element,ft)}get isAnimating(){return he(`.${Fe}-next,.${Fe}-prev`,this.element)!==null}cycle(){let{element:t,options:n,isPaused:i,index:s}=this;q.clear(t,xt),i&&(q.clear(t,ft),X(t,ft)),q.set(t,()=>{this.element&&!this.isPaused&&!this.isTouch&&Io(t)&&this.to(s+1)},n.interval,xt)}pause(){let{element:t,options:n}=this;!this.isPaused&&n.interval&&(L(t,ft),q.set(t,()=>{},1,ft))}next(){this.isAnimating||this.to(this.index+1)}prev(){this.isAnimating||this.to(this.index-1)}to(t){let{element:n,slides:i,options:s}=this,r=Ni(this),l=pt(n),u=t;if(!this.isAnimating&&r!==u&&!q.get(n,ut)){ru||r===i.length-1&&u===0)&&(this.direction=l?"left":"right");let{direction:d}=this;u<0?u=i.length-1:u>=i.length&&(u=0);let f=d==="left"?"next":"prev",m=d==="left"?"start":"end",p={relatedTarget:i[u],from:r,to:u,direction:d};nt(gi,p),nt(Oi,p),K(n,gi),gi.defaultPrevented||(this.index=u,pi(this,u),Xt(i[u])&&_(n,"slide")?q.set(n,()=>{L(i[u],`${Fe}-${f}`),kt(i[u]),L(i[u],`${Fe}-${m}`),L(i[r],`${Fe}-${m}`),ue(i[u],()=>this.slides&&this.slides.length&&Ms(this))},0,ut):(L(i[u],oe),X(i[r],oe),q.set(n,()=>{q.clear(n,ut),n&&s.interval&&!this.isPaused&&this.cycle(),K(n,Oi)},0,ut)))}}dispose(){let{isAnimating:t}=this,n={...this,isAnimating:t};Hs(n),super.dispose(),n.isAnimating&&ue(n.slides[n.index],()=>{Ms(n)})}};M(St,"selector",hn),M(St,"init",dl),M(St,"getInstance",ot);var Rt="collapsing",Ie="collapse",ko="Collapse",yl=`.${Ie}`,Fo=`[${Ye}="${Ie}"]`,El={parent:null},Rn=e=>Ae(e,ko),wl=e=>new Dt(e),Ls=ee(`show.bs.${Ie}`),Tl=ee(`shown.bs.${Ie}`),Rs=ee(`hide.bs.${Ie}`),xl=ee(`hidden.bs.${Ie}`),Sl=e=>{let{element:t,parent:n,triggers:i}=e;K(t,Ls),Ls.defaultPrevented||(q.set(t,an,17),n&&q.set(n,an,17),L(t,Rt),X(t,Ie),me(t,{height:`${t.scrollHeight}px`}),ue(t,()=>{q.clear(t),n&&q.clear(n),i.forEach(s=>Ee(s,Mn,"true")),X(t,Rt),L(t,Ie),L(t,$),me(t,{height:""}),K(t,Tl)}))},Ps=e=>{let{element:t,parent:n,triggers:i}=e;K(t,Rs),Rs.defaultPrevented||(q.set(t,an,17),n&&q.set(n,an,17),me(t,{height:`${t.scrollHeight}px`}),X(t,Ie),X(t,$),L(t,Rt),kt(t),me(t,{height:"0px"}),ue(t,()=>{q.clear(t),n&&q.clear(n),i.forEach(s=>Ee(s,Mn,"false")),X(t,Rt),L(t,Ie),me(t,{height:""}),K(t,xl)}))},ks=(e,t)=>{let n=t?Te:xe,{triggers:i}=e;i.length&&i.forEach(s=>n(s,ye,Dl))},Dl=e=>{let{target:t}=e,n=t&&we(t,Fo),i=n&&Me(n),s=i&&Rn(i);s&&s.toggle(),n&&n.tagName==="A"&&e.preventDefault()},Dt=class extends He{constructor(t,n){super(t,n);let{element:i,options:s}=this,r=Q(i);this.triggers=[...Be(Fo,r)].filter(l=>Me(l)===i),this.parent=ie(s.parent)?s.parent:dn(s.parent)?Me(i)||he(s.parent,r):null,ks(this,!0)}get name(){return ko}get defaults(){return El}toggle(){_(this.element,$)?this.hide():this.show()}hide(){let{triggers:t,element:n}=this;q.get(n)||(Ps(this),t.length&&t.forEach(i=>L(i,`${Ie}d`)))}show(){let{element:t,parent:n,triggers:i}=this,s,r;n&&(s=[...Be(`.${Ie}.${$}`,n)].find(l=>Rn(l)),r=s&&Rn(s)),(!n||!q.get(n))&&!q.get(t)&&(r&&s!==t&&(Ps(r),r.triggers.forEach(l=>{L(l,`${Ie}d`)})),Sl(this),i.length&&i.forEach(l=>X(l,`${Ie}d`)))}dispose(){ks(this),super.dispose()}};M(Dt,"selector",yl),M(Dt,"init",wl),M(Dt,"getInstance",Rn);var Pt=["dropdown","dropup","dropstart","dropend"],qo="Dropdown",$o="dropdown-menu",Vo=e=>{let t=we(e,"A");return e.tagName==="A"&&Ln(e,"href")&&ze(e,"href").slice(-1)==="#"||t&&Ln(t,"href")&&ze(t,"href").slice(-1)==="#"},[We,Ii,Mi,_i]=Pt,Bo=`[${Ye}="${We}"]`,Kt=e=>Ae(e,qo),Cl=e=>new Ct(e),Al=`${$o}-end`,Fs=[We,Ii],qs=[Mi,_i],$s=["A","BUTTON"],Ol={offset:5,display:"dynamic"},mi=ee(`show.bs.${We}`),Vs=ee(`shown.bs.${We}`),vi=ee(`hide.bs.${We}`),Bs=ee(`hidden.bs.${We}`),Wo=ee(`updated.bs.${We}`),jo=e=>{let{element:t,menu:n,parentElement:i,options:s}=e,{offset:r}=s;if(Ne(n,"position")!=="static"){let l=pt(t),u=_(n,Al);["margin","top","bottom","left","right"].forEach(a=>{let c={};c[a]="",me(n,c)});let d=Pt.find(a=>_(i,a))||We,f={dropdown:[r,0,0],dropup:[0,0,r],dropstart:l?[-1,0,0,r]:[-1,r,0],dropend:l?[-1,r,0]:[-1,0,0,r]},m={dropdown:{top:"100%"},dropup:{top:"auto",bottom:"100%"},dropstart:l?{left:"100%",right:"auto"}:{left:"auto",right:"100%"},dropend:l?{left:"auto",right:"100%"}:{left:"100%",right:"auto"},menuStart:l?{right:"0",left:"auto"}:{right:"auto",left:"0"},menuEnd:l?{right:"auto",left:"0"}:{right:"0",left:"auto"}},{offsetWidth:p,offsetHeight:E}=n,{clientWidth:x,clientHeight:C}=st(t),{left:T,top:H,width:V,height:z}=un(t),k=T-p-r<0,I=T+p+V+r>=x,ae=H+E+r>=C,Y=H+E+z+r>=C,U=H-E-r<0,Z=(!l&&u||l&&!u)&&T+V-p<0,F=(l&&u||!l&&!u)&&T+p>=x;if(qs.includes(d)&&k&&I&&(d=We),d===Mi&&(l?I:k)&&(d=_i),d===_i&&(l?k:I)&&(d=Mi),d===Ii&&U&&!Y&&(d=We),d===We&&Y&&!U&&(d=Ii),qs.includes(d)&&ae&&nt(m[d],{top:"auto",bottom:0}),Fs.includes(d)&&(Z||F)){let a={left:"auto",right:"auto"};!Z&&F&&!l&&(a={left:"auto",right:0}),Z&&!F&&l&&(a={left:0,right:"auto"}),a&&nt(m[d],a)}let o=f[d];me(n,{...m[d],margin:`${o.map(a=>a&&`${a}px`).join(" ")}`}),Fs.includes(d)&&u&&u&&me(n,m[!l&&Z||l&&F?"menuStart":"menuEnd"]),K(i,Wo)}},Nl=e=>[...e.children].map(t=>{if(t&&$s.includes(t.tagName))return t;let{firstElementChild:n}=t;return n&&$s.includes(n.tagName)?n:null}).filter(t=>t),Ws=e=>{let{element:t,options:n}=e,i=e.open?Te:xe,s=Q(t);i(s,ye,Us),i(s,Li,Us),i(s,qn,Ml),i(s,Ia,_l),n.display==="dynamic"&&[Bn,Vn].forEach(r=>{i(Gt(t),r,Hl,je)})},js=(e,t)=>{(t?Te:xe)(e.element,ye,Il)},Xn=e=>{let t=[...Pt,"btn-group","input-group"].map(n=>Ze(`${n} ${$}`,Q(e))).find(n=>n.length);if(t&&t.length)return[...t[0].children].find(n=>Pt.some(i=>i===ze(n,Ye)))},Us=e=>{let{target:t,type:n}=e;if(t&&ie(t)){let i=Xn(t),s=i&&Kt(i);if(s){let{parentElement:r,menu:l}=s,u=r&&r.contains(t)&&(t.tagName==="form"||we(t,"form")!==null);[ye,Do].includes(n)&&Vo(t)&&e.preventDefault(),!u&&n!==Li&&t!==i&&t!==l&&s.hide()}}},Il=e=>{let{target:t}=e,n=t&&we(t,Bo),i=n&&Kt(n);i&&(e.stopPropagation(),i.toggle(),n&&Vo(n)&&e.preventDefault())},Ml=e=>{[Ti,xi].includes(e.code)&&e.preventDefault()};function _l(e){let{code:t}=e,n=Xn(this),i=n&&Kt(n),{activeElement:s}=n&&Q(n);if(i&&s){let{menu:r,open:l}=i,u=Nl(r);if(u&&u.length&&[Ti,xi].includes(t)){let d=u.indexOf(s);s===n?d=0:t===xi?d=d>1?d-1:0:t===Ti&&(d=d{u.relatedTarget=t}),K(s,mi),mi.defaultPrevented||(L(i,$),L(s,$),Ee(t,Mn,"true"),jo(this),this.open=!n,it(t),Ws(this),K(s,Vs))}}hide(){let{element:t,open:n,menu:i,parentElement:s}=this;n&&([vi,Bs].forEach(r=>{r.relatedTarget=t}),K(s,vi),vi.defaultPrevented||(X(i,$),X(s,$),Ee(t,Mn,"false"),this.open=!n,Ws(this),K(s,Bs)))}dispose(){this.open&&this.hide(),js(this),super.dispose()}};M(Ct,"selector",Bo),M(Ct,"init",Cl),M(Ct,"getInstance",Kt);var Le="modal",Vi="Modal",Bi="Offcanvas",Ll="fixed-top",Rl="fixed-bottom",Uo="sticky-top",Xo="position-sticky",zo=e=>[...Ze(Ll,e),...Ze(Rl,e),...Ze(Uo,e),...Ze(Xo,e),...Ze("is-fixed",e)],Pl=e=>{let t=mt(e);me(t,{paddingRight:"",overflow:""});let n=zo(t);n.length&&n.forEach(i=>{me(i,{paddingRight:"",marginRight:""})})},Yo=e=>{let{clientWidth:t}=st(e),{innerWidth:n}=Gt(e);return Math.abs(n-t)},Go=(e,t)=>{let n=mt(e),i=parseInt(Ne(n,"paddingRight"),10),s=Ne(n,"overflow")==="hidden"&&i?0:Yo(e),r=zo(n);t&&(me(n,{overflow:"hidden",paddingRight:`${i+s}px`}),r.length&&r.forEach(l=>{let u=Ne(l,"paddingRight");if(l.style.paddingRight=`${parseInt(u,10)+s}px`,[Uo,Xo].some(d=>_(l,d))){let d=Ne(l,"marginRight");l.style.marginRight=`${parseInt(d,10)-s}px`}}))},qe="offcanvas",gt=ht({tagName:"div",className:"popup-container"}),Ko=(e,t)=>{let n=pe(t)&&t.nodeName==="BODY",i=pe(t)&&!n?t:gt,s=n?t:mt(e);pe(e)&&(i===gt&&s.append(gt),i.append(e))},Jo=(e,t)=>{let n=pe(t)&&t.nodeName==="BODY",i=pe(t)&&!n?t:gt;pe(e)&&(e.remove(),i===gt&&!gt.children.length&>.remove())},Wi=(e,t)=>{let n=pe(t)&&t.nodeName!=="BODY"?t:gt;return pe(e)&&n.contains(e)},Qo="backdrop",Xs=`${Le}-${Qo}`,zs=`${qe}-${Qo}`,Zo=`.${Le}.${$}`,ji=`.${qe}.${$}`,fe=ht("div"),Ft=e=>he(`${Zo},${ji}`,Q(e)),Ui=e=>{let t=e?Xs:zs;[Xs,zs].forEach(n=>{X(fe,n)}),L(fe,t)},er=(e,t,n)=>{Ui(n),Ko(fe,mt(e)),t&&L(fe,Se)},tr=()=>{_(fe,$)||(L(fe,$),kt(fe))},zn=()=>{X(fe,$)},nr=e=>{Ft(e)||(X(fe,Se),Jo(fe,mt(e)),Pl(e))},ir=e=>ie(e)&&Ne(e,"visibility")!=="hidden"&&e.offsetParent!==null,kl=`.${Le}`,sr=`[${Ye}="${Le}"]`,Fl=`[${jn}="${Le}"]`,or=`${Le}-static`,ql={backdrop:!0,keyboard:!0},fn=e=>Ae(e,Vi),$l=e=>new At(e),Nn=ee(`show.bs.${Le}`),Ys=ee(`shown.bs.${Le}`),bi=ee(`hide.bs.${Le}`),Gs=ee(`hidden.bs.${Le}`),rr=e=>{let{element:t}=e,n=Yo(t),{clientHeight:i,scrollHeight:s}=st(t),{clientHeight:r,scrollHeight:l}=t,u=r!==l;if(!u&&n){let d=pt(t)?"paddingLeft":"paddingRight",f={};f[d]=`${n}px`,me(t,f)}Go(t,u||i!==s)},ar=(e,t)=>{let n=t?Te:xe,{element:i,update:s}=e;n(i,ye,Wl),n(Gt(i),Vn,s,je),n(Q(i),qn,Bl)},Ks=(e,t)=>{let n=t?Te:xe,{triggers:i}=e;i.length&&i.forEach(s=>n(s,ye,Vl))},Js=e=>{let{triggers:t,element:n,relatedTarget:i}=e;nr(n),me(n,{paddingRight:"",display:""}),ar(e);let s=Nn.relatedTarget||t.find(ir);s&&it(s),Gs.relatedTarget=i,K(n,Gs)},Qs=e=>{let{element:t,relatedTarget:n}=e;it(t),ar(e,!0),Ys.relatedTarget=n,K(t,Ys)},Zs=e=>{let{element:t,hasFade:n}=e;me(t,{display:"block"}),rr(e),Ft(t)||me(mt(t),{overflow:"hidden"}),L(t,$),Lt(t,kn),Ee(t,Fn,"true"),n?ue(t,()=>Qs(e)):Qs(e)},eo=e=>{let{element:t,options:n,hasFade:i}=e;n.backdrop&&i&&_(fe,$)&&!Ft(t)?(zn(),ue(fe,()=>Js(e))):Js(e)},Vl=e=>{let{target:t}=e,n=t&&we(t,sr),i=n&&Me(n),s=i&&fn(i);s&&(n&&n.tagName==="A"&&e.preventDefault(),s.relatedTarget=n,s.toggle())},Bl=({code:e,target:t})=>{let n=he(Zo,Q(t)),i=n&&fn(n);if(i){let{options:s}=i;s.keyboard&&e===Fi&&_(n,$)&&(i.relatedTarget=null,i.hide())}};function Wl(e){var t,n;let i=fn(this);if(i&&!q.get(this)){let{options:s,isStatic:r,modalDialog:l}=i,{backdrop:u}=s,{target:d}=e,f=(n=(t=Q(this))==null?void 0:t.getSelection())==null?void 0:n.toString().length,m=l.contains(d),p=d&&we(d,Fl);r&&!m?q.set(this,()=>{L(this,or),ue(l,()=>jl(i))},17):(p||!f&&!r&&!m&&u)&&(i.relatedTarget=p||null,i.hide(),e.preventDefault())}}var jl=e=>{let{element:t,modalDialog:n}=e,i=(Xt(n)||0)+17;X(t,or),q.set(t,()=>q.clear(t),i)},At=class extends He{constructor(t,n){super(t,n),M(this,"update",()=>{_(this.element,$)&&rr(this)});let{element:i}=this,s=he(`.${Le}-dialog`,i);s&&(this.modalDialog=s,this.triggers=[...Be(sr,Q(i))].filter(r=>Me(r)===i),this.isStatic=this.options.backdrop==="static",this.hasFade=_(i,Se),this.relatedTarget=null,Ks(this,!0))}get name(){return Vi}get defaults(){return ql}toggle(){_(this.element,$)?this.hide():this.show()}show(){let{element:t,options:n,hasFade:i,relatedTarget:s}=this,{backdrop:r}=n,l=0;if(!_(t,$)&&(Nn.relatedTarget=s||void 0,K(t,Nn),!Nn.defaultPrevented)){let u=Ft(t);if(u&&u!==t){let d=fn(u)||Ae(u,Bi);d&&d.hide()}r?(Wi(fe)?Ui(!0):er(t,i,!0),l=Xt(fe),tr(),setTimeout(()=>Zs(this),l)):(Zs(this),u&&_(fe,$)&&zn())}}hide(){let{element:t,hasFade:n,relatedTarget:i}=this;_(t,$)&&(bi.relatedTarget=i||void 0,K(t,bi),bi.defaultPrevented||(X(t,$),Ee(t,kn,"true"),Lt(t,Fn),n?ue(t,()=>eo(this)):eo(this)))}dispose(){let t={...this},{element:n,modalDialog:i}=t,s=()=>setTimeout(()=>super.dispose(),17);Ks(t),this.hide(),_(n,"fade")?ue(i,s):s()}};M(At,"selector",kl),M(At,"init",$l),M(At,"getInstance",fn);var Ul=`.${qe}`,Xi=`[${Ye}="${qe}"]`,Xl=`[${jn}="${qe}"]`,Yn=`${qe}-toggling`,zl={backdrop:!0,keyboard:!0,scroll:!1},gn=e=>Ae(e,Bi),Yl=e=>new Ot(e),In=ee(`show.bs.${qe}`),lr=ee(`shown.bs.${qe}`),yi=ee(`hide.bs.${qe}`),cr=ee(`hidden.bs.${qe}`),Gl=e=>{let{element:t}=e,{clientHeight:n,scrollHeight:i}=st(t);Go(t,n!==i)},to=(e,t)=>{let n=t?Te:xe;e.triggers.forEach(i=>n(i,ye,Jl))},dr=(e,t)=>{let n=t?Te:xe,i=Q(e.element);n(i,qn,Zl),n(i,ye,Ql)},no=e=>{let{element:t,options:n}=e;n.scroll||(Gl(e),me(mt(t),{overflow:"hidden"})),L(t,Yn),L(t,$),me(t,{visibility:"visible"}),ue(t,()=>ec(e))},Kl=e=>{let{element:t,options:n}=e,i=Ft(t);t.blur(),!i&&n.backdrop&&_(fe,$)?(zn(),ue(fe,()=>io(e))):io(e)},Jl=e=>{let t=we(e.target,Xi),n=t&&Me(t),i=n&&gn(n);i&&(i.relatedTarget=t,i.toggle(),t&&t.tagName==="A"&&e.preventDefault())},Ql=e=>{let{target:t}=e,n=he(ji,Q(t)),i=he(Xl,n),s=n&&gn(n);if(s){let{options:r,triggers:l}=s,{backdrop:u}=r,d=we(t,Xi),f=Q(n).getSelection();(!fe.contains(t)||u!=="static")&&(!(f&&f.toString().length)&&(!n.contains(t)&&u&&(!d||l.includes(t))||i&&i.contains(t))&&(s.relatedTarget=i&&i.contains(t)?i:null,s.hide()),d&&d.tagName==="A"&&e.preventDefault())}},Zl=({code:e,target:t})=>{let n=he(ji,Q(t)),i=n&&gn(n);i&&i.options.keyboard&&e===Fi&&(i.relatedTarget=null,i.hide())},ec=e=>{let{element:t}=e;X(t,Yn),Lt(t,kn),Ee(t,Fn,"true"),Ee(t,"role","dialog"),K(t,lr),dr(e,!0),it(t)},io=e=>{let{element:t,triggers:n}=e;Ee(t,kn,"true"),Lt(t,Fn),Lt(t,"role"),me(t,{visibility:""});let i=In.relatedTarget||n.find(ir);i&&it(i),nr(t),K(t,cr),X(t,Yn),Ft(t)||dr(e)},Ot=class extends He{constructor(t,n){super(t,n);let{element:i}=this;this.triggers=[...Be(Xi,Q(i))].filter(s=>Me(s)===i),this.relatedTarget=null,to(this,!0)}get name(){return Bi}get defaults(){return zl}toggle(){_(this.element,$)?this.hide():this.show()}show(){let{element:t,options:n,relatedTarget:i}=this,s=0;if(!_(t,$)&&(In.relatedTarget=i||void 0,lr.relatedTarget=i||void 0,K(t,In),!In.defaultPrevented)){let r=Ft(t);if(r&&r!==t){let l=gn(r)||Ae(r,Vi);l&&l.hide()}n.backdrop?(Wi(fe)?Ui():er(t,!0),s=Xt(fe),tr(),setTimeout(()=>no(this),s)):(no(this),r&&_(fe,$)&&zn())}}hide(){let{element:t,relatedTarget:n}=this;_(t,$)&&(yi.relatedTarget=n||void 0,cr.relatedTarget=n||void 0,K(t,yi),yi.defaultPrevented||(L(t,Yn),X(t,$),Kl(this)))}dispose(){let t={...this},{element:n,options:i}=t,s=i.backdrop?Xt(fe):0,r=()=>setTimeout(()=>super.dispose(),s+17);to(t),this.hide(),_(n,$)?ue(n,r):r()}};M(Ot,"selector",Ul),M(Ot,"init",Yl),M(Ot,"getInstance",gn);var Nt="popover",Gn="Popover",tt="tooltip",ur=e=>{let t=e===tt,n=t?`${e}-inner`:`${e}-body`,i=t?"":`

`,s=`
`,r=`
`;return`
${i+s+r}
`},hr={top:"top",bottom:"bottom",left:"start",right:"end"},zi=e=>{let t=/\b(top|bottom|start|end)+/,{element:n,tooltip:i,container:s,options:r,arrow:l}=e;if(i){let u={...hr},d=pt(n);me(i,{top:"",left:"",right:"",bottom:""});let f=e.name===Gn,{offsetWidth:m,offsetHeight:p}=i,{clientWidth:E,clientHeight:x,offsetWidth:C}=st(n),{placement:T}=r,{clientWidth:H,offsetWidth:V}=s,z=Ne(s,"position")==="fixed",k=Math.abs(z?H-V:E-C),I=d&&z?k:0,ae=E-(d?0:k)-1,{width:Y,height:U,left:Z,right:F,top:o}=un(n,!0),{x:a,y:c}={x:Z,y:o};me(l,{top:"",left:"",right:"",bottom:""});let h=0,g="",b=0,v="",y="",S="",D="",W=l.offsetWidth||0,O=l.offsetHeight||0,A=W/2,te=o-p-O<0,G=o+p+U+O>=x,J=Z-m-W=ae,j=["left","right"],le=["top","bottom"];te=j.includes(T)?o+U/2-p/2-O<0:te,G=j.includes(T)?o+p/2+U/2+O>=x:G,J=le.includes(T)?Z+Y/2-m/2=ae:N,T=j.includes(T)&&J&&N?"top":T,T=T==="top"&&te?"bottom":T,T=T==="bottom"&&G?"top":T,T=T==="left"&&J?"right":T,T=T==="right"&&N?"left":T,i.className.includes(T)||(i.className=i.className.replace(t,u[T])),j.includes(T)?(T==="left"?b=a-m-(f?W:0):b=a+Y+(f?W:0),te&&G?(h=0,g=0,y=o+U/2-O/2):te?(h=c,g="",y=U/2-W):G?(h=c-p+U,g="",y=p-U/2-W):(h=c-p/2+U/2,y=p/2-O/2)):le.includes(T)&&(T==="top"?h=c-p-(f?O:0):h=c+U+(f?O:0),J?(b=0,S=a+Y/2-A):N?(b="auto",v=0,D=Y/2+ae-F-A):(b=a-m/2+Y/2,S=m/2-A)),me(i,{top:`${h}px`,bottom:g===""?"":`${g}px`,left:b==="auto"?b:`${b}px`,right:v!==""?`${v}px`:""}),ie(l)&&(y!==""&&(l.style.top=`${y}px`),S!==""?l.style.left=`${S}px`:D!==""&&(l.style.right=`${D}px`));let Et=ee(`updated.bs.${zt(e.name)}`);K(n,Et)}},Hi={template:ur(tt),title:"",customClass:"",trigger:"hover focus",placement:"top",sanitizeFn:void 0,animation:!0,delay:200,container:document.body,content:"",dismissible:!1,btnClose:""},fr="data-original-title",It="Tooltip",dt=(e,t,n)=>{if(dn(t)&&t.length){let i=t.trim();Ga(n)&&(i=n(i));let s=new DOMParser().parseFromString(i,"text/html");e.append(...s.body.childNodes)}else ie(t)?e.append(t):(Ka(t)||Ya(t)&&t.every(pe))&&e.append(...t)},tc=e=>{let t=e.name===It,{id:n,element:i,options:s}=e,{title:r,placement:l,template:u,animation:d,customClass:f,sanitizeFn:m,dismissible:p,content:E,btnClose:x}=s,C=t?tt:Nt,T={...hr},H=[],V=[];pt(i)&&(T.left="end",T.right="start");let z=`bs-${C}-${T[l]}`,k;if(ie(u))k=u;else{let ae=ht("div");dt(ae,u,m),k=ae.firstChild}e.tooltip=ie(k)?k.cloneNode(!0):void 0;let{tooltip:I}=e;if(I){Ee(I,"id",n),Ee(I,"role",tt);let ae=t?`${tt}-inner`:`${Nt}-body`,Y=t?null:he(`.${Nt}-header`,I),U=he(`.${ae}`,I);e.arrow=he(`.${C}-arrow`,I);let{arrow:Z}=e;if(ie(r))H=[r.cloneNode(!0)];else{let F=ht("div");dt(F,r,m),H=[...F.childNodes]}if(ie(E))V=[E.cloneNode(!0)];else{let F=ht("div");dt(F,E,m),V=[...F.childNodes]}if(p)if(r)if(ie(x))H=[...H,x.cloneNode(!0)];else{let F=ht("div");dt(F,x,m),H=[...H,F.firstChild]}else if(Y&&Y.remove(),ie(x))V=[...V,x.cloneNode(!0)];else{let F=ht("div");dt(F,x,m),V=[...V,F.firstChild]}t?r&&U&&dt(U,r,m):(r&&Y&&dt(Y,H,m),E&&U&&dt(U,V,m),e.btn=he(".btn-close",I)||void 0),L(I,"position-fixed"),L(Z,"position-absolute"),_(I,C)||L(I,C),d&&!_(I,Se)&&L(I,Se),f&&!_(I,f)&&L(I,f),_(I,z)||L(I,z)}},nc=e=>{let t=["HTML","BODY"],n=[],{parentNode:i}=e;for(;i&&!t.includes(i.nodeName);)i=za(i),Oo(i)||Ja(i)||n.push(i);return n.find((s,r)=>Ne(s,"position")!=="relative"&&n.slice(r+1).every(l=>Ne(l,"position")==="static")?s:null)||Q(e).body},ic=`[${Ye}="${tt}"],[data-tip="${tt}"]`,gr="title",pr=e=>Ae(e,It),sc=e=>new et(e),oc=e=>{let{element:t,tooltip:n,container:i,offsetParent:s}=e;Lt(t,xo),Jo(n,i===s?i:s)},sn=e=>{let{tooltip:t,container:n,offsetParent:i}=e;return t&&Wi(t,n===i?n:i)},rc=(e,t)=>{let{element:n}=e;rn(e),Ln(n,fr)&&e.name===It&&vr(e),t&&t()},mr=(e,t)=>{let n=t?Te:xe,{element:i}=e;n(Q(i),ki,e.handleTouch,je),[Bn,Vn].forEach(s=>{n(Gt(i),s,e.update,je)})},so=e=>{let{element:t}=e,n=ee(`shown.bs.${zt(e.name)}`);mr(e,!0),K(t,n),q.clear(t,"in")},oo=e=>{let{element:t}=e,n=ee(`hidden.bs.${zt(e.name)}`);mr(e),oc(e),K(t,n),q.clear(t,"out")},rn=(e,t)=>{let n=t?Te:xe,{element:i,options:s,btn:r}=e,{trigger:l}=s,u=!!(e.name!==It&&s.dismissible);l.includes("manual")||(e.enabled=!!t,l.split(" ").forEach(d=>{d===Ma?(n(i,Do,e.handleShow),n(i,$n,e.handleShow),u||(n(i,Pi,e.handleHide),n(Q(i),ki,e.handleTouch,je))):d===ye?n(i,d,u?e.handleShow:e.toggle):d===Li&&(n(i,Ri,e.handleShow),u||n(i,So,e.handleHide),$a&&n(i,ye,e.handleFocus)),u&&r&&n(r,ye,e.handleHide)}))},ro=(e,t)=>{let n=t?Te:xe,{element:i,container:s,offsetParent:r}=e,{offsetHeight:l,scrollHeight:u}=s,d=we(i,`.${Le}`),f=we(i,`.${qe}`),m=Gt(i),p=s===r&&l!==u?s:m;n(p,Vn,e.update,je),n(p,Bn,e.update,je),d&&n(d,`hide.bs.${Le}`,e.handleHide),f&&n(f,`hide.bs.${qe}`,e.handleHide)},vr=(e,t)=>{let n=[fr,gr],{element:i}=e;Ee(i,n[t?0:1],t||ze(i,n[0])||""),Lt(i,n[t?1:0])},et=class extends He{constructor(t,n){super(t,n),M(this,"handleFocus",()=>it(this.element)),M(this,"handleShow",()=>this.show()),M(this,"handleHide",()=>this.hide()),M(this,"update",()=>{zi(this)}),M(this,"toggle",()=>{let{tooltip:d}=this;d&&!sn(this)?this.show():this.hide()}),M(this,"handleTouch",({target:d})=>{let{tooltip:f,element:m}=this;f&&f.contains(d)||d===m||d&&m.contains(d)||this.hide()});let{element:i}=this,s=this.name===It,r=s?tt:Nt,l=s?It:Gn;pr=d=>Ae(d,l),this.enabled=!0,this.id=`${r}-${No(i,r)}`;let{options:u}=this;!u.title&&s||!s&&!u.content||(nt(Hi,{titleAttr:""}),Ln(i,gr)&&s&&typeof u.title=="string"&&vr(this,u.title),this.container=nc(i),this.offsetParent=["sticky","fixed"].some(d=>Ne(this.container,"position")===d)?this.container:Q(this.element).body,tc(this),rn(this,!0))}get name(){return It}get defaults(){return Hi}show(){let{options:t,tooltip:n,element:i,container:s,offsetParent:r,id:l}=this,{animation:u}=t,d=q.get(i,"out"),f=s===r?s:r;q.clear(i,"out"),n&&!d&&!sn(this)&&q.set(i,()=>{let m=ee(`show.bs.${zt(this.name)}`);K(i,m),m.defaultPrevented||(Ko(n,f),Ee(i,xo,`#${l}`),this.update(),ro(this,!0),_(n,$)||L(n,$),u?ue(n,()=>so(this)):so(this))},17,"in")}hide(){let{options:t,tooltip:n,element:i}=this,{animation:s,delay:r}=t;q.clear(i,"in"),n&&sn(this)&&q.set(i,()=>{let l=ee(`hide.bs.${zt(this.name)}`);K(i,l),l.defaultPrevented||(this.update(),X(n,$),ro(this),s?ue(n,()=>oo(this)):oo(this))},r+17,"out")}enable(){let{enabled:t}=this;t||(rn(this,!0),this.enabled=!t)}disable(){let{tooltip:t,options:n,enabled:i}=this,{animation:s}=n;i&&(t&&sn(this)&&s?(this.hide(),ue(t,()=>rn(this))):rn(this),this.enabled=!i)}toggleEnabled(){this.enabled?this.disable():this.enable()}dispose(){let{tooltip:t,options:n}=this,i={...this,name:this.name},s=()=>setTimeout(()=>rc(i,()=>super.dispose()),17);n.animation&&sn(i)?(this.options.delay=0,this.hide(),ue(t,s)):s()}};M(et,"selector",ic),M(et,"init",sc),M(et,"getInstance",pr),M(et,"styleTip",zi);var ac=`[${Ye}="${Nt}"],[data-tip="${Nt}"]`,lc=nt({},Hi,{template:ur(Nt),content:"",dismissible:!1,btnClose:''}),cc=e=>Ae(e,Gn),dc=e=>new Xe(e),Xe=class extends et{constructor(t,n){super(t,n),M(this,"show",()=>{super.show();let{options:i,btn:s}=this;i.dismissible&&s&&setTimeout(()=>it(s),17)})}get name(){return Gn}get defaults(){return lc}};M(Xe,"selector",ac),M(Xe,"init",dc),M(Xe,"getInstance",cc),M(Xe,"styleTip",zi);var uc="scrollspy",br="ScrollSpy",hc='[data-bs-spy="scroll"]',fc={offset:10,target:null},gc=e=>Ae(e,br),pc=e=>new Mt(e),ao=ee(`activate.bs.${uc}`),mc=e=>{let{target:t,scrollTarget:n,options:i,itemsLength:s,scrollHeight:r,element:l}=e,{offset:u}=i,d=qi(n),f=t&&$i("A",t),m=n?yr(n):r;if(e.scrollTop=d?n.scrollY:n.scrollTop,f&&(m!==r||s!==f.length)){let p,E,x;e.items=[],e.offsets=[],e.scrollHeight=m,e.maxScroll=e.scrollHeight-vc(e),[...f].forEach(C=>{p=ze(C,"href"),E=p&&p.charAt(0)==="#"&&p.slice(-1)!=="#"&&he(p,Q(l)),E&&(e.items.push(C),x=un(E),e.offsets.push((d?x.top+e.scrollTop:E.offsetTop)-u))}),e.itemsLength=e.items.length}},yr=e=>ie(e)?e.scrollHeight:st(e).scrollHeight,vc=({element:e,scrollTarget:t})=>qi(t)?t.innerHeight:un(e).height,Er=e=>{[...$i("A",e)].forEach(t=>{_(t,oe)&&X(t,oe)})},lo=(e,t)=>{let{target:n,element:i}=e;ie(n)&&Er(n),e.activeItem=t,L(t,oe);let s=[],r=t;for(;r!==mt(i);)r=r.parentElement,(_(r,"nav")||_(r,"dropdown-menu"))&&s.push(r);s.forEach(l=>{let u=l.previousElementSibling;u&&!_(u,oe)&&L(u,oe)}),ao.relatedTarget=t,K(i,ao)},co=(e,t)=>{(t?Te:xe)(e.scrollTarget,Bn,e.refresh,je)},Mt=class extends He{constructor(t,n){super(t,n),M(this,"refresh",()=>{let{target:r}=this;if(ie(r)&&r.offsetHeight>0){mc(this);let{scrollTop:l,maxScroll:u,itemsLength:d,items:f,activeItem:m}=this;if(l>=u){let E=f[d-1];m!==E&&lo(this,E);return}let{offsets:p}=this;if(m&&l0){this.activeItem=null,r&&Er(r);return}f.forEach((E,x)=>{m!==E&&l>=p[x]&&(typeof p[x+1]>"u"||lAe(e,wr),bc=e=>new _t(e),Ei=ee(`show.bs.${pn}`),uo=ee(`shown.bs.${pn}`),wi=ee(`hide.bs.${pn}`),ho=ee(`hidden.bs.${pn}`),ln=new Map,fo=e=>{let{tabContent:t,nav:n}=e;t&&_(t,Rt)&&(t.style.height="",X(t,Rt)),n&&q.clear(n)},go=e=>{let{element:t,tabContent:n,content:i,nav:s}=e,{tab:r}=ie(s)&&ln.get(s)||{tab:null};if(n&&i&&_(i,Se)){let{currentHeight:l,nextHeight:u}=ln.get(t)||{currentHeight:0,nextHeight:0};l===u?fo(e):setTimeout(()=>{n.style.height=`${u}px`,kt(n),ue(n,()=>fo(e))},50)}else s&&q.clear(s);uo.relatedTarget=r,K(t,uo)},po=e=>{let{element:t,content:n,tabContent:i,nav:s}=e,{tab:r,content:l}=s&&ln.get(s)||{tab:null,content:null},u=0;if(i&&n&&_(n,Se)&&([l,n].forEach(d=>{ie(d)&&L(d,"overflow-hidden")}),u=ie(l)?l.scrollHeight:0),Ei.relatedTarget=r,ho.relatedTarget=t,K(t,Ei),!Ei.defaultPrevented){if(n&&L(n,oe),l&&X(l,oe),i&&n&&_(n,Se)){let d=n.scrollHeight;ln.set(t,{currentHeight:u,nextHeight:d,tab:null,content:null}),L(i,Rt),i.style.height=`${u}px`,kt(i),[l,n].forEach(f=>{f&&X(f,"overflow-hidden")})}n&&n&&_(n,Se)?setTimeout(()=>{L(n,$),ue(n,()=>{go(e)})},1):(n&&L(n,$),go(e)),r&&K(r,ho)}},mo=e=>{let{nav:t}=e;if(!ie(t))return{tab:null,content:null};let n=Ze(oe,t),i=null;n.length===1&&!Pt.some(r=>_(n[0].parentElement,r))?[i]=n:n.length>1&&(i=n[n.length-1]);let s=ie(i)?Me(i):null;return{tab:i,content:s}},vo=e=>{if(!ie(e))return null;let t=we(e,`.${Pt.join(",.")}`);return t?he(`.${Pt[0]}-toggle`,t):null},bo=(e,t)=>{(t?Te:xe)(e.element,ye,yc)},yc=e=>{let t=xr(e.target);t&&(e.preventDefault(),t.show())},_t=class extends He{constructor(t){super(t);let{element:n}=this,i=Me(n);if(i){let s=we(n,".nav"),r=we(i,".tab-content");this.nav=s,this.content=i,this.tabContent=r,this.dropdown=vo(n);let{tab:l}=mo(this);if(s&&!l){let u=he(Tr,s),d=u&&Me(u);d&&(L(u,oe),L(d,$),L(d,oe),Ee(n,ui,"true"))}bo(this,!0)}}get name(){return wr}show(){let{element:t,content:n,nav:i,dropdown:s}=this;if(!(i&&q.get(i))&&!_(t,oe)){let{tab:r,content:l}=mo(this);if(i&&ln.set(i,{tab:r,content:l,currentHeight:0,nextHeight:0}),wi.relatedTarget=t,ie(r)&&(K(r,wi),!wi.defaultPrevented)){L(t,oe),Ee(t,ui,"true");let u=ie(r)&&vo(r);if(u&&_(u,oe)&&X(u,oe),i){let d=()=>{r&&(X(r,oe),Ee(r,ui,"false")),s&&!_(s,oe)&&L(s,oe)};l&&(_(l,Se)||n&&_(n,Se))?q.set(i,d,1):d()}l&&(X(l,$),_(l,Se)?ue(l,()=>po(this)):po(this))}}}dispose(){bo(this),super.dispose()}};M(_t,"selector",Tr),M(_t,"init",bc),M(_t,"getInstance",xr);var $e="toast",Sr="Toast",Ec=`.${$e}`,wc=`[${jn}="${$e}"]`,Dr=`[${Ye}="${$e}"]`,Yt="showing",Cr="hide",Tc={animation:!0,autohide:!0,delay:5e3},Yi=e=>Ae(e,Sr),xc=e=>new Ht(e),yo=ee(`show.bs.${$e}`),Sc=ee(`shown.bs.${$e}`),Eo=ee(`hide.bs.${$e}`),Dc=ee(`hidden.bs.${$e}`),wo=e=>{let{element:t,options:n}=e;X(t,Yt),q.clear(t,Yt),K(t,Sc),n.autohide&&q.set(t,()=>e.hide(),n.delay,$e)},To=e=>{let{element:t}=e;X(t,Yt),X(t,$),L(t,Cr),q.clear(t,$e),K(t,Dc)},Cc=e=>{let{element:t,options:n}=e;L(t,Yt),n.animation?(kt(t),ue(t,()=>To(e))):To(e)},Ac=e=>{let{element:t,options:n}=e;q.set(t,()=>{X(t,Cr),kt(t),L(t,$),L(t,Yt),n.animation?ue(t,()=>wo(e)):wo(e)},17,Yt)},Ar=(e,t)=>{let n=t?Te:xe,{element:i,triggers:s,dismiss:r,options:l,hide:u}=e;r&&n(r,ye,u),l.autohide&&[Ri,So,$n,Pi].forEach(d=>n(i,d,Ic)),s.length&&s.forEach(d=>n(d,ye,Nc))},Oc=e=>{q.clear(e.element,$e),Ar(e)},Nc=e=>{let{target:t}=e,n=t&&we(t,Dr),i=n&&Me(n),s=i&&Yi(i);s&&(n&&n.tagName==="A"&&e.preventDefault(),s.relatedTarget=n,s.show())},Ic=e=>{let t=e.target,n=Yi(t),{type:i,relatedTarget:s}=e;n&&t!==s&&!t.contains(s)&&([$n,Ri].includes(i)?q.clear(t,$e):q.set(t,()=>n.hide(),n.options.delay,$e))},Ht=class extends He{constructor(t,n){super(t,n),M(this,"show",()=>{let{element:r,isShown:l}=this;r&&!l&&(K(r,yo),yo.defaultPrevented||Ac(this))}),M(this,"hide",()=>{let{element:r,isShown:l}=this;r&&l&&(K(r,Eo),Eo.defaultPrevented||Cc(this))});let{element:i,options:s}=this;s.animation&&!_(i,Se)?L(i,Se):!s.animation&&_(i,Se)&&X(i,Se),this.dismiss=he(wc,i),this.triggers=[...Be(Dr,Q(i))].filter(r=>Me(r)===i),Ar(this,!0)}get name(){return Sr}get defaults(){return Tc}get isShown(){return _(this.element,$)}dispose(){let{element:t,isShown:n}=this;n&&X(t,$),Oc(this),super.dispose()}};M(Ht,"selector",Ec),M(Ht,"init",xc),M(Ht,"getInstance",Yi);var Or=new Map;[wt,Tt,St,Dt,Ct,At,Ot,Xe,Mt,_t,Ht,et].forEach(e=>Or.set(e.prototype.name,e));var Mc=(e,t)=>{[...t].forEach(n=>e(n))};var Pn=e=>{let t=e&&e.nodeName?e:document,n=[...$i("*",t)];Or.forEach(i=>{let{init:s,selector:r}=i;Mc(s,n.filter(l=>Mo(l,r)))})};document.body?Pn():Te(document,"DOMContentLoaded",()=>Pn(),{once:!0});function Nr(){document.body.addEventListener("htmx:configRequest",e=>{e.detail.headers["X-CSRF-Token"]=document.querySelector('meta[name="csrf-token"]').content})}function Ir(){let e="Select all",t="Deselect all",n=function(i){let s=i.target,l=s.closest("form").querySelectorAll("input[type='checkbox']"),u=s.textContent==e;l.forEach(d=>d.checked=u),s.textContent=u?t:e};document.querySelectorAll("button.form-check-all").forEach(i=>{i.addEventListener("click",n);let r=i.closest("form").querySelectorAll("input[type='checkbox']"),l=!0;for(let u=0;u{t.addEventListener("click",()=>{navigator.clipboard.writeText(t.dataset.clipboard).then(()=>{let n=t.querySelector(".if"),i=t.querySelector(".btn-text"),s=t.className,r=n.className,l=i.className,u=i.innerText;t.classList.remove("btn-outline-secondary"),t.classList.add("btn-outline-success"),n.classList.remove("if-copy","text-muted"),n.classList.add("if-check","text-success"),i.classList.remove("text-muted"),i.classList.add("text-success"),i.setAttribute("aria-live","polite"),i.innerText="Copied",setTimeout(function(){t.className=s,n.className=r,i.className=l,i.innerText=u},1500)})})})}function _r(){let e=function(t){t.querySelectorAll("[data-bs-toggle=popover-custom]").forEach(function(n){let i=document.querySelector(n.dataset.popoverContent),s=i.querySelector(".popover-body"),r=i.querySelector(".popover-heading"),l="";r&&(l=r.innerHTML),new Xe(n,{content:s.innerHTML,title:l,delay:1e3})})};re.onLoad(e)}function Hr(){class e{constructor(r){this.el=r,this.collapsers=r.querySelectorAll(".c-header-collapse-trigger"),this.collapsed=!1,this.init()}init(){try{let r=JSON.parse(localStorage.getItem(i));t=Object.assign({},t,r)}catch{console.warn("There was an error parsing the saved state for the prototype navigation.")}t.isExpanded?this.show():this.hide(),this.collapsers?.forEach(r=>r.addEventListener("click",this))}handleEvent(r){this.toggle(r)}toggle(r){this.collapsed?this.show():this.collapsed||this.hide()}show(){this.el.dataset.collapsed=!1,this.collapsed=!1,t.isExpanded=!0,this.saveNavState()}saveNavState(){localStorage.setItem(i,JSON.stringify(t))}hide(){this.el.dataset.collapsed=!0,this.collapsed=!0,t.isExpanded=!1,this.saveNavState()}}let t={isExpanded:!1},n=document.querySelectorAll(".c-header-collapsible"),i="bedrockheaderState";n.length&&[...n].map(s=>new e(s))}function Lr(){let e=/^data-tmpl-(.+)/,t=(i,s)=>{Array.from(i.getElementsByTagName("*")).forEach(function(r){if(r.hasAttributes()){let u=r.attributes;for(var l=0;l{let s=function(l){let u=l.target.closest("div.form-values");l.target.closest("div.form-value").remove();let d=Array.from(u.children).length;for(var f=0;f{C.classList.remove("is-invalid")}),t(p,m);let E=f.querySelector("button.form-value-add"),x=E.classList;x.remove("form-value-add"),x.remove("btn-outline-primary"),x.add("btn-link-muted"),x.add("form-value-delete"),x=f.querySelector("i.if-add").classList,x.remove("if-add"),x.add("if-delete"),f.querySelector(".form-value-delete .visually-hidden").textContent="Delete",E.removeEventListener("click",r),E.addEventListener("click",s),f.after(p),re.process(p),p.querySelector("button.form-value-add").addEventListener("click",r),p.dispatchEvent(new CustomEvent("form-value-add",{bubbles:!0}))};i.querySelectorAll("button.form-value-delete").forEach(l=>l.addEventListener("click",s)),i.querySelectorAll("button.form-value-add").forEach(l=>l.addEventListener("click",r))};re.onLoad(n)}function Rr(){document.querySelectorAll("form.form-change-submit").forEach(function(e){e.addEventListener("change",function(t){let n=e.querySelector(".spinner-border");n!==null&&(n.style.display="inline-block",n.style.opacity="1"),e.submit()})}),document.querySelectorAll("form .form-change-submit").forEach(function(e){e.addEventListener("change",function(t){t.target.closest("form").submit()})})}function Pr(){let e=function(t){t.querySelectorAll(".autocomplete").forEach(function(n){document.querySelector(n.dataset.target).addEventListener("keydown",function(s){s.key==="Escape"&&(n.querySelector(".autocomplete-hits").innerHTML="")})}),t.querySelectorAll(".autocomplete-hit").forEach(function(n){n.addEventListener("click",function(){let i=n.closest(".autocomplete").dataset.target,s=n.dataset.value;document.querySelector(i).value=s,n.closest(".autocomplete-hits").innerHTML=""})})};re.onLoad(function(t){e(t)}),document.addEventListener("form-value-add",function(t){e(t.target)})}function kr(){let e=function(t){let n=document.querySelectorAll(".modal").item(0),i=document.querySelectorAll(".modal-backdrop").item(0);n&&n.classList.remove("show"),i&&i.classList.remove("show"),setTimeout(function(){i&&i.remove(),n&&n.remove()},100)};re.onLoad(function(t){t.querySelectorAll(".modal-close").forEach(function(n){n.addEventListener("click",e)})})}function Fr(){let e=function(n){n.currentTarget.closest(".radio-card-group").querySelectorAll(".c-radio-card").forEach(function(r){r.setAttribute("aria-selected","false"),r.classList.remove("c-radio-card--selected")}),n.currentTarget.setAttribute("aria-selected","true"),n.currentTarget.classList.add("c-radio-card--selected")},t=function(n){n.querySelectorAll(".radio-card-group .c-radio-card").forEach(i=>i.addEventListener("click",e))};t(document),re.onLoad(t)}function qr(){let e=function(t){t.querySelectorAll('.btn-close[data-bs-dismiss="toast"]').forEach(function(n){n.addEventListener("click",()=>{n.closest(".toast").remove()})})};re.onLoad(e)}function $r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function Je(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Lc(e,t){if(e==null)return{};var n=Hc(e,t),i,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Rc="1.15.0";function rt(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var lt=rt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Sn=rt(/Edge/i),Vr=rt(/firefox/i),yn=rt(/safari/i)&&!rt(/chrome/i)&&!rt(/android/i),Gr=rt(/iP(ad|od|hone)/i),Kr=rt(/chrome/i)&&rt(/android/i),Jr={capture:!1,passive:!1};function se(e,t,n){e.addEventListener(t,n,!lt&&Jr)}function ne(e,t,n){e.removeEventListener(t,n,!lt&&Jr)}function oi(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Pc(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Ge(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&oi(e,t):oi(e,t))||i&&e===n)return e;if(e===n)break}while(e=Pc(e))}return null}var Br=/\s+/g;function Re(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(Br," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(Br," ")}}function R(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function tn(e,t){var n="";if(typeof e=="string")n=e;else do{var i=R(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function Qr(e,t,n){if(e){var i=e.getElementsByTagName(t),s=0,r=i.length;if(n)for(;s=r:l=s<=r,!l)return i;if(i===Ke())break;i=yt(i,!1)}return!1}function nn(e,t,n,i){for(var s=0,r=0,l=e.children;r2&&arguments[2]!==void 0?arguments[2]:{},s=i.evt,r=Lc(i,jc);Dn.pluginEvent.bind(P)(t,n,Je({dragEl:w,parentEl:ge,ghostEl:B,rootEl:ce,nextEl:Vt,lastDownEl:ti,cloneEl:de,cloneHidden:bt,dragStarted:mn,putSortable:De,activeSortable:P.active,originalEvent:s,oldIndex:en,oldDraggableIndex:wn,newIndex:Pe,newDraggableIndex:vt,hideGhostForTarget:oa,unhideGhostForTarget:ra,cloneNowHidden:function(){bt=!0},cloneNowShown:function(){bt=!1},dispatchSortableEvent:function(u){Oe({sortable:n,name:u,originalEvent:s})}},r))};function Oe(e){Wc(Je({putSortable:De,cloneEl:de,targetEl:w,rootEl:ce,oldIndex:en,oldDraggableIndex:wn,newIndex:Pe,newDraggableIndex:vt},e))}var w,ge,B,ce,Vt,ti,de,bt,en,Pe,wn,vt,Kn,De,Zt=!1,ri=!1,ai=[],qt,Ue,Ji,Qi,Ur,Xr,mn,Qt,Tn,xn=!1,Jn=!1,ni,Ce,Zi=[],ss=!1,li=[],di=typeof document<"u",Qn=Gr,zr=Sn||lt?"cssFloat":"float",Uc=di&&!Kr&&!Gr&&"draggable"in document.createElement("div"),na=function(){if(di){if(lt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),ia=function(t,n){var i=R(t),s=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=nn(t,0,n),l=nn(t,1,n),u=r&&R(r),d=l&&R(l),f=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+be(r).width,m=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+be(l).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&u.float&&u.float!=="none"){var p=u.float==="left"?"left":"right";return l&&(d.clear==="both"||d.clear===p)?"vertical":"horizontal"}return r&&(u.display==="block"||u.display==="flex"||u.display==="table"||u.display==="grid"||f>=s&&i[zr]==="none"||l&&i[zr]==="none"&&f+m>s)?"vertical":"horizontal"},Xc=function(t,n,i){var s=i?t.left:t.top,r=i?t.right:t.bottom,l=i?t.width:t.height,u=i?n.left:n.top,d=i?n.right:n.bottom,f=i?n.width:n.height;return s===u||r===d||s+l/2===u+f/2},zc=function(t,n){var i;return ai.some(function(s){var r=s[ke].options.emptyInsertThreshold;if(!(!r||ls(s))){var l=be(s),u=t>=l.left-r&&t<=l.right+r,d=n>=l.top-r&&n<=l.bottom+r;if(u&&d)return i=s}}),i},sa=function(t){function n(r,l){return function(u,d,f,m){var p=u.options.group.name&&d.options.group.name&&u.options.group.name===d.options.group.name;if(r==null&&(l||p))return!0;if(r==null||r===!1)return!1;if(l&&r==="clone")return r;if(typeof r=="function")return n(r(u,d,f,m),l)(u,d,f,m);var E=(l?u:d).options.group.name;return r===!0||typeof r=="string"&&r===E||r.join&&r.indexOf(E)>-1}}var i={},s=t.group;(!s||ei(s)!="object")&&(s={name:s}),i.name=s.name,i.checkPull=n(s.pull,!0),i.checkPut=n(s.put),i.revertClone=s.revertClone,t.group=i},oa=function(){!na&&B&&R(B,"display","none")},ra=function(){!na&&B&&R(B,"display","")};di&&!Kr&&document.addEventListener("click",function(e){if(ri)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),ri=!1,!1},!0);var $t=function(t){if(w){t=t.touches?t.touches[0]:t;var n=zc(t.clientX,t.clientY);if(n){var i={};for(var s in t)t.hasOwnProperty(s)&&(i[s]=t[s]);i.target=i.rootEl=n,i.preventDefault=void 0,i.stopPropagation=void 0,n[ke]._onDragOver(i)}}},Yc=function(t){w&&w.parentNode[ke]._isOutsideThisEl(t.target)};function P(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=at({},t),e[ke]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ia(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,u){l.setData("Text",u.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:P.supportPointer!==!1&&"PointerEvent"in window&&!yn,emptyInsertThreshold:5};Dn.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);sa(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:Uc,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?se(e,"pointerdown",this._onTapStart):(se(e,"mousedown",this._onTapStart),se(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(se(e,"dragover",this),se(e,"dragenter",this)),ai.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),at(this,$c())}P.prototype={constructor:P,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Qt=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,w):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,i=this.el,s=this.options,r=s.preventOnFilter,l=t.type,u=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,d=(u||t).target,f=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||d,m=s.filter;if(nd(i),!w&&!(/mousedown|pointerdown/.test(l)&&t.button!==0||s.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&yn&&d&&d.tagName.toUpperCase()==="SELECT")&&(d=Ge(d,s.draggable,i,!1),!(d&&d.animated)&&ti!==d)){if(en=Ve(d),wn=Ve(d,s.draggable),typeof m=="function"){if(m.call(this,t,d,this)){Oe({sortable:n,rootEl:f,name:"filter",targetEl:d,toEl:i,fromEl:i}),_e("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(m&&(m=m.split(",").some(function(p){if(p=Ge(f,p.trim(),i,!1),p)return Oe({sortable:n,rootEl:p,name:"filter",targetEl:d,fromEl:i,toEl:i}),_e("filter",n,{evt:t}),!0}),m)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!Ge(f,s.handle,i,!1)||this._prepareDragStart(t,u,d)}}},_prepareDragStart:function(t,n,i){var s=this,r=s.el,l=s.options,u=r.ownerDocument,d;if(i&&!w&&i.parentNode===r){var f=be(i);if(ce=r,w=i,ge=w.parentNode,Vt=w.nextSibling,ti=i,Kn=l.group,P.dragged=w,qt={target:w,clientX:(n||t).clientX,clientY:(n||t).clientY},Ur=qt.clientX-f.left,Xr=qt.clientY-f.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,w.style["will-change"]="all",d=function(){if(_e("delayEnded",s,{evt:t}),P.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!Vr&&s.nativeDraggable&&(w.draggable=!0),s._triggerDragStart(t,n),Oe({sortable:s,name:"choose",originalEvent:t}),Re(w,l.chosenClass,!0)},l.ignore.split(",").forEach(function(m){Qr(w,m.trim(),es)}),se(u,"dragover",$t),se(u,"mousemove",$t),se(u,"touchmove",$t),se(u,"mouseup",s._onDrop),se(u,"touchend",s._onDrop),se(u,"touchcancel",s._onDrop),Vr&&this.nativeDraggable&&(this.options.touchStartThreshold=4,w.draggable=!0),_e("delayStart",this,{evt:t}),l.delay&&(!l.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Sn||lt))){if(P.eventCanceled){this._onDrop();return}se(u,"mouseup",s._disableDelayedDrag),se(u,"touchend",s._disableDelayedDrag),se(u,"touchcancel",s._disableDelayedDrag),se(u,"mousemove",s._delayedDragTouchMoveHandler),se(u,"touchmove",s._delayedDragTouchMoveHandler),l.supportPointer&&se(u,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(d,l.delay)}else d()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){w&&es(w),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;ne(t,"mouseup",this._disableDelayedDrag),ne(t,"touchend",this._disableDelayedDrag),ne(t,"touchcancel",this._disableDelayedDrag),ne(t,"mousemove",this._delayedDragTouchMoveHandler),ne(t,"touchmove",this._delayedDragTouchMoveHandler),ne(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?se(document,"pointermove",this._onTouchMove):n?se(document,"touchmove",this._onTouchMove):se(document,"mousemove",this._onTouchMove):(se(w,"dragend",this),se(ce,"dragstart",this._onDragStart));try{document.selection?ii(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Zt=!1,ce&&w){_e("dragStarted",this,{evt:n}),this.nativeDraggable&&se(document,"dragover",Yc);var i=this.options;!t&&Re(w,i.dragClass,!1),Re(w,i.ghostClass,!0),P.active=this,t&&this._appendGhost(),Oe({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Ue){this._lastX=Ue.clientX,this._lastY=Ue.clientY,oa();for(var t=document.elementFromPoint(Ue.clientX,Ue.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ue.clientX,Ue.clientY),t!==n);)n=t;if(w.parentNode[ke]._isOutsideThisEl(t),n)do{if(n[ke]){var i=void 0;if(i=n[ke]._onDragOver({clientX:Ue.clientX,clientY:Ue.clientY,target:t,rootEl:n}),i&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);ra()}},_onTouchMove:function(t){if(qt){var n=this.options,i=n.fallbackTolerance,s=n.fallbackOffset,r=t.touches?t.touches[0]:t,l=B&&tn(B,!0),u=B&&l&&l.a,d=B&&l&&l.d,f=Qn&&Ce&&jr(Ce),m=(r.clientX-qt.clientX+s.x)/(u||1)+(f?f[0]-Zi[0]:0)/(u||1),p=(r.clientY-qt.clientY+s.y)/(d||1)+(f?f[1]-Zi[1]:0)/(d||1);if(!P.active&&!Zt){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))=0&&(Oe({rootEl:ge,name:"add",toEl:ge,fromEl:ce,originalEvent:t}),Oe({sortable:this,name:"remove",toEl:ge,originalEvent:t}),Oe({rootEl:ge,name:"sort",toEl:ge,fromEl:ce,originalEvent:t}),Oe({sortable:this,name:"sort",toEl:ge,originalEvent:t})),De&&De.save()):Pe!==en&&Pe>=0&&(Oe({sortable:this,name:"update",toEl:ge,originalEvent:t}),Oe({sortable:this,name:"sort",toEl:ge,originalEvent:t})),P.active&&((Pe==null||Pe===-1)&&(Pe=en,vt=wn),Oe({sortable:this,name:"end",toEl:ge,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){_e("nulling",this),ce=w=ge=B=Vt=de=ti=bt=qt=Ue=mn=Pe=vt=en=wn=Qt=Tn=De=Kn=P.dragged=P.ghost=P.clone=P.active=null,li.forEach(function(t){t.checked=!0}),li.length=Ji=Qi=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":w&&(this._onDragOver(t),Gc(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,i=this.el.children,s=0,r=i.length,l=this.options;si.right+s||e.clientX<=i.right&&e.clientY>i.bottom&&e.clientX>=i.left:e.clientX>i.right&&e.clientY>i.top||e.clientX<=i.right&&e.clientY>i.bottom+s}function Zc(e,t,n,i,s,r,l,u){var d=i?e.clientY:e.clientX,f=i?n.height:n.width,m=i?n.top:n.left,p=i?n.bottom:n.right,E=!1;if(!l){if(u&&nim+f*r/2:dp-ni)return-Tn}else if(d>m+f*(1-s)/2&&dp-f*r/2)?d>m+f/2?1:-1:0}function ed(e){return Ve(w){for(var n=t.querySelectorAll(".sortable"),i=0;in.addEventListener("click",e))};t(),re.onLoad(function(n){t()})}function Cn(e){let t=document.querySelector("#modals");if(!t)return;let n=document.querySelector("template.template-modal-error");if(!n)return;let i=n.content.cloneNode(!0);i.querySelector(".modal-close").addEventListener("click",function(){t.innerHTML=""}),i.querySelector(".msg").textContent=e,t.innerHTML="",t.appendChild(i)}function ha(){re.onLoad(function(e){e.querySelectorAll("input[type=file].upload-progress").forEach(t=>{t.addEventListener("change",n=>{let i=Array.from(t.files);if(!i.length)return;let s=i[0],r=t.closest("form"),l=document.querySelector(r.dataset.target),u=JSON.parse(r.dataset.headers),d=parseInt(t.dataset.maxSize),f=t.dataset.maxSizeError;if(!isNaN(d)&&d>0&&t.files[0].size>d){n.preventDefault(),n.stopPropagation(),Cn(f),ua(r);return}u["X-HTTP-Method-Override"]="POST",u["X-Upload-Filename"]=encodeURIComponent(s.name),u["Content-Type"]=s.type;let m=new XMLHttpRequest;m.upload.addEventListener("progress",p=>{p.lengthComputable&&us(r,Math.floor(p.loaded/p.total*100))},!1),m.addEventListener("readystatechange",p=>{m.readyState===XMLHttpRequest.DONE&&(ua(r),m.status==200||m.status==201?re.swap(l,m.responseText,{swapStyle:"innerHTML"}):m.status==413?Cn(t.dataset.uploadMsgFileTooLarge):m.status==404?Cn(t.dataset.uploadMsgRecordNotFound):Cn(t.dataset.uploadMsgUnexpected))}),sd(r),m.open(r.method,r.action);for(let p in u)m.setRequestHeader(p,u[p]);m.send(s)})})})}function sd(e){us(e,0),e.querySelectorAll("input").forEach(t=>{t.disabled=!0}),e.querySelector(".file-upload-start").classList.add("d-none"),e.querySelector(".file-upload-busy").classList.remove("d-none")}function ua(e){us(e,0),e.querySelectorAll("input").forEach(t=>{t.disabled=!1,t.value=""}),e.querySelector(".file-upload-start").classList.remove("d-none"),e.querySelector(".file-upload-busy").classList.add("d-none")}function us(e,t){let n=e.querySelector(".progress-bar");n.setAttribute("style","width: "+t+"%"),n.setAttribute("aria-valuenow",t);let i=e.querySelector(".progress-bar-percent");i.innerText=t}var ga=Da(fa());function pa(){let e=function(t,n,i){t.innerHTML="";for(let s=0;s{t.querySelectorAll(".tags").forEach(n=>{let i=n.querySelector(".tags-real-values"),s=n.querySelector(".tags-widget-values"),{inputName:r}=s.dataset;{let f=s.value;try{f=JSON.parse(f),Array.isArray(f)&&e(i,r,f)}catch{}}let l=new ga.default(s,{delimiters:`;| +|\r`,duplicates:!1,pasteAsTags:!0,dropdown:{enabled:!1,caseSensitive:!0}});l.on("change",function(f){e(i,r,f.detail.tagify.value.map(m=>m.value))});let{originalInput:u,input:d}=l.DOM;if(u&&u.id&&d){let f=document.querySelector(`label[for="${u.id}"]`);f&&f.addEventListener("click",()=>{window.setTimeout(()=>d.focus(),0)})}})})}function va(){document.querySelectorAll("[data-facet-dropdown]").forEach(e=>{let t=e.getAttribute("data-facet-dropdown"),n=e.querySelector("form");if(n){let i=null;e.addEventListener("show.bs.dropdown",function(){i=ma(n,t)}),e.addEventListener("shown.bs.dropdown",function(){n.querySelector("input[type=text]")?.focus()}),e.addEventListener("hidden.bs.dropdown",function(){let s=ma(n,t);i!==null&&i!==s&&n.submit(),i=null})}else console.log(`Could not find form element for facet '${t}'.`)})}function ma(e,t){return Array.from(new FormData(e).entries()).filter(([i])=>i===`f[${t}]`).map(([i,s])=>s).join(",")}function gs(){let e=document.querySelectorAll("[data-sidebar-menu] button"),t=document.querySelectorAll("[data-sidebar-content]"),n=document.querySelectorAll("[data-sidebar-close]");e.forEach(i=>{i.addEventListener("click",()=>{let s=i.getAttribute("data-target-id"),r=document.getElementById(s);r.classList.contains("open")?(r.classList.remove("open"),i.classList.remove("active")):(t.forEach(l=>{l.classList.remove("open")}),e.forEach(l=>{l.classList.remove("active")}),r.classList.add("open"),i.classList.add("active"))})}),n.forEach(i=>{i.addEventListener("click",()=>{let s=i.closest("[data-sidebar-content]");if(s){s.classList.remove("open");let r=document.querySelector(`[data-sidebar-menu] button[data-target="${s.id}"]`);r&&r.classList.remove("active")}})})}re.config.defaultFocusScroll=!0;re.onLoad(Pn);window.htmx=re;ba();document.addEventListener("DOMContentLoaded",function(){Nr(),Ir(),_r(),Hr(),Lr(),Rr(),Pr(),kr(),Fr(),qr(),ca(),da(),ha(),pa(),va(),gs()});re.onLoad(function(e){Mr(e)});})(); +/*! For license information please see app-4WA5PKDO.js.LEGAL.txt */ +//# sourceMappingURL=app-4WA5PKDO.js.map diff --git a/static/js/app-X5MYBGAE.js.LEGAL.txt b/static/js/app-4WA5PKDO.js.LEGAL.txt similarity index 100% rename from static/js/app-X5MYBGAE.js.LEGAL.txt rename to static/js/app-4WA5PKDO.js.LEGAL.txt diff --git a/static/js/app-X5MYBGAE.js.map b/static/js/app-4WA5PKDO.js.map similarity index 99% rename from static/js/app-X5MYBGAE.js.map rename to static/js/app-4WA5PKDO.js.map index b4f95c8fe..3e1b2bf06 100644 --- a/static/js/app-X5MYBGAE.js.map +++ b/static/js/app-4WA5PKDO.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../../node_modules/@yaireo/tagify/dist/tagify.min.js", "../../node_modules/htmx-ext-remove-me/remove-me.js", "../../node_modules/htmx.org/dist/htmx.esm.js", "../../node_modules/bootstrap.native/node_modules/@thednp/shorty/dist/shorty.mjs", "../../node_modules/bootstrap.native/node_modules/@thednp/event-listener/dist/event-listener.mjs", "../../node_modules/bootstrap.native/src/strings/fadeClass.ts", "../../node_modules/bootstrap.native/src/strings/showClass.ts", "../../node_modules/bootstrap.native/src/strings/dataBsDismiss.ts", "../../node_modules/bootstrap.native/src/strings/alertString.ts", "../../node_modules/bootstrap.native/src/strings/alertComponent.ts", "../../node_modules/bootstrap.native/src/version.ts", "../../node_modules/bootstrap.native/src/components/base-component.ts", "../../node_modules/bootstrap.native/src/components/alert.ts", "../../node_modules/bootstrap.native/src/strings/activeClass.ts", "../../node_modules/bootstrap.native/src/strings/dataBsToggle.ts", "../../node_modules/bootstrap.native/src/strings/buttonString.ts", "../../node_modules/bootstrap.native/src/strings/buttonComponent.ts", "../../node_modules/bootstrap.native/src/components/button.ts", "../../node_modules/bootstrap.native/src/strings/dataBsTarget.ts", "../../node_modules/bootstrap.native/src/strings/carouselString.ts", "../../node_modules/bootstrap.native/src/strings/carouselComponent.ts", "../../node_modules/bootstrap.native/src/strings/dataBsParent.ts", "../../node_modules/bootstrap.native/src/strings/dataBsContainer.ts", "../../node_modules/bootstrap.native/src/util/getTargetElement.ts", "../../node_modules/bootstrap.native/src/components/carousel.ts", "../../node_modules/bootstrap.native/src/strings/collapsingClass.ts", "../../node_modules/bootstrap.native/src/strings/collapseString.ts", "../../node_modules/bootstrap.native/src/strings/collapseComponent.ts", "../../node_modules/bootstrap.native/src/components/collapse.ts", "../../node_modules/bootstrap.native/src/strings/dropdownClasses.ts", "../../node_modules/bootstrap.native/src/strings/dropdownComponent.ts", "../../node_modules/bootstrap.native/src/strings/dropdownMenuClass.ts", "../../node_modules/bootstrap.native/src/util/isEmptyAnchor.ts", "../../node_modules/bootstrap.native/src/components/dropdown.ts", "../../node_modules/bootstrap.native/src/strings/modalString.ts", "../../node_modules/bootstrap.native/src/strings/modalComponent.ts", "../../node_modules/bootstrap.native/src/strings/offcanvasComponent.ts", "../../node_modules/bootstrap.native/src/strings/fixedTopClass.ts", "../../node_modules/bootstrap.native/src/strings/fixedBottomClass.ts", "../../node_modules/bootstrap.native/src/strings/stickyTopClass.ts", "../../node_modules/bootstrap.native/src/strings/positionStickyClass.ts", "../../node_modules/bootstrap.native/src/util/scrollbar.ts", "../../node_modules/bootstrap.native/src/strings/offcanvasString.ts", "../../node_modules/bootstrap.native/src/util/popupContainer.ts", "../../node_modules/bootstrap.native/src/util/backdrop.ts", "../../node_modules/bootstrap.native/src/util/isVisible.ts", "../../node_modules/bootstrap.native/src/components/modal.ts", "../../node_modules/bootstrap.native/src/components/offcanvas.ts", "../../node_modules/bootstrap.native/src/strings/popoverString.ts", "../../node_modules/bootstrap.native/src/strings/popoverComponent.ts", "../../node_modules/bootstrap.native/src/strings/tooltipString.ts", "../../node_modules/bootstrap.native/src/util/getTipTemplate.ts", "../../node_modules/bootstrap.native/src/util/tipClassPositions.ts", "../../node_modules/bootstrap.native/src/util/styleTip.ts", "../../node_modules/bootstrap.native/src/util/tooltipDefaults.ts", "../../node_modules/bootstrap.native/src/strings/dataOriginalTitle.ts", "../../node_modules/bootstrap.native/src/strings/tooltipComponent.ts", "../../node_modules/bootstrap.native/src/util/setHtml.ts", "../../node_modules/bootstrap.native/src/util/createTip.ts", "../../node_modules/bootstrap.native/src/util/getElementContainer.ts", "../../node_modules/bootstrap.native/src/components/tooltip.ts", "../../node_modules/bootstrap.native/src/components/popover.ts", "../../node_modules/bootstrap.native/src/strings/scrollspyString.ts", "../../node_modules/bootstrap.native/src/strings/scrollspyComponent.ts", "../../node_modules/bootstrap.native/src/components/scrollspy.ts", "../../node_modules/bootstrap.native/src/strings/tabString.ts", "../../node_modules/bootstrap.native/src/strings/tabComponent.ts", "../../node_modules/bootstrap.native/src/components/tab.ts", "../../node_modules/bootstrap.native/src/strings/toastString.ts", "../../node_modules/bootstrap.native/src/strings/toastComponent.ts", "../../node_modules/bootstrap.native/src/components/toast.ts", "../../node_modules/bootstrap.native/src/util/init.ts", "../../assets/js/ui/csrf.js", "../../assets/js/ui/checkbox.js", "../../assets/js/ui/clipboard.js", "../../assets/js/ui/popover.js", "../../assets/js/ui/header.js", "../../assets/js/ui/multiple.js", "../../assets/js/ui/form_change_submit.js", "../../assets/js/ui/autocomplete.js", "../../assets/js/ui/modal_close.js", "../../assets/js/ui/radio_card.js", "../../assets/js/ui/toast.js", "../../node_modules/sortablejs/modular/sortable.esm.js", "../../assets/js/ui/sortable.js", "../../assets/js/ui/collapsible_sub_sidebar.js", "../../assets/js/ui/modal_error.js", "../../assets/js/ui/file_upload.js", "../../assets/js/ui/tags.js", "../../assets/js/ui/facet_dropdowns.js", "../../assets/js/app.js"], - "sourcesContent": ["/**\n * Tagify (v 4.16.4) - tags input component\n * By undefined\n * https://github.com/yairEO/tagify\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in\r\n * all copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n * \r\n * THE SOFTWARE IS NOT PERMISSIBLE TO BE SOLD.\n */\n\n!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).Tagify=e()}(this,(function(){\"use strict\";function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function e(e){for(var s=1;s(t=\"\"+t,e=\"\"+e,s&&(t=t.trim(),e=e.trim()),i?t==e:t.toLowerCase()==e.toLowerCase()),a=(t,e)=>t&&Array.isArray(t)&&t.map((t=>n(t,e)));function n(t,e){var i,s={};for(i in t)e.indexOf(i)<0&&(s[i]=t[i]);return s}function o(t){var e=document.createElement(\"div\");return t.replace(/\\&#?[0-9a-z]+;/gi,(function(t){return e.innerHTML=t,e.innerText}))}function r(t){return(new DOMParser).parseFromString(t.trim(),\"text/html\").body.firstElementChild}function l(t,e){for(e=e||\"previous\";t=t[e+\"Sibling\"];)if(3==t.nodeType)return t}function d(t){return\"string\"==typeof t?t.replace(/&/g,\"&\").replace(//g,\">\").replace(/\"/g,\""\").replace(/`|'/g,\"'\"):t}function h(t){var e=Object.prototype.toString.call(t).split(\" \")[1].slice(0,-1);return t===Object(t)&&\"Array\"!=e&&\"Function\"!=e&&\"RegExp\"!=e&&\"HTMLUnknownElement\"!=e}function g(t,e,i){function s(t,e){for(var i in e)if(e.hasOwnProperty(i)){if(h(e[i])){h(t[i])?s(t[i],e[i]):t[i]=Object.assign({},e[i]);continue}if(Array.isArray(e[i])){t[i]=Object.assign([],e[i]);continue}t[i]=e[i]}}return t instanceof Object||(t={}),s(t,e),i&&s(t,i),t}function p(){const t=[],e={};for(let i of arguments)for(let s of i)h(s)?e[s.value]||(t.push(s),e[s.value]=1):t.includes(s)||t.push(s);return t}function c(t){return String.prototype.normalize?\"string\"==typeof t?t.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g,\"\"):void 0:t}var u=()=>/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent);function m(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)))}function v(t){return t&&t.classList&&t.classList.contains(this.settings.classNames.tag)}var f={delimiters:\",\",pattern:null,tagTextProp:\"value\",maxTags:1/0,callbacks:{},addTagOnBlur:!0,onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\\.|\\:|\\s/,mixTagsInterpolator:[\"[[\",\"]]\"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:()=>{},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:\"\u00A0\"},autoComplete:{enabled:!0,rightKey:!1},classNames:{namespace:\"tagify\",mixMode:\"tagify--mix\",selectMode:\"tagify--select\",input:\"tagify__input\",focus:\"tagify--focus\",tagNoAnimation:\"tagify--noAnim\",tagInvalid:\"tagify--invalid\",tagNotAllowed:\"tagify--notAllowed\",scopeLoading:\"tagify--loading\",hasMaxTags:\"tagify--hasMaxTags\",hasNoTags:\"tagify--noTags\",empty:\"tagify--empty\",inputInvalid:\"tagify__input--invalid\",dropdown:\"tagify__dropdown\",dropdownWrapper:\"tagify__dropdown__wrapper\",dropdownHeader:\"tagify__dropdown__header\",dropdownFooter:\"tagify__dropdown__footer\",dropdownItem:\"tagify__dropdown__item\",dropdownItemActive:\"tagify__dropdown__item--active\",dropdownItemHidden:\"tagify__dropdown__item--hidden\",dropdownInital:\"tagify__dropdown--initial\",tag:\"tagify__tag\",tagText:\"tagify__tag-text\",tagX:\"tagify__tag__removeBtn\",tagLoading:\"tagify__tag--loading\",tagEditing:\"tagify__tag--editable\",tagFlash:\"tagify__tag--flash\",tagHide:\"tagify__tag--hide\"},dropdown:{classname:\"\",enabled:2,maxItems:10,searchKeys:[\"value\",\"searchBy\"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,highlightFirst:!1,closeOnSelect:!0,clearOnSelect:!0,position:\"all\",appendTarget:null},hooks:{beforeRemoveTag:()=>Promise.resolve(),beforePaste:()=>Promise.resolve(),suggestionClick:()=>Promise.resolve()}};function T(){this.dropdown={};for(let t in this._dropdown)this.dropdown[t]=\"function\"==typeof this._dropdown[t]?this._dropdown[t].bind(this):this._dropdown[t];this.dropdown.refs()}var w={refs(){this.DOM.dropdown=this.parseTemplate(\"dropdown\",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector(\"[data-selector='tagify-suggestions-wrapper']\")},getHeaderRef(){return this.DOM.dropdown.querySelector(\"[data-selector='tagify-suggestions-header']\")},getFooterRef(){return this.DOM.dropdown.querySelector(\"[data-selector='tagify-suggestions-footer']\")},getAllSuggestionsRefs(){return[...this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector)]},show(t){var e,i,a,n=this.settings,o=\"mix\"==n.mode&&!n.enforceWhitelist,r=!n.whitelist||!n.whitelist.length,l=\"manual\"==n.dropdown.position;if(t=void 0===t?this.state.inputText:t,!(r&&!o&&!n.templates.dropdownItemNoMatch||!1===n.dropdown.enable||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(t),t&&!this.suggestedListItems.length&&(this.trigger(\"dropdown:noMatch\",t),n.templates.dropdownItemNoMatch&&(a=n.templates.dropdownItemNoMatch.call(this,{value:t}))),!a){if(this.suggestedListItems.length)t&&o&&!this.state.editing.scope&&!s(this.suggestedListItems[0].value,t)&&this.suggestedListItems.unshift({value:t});else{if(!t||!o||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:t}]}i=\"\"+(h(e=this.suggestedListItems[0])?e.value:e),n.autoComplete&&i&&0==i.indexOf(t)&&this.input.autocomplete.suggest.call(this,e)}this.dropdown.fill(a),n.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(n.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=t||!0,this.state.dropdown.query=t,this.setStateSelection(),l||setTimeout((()=>{this.dropdown.position(),this.dropdown.render()})),setTimeout((()=>{this.trigger(\"dropdown:show\",this.DOM.dropdown)}))}},hide(t){var e=this.DOM,i=e.scope,s=e.dropdown,a=\"manual\"==this.settings.dropdown.position&&!t;if(s&&document.body.contains(s)&&!a)return window.removeEventListener(\"resize\",this.dropdown.position),this.dropdown.events.binding.call(this,!1),i.setAttribute(\"aria-expanded\",!1),s.parentNode.removeChild(s),setTimeout((()=>{this.state.dropdown.visible=!1}),100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger(\"dropdown:hide\",s),this},toggle(t){this.dropdown[this.state.dropdown.visible&&!t?\"hide\":\"show\"]()},render(){var t,e,i,s=(t=this.DOM.dropdown,(i=t.cloneNode(!0)).style.cssText=\"position:fixed; top:-9999px; opacity:0\",document.body.appendChild(i),e=i.clientHeight,i.parentNode.removeChild(i),e),a=this.settings;return\"number\"==typeof a.dropdown.enabled&&a.dropdown.enabled>=0?(this.DOM.scope.setAttribute(\"aria-expanded\",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(a.classNames.dropdownInital),this.dropdown.position(s),a.dropdown.appendTarget.appendChild(this.DOM.dropdown),setTimeout((()=>this.DOM.dropdown.classList.remove(a.classNames.dropdownInital)))),this):this},fill(t){t=\"string\"==typeof t?t:this.dropdown.createListHTML(t||this.suggestedListItems);var e,i=this.settings.templates.dropdownContent.call(this,t);this.DOM.dropdown.content.innerHTML=(e=i)?e.replace(/\\>[\\r\\n ]+\\<\").replace(/(<.*?>)|\\s+/g,((t,e)=>e||\" \")):\"\"},fillHeaderFooter(){this.settings.templates;var t=this.dropdown.filterListItems(this.state.dropdown.query),e=this.parseTemplate(\"dropdownHeader\",[t]),i=this.parseTemplate(\"dropdownFooter\",[t]),s=this.dropdown.getHeaderRef(),a=this.dropdown.getFooterRef();e&&s?.parentNode.replaceChild(e,s),i&&a?.parentNode.replaceChild(i,a)},refilter(t){t=t||this.state.dropdown.query||\"\",this.suggestedListItems=this.dropdown.filterListItems(t),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger(\"dropdown:updated\",this.DOM.dropdown)},position(t){var e=this.settings.dropdown;if(\"manual\"!=e.position){var i,s,a,n,o,r,l=this.DOM.dropdown,d=e.placeAbove,h=e.appendTarget===document.body,g=h?window.pageYOffset:e.appendTarget.scrollTop,p=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,c=p.clientHeight,u=Math.max(p.clientWidth||0,window.innerWidth||0)>480?e.position:\"all\",m=this.DOM[\"input\"==u?\"input\":\"scope\"];if(t=t||l.clientHeight,this.state.dropdown.visible){if(\"text\"==u?(a=(i=this.getCaretGlobalPosition()).bottom,s=i.top,n=i.left,o=\"auto\"):(r=function(t){for(var e=0,i=0;t&&t!=p;)e+=t.offsetLeft||0,i+=t.offsetTop||0,t=t.parentNode;return{left:e,top:i}}(e.appendTarget),s=(i=m.getBoundingClientRect()).top-r.top,a=i.bottom-1-r.top,n=i.left-r.left,o=i.width+\"px\"),!h){let t=function(){for(var t=0,i=e.appendTarget.parentNode;i;)t+=i.scrollTop||0,i=i.parentNode;return t}();s+=t,a+=t}s=Math.floor(s),a=Math.ceil(a),d=void 0===d?c-i.bottom0&&void 0!==arguments[0])||arguments[0];var e=this.dropdown.events.callbacks,i=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:e.onKeyDown.bind(this),onMouseOver:e.onMouseOver.bind(this),onMouseLeave:e.onMouseLeave.bind(this),onClick:e.onClick.bind(this),onScroll:e.onScroll.bind(this)},s=t?\"addEventListener\":\"removeEventListener\";\"manual\"!=this.settings.dropdown.position&&(document[s](\"scroll\",i.position,!0),window[s](\"resize\",i.position),window[s](\"keydown\",i.onKeyDown)),this.DOM.dropdown[s](\"mouseover\",i.onMouseOver),this.DOM.dropdown[s](\"mouseleave\",i.onMouseLeave),this.DOM.dropdown[s](\"mousedown\",i.onClick),this.DOM.dropdown.content[s](\"scroll\",i.onScroll)},callbacks:{onKeyDown(t){if(this.state.hasFocus&&!this.state.composing){var e=this.DOM.dropdown.querySelector(this.settings.classNames.dropdownItemActiveSelector),i=this.dropdown.getSuggestionDataByNode(e);switch(t.key){case\"ArrowDown\":case\"ArrowUp\":case\"Down\":case\"Up\":t.preventDefault();var s=this.dropdown.getAllSuggestionsRefs(),a=\"ArrowUp\"==t.key||\"Up\"==t.key;e&&(e=this.dropdown.getNextOrPrevOption(e,!a)),e&&e.matches(this.settings.classNames.dropdownItemSelector)||(e=s[a?s.length-1:0]),i=this.dropdown.getSuggestionDataByNode(e),this.dropdown.highlightOption(e,!0);break;case\"Escape\":case\"Esc\":this.dropdown.hide();break;case\"ArrowRight\":if(this.state.actions.ArrowLeft)return;case\"Tab\":if(\"mix\"!=this.settings.mode&&e&&!this.settings.autoComplete.rightKey&&!this.state.editing){t.preventDefault();var n=this.dropdown.getMappedValue(i);return this.input.autocomplete.set.call(this,n),!1}return!0;case\"Enter\":t.preventDefault(),this.settings.hooks.suggestionClick(t,{tagify:this,tagData:i,suggestionElm:e}).then((()=>{if(e)return this.dropdown.selectOption(e),e=this.dropdown.getNextOrPrevOption(e,!a),void this.dropdown.highlightOption(e);this.dropdown.hide(),\"mix\"!=this.settings.mode&&this.addTags(this.state.inputText.trim(),!0)})).catch((t=>t));break;case\"Backspace\":{if(\"mix\"==this.settings.mode||this.state.editing.scope)return;const t=this.input.raw.call(this);\"\"!=t&&8203!=t.charCodeAt(0)||(!0===this.settings.backspace?this.removeTags():\"edit\"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0))}}}},onMouseOver(t){var e=t.target.closest(this.settings.classNames.dropdownItemSelector);e&&this.dropdown.highlightOption(e)},onMouseLeave(t){this.dropdown.highlightOption()},onClick(t){if(0==t.button&&t.target!=this.DOM.dropdown&&t.target!=this.DOM.dropdown.content){var e=t.target.closest(this.settings.classNames.dropdownItemSelector),i=this.dropdown.getSuggestionDataByNode(e);this.state.actions.selectOption=!0,setTimeout((()=>this.state.actions.selectOption=!1),50),this.settings.hooks.suggestionClick(t,{tagify:this,tagData:i,suggestionElm:e}).then((()=>{e?this.dropdown.selectOption(e,t):this.dropdown.hide()})).catch((t=>console.warn(t)))}},onScroll(t){var e=t.target,i=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger(\"dropdown:scroll\",{percentage:Math.round(i)})}}},getSuggestionDataByNode(t){var e=t&&t.getAttribute(\"value\");return this.suggestedListItems.find((t=>t.value==e))||null},getNextOrPrevOption(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i=this.dropdown.getAllSuggestionsRefs(),s=i.findIndex((e=>e===t));return e?i[s+1]:i[s-1]},highlightOption(t,e){var i,s=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(s),this.state.ddItemElm.removeAttribute(\"aria-selected\")),!t)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);i=this.dropdown.getSuggestionDataByNode(t),this.state.ddItemData=i,this.state.ddItemElm=t,t.classList.add(s),t.setAttribute(\"aria-selected\",!0),e&&(t.parentNode.scrollTop=t.clientHeight+t.offsetTop-t.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,i),this.dropdown.position())},selectOption(t,e){var i=this.settings.dropdown,s=i.clearOnSelect,a=i.closeOnSelect;if(!t)return this.addTags(this.state.inputText,!0),void(a&&this.dropdown.hide());e=e||{};var n=t.getAttribute(\"value\"),o=\"noMatch\"==n,r=this.suggestedListItems.find((t=>(t.value||t)==n));this.trigger(\"dropdown:select\",{data:r,elm:t,event:e}),n&&(r||o)?(this.state.editing?this.onEditTagDone(null,g({__isValid:!0},this.normalizeTags([r])[0])):this[\"mix\"==this.settings.mode?\"addMixTags\":\"addTags\"]([r||this.input.raw.call(this)],s),this.DOM.input.parentNode&&(setTimeout((()=>{this.DOM.input.focus(),this.toggleFocusClass(!0),this.setRangeAtStartEnd(!1)})),a&&setTimeout(this.dropdown.hide.bind(this)),t.addEventListener(\"transitionend\",(()=>{this.dropdown.fillHeaderFooter(),setTimeout((()=>t.remove()),100)}),{once:!0}),t.classList.add(this.settings.classNames.dropdownItemHidden))):a&&setTimeout(this.dropdown.hide.bind(this))},selectAll(t){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems(\"\");var e=this.dropdown.filterListItems(\"\");return t||(e=this.state.dropdown.suggestions),this.addTags(e,!0),this},filterListItems(t,e){var i,s,a,n,o,r=this.settings,l=r.dropdown,d=(e=e||{},[]),g=[],p=r.whitelist,u=l.maxItems>=0?l.maxItems:1/0,m=l.searchKeys,v=0;if(!(t=\"select\"==r.mode&&this.value.length&&this.value[0][r.tagTextProp]==t?\"\":t)||!m.length)return d=l.includeSelectedTags?p:p.filter((t=>!this.isTagDuplicate(h(t)?t.value:t))),this.state.dropdown.suggestions=d,d.slice(0,u);function f(t,e){return e.toLowerCase().split(\" \").every((e=>t.includes(e.toLowerCase())))}for(o=l.caseSensitive?\"\"+t:(\"\"+t).toLowerCase();vm.includes(t)))?[\"value\"]:m;l.fuzzySearch&&!e.exact?(a=u.reduce(((t,e)=>t+\" \"+(i[e]||\"\")),\"\").toLowerCase().trim(),l.accentedSearch&&(a=c(a),o=c(o)),t=0==a.indexOf(o),r=a===o,s=f(a,o)):(t=!0,s=u.some((t=>{var s=\"\"+(i[t]||\"\");return l.accentedSearch&&(s=c(s),o=c(o)),l.caseSensitive||(s=s.toLowerCase()),r=s===o,e.exact?s===o:0==s.indexOf(o)}))),n=!l.includeSelectedTags&&this.isTagDuplicate(h(i)?i.value:i),s&&!n&&(r&&t?g.push(i):\"startsWith\"==l.sortby&&t?d.unshift(i):d.push(i))}return this.state.dropdown.suggestions=g.concat(d),\"function\"==typeof l.sortby?l.sortby(g.concat(d),o):g.concat(d).slice(0,u)},getMappedValue(t){var e=this.settings.dropdown.mapValueTo;return e?\"function\"==typeof e?e(t):t[e]||t.value:t.value},createListHTML(t){return g([],t).map(((t,i)=>{\"string\"!=typeof t&&\"number\"!=typeof t||(t={value:t});var s=this.dropdown.getMappedValue(t);return s=\"string\"==typeof s?d(s):s,this.settings.templates.dropdownItem.apply(this,[e(e({},t),{},{mappedValue:s}),this])})).join(\"\")}};const b=\"@yaireo/tagify/\";var y,x={empty:\"empty\",exceed:\"number of tags exceeded\",pattern:\"pattern mismatch\",duplicate:\"already exists\",notAllowed:\"not allowed\"},D={wrapper:(t,e)=>`\\n \\n ​\\n `,tag(t,e){let i=e.settings;return`\\n \\n
\\n ${t[i.tagTextProp]||t.value}\\n
\\n
`},dropdown(t){var e=t.dropdown,i=\"manual\"==e.position,s=`${t.classNames.dropdown}`;return`
\\n
\\n
`},dropdownContent(t){var e=this.settings,i=this.state.dropdown.suggestions;return`\\n ${e.templates.dropdownHeader.call(this,i)}\\n ${t}\\n ${e.templates.dropdownFooter.call(this,i)}\\n `},dropdownItem(t){return`
${t.mappedValue||t.value}
`},dropdownHeader(t){return`
`},dropdownFooter(t){var e=t.length-this.settings.dropdown.maxItems;return e>0?`
\\n ${e} more items. Refine your search.\\n
`:\"\"},dropdownItemNoMatch:null};var O={customBinding(){this.customEventsList.forEach((t=>{this.on(t,this.settings.callbacks[t])}))},binding(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var e,i=this.events.callbacks,s=t?\"addEventListener\":\"removeEventListener\";if(!this.state.mainEvents||!t){for(var a in this.state.mainEvents=t,t&&!this.listeners.main&&(this.events.bindGlobal.call(this),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on(\"tagify.removeAllTags\",this.removeAllTags.bind(this))),e=this.listeners.main=this.listeners.main||{focus:[\"input\",i.onFocusBlur.bind(this)],keydown:[\"input\",i.onKeydown.bind(this)],click:[\"scope\",i.onClickScope.bind(this)],dblclick:[\"scope\",i.onDoubleClickScope.bind(this)],paste:[\"input\",i.onPaste.bind(this)],drop:[\"input\",i.onDrop.bind(this)],compositionstart:[\"input\",i.onCompositionStart.bind(this)],compositionend:[\"input\",i.onCompositionEnd.bind(this)]})this.DOM[e[a][0]][s](a,e[a][1]);clearInterval(this.listeners.main.originalInputValueObserverInterval),this.listeners.main.originalInputValueObserverInterval=setInterval(i.observeOriginalInputValue.bind(this),500);var n=this.listeners.main.inputMutationObserver||new MutationObserver(i.onInputDOMChange.bind(this));n&&n.disconnect(),\"mix\"==this.settings.mode&&n.observe(this.DOM.input,{childList:!0})}},bindGlobal(t){var e,i=this.events.callbacks,s=t?\"removeEventListener\":\"addEventListener\";if(t||!this.listeners.global)for(e of(this.listeners.global=this.listeners&&this.listeners.global||[{type:this.isIE?\"keydown\":\"input\",target:this.DOM.input,cb:i[this.isIE?\"onInputIE\":\"onInput\"].bind(this)},{type:\"keydown\",target:window,cb:i.onWindowKeyDown.bind(this)},{type:\"blur\",target:this.DOM.input,cb:i.onFocusBlur.bind(this)}],this.listeners.global))e.target[s](e.type,e.cb)},unbindGlobal(){this.events.bindGlobal.call(this,!0)},callbacks:{onFocusBlur(t){var e=this.settings,i=t.target?this.trim(t.target.textContent):\"\",s=this.value?.[0]?.[e.tagTextProp],a=t.type,n=e.dropdown.enabled>=0,o={relatedTarget:t.relatedTarget},r=this.state.actions.selectOption&&(n||!e.dropdown.closeOnSelect),l=this.state.actions.addNew&&n,d=t.relatedTarget&&v.call(this,t.relatedTarget)&&this.DOM.scope.contains(t.relatedTarget);if(\"blur\"==a){if(t.relatedTarget===this.DOM.scope)return this.dropdown.hide(),void this.DOM.input.focus();this.postUpdate(),e.onChangeAfterBlur&&this.triggerChangeEvent()}if(!r&&!l)if(this.state.hasFocus=\"focus\"==a&&+new Date,this.toggleFocusClass(this.state.hasFocus),\"mix\"!=e.mode){if(\"focus\"==a)return this.trigger(\"focus\",o),void(0!==e.dropdown.enabled&&e.userInput||this.dropdown.show(this.value.length?\"\":void 0));\"blur\"==a&&(this.trigger(\"blur\",o),this.loading(!1),\"select\"==e.mode&&(d&&(this.removeTags(),i=\"\"),s===i&&(i=\"\")),i&&!this.state.actions.selectOption&&e.addTagOnBlur&&this.addTags(i,!0)),this.DOM.input.removeAttribute(\"style\"),this.dropdown.hide()}else\"focus\"==a?this.trigger(\"focus\",o):\"blur\"==t.type&&(this.trigger(\"blur\",o),this.loading(!1),this.dropdown.hide(),this.state.dropdown.visible=void 0,this.setStateSelection())},onCompositionStart(t){this.state.composing=!0},onCompositionEnd(t){this.state.composing=!1},onWindowKeyDown(t){var e,i=document.activeElement;if(v.call(this,i)&&this.DOM.scope.contains(document.activeElement))switch(e=i.nextElementSibling,t.key){case\"Backspace\":this.settings.readonly||(this.removeTags(i),(e||this.DOM.input).focus());break;case\"Enter\":setTimeout(this.editTag.bind(this),0,i)}},onKeydown(t){var e=this.settings;if(!this.state.composing&&e.userInput){\"select\"==e.mode&&e.enforceWhitelist&&this.value.length&&\"Tab\"!=t.key&&t.preventDefault();var i=this.trim(t.target.textContent);if(this.trigger(\"keydown\",{event:t}),\"mix\"==e.mode){switch(t.key){case\"Left\":case\"ArrowLeft\":this.state.actions.ArrowLeft=!0;break;case\"Delete\":case\"Backspace\":if(this.state.editing)return;var s,a,n,r=document.getSelection(),d=\"Delete\"==t.key&&r.anchorOffset==(r.anchorNode.length||0),h=r.anchorNode.previousSibling,g=1==r.anchorNode.nodeType||!r.anchorOffset&&h&&1==h.nodeType&&r.anchorNode.previousSibling,p=o(this.DOM.input.innerHTML),c=this.getTagElms();if(\"edit\"==e.backspace&&g)return s=1==r.anchorNode.nodeType?null:r.anchorNode.previousElementSibling,setTimeout(this.editTag.bind(this),0,s),void t.preventDefault();if(u()&&g)return n=l(g),g.hasAttribute(\"readonly\")||g.remove(),this.DOM.input.focus(),void setTimeout((()=>{this.placeCaretAfterNode(n),this.DOM.input.click()}));if(\"BR\"==r.anchorNode.nodeName)return;if((d||g)&&1==r.anchorNode.nodeType?a=0==r.anchorOffset?d?c[0]:null:c[Math.min(c.length,r.anchorOffset)-1]:d?a=r.anchorNode.nextElementSibling:g&&(a=g),3==r.anchorNode.nodeType&&!r.anchorNode.nodeValue&&r.anchorNode.previousElementSibling&&t.preventDefault(),(g||d)&&!e.backspace)return void t.preventDefault();if(\"Range\"!=r.type&&!r.anchorOffset&&r.anchorNode==this.DOM.input&&\"Delete\"!=t.key)return void t.preventDefault();if(\"Range\"!=r.type&&a&&a.hasAttribute(\"readonly\"))return void this.placeCaretAfterNode(l(a));clearTimeout(y),y=setTimeout((()=>{var t=document.getSelection(),e=o(this.DOM.input.innerHTML),i=!d&&t.anchorNode.previousSibling;if(e.length>=p.length&&i)if(v.call(this,i)&&!i.hasAttribute(\"readonly\")){if(this.removeTags(i),this.fixFirefoxLastTagNoCaret(),2==this.DOM.input.children.length&&\"BR\"==this.DOM.input.children[1].tagName)return this.DOM.input.innerHTML=\"\",this.value.length=0,!0}else i.remove();this.value=[].map.call(c,((t,e)=>{var i=this.tagData(t);if(t.parentNode||i.readonly)return i;this.trigger(\"remove\",{tag:t,index:e,data:i})})).filter((t=>t))}),20)}return!0}switch(t.key){case\"Backspace\":\"select\"==e.mode&&e.enforceWhitelist&&this.value.length?this.removeTags():this.state.dropdown.visible&&\"manual\"!=e.dropdown.position||\"\"!=t.target.textContent&&8203!=i.charCodeAt(0)||(!0===e.backspace?this.removeTags():\"edit\"==e.backspace&&setTimeout(this.editTag.bind(this),0));break;case\"Esc\":case\"Escape\":if(this.state.dropdown.visible)return;t.target.blur();break;case\"Down\":case\"ArrowDown\":this.state.dropdown.visible||this.dropdown.show();break;case\"ArrowRight\":{let t=this.state.inputSuggestion||this.state.ddItemData;if(t&&e.autoComplete.rightKey)return void this.addTags([t],!0);break}case\"Tab\":{let s=\"select\"==e.mode;if(!i||s)return!0;t.preventDefault()}case\"Enter\":if(this.state.dropdown.visible&&\"manual\"!=e.dropdown.position)return;t.preventDefault(),setTimeout((()=>{this.state.actions.selectOption||this.addTags(i,!0)}))}}},onInput(t){this.postUpdate();var e=this.settings;if(\"mix\"==e.mode)return this.events.callbacks.onMixTagsInput.call(this,t);var i=this.input.normalize.call(this),s=i.length>=e.dropdown.enabled,a={value:i,inputElm:this.DOM.input},n=this.validateTag({value:i});\"select\"==e.mode&&this.toggleScopeValidation(n),a.isValid=n,this.state.inputText!=i&&(this.input.set.call(this,i,!1),-1!=i.search(e.delimiters)?this.addTags(i)&&this.input.set.call(this):e.dropdown.enabled>=0&&this.dropdown[s?\"show\":\"hide\"](i),this.trigger(\"input\",a))},onMixTagsInput(t){var e,i,s,a,n,o,r,l,d=this.settings,h=this.value.length,p=this.getTagElms(),c=document.createDocumentFragment(),m=window.getSelection().getRangeAt(0),v=[].map.call(p,(t=>this.tagData(t).value));if(\"deleteContentBackward\"==t.inputType&&u()&&this.events.callbacks.onKeydown.call(this,{target:t.target,key:\"Backspace\"}),this.value.slice().forEach((t=>{t.readonly&&!v.includes(t.value)&&c.appendChild(this.createTagElem(t))})),c.childNodes.length&&(m.insertNode(c),this.setRangeAtStartEnd(!1,c.lastChild)),p.length!=h)return this.value=[].map.call(this.getTagElms(),(t=>this.tagData(t))),void this.update({withoutChangeEvent:!0});if(this.hasMaxTags())return!0;if(window.getSelection&&(o=window.getSelection()).rangeCount>0&&3==o.anchorNode.nodeType){if((m=o.getRangeAt(0).cloneRange()).collapse(!0),m.setStart(o.focusNode,0),s=(e=m.toString().slice(0,m.endOffset)).split(d.pattern).length-1,(i=e.match(d.pattern))&&(a=e.slice(e.lastIndexOf(i[i.length-1]))),a){if(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:a.match(d.pattern)[0],value:a.replace(d.pattern,\"\")},this.state.tag.baseOffset=o.baseOffset-this.state.tag.value.length,l=this.state.tag.value.match(d.delimiters))return this.state.tag.value=this.state.tag.value.replace(d.delimiters,\"\"),this.state.tag.delimiters=l[0],this.addTags(this.state.tag.value,d.dropdown.clearOnSelect),void this.dropdown.hide();n=this.state.tag.value.length>=d.dropdown.enabled;try{r=(r=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&r.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch(t){}(r||s{this.update({withoutChangeEvent:!0}),this.trigger(\"input\",g({},this.state.tag,{textContent:this.DOM.input.textContent})),this.state.tag&&this.dropdown[n?\"show\":\"hide\"](this.state.tag.value)}),10)},onInputIE(t){var e=this;setTimeout((function(){e.events.callbacks.onInput.call(e,t)}))},observeOriginalInputValue(){this.DOM.originalInput.parentNode||this.destroy(),this.DOM.originalInput.value!=this.DOM.originalInput.tagifyValue&&this.loadOriginalValues()},onClickScope(t){var e=this.settings,i=t.target.closest(\".\"+e.classNames.tag),s=+new Date-this.state.hasFocus;if(t.target!=this.DOM.scope){if(!t.target.classList.contains(e.classNames.tagX))return i?(this.trigger(\"click\",{tag:i,index:this.getNodeIndex(i),data:this.tagData(i),event:t}),void(1!==e.editTags&&1!==e.editTags.clicks||this.events.callbacks.onDoubleClickScope.call(this,t))):void(t.target==this.DOM.input&&(\"mix\"==e.mode&&this.fixFirefoxLastTagNoCaret(),s>500)?this.state.dropdown.visible?this.dropdown.hide():0===e.dropdown.enabled&&\"mix\"!=e.mode&&this.dropdown.show(this.value.length?\"\":void 0):\"select\"==e.mode&&!this.state.dropdown.visible&&this.dropdown.show());this.removeTags(t.target.parentNode)}else this.state.hasFocus||this.DOM.input.focus()},onPaste(t){t.preventDefault();var e,i,s=this.settings;if(\"select\"==s.mode&&s.enforceWhitelist||!s.userInput)return!1;s.readonly||(e=t.clipboardData||window.clipboardData,i=e.getData(\"Text\"),s.hooks.beforePaste(t,{tagify:this,pastedText:i,clipboardData:e}).then((e=>{void 0===e&&(e=i),e&&(this.injectAtCaret(e,window.getSelection().getRangeAt(0)),\"mix\"==this.settings.mode?this.events.callbacks.onMixTagsInput.call(this,t):this.settings.pasteAsTags?this.addTags(this.state.inputText+e,!0):this.state.inputText=e)})).catch((t=>t)))},onDrop(t){t.preventDefault()},onEditTagInput(t,e){var i=t.closest(\".\"+this.settings.classNames.tag),s=this.getNodeIndex(i),a=this.tagData(i),n=this.input.normalize.call(this,t),o={[this.settings.tagTextProp]:n,__tagId:a.__tagId},r=this.validateTag(o);this.editTagChangeDetected(g(a,o))||!0!==t.originalIsValid||(r=!0),i.classList.toggle(this.settings.classNames.tagInvalid,!0!==r),a.__isValid=r,i.title=!0===r?a.title||a.value:r,n.length>=this.settings.dropdown.enabled&&(this.state.editing&&(this.state.editing.value=n),this.dropdown.show(n)),this.trigger(\"edit:input\",{tag:i,index:s,data:g({},this.value[s],{newValue:n}),event:e})},onEditTagFocus(t){this.state.editing={scope:t,input:t.querySelector(\"[contenteditable]\")}},onEditTagBlur(t){if(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(t)){var e,i,s=this.settings,a=t.closest(\".\"+s.classNames.tag),n=this.input.normalize.call(this,t),o=this.tagData(a),r=o.__originalData,l=this.editTagChangeDetected(o),d=this.validateTag({[s.tagTextProp]:n,__tagId:o.__tagId});if(n)if(l){if(e=this.hasMaxTags(),i=g({},r,{[s.tagTextProp]:this.trim(n),__isValid:d}),s.transformTag.call(this,i,r),!0!==(d=(!e||!0===r.__isValid)&&this.validateTag(i))){if(this.trigger(\"invalid\",{data:i,tag:a,message:d}),s.editTags.keepInvalid)return;s.keepInvalidTags?i.__isValid=d:i=r}else s.keepInvalidTags&&(delete i.title,delete i[\"aria-invalid\"],delete i.class);this.onEditTagDone(a,i)}else this.onEditTagDone(a,r);else this.onEditTagDone(a)}},onEditTagkeydown(t,e){if(!this.state.composing)switch(this.trigger(\"edit:keydown\",{event:t}),t.key){case\"Esc\":case\"Escape\":e.parentNode.replaceChild(e.__tagifyTagData.__originalHTML,e),this.state.editing=!1;case\"Enter\":case\"Tab\":t.preventDefault(),t.target.blur()}},onDoubleClickScope(t){var e,i,s=t.target.closest(\".\"+this.settings.classNames.tag),a=this.tagData(s),n=this.settings;s&&n.userInput&&!1!==a.editable&&(e=s.classList.contains(this.settings.classNames.tagEditing),i=s.hasAttribute(\"readonly\"),\"select\"==n.mode||n.readonly||e||i||!this.settings.editTags||this.editTag(s),this.toggleFocusClass(!0),this.trigger(\"dblclick\",{tag:s,index:this.getNodeIndex(s),data:this.tagData(s)}))},onInputDOMChange(t){t.forEach((t=>{t.addedNodes.forEach((t=>{if(\"

\"==t.outerHTML)t.replaceWith(document.createElement(\"br\"));else if(1==t.nodeType&&t.querySelector(this.settings.classNames.tagSelector)){let e=document.createTextNode(\"\");3==t.childNodes[0].nodeType&&\"BR\"!=t.previousSibling.nodeName&&(e=document.createTextNode(\"\\n\")),t.replaceWith(e,...[...t.childNodes].slice(0,-1)),this.placeCaretAfterNode(e)}else if(v.call(this,t)&&(3!=t.previousSibling?.nodeType||t.previousSibling.textContent||t.previousSibling.remove(),t.previousSibling&&\"BR\"==t.previousSibling.nodeName)){t.previousSibling.replaceWith(\"\\n\u200B\");let e=t.nextSibling,i=\"\";for(;e;)i+=e.textContent,e=e.nextSibling;i.trim()&&this.placeCaretAfterNode(t.previousSibling)}})),t.removedNodes.forEach((t=>{t&&\"BR\"==t.nodeName&&v.call(this,e)&&(this.removeTags(e),this.fixFirefoxLastTagNoCaret())}))}));var e=this.DOM.input.lastChild;e&&\"\"==e.nodeValue&&e.remove(),e&&\"BR\"==e.nodeName||this.DOM.input.appendChild(document.createElement(\"br\"))}}};function M(t,e){if(!t){console.warn(\"Tagify:\",\"input element not found\",t);const e=new Proxy(this,{get:()=>()=>e});return e}if(t.__tagify)return console.warn(\"Tagify: \",\"input element is already Tagified - Same instance is returned.\",t),t.__tagify;var i;g(this,function(t){var e=document.createTextNode(\"\");function i(t,i,s){s&&i.split(/\\s+/g).forEach((i=>e[t+\"EventListener\"].call(e,i,s)))}return{off(t,e){return i(\"remove\",t,e),this},on(t,e){return e&&\"function\"==typeof e&&i(\"add\",t,e),this},trigger(i,s,a){var n;if(a=a||{cloneData:!0},i)if(t.settings.isJQueryPlugin)\"remove\"==i&&(i=\"removeTag\"),jQuery(t.DOM.originalInput).triggerHandler(i,[s]);else{try{var o=\"object\"==typeof s?s:{value:s};if((o=a.cloneData?g({},o):o).tagify=this,s.event&&(o.event=this.cloneEvent(s.event)),s instanceof Object)for(var r in s)s[r]instanceof HTMLElement&&(o[r]=s[r]);n=new CustomEvent(i,{detail:o})}catch(t){console.warn(t)}e.dispatchEvent(n)}}}}(this)),this.isFirefox=\"undefined\"!=typeof InstallTrigger,this.isIE=window.document.documentMode,e=e||{},this.getPersistedData=(i=e.id,t=>{let e,s=\"/\"+t;if(1==localStorage.getItem(b+i+\"/v\",1))try{e=JSON.parse(localStorage[b+i+s])}catch(t){}return e}),this.setPersistedData=(t=>t?(localStorage.setItem(b+t+\"/v\",1),(e,i)=>{let s=\"/\"+i,a=JSON.stringify(e);e&&i&&(localStorage.setItem(b+t+s,a),dispatchEvent(new Event(\"storage\")))}):()=>{})(e.id),this.clearPersistedData=(t=>e=>{const i=b+\"/\"+t+\"/\";if(e)localStorage.removeItem(i+e);else for(let t in localStorage)t.includes(i)&&localStorage.removeItem(t)})(e.id),this.applySettings(t,e),this.state={inputText:\"\",editing:!1,composing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},this.build(t),T.call(this),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),t.autofocus&&this.DOM.input.focus(),t.__tagify=this}return M.prototype={_dropdown:w,helpers:{sameStr:s,removeCollectionProp:a,omit:n,isObject:h,parseHTML:r,escapeHTML:d,extend:g,concatWithoutDups:p,getUID:m,isNodeTag:v},customEventsList:[\"change\",\"add\",\"remove\",\"invalid\",\"input\",\"click\",\"keydown\",\"focus\",\"blur\",\"edit:input\",\"edit:beforeUpdate\",\"edit:updated\",\"edit:start\",\"edit:keydown\",\"dropdown:show\",\"dropdown:hide\",\"dropdown:select\",\"dropdown:updated\",\"dropdown:noMatch\",\"dropdown:scroll\"],dataProps:[\"__isValid\",\"__removed\",\"__originalData\",\"__originalHTML\",\"__tagId\"],trim(t){return this.settings.trim&&t&&\"string\"==typeof t?t.trim():t},parseHTML:r,templates:D,parseTemplate(t,e){return t=this.settings.templates[t]||t,this.parseHTML(t.apply(this,e))},set whitelist(t){const e=t&&Array.isArray(t);this.settings.whitelist=e?t:[],this.setPersistedData(e?t:[],\"whitelist\")},get whitelist(){return this.settings.whitelist},generateClassSelectors(t){for(let e in t){let i=e;Object.defineProperty(t,i+\"Selector\",{get(){return\".\"+this[i].split(\" \")[0]}})}},applySettings(t,i){f.templates=this.templates;var s=this.settings=g({},f,i);if(s.disabled=t.hasAttribute(\"disabled\"),s.readonly=s.readonly||t.hasAttribute(\"readonly\"),s.placeholder=d(t.getAttribute(\"placeholder\")||s.placeholder||\"\"),s.required=t.hasAttribute(\"required\"),this.generateClassSelectors(s.classNames),void 0===s.dropdown.includeSelectedTags&&(s.dropdown.includeSelectedTags=s.duplicates),this.isIE&&(s.autoComplete=!1),[\"whitelist\",\"blacklist\"].forEach((e=>{var i=t.getAttribute(\"data-\"+e);i&&(i=i.split(s.delimiters))instanceof Array&&(s[e]=i)})),\"autoComplete\"in i&&!h(i.autoComplete)&&(s.autoComplete=f.autoComplete,s.autoComplete.enabled=i.autoComplete),\"mix\"==s.mode&&(s.autoComplete.rightKey=!0,s.delimiters=i.delimiters||null,s.tagTextProp&&!s.dropdown.searchKeys.includes(s.tagTextProp)&&s.dropdown.searchKeys.push(s.tagTextProp)),t.pattern)try{s.pattern=new RegExp(t.pattern)}catch(t){}if(s.delimiters){s._delimiters=s.delimiters;try{s.delimiters=new RegExp(this.settings.delimiters,\"g\")}catch(t){}}s.disabled&&(s.userInput=!1),this.TEXTS=e(e({},x),s.texts||{}),\"select\"!=s.mode&&s.userInput||(s.dropdown.enabled=0),s.dropdown.appendTarget=i.dropdown&&i.dropdown.appendTarget?i.dropdown.appendTarget:document.body;let a=this.getPersistedData(\"whitelist\");Array.isArray(a)&&(this.whitelist=Array.isArray(s.whitelist)?p(s.whitelist,a):a)},getAttributes(t){var e,i=this.getCustomAttributes(t),s=\"\";for(e in i)s+=\" \"+e+(void 0!==t[e]?`=\"${i[e]}\"`:\"\");return s},getCustomAttributes(t){if(!h(t))return\"\";var e,i={};for(e in t)\"__\"!=e.slice(0,2)&&\"class\"!=e&&t.hasOwnProperty(e)&&void 0!==t[e]&&(i[e]=d(t[e]));return i},setStateSelection(){var t=window.getSelection(),e={anchorOffset:t.anchorOffset,anchorNode:t.anchorNode,range:t.getRangeAt&&t.rangeCount&&t.getRangeAt(0)};return this.state.selection=e,e},getCaretGlobalPosition(){const t=document.getSelection();if(t.rangeCount){const e=t.getRangeAt(0),i=e.startContainer,s=e.startOffset;let a,n;if(s>0)return n=document.createRange(),n.setStart(i,s-1),n.setEnd(i,s),a=n.getBoundingClientRect(),{left:a.right,top:a.top,bottom:a.bottom};if(i.getBoundingClientRect)return i.getBoundingClientRect()}return{left:-9999,top:-9999}},getCSSVars(){var t=getComputedStyle(this.DOM.scope,null);var e;this.CSSVars={tagHideTransition:(t=>{let e=t.value;return\"s\"==t.unit?1e3*e:e})(function(t){if(!t)return{};var e=(t=t.trim().split(\" \")[0]).split(/\\d+/g).filter((t=>t)).pop().trim();return{value:+t.split(e).filter((t=>t))[0].trim(),unit:e}}((e=\"tag-hide-transition\",t.getPropertyValue(\"--\"+e))))}},build(t){var e=this.DOM;this.settings.mixMode.integrated?(e.originalInput=null,e.scope=t,e.input=t):(e.originalInput=t,e.originalInput_tabIndex=t.tabIndex,e.scope=this.parseTemplate(\"wrapper\",[t,this.settings]),e.input=e.scope.querySelector(this.settings.classNames.inputSelector),t.parentNode.insertBefore(e.scope,t),t.tabIndex=-1)},destroy(){this.events.unbindGlobal.call(this),this.DOM.scope.parentNode.removeChild(this.DOM.scope),this.DOM.originalInput.tabIndex=this.DOM.originalInput_tabIndex,delete this.DOM.originalInput.__tagify,this.dropdown.hide(!0),clearTimeout(this.dropdownHide__bindEventsTimeout),clearInterval(this.listeners.main.originalInputValueObserverInterval)},loadOriginalValues(t){var e,i=this.settings;if(this.state.blockChangeEvent=!0,void 0===t){const e=this.getPersistedData(\"value\");t=e&&!this.DOM.originalInput.value?e:i.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value}if(this.removeAllTags(),t)if(\"mix\"==i.mode)this.parseMixTags(this.trim(t)),(e=this.DOM.input.lastChild)&&\"BR\"==e.tagName||this.DOM.input.insertAdjacentHTML(\"beforeend\",\"
\");else{try{JSON.parse(t)instanceof Array&&(t=JSON.parse(t))}catch(t){}this.addTags(t,!0).forEach((t=>t&&t.classList.add(i.classNames.tagNoAnimation)))}else this.postUpdate();this.state.lastOriginalValueReported=i.mixMode.integrated?\"\":this.DOM.originalInput.value,this.state.blockChangeEvent=!1},cloneEvent(t){var e={};for(var i in t)\"path\"!=i&&(e[i]=t[i]);return e},loading(t){return this.state.isLoading=t,this.DOM.scope.classList[t?\"add\":\"remove\"](this.settings.classNames.scopeLoading),this},tagLoading(t,e){return t&&t.classList[e?\"add\":\"remove\"](this.settings.classNames.tagLoading),this},toggleClass(t,e){\"string\"==typeof t&&this.DOM.scope.classList.toggle(t,e)},toggleScopeValidation(t){var e=!0===t||void 0===t;!this.settings.required&&t&&t===this.TEXTS.empty&&(e=!0),this.toggleClass(this.settings.classNames.tagInvalid,!e),this.DOM.scope.title=e?\"\":t},toggleFocusClass(t){this.toggleClass(this.settings.classNames.focus,!!t)},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var t=this.DOM.originalInput,e=this.state.lastOriginalValueReported!==t.value,i=new CustomEvent(\"change\",{bubbles:!0});e&&(this.state.lastOriginalValueReported=t.value,i.simulated=!0,t._valueTracker&&t._valueTracker.setValue(Math.random()),t.dispatchEvent(i),this.trigger(\"change\",this.state.lastOriginalValueReported),t.value=this.state.lastOriginalValueReported)}},events:O,fixFirefoxLastTagNoCaret(){},placeCaretAfterNode(t){if(t&&t.parentNode){var e=t,i=window.getSelection(),s=i.getRangeAt(0);i.rangeCount&&(s.setStartAfter(e||t),s.collapse(!0),i.removeAllRanges(),i.addRange(s))}},insertAfterTag(t,e){if(e=e||this.settings.mixMode.insertAfterTag,t&&t.parentNode&&e)return e=\"string\"==typeof e?document.createTextNode(e):e,t.parentNode.insertBefore(e,t.nextSibling),e},editTagChangeDetected(t){var e=t.__originalData;for(var i in e)if(!this.dataProps.includes(i)&&t[i]!=e[i])return!0;return!1},getTagTextNode(t){return t.querySelector(this.settings.classNames.tagTextSelector)},setTagTextNode(t,e){this.getTagTextNode(t).innerHTML=d(e)},editTag(t,e){t=t||this.getLastTag(),e=e||{},this.dropdown.hide();var i=this.settings,s=this.getTagTextNode(t),a=this.getNodeIndex(t),n=this.tagData(t),o=this.events.callbacks,r=this,l=!0;if(s){if(!(n instanceof Object&&\"editable\"in n)||n.editable)return n=this.tagData(t,{__originalData:g({},n),__originalHTML:t.cloneNode(!0)}),this.tagData(n.__originalHTML,n.__originalData),s.setAttribute(\"contenteditable\",!0),t.classList.add(i.classNames.tagEditing),s.addEventListener(\"focus\",o.onEditTagFocus.bind(this,t)),s.addEventListener(\"blur\",(function(){setTimeout((()=>o.onEditTagBlur.call(r,r.getTagTextNode(t))))})),s.addEventListener(\"input\",o.onEditTagInput.bind(this,s)),s.addEventListener(\"keydown\",(e=>o.onEditTagkeydown.call(this,e,t))),s.addEventListener(\"compositionstart\",o.onCompositionStart.bind(this)),s.addEventListener(\"compositionend\",o.onCompositionEnd.bind(this)),e.skipValidation||(l=this.editTagToggleValidity(t)),s.originalIsValid=l,this.trigger(\"edit:start\",{tag:t,index:a,data:n,isValid:l}),s.focus(),this.setRangeAtStartEnd(!1,s),this}else console.warn(\"Cannot find element in Tag template: .\",i.classNames.tagTextSelector)},editTagToggleValidity(t,e){var i;if(e=e||this.tagData(t))return(i=!(\"__isValid\"in e)||!0===e.__isValid)||this.removeTagsFromValue(t),this.update(),t.classList.toggle(this.settings.classNames.tagNotAllowed,!i),e.__isValid;console.warn(\"tag has no data: \",t,e)},onEditTagDone(t,e){e=e||{};var i={tag:t=t||this.state.editing.scope,index:this.getNodeIndex(t),previousData:this.tagData(t),data:e};this.trigger(\"edit:beforeUpdate\",i,{cloneData:!1}),this.state.editing=!1,delete e.__originalData,delete e.__originalHTML,t&&e[this.settings.tagTextProp]?(t=this.replaceTag(t,e),this.editTagToggleValidity(t,e),this.settings.a11y.focusableTags?t.focus():this.placeCaretAfterNode(t)):t&&this.removeTags(t),this.trigger(\"edit:updated\",i),this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag(t,e){e&&e.value||(e=t.__tagifyTagData),e.__isValid&&1!=e.__isValid&&g(e,this.getInvalidTagAttrs(e,e.__isValid));var i=this.createTagElem(e);return t.parentNode.replaceChild(i,t),this.updateValueByDOMTags(),i},updateValueByDOMTags(){this.value.length=0,[].forEach.call(this.getTagElms(),(t=>{t.classList.contains(this.settings.classNames.tagNotAllowed.split(\" \")[0])||this.value.push(this.tagData(t))})),this.update()},setRangeAtStartEnd(t,e){t=\"number\"==typeof t?t:!!t,e=(e=e||this.DOM.input).lastChild||e;var i=document.getSelection();try{i.rangeCount>=1&&[\"Start\",\"End\"].forEach((s=>i.getRangeAt(0)[\"set\"+s](e,t||e.length)))}catch(t){}},injectAtCaret(t,e){return!(e=e||this.state.selection?.range)&&t?(this.appendMixTags(t),this):(\"string\"==typeof t&&(t=document.createTextNode(t)),e.deleteContents(),e.insertNode(t),this.setRangeAtStartEnd(!1,t),this.updateValueByDOMTags(),this.update(),this)},input:{set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\",e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i=this.settings.dropdown.closeOnSelect;this.state.inputText=t,e&&(this.DOM.input.innerHTML=d(\"\"+t)),!t&&i&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw(){return this.DOM.input.textContent},validate(){var t=!this.state.inputText||!0===this.validateTag({value:this.state.inputText});return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!t),t},normalize(t){var e=t||this.DOM.input,i=[];e.childNodes.forEach((t=>3==t.nodeType&&i.push(t.nodeValue))),i=i.join(\"\\n\");try{i=i.replace(/(?:\\r\\n|\\r|\\n)/g,this.settings.delimiters.source.charAt(0))}catch(t){}return i=i.replace(/\\s/g,\" \"),this.trim(i)},autocomplete:{suggest(t){if(this.settings.autoComplete.enabled){\"string\"==typeof(t=t||{})&&(t={value:t});var e=t.value?\"\"+t.value:\"\",i=e.substr(0,this.state.inputText.length).toLowerCase(),s=e.substring(this.state.inputText.length);e&&this.state.inputText&&i==this.state.inputText.toLowerCase()?(this.DOM.input.setAttribute(\"data-suggest\",s),this.state.inputSuggestion=t):(this.DOM.input.removeAttribute(\"data-suggest\"),delete this.state.inputSuggestion)}},set(t){var e=this.DOM.input.getAttribute(\"data-suggest\"),i=t||(e?this.state.inputText+e:null);return!!i&&(\"mix\"==this.settings.mode?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+i)):(this.input.set.call(this,i),this.setRangeAtStartEnd()),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx(t){return this.value.findIndex((e=>e.__tagId==(t||{}).__tagId))},getNodeIndex(t){var e=0;if(t)for(;t=t.previousElementSibling;)e++;return e},getTagElms(){for(var t=arguments.length,e=new Array(t),i=0;it?(e&&(t.__tagifyTagData=i?e:g({},t.__tagifyTagData||{},e)),t.__tagifyTagData):(console.warn(\"tag element doesn't exist\",t,e),e),isTagDuplicate(t,e,i){var a=0;if(\"select\"==this.settings.mode)return!1;for(let n of this.value){s(this.trim(\"\"+t),n.value,e)&&i!=n.__tagId&&a++}return a},getTagIndexByValue(t){var e=[];return this.getTagElms().forEach(((i,a)=>{s(this.trim(i.textContent),t,this.settings.dropdown.caseSensitive)&&e.push(a)})),e},getTagElmByValue(t){var e=this.getTagIndexByValue(t)[0];return this.getTagElms()[e]},flashTag(t){t&&(t.classList.add(this.settings.classNames.tagFlash),setTimeout((()=>{t.classList.remove(this.settings.classNames.tagFlash)}),100))},isTagBlacklisted(t){return t=this.trim(t.toLowerCase()),this.settings.blacklist.filter((e=>(\"\"+e).toLowerCase()==t)).length},isTagWhitelisted(t){return!!this.getWhitelistItem(t)},getWhitelistItem(t,e,i){e=e||\"value\";var a,n=this.settings;return(i=i||n.whitelist).some((i=>{var o=\"string\"==typeof i?i:i[e]||i.value;if(s(o,t,n.dropdown.caseSensitive,n.trim))return a=\"string\"==typeof i?{value:i}:i,!0})),a||\"value\"!=e||\"value\"==n.tagTextProp||(a=this.getWhitelistItem(t,n.tagTextProp,i)),a},validateTag(t){var e=this.settings,i=\"value\"in t?\"value\":e.tagTextProp,s=this.trim(t[i]+\"\");return(t[i]+\"\").trim()?e.pattern&&e.pattern instanceof RegExp&&!e.pattern.test(s)?this.TEXTS.pattern:!e.duplicates&&this.isTagDuplicate(s,e.dropdown.caseSensitive,t.__tagId)?this.TEXTS.duplicate:this.isTagBlacklisted(s)||e.enforceWhitelist&&!this.isTagWhitelisted(s)?this.TEXTS.notAllowed:!e.validate||e.validate(t):this.TEXTS.empty},getInvalidTagAttrs(t,e){return{\"aria-invalid\":!0,class:`${t.class||\"\"} ${this.settings.classNames.tagNotAllowed}`.trim(),title:e}},hasMaxTags(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},setReadonly(t,e){var i=this.settings;document.activeElement.blur(),i[e||\"readonly\"]=t,this.DOM.scope[(t?\"set\":\"remove\")+\"Attribute\"](e||\"readonly\",!0),this.setContentEditable(!t)},setContentEditable(t){this.settings.userInput&&(this.DOM.input.contentEditable=t,this.DOM.input.tabIndex=t?0:-1)},setDisabled(t){this.setReadonly(t,\"disabled\")},normalizeTags(t){var e=this.settings,i=e.whitelist,s=e.delimiters,a=e.mode,n=e.tagTextProp;e.enforceWhitelist;var o=[],r=!!i&&i[0]instanceof Object,l=Array.isArray(t),d=l&&t[0].value,h=t=>(t+\"\").split(s).filter((t=>t)).map((t=>({[n]:this.trim(t),value:this.trim(t)})));if(\"number\"==typeof t&&(t=t.toString()),\"string\"==typeof t){if(!t.trim())return[];t=h(t)}else l&&(t=[].concat(...t.map((t=>t.value?t:h(t)))));return r&&!d&&(t.forEach((t=>{var e=o.map((t=>t.value)),i=this.dropdown.filterListItems.call(this,t[n],{exact:!0});this.settings.duplicates||(i=i.filter((t=>!e.includes(t.value))));var s=i.length>1?this.getWhitelistItem(t[n],n,i):i[0];s&&s instanceof Object?o.push(s):\"mix\"!=a&&(null==t.value&&(t.value=t[n]),o.push(t))})),o.length&&(t=o)),t},parseMixTags(t){var e=this.settings,i=e.mixTagsInterpolator,s=e.duplicates,a=e.transformTag,n=e.enforceWhitelist,o=e.maxTags,r=e.tagTextProp,l=[];return t=t.split(i[0]).map(((t,e)=>{var d,h,g,p=t.split(i[1]),c=p[0],u=l.length==o;try{if(c==+c)throw Error;h=JSON.parse(c)}catch(t){h=this.normalizeTags(c)[0]||{value:c}}if(a.call(this,h),u||!(p.length>1)||n&&!this.isTagWhitelisted(h.value)||!s&&this.isTagDuplicate(h.value)){if(t)return e?i[0]+t:t}else h[d=h[r]?r:\"value\"]=this.trim(h[d]),g=this.createTagElem(h),l.push(h),g.classList.add(this.settings.classNames.tagNoAnimation),p[0]=g.outerHTML,this.value.push(h);return p.join(\"\")})).join(\"\"),this.DOM.input.innerHTML=t,this.DOM.input.appendChild(document.createTextNode(\"\")),this.DOM.input.normalize(),this.getTagElms().forEach(((t,e)=>this.tagData(t,l[e]))),this.update({withoutChangeEvent:!0}),t},replaceTextWithNode(t,e){if(this.state.tag||e){e=e||this.state.tag.prefix+this.state.tag.value;var i,s,a=this.state.selection||window.getSelection(),n=a.anchorNode,o=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return n.splitText(a.anchorOffset-o),-1==(i=n.nodeValue.lastIndexOf(e))?!0:(s=n.splitText(i),t&&n.parentNode.replaceChild(t,s),!0)}},selectTag(t,e){var i=this.settings;if(!i.enforceWhitelist||this.isTagWhitelisted(e.value)){this.input.set.call(this,e[i.tagTextProp]||e.value,!0),this.state.actions.selectOption&&setTimeout(this.setRangeAtStartEnd.bind(this));var s=this.getLastTag();return s?this.replaceTag(s,e):this.appendTag(t),this.value[0]=e,this.update(),this.trigger(\"add\",{tag:t,data:e}),[t]}},addEmptyTag(t){var e=g({value:\"\"},t||{}),i=this.createTagElem(e);this.tagData(i,e),this.appendTag(i),this.editTag(i,{skipValidation:!0})},addTags(t,e,i){var s=[],a=this.settings,n=[],o=document.createDocumentFragment();if(i=i||a.skipInvalid,!t||0==t.length)return s;switch(t=this.normalizeTags(t),a.mode){case\"mix\":return this.addMixTags(t);case\"select\":e=!1,this.removeAllTags()}return this.DOM.input.removeAttribute(\"style\"),t.forEach((t=>{var e,r={},l=Object.assign({},t,{value:t.value+\"\"});if(t=Object.assign({},l),a.transformTag.call(this,t),t.__isValid=this.hasMaxTags()||this.validateTag(t),!0!==t.__isValid){if(i)return;if(g(r,this.getInvalidTagAttrs(t,t.__isValid),{__preInvalidData:l}),t.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(t.value)),!a.createInvalidTags)return void n.push(t.value)}if(\"readonly\"in t&&(t.readonly?r[\"aria-readonly\"]=!0:delete t.readonly),e=this.createTagElem(t,r),s.push(e),\"select\"==a.mode)return this.selectTag(e,t);o.appendChild(e),t.__isValid&&!0===t.__isValid?(this.value.push(t),this.trigger(\"add\",{tag:e,index:this.value.length-1,data:t})):(this.trigger(\"invalid\",{data:t,index:this.value.length,tag:e,message:t.__isValid}),a.keepInvalidTags||setTimeout((()=>this.removeTags(e,!0)),1e3)),this.dropdown.position()})),this.appendTag(o),this.update(),t.length&&e&&(this.input.set.call(this,a.createInvalidTags?\"\":n.join(a._delimiters)),this.setRangeAtStartEnd()),a.dropdown.enabled&&this.dropdown.refilter(),s},addMixTags(t){if((t=this.normalizeTags(t))[0].prefix||this.state.tag)return this.prefixedTextToTag(t[0]);\"string\"==typeof t&&(t=[{value:t}]),this.state.selection;var e=document.createDocumentFragment();return t.forEach((t=>{var i=this.createTagElem(t);e.appendChild(i),this.insertAfterTag(i)})),this.appendMixTags(e),e},appendMixTags(t){var e=!!this.state.selection;e?this.injectAtCaret(t):(this.DOM.input.focus(),(e=this.setStateSelection()).range.setStart(this.DOM.input,e.range.endOffset),e.range.setEnd(this.DOM.input,e.range.endOffset),this.DOM.input.appendChild(t),this.updateValueByDOMTags(),this.update())},prefixedTextToTag(t){var e,i=this.settings,s=this.state.tag.delimiters;if(i.transformTag.call(this,t),t.prefix=t.prefix||this.state.tag?this.state.tag.prefix:(i.pattern.source||i.pattern)[0],e=this.createTagElem(t),this.replaceTextWithNode(e)||this.DOM.input.appendChild(e),setTimeout((()=>e.classList.add(this.settings.classNames.tagNoAnimation)),300),this.value.push(t),this.update(),!s){var a=this.insertAfterTag(e)||e;this.placeCaretAfterNode(a)}return this.state.tag=null,this.trigger(\"add\",g({},{tag:e},{data:t})),e},appendTag(t){var e=this.DOM,i=e.input;i===e.input?e.scope.insertBefore(t,i):e.scope.appendChild(t)},createTagElem(t,i){t.__tagId=m();var s,a=g({},t,e({value:d(t.value+\"\")},i));return function(t){for(var e,i=document.createNodeIterator(t,NodeFilter.SHOW_TEXT,null,!1);e=i.nextNode();)e.textContent.trim()||e.parentNode.removeChild(e)}(s=this.parseTemplate(\"tag\",[a,this])),this.tagData(s,t),s},reCheckInvalidTags(){var t=this.settings;this.getTagElms(t.classNames.tagNotAllowed).forEach(((e,i)=>{var s=this.tagData(e),a=this.hasMaxTags(),n=this.validateTag(s),o=!0===n&&!a;if(\"select\"==t.mode&&this.toggleScopeValidation(n),o)return s=s.__preInvalidData?s.__preInvalidData:{value:s.value},this.replaceTag(e,s);e.title=a||n}))},removeTags(t,e,i){var s,a=this.settings;if(t=t&&t instanceof HTMLElement?[t]:t instanceof Array?t:t?[t]:[this.getLastTag()],s=t.reduce(((t,e)=>{e&&\"string\"==typeof e&&(e=this.getTagElmByValue(e));var i=this.tagData(e);return e&&i&&!i.readonly&&t.push({node:e,idx:this.getTagIdx(i),data:this.tagData(e,{__removed:!0})}),t}),[]),i=\"number\"==typeof i?i:this.CSSVars.tagHideTransition,\"select\"==a.mode&&(i=0,this.input.set.call(this)),1==s.length&&\"select\"!=a.mode&&s[0].node.classList.contains(a.classNames.tagNotAllowed)&&(e=!0),s.length)return a.hooks.beforeRemoveTag(s,{tagify:this}).then((()=>{function t(t){t.node.parentNode&&(t.node.parentNode.removeChild(t.node),e?a.keepInvalidTags&&this.trigger(\"remove\",{tag:t.node,index:t.idx}):(this.trigger(\"remove\",{tag:t.node,index:t.idx,data:t.data}),this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),a.keepInvalidTags&&this.reCheckInvalidTags()))}i&&i>10&&1==s.length?function(e){e.node.style.width=parseFloat(window.getComputedStyle(e.node).width)+\"px\",document.body.clientTop,e.node.classList.add(a.classNames.tagHide),setTimeout(t.bind(this),i,e)}.call(this,s[0]):s.forEach(t.bind(this)),e||(this.removeTagsFromValue(s.map((t=>t.node))),this.update(),\"select\"==a.mode&&this.setContentEditable(!0))})).catch((t=>{}))},removeTagsFromDOM(){[].slice.call(this.getTagElms()).forEach((t=>t.parentNode.removeChild(t)))},removeTagsFromValue(t){(t=Array.isArray(t)?t:[t]).forEach((t=>{var e=this.tagData(t),i=this.getTagIdx(e);i>-1&&this.value.splice(i,1)}))},removeAllTags(t){t=t||{},this.value=[],\"mix\"==this.settings.mode?this.DOM.input.innerHTML=\"\":this.removeTagsFromDOM(),this.dropdown.refilter(),this.dropdown.position(),this.state.dropdown.visible&&setTimeout((()=>{this.DOM.input.focus()})),\"select\"==this.settings.mode&&(this.input.set.call(this),this.setContentEditable(!0)),this.update(t)},postUpdate(){var t=this.settings,e=t.classNames,i=\"mix\"==t.mode?t.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(e.hasMaxTags,this.value.length>=t.maxTags),this.toggleClass(e.hasNoTags,!this.value.length),this.toggleClass(e.empty,!i),\"select\"==t.mode&&this.toggleScopeValidation(this.value?.[0]?.__isValid)},setOriginalInputValue(t){var e=this.DOM.originalInput;this.settings.mixMode.integrated||(e.value=t,e.tagifyValue=e.value,this.setPersistedData(t,\"value\"))},update(t){var e=this.getInputValue();this.setOriginalInputValue(e),this.postUpdate(),this.settings.onChangeAfterBlur&&(t||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent()},getInputValue(){var t=this.getCleanValue();return\"mix\"==this.settings.mode?this.getMixedTagsAsString(t):t.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(t):JSON.stringify(t):\"\"},getCleanValue(t){return a(t||this.value,this.dataProps)},getMixedTagsAsString(){var t=\"\",e=this,i=this.settings,s=i.originalInputValueFormat||JSON.stringify,a=i.mixTagsInterpolator;return function i(o){o.childNodes.forEach((o=>{if(1==o.nodeType){const r=e.tagData(o);if(\"BR\"==o.tagName&&(t+=\"\\r\\n\"),r&&v.call(e,o)){if(r.__removed)return;t+=a[0]+s(n(r,e.dataProps))+a[1]}else o.getAttribute(\"style\")||[\"B\",\"I\",\"U\"].includes(o.tagName)?t+=o.textContent:\"DIV\"!=o.tagName&&\"P\"!=o.tagName||(t+=\"\\r\\n\",i(o))}else t+=o.textContent}))}(this.DOM.input),t}},M.prototype.removeTag=M.prototype.removeTags,M}));\n", "(function() {\n function maybeRemoveMe(elt) {\n var timing = elt.getAttribute('remove-me') || elt.getAttribute('data-remove-me')\n if (timing) {\n setTimeout(function() {\n elt.parentElement.removeChild(elt)\n }, htmx.parseInterval(timing))\n }\n }\n\n htmx.defineExtension('remove-me', {\n onEvent: function(name, evt) {\n if (name === 'htmx:afterProcessNode') {\n var elt = evt.detail.elt\n if (elt.getAttribute) {\n maybeRemoveMe(elt)\n if (elt.querySelectorAll) {\n var children = elt.querySelectorAll('[remove-me], [data-remove-me]')\n for (var i = 0; i < children.length; i++) {\n maybeRemoveMe(children[i])\n }\n }\n }\n }\n }\n })\n})()\n", "var htmx = (function() {\n 'use strict'\n\n // Public API\n const htmx = {\n // Tsc madness here, assigning the functions directly results in an invalid TypeScript output, but reassigning is fine\n /* Event processing */\n /** @type {typeof onLoadHelper} */\n onLoad: null,\n /** @type {typeof processNode} */\n process: null,\n /** @type {typeof addEventListenerImpl} */\n on: null,\n /** @type {typeof removeEventListenerImpl} */\n off: null,\n /** @type {typeof triggerEvent} */\n trigger: null,\n /** @type {typeof ajaxHelper} */\n ajax: null,\n /* DOM querying helpers */\n /** @type {typeof find} */\n find: null,\n /** @type {typeof findAll} */\n findAll: null,\n /** @type {typeof closest} */\n closest: null,\n /**\n * Returns the input values that would resolve for a given element via the htmx value resolution mechanism\n *\n * @see https://htmx.org/api/#values\n *\n * @param {Element} elt the element to resolve values on\n * @param {HttpVerb} type the request type (e.g. **get** or **post**) non-GET's will include the enclosing form of the element. Defaults to **post**\n * @returns {Object}\n */\n values: function(elt, type) {\n const inputValues = getInputValues(elt, type || 'post')\n return inputValues.values\n },\n /* DOM manipulation helpers */\n /** @type {typeof removeElement} */\n remove: null,\n /** @type {typeof addClassToElement} */\n addClass: null,\n /** @type {typeof removeClassFromElement} */\n removeClass: null,\n /** @type {typeof toggleClassOnElement} */\n toggleClass: null,\n /** @type {typeof takeClassForElement} */\n takeClass: null,\n /** @type {typeof swap} */\n swap: null,\n /* Extension entrypoints */\n /** @type {typeof defineExtension} */\n defineExtension: null,\n /** @type {typeof removeExtension} */\n removeExtension: null,\n /* Debugging */\n /** @type {typeof logAll} */\n logAll: null,\n /** @type {typeof logNone} */\n logNone: null,\n /* Debugging */\n /**\n * The logger htmx uses to log with\n *\n * @see https://htmx.org/api/#logger\n */\n logger: null,\n /**\n * A property holding the configuration htmx uses at runtime.\n *\n * Note that using a [meta tag](https://htmx.org/docs/#config) is the preferred mechanism for setting these properties.\n *\n * @see https://htmx.org/api/#config\n */\n config: {\n /**\n * Whether to use history.\n * @type boolean\n * @default true\n */\n historyEnabled: true,\n /**\n * The number of pages to keep in **localStorage** for history support.\n * @type number\n * @default 10\n */\n historyCacheSize: 10,\n /**\n * @type boolean\n * @default false\n */\n refreshOnHistoryMiss: false,\n /**\n * The default swap style to use if **[hx-swap](https://htmx.org/attributes/hx-swap)** is omitted.\n * @type HtmxSwapStyle\n * @default 'innerHTML'\n */\n defaultSwapStyle: 'innerHTML',\n /**\n * The default delay between receiving a response from the server and doing the swap.\n * @type number\n * @default 0\n */\n defaultSwapDelay: 0,\n /**\n * The default delay between completing the content swap and settling attributes.\n * @type number\n * @default 20\n */\n defaultSettleDelay: 20,\n /**\n * If true, htmx will inject a small amount of CSS into the page to make indicators invisible unless the **htmx-indicator** class is present.\n * @type boolean\n * @default true\n */\n includeIndicatorStyles: true,\n /**\n * The class to place on indicators when a request is in flight.\n * @type string\n * @default 'htmx-indicator'\n */\n indicatorClass: 'htmx-indicator',\n /**\n * The class to place on triggering elements when a request is in flight.\n * @type string\n * @default 'htmx-request'\n */\n requestClass: 'htmx-request',\n /**\n * The class to temporarily place on elements that htmx has added to the DOM.\n * @type string\n * @default 'htmx-added'\n */\n addedClass: 'htmx-added',\n /**\n * The class to place on target elements when htmx is in the settling phase.\n * @type string\n * @default 'htmx-settling'\n */\n settlingClass: 'htmx-settling',\n /**\n * The class to place on target elements when htmx is in the swapping phase.\n * @type string\n * @default 'htmx-swapping'\n */\n swappingClass: 'htmx-swapping',\n /**\n * Allows the use of eval-like functionality in htmx, to enable **hx-vars**, trigger conditions & script tag evaluation. Can be set to **false** for CSP compatibility.\n * @type boolean\n * @default true\n */\n allowEval: true,\n /**\n * If set to false, disables the interpretation of script tags.\n * @type boolean\n * @default true\n */\n allowScriptTags: true,\n /**\n * If set, the nonce will be added to inline scripts.\n * @type string\n * @default ''\n */\n inlineScriptNonce: '',\n /**\n * If set, the nonce will be added to inline styles.\n * @type string\n * @default ''\n */\n inlineStyleNonce: '',\n /**\n * The attributes to settle during the settling phase.\n * @type string[]\n * @default ['class', 'style', 'width', 'height']\n */\n attributesToSettle: ['class', 'style', 'width', 'height'],\n /**\n * Allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates.\n * @type boolean\n * @default false\n */\n withCredentials: false,\n /**\n * @type number\n * @default 0\n */\n timeout: 0,\n /**\n * The default implementation of **getWebSocketReconnectDelay** for reconnecting after unexpected connection loss by the event code **Abnormal Closure**, **Service Restart** or **Try Again Later**.\n * @type {'full-jitter' | ((retryCount:number) => number)}\n * @default \"full-jitter\"\n */\n wsReconnectDelay: 'full-jitter',\n /**\n * The type of binary data being received over the WebSocket connection\n * @type BinaryType\n * @default 'blob'\n */\n wsBinaryType: 'blob',\n /**\n * @type string\n * @default '[hx-disable], [data-hx-disable]'\n */\n disableSelector: '[hx-disable], [data-hx-disable]',\n /**\n * @type {'auto' | 'instant' | 'smooth'}\n * @default 'smooth'\n */\n scrollBehavior: 'instant',\n /**\n * If the focused element should be scrolled into view.\n * @type boolean\n * @default false\n */\n defaultFocusScroll: false,\n /**\n * If set to true htmx will include a cache-busting parameter in GET requests to avoid caching partial responses by the browser\n * @type boolean\n * @default false\n */\n getCacheBusterParam: false,\n /**\n * If set to true, htmx will use the View Transition API when swapping in new content.\n * @type boolean\n * @default false\n */\n globalViewTransitions: false,\n /**\n * htmx will format requests with these methods by encoding their parameters in the URL, not the request body\n * @type {(HttpVerb)[]}\n * @default ['get', 'delete']\n */\n methodsThatUseUrlParams: ['get', 'delete'],\n /**\n * If set to true, disables htmx-based requests to non-origin hosts.\n * @type boolean\n * @default false\n */\n selfRequestsOnly: true,\n /**\n * If set to true htmx will not update the title of the document when a title tag is found in new content\n * @type boolean\n * @default false\n */\n ignoreTitle: false,\n /**\n * Whether the target of a boosted element is scrolled into the viewport.\n * @type boolean\n * @default true\n */\n scrollIntoViewOnBoost: true,\n /**\n * The cache to store evaluated trigger specifications into.\n * You may define a simple object to use a never-clearing cache, or implement your own system using a [proxy object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy)\n * @type {Object|null}\n * @default null\n */\n triggerSpecsCache: null,\n /** @type boolean */\n disableInheritance: false,\n /** @type HtmxResponseHandlingConfig[] */\n responseHandling: [\n { code: '204', swap: false },\n { code: '[23]..', swap: true },\n { code: '[45]..', swap: false, error: true }\n ],\n /**\n * Whether to process OOB swaps on elements that are nested within the main response element.\n * @type boolean\n * @default true\n */\n allowNestedOobSwaps: true\n },\n /** @type {typeof parseInterval} */\n parseInterval: null,\n /** @type {typeof internalEval} */\n _: null,\n version: '2.0.0'\n }\n // Tsc madness part 2\n htmx.onLoad = onLoadHelper\n htmx.process = processNode\n htmx.on = addEventListenerImpl\n htmx.off = removeEventListenerImpl\n htmx.trigger = triggerEvent\n htmx.ajax = ajaxHelper\n htmx.find = find\n htmx.findAll = findAll\n htmx.closest = closest\n htmx.remove = removeElement\n htmx.addClass = addClassToElement\n htmx.removeClass = removeClassFromElement\n htmx.toggleClass = toggleClassOnElement\n htmx.takeClass = takeClassForElement\n htmx.swap = swap\n htmx.defineExtension = defineExtension\n htmx.removeExtension = removeExtension\n htmx.logAll = logAll\n htmx.logNone = logNone\n htmx.parseInterval = parseInterval\n htmx._ = internalEval\n\n const internalAPI = {\n addTriggerHandler,\n bodyContains,\n canAccessLocalStorage,\n findThisElement,\n filterValues,\n swap,\n hasAttribute,\n getAttributeValue,\n getClosestAttributeValue,\n getClosestMatch,\n getExpressionVars,\n getHeaders,\n getInputValues,\n getInternalData,\n getSwapSpecification,\n getTriggerSpecs,\n getTarget,\n makeFragment,\n mergeObjects,\n makeSettleInfo,\n oobSwap,\n querySelectorExt,\n settleImmediately,\n shouldCancel,\n triggerEvent,\n triggerErrorEvent,\n withExtensions\n }\n\n const VERBS = ['get', 'post', 'put', 'delete', 'patch']\n const VERB_SELECTOR = VERBS.map(function(verb) {\n return '[hx-' + verb + '], [data-hx-' + verb + ']'\n }).join(', ')\n\n const HEAD_TAG_REGEX = makeTagRegEx('head')\n\n //= ===================================================================\n // Utilities\n //= ===================================================================\n\n /**\n * @param {string} tag\n * @param {boolean} global\n * @returns {RegExp}\n */\n function makeTagRegEx(tag, global = false) {\n return new RegExp(`<${tag}(\\\\s[^>]*>|>)([\\\\s\\\\S]*?)<\\\\/${tag}>`,\n global ? 'gim' : 'im')\n }\n\n /**\n * Parses an interval string consistent with the way htmx does. Useful for plugins that have timing-related attributes.\n *\n * Caution: Accepts an int followed by either **s** or **ms**. All other values use **parseFloat**\n *\n * @see https://htmx.org/api/#parseInterval\n *\n * @param {string} str timing string\n * @returns {number|undefined}\n */\n function parseInterval(str) {\n if (str == undefined) {\n return undefined\n }\n\n let interval = NaN\n if (str.slice(-2) == 'ms') {\n interval = parseFloat(str.slice(0, -2))\n } else if (str.slice(-1) == 's') {\n interval = parseFloat(str.slice(0, -1)) * 1000\n } else if (str.slice(-1) == 'm') {\n interval = parseFloat(str.slice(0, -1)) * 1000 * 60\n } else {\n interval = parseFloat(str)\n }\n return isNaN(interval) ? undefined : interval\n }\n\n /**\n * @param {Node} elt\n * @param {string} name\n * @returns {(string | null)}\n */\n function getRawAttribute(elt, name) {\n return elt instanceof Element && elt.getAttribute(name)\n }\n\n /**\n * @param {Element} elt\n * @param {string} qualifiedName\n * @returns {boolean}\n */\n // resolve with both hx and data-hx prefixes\n function hasAttribute(elt, qualifiedName) {\n return !!elt.hasAttribute && (elt.hasAttribute(qualifiedName) ||\n elt.hasAttribute('data-' + qualifiedName))\n }\n\n /**\n *\n * @param {Node} elt\n * @param {string} qualifiedName\n * @returns {(string | null)}\n */\n function getAttributeValue(elt, qualifiedName) {\n return getRawAttribute(elt, qualifiedName) || getRawAttribute(elt, 'data-' + qualifiedName)\n }\n\n /**\n * @param {Node} elt\n * @returns {Node | null}\n */\n function parentElt(elt) {\n const parent = elt.parentElement\n if (!parent && elt.parentNode instanceof ShadowRoot) return elt.parentNode\n return parent\n }\n\n /**\n * @returns {Document}\n */\n function getDocument() {\n return document\n }\n\n /**\n * @param {Node} elt\n * @param {boolean} global\n * @returns {Node|Document}\n */\n function getRootNode(elt, global) {\n return elt.getRootNode ? elt.getRootNode({ composed: global }) : getDocument()\n }\n\n /**\n * @param {Node} elt\n * @param {(e:Node) => boolean} condition\n * @returns {Node | null}\n */\n function getClosestMatch(elt, condition) {\n while (elt && !condition(elt)) {\n elt = parentElt(elt)\n }\n\n return elt || null\n }\n\n /**\n * @param {Element} initialElement\n * @param {Element} ancestor\n * @param {string} attributeName\n * @returns {string|null}\n */\n function getAttributeValueWithDisinheritance(initialElement, ancestor, attributeName) {\n const attributeValue = getAttributeValue(ancestor, attributeName)\n const disinherit = getAttributeValue(ancestor, 'hx-disinherit')\n var inherit = getAttributeValue(ancestor, 'hx-inherit')\n if (initialElement !== ancestor) {\n if (htmx.config.disableInheritance) {\n if (inherit && (inherit === '*' || inherit.split(' ').indexOf(attributeName) >= 0)) {\n return attributeValue\n } else {\n return null\n }\n }\n if (disinherit && (disinherit === '*' || disinherit.split(' ').indexOf(attributeName) >= 0)) {\n return 'unset'\n }\n }\n return attributeValue\n }\n\n /**\n * @param {Element} elt\n * @param {string} attributeName\n * @returns {string | null}\n */\n function getClosestAttributeValue(elt, attributeName) {\n let closestAttr = null\n getClosestMatch(elt, function(e) {\n return !!(closestAttr = getAttributeValueWithDisinheritance(elt, asElement(e), attributeName))\n })\n if (closestAttr !== 'unset') {\n return closestAttr\n }\n }\n\n /**\n * @param {Node} elt\n * @param {string} selector\n * @returns {boolean}\n */\n function matches(elt, selector) {\n // @ts-ignore: non-standard properties for browser compatibility\n // noinspection JSUnresolvedVariable\n const matchesFunction = elt instanceof Element && (elt.matches || elt.matchesSelector || elt.msMatchesSelector || elt.mozMatchesSelector || elt.webkitMatchesSelector || elt.oMatchesSelector)\n return !!matchesFunction && matchesFunction.call(elt, selector)\n }\n\n /**\n * @param {string} str\n * @returns {string}\n */\n function getStartTag(str) {\n const tagMatcher = /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i\n const match = tagMatcher.exec(str)\n if (match) {\n return match[1].toLowerCase()\n } else {\n return ''\n }\n }\n\n /**\n * @param {string} resp\n * @returns {Document}\n */\n function parseHTML(resp) {\n const parser = new DOMParser()\n return parser.parseFromString(resp, 'text/html')\n }\n\n /**\n * @param {DocumentFragment} fragment\n * @param {Node} elt\n */\n function takeChildrenFor(fragment, elt) {\n while (elt.childNodes.length > 0) {\n fragment.append(elt.childNodes[0])\n }\n }\n\n /**\n * @param {HTMLScriptElement} script\n * @returns {HTMLScriptElement}\n */\n function duplicateScript(script) {\n const newScript = getDocument().createElement('script')\n forEach(script.attributes, function(attr) {\n newScript.setAttribute(attr.name, attr.value)\n })\n newScript.textContent = script.textContent\n newScript.async = false\n if (htmx.config.inlineScriptNonce) {\n newScript.nonce = htmx.config.inlineScriptNonce\n }\n return newScript\n }\n\n /**\n * @param {HTMLScriptElement} script\n * @returns {boolean}\n */\n function isJavaScriptScriptNode(script) {\n return script.matches('script') && (script.type === 'text/javascript' || script.type === 'module' || script.type === '')\n }\n\n /**\n * we have to make new copies of script tags that we are going to insert because\n * SOME browsers (not saying who, but it involves an element and an animal) don't\n * execute scripts created in