diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index 5624e7298e..f7e00ea839 100644 --- a/netbox/project-static/dist/netbox.js +++ b/netbox/project-static/dist/netbox.js @@ -1,19 +1,19 @@ -(()=>{var uh=Object.create;var _a=Object.defineProperty,dh=Object.defineProperties,fh=Object.getOwnPropertyDescriptor,hh=Object.getOwnPropertyDescriptors,ph=Object.getOwnPropertyNames,cu=Object.getOwnPropertySymbols,mh=Object.getPrototypeOf,uu=Object.prototype.hasOwnProperty,gh=Object.prototype.propertyIsEnumerable;var Gl=(ii,ti,ei)=>ti in ii?_a(ii,ti,{enumerable:!0,configurable:!0,writable:!0,value:ei}):ii[ti]=ei,Ui=(ii,ti)=>{for(var ei in ti||(ti={}))uu.call(ti,ei)&&Gl(ii,ei,ti[ei]);if(cu)for(var ei of cu(ti))gh.call(ti,ei)&&Gl(ii,ei,ti[ei]);return ii},Fn=(ii,ti)=>dh(ii,hh(ti)),du=ii=>_a(ii,"__esModule",{value:!0});var Ga=(ii,ti)=>()=>(ti||ii((ti={exports:{}}).exports,ti),ti.exports),fu=(ii,ti)=>{du(ii);for(var ei in ti)_a(ii,ei,{get:ti[ei],enumerable:!0})},vh=(ii,ti,ei)=>{if(ti&&typeof ti=="object"||typeof ti=="function")for(let ni of ph(ti))!uu.call(ii,ni)&&ni!=="default"&&_a(ii,ni,{get:()=>ti[ni],enumerable:!(ei=fh(ti,ni))||ei.enumerable});return ii},zo=ii=>vh(du(_a(ii!=null?uh(mh(ii)):{},"default",ii&&ii.__esModule&&"default"in ii?{get:()=>ii.default,enumerable:!0}:{value:ii,enumerable:!0})),ii);var Pn=(ii,ti,ei)=>(Gl(ii,typeof ti!="symbol"?ti+"":ti,ei),ei);var $s=(ii,ti,ei)=>new Promise((ni,ri)=>{var si=di=>{try{li(ei.next(di))}catch(vi){ri(vi)}},ai=di=>{try{li(ei.throw(di))}catch(vi){ri(vi)}},li=di=>di.done?ni(di.value):Promise.resolve(di.value).then(si,ai);li((ei=ei.apply(ii,ti)).next())});var Rd=Ga((exports,module)=>{(function(ii,ti){typeof define=="function"&&define.amd?define([],ti):typeof module=="object"&&module.exports?module.exports=ti():ii.htmx=ii.htmx||ti()})(typeof self!="undefined"?self:exports,function(){return function(){"use strict";var Q={onLoad:F,process:zt,on:de,off:ge,trigger:ce,ajax:Nr,find:C,findAll:f,closest:v,values:function(ii,ti){var ei=dr(ii,ti||"post");return ei.values},remove:_,addClass:z,removeClass:n,toggleClass:$,takeClass:W,defineExtension:Ur,removeExtension:Br,logAll:V,logNone:j,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:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:!1,scrollBehavior:"smooth",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get"],selfRequestsOnly:!1,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null},parseInterval:d,_:t,createEventSource:function(ii){return new EventSource(ii,{withCredentials:!0})},createWebSocket:function(ii){var ti=new WebSocket(ii,[]);return ti.binaryType=Q.config.wsBinaryType,ti},version:"1.9.12"},r={addTriggerHandler:Lt,bodyContains:se,canAccessLocalStorage:U,findThisElement:xe,filterValues:yr,hasAttribute:o,getAttributeValue:te,getClosestAttributeValue:ne,getClosestMatch:c,getExpressionVars:Hr,getHeaders:xr,getInputValues:dr,getInternalData:ae,getSwapSpecification:wr,getTriggerSpecs:it,getTarget:ye,makeFragment:l,mergeObjects:le,makeSettleInfo:T,oobSwap:Ee,querySelectorExt:ue,selectAndSwap:je,settleImmediately:nr,shouldCancel:ut,triggerEvent:ce,triggerErrorEvent:fe,withExtensions:R},w=["get","post","put","delete","patch"],i=w.map(function(ii){return"[hx-"+ii+"], [data-hx-"+ii+"]"}).join(", "),S=e("head"),q=e("title"),H=e("svg",!0);function e(ii,ti){return new RegExp("<"+ii+"(\\s[^>]*>|>)([\\s\\S]*?)<\\/"+ii+">",ti?"gim":"im")}function d(ii){if(ii==null)return;let ti=NaN;return ii.slice(-2)=="ms"?ti=parseFloat(ii.slice(0,-2)):ii.slice(-1)=="s"?ti=parseFloat(ii.slice(0,-1))*1e3:ii.slice(-1)=="m"?ti=parseFloat(ii.slice(0,-1))*1e3*60:ti=parseFloat(ii),isNaN(ti)?void 0:ti}function ee(ii,ti){return ii.getAttribute&&ii.getAttribute(ti)}function o(ii,ti){return ii.hasAttribute&&(ii.hasAttribute(ti)||ii.hasAttribute("data-"+ti))}function te(ii,ti){return ee(ii,ti)||ee(ii,"data-"+ti)}function u(ii){return ii.parentElement}function re(){return document}function c(ii,ti){for(;ii&&!ti(ii);)ii=u(ii);return ii||null}function L(ii,ti,ei){var ni=te(ti,ei),ri=te(ti,"hx-disinherit");return ii!==ti&&ri&&(ri==="*"||ri.split(" ").indexOf(ei)>=0)?"unset":ni}function ne(ii,ti){var ei=null;if(c(ii,function(ni){return ei=L(ii,ni,ti)}),ei!=="unset")return ei}function h(ii,ti){var ei=ii.matches||ii.matchesSelector||ii.msMatchesSelector||ii.mozMatchesSelector||ii.webkitMatchesSelector||ii.oMatchesSelector;return ei&&ei.call(ii,ti)}function A(ii){var ti=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ei=ti.exec(ii);return ei?ei[1].toLowerCase():""}function s(ii,ti){for(var ei=new DOMParser,ni=ei.parseFromString(ii,"text/html"),ri=ni.body;ti>0;)ti--,ri=ri.firstChild;return ri==null&&(ri=re().createDocumentFragment()),ri}function N(ii){return/",0),si=ri.querySelector("template").content;return Q.config.allowScriptTags?oe(si.querySelectorAll("script"),function(ai){Q.config.inlineScriptNonce&&(ai.nonce=Q.config.inlineScriptNonce),ai.htmxExecuted=navigator.userAgent.indexOf("Firefox")===-1}):oe(si.querySelectorAll("script"),function(ai){_(ai)}),si}switch(ei){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return s(""+ni+"
",1);case"col":return s(""+ni+"
",2);case"tr":return s(""+ni+"
",2);case"td":case"th":return s(""+ni+"
",3);case"script":case"style":return s("
"+ni+"
",1);default:return s(ni,0)}}function ie(ii){ii&&ii()}function I(ii,ti){return Object.prototype.toString.call(ii)==="[object "+ti+"]"}function k(ii){return I(ii,"Function")}function P(ii){return I(ii,"Object")}function ae(ii){var ti="htmx-internal-data",ei=ii[ti];return ei||(ei=ii[ti]={}),ei}function M(ii){var ti=[];if(ii)for(var ei=0;ei=0}function se(ii){return ii.getRootNode&&ii.getRootNode()instanceof window.ShadowRoot?re().body.contains(ii.getRootNode().host):re().body.contains(ii)}function D(ii){return ii.trim().split(/\s+/)}function le(ii,ti){for(var ei in ti)ti.hasOwnProperty(ei)&&(ii[ei]=ti[ei]);return ii}function E(ii){try{return JSON.parse(ii)}catch(ti){return b(ti),null}}function U(){var ii="htmx:localStorageTest";try{return localStorage.setItem(ii,ii),localStorage.removeItem(ii),!0}catch(ti){return!1}}function B(ii){try{var ti=new URL(ii);return ti&&(ii=ti.pathname+ti.search),/^\/$/.test(ii)||(ii=ii.replace(/\/+$/,"")),ii}catch(ei){return ii}}function t(e){return Tr(re().body,function(){return eval(e)})}function F(ii){var ti=Q.on("htmx:load",function(ei){ii(ei.detail.elt)});return ti}function V(){Q.logger=function(ii,ti,ei){console&&console.log(ti,ii,ei)}}function j(){Q.logger=null}function C(ii,ti){return ti?ii.querySelector(ti):C(re(),ii)}function f(ii,ti){return ti?ii.querySelectorAll(ti):f(re(),ii)}function _(ii,ti){ii=p(ii),ti?setTimeout(function(){_(ii),ii=null},ti):ii.parentElement.removeChild(ii)}function z(ii,ti,ei){ii=p(ii),ei?setTimeout(function(){z(ii,ti),ii=null},ei):ii.classList&&ii.classList.add(ti)}function n(ii,ti,ei){ii=p(ii),ei?setTimeout(function(){n(ii,ti),ii=null},ei):ii.classList&&(ii.classList.remove(ti),ii.classList.length===0&&ii.removeAttribute("class"))}function $(ii,ti){ii=p(ii),ii.classList.toggle(ti)}function W(ii,ti){ii=p(ii),oe(ii.parentElement.children,function(ei){n(ei,ti)}),z(ii,ti)}function v(ii,ti){if(ii=p(ii),ii.closest)return ii.closest(ti);do if(ii==null||h(ii,ti))return ii;while(ii=ii&&u(ii));return null}function g(ii,ti){return ii.substring(0,ti.length)===ti}function G(ii,ti){return ii.substring(ii.length-ti.length)===ti}function J(ii){var ti=ii.trim();return g(ti,"<")&&G(ti,"/>")?ti.substring(1,ti.length-2):ti}function Z(ii,ti){return ti.indexOf("closest ")===0?[v(ii,J(ti.substr(8)))]:ti.indexOf("find ")===0?[C(ii,J(ti.substr(5)))]:ti==="next"?[ii.nextElementSibling]:ti.indexOf("next ")===0?[K(ii,J(ti.substr(5)))]:ti==="previous"?[ii.previousElementSibling]:ti.indexOf("previous ")===0?[Y(ii,J(ti.substr(9)))]:ti==="document"?[document]:ti==="window"?[window]:ti==="body"?[document.body]:re().querySelectorAll(J(ti))}var K=function(ii,ti){for(var ei=re().querySelectorAll(ti),ni=0;ni=0;ni--){var ri=ei[ni];if(ri.compareDocumentPosition(ii)===Node.DOCUMENT_POSITION_FOLLOWING)return ri}};function ue(ii,ti){return ti?Z(ii,ti)[0]:Z(re().body,ii)[0]}function p(ii){return I(ii,"String")?C(ii):ii}function ve(ii,ti,ei){return k(ti)?{target:re().body,event:ii,listener:ti}:{target:p(ii),event:ti,listener:ei}}function de(ii,ti,ei){jr(function(){var ri=ve(ii,ti,ei);ri.target.addEventListener(ri.event,ri.listener)});var ni=k(ti);return ni?ti:ei}function ge(ii,ti,ei){return jr(function(){var ni=ve(ii,ti,ei);ni.target.removeEventListener(ni.event,ni.listener)}),k(ti)?ti:ei}var pe=re().createElement("output");function me(ii,ti){var ei=ne(ii,ti);if(ei){if(ei==="this")return[xe(ii,ti)];var ni=Z(ii,ei);return ni.length===0?(b('The selector "'+ei+'" on '+ti+" returned no matches!"),[pe]):ni}}function xe(ii,ti){return c(ii,function(ei){return te(ei,ti)!=null})}function ye(ii){var ti=ne(ii,"hx-target");if(ti)return ti==="this"?xe(ii,"hx-target"):ue(ii,ti);var ei=ae(ii);return ei.boosted?re().body:ii}function be(ii){for(var ti=Q.config.attributesToSettle,ei=0;ei0?(ri=ii.substr(0,ii.indexOf(":")),ni=ii.substr(ii.indexOf(":")+1,ii.length)):ri=ii);var si=re().querySelectorAll(ni);return si?(oe(si,function(ai){var li,di=ti.cloneNode(!0);li=re().createDocumentFragment(),li.appendChild(di),Se(ri,ai)||(li=di);var vi={shouldSwap:!0,target:ai,fragment:li};!ce(ai,"htmx:oobBeforeSwap",vi)||(ai=vi.target,vi.shouldSwap&&Fe(ri,ai,ai,li,ei),oe(ei.elts,function(hi){ce(hi,"htmx:oobAfterSwap",vi)}))}),ti.parentNode.removeChild(ti)):(ti.parentNode.removeChild(ti),fe(re().body,"htmx:oobErrorNoTarget",{content:ti})),ii}function Ce(ii,ti,ei){var ni=ne(ii,"hx-select-oob");if(ni)for(var ri=ni.split(","),si=0;si0){var si=ri.replace("'","\\'"),ai=ni.tagName.replace(":","\\:"),li=ii.querySelector(ai+"[id='"+si+"']");if(li&&li!==ii){var di=ni.cloneNode();we(ni,li),ei.tasks.push(function(){we(ni,di)})}}})}function Oe(ii){return function(){n(ii,Q.config.addedClass),zt(ii),Nt(ii),qe(ii),ce(ii,"htmx:load")}}function qe(ii){var ti="[autofocus]",ei=h(ii,ti)?ii:ii.querySelector(ti);ei!=null&&ei.focus()}function a(ii,ti,ei,ni){for(Te(ii,ei,ni);ei.childNodes.length>0;){var ri=ei.firstChild;z(ri,Q.config.addedClass),ii.insertBefore(ri,ti),ri.nodeType!==Node.TEXT_NODE&&ri.nodeType!==Node.COMMENT_NODE&&ni.tasks.push(Oe(ri))}}function He(ii,ti){for(var ei=0;ei-1){var ti=ii.replace(H,""),ei=ti.match(q);if(ei)return ei[2]}}function je(ii,ti,ei,ni,ri,si){ri.title=Ve(ni);var ai=l(ni);if(ai)return Ce(ei,ai,ri),ai=Be(ei,ai,si),Re(ai),Fe(ii,ei,ti,ai,ri)}function _e(ii,ti,ei){var ni=ii.getResponseHeader(ti);if(ni.indexOf("{")===0){var ri=E(ni);for(var si in ri)if(ri.hasOwnProperty(si)){var ai=ri[si];P(ai)||(ai={value:ai}),ce(ei,si,ai)}}else for(var li=ni.split(","),di=0;di0;){var ai=ti[0];if(ai==="]"){if(ni--,ni===0){si===null&&(ri=ri+"true"),ti.shift(),ri+=")})";try{var li=Tr(ii,function(){return Function(ri)()},function(){return!0});return li.source=ri,li}catch(di){return fe(re().body,"htmx:syntax:error",{error:di,source:ri}),null}}}else ai==="["&&ni++;Qe(ai,si,ei)?ri+="(("+ei+"."+ai+") ? ("+ei+"."+ai+") : (window."+ai+"))":ri=ri+ai,si=ti.shift()}}}function y(ii,ti){for(var ei="";ii.length>0&&!ti.test(ii[0]);)ei+=ii.shift();return ei}function tt(ii){var ti;return ii.length>0&&Ze.test(ii[0])?(ii.shift(),ti=y(ii,Ke).trim(),ii.shift()):ti=y(ii,x),ti}var rt="input, textarea, select";function nt(ii,ti,ei){var ni=[],ri=Ye(ti);do{y(ri,Je);var si=ri.length,ai=y(ri,/[,\[\s]/);if(ai!=="")if(ai==="every"){var li={trigger:"every"};y(ri,Je),li.pollInterval=d(y(ri,/[,\[\s]/)),y(ri,Je);var di=et(ii,ri,"event");di&&(li.eventFilter=di),ni.push(li)}else if(ai.indexOf("sse:")===0)ni.push({trigger:"sse",sseEvent:ai.substr(4)});else{var vi={trigger:ai},di=et(ii,ri,"event");for(di&&(vi.eventFilter=di);ri.length>0&&ri[0]!==",";){y(ri,Je);var hi=ri.shift();if(hi==="changed")vi.changed=!0;else if(hi==="once")vi.once=!0;else if(hi==="consume")vi.consume=!0;else if(hi==="delay"&&ri[0]===":")ri.shift(),vi.delay=d(y(ri,x));else if(hi==="from"&&ri[0]===":"){if(ri.shift(),Ze.test(ri[0]))var _i=tt(ri);else{var _i=y(ri,x);if(_i==="closest"||_i==="find"||_i==="next"||_i==="previous"){ri.shift();var Ei=tt(ri);Ei.length>0&&(_i+=" "+Ei)}}vi.from=_i}else hi==="target"&&ri[0]===":"?(ri.shift(),vi.target=tt(ri)):hi==="throttle"&&ri[0]===":"?(ri.shift(),vi.throttle=d(y(ri,x))):hi==="queue"&&ri[0]===":"?(ri.shift(),vi.queue=y(ri,x)):hi==="root"&&ri[0]===":"?(ri.shift(),vi[hi]=tt(ri)):hi==="threshold"&&ri[0]===":"?(ri.shift(),vi[hi]=y(ri,x)):fe(ii,"htmx:syntax:error",{token:ri.shift()})}ni.push(vi)}ri.length===si&&fe(ii,"htmx:syntax:error",{token:ri.shift()}),y(ri,Je)}while(ri[0]===","&&ri.shift());return ei&&(ei[ti]=ni),ni}function it(ii){var ti=te(ii,"hx-trigger"),ei=[];if(ti){var ni=Q.config.triggerSpecsCache;ei=ni&&ni[ti]||nt(ii,ti,ni)}return ei.length>0?ei:h(ii,"form")?[{trigger:"submit"}]:h(ii,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:h(ii,rt)?[{trigger:"change"}]:[{trigger:"click"}]}function at(ii){ae(ii).cancelled=!0}function ot(ii,ti,ei){var ni=ae(ii);ni.timeout=setTimeout(function(){se(ii)&&ni.cancelled!==!0&&(ct(ei,ii,Wt("hx:poll:trigger",{triggerSpec:ei,target:ii}))||ti(ii),ot(ii,ti,ei))},ei.pollInterval)}function st(ii){return location.hostname===ii.hostname&&ee(ii,"href")&&ee(ii,"href").indexOf("#")!==0}function lt(ii,ti,ei){if(ii.tagName==="A"&&st(ii)&&(ii.target===""||ii.target==="_self")||ii.tagName==="FORM"){ti.boosted=!0;var ni,ri;if(ii.tagName==="A")ni="get",ri=ee(ii,"href");else{var si=ee(ii,"method");ni=si?si.toLowerCase():"get",ri=ee(ii,"action")}ei.forEach(function(ai){ht(ii,function(li,di){if(v(li,Q.config.disableSelector)){m(li);return}he(ni,ri,li,di)},ti,ai,!0)})}}function ut(ii,ti){return!!((ii.type==="submit"||ii.type==="click")&&(ti.tagName==="FORM"||h(ti,'input[type="submit"], button')&&v(ti,"form")!==null||ti.tagName==="A"&&ti.href&&(ti.getAttribute("href")==="#"||ti.getAttribute("href").indexOf("#")!==0)))}function ft(ii,ti){return ae(ii).boosted&&ii.tagName==="A"&&ti.type==="click"&&(ti.ctrlKey||ti.metaKey)}function ct(ii,ti,ei){var ni=ii.eventFilter;if(ni)try{return ni.call(ti,ei)!==!0}catch(ri){return fe(re().body,"htmx:eventFilter:error",{error:ri,source:ni.source}),!0}return!1}function ht(ii,ti,ei,ni,ri){var si=ae(ii),ai;ni.from?ai=Z(ii,ni.from):ai=[ii],ni.changed&&ai.forEach(function(li){var di=ae(li);di.lastValue=li.value}),oe(ai,function(li){var di=function(vi){if(!se(ii)){li.removeEventListener(ni.trigger,di);return}if(!ft(ii,vi)&&((ri||ut(vi,ii))&&vi.preventDefault(),!ct(ni,ii,vi))){var hi=ae(vi);if(hi.triggerSpec=ni,hi.handledFor==null&&(hi.handledFor=[]),hi.handledFor.indexOf(ii)<0){if(hi.handledFor.push(ii),ni.consume&&vi.stopPropagation(),ni.target&&vi.target&&!h(vi.target,ni.target))return;if(ni.once){if(si.triggeredOnce)return;si.triggeredOnce=!0}if(ni.changed){var _i=ae(li);if(_i.lastValue===li.value)return;_i.lastValue=li.value}if(si.delayed&&clearTimeout(si.delayed),si.throttle)return;ni.throttle>0?si.throttle||(ti(ii,vi),si.throttle=setTimeout(function(){si.throttle=null},ni.throttle)):ni.delay>0?si.delayed=setTimeout(function(){ti(ii,vi)},ni.delay):(ce(ii,"htmx:trigger"),ti(ii,vi))}}};ei.listenerInfos==null&&(ei.listenerInfos=[]),ei.listenerInfos.push({trigger:ni.trigger,listener:di,on:li}),li.addEventListener(ni.trigger,di)})}var vt=!1,dt=null;function gt(){dt||(dt=function(){vt=!0},window.addEventListener("scroll",dt),setInterval(function(){vt&&(vt=!1,oe(re().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),function(ii){pt(ii)}))},200))}function pt(ii){if(!o(ii,"data-hx-revealed")&&X(ii)){ii.setAttribute("data-hx-revealed","true");var ti=ae(ii);ti.initHash?ce(ii,"revealed"):ii.addEventListener("htmx:afterProcessNode",function(ei){ce(ii,"revealed")},{once:!0})}}function mt(ii,ti,ei){for(var ni=D(ei),ri=0;ri=0){var ai=wt(ei);setTimeout(function(){xt(ii,ti,ei+1)},ai)}},ri.onopen=function(si){ei=0},ae(ii).webSocket=ri,ri.addEventListener("message",function(si){if(!yt(ii)){var ai=si.data;R(ii,function(Ei){ai=Ei.transformResponse(ai,null,ii)});for(var li=T(ii),di=l(ai),vi=M(di.children),hi=0;hi0){ce(ii,"htmx:validation:halted",ai);return}ni.send(JSON.stringify(hi)),ut(ei,ii)&&ei.preventDefault()}):fe(ii,"htmx:noWebSocketSourceError")}function wt(ii){var ti=Q.config.wsReconnectDelay;if(typeof ti=="function")return ti(ii);if(ti==="full-jitter"){var ei=Math.min(ii,6),ni=1e3*Math.pow(2,ei);return ni*Math.random()}b('htmx.config.wsReconnectDelay must either be a function or the string "full-jitter"')}function St(ii,ti,ei){for(var ni=D(ei),ri=0;ri0?setTimeout(ri,ni):ri()}function Ht(ii,ti,ei){var ni=!1;return oe(w,function(ri){if(o(ii,"hx-"+ri)){var si=te(ii,"hx-"+ri);ni=!0,ti.path=si,ti.verb=ri,ei.forEach(function(ai){Lt(ii,ai,ti,function(li,di){if(v(li,Q.config.disableSelector)){m(li);return}he(ri,si,li,di)})})}}),ni}function Lt(ii,ti,ei,ni){if(ti.sseEvent)Rt(ii,ni,ti.sseEvent);else if(ti.trigger==="revealed")gt(),ht(ii,ni,ei,ti),pt(ii);else if(ti.trigger==="intersect"){var ri={};ti.root&&(ri.root=ue(ii,ti.root)),ti.threshold&&(ri.threshold=parseFloat(ti.threshold));var si=new IntersectionObserver(function(ai){for(var li=0;li0?(ei.polling=!0,ot(ii,ni,ti)):ht(ii,ni,ei,ti)}function At(ii){if(!ii.htmxExecuted&&Q.config.allowScriptTags&&(ii.type==="text/javascript"||ii.type==="module"||ii.type==="")){var ti=re().createElement("script");oe(ii.attributes,function(ni){ti.setAttribute(ni.name,ni.value)}),ti.textContent=ii.textContent,ti.async=!1,Q.config.inlineScriptNonce&&(ti.nonce=Q.config.inlineScriptNonce);var ei=ii.parentElement;try{ei.insertBefore(ti,ii)}catch(ni){b(ni)}finally{ii.parentElement&&ii.parentElement.removeChild(ii)}}}function Nt(ii){h(ii,"script")&&At(ii),oe(f(ii,"script"),function(ti){At(ti)})}function It(ii){var ti=ii.attributes;if(!ti)return!1;for(var ei=0;ei0;){var ai=ni.shift(),li=ai.match(/^\s*([a-zA-Z:\-\.]+:)(.*)/);si===0&&li?(ai.split(":"),ri=li[1].slice(0,-1),ei[ri]=li[2]):ei[ri]+=ai,si+=Bt(ai)}for(var di in ei)Ft(ii,di,ei[di])}}function jt(ii){Ae(ii);for(var ti=0;tiQ.config.historyCacheSize;)ri.shift();for(;ri.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(ri));break}catch(li){fe(re().body,"htmx:historyCacheError",{cause:li,cache:ri}),ri.shift()}}}function Yt(ii){if(!U())return null;ii=B(ii);for(var ti=E(localStorage.getItem("htmx-history-cache"))||[],ei=0;ei=200&&this.status<400){ce(re().body,"htmx:historyCacheMissLoad",ei);var ni=l(this.response);ni=ni.querySelector("[hx-history-elt],[data-hx-history-elt]")||ni;var ri=Zt(),si=T(ri),ai=Ve(this.response);if(ai){var li=C("title");li?li.innerHTML=ai:window.document.title=ai}Ue(ri,ni,si),nr(si.tasks),Jt=ii,ce(re().body,"htmx:historyRestore",{path:ii,cacheMiss:!0,serverResponse:this.response})}else fe(re().body,"htmx:historyCacheMissLoadError",ei)},ti.send()}function ar(ii){er(),ii=ii||location.pathname+location.search;var ti=Yt(ii);if(ti){var ei=l(ti.content),ni=Zt(),ri=T(ni);Ue(ni,ei,ri),nr(ri.tasks),document.title=ti.title,setTimeout(function(){window.scrollTo(0,ti.scroll)},0),Jt=ii,ce(re().body,"htmx:historyRestore",{path:ii,item:ti})}else Q.config.refreshOnHistoryMiss?window.location.reload(!0):ir(ii)}function or(ii){var ti=me(ii,"hx-indicator");return ti==null&&(ti=[ii]),oe(ti,function(ei){var ni=ae(ei);ni.requestCount=(ni.requestCount||0)+1,ei.classList.add.call(ei.classList,Q.config.requestClass)}),ti}function sr(ii){var ti=me(ii,"hx-disabled-elt");return ti==null&&(ti=[]),oe(ti,function(ei){var ni=ae(ei);ni.requestCount=(ni.requestCount||0)+1,ei.setAttribute("disabled","")}),ti}function lr(ii,ti){oe(ii,function(ei){var ni=ae(ei);ni.requestCount=(ni.requestCount||0)-1,ni.requestCount===0&&ei.classList.remove.call(ei.classList,Q.config.requestClass)}),oe(ti,function(ei){var ni=ae(ei);ni.requestCount=(ni.requestCount||0)-1,ni.requestCount===0&&ei.removeAttribute("disabled")})}function ur(ii,ti){for(var ei=0;ei=0}function wr(ii,ti){var ei=ti||ne(ii,"hx-swap"),ni={swapStyle:ae(ii).boosted?"innerHTML":Q.config.defaultSwapStyle,swapDelay:Q.config.defaultSwapDelay,settleDelay:Q.config.defaultSettleDelay};if(Q.config.scrollIntoViewOnBoost&&ae(ii).boosted&&!br(ii)&&(ni.show="top"),ei){var ri=D(ei);if(ri.length>0)for(var si=0;si0?di.join(":"):null;ni.scroll=vi,ni.scrollTarget=hi}else if(ai.indexOf("show:")===0){var _i=ai.substr(5),di=_i.split(":"),Ei=di.pop(),hi=di.length>0?di.join(":"):null;ni.show=Ei,ni.showTarget=hi}else if(ai.indexOf("focus-scroll:")===0){var Ai=ai.substr("focus-scroll:".length);ni.focusScroll=Ai=="true"}else si==0?ni.swapStyle=ai:b("Unknown modifier in hx-swap: "+ai)}}return ni}function Sr(ii){return ne(ii,"hx-encoding")==="multipart/form-data"||h(ii,"form")&&ee(ii,"enctype")==="multipart/form-data"}function Er(ii,ti,ei){var ni=null;return R(ti,function(ri){ni==null&&(ni=ri.encodeParameters(ii,ei,ti))}),ni!=null?ni:Sr(ti)?mr(ei):pr(ei)}function T(ii){return{tasks:[],elts:[ii]}}function Cr(ii,ti){var ei=ii[0],ni=ii[ii.length-1];if(ti.scroll){var ri=null;ti.scrollTarget&&(ri=ue(ei,ti.scrollTarget)),ti.scroll==="top"&&(ei||ri)&&(ri=ri||ei,ri.scrollTop=0),ti.scroll==="bottom"&&(ni||ri)&&(ri=ri||ni,ri.scrollTop=ri.scrollHeight)}if(ti.show){var ri=null;if(ti.showTarget){var si=ti.showTarget;ti.showTarget==="window"&&(si="body"),ri=ue(ei,si)}ti.show==="top"&&(ei||ri)&&(ri=ri||ei,ri.scrollIntoView({block:"start",behavior:Q.config.scrollBehavior})),ti.show==="bottom"&&(ni||ri)&&(ri=ri||ni,ri.scrollIntoView({block:"end",behavior:Q.config.scrollBehavior}))}}function Rr(ii,ti,ei,ni){if(ni==null&&(ni={}),ii==null)return ni;var ri=te(ii,ti);if(ri){var si=ri.trim(),ai=ei;if(si==="unset")return null;si.indexOf("javascript:")===0?(si=si.substr(11),ai=!0):si.indexOf("js:")===0&&(si=si.substr(3),ai=!0),si.indexOf("{")!==0&&(si="{"+si+"}");var li;ai?li=Tr(ii,function(){return Function("return ("+si+")")()},{}):li=E(si);for(var di in li)li.hasOwnProperty(di)&&ni[di]==null&&(ni[di]=li[di])}return Rr(u(ii),ti,ei,ni)}function Tr(ii,ti,ei){return Q.config.allowEval?ti():(fe(ii,"htmx:evalDisallowedError"),ei)}function Or(ii,ti){return Rr(ii,"hx-vars",!0,ti)}function qr(ii,ti){return Rr(ii,"hx-vals",!1,ti)}function Hr(ii){return le(Or(ii),qr(ii))}function Lr(ii,ti,ei){if(ei!==null)try{ii.setRequestHeader(ti,ei)}catch(ni){ii.setRequestHeader(ti,encodeURIComponent(ei)),ii.setRequestHeader(ti+"-URI-AutoEncoded","true")}}function Ar(ii){if(ii.responseURL&&typeof URL!="undefined")try{var ti=new URL(ii.responseURL);return ti.pathname+ti.search}catch(ei){fe(re().body,"htmx:badResponseUrl",{url:ii.responseURL})}}function O(ii,ti){return ti.test(ii.getAllResponseHeaders())}function Nr(ii,ti,ei){return ii=ii.toLowerCase(),ei?ei instanceof Element||I(ei,"String")?he(ii,ti,null,null,{targetOverride:p(ei),returnPromise:!0}):he(ii,ti,p(ei.source),ei.event,{handler:ei.handler,headers:ei.headers,values:ei.values,targetOverride:p(ei.target),swapOverride:ei.swap,select:ei.select,returnPromise:!0}):he(ii,ti,null,null,{returnPromise:!0})}function Ir(ii){for(var ti=[];ii;)ti.push(ii),ii=ii.parentElement;return ti}function kr(ii,ti,ei){var ni,ri;if(typeof URL=="function"){ri=new URL(ti,document.location.href);var si=document.location.origin;ni=si===ri.origin}else ri=ti,ni=g(ti,document.location.origin);return Q.config.selfRequestsOnly&&!ni?!1:ce(ii,"htmx:validateUrl",le({url:ri,sameHost:ni},ei))}function he(ii,ti,ei,ni,ri,si){var ai=null,li=null;if(ri=ri!=null?ri:{},ri.returnPromise&&typeof Promise!="undefined")var di=new Promise(function(Wn,_n){ai=Wn,li=_n});ei==null&&(ei=re().body);var vi=ri.handler||Mr,hi=ri.select||null;if(!se(ei))return ie(ai),di;var _i=ri.targetOverride||ye(ei);if(_i==null||_i==pe)return fe(ei,"htmx:targetError",{target:te(ei,"hx-target")}),ie(li),di;var Ei=ae(ei),Ai=Ei.lastButtonClicked;if(Ai){var ki=ee(Ai,"formaction");ki!=null&&(ti=ki);var Ti=ee(Ai,"formmethod");Ti!=null&&Ti.toLowerCase()!=="dialog"&&(ii=Ti)}var Fi=ne(ei,"hx-confirm");if(si===void 0){var en=function(Wn){return he(ii,ti,ei,ni,ri,!!Wn)},rn={target:_i,elt:ei,path:ti,verb:ii,triggeringEvent:ni,etc:ri,issueRequest:en,question:Fi};if(ce(ei,"htmx:confirm",rn)===!1)return ie(ai),di}var ln=ei,Yi=ne(ei,"hx-sync"),sn=null,on=!1;if(Yi){var En=Yi.split(":"),pn=En[0].trim();if(pn==="this"?ln=xe(ei,"hx-sync"):ln=ue(ei,pn),Yi=(En[1]||"drop").trim(),Ei=ae(ln),Yi==="drop"&&Ei.xhr&&Ei.abortable!==!0)return ie(ai),di;if(Yi==="abort"){if(Ei.xhr)return ie(ai),di;on=!0}else if(Yi==="replace")ce(ln,"htmx:abort");else if(Yi.indexOf("queue")===0){var mn=Yi.split(" ");sn=(mn[1]||"last").trim()}}if(Ei.xhr)if(Ei.abortable)ce(ln,"htmx:abort");else{if(sn==null){if(ni){var vn=ae(ni);vn&&vn.triggerSpec&&vn.triggerSpec.queue&&(sn=vn.triggerSpec.queue)}sn==null&&(sn="last")}return Ei.queuedRequests==null&&(Ei.queuedRequests=[]),sn==="first"&&Ei.queuedRequests.length===0?Ei.queuedRequests.push(function(){he(ii,ti,ei,ni,ri)}):sn==="all"?Ei.queuedRequests.push(function(){he(ii,ti,ei,ni,ri)}):sn==="last"&&(Ei.queuedRequests=[],Ei.queuedRequests.push(function(){he(ii,ti,ei,ni,ri)})),ie(ai),di}var un=new XMLHttpRequest;Ei.xhr=un,Ei.abortable=on;var yn=function(){if(Ei.xhr=null,Ei.abortable=!1,Ei.queuedRequests!=null&&Ei.queuedRequests.length>0){var Wn=Ei.queuedRequests.shift();Wn()}},Cn=ne(ei,"hx-prompt");if(Cn){var Ni=prompt(Cn);if(Ni===null||!ce(ei,"htmx:prompt",{prompt:Ni,target:_i}))return ie(ai),yn(),di}if(Fi&&!si&&!confirm(Fi))return ie(ai),yn(),di;var Hi=xr(ei,_i,Ni);ii!=="get"&&!Sr(ei)&&(Hi["Content-Type"]="application/x-www-form-urlencoded"),ri.headers&&(Hi=le(Hi,ri.headers));var Pi=dr(ei,ii),$i=Pi.errors,gn=Pi.values;ri.values&&(gn=le(gn,ri.values));var tn=Hr(ei),Bi=le(gn,tn),Li=yr(Bi,ei);Q.config.getCacheBusterParam&&ii==="get"&&(Li["org.htmx.cache-buster"]=ee(_i,"id")||"true"),(ti==null||ti==="")&&(ti=re().location.href);var zi=Rr(ei,"hx-request"),Ji=ae(ei).boosted,Vi=Q.config.methodsThatUseUrlParams.indexOf(ii)>=0,Ri={boosted:Ji,useUrlParams:Vi,parameters:Li,unfilteredParameters:Bi,headers:Hi,target:_i,verb:ii,errors:$i,withCredentials:ri.credentials||zi.credentials||Q.config.withCredentials,timeout:ri.timeout||zi.timeout||Q.config.timeout,path:ti,triggeringEvent:ni};if(!ce(ei,"htmx:configRequest",Ri))return ie(ai),yn(),di;if(ti=Ri.path,ii=Ri.verb,Hi=Ri.headers,Li=Ri.parameters,$i=Ri.errors,Vi=Ri.useUrlParams,$i&&$i.length>0)return ce(ei,"htmx:validation:halted",Ri),ie(ai),yn(),di;var Sn=ti.split("#"),Kn=Sn[0],$n=Sn[1],Bn=ti;if(Vi){Bn=Kn;var Gn=Object.keys(Li).length!==0;Gn&&(Bn.indexOf("?")<0?Bn+="?":Bn+="&",Bn+=pr(Li),$n&&(Bn+="#"+$n))}if(!kr(ei,Bn,Ri))return fe(ei,"htmx:invalidPath",Ri),ie(li),di;if(un.open(ii.toUpperCase(),Bn,!0),un.overrideMimeType("text/html"),un.withCredentials=Ri.withCredentials,un.timeout=Ri.timeout,!zi.noHeaders){for(var Xn in Hi)if(Hi.hasOwnProperty(Xn)){var Cs=Hi[Xn];Lr(un,Xn,Cs)}}var zn={xhr:un,target:_i,requestConfig:Ri,etc:ri,boosted:Ji,select:hi,pathInfo:{requestPath:ti,finalRequestPath:Bn,anchor:$n}};if(un.onload=function(){try{var Wn=Ir(ei);if(zn.pathInfo.responsePath=Ar(un),vi(ei,zn),lr(ps,ms),ce(ei,"htmx:afterRequest",zn),ce(ei,"htmx:afterOnLoad",zn),!se(ei)){for(var _n=null;Wn.length>0&&_n==null;){var Qr=Wn.shift();se(Qr)&&(_n=Qr)}_n&&(ce(_n,"htmx:afterRequest",zn),ce(_n,"htmx:afterOnLoad",zn))}ie(ai),yn()}catch(ls){throw fe(ei,"htmx:onLoadError",le({error:ls},zn)),ls}},un.onerror=function(){lr(ps,ms),fe(ei,"htmx:afterRequest",zn),fe(ei,"htmx:sendError",zn),ie(li),yn()},un.onabort=function(){lr(ps,ms),fe(ei,"htmx:afterRequest",zn),fe(ei,"htmx:sendAbort",zn),ie(li),yn()},un.ontimeout=function(){lr(ps,ms),fe(ei,"htmx:afterRequest",zn),fe(ei,"htmx:timeout",zn),ie(li),yn()},!ce(ei,"htmx:beforeRequest",zn))return ie(ai),yn(),di;var ps=or(ei),ms=sr(ei);oe(["loadstart","loadend","progress","abort"],function(Wn){oe([un,un.upload],function(_n){_n.addEventListener(Wn,function(Qr){ce(ei,"htmx:xhr:"+Wn,{lengthComputable:Qr.lengthComputable,loaded:Qr.loaded,total:Qr.total})})})}),ce(ei,"htmx:beforeSend",zn);var Qs=Vi?null:Er(un,ei,Li);return un.send(Qs),di}function Pr(ii,ti){var ei=ti.xhr,ni=null,ri=null;if(O(ei,/HX-Push:/i)?(ni=ei.getResponseHeader("HX-Push"),ri="push"):O(ei,/HX-Push-Url:/i)?(ni=ei.getResponseHeader("HX-Push-Url"),ri="push"):O(ei,/HX-Replace-Url:/i)&&(ni=ei.getResponseHeader("HX-Replace-Url"),ri="replace"),ni)return ni==="false"?{}:{type:ri,path:ni};var si=ti.pathInfo.finalRequestPath,ai=ti.pathInfo.responsePath,li=ne(ii,"hx-push-url"),di=ne(ii,"hx-replace-url"),vi=ae(ii).boosted,hi=null,_i=null;return li?(hi="push",_i=li):di?(hi="replace",_i=di):vi&&(hi="push",_i=ai||si),_i?_i==="false"?{}:(_i==="true"&&(_i=ai||si),ti.pathInfo.anchor&&_i.indexOf("#")===-1&&(_i=_i+"#"+ti.pathInfo.anchor),{type:hi,path:_i}):{}}function Mr(ii,ti){var ei=ti.xhr,ni=ti.target,ri=ti.etc,si=ti.requestConfig,ai=ti.select;if(!!ce(ii,"htmx:beforeOnLoad",ti)){if(O(ei,/HX-Trigger:/i)&&_e(ei,"HX-Trigger",ii),O(ei,/HX-Location:/i)){er();var li=ei.getResponseHeader("HX-Location"),di;li.indexOf("{")===0&&(di=E(li),li=di.path,delete di.path),Nr("GET",li,di).then(function(){tr(li)});return}var vi=O(ei,/HX-Refresh:/i)&&ei.getResponseHeader("HX-Refresh")==="true";if(O(ei,/HX-Redirect:/i)){location.href=ei.getResponseHeader("HX-Redirect"),vi&&location.reload();return}if(vi){location.reload();return}O(ei,/HX-Retarget:/i)&&(ei.getResponseHeader("HX-Retarget")==="this"?ti.target=ii:ti.target=ue(ii,ei.getResponseHeader("HX-Retarget")));var hi=Pr(ii,ti),_i=ei.status>=200&&ei.status<400&&ei.status!==204,Ei=ei.response,Ai=ei.status>=400,ki=Q.config.ignoreTitle,Ti=le({shouldSwap:_i,serverResponse:Ei,isError:Ai,ignoreTitle:ki},ti);if(!!ce(ni,"htmx:beforeSwap",Ti)){if(ni=Ti.target,Ei=Ti.serverResponse,Ai=Ti.isError,ki=Ti.ignoreTitle,ti.target=ni,ti.failed=Ai,ti.successful=!Ai,Ti.shouldSwap){ei.status===286&&at(ii),R(ii,function(pn){Ei=pn.transformResponse(Ei,ei,ii)}),hi.type&&er();var Fi=ri.swapOverride;O(ei,/HX-Reswap:/i)&&(Fi=ei.getResponseHeader("HX-Reswap"));var di=wr(ii,Fi);di.hasOwnProperty("ignoreTitle")&&(ki=di.ignoreTitle),ni.classList.add(Q.config.swappingClass);var en=null,rn=null,ln=function(){try{var pn=document.activeElement,mn={};try{mn={elt:pn,start:pn?pn.selectionStart:null,end:pn?pn.selectionEnd:null}}catch(Pi){}var vn;ai&&(vn=ai),O(ei,/HX-Reselect:/i)&&(vn=ei.getResponseHeader("HX-Reselect")),hi.type&&(ce(re().body,"htmx:beforeHistoryUpdate",le({history:hi},ti)),hi.type==="push"?(tr(hi.path),ce(re().body,"htmx:pushedIntoHistory",{path:hi.path})):(rr(hi.path),ce(re().body,"htmx:replacedInHistory",{path:hi.path})));var un=T(ni);if(je(di.swapStyle,ni,ii,Ei,un,vn),mn.elt&&!se(mn.elt)&&ee(mn.elt,"id")){var yn=document.getElementById(ee(mn.elt,"id")),Cn={preventScroll:di.focusScroll!==void 0?!di.focusScroll:!Q.config.defaultFocusScroll};if(yn){if(mn.start&&yn.setSelectionRange)try{yn.setSelectionRange(mn.start,mn.end)}catch(Pi){}yn.focus(Cn)}}if(ni.classList.remove(Q.config.swappingClass),oe(un.elts,function(Pi){Pi.classList&&Pi.classList.add(Q.config.settlingClass),ce(Pi,"htmx:afterSwap",ti)}),O(ei,/HX-Trigger-After-Swap:/i)){var Ni=ii;se(ii)||(Ni=re().body),_e(ei,"HX-Trigger-After-Swap",Ni)}var Hi=function(){if(oe(un.tasks,function(tn){tn.call()}),oe(un.elts,function(tn){tn.classList&&tn.classList.remove(Q.config.settlingClass),ce(tn,"htmx:afterSettle",ti)}),ti.pathInfo.anchor){var Pi=re().getElementById(ti.pathInfo.anchor);Pi&&Pi.scrollIntoView({block:"start",behavior:"auto"})}if(un.title&&!ki){var $i=C("title");$i?$i.innerHTML=un.title:window.document.title=un.title}if(Cr(un.elts,di),O(ei,/HX-Trigger-After-Settle:/i)){var gn=ii;se(ii)||(gn=re().body),_e(ei,"HX-Trigger-After-Settle",gn)}ie(en)};di.settleDelay>0?setTimeout(Hi,di.settleDelay):Hi()}catch(Pi){throw fe(ii,"htmx:swapError",ti),ie(rn),Pi}},Yi=Q.config.globalViewTransitions;if(di.hasOwnProperty("transition")&&(Yi=di.transition),Yi&&ce(ii,"htmx:beforeTransition",ti)&&typeof Promise!="undefined"&&document.startViewTransition){var sn=new Promise(function(pn,mn){en=pn,rn=mn}),on=ln;ln=function(){document.startViewTransition(function(){return on(),sn})}}di.swapDelay>0?setTimeout(ln,di.swapDelay):ln()}Ai&&fe(ii,"htmx:responseError",le({error:"Response Status Error Code "+ei.status+" from "+ti.pathInfo.requestPath},ti))}}}var Xr={};function Dr(){return{init:function(ii){return null},onEvent:function(ii,ti){return!0},transformResponse:function(ii,ti,ei){return ii},isInlineSwap:function(ii){return!1},handleSwap:function(ii,ti,ei,ni){return!1},encodeParameters:function(ii,ti,ei){return null}}}function Ur(ii,ti){ti.init&&ti.init(r),Xr[ii]=le(Dr(),ti)}function Br(ii){delete Xr[ii]}function Fr(ii,ti,ei){if(ii==null)return ti;ti==null&&(ti=[]),ei==null&&(ei=[]);var ni=te(ii,"hx-ext");return ni&&oe(ni.split(","),function(ri){if(ri=ri.replace(/ /g,""),ri.slice(0,7)=="ignore:"){ei.push(ri.slice(7));return}if(ei.indexOf(ri)<0){var si=Xr[ri];si&&ti.indexOf(si)<0&&ti.push(si)}}),Fr(u(ii),ti,ei)}var Vr=!1;re().addEventListener("DOMContentLoaded",function(){Vr=!0});function jr(ii){Vr||re().readyState==="complete"?ii():re().addEventListener("DOMContentLoaded",ii)}function _r(){Q.config.includeIndicatorStyles!==!1&&re().head.insertAdjacentHTML("beforeend","")}function zr(){var ii=re().querySelector('meta[name="htmx-config"]');return ii?E(ii.content):null}function $r(){var ii=zr();ii&&(Q.config=le(Q.config,ii))}return jr(function(){$r(),_r();var ii=re().body;zt(ii);var ti=re().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");ii.addEventListener("htmx:abort",function(ni){var ri=ni.target,si=ae(ri);si&&si.xhr&&si.xhr.abort()});let ei=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(ni){ni.state&&ni.state.htmx?(ar(),oe(ti,function(ri){ce(ri,"htmx:restored",{document:re(),triggerEvent:ce})})):ei&&ei(ni)},setTimeout(function(){ce(ii,"htmx:load",{}),ii=null},0)}),Q}()})});var _l=Ga((Ic,Pc)=>{(function(ii,ti){typeof Ic=="object"&&typeof Pc!="undefined"?Pc.exports=ti():typeof define=="function"&&define.amd?define(ti):(ii=typeof globalThis!="undefined"?globalThis:ii||self,ii.TomSelect=ti())})(Ic,function(){"use strict";function ii(fi,oi){fi.split(/\s+/).forEach(ci=>{oi(ci)})}class ti{constructor(){this._events=void 0,this._events={}}on(oi,ci){ii(oi,ui=>{let mi=this._events[ui]||[];mi.push(ci),this._events[ui]=mi})}off(oi,ci){var ui=arguments.length;if(ui===0){this._events={};return}ii(oi,mi=>{if(ui===1){delete this._events[mi];return}let bi=this._events[mi];bi!==void 0&&(bi.splice(bi.indexOf(ci),1),this._events[mi]=bi)})}trigger(oi,...ci){var ui=this;ii(oi,mi=>{let bi=ui._events[mi];bi!==void 0&&bi.forEach(yi=>{yi.apply(ui,ci)})})}}function ei(fi){return fi.plugins={},class extends fi{constructor(...oi){super(...oi);this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(oi,ci){fi.plugins[oi]={name:oi,fn:ci}}initializePlugins(oi){var ci,ui;let mi=this,bi=[];if(Array.isArray(oi))oi.forEach(yi=>{typeof yi=="string"?bi.push(yi):(mi.plugins.settings[yi.name]=yi.options,bi.push(yi.name))});else if(oi)for(ci in oi)oi.hasOwnProperty(ci)&&(mi.plugins.settings[ci]=oi[ci],bi.push(ci));for(;ui=bi.shift();)mi.require(ui)}loadPlugin(oi){var ci=this,ui=ci.plugins,mi=fi.plugins[oi];if(!fi.plugins.hasOwnProperty(oi))throw new Error('Unable to find "'+oi+'" plugin');ui.requested[oi]=!0,ui.loaded[oi]=mi.fn.apply(ci,[ci.plugins.settings[oi]||{}]),ui.names.push(oi)}require(oi){var ci=this,ui=ci.plugins;if(!ci.plugins.loaded.hasOwnProperty(oi)){if(ui.requested[oi])throw new Error('Plugin has circular dependency ("'+oi+'")');ci.loadPlugin(oi)}return ui.loaded[oi]}}}let ni=fi=>(fi=fi.filter(Boolean),fi.length<2?fi[0]||"":di(fi)==1?"["+fi.join("")+"]":"(?:"+fi.join("|")+")"),ri=fi=>{if(!ai(fi))return fi.join("");let oi="",ci=0,ui=()=>{ci>1&&(oi+="{"+ci+"}")};return fi.forEach((mi,bi)=>{if(mi===fi[bi-1]){ci++;return}ui(),oi+=mi,ci=1}),ui(),oi},si=fi=>{let oi=hi(fi);return ni(oi)},ai=fi=>new Set(fi).size!==fi.length,li=fi=>(fi+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),di=fi=>fi.reduce((oi,ci)=>Math.max(oi,vi(ci)),0),vi=fi=>hi(fi).length,hi=fi=>Array.from(fi);let _i=fi=>{if(fi.length===1)return[[fi]];let oi=[],ci=fi.substring(1);return _i(ci).forEach(function(mi){let bi=mi.slice(0);bi[0]=fi.charAt(0)+bi[0],oi.push(bi),bi=mi.slice(0),bi.unshift(fi.charAt(0)),oi.push(bi)}),oi};let Ei=[[0,65535]],Ai="[\u0300-\u036F\xB7\u02BE\u02BC]",ki,Ti,Fi=3,en={},rn={"/":"\u2044\u2215","0":"\u07C0",a:"\u2C65\u0250\u0251",aa:"\uA733",ae:"\xE6\u01FD\u01E3",ao:"\uA735",au:"\uA737",av:"\uA739\uA73B",ay:"\uA73D",b:"\u0180\u0253\u0183",c:"\uA73F\u0188\u023C\u2184",d:"\u0111\u0257\u0256\u1D05\u018C\uABB7\u0501\u0266",e:"\u025B\u01DD\u1D07\u0247",f:"\uA77C\u0192",g:"\u01E5\u0260\uA7A1\u1D79\uA77F\u0262",h:"\u0127\u2C68\u2C76\u0265",i:"\u0268\u0131",j:"\u0249\u0237",k:"\u0199\u2C6A\uA741\uA743\uA745\uA7A3",l:"\u0142\u019A\u026B\u2C61\uA749\uA747\uA781\u026D",m:"\u0271\u026F\u03FB",n:"\uA7A5\u019E\u0272\uA791\u1D0E\u043B\u0509",o:"\xF8\u01FF\u0254\u0275\uA74B\uA74D\u1D11",oe:"\u0153",oi:"\u01A3",oo:"\uA74F",ou:"\u0223",p:"\u01A5\u1D7D\uA751\uA753\uA755\u03C1",q:"\uA757\uA759\u024B",r:"\u024D\u027D\uA75B\uA7A7\uA783",s:"\xDF\u023F\uA7A9\uA785\u0282",t:"\u0167\u01AD\u0288\u2C66\uA787",th:"\xFE",tz:"\uA729",u:"\u0289",v:"\u028B\uA75F\u028C",vy:"\uA761",w:"\u2C73",y:"\u01B4\u024F\u1EFF",z:"\u01B6\u0225\u0240\u2C6C\uA763",hv:"\u0195"};for(let fi in rn){let oi=rn[fi]||"";for(let ci=0;ci{ki===void 0&&(ki=vn(fi||Ei))},sn=(fi,oi="NFKD")=>fi.normalize(oi),on=fi=>hi(fi).reduce((oi,ci)=>oi+En(ci),""),En=fi=>(fi=sn(fi).toLowerCase().replace(ln,oi=>en[oi]||""),sn(fi,"NFC"));function*pn(fi){for(let[oi,ci]of fi)for(let ui=oi;ui<=ci;ui++){let mi=String.fromCharCode(ui),bi=on(mi);bi!=mi.toLowerCase()&&(bi.length>Fi||bi.length!=0&&(yield{folded:bi,composed:mi,code_point:ui}))}}let mn=fi=>{let oi={},ci=(ui,mi)=>{let bi=oi[ui]||new Set,yi=new RegExp("^"+si(bi)+"$","iu");mi.match(yi)||(bi.add(li(mi)),oi[ui]=bi)};for(let ui of pn(fi))ci(ui.folded,ui.folded),ci(ui.folded,ui.composed);return oi},vn=fi=>{let oi=mn(fi),ci={},ui=[];for(let bi in oi){let yi=oi[bi];yi&&(ci[bi]=si(yi)),bi.length>1&&ui.push(li(bi))}ui.sort((bi,yi)=>yi.length-bi.length);let mi=ni(ui);return Ti=new RegExp("^"+mi,"u"),ci},un=(fi,oi=1)=>{let ci=0;return fi=fi.map(ui=>(ki[ui]&&(ci+=ui.length),ki[ui]||ui)),ci>=oi?ri(fi):""},yn=(fi,oi=1)=>(oi=Math.max(oi,fi.length-1),ni(_i(fi).map(ci=>un(ci,oi)))),Cn=(fi,oi=!0)=>{let ci=fi.length>1?1:0;return ni(fi.map(ui=>{let mi=[],bi=oi?ui.length():ui.length()-1;for(let yi=0;yi{for(let ci of oi){if(ci.start!=fi.start||ci.end!=fi.end||ci.substrs.join("")!==fi.substrs.join(""))continue;let ui=fi.parts,mi=yi=>{for(let Si of ui){if(Si.start===yi.start&&Si.substr===yi.substr)return!1;if(!(yi.length==1||Si.length==1)&&(yi.startSi.start||Si.startyi.start))return!0}return!1};if(!(ci.parts.filter(mi).length>0))return!0}return!1};class Hi{constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(oi){oi&&(this.parts.push(oi),this.substrs.push(oi.substr),this.start=Math.min(oi.start,this.start),this.end=Math.max(oi.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(oi,ci){let ui=new Hi,mi=JSON.parse(JSON.stringify(this.parts)),bi=mi.pop();for(let Di of mi)ui.add(Di);let yi=ci.substr.substring(0,oi-bi.start),Si=yi.length;return ui.add({start:bi.start,end:bi.start+Si,length:Si,substr:yi}),ui}}let Pi=fi=>{Yi(),fi=on(fi);let oi="",ci=[new Hi];for(let ui=0;ui0){Di=Di.sort((Wi,ji)=>Wi.length()-ji.length());for(let Wi of Di)Ni(Wi,ci)||ci.push(Wi);continue}if(ui>0&&Oi.size==1&&!Oi.has("3")){oi+=Cn(ci,!1);let Wi=new Hi,ji=ci[0];ji&&Wi.add(ji.last()),ci=[Wi]}}return oi+=Cn(ci,!0),oi};let $i=(fi,oi)=>{if(!!fi)return fi[oi]},gn=(fi,oi)=>{if(!!fi){for(var ci,ui=oi.split(".");(ci=ui.shift())&&(fi=fi[ci]););return fi}},tn=(fi,oi,ci)=>{var ui,mi;return!fi||(fi=fi+"",oi.regex==null)||(mi=fi.search(oi.regex),mi===-1)?0:(ui=oi.string.length/fi.length,mi===0&&(ui+=.5),ui*ci)},Bi=(fi,oi)=>{var ci=fi[oi];if(typeof ci=="function")return ci;ci&&!Array.isArray(ci)&&(fi[oi]=[ci])},Li=(fi,oi)=>{if(Array.isArray(fi))fi.forEach(oi);else for(var ci in fi)fi.hasOwnProperty(ci)&&oi(fi[ci],ci)},zi=(fi,oi)=>typeof fi=="number"&&typeof oi=="number"?fi>oi?1:fioi?1:oi>fi?-1:0);class Ji{constructor(oi,ci){this.items=void 0,this.settings=void 0,this.items=oi,this.settings=ci||{diacritics:!0}}tokenize(oi,ci,ui){if(!oi||!oi.length)return[];let mi=[],bi=oi.split(/\s+/);var yi;return ui&&(yi=new RegExp("^("+Object.keys(ui).map(li).join("|")+"):(.*)$")),bi.forEach(Si=>{let Di,Oi=null,Wi=null;yi&&(Di=Si.match(yi))&&(Oi=Di[1],Si=Di[2]),Si.length>0&&(this.settings.diacritics?Wi=Pi(Si)||null:Wi=li(Si),Wi&&ci&&(Wi="\\b"+Wi)),mi.push({string:Si,regex:Wi?new RegExp(Wi,"iu"):null,field:Oi})}),mi}getScoreFunction(oi,ci){var ui=this.prepareSearch(oi,ci);return this._getScoreFunction(ui)}_getScoreFunction(oi){let ci=oi.tokens,ui=ci.length;if(!ui)return function(){return 0};let mi=oi.options.fields,bi=oi.weights,yi=mi.length,Si=oi.getAttrFn;if(!yi)return function(){return 1};let Di=function(){return yi===1?function(Oi,Wi){let ji=mi[0].field;return tn(Si(Wi,ji),Oi,bi[ji]||1)}:function(Oi,Wi){var ji=0;if(Oi.field){let Zi=Si(Wi,Oi.field);!Oi.regex&&Zi?ji+=1/yi:ji+=tn(Zi,Oi,1)}else Li(bi,(Zi,In)=>{ji+=tn(Si(Wi,In),Oi,Zi)});return ji/yi}}();return ui===1?function(Oi){return Di(ci[0],Oi)}:oi.options.conjunction==="and"?function(Oi){var Wi,ji=0;for(let Zi of ci){if(Wi=Di(Zi,Oi),Wi<=0)return 0;ji+=Wi}return ji/ui}:function(Oi){var Wi=0;return Li(ci,ji=>{Wi+=Di(ji,Oi)}),Wi/ui}}getSortFunction(oi,ci){var ui=this.prepareSearch(oi,ci);return this._getSortFunction(ui)}_getSortFunction(oi){var ci,ui=[];let mi=this,bi=oi.options,yi=!oi.query&&bi.sort_empty?bi.sort_empty:bi.sort;if(typeof yi=="function")return yi.bind(this);let Si=function(Wi,ji){return Wi==="$score"?ji.score:oi.getAttrFn(mi.items[ji.id],Wi)};if(yi)for(let Oi of yi)(oi.query||Oi.field!=="$score")&&ui.push(Oi);if(oi.query){ci=!0;for(let Oi of ui)if(Oi.field==="$score"){ci=!1;break}ci&&ui.unshift({field:"$score",direction:"desc"})}else ui=ui.filter(Oi=>Oi.field!=="$score");return ui.length?function(Oi,Wi){var ji,Zi;for(let In of ui)if(Zi=In.field,ji=(In.direction==="desc"?-1:1)*zi(Si(Zi,Oi),Si(Zi,Wi)),ji)return ji;return 0}:null}prepareSearch(oi,ci){let ui={};var mi=Object.assign({},ci);if(Bi(mi,"sort"),Bi(mi,"sort_empty"),mi.fields){Bi(mi,"fields");let bi=[];mi.fields.forEach(yi=>{typeof yi=="string"&&(yi={field:yi,weight:1}),bi.push(yi),ui[yi.field]="weight"in yi?yi.weight:1}),mi.fields=bi}return{options:mi,query:oi.toLowerCase().trim(),tokens:this.tokenize(oi,mi.respect_word_boundaries,ui),total:0,items:[],weights:ui,getAttrFn:mi.nesting?gn:$i}}search(oi,ci){var ui=this,mi,bi;bi=this.prepareSearch(oi,ci),ci=bi.options,oi=bi.query;let yi=ci.score||ui._getScoreFunction(bi);oi.length?Li(ui.items,(Di,Oi)=>{mi=yi(Di),(ci.filter===!1||mi>0)&&bi.items.push({score:mi,id:Oi})}):Li(ui.items,(Di,Oi)=>{bi.items.push({score:1,id:Oi})});let Si=ui._getSortFunction(bi);return Si&&bi.items.sort(Si),bi.total=bi.items.length,typeof ci.limit=="number"&&(bi.items=bi.items.slice(0,ci.limit)),bi}}let Vi=(fi,oi)=>{if(Array.isArray(fi))fi.forEach(oi);else for(var ci in fi)fi.hasOwnProperty(ci)&&oi(fi[ci],ci)},Ri=fi=>{if(fi.jquery)return fi[0];if(fi instanceof HTMLElement)return fi;if(Sn(fi)){var oi=document.createElement("template");return oi.innerHTML=fi.trim(),oi.content.firstChild}return document.querySelector(fi)},Sn=fi=>typeof fi=="string"&&fi.indexOf("<")>-1,Kn=fi=>fi.replace(/['"\\]/g,"\\$&"),$n=(fi,oi)=>{var ci=document.createEvent("HTMLEvents");ci.initEvent(oi,!0,!1),fi.dispatchEvent(ci)},Bn=(fi,oi)=>{Object.assign(fi.style,oi)},Gn=(fi,...oi)=>{var ci=Cs(oi);fi=zn(fi),fi.map(ui=>{ci.map(mi=>{ui.classList.add(mi)})})},Xn=(fi,...oi)=>{var ci=Cs(oi);fi=zn(fi),fi.map(ui=>{ci.map(mi=>{ui.classList.remove(mi)})})},Cs=fi=>{var oi=[];return Vi(fi,ci=>{typeof ci=="string"&&(ci=ci.trim().split(/[\11\12\14\15\40]/)),Array.isArray(ci)&&(oi=oi.concat(ci))}),oi.filter(Boolean)},zn=fi=>(Array.isArray(fi)||(fi=[fi]),fi),ps=(fi,oi,ci)=>{if(!(ci&&!ci.contains(fi)))for(;fi&&fi.matches;){if(fi.matches(oi))return fi;fi=fi.parentNode}},ms=(fi,oi=0)=>oi>0?fi[fi.length-1]:fi[0],Qs=fi=>Object.keys(fi).length===0,Wn=(fi,oi)=>{if(!fi)return-1;oi=oi||fi.nodeName;for(var ci=0;fi=fi.previousElementSibling;)fi.matches(oi)&&ci++;return ci},_n=(fi,oi)=>{Vi(oi,(ci,ui)=>{ci==null?fi.removeAttribute(ui):fi.setAttribute(ui,""+ci)})},Qr=(fi,oi)=>{fi.parentNode&&fi.parentNode.replaceChild(oi,fi)},ls=(fi,oi)=>{if(oi===null)return;if(typeof oi=="string"){if(!oi.length)return;oi=new RegExp(oi,"i")}let ci=bi=>{var yi=bi.data.match(oi);if(yi&&bi.data.length>0){var Si=document.createElement("span");Si.className="highlight";var Di=bi.splitText(yi.index);Di.splitText(yi[0].length);var Oi=Di.cloneNode(!0);return Si.appendChild(Oi),Qr(Di,Si),1}return 0},ui=bi=>{bi.nodeType===1&&bi.childNodes&&!/(script|style)/i.test(bi.tagName)&&(bi.className!=="highlight"||bi.tagName!=="SPAN")&&Array.from(bi.childNodes).forEach(yi=>{mi(yi)})},mi=bi=>bi.nodeType===3?ci(bi):(ui(bi),0);mi(fi)},Xs=fi=>{var oi=fi.querySelectorAll("span.highlight");Array.prototype.forEach.call(oi,function(ci){var ui=ci.parentNode;ui.replaceChild(ci.firstChild,ci),ui.normalize()})},mo=65,Js=13,Fs=27,Ss=37,Po=38,Zs=39,Ho=40,ga=8,$l=46,va=9,Fo=(typeof navigator=="undefined"?!1:/Mac/.test(navigator.userAgent))?"metaKey":"ctrlKey";var Wa={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,refreshThrottle:300,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(fi){return fi.length>0},render:{}};let xn=fi=>typeof fi=="undefined"||fi===null?null:eo(fi),eo=fi=>typeof fi=="boolean"?fi?"1":"0":fi+"",to=fi=>(fi+"").replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),Bl=(fi,oi)=>oi>0?setTimeout(fi,oi):(fi.call(null),null),$o=(fi,oi)=>{var ci;return function(ui,mi){var bi=this;ci&&(bi.loading=Math.max(bi.loading-1,0),clearTimeout(ci)),ci=setTimeout(function(){ci=null,bi.loadedSearches[ui]=!0,fi.call(bi,ui,mi)},oi)}},jo=(fi,oi,ci)=>{var ui,mi=fi.trigger,bi={};fi.trigger=function(){var yi=arguments[0];if(oi.indexOf(yi)!==-1)bi[yi]=arguments;else return mi.apply(fi,arguments)},ci.apply(fi,[]),fi.trigger=mi;for(ui of oi)ui in bi&&mi.apply(fi,bi[ui])},As=fi=>({start:fi.selectionStart||0,length:(fi.selectionEnd||0)-(fi.selectionStart||0)}),Dn=(fi,oi=!1)=>{fi&&(fi.preventDefault(),oi&&fi.stopPropagation())},Ln=(fi,oi,ci,ui)=>{fi.addEventListener(oi,ci,ui)},pi=(fi,oi)=>{if(!oi||!oi[fi])return!1;var ci=(oi.altKey?1:0)+(oi.ctrlKey?1:0)+(oi.shiftKey?1:0)+(oi.metaKey?1:0);return ci===1},gi=(fi,oi)=>{let ci=fi.getAttribute("id");return ci||(fi.setAttribute("id",oi),oi)},wi=fi=>fi.replace(/[\\"']/g,"\\$&"),Ci=(fi,oi)=>{oi&&fi.append(oi)};function Ii(fi,oi){var ci=Object.assign({},Wa,oi),ui=ci.dataAttr,mi=ci.labelField,bi=ci.valueField,yi=ci.disabledField,Si=ci.optgroupField,Di=ci.optgroupLabelField,Oi=ci.optgroupValueField,Wi=fi.tagName.toLowerCase(),ji=fi.getAttribute("placeholder")||fi.getAttribute("data-placeholder");if(!ji&&!ci.allowEmptyOption){let An=fi.querySelector('option[value=""]');An&&(ji=An.textContent)}var Zi={placeholder:ji,options:[],optgroups:[],items:[],maxItems:null},In=()=>{var An,Hn=Zi.options,Nn={},dn=1;let Vn=0;var ks=Tn=>{var Mn=Object.assign({},Tn.dataset),wn=ui&&Mn[ui];return typeof wn=="string"&&wn.length&&(Mn=Object.assign(Mn,JSON.parse(wn))),Mn},Ua=(Tn,Mn)=>{var wn=xn(Tn.value);if(wn!=null&&!(!wn&&!ci.allowEmptyOption)){if(Nn.hasOwnProperty(wn)){if(Mn){var Zr=Nn[wn][Si];Zr?Array.isArray(Zr)?Zr.push(Mn):Nn[wn][Si]=[Zr,Mn]:Nn[wn][Si]=Mn}}else{var Rn=ks(Tn);Rn[mi]=Rn[mi]||Tn.textContent,Rn[bi]=Rn[bi]||wn,Rn[yi]=Rn[yi]||Tn.disabled,Rn[Si]=Rn[Si]||Mn,Rn.$option=Tn,Rn.$order=Rn.$order||++Vn,Nn[wn]=Rn,Hn.push(Rn)}Tn.selected&&Zi.items.push(wn)}},Bo=Tn=>{var Mn,wn;wn=ks(Tn),wn[Di]=wn[Di]||Tn.getAttribute("label")||"",wn[Oi]=wn[Oi]||dn++,wn[yi]=wn[yi]||Tn.disabled,wn.$order=wn.$order||++Vn,Zi.optgroups.push(wn),Mn=wn[Oi],Vi(Tn.children,Zr=>{Ua(Zr,Mn)})};Zi.maxItems=fi.hasAttribute("multiple")?null:1,Vi(fi.children,Tn=>{An=Tn.tagName.toLowerCase(),An==="optgroup"?Bo(Tn):An==="option"&&Ua(Tn)})},Qi=()=>{let An=fi.getAttribute(ui);if(An)Zi.options=JSON.parse(An),Vi(Zi.options,Nn=>{Zi.items.push(Nn[bi])});else{var Hn=fi.value.trim()||"";if(!ci.allowEmptyOption&&!Hn.length)return;let Nn=Hn.split(ci.delimiter);Vi(Nn,dn=>{let Vn={};Vn[mi]=dn,Vn[bi]=dn,Zi.options.push(Vn)}),Zi.items=Nn}};return Wi==="select"?In():Qi(),Object.assign({},Wa,Zi,oi)}var qi=0;class nn extends ei(ti){constructor(oi,ci){super();this.control_input=void 0,this.wrapper=void 0,this.dropdown=void 0,this.control=void 0,this.dropdown_content=void 0,this.focus_node=void 0,this.order=0,this.settings=void 0,this.input=void 0,this.tabIndex=void 0,this.is_select_tag=void 0,this.rtl=void 0,this.inputId=void 0,this._destroy=void 0,this.sifter=void 0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isRequired=void 0,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.currentResults=void 0,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],this.refreshTimeout=null,qi++;var ui,mi=Ri(oi);if(mi.tomselect)throw new Error("Tom Select already initialized on this element");mi.tomselect=this;var bi=window.getComputedStyle&&window.getComputedStyle(mi,null);ui=bi.getPropertyValue("direction");let yi=Ii(mi,ci);this.settings=yi,this.input=mi,this.tabIndex=mi.tabIndex||0,this.is_select_tag=mi.tagName.toLowerCase()==="select",this.rtl=/rtl/i.test(ui),this.inputId=gi(mi,"tomselect-"+qi),this.isRequired=mi.required,this.sifter=new Ji(this.options,{diacritics:yi.diacritics}),yi.mode=yi.mode||(yi.maxItems===1?"single":"multi"),typeof yi.hideSelected!="boolean"&&(yi.hideSelected=yi.mode==="multi"),typeof yi.hidePlaceholder!="boolean"&&(yi.hidePlaceholder=yi.mode!=="multi");var Si=yi.createFilter;typeof Si!="function"&&(typeof Si=="string"&&(Si=new RegExp(Si)),Si instanceof RegExp?yi.createFilter=Hn=>Si.test(Hn):yi.createFilter=Hn=>this.settings.duplicates||!this.options[Hn]),this.initializePlugins(yi.plugins),this.setupCallbacks(),this.setupTemplates();let Di=Ri("
"),Oi=Ri("
"),Wi=this._render("dropdown"),ji=Ri('
'),Zi=this.input.getAttribute("class")||"",In=yi.mode;var Qi;if(Gn(Di,yi.wrapperClass,Zi,In),Gn(Oi,yi.controlClass),Ci(Di,Oi),Gn(Wi,yi.dropdownClass,In),yi.copyClassesToDropdown&&Gn(Wi,Zi),Gn(ji,yi.dropdownContentClass),Ci(Wi,ji),Ri(yi.dropdownParent||Di).appendChild(Wi),Sn(yi.controlInput)){Qi=Ri(yi.controlInput);var An=["autocorrect","autocapitalize","autocomplete","spellcheck"];Li(An,Hn=>{mi.getAttribute(Hn)&&_n(Qi,{[Hn]:mi.getAttribute(Hn)})}),Qi.tabIndex=-1,Oi.appendChild(Qi),this.focus_node=Qi}else yi.controlInput?(Qi=Ri(yi.controlInput),this.focus_node=Qi):(Qi=Ri(""),this.focus_node=Oi);this.wrapper=Di,this.dropdown=Wi,this.dropdown_content=ji,this.control=Oi,this.control_input=Qi,this.setup()}setup(){let oi=this,ci=oi.settings,ui=oi.control_input,mi=oi.dropdown,bi=oi.dropdown_content,yi=oi.wrapper,Si=oi.control,Di=oi.input,Oi=oi.focus_node,Wi={passive:!0},ji=oi.inputId+"-ts-dropdown";_n(bi,{id:ji}),_n(Oi,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":ji});let Zi=gi(Oi,oi.inputId+"-ts-control"),In="label[for='"+Kn(oi.inputId)+"']",Qi=document.querySelector(In),An=oi.focus.bind(oi);if(Qi){Ln(Qi,"click",An),_n(Qi,{for:Zi});let dn=gi(Qi,oi.inputId+"-ts-label");_n(Oi,{"aria-labelledby":dn}),_n(bi,{"aria-labelledby":dn})}if(yi.style.width=Di.style.width,oi.plugins.names.length){let dn="plugin-"+oi.plugins.names.join(" plugin-");Gn([yi,mi],dn)}(ci.maxItems===null||ci.maxItems>1)&&oi.is_select_tag&&_n(Di,{multiple:"multiple"}),ci.placeholder&&_n(ui,{placeholder:ci.placeholder}),!ci.splitOn&&ci.delimiter&&(ci.splitOn=new RegExp("\\s*"+li(ci.delimiter)+"+\\s*")),ci.load&&ci.loadThrottle&&(ci.load=$o(ci.load,ci.loadThrottle)),Ln(mi,"mousemove",()=>{oi.ignoreHover=!1}),Ln(mi,"mouseenter",dn=>{var Vn=ps(dn.target,"[data-selectable]",mi);Vn&&oi.onOptionHover(dn,Vn)},{capture:!0}),Ln(mi,"click",dn=>{let Vn=ps(dn.target,"[data-selectable]");Vn&&(oi.onOptionSelect(dn,Vn),Dn(dn,!0))}),Ln(Si,"click",dn=>{var Vn=ps(dn.target,"[data-ts-item]",Si);if(Vn&&oi.onItemSelect(dn,Vn)){Dn(dn,!0);return}ui.value==""&&(oi.onClick(),Dn(dn,!0))}),Ln(Oi,"keydown",dn=>oi.onKeyDown(dn)),Ln(ui,"keypress",dn=>oi.onKeyPress(dn)),Ln(ui,"input",dn=>oi.onInput(dn)),Ln(Oi,"blur",dn=>oi.onBlur(dn)),Ln(Oi,"focus",dn=>oi.onFocus(dn)),Ln(ui,"paste",dn=>oi.onPaste(dn));let Hn=dn=>{let Vn=dn.composedPath()[0];if(!yi.contains(Vn)&&!mi.contains(Vn)){oi.isFocused&&oi.blur(),oi.inputState();return}Vn==ui&&oi.isOpen?dn.stopPropagation():Dn(dn,!0)},Nn=()=>{oi.isOpen&&oi.positionDropdown()};Ln(document,"mousedown",Hn),Ln(window,"scroll",Nn,Wi),Ln(window,"resize",Nn,Wi),this._destroy=()=>{document.removeEventListener("mousedown",Hn),window.removeEventListener("scroll",Nn),window.removeEventListener("resize",Nn),Qi&&Qi.removeEventListener("click",An)},this.revertSettings={innerHTML:Di.innerHTML,tabIndex:Di.tabIndex},Di.tabIndex=-1,Di.insertAdjacentElement("afterend",oi.wrapper),oi.sync(!1),ci.items=[],delete ci.optgroups,delete ci.options,Ln(Di,"invalid",()=>{oi.isValid&&(oi.isValid=!1,oi.isInvalid=!0,oi.refreshState())}),oi.updateOriginalInput(),oi.refreshItems(),oi.close(!1),oi.inputState(),oi.isSetup=!0,Di.disabled?oi.disable():Di.readOnly?oi.setReadOnly(!0):oi.enable(),oi.on("change",this.onChange),Gn(Di,"tomselected","ts-hidden-accessible"),oi.trigger("initialize"),ci.preload===!0&&oi.preload()}setupOptions(oi=[],ci=[]){this.addOptions(oi),Li(ci,ui=>{this.registerOptionGroup(ui)})}setupTemplates(){var oi=this,ci=oi.settings.labelField,ui=oi.settings.optgroupLabelField,mi={optgroup:bi=>{let yi=document.createElement("div");return yi.className="optgroup",yi.appendChild(bi.options),yi},optgroup_header:(bi,yi)=>'
'+yi(bi[ui])+"
",option:(bi,yi)=>"
"+yi(bi[ci])+"
",item:(bi,yi)=>"
"+yi(bi[ci])+"
",option_create:(bi,yi)=>'
Add '+yi(bi.input)+"
",no_results:()=>'
No results found
',loading:()=>'
',not_loading:()=>{},dropdown:()=>"
"};oi.settings.render=Object.assign({},mi,oi.settings.render)}setupCallbacks(){var oi,ci,ui={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(oi in ui)ci=this.settings[ui[oi]],ci&&this.on(oi,ci)}sync(oi=!0){let ci=this,ui=oi?Ii(ci.input,{delimiter:ci.settings.delimiter}):ci.settings;ci.setupOptions(ui.options,ui.optgroups),ci.setValue(ui.items||[],!0),ci.lastQuery=null}onClick(){var oi=this;if(oi.activeItems.length>0){oi.clearActiveItems(),oi.focus();return}oi.isFocused&&oi.isOpen?oi.blur():oi.focus()}onMouseDown(){}onChange(){$n(this.input,"input"),$n(this.input,"change")}onPaste(oi){var ci=this;if(ci.isInputHidden||ci.isLocked){Dn(oi);return}!ci.settings.splitOn||setTimeout(()=>{var ui=ci.inputValue();if(!!ui.match(ci.settings.splitOn)){var mi=ui.trim().split(ci.settings.splitOn);Li(mi,bi=>{xn(bi)&&(this.options[bi]?ci.addItem(bi):ci.createItem(bi))})}},0)}onKeyPress(oi){var ci=this;if(ci.isLocked){Dn(oi);return}var ui=String.fromCharCode(oi.keyCode||oi.which);if(ci.settings.create&&ci.settings.mode==="multi"&&ui===ci.settings.delimiter){ci.createItem(),Dn(oi);return}}onKeyDown(oi){var ci=this;if(ci.ignoreHover=!0,ci.isLocked){oi.keyCode!==va&&Dn(oi);return}switch(oi.keyCode){case mo:if(pi(Fo,oi)&&ci.control_input.value==""){Dn(oi),ci.selectAll();return}break;case Fs:ci.isOpen&&(Dn(oi,!0),ci.close()),ci.clearActiveItems();return;case Ho:if(!ci.isOpen&&ci.hasOptions)ci.open();else if(ci.activeOption){let ui=ci.getAdjacent(ci.activeOption,1);ui&&ci.setActiveOption(ui)}Dn(oi);return;case Po:if(ci.activeOption){let ui=ci.getAdjacent(ci.activeOption,-1);ui&&ci.setActiveOption(ui)}Dn(oi);return;case Js:ci.canSelect(ci.activeOption)?(ci.onOptionSelect(oi,ci.activeOption),Dn(oi)):(ci.settings.create&&ci.createItem()||document.activeElement==ci.control_input&&ci.isOpen)&&Dn(oi);return;case Ss:ci.advanceSelection(-1,oi);return;case Zs:ci.advanceSelection(1,oi);return;case va:ci.settings.selectOnTab&&(ci.canSelect(ci.activeOption)&&(ci.onOptionSelect(oi,ci.activeOption),Dn(oi)),ci.settings.create&&ci.createItem()&&Dn(oi));return;case ga:case $l:ci.deleteSelection(oi);return}ci.isInputHidden&&!pi(Fo,oi)&&Dn(oi)}onInput(oi){if(this.isLocked)return;let ci=this.inputValue();if(this.lastValue!==ci){if(this.lastValue=ci,ci==""){this._onInput();return}this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshTimeout=Bl(()=>{this.refreshTimeout=null,this._onInput()},this.settings.refreshThrottle)}}_onInput(){let oi=this.lastValue;this.settings.shouldLoad.call(this,oi)&&this.load(oi),this.refreshOptions(),this.trigger("type",oi)}onOptionHover(oi,ci){this.ignoreHover||this.setActiveOption(ci,!1)}onFocus(oi){var ci=this,ui=ci.isFocused;if(ci.isDisabled||ci.isReadOnly){ci.blur(),Dn(oi);return}ci.ignoreFocus||(ci.isFocused=!0,ci.settings.preload==="focus"&&ci.preload(),ui||ci.trigger("focus"),ci.activeItems.length||(ci.inputState(),ci.refreshOptions(!!ci.settings.openOnFocus)),ci.refreshState())}onBlur(oi){if(document.hasFocus()!==!1){var ci=this;if(!!ci.isFocused){ci.isFocused=!1,ci.ignoreFocus=!1;var ui=()=>{ci.close(),ci.setActiveItem(),ci.setCaret(ci.items.length),ci.trigger("blur")};ci.settings.create&&ci.settings.createOnBlur?ci.createItem(null,ui):ui()}}}onOptionSelect(oi,ci){var ui,mi=this;ci.parentElement&&ci.parentElement.matches("[data-disabled]")||(ci.classList.contains("create")?mi.createItem(null,()=>{mi.settings.closeAfterSelect&&mi.close()}):(ui=ci.dataset.value,typeof ui!="undefined"&&(mi.lastQuery=null,mi.addItem(ui),mi.settings.closeAfterSelect&&mi.close(),!mi.settings.hideSelected&&oi.type&&/click/.test(oi.type)&&mi.setActiveOption(ci))))}canSelect(oi){return!!(this.isOpen&&oi&&this.dropdown_content.contains(oi))}onItemSelect(oi,ci){var ui=this;return!ui.isLocked&&ui.settings.mode==="multi"?(Dn(oi),ui.setActiveItem(ci,oi),!0):!1}canLoad(oi){return!(!this.settings.load||this.loadedSearches.hasOwnProperty(oi))}load(oi){let ci=this;if(!ci.canLoad(oi))return;Gn(ci.wrapper,ci.settings.loadingClass),ci.loading++;let ui=ci.loadCallback.bind(ci);ci.settings.load.call(ci,oi,ui)}loadCallback(oi,ci){let ui=this;ui.loading=Math.max(ui.loading-1,0),ui.lastQuery=null,ui.clearActiveOption(),ui.setupOptions(oi,ci),ui.refreshOptions(ui.isFocused&&!ui.isInputHidden),ui.loading||Xn(ui.wrapper,ui.settings.loadingClass),ui.trigger("load",oi,ci)}preload(){var oi=this.wrapper.classList;oi.contains("preloaded")||(oi.add("preloaded"),this.load(""))}setTextboxValue(oi=""){var ci=this.control_input,ui=ci.value!==oi;ui&&(ci.value=oi,$n(ci,"update"),this.lastValue=oi)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(oi,ci){var ui=ci?[]:["change"];jo(this,ui,()=>{this.clear(ci),this.addItems(oi,ci)})}setMaxItems(oi){oi===0&&(oi=null),this.settings.maxItems=oi,this.refreshState()}setActiveItem(oi,ci){var ui=this,mi,bi,yi,Si,Di,Oi;if(ui.settings.mode!=="single"){if(!oi){ui.clearActiveItems(),ui.isFocused&&ui.inputState();return}if(mi=ci&&ci.type.toLowerCase(),mi==="click"&&pi("shiftKey",ci)&&ui.activeItems.length){for(Oi=ui.getLastActive(),yi=Array.prototype.indexOf.call(ui.control.children,Oi),Si=Array.prototype.indexOf.call(ui.control.children,oi),yi>Si&&(Di=yi,yi=Si,Si=Di),bi=yi;bi<=Si;bi++)oi=ui.control.children[bi],ui.activeItems.indexOf(oi)===-1&&ui.setActiveItemClass(oi);Dn(ci)}else mi==="click"&&pi(Fo,ci)||mi==="keydown"&&pi("shiftKey",ci)?oi.classList.contains("active")?ui.removeActiveItem(oi):ui.setActiveItemClass(oi):(ui.clearActiveItems(),ui.setActiveItemClass(oi));ui.inputState(),ui.isFocused||ui.focus()}}setActiveItemClass(oi){let ci=this,ui=ci.control.querySelector(".last-active");ui&&Xn(ui,"last-active"),Gn(oi,"active last-active"),ci.trigger("item_select",oi),ci.activeItems.indexOf(oi)==-1&&ci.activeItems.push(oi)}removeActiveItem(oi){var ci=this.activeItems.indexOf(oi);this.activeItems.splice(ci,1),Xn(oi,"active")}clearActiveItems(){Xn(this.activeItems,"active"),this.activeItems=[]}setActiveOption(oi,ci=!0){oi!==this.activeOption&&(this.clearActiveOption(),!!oi&&(this.activeOption=oi,_n(this.focus_node,{"aria-activedescendant":oi.getAttribute("id")}),_n(oi,{"aria-selected":"true"}),Gn(oi,"active"),ci&&this.scrollToOption(oi)))}scrollToOption(oi,ci){if(!oi)return;let ui=this.dropdown_content,mi=ui.clientHeight,bi=ui.scrollTop||0,yi=oi.offsetHeight,Si=oi.getBoundingClientRect().top-ui.getBoundingClientRect().top+bi;Si+yi>mi+bi?this.scroll(Si-mi+yi,ci):Si{oi.setActiveItemClass(ui)}))}inputState(){var oi=this;!oi.control.contains(oi.control_input)||(_n(oi.control_input,{placeholder:oi.settings.placeholder}),oi.activeItems.length>0||!oi.isFocused&&oi.settings.hidePlaceholder&&oi.items.length>0?(oi.setTextboxValue(),oi.isInputHidden=!0):(oi.settings.hidePlaceholder&&oi.items.length>0&&_n(oi.control_input,{placeholder:""}),oi.isInputHidden=!1),oi.wrapper.classList.toggle("input-hidden",oi.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var oi=this;oi.isDisabled||oi.isReadOnly||(oi.ignoreFocus=!0,oi.control_input.offsetWidth?oi.control_input.focus():oi.focus_node.focus(),setTimeout(()=>{oi.ignoreFocus=!1,oi.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(oi){return this.sifter.getScoreFunction(oi,this.getSearchOptions())}getSearchOptions(){var oi=this.settings,ci=oi.sortField;return typeof oi.sortField=="string"&&(ci=[{field:oi.sortField}]),{fields:oi.searchField,conjunction:oi.searchConjunction,sort:ci,nesting:oi.nesting}}search(oi){var ci,ui,mi=this,bi=this.getSearchOptions();if(mi.settings.score&&(ui=mi.settings.score.call(mi,oi),typeof ui!="function"))throw new Error('Tom Select "score" setting must be a function that returns a function');return oi!==mi.lastQuery?(mi.lastQuery=oi,ci=mi.sifter.search(oi,Object.assign(bi,{score:ui})),mi.currentResults=ci):ci=Object.assign({},mi.currentResults),mi.settings.hideSelected&&(ci.items=ci.items.filter(yi=>{let Si=xn(yi.id);return!(Si&&mi.items.indexOf(Si)!==-1)})),ci}refreshOptions(oi=!0){var ci,ui,mi,bi,yi,Si,Di,Oi,Wi,ji;let Zi={},In=[];var Qi=this,An=Qi.inputValue();let Hn=An===Qi.lastQuery||An==""&&Qi.lastQuery==null;var Nn=Qi.search(An),dn=null,Vn=Qi.settings.shouldOpen||!1,ks=Qi.dropdown_content;Hn&&(dn=Qi.activeOption,dn&&(Wi=dn.closest("[data-group]"))),bi=Nn.items.length,typeof Qi.settings.maxOptions=="number"&&(bi=Math.min(bi,Qi.settings.maxOptions)),bi>0&&(Vn=!0);let Ua=(Tn,Mn)=>{let wn=Zi[Tn];if(wn!==void 0){let Rn=In[wn];if(Rn!==void 0)return[wn,Rn.fragment]}let Zr=document.createDocumentFragment();return wn=In.length,In.push({fragment:Zr,order:Mn,optgroup:Tn}),[wn,Zr]};for(ci=0;ci0&&(Rn=Rn.cloneNode(!0),_n(Rn,{id:wn.$id+"-clone-"+ui,"aria-selected":null}),Rn.classList.add("ts-cloned"),Xn(Rn,"active"),Qi.activeOption&&Qi.activeOption.dataset.value==Mn&&Wi&&Wi.dataset.group===yi.toString()&&(dn=Rn)),ch.appendChild(Rn),yi!=""&&(Zi[yi]=lh)}}Qi.settings.lockOptgroupOrder&&In.sort((Tn,Mn)=>Tn.order-Mn.order),Di=document.createDocumentFragment(),Li(In,Tn=>{let Mn=Tn.fragment,wn=Tn.optgroup;if(!Mn||!Mn.children.length)return;let Zr=Qi.optgroups[wn];if(Zr!==void 0){let Rn=document.createDocumentFragment(),Ya=Qi.render("optgroup_header",Zr);Ci(Rn,Ya),Ci(Rn,Mn);let Ka=Qi.render("optgroup",{group:Zr,options:Rn});Ci(Di,Ka)}else Ci(Di,Mn)}),ks.innerHTML="",Ci(ks,Di),Qi.settings.highlight&&(Xs(ks),Nn.query.length&&Nn.tokens.length&&Li(Nn.tokens,Tn=>{ls(ks,Tn.regex)}));var Bo=Tn=>{let Mn=Qi.render(Tn,{input:An});return Mn&&(Vn=!0,ks.insertBefore(Mn,ks.firstChild)),Mn};if(Qi.loading?Bo("loading"):Qi.settings.shouldLoad.call(Qi,An)?Nn.items.length===0&&Bo("no_results"):Bo("not_loading"),Oi=Qi.canCreate(An),Oi&&(ji=Bo("option_create")),Qi.hasOptions=Nn.items.length>0||Oi,Vn){if(Nn.items.length>0){if(!dn&&Qi.settings.mode==="single"&&Qi.items[0]!=null&&(dn=Qi.getOption(Qi.items[0])),!ks.contains(dn)){let Tn=0;ji&&!Qi.settings.addPrecedence&&(Tn=1),dn=Qi.selectable()[Tn]}}else ji&&(dn=ji);oi&&!Qi.isOpen&&(Qi.open(),Qi.scrollToOption(dn,"auto")),Qi.setActiveOption(dn)}else Qi.clearActiveOption(),oi&&Qi.isOpen&&Qi.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(oi,ci=!1){let ui=this;if(Array.isArray(oi))return ui.addOptions(oi,ci),!1;let mi=xn(oi[ui.settings.valueField]);return mi===null||ui.options.hasOwnProperty(mi)?!1:(oi.$order=oi.$order||++ui.order,oi.$id=ui.inputId+"-opt-"+oi.$order,ui.options[mi]=oi,ui.lastQuery=null,ci&&(ui.userOptions[mi]=ci,ui.trigger("option_add",mi,oi)),mi)}addOptions(oi,ci=!1){Li(oi,ui=>{this.addOption(ui,ci)})}registerOption(oi){return this.addOption(oi)}registerOptionGroup(oi){var ci=xn(oi[this.settings.optgroupValueField]);return ci===null?!1:(oi.$order=oi.$order||++this.order,this.optgroups[ci]=oi,ci)}addOptionGroup(oi,ci){var ui;ci[this.settings.optgroupValueField]=oi,(ui=this.registerOptionGroup(ci))&&this.trigger("optgroup_add",ui,ci)}removeOptionGroup(oi){this.optgroups.hasOwnProperty(oi)&&(delete this.optgroups[oi],this.clearCache(),this.trigger("optgroup_remove",oi))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(oi,ci){let ui=this;var mi,bi;let yi=xn(oi),Si=xn(ci[ui.settings.valueField]);if(yi===null)return;let Di=ui.options[yi];if(Di==null)return;if(typeof Si!="string")throw new Error("Value must be set in option data");let Oi=ui.getOption(yi),Wi=ui.getItem(yi);if(ci.$order=ci.$order||Di.$order,delete ui.options[yi],ui.uncacheValue(Si),ui.options[Si]=ci,Oi){if(ui.dropdown_content.contains(Oi)){let ji=ui._render("option",ci);Qr(Oi,ji),ui.activeOption===Oi&&ui.setActiveOption(ji)}Oi.remove()}Wi&&(bi=ui.items.indexOf(yi),bi!==-1&&ui.items.splice(bi,1,Si),mi=ui._render("item",ci),Wi.classList.contains("active")&&Gn(mi,"active"),Qr(Wi,mi)),ui.lastQuery=null}removeOption(oi,ci){let ui=this;oi=eo(oi),ui.uncacheValue(oi),delete ui.userOptions[oi],delete ui.options[oi],ui.lastQuery=null,ui.trigger("option_remove",oi),ui.removeItem(oi,ci)}clearOptions(oi){let ci=(oi||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();let ui={};Li(this.options,(mi,bi)=>{ci(mi,bi)&&(ui[bi]=mi)}),this.options=this.sifter.items=ui,this.lastQuery=null,this.trigger("option_clear")}clearFilter(oi,ci){return this.items.indexOf(ci)>=0}getOption(oi,ci=!1){let ui=xn(oi);if(ui===null)return null;let mi=this.options[ui];if(mi!=null){if(mi.$div)return mi.$div;if(ci)return this._render("option",mi)}return null}getAdjacent(oi,ci,ui="option"){var mi=this,bi;if(!oi)return null;ui=="item"?bi=mi.controlChildren():bi=mi.dropdown_content.querySelectorAll("[data-selectable]");for(let yi=0;yi0?bi[yi+1]:bi[yi-1];return null}getItem(oi){if(typeof oi=="object")return oi;var ci=xn(oi);return ci!==null?this.control.querySelector(`[data-value="${wi(ci)}"]`):null}addItems(oi,ci){var ui=this,mi=Array.isArray(oi)?oi:[oi];mi=mi.filter(yi=>ui.items.indexOf(yi)===-1);let bi=mi[mi.length-1];mi.forEach(yi=>{ui.isPending=yi!==bi,ui.addItem(yi,ci)})}addItem(oi,ci){var ui=ci?[]:["change","dropdown_close"];jo(this,ui,()=>{var mi,bi;let yi=this,Si=yi.settings.mode,Di=xn(oi);if(!(Di&&yi.items.indexOf(Di)!==-1&&(Si==="single"&&yi.close(),Si==="single"||!yi.settings.duplicates))&&!(Di===null||!yi.options.hasOwnProperty(Di))&&(Si==="single"&&yi.clear(ci),!(Si==="multi"&&yi.isFull()))){if(mi=yi._render("item",yi.options[Di]),yi.control.contains(mi)&&(mi=mi.cloneNode(!0)),bi=yi.isFull(),yi.items.splice(yi.caretPos,0,Di),yi.insertAtCaret(mi),yi.isSetup){if(!yi.isPending&&yi.settings.hideSelected){let Oi=yi.getOption(Di),Wi=yi.getAdjacent(Oi,1);Wi&&yi.setActiveOption(Wi)}!yi.isPending&&!yi.settings.closeAfterSelect&&yi.refreshOptions(yi.isFocused&&Si!=="single"),yi.settings.closeAfterSelect!=!1&&yi.isFull()?yi.close():yi.isPending||yi.positionDropdown(),yi.trigger("item_add",Di,mi),yi.isPending||yi.updateOriginalInput({silent:ci})}(!yi.isPending||!bi&&yi.isFull())&&(yi.inputState(),yi.refreshState())}})}removeItem(oi=null,ci){let ui=this;if(oi=ui.getItem(oi),!oi)return;var mi,bi;let yi=oi.dataset.value;mi=Wn(oi),oi.remove(),oi.classList.contains("active")&&(bi=ui.activeItems.indexOf(oi),ui.activeItems.splice(bi,1),Xn(oi,"active")),ui.items.splice(mi,1),ui.lastQuery=null,!ui.settings.persist&&ui.userOptions.hasOwnProperty(yi)&&ui.removeOption(yi,ci),mi{}){arguments.length===3&&(ci=arguments[2]),typeof ci!="function"&&(ci=()=>{});var ui=this,mi=ui.caretPos,bi;if(oi=oi||ui.inputValue(),!ui.canCreate(oi))return ci(),!1;ui.lock();var yi=!1,Si=Di=>{if(ui.unlock(),!Di||typeof Di!="object")return ci();var Oi=xn(Di[ui.settings.valueField]);if(typeof Oi!="string")return ci();ui.setTextboxValue(),ui.addOption(Di,!0),ui.setCaret(mi),ui.addItem(Oi),ci(Di),yi=!0};return typeof ui.settings.create=="function"?bi=ui.settings.create.call(this,oi,Si):bi={[ui.settings.labelField]:oi,[ui.settings.valueField]:oi},yi||Si(bi),!0}refreshItems(){var oi=this;oi.lastQuery=null,oi.isSetup&&oi.addItems(oi.items),oi.updateOriginalInput(),oi.refreshState()}refreshState(){let oi=this;oi.refreshValidityState();let ci=oi.isFull(),ui=oi.isLocked;oi.wrapper.classList.toggle("rtl",oi.rtl);let mi=oi.wrapper.classList;mi.toggle("focus",oi.isFocused),mi.toggle("disabled",oi.isDisabled),mi.toggle("readonly",oi.isReadOnly),mi.toggle("required",oi.isRequired),mi.toggle("invalid",!oi.isValid),mi.toggle("locked",ui),mi.toggle("full",ci),mi.toggle("input-active",oi.isFocused&&!oi.isInputHidden),mi.toggle("dropdown-active",oi.isOpen),mi.toggle("has-options",Qs(oi.options)),mi.toggle("has-items",oi.items.length>0)}refreshValidityState(){var oi=this;!oi.input.validity||(oi.isValid=oi.input.validity.valid,oi.isInvalid=!oi.isValid)}isFull(){return this.settings.maxItems!==null&&this.items.length>=this.settings.maxItems}updateOriginalInput(oi={}){let ci=this;var ui,mi;let bi=ci.input.querySelector('option[value=""]');if(ci.is_select_tag){let Di=function(Oi,Wi,ji){return Oi||(Oi=Ri('")),Oi!=bi&&ci.input.append(Oi),yi.push(Oi),(Oi!=bi||Si>0)&&(Oi.selected=!0),Oi},yi=[],Si=ci.input.querySelectorAll("option:checked").length;ci.input.querySelectorAll("option:checked").forEach(Oi=>{Oi.selected=!1}),ci.items.length==0&&ci.settings.mode=="single"?Di(bi,"",""):ci.items.forEach(Oi=>{if(ui=ci.options[Oi],mi=ui[ci.settings.labelField]||"",yi.includes(ui.$option)){let Wi=ci.input.querySelector(`option[value="${wi(Oi)}"]:not(:checked)`);Di(Wi,Oi,mi)}else ui.$option=Di(ui.$option,Oi,mi)})}else ci.input.value=ci.getValue();ci.isSetup&&(oi.silent||ci.trigger("change",ci.getValue()))}open(){var oi=this;oi.isLocked||oi.isOpen||oi.settings.mode==="multi"&&oi.isFull()||(oi.isOpen=!0,_n(oi.focus_node,{"aria-expanded":"true"}),oi.refreshState(),Bn(oi.dropdown,{visibility:"hidden",display:"block"}),oi.positionDropdown(),Bn(oi.dropdown,{visibility:"visible",display:"block"}),oi.focus(),oi.trigger("dropdown_open",oi.dropdown))}close(oi=!0){var ci=this,ui=ci.isOpen;oi&&(ci.setTextboxValue(),ci.settings.mode==="single"&&ci.items.length&&ci.inputState()),ci.isOpen=!1,_n(ci.focus_node,{"aria-expanded":"false"}),Bn(ci.dropdown,{display:"none"}),ci.settings.hideSelected&&ci.clearActiveOption(),ci.refreshState(),ui&&ci.trigger("dropdown_close",ci.dropdown)}positionDropdown(){if(this.settings.dropdownParent==="body"){var oi=this.control,ci=oi.getBoundingClientRect(),ui=oi.offsetHeight+ci.top+window.scrollY,mi=ci.left+window.scrollX;Bn(this.dropdown,{width:ci.width+"px",top:ui+"px",left:mi+"px"})}}clear(oi){var ci=this;if(!!ci.items.length){var ui=ci.controlChildren();Li(ui,mi=>{ci.removeItem(mi,!0)}),ci.inputState(),oi||ci.updateOriginalInput(),ci.trigger("clear")}}insertAtCaret(oi){let ci=this,ui=ci.caretPos,mi=ci.control;mi.insertBefore(oi,mi.children[ui]||null),ci.setCaret(ui+1)}deleteSelection(oi){var ci,ui,mi,bi,yi=this;ci=oi&&oi.keyCode===ga?-1:1,ui=As(yi.control_input);let Si=[];if(yi.activeItems.length)bi=ms(yi.activeItems,ci),mi=Wn(bi),ci>0&&mi++,Li(yi.activeItems,Di=>Si.push(Di));else if((yi.isFocused||yi.settings.mode==="single")&&yi.items.length){let Di=yi.controlChildren(),Oi;ci<0&&ui.start===0&&ui.length===0?Oi=Di[yi.caretPos-1]:ci>0&&ui.start===yi.inputValue().length&&(Oi=Di[yi.caretPos]),Oi!==void 0&&Si.push(Oi)}if(!yi.shouldDelete(Si,oi))return!1;for(Dn(oi,!0),typeof mi!="undefined"&&yi.setCaret(mi);Si.length;)yi.removeItem(Si.pop());return yi.inputState(),yi.positionDropdown(),yi.refreshOptions(!1),!0}shouldDelete(oi,ci){let ui=oi.map(mi=>mi.dataset.value);return!(!ui.length||typeof this.settings.onDelete=="function"&&this.settings.onDelete(ui,ci)===!1)}advanceSelection(oi,ci){var ui,mi,bi=this;bi.rtl&&(oi*=-1),!bi.inputValue().length&&(pi(Fo,ci)||pi("shiftKey",ci)?(ui=bi.getLastActive(oi),ui?ui.classList.contains("active")?mi=bi.getAdjacent(ui,oi,"item"):mi=ui:oi>0?mi=bi.control_input.nextElementSibling:mi=bi.control_input.previousElementSibling,mi&&(mi.classList.contains("active")&&bi.removeActiveItem(ui),bi.setActiveItemClass(mi))):bi.moveCaret(oi))}moveCaret(oi){}getLastActive(oi){let ci=this.control.querySelector(".last-active");if(ci)return ci;var ui=this.control.querySelectorAll(".active");if(ui)return ms(ui,oi)}setCaret(oi){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(oi=this.isReadOnly||this.isDisabled){this.isLocked=oi,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(oi){this.focus_node.tabIndex=oi?-1:this.tabIndex,this.isDisabled=oi,this.input.disabled=oi,this.control_input.disabled=oi,this.setLocked()}setReadOnly(oi){this.isReadOnly=oi,this.input.readOnly=oi,this.control_input.readOnly=oi,this.setLocked()}destroy(){var oi=this,ci=oi.revertSettings;oi.trigger("destroy"),oi.off(),oi.wrapper.remove(),oi.dropdown.remove(),oi.input.innerHTML=ci.innerHTML,oi.input.tabIndex=ci.tabIndex,Xn(oi.input,"tomselected","ts-hidden-accessible"),oi._destroy(),delete oi.input.tomselect}render(oi,ci){var ui,mi;let bi=this;if(typeof this.settings.render[oi]!="function"||(mi=bi.settings.render[oi].call(this,ci,to),!mi))return null;if(mi=Ri(mi),oi==="option"||oi==="option_create"?ci[bi.settings.disabledField]?_n(mi,{"aria-disabled":"true"}):_n(mi,{"data-selectable":""}):oi==="optgroup"&&(ui=ci.group[bi.settings.optgroupValueField],_n(mi,{"data-group":ui}),ci.group[bi.settings.disabledField]&&_n(mi,{"data-disabled":""})),oi==="option"||oi==="item"){let yi=eo(ci[bi.settings.valueField]);_n(mi,{"data-value":yi}),oi==="item"?(Gn(mi,bi.settings.itemClass),_n(mi,{"data-ts-item":""})):(Gn(mi,bi.settings.optionClass),_n(mi,{role:"option",id:ci.$id}),ci.$div=mi,bi.options[yi]=ci)}return mi}_render(oi,ci){let ui=this.render(oi,ci);if(ui==null)throw"HTMLElement expected";return ui}clearCache(){Li(this.options,oi=>{oi.$div&&(oi.$div.remove(),delete oi.$div)})}uncacheValue(oi){let ci=this.getOption(oi);ci&&ci.remove()}canCreate(oi){return this.settings.create&&oi.length>0&&this.settings.createFilter.call(this,oi)}hook(oi,ci,ui){var mi=this,bi=mi[ci];mi[ci]=function(){var yi,Si;return oi==="after"&&(yi=bi.apply(mi,arguments)),Si=ui.apply(mi,arguments),oi==="instead"?Si:(oi==="before"&&(yi=bi.apply(mi,arguments)),yi)}}}function Xi(){Ln(this.input,"change",()=>{this.sync()})}function bn(fi){var oi=this,ci=oi.onOptionSelect;oi.settings.hideSelected=!1;let ui=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},fi);var mi=function(Si,Di){Di?(Si.checked=!0,ui.uncheckedClassNames&&Si.classList.remove(...ui.uncheckedClassNames),ui.checkedClassNames&&Si.classList.add(...ui.checkedClassNames)):(Si.checked=!1,ui.checkedClassNames&&Si.classList.remove(...ui.checkedClassNames),ui.uncheckedClassNames&&Si.classList.add(...ui.uncheckedClassNames))},bi=function(Si){setTimeout(()=>{var Di=Si.querySelector("input."+ui.className);Di instanceof HTMLInputElement&&mi(Di,Si.classList.contains("selected"))},1)};oi.hook("after","setupTemplates",()=>{var yi=oi.settings.render.option;oi.settings.render.option=(Si,Di)=>{var Oi=Ri(yi.call(oi,Si,Di)),Wi=document.createElement("input");ui.className&&Wi.classList.add(ui.className),Wi.addEventListener("click",function(Zi){Dn(Zi)}),Wi.type="checkbox";let ji=xn(Si[oi.settings.valueField]);return mi(Wi,!!(ji&&oi.items.indexOf(ji)>-1)),Oi.prepend(Wi),Oi}}),oi.on("item_remove",yi=>{var Si=oi.getOption(yi);Si&&(Si.classList.remove("selected"),bi(Si))}),oi.on("item_add",yi=>{var Si=oi.getOption(yi);Si&&bi(Si)}),oi.hook("instead","onOptionSelect",(yi,Si)=>{if(Si.classList.contains("selected")){Si.classList.remove("selected"),oi.removeItem(Si.dataset.value),oi.refreshOptions(),Dn(yi,!0);return}ci.call(oi,yi,Si),bi(Si)})}function Gi(fi){let oi=this,ci=Object.assign({className:"clear-button",title:"Clear All",html:ui=>`
`},fi);oi.on("initialize",()=>{var ui=Ri(ci.html(ci));ui.addEventListener("click",mi=>{oi.isLocked||(oi.clear(),oi.settings.mode==="single"&&oi.settings.allowEmptyOption&&oi.addItem(""),mi.preventDefault(),mi.stopPropagation())}),oi.control.appendChild(ui)})}let hn=(fi,oi)=>{var ci;(ci=fi.parentNode)==null||ci.insertBefore(oi,fi.nextSibling)},kn=(fi,oi)=>{var ci;(ci=fi.parentNode)==null||ci.insertBefore(oi,fi)},gs=(fi,oi)=>{do{var ci;if(oi=(ci=oi)==null?void 0:ci.previousElementSibling,fi==oi)return!0}while(oi&&oi.previousElementSibling);return!1};function ns(){var fi=this;if(fi.settings.mode!=="multi")return;var oi=fi.lock,ci=fi.unlock;let ui=!0,mi;fi.hook("after","setupTemplates",()=>{var bi=fi.settings.render.item;fi.settings.render.item=(yi,Si)=>{let Di=Ri(bi.call(fi,yi,Si));_n(Di,{draggable:"true"});let Oi=An=>{ui||Dn(An),An.stopPropagation()},Wi=An=>{mi=Di,setTimeout(()=>{Di.classList.add("ts-dragging")},0)},ji=An=>{An.preventDefault(),Di.classList.add("ts-drag-over"),In(Di,mi)},Zi=()=>{Di.classList.remove("ts-drag-over")},In=(An,Hn)=>{Hn!==void 0&&(gs(Hn,Di)?hn(An,Hn):kn(An,Hn))},Qi=()=>{var An;document.querySelectorAll(".ts-drag-over").forEach(Nn=>Nn.classList.remove("ts-drag-over")),(An=mi)==null||An.classList.remove("ts-dragging"),mi=void 0;var Hn=[];fi.control.querySelectorAll("[data-value]").forEach(Nn=>{if(Nn.dataset.value){let dn=Nn.dataset.value;dn&&Hn.push(dn)}}),fi.setValue(Hn)};return Ln(Di,"mousedown",Oi),Ln(Di,"dragstart",Wi),Ln(Di,"dragenter",ji),Ln(Di,"dragover",ji),Ln(Di,"dragleave",Zi),Ln(Di,"dragend",Qi),Di}}),fi.hook("instead","lock",()=>(ui=!1,oi.call(fi))),fi.hook("instead","unlock",()=>(ui=!0,ci.call(fi)))}function go(fi){let oi=this,ci=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:ui=>'
'+ui.title+'×
'},fi);oi.on("initialize",()=>{var ui=Ri(ci.html(ci)),mi=ui.querySelector("."+ci.closeClass);mi&&mi.addEventListener("click",bi=>{Dn(bi,!0),oi.close()}),oi.dropdown.insertBefore(ui,oi.dropdown.firstChild)})}function io(){var fi=this;fi.hook("instead","setCaret",oi=>{fi.settings.mode==="single"||!fi.control.contains(fi.control_input)?oi=fi.items.length:(oi=Math.max(0,Math.min(fi.items.length,oi)),oi!=fi.caretPos&&!fi.isPending&&fi.controlChildren().forEach((ci,ui)=>{ui{if(!fi.isFocused)return;let ci=fi.getLastActive(oi);if(ci){let ui=Wn(ci);fi.setCaret(oi>0?ui+1:ui),fi.setActiveItem(),Xn(ci,"last-active")}else fi.setCaret(fi.caretPos+oi)})}function zl(){let fi=this;fi.settings.shouldOpen=!0,fi.hook("before","setup",()=>{fi.focus_node=fi.control,Gn(fi.control_input,"dropdown-input");let oi=Ri('