bh 6.1.4 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/README.md +87 -15
  4. data/app/javascript/bh/bookmark_controller.js +97 -0
  5. data/app/javascript/bh/clear_controller.js +22 -0
  6. data/app/javascript/bh/combobox/menu.js +93 -0
  7. data/app/javascript/bh/combobox_controller.js +82 -0
  8. data/app/javascript/bh/confirm.js +100 -0
  9. data/app/javascript/bh/density_controller.js +21 -0
  10. data/app/javascript/bh/deselect_controller.js +37 -0
  11. data/app/javascript/bh/flash.js +35 -0
  12. data/app/javascript/bh/limit_controller.js +23 -0
  13. data/app/javascript/bh/map/loader.js +20 -0
  14. data/app/javascript/bh/map_controller.js +88 -0
  15. data/app/javascript/bh/otp/slots.js +27 -0
  16. data/app/javascript/bh/otp_controller.js +98 -0
  17. data/app/javascript/bh/phone_controller.js +89 -0
  18. data/app/javascript/bh/placeholder_controller.js +28 -0
  19. data/app/javascript/bh/relative_time_controller.js +45 -0
  20. data/app/javascript/bh/require_controller.js +18 -0
  21. data/app/javascript/bh/reveal_controller.js +16 -0
  22. data/app/javascript/bh/scheme_controller.js +99 -0
  23. data/app/javascript/bh/search_controller.js +78 -0
  24. data/app/javascript/bh/shortcuts_controller.js +42 -0
  25. data/app/javascript/bh/sortable_controller.js +84 -0
  26. data/app/javascript/bh/thread_controller.js +47 -0
  27. data/app/javascript/bh/timezone_controller.js +27 -0
  28. data/app/javascript/bh/toast_controller.js +35 -0
  29. data/app/javascript/bh/tooltip_controller.js +23 -0
  30. data/app/javascript/bh/written.js +20 -0
  31. data/app/javascript/bh/written_controller.js +28 -0
  32. data/app/javascript/bh.js +60 -0
  33. data/app/stylesheets/bh/base.css +27 -0
  34. data/app/stylesheets/bh/chat.css +77 -0
  35. data/app/stylesheets/bh/flow.css +94 -0
  36. data/app/stylesheets/bh/map.css +3 -0
  37. data/app/stylesheets/bh/pin.css +34 -0
  38. data/app/stylesheets/bh/search.css +60 -0
  39. data/app/stylesheets/bh/shell.css +202 -0
  40. data/app/stylesheets/bh/table.css +130 -0
  41. data/app/stylesheets/bh/values.css +41 -0
  42. data/app/stylesheets/bh.css +13 -0
  43. data/build.mjs +15 -0
  44. data/config/locales/bh.en.yml +13 -0
  45. data/lib/bh/engine.rb +21 -6
  46. data/lib/bh/form_builder/comboboxes.rb +38 -0
  47. data/lib/bh/form_builder/controls.rb +67 -0
  48. data/lib/bh/form_builder/pins.rb +30 -0
  49. data/lib/bh/form_builder.rb +96 -0
  50. data/lib/bh/helpers/chats/asides.rb +49 -0
  51. data/lib/bh/helpers/chats/asks.rb +41 -0
  52. data/lib/bh/helpers/chats.rb +42 -0
  53. data/lib/bh/helpers/dialogs.rb +47 -0
  54. data/lib/bh/helpers/flows.rb +49 -0
  55. data/lib/bh/helpers/heads.rb +27 -0
  56. data/lib/bh/helpers/notices.rb +55 -0
  57. data/lib/bh/helpers.rb +12 -0
  58. data/lib/bh/message.rb +11 -0
  59. data/lib/bh/version.rb +2 -3
  60. data/lib/bh.rb +8 -6
  61. data/package.json +32 -0
  62. data/public/bh/css/bh.css +1 -0
  63. data/public/bh/js/bh.js +152 -0
  64. data/vendor/bootstrap.bundle.min.js +9 -0
  65. data/vendor/bootstrap.min.css +2 -0
  66. metadata +101 -23
  67. data/.gitignore +0 -23
  68. data/.rspec +0 -3
  69. data/.travis.yml +0 -15
  70. data/.yardopts +0 -3
  71. data/Gemfile +0 -4
  72. data/app/assets/stylesheets/bh.css +0 -29
  73. data/app/javascript/controllers/bh/theme_controller.js +0 -16
  74. data/app/javascript/controllers/phone_controller.js +0 -33
  75. data/app/javascript/controllers/require_controller.js +0 -20
  76. data/app/javascript/controllers/submit_controller.js +0 -24
  77. data/app/views/bh/_grid.html.erb +0 -6
  78. data/app/views/bh/_table.html.erb +0 -44
  79. data/bh.gemspec +0 -19
  80. data/lib/bh/bootstrap_helpers.rb +0 -137
@@ -0,0 +1,152 @@
1
+ var zh=Object.defineProperty;var Te=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(s){throw n=[s],s}};var _a=(t,e)=>{for(var n in e)zh(t,n,{get:e[n],enumerable:!0})};var Ge,is=Te(()=>{Ge={logger:typeof console<"u"?console:void 0,WebSocket:typeof WebSocket<"u"?WebSocket:void 0}});var q,Nt=Te(()=>{is();q={log(...t){this.enabled&&(t.push(Date.now()),Ge.logger.log("[ActionCable]",...t))}}});var an,rs,ln,os,ur=Te(()=>{Nt();an=()=>new Date().getTime(),rs=t=>(an()-t)/1e3,ln=class{constructor(e){this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=e,this.reconnectAttempts=0}start(){this.isRunning()||(this.startedAt=an(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),q.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`))}stop(){this.isRunning()&&(this.stoppedAt=an(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),q.log("ConnectionMonitor stopped"))}isRunning(){return this.startedAt&&!this.stoppedAt}recordMessage(){this.pingedAt=an()}recordConnect(){this.reconnectAttempts=0,delete this.disconnectedAt,q.log("ConnectionMonitor recorded connect")}recordDisconnect(){this.disconnectedAt=an(),q.log("ConnectionMonitor recorded disconnect")}startPolling(){this.stopPolling(),this.poll()}stopPolling(){clearTimeout(this.pollTimeout)}poll(){this.pollTimeout=setTimeout(()=>{this.reconnectIfStale(),this.poll()},this.getPollInterval())}getPollInterval(){let{staleThreshold:e,reconnectionBackoffRate:n}=this.constructor,s=Math.pow(1+n,Math.min(this.reconnectAttempts,10)),r=(this.reconnectAttempts===0?1:n)*Math.random();return e*1e3*s*(1+r)}reconnectIfStale(){this.connectionIsStale()&&(q.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${rs(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`),this.reconnectAttempts++,this.disconnectedRecently()?q.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${rs(this.disconnectedAt)} s`):(q.log("ConnectionMonitor reopening"),this.connection.reopen()))}get refreshedAt(){return this.pingedAt?this.pingedAt:this.startedAt}connectionIsStale(){return rs(this.refreshedAt)>this.constructor.staleThreshold}disconnectedRecently(){return this.disconnectedAt&&rs(this.disconnectedAt)<this.constructor.staleThreshold}visibilityDidChange(){document.visibilityState==="visible"&&setTimeout(()=>{(this.connectionIsStale()||!this.connection.isOpen())&&(q.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`),this.connection.reopen())},200)}};ln.staleThreshold=6;ln.reconnectionBackoffRate=.15;os=ln});var cn,dr=Te(()=>{cn={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},disconnect_reasons:{unauthorized:"unauthorized",invalid_request:"invalid_request",server_restart:"server_restart",remote:"remote"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]}});var hn,mr,ed,tl,un,as,fr=Te(()=>{is();ur();dr();Nt();({message_types:hn,protocols:mr}=cn),ed=mr.slice(0,mr.length-1),tl=[].indexOf,un=class{constructor(e){this.open=this.open.bind(this),this.consumer=e,this.subscriptions=this.consumer.subscriptions,this.monitor=new os(this),this.disconnected=!0}send(e){return this.isOpen()?(this.webSocket.send(JSON.stringify(e)),!0):!1}open(){if(this.isActive())return q.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`),!1;{let e=[...mr,...this.consumer.subprotocols||[]];return q.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${e}`),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new Ge.WebSocket(this.consumer.url,e),this.installEventHandlers(),this.monitor.start(),!0}}close({allowReconnect:e}={allowReconnect:!0}){if(e||this.monitor.stop(),this.isOpen())return this.webSocket.close()}reopen(){if(q.log(`Reopening WebSocket, current state is ${this.getState()}`),this.isActive())try{return this.close()}catch(e){q.log("Failed to reopen WebSocket",e)}finally{q.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`),setTimeout(this.open,this.constructor.reopenDelay)}else return this.open()}getProtocol(){if(this.webSocket)return this.webSocket.protocol}isOpen(){return this.isState("open")}isActive(){return this.isState("open","connecting")}triedToReconnect(){return this.monitor.reconnectAttempts>0}isProtocolSupported(){return tl.call(ed,this.getProtocol())>=0}isState(...e){return tl.call(e,this.getState())>=0}getState(){if(this.webSocket){for(let e in Ge.WebSocket)if(Ge.WebSocket[e]===this.webSocket.readyState)return e.toLowerCase()}return null}installEventHandlers(){for(let e in this.events){let n=this.events[e].bind(this);this.webSocket[`on${e}`]=n}}uninstallEventHandlers(){for(let e in this.events)this.webSocket[`on${e}`]=function(){}}};un.reopenDelay=500;un.prototype.events={message(t){if(!this.isProtocolSupported())return;let{identifier:e,message:n,reason:s,reconnect:i,type:r}=JSON.parse(t.data);switch(this.monitor.recordMessage(),r){case hn.welcome:return this.triedToReconnect()&&(this.reconnectAttempted=!0),this.monitor.recordConnect(),this.subscriptions.reload();case hn.disconnect:return q.log(`Disconnecting. Reason: ${s}`),this.close({allowReconnect:i});case hn.ping:return null;case hn.confirmation:return this.subscriptions.confirmSubscription(e),this.reconnectAttempted?(this.reconnectAttempted=!1,this.subscriptions.notify(e,"connected",{reconnected:!0})):this.subscriptions.notify(e,"connected",{reconnected:!1});case hn.rejection:return this.subscriptions.reject(e);default:return this.subscriptions.notify(e,"received",n)}},open(){if(q.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`),this.disconnected=!1,!this.isProtocolSupported())return q.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close(t){if(q.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error(){q.log("WebSocket onerror event")}};as=un});var td,ut,pr=Te(()=>{td=function(t,e){if(e!=null)for(let n in e){let s=e[n];t[n]=s}return t},ut=class{constructor(e,n={},s){this.consumer=e,this.identifier=JSON.stringify(n),td(this,s)}perform(e,n={}){return n.action=e,this.send(n)}send(e){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(e)})}unsubscribe(){return this.consumer.subscriptions.remove(this)}}});var gr,ls,br=Te(()=>{Nt();gr=class{constructor(e){this.subscriptions=e,this.pendingSubscriptions=[]}guarantee(e){this.pendingSubscriptions.indexOf(e)==-1?(q.log(`SubscriptionGuarantor guaranteeing ${e.identifier}`),this.pendingSubscriptions.push(e)):q.log(`SubscriptionGuarantor already guaranteeing ${e.identifier}`),this.startGuaranteeing()}forget(e){q.log(`SubscriptionGuarantor forgetting ${e.identifier}`),this.pendingSubscriptions=this.pendingSubscriptions.filter(n=>n!==e)}startGuaranteeing(){this.stopGuaranteeing(),this.retrySubscribing()}stopGuaranteeing(){clearTimeout(this.retryTimeout)}retrySubscribing(){this.retryTimeout=setTimeout(()=>{this.subscriptions&&typeof this.subscriptions.subscribe=="function"&&this.pendingSubscriptions.map(e=>{q.log(`SubscriptionGuarantor resubscribing ${e.identifier}`),this.subscriptions.subscribe(e)})},500)}},ls=gr});var dt,vr=Te(()=>{pr();br();Nt();dt=class{constructor(e){this.consumer=e,this.guarantor=new ls(this),this.subscriptions=[]}create(e,n){let s=e,i=typeof s=="object"?s:{channel:s},r=new ut(this.consumer,i,n);return this.add(r)}add(e){return this.subscriptions.push(e),this.consumer.ensureActiveConnection(),this.notify(e,"initialized"),this.subscribe(e),e}remove(e){return this.forget(e),this.findAll(e.identifier).length||this.sendCommand(e,"unsubscribe"),e}reject(e){return this.findAll(e).map(n=>(this.forget(n),this.notify(n,"rejected"),n))}forget(e){return this.guarantor.forget(e),this.subscriptions=this.subscriptions.filter(n=>n!==e),e}findAll(e){return this.subscriptions.filter(n=>n.identifier===e)}reload(){return this.subscriptions.map(e=>this.subscribe(e))}notifyAll(e,...n){return this.subscriptions.map(s=>this.notify(s,e,...n))}notify(e,n,...s){let i;return typeof e=="string"?i=this.findAll(e):i=[e],i.map(r=>typeof r[n]=="function"?r[n](...s):void 0)}subscribe(e){this.sendCommand(e,"subscribe")&&this.guarantor.guarantee(e)}confirmSubscription(e){q.log(`Subscription confirmed ${e}`),this.findAll(e).map(n=>this.guarantor.forget(n))}sendCommand(e,n){let{identifier:s}=e;return this.consumer.send({command:n,identifier:s})}}});function _r(t){if(typeof t=="function"&&(t=t()),t&&!/^wss?:/i.test(t)){let e=document.createElement("a");return e.href=t,e.href=e.href,e.protocol=e.protocol.replace("http","ws"),e.href}else return t}var It,nl=Te(()=>{fr();vr();It=class{constructor(e){this._url=e,this.subscriptions=new dt(this),this.connection=new as(this),this.subprotocols=[]}get url(){return _r(this._url)}send(e){return this.connection.send(e)}connect(){return this.connection.open()}disconnect(){return this.connection.close({allowReconnect:!1})}ensureActiveConnection(){if(!this.connection.isActive())return this.connection.open()}addSubProtocol(e){this.subprotocols=[...this.subprotocols,e]}}});var il={};_a(il,{Connection:()=>as,ConnectionMonitor:()=>os,Consumer:()=>It,INTERNAL:()=>cn,Subscription:()=>ut,SubscriptionGuarantor:()=>ls,Subscriptions:()=>dt,adapters:()=>Ge,createConsumer:()=>nd,createWebSocketURL:()=>_r,getConfig:()=>sl,logger:()=>q});function nd(t=sl("url")||cn.default_mount_path){return new It(t)}function sl(t){let e=document.head.querySelector(`meta[name='action-cable-${t}']`);if(e)return e.getAttribute("content")}var rl=Te(()=>{fr();ur();nl();dr();pr();vr();br();is();Nt()});var hr={};_a(hr,{FetchEnctype:()=>Ke,FetchMethod:()=>ue,FetchRequest:()=>je,FetchResponse:()=>Mt,FrameElement:()=>de,FrameLoadingStyle:()=>ct,FrameRenderer:()=>Lt,PageRenderer:()=>Ot,PageSnapshot:()=>ge,StreamActions:()=>cr,StreamElement:()=>Jn,StreamSourceElement:()=>es,cache:()=>Ka,config:()=>Z,connectStreamSource:()=>rn,disconnectStreamSource:()=>on,fetch:()=>ar,fetchEnctypeFromString:()=>$a,fetchMethodFromString:()=>ts,isSafe:()=>ns,morphBodyElements:()=>Ja,morphChildren:()=>ss,morphElements:()=>sn,morphTurboFrameElements:()=>el,navigator:()=>Ua,registerAdapter:()=>ja,renderStreamMessage:()=>Ga,session:()=>z,setConfirmMethod:()=>Za,setFormMode:()=>Qa,setProgressBarDelay:()=>Xa,start:()=>lr,visit:()=>za});var ct={eager:"eager",lazy:"lazy"},de=class t extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new t.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&this.refresh==="morph"}get loading(){return Gh(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}};function Gh(t){return t.toLowerCase()==="lazy"?ct.lazy:ct.eager}var Xh={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function en(t){if(t.getAttribute("data-turbo-eval")=="false")return t;{let e=document.createElement("script"),n=Oa();return n&&(e.nonce=n),e.textContent=t.textContent,e.async=!1,Zh(e,t),e}}function Zh(t,e){for(let{name:n,value:s}of e.attributes)t.setAttribute(n,s)}function Qh(t){let e=document.createElement("template");return e.innerHTML=t,e.content}function K(t,{target:e,cancelable:n,detail:s}={}){let i=new CustomEvent(t,{cancelable:n,bubbles:!0,composed:!0,detail:s});return e&&e.isConnected?e.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function ya(t){t.preventDefault(),t.stopImmediatePropagation()}function Qt(){return document.visibilityState==="hidden"?Da():Ca()}function Ca(){return new Promise(t=>requestAnimationFrame(()=>t()))}function Da(){return new Promise(t=>setTimeout(()=>t(),0))}function Ma(t=""){return new DOMParser().parseFromString(t,"text/html")}function xa(t,...e){let n=Jh(t,e).replace(/^\n/,"").split(`
2
+ `),s=n[0].match(/^\s+/),i=s?s[0].length:0;return n.map(r=>r.slice(i)).join(`
3
+ `)}function Jh(t,e){return t.reduce((n,s,i)=>{let r=e[i]==null?"":e[i];return n+s+r},"")}function Ue(){return Array.from({length:36}).map((t,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*16).toString(16)).join("")}function Vn(t,...e){for(let n of e.map(s=>s?.getAttribute(t)))if(typeof n=="string")return n;return null}function eu(t,...e){return e.some(n=>n&&n.hasAttribute(t))}function Bn(...t){for(let e of t)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function qn(...t){for(let e of t)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function tu(t,e=2e3){return new Promise(n=>{let s=()=>{t.removeEventListener("error",s),t.removeEventListener("load",s),n()};t.addEventListener("load",s,{once:!0}),t.addEventListener("error",s,{once:!0}),setTimeout(n,e)})}function La(t){switch(t){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function nu(t){return t=="advance"||t=="replace"||t=="restore"}function ht(...t){let e=Vn("data-turbo-action",...t);return nu(e)?e:null}function ir(t){return document.querySelector(`meta[name="${t}"]`)}function Wn(t){let e=ir(t);return e&&e.content}function Oa(){let t=ir("csp-nonce");if(t){let{nonce:e,content:n}=t;return e==""?n:e}}function su(t,e){let n=ir(t);return n||(n=document.createElement("meta"),n.setAttribute("name",t),document.head.appendChild(n)),n.setAttribute("content",e),n}function Ct(t,e){if(t instanceof Element)return t.closest(e)||Ct(t.assignedSlot||t.getRootNode()?.host,e)}function rr(t){return!!t&&t.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof t.focus=="function"}function Na(t){return Array.from(t.querySelectorAll("[autofocus]")).find(rr)}async function iu(t,e){let n=e();t(),await Ca();let s=e();return[n,s]}function Ia(t){if(t==="_blank")return!1;if(t){for(let e of document.getElementsByName(t))if(e instanceof HTMLIFrameElement)return!1;return!0}else return!0}function ka(t){let e=Ct(t,"a[href], a[xlink\\:href]");if(!e||e.href.startsWith("#")||e.hasAttribute("download"))return null;let n=e.getAttribute("target");return n&&n!=="_self"?null:e}function ru(t,e){let n=null;return(...s)=>{let i=()=>t.apply(this,s);clearTimeout(n),n=setTimeout(i,e)}}var ou={"aria-disabled":{beforeSubmit:t=>{t.setAttribute("aria-disabled","true"),t.addEventListener("click",ya)},afterSubmit:t=>{t.removeAttribute("aria-disabled"),t.removeEventListener("click",ya)}},disabled:{beforeSubmit:t=>t.disabled=!0,afterSubmit:t=>t.disabled=!1}},Li=class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=ou[e]||e}},au=new Li({mode:"on",submitter:"disabled"}),Z={drive:Xh,forms:au};function ne(t){return new URL(t.toString(),document.baseURI)}function Jt(t){let e;if(t.hash)return t.hash.slice(1);if(e=t.href.match(/#(.*)$/))return e[1]}function or(t,e){let n=e?.getAttribute("formaction")||t.getAttribute("action")||t.action;return ne(n)}function lu(t){return(du(t).match(/\.[^.]*$/)||[])[0]||""}function cu(t,e){let n=Ea(e.origin+e.pathname);return Ea(t.href)===n||t.href.startsWith(n)}function Ye(t,e){return cu(t,e)&&!Z.drive.unvisitableExtensions.has(lu(t))}function Ra(t){return ne(t.getAttribute("href")||"")}function hu(t){let e=Jt(t);return e!=null?t.href.slice(0,-(e.length+1)):t.href}function Hn(t){return hu(t)}function Pa(t,e){return ne(t).href==ne(e).href}function uu(t){return t.pathname.split("/").slice(1)}function du(t){return uu(t).slice(-1)[0]}function Ea(t){return t.endsWith("/")?t:t+"/"}var Mt=class{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return ne(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}},Oi=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let s=this.values().next().value;this.delete(s)}super.add(e)}},Fa=new Oi(20);function ar(t,e={}){let n=new Headers(e.headers||{}),s=Ue();return Fa.add(s),n.append("X-Turbo-Request-Id",s),window.fetch(t,{...e,headers:n})}function ts(t){switch(t.toLowerCase()){case"get":return ue.get;case"post":return ue.post;case"put":return ue.put;case"patch":return ue.patch;case"delete":return ue.delete}}var ue={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function $a(t){switch(t.toLowerCase()){case Ke.multipart:return Ke.multipart;case Ke.plain:return Ke.plain;default:return Ke.urlEncoded}}var Ke={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},je=class{abortController=new AbortController;#e=e=>{};constructor(e,n,s,i=new URLSearchParams,r=null,o=Ke.urlEncoded){let[a,l]=wa(ne(s),n,i,o);this.delegate=e,this.url=a,this.target=r,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:n.toUpperCase(),headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let n=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,s=ts(e)||ue.get;this.url.search="";let[i,r]=wa(this.url,s,n,this.enctype);this.url=i,this.fetchOptions.body=r,this.fetchOptions.method=s.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let n=await this.#t(e);try{this.delegate.requestStarted(this),n.detail.fetchRequest?this.response=n.detail.fetchRequest.response:this.response=ar(this.url.href,e);let s=await this.response;return await this.receive(s)}catch(s){if(s.name!=="AbortError")throw this.#n(s)&&this.delegate.requestErrored(this,s),s}finally{this.delegate.requestFinished(this)}}async receive(e){let n=new Mt(e);return K("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:n},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,n):n.succeeded?this.delegate.requestSucceededWithResponse(this,n):this.delegate.requestFailedWithResponse(this,n),n}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return ns(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let n=new Promise(i=>this.#e=i),s=K("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=s.detail.url,s.defaultPrevented&&await n,s}#n(e){return!K("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function ns(t){return ts(t)==ue.get}function wa(t,e,n,s){let i=Array.from(n).length>0?new URLSearchParams(Ha(n)):t.searchParams;return ns(e)?[mu(t,i),null]:s==Ke.urlEncoded?[t,i]:[t,n]}function Ha(t){let e=[];for(let[n,s]of t)s instanceof File||e.push([n,s]);return e}function mu(t,e){let n=new URLSearchParams(Ha(e));return t.search=n.toString(),t}var Ni=class{started=!1;constructor(e,n){this.delegate=e,this.element=n,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},ze=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(Qh(e)):e}constructor(e){this.fragment=fu(e)}};function fu(t){for(let e of t.querySelectorAll("turbo-stream")){let n=document.importNode(e,!0);for(let s of n.templateElement.content.querySelectorAll("script"))s.replaceWith(en(s));e.replaceWith(n)}return t}var pu=t=>t,Yn=class{keys=[];entries={};#e;constructor(e,n=pu){this.size=e,this.#e=n}has(e){return this.#e(e)in this.entries}get(e){if(this.has(e)){let n=this.read(e);return this.touch(e),n}}put(e,n){return this.write(e,n),this.touch(e),n}clear(){for(let e of Object.keys(this.entries))this.evict(e)}read(e){return this.entries[this.#e(e)]}write(e,n){this.entries[this.#e(e)]=n}touch(e){e=this.#e(e);let n=this.keys.indexOf(e);n>-1&&this.keys.splice(n,1),this.keys.unshift(e),this.trim()}trim(){for(let e of this.keys.splice(this.size))this.evict(e)}evict(e){delete this.entries[e]}},gu=100,Ii=class extends Yn{#e=null;#t={};constructor(e=1,n=gu){super(e,Hn),this.prefetchDelay=n}putLater(e,n,s){this.#e=setTimeout(()=>{n.perform(),this.put(e,n,s),this.#e=null},this.prefetchDelay)}put(e,n,s=Va){super.put(e,n),this.#t[Hn(e)]=new Date(new Date().getTime()+s)}clear(){super.clear(),this.#e&&clearTimeout(this.#e)}evict(e){super.evict(e),delete this.#t[e]}has(e){if(super.has(e)){let n=this.#t[Hn(e)];return n&&n>Date.now()}else return!1}},Va=10*1e3,At=new Ii,Tt={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},Kn=class t{state=Tt.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,n,s,i=!1){let r=wu(n,s),o=Eu(yu(n,s),r),a=bu(n,s),l=Su(n,s);this.delegate=e,this.formElement=n,this.submitter=s,this.fetchRequest=new je(this,r,o,a,n,l),this.mustRedirect=i}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=ne(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:n}=Tt,s=Vn("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof s=="string"&&!await(typeof Z.forms.confirm=="function"?Z.forms.confirm:t.confirmMethod)(s,this.formElement,this.submitter))&&this.state==e)return this.state=n,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:n}=Tt;if(this.state!=e&&this.state!=n)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let n=vu(Wn("csrf-param"))||Wn("csrf-token");n&&(e.headers["X-CSRF-Token"]=n)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(ze.contentType)}requestStarted(e){this.state=Tt.waiting,this.submitter&&Z.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),Bn(this.formElement),K("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,n){At.clear(),this.result={success:n.succeeded,fetchResponse:n}}requestSucceededWithResponse(e,n){if(n.clientError||n.serverError){this.delegate.formSubmissionFailedWithResponse(this,n);return}if(At.clear(),this.requestMustRedirect(e)&&_u(n)){let s=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,s)}else this.state=Tt.receiving,this.result={success:!0,fetchResponse:n},this.delegate.formSubmissionSucceededWithResponse(this,n)}requestFailedWithResponse(e,n){this.result={success:!1,fetchResponse:n},this.delegate.formSubmissionFailedWithResponse(this,n)}requestErrored(e,n){this.result={success:!1,error:n},this.delegate.formSubmissionErrored(this,n)}requestFinished(e){this.state=Tt.stopped,this.submitter&&Z.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),qn(this.formElement),K("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||eu("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function bu(t,e){let n=new FormData(t),s=e?.getAttribute("name"),i=e?.getAttribute("value");return s&&n.append(s,i||""),n}function vu(t){if(t!=null){let n=(document.cookie?document.cookie.split("; "):[]).find(s=>s.startsWith(t));if(n){let s=n.split("=").slice(1).join("=");return s?decodeURIComponent(s):void 0}}}function _u(t){return t.statusCode==200&&!t.redirected}function yu(t,e){let n=typeof t.action=="string"?t.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":t.getAttribute("action")||n||""}function Eu(t,e){let n=ne(t);return ns(e)&&(n.search=""),n}function wu(t,e){let n=e?.getAttribute("formmethod")||t.getAttribute("method")||"";return ts(n.toLowerCase())||ue.get}function Su(t,e){return $a(e?.getAttribute("formenctype")||t.enctype)}var xt=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return Na(this.element)}get permanentElements(){return qa(this.element)}getPermanentElementById(e){return Ba(this.element,e)}getPermanentElementMapForSnapshot(e){let n={};for(let s of this.permanentElements){let{id:i}=s,r=e.getPermanentElementById(i);r&&(n[i]=[s,r])}return n}};function Ba(t,e){return t.querySelector(`#${e}[data-turbo-permanent]`)}function qa(t){return t.querySelectorAll("[id][data-turbo-permanent]")}var tn=class{started=!1;constructor(e,n){this.delegate=e,this.eventTarget=n}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let n=e.target instanceof HTMLFormElement?e.target:void 0,s=e.submitter||void 0;n&&Tu(n,s)&&Au(n,s)&&this.delegate.willSubmitForm(n,s)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(n,s))}}};function Tu(t,e){return(e?.getAttribute("formmethod")||t.getAttribute("method"))!="dialog"}function Au(t,e){let n=e?.getAttribute("formtarget")||t.getAttribute("target");return Ia(n)}var Un=class{#e=e=>{};#t=e=>{};constructor(e,n){this.delegate=e,this.element=n}scrollToAnchor(e){let n=this.snapshot.getElementForAnchor(e);n?(this.focusElement(n),this.scrollToElement(n)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(Jt(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:n}){this.scrollRoot.scrollTo(e,n)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:n,shouldRender:s,willRender:i,newSnapshot:r}=e,o=i;if(s)try{this.renderPromise=new Promise(h=>this.#e=h),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(h=>this.#t=h),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(r,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(r,n,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},ki=class extends Un{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new xt(this.element)}},jn=class{constructor(e,n){this.delegate=e,this.element=n}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.clickEventIsSignificant(e)&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};clickEventIsSignificant(e){let n=e.composed?e.target?.parentElement:e.target,s=ka(n)||n;return s instanceof Element&&s.closest("turbo-frame, html")==this.element}},zn=class{started=!1;constructor(e,n){this.delegate=e,this.eventTarget=n}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let n=e.composedPath&&e.composedPath()[0]||e.target,s=ka(n);if(s&&Ia(s.target)){let i=Ra(s);this.delegate.willFollowLinkToLocation(s,i,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(s,i))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},Gn=class{constructor(e,n){this.delegate=e,this.linkInterceptor=new zn(this,n)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,n){return!1}prefetchAndCacheRequestToLocation(e,n){}willFollowLinkToLocation(e,n,s){return this.delegate.willSubmitFormLinkToLocation(e,n,s)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,n){let s=document.createElement("form"),i="hidden";for(let[u,m]of n.searchParams)s.append(Object.assign(document.createElement("input"),{type:i,name:u,value:m}));let r=Object.assign(n,{search:""});s.setAttribute("data-turbo","true"),s.setAttribute("action",r.href),s.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&s.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&s.setAttribute("data-turbo-frame",a);let l=ht(e);l&&s.setAttribute("data-turbo-action",l);let c=e.getAttribute("data-turbo-confirm");c&&s.setAttribute("data-turbo-confirm",c),e.hasAttribute("data-turbo-stream")&&s.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,n,s),document.body.appendChild(s),s.addEventListener("turbo:submit-end",()=>s.remove(),{once:!0}),requestAnimationFrame(()=>s.requestSubmit())}},Xn=class{static async preservingPermanentElements(e,n,s){let i=new this(e,n);i.enter(),await s(),i.leave()}constructor(e,n){this.delegate=e,this.permanentElementMap=n}enter(){for(let e in this.permanentElementMap){let[n,s]=this.permanentElementMap[e];this.delegate.enteringBardo(n,s),this.replaceNewPermanentElementWithPlaceholder(s)}}leave(){for(let e in this.permanentElementMap){let[n]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(n),this.replacePlaceholderWithPermanentElement(n),this.delegate.leavingBardo(n)}}replaceNewPermanentElementWithPlaceholder(e){let n=Cu(e);e.replaceWith(n)}replaceCurrentPermanentElementWithClone(e){let n=e.cloneNode(!0);e.replaceWith(n)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(n=>n.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function Cu(t){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",t.id),e}var nn=class{#e=null;static renderElement(e,n){}constructor(e,n,s,i=!0){this.currentSnapshot=e,this.newSnapshot=n,this.isPreview=s,this.willRender=i,this.renderElement=this.constructor.renderElement,this.promise=new Promise((r,o)=>this.resolvingFunctions={resolve:r,reject:o})}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await Xn.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},Lt=class extends nn{static renderElement(e,n){let s=document.createRange();s.selectNodeContents(e),s.deleteContents();let i=n,r=i.ownerDocument?.createRange();r&&(r.selectNodeContents(i),e.appendChild(r.extractContents()))}constructor(e,n,s,i,r,o=!0){super(n,s,i,r,o),this.delegate=e}get shouldRender(){return!0}async render(){await Qt(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Qt(),this.focusFirstAutofocusableElement(),await Qt(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,n=Du(this.currentElement.getAttribute("data-autoscroll-block"),"end"),s=Mu(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:n,behavior:s}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let n=en(e);e.replaceWith(n)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function Du(t,e){return t=="end"||t=="start"||t=="center"||t=="nearest"?t:e}function Mu(t,e){return t=="auto"||t=="smooth"?t:e}var xu=(function(){let t=()=>{},e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:t,afterNodeAdded:t,beforeNodeMorphed:t,afterNodeMorphed:t,beforeNodeRemoved:t,afterNodeRemoved:t,beforeAttributeUpdated:t},head:{style:"merge",shouldPreserve:m=>m.getAttribute("im-preserve")==="true",shouldReAppend:m=>m.getAttribute("im-re-append")==="true",shouldRemove:t,afterHeadMorphed:t},restoreFocus:!0};function n(m,f,g={}){m=h(m);let _=u(f),S=c(m,_,g),C=i(S,()=>a(S,m,_,p=>p.morphStyle==="innerHTML"?(r(p,m,_),Array.from(m.childNodes)):s(p,m,_)));return S.pantry.remove(),C}function s(m,f,g){let _=u(f);return r(m,_,g,f,f.nextSibling),Array.from(_.childNodes)}function i(m,f){if(!m.config.restoreFocus)return f();let g=document.activeElement;if(!(g instanceof HTMLInputElement||g instanceof HTMLTextAreaElement))return f();let{id:_,selectionStart:S,selectionEnd:C}=g,p=f();return _&&_!==document.activeElement?.getAttribute("id")&&(g=m.target.querySelector(`[id="${_}"]`),g?.focus()),g&&!g.selectionEnd&&C&&g.setSelectionRange(S,C),p}let r=(function(){function m(b,v,E,T=null,O=null){v instanceof HTMLTemplateElement&&E instanceof HTMLTemplateElement&&(v=v.content,E=E.content),T||=v.firstChild;for(let x of E.childNodes){if(T&&T!=O){let $=g(b,x,T,O);if($){$!==T&&S(b,T,$),o($,x,b),T=$.nextSibling;continue}}if(x instanceof Element){let $=x.getAttribute("id");if(b.persistentIds.has($)){let Y=C(v,$,T,b);o(Y,x,b),T=Y.nextSibling;continue}}let N=f(v,x,T,b);N&&(T=N.nextSibling)}for(;T&&T!=O;){let x=T;T=T.nextSibling,_(b,x)}}function f(b,v,E,T){if(T.callbacks.beforeNodeAdded(v)===!1)return null;if(T.idMap.has(v)){let O=document.createElement(v.tagName);return b.insertBefore(O,E),o(O,v,T),T.callbacks.afterNodeAdded(O),O}else{let O=document.importNode(v,!0);return b.insertBefore(O,E),T.callbacks.afterNodeAdded(O),O}}let g=(function(){function b(T,O,x,N){let $=null,Y=O.nextSibling,Q=0,V=x;for(;V&&V!=N;){if(E(V,O)){if(v(T,V,O))return V;$===null&&(T.idMap.has(V)||($=V))}if($===null&&Y&&E(V,Y)&&(Q++,Y=Y.nextSibling,Q>=2&&($=void 0)),T.activeElementAndParents.includes(V))break;V=V.nextSibling}return $||null}function v(T,O,x){let N=T.idMap.get(O),$=T.idMap.get(x);if(!$||!N)return!1;for(let Y of N)if($.has(Y))return!0;return!1}function E(T,O){let x=T,N=O;return x.nodeType===N.nodeType&&x.tagName===N.tagName&&(!x.getAttribute?.("id")||x.getAttribute?.("id")===N.getAttribute?.("id"))}return b})();function _(b,v){if(b.idMap.has(v))w(b.pantry,v,null);else{if(b.callbacks.beforeNodeRemoved(v)===!1)return;v.parentNode?.removeChild(v),b.callbacks.afterNodeRemoved(v)}}function S(b,v,E){let T=v;for(;T&&T!==E;){let O=T;T=T.nextSibling,_(b,O)}return T}function C(b,v,E,T){let O=T.target.getAttribute?.("id")===v&&T.target||T.target.querySelector(`[id="${v}"]`)||T.pantry.querySelector(`[id="${v}"]`);return p(O,T),w(b,O,E),O}function p(b,v){let E=b.getAttribute("id");for(;b=b.parentNode;){let T=v.idMap.get(b);T&&(T.delete(E),T.size||v.idMap.delete(b))}}function w(b,v,E){if(b.moveBefore)try{b.moveBefore(v,E)}catch{b.insertBefore(v,E)}else b.insertBefore(v,E)}return m})(),o=(function(){function m(p,w,b){return b.ignoreActive&&p===document.activeElement?null:(b.callbacks.beforeNodeMorphed(p,w)===!1||(p instanceof HTMLHeadElement&&b.head.ignore||(p instanceof HTMLHeadElement&&b.head.style!=="morph"?l(p,w,b):(f(p,w,b),C(p,b)||r(b,p,w))),b.callbacks.afterNodeMorphed(p,w)),p)}function f(p,w,b){let v=w.nodeType;if(v===1){let E=p,T=w,O=E.attributes,x=T.attributes;for(let N of x)S(N.name,E,"update",b)||E.getAttribute(N.name)!==N.value&&E.setAttribute(N.name,N.value);for(let N=O.length-1;0<=N;N--){let $=O[N];if($&&!T.hasAttribute($.name)){if(S($.name,E,"remove",b))continue;E.removeAttribute($.name)}}C(E,b)||g(E,T,b)}(v===8||v===3)&&p.nodeValue!==w.nodeValue&&(p.nodeValue=w.nodeValue)}function g(p,w,b){if(p instanceof HTMLInputElement&&w instanceof HTMLInputElement&&w.type!=="file"){let v=w.value,E=p.value;_(p,w,"checked",b),_(p,w,"disabled",b),w.hasAttribute("value")?E!==v&&(S("value",p,"update",b)||(p.setAttribute("value",v),p.value=v)):S("value",p,"remove",b)||(p.value="",p.removeAttribute("value"))}else if(p instanceof HTMLOptionElement&&w instanceof HTMLOptionElement)_(p,w,"selected",b);else if(p instanceof HTMLTextAreaElement&&w instanceof HTMLTextAreaElement){let v=w.value,E=p.value;if(S("value",p,"update",b))return;v!==E&&(p.value=v),p.firstChild&&p.firstChild.nodeValue!==v&&(p.firstChild.nodeValue=v)}}function _(p,w,b,v){let E=w[b],T=p[b];if(E!==T){let O=S(b,p,"update",v);O||(p[b]=w[b]),E?O||p.setAttribute(b,""):S(b,p,"remove",v)||p.removeAttribute(b)}}function S(p,w,b,v){return p==="value"&&v.ignoreActiveValue&&w===document.activeElement?!0:v.callbacks.beforeAttributeUpdated(p,w,b)===!1}function C(p,w){return!!w.ignoreActiveValue&&p===document.activeElement&&p!==document.body}return m})();function a(m,f,g,_){if(m.head.block){let S=f.querySelector("head"),C=g.querySelector("head");if(S&&C){let p=l(S,C,m);return Promise.all(p).then(()=>{let w=Object.assign(m,{head:{block:!1,ignore:!0}});return _(w)})}}return _(m)}function l(m,f,g){let _=[],S=[],C=[],p=[],w=new Map;for(let v of f.children)w.set(v.outerHTML,v);for(let v of m.children){let E=w.has(v.outerHTML),T=g.head.shouldReAppend(v),O=g.head.shouldPreserve(v);E||O?T?S.push(v):(w.delete(v.outerHTML),C.push(v)):g.head.style==="append"?T&&(S.push(v),p.push(v)):g.head.shouldRemove(v)!==!1&&S.push(v)}p.push(...w.values());let b=[];for(let v of p){let E=document.createRange().createContextualFragment(v.outerHTML).firstChild;if(g.callbacks.beforeNodeAdded(E)!==!1){if("href"in E&&E.href||"src"in E&&E.src){let T,O=new Promise(function(x){T=x});E.addEventListener("load",function(){T()}),b.push(O)}m.appendChild(E),g.callbacks.afterNodeAdded(E),_.push(E)}}for(let v of S)g.callbacks.beforeNodeRemoved(v)!==!1&&(m.removeChild(v),g.callbacks.afterNodeRemoved(v));return g.head.afterHeadMorphed(m,{added:_,kept:C,removed:S}),b}let c=(function(){function m(b,v,E){let{persistentIds:T,idMap:O}=p(b,v),x=f(E),N=x.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(N))throw`Do not understand how to morph style ${N}`;return{target:b,newContent:v,config:x,morphStyle:N,ignoreActive:x.ignoreActive,ignoreActiveValue:x.ignoreActiveValue,restoreFocus:x.restoreFocus,idMap:O,persistentIds:T,pantry:g(),activeElementAndParents:_(b),callbacks:x.callbacks,head:x.head}}function f(b){let v=Object.assign({},e);return Object.assign(v,b),v.callbacks=Object.assign({},e.callbacks,b.callbacks),v.head=Object.assign({},e.head,b.head),v}function g(){let b=document.createElement("div");return b.hidden=!0,document.body.insertAdjacentElement("afterend",b),b}function _(b){let v=[],E=document.activeElement;if(E?.tagName!=="BODY"&&b.contains(E))for(;E&&(v.push(E),E!==b);)E=E.parentElement;return v}function S(b){let v=Array.from(b.querySelectorAll("[id]"));return b.getAttribute?.("id")&&v.push(b),v}function C(b,v,E,T){for(let O of T){let x=O.getAttribute("id");if(v.has(x)){let N=O;for(;N;){let $=b.get(N);if($==null&&($=new Set,b.set(N,$)),$.add(x),N===E)break;N=N.parentElement}}}}function p(b,v){let E=S(b),T=S(v),O=w(E,T),x=new Map;C(x,O,b,E);let N=v.__idiomorphRoot||v;return C(x,O,N,T),{persistentIds:O,idMap:x}}function w(b,v){let E=new Set,T=new Map;for(let{id:x,tagName:N}of b)T.has(x)?E.add(x):T.set(x,N);let O=new Set;for(let{id:x,tagName:N}of v)O.has(x)?E.add(x):T.get(x)===N&&O.add(x);for(let x of E)O.delete(x);return O}return m})(),{normalizeElement:h,normalizeParent:u}=(function(){let m=new WeakSet;function f(C){return C instanceof Document?C.documentElement:C}function g(C){if(C==null)return document.createElement("div");if(typeof C=="string")return g(S(C));if(m.has(C))return C;if(C instanceof Node){if(C.parentNode)return new _(C);{let p=document.createElement("div");return p.append(C),p}}else{let p=document.createElement("div");for(let w of[...C])p.append(w);return p}}class _{constructor(p){this.originalNode=p,this.realParentNode=p.parentNode,this.previousSibling=p.previousSibling,this.nextSibling=p.nextSibling}get childNodes(){let p=[],w=this.previousSibling?this.previousSibling.nextSibling:this.realParentNode.firstChild;for(;w&&w!=this.nextSibling;)p.push(w),w=w.nextSibling;return p}querySelectorAll(p){return this.childNodes.reduce((w,b)=>{if(b instanceof Element){b.matches(p)&&w.push(b);let v=b.querySelectorAll(p);for(let E=0;E<v.length;E++)w.push(v[E])}return w},[])}insertBefore(p,w){return this.realParentNode.insertBefore(p,w)}moveBefore(p,w){return this.realParentNode.moveBefore(p,w)}get __idiomorphRoot(){return this.originalNode}}function S(C){let p=new DOMParser,w=C.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(w.match(/<\/html>/)||w.match(/<\/head>/)||w.match(/<\/body>/)){let b=p.parseFromString(C,"text/html");if(w.match(/<\/html>/))return m.add(b),b;{let v=b.firstChild;return v&&m.add(v),v}}else{let v=p.parseFromString("<body><template>"+C+"</template></body>","text/html").body.querySelector("template").content;return m.add(v),v}}return{normalizeElement:f,normalizeParent:g}})();return{morph:n,defaults:e}})();function sn(t,e,{callbacks:n,...s}={}){xu.morph(t,e,{...s,callbacks:new Ri(n)})}function ss(t,e,n={}){sn(t,e.childNodes,{...n,morphStyle:"innerHTML"})}function Wa(t,e){return t instanceof de&&t.shouldReloadWithMorph&&(!e||Lu(t,e))&&!t.closest("[data-turbo-permanent]")}function Lu(t,e){return e instanceof Element&&e.nodeName==="TURBO-FRAME"&&t.id===e.id&&(!e.getAttribute("src")||Pa(t.src,e.getAttribute("src")))}function Ya(t){return t.parentElement.closest("turbo-frame[src][refresh=morph]")}var Ri=class{#e;constructor({beforeNodeMorphed:e}={}){this.#e=e||(()=>!0)}beforeNodeAdded=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));beforeNodeMorphed=(e,n)=>{if(e instanceof Element)return!e.hasAttribute("data-turbo-permanent")&&this.#e(e,n)?!K("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:n}}).defaultPrevented:!1};beforeAttributeUpdated=(e,n,s)=>!K("turbo:before-morph-attribute",{cancelable:!0,target:n,detail:{attributeName:e,mutationType:s}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,n)=>{e instanceof Element&&K("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:n}})}},Zn=class extends Lt{static renderElement(e,n){K("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:n}}),ss(e,n,{callbacks:{beforeNodeMorphed:(s,i)=>Wa(s,i)&&Ya(s)===e?(s.reload(),!1):!0}})}async preservingPermanentElements(e){return await e()}},Pi=class t{static animationDuration=300;static get defaultCSS(){return xa`
4
+ .turbo-progress-bar {
5
+ position: fixed;
6
+ display: block;
7
+ top: 0;
8
+ left: 0;
9
+ height: 3px;
10
+ background: #0076ff;
11
+ z-index: 2147483647;
12
+ transition:
13
+ width ${t.animationDuration}ms ease-out,
14
+ opacity ${t.animationDuration/2}ms ${t.animationDuration/2}ms ease-in;
15
+ transform: translate3d(0, 0, 0);
16
+ }
17
+ `}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,t.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,t.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");e.type="text/css",e.textContent=t.defaultCSS;let n=Oa();return n&&(e.nonce=n),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}},Fi=class extends xt{detailsByOuterHTML=this.children.filter(e=>!ku(e)).map(e=>Fu(e)).reduce((e,n)=>{let{outerHTML:s}=n,i=s in e?e[s]:{type:Ou(n),tracked:Nu(n),elements:[]};return{...e,[s]:{...i,elements:[...i.elements,n]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,n){return Object.keys(this.detailsByOuterHTML).filter(s=>!(s in n.detailsByOuterHTML)).map(s=>this.detailsByOuterHTML[s]).filter(({type:s})=>s==e).map(({elements:[s]})=>s)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,n)=>{let{type:s,tracked:i,elements:r}=this.detailsByOuterHTML[n];return s==null&&!i?[...e,...r]:r.length>1?[...e,...r.slice(1)]:e},[])}getMetaValue(e){let n=this.findMetaElementByName(e);return n?n.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((n,s)=>{let{elements:[i]}=this.detailsByOuterHTML[s];return Pu(i,e)?i:n},void 0|void 0)}};function Ou(t){if(Iu(t))return"script";if(Ru(t))return"stylesheet"}function Nu(t){return t.getAttribute("data-turbo-track")=="reload"}function Iu(t){return t.localName=="script"}function ku(t){return t.localName=="noscript"}function Ru(t){let e=t.localName;return e=="style"||e=="link"&&t.getAttribute("rel")=="stylesheet"}function Pu(t,e){return t.localName=="meta"&&t.getAttribute("name")==e}function Fu(t){return t.hasAttribute("nonce")&&t.setAttribute("nonce",""),t}var ge=class t extends xt{static fromHTMLString(e=""){return this.fromDocument(Ma(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:n,head:s}){return new this(e,n,new Fi(s))}constructor(e,n,s){super(n),this.documentElement=e,this.headSnapshot=s}clone(){let e=this.element.cloneNode(!0),n=this.element.querySelectorAll("select"),s=e.querySelectorAll("select");for(let[i,r]of n.entries()){let o=s[i];for(let a of o.selectedOptions)a.selected=!1;for(let a of r.selectedOptions)o.options[a.index].selected=!0}for(let i of e.querySelectorAll('input[type="password"]'))i.value="";for(let i of e.querySelectorAll("noscript"))i.remove();return new t(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get dir(){return this.documentElement.getAttribute("dir")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return ne(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return(this.getSetting("view-transition")==="true"||this.headSnapshot.getMetaValue("view-transition")==="same-origin")&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}get refreshMethod(){return this.getSetting("refresh-method")}get refreshScroll(){return this.getSetting("refresh-scroll")}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},$i=class{#e=!1;#t=Promise.resolve();renderChange(e,n){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(n).finished})):this.#t=this.#t.then(n),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},$u={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1,refresh:{}},$n={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Ie={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},Dt={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Hu={advance:"forward",restore:"back",replace:"none"},Hi=class{identifier=Ue();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Ie.initialized;viewTransitioner=new $i;constructor(e,n,s,i={}){this.delegate=e,this.location=n,this.restorationIdentifier=s||Ue();let{action:r,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:c,response:h,visitCachedSnapshot:u,willRender:m,updateHistory:f,shouldCacheSnapshot:g,acceptsStreamResponse:_,direction:S,refresh:C}={...$u,...i};this.action=r,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=c,this.response=h,this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=u,this.willRender=m,this.updateHistory=f,this.scrolled=!m,this.shouldCacheSnapshot=g,this.acceptsStreamResponse=_,this.direction=S||Hu[r],this.refresh=C}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}start(){this.state==Ie.initialized&&(this.recordTimingMetric($n.visitStart),this.state=Ie.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Ie.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Ie.canceled)}complete(){this.state==Ie.started&&(this.recordTimingMetric($n.visitEnd),this.adapter.visitCompleted(this),this.state=Ie.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Ie.started&&(this.state=Ie.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,n=La(e);this.history.update(n,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new je(this,ue.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric($n.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:n}=e;Sa(n)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,n)}}finishRequest(){this.recordTimingMetric($n.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:n}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Sa(e)&&n!=null){let s=ge.fromHTMLString(n);await this.renderPageSnapshot(s,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(ge.fromHTMLString(n),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!Jt(this.location)||e.hasAnchor(Jt(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return ge.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let n=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,n),this.adapter.visitRendered(this),n||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(ze.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,n){}async requestSucceededWithResponse(e,n){let s=await n.responseHTML,{redirected:i,statusCode:r}=n;s==null?this.recordResponse({statusCode:Dt.contentTypeMismatch,redirected:i}):(this.redirectedToLocation=n.redirected?n.location:void 0,this.recordResponse({statusCode:r,responseHTML:s,redirected:i}))}async requestFailedWithResponse(e,n){let s=await n.responseHTML,{redirected:i,statusCode:r}=n;s==null?this.recordResponse({statusCode:Dt.contentTypeMismatch,redirected:i}):this.recordResponse({statusCode:r,responseHTML:s,redirected:i})}requestErrored(e,n){this.recordResponse({statusCode:Dt.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=Jt(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(n=>{this.frame=document.visibilityState==="hidden"?setTimeout(()=>n(),0):requestAnimationFrame(()=>n())}),await e(),delete this.frame}async renderPageSnapshot(e,n){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,n,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function Sa(t){return t>=200&&t<300}var Vi=class{progressBar=new Pi;constructor(e){this.session=e}visitProposedToLocation(e,n){Ye(e,this.navigator.rootLocation)?this.navigator.startVisit(e,n?.restorationIdentifier||Ue(),n):window.location.href=e.toString()}visitStarted(e){this.location=e.location,this.redirectedToLocation=null,e.loadCachedSnapshot(),e.issueRequest()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse(),e.response.redirected&&(this.redirectedToLocation=e.redirectedToLocation)}visitRequestFailedWithStatusCode(e,n){switch(n){case Dt.networkFailure:case Dt.timeoutFailure:case Dt.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:n}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}linkPrefetchingIsEnabledForLocation(e){return!0}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){K("turbo:reload",{detail:e}),window.location.href=(this.redirectedToLocation||this.location)?.toString()||window.location.href}get navigator(){return this.session.navigator}},Bi=class{selector="[data-turbo-temporary]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let n of this.temporaryElements)n.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector)]}},qi=class{constructor(e,n){this.session=e,this.element=n,this.linkInterceptor=new jn(this,n),this.formSubmitObserver=new tn(this,n)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,n,s){return this.#t(e)}linkClickIntercepted(e,n,s){let i=this.#n(e);i&&i.delegate.linkClickIntercepted(e,n,s)}willSubmitForm(e,n){return e.closest("turbo-frame")==null&&this.#e(e,n)&&this.#t(e,n)}formSubmitted(e,n){let s=this.#n(e,n);s&&s.delegate.formSubmitted(e,n)}#e(e,n){let s=or(e,n),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),r=ne(i?.content??"/");return this.#t(e,n)&&Ye(s,r)}#t(e,n){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,n):this.session.elementIsNavigatable(e)){let i=this.#n(e,n);return i?i!=e.closest("turbo-frame"):!1}else return!1}#n(e,n){let s=n?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(s&&s!="_top"){let i=this.element.querySelector(`#${s}:not([disabled])`);if(i instanceof de)return i}}},Wi=class{location;restorationIdentifier=Ue();restorationData={};started=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),this.started=!1)}push(e,n){this.update(history.pushState,e,n)}replace(e,n){this.update(history.replaceState,e,n)}update(e,n,s=Ue()){e===history.pushState&&++this.currentIndex;let i={turbo:{restorationIdentifier:s,restorationIndex:this.currentIndex}};e.call(history,i,"",n.href),this.location=n,this.restorationIdentifier=s}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:n}=this,s=this.restorationData[n];this.restorationData[n]={...s,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{let{turbo:n}=e.state||{};if(this.location=new URL(window.location.href),n){let{restorationIdentifier:s,restorationIndex:i}=n;this.restorationIdentifier=s;let r=i>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,s,r),this.currentIndex=i}else this.currentIndex++,this.delegate.historyPoppedWithEmptyState(this.location)}},Yi=class{started=!1;#e=null;constructor(e,n){this.delegate=e,this.eventTarget=n}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#o,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#o,!0),this.started=!0};#n=e=>{if(Wn("turbo-prefetch")==="false")return;let n=e.target;if(n.matches&&n.matches("a[href]:not([target^=_]):not([download])")&&this.#l(n)){let i=n,r=Ra(i);if(this.delegate.canPrefetchRequestToLocation(i,r)){this.#e=i;let o=new je(this,ue.get,r,new URLSearchParams,n);o.fetchOptions.priority="low",At.putLater(r,o,this.#r)}}};#i=e=>{e.target===this.#e&&this.#s()};#s=()=>{At.clear(),this.#e=null};#o=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="GET"){let n=At.get(e.detail.url);n&&(e.detail.fetchRequest=n),At.clear()}};prepareRequest(e){let n=e.target;e.headers["X-Sec-Purpose"]="prefetch";let s=n.closest("turbo-frame"),i=n.getAttribute("data-turbo-frame")||s?.getAttribute("target")||s?.id;i&&i!=="_top"&&(e.headers["Turbo-Frame"]=i)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,n){}requestFailedWithResponse(e,n){}get#r(){return Number(Wn("turbo-prefetch-cache-time"))||Va}#l(e){return!(!e.getAttribute("href")||Vu(e)||Bu(e)||qu(e)||Wu(e)||Ku(e))}},Vu=t=>t.origin!==document.location.origin||!["http:","https:"].includes(t.protocol)||t.hasAttribute("target"),Bu=t=>t.pathname+t.search===document.location.pathname+document.location.search||t.href.startsWith("#"),qu=t=>{if(t.getAttribute("data-turbo-prefetch")==="false"||t.getAttribute("data-turbo")==="false")return!0;let e=Ct(t,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},Wu=t=>{let e=t.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||Yu(t)||t.hasAttribute("data-turbo-confirm")||t.hasAttribute("data-turbo-stream"))},Yu=t=>t.hasAttribute("data-remote")||t.hasAttribute("data-behavior")||t.hasAttribute("data-confirm")||t.hasAttribute("data-method"),Ku=t=>K("turbo:before-prefetch",{target:t,cancelable:!0}).defaultPrevented,Ki=class{constructor(e){this.delegate=e}proposeVisit(e,n={}){this.delegate.allowsVisitingLocationWithAction(e,n.action)&&this.delegate.visitProposedToLocation(e,n)}startVisit(e,n,s={}){this.stop(),this.currentVisit=new Hi(this,ne(e),n,{referrer:this.location,...s}),this.currentVisit.start()}submitForm(e,n){this.stop(),this.formSubmission=new Kn(this,e,n,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,n){if(e==this.formSubmission){let s=await n.responseHTML;if(s){let i=e.isSafe;i||this.view.clearSnapshotCache();let{statusCode:r,redirected:o}=n,l={action:this.#e(e,n),shouldCacheSnapshot:i,response:{statusCode:r,responseHTML:s,redirected:o}};this.proposeVisit(n.location,l)}}}async formSubmissionFailedWithResponse(e,n){let s=await n.responseHTML;if(s){let i=ge.fromHTMLString(s);n.serverError?await this.view.renderError(i,this.currentVisit):await this.view.renderPage(i,!1,!0,this.currentVisit),i.refreshScroll!=="preserve"&&this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,n){console.error(n)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}linkPrefetchingIsEnabledForLocation(e){return typeof this.adapter.linkPrefetchingIsEnabledForLocation=="function"?this.adapter.linkPrefetchingIsEnabledForLocation(e):!0}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e),delete this.currentVisit}locationWithActionIsSamePage(e,n){return!1}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,n){let{submitter:s,formElement:i}=e;return ht(s,i)||this.#t(n)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},lt={initial:0,loading:1,interactive:2,complete:3},Ui=class{stage=lt.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==lt.initial&&(this.stage=lt.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==lt.loading&&(this.stage=lt.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==lt.interactive&&(this.stage=lt.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},ji=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},zi=class{render({fragment:e}){Xn.preservingPermanentElements(this,Uu(e),()=>{ju(e,()=>{zu(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,n){n.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function Uu(t){let e=qa(document.documentElement),n={};for(let s of e){let{id:i}=s;for(let r of t.querySelectorAll("turbo-stream")){let o=Ba(r.templateElement.content,i);o&&(n[i]=[s,o])}}return n}async function ju(t,e){let n=`turbo-stream-autofocus-${Ue()}`,s=t.querySelectorAll("turbo-stream"),i=Gu(s),r=null;if(i&&(i.id?r=i.id:r=n,i.id=r),e(),await Qt(),(document.activeElement==null||document.activeElement==document.body)&&r){let a=document.getElementById(r);rr(a)&&a.focus(),a&&a.id==n&&a.removeAttribute("id")}}async function zu(t){let[e,n]=await iu(t,()=>document.activeElement),s=e&&e.id;if(s){let i=document.getElementById(s);rr(i)&&i!=n&&i.focus()}}function Gu(t){for(let e of t){let n=Na(e.templateElement.content);if(n)return n}return null}var Gi=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let n=Xu(e);n&&Zu(n)&&(e.preventDefault(),this.receiveMessageResponse(n))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let n=await e.responseHTML;n&&this.receiveMessageHTML(n)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(ze.wrap(e))}};function Xu(t){let e=t.detail?.fetchResponse;if(e instanceof Mt)return e}function Zu(t){return(t.contentType??"").startsWith(ze.contentType)}var Xi=class extends nn{static renderElement(e,n){let{documentElement:s,body:i}=document;s.replaceChild(n,i)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:n}=document;e.replaceChild(this.newHead,n),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let n=e.parentNode;if(n){let s=en(e);n.replaceChild(s,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},Ot=class extends nn{static renderElement(e,n){document.body&&n instanceof HTMLBodyElement?document.body.replaceWith(n):document.documentElement.appendChild(n)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{dir:n,lang:s}=this.newSnapshot;s?e.setAttribute("lang",s):e.removeAttribute("lang"),n?e.setAttribute("dir",n):e.removeAttribute("dir")}async mergeHead(){let e=this.mergeProvisionalElements(),n=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await n,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let n of this.newHeadStylesheetElements)e.push(tu(n)),document.head.appendChild(n);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(en(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let n of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(n,e)||document.head.removeChild(n);for(let n of e)document.head.appendChild(n)}isCurrentElementInElementList(e,n){for(let[s,i]of n.entries()){if(e.tagName=="TITLE"){if(i.tagName!="TITLE")continue;if(e.innerHTML==i.innerHTML)return n.splice(s,1),!0}if(i.isEqualNode(e))return n.splice(s,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.removeNoscriptElements(),this.activateNewBodyScriptElements()}removeNoscriptElements(){for(let e of this.newElement.querySelectorAll("noscript"))e.remove()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let n=en(e);e.replaceWith(n)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},Qn=class extends Ot{static renderElement(e,n){sn(e,n,{callbacks:{beforeNodeMorphed:(s,i)=>Wa(s,i)&&!Ya(s)?(s.reload(),!1):!0}}),K("turbo:morph",{detail:{currentElement:e,newElement:n}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}},Zi=class extends Yn{constructor(e){super(e,Hn)}get snapshots(){return this.entries}},Qi=class extends Un{snapshotCache=new Zi(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,n=!1,s=!0,i){let o=this.isPageRefresh(i)&&(i?.refresh?.method||this.snapshot.refreshMethod)==="morph"?Qn:Ot,a=new o(this.snapshot,e,n,s);return a.shouldRender?i?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,n){n?.changeHistory();let s=new Xi(this.snapshot,e,!1);return this.render(s)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:n}=this;await Da();let s=e.clone();return this.snapshotCache.put(n,s),s}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&(e?.refresh?.scroll||this.snapshot.refreshScroll)==="preserve"}get snapshot(){return ge.fromElement(this.element)}},Ji=class{selector="a[data-turbo-preload]";constructor(e,n){this.delegate=e,this.snapshotCache=n}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let n of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(n)&&this.preloadURL(n)}async preloadURL(e){let n=new URL(e.href);if(this.snapshotCache.has(n))return;await new je(this,ue.get,n,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,n){try{let s=await n.responseHTML,i=ge.fromHTMLString(s);this.snapshotCache.put(e.url,i)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,n){}requestFailedWithResponse(e,n){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},er=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){su("turbo-cache-control",e)}},tr=class{navigator=new Ki(this);history=new Wi(this);view=new Qi(this,document.documentElement);adapter=new Vi(this);pageObserver=new Ui(this);cacheObserver=new Bi;linkPrefetchObserver=new Yi(this,document);linkClickObserver=new zn(this,window);formSubmitObserver=new tn(this,document);scrollObserver=new ji(this);streamObserver=new Gi(this);formLinkClickObserver=new Gn(this,document.documentElement);frameRedirector=new qi(this,document.documentElement);streamMessageRenderer=new zi;cache=new er(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new Ji(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,n={}){let s=n.frame?document.getElementById(n.frame):null;if(s instanceof de){let i=n.action||ht(s);s.delegate.proposeVisitIfNavigatedWithAction(s,i),s.src=e.toString()}else this.navigator.proposeVisit(ne(e),n)}refresh(e,n={}){n=typeof n=="string"?{requestId:n}:n;let{method:s,requestId:i,scroll:r}=n,o=i&&this.recentRequests.has(i),a=e===document.baseURI;!o&&!this.navigator.currentVisit&&a&&this.visit(e,{action:"replace",shouldCacheSnapshot:!1,refresh:{method:s,scroll:r}})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(ze.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=e}set progressBarDelay(e){Z.drive.progressBarDelay=e}get progressBarDelay(){return Z.drive.progressBarDelay}set drive(e){Z.drive.enabled=e}get drive(){return Z.drive.enabled}set formMode(e){Z.forms.mode=e}get formMode(){return Z.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=ru(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let n=e.hasAttribute("data-turbo-method"),s=e.hasAttribute("data-turbo-stream"),i=e.getAttribute("data-turbo-frame"),r=i=="_top"?null:document.getElementById(i)||Ct(e,"turbo-frame:not([disabled])");if(n||s||r instanceof de)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&Ye(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,n,s){this.enabled?this.navigator.startVisit(e,n,{action:"restore",historyChanged:!0,direction:s}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}historyPoppedWithEmptyState(e){this.history.replace(e),this.view.lastRenderedLocation=e,this.view.cacheSnapshot()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,n){return this.elementIsNavigatable(e)&&Ye(n,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,n){return this.elementIsNavigatable(e)&&Ye(n,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(n)}willFollowLinkToLocation(e,n,s){return this.elementIsNavigatable(e)&&Ye(n,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,n,s)}followedLinkToLocation(e,n){let s=this.getActionForLink(e),i=e.hasAttribute("data-turbo-stream");this.visit(n.href,{action:s,acceptsStreamResponse:i})}allowsVisitingLocationWithAction(e,n){return this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,n){Ta(e),this.adapter.visitProposedToLocation(e,n)}visitStarted(e){e.acceptsStreamResponse||(Bn(document.documentElement),this.view.markVisitDirection(e.direction)),Ta(e.location),this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),qn(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}willSubmitForm(e,n){let s=or(e,n);return this.submissionIsNavigatable(e,n)&&Ye(ne(s),this.snapshot.rootLocation)}formSubmitted(e,n){this.navigator.submitForm(e,n)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},n){let s=this.notifyApplicationBeforeRender(e,n),{defaultPrevented:i,detail:{render:r}}=s;return this.view.renderer&&r&&(this.view.renderer.renderElement=r),!i}viewRenderedSnapshot(e,n,s){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(s)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,n){this.notifyApplicationAfterFrameRender(e,n)}applicationAllowsFollowingLinkToLocation(e,n,s){return!this.notifyApplicationAfterClickingLinkToLocation(e,n,s).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,n,s){return K("turbo:click",{target:e,detail:{url:n.href,originalEvent:s},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return K("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,n){return K("turbo:visit",{detail:{url:e.href,action:n}})}notifyApplicationBeforeCachingSnapshot(){return K("turbo:before-cache")}notifyApplicationBeforeRender(e,n){return K("turbo:before-render",{detail:{newBody:e,...n},cancelable:!0})}notifyApplicationAfterRender(e){return K("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return K("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterFrameLoad(e){return K("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,n){return K("turbo:frame-render",{detail:{fetchResponse:e},target:n,cancelable:!0})}submissionIsNavigatable(e,n){if(Z.forms.mode=="off")return!1;{let s=n?this.elementIsNavigatable(n):!0;return Z.forms.mode=="optin"?s&&e.closest('[data-turbo="true"]')!=null:s&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let n=Ct(e,"[data-turbo]"),s=Ct(e,"turbo-frame");return Z.drive.enabled||s?n?n.getAttribute("data-turbo")!="false":!0:n?n.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return ht(e)||"advance"}get snapshot(){return this.view.snapshot}};function Ta(t){Object.defineProperties(t,Qu)}var Qu={absoluteURL:{get(){return this.toString()}}},z=new tr(Fa),{cache:Ka,navigator:Ua}=z;function lr(){z.start()}function ja(t){z.registerAdapter(t)}function za(t,e){z.visit(t,e)}function rn(t){z.connectStreamSource(t)}function on(t){z.disconnectStreamSource(t)}function Ga(t){z.renderStreamMessage(t)}function Xa(t){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Z.drive.progressBarDelay=t}function Za(t){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Z.forms.confirm=t}function Qa(t){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Z.forms.mode=t}function Ja(t,e){Qn.renderElement(t,e)}function el(t,e){Zn.renderElement(t,e)}var Ju=Object.freeze({__proto__:null,PageRenderer:Ot,PageSnapshot:ge,FrameRenderer:Lt,fetch:ar,config:Z,session:z,cache:Ka,navigator:Ua,start:lr,registerAdapter:ja,visit:za,connectStreamSource:rn,disconnectStreamSource:on,renderStreamMessage:Ga,setProgressBarDelay:Xa,setConfirmMethod:Za,setFormMode:Qa,morphBodyElements:Ja,morphTurboFrameElements:el,morphChildren:ss,morphElements:sn}),nr=class extends Error{},sr=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#n=!1;#i=!1;#s=new Set;#o=!1;action=null;constructor(e){this.element=e,this.view=new ki(this,this.element),this.appearanceObserver=new Ni(this,this.element),this.formLinkClickObserver=new Gn(this,this.element),this.linkInterceptor=new jn(this,this.element),this.restorationIdentifier=Ue(),this.formSubmitObserver=new tn(this,this.element)}connect(){this.#n||(this.#n=!0,this.loadingStyle==ct.lazy?this.appearanceObserver.start():this.#r(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#n&&(this.#n=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop(),this.element.hasAttribute("recurse")||this.#e?.cancel())}disabledChanged(){this.disabled?this.#e?.cancel():this.loadingStyle==ct.eager&&this.#r()}sourceURLChanged(){this.#_("src")||(this.sourceURL||this.#e?.cancel(),this.element.isConnected&&(this.complete=!1),(this.loadingStyle==ct.eager||this.#i)&&this.#r())}sourceURLReloaded(){let{refresh:e,src:n}=this.element;return this.#o=n&&e==="morph",this.element.removeAttribute("complete"),this.element.src=null,this.element.src=n,this.element.loaded}loadingStyleChanged(){this.loadingStyle==ct.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#d(ne(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#i=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let n=await e.responseHTML;if(n){let s=Ma(n);ge.fromDocument(s).isVisitable?await this.#l(e,s):await this.#f(e)}}finally{this.#o=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,ht(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#c(e)}submittedFormLinkToLocation(e,n,s){let i=this.#a(e);i&&s.setAttribute("data-turbo-frame",i.id)}shouldInterceptLinkClick(e,n,s){return this.#c(e)}linkClickIntercepted(e,n){this.#m(e,n)}willSubmitForm(e,n){return e.closest("turbo-frame")==this.element&&this.#c(e,n)}formSubmitted(e,n){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new Kn(this,e,n);let{fetchRequest:s}=this.formSubmission,i=this.#a(e,n);this.prepareRequest(s,i),this.formSubmission.start()}prepareRequest(e,n=this){e.headers["Turbo-Frame"]=n.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(ze.contentType)}requestStarted(e){Bn(this.element)}requestPreventedHandlingResponse(e,n){this.#t()}async requestSucceededWithResponse(e,n){await this.loadResponse(n),this.#t()}async requestFailedWithResponse(e,n){await this.loadResponse(n),this.#t()}requestErrored(e,n){console.error(n),this.#t()}requestFinished(e){qn(this.element)}formSubmissionStarted({formElement:e}){Bn(e,this.#a(e))}formSubmissionSucceededWithResponse(e,n){let s=this.#a(e.formElement,e.submitter);s.delegate.proposeVisitIfNavigatedWithAction(s,ht(e.submitter,e.formElement,s)),s.delegate.loadResponse(n),e.isSafe||z.clearCache()}formSubmissionFailedWithResponse(e,n){this.element.delegate.loadResponse(n),z.clearCache()}formSubmissionErrored(e,n){console.error(n)}formSubmissionFinished({formElement:e}){qn(e,this.#a(e))}allowsImmediateRender({element:e},n){let s=K("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...n},cancelable:!0}),{defaultPrevented:i,detail:{render:r}}=s;return this.view.renderer&&r&&(this.view.renderer.renderElement=r),!i}viewRenderedSnapshot(e,n,s){}preloadOnLoadLinksForView(e){z.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,n){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let n=e.querySelector("#"+this.element.id);n&&this.previousFrameElement&&n.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#l(e,n){let s=await this.extractForeignFrameElement(n.body),i=this.#o?Zn:Lt;if(s){let r=new xt(s),o=new i(this,this.view.snapshot,r,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(o),this.complete=!0,z.frameRendered(e,this.element),z.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#p(e)&&this.#g(e)}async#d(e){let n=new je(this,ue.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=n,new Promise(s=>{this.#t=()=>{this.#t=()=>{},this.#e=null,s()},n.perform()})}#m(e,n,s){let i=this.#a(e,s);i.delegate.proposeVisitIfNavigatedWithAction(i,ht(s,e,i)),this.#E(e,()=>{i.src=n})}proposeVisitIfNavigatedWithAction(e,n=null){if(this.action=n,this.action){let s=ge.fromElement(e).clone(),{visitCachedSnapshot:i}=e.delegate;e.delegate.fetchResponseLoaded=async r=>{if(e.src){let{statusCode:o,redirected:a}=r,l=await r.responseHTML,h={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:i,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:s};this.action&&(h.action=this.action),z.visit(e.src,h)}}}}changeHistory(){if(this.action){let e=La(this.action);z.history.update(e,ne(this.element.src||""),this.restorationIdentifier)}}async#f(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#h(e.response)}#p(e){this.element.setAttribute("complete","");let n=e.response,s=async(r,o)=>{r instanceof Response?this.#h(r):z.visit(r,o)};return!K("turbo:frame-missing",{target:this.element,detail:{response:n,visit:s},cancelable:!0}).defaultPrevented}#g(e){this.view.missing(),this.#b(e)}#b(e){let n=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new nr(n)}async#h(e){let n=new Mt(e),s=await n.responseHTML,{location:i,redirected:r,statusCode:o}=n;return z.visit(i,{response:{redirected:r,statusCode:o,responseHTML:s}})}#a(e,n){let s=Vn("data-turbo-frame",n,e)||this.element.getAttribute("target"),i=this.#u(s);return i instanceof de?i:this.element}async extractForeignFrameElement(e){let n,s=CSS.escape(this.id);try{if(n=Aa(e.querySelector(`turbo-frame#${s}`),this.sourceURL),n)return n;if(n=Aa(e.querySelector(`turbo-frame[src][recurse~=${s}]`),this.sourceURL),n)return await n.loaded,await this.extractForeignFrameElement(n)}catch(i){return console.error(i),new de}return null}#v(e,n){let s=or(e,n);return Ye(ne(s),this.rootLocation)}#c(e,n){let s=Vn("data-turbo-frame",n,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#v(e,n)||!this.enabled||s=="_top")return!1;if(s){let i=this.#u(s);if(i)return!i.disabled;if(s=="_parent")return!1}return!(!z.elementIsNavigatable(e)||n&&!z.elementIsNavigatable(n))}get id(){return this.element.id}get disabled(){return this.element.disabled}get enabled(){return!this.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#y("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#n}get rootLocation(){let n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return ne(n)}#_(e){return this.#s.has(e)}#y(e,n){this.#s.add(e),n(),this.#s.delete(e)}#E(e,n){this.currentNavigationElement=e,n(),delete this.currentNavigationElement}#u(e){if(e!=null){let n=e==="_parent"?this.element.parentElement.closest("turbo-frame"):document.getElementById(e);if(n instanceof de)return n}}};function Aa(t,e){if(t){let n=t.getAttribute("src");if(n!=null&&e!=null&&Pa(n,e))throw new Error(`Matching <turbo-frame id="${t.id}"> element has a source URL which references itself`);if(t.ownerDocument!==document&&(t=document.importNode(t,!0)),t instanceof de)return t.connectedCallback(),t.disconnectedCallback(),t}}var cr={after(){this.removeDuplicateTargetSiblings(),this.targetElements.forEach(t=>t.parentElement?.insertBefore(this.templateContent,t.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(t=>t.append(this.templateContent))},before(){this.removeDuplicateTargetSiblings(),this.targetElements.forEach(t=>t.parentElement?.insertBefore(this.templateContent,t))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(t=>t.prepend(this.templateContent))},remove(){this.targetElements.forEach(t=>t.remove())},replace(){let t=this.getAttribute("method");this.targetElements.forEach(e=>{t==="morph"?sn(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){let t=this.getAttribute("method");this.targetElements.forEach(e=>{t==="morph"?ss(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){let t=this.getAttribute("method"),e=this.requestId,n=this.getAttribute("scroll");z.refresh(this.baseURI,{method:t,requestId:e,scroll:n})}},Jn=class t extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await Qt(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(s=>[...s.children]).filter(s=>!!s.getAttribute("id")),n=[...this.templateContent?.children||[]].filter(s=>!!s.getAttribute("id")).map(s=>s.getAttribute("id"));return e.filter(s=>n.includes(s.getAttribute("id")))}removeDuplicateTargetSiblings(){this.duplicateSiblings.forEach(e=>e.remove())}get duplicateSiblings(){let e=this.targetElements.flatMap(s=>[...s.parentElement.children]).filter(s=>!!s.id),n=[...this.templateContent?.children||[]].filter(s=>!!s.id).map(s=>s.id);return e.filter(s=>n.includes(s.id))}get performAction(){if(this.action){let e=cr[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:t.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},es=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),rn(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),on(this.streamSource))}get src(){return this.getAttribute("src")||""}};de.delegateConstructor=sr;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",de);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",Jn);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",es);(()=>{let t=document.currentScript;if(!t||t.hasAttribute("data-turbo-suppress-warning"))return;let e=t.parentElement;for(;e;){if(e==document.body)return console.warn(xa`
18
+ You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
19
+
20
+ Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
21
+
22
+ For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
23
+
24
+ ——
25
+ Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
26
+ `,t.outerHTML);e=e.parentElement}})();window.Turbo={...Ju,StreamActions:cr};lr();var al;async function sd(){return al||ol(id().then(ol))}function ol(t){return al=t}async function id(){let{createConsumer:t}=await Promise.resolve().then(()=>(rl(),il));return t()}async function ll(t,e){let{subscriptions:n}=await sd();return n.create(t,e)}function dn(t){return!t||typeof t!="object"||t instanceof Date||t instanceof RegExp?t:Array.isArray(t)?t.map(dn):Object.keys(t).reduce(function(e,n){var s=n[0].toLowerCase()+n.slice(1).replace(/([A-Z]+)/g,function(i,r){return"_"+r.toLowerCase()});return e[s]=dn(t[n]),e},{})}var yr=class extends HTMLElement{static observedAttributes=["channel","signed-stream-name"];async connectedCallback(){rn(this),this.subscription=await ll(this.channel,{received:this.dispatchMessageEvent.bind(this),connected:this.subscriptionConnected.bind(this),disconnected:this.subscriptionDisconnected.bind(this)})}disconnectedCallback(){on(this),this.subscription&&this.subscription.unsubscribe(),this.subscriptionDisconnected()}attributeChangedCallback(){this.subscription&&(this.disconnectedCallback(),this.connectedCallback())}dispatchMessageEvent(e){let n=new MessageEvent("message",{data:e});return this.dispatchEvent(n)}subscriptionConnected(){this.setAttribute("connected","")}subscriptionDisconnected(){this.removeAttribute("connected")}get channel(){let e=this.getAttribute("channel"),n=this.getAttribute("signed-stream-name");return{channel:e,signed_stream_name:n,...dn({...this.dataset})}}};customElements.get("turbo-cable-stream-source")===void 0&&customElements.define("turbo-cable-stream-source",yr);function cl(t){if(t.target instanceof HTMLFormElement){let{target:e,detail:{fetchOptions:n}}=t;e.addEventListener("turbo:submit-start",({detail:{formSubmission:{submitter:s}}})=>{let i=ld(n.body)?n.body:new URLSearchParams,r=od(s,i,e);/get/i.test(r)||(/post/i.test(r)?i.delete("_method"):i.set("_method",r),n.method="post")},{once:!0})}}function od(t,e,n){let s=ad(t),i=e.get("_method"),r=n.getAttribute("method")||"get";return typeof s=="string"?s:typeof i=="string"?i:r}function ad(t){return t instanceof HTMLButtonElement||t instanceof HTMLInputElement?t.name==="_method"?t.value:t.hasAttribute("formmethod")?t.formMethod:null:null}function ld(t){return t instanceof FormData||t instanceof URLSearchParams}window.Turbo=hr;addEventListener("turbo:before-fetch-request",cl);var Ae=new Map,Pt={set(t,e,n){Ae.has(t)||Ae.set(t,new Map);let s=Ae.get(t);s.has(e)||s.size===0?s.set(e,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${[...s.keys()][0]}.`)},get:(t,e)=>t&&Ae.has(t)&&Ae.get(t).get(e)||null,getAny:t=>t&&Ae.has(t)&&Ae.get(t).values().next().value||null,remove(t,e){if(!Ae.has(t))return;let n=Ae.get(t);n.delete(e),n.size===0&&Ae.delete(t)}},cd=/[^.]*(?=\..*)\.|.*/,hd=/\..*/,ud=/::\d+$/,Er={},hl=1,_s={mouseenter:"mouseover",mouseleave:"mouseout"},dd=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll","scrollend"]);function cc(t,e){return e&&`${e}::${hl++}`||t.uidEvent||hl++}function hc(t){let e=cc(t);return t.uidEvent=e,Er[e]=Er[e]||{},Er[e]}function uc(t){let{delegateTarget:e,relatedTarget:n}=t;return!!(n&&e.contains(n))}function md(t,e,n){let s=n in _s;return function i(r){let o=oo(r,{delegateTarget:t});if(!s||!uc(o))return i.oneOff&&d.off(t,n,e),e.apply(t,[o])}}function fd(t,e,n,s){let i=s in _s;return function r(o){let a=t.querySelectorAll(e);for(let{target:l}=o;l&&l!==this;l=l.parentNode)for(let c of a){if(c!==l)continue;let h=oo(o,{delegateTarget:l});return i&&uc(h)?void 0:(r.oneOff&&d.off(t,s,e,n),n.apply(l,[h]))}}}function dc(t,e,n,s=null){return Object.values(t).find(i=>i.callable===e&&i.handlerTypeEvent===n&&i.delegationSelector===s)}function mc(t,e,n){let s=typeof e=="string",i=s?n:e||n,r=t.replace(hd,""),o=_s[r]||r;return dd.has(o)||(o=t),{isDelegated:s,callable:i,typeEvent:o,handlerTypeEvent:r in _s?r:o}}function ul(t,e,n,s,i){if(typeof e!="string"||!t)return;let{isDelegated:r,callable:o,typeEvent:a,handlerTypeEvent:l}=mc(e,n,s),c=hc(t),h=c[a]||(c[a]={}),u=dc(h,o,l,r?n:null);if(u)return void(u.oneOff=u.oneOff&&i);let m=cc(o,e.replace(cd,"")),f=r?fd(t,n,o,l):md(t,o,l);f.delegationSelector=r?n:null,f.callable=o,f.handlerTypeEvent=l,f.oneOff=i,f.uidEvent=m,h[m]=f,t.addEventListener(a,f,r)}function Br(t,e,n,s){t.removeEventListener(n,s,!!s.delegationSelector),delete e[n][s.uidEvent]}function pd(t,e,n,s){let i=e[n]||{};for(let[r,o]of Object.entries(i))r.includes(s)&&Br(t,e,n,o)}function gd(t,e,n){if(typeof e!="string"||!t)return null;let s=oo(new Event(e,{bubbles:!0,cancelable:!0}),n);return t.dispatchEvent(s),s}var d={on(t,e,n,s){ul(t,e,n,s,!1)},one(t,e,n,s){ul(t,e,n,s,!0)},off(t,e,n,s){if(typeof e!="string"||!t)return;let{isDelegated:i,callable:r,typeEvent:o,handlerTypeEvent:a}=mc(e,n,s),l=o!==e&&a!==e,c=hc(t),h=c[o]||{},u=e.startsWith(".");if(r!==void 0){if(!Object.keys(h).length)return;let m=dc(h,r,a,i?n:null);return void(m&&Br(t,c,o,m))}if(u)for(let m of Object.keys(c))pd(t,c,m,e.slice(1));for(let[m,f]of Object.entries(h)){let g=m.replace(ud,"");f.handlerTypeEvent!==a||l&&!e.includes(g)||Br(t,c,o,f)}},trigger:gd};function oo(t,e={}){for(let[n,s]of Object.entries(e))try{t[n]=s}catch{Object.defineProperty(t,n,{configurable:!0,get:()=>s})}return t}function dl(t){if(t==="true")return!0;if(t==="false")return!1;if(t===Number(t).toString())return Number(t);if(t===""||t==="null")return null;if(typeof t!="string")return t;try{return JSON.parse(decodeURIComponent(t))}catch{return t}}function wr(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var Ce={setDataAttribute(t,e,n){t.setAttribute(`data-bs-${wr(e)}`,n)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${wr(e)}`)},getDataAttributes(t){if(!t)return{};let e={},n=Object.keys(t.dataset).filter(s=>s.startsWith("bs")&&!s.startsWith("bsConfig"));for(let s of n){let i=s.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=dl(t.dataset[s])}return e},getDataAttribute:(t,e)=>dl(t.getAttribute(`data-bs-${wr(e)}`))};var qr="transitionend",fc=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(e,n)=>`#${CSS.escape(n)}`)),t),bd=t=>t==null?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),vd=t=>{do t+=Math.floor(1e6*Math.random());while(document.getElementById(t));return t},_d=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:n}=window.getComputedStyle(t);return Number.parseFloat(e)||Number.parseFloat(n)?(e=e.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(n))):0},yd=t=>{t.dispatchEvent(new Event(qr))},ke=t=>!(!t||typeof t!="object")&&t.nodeType!==void 0,Re=t=>ke(t)?t:typeof t=="string"&&t.length>0?document.querySelector(fc(t)):null,Je=t=>{if(!ke(t)||t.getClientRects().length===0)return!1;let e=getComputedStyle(t).getPropertyValue("visibility")==="visible",n=t.closest("details:not([open])");if(!n)return e;if(n!==t){let s=t.closest("summary");if(s&&s.parentNode!==n||s===null)return!1}return e},be=t=>{if(!t||t.nodeType!==Node.ELEMENT_NODE||t.classList.contains("disabled"))return!0;let e=t;return e.disabled!==void 0?e.disabled:t.hasAttribute("disabled")&&t.getAttribute("disabled")!=="false"},gt=(t,e,n)=>{t.setAttribute(e,String(n))},pc=t=>{if(!document.documentElement.attachShadow)return null;if(typeof t.getRootNode=="function"){let e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?pc(t.parentNode):null},ys=()=>{},gc=t=>{t.offsetHeight},De=()=>document.documentElement.dir==="rtl",Me=(t,e=[],n=t)=>typeof t=="function"?t.call(...e):n,Ed=(t,e,n=!0)=>{if(!n)return void Me(t);let s=_d(e)+5,i=!1,r=({target:o})=>{o===e&&(i=!0,e.removeEventListener(qr,r),Me(t))};e.addEventListener(qr,r),setTimeout(()=>{i||yd(e)},s)},ao=(t,e,n,s)=>{let i=t.length,r=t.indexOf(e);return r===-1?!n&&s?t[i-1]:t[0]:(r+=n?1:-1,s&&(r=(r+i)%i),t[Math.max(0,Math.min(r,i-1))])},lo=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){let n=ke(e)?Ce.getDataAttribute(e,"config"):{};return{...this.constructor.Default,...typeof n=="object"?n:{},...ke(e)?Ce.getDataAttributes(e):{},...typeof t=="object"?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(let[n,s]of Object.entries(e)){let i=t[n],r=ke(i)?"element":bd(i);if(!new RegExp(s).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${r}" but expected type "${s}".`)}}},wd="6.0.0-alpha1",te=class extends lo{constructor(t,e){if(super(),!(t=Re(t)))return;this._element=t,this._config=this._getConfig(e);let n=Pt.get(this._element,this.constructor.DATA_KEY);n&&n.dispose(),Pt.set(this._element,this.constructor.DATA_KEY,this)}dispose(){Pt.remove(this._element,this.constructor.DATA_KEY),d.off(this._element,this.constructor.EVENT_KEY);for(let t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,n=!0){Ed(()=>{this._element&&t()},e,n)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return Pt.get(Re(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,typeof e=="object"?e:null)}static get VERSION(){return wd}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}},Sr=t=>{let e=t.getAttribute("data-bs-target");if(!e||e==="#"){let n=t.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),e=n&&n!=="#"?n.trim():null}return e?e.split(",").map(n=>fc(n)).join(","):null},y={find:(t,e=document.documentElement)=>[...Element.prototype.querySelectorAll.call(e,t)],findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[...t.children].filter(n=>n.matches(e)),parents(t,e){let n=[],s=t.parentNode.closest(e);for(;s;)n.push(s),s=s.parentNode.closest(e);return n},closest:(t,e)=>Element.prototype.closest.call(t,e),prev(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return[n];n=n.previousElementSibling}return[]},next(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return[n];n=n.nextElementSibling}return[]},focusableChildren(t){let e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(n=>`${n}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(n=>!be(n)&&Je(n))},getSelectorFromElement(t){let e=Sr(t);return e&&y.findOne(e)?e:null},getElementFromSelector(t){let e=Sr(t);return e?y.findOne(e):null},getMultipleElementsFromSelector(t){let e=Sr(t);return e?y.find(e):[]}},Ls=(t,e="hide")=>{let n=`click.dismiss${t.EVENT_KEY}`,s=t.NAME;d.on(document,n,`[data-bs-dismiss="${s}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),be(this))return;let r=y.getElementFromSelector(this)||this.closest(`.${s}`);t.getOrCreateInstance(r)[e]()})},Sd=(t,e,n,s,i=null)=>{Td(`${e}.${t.NAME}`,n,r=>{let o=r.targets.filter(Boolean).map(a=>t.getOrCreateInstance(a));typeof i=="function"&&i({...r,instances:o});for(let a of o)a[s]()})},Td=(t,e,n)=>{let s=`${e}:not(.disabled):not(:disabled)`;d.on(document,t,s,function(i){["A","AREA"].includes(this.tagName)&&i.preventDefault();let r=y.getSelectorFromElement(this);n({targets:r?y.find(r):[this],event:i})})};var Ad="close.bs.alert",Cd="closed.bs.alert";var Dd=class extends te{static get NAME(){return"alert"}close(){if(d.trigger(this._element,Ad).defaultPrevented)return;this._element.classList.remove("show");let t=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),d.trigger(this._element,Cd),this.dispose()}};Ls(Dd,"close");var Md="button";var ml='[data-bs-toggle="button"]',xd="click.bs.button.data-api",Ld=class extends te{static get NAME(){return Md}toggle(){gt(this._element,"aria-pressed",this._element.classList.toggle("active"))}};d.on(document,xd,ml,t=>{t.preventDefault();let e=t.target.closest(ml);Ld.getOrCreateInstance(e).toggle()});var Od="carousel",$e=".bs.carousel";var Nd="ArrowLeft",Id="ArrowRight";var fl=`slide${$e}`,pl=`slid${$e}`,kd=`keydown${$e}`,Rd=`mouseenter${$e}`,Pd=`mouseleave${$e}`,Fd=`pointerdown${$e}`,$d=`load${$e}.data-api`,gl=`click${$e}.data-api`;var Wr="carousel-item-clone";var Hd="--bs-carousel-interval";var bc=`.carousel-item:not(.${Wr})`,Vd=".active"+bc,Bd=".carousel-inner",qd=".carousel-indicators",vc=".carousel-control-play-pause",Wd="[data-bs-slide], [data-bs-slide-to]";var Yd='[data-bs-autoplay="true"]',Kd={[Nd]:"right",[Id]:"left"},bl="stop",vl="wrap",gs="loop",_l={autoplay:!1,ends:gs,interval:5e3,keyboard:!0,pause:"hover"},Ud={autoplay:"boolean",ends:"string",interval:"number",keyboard:"boolean",pause:"(string|boolean)"},jd=t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2,Tr=class extends te{constructor(t,e){super(t,e),this._viewport=y.findOne(Bd,this._element)||this._element,this._indicatorsElement=y.findOne(qd,this._element),this._playPauseElement=y.findOne(vc,this._element),this._prevControls=y.find('[data-bs-slide="prev"]',this._element),this._nextControls=y.find('[data-bs-slide="next"]',this._element),this._interval=null,this._observer=null,this._scrollFrame=null,this._looping=!1,this._visibility=new Map,this._playing=this._config.autoplay,this._activeIndex=this._initialActiveIndex(),this._addEventListeners(),this._observeItems(),this._refreshActiveState(),this._playing&&this.cycle(),this._updatePlayPauseControl()}static get Default(){return _l}static get DefaultType(){return Ud}static get NAME(){return Od}next(){this.to(this._navIndex()+1)}nextWhenVisible(){document.visibilityState==="visible"&&Je(this._element)&&this.next()}prev(){this.to(this._navIndex()-1)}pause(){this._clearInterval(),this._element.classList.remove("carousel-playing")}cycle(){this._clearInterval(),this._scheduleAutoplay(),this._element.classList.add("carousel-playing")}to(t){if(this._looping)return;let e=this._getItems(),n=Number.parseInt(t,10);if(this._config.ends===gs&&!this._prefersReducedMotion()&&this._canLoop()){if(n>e.length-1)return void this._loopTransition(!0);if(n<0)return void this._loopTransition(!1)}let s=this._normalizeIndex(n,e.length),i=this._navIndex();s!==null&&s!==i&&(d.trigger(this._element,fl,{relatedTarget:e[s],direction:this._direction(i,s),from:i,to:s}).defaultPrevented||(this._isFade()?this._fadeTo(s):this._scrollToIndex(s)))}dispose(){this._clearInterval(),this._observer&&this._observer.disconnect(),this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame);for(let t of y.find(`.${Wr}`,this._viewport))t.remove();this._viewport.style.scrollSnapType="",d.off(this._viewport,$e),super.dispose()}_configAfterMerge(t){return[bl,vl,gs].includes(t.ends)||(t.ends=_l.ends),t}_initialActiveIndex(){let t=y.findOne(Vd,this._element),e=t?this._getItems().indexOf(t):0;return Math.max(e,0)}_addEventListeners(){this._config.keyboard&&d.on(this._element,kd,t=>this._keydown(t)),this._config.pause==="hover"&&(d.on(this._element,Rd,()=>this.pause()),d.on(this._element,Pd,()=>this._maybeEnableCycle())),d.on(this._viewport,Fd,()=>this._pauseFromInteraction())}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;let e=Kd[t.key];e&&(t.preventDefault(),this._pauseFromInteraction(),e==="right"?this.prev():this.next())}_observeItems(){if(!this._isFade()&&typeof IntersectionObserver<"u"){this._observer=new IntersectionObserver(t=>this._handleIntersection(t),{root:this._viewport,threshold:[0,.25,.5,.75,1]});for(let t of this._getItems())this._observer.observe(t)}}_handleIntersection(t){if(this._looping)return;for(let i of t)this._visibility.set(i.target,i.isIntersecting?i.intersectionRatio:0);let e=this._getItems().map(i=>this._visibility.get(i)??0),n=Math.max(...e),s=this._activeIndex;n>0&&(s=e.findIndex(i=>i>=n-.05)),this._setActive(s),this._updateEndControls()}_navIndex(){if(this._isFade()||this._viewport.scrollWidth-this._viewport.clientWidth<=0)return this._activeIndex;let t=this._activeIndex,e=Number.POSITIVE_INFINITY;for(let[n,s]of this._getItems().entries()){let i=Math.abs(this._scrollDelta(s));i<e&&(e=i,t=n)}return t}_scrollToIndex(t){let e=this._getItems()[t];if(!e)return;let n=this._scrollDelta(e);if(Math.abs(n)<1)return;let s=this._viewport.scrollLeft+n;this._viewport.style.scrollSnapType="none",this._animateScroll(s,()=>{this._viewport.style.scrollSnapType="",this._observer||this._setActive(t),this._updateEndControls()})}_animateScroll(t,e){this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null);let n=this._viewport.scrollLeft,s=t-n;if(this._prefersReducedMotion()||typeof requestAnimationFrame>"u")return this._viewport.scrollTo({left:t,behavior:"instant"}),void e();let i=null,r=o=>{i===null&&(i=o);let a=Math.min((o-i)/300,1);this._viewport.scrollTo({left:n+s*jd(a),behavior:"instant"}),a<1?this._scrollFrame=requestAnimationFrame(r):(this._viewport.scrollTo({left:t,behavior:"instant"}),this._scrollFrame=null,e())};this._scrollFrame=requestAnimationFrame(r)}_scrollDelta(t){let e=this._viewport.getBoundingClientRect(),n=t.getBoundingClientRect();if(this._element.classList.contains("carousel-center"))return n.left+n.width/2-(e.left+e.width/2);let s=Number.parseFloat(getComputedStyle(this._viewport).scrollPaddingInlineStart)||0;return De()?n.right-(e.right-s):n.left-(e.left+s)}_loopTransition(t){let e=this._getItems(),n=e.length-1,s=this._activeIndex,i=t?0:n,r=this._loopDirection(t);if(d.trigger(this._element,fl,{relatedTarget:e[i],direction:r,from:s,to:i}).defaultPrevented)return;this._looping=!0;let o=(t?e[0]:e[n]).cloneNode(!0);o.classList.add(Wr),o.classList.remove("active"),o.removeAttribute("id");for(let a of y.find("[id]",o))a.removeAttribute("id");o.setAttribute("aria-hidden","true"),o.inert=!0,this._viewport.style.scrollSnapType="none",t?this._viewport.append(o):(this._viewport.prepend(o),this._jumpScroll(this._scrollDelta(e[s]))),this._animateScroll(this._viewport.scrollLeft+this._scrollDelta(o),()=>{o.remove(),this._jumpScroll(this._scrollDelta(e[i])),this._activeIndex=i,this._refreshActiveState(),d.trigger(this._element,pl,{relatedTarget:e[i],direction:r,from:s,to:i}),this._viewport.style.scrollSnapType="",this._looping=!1})}_loopDirection(t){return De()?t?"right":"left":t?"left":"right"}_jumpScroll(t){this._viewport.style.scrollSnapType="none",this._viewport.scrollBy({left:t,top:0,behavior:"instant"})}_fadeTo(t){this._setActive(t)}_setActive(t){let e=this._getItems();if(t===this._activeIndex||!e[t])return;let n=this._activeIndex;this._activeIndex=t,this._refreshActiveState(),d.trigger(this._element,pl,{relatedTarget:e[t],direction:this._direction(n,t),from:n,to:t})}_refreshActiveState(){let t=this._getItems();for(let[e,n]of t.entries())n.classList.toggle("active",e===this._activeIndex);this._setActiveIndicatorElement(this._activeIndex),this._updateEndControls()}_updateEndControls(){if(this._config.ends!==bl)return;let t=this._viewport,e=t.scrollWidth-t.clientWidth,n,s;if(e>0){let i=Math.abs(t.scrollLeft);n=i<=1,s=i>=e-1}else{let i=this._getItems().length-1;n=this._activeIndex<=0,s=this._activeIndex>=i}this._setControlsDisabled(this._prevControls,n),this._setControlsDisabled(this._nextControls,s)}_setControlsDisabled(t,e){for(let n of t)e&&n===document.activeElement&&((t===this._prevControls?this._nextControls:this._prevControls)[0]??this._viewport).focus({preventScroll:!0}),n.disabled=e}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;let e=y.findOne(".active",this._indicatorsElement);e&&(e.classList.remove("active"),e.removeAttribute("aria-current"));let n=y.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);n&&(n.classList.add("active"),n.setAttribute("aria-current","true"))}_normalizeIndex(t,e){return Number.isNaN(t)||e===0?null:t<0?this._wrapsAround()?e-1:null:t>e-1?this._wrapsAround()?0:null:t}_wrapsAround(){return this._config.ends===vl||this._config.ends===gs}_canLoop(){if(this._isFade()||this._getItems().length<2)return!1;let t=getComputedStyle(this._element),e=n=>Number.parseFloat(t.getPropertyValue(n))||0;return(e("--bs-carousel-items")||1)===1&&e("--bs-carousel-items-peek")===0&&!this._element.classList.contains("carousel-center")&&!this._element.classList.contains("carousel-auto")}_direction(t,e){let n=e>t;return De()?n?"right":"left":n?"left":"right"}_scheduleAutoplay(t=this._activeIndex){let e=this._itemInterval(t);this._element.style.setProperty(Hd,`${e}ms`),this._interval=setTimeout(()=>{let n=this._upcomingIndex();this.nextWhenVisible(),n!==null?this._scheduleAutoplay(n):this.pause()},e)}_upcomingIndex(){return this._normalizeIndex(this._navIndex()+1,this._getItems().length)}_itemInterval(t=this._activeIndex){let e=this._getItems()[t],n=e?Number.parseInt(e.getAttribute("data-bs-interval"),10):NaN;return Number.isNaN(n)?this._config.interval:n}_maybeEnableCycle(){this._playing&&this.cycle()}_pauseFromInteraction(){this._playing=!1,this.pause(),this._updatePlayPauseControl()}_togglePlayPause(){this._playing?this._pauseFromInteraction():(this._playing=!0,this.cycle(),this._updatePlayPauseControl())}_updatePlayPauseControl(){if(!this._playPauseElement)return;this._playPauseElement.classList.toggle("paused",!this._playing);let t=this._playPauseElement.getAttribute(this._playing?"data-bs-pause-label":"data-bs-play-label");t&&this._playPauseElement.setAttribute("aria-label",t)}_isFade(){return this._element.classList.contains("carousel-fade")}_prefersReducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}_getItems(){return y.find(bc,this._element)}_clearInterval(){this._interval&&(clearTimeout(this._interval),this._interval=null)}};d.on(document,gl,Wd,function(t){let e=y.getElementFromSelector(this);if(!e||!e.classList.contains("carousel"))return;t.preventDefault();let n=Tr.getOrCreateInstance(e);n._pauseFromInteraction();let s=this.getAttribute("data-bs-slide-to");s?n.to(s):Ce.getDataAttribute(this,"slide")!=="next"?n.prev():n.next()}),d.on(document,gl,vc,function(t){let e=y.getElementFromSelector(this);e&&e.classList.contains("carousel")&&(t.preventDefault(),Tr.getOrCreateInstance(e)._togglePlayPause())}),d.on(window,$d,()=>{let t=y.find(Yd);for(let e of t)Tr.getOrCreateInstance(e)});var zd="collapse",yn=".bs.collapse";var Gd=`show${yn}`,Xd=`shown${yn}`,Zd=`hide${yn}`,Qd=`hidden${yn}`,Jd=`click${yn}.data-api`;var em=":scope .collapse .collapse";var tm="width",nm="height",sm=".collapse.show, .collapse.collapsing",Yr='[data-bs-toggle="collapse"]',im={parent:null,toggle:!0},rm={parent:"(null|element)",toggle:"boolean"},om=class _c extends te{constructor(e,n){super(e,n),this._isTransitioning=!1,this._triggerArray=[];let s=y.find(Yr);for(let i of s){let r=y.getSelectorFromElement(i),o=y.find(r).filter(a=>a===this._element);r!==null&&o.length&&this._triggerArray.push(i)}this._initializeChildren(),this._config.parent||this._setAriaExpanded(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return im}static get DefaultType(){return rm}static get NAME(){return zd}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(sm).filter(i=>i!==this._element).map(i=>_c.getOrCreateInstance(i,{toggle:!1}))),e.length&&e[0]._isTransitioning||d.trigger(this._element,Gd).defaultPrevented)return;for(let i of e)i.hide();let n=this._getDimension();this._element.classList.remove("collapse"),this._element.classList.add("collapsing"),this._element.style[n]=0,this._setAriaExpanded(this._triggerArray,!0),this._isTransitioning=!0;let s=`scroll${n[0].toUpperCase()+n.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse","show"),this._element.style[n]="",d.trigger(this._element,Xd)},this._element,!0),this._element.style[n]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown()||d.trigger(this._element,Zd).defaultPrevented)return;let e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,gc(this._element),this._element.classList.add("collapsing"),this._element.classList.remove("collapse","show");for(let n of this._triggerArray){let s=y.getElementFromSelector(n);s&&!this._isShown(s)&&this._setAriaExpanded([n],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse"),d.trigger(this._element,Qd)},this._element,!0)}_isShown(e=this._element){return e.classList.contains("show")}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=Re(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?tm:nm}_initializeChildren(){if(!this._config.parent)return;let e=this._getFirstLevelChildren(Yr);for(let n of e){let s=y.getElementFromSelector(n);s&&this._setAriaExpanded([n],this._isShown(s))}}_getFirstLevelChildren(e){let n=y.find(em,this._config.parent);return y.find(e,this._config.parent).filter(s=>!n.includes(s))}_setAriaExpanded(e,n){if(e.length)for(let s of e)gt(s,"aria-expanded",n)}};d.on(document,Jd,Yr,function(t){(t.target.tagName==="A"||t.delegateTarget&&t.delegateTarget.tagName==="A")&&t.preventDefault();for(let e of y.getMultipleElementsFromSelector(this))om.getOrCreateInstance(e,{toggle:!1}).toggle()});var Vt=Math.min,bt=Math.max,Es=Math.round,cs=Math.floor,xe=t=>({x:t,y:t}),am={left:"right",right:"left",bottom:"top",top:"bottom"};function Kr(t,e,n){return bt(t,Vt(e,n))}function En(t,e){return typeof t=="function"?t(e):t}function vt(t){return t.split("-")[0]}function wn(t){return t.split("-")[1]}function yc(t){return t==="x"?"y":"x"}function co(t){return t==="y"?"height":"width"}function Ze(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function ho(t){return yc(Ze(t))}function lm(t,e,n){n===void 0&&(n=!1);let s=wn(t),i=ho(t),r=co(i),o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=ws(o)),[o,ws(o)]}function cm(t){let e=ws(t);return[Ur(t),e,Ur(e)]}function Ur(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var yl=["left","right"],El=["right","left"],hm=["top","bottom"],um=["bottom","top"];function dm(t,e,n){switch(t){case"top":case"bottom":return n?e?El:yl:e?yl:El;case"left":case"right":return e?hm:um;default:return[]}}function mm(t,e,n,s){let i=wn(t),r=dm(vt(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Ur)))),r}function ws(t){let e=vt(t);return am[e]+t.slice(e.length)}function fm(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ec(t){return typeof t!="number"?fm(t):{top:t,right:t,bottom:t,left:t}}function Ss(t){let{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function wl(t,e,n){let{reference:s,floating:i}=t,r=Ze(e),o=ho(e),a=co(o),l=vt(e),c=r==="y",h=s.x+s.width/2-i.width/2,u=s.y+s.height/2-i.height/2,m=s[a]/2-i[a]/2,f;switch(l){case"top":f={x:h,y:s.y-i.height};break;case"bottom":f={x:h,y:s.y+s.height};break;case"right":f={x:s.x+s.width,y:u};break;case"left":f={x:s.x-i.width,y:u};break;default:f={x:s.x,y:s.y}}switch(wn(e)){case"start":f[o]-=m*(n&&c?-1:1);break;case"end":f[o]+=m*(n&&c?-1:1)}return f}async function pm(t,e){var n;e===void 0&&(e={});let{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:m=!1,padding:f=0}=En(e,t),g=Ec(f),_=a[m?u==="floating"?"reference":"floating":u],S=Ss(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(_)))==null||n?_:_.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),C=u==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,p=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),w=await(r.isElement==null?void 0:r.isElement(p))&&await(r.getScale==null?void 0:r.getScale(p))||{x:1,y:1},b=Ss(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:p,strategy:l}):C);return{top:(S.top-b.top+g.top)/w.y,bottom:(b.bottom-S.bottom+g.bottom)/w.y,left:(S.left-b.left+g.left)/w.x,right:(b.right-S.right+g.right)/w.x}}var gm=async(t,e,n)=>{let{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:pm},l=await(o.isRTL==null?void 0:o.isRTL(e)),c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=wl(c,s,l),m=s,f=0,g={};for(let _=0;_<r.length;_++){let S=r[_];if(!S)continue;let{name:C,fn:p}=S,{x:w,y:b,data:v,reset:E}=await p({x:h,y:u,initialPlacement:s,placement:m,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:t,floating:e}});h=w??h,u=b??u,g[C]={...g[C],...v},E&&f<50&&(f++,typeof E=="object"&&(E.placement&&(m=E.placement),E.rects&&(c=E.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:h,y:u}=wl(c,m,l)),_=-1)}return{x:h,y:u,placement:m,strategy:i,middlewareData:g}},bm=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:s,placement:i,rects:r,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=En(t,e)||{};if(c==null)return{};let u=Ec(h),m={x:n,y:s},f=ho(i),g=co(f),_=await o.getDimensions(c),S=f==="y",C=S?"top":"left",p=S?"bottom":"right",w=S?"clientHeight":"clientWidth",b=r.reference[g]+r.reference[f]-m[f]-r.floating[g],v=m[f]-r.reference[f],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c)),T=E?E[w]:0;T&&await(o.isElement==null?void 0:o.isElement(E))||(T=a.floating[w]||r.floating[g]);let O=b/2-v/2,x=T/2-_[g]/2-1,N=Vt(u[C],x),$=Vt(u[p],x),Y=N,Q=T-_[g]-$,V=T/2-_[g]/2+O,he=Kr(Y,V,Q),J=!l.arrow&&wn(i)!=null&&V!==he&&r.reference[g]/2-(V<Y?N:$)-_[g]/2<0,ee=J?V<Y?V-Y:V-Q:0;return{[f]:m[f]+ee,data:{[f]:he,centerOffset:V-he-ee,...J&&{alignmentOffset:ee}},reset:J}}}),vm=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;let{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:_=!0,...S}=En(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};let C=vt(i),p=Ze(a),w=vt(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),v=m||(w||!_?[ws(a)]:cm(a)),E=g!=="none";!m&&E&&v.push(...mm(a,_,g,b));let T=[a,...v],O=await l.detectOverflow(e,S),x=[],N=((s=r.flip)==null?void 0:s.overflows)||[];if(h&&x.push(O[C]),u){let V=lm(i,o,b);x.push(O[V[0]],O[V[1]])}if(N=[...N,{placement:i,overflows:x}],!x.every(V=>V<=0)){var $,Y;let V=((($=r.flip)==null?void 0:$.index)||0)+1,he=T[V];if(he&&(u!=="alignment"||p===Ze(he)||N.every(ee=>Ze(ee.placement)!==p||ee.overflows[0]>0)))return{data:{index:V,overflows:N},reset:{placement:he}};let J=(Y=N.filter(ee=>ee.overflows[0]<=0).sort((ee,ae)=>ee.overflows[1]-ae.overflows[1])[0])==null?void 0:Y.placement;if(!J)switch(f){case"bestFit":{var Q;let ee=(Q=N.filter(ae=>{if(E){let Se=Ze(ae.placement);return Se===p||Se==="y"}return!0}).map(ae=>[ae.placement,ae.overflows.filter(Se=>Se>0).reduce((Se,ba)=>Se+ba,0)]).sort((ae,Se)=>ae[1]-Se[1])[0])==null?void 0:Q[0];ee&&(J=ee);break}case"initialPlacement":J=a}if(i!==J)return{reset:{placement:J}}}return{}}}},_m=new Set(["left","top"]);async function ym(t,e){let{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=vt(n),a=wn(n),l=Ze(n)==="y",c=_m.has(o)?-1:1,h=r&&l?-1:1,u=En(e,t),{mainAxis:m,crossAxis:f,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof g=="number"&&(f=a==="end"?-1*g:g),l?{x:f*h,y:m*c}:{x:m*c,y:f*h}}var Em=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;let{x:i,y:r,placement:o,middlewareData:a}=e,l=await ym(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},wm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:C=>{let{x:p,y:w}=C;return{x:p,y:w}}},...c}=En(t,e),h={x:n,y:s},u=await r.detectOverflow(e,c),m=Ze(vt(i)),f=yc(m),g=h[f],_=h[m];if(o){let C=f==="y"?"bottom":"right";g=Kr(g+u[f==="y"?"top":"left"],g,g-u[C])}if(a){let C=m==="y"?"bottom":"right";_=Kr(_+u[m==="y"?"top":"left"],_,_-u[C])}let S=l.fn({...e,[f]:g,[m]:_});return{...S,data:{x:S.x-n,y:S.y-s,enabled:{[f]:o,[m]:a}}}}}};function Os(){return typeof window<"u"}function Yt(t){return wc(t)?(t.nodeName||"").toLowerCase():"#document"}function me(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Le(t){var e;return(e=(wc(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function wc(t){return!!Os()&&(t instanceof Node||t instanceof me(t).Node)}function _e(t){return!!Os()&&(t instanceof Element||t instanceof me(t).Element)}function He(t){return!!Os()&&(t instanceof HTMLElement||t instanceof me(t).HTMLElement)}function Sl(t){return!(!Os()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof me(t).ShadowRoot)}function Sn(t){let{overflow:e,overflowX:n,overflowY:s,display:i}=ye(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function Sm(t){return/^(table|td|th)$/.test(Yt(t))}function Ns(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Tm=/transform|translate|scale|rotate|perspective|filter/,Am=/paint|layout|strict|content/,mt=t=>!!t&&t!=="none",Ar;function uo(t){let e=_e(t)?ye(t):t;return mt(e.transform)||mt(e.translate)||mt(e.scale)||mt(e.rotate)||mt(e.perspective)||!mo()&&(mt(e.backdropFilter)||mt(e.filter))||Tm.test(e.willChange||"")||Am.test(e.contain||"")}function Cm(t){let e=et(t);for(;He(e)&&!Bt(e);){if(uo(e))return e;if(Ns(e))return null;e=et(e)}return null}function mo(){return Ar==null&&(Ar=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ar}function Bt(t){return/^(html|body|#document)$/.test(Yt(t))}function ye(t){return me(t).getComputedStyle(t)}function Is(t){return _e(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function et(t){if(Yt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Sl(t)&&t.host||Le(t);return Sl(e)?e.host:e}function Sc(t){let e=et(t);return Bt(e)?t.ownerDocument?t.ownerDocument.body:t.body:He(e)&&Sn(e)?e:Sc(e)}function bn(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Sc(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=me(i);if(r){let a=jr(o);return e.concat(o,o.visualViewport||[],Sn(i)?i:[],a&&n?bn(a):[])}return e.concat(i,bn(i,[],n))}function jr(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Tc(t){let e=ye(t),n=parseFloat(e.width)||0,s=parseFloat(e.height)||0,i=He(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=Es(n)!==r||Es(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function fo(t){return _e(t)?t:t.contextElement}function $t(t){let e=fo(t);if(!He(e))return xe(1);let n=e.getBoundingClientRect(),{width:s,height:i,$:r}=Tc(e),o=(r?Es(n.width):n.width)/s,a=(r?Es(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}var Dm=xe(0);function Ac(t){let e=me(t);return mo()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Dm}function Mm(t,e,n){return e===void 0&&(e=!1),!(!n||e&&n!==me(t))&&e}function _t(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=fo(t),o=xe(1);e&&(s?_e(s)&&(o=$t(s)):o=$t(t));let a=Mm(r,n,s)?Ac(r):xe(0),l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,h=i.width/o.x,u=i.height/o.y;if(r){let m=me(r),f=s&&_e(s)?me(s):s,g=m,_=jr(g);for(;_&&s&&f!==g;){let S=$t(_),C=_.getBoundingClientRect(),p=ye(_),w=C.left+(_.clientLeft+parseFloat(p.paddingLeft))*S.x,b=C.top+(_.clientTop+parseFloat(p.paddingTop))*S.y;l*=S.x,c*=S.y,h*=S.x,u*=S.y,l+=w,c+=b,g=me(_),_=jr(g)}}return Ss({width:h,height:u,x:l,y:c})}function ks(t,e){let n=Is(t).scrollLeft;return e?e.left+n:_t(Le(t)).left+n}function Cc(t,e){let n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-ks(t,n),y:n.top+e.scrollTop}}function xm(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t,r=i==="fixed",o=Le(s),a=!!e&&Ns(e.floating);if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=xe(1),h=xe(0),u=He(s);if((u||!u&&!r)&&((Yt(s)!=="body"||Sn(o))&&(l=Is(s)),u)){let f=_t(s);c=$t(s),h.x=f.x+s.clientLeft,h.y=f.y+s.clientTop}let m=!o||u||r?xe(0):Cc(o,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+m.x,y:n.y*c.y-l.scrollTop*c.y+h.y+m.y}}function Lm(t){return Array.from(t.getClientRects())}function Om(t){let e=Le(t),n=Is(t),s=t.ownerDocument.body,i=bt(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),r=bt(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight),o=-n.scrollLeft+ks(t),a=-n.scrollTop;return ye(s).direction==="rtl"&&(o+=bt(e.clientWidth,s.clientWidth)-i),{width:i,height:r,x:o,y:a}}function Nm(t,e){let n=me(t),s=Le(t),i=n.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;let h=mo();(!h||h&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}let c=ks(s);if(c<=0){let h=s.ownerDocument,u=h.body,m=getComputedStyle(u),f=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(s.clientWidth-u.clientWidth-f);g<=25&&(r-=g)}else c<=25&&(r+=c);return{width:r,height:o,x:a,y:l}}function Im(t,e){let n=_t(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=He(t)?$t(t):xe(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:s*r.y}}function Tl(t,e,n){let s;if(e==="viewport")s=Nm(t,n);else if(e==="document")s=Om(Le(t));else if(_e(e))s=Im(e,n);else{let i=Ac(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ss(s)}function Dc(t,e){let n=et(t);return!(n===e||!_e(n)||Bt(n))&&(ye(n).position==="fixed"||Dc(n,e))}function km(t,e){let n=e.get(t);if(n)return n;let s=bn(t,[],!1).filter(a=>_e(a)&&Yt(a)!=="body"),i=null,r=ye(t).position==="fixed",o=r?et(t):t;for(;_e(o)&&!Bt(o);){let a=ye(o),l=uo(o);l||a.position!=="fixed"||(i=null),(r?!l&&!i:!l&&a.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Sn(o)&&!l&&Dc(t,o))?s=s.filter(c=>c!==o):i=a,o=et(o)}return e.set(t,s),s}function Rm(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t,r=[...n==="clippingAncestors"?Ns(e)?[]:km(e,this._c):[].concat(n),s],o=Tl(e,r[0],i),a=o.top,l=o.right,c=o.bottom,h=o.left;for(let u=1;u<r.length;u++){let m=Tl(e,r[u],i);a=bt(m.top,a),l=Vt(m.right,l),c=Vt(m.bottom,c),h=bt(m.left,h)}return{width:l-h,height:c-a,x:h,y:a}}function Pm(t){let{width:e,height:n}=Tc(t);return{width:e,height:n}}function Fm(t,e,n){let s=He(e),i=Le(e),r=n==="fixed",o=_t(t,!0,r,e),a={scrollLeft:0,scrollTop:0},l=xe(0);function c(){l.x=ks(i)}if(s||!s&&!r)if((Yt(e)!=="body"||Sn(i))&&(a=Is(e)),s){let u=_t(e,!0,r,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}else i&&c();r&&!s&&i&&c();let h=!i||s||r?xe(0):Cc(i,a);return{x:o.left+a.scrollLeft-l.x-h.x,y:o.top+a.scrollTop-l.y-h.y,width:o.width,height:o.height}}function Cr(t){return ye(t).position==="static"}function Al(t,e){if(!He(t)||ye(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Le(t)===n&&(n=n.ownerDocument.body),n}function Mc(t,e){let n=me(t);if(Ns(t))return n;if(!He(t)){let i=et(t);for(;i&&!Bt(i);){if(_e(i)&&!Cr(i))return i;i=et(i)}return n}let s=Al(t,e);for(;s&&Sm(s)&&Cr(s);)s=Al(s,e);return s&&Bt(s)&&Cr(s)&&!uo(s)?n:s||Cm(t)||n}var $m=async function(t){let e=this.getOffsetParent||Mc,n=this.getDimensions,s=await n(t.floating);return{reference:Fm(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Hm(t){return ye(t).direction==="rtl"}var Vm={convertOffsetParentRelativeRectToViewportRelativeRect:xm,getDocumentElement:Le,getClippingRect:Rm,getOffsetParent:Mc,getElementRects:$m,getClientRects:Lm,getDimensions:Pm,getScale:$t,isElement:_e,isRTL:Hm};function xc(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Bm(t,e){let n,s=null,i=Le(t);function r(){var o;clearTimeout(n),(o=s)==null||o.disconnect(),s=null}return(function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();let c=t.getBoundingClientRect(),{left:h,top:u,width:m,height:f}=c;if(a||e(),!m||!f)return;let g={rootMargin:-cs(u)+"px "+-cs(i.clientWidth-(h+m))+"px "+-cs(i.clientHeight-(u+f))+"px "+-cs(h)+"px",threshold:bt(0,Vt(1,l))||1},_=!0;function S(C){let p=C[0].intersectionRatio;if(p!==l){if(!_)return o();p?o(!1,p):n=setTimeout(()=>{o(!1,1e-7)},1e3)}p!==1||xc(c,t.getBoundingClientRect())||o(),_=!1}try{s=new IntersectionObserver(S,{...g,root:i.ownerDocument})}catch{s=new IntersectionObserver(S,g)}s.observe(t)})(!0),r}function zr(t,e,n,s){s===void 0&&(s={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=fo(t),h=i||r?[...c?bn(c):[],...e?bn(e):[]]:[];h.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),r&&S.addEventListener("resize",n)});let u=c&&a?Bm(c,n):null,m,f=-1,g=null;o&&(g=new ResizeObserver(S=>{let[C]=S;C&&C.target===c&&g&&e&&(g.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var p;(p=g)==null||p.observe(e)})),n()}),c&&!l&&g.observe(c),e&&g.observe(e));let _=l?_t(t):null;return l&&(function S(){let C=_t(t);_&&!xc(_,C)&&n(),_=C,m=requestAnimationFrame(S)})(),n(),()=>{var S;h.forEach(C=>{i&&C.removeEventListener("scroll",n),r&&C.removeEventListener("resize",n)}),u?.(),(S=g)==null||S.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Gr=Em,Xr=wm,Zr=vm,qm=bm,Lc=(t,e,n)=>{let s=new Map,i={platform:Vm,...n},r={...i.platform,_c:s};return gm(t,e,{...i,platform:r})},Ts={sm:576,md:768,lg:1024,xl:1280,"2xl":1536},Oc=(t,e="bottom")=>{if(!t||!t.includes(":"))return null;let n=t.split(/\s+/),s={xs:e};for(let i of n)if(i.includes(":")){let[r,o]=i.split(":");Ts[r]!==void 0&&(s[r]=o)}else s.xs=i;return s},Nc=(t,e="bottom")=>{if(!t)return e;let n=window.innerWidth,s=t.xs||e;for(let i of["sm","md","lg","xl","2xl"])n>=Ts[i]&&t[i]&&(s=t[i]);return s},Ic=t=>{let e=[];for(let n of Object.keys(Ts)){let s=Ts[n],i=window.matchMedia(`(min-width: ${s}px)`);i.addEventListener("change",t),e.push({mql:i,handler:t})}return e},kc=t=>{for(let{mql:e,handler:n}of t)e.removeEventListener("change",n)},As=t=>Array.isArray(t)?{mainAxis:t[1]||0,crossAxis:t[0]||0}:t;var Wm="ArrowUp",Cl="ArrowDown",Dr="ArrowLeft",Mr="ArrowRight",xr="Home",Dl="End",Ml="Enter",xl=" ";var Ym="hide.bs.menu",Km="hidden.bs.menu",Um="show.bs.menu",jm="shown.bs.menu",Ll="click.bs.menu.data-api",Ol="keydown.bs.menu.data-api",zm="keyup.bs.menu.data-api";var Ft='[data-bs-toggle="menu"]:not(.disabled):not(:disabled)';var hs=".menu-item:not(.disabled):not(:disabled)";var mn=t=>De()?t.replace(/^start(?=-|$)/,"right").replace(/^end(?=-|$)/,"left"):t.replace(/^start(?=-|$)/,"left").replace(/^end(?=-|$)/,"right"),Lr=(t,e,n)=>(t.x-n.x)*(e.y-n.y)-(e.x-n.x)*(t.y-n.y),Gm={autoClose:!0,boundary:"clippingParents",container:!1,display:"dynamic",offset:[0,2],floatingConfig:null,menu:null,placement:"bottom-start",reference:"toggle",strategy:"absolute",submenuTrigger:"both",submenuDelay:100},Xm={autoClose:"(boolean|string)",boundary:"(string|element)",container:"(string|element|boolean)",display:"string",offset:"(array|string|function)",floatingConfig:"(null|object|function)",menu:"(null|element)",placement:"string",reference:"(string|element|object)",strategy:"string",submenuTrigger:"string",submenuDelay:"number"},kt=class Rt extends te{static _openInstances=new Set;constructor(e,n){super(e,n),this._floatingCleanup=null,this._mediaQueryListeners=[],this._responsivePlacements=null,this._parent=this._element.parentNode,this._openSubmenus=new Map,this._submenuCloseTimeouts=new Map,this._hoverIntentData=null,this._menu=this._config.menu||this._findMenu(),!this._config.menu&&this._menu&&(this._parent=this._findWrapper(this._menu)),this._isSubmenu=this._parent.classList?.contains("submenu"),this._menuOriginalParent=this._menu?.parentNode,this._parseResponsivePlacements(),this._setupSubmenuListeners()}static get Default(){return Gm}static get DefaultType(){return Xm}static get NAME(){return"menu"}toggle(){return this._isShown()?this.hide():this.show()}show(){if(be(this._element)||this._isShown())return;let e={relatedTarget:this._element};if(!d.trigger(this._element,Um,e).defaultPrevented){if(this._moveMenuToContainer(),this._createFloating(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(let n of document.body.children)d.on(n,"mouseover",ys);this._element.focus({focusVisible:!1}),this._element.setAttribute("aria-expanded","true"),this._menu.classList.add("show"),this._element.classList.add("show"),this._parent&&this._parent.classList.add("show"),Rt._openInstances.add(this),d.trigger(this._element,jm,e)}}hide(){if(be(this._element)||!this._isShown())return;let e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._disposeFloating(),this._restoreMenuToOriginalParent(),this._disposeMediaQueryListeners(),this._closeAllSubmenus(),this._clearAllSubmenuTimeouts(),Rt._openInstances.delete(this),super.dispose()}update(){this._floatingCleanup&&this._updateFloatingPosition()}_findMenu(){let e=y.closest(this._element,":has(.menu)");return y.next(this._element,".menu")[0]||y.prev(this._element,".menu")[0]||y.findOne(".menu",e||this._parent)}_findWrapper(e){let n=this._element.parentNode;for(;n instanceof Element&&!n.contains(e);)n=n.parentNode;return n instanceof Element?n:this._element.parentNode}_completeHide(e){if(!d.trigger(this._element,Ym,e).defaultPrevented){if(this._closeAllSubmenus(),"ontouchstart"in document.documentElement)for(let n of document.body.children)d.off(n,"mouseover",ys);this._disposeFloating(),this._restoreMenuToOriginalParent(),this._menu.classList.remove("show"),this._element.classList.remove("show"),this._parent&&this._parent.classList.remove("show"),this._element.setAttribute("aria-expanded","false"),Ce.removeDataAttribute(this._menu,"placement"),Ce.removeDataAttribute(this._menu,"display"),Rt._openInstances.delete(this),d.trigger(this._element,Km,e)}}_getConfig(e){if(typeof(e=super._getConfig(e)).reference=="object"&&!ke(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${"menu".toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createFloating(){if(this._config.display==="static")return void Ce.setDataAttribute(this._menu,"display","static");let e=this._element;this._config.reference==="parent"?e=this._parent:ke(this._config.reference)?e=Re(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference),this._updateFloatingPosition(e),this._floatingCleanup=zr(e,this._menu,()=>this._updateFloatingPosition(e))}async _updateFloatingPosition(e=null){if(!this._menu)return;e||(e=this._config.reference==="parent"?this._parent:ke(this._config.reference)?Re(this._config.reference):typeof this._config.reference=="object"?this._config.reference:this._element);let n=this._getPlacement(),s=this._getFloatingMiddleware(),i=this._getFloatingConfig(n,s);await this._applyFloatingPosition(e,this._menu,i.placement,i.middleware,i.strategy)}_isShown(){return this._menu.classList.contains("show")}_getPlacement(){let e=this._responsivePlacements?Nc(this._responsivePlacements,"bottom-start"):this._config.placement;return mn(e)}_parseResponsivePlacements(){this._responsivePlacements=Oc(this._config.placement,"bottom-start"),this._responsivePlacements&&this._setupMediaQueryListeners()}_setupMediaQueryListeners(){this._disposeMediaQueryListeners(),this._mediaQueryListeners=Ic(()=>{this._isShown()&&this._updateFloatingPosition()})}_disposeMediaQueryListeners(){kc(this._mediaQueryListeners),this._mediaQueryListeners=[]}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(n=>Number.parseInt(n,10)):typeof e=="function"?({placement:n,rects:s})=>As(e({placement:n,reference:s.reference,floating:s.floating},this._element)):e}_getFloatingMiddleware(){let e=this._getOffset();return[Gr(typeof e=="function"?e:As(e)),Zr({fallbackPlacements:this._getFallbackPlacements(),fallbackStrategy:"initialPlacement"}),Xr({boundary:this._config.boundary==="clippingParents"?"clippingAncestors":this._config.boundary})]}_getFallbackPlacements(){return{bottom:["top","bottom-start","bottom-end","top-start","top-end"],"bottom-start":["top-start","bottom-end","top-end"],"bottom-end":["top-end","bottom-start","top-start"],top:["bottom","top-start","top-end","bottom-start","bottom-end"],"top-start":["bottom-start","top-end","bottom-end"],"top-end":["bottom-end","top-start","bottom-start"],right:["left","right-start","right-end","left-start","left-end"],"right-start":["left-start","right-end","left-end","top-start","bottom-start"],"right-end":["left-end","right-start","left-start","top-end","bottom-end"],left:["right","left-start","left-end","right-start","right-end"],"left-start":["right-start","left-end","right-end","top-start","bottom-start"],"left-end":["right-end","left-start","right-start","top-end","bottom-end"]}[this._getPlacement()]||["top","bottom","right","left"]}_getFloatingConfig(e,n){let s={placement:e,middleware:n,strategy:this._config.strategy};return{...s,...Me(this._config.floatingConfig,[void 0,s])}}_disposeFloating(){this._floatingCleanup&&(this._floatingCleanup(),this._floatingCleanup=null)}_getContainer(){let{container:e}=this._config;return e===!1?null:e===!0?document.body:Re(e)}_moveMenuToContainer(){let e=this._getContainer();e&&this._menu&&this._menu.parentNode!==e&&e.append(this._menu)}_restoreMenuToOriginalParent(){this._menuOriginalParent&&this._menu&&this._menu.parentNode!==this._menuOriginalParent&&this._menuOriginalParent.append(this._menu)}async _applyFloatingPosition(e,n,s,i,r="absolute"){if(!n.isConnected)return null;let{x:o,y:a,placement:l}=await Lc(e,n,{placement:s,middleware:i,strategy:r});return n.isConnected?(Object.assign(n.style,{position:r,left:`${o}px`,top:`${a}px`,margin:"0"}),Ce.setDataAttribute(n,"placement",l),l):null}_setupSubmenuListeners(){this._config.submenuTrigger!=="hover"&&this._config.submenuTrigger!=="both"||(d.on(this._menu,"mouseenter",".submenu > .menu-item",e=>{this._onSubmenuTriggerEnter(e)}),d.on(this._menu,"mouseleave",".submenu",e=>{this._onSubmenuLeave(e)}),d.on(this._menu,"mousemove",e=>{this._trackMousePosition(e)})),this._config.submenuTrigger!=="click"&&this._config.submenuTrigger!=="both"||d.on(this._menu,"click",".submenu > .menu-item",e=>{this._onSubmenuTriggerClick(e)})}_onSubmenuTriggerEnter(e){let n=e.target.closest(".submenu > .menu-item");if(!n)return;let s=n.closest(".submenu"),i=y.findOne(".menu",s);i&&(this._cancelSubmenuCloseTimeout(i),this._closeSiblingSubmenus(s),this._openSubmenu(n,i,s))}_onSubmenuLeave(e){let n=e.target.closest(".submenu"),s=y.findOne(".menu",n);s&&this._openSubmenus.has(s)&&(this._isMovingTowardSubmenu(e,s)||this._scheduleSubmenuClose(s,n))}_onSubmenuTriggerClick(e){let n=e.target.closest(".submenu > .menu-item");if(!n)return;e.preventDefault(),e.stopPropagation();let s=n.closest(".submenu"),i=y.findOne(".menu",s);i&&(this._openSubmenus.has(i)?this._closeSubmenu(i,s):(this._closeSiblingSubmenus(s),this._openSubmenu(n,i,s)))}_openSubmenu(e,n,s){if(this._openSubmenus.has(n))return;e.setAttribute("aria-expanded","true"),e.setAttribute("aria-haspopup","true"),n.style.opacity="0",n.classList.add("show"),s.classList.add("show");let i=this._createSubmenuFloating(e,n,s);this._openSubmenus.set(n,i),d.on(n,"mouseenter",()=>{this._cancelSubmenuCloseTimeout(n)})}_closeSubmenu(e,n){if(!this._openSubmenus.has(e))return;let s=y.find(".submenu .menu.show",e);for(let o of s){let a=o.closest(".submenu");this._closeSubmenu(o,a)}let i=y.findOne(".submenu > .menu-item",n),r=this._openSubmenus.get(e);r&&r(),this._openSubmenus.delete(e),d.off(e,"mouseenter"),i&&i.setAttribute("aria-expanded","false"),e.classList.remove("show"),n.classList.remove("show"),e.style.opacity=""}_closeAllSubmenus(){for(let[e]of this._openSubmenus){let n=e.closest(".submenu");this._closeSubmenu(e,n)}}_closeSiblingSubmenus(e){let n=e.parentNode,s=y.find(".submenu > .menu.show",n);for(let i of s){let r=i.closest(".submenu");r!==e&&this._closeSubmenu(i,r)}}_createSubmenuFloating(e,n,s){let i=s,r=mn("end-start"),o=[Gr({mainAxis:0,crossAxis:-4}),Zr({fallbackPlacements:[mn("start-start"),mn("end-end"),mn("start-end")]}),Xr({padding:8})],a=()=>this._applyFloatingPosition(i,n,r,o).then(l=>(n.style.opacity="",l));return a(),zr(i,n,a)}_scheduleSubmenuClose(e,n){this._cancelSubmenuCloseTimeout(e);let s=setTimeout(()=>{this._closeSubmenu(e,n),this._submenuCloseTimeouts.delete(e)},this._config.submenuDelay);this._submenuCloseTimeouts.set(e,s)}_cancelSubmenuCloseTimeout(e){let n=this._submenuCloseTimeouts.get(e);n&&(clearTimeout(n),this._submenuCloseTimeouts.delete(e))}_clearAllSubmenuTimeouts(){for(let e of this._submenuCloseTimeouts.values())clearTimeout(e);this._submenuCloseTimeouts.clear()}_trackMousePosition(e){this._hoverIntentData={x:e.clientX,y:e.clientY,timestamp:Date.now()}}_isMovingTowardSubmenu(e,n){if(!this._hoverIntentData)return!1;let s=n.getBoundingClientRect(),i={x:e.clientX,y:e.clientY},r={x:this._hoverIntentData.x,y:this._hoverIntentData.y},o=De()?s.right:s.left,a={x:o,y:s.top},l={x:o,y:s.bottom};return this._pointInTriangle(i,r,a,l)}_pointInTriangle(e,n,s,i){let r=Lr(e,n,s),o=Lr(e,s,i),a=Lr(e,i,n);return!((r<0||o<0||a<0)&&(r>0||o>0||a>0))}_selectMenuItem({key:e,target:n}){let s=n.closest(".menu")||this._menu,i=y.find(`:scope > ${hs}`,s).filter(r=>Je(r));i.length&&ao(i,n,e===Cl,!i.includes(n)).focus()}_handleSubmenuKeydown(e){let{key:n,target:s}=e,i=De(),r=i?Dr:Mr,o=i?Mr:Dr,a=s.closest(".submenu"),l=s.matches(".submenu > .menu-item");if((n===Ml||n===xl)&&a&&l){e.preventDefault(),e.stopPropagation();let c=y.findOne(".menu",a);return c&&(this._closeSiblingSubmenus(a),this._openSubmenu(s,c,a),requestAnimationFrame(()=>{let h=y.findOne(hs,c);h&&h.focus()})),!0}if(n===r&&a&&l){e.preventDefault(),e.stopPropagation();let c=y.findOne(".menu",a);return c&&(this._closeSiblingSubmenus(a),this._openSubmenu(s,c,a),requestAnimationFrame(()=>{let h=y.findOne(hs,c);h&&h.focus()})),!0}if(n===o){let c=s.closest(".menu"),h=c?.closest(".submenu");if(h){e.preventDefault(),e.stopPropagation();let u=y.findOne(".submenu > .menu-item",h);return this._closeSubmenu(c,h),u&&u.focus(),!0}}if(n===xr||n===Dl){e.preventDefault(),e.stopPropagation();let c=s.closest(".menu"),h=y.find(`:scope > ${hs}`,c).filter(u=>Je(u));return h.length&&(n===xr?h[0]:h.at(-1)).focus(),!0}return!1}static clearMenus(e){if(e.button!==2&&(e.type!=="keyup"||e.key==="Tab"))for(let n of Rt._openInstances){if(n._config.autoClose===!1)continue;let s=e.composedPath(),i=s.includes(n._menu);if(s.includes(n._element)||n._config.autoClose==="inside"&&!i||n._config.autoClose==="outside"&&i)continue;let r=e.target.closest?.("form"),o=!!r&&n._menu.contains(r);if(n._menu.contains(e.target)&&(e.type==="keyup"&&e.key==="Tab"||/input|select|option|textarea|form/i.test(e.target.tagName)||o))continue;let a={relatedTarget:n._element};e.type==="click"&&(a.clickEvent=e),n._completeHide(a)}}static dataApiKeydownHandler(e){let n=/input|textarea/i.test(e.target.tagName)||e.target.isContentEditable,s=e.key==="Escape",i=[Wm,Cl].includes(e.key),r=[Dr,Mr].includes(e.key),o=[xr,Dl].includes(e.key),a=[Ml,xl].includes(e.key),l=e.target.matches(".submenu > .menu-item");if(!(i||s||r||o||a&&l)||n&&!s)return;let c=this.matches(Ft)?this:y.prev(this,Ft)[0]||y.next(this,Ft)[0]||y.findOne(Ft,e.delegateTarget.parentNode);if(!c)return;let h=Rt.getOrCreateInstance(c);if(!(r||o||a&&l)||!h._handleSubmenuKeydown(e)){if(i)return e.preventDefault(),e.stopPropagation(),h.show(),void h._selectMenuItem(e);if(s&&h._isShown()){e.preventDefault(),e.stopPropagation();let u=e.target.closest(".menu"),m=u?.closest(".submenu");if(m&&h._openSubmenus.size>0){let f=y.findOne(".submenu > .menu-item",m);return h._closeSubmenu(u,m),void(f&&f.focus())}h.hide(),c.focus()}}}};d.on(document,Ol,Ft,kt.dataApiKeydownHandler),d.on(document,Ol,".menu",kt.dataApiKeydownHandler),d.on(document,Ll,kt.clearMenus),d.on(document,zm,kt.clearMenus),d.on(document,Ll,Ft,function(t){t.preventDefault(),kt.getOrCreateInstance(this).toggle()});var Zm="combobox",tt=".bs.combobox";var Qm=`change${tt}`,Jm=`show${tt}`,ef=`shown${tt}`,tf=`hide${tt}`,nf=`hidden${tt}`,sf=`click${tt}.data-api`;var Nl='[data-bs-toggle="combobox"]';var us=".menu-item[data-bs-value]",rf=".menu-item[data-bs-value]:not(.disabled):not(:disabled)",of=".combobox-value",af=".combobox-search-input",lf=".combobox-no-results",cf={boundary:"clippingParents",multiple:!1,name:null,offset:[0,2],placeholder:"",placement:"bottom-start",search:!1,searchNormalize:!1},hf={boundary:"(string|element)",multiple:"boolean",name:"(string|null)",offset:"(array|string|function)",placeholder:"string",placement:"string",search:"boolean",searchNormalize:"boolean"},Cs=class extends te{constructor(t,e){super(t,e),this._toggle=this._element,this._menu=y.next(this._toggle,".menu")[0],this._valueDisplay=y.findOne(of,this._toggle),this._searchInput=y.findOne(af,this._menu),this._noResults=y.findOne(lf,this._menu),this._hiddenInput=null,this._menuInstance=null,this._createHiddenInput(),this._createMenuInstance(),this._syncInitialSelection(),this._addEventListeners()}static get Default(){return cf}static get DefaultType(){return hf}static get NAME(){return Zm}toggle(){return this._isShown()?this.hide():this.show()}show(){be(this._toggle)||this._isShown()||d.trigger(this._toggle,Jm).defaultPrevented||(this._menuInstance.show(),this._searchInput&&(this._searchInput.value="",this._filterItems(""),requestAnimationFrame(()=>this._searchInput.focus())),d.trigger(this._toggle,ef))}hide(){this._isShown()&&(d.trigger(this._toggle,tf).defaultPrevented||(this._menuInstance.hide(),d.trigger(this._toggle,nf)))}dispose(){this._menuInstance&&(this._menuInstance.dispose(),this._menuInstance=null),this._hiddenInput&&(this._hiddenInput.remove(),this._hiddenInput=null),d.off(this._menu,tt),d.off(this._toggle,tt),super.dispose()}_isShown(){return this._menu.classList.contains("show")}_createHiddenInput(){let{name:t}=this._config;t&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=t,this._hiddenInput.value="",this._toggle.parentNode.insertBefore(this._hiddenInput,this._toggle))}_createMenuInstance(){this._menuInstance=new kt(this._toggle,{menu:this._menu,autoClose:!this._config.multiple||"outside",boundary:this._config.boundary,offset:this._config.offset,placement:this._config.placement})}_syncInitialSelection(){this._getSelectedItems().length>0?(this._updateToggleText(),this._updateHiddenInput()):this._showPlaceholder()}_addEventListeners(){d.on(this._menu,"click",us,t=>{let e=t.target.closest(us);e&&!be(e)&&(t.preventDefault(),t.stopPropagation(),this._selectItem(e))}),d.on(this._toggle,"keydown",t=>{this._handleToggleKeydown(t)}),d.on(this._menu,"keydown",t=>{this._handleMenuKeydown(t)}),this._searchInput&&(d.on(this._searchInput,"input",()=>{this._filterItems(this._searchInput.value)}),d.on(this._searchInput,"keydown",t=>{if(t.key==="ArrowDown"){t.preventDefault();let e=this._getVisibleItems();e.length>0&&e[0].focus()}t.key==="Escape"&&(this.hide(),this._toggle.focus())}))}_selectItem(t){if(this._config.multiple)t.classList.toggle("selected"),gt(t,"aria-selected",t.classList.contains("selected"));else{let n=y.find(".selected",this._menu);for(let s of n)s.classList.remove("selected"),s.setAttribute("aria-selected","false");t.classList.add("selected"),t.setAttribute("aria-selected","true")}this._updateToggleText(),this._updateHiddenInput();let e=this._config.multiple?this._getSelectedItems().map(n=>n.dataset.bsValue):t.dataset.bsValue;d.trigger(this._toggle,Qm,{value:e,item:t}),this._config.multiple||(this.hide(),this._toggle.focus())}_updateToggleText(){let t=this._getSelectedItems();if(t.length!==0)if(this._valueDisplay.classList.remove("combobox-placeholder"),this._config.multiple&&t.length>1)this._valueDisplay.textContent=`${t.length} selected`;else{let e=t[0],n=y.findOne(".menu-item-content > span:first-child",e);this._valueDisplay.textContent=n?n.textContent:e.textContent.trim()}else this._showPlaceholder()}_showPlaceholder(){let{placeholder:t}=this._config;t&&(this._valueDisplay.textContent=t,this._valueDisplay.classList.add("combobox-placeholder"))}_updateHiddenInput(){if(!this._hiddenInput)return;let t=this._getSelectedItems().map(e=>e.dataset.bsValue);this._hiddenInput.value=this._config.multiple?t.join(","):t[0]||""}_getSelectedItems(){return y.find(".selected",this._menu)}_getVisibleItems(){return y.find(rf,this._menu).filter(t=>Je(t))}_filterItems(t){let e=this._normalizeText(t.toLowerCase().trim()),n=y.find(us,this._menu),s=0;for(let i of n){let r=this._normalizeText(i.textContent.toLowerCase().trim()),o=!e||r.includes(e);i.style.display=o?"":"none",o&&s++}this._noResults&&this._noResults.classList.toggle("d-none",s>0)}_normalizeText(t){return this._config.searchNormalize?t.normalize("NFD").replace(/[\u0300-\u036F]/g,""):t}_handleToggleKeydown(t){let{key:e}=t;if(e==="ArrowDown"||e==="ArrowUp"){t.preventDefault(),this._isShown()||this.show();let n=this._getVisibleItems();return void(n.length>0&&(e==="ArrowDown"?n[0]:n.at(-1)).focus())}e!=="Enter"&&e!==" "||this._isShown()||(t.preventDefault(),this.show())}_handleMenuKeydown(t){let{key:e,target:n}=t;if(e==="Escape")return t.preventDefault(),t.stopPropagation(),this.hide(),void this._toggle.focus();if(e==="Tab")return void this.hide();let s=n.matches("input");if(e==="ArrowDown"||e==="ArrowUp"){t.preventDefault();let i=this._getVisibleItems();return void(i.length>0&&ao(i,n,e==="ArrowDown",!i.includes(n)).focus())}if(e==="Home"||e==="End"){t.preventDefault();let i=this._getVisibleItems();return void(i.length>0&&(e==="Home"?i[0]:i.at(-1)).focus())}if((e==="Enter"||e===" ")&&!s){t.preventDefault();let i=n.closest(us);i&&!be(i)&&this._selectItem(i)}}};d.on(document,sf,Nl,function(t){t.preventDefault(),Cs.getOrCreateInstance(this).toggle()}),d.on(document,"DOMContentLoaded",()=>{for(let t of y.find(Nl))Cs.getOrCreateInstance(t)});var uf=Object.defineProperty,df=Object.defineProperties,mf=Object.getOwnPropertyDescriptors,Il=Object.getOwnPropertySymbols,ff=Object.prototype.hasOwnProperty,pf=Object.prototype.propertyIsEnumerable,Qr=(t,e,n)=>e in t?uf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qt=(t,e)=>{for(var n in e||(e={}))ff.call(e,n)&&Qr(t,n,e[n]);if(Il)for(var n of Il(e))pf.call(e,n)&&Qr(t,n,e[n]);return t},gf=(t,e)=>df(t,mf(e)),M=(t,e,n)=>(Qr(t,typeof e!="symbol"?e+"":e,n),n),nt={notFoundSelector:t=>`${t} is not found, check the first argument passed to new Calendar.`,notInit:'The calendar has not been initialized, please initialize it using the "init()" method first.',notLocale:"You specified an incorrect language label or did not specify the required number of values \u200B\u200Bfor \xABlocale.weekdays\xBB or \xABlocale.months\xBB.",incorrectTime:"The value of the time property can be: false, 12 or 24.",incorrectMonthsCount:"For the \xABmultiple\xBB calendar type, the \xABdisplayMonthsCount\xBB parameter can have a value from 2 to 12, and for all others it cannot be greater than 1."},L=(t,e,n)=>{t.context[e]=n},bf=t=>{var e,n,s,i,r;if(!t.context.isInit)throw new Error(nt.notInit);t.inputMode?((e=t.context.mainElement.parentElement)==null||e.removeChild(t.context.mainElement),(s=(n=t.context.inputElement)==null?void 0:n.replaceWith)==null||s.call(n,t.context.originalElement),L(t,"inputElement",void 0)):(r=(i=t.context.mainElement).replaceWith)==null||r.call(i,t.context.originalElement),L(t,"mainElement",t.context.originalElement),t.onDestroy&&t.onDestroy(t)},po=new WeakSet,vf=t=>po.has(t),_f=t=>{po.add(t)},yf=t=>{po.delete(t)},Ht="data-vc-prev-tabindex",kl=t=>t.tabIndex>=0&&!t.hasAttribute("disabled")&&t.getAttribute("aria-disabled")!=="true",Rl=t=>{if(t.hasAttribute(Ht))return;let e=t.getAttribute("tabindex");t.setAttribute(Ht,e??"")},Pl=t=>{if(!t.hasAttribute(Ht))return;let e=t.getAttribute(Ht);e===""||e===null?t.removeAttribute("tabindex"):t.setAttribute("tabindex",e),t.removeAttribute(Ht)},Ef=t=>{kl(t)&&(Rl(t),t.tabIndex=-1);let e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>kl(n)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;e.nextNode();){let n=e.currentNode;Rl(n),n.tabIndex=-1}},wf=t=>{Pl(t),t.querySelectorAll(`[${Ht}]`).forEach(Pl)},Jr=t=>{t.context.isShowInInputMode&&t.context.currentType&&(t.context.mainElement.dataset.vcCalendarHidden="",L(t,"isShowInInputMode",!1),t.inputMode&&Ef(t.context.mainElement),t.context.cleanupHandlers[0]&&(t.context.cleanupHandlers.forEach(e=>e()),L(t,"cleanupHandlers",[])),t.inputMode&&t.context.inputElement&&t.context.mainElement.contains(document.activeElement)&&((typeof t.openOnFocus=="function"||t.openOnFocus===!0)&&_f(t),t.context.inputElement.focus()),t.onHide&&t.onHide(t))};function go(t){if(!t||!t.getBoundingClientRect)return{top:0,bottom:0,left:0,right:0};let e=t.getBoundingClientRect(),n=document.documentElement;return{bottom:e.bottom,right:e.right,top:e.top+window.scrollY-n.clientTop,left:e.left+window.scrollX-n.clientLeft}}function bo(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function Sf(){return{left:window.scrollX||document.documentElement.scrollLeft||0,top:window.scrollY||document.documentElement.scrollTop||0}}function Tf(t){let{top:e,left:n}=Sf(),{top:s,left:i}=go(t),{vh:r,vw:o}=bo(),a=s-e,l=i-n;return{top:a,bottom:r-(a+t.clientHeight),left:l,right:o-(l+t.clientWidth)}}function Rc(t,e,n=5){let s={top:!0,bottom:!0,left:!0,right:!0},i=[];if(!e||!t)return{canShow:s,parentPositions:i};let{bottom:r,top:o}=Tf(t),{top:a,left:l}=go(t),{height:c,width:h}=e.getBoundingClientRect(),{vh:u,vw:m}=bo(),f=m/2,g=u/2;return[{condition:a<g,position:"top"},{condition:a>g,position:"bottom"},{condition:l<f,position:"left"},{condition:l>f,position:"right"}].forEach(({condition:_,position:S})=>{_&&i.push(S)}),Object.assign(s,{top:c<=o-n,bottom:c<=r-n,left:h<=l,right:h<=m-l}),{canShow:s,parentPositions:i}}var Af=(t,e,n,s)=>{var i;let r=s.querySelector(`[data-vc-date="${e}"]`),o=r?.querySelector("[data-vc-date-btn]");if(!r||!o||(n!=null&&n.modifier&&o.classList.add(...n.modifier.trim().split(" ")),!n?.html))return;let a=document.createElement("div");a.className=t.styles.datePopup,a.dataset.vcDatePopup="",a.innerHTML=t.sanitizerHTML(n.html),o.ariaExpanded="true",o.ariaLabel=`${o.ariaLabel}, ${(i=a?.textContent)==null?void 0:i.replace(/^\s+|\s+(?=\s)|\s+$/g,"").replace(/&nbsp;/g," ")}`,r.appendChild(a),requestAnimationFrame(()=>{if(!a)return;let{canShow:l}=Rc(r,a),c=l.bottom?r.offsetHeight:-a.offsetHeight,h=l.left&&!l.right?r.offsetWidth-a.offsetWidth/2:!l.left&&l.right?a.offsetWidth/2:0;Object.assign(a.style,{left:`${h}px`,top:`${c}px`})})},Cf=(t,e)=>{var n;t.popups&&((n=Object.entries(t.popups))==null||n.forEach(([s,i])=>Af(t,s,i,e)))},P=t=>new Date(`${t}T00:00:00`),yt=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,Fe=t=>t.reduce((e,n)=>{if(n instanceof Date||typeof n=="number"){let s=n instanceof Date?n:new Date(n);e.push(s.toISOString().substring(0,10))}else n.match(/^(\d{4}-\d{2}-\d{2})$/g)?e.push(n):n.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(s,i,r)=>{let o=P(i),a=P(r),l=new Date(o.getTime());for(;l<=a;l.setDate(l.getDate()+1))e.push(yt(l));return s});return e},[]),Xe=(t,e,n,s="")=>{e?t.setAttribute(n,s):t.getAttribute(n)===s&&t.removeAttribute(n)},Pc=(t,e,n,s,i,r,o)=>{var a,l,c,h;let u=P(t.context.displayDateMin)>P(r)||P(t.context.displayDateMax)<P(r)||((a=t.context.disableDates)==null?void 0:a.includes(r))||!t.selectionMonthsMode&&o!=="current"||!t.selectionYearsMode&&P(r).getFullYear()!==e;Xe(n,u,"data-vc-date-disabled"),s&&Xe(s,u,"aria-disabled","true"),s&&Xe(s,u,"tabindex","-1"),Xe(n,!t.disableToday&&t.context.dateToday===r,"data-vc-date-today"),Xe(n,!t.disableToday&&t.context.dateToday===r,"aria-current","date"),Xe(n,(l=t.selectedWeekends)==null?void 0:l.includes(i),"data-vc-date-weekend");let m=(c=t.selectedHolidays)!=null&&c[0]?Fe(t.selectedHolidays):[];if(Xe(n,m.includes(r),"data-vc-date-holiday"),(h=t.context.selectedDates)!=null&&h.includes(r)?(n.setAttribute("data-vc-date-selected",""),s&&s.setAttribute("aria-selected","true"),t.context.selectedDates.length>1&&t.selectionDatesMode==="multiple-ranged"&&(t.context.selectedDates[0]===r&&t.context.selectedDates[t.context.selectedDates.length-1]===r?n.setAttribute("data-vc-date-selected","first-and-last"):t.context.selectedDates[0]===r?n.setAttribute("data-vc-date-selected","first"):t.context.selectedDates[t.context.selectedDates.length-1]===r&&n.setAttribute("data-vc-date-selected","last"),t.context.selectedDates[0]!==r&&t.context.selectedDates[t.context.selectedDates.length-1]!==r&&n.setAttribute("data-vc-date-selected","middle"))):n.hasAttribute("data-vc-date-selected")&&(n.removeAttribute("data-vc-date-selected"),s&&s.removeAttribute("aria-selected")),!t.context.disableDates.includes(r)&&t.enableEdgeDatesOnly&&t.context.selectedDates.length>1&&t.selectionDatesMode==="multiple-ranged"){let f=P(t.context.selectedDates[0]),g=P(t.context.selectedDates[t.context.selectedDates.length-1]),_=P(r);Xe(n,_>f&&_<g,"data-vc-date-selected","middle")}},Df=(t,e,n)=>new Date(`${t}T00:00:00.000Z`).toLocaleString(e,n),Fc=(t,e)=>{let n=P(t),s=(n.getDay()-e+7)%7;n.setDate(n.getDate()+4-s);let i=new Date(n.getFullYear(),0,1),r=Math.ceil(((+n-+i)/864e5+1)/7);return{year:n.getFullYear(),week:r}},Mf=(t,e,n)=>{let s=Fc(n,t.firstWeekday);s&&(e.dataset.vcDateWeekNumber=String(s.week))},xf=(t,e,n)=>{var s,i,r,o,a;let l=(s=t.disableWeekdays)==null?void 0:s.includes(n),c=t.disableAllDates&&!!((i=t.context.enableDates)!=null&&i[0]);!l&&!c||(r=t.context.enableDates)!=null&&r.includes(e)||(o=t.context.disableDates)!=null&&o.includes(e)||(t.context.disableDates.push(e),(a=t.context.disableDates)==null||a.sort((h,u)=>+new Date(h)-+new Date(u)))},vo=(t,e,n,s,i,r)=>{let o=P(i).getDay(),a=typeof t.locale=="string"&&t.locale.length?t.locale:"en",l=document.createElement("div"),c;l.className=t.styles.date,l.dataset.vcDate=i,l.dataset.vcDateMonth=r,l.dataset.vcDateWeekDay=String(o),l.role="gridcell",(r==="current"||t.displayDatesOutside)&&(c=document.createElement("button"),c.className=t.styles.dateBtn,c.type="button",c.ariaLabel=Df(i,a,{dateStyle:"long",timeZone:"UTC"}),c.dataset.vcDateBtn="",c.innerText=String(s),l.appendChild(c)),t.enableWeekNumbers&&Mf(t,l,i),xf(t,i,o),Pc(t,e,l,c,o,i,r),n.addDate(l),t.onCreateDateEls&&t.onCreateDateEls(t,l)},Lf=(t,e,n,s,i)=>{for(let r=1;r<=n;r++){let o=new Date(s,i,r);vo(t,s,e,r,yt(o),"current")}},Of=(t,e,n,s,i)=>{let r=i+1===12?s+1:s,o=i+1===12?"01":i+2<10?`0${i+2}`:i+2;for(let a=1;a<=n;a++){let l=a<10?`0${a}`:String(a);vo(t,s,e,a,`${r}-${o}-${l}`,"next")}},Nf=(t,e,n,s,i)=>{let r=new Date(n,s,0).getDate()-(i-1),o=s===0?n-1:n,a=s===0?12:s<10?`0${s}`:s;for(let l=i;l>0;l--,r++)vo(t,n,e,r,`${o}-${a}-${r}`,"prev")},If=(t,e,n,s,i)=>{if(!t.enableWeekNumbers)return;s.textContent="";let r=document.createElement("b");r.className=t.styles.weekNumbersTitle,r.innerText="#",r.dataset.vcWeekNumbers="title",s.appendChild(r);let o=document.createElement("div");o.className=t.styles.weekNumbersContent,o.dataset.vcWeekNumbers="content",s.appendChild(o);let a=document.createElement("button");a.type="button",a.className=t.styles.weekNumber;let l=i.querySelectorAll("[data-vc-date]"),c=Math.ceil((e+n)/7);for(let h=0;h<c;h++){let u=l[h===0?6:7*h].dataset.vcDate,m=Fc(u,t.firstWeekday);if(!m)return;let f=a.cloneNode(!0);f.innerText=String(m.week),f.dataset.vcWeekNumber=String(m.week),f.dataset.vcWeekYear=String(m.year),f.role="rowheader",f.ariaLabel=`${m.week}`,o.appendChild(f)}},eo=t=>{let e=new Date(t.context.selectedYear,t.context.selectedMonth,1),n=t.context.mainElement.querySelectorAll('[data-vc="dates"]'),s=t.context.mainElement.querySelectorAll('[data-vc-week="numbers"]');n.forEach((i,r)=>{t.selectionDatesMode||(i.dataset.vcDatesDisabled=""),i.textContent="";let o=new Date(e);o.setMonth(o.getMonth()+r);let a=o.getMonth(),l=o.getFullYear(),c=(new Date(l,a,1).getDay()-t.firstWeekday+7)%7,h=new Date(l,a+1,0).getDate(),u=c+h,m=Math.ceil(u/7),f=7*m-u,g=[];for(let p=0;p<m;p++){let w=document.createElement("div");w.className=t.styles.datesRow,w.setAttribute("data-vc-dates","row"),w.setAttribute("role","row"),g.push(w)}let _=0,S=0,C={addDate:p=>{g[_].appendChild(p),S++,S>=7&&(_++,S=0)}};Nf(t,C,l,a,c),Lf(t,C,h,l,a),Of(t,C,f,l,a);for(let p of g)i.appendChild(p);Cf(t,i),If(t,c,h,s[r],i)})},kf=t=>`
27
+ <div class="${t.styles.header}" data-vc="header" role="toolbar" aria-label="${t.labels.navigation}">
28
+ <#ArrowPrev [month] />
29
+ <div class="${t.styles.headerContent}" data-vc-header="content">
30
+ <#Month />
31
+ <#Year />
32
+ </div>
33
+ <#ArrowNext [month] />
34
+ </div>
35
+ <div class="${t.styles.wrapper}" data-vc="wrapper">
36
+ <#WeekNumbers />
37
+ <div class="${t.styles.content}" data-vc="content" role="grid">
38
+ <#Week />
39
+ <#Dates />
40
+ <#DateRangeTooltip />
41
+ </div>
42
+ </div>
43
+ <#ControlTime />
44
+ `,Rf=t=>`
45
+ <div class="${t.styles.header}" data-vc="header" role="toolbar" aria-label="${t.labels.navigation}">
46
+ <div class="${t.styles.headerContent}" data-vc-header="content">
47
+ <#Month />
48
+ <#Year />
49
+ </div>
50
+ </div>
51
+ <div class="${t.styles.wrapper}" data-vc="wrapper">
52
+ <div class="${t.styles.content}" data-vc="content">
53
+ <#Months />
54
+ </div>
55
+ </div>
56
+ `,Pf=t=>`
57
+ <div class="${t.styles.controls}" data-vc="controls" role="toolbar" aria-label="${t.labels.navigation}">
58
+ <#ArrowPrev [month] />
59
+ <#ArrowNext [month] />
60
+ </div>
61
+ <div class="${t.styles.grid}" data-vc="grid">
62
+ <#Multiple>
63
+ <div class="${t.styles.column}" data-vc="column" role="region">
64
+ <div class="${t.styles.header}" data-vc="header">
65
+ <div class="${t.styles.headerContent}" data-vc-header="content">
66
+ <#Month />
67
+ <#Year />
68
+ </div>
69
+ </div>
70
+ <div class="${t.styles.wrapper}" data-vc="wrapper">
71
+ <#WeekNumbers />
72
+ <div class="${t.styles.content}" data-vc="content" role="grid">
73
+ <#Week />
74
+ <#Dates />
75
+ </div>
76
+ </div>
77
+ </div>
78
+ <#/Multiple>
79
+ <#DateRangeTooltip />
80
+ </div>
81
+ <#ControlTime />
82
+ `,Ff=t=>`
83
+ <div class="${t.styles.header}" data-vc="header" role="toolbar" aria-label="${t.labels.navigation}">
84
+ <#ArrowPrev [year] />
85
+ <div class="${t.styles.headerContent}" data-vc-header="content">
86
+ <#Month />
87
+ <#Year />
88
+ </div>
89
+ <#ArrowNext [year] />
90
+ </div>
91
+ <div class="${t.styles.wrapper}" data-vc="wrapper">
92
+ <div class="${t.styles.content}" data-vc="content">
93
+ <#Years />
94
+ </div>
95
+ </div>
96
+ `,$f=(t,e)=>`<button type="button" class="${t.styles.arrowNext}" data-vc-arrow="next" aria-label="${t.labels.arrowNext[e]}"></button>`,Hf=(t,e)=>`<button type="button" class="${t.styles.arrowPrev}" data-vc-arrow="prev" aria-label="${t.labels.arrowPrev[e]}"></button>`,Vf=t=>t.selectionTimeMode?`<div class="${t.styles.time}" data-vc="time" role="group" aria-label="${t.labels.selectingTime}"></div>`:"",Bf=t=>t.onCreateDateRangeTooltip?`<div class="${t.styles.dateRangeTooltip}" data-vc-date-range-tooltip="hidden"></div>`:"",qf=t=>`<div class="${t.styles.dates}" data-vc="dates" aria-live="assertive" aria-label="${t.labels.dates}" ${t.type==="multiple"?"aria-multiselectable":""}></div>`,Wf=t=>`<button type="button" class="${t.styles.month}" data-vc="month"></button>`,Yf=t=>`<div class="${t.styles.months}" data-vc="months" role="grid" aria-live="assertive" aria-label="${t.labels.months}"></div>`,Kf=t=>`<div class="${t.styles.week}" data-vc="week" role="row" aria-label="${t.labels.week}"></div>`,Uf=t=>t.enableWeekNumbers?`<div class="${t.styles.weekNumbers}" data-vc-week="numbers" role="row" aria-label="${t.labels.weekNumber}"></div>`:"",jf=t=>`<button type="button" class="${t.styles.year}" data-vc="year"></button>`,zf=t=>`<div class="${t.styles.years}" data-vc="years" role="grid" aria-live="assertive" aria-label="${t.labels.years}"></div>`,Gf={ArrowNext:$f,ArrowPrev:Hf,ControlTime:Vf,Dates:qf,DateRangeTooltip:Bf,Month:Wf,Months:Yf,Week:Kf,WeekNumbers:Uf,Year:jf,Years:zf},Xf=t=>Gf[t],Or=(t,e)=>e.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(n,s)=>{let i=(s.match(/\[(.*?)\]/)||[])[1],r=s.replace(/[/\s\n\t]|\[(.*?)\]/g,""),o=Xf(r),a=o?o(t,i??null):"";return t.sanitizerHTML(a)}).replace(/[\n\t]/g,""),Zf=(t,e)=>e.replace(new RegExp("<#Multiple>(.*?)<#\\/Multiple>","gs"),(n,s)=>{let i=Array(t.context.displayMonthsCount).fill(s).join("");return t.sanitizerHTML(i)}).replace(/[\n\t]/g,""),_o=(t,e)=>{let n={default:kf,month:Rf,year:Ff,multiple:Pf};if(Object.keys(n).forEach(s=>{let i=s;t.layouts[i].length||(t.layouts[i]=n[i](t))}),t.context.mainElement.className=t.styles.calendar,t.context.mainElement.dataset.vc="calendar",t.context.mainElement.dataset.vcType=t.context.currentType,t.context.mainElement.role="application",t.context.mainElement.tabIndex=0,t.context.mainElement.ariaLabel=t.labels.application,t.context.currentType!=="multiple"){if(t.type==="multiple"&&e){let s=t.context.mainElement.querySelector('[data-vc="controls"]'),i=t.context.mainElement.querySelector('[data-vc="grid"]'),r=e.closest('[data-vc="column"]');return s&&s.remove(),i&&(i.dataset.vcGrid="hidden"),r&&(r.dataset.vcColumn=t.context.currentType),void(r&&(r.innerHTML=t.sanitizerHTML(Or(t,t.layouts[t.context.currentType]))))}t.context.mainElement.innerHTML=t.sanitizerHTML(Or(t,t.layouts[t.context.currentType]))}else t.context.mainElement.innerHTML=t.sanitizerHTML(Zf(t,Or(t,t.layouts[t.context.currentType])))},$c=(t,e,n,s)=>{t.style.visibility=n?"hidden":"",e.style.visibility=s?"hidden":""},Qf=(t,e,n)=>{let s=P(yt(new Date(t.context.selectedYear,t.context.selectedMonth,1))),i=new Date(s.getTime()),r=new Date(s.getTime());i.setMonth(i.getMonth()-t.monthsToSwitch),r.setMonth(r.getMonth()+t.monthsToSwitch);let o=P(t.context.dateMin),a=P(t.context.dateMax);t.selectionYearsMode||(o.setFullYear(s.getFullYear()),a.setFullYear(s.getFullYear()));let l=!t.selectionMonthsMode||i.getFullYear()<o.getFullYear()||i.getFullYear()===o.getFullYear()&&i.getMonth()<o.getMonth(),c=!t.selectionMonthsMode||r.getFullYear()>a.getFullYear()||r.getFullYear()===a.getFullYear()&&r.getMonth()>a.getMonth()-(t.context.displayMonthsCount-1);$c(e,n,l,c)},Jf=(t,e,n)=>{let s=P(t.context.dateMin),i=P(t.context.dateMax),r=!!(s.getFullYear()&&t.context.displayYear-7<=s.getFullYear()),o=!!(i.getFullYear()&&t.context.displayYear+7>=i.getFullYear());$c(e,n,r,o)},Rs=t=>{if(t.context.currentType==="month")return;let e=t.context.mainElement.querySelector('[data-vc-arrow="prev"]'),n=t.context.mainElement.querySelector('[data-vc-arrow="next"]');e&&n&&{default:()=>Qf(t,e,n),year:()=>Jf(t,e,n)}[t.context.currentType==="multiple"?"default":t.context.currentType]()},ep=(t,e,n,s,i)=>{let r=new Date(s.setFullYear(t.context.selectedYear,t.context.selectedMonth+n)).getFullYear(),o=new Date(s.setMonth(t.context.selectedMonth+n)).getMonth(),a=t.context.locale.months.long[o],l=e.closest('[data-vc="column"]');l&&(l.ariaLabel=`${a} ${r}`);let c={month:{id:o,label:a},year:{id:r,label:r}};e.innerText=String(c[i].label),e.dataset[`vc${i.charAt(0).toUpperCase()+i.slice(1)}`]=String(c[i].id),e.ariaLabel=`${t.labels[i]} ${c[i].label}`;let h={month:t.selectionMonthsMode,year:t.selectionYearsMode},u=h[i]===!1||h[i]==="only-arrows";u&&(e.tabIndex=-1),e.disabled=u},Tn=t=>{let e=t.context.mainElement.querySelectorAll('[data-vc="month"]'),n=t.context.mainElement.querySelectorAll('[data-vc="year"]'),s=new Date(t.context.selectedYear,t.context.selectedMonth,1);[e,n].forEach(i=>i?.forEach((r,o)=>ep(t,r,o,s,r.dataset.vc)))},yo=(t,e,n,s,i)=>{var r;let o={month:{selected:"data-vc-months-month-selected",aria:"aria-selected",value:"vcMonthsMonth",selectedProperty:"selectedMonth"},year:{selected:"data-vc-years-year-selected",aria:"aria-selected",value:"vcYearsYear",selectedProperty:"selectedYear"}};i&&((r=t.context.mainElement.querySelectorAll({month:"[data-vc-months-month]",year:"[data-vc-years-year]"}[n]))==null||r.forEach(a=>{a.removeAttribute(o[n].selected),a.removeAttribute(o[n].aria)}),L(t,o[n].selectedProperty,Number(e.dataset[o[n].value])),Tn(t),n==="year"&&Rs(t)),s&&(e.setAttribute(o[n].selected,""),e.setAttribute(o[n].aria,"true"))},Eo=(t,e)=>{var n;if(t.type!=="multiple")return{currentValue:null,columnID:0};let s=t.context.mainElement.querySelectorAll('[data-vc="column"]'),i=Array.from(s).findIndex(r=>r.closest(`[data-vc-column="${e}"]`));return{currentValue:i>=0?Number((n=s[i].querySelector(`[data-vc="${e}"]`))==null?void 0:n.getAttribute(`data-vc-${e}`)):null,columnID:Math.max(i,0)}},tp=(t,e,n,s,i,r,o)=>{let a=e.cloneNode(!1);return a.className=t.styles.monthsMonth,a.innerText=s,a.ariaLabel=i,a.role="gridcell",a.dataset.vcMonthsMonth=`${o}`,r&&(a.ariaDisabled="true"),r&&(a.tabIndex=-1),a.disabled=r,yo(t,a,"month",n===o,!1),a},Hc=(t,e)=>{var n,s;let i=(n=e?.closest('[data-vc="header"]'))==null?void 0:n.querySelector('[data-vc="year"]'),r=i?Number(i.dataset.vcYear):t.context.selectedYear,o=e?.dataset.vcMonth?Number(e.dataset.vcMonth):t.context.selectedMonth;L(t,"currentType","month"),_o(t,e),Tn(t);let a=t.context.mainElement.querySelector('[data-vc="months"]');if(!t.selectionMonthsMode||!a)return;let l=t.monthsToSwitch>1?t.context.locale.months.long.map((h,u)=>o-t.monthsToSwitch*u).concat(t.context.locale.months.long.map((h,u)=>o+t.monthsToSwitch*u)).filter(h=>h>=0&&h<=12):Array.from(Array(12).keys()),c=document.createElement("button");c.type="button";for(let h=0;h<12;h++){let u=P(t.context.dateMin),m=P(t.context.dateMax),f=t.context.displayMonthsCount-1,{columnID:g}=Eo(t,"month"),_=r<=u.getFullYear()&&h<u.getMonth()+g||r>=m.getFullYear()&&h>m.getMonth()-f+g||r>m.getFullYear()||h!==o&&!l.includes(h),S=tp(t,c,o,t.context.locale.months.short[h],t.context.locale.months.long[h],_,h);a.appendChild(S),t.onCreateMonthEls&&t.onCreateMonthEls(t,S)}(s=t.context.mainElement.querySelector("[data-vc-months-month]:not([disabled])"))==null||s.focus()},Fl=(t,e,n,s,i)=>`
97
+ <label class="${e}" data-vc-time-input="${t}">
98
+ <input type="text" name="${t}" maxlength="2" aria-label="${n[`input${t.charAt(0).toUpperCase()+t.slice(1)}`]}" value="${s}" ${i?"disabled":""}>
99
+ </label>
100
+ `,$l=(t,e,n,s,i,r,o)=>`
101
+ <label class="${e}" data-vc-time-range="${t}">
102
+ <input type="range" name="${t}" min="${s}" max="${i}" step="${r}" aria-label="${n[`range${t.charAt(0).toUpperCase()+t.slice(1)}`]}" value="${o}">
103
+ </label>
104
+ `,gn=(t,e,n,s)=>{({hour:()=>L(t,"selectedHours",n),minute:()=>L(t,"selectedMinutes",n)})[s](),L(t,"selectedTime",`${t.context.selectedHours}:${t.context.selectedMinutes}${t.context.selectedKeeping?` ${t.context.selectedKeeping}`:""}`),t.onChangeTime&&t.onChangeTime(t,e,!1),t.inputMode&&t.context.inputElement&&t.context.mainElement&&t.onChangeToInput&&t.onChangeToInput(t,e)},Ds=(t,e)=>{var n;return((n={0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"00",PM:"12"}}[Number(t)])==null?void 0:n[e])||String(t)},np=(t,e,n,s,i)=>{let r=o=>{let a=t.context.selectedKeeping==="AM"?"PM":"AM",l=Ds(t.context.selectedHours,a);Number(l)<=s&&Number(l)>=i?(L(t,"selectedKeeping",a),n.value=l,gn(t,o,t.context.selectedHours,"hour"),e.ariaLabel=`${t.labels.btnKeeping} ${t.context.selectedKeeping}`,e.innerText=t.context.selectedKeeping):t.onChangeTime&&t.onChangeTime(t,o,!0)};return e.addEventListener("click",r),()=>{e.removeEventListener("click",r)}},vn=t=>({0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"})[Number(t)]||String(t),ds=(t,e,n,s)=>{t.value=n,e.value=s},sp=(t,e,n)=>{e&&n&&(L(t,"selectedKeeping",n),e.innerText=n)},Hl=(t,e,n,s,i,r,o)=>{let a={hour:(c,h,u)=>{t.selectionTimeMode&&{12:()=>{if(!t.context.selectedKeeping)return;let m=Number(Ds(h,t.context.selectedKeeping));if(!(m<=r&&m>=o))return ds(n,e,t.context.selectedHours,t.context.selectedHours),void(t.onChangeTime&&t.onChangeTime(t,u,!0));ds(n,e,vn(h),Ds(h,t.context.selectedKeeping)),c>12&&sp(t,s,"PM"),gn(t,u,vn(h),i)},24:()=>{if(!(c<=r&&c>=o))return ds(n,e,t.context.selectedHours,t.context.selectedHours),void(t.onChangeTime&&t.onChangeTime(t,u,!0));ds(n,e,h,h),gn(t,u,h,i)}}[t.selectionTimeMode]()},minute:(c,h,u)=>{if(!(c<=r&&c>=o))return n.value=t.context.selectedMinutes,void(t.onChangeTime&&t.onChangeTime(t,u,!0));n.value=h,e.value=h,gn(t,u,h,i)}},l=c=>{let h=Number(n.value),u=n.value.padStart(2,"0");a[i]&&a[i](h,u,c)};return n.addEventListener("change",l),()=>{n.removeEventListener("change",l)}},ip=(t,e,n,s,i)=>{e.value=i,gn(t,n,i,s)},rp=(t,e,n)=>{e&&(L(t,"selectedKeeping",n),e.innerText=n)},Vl=(t,e,n,s,i)=>{let r=o=>{let a=Number(e.value),l=e.value.padStart(2,"0"),c=i==="hour",h=t.selectionTimeMode===24,u=a>0&&a<12;c&&!h&&rp(t,s,a===0||u?"AM":"PM"),ip(t,n,o,i,!c||h||u?l:vn(e.value))};return e.addEventListener("input",r),()=>{e.removeEventListener("input",r)}},Bl=t=>t.setAttribute("data-vc-input-focus",""),ql=t=>t.removeAttribute("data-vc-input-focus"),op=(t,e)=>{let n=e.querySelector('[data-vc-time-range="hour"] input[name="hour"]'),s=e.querySelector('[data-vc-time-range="minute"] input[name="minute"]'),i=e.querySelector('[data-vc-time-input="hour"] input[name="hour"]'),r=e.querySelector('[data-vc-time-input="minute"] input[name="minute"]'),o=e.querySelector('[data-vc-time="keeping"]');if(!(n&&s&&i&&r))return;let a=c=>{c.target===n&&Bl(i),c.target===s&&Bl(r)},l=c=>{c.target===n&&ql(i),c.target===s&&ql(r)};return e.addEventListener("mouseover",a),e.addEventListener("mouseout",l),Hl(t,n,i,o,"hour",t.timeMaxHour,t.timeMinHour),Hl(t,s,r,o,"minute",t.timeMaxMinute,t.timeMinMinute),Vl(t,n,i,o,"hour"),Vl(t,s,r,o,"minute"),o&&np(t,o,n,t.timeMaxHour,t.timeMinHour),()=>{e.removeEventListener("mouseover",a),e.removeEventListener("mouseout",l)}},ap=t=>{let e=t.context.mainElement.querySelector('[data-vc="time"]');if(!t.selectionTimeMode||!e)return;let[n,s]=[t.timeMinHour,t.timeMaxHour],[i,r]=[t.timeMinMinute,t.timeMaxMinute],o=t.context.selectedKeeping?Ds(t.context.selectedHours,t.context.selectedKeeping):t.context.selectedHours,a=t.timeControls==="range";var l;e.innerHTML=t.sanitizerHTML(`
105
+ <div class="${t.styles.timeContent}" data-vc-time="content">
106
+ ${Fl("hour",t.styles.timeHour,t.labels,t.context.selectedHours,a)}
107
+ ${Fl("minute",t.styles.timeMinute,t.labels,t.context.selectedMinutes,a)}
108
+ ${t.selectionTimeMode===12?(l=t.context.selectedKeeping,`<button type="button" class="${t.styles.timeKeeping}" aria-label="${t.labels.btnKeeping} ${l}" data-vc-time="keeping" ${a?"disabled":""}>${l}</button>`):""}
109
+ </div>
110
+ <div class="${t.styles.timeRanges}" data-vc-time="ranges">
111
+ ${$l("hour",t.styles.timeRange,t.labels,n,s,t.timeStepHour,o)}
112
+ ${$l("minute",t.styles.timeRange,t.labels,i,r,t.timeStepMinute,t.context.selectedMinutes)}
113
+ </div>
114
+ `),op(t,e)},Wl=t=>{let e=t.selectedWeekends?[...t.selectedWeekends]:[],n=[...t.context.locale.weekdays.long].reduce((i,r,o)=>[...i,{id:o,titleShort:t.context.locale.weekdays.short[o],titleLong:r,isWeekend:e.includes(o)}],[]),s=[...n.slice(t.firstWeekday),...n.slice(0,t.firstWeekday)];t.context.mainElement.querySelectorAll('[data-vc="week"]').forEach(i=>{let r=t.onClickWeekDay?document.createElement("button"):document.createElement("b");t.onClickWeekDay&&(r.type="button"),s.forEach(o=>{let a=r.cloneNode(!0);a.innerText=o.titleShort,a.className=t.styles.weekDay,a.role="columnheader",a.ariaLabel=o.titleLong,a.dataset.vcWeekDay=String(o.id),o.isWeekend&&(a.dataset.vcWeekDayOff=""),i.appendChild(a)})})},lp=(t,e,n,s,i)=>{let r=e.cloneNode(!1);return r.className=t.styles.yearsYear,r.innerText=String(i),r.ariaLabel=String(i),r.role="gridcell",r.dataset.vcYearsYear=`${i}`,s&&(r.ariaDisabled="true"),s&&(r.tabIndex=-1),r.disabled=s,yo(t,r,"year",n===i,!1),r},wo=(t,e)=>{var n;let s=e?.dataset.vcYear?Number(e.dataset.vcYear):t.context.selectedYear;L(t,"currentType","year"),_o(t,e),Tn(t),Rs(t);let i=t.context.mainElement.querySelector('[data-vc="years"]');if(!t.selectionYearsMode||!i)return;let r=t.type!=="multiple"||t.context.selectedYear===s?0:1,o=document.createElement("button");o.type="button";for(let a=t.context.displayYear-7;a<t.context.displayYear+8;a++){let l=a<P(t.context.dateMin).getFullYear()+r||a>P(t.context.dateMax).getFullYear(),c=lp(t,o,s,l,a);i.appendChild(c),t.onCreateYearEls&&t.onCreateYearEls(t,c)}(n=t.context.mainElement.querySelector("[data-vc-years-year]:not([disabled])"))==null||n.focus()},cp=(t,e,n)=>{new MutationObserver(s=>{for(let i=0;i<s.length;i++)if(s[i].attributeName===e){n();break}}).observe(t,{attributes:!0})},Ms={value:!1,set:()=>Ms.value=!0,check:()=>Ms.value},Wt=(t,e)=>t.dataset.vcTheme=e,Yl=(t,e)=>{if(Wt(t.context.mainElement,e.matches?"dark":"light"),t.selectedTheme!=="system"||Ms.check())return;let n=s=>{document.querySelectorAll('[data-vc="calendar"]')?.forEach(i=>Wt(i,s.matches?"dark":"light"))};e.addEventListener?e.addEventListener("change",n):e.addListener(n),Ms.set()},hp=(t,e)=>{let n=t.themeAttrDetect.length?document.querySelector(t.themeAttrDetect):null,s=t.themeAttrDetect.replace(/^.*\[(.+)\]/g,(r,o)=>o);if(!n||n.getAttribute(s)==="system")return void Yl(t,e);let i=n.getAttribute(s);i?(Wt(t.context.mainElement,i),cp(n,s,()=>{let r=n.getAttribute(s);r&&Wt(t.context.mainElement,r)})):Yl(t,e)},up=t=>{window.matchMedia("(prefers-color-scheme)").media!=="not all"?t.selectedTheme==="system"?hp(t,window.matchMedia("(prefers-color-scheme: dark)")):Wt(t.context.mainElement,t.selectedTheme):Wt(t.context.mainElement,"light")},xs=t=>t.charAt(0).toUpperCase()+t.slice(1).replace(/\./,""),dp=(t,e,n)=>{let s=new Date(`1978-01-0${e+1}T00:00:00.000Z`),i=s.toLocaleString(n,{weekday:"short",timeZone:"UTC"}),r=s.toLocaleString(n,{weekday:"long",timeZone:"UTC"});t.context.locale.weekdays.short.push(xs(i)),t.context.locale.weekdays.long.push(xs(r))},mp=(t,e,n)=>{let s=new Date(`1978-${String(e+1).padStart(2,"0")}-01T00:00:00.000Z`),i=s.toLocaleString(n,{month:"short",timeZone:"UTC"}),r=s.toLocaleString(n,{month:"long",timeZone:"UTC"});t.context.locale.months.short.push(xs(i)),t.context.locale.months.long.push(xs(r))},fp=t=>{var e,n,s,i,r,o,a,l;if(!(t.context.locale.weekdays.short[6]&&t.context.locale.weekdays.long[6]&&t.context.locale.months.short[11]&&t.context.locale.months.long[11]))if(typeof t.locale=="string"){if(typeof t.locale=="string"&&!t.locale.length)throw new Error(nt.notLocale);Array.from({length:7},(c,h)=>dp(t,h,t.locale)),Array.from({length:12},(c,h)=>mp(t,h,t.locale))}else{if(!((n=(e=t.locale)==null?void 0:e.weekdays)!=null&&n.short[6]&&((i=(s=t.locale)==null?void 0:s.weekdays)!=null&&i.long[6])&&((o=(r=t.locale)==null?void 0:r.months)!=null&&o.short[11])&&((l=(a=t.locale)==null?void 0:a.months)!=null&&l.long[11])))throw new Error(nt.notLocale);L(t,"locale",qt({},t.locale))}},Ps=t=>{up(t),fp(t),_o(t),Tn(t),Rs(t),ap(t),{default:()=>{Wl(t),eo(t)},multiple:()=>{Wl(t),eo(t)},month:()=>Hc(t),year:()=>wo(t)}[t.context.currentType]()},Vc=t=>{let e=n=>{var s;let i=n.target;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(n.key)||i.localName!=="button")return;let r=Array.from(t.context.mainElement.querySelectorAll('[data-vc="calendar"] button')),o=r.indexOf(i);if(o===-1)return;let a=(l=r[o]).hasAttribute("data-vc-date-btn")?7:l.hasAttribute("data-vc-months-month")?4:l.hasAttribute("data-vc-years-year")?5:1;var l;(s=r[(0,{ArrowUp:()=>Math.max(0,o-a),ArrowDown:()=>Math.min(r.length-1,o+a),ArrowLeft:()=>Math.max(0,o-1),ArrowRight:()=>Math.min(r.length-1,o+1)}[n.key])()])==null||s.focus()};return t.context.mainElement.addEventListener("keydown",e),()=>t.context.mainElement.removeEventListener("keydown",e)},to=(t,e)=>{let n=P(yt(new Date(t.context.selectedYear,t.context.selectedMonth,1)));({prev:()=>n.setMonth(n.getMonth()-t.monthsToSwitch),next:()=>n.setMonth(n.getMonth()+t.monthsToSwitch)})[e](),L(t,"selectedMonth",n.getMonth()),L(t,"selectedYear",n.getFullYear()),Tn(t),Rs(t),eo(t)},pp=(t,e)=>{let n=e.target.closest("[data-vc-arrow]");if(n){if(["default","multiple"].includes(t.context.currentType))to(t,n.dataset.vcArrow);else if(t.context.currentType==="year"&&t.context.displayYear!==void 0){let s={prev:-15,next:15}[n.dataset.vcArrow];L(t,"displayYear",t.context.displayYear+s),wo(t,e.target)}t.onClickArrow&&t.onClickArrow(t,e)}},Bc=(t,e)=>e===void 0||(typeof e=="function"?e(t):e),no=t=>Bc(t,t.enableDateToggle),Kl=(t,e,n)=>{let s=e.dataset.vcDate,i=e.closest("[data-vc-date][data-vc-date-selected]"),r=no(t);if(i&&!r)return;let o=i?t.context.selectedDates.filter(a=>a!==s):n?[...t.context.selectedDates,s]:[s];L(t,"selectedDates",o)},Pe=(t,e,n)=>{if(!e)return;if(!n)return e.dataset.vcDateRangeTooltip="hidden",void(e.textContent="");let s=t.context.mainElement.getBoundingClientRect(),i=n.getBoundingClientRect();e.style.left=i.left-s.left+i.width/2+"px",e.style.top=i.bottom-s.top-i.height+"px",e.dataset.vcDateRangeTooltip="visible",e.innerHTML=t.sanitizerHTML(t.onCreateDateRangeTooltip(t,n,e,i,s))},A={self:null,lastDateEl:null,isHovering:!1,rangeMin:void 0,rangeMax:void 0,tooltipEl:null,timeoutId:null},gp=(t,e,n)=>{var s,i,r;if(!((i=(s=A.self)==null?void 0:s.context)!=null&&i.selectedDates[0]))return;let o=yt(t);(r=A.self.context.disableDates)!=null&&r.includes(o)||(A.self.context.mainElement.querySelectorAll(`[data-vc-date="${o}"]`).forEach(a=>a.dataset.vcDateHover=""),e.forEach(a=>a.dataset.vcDateHover="first"),n.forEach(a=>{a.dataset.vcDateHover==="first"?a.dataset.vcDateHover="first-and-last":a.dataset.vcDateHover="last"}))},_n=()=>{var t,e;(e=(t=A.self)==null?void 0:t.context)!=null&&e.mainElement&&A.self.context.mainElement.querySelectorAll("[data-vc-date-hover]").forEach(n=>n.removeAttribute("data-vc-date-hover"))},bp=t=>{var e,n;if(!t||!((n=(e=A.self)==null?void 0:e.context)!=null&&n.selectedDates[0]))return;if(!t.closest('[data-vc="dates"]'))return A.lastDateEl=null,Pe(A.self,A.tooltipEl,null),void _n();let s=t.closest("[data-vc-date]");if(!s||A.lastDateEl===s)return;A.lastDateEl=s,Pe(A.self,A.tooltipEl,s),_n();let i=s.dataset.vcDate,r=P(A.self.context.selectedDates[0]),o=P(i),a=A.self.context.mainElement.querySelectorAll(`[data-vc-date="${A.self.context.selectedDates[0]}"]`),l=A.self.context.mainElement.querySelectorAll(`[data-vc-date="${i}"]`),[c,h]=r<o?[a,l]:[l,a],[u,m]=r<o?[r,o]:[o,r];for(let f=new Date(u);f<=m;f.setDate(f.getDate()+1))gp(f,c,h)},vp=t=>{let e=t?.closest("[data-vc-date-selected]");if(!e&&A.lastDateEl)return A.lastDateEl=null,void Pe(A.self,A.tooltipEl,null);e&&A.lastDateEl!==e&&(A.lastDateEl=e,Pe(A.self,A.tooltipEl,e))},qc=t=>e=>{let n=e.target;A.isHovering||(A.isHovering=!0,requestAnimationFrame(()=>{t(n),A.isHovering=!1}))},bs=qc(bp),ms=qc(vp),pn=t=>{A.self&&t.key==="Escape"&&(A.lastDateEl=null,L(A.self,"selectedDates",[]),A.self.context.mainElement.removeEventListener("mousemove",bs),A.self.context.mainElement.removeEventListener("keydown",pn),Pe(A.self,A.tooltipEl,null),_n())},ft=()=>{A.timeoutId!==null&&clearTimeout(A.timeoutId),A.timeoutId=setTimeout(()=>{A.lastDateEl=null,Pe(A.self,A.tooltipEl,null),_n()},50)},_p=()=>{var t,e,n,s;if(!((n=(e=(t=A.self)==null?void 0:t.context)==null?void 0:e.selectedDates)!=null&&n[0])||!((s=A.self.context.disableDates)!=null&&s[0]))return;let i=P(A.self.context.selectedDates[0]),[r,o]=A.self.context.disableDates.map(a=>P(a)).reduce(([a,l],c)=>[i>=c?c:a,i<c&&l===null?c:l],[null,null]);r&&L(A.self,"displayDateMin",yt(new Date(r.setDate(r.getDate()+1)))),o&&L(A.self,"displayDateMax",yt(new Date(o.setDate(o.getDate()-1)))),A.self.disableDatesPast&&!A.self.disableAllDates&&P(A.self.context.displayDateMin)<P(A.self.context.dateToday)&&L(A.self,"displayDateMin",A.self.context.dateToday)},Wc=(t,e)=>{A.self=t,A.lastDateEl=e,_n(),t.disableDatesGaps&&(A.rangeMin=A.rangeMin?A.rangeMin:t.context.displayDateMin,A.rangeMax=A.rangeMax?A.rangeMax:t.context.displayDateMax),t.onCreateDateRangeTooltip&&(A.tooltipEl=t.context.mainElement.querySelector("[data-vc-date-range-tooltip]"));let n=e?.dataset.vcDate;if(n){let s=t.context.selectedDates.length===1&&t.context.selectedDates[0].includes(n),i=s&&!no(t)?[n,n]:s&&no(t)?[]:t.context.selectedDates.length>1?[n]:[...t.context.selectedDates,n];L(t,"selectedDates",i),t.context.selectedDates.length>1&&t.context.selectedDates.sort((r,o)=>+new Date(r)-+new Date(o))}({set:()=>(t.disableDatesGaps&&_p(),Pe(A.self,A.tooltipEl,e),A.self.context.mainElement.removeEventListener("mousemove",ms),A.self.context.mainElement.removeEventListener("mouseleave",ft),A.self.context.mainElement.removeEventListener("keydown",pn),A.self.context.mainElement.addEventListener("mousemove",bs),A.self.context.mainElement.addEventListener("mouseleave",ft),A.self.context.mainElement.addEventListener("keydown",pn),()=>{A.self.context.mainElement.removeEventListener("mousemove",bs),A.self.context.mainElement.removeEventListener("mouseleave",ft),A.self.context.mainElement.removeEventListener("keydown",pn)}),reset:()=>{let[s,i]=[t.context.selectedDates[0],t.context.selectedDates[t.context.selectedDates.length-1]],r=t.context.selectedDates[0]!==t.context.selectedDates[t.context.selectedDates.length-1],o=Fe([`${s}:${i}`]).filter(l=>!t.context.disableDates.includes(l)),a=r?t.enableEdgeDatesOnly?[s,i]:o:[t.context.selectedDates[0],t.context.selectedDates[0]];if(L(t,"selectedDates",a),t.disableDatesGaps&&(L(t,"displayDateMin",A.rangeMin),L(t,"displayDateMax",A.rangeMax)),A.self.context.mainElement.removeEventListener("mousemove",bs),A.self.context.mainElement.removeEventListener("mouseleave",ft),A.self.context.mainElement.removeEventListener("keydown",pn),t.onCreateDateRangeTooltip)return t.context.selectedDates[0]||(A.self.context.mainElement.removeEventListener("mousemove",ms),A.self.context.mainElement.removeEventListener("mouseleave",ft),Pe(A.self,A.tooltipEl,null)),t.context.selectedDates[0]&&(A.self.context.mainElement.addEventListener("mousemove",ms),A.self.context.mainElement.addEventListener("mouseleave",ft),Pe(A.self,A.tooltipEl,e)),()=>{A.self.context.mainElement.removeEventListener("mousemove",ms),A.self.context.mainElement.removeEventListener("mouseleave",ft)}}})[t.context.selectedDates.length===1?"set":"reset"]()},Nr=t=>{t.context.mainElement.querySelectorAll("[data-vc-date]").forEach(e=>{let n=e.querySelector("[data-vc-date-btn]"),s=e.dataset.vcDate,i=P(s).getDay();Pc(t,t.context.selectedYear,e,n,i,s,"current")})},yp=(t,e)=>{var n;let s=e.target,i=s.closest("[data-vc-date-btn]");if(!t.selectionDatesMode||!["single","multiple","multiple-ranged"].includes(t.selectionDatesMode)||!i)return;let r=i.closest("[data-vc-date]");({single:()=>Kl(t,r,!1),multiple:()=>Kl(t,r,!0),"multiple-ranged":()=>Wc(t,r)})[t.selectionDatesMode](),(n=t.context.selectedDates)==null||n.sort((l,c)=>+new Date(l)-+new Date(c)),t.onClickDate&&t.onClickDate(t,e),t.inputMode&&t.context.inputElement&&t.context.mainElement&&t.onChangeToInput&&t.onChangeToInput(t,e);let o=s.closest('[data-vc-date-month="prev"]'),a=s.closest('[data-vc-date-month="next"]');({prev:()=>t.enableMonthChangeOnDayClick?to(t,"prev"):Nr(t),next:()=>t.enableMonthChangeOnDayClick?to(t,"next"):Nr(t),current:()=>Nr(t)})[o?"prev":a?"next":"current"]()},Ep=["month","year"],Yc=(t,e,n)=>{let{currentValue:s,columnID:i}=Eo(t,e);return t.context.currentType==="month"&&i>=0?n-i:t.context.currentType==="year"&&t.context.selectedYear!==s?n-1:n},wp=(t,e)=>{let n=Yc(t,"year",Number(e.dataset.vcYearsYear)),s=P(t.context.dateMin),i=P(t.context.dateMax),r=t.context.displayMonthsCount-1,{columnID:o}=Eo(t,"year"),a=t.context.selectedMonth<s.getMonth()&&n<=s.getFullYear(),l=t.context.selectedMonth>i.getMonth()-r+o&&n>=i.getFullYear(),c=n<s.getFullYear(),h=n>i.getFullYear(),u=a||c?s.getFullYear():l||h?i.getFullYear():n,m=a||c?s.getMonth():l||h?i.getMonth()-r+o:t.context.selectedMonth;L(t,"selectedYear",u),L(t,"selectedMonth",m)},Sp=(t,e)=>{let n=e.closest('[data-vc-column="month"]').querySelector('[data-vc="year"]'),s=Yc(t,"month",Number(e.dataset.vcMonthsMonth)),i=Number(n.dataset.vcYear),r=P(t.context.dateMin),o=P(t.context.dateMax),a=s<r.getMonth()&&i<=r.getFullYear(),l=s>o.getMonth()&&i>=o.getFullYear();L(t,"selectedYear",i),L(t,"selectedMonth",a?r.getMonth():l?o.getMonth():s)},Tp=(t,e,n,s)=>{var i;({year:()=>{if(t.type==="multiple")return wp(t,s);L(t,"selectedYear",Number(s.dataset.vcYearsYear))},month:()=>{if(t.type==="multiple")return Sp(t,s);L(t,"selectedMonth",Number(s.dataset.vcMonthsMonth))}})[n](),{year:()=>{var r;return(r=t.onClickYear)==null?void 0:r.call(t,t,e)},month:()=>{var r;return(r=t.onClickMonth)==null?void 0:r.call(t,t,e)}}[n](),t.context.currentType!==t.type?(L(t,"currentType",t.type),Ps(t),(i=t.context.mainElement.querySelector(`[data-vc="${n}"]`))==null||i.focus()):yo(t,s,n,!0,!0)},Ap=(t,e,n)=>{var s;let i=e.target,r=i.closest(`[data-vc="${n}"]`),o={year:()=>wo(t,i),month:()=>Hc(t,i)};if(r&&t.onClickTitle&&t.onClickTitle(t,e),r&&t.context.currentType!==n)return o[n]();let a=i.closest(`[data-vc-${n}s-${n}]`);if(a)return Tp(t,e,n,a);let l=i.closest('[data-vc="grid"]'),c=i.closest('[data-vc="column"]');(t.context.currentType===n&&r||t.type==="multiple"&&t.context.currentType===n&&l&&!c)&&(L(t,"currentType",t.type),Ps(t),(s=t.context.mainElement.querySelector(`[data-vc="${n}"]`))==null||s.focus())},Cp=(t,e)=>{let n={month:t.selectionMonthsMode,year:t.selectionYearsMode};Ep.forEach(s=>{n[s]&&e.target&&Ap(t,e,s)})},Dp=(t,e)=>{if(!t.enableWeekNumbers||!t.onClickWeekNumber)return;let n=e.target.closest("[data-vc-week-number]"),s=t.context.mainElement.querySelectorAll("[data-vc-date-week-number]");if(!n||!s[0])return;let i=Number(n.innerText),r=Number(n.dataset.vcWeekYear),o=Array.from(s).filter(a=>Number(a.dataset.vcDateWeekNumber)===i);t.onClickWeekNumber(t,i,r,o,e)},Mp=(t,e)=>{if(!t.onClickWeekDay)return;let n=e.target.closest("[data-vc-week-day]"),s=e.target.closest('[data-vc="column"]'),i=s?s.querySelectorAll("[data-vc-date-week-day]"):t.context.mainElement.querySelectorAll("[data-vc-date-week-day]");if(!n||!i[0])return;let r=Number(n.dataset.vcWeekDay),o=Array.from(i).filter(a=>Number(a.dataset.vcDateWeekDay)===r);t.onClickWeekDay(t,r,o,e)},Kc=t=>{let e=n=>{pp(t,n),Mp(t,n),Dp(t,n),yp(t,n),Cp(t,n)};return t.context.mainElement.addEventListener("click",e),()=>t.context.mainElement.removeEventListener("click",e)},xp=t=>{if(t.type==="multiple"&&(t.displayMonthsCount<=1||t.displayMonthsCount>12))throw new Error(nt.incorrectMonthsCount);if(t.type!=="multiple"&&t.displayMonthsCount>1)throw new Error(nt.incorrectMonthsCount);L(t,"displayMonthsCount",t.displayMonthsCount?t.displayMonthsCount:t.type==="multiple"?2:1)},Lp=()=>{let t=new Date;return new Date(t.getTime()-6e4*t.getTimezoneOffset()).toISOString().substring(0,10)},pt=(t,e)=>t==="today"?Lp():t instanceof Date||typeof t=="number"||typeof t=="string"?Fe([t])[0]:e,Op=t=>{var e,n,s;let i=pt(t.dateMin,t.dateMin),r=pt(t.dateMax,t.dateMax),o=pt(t.displayDateMin,i),a=pt(t.displayDateMax,r);L(t,"dateToday",pt(t.dateToday,t.dateToday)),L(t,"displayDateMin",o?P(i)>=P(o)?i:o:i),L(t,"displayDateMax",a?P(r)<=P(a)?r:a:r);let l=t.disableDatesPast&&!t.disableAllDates&&P(o)<P(t.context.dateToday);L(t,"displayDateMin",l||t.disableAllDates?t.context.dateToday:o),L(t,"displayDateMax",t.disableAllDates?t.context.dateToday:a),L(t,"disableDates",t.disableDates[0]&&!t.disableAllDates?Fe(t.disableDates):t.disableAllDates?[t.context.displayDateMin]:[]),t.context.disableDates.length>1&&t.context.disableDates.sort((c,h)=>+new Date(c)-+new Date(h)),L(t,"enableDates",t.enableDates[0]?Fe(t.enableDates):[]),(e=t.context.enableDates)!=null&&e[0]&&(n=t.context.disableDates)!=null&&n[0]&&L(t,"disableDates",t.context.disableDates.filter(c=>!t.context.enableDates.includes(c))),t.context.enableDates.length>1&&t.context.enableDates.sort((c,h)=>+new Date(c)-+new Date(h)),(s=t.context.enableDates)!=null&&s[0]&&t.disableAllDates&&(L(t,"displayDateMin",t.context.enableDates[0]),L(t,"displayDateMax",t.context.enableDates[t.context.enableDates.length-1])),L(t,"dateMin",t.displayDisabledDates?i:t.context.displayDateMin),L(t,"dateMax",t.displayDisabledDates?r:t.context.displayDateMax)},Np=t=>{var e;L(t,"selectedDates",(e=t.selectedDates)!=null&&e[0]?Fe(t.selectedDates):[])},Ip=t=>{let e=i=>{let r=new Date(i);so(t,r.getMonth(),r.getFullYear())};if(t.displayDateMin&&t.displayDateMin!=="today"&&(n=t.displayDateMin,s=new Date,new Date(n).getTime()>s.getTime())){let i=t.selectedDates.length&&t.selectedDates[0]?Fe(t.selectedDates)[0]:t.displayDateMin;return e(P(pt(i,t.displayDateMin))),!0}var n,s;if(t.displayDateMax&&t.displayDateMax!=="today"&&((i,r)=>new Date(i).getTime()<r.getTime())(t.displayDateMax,new Date)){let i=t.selectedDates.length&&t.selectedDates[0]?Fe(t.selectedDates)[0]:t.displayDateMax;return e(P(pt(i,t.displayDateMax))),!0}return!1},so=(t,e,n)=>{L(t,"selectedMonth",e),L(t,"selectedYear",n),L(t,"displayYear",n)},kp=t=>{var e;if(t.enableJumpToSelectedDate&&((e=t.selectedDates)!=null&&e[0])&&t.selectedMonth===void 0&&t.selectedYear===void 0){let i=P(Fe(t.selectedDates)[0]);return void so(t,i.getMonth(),i.getFullYear())}if(Ip(t))return;let n=t.selectedMonth!==void 0&&Number(t.selectedMonth)>=0&&Number(t.selectedMonth)<12,s=t.selectedYear!==void 0&&Number(t.selectedYear)>=0&&Number(t.selectedYear)<=9999;so(t,n?Number(t.selectedMonth):P(t.context.dateToday).getMonth(),s?Number(t.selectedYear):P(t.context.dateToday).getFullYear())},Rp=t=>{var e,n,s;if(!t.selectionTimeMode)return;if(![12,24].includes(t.selectionTimeMode))throw new Error(nt.incorrectTime);let i=t.selectionTimeMode===12,r=i?/^(0[1-9]|1[0-2]):([0-5][0-9]) ?(AM|PM)?$/i:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/,[o,a,l]=(s=(n=(e=t.selectedTime)==null?void 0:e.match(r))==null?void 0:n.slice(1))!=null?s:[];o?i&&!l&&(l="AM"):(o=i?vn(String(t.timeMinHour)):String(t.timeMinHour),a=String(t.timeMinMinute),l=i?Number(vn(String(t.timeMinHour)))>=12?"PM":"AM":null),L(t,"selectedHours",o.padStart(2,"0")),L(t,"selectedMinutes",a.padStart(2,"0")),L(t,"selectedKeeping",l),L(t,"selectedTime",`${t.context.selectedHours}:${t.context.selectedMinutes}${l?` ${l}`:""}`)},Uc=t=>{L(t,"currentType",t.type),xp(t),Op(t),kp(t),Np(t),Rp(t)},jc=(t,{year:e,month:n,dates:s,time:i,locale:r},o=!0)=>{var a;let l={year:t.selectedYear,month:t.selectedMonth,dates:t.selectedDates,time:t.selectedTime};t.selectedYear=e?l.year:t.context.selectedYear,t.selectedMonth=n?l.month:t.context.selectedMonth,t.selectedTime=i?l.time:t.context.selectedTime,t.selectedDates=s==="only-first"&&((a=t.context.selectedDates)!=null&&a[0])?[t.context.selectedDates[0]]:s===!0?l.dates:t.context.selectedDates,r&&L(t,"locale",{months:{short:[],long:[]},weekdays:{short:[],long:[]}}),Uc(t),o&&Ps(t),t.selectedYear=l.year,t.selectedMonth=l.month,t.selectedDates=l.dates,t.selectedTime=l.time,t.selectionDatesMode==="multiple-ranged"&&s&&Wc(t,null)},Pp=t=>{let e=document.createElement("div");return e.className=t.styles.calendar,e.dataset.vc="calendar",e.dataset.vcInput="",e.dataset.vcCalendarHidden="",L(t,"inputModeInit",!0),L(t,"isShowInInputMode",!1),L(t,"mainElement",e),document.body.appendChild(t.context.mainElement),jc(t,{year:!0,month:!0,dates:!0,time:!0,locale:!0}),setTimeout(()=>To(t)),t.onInit&&t.onInit(t),Vc(t),Kc(t)},Fp=t=>Bc(t,t.openOnFocus),$p=t=>{L(t,"inputElement",t.context.mainElement);let e=()=>{t.context.inputModeInit?setTimeout(()=>To(t)):Pp(t)};t.context.inputElement.addEventListener("click",e);let n=typeof t.openOnFocus=="function"||t.openOnFocus===!0,s=()=>{vf(t)?yf(t):Fp(t)&&e()};n&&t.context.inputElement.addEventListener("focus",s);let i=r=>{let o=r.key==="Tab"&&!r.shiftKey,a=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(r.key);(o||a)&&(l=>{var c;if(!t.context.isShowInInputMode||document.activeElement!==t.context.inputElement)return!1;let h=m=>m.tabIndex>=0&&!m.hasAttribute("disabled")&&m.getAttribute("aria-disabled")!=="true",u=(c=document.createTreeWalker(t.context.mainElement,NodeFilter.SHOW_ELEMENT,{acceptNode:m=>h(m)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode())!=null?c:h(t.context.mainElement)?t.context.mainElement:null;!u||u.tabIndex<0||(l.preventDefault(),u.focus())})(r)};return t.context.inputElement.addEventListener("keydown",i),()=>{t.context.inputElement.removeEventListener("click",e),n&&t.context.inputElement.removeEventListener("focus",s),t.context.inputElement.removeEventListener("keydown",i)}},Hp=t=>(L(t,"originalElement",t.context.mainElement.cloneNode(!0)),L(t,"isInit",!0),t.inputMode?$p(t):(Uc(t),Ps(t),t.onInit&&t.onInit(t),Vc(t),Kc(t))),zc=(t,e)=>{if(!t.context.isInit)throw new Error(nt.notInit);jc(t,qt(qt({},{year:!0,month:!0,dates:!0,time:!0,locale:!0}),e),!(t.inputMode&&!t.context.inputModeInit)),t.onUpdate&&t.onUpdate(t)},So=(t,e)=>{let n=Object.keys(e);for(let s=0;s<n.length;s++){let i=n[s];typeof t[i]!="object"||typeof e[i]!="object"||e[i]instanceof Date||Array.isArray(e[i])?e[i]!==void 0&&(t[i]=e[i]):So(t[i],e[i])}},Vp=(t,e,n)=>{So(t,e),t.context.isInit&&zc(t,n)};function Bp(t,e){let n="left";if(!e||!t)return n;let{canShow:s,parentPositions:i}=Rc(t,e),r=s.left&&s.right;return(r&&s.bottom?"center":r&&s.top?["top","center"]:Array.isArray(i)?[i[0]==="bottom"?"top":"bottom",...i.slice(1)]:i)||n}var Ul=(t,e,n)=>{if(!t)return;let s=n==="auto"?Bp(t,e):n,i={top:-e.offsetHeight,bottom:t.offsetHeight,left:0,center:t.offsetWidth/2-e.offsetWidth/2,right:t.offsetWidth-e.offsetWidth},r=Array.isArray(s)?s[0]:"bottom",o=Array.isArray(s)?s[1]:s;e.dataset.vcPosition=r;let{top:a,left:l}=go(t),c=a+i[r],h=l+i[o],{vw:u}=bo();if(h+e.clientWidth>u){let m=window.innerWidth-document.body.clientWidth;h=u-e.clientWidth-m}else h<0&&(h=0);Object.assign(e.style,{left:`${h}px`,top:`${c}px`})},To=t=>{if(t.context.isShowInInputMode)return;if(!t.context.currentType)return void t.context.mainElement.click();L(t,"cleanupHandlers",[]),L(t,"isShowInInputMode",!0),t.inputMode&&wf(t.context.mainElement),Ul(t.context.inputElement,t.context.mainElement,t.positionToInput),t.context.mainElement.removeAttribute("data-vc-calendar-hidden");let e=()=>{Ul(t.context.inputElement,t.context.mainElement,t.positionToInput)};window.addEventListener("resize",e),t.context.cleanupHandlers.push(()=>window.removeEventListener("resize",e));let n=i=>{i.key==="Escape"&&Jr(t)};document.addEventListener("keydown",n),t.context.cleanupHandlers.push(()=>document.removeEventListener("keydown",n));let s=i=>{i.target===t.context.inputElement||t.context.mainElement.contains(i.target)||Jr(t)};document.addEventListener("click",s,{capture:!0}),t.context.cleanupHandlers.push(()=>document.removeEventListener("click",s,{capture:!0})),t.onShow&&t.onShow(t)},qp={application:"Calendar",navigation:"Calendar Navigation",arrowNext:{month:"Next month",year:"Next list of years"},arrowPrev:{month:"Previous month",year:"Previous list of years"},month:"Select month, current selected month:",months:"List of months",year:"Select year, current selected year:",years:"List of years",week:"Days of the week",weekNumber:"Numbers of weeks in a year",dates:"Dates in the current month",selectingTime:"Selecting a time ",inputHour:"Hours",inputMinute:"Minutes",rangeHour:"Slider for selecting hours",rangeMinute:"Slider for selecting minutes",btnKeeping:"Switch AM/PM, current position:"},Wp={calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",datesRow:"vc-dates__row",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"},Yp=class{constructor(){M(this,"type","default"),M(this,"inputMode",!1),M(this,"openOnFocus",!0),M(this,"positionToInput","left"),M(this,"firstWeekday",1),M(this,"monthsToSwitch",1),M(this,"themeAttrDetect","html[data-theme]"),M(this,"locale","en"),M(this,"dateToday","today"),M(this,"dateMin","1970-01-01"),M(this,"dateMax","2470-12-31"),M(this,"displayDateMin"),M(this,"displayDateMax"),M(this,"displayDatesOutside",!0),M(this,"displayDisabledDates",!1),M(this,"displayMonthsCount"),M(this,"disableDates",[]),M(this,"disableAllDates",!1),M(this,"disableDatesPast",!1),M(this,"disableDatesGaps",!1),M(this,"disableWeekdays",[]),M(this,"disableToday",!1),M(this,"enableDates",[]),M(this,"enableEdgeDatesOnly",!0),M(this,"enableDateToggle",!0),M(this,"enableWeekNumbers",!1),M(this,"enableMonthChangeOnDayClick",!0),M(this,"enableJumpToSelectedDate",!1),M(this,"selectionDatesMode","single"),M(this,"selectionMonthsMode",!0),M(this,"selectionYearsMode",!0),M(this,"selectionTimeMode",!1),M(this,"selectedDates",[]),M(this,"selectedMonth"),M(this,"selectedYear"),M(this,"selectedHolidays",[]),M(this,"selectedWeekends",[0,6]),M(this,"selectedTime"),M(this,"selectedTheme","system"),M(this,"timeMinHour",0),M(this,"timeMaxHour",23),M(this,"timeMinMinute",0),M(this,"timeMaxMinute",59),M(this,"timeControls","all"),M(this,"timeStepHour",1),M(this,"timeStepMinute",1),M(this,"sanitizerHTML",t=>t),M(this,"onClickDate"),M(this,"onClickWeekDay"),M(this,"onClickWeekNumber"),M(this,"onClickTitle"),M(this,"onClickMonth"),M(this,"onClickYear"),M(this,"onClickArrow"),M(this,"onChangeTime"),M(this,"onChangeToInput"),M(this,"onCreateDateRangeTooltip"),M(this,"onCreateDateEls"),M(this,"onCreateMonthEls"),M(this,"onCreateYearEls"),M(this,"onInit"),M(this,"onUpdate"),M(this,"onDestroy"),M(this,"onShow"),M(this,"onHide"),M(this,"popups",{}),M(this,"labels",qt({},qp)),M(this,"layouts",{default:"",multiple:"",month:"",year:""}),M(this,"styles",qt({},Wp))}},Gc=class io extends Yp{constructor(e,n){var s;super(),M(this,"init",()=>Hp(this)),M(this,"update",i=>zc(this,i)),M(this,"destroy",()=>bf(this)),M(this,"show",()=>To(this)),M(this,"hide",()=>Jr(this)),M(this,"set",(i,r)=>Vp(this,i,r)),M(this,"context"),this.context=gf(qt({},this.context),{locale:{months:{short:[],long:[]},weekdays:{short:[],long:[]}}}),L(this,"mainElement",typeof e=="string"?(s=io.memoizedElements.get(e))!=null?s:this.queryAndMemoize(e):e),n&&So(this,n)}queryAndMemoize(e){let n=document.querySelector(e);if(!n)throw new Error(nt.notFoundSelector(e));return io.memoizedElements.set(e,n),n}};M(Gc,"memoizedElements",new Map);var Kp=Gc,Up="datepicker",st=".bs.datepicker";var jp=`change${st}`,zp=`show${st}`,Gp=`shown${st}`,Xp=`hide${st}`,Zp=`hidden${st}`,Qp=`click${st}.data-api`,Jp=`focusin${st}.data-api`,fs='[data-bs-toggle="datepicker"]';var eg={datepickerTheme:null,dateMin:null,dateMax:null,dateFormat:null,displayElement:null,displayMonthsCount:1,firstWeekday:1,inline:!1,locale:"default",positionElement:null,selectedDates:[],selectionMode:"single",placement:"left",vcpOptions:{}},tg={datepickerTheme:"(null|string)",dateMin:"(null|string|number|object)",dateMax:"(null|string|number|object)",dateFormat:"(null|object|function)",displayElement:"(null|string|element|boolean)",displayMonthsCount:"number",firstWeekday:"number",inline:"boolean",locale:"string",positionElement:"(null|string|element)",selectedDates:"array",selectionMode:"string",placement:"string",vcpOptions:"object"},Ir=class extends te{constructor(t,e){super(t,e),this._calendar=null,this._isShown=!1,this._initCalendar()}static get Default(){return eg}static get DefaultType(){return tg}static get NAME(){return Up}toggle(){if(!this._config.inline)return this._isShown?this.hide():this.show()}show(){this._config.inline||!this._calendar||be(this._element)||this._isShown||d.trigger(this._element,zp).defaultPrevented||(this._calendar.show(),this._isShown=!0,d.trigger(this._element,Gp))}hide(){this._config.inline||this._calendar&&this._isShown&&(d.trigger(this._element,Xp).defaultPrevented||(this._calendar.hide(),this._isShown=!1,d.trigger(this._element,Zp)))}dispose(){this._themeObserver&&(this._themeObserver.disconnect(),this._themeObserver=null),this._calendar&&this._calendar.destroy(),this._calendar=null,super.dispose()}getSelectedDates(){let t=this._calendar?.context?.selectedDates;return t?[...t]:[]}setSelectedDates(t){this._calendar&&this._calendar.set({selectedDates:t})}_initCalendar(){this._isInput=this._element.tagName==="INPUT",this._isInline=this._config.inline,this._isInline&&!this._isInput&&(this._boundInput=this._element.querySelector('input[type="hidden"], input[name]')),this._positionElement=this._resolvePositionElement(),this._displayElement=this._resolveDisplayElement();let t=this._buildCalendarOptions();this._calendar=new Kp(this._positionElement,t),this._calendar.init(),this._setupThemeObserver(),this._isInput&&this._element.value&&this._parseInputValue(),this._updateDisplayWithSelectedDates()}_updateDisplayWithSelectedDates(){let{selectedDates:t}=this._config;if(!t||t.length===0)return;let e=this._formatDateForInput(t);this._isInput&&(this._element.value=e),this._boundInput&&(this._boundInput.value=t.join(",")),this._displayElement&&(this._displayElement.textContent=e)}_resolvePositionElement(){let{positionElement:t}=this._config;if(typeof t=="string"&&(t=document.querySelector(t)),!t&&this._isInput&&!this._isInline){let e=this._element.closest(".form-adorn");e&&(t=e)}return t||this._element}_resolveDisplayElement(){let{displayElement:t}=this._config;return typeof t=="string"?document.querySelector(t):t===!0||t===null&&!this._isInput&&!this._isInline?this._element.querySelector("[data-bs-datepicker-display]")||this._element:t}_getThemeAncestor(){return this._element.closest("[data-bs-theme]")}_getEffectiveTheme(){let{datepickerTheme:t}=this._config;return t||this._getThemeAncestor()?.getAttribute("data-bs-theme")||null}_syncThemeAttribute(t){if(!t)return;let e=this._getEffectiveTheme();e?t.setAttribute("data-bs-theme",e):t.removeAttribute("data-bs-theme")}_setupThemeObserver(){let t=this._getThemeAncestor();t&&!this._config.datepickerTheme&&(this._themeObserver=new MutationObserver(()=>{this._syncThemeAttribute(this._calendar?.context?.mainElement)}),this._themeObserver.observe(t,{attributes:!0,attributeFilter:["data-bs-theme"]}))}_buildCalendarOptions(){let t=this._getEffectiveTheme(),e=t&&t!=="auto"?t:"system",n={...this._config.vcpOptions,inputMode:!this._isInline,positionToInput:this._config.placement,firstWeekday:this._config.firstWeekday,locale:this._config.locale,selectionDatesMode:this._config.selectionMode,selectedDates:this._config.selectedDates,displayMonthsCount:this._config.displayMonthsCount,type:this._config.displayMonthsCount>1?"multiple":"default",selectedTheme:e,themeAttrDetect:"[data-bs-theme]",onClickDate:(s,i)=>this._handleDateClick(s,i),onInit:s=>{this._syncThemeAttribute(s.context.mainElement)},onShow:()=>{this._isShown=!0,this._syncThemeAttribute(this._calendar.context.mainElement)},onHide:()=>{this._isShown=!1}};if(this._config.selectedDates.length>0){let s=this._parseDate(this._config.selectedDates[0]);n.selectedMonth=s.getMonth(),n.selectedYear=s.getFullYear()}return this._config.dateMin&&(n.dateMin=this._config.dateMin),this._config.dateMax&&(n.dateMax=this._config.dateMax),n}_handleDateClick(t,e){let n=[...t.context.selectedDates];if(n.length>0){let s=this._formatDateForInput(n);this._isInput&&(this._element.value=s),this._boundInput&&(this._boundInput.value=n.join(",")),this._displayElement&&(this._displayElement.textContent=s)}d.trigger(this._element,jp,{dates:n,event:e}),this._maybeHideAfterSelection(n)}_maybeHideAfterSelection(t){this._isInline||(this._config.selectionMode==="single"&&t.length>0||this._config.selectionMode==="multiple-ranged"&&t.length>=2)&&setTimeout(()=>this.hide(),100)}_parseDate(t){let[e,n,s]=t.split("-");return new Date(e,n-1,s)}_formatDate(t){let e=this._parseDate(t),n=this._config.locale==="default"?void 0:this._config.locale,{dateFormat:s}=this._config;return typeof s=="function"?s(e,n):s&&typeof s=="object"?new Intl.DateTimeFormat(n,s).format(e):e.toLocaleDateString(n)}_formatDateForInput(t){if(t.length===0)return"";if(t.length===1)return this._formatDate(t[0]);let e=this._config.selectionMode==="multiple-ranged"?" \u2013 ":", ";return t.map(n=>this._formatDate(n)).join(e)}_parseInputValue(){let t=this._element.value.trim();if(!t)return;let e=new Date(t);if(!Number.isNaN(e.getTime())){let n=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;this._calendar.set({selectedDates:[n]})}}};d.on(document,Qp,fs,function(t){this.tagName!=="INPUT"&&this.dataset.bsInline!=="true"&&(t.preventDefault(),Ir.getOrCreateInstance(this).toggle())}),d.on(document,Jp,fs,function(){this.tagName==="INPUT"&&Ir.getOrCreateInstance(this).show()}),d.on(document,`DOMContentLoaded${st}.data-api`,()=>{let t=`${fs}[data-bs-inline="true"], ${fs}[data-bs-selected-dates]`;for(let e of document.querySelectorAll(t))Ir.getOrCreateInstance(e)});var Xc=class extends te{constructor(t,e){super(t,e),this._isTransitioning=!1,this._openedAsModal=!1,this._addDialogListeners()}static get NAME(){return"dialogbase"}toggle(t){return this._element.open?this.hide():this.show(t)}show(t){if(this._element.open||this._isTransitioning||d.trigger(this._element,this.constructor.eventName("show"),{relatedTarget:t}).defaultPrevented)return;this._isTransitioning=!0,this._onBeforeShow();let{modal:e,preventBodyScroll:n}=this._getShowOptions();this._showElement({modal:e,preventBodyScroll:n}),this._queueCallback(()=>{this._isTransitioning=!1,d.trigger(this._element,this.constructor.eventName("shown"),{relatedTarget:t})},this._element,this._isAnimated())}hide(){this._element.open&&!this._isTransitioning&&(d.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented||(this._isTransitioning=!0,this._hideElement(),this._queueCallback(()=>{this._element.open&&this._closeAndCleanup(),this._element.classList.remove("hiding"),this._onAfterHide(),this._isTransitioning=!1,d.trigger(this._element,this.constructor.eventName("hidden"))},this._element,this._isAnimated())))}dispose(){this._element.open&&this._closeAndCleanup(),d.off(this._element,"cancel",this._cancelHandler),super.dispose()}_getShowOptions(){return{modal:!0,preventBodyScroll:!0}}_onBeforeShow(){}_onAfterHide(){}_isAnimated(){return!this._element.classList.contains(this._getInstantClassName())}_getInstantClassName(){return"dialog-instant"}_getStaticClassName(){return"dialog-static"}_onCancel(){}_showElement({modal:t=!0,preventBodyScroll:e=!0}={}){this._openedAsModal=t,t?this._element.showModal():this._element.show(),e&&document.documentElement.classList.add("dialog-open")}_hideElement(){this._hideChildComponents(),this._element.classList.add("hiding"),this._shouldDeferClose()||this._closeAndCleanup()}_closeAndCleanup(){this._element.close(),this._openedAsModal=!1,document.querySelector("dialog[open]:modal")||document.documentElement.classList.remove("dialog-open")}_shouldDeferClose(){return!1}_triggerBackdropTransition(){if(d.trigger(this._element,this.constructor.eventName("hidePrevented")).defaultPrevented)return;let t=this._getStaticClassName();this._element.classList.add(t),this._queueCallback(()=>{this._element.classList.remove(t)},this._element)}_hideChildComponents(){for(let t of y.find('[data-bs-toggle="tooltip"], [data-bs-toggle="popover"]',this._element)){let e=Pt.getAny(t);e&&typeof e.hide=="function"&&e.hide()}for(let t of y.find(".toast.show",this._element)){let e=Pt.getAny(t);e&&typeof e.hide=="function"&&e.hide()}}_addDialogListeners(){let t=this.constructor.EVENT_KEY;this._cancelHandler=e=>{e.preventDefault(),this._config.keyboard?(this._onCancel(),this.hide()):this._triggerBackdropTransition()},d.on(this._element,"cancel",this._cancelHandler),d.on(this._element,`keydown${t}`,e=>{e.key!=="Escape"||this._openedAsModal||(e.preventDefault(),this._config.keyboard&&(this._onCancel(),this.hide()))}),d.on(this._element,`click${t}`,e=>{e.target===this._element&&this._openedAsModal&&(this._config.backdrop!=="static"?this.hide():this._triggerBackdropTransition())})}},ng="dialog";var sg="show.bs.dialog",jl="hidden.bs.dialog",ig="cancel.bs.dialog",rg="click.bs.dialog.data-api";var og='[data-bs-toggle="dialog"]',ag={backdrop:!0,keyboard:!0,modal:!0},lg={backdrop:"(boolean|string)",keyboard:"boolean",modal:"boolean"},Qe=class extends Xc{constructor(t,e){super(t,e)}static get Default(){return ag}static get DefaultType(){return lg}static get NAME(){return ng}handleUpdate(){}_getShowOptions(){return{modal:this._config.modal,preventBodyScroll:this._config.modal}}_onBeforeShow(){this._config.modal||this._element.classList.add("dialog-nonmodal")}_onAfterHide(){this._element.classList.remove("dialog-nonmodal")}_shouldDeferClose(){return this._isAnimated()}_onCancel(){d.trigger(this._element,ig)}};d.on(document,rg,og,function(t){let e=y.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),d.one(e,sg,i=>{i.defaultPrevented||d.one(e,jl,()=>{Je(this)&&this.focus({preventScroll:!0})})});let n=Ce.getDataAttributes(this),s=this.closest("dialog[open]");if(s&&s!==e){let i=Qe.getOrCreateInstance(e,n);e.classList.add("dialog-swap-in"),i.show(this),d.one(e,"shown.bs.dialog",()=>{e.classList.remove("dialog-swap-in")});let r=Qe.getInstance(s);return void(r&&(s.classList.add("dialog-instant"),d.one(s,jl,()=>{s.classList.remove("dialog-instant")}),r.hide()))}Qe.getOrCreateInstance(e,n).toggle(this)}),Ls(Qe);var cg="navoverflow",Ao=".bs.navoverflow",hg=`update${Ao}`,zl=`overflow${Ao}`,Gl=`resize${Ao}`;var ug="[data-bs-overflow-icon]",ps="nav-overflow-keep",dg={collapseBelow:0,iconPlacement:"start",menuPlacement:"bottom-end",moreText:"More",moreIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M3 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/></svg>',threshold:0},mg={collapseBelow:"(number|string)",iconPlacement:"string",menuPlacement:"string",moreText:"string",moreIcon:"string",threshold:"number"},fg=class extends te{constructor(t,e){super(t,e),this._items=[],this._overflowItems=[],this._overflowMenu=null,this._overflowToggle=null,this._resizeObserver=null,this._resizeHandler=null,this._collapseBelow=0,this._init()}static get Default(){return dg}static get DefaultType(){return mg}static get NAME(){return cg}update(){this._calculateOverflow(),d.trigger(this._element,hg)}dispose(){this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeHandler&&d.off(window,Gl,this._resizeHandler),this._restoreItems(),this._overflowToggle&&this._overflowToggle.parentElement&&this._overflowToggle.parentElement.remove(),super.dispose()}_init(){this._element.classList.add("nav-overflow"),this._items=[...y.find(".nav-item",this._element)];for(let[t,e]of this._items.entries())e.dataset.bsNavOrder=t;this._collapseBelow=this._resolveCollapseBelow(),this._createOverflowMenu(),this._setupResizeObserver(),this._calculateOverflow()}_createOverflowMenu(){if(this._overflowToggle=y.findOne(".nav-overflow-toggle",this._element),this._overflowToggle)return void(this._overflowMenu=y.findOne(".nav-overflow-menu",this._element));let t=`<span class="nav-overflow-icon">${this._resolveIcon()}</span>`,e=`<span class="nav-overflow-text">${this._config.moreText}</span>`,n=this._config.iconPlacement==="end"?`${e}${t}`:`${t}${e}`,s=document.createElement("li");s.className="nav-item nav-overflow-item",s.innerHTML=`
115
+ <button class="nav-link nav-overflow-toggle" type="button" data-bs-toggle="menu" data-bs-placement="${this._config.menuPlacement}" aria-expanded="false">
116
+ ${n}
117
+ </button>
118
+ <div class="nav-overflow-menu menu"></div>
119
+ `,this._element.append(s),this._overflowToggle=s.querySelector(".nav-overflow-toggle"),this._overflowMenu=s.querySelector(".nav-overflow-menu")}_resolveIcon(){let t=y.findOne(ug,this._element);if(!t)return this._config.moreIcon;let e=t.cloneNode(!0);e.removeAttribute("data-bs-overflow-icon");let n=e.outerHTML;return t.remove(),n}_resolveCollapseBelow(){let t=this._config.collapseBelow;if(typeof t=="number")return t;if(typeof t=="string"&&t!==""){let e=getComputedStyle(document.documentElement).getPropertyValue(`--bs-breakpoint-${t}`);return Number.parseFloat(e)||0}return 0}_setupResizeObserver(){if(typeof ResizeObserver>"u")return this._resizeHandler=()=>this._calculateOverflow(),void d.on(window,Gl,this._resizeHandler);this._resizeObserver=new ResizeObserver(()=>{this._calculateOverflow()}),this._resizeObserver.observe(this._element)}_calculateOverflow(){this._restoreItems();let t=this._element.offsetWidth,e=this._overflowToggle?.closest(".nav-item");if(this._collapseBelow>0&&t<this._collapseBelow){let r=this._items.filter(o=>!o.classList.contains(ps));return this._moveToOverflow(r),e&&(r.length>0?e.classList.remove("d-none"):e.classList.add("d-none")),void(r.length>0&&d.trigger(this._element,zl,{overflowCount:r.length,visibleCount:this._items.length-r.length}))}let n=0,s=[],i=t-(e?.offsetWidth||0)-this._items.filter(r=>r.classList.contains(ps)).reduce((r,o)=>r+o.offsetWidth,0)-10;for(let r of this._items)r.classList.contains(ps)||(n+=r.offsetWidth,n>i&&s.push(r));if(this._items.length-s.length<this._config.threshold&&this._items.length>this._config.threshold){let r=this._items.slice(this._config.threshold).filter(o=>!o.classList.contains(ps));s.length=0,s.push(...r)}this._moveToOverflow(s),e&&(s.length>0?e.classList.remove("d-none"):e.classList.add("d-none")),s.length>0&&d.trigger(this._element,zl,{overflowCount:s.length,visibleCount:this._items.length-s.length})}_moveToOverflow(t){if(this._overflowMenu){this._overflowMenu.innerHTML="",this._overflowItems=[];for(let e of t){let n=y.findOne(".nav-link",e);if(!n)continue;let s=n.cloneNode(!0);s.className="menu-item",n.classList.contains("active")&&s.classList.add("active"),(n.classList.contains("disabled")||n.hasAttribute("disabled"))&&s.classList.add("disabled"),this._overflowMenu.append(s),e.classList.add("d-none"),e.dataset.bsNavOverflow="true",this._overflowItems.push(e)}}}_restoreItems(){for(let t of this._items)t.classList.remove("d-none"),delete t.dataset.bsNavOverflow;this._overflowMenu&&(this._overflowMenu.innerHTML=""),this._overflowItems=[]}};d.on(document,"DOMContentLoaded",()=>{for(let t of y.find('[data-bs-toggle="nav-overflow"]'))fg.getOrCreateInstance(t)});var pg="touchstart.bs.swipe",gg="touchmove.bs.swipe",bg="touchend.bs.swipe",vg="pointerdown.bs.swipe",_g="pointerup.bs.swipe";var yg={endCallback:null,leftCallback:null,rightCallback:null,upCallback:null,downCallback:null},Eg={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)",upCallback:"(function|null)",downCallback:"(function|null)"},Xl=class Zc extends lo{constructor(e,n){super(),this._element=e,e&&Zc.isSupported()&&(this._config=this._getConfig(n),this._deltaX=0,this._deltaY=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return yg}static get DefaultType(){return Eg}static get NAME(){return"swipe"}dispose(){d.off(this._element,".bs.swipe")}_start(e){if(!this._supportPointerEvents)return this._deltaX=e.touches[0].clientX,void(this._deltaY=e.touches[0].clientY);this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX,this._deltaY=e.clientY)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX,this._deltaY=e.clientY-this._deltaY),this._handleSwipe(),Me(this._config.endCallback)}_move(e){if(e.touches&&e.touches.length>1)return this._deltaX=0,void(this._deltaY=0);this._deltaX=e.touches[0].clientX-this._deltaX,this._deltaY=e.touches[0].clientY-this._deltaY}_handleSwipe(){let e=Math.abs(this._deltaX),n=Math.abs(this._deltaY);if(n>e&&n>40){let s=this._deltaY>0?"down":"up";return this._deltaX=0,this._deltaY=0,void Me(s==="down"?this._config.downCallback:this._config.upCallback)}if(e>40){let s=e/this._deltaX;return this._deltaX=0,this._deltaY=0,s?void Me(s>0?this._config.rightCallback:this._config.leftCallback):void 0}this._deltaX=0,this._deltaY=0}_initEvents(){this._supportPointerEvents?(d.on(this._element,vg,e=>this._start(e)),d.on(this._element,_g,e=>this._end(e)),this._element.classList.add("pointer-event")):(d.on(this._element,pg,e=>this._start(e)),d.on(this._element,gg,e=>this._move(e)),d.on(this._element,bg,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType==="pen"||e.pointerType==="touch")}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}},wg="drawer",Fs=".bs.drawer";var Sg=`load${Fs}.data-api`,Tg=`hidden${Fs}`,Ag=`resize${Fs}`,Cg=`click${Fs}.data-api`,Dg='[data-bs-toggle="drawer"]',Mg={backdrop:!0,keyboard:!0,scroll:!1},xg={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},fn=class extends Xc{constructor(t,e){super(t,e),this._swipeHelper=null}static get Default(){return Mg}static get DefaultType(){return xg}static get NAME(){return wg}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_getShowOptions(){return{modal:!!this._config.backdrop||!this._config.scroll,preventBodyScroll:!this._config.scroll}}_onBeforeShow(){this._initSwipe()}_getInstantClassName(){return"drawer-instant"}_getStaticClassName(){return"drawer-static"}_initSwipe(){if(this._swipeHelper||!Xl.isSupported())return;let t={},e=this._element;e.classList.contains("drawer-bottom")?t.downCallback=()=>this.hide():e.classList.contains("drawer-top")?t.upCallback=()=>this.hide():e.classList.contains("drawer-end")?De()?t.leftCallback=()=>this.hide():t.rightCallback=()=>this.hide():De()?t.rightCallback=()=>this.hide():t.leftCallback=()=>this.hide(),this._swipeHelper=new Xl(e,t)}};d.on(document,Cg,Dg,function(t){let e=y.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),be(this))return;d.one(e,Tg,()=>{Je(this)&&this.focus({preventScroll:!0})});let n=y.findOne("dialog.drawer[open]");n&&n!==e&&fn.getInstance(n).hide(),fn.getOrCreateInstance(e).toggle(this)}),d.on(window,Sg,()=>{for(let t of y.find("dialog.drawer[open]"))fn.getOrCreateInstance(t).show()}),d.on(window,Ag,()=>{for(let t of y.find('dialog[open][class*="\\:drawer"]'))getComputedStyle(t).position!=="fixed"&&fn.getOrCreateInstance(t).hide()}),Ls(fn);var Lg="strength",Qc=".bs.strength";var Og=`strengthChange${Qc}`;var Ng=["weak","fair","good","strong"],Ig={input:null,minLength:8,messages:{weak:"Weak",fair:"Fair",good:"Good",strong:"Strong"},weights:{minLength:1,extraLength:1,lowercase:1,uppercase:1,numbers:1,special:1,multipleSpecial:1,longPassword:1},thresholds:[2,4,6],scorer:null},kg={input:"(string|element|null)",minLength:"number",messages:"object",weights:"object",thresholds:"array",scorer:"(function|null)"},Rg=class extends te{constructor(t,e){super(t,e),this._input=this._getInput(),this._segments=y.find(".strength-segment",this._element),this._textElement=y.findOne(".strength-text",this._element.parentElement),this._currentStrength=null,this._input&&(this._addEventListeners(),this._evaluate())}static get Default(){return Ig}static get DefaultType(){return kg}static get NAME(){return Lg}getStrength(){return this._currentStrength}evaluate(){this._evaluate()}_getInput(){if(this._config.input)return typeof this._config.input=="string"?y.findOne(this._config.input):this._config.input;let t=this._element.parentElement;return y.findOne('input[type="password"]',t)}_addEventListeners(){d.on(this._input,"input",()=>this._evaluate()),d.on(this._input,"change",()=>this._evaluate())}_evaluate(){let t=this._input.value,e=this._calculateScore(t),n=this._scoreToStrength(e);n!==this._currentStrength&&(this._currentStrength=n,this._updateUI(n),d.trigger(this._element,Og,{strength:n,score:e,password:t.length>0?"***":""}))}_calculateScore(t){if(!t)return 0;if(typeof this._config.scorer=="function")return this._config.scorer(t);let{weights:e}=this._config,n=0;return t.length>=this._config.minLength&&(n+=e.minLength),t.length>=this._config.minLength+4&&(n+=e.extraLength),/[a-z]/.test(t)&&(n+=e.lowercase),/[A-Z]/.test(t)&&(n+=e.uppercase),/\d/.test(t)&&(n+=e.numbers),/[!@#$%^&*(),.?":{}|<>]/.test(t)&&(n+=e.special),/[!@#$%^&*(),.?":{}|<>].*[!@#$%^&*(),.?":{}|<>]/.test(t)&&(n+=e.multipleSpecial),t.length>=16&&(n+=e.longPassword),n}_scoreToStrength(t){if(t===0)return null;let[e,n,s]=this._config.thresholds;return t<=e?"weak":t<=n?"fair":t<=s?"good":"strong"}_updateUI(t){t?this._element.dataset.bsStrength=t:delete this._element.dataset.bsStrength;let e=t?Ng.indexOf(t):-1;for(let[n,s]of this._segments.entries())n<=e?s.classList.add("active"):s.classList.remove("active");this._textElement&&(t&&this._config.messages[t]?(this._textElement.textContent=this._config.messages[t],this._textElement.dataset.bsStrength=t,this._textElement.style.setProperty("--strength-color",`var(--${{weak:"danger",fair:"warning",good:"info",strong:"success"}[t]}-text)`)):(this._textElement.textContent="",delete this._textElement.dataset.bsStrength))}};d.on(document,`DOMContentLoaded${Qc}.data-api`,()=>{for(let t of y.find("[data-bs-strength]"))Rg.getOrCreateInstance(t)});var Pg="otpInput",Co=".bs.otpInput";var Fg=`complete${Co}`,$g=`input${Co}`,Hg=`DOMContentLoaded${Co}.data-api`;var Zl=["blur","keyup","select"];var Ql={numeric:{inputmode:"numeric",pattern:"[0-9]*",filter:/[^0-9]/g},alphanumeric:{inputmode:"text",pattern:"[A-Za-z0-9]*",filter:/[^A-Za-z0-9]/g},alpha:{inputmode:"text",pattern:"[A-Za-z]*",filter:/[^A-Za-z]/g}},Vg={groups:null,length:null,mask:!1,separator:"\xB7",type:"numeric"},Bg={groups:"(array|null)",length:"(number|null)",mask:"boolean",separator:"string",type:"string"},$s=class extends te{constructor(t,e){super(t,e);let n=y.findOne("input",this._element);n&&(this._input=n,this._type=Ql[this._config.type]||Ql.numeric,this._length=this._resolveLength(),this._slots=[],this._pointerActive=!1,this._pointerIndex=0,this._setupInput(),this._renderSlots(),this._addEventListeners(),this._render())}static get Default(){return Vg}static get DefaultType(){return Bg}static get NAME(){return Pg}getValue(){return this._input.value}setValue(t){this._input.value=this._sanitize(String(t)),this._render(),this._checkComplete()}clear(){this._input.value="",this._render(),this._input.focus()}focus(){this._input.focus(),this._selectSlot(this._firstEmptyIndex()),this._render()}dispose(){d.off(this._input,"input",this._onInput),d.off(this._input,"beforeinput",this._onBeforeInput),d.off(this._input,"focus",this._onFocus),d.off(this._input,"pointerdown",this._onPointerDown),d.off(document,"selectionchange",this._onSelectionChange);for(let t of Zl)d.off(this._input,t,this._onSync);this._slotsContainer?.remove(),this._element.classList.remove("otp-rendered"),super.dispose()}_resolveLength(){if(this._config.length)return this._config.length;let t=Number.parseInt(this._input.getAttribute("maxlength"),10);return Number.isNaN(t)||t<1?6:t}_setupInput(){let t=this._input;t.type!=="number"&&t.type!=="password"||(t.type="text"),t.classList.add("otp-input"),t.setAttribute("maxlength",String(this._length)),t.setAttribute("inputmode",this._type.inputmode),t.setAttribute("pattern",this._type.pattern),t.getAttribute("autocomplete")||t.setAttribute("autocomplete","one-time-code"),t.value&&(t.value=this._sanitize(t.value))}_renderSlots(){let t=document.createElement("div");t.className="otp-slots",t.setAttribute("aria-hidden","true");let{groups:e}=this._config,n=0,s=0;for(let i=0;i<this._length;i++){let r=document.createElement("div");if(r.className="otp-slot",t.append(r),this._slots.push(r),Array.isArray(e)&&e.length>0&&(s++,s===e[n]&&i<this._length-1)){let o=document.createElement("div");o.className="otp-separator",o.textContent=this._config.separator,t.append(o),n=Math.min(n+1,e.length-1),s=0}}this._slotsContainer=t,this._element.append(t),this._element.classList.add("otp-rendered")}_addEventListeners(){this._onInput=()=>this._handleInput(),this._onBeforeInput=t=>this._handleBeforeInput(t),this._onPointerDown=t=>this._handlePointerDown(t),this._onFocus=()=>{if(this._pointerActive)return this._pointerActive=!1,this._selectSlot(this._pointerIndex),void this._render();this._selectSlot(this._firstEmptyIndex()),this._render()},this._onSync=()=>this._render(),this._onSelectionChange=()=>{document.activeElement===this._input&&this._render()},d.on(this._input,"input",this._onInput),d.on(this._input,"beforeinput",this._onBeforeInput),d.on(this._input,"focus",this._onFocus),d.on(this._input,"pointerdown",this._onPointerDown),d.on(document,"selectionchange",this._onSelectionChange);for(let t of Zl)d.on(this._input,t,this._onSync)}_handleInput(){let t=this._sanitize(this._input.value);t!==this._input.value&&(this._input.value=t),document.activeElement===this._input&&this._selectSlot(this._firstEmptyIndex()),this._afterValueChange()}_handleBeforeInput(t){let{inputType:e,data:n}=t;if(e==="insertText"&&n&&n.length===1){t.preventDefault();let s=this._sanitize(n);if(!s)return;let i=Math.min(this._input.selectionStart??0,this._length-1),r=[...this._input.value];return r[i]=s,this._input.value=r.join("").slice(0,this._length),this._selectSlot(i+1),void this._afterValueChange()}if(e==="deleteContentBackward"){t.preventDefault();let s=this._input.selectionStart??0,i=this._input.selectionEnd??s,r=[...this._input.value];i>s?(r.splice(s,i-s),this._input.value=r.join(""),this._selectSlot(s)):s>0&&(r.splice(s-1,1),this._input.value=r.join(""),this._selectSlot(s-1)),this._afterValueChange()}}_handlePointerDown(t){let e=this._slotIndexFromPoint(t.clientX);if(e===null)return;let n=Math.min(e,this._firstEmptyIndex());if(document.activeElement===this._input)return t.preventDefault(),this._selectSlot(n),void this._render();this._pointerActive=!0,this._pointerIndex=n}_slotIndexFromPoint(t){for(let[e,n]of this._slots.entries())if(t<=n.getBoundingClientRect().right||e===this._slots.length-1)return e;return null}_afterValueChange(){this._render(),d.trigger(this._element,$g,{value:this._input.value}),this._checkComplete()}_firstEmptyIndex(){return Math.min(this._input.value.length,this._length-1)}_selectSlot(t){let e=Math.max(0,Math.min(t,this._length-1)),n=e<this._input.value.length?e+1:e;this._input.setSelectionRange(e,n)}_sanitize(t){return t.replace(this._type.filter,"").slice(0,this._length)}_render(){let{value:t}=this._input,e=document.activeElement===this._input,n=Math.min(this._input.selectionStart??t.length,this._length-1);for(let[s,i]of this._slots.entries()){let r=t[s]??"";i.textContent=r&&this._config.mask?"\u2022":r,i.classList.toggle("otp-slot-filled",!!r),i.classList.toggle("otp-slot-active",e&&s===n)}}_checkComplete(){let{value:t}=this._input;t.length===this._length&&d.trigger(this._element,Fg,{value:t})}};d.on(document,Hg,()=>{for(let t of y.find("[data-bs-otp]"))$s.getOrCreateInstance(t)});var qg="chips";var Wg="add.bs.chips",Yg="remove.bs.chips",kr="change.bs.chips",Rr="select.bs.chips";var Kg={separator:",",allowDuplicates:!1,maxChips:null,placeholder:"",dismissible:!0,dismissIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg>',createOnBlur:!0},Ug={separator:"(string|null)",allowDuplicates:"boolean",maxChips:"(number|null)",placeholder:"string",dismissible:"boolean",dismissIcon:"string",createOnBlur:"boolean"},jg=class extends te{constructor(t,e){super(t,e);let n=y.findOne(".form-ghost",this._element);this._chips=[],this._selectedChips=new Set,this._anchorChip=null,n?this._input=n:this._createInput(),this._initializeExistingChips(),this._addEventListeners()}static get Default(){return Kg}static get DefaultType(){return Ug}static get NAME(){return qg}add(t){let e=String(t).trim();if(!e||!this._config.allowDuplicates&&this._chips.includes(e)||this._config.maxChips!==null&&this._chips.length>=this._config.maxChips||d.trigger(this._element,Wg,{value:e,relatedTarget:this._input}).defaultPrevented)return null;let n=this._createChip(e);return this._element.insertBefore(n,this._input),this._chips.push(e),d.trigger(this._element,kr,{values:this.getValues()}),n}remove(t){let e,n;return typeof t=="string"?(n=t,e=this._findChipByValue(n)):(e=t,n=this._getChipValue(e)),!(!e||!n||d.trigger(this._element,Yg,{value:n,chip:e,relatedTarget:this._input}).defaultPrevented||(this._selectedChips.delete(e),this._anchorChip===e&&(this._anchorChip=null),e.remove(),this._chips=this._getChipElements().map(s=>this._getChipValue(s)).filter(Boolean),d.trigger(this._element,kr,{values:this.getValues()}),0))}removeSelected(){let t=[...this._selectedChips];for(let e of t)this.remove(e);this._input?.focus()}getValues(){return[...this._chips]}getSelectedValues(){return[...this._selectedChips].map(t=>this._getChipValue(t))}clear(){let t=y.find(".chip",this._element);for(let e of t)e.remove();this._chips=[],this._selectedChips.clear(),this._anchorChip=null,d.trigger(this._element,kr,{values:[]})}clearSelection(){for(let t of this._selectedChips)t.classList.remove("active");this._selectedChips.clear(),this._anchorChip=null,d.trigger(this._element,Rr,{selected:[]})}selectChip(t,e={}){let{addToSelection:n=!1,rangeSelect:s=!1}=e,i=this._getChipElements();if(i.includes(t)){if(s&&this._anchorChip){let r=i.indexOf(this._anchorChip),o=i.indexOf(t),a=Math.min(r,o),l=Math.max(r,o);n||this.clearSelection();for(let c=a;c<=l;c++)this._selectedChips.add(i[c]),i[c].classList.add("active")}else n?this._selectedChips.has(t)?(this._selectedChips.delete(t),t.classList.remove("active")):(this._selectedChips.add(t),t.classList.add("active"),this._anchorChip=t):(this.clearSelection(),this._selectedChips.add(t),t.classList.add("active"),this._anchorChip=t);d.trigger(this._element,Rr,{selected:this.getSelectedValues()})}}focus(){this._input?.focus()}_getChipElements(){return y.find(".chip",this._element)}_createInput(){let t=document.createElement("input");t.type="text",t.className="form-ghost",this._config.placeholder&&(t.placeholder=this._config.placeholder),this._element.append(t),this._input=t}_initializeExistingChips(){let t=y.find(".chip",this._element);for(let e of t){let n=this._getChipValue(e);n&&(this._chips.push(n),this._setupChip(e))}}_setupChip(t){t.setAttribute("tabindex","0"),this._config.dismissible&&!y.findOne(".chip-dismiss",t)&&t.append(this._createDismissButton())}_createChip(t){let e=document.createElement("span");return e.className="chip",e.dataset.bsChipValue=t,e.append(document.createTextNode(t)),this._setupChip(e),e}_createDismissButton(){let t=document.createElement("button");return t.type="button",t.className="chip-dismiss",t.setAttribute("aria-label","Remove"),t.setAttribute("tabindex","-1"),t.innerHTML=this._config.dismissIcon,t}_findChipByValue(t){return this._getChipElements().find(e=>this._getChipValue(e)===t)}_getChipValue(t){if(t.dataset.bsChipValue)return t.dataset.bsChipValue;let e=t.cloneNode(!0),n=y.findOne(".chip-dismiss",e);return n&&n.remove(),e.textContent?.trim()||""}_addEventListeners(){d.on(this._input,"keydown",t=>this._handleInputKeydown(t)),d.on(this._input,"input",t=>this._handleInput(t)),d.on(this._input,"paste",t=>this._handlePaste(t)),d.on(this._input,"focus",()=>this.clearSelection()),this._config.createOnBlur&&d.on(this._input,"blur",t=>{t.relatedTarget?.closest(".chip")||this._createChipFromInput()}),d.on(this._element,"click",".chip",t=>{if(t.target.closest(".chip-dismiss"))return;let e=t.target.closest(".chip");e&&(t.preventDefault(),this.selectChip(e,{addToSelection:t.metaKey||t.ctrlKey,rangeSelect:t.shiftKey}),e.focus())}),d.on(this._element,"click",".chip-dismiss",t=>{t.stopPropagation();let e=t.target.closest(".chip");e&&(this.remove(e),this._input?.focus())}),d.on(this._element,"keydown",".chip",t=>{this._handleChipKeydown(t)}),d.on(this._element,"click",t=>{t.target===this._element&&(this.clearSelection(),this._input?.focus())})}_handleInputKeydown(t){let{key:e}=t;switch(e){case"Enter":t.preventDefault(),this._createChipFromInput();break;case"Backspace":case"Delete":if(this._input.value===""){t.preventDefault();let n=this._getChipElements();if(n.length>0){let s=n.at(-1);this.selectChip(s),s.focus()}}break;case"ArrowLeft":if(this._input.selectionStart===0&&this._input.selectionEnd===0){t.preventDefault();let n=this._getChipElements();if(n.length>0){let s=n.at(-1);t.shiftKey?this.selectChip(s,{addToSelection:!0}):this.selectChip(s),s.focus()}}break;case"Escape":this._input.value="",this.clearSelection(),this._input.blur()}}_handleChipKeydown(t){let{key:e}=t,n=t.target.closest(".chip");if(!n)return;let s=this._getChipElements(),i=s.indexOf(n);switch(e){case"Backspace":case"Delete":t.preventDefault(),this._handleChipDelete(i,s);break;case"ArrowLeft":t.preventDefault(),this._navigateChip(s,i,-1,t.shiftKey);break;case"ArrowRight":t.preventDefault(),this._navigateChip(s,i,1,t.shiftKey);break;case"Home":t.preventDefault(),this._navigateToEdge(s,0,t.shiftKey);break;case"End":case"Escape":t.preventDefault(),this.clearSelection(),this._input?.focus();break;case"a":this._handleSelectAll(t,s)}}_handleChipDelete(t,e){if(this._selectedChips.size===0)return;let n=Math.min(t,e.length-this._selectedChips.size-1);this.removeSelected();let s=this._getChipElements();if(s.length>0){let i=Math.max(0,Math.min(n,s.length-1));s[i].focus(),this.selectChip(s[i])}else this._input?.focus()}_navigateChip(t,e,n,s){let i=e+n;if(n<0&&i>=0){let r=t[i];this.selectChip(r,s?{addToSelection:!0,rangeSelect:!0}:{}),r.focus()}else if(n>0&&i<t.length){let r=t[i];this.selectChip(r,s?{addToSelection:!0,rangeSelect:!0}:{}),r.focus()}else n>0&&(this.clearSelection(),this._input?.focus())}_navigateToEdge(t,e,n){if(t.length===0)return;let s=t[e];this.selectChip(s,n?{rangeSelect:!0}:{}),s.focus()}_handleSelectAll(t,e){if(t.metaKey||t.ctrlKey){t.preventDefault();for(let n of e)this._selectedChips.add(n),n.classList.add("active");d.trigger(this._element,Rr,{selected:this.getSelectedValues()})}}_handleInput(t){let{value:e}=t.target,{separator:n}=this._config;if(n&&e.includes(n)){let s=e.split(n);for(let i of s.slice(0,-1))this.add(i.trim());this._input.value=s.at(-1)}}_handlePaste(t){let{separator:e}=this._config;if(!e)return;let n=(t.clipboardData||window.clipboardData).getData("text");if(n.includes(e)){t.preventDefault();let s=n.split(e);for(let i of s)this.add(i.trim())}}_createChipFromInput(){let t=this._input.value.trim();t&&(this.add(t),this._input.value="")}};d.on(document,"DOMContentLoaded.bs.chips.data-api",()=>{for(let t of y.find("[data-bs-chips]"))jg.getOrCreateInstance(t)});var Jc={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},zg=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Gg=/^(?!(?:javascript|data|vbscript):)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Xg=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z=]+$/i,Zg=(t,e)=>{let n=t.nodeName.toLowerCase();return e.includes(n)?!zg.has(n)||!!(Gg.test(t.nodeValue)||Xg.test(t.nodeValue)):e.filter(s=>s instanceof RegExp).some(s=>s.test(n))};function Qg(t,e,n){if(!t.length)return t;if(n&&typeof n=="function")return n(t);let s=new window.DOMParser().parseFromString(t,"text/html"),i=[...s.body.querySelectorAll("*")];for(let r of i){let o=r.nodeName.toLowerCase();if(!Object.keys(e).includes(o)){r.remove();continue}let a=[...r.attributes],l=[...e["*"]||[],...e[o]||[]];for(let c of a)Zg(c,l)||r.removeAttribute(c.nodeName)}return s.body.innerHTML}var Jg="TemplateFactory",eb={allowList:Jc,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},tb={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},nb={entry:"(string|element|function|null)",selector:"(string|element)"},sb=class extends lo{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return eb}static get DefaultType(){return tb}static get NAME(){return Jg}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){let t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(let[s,i]of Object.entries(this._config.content))this._setContent(t,i,s);let e=t.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&e.classList.add(...n.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(let[e,n]of Object.entries(t))super._typeCheckConfig({selector:e,entry:n},nb)}_setContent(t,e,n){let s=y.findOne(n,t);s&&((e=this._resolvePossibleFunction(e))?ke(e)?this._putElementInTemplate(Re(e),s):this._config.html?s.innerHTML=this._maybeSanitize(e):s.textContent=e:s.remove())}_maybeSanitize(t){return this._config.sanitize?Qg(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return Me(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}},ib="tooltip",rb=new Set(["sanitize","allowList","sanitizeFn"]);var ob=".tooltip-inner";var ro='[data-bs-toggle="tooltip"]';var Jl={AUTO:"auto",TOP:"top",RIGHT:De()?"left":"right",BOTTOM:"bottom",LEFT:De()?"right":"left"},ab={allowList:Jc,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",floatingConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},lb={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",floatingConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},it=class extends te{constructor(t,e){super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._floatingCleanup=null,this._keydownHandler=null,this._templateFactory=null,this._newContent=null,this._mediaQueryListeners=[],this._responsivePlacements=null,this.tip=null,this._parseResponsivePlacements(),this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return ab}static get DefaultType(){return lb}static get NAME(){return ib}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),this._removeEscapeListener(),d.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposeFloating(),this._disposeMediaQueryListeners(),super.dispose()}async show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;let t=d.trigger(this._element,this.constructor.eventName("show")),e=(pc(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return void(this._isHovered=!1);this._disposeFloating();let n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));let{container:s}=this._config,i=this._element.closest("dialog[open]");if(i&&s===document.body&&(s=i),this._element.ownerDocument.documentElement.contains(this.tip)||(s.append(n),d.trigger(this._element,this.constructor.eventName("inserted"))),await this._createFloating(n),n.classList.add("show"),this._setEscapeListener(),"ontouchstart"in document.documentElement)for(let r of document.body.children)d.on(r,"mouseover",ys);this._queueCallback(()=>{d.trigger(this._element,this.constructor.eventName("shown")),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!d.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._removeEscapeListener(),this._getTipElement().classList.remove("show"),"ontouchstart"in document.documentElement)for(let t of document.body.children)d.off(t,"mouseover",ys);this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposeFloating(),this._element.removeAttribute("aria-describedby"),d.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._floatingCleanup&&this.tip&&this._updateFloatingPosition()}_isWithContent(){return!!this._getTitle()||this._hasNewContent()}_hasNewContent(){return!!this._newContent&&Object.values(this._newContent).some(Boolean)}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){let e=this._getTemplateFactory(t).toHtml();e.classList.remove("fade","show"),e.classList.add(`bs-${this.constructor.NAME}-auto`);let n=vd(this.constructor.NAME).toString();return e.setAttribute("id",n),this._isAnimated()&&e.classList.add("fade"),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposeFloating(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new sb({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[ob]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains("fade")}_isShown(){return this.tip&&this.tip.classList.contains("show")}_getPlacement(t){if(this._responsivePlacements){let n=Nc(this._responsivePlacements,"top");return Jl[n.toUpperCase()]||n}let e=Me(this._config.placement,[this,t,this._element]);return Jl[e.toUpperCase()]||e}_parseResponsivePlacements(){typeof this._config.placement=="string"?(this._responsivePlacements=Oc(this._config.placement,"top"),this._responsivePlacements&&this._setupMediaQueryListeners()):this._responsivePlacements=null}_setupMediaQueryListeners(){this._disposeMediaQueryListeners(),this._mediaQueryListeners=Ic(()=>{this._isShown()&&this._updateFloatingPosition()})}_disposeMediaQueryListeners(){kc(this._mediaQueryListeners),this._mediaQueryListeners=[]}async _createFloating(t){let e=this._getPlacement(t),n=t.querySelector(`.${this.constructor.NAME}-arrow`);await this._updateFloatingPosition(t,e,n),this._floatingCleanup=zr(this._element,t,()=>this._updateFloatingPosition(t,null,n))}async _updateFloatingPosition(t=this.tip,e=null,n=null){if(!t)return;e||(e=this._getPlacement(t)),n||(n=t.querySelector(`.${this.constructor.NAME}-arrow`));let s=this._getFloatingMiddleware(n),i=this._getFloatingConfig(e,s),{x:r,y:o,placement:a,middlewareData:l}=await Lc(this._element,t,i);if(Object.assign(t.style,{position:"absolute",left:`${r}px`,top:`${o}px`}),n&&(n.style.position="absolute"),Ce.setDataAttribute(t,"placement",a),n&&l.arrow){let{x:c,y:h}=l.arrow,u=a.startsWith("top")||a.startsWith("bottom");Object.assign(n.style,{left:u&&c!==void 0?`${c}px`:"",top:u||h===void 0?"":`${h}px`,right:"",bottom:""})}}_getOffset(){let{offset:t}=this._config;return typeof t=="string"?t.split(",").map(e=>Number.parseInt(e,10)):typeof t=="function"?({placement:e,rects:n})=>As(t({placement:e,reference:n.reference,floating:n.floating},this._element)):t}_resolvePossibleFunction(t){return Me(t,[this._element,this._element])}_getFloatingMiddleware(t){let e=this._getOffset(),n=[Gr(typeof e=="function"?e:As(e)),Zr({fallbackPlacements:this._config.fallbackPlacements}),Xr({boundary:this._config.boundary==="clippingParents"?"clippingAncestors":this._config.boundary})];return t&&n.push(qm({element:t})),n}_getFloatingConfig(t,e){let n={placement:t,middleware:e};return{...n,...Me(this._config.floatingConfig,[void 0,n])}}_setListeners(){let t=this._config.trigger.split(" ");for(let e of t)if(e==="click")d.on(this._element,this.constructor.eventName("click"),this._config.selector,n=>{let s=this._initializeOnDelegatedTarget(n);s._activeTrigger.click=!(s._isShown()&&s._activeTrigger.click),s.toggle()});else if(e!=="manual"){let n=e==="hover"?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),s=e==="hover"?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");d.on(this._element,n,this._config.selector,i=>{let r=this._initializeOnDelegatedTarget(i);r._activeTrigger[i.type==="focusin"?"focus":"hover"]=!0,r._enter()}),d.on(this._element,s,this._config.selector,i=>{let r=this._initializeOnDelegatedTarget(i);r._activeTrigger[i.type==="focusout"?"focus":"hover"]=r._element.contains(i.relatedTarget),r._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},d.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler)}_setEscapeListener(){this._keydownHandler||(this._keydownHandler=t=>{t.key==="Escape"&&this._isShown()&&this.tip.isConnected&&(t.preventDefault(),t.stopPropagation(),this.hide())},this._element.ownerDocument.addEventListener("keydown",this._keydownHandler,!0))}_removeEscapeListener(){this._keydownHandler&&(this._element.ownerDocument.removeEventListener("keydown",this._keydownHandler,!0),this._keydownHandler=null)}_fixTitle(){let t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){let e=Ce.getDataAttributes(this._element);for(let n of Object.keys(e))rb.has(n)&&delete e[n];return t={...e,...typeof t=="object"&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=t.container===!1?document.body:Re(t.container),typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),typeof t.title!="number"&&typeof t.title!="boolean"||(t.title=t.title.toString()),typeof t.content!="number"&&typeof t.content!="boolean"||(t.content=t.content.toString()),t}_getDelegateConfig(){let t={};for(let[e,n]of Object.entries(this._config))this.constructor.Default[e]!==n&&(t[e]=n);return t.selector=!1,t.trigger="manual",t}_disposeFloating(){this._floatingCleanup&&(this._floatingCleanup(),this._floatingCleanup=null),this.tip&&(this.tip.remove(),this.tip=null)}},ec=t=>{let e=t.target.closest(ro);e&&it.getOrCreateInstance(e)};d.on(document,"focusin",ro,ec),d.on(document,"mouseenter",ro,ec);var cb="popover",hb=".popover-header",ub=".popover-body",vs='[data-bs-toggle="popover"]';var db={...it.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},mb={...it.DefaultType,content:"(null|string|element|function)"},fb=class extends it{constructor(t,e){super(t,e)}static get Default(){return db}static get DefaultType(){return mb}static get NAME(){return cb}_isWithContent(){return!!(this._getTitle()||this._getContent())||this._hasNewContent()}_getContentForTemplate(){return{[hb]:this._getTitle(),[ub]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}},Pr=t=>{let e=t.target.closest(vs);e&&(t.type==="click"&&t.preventDefault(),fb.getOrCreateInstance(e))};d.on(document,"click",vs,Pr),d.on(document,"focusin",vs,Pr),d.on(document,"mouseenter",vs,Pr);var pb="range";var gb="changed.bs.range",bb="DOMContentLoaded.bs.range.data-api";var vb=".form-range-input",_b="form-range-bubble",yb="form-range-ticks",Eb="form-range-tick",wb="form-range-tick-label",Sb="--bs-range-fill",Tb={bubble:!1,formatter:null},Ab={bubble:"(boolean|null)",formatter:"(function|null)"},Cb=class extends te{constructor(t,e){super(t,e),this._element&&(this._input=y.findOne(vb,this._element),this._input&&(this._bubble=null,this._bubbleText=null,this._ticks=null,this._updateHandler=()=>this._update(),this._config.bubble&&this._createBubble(),this._createTicks(),this._addEventListeners(),this._update()))}static get Default(){return Tb}static get DefaultType(){return Ab}static get NAME(){return pb}update(){this._update()}dispose(){d.off(this._input,"input",this._updateHandler),d.off(this._input,"change",this._updateHandler),this._bubble?.remove(),this._ticks?.remove(),super.dispose()}_configAfterMerge(t){return t.bubble===null&&(t.bubble=!0),t}_addEventListeners(){d.on(this._input,"input",this._updateHandler),d.on(this._input,"change",this._updateHandler)}_min(){return this._input.min===""?0:Number.parseFloat(this._input.min)}_max(){return this._input.max===""?100:Number.parseFloat(this._input.max)}_value(){return Number.parseFloat(this._input.value)}_ratio(){let t=this._max()-this._min();return t>0?(this._value()-this._min())/t:0}_update(){this._element.style.setProperty(Sb,`${this._ratio()}`),this._bubbleText&&(this._bubbleText.textContent=this._format(this._value())),d.trigger(this._input,gb,{value:this._value()})}_format(t){return typeof this._config.formatter=="function"?this._config.formatter(t):String(t)}_createBubble(){this._bubble=document.createElement("output"),this._bubble.className=`${_b} tooltip bs-tooltip-top show`,this._bubble.setAttribute("aria-hidden","true");let t=document.createElement("div");t.className="tooltip-arrow",this._bubbleText=document.createElement("div"),this._bubbleText.className="tooltip-inner",this._bubble.append(t,this._bubbleText),this._input.insertAdjacentElement("afterend",this._bubble)}_createTicks(){let t=this._input.getAttribute("list"),e=t?document.getElementById(t):null;if(!e)return;let n=this._min(),s=this._max()-n||1,i=[];for(let o of y.find("option",e)){let a=Number.parseFloat(o.value);if(!Number.isNaN(a)){let l=Math.min(Math.max((a-n)/s,0),1);i.push({ratio:l,label:o.label})}}if(i.length===0)return;i.sort((o,a)=>o.ratio-a.ratio),this._ticks=document.createElement("div"),this._ticks.className=yb,this._ticks.setAttribute("aria-hidden","true");let r=[0,...i.map(o=>o.ratio),1];this._ticks.style.gridTemplateColumns=r.slice(1).map((o,a)=>o-r[a]+"fr").join(" ");for(let[o,a]of i.entries()){let l=document.createElement("span");if(l.className=Eb,l.style.gridColumnStart=`${o+2}`,a.label){let c=document.createElement("span");c.className=wb,c.textContent=a.label,l.append(c)}this._ticks.append(l)}this._element.append(this._ticks)}};d.on(document,bb,()=>{for(let t of y.find(".form-range"))Cb.getOrCreateInstance(t)});var Db="scrollspy",Kt=".bs.scrollspy";var Mb=`activate${Kt}`,Fr=`click${Kt}`,tc=`scroll${Kt}`,nc=`scrollend${Kt}`,sc=`resize${Kt}`,xb=`load${Kt}.data-api`;var Lb='[data-bs-spy="scroll"]';var Ob=".nav-link, .nav-item > .nav-link, .list-group-item",Nb='[data-bs-toggle="menu"]';var Ib={rootMargin:null,smoothScroll:!1,target:null,threshold:[0],topMargin:"12%"},kb={rootMargin:"(string|null)",smoothScroll:"boolean",target:"element",threshold:"array",topMargin:"string"},Rb=class extends te{constructor(t,e){super(t,e),this._sections=[],this._linkBySection=new Map,this._sectionByLink=new Map,this._intersecting=new Set,this._activeTarget=null,this._lastActive=null,this._atBottom=!1,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._observer=null,this._sentinel=null,this._sentinelObserver=null,this._pendingNavigation=null,this._settleTimeout=null,this._settleHandler=null,this._scrollIdleHandler=null,this._resizeHandler=null,this._resizeTimeout=null,this.refresh()}static get Default(){return Ib}static get DefaultType(){return kb}static get NAME(){return Db}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?.disconnect(),this._intersecting.clear(),this._observer=this._getNewObserver();for(let t of this._sections)this._observer.observe(t);this._setUpSentinel(),this._maybeAddResizeListener()}dispose(){this._observer?.disconnect(),this._teardownSentinel(),this._disarmSettle(),this._removeResizeListener(),d.off(this._config.target,Fr),super.dispose()}_configAfterMerge(t){return t.target=Re(t.target)||document.body,typeof t.threshold=="string"&&(t.threshold=t.threshold.split(",").map(e=>Number.parseFloat(e))),t}_getNewObserver(){let t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin??this._getDerivedRootMargin()};return new IntersectionObserver(e=>this._onIntersect(e),t)}_onIntersect(t){for(let e of t)e.isIntersecting?this._intersecting.add(e.target):this._intersecting.delete(e.target);this._computeActive()}_computeActive(){if(!this._element?.isConnected||this._sections.length===0)return;let t=null;if(this._atBottom)t=this._sections.at(-1);else{for(let n of this._sections)this._intersecting.has(n)&&(t=n);t||=this._lastActive??this._sections.at(0)}if(!t)return;this._lastActive=t;let e=this._linkBySection.get(t);e&&this._process(e)}_parseTopMargin(){let t=String(this._config.topMargin);return{value:Number.parseFloat(t)||0,unit:t.endsWith("%")?"%":"px"}}_getDerivedRootMargin(){let{value:t,unit:e}=this._parseTopMargin(),n=t;if(e==="px"){let s=this._rootElement?this._rootElement.clientHeight:document.documentElement.clientHeight||window.innerHeight;n=s?t/s*100:12}return`0px 0px -${Math.min(Math.max(100-n,0),100)}% 0px`}_usesPixelMargin(){return!this._config.rootMargin&&this._parseTopMargin().unit==="px"}_setUpSentinel(){if(this._teardownSentinel(),this._sections.length===0)return;let t=document.createElement("div");t.setAttribute("aria-hidden","true"),t.style.cssText="position:relative;width:0;height:0;margin:0;padding:0;border:0;visibility:hidden;",this._element.append(t),this._sentinel=t,this._sentinelObserver=new IntersectionObserver(e=>this._onSentinel(e),{root:this._rootElement,threshold:[0]}),this._sentinelObserver.observe(t)}_onSentinel(t){let e=t.at(-1);this._atBottom=!!e?.isIntersecting&&this._isOverflowing(),this._computeActive()}_isOverflowing(){let t=this._rootElement||document.scrollingElement||document.documentElement;return t.scrollHeight>t.clientHeight}_teardownSentinel(){this._sentinelObserver?.disconnect(),this._sentinelObserver=null,this._sentinel?.remove(),this._sentinel=null,this._atBottom=!1}_maybeAddResizeListener(){this._removeResizeListener(),this._usesPixelMargin()&&(this._resizeHandler=()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(()=>this._rebuildObserver(),100)},d.on(window,sc,this._resizeHandler))}_removeResizeListener(){clearTimeout(this._resizeTimeout),this._resizeTimeout=null,this._resizeHandler&&(d.off(window,sc,this._resizeHandler),this._resizeHandler=null)}_rebuildObserver(){if(this._observer){this._observer.disconnect(),this._intersecting.clear(),this._observer=this._getNewObserver();for(let t of this._sections)this._observer.observe(t)}}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(d.off(this._config.target,Fr),d.on(this._config.target,Fr,"[href]",t=>{let e=t.target.closest("[href]"),n=e&&this._sectionByLink.get(e);if(!n||!this._element)return;t.preventDefault();let s=this._rootElement||window,i=n.offsetTop-this._element.offsetTop,r=this._rootElement?this._rootElement.scrollTop:window.scrollY??window.pageYOffset;if(matchMedia("(prefers-reduced-motion: reduce)").matches||Math.abs(r-i)<=2)return s.scrollTo?s.scrollTo({top:i,behavior:"auto"}):s.scrollTop=i,void this._settleNavigation(e.hash,n);this._pendingNavigation={hash:e.hash,section:n},this._armSettle(),s.scrollTo?s.scrollTo({top:i,behavior:"smooth"}):s.scrollTop=i}))}_armSettle(){this._disarmSettle();let t=this._getSettleTarget();this._settleHandler=()=>this._onSettle(),this._scrollIdleHandler=()=>{clearTimeout(this._settleTimeout),this._settleTimeout=setTimeout(()=>this._onSettle(),100)},d.on(t,nc,this._settleHandler),d.on(t,tc,this._scrollIdleHandler)}_disarmSettle(){clearTimeout(this._settleTimeout),this._settleTimeout=null;let t=this._getSettleTarget();this._settleHandler&&(d.off(t,nc,this._settleHandler),this._settleHandler=null),this._scrollIdleHandler&&(d.off(t,tc,this._scrollIdleHandler),this._scrollIdleHandler=null)}_getSettleTarget(){return this._rootElement||document}_onSettle(){if(this._disarmSettle(),!this._pendingNavigation)return;let{hash:t,section:e}=this._pendingNavigation;this._settleNavigation(t,e)}_settleNavigation(t,e){this._pendingNavigation=null,window.history?.replaceState&&window.history.replaceState(null,"",t),e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.focus({preventScroll:!0})}_initializeTargetsAndObservables(){this._sections=[],this._linkBySection=new Map,this._sectionByLink=new Map;let t=y.find("[href]",this._config.target),e=new Set;for(let n of t){if(!n.hash||be(n))continue;let s=Pb(n.hash.slice(1));if(!s)continue;let i=document.getElementById(s);i&&this._element.contains(i)&&Je(i)&&(this._sectionByLink.set(n,i),this._linkBySection.set(i,n),e.has(i)||(e.add(i),this._sections.push(i)))}this._sections.sort((n,s)=>n.getBoundingClientRect().top-s.getBoundingClientRect().top)}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add("active"),this._activateParents(t),d.trigger(this._element,Mb,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("menu-item")){let e=t.closest(".menu")?.previousElementSibling;return void(e?.matches(Nb)&&e.classList.add("active"))}for(let e of y.parents(t,".nav, .list-group"))for(let n of y.prev(e,Ob))n.classList.add("active")}_clearActiveClass(t){t.classList.remove("active");let e=y.find("[href].active",t);for(let n of e)n.classList.remove("active")}};function Pb(t){try{return decodeURIComponent(t)}catch{return t}}d.on(window,xb,()=>{for(let t of y.find(Lb))Rb.getOrCreateInstance(t)});var Fb="hide.bs.tab",$b="hidden.bs.tab",Hb="show.bs.tab",Vb="shown.bs.tab";var Bb="keydown.bs.tab";var qb="ArrowLeft",ic="ArrowRight",Wb="ArrowUp",rc="ArrowDown",$r="Home",oc="End";var eh='[data-bs-toggle="menu"]';var Hr=`:not(${eh})`,ac='.list-group, .nav, [role="tablist"]',Yb=".nav-item, .list-group-item",Kb=`.nav-link${Hr}, .list-group-item${Hr}, [role="tab"]${Hr}`,th='[data-bs-toggle="tab"]',Vr=`${Kb}, ${th}`,Ub='.active[data-bs-toggle="tab"]',lc=class nh extends te{constructor(e){if(super(e),this._parent=this._element.closest(ac),!this._parent)throw new TypeError(`${this._element.outerHTML} has no valid parent ${ac}`);this._setInitialAttributes(this._parent,this._getChildren()),d.on(this._element,Bb,n=>this._keydown(n))}static get NAME(){return"tab"}show(){let e=this._element;if(this._elemIsActive(e))return;let n=this._getActiveElem(),s=n?d.trigger(n,Fb,{relatedTarget:e}):null;d.trigger(e,Hb,{relatedTarget:n}).defaultPrevented||s&&s.defaultPrevented||(this._deactivate(n,e),this._activate(e,n))}_activate(e,n){e&&(e.classList.add("active"),this._activate(y.getElementFromSelector(e)),this._queueCallback(()=>{e.getAttribute("role")==="tab"?(e.removeAttribute("tabindex"),gt(e,"aria-selected",!0),this._toggleMenu(e,!0),d.trigger(e,Vb,{relatedTarget:n})):e.classList.add("show")},e,e.classList.contains("fade")))}_deactivate(e,n){e&&(e.classList.remove("active"),e.blur(),this._deactivate(y.getElementFromSelector(e)),this._queueCallback(()=>{e.getAttribute("role")==="tab"?(gt(e,"aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleMenu(e,!1),d.trigger(e,$b,{relatedTarget:n})):e.classList.remove("show")},e,e.classList.contains("fade")))}_keydown(e){if(![qb,ic,Wb,rc,$r,oc].includes(e.key)||e.altKey||e.ctrlKey||e.metaKey)return;e.stopPropagation(),e.preventDefault();let n=this._getChildren().filter(i=>!be(i)),s;if([$r,oc].includes(e.key))s=e.key===$r?n[0]:n.at(-1);else{let i=[ic,rc].includes(e.key);s=ao(n,e.target,i,!0)}s&&(s.focus({preventScroll:!0}),nh.getOrCreateInstance(s).show())}_getChildren(){return y.find(Vr,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,n){this._setAttributeIfNotExists(e,"role","tablist");for(let s of n)this._setInitialAttributesOnChild(s)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);let n=this._elemIsActive(e),s=this._getOuterElement(e);gt(e,"aria-selected",n),s!==e&&this._setAttributeIfNotExists(s,"role","presentation"),n||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){let n=y.getElementFromSelector(e);n&&(this._setAttributeIfNotExists(n,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(n,"aria-labelledby",`${e.id}`))}_toggleMenu(e,n){let s=this._getOuterElement(e),i=y.findOne(eh,s);if(!i)return;let r=y.findOne(".menu",s);i.classList.toggle("active",n),r&&r.classList.toggle("show",n),gt(i,"aria-expanded",n)}_setAttributeIfNotExists(e,n,s){e.hasAttribute(n)||e.setAttribute(n,s)}_elemIsActive(e){return e.classList.contains("active")}_getInnerElement(e){return e.matches(Vr)?e:y.findOne(Vr,e)}_getOuterElement(e){return e.closest(Yb)||e}};d.on(document,"click.bs.tab",th,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),be(this)||lc.getOrCreateInstance(this).show()}),d.on(window,"load.bs.tab",()=>{for(let t of y.find(Ub))lc.getOrCreateInstance(t)});var jb="toast";var zb="mouseover.bs.toast",Gb="mouseout.bs.toast",Xb="focusin.bs.toast",Zb="focusout.bs.toast",Qb="hide.bs.toast",Jb="hidden.bs.toast",ev="show.bs.toast",tv="shown.bs.toast";var nv={animation:"boolean",autohide:"boolean",delay:"number"},sv={animation:!0,autohide:!0,delay:5e3},Do=class extends te{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return sv}static get DefaultType(){return nv}static get NAME(){return jb}show(){d.trigger(this._element,ev).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove("hide"),gc(this._element),this._element.classList.add("show","showing"),this._queueCallback(()=>{this._element.classList.remove("showing"),d.trigger(this._element,tv),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(d.trigger(this._element,Qb).defaultPrevented||(this._element.classList.add("showing"),this._queueCallback(()=>{this._element.classList.add("hide"),this._element.classList.remove("showing","show"),d.trigger(this._element,Jb)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove("show"),super.dispose()}isShown(){return this._element.classList.contains("show")}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();let n=t.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){d.on(this._element,zb,t=>this._onInteraction(t,!0)),d.on(this._element,Gb,t=>this._onInteraction(t,!1)),d.on(this._element,Xb,t=>this._onInteraction(t,!0)),d.on(this._element,Zb,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}};Ls(Do);var iv="toggler",sh=".bs.toggler",rv=`toggle${sh}`,ov=`toggled${sh}`;var av='[data-bs-toggle="toggler"]',lv={attribute:"string",value:"(string|number|boolean)"},cv={attribute:"class",value:null},hv=class extends te{static get Default(){return cv}static get DefaultType(){return lv}static get NAME(){return iv}toggle(){d.trigger(this._element,rv).defaultPrevented||(this._execute(),d.trigger(this._element,ov))}_execute(){let{attribute:t,value:e}=this._config;t!=="id"&&(t!=="class"?this._element.getAttribute(t)!==String(e)?this._element.setAttribute(t,e):this._element.removeAttribute(t):this._element.classList.toggle(e))}};Sd(hv,"click",av,"toggle");var Mo=class{constructor(e,n,s){this.eventTarget=e,this.eventName=n,this.eventOptions=s,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let n=uv(e);for(let s of this.bindings){if(n.immediatePropagationStopped)break;s.handleEvent(n)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,n)=>{let s=e.index,i=n.index;return s<i?-1:s>i?1:0})}};function uv(t){if("immediatePropagationStopped"in t)return t;{let{stopImmediatePropagation:e}=t;return Object.assign(t,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var xo=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,n)=>e.concat(Array.from(n.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,n=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),n&&this.clearEventListenersForBinding(e)}handleError(e,n,s={}){this.application.handleError(e,`Error ${n}`,s)}clearEventListenersForBinding(e){let n=this.fetchEventListenerForBinding(e);n.hasBindings()||(n.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:n,eventName:s,eventOptions:i}=e,r=this.fetchEventListenerMapForEventTarget(n),o=this.cacheKey(s,i);r.delete(o),r.size==0&&this.eventListenerMaps.delete(n)}fetchEventListenerForBinding(e){let{eventTarget:n,eventName:s,eventOptions:i}=e;return this.fetchEventListener(n,s,i)}fetchEventListener(e,n,s){let i=this.fetchEventListenerMapForEventTarget(e),r=this.cacheKey(n,s),o=i.get(r);return o||(o=this.createEventListener(e,n,s),i.set(r,o)),o}createEventListener(e,n,s){let i=new Mo(e,n,s);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let n=this.eventListenerMaps.get(e);return n||(n=new Map,this.eventListenerMaps.set(e,n)),n}cacheKey(e,n){let s=[e];return Object.keys(n).sort().forEach(i=>{s.push(`${n[i]?"":"!"}${i}`)}),s.join(":")}},dv={stop({event:t,value:e}){return e&&t.stopPropagation(),!0},prevent({event:t,value:e}){return e&&t.preventDefault(),!0},self({event:t,value:e,element:n}){return e?n===t.target:!0}},mv=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function fv(t){let n=t.trim().match(mv)||[],s=n[2],i=n[3];return i&&!["keydown","keyup","keypress"].includes(s)&&(s+=`.${i}`,i=""),{eventTarget:pv(n[4]),eventName:s,eventOptions:n[7]?gv(n[7]):{},identifier:n[5],methodName:n[6],keyFilter:n[1]||i}}function pv(t){if(t=="window")return window;if(t=="document")return document}function gv(t){return t.split(":").reduce((e,n)=>Object.assign(e,{[n.replace(/^!/,"")]:!/^!/.test(n)}),{})}function bv(t){if(t==window)return"window";if(t==document)return"document"}function Zo(t){return t.replace(/(?:[_-])([a-z0-9])/g,(e,n)=>n.toUpperCase())}function Lo(t){return Zo(t.replace(/--/g,"-").replace(/__/g,"_"))}function Cn(t){return t.charAt(0).toUpperCase()+t.slice(1)}function mh(t){return t.replace(/([A-Z])/g,(e,n)=>`-${n.toLowerCase()}`)}function vv(t){return t.match(/[^\s]+/g)||[]}function ih(t){return t!=null}function Oo(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var rh=["meta","ctrl","alt","shift"],No=class{constructor(e,n,s,i){this.element=e,this.index=n,this.eventTarget=s.eventTarget||e,this.eventName=s.eventName||_v(e)||Hs("missing event name"),this.eventOptions=s.eventOptions||{},this.identifier=s.identifier||Hs("missing identifier"),this.methodName=s.methodName||Hs("missing method name"),this.keyFilter=s.keyFilter||"",this.schema=i}static forToken(e,n){return new this(e.element,e.index,fv(e.content),n)}toString(){let e=this.keyFilter?`.${this.keyFilter}`:"",n=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${n}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;let n=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,n))return!0;let s=n.filter(i=>!rh.includes(i))[0];return s?(Oo(this.keyMappings,s)||Hs(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[s].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let n=[this.keyFilter];return!!this.keyFilterDissatisfied(e,n)}get params(){let e={},n=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:s,value:i}of Array.from(this.element.attributes)){let r=s.match(n),o=r&&r[1];o&&(e[Zo(o)]=yv(i))}return e}get eventTargetName(){return bv(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,n){let[s,i,r,o]=rh.map(a=>n.includes(a));return e.metaKey!==s||e.ctrlKey!==i||e.altKey!==r||e.shiftKey!==o}},oh={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:t=>t.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function _v(t){let e=t.tagName.toLowerCase();if(e in oh)return oh[e](t)}function Hs(t){throw new Error(t)}function yv(t){try{return JSON.parse(t)}catch{return t}}var Io=class{constructor(e,n){this.context=e,this.action=n}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let n=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(n)&&this.invokeWithEvent(n)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:n}=this.action,{actionDescriptorFilters:s}=this.context.application,{controller:i}=this.context,r=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in s){let l=s[o];r=r&&l({name:o,value:a,event:e,element:n,controller:i})}else continue;return r}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:n,currentTarget:s}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:n,currentTarget:s,action:this.methodName})}catch(i){let{identifier:r,controller:o,element:a,index:l}=this,c={identifier:r,controller:o,element:a,index:l,event:e};this.context.handleError(i,`invoking action "${this.action}"`,c)}}willBeInvokedByEvent(e){let n=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===n?!0:n instanceof Element&&this.element.contains(n)?this.scope.containsElement(n):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},Vs=class{constructor(e,n){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=n,this.elements=new Set,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let n of Array.from(this.elements))e.has(n)||this.removeElement(n);for(let n of Array.from(e))this.addElement(n)}}processMutations(e){if(this.started)for(let n of e)this.processMutation(n)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,n){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,n):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(let n of Array.from(e)){let s=this.elementFromNode(n);s&&this.processTree(s,this.removeElement)}}processAddedNodes(e){for(let n of Array.from(e)){let s=this.elementFromNode(n);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,n){for(let s of this.matchElementsInTree(e))n.call(this,s)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},Bs=class{constructor(e,n,s){this.attributeName=n,this.delegate=s,this.elementObserver=new Vs(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let n=this.matchElement(e)?[e]:[],s=Array.from(e.querySelectorAll(this.selector));return n.concat(s)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,n){this.delegate.elementAttributeValueChanged&&this.attributeName==n&&this.delegate.elementAttributeValueChanged(e,n)}};function Ev(t,e,n){fh(t,e).add(n)}function wv(t,e,n){fh(t,e).delete(n),Sv(t,e)}function fh(t,e){let n=t.get(e);return n||(n=new Set,t.set(e,n)),n}function Sv(t,e){let n=t.get(e);n!=null&&n.size==0&&t.delete(e)}var Ve=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((n,s)=>n.concat(Array.from(s)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((n,s)=>n+s.size,0)}add(e,n){Ev(this.valuesByKey,e,n)}delete(e,n){wv(this.valuesByKey,e,n)}has(e,n){let s=this.valuesByKey.get(e);return s!=null&&s.has(n)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(s=>s.has(e))}getValuesForKey(e){let n=this.valuesByKey.get(e);return n?Array.from(n):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([n,s])=>s.has(e)).map(([n,s])=>n)}};var ko=class{constructor(e,n,s,i){this._selector=n,this.details=i,this.elementObserver=new Vs(e,this),this.delegate=s,this.matchesByElement=new Ve}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){let{selector:n}=this;if(n){let s=e.matches(n);return this.delegate.selectorMatchElement?s&&this.delegate.selectorMatchElement(e,this.details):s}else return!1}matchElementsInTree(e){let{selector:n}=this;if(n){let s=this.matchElement(e)?[e]:[],i=Array.from(e.querySelectorAll(n)).filter(r=>this.matchElement(r));return s.concat(i)}else return[]}elementMatched(e){let{selector:n}=this;n&&this.selectorMatched(e,n)}elementUnmatched(e){let n=this.matchesByElement.getKeysForValue(e);for(let s of n)this.selectorUnmatched(e,s)}elementAttributeChanged(e,n){let{selector:s}=this;if(s){let i=this.matchElement(e),r=this.matchesByElement.has(s,e);i&&!r?this.selectorMatched(e,s):!i&&r&&this.selectorUnmatched(e,s)}}selectorMatched(e,n){this.delegate.selectorMatched(e,n,this.details),this.matchesByElement.add(n,e)}selectorUnmatched(e,n){this.delegate.selectorUnmatched(e,n,this.details),this.matchesByElement.delete(n,e)}},Ro=class{constructor(e,n){this.element=e,this.delegate=n,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let n of e)this.processMutation(n)}processMutation(e){let n=e.attributeName;n&&this.refreshAttribute(n,e.oldValue)}refreshAttribute(e,n){let s=this.delegate.getStringMapKeyForAttribute(e);if(s!=null){this.stringMap.has(e)||this.stringMapKeyAdded(s,e);let i=this.element.getAttribute(e);if(this.stringMap.get(e)!=i&&this.stringMapValueChanged(i,s,n),i==null){let r=this.stringMap.get(e);this.stringMap.delete(e),r&&this.stringMapKeyRemoved(s,e,r)}else this.stringMap.set(e,i)}}stringMapKeyAdded(e,n){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,n)}stringMapValueChanged(e,n,s){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,n,s)}stringMapKeyRemoved(e,n,s){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,n,s)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},qs=class{constructor(e,n,s){this.attributeObserver=new Bs(e,n,this),this.delegate=s,this.tokensByElement=new Ve}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[n,s]=this.refreshTokensForElement(e);this.tokensUnmatched(n),this.tokensMatched(s)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(n=>this.tokenMatched(n))}tokensUnmatched(e){e.forEach(n=>this.tokenUnmatched(n))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let n=this.tokensByElement.getValuesForKey(e),s=this.readTokensForElement(e),i=Av(n,s).findIndex(([r,o])=>!Cv(r,o));return i==-1?[[],[]]:[n.slice(i),s.slice(i)]}readTokensForElement(e){let n=this.attributeName,s=e.getAttribute(n)||"";return Tv(s,e,n)}};function Tv(t,e,n){return t.trim().split(/\s+/).filter(s=>s.length).map((s,i)=>({element:e,attributeName:n,content:s,index:i}))}function Av(t,e){let n=Math.max(t.length,e.length);return Array.from({length:n},(s,i)=>[t[i],e[i]])}function Cv(t,e){return t&&e&&t.index==e.index&&t.content==e.content}var Ws=class{constructor(e,n,s){this.tokenListObserver=new qs(e,n,this),this.delegate=s,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:n}=e,{value:s}=this.fetchParseResultForToken(e);s&&(this.fetchValuesByTokenForElement(n).set(e,s),this.delegate.elementMatchedValue(n,s))}tokenUnmatched(e){let{element:n}=e,{value:s}=this.fetchParseResultForToken(e);s&&(this.fetchValuesByTokenForElement(n).delete(e),this.delegate.elementUnmatchedValue(n,s))}fetchParseResultForToken(e){let n=this.parseResultsByToken.get(e);return n||(n=this.parseToken(e),this.parseResultsByToken.set(e,n)),n}fetchValuesByTokenForElement(e){let n=this.valuesByTokenByElement.get(e);return n||(n=new Map,this.valuesByTokenByElement.set(e,n)),n}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(n){return{error:n}}}},Po=class{constructor(e,n){this.context=e,this.delegate=n,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new Ws(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let n=new Io(this.context,e);this.bindingsByAction.set(e,n),this.delegate.bindingConnected(n)}disconnectAction(e){let n=this.bindingsByAction.get(e);n&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(n))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){let n=No.forToken(e,this.schema);if(n.identifier==this.identifier)return n}elementMatchedValue(e,n){this.connectAction(n)}elementUnmatchedValue(e,n){this.disconnectAction(n)}},Fo=class{constructor(e,n){this.context=e,this.receiver=n,this.stringMapObserver=new Ro(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,n){let s=this.valueDescriptorMap[n];this.hasValue(e)||this.invokeChangedCallback(e,s.writer(this.receiver[e]),s.writer(s.defaultValue))}stringMapValueChanged(e,n,s){let i=this.valueDescriptorNameMap[n];e!==null&&(s===null&&(s=i.writer(i.defaultValue)),this.invokeChangedCallback(n,e,s))}stringMapKeyRemoved(e,n,s){let i=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,i.writer(this.receiver[e]),s):this.invokeChangedCallback(e,i.writer(i.defaultValue),s)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:n,defaultValue:s,writer:i}of this.valueDescriptors)s!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(n,i(s),void 0)}invokeChangedCallback(e,n,s){let i=`${e}Changed`,r=this.receiver[i];if(typeof r=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(n),l=s;s&&(l=o.reader(s)),r.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(n=>e[n])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(n=>{let s=this.valueDescriptorMap[n];e[s.name]=s}),e}hasValue(e){let n=this.valueDescriptorNameMap[e],s=`has${Cn(n.name)}`;return this.receiver[s]}},$o=class{constructor(e,n){this.context=e,this.delegate=n,this.targetsByName=new Ve}start(){this.tokenListObserver||(this.tokenListObserver=new qs(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:n}){this.scope.containsElement(e)&&this.connectTarget(e,n)}tokenUnmatched({element:e,content:n}){this.disconnectTarget(e,n)}connectTarget(e,n){var s;this.targetsByName.has(n,e)||(this.targetsByName.add(n,e),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetConnected(e,n)))}disconnectTarget(e,n){var s;this.targetsByName.has(n,e)&&(this.targetsByName.delete(n,e),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetDisconnected(e,n)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let n of this.targetsByName.getValuesForKey(e))this.disconnectTarget(n,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function Dn(t,e){let n=ph(t);return Array.from(n.reduce((s,i)=>(Mv(i,e).forEach(r=>s.add(r)),s),new Set))}function Dv(t,e){return ph(t).reduce((s,i)=>(s.push(...xv(i,e)),s),[])}function ph(t){let e=[];for(;t;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}function Mv(t,e){let n=t[e];return Array.isArray(n)?n:[]}function xv(t,e){let n=t[e];return n?Object.keys(n).map(s=>[s,n[s]]):[]}var Ho=class{constructor(e,n){this.started=!1,this.context=e,this.delegate=n,this.outletsByName=new Ve,this.outletElementsByName=new Ve,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,n,{outletName:s}){let i=this.getOutlet(e,s);i&&this.connectOutlet(i,e,s)}selectorUnmatched(e,n,{outletName:s}){let i=this.getOutletFromMap(e,s);i&&this.disconnectOutlet(i,e,s)}selectorMatchElement(e,{outletName:n}){let s=this.selector(n),i=this.hasOutlet(e,n),r=e.matches(`[${this.schema.controllerAttribute}~=${n}]`);return s?i&&r&&e.matches(s):!1}elementMatchedAttribute(e,n){let s=this.getOutletNameFromOutletAttributeName(n);s&&this.updateSelectorObserverForOutlet(s)}elementAttributeValueChanged(e,n){let s=this.getOutletNameFromOutletAttributeName(n);s&&this.updateSelectorObserverForOutlet(s)}elementUnmatchedAttribute(e,n){let s=this.getOutletNameFromOutletAttributeName(n);s&&this.updateSelectorObserverForOutlet(s)}connectOutlet(e,n,s){var i;this.outletElementsByName.has(s,n)||(this.outletsByName.add(s,e),this.outletElementsByName.add(s,n),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletConnected(e,n,s)))}disconnectOutlet(e,n,s){var i;this.outletElementsByName.has(s,n)&&(this.outletsByName.delete(s,e),this.outletElementsByName.delete(s,n),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletDisconnected(e,n,s)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let n of this.outletElementsByName.getValuesForKey(e))for(let s of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(s,n,e)}updateSelectorObserverForOutlet(e){let n=this.selectorObserverMap.get(e);n&&(n.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let n=this.selector(e),s=new ko(document.body,n,this,{outletName:e});this.selectorObserverMap.set(e,s),s.start()}setupAttributeObserverForOutlet(e){let n=this.attributeNameForOutletName(e),s=new Bs(this.scope.element,n,this);this.attributeObserverMap.set(e,s),s.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(n=>this.attributeNameForOutletName(n)===e)}get outletDependencies(){let e=new Ve;return this.router.modules.forEach(n=>{let s=n.definition.controllerConstructor;Dn(s,"outlets").forEach(r=>e.add(r,n.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let e=this.dependentControllerIdentifiers;return this.router.contexts.filter(n=>e.includes(n.identifier))}hasOutlet(e,n){return!!this.getOutlet(e,n)||!!this.getOutletFromMap(e,n)}getOutlet(e,n){return this.application.getControllerForElementAndIdentifier(e,n)}getOutletFromMap(e,n){return this.outletsByName.getValuesForKey(n).find(s=>s.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},Vo=class{constructor(e,n){this.logDebugActivity=(s,i={})=>{let{identifier:r,controller:o,element:a}=this;i=Object.assign({identifier:r,controller:o,element:a},i),this.application.logDebugActivity(this.identifier,s,i)},this.module=e,this.scope=n,this.controller=new e.controllerConstructor(this),this.bindingObserver=new Po(this,this.dispatcher),this.valueObserver=new Fo(this,this.controller),this.targetObserver=new $o(this,this),this.outletObserver=new Ho(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(s){this.handleError(s,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,n,s={}){let{identifier:i,controller:r,element:o}=this;s=Object.assign({identifier:i,controller:r,element:o},s),this.application.handleError(e,`Error ${n}`,s)}targetConnected(e,n){this.invokeControllerMethod(`${n}TargetConnected`,e)}targetDisconnected(e,n){this.invokeControllerMethod(`${n}TargetDisconnected`,e)}outletConnected(e,n,s){this.invokeControllerMethod(`${Lo(s)}OutletConnected`,e,n)}outletDisconnected(e,n,s){this.invokeControllerMethod(`${Lo(s)}OutletDisconnected`,e,n)}invokeControllerMethod(e,...n){let s=this.controller;typeof s[e]=="function"&&s[e](...n)}};function Lv(t){return Ov(t,Nv(t))}function Ov(t,e){let n=Pv(t),s=Iv(t.prototype,e);return Object.defineProperties(n.prototype,s),n}function Nv(t){return Dn(t,"blessings").reduce((n,s)=>{let i=s(t);for(let r in i){let o=n[r]||{};n[r]=Object.assign(o,i[r])}return n},{})}function Iv(t,e){return Rv(e).reduce((n,s)=>{let i=kv(t,e,s);return i&&Object.assign(n,{[s]:i}),n},{})}function kv(t,e,n){let s=Object.getOwnPropertyDescriptor(t,n);if(!(s&&"value"in s)){let r=Object.getOwnPropertyDescriptor(e,n).value;return s&&(r.get=s.get||r.get,r.set=s.set||r.set),r}}var Rv=typeof Object.getOwnPropertySymbols=="function"?t=>[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)]:Object.getOwnPropertyNames,Pv=(()=>{function t(n){function s(){return Reflect.construct(n,arguments,new.target)}return s.prototype=Object.create(n.prototype,{constructor:{value:s}}),Reflect.setPrototypeOf(s,n),s}function e(){let s=t(function(){this.a.call(this)});return s.prototype.a=function(){},new s}try{return e(),t}catch{return s=>class extends s{}}})();function Fv(t){return{identifier:t.identifier,controllerConstructor:Lv(t.controllerConstructor)}}var Bo=class{constructor(e,n){this.application=e,this.definition=Fv(n),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let n=this.fetchContextForScope(e);this.connectedContexts.add(n),n.connect()}disconnectContextForScope(e){let n=this.contextsByScope.get(e);n&&(this.connectedContexts.delete(n),n.disconnect())}fetchContextForScope(e){let n=this.contextsByScope.get(e);return n||(n=new Vo(this,e),this.contextsByScope.set(e,n)),n}},qo=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let n=this.data.get(this.getDataKey(e))||"";return vv(n)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Wo=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let n=this.getAttributeNameForKey(e);return this.element.getAttribute(n)}set(e,n){let s=this.getAttributeNameForKey(e);return this.element.setAttribute(s,n),this.get(e)}has(e){let n=this.getAttributeNameForKey(e);return this.element.hasAttribute(n)}delete(e){if(this.has(e)){let n=this.getAttributeNameForKey(e);return this.element.removeAttribute(n),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${mh(e)}`}},Yo=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,n,s){let i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(n)||(i.add(n),this.logger.warn(s,e))}};function Ko(t,e){return`[${t}~="${e}"]`}var Uo=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((n,s)=>n||this.findTarget(s)||this.findLegacyTarget(s),void 0)}findAll(...e){return e.reduce((n,s)=>[...n,...this.findAllTargets(s),...this.findAllLegacyTargets(s)],[])}findTarget(e){let n=this.getSelectorForTargetName(e);return this.scope.findElement(n)}findAllTargets(e){let n=this.getSelectorForTargetName(e);return this.scope.findAllElements(n)}getSelectorForTargetName(e){let n=this.schema.targetAttributeForScope(this.identifier);return Ko(n,e)}findLegacyTarget(e){let n=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(n),e)}findAllLegacyTargets(e){let n=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(n).map(s=>this.deprecate(s,e))}getLegacySelectorForTargetName(e){let n=`${this.identifier}.${e}`;return Ko(this.schema.targetAttribute,n)}deprecate(e,n){if(e){let{identifier:s}=this,i=this.schema.targetAttribute,r=this.schema.targetAttributeForScope(s);this.guide.warn(e,`target:${n}`,`Please replace ${i}="${s}.${n}" with ${r}="${n}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},jo=class{constructor(e,n){this.scope=e,this.controllerElement=n}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((n,s)=>n||this.findOutlet(s),void 0)}findAll(...e){return e.reduce((n,s)=>[...n,...this.findAllOutlets(s)],[])}getSelectorForOutletName(e){let n=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(n)}findOutlet(e){let n=this.getSelectorForOutletName(e);if(n)return this.findElement(n,e)}findAllOutlets(e){let n=this.getSelectorForOutletName(e);return n?this.findAllElements(n,e):[]}findElement(e,n){return this.scope.queryElements(e).filter(i=>this.matchesElement(i,e,n))[0]}findAllElements(e,n){return this.scope.queryElements(e).filter(i=>this.matchesElement(i,e,n))}matchesElement(e,n,s){let i=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(n)&&i.split(" ").includes(s)}},zo=class t{constructor(e,n,s,i){this.targets=new Uo(this),this.classes=new qo(this),this.data=new Wo(this),this.containsElement=r=>r.closest(this.controllerSelector)===this.element,this.schema=e,this.element=n,this.identifier=s,this.guide=new Yo(i),this.outlets=new jo(this.documentScope,n)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return Ko(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new t(this.schema,document.documentElement,this.identifier,this.guide.logger)}},Go=class{constructor(e,n,s){this.element=e,this.schema=n,this.delegate=s,this.valueListObserver=new Ws(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:n,content:s}=e;return this.parseValueForElementAndIdentifier(n,s)}parseValueForElementAndIdentifier(e,n){let s=this.fetchScopesByIdentifierForElement(e),i=s.get(n);return i||(i=this.delegate.createScopeForElementAndIdentifier(e,n),s.set(n,i)),i}elementMatchedValue(e,n){let s=(this.scopeReferenceCounts.get(n)||0)+1;this.scopeReferenceCounts.set(n,s),s==1&&this.delegate.scopeConnected(n)}elementUnmatchedValue(e,n){let s=this.scopeReferenceCounts.get(n);s&&(this.scopeReferenceCounts.set(n,s-1),s==1&&this.delegate.scopeDisconnected(n))}fetchScopesByIdentifierForElement(e){let n=this.scopesByIdentifierByElement.get(e);return n||(n=new Map,this.scopesByIdentifierByElement.set(e,n)),n}},Xo=class{constructor(e){this.application=e,this.scopeObserver=new Go(this.element,this.schema,this),this.scopesByIdentifier=new Ve,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,n)=>e.concat(n.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let n=new Bo(this.application,e);this.connectModule(n);let s=e.controllerConstructor.afterLoad;s&&s.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let n=this.modulesByIdentifier.get(e);n&&this.disconnectModule(n)}getContextForElementAndIdentifier(e,n){let s=this.modulesByIdentifier.get(n);if(s)return s.contexts.find(i=>i.element==e)}proposeToConnectScopeForElementAndIdentifier(e,n){let s=this.scopeObserver.parseValueForElementAndIdentifier(e,n);s?this.scopeObserver.elementMatchedValue(s.element,s):console.error(`Couldn't find or create scope for identifier: "${n}" and element:`,e)}handleError(e,n,s){this.application.handleError(e,n,s)}createScopeForElementAndIdentifier(e,n){return new zo(this.schema,e,n,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let n=this.modulesByIdentifier.get(e.identifier);n&&n.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let n=this.modulesByIdentifier.get(e.identifier);n&&n.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(s=>e.connectContextForScope(s))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(s=>e.disconnectContextForScope(s))}},$v={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:t=>`data-${t}-target`,outletAttributeForScope:(t,e)=>`data-${t}-${e}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},ah("abcdefghijklmnopqrstuvwxyz".split("").map(t=>[t,t]))),ah("0123456789".split("").map(t=>[t,t])))};function ah(t){return t.reduce((e,[n,s])=>Object.assign(Object.assign({},e),{[n]:s}),{})}var Ys=class{constructor(e=document.documentElement,n=$v){this.logger=console,this.debug=!1,this.logDebugActivity=(s,i,r={})=>{this.debug&&this.logFormattedMessage(s,i,r)},this.element=e,this.schema=n,this.dispatcher=new xo(this),this.router=new Xo(this),this.actionDescriptorFilters=Object.assign({},dv)}static start(e,n){let s=new this(e,n);return s.start(),s}async start(){await Hv(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,n){this.load({identifier:e,controllerConstructor:n})}registerActionOption(e,n){this.actionDescriptorFilters[e]=n}load(e,...n){(Array.isArray(e)?e:[e,...n]).forEach(i=>{i.controllerConstructor.shouldLoad&&this.router.loadDefinition(i)})}unload(e,...n){(Array.isArray(e)?e:[e,...n]).forEach(i=>this.router.unloadIdentifier(i))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,n){let s=this.router.getContextForElementAndIdentifier(e,n);return s?s.controller:null}handleError(e,n,s){var i;this.logger.error(`%s
120
+
121
+ %o
122
+
123
+ %o`,n,e,s),(i=window.onerror)===null||i===void 0||i.call(window,n,"",0,0,e)}logFormattedMessage(e,n,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${e} #${n}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}};function Hv(){return new Promise(t=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>t()):t()})}function Vv(t){return Dn(t,"classes").reduce((n,s)=>Object.assign(n,Bv(s)),{})}function Bv(t){return{[`${t}Class`]:{get(){let{classes:e}=this;if(e.has(t))return e.get(t);{let n=e.getAttributeName(t);throw new Error(`Missing attribute "${n}"`)}}},[`${t}Classes`]:{get(){return this.classes.getAll(t)}},[`has${Cn(t)}Class`]:{get(){return this.classes.has(t)}}}}function qv(t){return Dn(t,"outlets").reduce((n,s)=>Object.assign(n,Wv(s)),{})}function lh(t,e,n){return t.application.getControllerForElementAndIdentifier(e,n)}function ch(t,e,n){let s=lh(t,e,n);if(s||(t.application.router.proposeToConnectScopeForElementAndIdentifier(e,n),s=lh(t,e,n),s))return s}function Wv(t){let e=Lo(t);return{[`${e}Outlet`]:{get(){let n=this.outlets.find(t),s=this.outlets.getSelectorForOutletName(t);if(n){let i=ch(this,n,t);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${t}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${t}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}Outlets`]:{get(){let n=this.outlets.findAll(t);return n.length>0?n.map(s=>{let i=ch(this,s,t);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${t}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${e}OutletElement`]:{get(){let n=this.outlets.find(t),s=this.outlets.getSelectorForOutletName(t);if(n)return n;throw new Error(`Missing outlet element "${t}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(t)}},[`has${Cn(e)}Outlet`]:{get(){return this.outlets.has(t)}}}}function Yv(t){return Dn(t,"targets").reduce((n,s)=>Object.assign(n,Kv(s)),{})}function Kv(t){return{[`${t}Target`]:{get(){let e=this.targets.find(t);if(e)return e;throw new Error(`Missing target element "${t}" for "${this.identifier}" controller`)}},[`${t}Targets`]:{get(){return this.targets.findAll(t)}},[`has${Cn(t)}Target`]:{get(){return this.targets.has(t)}}}}function Uv(t){let e=Dv(t,"values"),n={valueDescriptorMap:{get(){return e.reduce((s,i)=>{let r=gh(i,this.identifier),o=this.data.getAttributeNameForKey(r.key);return Object.assign(s,{[o]:r})},{})}}};return e.reduce((s,i)=>Object.assign(s,jv(i)),n)}function jv(t,e){let n=gh(t,e),{key:s,name:i,reader:r,writer:o}=n;return{[i]:{get(){let a=this.data.get(s);return a!==null?r(a):n.defaultValue},set(a){a===void 0?this.data.delete(s):this.data.set(s,o(a))}},[`has${Cn(i)}`]:{get(){return this.data.has(s)||n.hasCustomDefaultValue}}}}function gh([t,e],n){return Zv({controller:n,token:t,typeDefinition:e})}function Ks(t){switch(t){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function An(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(t))return"array";if(Object.prototype.toString.call(t)==="[object Object]")return"object"}function zv(t){let{controller:e,token:n,typeObject:s}=t,i=ih(s.type),r=ih(s.default),o=i&&r,a=i&&!r,l=!i&&r,c=Ks(s.type),h=An(t.typeObject.default);if(a)return c;if(l)return h;if(c!==h){let u=e?`${e}.${n}`:n;throw new Error(`The specified default value for the Stimulus Value "${u}" must match the defined type "${c}". The provided default value of "${s.default}" is of type "${h}".`)}if(o)return c}function Gv(t){let{controller:e,token:n,typeDefinition:s}=t,r=zv({controller:e,token:n,typeObject:s}),o=An(s),a=Ks(s),l=r||o||a;if(l)return l;let c=e?`${e}.${s}`:n;throw new Error(`Unknown value type "${c}" for "${n}" value`)}function Xv(t){let e=Ks(t);if(e)return hh[e];let n=Oo(t,"default"),s=Oo(t,"type"),i=t;if(n)return i.default;if(s){let{type:r}=i,o=Ks(r);if(o)return hh[o]}return t}function Zv(t){let{token:e,typeDefinition:n}=t,s=`${mh(e)}-value`,i=Gv(t);return{type:i,key:s,name:Zo(s),get defaultValue(){return Xv(n)},get hasCustomDefaultValue(){return An(n)!==void 0},reader:Qv[i],writer:uh[i]||uh.default}}var hh={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Qv={array(t){let e=JSON.parse(t);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${t}" of type "${An(e)}"`);return e},boolean(t){return!(t=="0"||String(t).toLowerCase()=="false")},number(t){return Number(t.replace(/_/g,""))},object(t){let e=JSON.parse(t);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${t}" of type "${An(e)}"`);return e},string(t){return t}},uh={default:Jv,array:dh,object:dh};function dh(t){return JSON.stringify(t)}function Jv(t){return`${t}`}var I=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,n){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:n=this.element,detail:s={},prefix:i=this.identifier,bubbles:r=!0,cancelable:o=!0}={}){let a=i?`${i}:${e}`:e,l=new CustomEvent(a,{detail:s,bubbles:r,cancelable:o});return n.dispatchEvent(l),l}};I.blessings=[Vv,Yv,Uv,qv];I.targets=[];I.outlets=[];I.values={};function Qo(t,e,n){let s=n_(),[i,...r]=t.split(`
124
+ `),o=s.querySelector(".dialog-body");s.querySelector(".dialog-title").textContent=i,o.replaceChildren(...t_(r)),o.hidden=!o.children.length;let a=s.querySelector(".bh-confirm-answer");return a.textContent=e_(n,e)||"OK",new Promise(l=>{a.onclick=()=>{l(!0),Qe.getOrCreateInstance(s).hide()},s.addEventListener("hidden.bs.dialog",()=>l(!1),{once:!0}),Qe.getOrCreateInstance(s).show()})}function e_(t,e){let n=e?.tagName==="FORM",s=t||(n?e.querySelector("[type=submit]")||bh:e);return s?.textContent?.trim()||s?.value}var bh=null;document.addEventListener("click",({target:t})=>{bh=t.closest?.("[data-turbo-confirm]")||null},!0);function t_(t){return t.filter(e=>e).map(e=>{let n=document.createElement("p");return n.textContent=e,n})}function n_(){let t=document.querySelector("#bh-confirm");return t||(t=document.createElement("dialog"),t.className="dialog dialog-slide-down",t.id="bh-confirm",t.setAttribute("aria-labelledby","bh-confirm-title"),t.innerHTML=`
125
+ <div class='dialog-header'><h1 class='dialog-title' id='bh-confirm-title'></h1></div>
126
+ <div class='dialog-body'></div>
127
+ <div class='dialog-footer'>
128
+ <button type='button' class='btn btn-solid theme-secondary' data-bs-dismiss='dialog' autofocus>${s_()}</button>
129
+ <button type='button' class='btn btn-solid theme-danger bh-confirm-answer'></button>
130
+ </div>`,document.body.append(t),t)}function s_(){return document.querySelector('meta[name="bh-cancel"]')?.content||"Cancel"}document.addEventListener("turbo:before-cache",()=>{let t=document.querySelector("#bh-confirm");t?.open&&Qe.getOrCreateInstance(t).dispose(),t?.classList.remove("hiding")});function Us(t,e="theme-danger"){let n=document.createElement("div");n.className=`toast fade show ${e}`,n.setAttribute("role","alert"),n.setAttribute("aria-live","assertive"),n.dataset.controller="toast",n.dataset.action=["mouseenter->toast#stopTimer","mouseleave->toast#startTimer","focusin->toast#stopTimer","focusout->toast#startTimer"].join(" ");let s=document.createElement("div");s.className="toast-header border-0";let i=document.createElement("span");i.className="me-auto",i.textContent=t,s.append(i),n.append(s),i_().append(n)}function i_(){let t=document.querySelector(".toast-container");return t||(t=document.createElement("div"),t.className="toast-container position-fixed bottom-0 end-0 p-3",t.dataset.turboTemporary="",document.body.append(t),t)}var js=class extends I{static values={kept:Boolean,error:String};connect(){this.form=this.element.closest("form"),this.row=this.element.closest("tr"),this.icon=this.element.querySelector("i"),this.form.addEventListener("submit",this.submit)}disconnect(){this.form.removeEventListener("submit",this.submit)}submit=t=>{t.preventDefault();let e=!this.keptValue,n=new FormData(this.form);this.render(e),this.send(n,e)};render(t){this.keptValue=t,this.icon.className=t?"bi bi-bookmark-fill":"bi bi-bookmark",this.element.setAttribute("aria-pressed",t),this.method.value=t?"delete":"post"}get token(){return document.querySelector('meta[name="csrf-token"]')?.content}get method(){let t=this.form.querySelector('input[name="_method"]');return t||(t=document.createElement("input"),t.type="hidden",t.name="_method",this.form.prepend(t)),t}async send(t,e){try{if(!(await fetch(this.form.action,{method:"post",body:t,headers:{Accept:"application/json","X-CSRF-Token":this.token}})).ok)return this.revert(e);this.row?.classList.toggle("recourse-kept",e)}catch{this.revert(e)}}revert(t){this.render(!t),Us(this.errorValue)}};var zs=class extends I{static targets=["input","button"];connect(){this.toggle()}toggle(){this.buttonTarget.classList.toggle("d-none",!this.inputTarget.value)}clear(){this.inputTarget.value="",this.inputTarget.dispatchEvent(new Event("input",{bubbles:!0})),this.inputTarget.focus(),this.toggle()}};function vh(t,e){let n=ie("button","form-control combobox-toggle",{type:"button"});return t.classList.contains("form-select-sm")&&n.classList.add("form-control-sm"),t.classList.contains("is-invalid")&&n.classList.add("is-invalid"),n.dataset.bsToggle="combobox",n.dataset.bsSearch="true",n.dataset.bsPlaceholder=e.placeholderValue,t.multiple&&(n.dataset.bsMultiple="true"),t.required&&n.setAttribute("aria-required","true"),r_(n,t),n.append(ie("span","combobox-value",{},e.placeholderValue),ie("i","bi bi-chevron-down combobox-caret")),[n,o_(t,e)]}function r_(t,e){let n=e.id&&document.querySelector(`label[for='${e.id}']`);n&&t.setAttribute("aria-labelledby",n.id||=`${e.id}-label`);for(let s of["aria-label","aria-describedby"])e.hasAttribute(s)&&t.setAttribute(s,e.getAttribute(s))}function o_(t,e){let n=ie("div","menu");n.append(a_(t)),e.hasAllValue&&t.multiple&&n.append(l_(t,e.allValue),ie("div","menu-divider"));for(let s of t.options)n.append(c_(s,t.multiple));return n.append(ie("div","combobox-no-results d-none",{},t.dataset.noResults||"")),n}function a_(t){let e=ie("div","combobox-search");e.dataset.controller="clear";let n=ie("input","form-control combobox-search-input",{type:"text",autocomplete:"off",placeholder:t.dataset.search||"","aria-label":t.dataset.search||""});n.dataset.clearTarget="input",n.dataset.action="input->clear#toggle";let s=ie("button","combobox-search-clear d-none",{type:"button","aria-label":t.dataset.clear||""});return s.dataset.clearTarget="button",s.dataset.action="clear#clear",s.append(ie("i","bi bi-x-lg")),e.append(n,s),e}function l_(t,e){let n=ie("button","menu-item",{type:"button"},e);return n.dataset.controller="deselect",n.dataset.action="deselect#all",n.dataset.deselectMultipleValue=String(t.multiple),n}function c_(t,e){let n=ie("button","menu-item",{type:"button","aria-selected":String(t.selected)});n.dataset.bsValue=t.value,t.selected&&n.classList.add("selected"),"hidden"in t.dataset&&!t.selected&&n.classList.add("d-none");let s=ie("span","menu-item-content");return s.append(ie("span","",{},t.textContent)),n.append(s),t.dataset.count&&n.append(ie("span","combobox-count fg-2",{},t.dataset.count)),e&&n.append(ie("i","bi bi-check menu-item-check")),n}function ie(t,e,n={},s=null){let i=document.createElement(t);e&&(i.className=e);for(let[r,o]of Object.entries(n))i.setAttribute(r,o);return s!==null&&(i.textContent=s),i}var Gs=class extends I{static values={more:String,placeholder:String,all:String};connect(){this.#e(),this.morphed=()=>this.#n(),document.addEventListener("turbo:morph",this.morphed)}disconnect(){document.removeEventListener("turbo:morph",this.morphed),this.#t()}#e(){this.widget=vh(this.element,this),this.element.after(...this.widget),this.element.hidden=!0,this.combobox=Cs.getOrCreateInstance(this.toggle),this.#s(),this.picked=()=>this.#i(),this.toggle.addEventListener("change.bs.combobox",this.picked)}#t(){this.toggle.removeEventListener("change.bs.combobox",this.picked),this.combobox.dispose(),this.widget.forEach(t=>t.remove()),this.element.hidden=!1}get toggle(){return this.widget[0]}get menu(){return this.widget[1]}#n(){this.element.isConnected&&(this.#t(),this.#e())}#i(){let t=new Set([...this.menu.querySelectorAll(".menu-item.selected")].map(e=>e.dataset.bsValue));for(let e of this.element.options)e.selected=t.has(e.value);this.#s(),this.element.dispatchEvent(new Event("change",{bubbles:!0}))}#s(){let t=this.menu.querySelectorAll(".menu-item.selected");if(!this.element.multiple||t.length<2)return;let e=t[0].querySelector(".menu-item-content > span:first-child");this.toggle.querySelector(".combobox-value").textContent=this.moreValue.replace("%{first}",e.textContent).replace("%{count}",t.length-1)}};var Xs=class extends I{static values={storage:String};toggle(){let e=document.body.classList.contains("recourse-expanded")?"compact":"expanded";document.cookie=`${this.storageValue}=${e}; path=/; max-age=31536000; samesite=lax`,window.location.reload()}};var Zs=class extends I{static values={multiple:Boolean};all(t){t.stopPropagation();let e=this.element.closest(".menu");for(let n of e.querySelectorAll(".menu-item.d-none"))n.classList.remove("d-none");if(this.multipleValue)for(let n of e.querySelectorAll(".menu-item.selected"))n.click()}};var Qs=class extends I{static values={storage:String,to:Number};toggle(){document.cookie=`${this.storageValue}=${this.toValue}; path=/; max-age=31536000; samesite=lax`;let t=new URL(window.location.href);t.searchParams.delete("page"),window.Turbo.visit(t.href,{frame:"results",action:"replace"})}};function _h(t){let e=(window.google||={}).maps||={};if(e.importLibrary)return;let n;e.importLibrary=(s,...i)=>(n||=new Promise((r,o)=>{let a=document.createElement("script"),l=new URLSearchParams({key:t,v:"weekly",loading:"async",callback:"google.maps.__ib__"});a.src=`https://maps.googleapis.com/maps/api/js?${l}`,e.__ib__=r,a.onerror=()=>o(new Error("The Google Maps API could not be loaded")),document.head.append(a)}),n.then(()=>e.importLibrary(s,...i)))}var Js=class extends I{static values={key:String,id:String,boundary:String,places:Array,points:Array};async connect(){_h(this.keyValue);let{Map:t}=await google.maps.importLibrary("maps"),{LatLngBounds:e}=await google.maps.importLibrary("core"),n=new t(this.element,{mapId:this.idValue,gestureHandling:"none",zoomControl:!1,disableDefaultUI:!0,keyboardShortcuts:!1}),s=new e;await Promise.all([this.place(n,s),this.point(n,s)]),s.isEmpty()||n.fitBounds(s,10)}async place(t,e){if(this.placesValue.length===0)return;let{Place:n}=await google.maps.importLibrary("places"),s=this.placesValue.map(i=>new n({id:i}));return this.hasBoundaryValue?this.fill(t,e,s):this.pin(t,e,s)}async fill(t,e,n){let s=new Set(this.placesValue);t.getFeatureLayer(this.boundaryValue).style=({feature:i})=>{if(s.has(i.placeId))return h_},await Promise.all(n.map(i=>yh(i,"viewport").then(()=>{i.viewport&&e.union(i.viewport)})))}async pin(t,e,n){let s=await this.dropper(t,e);await Promise.all(n.map(i=>yh(i,"location").then(()=>{i.location&&s(i.location)})))}async point(t,e){if(this.pointsValue.length===0)return;let n=await this.dropper(t,e);for(let[s,i]of this.pointsValue)n({lat:s,lng:i})}async dropper(t,e){let{AdvancedMarkerElement:n}=await google.maps.importLibrary("marker");return s=>{new n({map:t,position:s}),e.extend(s)}}};function yh(t,e){return t.fetchFields({fields:[e]}).catch(console.error)}var h_={strokeColor:"#2D85FF",strokeOpacity:1,strokeWeight:3,fillColor:"#2D85FF",fillOpacity:.5};function Eh(t,e){$s.getInstance(t)?.dispose(),t.querySelector(".otp-slots")?.remove(),t.classList.remove("otp-rendered");let n=new $s(t);return e.value&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length)),e.pattern="[0-9]{6}",n}var ei=class extends I{connect(){this.element.classList.add("otp-drawing"),this.pasted=!1,this.draw=()=>{this.element.isConnected&&(this.otp=Eh(this.element,this.field))},this.collapse=()=>{if(document.activeElement!==this.field)return;let{value:t,selectionStart:e,selectionEnd:n}=this.field;t.length<6||e===n||this.field.setSelectionRange(t.length,t.length)},this.relay=()=>{this.relaying||(this.relaying=!0,this.field.dispatchEvent(new Event("input",{bubbles:!0})),this.relaying=!1)},this.remember=()=>{this.pasted=!0,this.field.value=""},this.forget=t=>{/^[0-9]$/.test(t.key)&&(this.pasted=!1)},this.send=()=>{this.pasted&&(this.pasted=!1,this.submit())},this.submit=()=>this.element.closest("form")?.requestSubmit(),this.adopt=()=>{this.relaying||(this.field.dispatchEvent(new Event("keyup",{bubbles:!0})),this.field.checkValidity()&&this.submit())},this.listeners=[["input",this.adopt],["input.bs.otpInput",this.relay],["paste",this.remember],["keydown",this.forget],["complete.bs.otpInput",this.send]];for(let[t,e]of this.listeners)this.element.addEventListener(t,e);this.draw(),document.addEventListener("turbo:render",this.draw),document.addEventListener("selectionchange",this.collapse)}disconnect(){document.removeEventListener("turbo:render",this.draw),document.removeEventListener("selectionchange",this.collapse);for(let[t,e]of this.listeners)this.element.removeEventListener(t,e);this.otp?.dispose()}get field(){return this.element.querySelector(".otp-input")}};var ti=class extends I{static pattern="[2-9]\\d{2}-[2-9]\\d{2}-\\d{4}";static sample="555-555-5555";connect(){this.#e&&this.#i(),this.#s()}down(t){if(t.key&&!t.ctrlKey&&!t.metaKey&&!(t.key.length>1)){if(!/[0-9.]/.test(t.key)){t.preventDefault();return}this.#t().length>=10&&this.#n()&&t.preventDefault()}}input(t){t.inputType!=="deleteContentBackward"&&this.#s()}get#e(){return this.element instanceof HTMLInputElement}#t(){return this.constructor.digits(this.#e?this.element.value:this.element.textContent)}#n(){return this.element.selectionStart===this.element.selectionEnd}#i(){let{pattern:t,sample:e}=this.constructor,n=this.element;n.pattern||=t,n.placeholder||=e,n.title||=`Please match the format ${e}`,n.inputMode||="numeric"}#s(){let t=this.#e?this.element.value:this.element.textContent,e=this.constructor.format(t);if(e!==t){if(!this.#e){this.element.textContent=e;return}this.element.value=e,!this.saying&&(this.saying=!0,this.element.dispatchEvent(new Event("input",{bubbles:!0})),this.saying=!1)}}static format(t){let e=this.digits(t);return[e.substring(0,3),e.substring(3,6),e.substring(6,10)].filter(s=>s.length>0).join("-")}static digits(t){let e=t.replace(/\D/g,"");return e.length>10&&e.startsWith("1")?e.slice(1,11):e.slice(0,10)}};var ni=class extends I{static values={questions:Array,every:{type:Number,default:1e4}};connect(){this.index=0,this.timer=setInterval(()=>this.#e(),this.everyValue)}disconnect(){clearInterval(this.timer)}#e(){this.element.value||(this.element.classList.add("is-fading"),setTimeout(()=>{this.index=(this.index+1)%this.questionsValue.length,this.element.placeholder=this.questionsValue[this.index],this.element.classList.remove("is-fading")},300))}};var u_=[["year",31536e6],["month",2592e6],["week",6048e5],["day",864e5],["hour",36e5],["minute",6e4]],si=class extends I{connect(){this.entered=()=>this.#e(),this.element.addEventListener("mouseenter",this.entered)}disconnect(){this.element.removeEventListener("mouseenter",this.entered)}#e(){let t=new Date(this.element.getAttribute("datetime"));isNaN(t.getTime())||it.getInstance(this.element)?.setContent({".tooltip-inner":this.#t(t)})}#t(t){let e=new Intl.RelativeTimeFormat(document.documentElement.lang||"en"),n=t-new Date;for(let[s,i]of u_)if(Math.abs(n)>=i)return e.format(Math.round(n/i),s);return e.format(Math.round(n/1e3),"second")}};var ii=class extends I{connect(){this.toggle(),this.element.querySelectorAll("[required]").forEach(t=>{t.addEventListener("input",()=>this.toggle())})}toggle(){let t=this.element.querySelectorAll("[required]:invalid").length>0;this.element.querySelectorAll('[type="submit"]').forEach(e=>{e.disabled=t})}};var ri=class extends I{static targets=["mask","button"];static values={plain:String};show(){this.maskTarget.textContent=this.plainValue,this.buttonTarget.remove()}};var oi=class extends I{static values={themes:Array,path:String,storage:String};connect(){let t=this.#t();t&&this.#e(t.theme,t.mode)}rotate(){let t=this.#n()==="dark"?"light":"dark",e=this.themesValue.filter(s=>s!==this.#i()),n=e[Math.floor(Math.random()*e.length)];this.#e(n,t),localStorage.setItem(this.storageValue,JSON.stringify({theme:n,mode:t}))}#e(t,e){(e==="light"||e==="dark")&&(document.documentElement.dataset.bsTheme=e),this.themesValue.includes(t)&&(this.#o().href=`${this.pathValue}/${t}.css`)}#t(){try{return JSON.parse(localStorage.getItem(this.storageValue))}catch{return null}}#n(){return document.documentElement.dataset.bsTheme||(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}#i(){let t=this.#s();return t?t.href.split("/").pop().replace(".css",""):null}#s(){let t=document.querySelectorAll("link[data-recourse-theme]");return t[t.length-1]}#o(){let t=[...document.querySelectorAll("link[data-recourse-theme]")],e=t.pop()||this.#r();return t.forEach(n=>n.remove()),e}#r(){let t=document.createElement("link");return t.rel="stylesheet",t.dataset.recourseTheme="",document.head.appendChild(t),t}};var ai=!1,li=class extends I{static targets=["field"];connect(){ai&&!document.documentElement.hasAttribute("data-turbo-preview")&&(ai=!1,this.#n()),this.picked=()=>{clearTimeout(this.pick),this.pick=setTimeout(()=>this.#e(),0)},this.element.addEventListener("change",this.picked),this.reloaded=()=>{ai=!1,this.#t()},document.addEventListener("turbo:frame-load",this.reloaded),this.morphing=t=>{this.element.contains(t.target)&&t.preventDefault()},document.addEventListener("turbo:before-morph-element",this.morphing)}disconnect(){this.element.removeEventListener("change",this.picked),document.removeEventListener("turbo:frame-load",this.reloaded),document.removeEventListener("turbo:before-morph-element",this.morphing),clearTimeout(this.timer),clearTimeout(this.pick)}submit(){clearTimeout(this.timer),this.timer=setTimeout(()=>{ai=!0,this.#e()},300)}#e(){this.element.requestSubmit()}#t(){let t=this.element.querySelector('input[name="q[s]"]');t&&(t.value=new URL(window.location.href).searchParams.get("q[s]")||"")}#n(){if(!this.hasFieldTarget)return;let t=this.fieldTarget;t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length)}};var ci=class extends I{connect(){this.reveal=t=>this.element.classList.toggle("recourse-keys",t.altKey),this.hide=()=>this.element.classList.remove("recourse-keys"),this.press=t=>this.#e(t),document.addEventListener("keydown",this.reveal),document.addEventListener("keyup",this.reveal),document.addEventListener("keydown",this.press),window.addEventListener("blur",this.hide)}disconnect(){document.removeEventListener("keydown",this.reveal),document.removeEventListener("keyup",this.reveal),document.removeEventListener("keydown",this.press),window.removeEventListener("blur",this.hide)}#e(t){if(!t.altKey||t.ctrlKey||t.metaKey)return;let e=t.code.match(/^Key([A-Z])$/);if(!e)return;let n=this.element.querySelector(`[data-key="${e[1].toLowerCase()}"]`);n&&(t.preventDefault(),this.hide(),n.click())}};function d_(t,e,n){return(e=g_(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qe(){return qe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var s in n)({}).hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},qe.apply(null,arguments)}function wh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function Ne(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wh(Object(n),!0).forEach(function(s){d_(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wh(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}function m_(t,e){if(t==null)return{};var n,s,i=f_(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(s=0;s<r.length;s++)n=r[s],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function f_(t,e){if(t==null)return{};var n={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.indexOf(s)!==-1)continue;n[s]=t[s]}return n}function p_(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,e||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function g_(t){var e=p_(t,"string");return typeof e=="symbol"?e:e+""}function la(t){"@babel/helpers - typeof";return la=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},la(t)}var b_="1.15.7";function Be(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var We=Be(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pn=Be(/Edge/i),Sh=Be(/firefox/i),On=Be(/safari/i)&&!Be(/chrome/i)&&!Be(/android/i),ma=Be(/iP(ad|od|hone)/i),Oh=Be(/chrome/i)&&Be(/android/i),Nh={capture:!1,passive:!1};function B(t,e,n){t.addEventListener(e,n,!We&&Nh)}function H(t,e,n){t.removeEventListener(e,n,!We&&Nh)}function vi(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Ih(t){return t.host&&t!==document&&t.host.nodeType&&t.host!==t?t.host:t.parentNode}function we(t,e,n,s){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&vi(t,e):vi(t,e))||s&&t===n)return t;if(t===n)break}while(t=Ih(t))}return null}var Th=/\s+/g;function fe(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var s=(" "+t.className+" ").replace(Th," ").replace(" "+e+" "," ");t.className=(s+(n?" "+e:"")).replace(Th," ")}}function k(t,e,n){var s=t&&t.style;if(s){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in s)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),s[e]=n+(typeof n=="string"?"":"px")}}function Xt(t,e){var n="";if(typeof t=="string")n=t;else do{var s=k(t,"transform");s&&s!=="none"&&(n=s+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function kh(t,e,n){if(t){var s=t.getElementsByTagName(e),i=0,r=s.length;if(n)for(;i<r;i++)n(s[i],i);return s}return[]}function Oe(){var t=document.scrollingElement;return t||document.documentElement}function X(t,e,n,s,i){if(!(!t.getBoundingClientRect&&t!==window)){var r,o,a,l,c,h,u;if(t!==window&&t.parentNode&&t!==Oe()?(r=t.getBoundingClientRect(),o=r.top,a=r.left,l=r.bottom,c=r.right,h=r.height,u=r.width):(o=0,a=0,l=window.innerHeight,c=window.innerWidth,h=window.innerHeight,u=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!We))do if(i&&i.getBoundingClientRect&&(k(i,"transform")!=="none"||n&&k(i,"position")!=="static")){var m=i.getBoundingClientRect();o-=m.top+parseInt(k(i,"border-top-width")),a-=m.left+parseInt(k(i,"border-left-width")),l=o+r.height,c=a+r.width;break}while(i=i.parentNode);if(s&&t!==window){var f=Xt(i||t),g=f&&f.a,_=f&&f.d;f&&(o/=_,a/=g,u/=g,h/=_,l=o+h,c=a+u)}return{top:o,left:a,bottom:l,right:c,width:u,height:h}}}function Ah(t,e,n){for(var s=at(t,!0),i=X(t)[e];s;){var r=X(s)[n],o=void 0;if(n==="top"||n==="left"?o=i>=r:o=i<=r,!o)return s;if(s===Oe())break;s=at(s,!1)}return!1}function Zt(t,e,n,s){for(var i=0,r=0,o=t.children;r<o.length;){if(o[r].style.display!=="none"&&o[r]!==R.ghost&&(s||o[r]!==R.dragged)&&we(o[r],n.draggable,t,!1)){if(i===e)return o[r];i++}r++}return null}function fa(t,e){for(var n=t.lastElementChild;n&&(n===R.ghost||k(n,"display")==="none"||e&&!vi(n,e));)n=n.previousElementSibling;return n||null}function ve(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==R.clone&&(!e||vi(t,e))&&n++;return n}function Ch(t){var e=0,n=0,s=Oe();if(t)do{var i=Xt(t),r=i.a,o=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*o}while(t!==s&&(t=t.parentNode));return[e,n]}function v_(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var s in e)if(e.hasOwnProperty(s)&&e[s]===t[n][s])return Number(n)}return-1}function at(t,e){if(!t||!t.getBoundingClientRect)return Oe();var n=t,s=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=k(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Oe();if(s||e)return n;s=!0}}while(n=n.parentNode);return Oe()}function __(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Jo(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Nn;function Rh(t,e){return function(){if(!Nn){var n=arguments,s=this;n.length===1?t.call(s,n[0]):t.apply(s,n),Nn=setTimeout(function(){Nn=void 0},e)}}}function y_(){clearTimeout(Nn),Nn=void 0}function Ph(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Fh(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function $h(t,e,n){var s={};return Array.from(t.children).forEach(function(i){var r,o,a,l;if(!(!we(i,e.draggable,t,!1)||i.animated||i===n)){var c=X(i);s.left=Math.min((r=s.left)!==null&&r!==void 0?r:1/0,c.left),s.top=Math.min((o=s.top)!==null&&o!==void 0?o:1/0,c.top),s.right=Math.max((a=s.right)!==null&&a!==void 0?a:-1/0,c.right),s.bottom=Math.max((l=s.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}var ce="Sortable"+new Date().getTime();function E_(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(i){if(!(k(i,"display")==="none"||i===R.ghost)){t.push({target:i,rect:X(i)});var r=Ne({},t[t.length-1].rect);if(i.thisAnimationDuration){var o=Xt(i,!0);o&&(r.top-=o.f,r.left-=o.e)}i.fromRect=r}})}},addAnimationState:function(s){t.push(s)},removeAnimationState:function(s){t.splice(v_(t,{target:s}),1)},animateAll:function(s){var i=this;if(!this.options.animation){clearTimeout(e),typeof s=="function"&&s();return}var r=!1,o=0;t.forEach(function(a){var l=0,c=a.target,h=c.fromRect,u=X(c),m=c.prevFromRect,f=c.prevToRect,g=a.rect,_=Xt(c,!0);_&&(u.top-=_.f,u.left-=_.e),c.toRect=u,c.thisAnimationDuration&&Jo(m,u)&&!Jo(h,u)&&(g.top-u.top)/(g.left-u.left)===(h.top-u.top)/(h.left-u.left)&&(l=S_(g,m,f,i.options)),Jo(u,h)||(c.prevFromRect=h,c.prevToRect=u,l||(l=i.options.animation),i.animate(c,g,u,l)),l&&(r=!0,o=Math.max(o,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(e),r?e=setTimeout(function(){typeof s=="function"&&s()},o):typeof s=="function"&&s(),t=[]},animate:function(s,i,r,o){if(o){k(s,"transition",""),k(s,"transform","");var a=Xt(this.el),l=a&&a.a,c=a&&a.d,h=(i.left-r.left)/(l||1),u=(i.top-r.top)/(c||1);s.animatingX=!!h,s.animatingY=!!u,k(s,"transform","translate3d("+h+"px,"+u+"px,0)"),this.forRepaintDummy=w_(s),k(s,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),k(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){k(s,"transition",""),k(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},o)}}}}function w_(t){return t.offsetWidth}function S_(t,e,n,s){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*s.animation}var Ut=[],ea={initializeByDefault:!0},Fn={mount:function(e){for(var n in ea)ea.hasOwnProperty(n)&&!(n in e)&&(e[n]=ea[n]);Ut.forEach(function(s){if(s.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Ut.push(e)},pluginEvent:function(e,n,s){var i=this;this.eventCanceled=!1,s.cancel=function(){i.eventCanceled=!0};var r=e+"Global";Ut.forEach(function(o){n[o.pluginName]&&(n[o.pluginName][r]&&n[o.pluginName][r](Ne({sortable:n},s)),n.options[o.pluginName]&&n[o.pluginName][e]&&n[o.pluginName][e](Ne({sortable:n},s)))})},initializePlugins:function(e,n,s,i){Ut.forEach(function(a){var l=a.pluginName;if(!(!e.options[l]&&!a.initializeByDefault)){var c=new a(e,n,e.options);c.sortable=e,c.options=e.options,e[l]=c,qe(s,c.defaults)}});for(var r in e.options)if(e.options.hasOwnProperty(r)){var o=this.modifyOption(e,r,e.options[r]);typeof o<"u"&&(e.options[r]=o)}},getEventProperties:function(e,n){var s={};return Ut.forEach(function(i){typeof i.eventProperties=="function"&&qe(s,i.eventProperties.call(n[i.pluginName],e))}),s},modifyOption:function(e,n,s){var i;return Ut.forEach(function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(i=r.optionListeners[n].call(e[r.pluginName],s))}),i}};function T_(t){var e=t.sortable,n=t.rootEl,s=t.name,i=t.targetEl,r=t.cloneEl,o=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,h=t.oldDraggableIndex,u=t.newDraggableIndex,m=t.originalEvent,f=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[ce],!!e){var _,S=e.options,C="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!We&&!Pn?_=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(_=document.createEvent("Event"),_.initEvent(s,!0,!0)),_.to=o||n,_.from=a||n,_.item=i||n,_.clone=r,_.oldIndex=l,_.newIndex=c,_.oldDraggableIndex=h,_.newDraggableIndex=u,_.originalEvent=m,_.pullMode=f?f.lastPutMode:void 0;var p=Ne(Ne({},g),Fn.getEventProperties(s,e));for(var w in p)_[w]=p[w];n&&n.dispatchEvent(_),S[C]&&S[C].call(e,_)}}var A_=["evt"],le=function(e,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=s.evt,r=m_(s,A_);Fn.pluginEvent.bind(R)(e,n,Ne({dragEl:D,parentEl:j,ghostEl:F,rootEl:W,nextEl:St,lastDownEl:fi,cloneEl:U,cloneHidden:ot,dragStarted:Mn,putSortable:se,activeSortable:R.active,originalEvent:i,oldIndex:Gt,oldDraggableIndex:In,newIndex:pe,newDraggableIndex:rt,hideGhostForTarget:qh,unhideGhostForTarget:Wh,cloneNowHidden:function(){ot=!0},cloneNowShown:function(){ot=!1},dispatchSortableEvent:function(a){oe({sortable:n,name:a,originalEvent:i})}},r))};function oe(t){T_(Ne({putSortable:se,cloneEl:U,targetEl:D,rootEl:W,oldIndex:Gt,oldDraggableIndex:In,newIndex:pe,newDraggableIndex:rt},t))}var D,j,F,W,St,fi,U,ot,Gt,pe,In,rt,hi,se,zt=!1,_i=!1,yi=[],Et,Ee,ta,na,Dh,Mh,Mn,jt,kn,Rn=!1,ui=!1,pi,re,sa=[],ca=!1,Ei=[],Si=typeof document<"u",di=ma,xh=Pn||We?"cssFloat":"float",C_=Si&&!Oh&&!ma&&"draggable"in document.createElement("div"),Hh=(function(){if(Si){if(We)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}})(),Vh=function(e,n){var s=k(e),i=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),r=Zt(e,0,n),o=Zt(e,1,n),a=r&&k(r),l=o&&k(o),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+X(r).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+X(o).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return o&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=i&&s[xh]==="none"||o&&s[xh]==="none"&&c+h>i)?"vertical":"horizontal"},D_=function(e,n,s){var i=s?e.left:e.top,r=s?e.right:e.bottom,o=s?e.width:e.height,a=s?n.left:n.top,l=s?n.right:n.bottom,c=s?n.width:n.height;return i===a||r===l||i+o/2===a+c/2},M_=function(e,n){var s;return yi.some(function(i){var r=i[ce].options.emptyInsertThreshold;if(!(!r||fa(i))){var o=X(i),a=e>=o.left-r&&e<=o.right+r,l=n>=o.top-r&&n<=o.bottom+r;if(a&&l)return s=i}}),s},Bh=function(e){function n(r,o){return function(a,l,c,h){var u=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(o||u))return!0;if(r==null||r===!1)return!1;if(o&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,c,h),o)(a,l,c,h);var m=(o?a:l).options.group.name;return r===!0||typeof r=="string"&&r===m||r.join&&r.indexOf(m)>-1}}var s={},i=e.group;(!i||la(i)!="object")&&(i={name:i}),s.name=i.name,s.checkPull=n(i.pull,!0),s.checkPut=n(i.put),s.revertClone=i.revertClone,e.group=s},qh=function(){!Hh&&F&&k(F,"display","none")},Wh=function(){!Hh&&F&&k(F,"display","")};Si&&!Oh&&document.addEventListener("click",function(t){if(_i)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),_i=!1,!1},!0);var wt=function(e){if(D){e=e.touches?e.touches[0]:e;var n=M_(e.clientX,e.clientY);if(n){var s={};for(var i in e)e.hasOwnProperty(i)&&(s[i]=e[i]);s.target=s.rootEl=n,s.preventDefault=void 0,s.stopPropagation=void 0,n[ce]._onDragOver(s)}}},x_=function(e){D&&D.parentNode[ce]._isOutsideThisEl(e.target)};function R(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=qe({},e),t[ce]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Vh(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,a){o.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:R.supportPointer!==!1&&"PointerEvent"in window&&(!On||ma),emptyInsertThreshold:5};Fn.initializePlugins(this,t,n);for(var s in n)!(s in e)&&(e[s]=n[s]);Bh(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:C_,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?B(t,"pointerdown",this._onTapStart):(B(t,"mousedown",this._onTapStart),B(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(B(t,"dragover",this),B(t,"dragenter",this)),yi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),qe(this,E_())}R.prototype={constructor:R,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(jt=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,D):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,s=this.el,i=this.options,r=i.preventOnFilter,o=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(a||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,h=i.filter;if(F_(s),!D&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||i.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&On&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=we(l,i.draggable,s,!1),!(l&&l.animated)&&fi!==l)){if(Gt=ve(l),In=ve(l,i.draggable),typeof h=="function"){if(h.call(this,e,l,this)){oe({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:s,fromEl:s}),le("filter",n,{evt:e}),r&&e.preventDefault();return}}else if(h&&(h=h.split(",").some(function(u){if(u=we(c,u.trim(),s,!1),u)return oe({sortable:n,rootEl:u,name:"filter",targetEl:l,fromEl:s,toEl:s}),le("filter",n,{evt:e}),!0}),h)){r&&e.preventDefault();return}i.handle&&!we(c,i.handle,s,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,n,s){var i=this,r=i.el,o=i.options,a=r.ownerDocument,l;if(s&&!D&&s.parentNode===r){var c=X(s);if(W=r,D=s,j=D.parentNode,St=D.nextSibling,fi=s,hi=o.group,R.dragged=D,Et={target:D,clientX:(n||e).clientX,clientY:(n||e).clientY},Dh=Et.clientX-c.left,Mh=Et.clientY-c.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,D.style["will-change"]="all",l=function(){if(le("delayEnded",i,{evt:e}),R.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Sh&&i.nativeDraggable&&(D.draggable=!0),i._triggerDragStart(e,n),oe({sortable:i,name:"choose",originalEvent:e}),fe(D,o.chosenClass,!0)},o.ignore.split(",").forEach(function(h){kh(D,h.trim(),ia)}),B(a,"dragover",wt),B(a,"mousemove",wt),B(a,"touchmove",wt),o.supportPointer?(B(a,"pointerup",i._onDrop),!this.nativeDraggable&&B(a,"pointercancel",i._onDrop)):(B(a,"mouseup",i._onDrop),B(a,"touchend",i._onDrop),B(a,"touchcancel",i._onDrop)),Sh&&this.nativeDraggable&&(this.options.touchStartThreshold=4,D.draggable=!0),le("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pn||We))){if(R.eventCanceled){this._onDrop();return}o.supportPointer?(B(a,"pointerup",i._disableDelayedDrag),B(a,"pointercancel",i._disableDelayedDrag)):(B(a,"mouseup",i._disableDelayedDrag),B(a,"touchend",i._disableDelayedDrag),B(a,"touchcancel",i._disableDelayedDrag)),B(a,"mousemove",i._delayedDragTouchMoveHandler),B(a,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&B(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(l,o.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){D&&ia(D),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;H(e,"mouseup",this._disableDelayedDrag),H(e,"touchend",this._disableDelayedDrag),H(e,"touchcancel",this._disableDelayedDrag),H(e,"pointerup",this._disableDelayedDrag),H(e,"pointercancel",this._disableDelayedDrag),H(e,"mousemove",this._delayedDragTouchMoveHandler),H(e,"touchmove",this._delayedDragTouchMoveHandler),H(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?B(document,"pointermove",this._onTouchMove):n?B(document,"touchmove",this._onTouchMove):B(document,"mousemove",this._onTouchMove):(B(D,"dragend",this),B(W,"dragstart",this._onDragStart));try{document.selection?gi(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(zt=!1,W&&D){le("dragStarted",this,{evt:n}),this.nativeDraggable&&B(document,"dragover",x_);var s=this.options;!e&&fe(D,s.dragClass,!1),fe(D,s.ghostClass,!0),R.active=this,e&&this._appendGhost(),oe({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Ee){this._lastX=Ee.clientX,this._lastY=Ee.clientY,qh();for(var e=document.elementFromPoint(Ee.clientX,Ee.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Ee.clientX,Ee.clientY),e!==n);)n=e;if(D.parentNode[ce]._isOutsideThisEl(e),n)do{if(n[ce]){var s=void 0;if(s=n[ce]._onDragOver({clientX:Ee.clientX,clientY:Ee.clientY,target:e,rootEl:n}),s&&!this.options.dragoverBubble)break}e=n}while(n=Ih(n));Wh()}},_onTouchMove:function(e){if(Et){var n=this.options,s=n.fallbackTolerance,i=n.fallbackOffset,r=e.touches?e.touches[0]:e,o=F&&Xt(F,!0),a=F&&o&&o.a,l=F&&o&&o.d,c=di&&re&&Ch(re),h=(r.clientX-Et.clientX+i.x)/(a||1)+(c?c[0]-sa[0]:0)/(a||1),u=(r.clientY-Et.clientY+i.y)/(l||1)+(c?c[1]-sa[1]:0)/(l||1);if(!R.active&&!zt){if(s&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<s)return;this._onDragStart(e,!0)}if(F){o?(o.e+=h-(ta||0),o.f+=u-(na||0)):o={a:1,b:0,c:0,d:1,e:h,f:u};var m="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");k(F,"webkitTransform",m),k(F,"mozTransform",m),k(F,"msTransform",m),k(F,"transform",m),ta=h,na=u,Ee=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!F){var e=this.options.fallbackOnBody?document.body:W,n=X(D,!0,di,!0,e),s=this.options;if(di){for(re=e;k(re,"position")==="static"&&k(re,"transform")==="none"&&re!==document;)re=re.parentNode;re!==document.body&&re!==document.documentElement?(re===document&&(re=Oe()),n.top+=re.scrollTop,n.left+=re.scrollLeft):re=Oe(),sa=Ch(re)}F=D.cloneNode(!0),fe(F,s.ghostClass,!1),fe(F,s.fallbackClass,!0),fe(F,s.dragClass,!0),k(F,"transition",""),k(F,"transform",""),k(F,"box-sizing","border-box"),k(F,"margin",0),k(F,"top",n.top),k(F,"left",n.left),k(F,"width",n.width),k(F,"height",n.height),k(F,"opacity","0.8"),k(F,"position",di?"absolute":"fixed"),k(F,"zIndex","100000"),k(F,"pointerEvents","none"),R.ghost=F,e.appendChild(F),k(F,"transform-origin",Dh/parseInt(F.style.width)*100+"% "+Mh/parseInt(F.style.height)*100+"%")}},_onDragStart:function(e,n){var s=this,i=e.dataTransfer,r=s.options;if(le("dragStart",this,{evt:e}),R.eventCanceled){this._onDrop();return}le("setupClone",this),R.eventCanceled||(U=Fh(D),U.removeAttribute("id"),U.draggable=!1,U.style["will-change"]="",this._hideClone(),fe(U,this.options.chosenClass,!1),R.clone=U),s.cloneId=gi(function(){le("clone",s),!R.eventCanceled&&(s.options.removeCloneOnHide||W.insertBefore(U,D),s._hideClone(),oe({sortable:s,name:"clone"}))}),!n&&fe(D,r.dragClass,!0),n?(_i=!0,s._loopId=setInterval(s._emulateDragOver,50)):(H(document,"mouseup",s._onDrop),H(document,"touchend",s._onDrop),H(document,"touchcancel",s._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(s,i,D)),B(document,"drop",s),k(D,"transform","translateZ(0)")),zt=!0,s._dragStartId=gi(s._dragStarted.bind(s,n,e)),B(document,"selectstart",s),Mn=!0,window.getSelection().removeAllRanges(),On&&k(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,s=e.target,i,r,o,a=this.options,l=a.group,c=R.active,h=hi===l,u=a.sort,m=se||c,f,g=this,_=!1;if(ca)return;function S(ae,Se){le(ae,g,Ne({evt:e,isOwner:h,axis:f?"vertical":"horizontal",revert:o,dragRect:i,targetRect:r,canSort:u,fromSortable:m,target:s,completed:p,onMove:function(va,jh){return mi(W,n,D,i,va,X(va),e,jh)},changed:w},Se))}function C(){S("dragOverAnimationCapture"),g.captureAnimationState(),g!==m&&m.captureAnimationState()}function p(ae){return S("dragOverCompleted",{insertion:ae}),ae&&(h?c._hideClone():c._showClone(g),g!==m&&(fe(D,se?se.options.ghostClass:c.options.ghostClass,!1),fe(D,a.ghostClass,!0)),se!==g&&g!==R.active?se=g:g===R.active&&se&&(se=null),m===g&&(g._ignoreWhileAnimating=s),g.animateAll(function(){S("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(s===D&&!D.animated||s===n&&!s.animated)&&(jt=null),!a.dragoverBubble&&!e.rootEl&&s!==document&&(D.parentNode[ce]._isOutsideThisEl(e.target),!ae&&wt(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),_=!0}function w(){pe=ve(D),rt=ve(D,a.draggable),oe({sortable:g,name:"change",toEl:n,newIndex:pe,newDraggableIndex:rt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),s=we(s,a.draggable,n,!0),S("dragOver"),R.eventCanceled)return _;if(D.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||g._ignoreWhileAnimating===s)return p(!1);if(_i=!1,c&&!a.disabled&&(h?u||(o=j!==W):se===this||(this.lastPutMode=hi.checkPull(this,c,D,e))&&l.checkPut(this,c,D,e))){if(f=this._getDirection(e,s)==="vertical",i=X(D),S("dragOverValid"),R.eventCanceled)return _;if(o)return j=W,C(),this._hideClone(),S("revert"),R.eventCanceled||(St?W.insertBefore(D,St):W.appendChild(D)),p(!0);var b=fa(n,a.draggable);if(!b||I_(e,f,this)&&!b.animated){if(b===D)return p(!1);if(b&&n===e.target&&(s=b),s&&(r=X(s)),mi(W,n,D,i,s,r,e,!!s)!==!1)return C(),b&&b.nextSibling?n.insertBefore(D,b.nextSibling):n.appendChild(D),j=n,w(),p(!0)}else if(b&&N_(e,f,this)){var v=Zt(n,0,a,!0);if(v===D)return p(!1);if(s=v,r=X(s),mi(W,n,D,i,s,r,e,!1)!==!1)return C(),n.insertBefore(D,v),j=n,w(),p(!0)}else if(s.parentNode===n){r=X(s);var E=0,T,O=D.parentNode!==n,x=!D_(D.animated&&D.toRect||i,s.animated&&s.toRect||r,f),N=f?"top":"left",$=Ah(s,"top","top")||Ah(D,"top","top"),Y=$?$.scrollTop:void 0;jt!==s&&(T=r[N],Rn=!1,ui=!x&&a.invertSwap||O),E=k_(e,s,r,f,x?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,ui,jt===s);var Q;if(E!==0){var V=ve(D);do V-=E,Q=j.children[V];while(Q&&(k(Q,"display")==="none"||Q===F))}if(E===0||Q===s)return p(!1);jt=s,kn=E;var he=s.nextElementSibling,J=!1;J=E===1;var ee=mi(W,n,D,i,s,r,e,J);if(ee!==!1)return(ee===1||ee===-1)&&(J=ee===1),ca=!0,setTimeout(O_,30),C(),J&&!he?n.appendChild(D):s.parentNode.insertBefore(D,J?he:s),$&&Ph($,0,Y-$.scrollTop),j=D.parentNode,T!==void 0&&!ui&&(pi=Math.abs(T-X(s)[N])),w(),p(!0)}if(n.contains(D))return p(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){H(document,"mousemove",this._onTouchMove),H(document,"touchmove",this._onTouchMove),H(document,"pointermove",this._onTouchMove),H(document,"dragover",wt),H(document,"mousemove",wt),H(document,"touchmove",wt)},_offUpEvents:function(){var e=this.el.ownerDocument;H(e,"mouseup",this._onDrop),H(e,"touchend",this._onDrop),H(e,"pointerup",this._onDrop),H(e,"pointercancel",this._onDrop),H(e,"touchcancel",this._onDrop),H(document,"selectstart",this)},_onDrop:function(e){var n=this.el,s=this.options;if(pe=ve(D),rt=ve(D,s.draggable),le("drop",this,{evt:e}),j=D&&D.parentNode,pe=ve(D),rt=ve(D,s.draggable),R.eventCanceled){this._nulling();return}zt=!1,ui=!1,Rn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ha(this.cloneId),ha(this._dragStartId),this.nativeDraggable&&(H(document,"drop",this),H(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),On&&k(document.body,"user-select",""),k(D,"transform",""),e&&(Mn&&(e.cancelable&&e.preventDefault(),!s.dropBubble&&e.stopPropagation()),F&&F.parentNode&&F.parentNode.removeChild(F),(W===j||se&&se.lastPutMode!=="clone")&&U&&U.parentNode&&U.parentNode.removeChild(U),D&&(this.nativeDraggable&&H(D,"dragend",this),ia(D),D.style["will-change"]="",Mn&&!zt&&fe(D,se?se.options.ghostClass:this.options.ghostClass,!1),fe(D,this.options.chosenClass,!1),oe({sortable:this,name:"unchoose",toEl:j,newIndex:null,newDraggableIndex:null,originalEvent:e}),W!==j?(pe>=0&&(oe({rootEl:j,name:"add",toEl:j,fromEl:W,originalEvent:e}),oe({sortable:this,name:"remove",toEl:j,originalEvent:e}),oe({rootEl:j,name:"sort",toEl:j,fromEl:W,originalEvent:e}),oe({sortable:this,name:"sort",toEl:j,originalEvent:e})),se&&se.save()):pe!==Gt&&pe>=0&&(oe({sortable:this,name:"update",toEl:j,originalEvent:e}),oe({sortable:this,name:"sort",toEl:j,originalEvent:e})),R.active&&((pe==null||pe===-1)&&(pe=Gt,rt=In),oe({sortable:this,name:"end",toEl:j,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){le("nulling",this),W=D=j=F=St=U=fi=ot=Et=Ee=Mn=pe=rt=Gt=In=jt=kn=se=hi=R.dragged=R.ghost=R.clone=R.active=null;var e=this.el;Ei.forEach(function(n){e.contains(n)&&(n.checked=!0)}),Ei.length=ta=na=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":D&&(this._onDragOver(e),L_(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,s=this.el.children,i=0,r=s.length,o=this.options;i<r;i++)n=s[i],we(n,o.draggable,this.el,!1)&&e.push(n.getAttribute(o.dataIdAttr)||P_(n));return e},sort:function(e,n){var s={},i=this.el;this.toArray().forEach(function(r,o){var a=i.children[o];we(a,this.options.draggable,i,!1)&&(s[r]=a)},this),n&&this.captureAnimationState(),e.forEach(function(r){s[r]&&(i.removeChild(s[r]),i.appendChild(s[r]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return we(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var s=this.options;if(n===void 0)return s[e];var i=Fn.modifyOption(this,e,n);typeof i<"u"?s[e]=i:s[e]=n,e==="group"&&Bh(s)},destroy:function(){le("destroy",this);var e=this.el;e[ce]=null,H(e,"mousedown",this._onTapStart),H(e,"touchstart",this._onTapStart),H(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(H(e,"dragover",this),H(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),yi.splice(yi.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ot){if(le("hideClone",this),R.eventCanceled)return;k(U,"display","none"),this.options.removeCloneOnHide&&U.parentNode&&U.parentNode.removeChild(U),ot=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ot){if(le("showClone",this),R.eventCanceled)return;D.parentNode==W&&!this.options.group.revertClone?W.insertBefore(U,D):St?W.insertBefore(U,St):W.appendChild(U),this.options.group.revertClone&&this.animate(D,U),k(U,"display",""),ot=!1}}};function L_(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function mi(t,e,n,s,i,r,o,a){var l,c=t[ce],h=c.options.onMove,u;return window.CustomEvent&&!We&&!Pn?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=t,l.dragged=n,l.draggedRect=s,l.related=i||e,l.relatedRect=r||X(e),l.willInsertAfter=a,l.originalEvent=o,t.dispatchEvent(l),h&&(u=h.call(c,l,o)),u}function ia(t){t.draggable=!1}function O_(){ca=!1}function N_(t,e,n){var s=X(Zt(n.el,0,n.options,!0)),i=$h(n.el,n.options,F),r=10;return e?t.clientX<i.left-r||t.clientY<s.top&&t.clientX<s.right:t.clientY<i.top-r||t.clientY<s.bottom&&t.clientX<s.left}function I_(t,e,n){var s=X(fa(n.el,n.options.draggable)),i=$h(n.el,n.options,F),r=10;return e?t.clientX>i.right+r||t.clientY>s.bottom&&t.clientX>s.left:t.clientY>i.bottom+r||t.clientX>s.right&&t.clientY>s.top}function k_(t,e,n,s,i,r,o,a){var l=s?t.clientY:t.clientX,c=s?n.height:n.width,h=s?n.top:n.left,u=s?n.bottom:n.right,m=!1;if(!o){if(a&&pi<c*i){if(!Rn&&(kn===1?l>h+c*r/2:l<u-c*r/2)&&(Rn=!0),Rn)m=!0;else if(kn===1?l<h+pi:l>u-pi)return-kn}else if(l>h+c*(1-i)/2&&l<u-c*(1-i)/2)return R_(e)}return m=m||o,m&&(l<h+c*r/2||l>u-c*r/2)?l>h+c/2?1:-1:0}function R_(t){return ve(D)<ve(t)?1:-1}function P_(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,s=0;n--;)s+=e.charCodeAt(n);return s.toString(36)}function F_(t){Ei.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var s=e[n];s.checked&&Ei.push(s)}}function gi(t){return setTimeout(t,0)}function ha(t){return clearTimeout(t)}Si&&B(document,"touchmove",function(t){(R.active||zt)&&t.cancelable&&t.preventDefault()});R.utils={on:B,off:H,css:k,find:kh,is:function(e,n){return!!we(e,n,e,!1)},extend:__,throttle:Rh,closest:we,toggleClass:fe,clone:Fh,index:ve,nextTick:gi,cancelNextTick:ha,detectDirection:Vh,getChild:Zt,expando:ce};R.get=function(t){return t[ce]};R.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(R.utils=Ne(Ne({},R.utils),s.utils)),Fn.mount(s)})};R.create=function(t,e){return new R(t,e)};R.version=b_;var G=[],xn,ua,da=!1,ra,oa,wi,Ln;function $_(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var s=n.originalEvent;this.sortable.nativeDraggable?B(document,"dragover",this._handleAutoScroll):this.options.supportPointer?B(document,"pointermove",this._handleFallbackAutoScroll):s.touches?B(document,"touchmove",this._handleFallbackAutoScroll):B(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var s=n.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?H(document,"dragover",this._handleAutoScroll):(H(document,"pointermove",this._handleFallbackAutoScroll),H(document,"touchmove",this._handleFallbackAutoScroll),H(document,"mousemove",this._handleFallbackAutoScroll)),Lh(),bi(),y_()},nulling:function(){wi=ua=xn=da=Ln=ra=oa=null,G.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,s){var i=this,r=(n.touches?n.touches[0]:n).clientX,o=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(r,o);if(wi=n,s||this.options.forceAutoScrollFallback||Pn||We||On){aa(n,this.options,a,s);var l=at(a,!0);da&&(!Ln||r!==ra||o!==oa)&&(Ln&&Lh(),Ln=setInterval(function(){var c=at(document.elementFromPoint(r,o),!0);c!==l&&(l=c,bi()),aa(n,i.options,c,s)},10),ra=r,oa=o)}else{if(!this.options.bubbleScroll||at(a,!0)===Oe()){bi();return}aa(n,this.options,at(a,!1),!1)}}},qe(t,{pluginName:"scroll",initializeByDefault:!0})}function bi(){G.forEach(function(t){clearInterval(t.pid)}),G=[]}function Lh(){clearInterval(Ln)}var aa=Rh(function(t,e,n,s){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,o=e.scrollSensitivity,a=e.scrollSpeed,l=Oe(),c=!1,h;ua!==n&&(ua=n,bi(),xn=e.scroll,h=e.scrollFn,xn===!0&&(xn=at(n,!0)));var u=0,m=xn;do{var f=m,g=X(f),_=g.top,S=g.bottom,C=g.left,p=g.right,w=g.width,b=g.height,v=void 0,E=void 0,T=f.scrollWidth,O=f.scrollHeight,x=k(f),N=f.scrollLeft,$=f.scrollTop;f===l?(v=w<T&&(x.overflowX==="auto"||x.overflowX==="scroll"||x.overflowX==="visible"),E=b<O&&(x.overflowY==="auto"||x.overflowY==="scroll"||x.overflowY==="visible")):(v=w<T&&(x.overflowX==="auto"||x.overflowX==="scroll"),E=b<O&&(x.overflowY==="auto"||x.overflowY==="scroll"));var Y=v&&(Math.abs(p-i)<=o&&N+w<T)-(Math.abs(C-i)<=o&&!!N),Q=E&&(Math.abs(S-r)<=o&&$+b<O)-(Math.abs(_-r)<=o&&!!$);if(!G[u])for(var V=0;V<=u;V++)G[V]||(G[V]={});(G[u].vx!=Y||G[u].vy!=Q||G[u].el!==f)&&(G[u].el=f,G[u].vx=Y,G[u].vy=Q,clearInterval(G[u].pid),(Y!=0||Q!=0)&&(c=!0,G[u].pid=setInterval(function(){s&&this.layer===0&&R.active._onTouchMove(wi);var he=G[this.layer].vy?G[this.layer].vy*a:0,J=G[this.layer].vx?G[this.layer].vx*a:0;typeof h=="function"&&h.call(R.dragged.parentNode[ce],J,he,t,wi,G[this.layer].el)!=="continue"||Ph(G[this.layer].el,J,he)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&m!==l&&(m=at(m,!1)));da=c}},30),Yh=function(e){var n=e.originalEvent,s=e.putSortable,i=e.dragEl,r=e.activeSortable,o=e.dispatchSortableEvent,a=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(n){var c=s||r;a();var h=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,u=document.elementFromPoint(h.clientX,h.clientY);l(),c&&!c.el.contains(u)&&(o("spill"),this.onSpill({dragEl:i,putSortable:s}))}};function pa(){}pa.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,s=e.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var i=Zt(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),s&&s.animateAll()},drop:Yh};qe(pa,{pluginName:"revertOnSpill"});function ga(){}ga.prototype={onSpill:function(e){var n=e.dragEl,s=e.putSortable,i=s||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop:Yh};qe(ga,{pluginName:"removeOnSpill"});R.mount(new $_);R.mount(ga,pa);var Kh=R;var Ti=class extends I{static values={offset:Number,message:String};connect(){this.sortable=Kh.create(this.element,{handle:".recourse-handle",animation:150,onStart:this.hold,onEnd:this.drop}),document.addEventListener("turbo:before-morph-element",this.freeze)}disconnect(){this.sortable.destroy(),document.removeEventListener("turbo:before-morph-element",this.freeze)}hold=()=>{this.dragging=!0};drop=({item:t,newIndex:e,oldIndex:n})=>{this.dragging=!1,e!==n&&this.send(t.dataset.sortableUpdateUrl,this.offsetValue+e+1)};freeze=t=>{this.dragging&&this.element.contains(t.target)&&t.preventDefault()};async send(t,e){let n=new FormData;n.append("position",e);try{if(!(await fetch(t,{method:"PATCH",body:n,headers:{Accept:"application/json","X-CSRF-Token":this.token}})).ok)return this.revert();Us(this.messageValue,"theme-success")}catch{this.revert()}}revert(){this.element.closest("turbo-frame")?.reload()}get token(){return document.querySelector('meta[name="csrf-token"]')?.content}};var Ai=class extends I{static targets=["messages","field"];connect(){this.following=!0,this.follow=()=>{this.following=this.#t()},this.settle=()=>requestAnimationFrame(()=>this.#e()),this.empty=()=>{this.hasFieldTarget&&(this.fieldTarget.value="")},this.hasMessagesTarget&&this.messagesTarget.addEventListener("scroll",this.follow),document.addEventListener("turbo:render",this.settle),this.element.addEventListener("turbo:submit-end",this.empty),this.settle()}disconnect(){this.hasMessagesTarget&&this.messagesTarget.removeEventListener("scroll",this.follow),document.removeEventListener("turbo:render",this.settle),this.element.removeEventListener("turbo:submit-end",this.empty)}#e(){this.hasFieldTarget&&this.fieldTarget.focus({preventScroll:!0}),this.hasMessagesTarget&&this.following&&(this.messagesTarget.scrollTop=this.messagesTarget.scrollHeight)}#t(){let{scrollTop:t,scrollHeight:e,clientHeight:n}=this.messagesTarget;return e-t-n<24}};var Ci=class extends I{static values={storage:String};connect(){let t=Intl.DateTimeFormat().resolvedOptions().timeZone;!t||t===this.#e()||(document.cookie=`${this.storageValue}=${encodeURIComponent(t)}; path=/; max-age=31536000; samesite=lax`,window.Turbo.visit(window.location.href,{action:"replace"}))}#e(){let t=document.cookie.split(/;\s*/).find(e=>e.startsWith(`${this.storageValue}=`));return t?decodeURIComponent(t.split("=")[1]):null}};function Uh(t){return t?(t.classList.remove("recourse-written-out"),t.classList.add("recourse-written"),()=>{t.classList.remove("recourse-written"),t.classList.add("recourse-written-out")}):()=>{}}var Di=class extends I{static values={delay:{type:Number,default:2e3}};connect(){this.toast=Do.getOrCreateInstance(this.element,{autohide:!1}),this.startTimer()}disconnect(){this.stopTimer(),this.toast.dispose()}stopTimer(){clearTimeout(this.timeout)}startTimer(){this.timeout=setTimeout(()=>this.toast.hide(),this.delayValue)}};var Mi=class extends I{connect(){matchMedia("(hover: none), (pointer: coarse)").matches||(this.tooltip=it.getOrCreateInstance(this.element))}disconnect(){this.tooltip?.dispose()}};var xi=class extends I{static values={row:String};connect(){let t=document.getElementById(this.rowValue);!t||!this.element.querySelector(".toast")||(this.fade=Uh(t),this.element.addEventListener("hide.bs.toast",this.fade))}disconnect(){this.fade&&this.element.removeEventListener("hide.bs.toast",this.fade)}};window.Stimulus||(window.Stimulus=Ys.start(),window.Stimulus.register("bookmark",js),window.Stimulus.register("clear",zs),window.Stimulus.register("combobox",Gs),window.Stimulus.register("density",Xs),window.Stimulus.register("deselect",Zs),window.Stimulus.register("limit",Qs),window.Stimulus.register("map",Js),window.Stimulus.register("otp",ei),window.Stimulus.register("phone",ti),window.Stimulus.register("placeholder",ni),window.Stimulus.register("relative-time",si),window.Stimulus.register("require",ii),window.Stimulus.register("reveal",ri),window.Stimulus.register("scheme",oi),window.Stimulus.register("search",li),window.Stimulus.register("shortcuts",ci),window.Stimulus.register("sortable",Ti),window.Stimulus.register("thread",Ai),window.Stimulus.register("timezone",Ci),window.Stimulus.register("toast",Di),window.Stimulus.register("tooltip",Mi),window.Stimulus.register("written",xi),window.Turbo.config.forms.confirm=Qo);
131
+ /*!
132
+ * Bootstrap v6.0.0-alpha1 (https://getbootstrap.com/)
133
+ * Copyright 2011-2026 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
134
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
135
+ */
136
+ /*! name: vanilla-calendar-pro v3.1.0 | url: https://github.com/uvarov-frontend/vanilla-calendar-pro */
137
+ /*! Bundled license information:
138
+
139
+ @hotwired/turbo/dist/turbo.es2017-esm.js:
140
+ (*!
141
+ Turbo 8.0.23
142
+ Copyright © 2026 37signals LLC
143
+ *)
144
+
145
+ sortablejs/modular/sortable.esm.js:
146
+ (**!
147
+ * Sortable 1.15.7
148
+ * @author RubaXa <trash@rubaxa.org>
149
+ * @author owenm <owen23355@gmail.com>
150
+ * @license MIT
151
+ *)
152
+ */