From 8a7c7586348eb5ee37921f861a565217575c9f73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BF=AB=E4=B9=90=E4=B8=A4=E5=B0=8F=E6=97=B6?=
 <1164601554@qq.com>
Date: Wed, 18 Dec 2024 17:54:52 +0800
Subject: [PATCH] =?UTF-8?q?API=EF=BC=9A=E5=AF=B9=E8=AF=9D=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

未完成
---
 dist/bunny.js    |  2 +-
 doc/dialog.md    | 13 +++++++++++++
 highlight.min.js |  2 +-
 index.html       |  2 ++
 src/bunny.js     | 10 ++++++++++
 src/index.js     |  4 +++-
 6 files changed, 30 insertions(+), 3 deletions(-)
 create mode 100644 doc/dialog.md
 create mode 100644 src/bunny.js

diff --git a/dist/bunny.js b/dist/bunny.js
index 887c06c..48fc4ae 100644
--- a/dist/bunny.js
+++ b/dist/bunny.js
@@ -1 +1 @@
-(()=>{"use strict";var __webpack_modules__={335:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var htmx=function(){const htmx={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){return getInputValues(e,t||"post").values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,allowScriptTags:!0,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:!0,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null,disableInheritance:!1,responseHandling:[{code:"204",swap:!1},{code:"[23]..",swap:!0},{code:"[45]..",swap:!1,error:!0}],allowNestedOobSwaps:!0},parseInterval:null,_:null,version:"2.0.2"};htmx.onLoad=onLoadHelper,htmx.process=processNode,htmx.on=addEventListenerImpl,htmx.off=removeEventListenerImpl,htmx.trigger=triggerEvent,htmx.ajax=ajaxHelper,htmx.find=find,htmx.findAll=findAll,htmx.closest=closest,htmx.remove=removeElement,htmx.addClass=addClassToElement,htmx.removeClass=removeClassFromElement,htmx.toggleClass=toggleClassOnElement,htmx.takeClass=takeClassForElement,htmx.swap=swap,htmx.defineExtension=defineExtension,htmx.removeExtension=removeExtension,htmx.logAll=logAll,htmx.logNone=logNone,htmx.parseInterval=parseInterval,htmx._=internalEval;const internalAPI={addTriggerHandler,bodyContains,canAccessLocalStorage,findThisElement,filterValues,swap,hasAttribute,getAttributeValue,getClosestAttributeValue,getClosestMatch,getExpressionVars,getHeaders,getInputValues,getInternalData,getSwapSpecification,getTriggerSpecs,getTarget,makeFragment,mergeObjects,makeSettleInfo,oobSwap,querySelectorExt,settleImmediately,shouldCancel,triggerEvent,triggerErrorEvent,withExtensions},VERBS=["get","post","put","delete","patch"],VERB_SELECTOR=VERBS.map((function(e){return"[hx-"+e+"], [data-hx-"+e+"]"})).join(", "),HEAD_TAG_REGEX=makeTagRegEx("head");function makeTagRegEx(e,t=!1){return new RegExp(`<${e}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${e}>`,t?"gim":"im")}function parseInterval(e){if(null==e)return;let t=NaN;return t="ms"==e.slice(-2)?parseFloat(e.slice(0,-2)):"s"==e.slice(-1)?1e3*parseFloat(e.slice(0,-1)):"m"==e.slice(-1)?1e3*parseFloat(e.slice(0,-1))*60: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){const 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){const r=getAttributeValue(t,n),o=getAttributeValue(t,"hx-disinherit");var a=getAttributeValue(t,"hx-inherit");if(e!==t){if(htmx.config.disableInheritance)return a&&("*"===a||a.split(" ").indexOf(n)>=0)?r:null;if(o&&("*"===o||o.split(" ").indexOf(n)>=0))return"unset"}return r}function getClosestAttributeValue(e,t){let n=null;if(getClosestMatch(e,(function(r){return!!(n=getAttributeValueWithDisinheritance(e,asElement(r),t))})),"unset"!==n)return n}function matches(e,t){const 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){const t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(e);return t?t[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){const t=getDocument().createElement("script");return forEach(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),t.textContent=e.textContent,t.async=!1,htmx.config.inlineScriptNonce&&(t.nonce=htmx.config.inlineScriptNonce),t}function isJavaScriptScriptNode(e){return e.matches("script")&&("text/javascript"===e.type||"module"===e.type||""===e.type)}function normalizeScriptTags(e){Array.from(e.querySelectorAll("script")).forEach((e=>{if(isJavaScriptScriptNode(e)){const t=duplicateScript(e),n=e.parentNode;try{n.insertBefore(t,e)}catch(e){logError(e)}finally{e.remove()}}}))}function makeFragment(e){const t=e.replace(HEAD_TAG_REGEX,""),n=getStartTag(t);let r;if("html"===n){r=new DocumentFragment;const t=parseHTML(e);takeChildrenFor(r,t.body),r.title=t.title}else if("body"===n){r=new DocumentFragment;const e=parseHTML(t);takeChildrenFor(r,e.body),r.title=e.title}else{const e=parseHTML('<body><template class="internal-htmx-wrapper">'+t+"</template></body>");r=e.querySelector("template").content,r.title=e.title;var o=r.querySelector("title");o&&o.parentNode===r&&(o.remove(),r.title=o.innerText)}return r&&(htmx.config.allowScriptTags?normalizeScriptTags(r):r.querySelectorAll("script").forEach((e=>e.remove()))),r}function maybeCall(e){e&&e()}function isType(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function isFunction(e){return"function"==typeof e}function isRawObject(e){return isType(e,"Object")}function getInternalData(e){const t="htmx-internal-data";let n=e[t];return n||(n=e[t]={}),n}function toArray(e){const t=[];if(e)for(let n=0;n<e.length;n++)t.push(e[n]);return t}function forEach(e,t){if(e)for(let n=0;n<e.length;n++)t(e[n])}function isScrolledIntoView(e){const t=e.getBoundingClientRect(),n=t.top,r=t.bottom;return n<window.innerHeight&&r>=0}function bodyContains(e){const 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(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function parseJSON(e){try{return JSON.parse(e)}catch(e){return logError(e),null}}function canAccessLocalStorage(){const e="htmx:localStorageTest";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}function normalizePath(e){try{const t=new URL(e);return t&&(e=t.pathname+t.search),/^\/$/.test(e)||(e=e.replace(/\/+$/,"")),e}catch(t){return e}}function internalEval(str){return maybeEval(getDocument().body,(function(){return eval(str)}))}function onLoadHelper(e){return htmx.on("htmx:load",(function(t){e(t.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"string"!=typeof e?e.querySelector(t):find(getDocument(),e)}function findAll(e,t){return"string"!=typeof e?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"string"==typeof e?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)))&&(n?getWindow().setTimeout((function(){addClassToElement(e,t),e=null}),n):e.classList&&e.classList.add(t))}function removeClassFromElement(e,t,n){let r=asElement(resolveTarget(e));r&&(n?getWindow().setTimeout((function(){removeClassFromElement(r,t),r=null}),n):r.classList&&(r.classList.remove(t),0===r.classList.length&&r.removeAttribute("class")))}function toggleClassOnElement(e,t){(e=resolveTarget(e)).classList.toggle(t)}function takeClassForElement(e,t){forEach((e=resolveTarget(e)).parentElement.children,(function(e){removeClassFromElement(e,t)})),addClassToElement(asElement(e),t)}function closest(e,t){if((e=asElement(resolveTarget(e)))&&e.closest)return e.closest(t);do{if(null==e||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){const t=e.trim();return startsWith(t,"<")&&endsWith(t,"/>")?t.substring(1,t.length-2):t}function querySelectorAllExt(e,t,n){return e=resolveTarget(e),0===t.indexOf("closest ")?[closest(asElement(e),normalizeSelector(t.substr(8)))]:0===t.indexOf("find ")?[find(asParentNode(e),normalizeSelector(t.substr(5)))]:"next"===t?[asElement(e).nextElementSibling]:0===t.indexOf("next ")?[scanForwardQuery(e,normalizeSelector(t.substr(5)),!!n)]:"previous"===t?[asElement(e).previousElementSibling]:0===t.indexOf("previous ")?[scanBackwardsQuery(e,normalizeSelector(t.substr(9)),!!n)]:"document"===t?[document]:"window"===t?[window]:"body"===t?[document.body]:"root"===t?[getRootNode(e,!!n)]:0===t.indexOf("global ")?querySelectorAllExt(e,t.slice(7),!0):toArray(asParentNode(getRootNode(e,!!n)).querySelectorAll(normalizeSelector(t)))}var scanForwardQuery=function(e,t,n){const r=asParentNode(getRootNode(e,n)).querySelectorAll(t);for(let t=0;t<r.length;t++){const n=r[t];if(n.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING)return n}},scanBackwardsQuery=function(e,t,n){const r=asParentNode(getRootNode(e,n)).querySelectorAll(t);for(let t=r.length-1;t>=0;t--){const n=r[t];if(n.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING)return n}};function querySelectorExt(e,t){return"string"!=typeof e?querySelectorAllExt(e,t)[0]:querySelectorAllExt(getDocument().body,e)[0]}function resolveTarget(e,t){return"string"==typeof e?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(){const r=processEventArgs(e,t,n);r.target.addEventListener(r.event,r.listener)})),isFunction(t)?t:n}function removeEventListenerImpl(e,t,n){return ready((function(){const r=processEventArgs(e,t,n);r.target.removeEventListener(r.event,r.listener)})),isFunction(t)?t:n}const DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(e,t){const n=getClosestAttributeValue(e,t);if(n){if("this"===n)return[findThisElement(e,t)];{const r=querySelectorAllExt(e,n);return 0===r.length?(logError('The selector "'+n+'" on '+t+" returned no matches!"),[DUMMY_ELT]):r}}}function findThisElement(e,t){return asElement(getClosestMatch(e,(function(e){return null!=getAttributeValue(asElement(e),t)})))}function getTarget(e){const t=getClosestAttributeValue(e,"hx-target");return t?"this"===t?findThisElement(e,"hx-target"):querySelectorExt(e,t):getInternalData(e).boosted?getDocument().body:e}function shouldSettleAttribute(e){const t=htmx.config.attributesToSettle;for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1}function cloneAttributes(e,t){forEach(e.attributes,(function(n){!t.hasAttribute(n.name)&&shouldSettleAttribute(n.name)&&e.removeAttribute(n.name)})),forEach(t.attributes,(function(t){shouldSettleAttribute(t.name)&&e.setAttribute(t.name,t.value)}))}function isInlineSwap(e,t){const n=getExtensions(t);for(let t=0;t<n.length;t++){const r=n[t];try{if(r.isInlineSwap(e))return!0}catch(e){logError(e)}}return"outerHTML"===e}function oobSwap(e,t,n){let r="#"+getRawAttribute(t,"id"),o="outerHTML";"true"===e||(e.indexOf(":")>0?(o=e.substr(0,e.indexOf(":")),r=e.substr(e.indexOf(":")+1,e.length)):o=e);const a=getDocument().querySelectorAll(r);return a?(forEach(a,(function(e){let r;const a=t.cloneNode(!0);r=getDocument().createDocumentFragment(),r.appendChild(a),isInlineSwap(o,e)||(r=asParentNode(a));const s={shouldSwap:!0,target:e,fragment:r};triggerEvent(e,"htmx:oobBeforeSwap",s)&&(e=s.target,s.shouldSwap&&swapWithStyle(o,e,e,r,n),forEach(n.elts,(function(e){triggerEvent(e,"htmx:oobAfterSwap",s)})))})),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(e){const t=getAttributeValue(e,"id"),n=getDocument().getElementById(t);null!=n&&e.parentNode.replaceChild(n,e)}))}function handleAttributes(e,t,n){forEach(t.querySelectorAll("[id]"),(function(t){const r=getRawAttribute(t,"id");if(r&&r.length>0){const o=r.replace("'","\\'"),a=t.tagName.replace(":","\\:"),s=asParentNode(e),i=s&&s.querySelector(a+"[id='"+o+"']");if(i&&i!==s){const e=t.cloneNode();cloneAttributes(t,i),n.tasks.push((function(){cloneAttributes(t,e)}))}}}))}function makeAjaxLoadTask(e){return function(){removeClassFromElement(e,htmx.config.addedClass),processNode(asElement(e)),processFocus(asParentNode(e)),triggerEvent(e,"htmx:load")}}function processFocus(e){const t="[autofocus]",n=asHtmlElement(matches(e,t)?e:e.querySelector(t));null!=n&&n.focus()}function insertNodesBefore(e,t,n,r){for(handleAttributes(e,n,r);n.childNodes.length>0;){const o=n.firstChild;addClassToElement(asElement(o),htmx.config.addedClass),e.insertBefore(o,t),o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE&&r.tasks.push(makeAjaxLoadTask(o))}}function stringHash(e,t){let n=0;for(;n<e.length;)t=(t<<5)-t+e.charCodeAt(n++)|0;return t}function attributeHash(e){let t=0;if(e.attributes)for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n];r.value&&(t=stringHash(r.name,t),t=stringHash(r.value,t))}return t}function deInitOnHandlers(e){const t=getInternalData(e);if(t.onHandlers){for(let n=0;n<t.onHandlers.length;n++){const r=t.onHandlers[n];removeEventListenerImpl(e,r.event,r.listener)}delete t.onHandlers}}function deInitNode(e){const t=getInternalData(e);t.timeout&&clearTimeout(t.timeout),t.listenerInfos&&forEach(t.listenerInfos,(function(e){e.on&&removeEventListenerImpl(e.on,e.trigger,e.listener)})),deInitOnHandlers(e),forEach(Object.keys(t),(function(e){delete t[e]}))}function cleanUpElement(e){triggerEvent(e,"htmx:beforeCleanupElement"),deInitNode(e),e.children&&forEach(e.children,(function(e){cleanUpElement(e)}))}function swapOuterHTML(e,t,n){if(e instanceof Element&&"BODY"===e.tagName)return swapInnerHTML(e,t,n);let r;const o=e.previousSibling;for(insertNodesBefore(parentElt(e),e,t,n),r=null==o?parentElt(e).firstChild:o.nextSibling,n.elts=n.elts.filter((function(t){return t!==e}));r&&r!==e;)r instanceof Element&&n.elts.push(r),r=r.nextSibling;cleanUpElement(e),e instanceof Element?e.remove():e.parentNode.removeChild(e)}function swapAfterBegin(e,t,n){return insertNodesBefore(e,e.firstChild,t,n)}function swapBeforeBegin(e,t,n){return insertNodesBefore(parentElt(e),e,t,n)}function swapBeforeEnd(e,t,n){return insertNodesBefore(e,null,t,n)}function swapAfterEnd(e,t,n){return insertNodesBefore(parentElt(e),e.nextSibling,t,n)}function swapDelete(e){return cleanUpElement(e),parentElt(e).removeChild(e)}function swapInnerHTML(e,t,n){const r=e.firstChild;if(insertNodesBefore(e,r,t,n),r){for(;r.nextSibling;)cleanUpElement(r.nextSibling),e.removeChild(r.nextSibling);cleanUpElement(r),e.removeChild(r)}}function swapWithStyle(e,t,n,r,o){switch(e){case"none":return;case"outerHTML":return void swapOuterHTML(n,r,o);case"afterbegin":return void swapAfterBegin(n,r,o);case"beforebegin":return void swapBeforeBegin(n,r,o);case"beforeend":return void swapBeforeEnd(n,r,o);case"afterend":return void swapAfterEnd(n,r,o);case"delete":return void swapDelete(n);default:var a=getExtensions(t);for(let t=0;t<a.length;t++){const s=a[t];try{const t=s.handleSwap(e,n,r,o);if(t){if(Array.isArray(t))for(let e=0;e<t.length;e++){const n=t[e];n.nodeType!==Node.TEXT_NODE&&n.nodeType!==Node.COMMENT_NODE&&o.tasks.push(makeAjaxLoadTask(n))}return}}catch(e){logError(e)}}"innerHTML"===e?swapInnerHTML(n,r,o):swapWithStyle(htmx.config.defaultSwapStyle,t,n,r,o)}}function findAndSwapOobElements(e,t){var n=findAll(e,"[hx-swap-oob], [data-hx-swap-oob]");return forEach(n,(function(e){if(htmx.config.allowNestedOobSwaps||null===e.parentElement){const n=getAttributeValue(e,"hx-swap-oob");null!=n&&oobSwap(n,e,t)}else e.removeAttribute("hx-swap-oob"),e.removeAttribute("data-hx-swap-oob")})),n.length>0}function swap(e,t,n,r){r||(r={}),e=resolveTarget(e);const o=document.activeElement;let a={};try{a={elt:o,start:o?o.selectionStart:null,end:o?o.selectionEnd:null}}catch(e){}const s=makeSettleInfo(e);if("textContent"===n.swapStyle)e.textContent=t;else{let o=makeFragment(t);if(s.title=o.title,r.selectOOB){const e=r.selectOOB.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(":",2);let r=n[0].trim();0===r.indexOf("#")&&(r=r.substring(1));const a=n[1]||"true",i=o.querySelector("#"+r);i&&oobSwap(a,i,s)}}if(findAndSwapOobElements(o,s),forEach(findAll(o,"template"),(function(e){findAndSwapOobElements(e.content,s)&&e.remove()})),r.select){const e=getDocument().createDocumentFragment();forEach(o.querySelectorAll(r.select),(function(t){e.appendChild(t)})),o=e}handlePreservedElements(o),swapWithStyle(n.swapStyle,r.contextElement,e,o,s)}if(a.elt&&!bodyContains(a.elt)&&getRawAttribute(a.elt,"id")){const e=document.getElementById(getRawAttribute(a.elt,"id")),t={preventScroll:void 0!==n.focusScroll?!n.focusScroll:!htmx.config.defaultFocusScroll};if(e){if(a.start&&e.setSelectionRange)try{e.setSelectionRange(a.start,a.end)}catch(e){}e.focus(t)}}e.classList.remove(htmx.config.swappingClass),forEach(s.elts,(function(e){e.classList&&e.classList.add(htmx.config.settlingClass),triggerEvent(e,"htmx:afterSwap",r.eventInfo)})),r.afterSwapCallback&&r.afterSwapCallback(),n.ignoreTitle||handleTitle(s.title);const i=function(){if(forEach(s.tasks,(function(e){e.call()})),forEach(s.elts,(function(e){e.classList&&e.classList.remove(htmx.config.settlingClass),triggerEvent(e,"htmx:afterSettle",r.eventInfo)})),r.anchor){const e=asElement(resolveTarget("#"+r.anchor));e&&e.scrollIntoView({block:"start",behavior:"auto"})}updateScrollState(s.elts,n),r.afterSettleCallback&&r.afterSettleCallback()};n.settleDelay>0?getWindow().setTimeout(i,n.settleDelay):i()}function handleTriggerHeader(e,t,n){const r=e.getResponseHeader(t);if(0===r.indexOf("{")){const e=parseJSON(r);for(const t in e)if(e.hasOwnProperty(t)){let r=e[t];isRawObject(r)?n=void 0!==r.target?r.target:n:r={value:r},triggerEvent(n,t,r)}}else{const e=r.split(",");for(let t=0;t<e.length;t++)triggerEvent(n,e[t].trim(),[])}}const WHITESPACE=/\s/,WHITESPACE_OR_COMMA=/[\s,]/,SYMBOL_START=/[_$a-zA-Z]/,SYMBOL_CONT=/[_$a-zA-Z0-9]/,STRINGISH_START=['"',"'","/"],NOT_WHITESPACE=/[^\s]/,COMBINED_SELECTOR_START=/[{(]/,COMBINED_SELECTOR_END=/[})]/;function tokenizeString(e){const t=[];let n=0;for(;n<e.length;){if(SYMBOL_START.exec(e.charAt(n))){for(var r=n;SYMBOL_CONT.exec(e.charAt(n+1));)n++;t.push(e.substr(r,n-r+1))}else if(-1!==STRINGISH_START.indexOf(e.charAt(n))){const o=e.charAt(n);for(r=n,n++;n<e.length&&e.charAt(n)!==o;)"\\"===e.charAt(n)&&n++,n++;t.push(e.substr(r,n-r+1))}else{const r=e.charAt(n);t.push(r)}n++}return t}function isPossibleRelativeReference(e,t,n){return SYMBOL_START.exec(e.charAt(0))&&"true"!==e&&"false"!==e&&"this"!==e&&e!==n&&"."!==t}function maybeGenerateConditional(e,t,n){if("["===t[0]){t.shift();let r=1,o=" return (function("+n+"){ return (",a=null;for(;t.length>0;){const s=t[0];if("]"===s){if(r--,0===r){null===a&&(o+="true"),t.shift(),o+=")})";try{const t=maybeEval(e,(function(){return Function(o)()}),(function(){return!0}));return t.source=o,t}catch(e){return triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:e,source:o}),null}}}else"["===s&&r++;isPossibleRelativeReference(s,a,n)?o+="(("+n+"."+s+") ? ("+n+"."+s+") : (window."+s+"))":o+=s,a=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}const INPUT_SELECTOR="input, textarea, select";function parseAndCacheTrigger(e,t,n){const r=[],o=tokenizeString(t);do{consumeUntil(o,NOT_WHITESPACE);const t=o.length,n=consumeUntil(o,/[,\[\s]/);if(""!==n)if("every"===n){const t={trigger:"every"};consumeUntil(o,NOT_WHITESPACE),t.pollInterval=parseInterval(consumeUntil(o,/[,\[\s]/)),consumeUntil(o,NOT_WHITESPACE),(a=maybeGenerateConditional(e,o,"event"))&&(t.eventFilter=a),r.push(t)}else{const t={trigger:n};var a;for((a=maybeGenerateConditional(e,o,"event"))&&(t.eventFilter=a);o.length>0&&","!==o[0];){consumeUntil(o,NOT_WHITESPACE);const n=o.shift();if("changed"===n)t.changed=!0;else if("once"===n)t.once=!0;else if("consume"===n)t.consume=!0;else if("delay"===n&&":"===o[0])o.shift(),t.delay=parseInterval(consumeUntil(o,WHITESPACE_OR_COMMA));else if("from"===n&&":"===o[0]){if(o.shift(),COMBINED_SELECTOR_START.test(o[0]))var s=consumeCSSSelector(o);else if("closest"===(s=consumeUntil(o,WHITESPACE_OR_COMMA))||"find"===s||"next"===s||"previous"===s){o.shift();const e=consumeCSSSelector(o);e.length>0&&(s+=" "+e)}t.from=s}else"target"===n&&":"===o[0]?(o.shift(),t.target=consumeCSSSelector(o)):"throttle"===n&&":"===o[0]?(o.shift(),t.throttle=parseInterval(consumeUntil(o,WHITESPACE_OR_COMMA))):"queue"===n&&":"===o[0]?(o.shift(),t.queue=consumeUntil(o,WHITESPACE_OR_COMMA)):"root"===n&&":"===o[0]?(o.shift(),t[n]=consumeCSSSelector(o)):"threshold"===n&&":"===o[0]?(o.shift(),t[n]=consumeUntil(o,WHITESPACE_OR_COMMA)):triggerErrorEvent(e,"htmx:syntax:error",{token:o.shift()})}r.push(t)}o.length===t&&triggerErrorEvent(e,"htmx:syntax:error",{token:o.shift()}),consumeUntil(o,NOT_WHITESPACE)}while(","===o[0]&&o.shift());return n&&(n[t]=r),r}function getTriggerSpecs(e){const t=getAttributeValue(e,"hx-trigger");let n=[];if(t){const r=htmx.config.triggerSpecsCache;n=r&&r[t]||parseAndCacheTrigger(e,t,r)}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){const r=getInternalData(e);r.timeout=getWindow().setTimeout((function(){bodyContains(e)&&!0!==r.cancelled&&(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")&&0!==getRawAttribute(e,"href").indexOf("#")}function eltIsDisabled(e){return closest(e,htmx.config.disableSelector)}function boostElement(e,t,n){if(e instanceof HTMLAnchorElement&&isLocalLink(e)&&(""===e.target||"_self"===e.target)||"FORM"===e.tagName&&"dialog"!==String(getRawAttribute(e,"method")).toLowerCase()){let r,o;if(t.boosted=!0,"A"===e.tagName)r="get",o=getRawAttribute(e,"href");else{const t=getRawAttribute(e,"method");r=t?t.toLowerCase():"get",o=getRawAttribute(e,"action")}n.forEach((function(n){addEventListener(e,(function(e,t){const n=asElement(e);eltIsDisabled(n)?cleanUpElement(n):issueAjaxRequest(r,o,n,t)}),t,n,!0)}))}}function shouldCancel(e,t){const n=asElement(t);if(!n)return!1;if("submit"===e.type||"click"===e.type){if("FORM"===n.tagName)return!0;if(matches(n,'input[type="submit"], button')&&null!==closest(n,"form"))return!0;if(n instanceof HTMLAnchorElement&&n.href&&("#"===n.getAttribute("href")||0!==n.getAttribute("href").indexOf("#")))return!0}return!1}function ignoreBoostedAnchorCtrlClick(e,t){return getInternalData(e).boosted&&e instanceof HTMLAnchorElement&&"click"===t.type&&(t.ctrlKey||t.metaKey)}function maybeFilterEvent(e,t,n){const r=e.eventFilter;if(r)try{return!0!==r.call(t,n)}catch(e){const t=r.source;return triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:e,source:t}),!0}return!1}function addEventListener(e,t,n,r,o){const a=getInternalData(e);let s;s=r.from?querySelectorAllExt(e,r.from):[e],r.changed&&s.forEach((function(e){getInternalData(e).lastValue=e.value})),forEach(s,(function(s){const i=function(n){if(!bodyContains(e))return void s.removeEventListener(r.trigger,i);if(ignoreBoostedAnchorCtrlClick(e,n))return;if((o||shouldCancel(n,e))&&n.preventDefault(),maybeFilterEvent(r,e,n))return;const l=getInternalData(n);if(l.triggerSpec=r,null==l.handledFor&&(l.handledFor=[]),l.handledFor.indexOf(e)<0){if(l.handledFor.push(e),r.consume&&n.stopPropagation(),r.target&&n.target&&!matches(asElement(n.target),r.target))return;if(r.once){if(a.triggeredOnce)return;a.triggeredOnce=!0}if(r.changed){const e=getInternalData(s),t=s.value;if(e.lastValue===t)return;e.lastValue=t}if(a.delayed&&clearTimeout(a.delayed),a.throttle)return;r.throttle>0?a.throttle||(triggerEvent(e,"htmx:trigger"),t(e,n),a.throttle=getWindow().setTimeout((function(){a.throttle=null}),r.throttle)):r.delay>0?a.delayed=getWindow().setTimeout((function(){triggerEvent(e,"htmx:trigger"),t(e,n)}),r.delay):(triggerEvent(e,"htmx:trigger"),t(e,n))}};null==n.listenerInfos&&(n.listenerInfos=[]),n.listenerInfos.push({trigger:r.trigger,listener:i,on:s}),s.addEventListener(r.trigger,i)}))}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,r){const o=function(){n.loaded||(n.loaded=!0,t(e))};r>0?getWindow().setTimeout(o,r):o()}function processVerbs(e,t,n){let r=!1;return forEach(VERBS,(function(o){if(hasAttribute(e,"hx-"+o)){const a=getAttributeValue(e,"hx-"+o);r=!0,t.path=a,t.verb=o,n.forEach((function(n){addTriggerHandler(e,n,t,(function(e,t){const n=asElement(e);closest(n,htmx.config.disableSelector)?cleanUpElement(n):issueAjaxRequest(o,a,n,t)}))}))}})),r}function addTriggerHandler(e,t,n,r){if("revealed"===t.trigger)initScrollHandler(),addEventListener(e,r,n,t),maybeReveal(asElement(e));else if("intersect"===t.trigger){const o={};t.root&&(o.root=querySelectorExt(e,t.root)),t.threshold&&(o.threshold=parseFloat(t.threshold)),new IntersectionObserver((function(t){for(let n=0;n<t.length;n++)if(t[n].isIntersecting){triggerEvent(e,"intersect");break}}),o).observe(asElement(e)),addEventListener(asElement(e),r,n,t)}else"load"===t.trigger?maybeFilterEvent(t,e,makeEvent("load",{elt:e}))||loadImmediately(asElement(e),r,n,t.delay):t.pollInterval>0?(n.polling=!0,processPolling(asElement(e),r,t)):addEventListener(e,r,n,t)}function shouldProcessHxOn(e){const t=asElement(e);if(!t)return!1;const n=t.attributes;for(let e=0;e<n.length;e++){const t=n[e].name;if(startsWith(t,"hx-on:")||startsWith(t,"data-hx-on:")||startsWith(t,"hx-on-")||startsWith(t,"data-hx-on-"))return!0}return!1}const HX_ON_QUERY=(new XPathEvaluator).createExpression('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]');function processHXOnRoot(e,t){shouldProcessHxOn(e)&&t.push(asElement(e));const n=HX_ON_QUERY.evaluate(e);let r=null;for(;r=n.iterateNext();)t.push(asElement(r))}function findHxOnWildcardElements(e){const t=[];if(e instanceof DocumentFragment)for(const n of e.childNodes)processHXOnRoot(n,t);else processHXOnRoot(e,t);return t}function findElementsToProcess(e){if(e.querySelectorAll){const n=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]",r=[];for(const e in extensions){const n=extensions[e];if(n.getSelectors){var t=n.getSelectors();t&&r.push(t)}}return e.querySelectorAll(VERB_SELECTOR+n+", form, [type='submit'], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]"+r.flat().map((e=>", "+e)).join(""))}return[]}function maybeSetLastButtonClicked(e){const t=closest(asElement(e.target),"button, input[type='submit']"),n=getRelatedFormData(e);n&&(n.lastButtonClicked=t)}function maybeUnsetLastButtonClicked(e){const t=getRelatedFormData(e);t&&(t.lastButtonClicked=null)}function getRelatedFormData(e){const t=closest(asElement(e.target),"button, input[type='submit']");if(!t)return;const n=resolveTarget("#"+getRawAttribute(t,"form"),t.getRootNode())||closest(t,"form");return n?getInternalData(n):void 0}function initButtonTracking(e){e.addEventListener("click",maybeSetLastButtonClicked),e.addEventListener("focusin",maybeSetLastButtonClicked),e.addEventListener("focusout",maybeUnsetLastButtonClicked)}function addHxOnEventHandler(e,t,n){const r=getInternalData(e);let o;Array.isArray(r.onHandlers)||(r.onHandlers=[]);const a=function(t){maybeEval(e,(function(){eltIsDisabled(e)||(o||(o=new Function("event",n)),o.call(e,t))}))};e.addEventListener(t,a),r.onHandlers.push({event:t,listener:a})}function processHxOnWildcard(e){deInitOnHandlers(e);for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name,r=e.attributes[t].value;if(startsWith(n,"hx-on")||startsWith(n,"data-hx-on")){const t=n.indexOf("-on")+3,o=n.slice(t,t+1);if("-"===o||":"===o){let o=n.slice(t+1);startsWith(o,":")?o="htmx"+o:startsWith(o,"-")?o="htmx:"+o.slice(1):startsWith(o,"htmx-")&&(o="htmx:"+o.slice(5)),addHxOnEventHandler(e,o,r)}}}}function initNode(e){if(closest(e,htmx.config.disableSelector))return void cleanUpElement(e);const t=getInternalData(e);if(t.initHash!==attributeHash(e)){deInitNode(e),t.initHash=attributeHash(e),triggerEvent(e,"htmx:beforeProcessNode"),e.value&&(t.lastValue=e.value);const n=getTriggerSpecs(e);processVerbs(e,t,n)||("true"===getClosestAttributeValue(e,"hx-boost")?boostElement(e,t,n):hasAttribute(e,"hx-trigger")&&n.forEach((function(n){addTriggerHandler(e,n,t,(function(){}))}))),("FORM"===e.tagName||"submit"===getRawAttribute(e,"type")&&hasAttribute(e,"form"))&&initButtonTracking(e),triggerEvent(e,"htmx:afterProcessNode")}}function processNode(e){closest(e=resolveTarget(e),htmx.config.disableSelector)?cleanUpElement(e):(initNode(e),forEach(findElementsToProcess(e),(function(e){initNode(e)})),forEach(findHxOnWildcardElements(e),processHxOnWildcard))}function kebabEventName(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function makeEvent(e,t){let n;return window.CustomEvent&&"function"==typeof window.CustomEvent?n=new CustomEvent(e,{bubbles:!0,cancelable:!0,composed:!0,detail:t}):(n=getDocument().createEvent("CustomEvent"),n.initCustomEvent(e,!0,!0,t)),n}function triggerErrorEvent(e,t,n){triggerEvent(e,t,mergeObjects({error:t},n))}function ignoreEventForLogging(e){return"htmx:afterProcessNode"===e}function withExtensions(e,t){forEach(getExtensions(e),(function(e){try{t(e)}catch(e){logError(e)}}))}function logError(e){console.error?console.error(e):console.log&&console.log("ERROR: ",e)}function triggerEvent(e,t,n){e=resolveTarget(e),null==n&&(n={}),n.elt=e;const r=makeEvent(t,n);htmx.logger&&!ignoreEventForLogging(t)&&htmx.logger(e,t,n),n.error&&(logError(n.error),triggerEvent(e,"htmx:error",{errorInfo:n}));let o=e.dispatchEvent(r);const a=kebabEventName(t);if(o&&a!==t){const t=makeEvent(a,r.detail);o=o&&e.dispatchEvent(t)}return withExtensions(asElement(e),(function(e){o=o&&!1!==e.onEvent(t,r)&&!r.defaultPrevented})),o}let currentPathForHistory=location.pathname+location.search;function getHistoryElement(){return getDocument().querySelector("[hx-history-elt],[data-hx-history-elt]")||getDocument().body}function saveToHistoryCache(e,t){if(!canAccessLocalStorage())return;const n=cleanInnerHtmlForHistory(t),r=getDocument().title,o=window.scrollY;if(htmx.config.historyCacheSize<=0)return void localStorage.removeItem("htmx-history-cache");e=normalizePath(e);const a=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let t=0;t<a.length;t++)if(a[t].url===e){a.splice(t,1);break}const s={url:e,content:n,title:r,scroll:o};for(triggerEvent(getDocument().body,"htmx:historyItemCreated",{item:s,cache:a}),a.push(s);a.length>htmx.config.historyCacheSize;)a.shift();for(;a.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(a));break}catch(e){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:e,cache:a}),a.shift()}}function getCachedHistory(e){if(!canAccessLocalStorage())return null;e=normalizePath(e);const t=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let n=0;n<t.length;n++)if(t[n].url===e)return t[n];return null}function cleanInnerHtmlForHistory(e){const t=htmx.config.requestClass,n=e.cloneNode(!0);return forEach(findAll(n,"."+t),(function(e){removeClassFromElement(e,t)})),forEach(findAll(n,"[data-disabled-by-htmx]"),(function(e){e.removeAttribute("disabled")})),n.innerHTML}function saveCurrentPageToHistory(){const e=getHistoryElement(),t=currentPathForHistory||location.pathname+location.search;let n;try{n=getDocument().querySelector('[hx-history="false" i],[data-hx-history="false" i]')}catch(e){n=getDocument().querySelector('[hx-history="false"],[data-hx-history="false"]')}n||(triggerEvent(getDocument().body,"htmx:beforeHistorySave",{path:t,historyElt:e}),saveToHistoryCache(t,e)),htmx.config.historyEnabled&&history.replaceState({htmx:!0},getDocument().title,window.location.href)}function pushUrlIntoHistory(e){htmx.config.getCacheBusterParam&&(endsWith(e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,""),"&")||endsWith(e,"?"))&&(e=e.slice(0,-1)),htmx.config.historyEnabled&&history.pushState({htmx:!0},"",e),currentPathForHistory=e}function replaceUrlInHistory(e){htmx.config.historyEnabled&&history.replaceState({htmx:!0},"",e),currentPathForHistory=e}function settleImmediately(e){forEach(e,(function(e){e.call(void 0)}))}function loadHistoryFromServer(e){const t=new XMLHttpRequest,n={path:e,xhr:t};triggerEvent(getDocument().body,"htmx:historyCacheMiss",n),t.open("GET",e,!0),t.setRequestHeader("HX-Request","true"),t.setRequestHeader("HX-History-Restore-Request","true"),t.setRequestHeader("HX-Current-URL",getDocument().location.href),t.onload=function(){if(this.status>=200&&this.status<400){triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",n);const t=makeFragment(this.response),r=t.querySelector("[hx-history-elt],[data-hx-history-elt]")||t,o=getHistoryElement(),a=makeSettleInfo(o);handleTitle(t.title),swapInnerHTML(o,r,a),settleImmediately(a.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();const t=getCachedHistory(e=e||location.pathname+location.search);if(t){const n=makeFragment(t.content),r=getHistoryElement(),o=makeSettleInfo(r);handleTitle(n.title),swapInnerHTML(r,n,o),settleImmediately(o.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 null==t&&(t=[e]),forEach(t,(function(e){const t=getInternalData(e);t.requestCount=(t.requestCount||0)+1,e.classList.add.call(e.classList,htmx.config.requestClass)})),t}function disableElements(e){let t=findAttributeTargets(e,"hx-disabled-elt");return null==t&&(t=[]),forEach(t,(function(e){const t=getInternalData(e);t.requestCount=(t.requestCount||0)+1,e.setAttribute("disabled",""),e.setAttribute("data-disabled-by-htmx","")})),t}function removeRequestIndicators(e,t){forEach(e,(function(e){const t=getInternalData(e);t.requestCount=(t.requestCount||0)-1,0===t.requestCount&&e.classList.remove.call(e.classList,htmx.config.requestClass)})),forEach(t,(function(e){const t=getInternalData(e);t.requestCount=(t.requestCount||0)-1,0===t.requestCount&&(e.removeAttribute("disabled"),e.removeAttribute("data-disabled-by-htmx"))}))}function haveSeenNode(e,t){for(let n=0;n<e.length;n++)if(e[n].isSameNode(t))return!0;return!1}function shouldInclude(e){const t=e;return""!==t.name&&null!=t.name&&!t.disabled&&!closest(t,"fieldset[disabled]")&&"button"!==t.type&&"submit"!==t.type&&"image"!==t.tagName&&"reset"!==t.tagName&&"file"!==t.tagName&&("checkbox"!==t.type&&"radio"!==t.type||t.checked)}function addValueToFormData(e,t,n){null!=e&&null!=t&&(Array.isArray(t)?t.forEach((function(t){n.append(e,t)})):n.append(e,t))}function removeValueFromFormData(e,t,n){if(null!=e&&null!=t){let r=n.getAll(e);r=Array.isArray(t)?r.filter((e=>t.indexOf(e)<0)):r.filter((e=>e!==t)),n.delete(e),forEach(r,(t=>n.append(e,t)))}}function processInputValue(e,t,n,r,o){if(null!=r&&!haveSeenNode(e,r)){if(e.push(r),shouldInclude(r)){const e=getRawAttribute(r,"name");let a=r.value;r instanceof HTMLSelectElement&&r.multiple&&(a=toArray(r.querySelectorAll("option:checked")).map((function(e){return e.value}))),r instanceof HTMLInputElement&&r.files&&(a=toArray(r.files)),addValueToFormData(e,a,t),o&&validateElement(r,n)}r instanceof HTMLFormElement&&(forEach(r.elements,(function(r){e.indexOf(r)>=0?removeValueFromFormData(r.name,r.value,t):e.push(r),o&&validateElement(r,n)})),new FormData(r).forEach((function(e,n){e instanceof File&&""===e.name||addValueToFormData(n,e,t)})))}}function validateElement(e,t){const 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(const n of t.keys())e.delete(n);return t.forEach((function(t,n){e.append(n,t)})),e}function getInputValues(e,t){const n=[],r=new FormData,o=new FormData,a=[],s=getInternalData(e);s.lastButtonClicked&&!bodyContains(s.lastButtonClicked)&&(s.lastButtonClicked=null);let i=e instanceof HTMLFormElement&&!0!==e.noValidate||"true"===getAttributeValue(e,"hx-validate");if(s.lastButtonClicked&&(i=i&&!0!==s.lastButtonClicked.formNoValidate),"get"!==t&&processInputValue(n,o,a,closest(e,"form"),i),processInputValue(n,r,a,e,i),s.lastButtonClicked||"BUTTON"===e.tagName||"INPUT"===e.tagName&&"submit"===getRawAttribute(e,"type")){const t=s.lastButtonClicked||e;addValueToFormData(getRawAttribute(t,"name"),t.value,o)}return forEach(findAttributeTargets(e,"hx-include"),(function(e){processInputValue(n,r,a,asElement(e),i),matches(e,"form")||forEach(asParentNode(e).querySelectorAll(INPUT_SELECTOR),(function(e){processInputValue(n,r,a,e,i)}))})),overrideFormData(r,o),{errors:a,formData:r,values:formDataProxy(r)}}function appendParam(e,t,n){""!==e&&(e+="&"),"[object Object]"===String(n)&&(n=JSON.stringify(n));const r=encodeURIComponent(n);return e+(encodeURIComponent(t)+"=")+r}function urlEncode(e){e=formDataFromObject(e);let t="";return e.forEach((function(e,n){t=appendParam(t,n,e)})),t}function getHeaders(e,t,n){const r={"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,r),void 0!==n&&(r["HX-Prompt"]=n),getInternalData(e).boosted&&(r["HX-Boosted"]="true"),r}function filterValues(e,t){const n=getClosestAttributeValue(t,"hx-params");if(n){if("none"===n)return new FormData;if("*"===n)return e;if(0===n.indexOf("not "))return forEach(n.substr(4).split(","),(function(t){t=t.trim(),e.delete(t)})),e;{const t=new FormData;return forEach(n.split(","),(function(n){n=n.trim(),e.has(n)&&e.getAll(n).forEach((function(e){t.append(n,e)}))})),t}}return e}function isAnchorLink(e){return!!getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")>=0}function getSwapSpecification(e,t){const n=t||getClosestAttributeValue(e,"hx-swap"),r={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)&&(r.show="top"),n){const e=splitOnWhitespace(n);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t];if(0===n.indexOf("swap:"))r.swapDelay=parseInterval(n.substr(5));else if(0===n.indexOf("settle:"))r.settleDelay=parseInterval(n.substr(7));else if(0===n.indexOf("transition:"))r.transition="true"===n.substr(11);else if(0===n.indexOf("ignoreTitle:"))r.ignoreTitle="true"===n.substr(12);else if(0===n.indexOf("scroll:")){const e=(a=n.substr(7).split(":")).pop();var o=a.length>0?a.join(":"):null;r.scroll=e,r.scrollTarget=o}else if(0===n.indexOf("show:")){var a;const e=(a=n.substr(5).split(":")).pop();o=a.length>0?a.join(":"):null,r.show=e,r.showTarget=o}else if(0===n.indexOf("focus-scroll:")){const e=n.substr(13);r.focusScroll="true"==e}else 0==t?r.swapStyle=n:logError("Unknown modifier in hx-swap: "+n)}}return r}function usesFormData(e){return"multipart/form-data"===getClosestAttributeValue(e,"hx-encoding")||matches(e,"form")&&"multipart/form-data"===getRawAttribute(e,"enctype")}function encodeParamsForBody(e,t,n){let r=null;return withExtensions(t,(function(o){null==r&&(r=o.encodeParameters(e,n,t))})),null!=r?r:usesFormData(t)?overrideFormData(new FormData,formDataFromObject(n)):urlEncode(n)}function makeSettleInfo(e){return{tasks:[],elts:[e]}}function updateScrollState(e,t){const n=e[0],r=e[e.length-1];if(t.scroll){var o=null;t.scrollTarget&&(o=asElement(querySelectorExt(n,t.scrollTarget))),"top"===t.scroll&&(n||o)&&((o=o||n).scrollTop=0),"bottom"===t.scroll&&(r||o)&&((o=o||r).scrollTop=o.scrollHeight)}if(t.show){if(o=null,t.showTarget){let e=t.showTarget;"window"===t.showTarget&&(e="body"),o=asElement(querySelectorExt(n,e))}"top"===t.show&&(n||o)&&(o=o||n).scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior}),"bottom"===t.show&&(r||o)&&(o=o||r).scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior})}}function getValuesForElement(e,t,n,r){if(null==r&&(r={}),null==e)return r;const o=getAttributeValue(e,t);if(o){let t,a=o.trim(),s=n;if("unset"===a)return null;0===a.indexOf("javascript:")?(a=a.substr(11),s=!0):0===a.indexOf("js:")&&(a=a.substr(3),s=!0),0!==a.indexOf("{")&&(a="{"+a+"}"),t=s?maybeEval(e,(function(){return Function("return ("+a+")")()}),{}):parseJSON(a);for(const e in t)t.hasOwnProperty(e)&&null==r[e]&&(r[e]=t[e])}return getValuesForElement(asElement(parentElt(e)),t,n,r)}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(null!==n)try{e.setRequestHeader(t,n)}catch(r){e.setRequestHeader(t,encodeURIComponent(n)),e.setRequestHeader(t+"-URI-AutoEncoded","true")}}function getPathFromResponse(e){if(e.responseURL&&"undefined"!=typeof URL)try{const t=new URL(e.responseURL);return t.pathname+t.search}catch(t){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||"string"==typeof n?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){const t=[];for(;e;)t.push(e),e=e.parentElement;return t}function verifyPath(e,t,n){let r,o;return"function"==typeof URL?(o=new URL(t,document.location.href),r=document.location.origin===o.origin):(o=t,r=startsWith(t,document.location.origin)),!(htmx.config.selfRequestsOnly&&!r)&&triggerEvent(e,"htmx:validateUrl",mergeObjects({url:o,sameHost:r},n))}function formDataFromObject(e){if(e instanceof FormData)return e;const t=new FormData;for(const n in e)e.hasOwnProperty(n)&&("function"==typeof e[n].forEach?e[n].forEach((function(e){t.append(n,e)})):"object"!=typeof e[n]||e[n]instanceof Blob?t.append(n,e[n]):t.append(n,JSON.stringify(e[n])));return t}function formDataArrayProxy(e,t,n){return new Proxy(n,{get:function(n,r){return"number"==typeof r?n[r]:"length"===r?n.length:"push"===r?function(r){n.push(r),e.append(t,r)}:"function"==typeof n[r]?function(){n[r].apply(n,arguments),e.delete(t),n.forEach((function(n){e.append(t,n)}))}:n[r]&&1===n[r].length?n[r][0]:n[r]},set:function(n,r,o){return n[r]=o,e.delete(t),n.forEach((function(n){e.append(t,n)})),!0}})}function formDataProxy(e){return new Proxy(e,{get:function(t,n){if("symbol"==typeof n)return Reflect.get(t,n);if("toJSON"===n)return()=>Object.fromEntries(e);if(n in t)return"function"==typeof t[n]?function(){return e[n].apply(e,arguments)}:t[n];const r=e.getAll(n);return 0===r.length?void 0:1===r.length?r[0]:formDataArrayProxy(t,n,r)},set:function(e,t,n){return"string"==typeof t&&(e.delete(t),"function"==typeof n.forEach?n.forEach((function(n){e.append(t,n)})):"object"!=typeof n||n instanceof Blob?e.append(t,n):e.append(t,JSON.stringify(n)),!0)},deleteProperty:function(e,t){return"string"==typeof t&&e.delete(t),!0},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function issueAjaxRequest(e,t,n,r,o,a){let s=null,i=null;if((o=null!=o?o:{}).returnPromise&&"undefined"!=typeof Promise)var l=new Promise((function(e,t){s=e,i=t}));null==n&&(n=getDocument().body);const c=o.handler||handleAjaxResponse,u=o.select||null;if(!bodyContains(n))return maybeCall(s),l;const d=o.targetOverride||asElement(getTarget(n));if(null==d||d==DUMMY_ELT)return triggerErrorEvent(n,"htmx:targetError",{target:getAttributeValue(n,"hx-target")}),maybeCall(i),l;let f=getInternalData(n);const g=f.lastButtonClicked;if(g){const n=getRawAttribute(g,"formaction");null!=n&&(t=n);const r=getRawAttribute(g,"formmethod");null!=r&&"dialog"!==r.toLowerCase()&&(e=r)}const h=getClosestAttributeValue(n,"hx-confirm");if(void 0===a&&!1===triggerEvent(n,"htmx:confirm",{target:d,elt:n,path:t,verb:e,triggeringEvent:r,etc:o,issueRequest:function(a){return issueAjaxRequest(e,t,n,r,o,!!a)},question:h}))return maybeCall(s),l;let m=n,p=getClosestAttributeValue(n,"hx-sync"),E=null,b=!1;if(p){const e=p.split(":"),t=e[0].trim();if(m="this"===t?findThisElement(n,"hx-sync"):asElement(querySelectorExt(n,t)),p=(e[1]||"drop").trim(),f=getInternalData(m),"drop"===p&&f.xhr&&!0!==f.abortable)return maybeCall(s),l;if("abort"===p){if(f.xhr)return maybeCall(s),l;b=!0}else"replace"===p?triggerEvent(m,"htmx:abort"):0===p.indexOf("queue")&&(E=(p.split(" ")[1]||"last").trim())}if(f.xhr){if(!f.abortable){if(null==E){if(r){const e=getInternalData(r);e&&e.triggerSpec&&e.triggerSpec.queue&&(E=e.triggerSpec.queue)}null==E&&(E="last")}return null==f.queuedRequests&&(f.queuedRequests=[]),"first"===E&&0===f.queuedRequests.length||"all"===E?f.queuedRequests.push((function(){issueAjaxRequest(e,t,n,r,o)})):"last"===E&&(f.queuedRequests=[],f.queuedRequests.push((function(){issueAjaxRequest(e,t,n,r,o)}))),maybeCall(s),l}triggerEvent(m,"htmx:abort")}const x=new XMLHttpRequest;f.xhr=x,f.abortable=b;const y=function(){f.xhr=null,f.abortable=!1,null!=f.queuedRequests&&f.queuedRequests.length>0&&f.queuedRequests.shift()()},v=getClosestAttributeValue(n,"hx-prompt");if(v){var w=prompt(v);if(null===w||!triggerEvent(n,"htmx:prompt",{prompt:w,target:d}))return maybeCall(s),y(),l}if(h&&!a&&!confirm(h))return maybeCall(s),y(),l;let S=getHeaders(n,d,w);"get"===e||usesFormData(n)||(S["Content-Type"]="application/x-www-form-urlencoded"),o.headers&&(S=mergeObjects(S,o.headers));const A=getInputValues(n,e);let C=A.errors;const T=A.formData;o.values&&overrideFormData(T,formDataFromObject(o.values));const H=overrideFormData(T,formDataFromObject(getExpressionVars(n)));let R=filterValues(H,n);htmx.config.getCacheBusterParam&&"get"===e&&R.set("org.htmx.cache-buster",getRawAttribute(d,"id")||"true"),null!=t&&""!==t||(t=getDocument().location.href);const O=getValuesForElement(n,"hx-request"),I=getInternalData(n).boosted;let D=htmx.config.methodsThatUseUrlParams.indexOf(e)>=0;const _={boosted:I,useUrlParams:D,formData:R,parameters:formDataProxy(R),unfilteredFormData:H,unfilteredParameters:formDataProxy(H),headers:S,target:d,verb:e,errors:C,withCredentials:o.credentials||O.credentials||htmx.config.withCredentials,timeout:o.timeout||O.timeout||htmx.config.timeout,path:t,triggeringEvent:r};if(!triggerEvent(n,"htmx:configRequest",_))return maybeCall(s),y(),l;if(t=_.path,e=_.verb,S=_.headers,R=formDataFromObject(_.parameters),C=_.errors,D=_.useUrlParams,C&&C.length>0)return triggerEvent(n,"htmx:validation:halted",_),maybeCall(s),y(),l;const N=t.split("#"),L=N[0],q=N[1];let P=t;if(D&&(P=L,!R.keys().next().done&&(P.indexOf("?")<0?P+="?":P+="&",P+=urlEncode(R),q&&(P+="#"+q))),!verifyPath(n,P,_))return triggerErrorEvent(n,"htmx:invalidPath",_),maybeCall(i),l;if(x.open(e.toUpperCase(),P,!0),x.overrideMimeType("text/html"),x.withCredentials=_.withCredentials,x.timeout=_.timeout,O.noHeaders);else for(const e in S)if(S.hasOwnProperty(e)){const t=S[e];safelySetHeaderValue(x,e,t)}const F={xhr:x,target:d,requestConfig:_,etc:o,boosted:I,select:u,pathInfo:{requestPath:t,finalRequestPath:P,responsePath:null,anchor:q}};if(x.onload=function(){try{const e=hierarchyForElt(n);if(F.pathInfo.responsePath=getPathFromResponse(x),c(n,F),!0!==F.keepIndicators&&removeRequestIndicators(k,M),triggerEvent(n,"htmx:afterRequest",F),triggerEvent(n,"htmx:afterOnLoad",F),!bodyContains(n)){let t=null;for(;e.length>0&&null==t;){const n=e.shift();bodyContains(n)&&(t=n)}t&&(triggerEvent(t,"htmx:afterRequest",F),triggerEvent(t,"htmx:afterOnLoad",F))}maybeCall(s),y()}catch(e){throw triggerErrorEvent(n,"htmx:onLoadError",mergeObjects({error:e},F)),e}},x.onerror=function(){removeRequestIndicators(k,M),triggerErrorEvent(n,"htmx:afterRequest",F),triggerErrorEvent(n,"htmx:sendError",F),maybeCall(i),y()},x.onabort=function(){removeRequestIndicators(k,M),triggerErrorEvent(n,"htmx:afterRequest",F),triggerErrorEvent(n,"htmx:sendAbort",F),maybeCall(i),y()},x.ontimeout=function(){removeRequestIndicators(k,M),triggerErrorEvent(n,"htmx:afterRequest",F),triggerErrorEvent(n,"htmx:timeout",F),maybeCall(i),y()},!triggerEvent(n,"htmx:beforeRequest",F))return maybeCall(s),y(),l;var k=addRequestIndicatorClasses(n),M=disableElements(n);forEach(["loadstart","loadend","progress","abort"],(function(e){forEach([x,x.upload],(function(t){t.addEventListener(e,(function(t){triggerEvent(n,"htmx:xhr:"+e,{lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total})}))}))})),triggerEvent(n,"htmx:beforeSend",F);const V=D?null:encodeParamsForBody(x,n,R);return x.send(V),l}function determineHistoryUpdates(e,t){const n=t.xhr;let r=null,o=null;if(hasHeader(n,/HX-Push:/i)?(r=n.getResponseHeader("HX-Push"),o="push"):hasHeader(n,/HX-Push-Url:/i)?(r=n.getResponseHeader("HX-Push-Url"),o="push"):hasHeader(n,/HX-Replace-Url:/i)&&(r=n.getResponseHeader("HX-Replace-Url"),o="replace"),r)return"false"===r?{}:{type:o,path:r};const a=t.pathInfo.finalRequestPath,s=t.pathInfo.responsePath,i=getClosestAttributeValue(e,"hx-push-url"),l=getClosestAttributeValue(e,"hx-replace-url"),c=getInternalData(e).boosted;let u=null,d=null;return i?(u="push",d=i):l?(u="replace",d=l):c&&(u="push",d=s||a),d?"false"===d?{}:("true"===d&&(d=s||a),t.pathInfo.anchor&&-1===d.indexOf("#")&&(d=d+"#"+t.pathInfo.anchor),{type:u,path:d}):{}}function codeMatches(e,t){return new RegExp(e.code).test(t.toString(10))}function resolveResponseHandling(e){for(var t=0;t<htmx.config.responseHandling.length;t++){var n=htmx.config.responseHandling[t];if(codeMatches(n,e.status))return n}return{swap:!1}}function handleTitle(e){if(e){const t=find("title");t?t.innerHTML=e:window.document.title=e}}function handleAjaxResponse(e,t){const n=t.xhr;let r=t.target;const o=t.etc,a=t.select;if(!triggerEvent(e,"htmx:beforeOnLoad",t))return;if(hasHeader(n,/HX-Trigger:/i)&&handleTriggerHeader(n,"HX-Trigger",e),hasHeader(n,/HX-Location:/i)){saveCurrentPageToHistory();let e=n.getResponseHeader("HX-Location");var s;return 0===e.indexOf("{")&&(s=parseJSON(e),e=s.path,delete s.path),void ajaxHelper("get",e,s).then((function(){pushUrlIntoHistory(e)}))}const i=hasHeader(n,/HX-Refresh:/i)&&"true"===n.getResponseHeader("HX-Refresh");if(hasHeader(n,/HX-Redirect:/i))return t.keepIndicators=!0,location.href=n.getResponseHeader("HX-Redirect"),void(i&&location.reload());if(i)return t.keepIndicators=!0,void location.reload();hasHeader(n,/HX-Retarget:/i)&&("this"===n.getResponseHeader("HX-Retarget")?t.target=e:t.target=asElement(querySelectorExt(e,n.getResponseHeader("HX-Retarget"))));const l=determineHistoryUpdates(e,t),c=resolveResponseHandling(n),u=c.swap;let d=!!c.error,f=htmx.config.ignoreTitle||c.ignoreTitle,g=c.select;c.target&&(t.target=asElement(querySelectorExt(e,c.target)));var h=o.swapOverride;null==h&&c.swapOverride&&(h=c.swapOverride),hasHeader(n,/HX-Retarget:/i)&&("this"===n.getResponseHeader("HX-Retarget")?t.target=e:t.target=asElement(querySelectorExt(e,n.getResponseHeader("HX-Retarget")))),hasHeader(n,/HX-Reswap:/i)&&(h=n.getResponseHeader("HX-Reswap"));var m=n.response,p=mergeObjects({shouldSwap:u,serverResponse:m,isError:d,ignoreTitle:f,selectOverride:g},t);if((!c.event||triggerEvent(r,c.event,p))&&triggerEvent(r,"htmx:beforeSwap",p)){if(r=p.target,m=p.serverResponse,d=p.isError,f=p.ignoreTitle,g=p.selectOverride,t.target=r,t.failed=d,t.successful=!d,p.shouldSwap){286===n.status&&cancelPolling(e),withExtensions(e,(function(t){m=t.transformResponse(m,n,e)})),l.type&&saveCurrentPageToHistory(),hasHeader(n,/HX-Reswap:/i)&&(h=n.getResponseHeader("HX-Reswap"));var E=getSwapSpecification(e,h);E.hasOwnProperty("ignoreTitle")||(E.ignoreTitle=f),r.classList.add(htmx.config.swappingClass);let o=null,s=null;a&&(g=a),hasHeader(n,/HX-Reselect:/i)&&(g=n.getResponseHeader("HX-Reselect"));const i=getClosestAttributeValue(e,"hx-select-oob"),c=getClosestAttributeValue(e,"hx-select");let u=function(){try{l.type&&(triggerEvent(getDocument().body,"htmx:beforeHistoryUpdate",mergeObjects({history:l},t)),"push"===l.type?(pushUrlIntoHistory(l.path),triggerEvent(getDocument().body,"htmx:pushedIntoHistory",{path:l.path})):(replaceUrlInHistory(l.path),triggerEvent(getDocument().body,"htmx:replacedInHistory",{path:l.path}))),swap(r,m,E,{select:g||c,selectOOB:i,eventInfo:t,anchor:t.pathInfo.anchor,contextElement:e,afterSwapCallback:function(){if(hasHeader(n,/HX-Trigger-After-Swap:/i)){let t=e;bodyContains(e)||(t=getDocument().body),handleTriggerHeader(n,"HX-Trigger-After-Swap",t)}},afterSettleCallback:function(){if(hasHeader(n,/HX-Trigger-After-Settle:/i)){let t=e;bodyContains(e)||(t=getDocument().body),handleTriggerHeader(n,"HX-Trigger-After-Settle",t)}maybeCall(o)}})}catch(n){throw triggerErrorEvent(e,"htmx:swapError",t),maybeCall(s),n}},d=htmx.config.globalViewTransitions;if(E.hasOwnProperty("transition")&&(d=E.transition),d&&triggerEvent(e,"htmx:beforeTransition",t)&&"undefined"!=typeof Promise&&document.startViewTransition){const e=new Promise((function(e,t){o=e,s=t})),t=u;u=function(){document.startViewTransition((function(){return t(),e}))}}E.swapDelay>0?getWindow().setTimeout(u,E.swapDelay):u()}d&&triggerErrorEvent(e,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+n.status+" from "+t.pathInfo.requestPath},t))}}const 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,r){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(null==t&&(t=[]),null==e)return t;null==n&&(n=[]);const r=getAttributeValue(e,"hx-ext");return r&&forEach(r.split(","),(function(e){if("ignore:"!=(e=e.replace(/ /g,"")).slice(0,7)){if(n.indexOf(e)<0){const n=extensions[e];n&&t.indexOf(n)<0&&t.push(n)}}else n.push(e.slice(7))})),getExtensions(asElement(parentElt(e)),t,n)}var isReady=!1;function ready(e){isReady||"complete"===getDocument().readyState?e():getDocument().addEventListener("DOMContentLoaded",e)}function insertIndicatorStyles(){if(!1!==htmx.config.includeIndicatorStyles){const e=htmx.config.inlineStyleNonce?` nonce="${htmx.config.inlineStyleNonce}"`:"";getDocument().head.insertAdjacentHTML("beforeend","<style"+e+">        ."+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;}        </style>")}}function getMetaConfig(){const e=getDocument().querySelector('meta[name="htmx-config"]');return e?parseJSON(e.content):null}function mergeMetaConfig(){const e=getMetaConfig();e&&(htmx.config=mergeObjects(htmx.config,e))}return getDocument().addEventListener("DOMContentLoaded",(function(){isReady=!0})),ready((function(){mergeMetaConfig(),insertIndicatorStyles();let e=getDocument().body;processNode(e);const t=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",(function(e){const t=getInternalData(e.target);t&&t.xhr&&t.xhr.abort()}));const n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){e.state&&e.state.htmx?(restoreHistory(),forEach(t,(function(e){triggerEvent(e,"htmx:restored",{document:getDocument(),triggerEvent})}))):n&&n(e)},getWindow().setTimeout((function(){triggerEvent(e,"htmx:load",{}),e=null}),0)})),htmx}();const __WEBPACK_DEFAULT_EXPORT__=htmx}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={},htmx=__webpack_require__(335);let tool={indexOf:function(e){return Array.prototype.indexOf.call(e.parentNode.children,e)},escapeHTML:function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}};const src_tool=tool;htmx.A.defineExtension("bny-tab",{onEvent:function(e,t){return"htmx:beforeProcessNode"===e?function(e){const t=e.target;return null===t||!e.target.classList.contains("bny-tab")||(htmx.A.findAll(".bny-tab-item",t).forEach((e=>{htmx.A.on(e,"click",(function(){const e=src_tool.indexOf(this),t=this.parentNode.parentNode,n=htmx.A.find(t,`.bny-tab-body>div:nth-child(${e+1})`);htmx.A.findAll(t,".bny-tab-title .this").forEach((async function(e){e.classList.remove("this")})),htmx.A.findAll(t,".bny-tab-body .this").forEach((async function(e){e.classList.remove("this")})),htmx.A.addClass(this,"this"),htmx.A.addClass(n,"this"),n.classList.contains("process")||(htmx.A.process(n),htmx.A.addClass(n,"process"))}))})),!1)}(t):"htmx:afterProcessNode"===e?(function(e){const t=e.target;if(null!==t&&t.classList.contains("bny-tab-body")){const e=htmx.A.findAll(t.parentNode,".bny-tab-title .bny-tab-item").length,n=htmx.A.findAll(t,"div").length;if(e-n>0)for(let r=0;r<e-n;r++){const e=document.createElement("div");t.append(e)}let r=t.parentNode;const o=r.getAttribute("selected")??0;htmx.A.find(r,`.bny-tab-title .bny-tab-item:nth-child(${Number(o)+1})`).click()}}(t),!1):"htmx:beforeSwap"===e?(function(e){const t=e.target;if(null!==t&&t.classList.contains("bny-tab-item")){const n=src_tool.indexOf(t),r=htmx.A.find(t.parentNode.parentNode,`.bny-tab-body>div:nth-child(${n+1})`);200===e.detail.xhr.status?htmx.A.swap(r,e.detail.serverResponse,{swapStyle:"innerHTML"}):htmx.A.swap(r,"网络错误...",{swapStyle:"innerHTML"})}}(t),!1):void 0}}),htmx.A.defineExtension("bny-card",{onEvent:function(e,t){if("htmx:beforeSwap"===e){if(200===t.detail.xhr.status){const e=JSON.parse(t.detail.serverResponse);if(1===e.code){const n=e.data,r=n&&n.body?`\n                                <h4 class="bny-card-title">${n.body.title||""}</h4>\n                                <h5 class="bny-card-subtitle">${n.body.subtitle||""}</h5>\n                                <p class="bny-card-text">${n.body.text||""}</p>\n                            `:"";t.detail.elt.innerHTML=`\n                            <div class="bny-card">\n                                ${n&&n.top_img?`<img src="${n.top_img}" >`:""}\n                                ${n&&n.header?`<div class="bny-card-header">${n.header}</div>`:""}\n                                <div class="bny-card-body">${r}</div>\n                                ${n&&n.footer?`<div class="bny-card-footer">${n.footer}</div>`:""}\n                                ${n&&n.bottom_img?`<img src="${n.bottom_img}" >`:""}\n                            </div>`}else t.detail.elt.innerHTML=`<div class="bny-card">${data.msg}</div>`}else t.detail.elt.innerHTML='<div class="bny-card">网络错误</div>';return!1}}}),htmx.A.defineExtension("bny-code",{onEvent:function(e,t){if(null!==t.target&&"htmx:beforeSwap"===e){const e=t.target.getAttribute("hx-swap")||"innerHTML";if(200===t.detail.xhr.status){const n=`<pre><code>${src_tool.escapeHTML(t.detail.serverResponse)}</code></pre>`;htmx.A.swap(t.target,n,{swapStyle:e})}else htmx.A.swap(t.target,"<span>网络错误...</span>",{swapStyle:e});return!1}}}),htmx.A.defineExtension("bny-marquee",{onEvent:function(e,t){if("htmx:beforeProcessNode"===e&&t.target.classList.contains("bny-marquee")){const e=t.target.getAttribute("speed")||50;let o=htmx.A.find(t.target,".bny-marquee-content");var n=o.parentNode.offsetWidth,r=(o.offsetWidth+n)/Number(e);return o.style.animationDuration=r+"s",!1}}}),htmx.A.defineExtension("bny-alert",{onEvent:function(e,t){if("htmx:beforeProcessNode"===e){const e=t.target;let n=document.createElement("span");n.setAttribute("class","alert-del"),n.textContent="X",e.append(n),htmx.A.on(n,"click",(function(){this.parentNode.style.opacity=0,setTimeout((()=>{this.parentNode.remove()}),235)}))}}}),function(){function e(t){let n="";return t.forEach((t=>{const r=t.icon?`<i class="${t.icon}"></i>`:"",o=t.children?`<menu>${e(t.children)}</menu>`:"",a=t.url?t.url:"javascript:;",s=t.title?`<span>${t.title}</span>`:"";n+=`<li><a href="${a}">${r}${s}${o}</a></li>`})),n}function t(t){const n=t.target.getAttribute("hx-swap")||"innerHTML",r=null!==t.target.getAttribute("vertical")?"vertical":"";if(200===t.detail.xhr.status){const o=JSON.parse(t.detail.serverResponse);if(1===o.code){const a=o.data;htmx.A.swap(t.detail.elt,`<menu class="bny-menu" ${r}>${e(a)}</menu>`,{swapStyle:n})}else htmx.A.swap(t.detail.elt,`<span>加载失败${o.msg}...</span>`,{swapStyle:n})}else htmx.A.swap(t.detail.elt,"<span>网络错误...</span>",{swapStyle:n})}htmx.A.defineExtension("bny-menu",{onEvent:function(e,n){null!==n.target&&"htmx:beforeSwap"===e&&t(n)}})}(),window.htmx=htmx.A})();
\ No newline at end of file
+(()=>{"use strict";var __webpack_modules__={335:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var htmx=function(){const htmx={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){return getInputValues(e,t||"post").values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,allowScriptTags:!0,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:!0,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null,disableInheritance:!1,responseHandling:[{code:"204",swap:!1},{code:"[23]..",swap:!0},{code:"[45]..",swap:!1,error:!0}],allowNestedOobSwaps:!0},parseInterval:null,_:null,version:"2.0.2"};htmx.onLoad=onLoadHelper,htmx.process=processNode,htmx.on=addEventListenerImpl,htmx.off=removeEventListenerImpl,htmx.trigger=triggerEvent,htmx.ajax=ajaxHelper,htmx.find=find,htmx.findAll=findAll,htmx.closest=closest,htmx.remove=removeElement,htmx.addClass=addClassToElement,htmx.removeClass=removeClassFromElement,htmx.toggleClass=toggleClassOnElement,htmx.takeClass=takeClassForElement,htmx.swap=swap,htmx.defineExtension=defineExtension,htmx.removeExtension=removeExtension,htmx.logAll=logAll,htmx.logNone=logNone,htmx.parseInterval=parseInterval,htmx._=internalEval;const internalAPI={addTriggerHandler,bodyContains,canAccessLocalStorage,findThisElement,filterValues,swap,hasAttribute,getAttributeValue,getClosestAttributeValue,getClosestMatch,getExpressionVars,getHeaders,getInputValues,getInternalData,getSwapSpecification,getTriggerSpecs,getTarget,makeFragment,mergeObjects,makeSettleInfo,oobSwap,querySelectorExt,settleImmediately,shouldCancel,triggerEvent,triggerErrorEvent,withExtensions},VERBS=["get","post","put","delete","patch"],VERB_SELECTOR=VERBS.map((function(e){return"[hx-"+e+"], [data-hx-"+e+"]"})).join(", "),HEAD_TAG_REGEX=makeTagRegEx("head");function makeTagRegEx(e,t=!1){return new RegExp(`<${e}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${e}>`,t?"gim":"im")}function parseInterval(e){if(null==e)return;let t=NaN;return t="ms"==e.slice(-2)?parseFloat(e.slice(0,-2)):"s"==e.slice(-1)?1e3*parseFloat(e.slice(0,-1)):"m"==e.slice(-1)?1e3*parseFloat(e.slice(0,-1))*60: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){const 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){const r=getAttributeValue(t,n),o=getAttributeValue(t,"hx-disinherit");var a=getAttributeValue(t,"hx-inherit");if(e!==t){if(htmx.config.disableInheritance)return a&&("*"===a||a.split(" ").indexOf(n)>=0)?r:null;if(o&&("*"===o||o.split(" ").indexOf(n)>=0))return"unset"}return r}function getClosestAttributeValue(e,t){let n=null;if(getClosestMatch(e,(function(r){return!!(n=getAttributeValueWithDisinheritance(e,asElement(r),t))})),"unset"!==n)return n}function matches(e,t){const 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){const t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(e);return t?t[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){const t=getDocument().createElement("script");return forEach(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),t.textContent=e.textContent,t.async=!1,htmx.config.inlineScriptNonce&&(t.nonce=htmx.config.inlineScriptNonce),t}function isJavaScriptScriptNode(e){return e.matches("script")&&("text/javascript"===e.type||"module"===e.type||""===e.type)}function normalizeScriptTags(e){Array.from(e.querySelectorAll("script")).forEach((e=>{if(isJavaScriptScriptNode(e)){const t=duplicateScript(e),n=e.parentNode;try{n.insertBefore(t,e)}catch(e){logError(e)}finally{e.remove()}}}))}function makeFragment(e){const t=e.replace(HEAD_TAG_REGEX,""),n=getStartTag(t);let r;if("html"===n){r=new DocumentFragment;const t=parseHTML(e);takeChildrenFor(r,t.body),r.title=t.title}else if("body"===n){r=new DocumentFragment;const e=parseHTML(t);takeChildrenFor(r,e.body),r.title=e.title}else{const e=parseHTML('<body><template class="internal-htmx-wrapper">'+t+"</template></body>");r=e.querySelector("template").content,r.title=e.title;var o=r.querySelector("title");o&&o.parentNode===r&&(o.remove(),r.title=o.innerText)}return r&&(htmx.config.allowScriptTags?normalizeScriptTags(r):r.querySelectorAll("script").forEach((e=>e.remove()))),r}function maybeCall(e){e&&e()}function isType(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function isFunction(e){return"function"==typeof e}function isRawObject(e){return isType(e,"Object")}function getInternalData(e){const t="htmx-internal-data";let n=e[t];return n||(n=e[t]={}),n}function toArray(e){const t=[];if(e)for(let n=0;n<e.length;n++)t.push(e[n]);return t}function forEach(e,t){if(e)for(let n=0;n<e.length;n++)t(e[n])}function isScrolledIntoView(e){const t=e.getBoundingClientRect(),n=t.top,r=t.bottom;return n<window.innerHeight&&r>=0}function bodyContains(e){const 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(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function parseJSON(e){try{return JSON.parse(e)}catch(e){return logError(e),null}}function canAccessLocalStorage(){const e="htmx:localStorageTest";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}function normalizePath(e){try{const t=new URL(e);return t&&(e=t.pathname+t.search),/^\/$/.test(e)||(e=e.replace(/\/+$/,"")),e}catch(t){return e}}function internalEval(str){return maybeEval(getDocument().body,(function(){return eval(str)}))}function onLoadHelper(e){return htmx.on("htmx:load",(function(t){e(t.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"string"!=typeof e?e.querySelector(t):find(getDocument(),e)}function findAll(e,t){return"string"!=typeof e?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"string"==typeof e?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)))&&(n?getWindow().setTimeout((function(){addClassToElement(e,t),e=null}),n):e.classList&&e.classList.add(t))}function removeClassFromElement(e,t,n){let r=asElement(resolveTarget(e));r&&(n?getWindow().setTimeout((function(){removeClassFromElement(r,t),r=null}),n):r.classList&&(r.classList.remove(t),0===r.classList.length&&r.removeAttribute("class")))}function toggleClassOnElement(e,t){(e=resolveTarget(e)).classList.toggle(t)}function takeClassForElement(e,t){forEach((e=resolveTarget(e)).parentElement.children,(function(e){removeClassFromElement(e,t)})),addClassToElement(asElement(e),t)}function closest(e,t){if((e=asElement(resolveTarget(e)))&&e.closest)return e.closest(t);do{if(null==e||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){const t=e.trim();return startsWith(t,"<")&&endsWith(t,"/>")?t.substring(1,t.length-2):t}function querySelectorAllExt(e,t,n){return e=resolveTarget(e),0===t.indexOf("closest ")?[closest(asElement(e),normalizeSelector(t.substr(8)))]:0===t.indexOf("find ")?[find(asParentNode(e),normalizeSelector(t.substr(5)))]:"next"===t?[asElement(e).nextElementSibling]:0===t.indexOf("next ")?[scanForwardQuery(e,normalizeSelector(t.substr(5)),!!n)]:"previous"===t?[asElement(e).previousElementSibling]:0===t.indexOf("previous ")?[scanBackwardsQuery(e,normalizeSelector(t.substr(9)),!!n)]:"document"===t?[document]:"window"===t?[window]:"body"===t?[document.body]:"root"===t?[getRootNode(e,!!n)]:0===t.indexOf("global ")?querySelectorAllExt(e,t.slice(7),!0):toArray(asParentNode(getRootNode(e,!!n)).querySelectorAll(normalizeSelector(t)))}var scanForwardQuery=function(e,t,n){const r=asParentNode(getRootNode(e,n)).querySelectorAll(t);for(let t=0;t<r.length;t++){const n=r[t];if(n.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING)return n}},scanBackwardsQuery=function(e,t,n){const r=asParentNode(getRootNode(e,n)).querySelectorAll(t);for(let t=r.length-1;t>=0;t--){const n=r[t];if(n.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING)return n}};function querySelectorExt(e,t){return"string"!=typeof e?querySelectorAllExt(e,t)[0]:querySelectorAllExt(getDocument().body,e)[0]}function resolveTarget(e,t){return"string"==typeof e?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(){const r=processEventArgs(e,t,n);r.target.addEventListener(r.event,r.listener)})),isFunction(t)?t:n}function removeEventListenerImpl(e,t,n){return ready((function(){const r=processEventArgs(e,t,n);r.target.removeEventListener(r.event,r.listener)})),isFunction(t)?t:n}const DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(e,t){const n=getClosestAttributeValue(e,t);if(n){if("this"===n)return[findThisElement(e,t)];{const r=querySelectorAllExt(e,n);return 0===r.length?(logError('The selector "'+n+'" on '+t+" returned no matches!"),[DUMMY_ELT]):r}}}function findThisElement(e,t){return asElement(getClosestMatch(e,(function(e){return null!=getAttributeValue(asElement(e),t)})))}function getTarget(e){const t=getClosestAttributeValue(e,"hx-target");return t?"this"===t?findThisElement(e,"hx-target"):querySelectorExt(e,t):getInternalData(e).boosted?getDocument().body:e}function shouldSettleAttribute(e){const t=htmx.config.attributesToSettle;for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1}function cloneAttributes(e,t){forEach(e.attributes,(function(n){!t.hasAttribute(n.name)&&shouldSettleAttribute(n.name)&&e.removeAttribute(n.name)})),forEach(t.attributes,(function(t){shouldSettleAttribute(t.name)&&e.setAttribute(t.name,t.value)}))}function isInlineSwap(e,t){const n=getExtensions(t);for(let t=0;t<n.length;t++){const r=n[t];try{if(r.isInlineSwap(e))return!0}catch(e){logError(e)}}return"outerHTML"===e}function oobSwap(e,t,n){let r="#"+getRawAttribute(t,"id"),o="outerHTML";"true"===e||(e.indexOf(":")>0?(o=e.substr(0,e.indexOf(":")),r=e.substr(e.indexOf(":")+1,e.length)):o=e);const a=getDocument().querySelectorAll(r);return a?(forEach(a,(function(e){let r;const a=t.cloneNode(!0);r=getDocument().createDocumentFragment(),r.appendChild(a),isInlineSwap(o,e)||(r=asParentNode(a));const s={shouldSwap:!0,target:e,fragment:r};triggerEvent(e,"htmx:oobBeforeSwap",s)&&(e=s.target,s.shouldSwap&&swapWithStyle(o,e,e,r,n),forEach(n.elts,(function(e){triggerEvent(e,"htmx:oobAfterSwap",s)})))})),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(e){const t=getAttributeValue(e,"id"),n=getDocument().getElementById(t);null!=n&&e.parentNode.replaceChild(n,e)}))}function handleAttributes(e,t,n){forEach(t.querySelectorAll("[id]"),(function(t){const r=getRawAttribute(t,"id");if(r&&r.length>0){const o=r.replace("'","\\'"),a=t.tagName.replace(":","\\:"),s=asParentNode(e),i=s&&s.querySelector(a+"[id='"+o+"']");if(i&&i!==s){const e=t.cloneNode();cloneAttributes(t,i),n.tasks.push((function(){cloneAttributes(t,e)}))}}}))}function makeAjaxLoadTask(e){return function(){removeClassFromElement(e,htmx.config.addedClass),processNode(asElement(e)),processFocus(asParentNode(e)),triggerEvent(e,"htmx:load")}}function processFocus(e){const t="[autofocus]",n=asHtmlElement(matches(e,t)?e:e.querySelector(t));null!=n&&n.focus()}function insertNodesBefore(e,t,n,r){for(handleAttributes(e,n,r);n.childNodes.length>0;){const o=n.firstChild;addClassToElement(asElement(o),htmx.config.addedClass),e.insertBefore(o,t),o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE&&r.tasks.push(makeAjaxLoadTask(o))}}function stringHash(e,t){let n=0;for(;n<e.length;)t=(t<<5)-t+e.charCodeAt(n++)|0;return t}function attributeHash(e){let t=0;if(e.attributes)for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n];r.value&&(t=stringHash(r.name,t),t=stringHash(r.value,t))}return t}function deInitOnHandlers(e){const t=getInternalData(e);if(t.onHandlers){for(let n=0;n<t.onHandlers.length;n++){const r=t.onHandlers[n];removeEventListenerImpl(e,r.event,r.listener)}delete t.onHandlers}}function deInitNode(e){const t=getInternalData(e);t.timeout&&clearTimeout(t.timeout),t.listenerInfos&&forEach(t.listenerInfos,(function(e){e.on&&removeEventListenerImpl(e.on,e.trigger,e.listener)})),deInitOnHandlers(e),forEach(Object.keys(t),(function(e){delete t[e]}))}function cleanUpElement(e){triggerEvent(e,"htmx:beforeCleanupElement"),deInitNode(e),e.children&&forEach(e.children,(function(e){cleanUpElement(e)}))}function swapOuterHTML(e,t,n){if(e instanceof Element&&"BODY"===e.tagName)return swapInnerHTML(e,t,n);let r;const o=e.previousSibling;for(insertNodesBefore(parentElt(e),e,t,n),r=null==o?parentElt(e).firstChild:o.nextSibling,n.elts=n.elts.filter((function(t){return t!==e}));r&&r!==e;)r instanceof Element&&n.elts.push(r),r=r.nextSibling;cleanUpElement(e),e instanceof Element?e.remove():e.parentNode.removeChild(e)}function swapAfterBegin(e,t,n){return insertNodesBefore(e,e.firstChild,t,n)}function swapBeforeBegin(e,t,n){return insertNodesBefore(parentElt(e),e,t,n)}function swapBeforeEnd(e,t,n){return insertNodesBefore(e,null,t,n)}function swapAfterEnd(e,t,n){return insertNodesBefore(parentElt(e),e.nextSibling,t,n)}function swapDelete(e){return cleanUpElement(e),parentElt(e).removeChild(e)}function swapInnerHTML(e,t,n){const r=e.firstChild;if(insertNodesBefore(e,r,t,n),r){for(;r.nextSibling;)cleanUpElement(r.nextSibling),e.removeChild(r.nextSibling);cleanUpElement(r),e.removeChild(r)}}function swapWithStyle(e,t,n,r,o){switch(e){case"none":return;case"outerHTML":return void swapOuterHTML(n,r,o);case"afterbegin":return void swapAfterBegin(n,r,o);case"beforebegin":return void swapBeforeBegin(n,r,o);case"beforeend":return void swapBeforeEnd(n,r,o);case"afterend":return void swapAfterEnd(n,r,o);case"delete":return void swapDelete(n);default:var a=getExtensions(t);for(let t=0;t<a.length;t++){const s=a[t];try{const t=s.handleSwap(e,n,r,o);if(t){if(Array.isArray(t))for(let e=0;e<t.length;e++){const n=t[e];n.nodeType!==Node.TEXT_NODE&&n.nodeType!==Node.COMMENT_NODE&&o.tasks.push(makeAjaxLoadTask(n))}return}}catch(e){logError(e)}}"innerHTML"===e?swapInnerHTML(n,r,o):swapWithStyle(htmx.config.defaultSwapStyle,t,n,r,o)}}function findAndSwapOobElements(e,t){var n=findAll(e,"[hx-swap-oob], [data-hx-swap-oob]");return forEach(n,(function(e){if(htmx.config.allowNestedOobSwaps||null===e.parentElement){const n=getAttributeValue(e,"hx-swap-oob");null!=n&&oobSwap(n,e,t)}else e.removeAttribute("hx-swap-oob"),e.removeAttribute("data-hx-swap-oob")})),n.length>0}function swap(e,t,n,r){r||(r={}),e=resolveTarget(e);const o=document.activeElement;let a={};try{a={elt:o,start:o?o.selectionStart:null,end:o?o.selectionEnd:null}}catch(e){}const s=makeSettleInfo(e);if("textContent"===n.swapStyle)e.textContent=t;else{let o=makeFragment(t);if(s.title=o.title,r.selectOOB){const e=r.selectOOB.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(":",2);let r=n[0].trim();0===r.indexOf("#")&&(r=r.substring(1));const a=n[1]||"true",i=o.querySelector("#"+r);i&&oobSwap(a,i,s)}}if(findAndSwapOobElements(o,s),forEach(findAll(o,"template"),(function(e){findAndSwapOobElements(e.content,s)&&e.remove()})),r.select){const e=getDocument().createDocumentFragment();forEach(o.querySelectorAll(r.select),(function(t){e.appendChild(t)})),o=e}handlePreservedElements(o),swapWithStyle(n.swapStyle,r.contextElement,e,o,s)}if(a.elt&&!bodyContains(a.elt)&&getRawAttribute(a.elt,"id")){const e=document.getElementById(getRawAttribute(a.elt,"id")),t={preventScroll:void 0!==n.focusScroll?!n.focusScroll:!htmx.config.defaultFocusScroll};if(e){if(a.start&&e.setSelectionRange)try{e.setSelectionRange(a.start,a.end)}catch(e){}e.focus(t)}}e.classList.remove(htmx.config.swappingClass),forEach(s.elts,(function(e){e.classList&&e.classList.add(htmx.config.settlingClass),triggerEvent(e,"htmx:afterSwap",r.eventInfo)})),r.afterSwapCallback&&r.afterSwapCallback(),n.ignoreTitle||handleTitle(s.title);const i=function(){if(forEach(s.tasks,(function(e){e.call()})),forEach(s.elts,(function(e){e.classList&&e.classList.remove(htmx.config.settlingClass),triggerEvent(e,"htmx:afterSettle",r.eventInfo)})),r.anchor){const e=asElement(resolveTarget("#"+r.anchor));e&&e.scrollIntoView({block:"start",behavior:"auto"})}updateScrollState(s.elts,n),r.afterSettleCallback&&r.afterSettleCallback()};n.settleDelay>0?getWindow().setTimeout(i,n.settleDelay):i()}function handleTriggerHeader(e,t,n){const r=e.getResponseHeader(t);if(0===r.indexOf("{")){const e=parseJSON(r);for(const t in e)if(e.hasOwnProperty(t)){let r=e[t];isRawObject(r)?n=void 0!==r.target?r.target:n:r={value:r},triggerEvent(n,t,r)}}else{const e=r.split(",");for(let t=0;t<e.length;t++)triggerEvent(n,e[t].trim(),[])}}const WHITESPACE=/\s/,WHITESPACE_OR_COMMA=/[\s,]/,SYMBOL_START=/[_$a-zA-Z]/,SYMBOL_CONT=/[_$a-zA-Z0-9]/,STRINGISH_START=['"',"'","/"],NOT_WHITESPACE=/[^\s]/,COMBINED_SELECTOR_START=/[{(]/,COMBINED_SELECTOR_END=/[})]/;function tokenizeString(e){const t=[];let n=0;for(;n<e.length;){if(SYMBOL_START.exec(e.charAt(n))){for(var r=n;SYMBOL_CONT.exec(e.charAt(n+1));)n++;t.push(e.substr(r,n-r+1))}else if(-1!==STRINGISH_START.indexOf(e.charAt(n))){const o=e.charAt(n);for(r=n,n++;n<e.length&&e.charAt(n)!==o;)"\\"===e.charAt(n)&&n++,n++;t.push(e.substr(r,n-r+1))}else{const r=e.charAt(n);t.push(r)}n++}return t}function isPossibleRelativeReference(e,t,n){return SYMBOL_START.exec(e.charAt(0))&&"true"!==e&&"false"!==e&&"this"!==e&&e!==n&&"."!==t}function maybeGenerateConditional(e,t,n){if("["===t[0]){t.shift();let r=1,o=" return (function("+n+"){ return (",a=null;for(;t.length>0;){const s=t[0];if("]"===s){if(r--,0===r){null===a&&(o+="true"),t.shift(),o+=")})";try{const t=maybeEval(e,(function(){return Function(o)()}),(function(){return!0}));return t.source=o,t}catch(e){return triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:e,source:o}),null}}}else"["===s&&r++;isPossibleRelativeReference(s,a,n)?o+="(("+n+"."+s+") ? ("+n+"."+s+") : (window."+s+"))":o+=s,a=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}const INPUT_SELECTOR="input, textarea, select";function parseAndCacheTrigger(e,t,n){const r=[],o=tokenizeString(t);do{consumeUntil(o,NOT_WHITESPACE);const t=o.length,n=consumeUntil(o,/[,\[\s]/);if(""!==n)if("every"===n){const t={trigger:"every"};consumeUntil(o,NOT_WHITESPACE),t.pollInterval=parseInterval(consumeUntil(o,/[,\[\s]/)),consumeUntil(o,NOT_WHITESPACE),(a=maybeGenerateConditional(e,o,"event"))&&(t.eventFilter=a),r.push(t)}else{const t={trigger:n};var a;for((a=maybeGenerateConditional(e,o,"event"))&&(t.eventFilter=a);o.length>0&&","!==o[0];){consumeUntil(o,NOT_WHITESPACE);const n=o.shift();if("changed"===n)t.changed=!0;else if("once"===n)t.once=!0;else if("consume"===n)t.consume=!0;else if("delay"===n&&":"===o[0])o.shift(),t.delay=parseInterval(consumeUntil(o,WHITESPACE_OR_COMMA));else if("from"===n&&":"===o[0]){if(o.shift(),COMBINED_SELECTOR_START.test(o[0]))var s=consumeCSSSelector(o);else if("closest"===(s=consumeUntil(o,WHITESPACE_OR_COMMA))||"find"===s||"next"===s||"previous"===s){o.shift();const e=consumeCSSSelector(o);e.length>0&&(s+=" "+e)}t.from=s}else"target"===n&&":"===o[0]?(o.shift(),t.target=consumeCSSSelector(o)):"throttle"===n&&":"===o[0]?(o.shift(),t.throttle=parseInterval(consumeUntil(o,WHITESPACE_OR_COMMA))):"queue"===n&&":"===o[0]?(o.shift(),t.queue=consumeUntil(o,WHITESPACE_OR_COMMA)):"root"===n&&":"===o[0]?(o.shift(),t[n]=consumeCSSSelector(o)):"threshold"===n&&":"===o[0]?(o.shift(),t[n]=consumeUntil(o,WHITESPACE_OR_COMMA)):triggerErrorEvent(e,"htmx:syntax:error",{token:o.shift()})}r.push(t)}o.length===t&&triggerErrorEvent(e,"htmx:syntax:error",{token:o.shift()}),consumeUntil(o,NOT_WHITESPACE)}while(","===o[0]&&o.shift());return n&&(n[t]=r),r}function getTriggerSpecs(e){const t=getAttributeValue(e,"hx-trigger");let n=[];if(t){const r=htmx.config.triggerSpecsCache;n=r&&r[t]||parseAndCacheTrigger(e,t,r)}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){const r=getInternalData(e);r.timeout=getWindow().setTimeout((function(){bodyContains(e)&&!0!==r.cancelled&&(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")&&0!==getRawAttribute(e,"href").indexOf("#")}function eltIsDisabled(e){return closest(e,htmx.config.disableSelector)}function boostElement(e,t,n){if(e instanceof HTMLAnchorElement&&isLocalLink(e)&&(""===e.target||"_self"===e.target)||"FORM"===e.tagName&&"dialog"!==String(getRawAttribute(e,"method")).toLowerCase()){let r,o;if(t.boosted=!0,"A"===e.tagName)r="get",o=getRawAttribute(e,"href");else{const t=getRawAttribute(e,"method");r=t?t.toLowerCase():"get",o=getRawAttribute(e,"action")}n.forEach((function(n){addEventListener(e,(function(e,t){const n=asElement(e);eltIsDisabled(n)?cleanUpElement(n):issueAjaxRequest(r,o,n,t)}),t,n,!0)}))}}function shouldCancel(e,t){const n=asElement(t);if(!n)return!1;if("submit"===e.type||"click"===e.type){if("FORM"===n.tagName)return!0;if(matches(n,'input[type="submit"], button')&&null!==closest(n,"form"))return!0;if(n instanceof HTMLAnchorElement&&n.href&&("#"===n.getAttribute("href")||0!==n.getAttribute("href").indexOf("#")))return!0}return!1}function ignoreBoostedAnchorCtrlClick(e,t){return getInternalData(e).boosted&&e instanceof HTMLAnchorElement&&"click"===t.type&&(t.ctrlKey||t.metaKey)}function maybeFilterEvent(e,t,n){const r=e.eventFilter;if(r)try{return!0!==r.call(t,n)}catch(e){const t=r.source;return triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:e,source:t}),!0}return!1}function addEventListener(e,t,n,r,o){const a=getInternalData(e);let s;s=r.from?querySelectorAllExt(e,r.from):[e],r.changed&&s.forEach((function(e){getInternalData(e).lastValue=e.value})),forEach(s,(function(s){const i=function(n){if(!bodyContains(e))return void s.removeEventListener(r.trigger,i);if(ignoreBoostedAnchorCtrlClick(e,n))return;if((o||shouldCancel(n,e))&&n.preventDefault(),maybeFilterEvent(r,e,n))return;const l=getInternalData(n);if(l.triggerSpec=r,null==l.handledFor&&(l.handledFor=[]),l.handledFor.indexOf(e)<0){if(l.handledFor.push(e),r.consume&&n.stopPropagation(),r.target&&n.target&&!matches(asElement(n.target),r.target))return;if(r.once){if(a.triggeredOnce)return;a.triggeredOnce=!0}if(r.changed){const e=getInternalData(s),t=s.value;if(e.lastValue===t)return;e.lastValue=t}if(a.delayed&&clearTimeout(a.delayed),a.throttle)return;r.throttle>0?a.throttle||(triggerEvent(e,"htmx:trigger"),t(e,n),a.throttle=getWindow().setTimeout((function(){a.throttle=null}),r.throttle)):r.delay>0?a.delayed=getWindow().setTimeout((function(){triggerEvent(e,"htmx:trigger"),t(e,n)}),r.delay):(triggerEvent(e,"htmx:trigger"),t(e,n))}};null==n.listenerInfos&&(n.listenerInfos=[]),n.listenerInfos.push({trigger:r.trigger,listener:i,on:s}),s.addEventListener(r.trigger,i)}))}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,r){const o=function(){n.loaded||(n.loaded=!0,t(e))};r>0?getWindow().setTimeout(o,r):o()}function processVerbs(e,t,n){let r=!1;return forEach(VERBS,(function(o){if(hasAttribute(e,"hx-"+o)){const a=getAttributeValue(e,"hx-"+o);r=!0,t.path=a,t.verb=o,n.forEach((function(n){addTriggerHandler(e,n,t,(function(e,t){const n=asElement(e);closest(n,htmx.config.disableSelector)?cleanUpElement(n):issueAjaxRequest(o,a,n,t)}))}))}})),r}function addTriggerHandler(e,t,n,r){if("revealed"===t.trigger)initScrollHandler(),addEventListener(e,r,n,t),maybeReveal(asElement(e));else if("intersect"===t.trigger){const o={};t.root&&(o.root=querySelectorExt(e,t.root)),t.threshold&&(o.threshold=parseFloat(t.threshold)),new IntersectionObserver((function(t){for(let n=0;n<t.length;n++)if(t[n].isIntersecting){triggerEvent(e,"intersect");break}}),o).observe(asElement(e)),addEventListener(asElement(e),r,n,t)}else"load"===t.trigger?maybeFilterEvent(t,e,makeEvent("load",{elt:e}))||loadImmediately(asElement(e),r,n,t.delay):t.pollInterval>0?(n.polling=!0,processPolling(asElement(e),r,t)):addEventListener(e,r,n,t)}function shouldProcessHxOn(e){const t=asElement(e);if(!t)return!1;const n=t.attributes;for(let e=0;e<n.length;e++){const t=n[e].name;if(startsWith(t,"hx-on:")||startsWith(t,"data-hx-on:")||startsWith(t,"hx-on-")||startsWith(t,"data-hx-on-"))return!0}return!1}const HX_ON_QUERY=(new XPathEvaluator).createExpression('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]');function processHXOnRoot(e,t){shouldProcessHxOn(e)&&t.push(asElement(e));const n=HX_ON_QUERY.evaluate(e);let r=null;for(;r=n.iterateNext();)t.push(asElement(r))}function findHxOnWildcardElements(e){const t=[];if(e instanceof DocumentFragment)for(const n of e.childNodes)processHXOnRoot(n,t);else processHXOnRoot(e,t);return t}function findElementsToProcess(e){if(e.querySelectorAll){const n=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]",r=[];for(const e in extensions){const n=extensions[e];if(n.getSelectors){var t=n.getSelectors();t&&r.push(t)}}return e.querySelectorAll(VERB_SELECTOR+n+", form, [type='submit'], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]"+r.flat().map((e=>", "+e)).join(""))}return[]}function maybeSetLastButtonClicked(e){const t=closest(asElement(e.target),"button, input[type='submit']"),n=getRelatedFormData(e);n&&(n.lastButtonClicked=t)}function maybeUnsetLastButtonClicked(e){const t=getRelatedFormData(e);t&&(t.lastButtonClicked=null)}function getRelatedFormData(e){const t=closest(asElement(e.target),"button, input[type='submit']");if(!t)return;const n=resolveTarget("#"+getRawAttribute(t,"form"),t.getRootNode())||closest(t,"form");return n?getInternalData(n):void 0}function initButtonTracking(e){e.addEventListener("click",maybeSetLastButtonClicked),e.addEventListener("focusin",maybeSetLastButtonClicked),e.addEventListener("focusout",maybeUnsetLastButtonClicked)}function addHxOnEventHandler(e,t,n){const r=getInternalData(e);let o;Array.isArray(r.onHandlers)||(r.onHandlers=[]);const a=function(t){maybeEval(e,(function(){eltIsDisabled(e)||(o||(o=new Function("event",n)),o.call(e,t))}))};e.addEventListener(t,a),r.onHandlers.push({event:t,listener:a})}function processHxOnWildcard(e){deInitOnHandlers(e);for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name,r=e.attributes[t].value;if(startsWith(n,"hx-on")||startsWith(n,"data-hx-on")){const t=n.indexOf("-on")+3,o=n.slice(t,t+1);if("-"===o||":"===o){let o=n.slice(t+1);startsWith(o,":")?o="htmx"+o:startsWith(o,"-")?o="htmx:"+o.slice(1):startsWith(o,"htmx-")&&(o="htmx:"+o.slice(5)),addHxOnEventHandler(e,o,r)}}}}function initNode(e){if(closest(e,htmx.config.disableSelector))return void cleanUpElement(e);const t=getInternalData(e);if(t.initHash!==attributeHash(e)){deInitNode(e),t.initHash=attributeHash(e),triggerEvent(e,"htmx:beforeProcessNode"),e.value&&(t.lastValue=e.value);const n=getTriggerSpecs(e);processVerbs(e,t,n)||("true"===getClosestAttributeValue(e,"hx-boost")?boostElement(e,t,n):hasAttribute(e,"hx-trigger")&&n.forEach((function(n){addTriggerHandler(e,n,t,(function(){}))}))),("FORM"===e.tagName||"submit"===getRawAttribute(e,"type")&&hasAttribute(e,"form"))&&initButtonTracking(e),triggerEvent(e,"htmx:afterProcessNode")}}function processNode(e){closest(e=resolveTarget(e),htmx.config.disableSelector)?cleanUpElement(e):(initNode(e),forEach(findElementsToProcess(e),(function(e){initNode(e)})),forEach(findHxOnWildcardElements(e),processHxOnWildcard))}function kebabEventName(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function makeEvent(e,t){let n;return window.CustomEvent&&"function"==typeof window.CustomEvent?n=new CustomEvent(e,{bubbles:!0,cancelable:!0,composed:!0,detail:t}):(n=getDocument().createEvent("CustomEvent"),n.initCustomEvent(e,!0,!0,t)),n}function triggerErrorEvent(e,t,n){triggerEvent(e,t,mergeObjects({error:t},n))}function ignoreEventForLogging(e){return"htmx:afterProcessNode"===e}function withExtensions(e,t){forEach(getExtensions(e),(function(e){try{t(e)}catch(e){logError(e)}}))}function logError(e){console.error?console.error(e):console.log&&console.log("ERROR: ",e)}function triggerEvent(e,t,n){e=resolveTarget(e),null==n&&(n={}),n.elt=e;const r=makeEvent(t,n);htmx.logger&&!ignoreEventForLogging(t)&&htmx.logger(e,t,n),n.error&&(logError(n.error),triggerEvent(e,"htmx:error",{errorInfo:n}));let o=e.dispatchEvent(r);const a=kebabEventName(t);if(o&&a!==t){const t=makeEvent(a,r.detail);o=o&&e.dispatchEvent(t)}return withExtensions(asElement(e),(function(e){o=o&&!1!==e.onEvent(t,r)&&!r.defaultPrevented})),o}let currentPathForHistory=location.pathname+location.search;function getHistoryElement(){return getDocument().querySelector("[hx-history-elt],[data-hx-history-elt]")||getDocument().body}function saveToHistoryCache(e,t){if(!canAccessLocalStorage())return;const n=cleanInnerHtmlForHistory(t),r=getDocument().title,o=window.scrollY;if(htmx.config.historyCacheSize<=0)return void localStorage.removeItem("htmx-history-cache");e=normalizePath(e);const a=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let t=0;t<a.length;t++)if(a[t].url===e){a.splice(t,1);break}const s={url:e,content:n,title:r,scroll:o};for(triggerEvent(getDocument().body,"htmx:historyItemCreated",{item:s,cache:a}),a.push(s);a.length>htmx.config.historyCacheSize;)a.shift();for(;a.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(a));break}catch(e){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:e,cache:a}),a.shift()}}function getCachedHistory(e){if(!canAccessLocalStorage())return null;e=normalizePath(e);const t=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let n=0;n<t.length;n++)if(t[n].url===e)return t[n];return null}function cleanInnerHtmlForHistory(e){const t=htmx.config.requestClass,n=e.cloneNode(!0);return forEach(findAll(n,"."+t),(function(e){removeClassFromElement(e,t)})),forEach(findAll(n,"[data-disabled-by-htmx]"),(function(e){e.removeAttribute("disabled")})),n.innerHTML}function saveCurrentPageToHistory(){const e=getHistoryElement(),t=currentPathForHistory||location.pathname+location.search;let n;try{n=getDocument().querySelector('[hx-history="false" i],[data-hx-history="false" i]')}catch(e){n=getDocument().querySelector('[hx-history="false"],[data-hx-history="false"]')}n||(triggerEvent(getDocument().body,"htmx:beforeHistorySave",{path:t,historyElt:e}),saveToHistoryCache(t,e)),htmx.config.historyEnabled&&history.replaceState({htmx:!0},getDocument().title,window.location.href)}function pushUrlIntoHistory(e){htmx.config.getCacheBusterParam&&(endsWith(e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,""),"&")||endsWith(e,"?"))&&(e=e.slice(0,-1)),htmx.config.historyEnabled&&history.pushState({htmx:!0},"",e),currentPathForHistory=e}function replaceUrlInHistory(e){htmx.config.historyEnabled&&history.replaceState({htmx:!0},"",e),currentPathForHistory=e}function settleImmediately(e){forEach(e,(function(e){e.call(void 0)}))}function loadHistoryFromServer(e){const t=new XMLHttpRequest,n={path:e,xhr:t};triggerEvent(getDocument().body,"htmx:historyCacheMiss",n),t.open("GET",e,!0),t.setRequestHeader("HX-Request","true"),t.setRequestHeader("HX-History-Restore-Request","true"),t.setRequestHeader("HX-Current-URL",getDocument().location.href),t.onload=function(){if(this.status>=200&&this.status<400){triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",n);const t=makeFragment(this.response),r=t.querySelector("[hx-history-elt],[data-hx-history-elt]")||t,o=getHistoryElement(),a=makeSettleInfo(o);handleTitle(t.title),swapInnerHTML(o,r,a),settleImmediately(a.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();const t=getCachedHistory(e=e||location.pathname+location.search);if(t){const n=makeFragment(t.content),r=getHistoryElement(),o=makeSettleInfo(r);handleTitle(n.title),swapInnerHTML(r,n,o),settleImmediately(o.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 null==t&&(t=[e]),forEach(t,(function(e){const t=getInternalData(e);t.requestCount=(t.requestCount||0)+1,e.classList.add.call(e.classList,htmx.config.requestClass)})),t}function disableElements(e){let t=findAttributeTargets(e,"hx-disabled-elt");return null==t&&(t=[]),forEach(t,(function(e){const t=getInternalData(e);t.requestCount=(t.requestCount||0)+1,e.setAttribute("disabled",""),e.setAttribute("data-disabled-by-htmx","")})),t}function removeRequestIndicators(e,t){forEach(e,(function(e){const t=getInternalData(e);t.requestCount=(t.requestCount||0)-1,0===t.requestCount&&e.classList.remove.call(e.classList,htmx.config.requestClass)})),forEach(t,(function(e){const t=getInternalData(e);t.requestCount=(t.requestCount||0)-1,0===t.requestCount&&(e.removeAttribute("disabled"),e.removeAttribute("data-disabled-by-htmx"))}))}function haveSeenNode(e,t){for(let n=0;n<e.length;n++)if(e[n].isSameNode(t))return!0;return!1}function shouldInclude(e){const t=e;return""!==t.name&&null!=t.name&&!t.disabled&&!closest(t,"fieldset[disabled]")&&"button"!==t.type&&"submit"!==t.type&&"image"!==t.tagName&&"reset"!==t.tagName&&"file"!==t.tagName&&("checkbox"!==t.type&&"radio"!==t.type||t.checked)}function addValueToFormData(e,t,n){null!=e&&null!=t&&(Array.isArray(t)?t.forEach((function(t){n.append(e,t)})):n.append(e,t))}function removeValueFromFormData(e,t,n){if(null!=e&&null!=t){let r=n.getAll(e);r=Array.isArray(t)?r.filter((e=>t.indexOf(e)<0)):r.filter((e=>e!==t)),n.delete(e),forEach(r,(t=>n.append(e,t)))}}function processInputValue(e,t,n,r,o){if(null!=r&&!haveSeenNode(e,r)){if(e.push(r),shouldInclude(r)){const e=getRawAttribute(r,"name");let a=r.value;r instanceof HTMLSelectElement&&r.multiple&&(a=toArray(r.querySelectorAll("option:checked")).map((function(e){return e.value}))),r instanceof HTMLInputElement&&r.files&&(a=toArray(r.files)),addValueToFormData(e,a,t),o&&validateElement(r,n)}r instanceof HTMLFormElement&&(forEach(r.elements,(function(r){e.indexOf(r)>=0?removeValueFromFormData(r.name,r.value,t):e.push(r),o&&validateElement(r,n)})),new FormData(r).forEach((function(e,n){e instanceof File&&""===e.name||addValueToFormData(n,e,t)})))}}function validateElement(e,t){const 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(const n of t.keys())e.delete(n);return t.forEach((function(t,n){e.append(n,t)})),e}function getInputValues(e,t){const n=[],r=new FormData,o=new FormData,a=[],s=getInternalData(e);s.lastButtonClicked&&!bodyContains(s.lastButtonClicked)&&(s.lastButtonClicked=null);let i=e instanceof HTMLFormElement&&!0!==e.noValidate||"true"===getAttributeValue(e,"hx-validate");if(s.lastButtonClicked&&(i=i&&!0!==s.lastButtonClicked.formNoValidate),"get"!==t&&processInputValue(n,o,a,closest(e,"form"),i),processInputValue(n,r,a,e,i),s.lastButtonClicked||"BUTTON"===e.tagName||"INPUT"===e.tagName&&"submit"===getRawAttribute(e,"type")){const t=s.lastButtonClicked||e;addValueToFormData(getRawAttribute(t,"name"),t.value,o)}return forEach(findAttributeTargets(e,"hx-include"),(function(e){processInputValue(n,r,a,asElement(e),i),matches(e,"form")||forEach(asParentNode(e).querySelectorAll(INPUT_SELECTOR),(function(e){processInputValue(n,r,a,e,i)}))})),overrideFormData(r,o),{errors:a,formData:r,values:formDataProxy(r)}}function appendParam(e,t,n){""!==e&&(e+="&"),"[object Object]"===String(n)&&(n=JSON.stringify(n));const r=encodeURIComponent(n);return e+(encodeURIComponent(t)+"=")+r}function urlEncode(e){e=formDataFromObject(e);let t="";return e.forEach((function(e,n){t=appendParam(t,n,e)})),t}function getHeaders(e,t,n){const r={"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,r),void 0!==n&&(r["HX-Prompt"]=n),getInternalData(e).boosted&&(r["HX-Boosted"]="true"),r}function filterValues(e,t){const n=getClosestAttributeValue(t,"hx-params");if(n){if("none"===n)return new FormData;if("*"===n)return e;if(0===n.indexOf("not "))return forEach(n.substr(4).split(","),(function(t){t=t.trim(),e.delete(t)})),e;{const t=new FormData;return forEach(n.split(","),(function(n){n=n.trim(),e.has(n)&&e.getAll(n).forEach((function(e){t.append(n,e)}))})),t}}return e}function isAnchorLink(e){return!!getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")>=0}function getSwapSpecification(e,t){const n=t||getClosestAttributeValue(e,"hx-swap"),r={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)&&(r.show="top"),n){const e=splitOnWhitespace(n);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t];if(0===n.indexOf("swap:"))r.swapDelay=parseInterval(n.substr(5));else if(0===n.indexOf("settle:"))r.settleDelay=parseInterval(n.substr(7));else if(0===n.indexOf("transition:"))r.transition="true"===n.substr(11);else if(0===n.indexOf("ignoreTitle:"))r.ignoreTitle="true"===n.substr(12);else if(0===n.indexOf("scroll:")){const e=(a=n.substr(7).split(":")).pop();var o=a.length>0?a.join(":"):null;r.scroll=e,r.scrollTarget=o}else if(0===n.indexOf("show:")){var a;const e=(a=n.substr(5).split(":")).pop();o=a.length>0?a.join(":"):null,r.show=e,r.showTarget=o}else if(0===n.indexOf("focus-scroll:")){const e=n.substr(13);r.focusScroll="true"==e}else 0==t?r.swapStyle=n:logError("Unknown modifier in hx-swap: "+n)}}return r}function usesFormData(e){return"multipart/form-data"===getClosestAttributeValue(e,"hx-encoding")||matches(e,"form")&&"multipart/form-data"===getRawAttribute(e,"enctype")}function encodeParamsForBody(e,t,n){let r=null;return withExtensions(t,(function(o){null==r&&(r=o.encodeParameters(e,n,t))})),null!=r?r:usesFormData(t)?overrideFormData(new FormData,formDataFromObject(n)):urlEncode(n)}function makeSettleInfo(e){return{tasks:[],elts:[e]}}function updateScrollState(e,t){const n=e[0],r=e[e.length-1];if(t.scroll){var o=null;t.scrollTarget&&(o=asElement(querySelectorExt(n,t.scrollTarget))),"top"===t.scroll&&(n||o)&&((o=o||n).scrollTop=0),"bottom"===t.scroll&&(r||o)&&((o=o||r).scrollTop=o.scrollHeight)}if(t.show){if(o=null,t.showTarget){let e=t.showTarget;"window"===t.showTarget&&(e="body"),o=asElement(querySelectorExt(n,e))}"top"===t.show&&(n||o)&&(o=o||n).scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior}),"bottom"===t.show&&(r||o)&&(o=o||r).scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior})}}function getValuesForElement(e,t,n,r){if(null==r&&(r={}),null==e)return r;const o=getAttributeValue(e,t);if(o){let t,a=o.trim(),s=n;if("unset"===a)return null;0===a.indexOf("javascript:")?(a=a.substr(11),s=!0):0===a.indexOf("js:")&&(a=a.substr(3),s=!0),0!==a.indexOf("{")&&(a="{"+a+"}"),t=s?maybeEval(e,(function(){return Function("return ("+a+")")()}),{}):parseJSON(a);for(const e in t)t.hasOwnProperty(e)&&null==r[e]&&(r[e]=t[e])}return getValuesForElement(asElement(parentElt(e)),t,n,r)}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(null!==n)try{e.setRequestHeader(t,n)}catch(r){e.setRequestHeader(t,encodeURIComponent(n)),e.setRequestHeader(t+"-URI-AutoEncoded","true")}}function getPathFromResponse(e){if(e.responseURL&&"undefined"!=typeof URL)try{const t=new URL(e.responseURL);return t.pathname+t.search}catch(t){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||"string"==typeof n?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){const t=[];for(;e;)t.push(e),e=e.parentElement;return t}function verifyPath(e,t,n){let r,o;return"function"==typeof URL?(o=new URL(t,document.location.href),r=document.location.origin===o.origin):(o=t,r=startsWith(t,document.location.origin)),!(htmx.config.selfRequestsOnly&&!r)&&triggerEvent(e,"htmx:validateUrl",mergeObjects({url:o,sameHost:r},n))}function formDataFromObject(e){if(e instanceof FormData)return e;const t=new FormData;for(const n in e)e.hasOwnProperty(n)&&("function"==typeof e[n].forEach?e[n].forEach((function(e){t.append(n,e)})):"object"!=typeof e[n]||e[n]instanceof Blob?t.append(n,e[n]):t.append(n,JSON.stringify(e[n])));return t}function formDataArrayProxy(e,t,n){return new Proxy(n,{get:function(n,r){return"number"==typeof r?n[r]:"length"===r?n.length:"push"===r?function(r){n.push(r),e.append(t,r)}:"function"==typeof n[r]?function(){n[r].apply(n,arguments),e.delete(t),n.forEach((function(n){e.append(t,n)}))}:n[r]&&1===n[r].length?n[r][0]:n[r]},set:function(n,r,o){return n[r]=o,e.delete(t),n.forEach((function(n){e.append(t,n)})),!0}})}function formDataProxy(e){return new Proxy(e,{get:function(t,n){if("symbol"==typeof n)return Reflect.get(t,n);if("toJSON"===n)return()=>Object.fromEntries(e);if(n in t)return"function"==typeof t[n]?function(){return e[n].apply(e,arguments)}:t[n];const r=e.getAll(n);return 0===r.length?void 0:1===r.length?r[0]:formDataArrayProxy(t,n,r)},set:function(e,t,n){return"string"==typeof t&&(e.delete(t),"function"==typeof n.forEach?n.forEach((function(n){e.append(t,n)})):"object"!=typeof n||n instanceof Blob?e.append(t,n):e.append(t,JSON.stringify(n)),!0)},deleteProperty:function(e,t){return"string"==typeof t&&e.delete(t),!0},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function issueAjaxRequest(e,t,n,r,o,a){let s=null,i=null;if((o=null!=o?o:{}).returnPromise&&"undefined"!=typeof Promise)var l=new Promise((function(e,t){s=e,i=t}));null==n&&(n=getDocument().body);const c=o.handler||handleAjaxResponse,u=o.select||null;if(!bodyContains(n))return maybeCall(s),l;const d=o.targetOverride||asElement(getTarget(n));if(null==d||d==DUMMY_ELT)return triggerErrorEvent(n,"htmx:targetError",{target:getAttributeValue(n,"hx-target")}),maybeCall(i),l;let f=getInternalData(n);const g=f.lastButtonClicked;if(g){const n=getRawAttribute(g,"formaction");null!=n&&(t=n);const r=getRawAttribute(g,"formmethod");null!=r&&"dialog"!==r.toLowerCase()&&(e=r)}const h=getClosestAttributeValue(n,"hx-confirm");if(void 0===a&&!1===triggerEvent(n,"htmx:confirm",{target:d,elt:n,path:t,verb:e,triggeringEvent:r,etc:o,issueRequest:function(a){return issueAjaxRequest(e,t,n,r,o,!!a)},question:h}))return maybeCall(s),l;let m=n,p=getClosestAttributeValue(n,"hx-sync"),E=null,b=!1;if(p){const e=p.split(":"),t=e[0].trim();if(m="this"===t?findThisElement(n,"hx-sync"):asElement(querySelectorExt(n,t)),p=(e[1]||"drop").trim(),f=getInternalData(m),"drop"===p&&f.xhr&&!0!==f.abortable)return maybeCall(s),l;if("abort"===p){if(f.xhr)return maybeCall(s),l;b=!0}else"replace"===p?triggerEvent(m,"htmx:abort"):0===p.indexOf("queue")&&(E=(p.split(" ")[1]||"last").trim())}if(f.xhr){if(!f.abortable){if(null==E){if(r){const e=getInternalData(r);e&&e.triggerSpec&&e.triggerSpec.queue&&(E=e.triggerSpec.queue)}null==E&&(E="last")}return null==f.queuedRequests&&(f.queuedRequests=[]),"first"===E&&0===f.queuedRequests.length||"all"===E?f.queuedRequests.push((function(){issueAjaxRequest(e,t,n,r,o)})):"last"===E&&(f.queuedRequests=[],f.queuedRequests.push((function(){issueAjaxRequest(e,t,n,r,o)}))),maybeCall(s),l}triggerEvent(m,"htmx:abort")}const x=new XMLHttpRequest;f.xhr=x,f.abortable=b;const y=function(){f.xhr=null,f.abortable=!1,null!=f.queuedRequests&&f.queuedRequests.length>0&&f.queuedRequests.shift()()},v=getClosestAttributeValue(n,"hx-prompt");if(v){var w=prompt(v);if(null===w||!triggerEvent(n,"htmx:prompt",{prompt:w,target:d}))return maybeCall(s),y(),l}if(h&&!a&&!confirm(h))return maybeCall(s),y(),l;let S=getHeaders(n,d,w);"get"===e||usesFormData(n)||(S["Content-Type"]="application/x-www-form-urlencoded"),o.headers&&(S=mergeObjects(S,o.headers));const A=getInputValues(n,e);let C=A.errors;const T=A.formData;o.values&&overrideFormData(T,formDataFromObject(o.values));const H=overrideFormData(T,formDataFromObject(getExpressionVars(n)));let R=filterValues(H,n);htmx.config.getCacheBusterParam&&"get"===e&&R.set("org.htmx.cache-buster",getRawAttribute(d,"id")||"true"),null!=t&&""!==t||(t=getDocument().location.href);const O=getValuesForElement(n,"hx-request"),I=getInternalData(n).boosted;let D=htmx.config.methodsThatUseUrlParams.indexOf(e)>=0;const _={boosted:I,useUrlParams:D,formData:R,parameters:formDataProxy(R),unfilteredFormData:H,unfilteredParameters:formDataProxy(H),headers:S,target:d,verb:e,errors:C,withCredentials:o.credentials||O.credentials||htmx.config.withCredentials,timeout:o.timeout||O.timeout||htmx.config.timeout,path:t,triggeringEvent:r};if(!triggerEvent(n,"htmx:configRequest",_))return maybeCall(s),y(),l;if(t=_.path,e=_.verb,S=_.headers,R=formDataFromObject(_.parameters),C=_.errors,D=_.useUrlParams,C&&C.length>0)return triggerEvent(n,"htmx:validation:halted",_),maybeCall(s),y(),l;const N=t.split("#"),L=N[0],q=N[1];let P=t;if(D&&(P=L,!R.keys().next().done&&(P.indexOf("?")<0?P+="?":P+="&",P+=urlEncode(R),q&&(P+="#"+q))),!verifyPath(n,P,_))return triggerErrorEvent(n,"htmx:invalidPath",_),maybeCall(i),l;if(x.open(e.toUpperCase(),P,!0),x.overrideMimeType("text/html"),x.withCredentials=_.withCredentials,x.timeout=_.timeout,O.noHeaders);else for(const e in S)if(S.hasOwnProperty(e)){const t=S[e];safelySetHeaderValue(x,e,t)}const F={xhr:x,target:d,requestConfig:_,etc:o,boosted:I,select:u,pathInfo:{requestPath:t,finalRequestPath:P,responsePath:null,anchor:q}};if(x.onload=function(){try{const e=hierarchyForElt(n);if(F.pathInfo.responsePath=getPathFromResponse(x),c(n,F),!0!==F.keepIndicators&&removeRequestIndicators(k,M),triggerEvent(n,"htmx:afterRequest",F),triggerEvent(n,"htmx:afterOnLoad",F),!bodyContains(n)){let t=null;for(;e.length>0&&null==t;){const n=e.shift();bodyContains(n)&&(t=n)}t&&(triggerEvent(t,"htmx:afterRequest",F),triggerEvent(t,"htmx:afterOnLoad",F))}maybeCall(s),y()}catch(e){throw triggerErrorEvent(n,"htmx:onLoadError",mergeObjects({error:e},F)),e}},x.onerror=function(){removeRequestIndicators(k,M),triggerErrorEvent(n,"htmx:afterRequest",F),triggerErrorEvent(n,"htmx:sendError",F),maybeCall(i),y()},x.onabort=function(){removeRequestIndicators(k,M),triggerErrorEvent(n,"htmx:afterRequest",F),triggerErrorEvent(n,"htmx:sendAbort",F),maybeCall(i),y()},x.ontimeout=function(){removeRequestIndicators(k,M),triggerErrorEvent(n,"htmx:afterRequest",F),triggerErrorEvent(n,"htmx:timeout",F),maybeCall(i),y()},!triggerEvent(n,"htmx:beforeRequest",F))return maybeCall(s),y(),l;var k=addRequestIndicatorClasses(n),M=disableElements(n);forEach(["loadstart","loadend","progress","abort"],(function(e){forEach([x,x.upload],(function(t){t.addEventListener(e,(function(t){triggerEvent(n,"htmx:xhr:"+e,{lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total})}))}))})),triggerEvent(n,"htmx:beforeSend",F);const V=D?null:encodeParamsForBody(x,n,R);return x.send(V),l}function determineHistoryUpdates(e,t){const n=t.xhr;let r=null,o=null;if(hasHeader(n,/HX-Push:/i)?(r=n.getResponseHeader("HX-Push"),o="push"):hasHeader(n,/HX-Push-Url:/i)?(r=n.getResponseHeader("HX-Push-Url"),o="push"):hasHeader(n,/HX-Replace-Url:/i)&&(r=n.getResponseHeader("HX-Replace-Url"),o="replace"),r)return"false"===r?{}:{type:o,path:r};const a=t.pathInfo.finalRequestPath,s=t.pathInfo.responsePath,i=getClosestAttributeValue(e,"hx-push-url"),l=getClosestAttributeValue(e,"hx-replace-url"),c=getInternalData(e).boosted;let u=null,d=null;return i?(u="push",d=i):l?(u="replace",d=l):c&&(u="push",d=s||a),d?"false"===d?{}:("true"===d&&(d=s||a),t.pathInfo.anchor&&-1===d.indexOf("#")&&(d=d+"#"+t.pathInfo.anchor),{type:u,path:d}):{}}function codeMatches(e,t){return new RegExp(e.code).test(t.toString(10))}function resolveResponseHandling(e){for(var t=0;t<htmx.config.responseHandling.length;t++){var n=htmx.config.responseHandling[t];if(codeMatches(n,e.status))return n}return{swap:!1}}function handleTitle(e){if(e){const t=find("title");t?t.innerHTML=e:window.document.title=e}}function handleAjaxResponse(e,t){const n=t.xhr;let r=t.target;const o=t.etc,a=t.select;if(!triggerEvent(e,"htmx:beforeOnLoad",t))return;if(hasHeader(n,/HX-Trigger:/i)&&handleTriggerHeader(n,"HX-Trigger",e),hasHeader(n,/HX-Location:/i)){saveCurrentPageToHistory();let e=n.getResponseHeader("HX-Location");var s;return 0===e.indexOf("{")&&(s=parseJSON(e),e=s.path,delete s.path),void ajaxHelper("get",e,s).then((function(){pushUrlIntoHistory(e)}))}const i=hasHeader(n,/HX-Refresh:/i)&&"true"===n.getResponseHeader("HX-Refresh");if(hasHeader(n,/HX-Redirect:/i))return t.keepIndicators=!0,location.href=n.getResponseHeader("HX-Redirect"),void(i&&location.reload());if(i)return t.keepIndicators=!0,void location.reload();hasHeader(n,/HX-Retarget:/i)&&("this"===n.getResponseHeader("HX-Retarget")?t.target=e:t.target=asElement(querySelectorExt(e,n.getResponseHeader("HX-Retarget"))));const l=determineHistoryUpdates(e,t),c=resolveResponseHandling(n),u=c.swap;let d=!!c.error,f=htmx.config.ignoreTitle||c.ignoreTitle,g=c.select;c.target&&(t.target=asElement(querySelectorExt(e,c.target)));var h=o.swapOverride;null==h&&c.swapOverride&&(h=c.swapOverride),hasHeader(n,/HX-Retarget:/i)&&("this"===n.getResponseHeader("HX-Retarget")?t.target=e:t.target=asElement(querySelectorExt(e,n.getResponseHeader("HX-Retarget")))),hasHeader(n,/HX-Reswap:/i)&&(h=n.getResponseHeader("HX-Reswap"));var m=n.response,p=mergeObjects({shouldSwap:u,serverResponse:m,isError:d,ignoreTitle:f,selectOverride:g},t);if((!c.event||triggerEvent(r,c.event,p))&&triggerEvent(r,"htmx:beforeSwap",p)){if(r=p.target,m=p.serverResponse,d=p.isError,f=p.ignoreTitle,g=p.selectOverride,t.target=r,t.failed=d,t.successful=!d,p.shouldSwap){286===n.status&&cancelPolling(e),withExtensions(e,(function(t){m=t.transformResponse(m,n,e)})),l.type&&saveCurrentPageToHistory(),hasHeader(n,/HX-Reswap:/i)&&(h=n.getResponseHeader("HX-Reswap"));var E=getSwapSpecification(e,h);E.hasOwnProperty("ignoreTitle")||(E.ignoreTitle=f),r.classList.add(htmx.config.swappingClass);let o=null,s=null;a&&(g=a),hasHeader(n,/HX-Reselect:/i)&&(g=n.getResponseHeader("HX-Reselect"));const i=getClosestAttributeValue(e,"hx-select-oob"),c=getClosestAttributeValue(e,"hx-select");let u=function(){try{l.type&&(triggerEvent(getDocument().body,"htmx:beforeHistoryUpdate",mergeObjects({history:l},t)),"push"===l.type?(pushUrlIntoHistory(l.path),triggerEvent(getDocument().body,"htmx:pushedIntoHistory",{path:l.path})):(replaceUrlInHistory(l.path),triggerEvent(getDocument().body,"htmx:replacedInHistory",{path:l.path}))),swap(r,m,E,{select:g||c,selectOOB:i,eventInfo:t,anchor:t.pathInfo.anchor,contextElement:e,afterSwapCallback:function(){if(hasHeader(n,/HX-Trigger-After-Swap:/i)){let t=e;bodyContains(e)||(t=getDocument().body),handleTriggerHeader(n,"HX-Trigger-After-Swap",t)}},afterSettleCallback:function(){if(hasHeader(n,/HX-Trigger-After-Settle:/i)){let t=e;bodyContains(e)||(t=getDocument().body),handleTriggerHeader(n,"HX-Trigger-After-Settle",t)}maybeCall(o)}})}catch(n){throw triggerErrorEvent(e,"htmx:swapError",t),maybeCall(s),n}},d=htmx.config.globalViewTransitions;if(E.hasOwnProperty("transition")&&(d=E.transition),d&&triggerEvent(e,"htmx:beforeTransition",t)&&"undefined"!=typeof Promise&&document.startViewTransition){const e=new Promise((function(e,t){o=e,s=t})),t=u;u=function(){document.startViewTransition((function(){return t(),e}))}}E.swapDelay>0?getWindow().setTimeout(u,E.swapDelay):u()}d&&triggerErrorEvent(e,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+n.status+" from "+t.pathInfo.requestPath},t))}}const 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,r){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(null==t&&(t=[]),null==e)return t;null==n&&(n=[]);const r=getAttributeValue(e,"hx-ext");return r&&forEach(r.split(","),(function(e){if("ignore:"!=(e=e.replace(/ /g,"")).slice(0,7)){if(n.indexOf(e)<0){const n=extensions[e];n&&t.indexOf(n)<0&&t.push(n)}}else n.push(e.slice(7))})),getExtensions(asElement(parentElt(e)),t,n)}var isReady=!1;function ready(e){isReady||"complete"===getDocument().readyState?e():getDocument().addEventListener("DOMContentLoaded",e)}function insertIndicatorStyles(){if(!1!==htmx.config.includeIndicatorStyles){const e=htmx.config.inlineStyleNonce?` nonce="${htmx.config.inlineStyleNonce}"`:"";getDocument().head.insertAdjacentHTML("beforeend","<style"+e+">        ."+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;}        </style>")}}function getMetaConfig(){const e=getDocument().querySelector('meta[name="htmx-config"]');return e?parseJSON(e.content):null}function mergeMetaConfig(){const e=getMetaConfig();e&&(htmx.config=mergeObjects(htmx.config,e))}return getDocument().addEventListener("DOMContentLoaded",(function(){isReady=!0})),ready((function(){mergeMetaConfig(),insertIndicatorStyles();let e=getDocument().body;processNode(e);const t=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",(function(e){const t=getInternalData(e.target);t&&t.xhr&&t.xhr.abort()}));const n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){e.state&&e.state.htmx?(restoreHistory(),forEach(t,(function(e){triggerEvent(e,"htmx:restored",{document:getDocument(),triggerEvent})}))):n&&n(e)},getWindow().setTimeout((function(){triggerEvent(e,"htmx:load",{}),e=null}),0)})),htmx}();const __WEBPACK_DEFAULT_EXPORT__=htmx}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={},htmx=__webpack_require__(335);let bunny={dialog:function(e){console.log(typeof e,e)}};const src_bunny=bunny;let tool={indexOf:function(e){return Array.prototype.indexOf.call(e.parentNode.children,e)},escapeHTML:function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}};const src_tool=tool;htmx.A.defineExtension("bny-tab",{onEvent:function(e,t){return"htmx:beforeProcessNode"===e?function(e){const t=e.target;return null===t||!e.target.classList.contains("bny-tab")||(htmx.A.findAll(".bny-tab-item",t).forEach((e=>{htmx.A.on(e,"click",(function(){const e=src_tool.indexOf(this),t=this.parentNode.parentNode,n=htmx.A.find(t,`.bny-tab-body>div:nth-child(${e+1})`);htmx.A.findAll(t,".bny-tab-title .this").forEach((async function(e){e.classList.remove("this")})),htmx.A.findAll(t,".bny-tab-body .this").forEach((async function(e){e.classList.remove("this")})),htmx.A.addClass(this,"this"),htmx.A.addClass(n,"this"),n.classList.contains("process")||(htmx.A.process(n),htmx.A.addClass(n,"process"))}))})),!1)}(t):"htmx:afterProcessNode"===e?(function(e){const t=e.target;if(null!==t&&t.classList.contains("bny-tab-body")){const e=htmx.A.findAll(t.parentNode,".bny-tab-title .bny-tab-item").length,n=htmx.A.findAll(t,"div").length;if(e-n>0)for(let r=0;r<e-n;r++){const e=document.createElement("div");t.append(e)}let r=t.parentNode;const o=r.getAttribute("selected")??0;htmx.A.find(r,`.bny-tab-title .bny-tab-item:nth-child(${Number(o)+1})`).click()}}(t),!1):"htmx:beforeSwap"===e?(function(e){const t=e.target;if(null!==t&&t.classList.contains("bny-tab-item")){const n=src_tool.indexOf(t),r=htmx.A.find(t.parentNode.parentNode,`.bny-tab-body>div:nth-child(${n+1})`);200===e.detail.xhr.status?htmx.A.swap(r,e.detail.serverResponse,{swapStyle:"innerHTML"}):htmx.A.swap(r,"网络错误...",{swapStyle:"innerHTML"})}}(t),!1):void 0}}),htmx.A.defineExtension("bny-card",{onEvent:function(e,t){if("htmx:beforeSwap"===e){if(200===t.detail.xhr.status){const e=JSON.parse(t.detail.serverResponse);if(1===e.code){const n=e.data,r=n&&n.body?`\n                                <h4 class="bny-card-title">${n.body.title||""}</h4>\n                                <h5 class="bny-card-subtitle">${n.body.subtitle||""}</h5>\n                                <p class="bny-card-text">${n.body.text||""}</p>\n                            `:"";t.detail.elt.innerHTML=`\n                            <div class="bny-card">\n                                ${n&&n.top_img?`<img src="${n.top_img}" >`:""}\n                                ${n&&n.header?`<div class="bny-card-header">${n.header}</div>`:""}\n                                <div class="bny-card-body">${r}</div>\n                                ${n&&n.footer?`<div class="bny-card-footer">${n.footer}</div>`:""}\n                                ${n&&n.bottom_img?`<img src="${n.bottom_img}" >`:""}\n                            </div>`}else t.detail.elt.innerHTML=`<div class="bny-card">${data.msg}</div>`}else t.detail.elt.innerHTML='<div class="bny-card">网络错误</div>';return!1}}}),htmx.A.defineExtension("bny-code",{onEvent:function(e,t){if(null!==t.target&&"htmx:beforeSwap"===e){const e=t.target.getAttribute("hx-swap")||"innerHTML";if(200===t.detail.xhr.status){const n=`<pre><code>${src_tool.escapeHTML(t.detail.serverResponse)}</code></pre>`;htmx.A.swap(t.target,n,{swapStyle:e})}else htmx.A.swap(t.target,"<span>网络错误...</span>",{swapStyle:e});return!1}}}),htmx.A.defineExtension("bny-marquee",{onEvent:function(e,t){if("htmx:beforeProcessNode"===e&&t.target.classList.contains("bny-marquee")){const e=t.target.getAttribute("speed")||50;let o=htmx.A.find(t.target,".bny-marquee-content");var n=o.parentNode.offsetWidth,r=(o.offsetWidth+n)/Number(e);return o.style.animationDuration=r+"s",!1}}}),htmx.A.defineExtension("bny-alert",{onEvent:function(e,t){if("htmx:beforeProcessNode"===e){const e=t.target;let n=document.createElement("span");n.setAttribute("class","alert-del"),n.textContent="X",e.append(n),htmx.A.on(n,"click",(function(){this.parentNode.style.opacity=0,setTimeout((()=>{this.parentNode.remove()}),235)}))}}}),function(){function e(t){let n="";return t.forEach((t=>{const r=t.icon?`<i class="${t.icon}"></i>`:"",o=t.children?`<menu>${e(t.children)}</menu>`:"",a=t.url?t.url:"javascript:;",s=t.title?`<span>${t.title}</span>`:"";n+=`<li><a href="${a}">${r}${s}${o}</a></li>`})),n}function t(t){const n=t.target.getAttribute("hx-swap")||"innerHTML",r=null!==t.target.getAttribute("vertical")?"vertical":"";if(200===t.detail.xhr.status){const o=JSON.parse(t.detail.serverResponse);if(1===o.code){const a=o.data;htmx.A.swap(t.detail.elt,`<menu class="bny-menu" ${r}>${e(a)}</menu>`,{swapStyle:n})}else htmx.A.swap(t.detail.elt,`<span>加载失败${o.msg}...</span>`,{swapStyle:n})}else htmx.A.swap(t.detail.elt,"<span>网络错误...</span>",{swapStyle:n})}htmx.A.defineExtension("bny-menu",{onEvent:function(e,n){null!==n.target&&"htmx:beforeSwap"===e&&t(n)}})}(),window.htmx=htmx.A,window.bunny=src_bunny})();
\ No newline at end of file
diff --git a/doc/dialog.md b/doc/dialog.md
new file mode 100644
index 0000000..a2533c3
--- /dev/null
+++ b/doc/dialog.md
@@ -0,0 +1,13 @@
+对话框
+
+<!-- <button class="bny-btn" hx-on:click="bunny.dialog({'elem':this})">消息</button> -->
+<button class="bny-btn" hx-delete="#" hx-confirm="???" bny>消息</button>
+
+<script>
+    document.body.addEventListener('htmx:confirm', function (evt) {
+        if (evt.target.matches("[bny]")) {
+            evt.preventDefault();
+            console.log(evt.target)
+        }
+    });
+</script>
\ No newline at end of file
diff --git a/highlight.min.js b/highlight.min.js
index 3c2f2a3..bb51211 100644
--- a/highlight.min.js
+++ b/highlight.min.js
@@ -262,7 +262,7 @@
     K("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}
     return n.split(/\s+/).find((e=>_(e)||N(e)))})(e);if(_(t))return
     ;if(O("before:highlightElement",{el:e,language:t
-    }),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e)
+    }),e.dataset.highlighted)return /* void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e) */
     ;if(e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),
     console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),
     console.warn("The element with unescaped HTML:"),
diff --git a/index.html b/index.html
index 7e03d83..b0aa9a3 100644
--- a/index.html
+++ b/index.html
@@ -51,6 +51,7 @@
                 <div class="bny-tab-item">辅助</div>
                 <div class="bny-tab-item">公共类</div>
                 <div class="bny-tab-item">表格</div>
+                <div class="bny-tab-item">对话框</div>
             </div>
             <div class="bny-tab-body" hx-trigger="load">
                 <div class="marked" hx-get="doc/color.md" hx-trigger="load"></div>
@@ -69,6 +70,7 @@
                 <div class="marked" hx-get="doc/subsidiary.md" hx-trigger="load"></div>
                 <div class="marked" hx-get="doc/class.md" hx-trigger="load"></div>
                 <div class="marked" hx-get="doc/table.md" hx-trigger="load"></div>
+                <div class="marked" hx-get="doc/dialog.md" hx-trigger="load"></div>
             </div>
         </div>
     </div>
diff --git a/src/bunny.js b/src/bunny.js
new file mode 100644
index 0000000..8bf65c1
--- /dev/null
+++ b/src/bunny.js
@@ -0,0 +1,10 @@
+/**
+ * API组件
+ */
+let bunny = {
+    dialog: function (e) {
+        console.log(typeof e, e)
+    }
+}
+
+export default bunny
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index c57924d..1c1070d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,4 +1,5 @@
 import htmx from "./htmx.js"
+import bunny from "./bunny.js"
 import "./bny-tab.js"
 import "./bny-card.js"
 import "./bny-code.js"
@@ -6,4 +7,5 @@ import "./bny-marquee.js"
 import "./bny-alert.js"
 import "./bny-menu.js"
 
-window.htmx = htmx
\ No newline at end of file
+window.htmx = htmx
+window.bunny = bunny
\ No newline at end of file