ariadne_view_components 0.0.96.14 → 0.0.97.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/app/assets/javascripts/ariadne_view_components.js +13 -13
- data/app/assets/javascripts/ariadne_view_components.js.br +0 -0
- data/app/assets/javascripts/ariadne_view_components.js.gz +0 -0
- data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
- data/app/assets/stylesheets/ariadne_view_components.css +1 -1
- data/app/assets/stylesheets/ariadne_view_components.css.br +0 -0
- data/app/assets/stylesheets/ariadne_view_components.css.gz +0 -0
- data/app/components/ariadne/form/text_field/component.rb +3 -3
- data/app/components/ariadne/layout/content/README.md +63 -0
- data/app/components/ariadne/ui/button/component.rb +1 -1
- data/app/components/ariadne/ui/card/component.rb +1 -1
- data/app/components/ariadne/ui/dialog/component.html.erb +34 -13
- data/app/components/ariadne/ui/dialog/component.rb +27 -20
- data/app/components/ariadne/ui/dialog/component.ts +68 -8
- data/app/components/ariadne/ui/dialog_trigger/component.ts +47 -0
- data/app/frontend/stylesheets/theme.css +1 -1
- data/lib/ariadne/view_components/version.rb +1 -1
- metadata +4 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
class No{constructor(t,e,{tabInsertsSuggestions:s,defaultFirstOption:i,scrollIntoViewOptions:r}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=s??!0,this.defaultFirstOption=i??!1,this.scrollIntoViewOptions=r??{block:"nearest",inline:"nearest"},this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=o=>$o(o,this),this.compositionEventHandler=o=>Ho(o,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",xs),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",xs)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Qe)[0])===null||t===void 0||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Qe)[0],s=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Qe),i=s.indexOf(e);if(i===s.length-1&&t===1||i===0&&t===-1){this.clearSelection(),this.input.focus();return}let r=t===1?0:s.length-1;if(e&&i>=0){const a=i+t;a>=0&&a<s.length&&(r=a)}const o=s[r];if(o)for(const a of s)a.removeAttribute("data-combobox-option-default"),o===a?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),Ko(o),o.scrollIntoView(this.scrollIntoViewOptions)):a.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function $o(n,t){if(!(n.shiftKey||n.metaKey||n.altKey)&&!(!t.ctrlBindings&&n.ctrlKey)&&!t.isComposing)switch(n.key){case"Enter":Ss(t.input,t.list)&&n.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&Ss(t.input,t.list)&&n.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),n.preventDefault();break;case"ArrowUp":t.navigate(-1),n.preventDefault();break;case"n":t.ctrlBindings&&n.ctrlKey&&(t.navigate(1),n.preventDefault());break;case"p":t.ctrlBindings&&n.ctrlKey&&(t.navigate(-1),n.preventDefault());break;default:if(n.ctrlKey)break;t.clearSelection()}}function xs(n){if(!(n.target instanceof Element))return;const t=n.target.closest('[role="option"]');t&&t.getAttribute("aria-disabled")!=="true"&&jo(t,{event:n})}function Ss(n,t){const e=t.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return e?(e.getAttribute("aria-disabled")==="true"||e.click(),!0):!1}function jo(n,t){n.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:t}))}function Ko(n){n.dispatchEvent(new Event("combobox-select",{bubbles:!0}))}function Qe(n){return!n.hidden&&!(n instanceof HTMLInputElement&&n.type==="hidden")&&(n.offsetWidth>0||n.offsetHeight>0)}function Ho(n,t){t.isComposing=n.type==="compositionstart",document.getElementById(t.input.getAttribute("aria-controls")||"")&&t.clearSelection()}function Uo(n,t=0){let e;return function(...s){clearTimeout(e),e=window.setTimeout(()=>{clearTimeout(e),n(...s)},t)}}const Wo=window.testScreenReaderDelay||100;class zo{constructor(t,e,s,i=!1){var r;if(this.container=t,this.input=e,this.results=s,this.combobox=new No(e,s,{defaultFirstOption:i}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=s.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const o=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(o==null?void 0:o.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=Uo(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),(r=this.clearButton)===null||r===void 0||r.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),this.input.getAttribute("aria-expanded")==="true"&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.close()}onKeydown(t){if(t.key==="Escape"&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&t.key==="ArrowUp"&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&t.key==="ArrowDown"&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement)||(this.close(),e instanceof HTMLAnchorElement))return;const s=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=s,s||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout(()=>{this.feedback&&(this.feedback.textContent=t)},Wo)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty){this.close();return}const e=this.container.src;if(!e)return;const s=new URL(e,window.location.href),i=new URLSearchParams(s.search.slice(1));i.append("q",t),s.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(s).then(r=>{this.results.innerHTML=r,this.identifyOptions(),this.combobox.indicateDefaultOption();const o=this.results.querySelectorAll('[role="option"]'),a=!!o.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,l=o.length,[c]=o,u=c==null?void 0:c.textContent;this.autoselectEnabled&&u?this.updateFeedbackForScreenReaders(`${l} results. ${u} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${l||"No"} results.`),a?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))}).catch(()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))})}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var tt=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Je=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},qo=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(e[s[i]]=n[s[i]]);return e},St,Yt,Xt,Gt,Me;const Yo=globalThis.HTMLElement||null;class Xo extends Event{constructor(t,e){var{relatedTarget:s}=e,i=qo(e,["relatedTarget"]);super(t,i),this.relatedTarget=s}}const rt=new WeakMap;let tn=null;class Go extends Yo{constructor(){super(...arguments),St.add(this),Yt.set(this,null),Xt.set(this,null),Me.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){tn=t===null?t:Promise.resolve(t)}get forElement(){var t;if(!((t=tt(this,Yt,"f"))===null||t===void 0)&&t.isConnected)return tt(this,Yt,"f");const e=this.getAttribute("for"),s=this.getRootNode();return e&&(s instanceof Document||s instanceof ShadowRoot)?s.getElementById(e):null}set forElement(t){Je(this,Yt,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return!((t=tt(this,Xt,"f"))===null||t===void 0)&&t.isConnected?tt(this,Xt,"f"):this.querySelector("input")}set inputElement(t){Je(this,Xt,t,"f"),tt(this,St,"m",Gt).call(this)}connectedCallback(){this.isConnected&&(tt(this,St,"m",Gt).call(this),new MutationObserver(()=>{rt.get(this)||tt(this,St,"m",Gt).call(this)}).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=rt.get(this);t&&(t.destroy(),rt.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;(e=tt(this,Me,"f"))===null||e===void 0||e.abort();const{signal:s}=Je(this,Me,new AbortController,"f"),i=await fetch(t.toString(),{signal:s,headers:{Accept:"text/fragment+html"}});if(!i.ok)throw new Error(await i.text());return tn?(await tn).createHTML(await i.text(),i):await i.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,s){var i,r;if(e===s)return;const o=rt.get(this);if(o)switch((this.forElement!==((i=rt.get(this))===null||i===void 0?void 0:i.results)||this.inputElement!==((r=rt.get(this))===null||r===void 0?void 0:r.input))&&tt(this,St,"m",Gt).call(this),t){case"open":s===null?o.close():o.open();break;case"value":s!==null&&(o.input.value=s),this.dispatchEvent(new Xo("auto-complete-change",{bubbles:!0,relatedTarget:o.input}));break}}}Yt=new WeakMap,Xt=new WeakMap,Me=new WeakMap,St=new WeakSet,Gt=function(){var t;(t=rt.get(this))===null||t===void 0||t.destroy();const{forElement:e,inputElement:s}=this;if(!e||!s)return;const i=this.getAttribute("data-autoselect")==="true";rt.set(this,new zo(this,s,e,i)),e.setAttribute("role","listbox")};const en=typeof globalThis<"u"?globalThis:window;try{en.AutocompleteElement=en.AutoCompleteElement=Go.define()}catch(n){if(!(en.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}class dn extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const s=[q(t,"compositionstart",i=>Ls(this,i)),q(t,"compositionend",i=>Ls(this,i)),q(t,"click",i=>Cs(t,i)),q(t,"change",i=>Cs(t,i)),q(t,"keydown",i=>na(t,this,i)),q(t,"toggle",()=>Ms(t,this),{once:!0}),q(t,"toggle",()=>Jo(t)),this.preload?q(t,"mouseover",()=>Ms(t,this),{once:!0}):Zo,...Qo(t)];Ct.set(this,{subscriptions:s,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Ct.get(this);if(t){Ct.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Ct=new WeakMap,Zo={unsubscribe(){}};function q(n,t,e,s=!1){return n.addEventListener(t,e,s),{unsubscribe:()=>{n.removeEventListener(t,e,s)}}}function Ms(n,t){const e=t.getAttribute("src");if(!e)return;const s=Ct.get(t);if(!s||s.loaded)return;s.loaded=!0;const i=t.querySelector("include-fragment");i&&!i.hasAttribute("src")&&(i.addEventListener("loadend",()=>qi(n)),i.setAttribute("src",e))}function Qo(n){let t=!1;const e=()=>t=!0,s=()=>t=!1,i=()=>{n.hasAttribute("open")&&(qi(n)||t||ta(n))};return[q(n,"mousedown",e),q(n,"keydown",s),q(n,"toggle",i)]}function Jo(n){if(n.hasAttribute("open"))for(const t of document.querySelectorAll("details[open] > details-menu")){const e=t.closest("details");e&&e!==n&&!e.contains(n)&&e.removeAttribute("open")}}function qi(n){if(!n.hasAttribute("open"))return!1;const t=n.querySelector("details-menu [autofocus]");return t?(t.focus(),!0):!1}function ta(n){const t=document.activeElement;if(t&&Yi(t)&&n.contains(t))return;const e=Zt(n,!0);e&&e.focus()}function Zt(n,t){const e=Array.from(n.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),s=document.activeElement,i=s instanceof HTMLElement?e.indexOf(s):-1,r=t?e[i+1]:e[i-1],o=t?e[0]:e[e.length-1];return r||o}const Os=navigator.userAgent.match(/Macintosh/);function Cs(n,t){const e=t.target;if(e instanceof Element&&e.closest("details")===n){if(t.type==="click"){const s=e.closest('[role="menuitem"], [role="menuitemradio"]');if(!s)return;const i=s.querySelector("input");if(s.tagName==="LABEL"&&e===i)return;s.tagName==="LABEL"&&i&&!i.checked||ks(s,n)}else if(t.type==="change"){const s=e.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');s&&ks(s,n)}}}function ea(n,t){for(const e of t.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const s=e.querySelector('input[type="radio"], input[type="checkbox"]');let i=(e===n).toString();s instanceof HTMLInputElement&&(i=s.indeterminate?"mixed":s.checked.toString()),e.setAttribute("aria-checked",i)}}function ks(n,t){if(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")return;const e=n.closest("details-menu");!e||!e.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:n}}))||(sa(n,t),ea(n,t),n.getAttribute("role")!=="menuitemcheckbox"&&Xi(t),e.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:n}})))}function na(n,t,e){if(!(e instanceof KeyboardEvent)||n.querySelector("details[open]"))return;const s=Ct.get(t);if(!s||s.isComposing)return;const i=e.target instanceof Element&&e.target.tagName==="SUMMARY";switch(e.key){case"Escape":n.hasAttribute("open")&&(Xi(n),e.preventDefault(),e.stopPropagation());break;case"ArrowDown":{i&&!n.hasAttribute("open")&&n.setAttribute("open","");const r=Zt(n,!0);r&&r.focus(),e.preventDefault()}break;case"ArrowUp":{i&&!n.hasAttribute("open")&&n.setAttribute("open","");const r=Zt(n,!1);r&&r.focus(),e.preventDefault()}break;case"n":if(Os&&e.ctrlKey){const r=Zt(n,!0);r&&r.focus(),e.preventDefault()}break;case"p":if(Os&&e.ctrlKey){const r=Zt(n,!1);r&&r.focus(),e.preventDefault()}break;case" ":case"Enter":{const r=document.activeElement;r instanceof HTMLElement&&Yi(r)&&r.closest("details")===n&&(e.preventDefault(),e.stopPropagation(),r.click())}break}}function Yi(n){const t=n.getAttribute("role");return t==="menuitem"||t==="menuitemcheckbox"||t==="menuitemradio"}function Xi(n){if(!n.hasAttribute("open"))return;n.removeAttribute("open");const e=n.querySelector("summary");e&&e.focus()}function sa(n,t){const e=t.querySelector("[data-menu-button]");if(!e)return;const s=ia(n);if(s)e.textContent=s;else{const i=ra(n);i&&(e.innerHTML=i)}}function ia(n){if(!n)return null;const t=n.hasAttribute("data-menu-button-text")?n:n.querySelector("[data-menu-button-text]");return t?t.getAttribute("data-menu-button-text")||t.textContent:null}function ra(n){if(!n)return null;const t=n.hasAttribute("data-menu-button-contents")?n:n.querySelector("[data-menu-button-contents]");return t?t.innerHTML:null}function Ls(n,t){const e=Ct.get(n);e&&(e.isComposing=t.type==="compositionstart")}window.customElements.get("details-menu")||(window.DetailsMenuElement=dn,window.customElements.define("details-menu",dn));const kt=new WeakMap,ft=new WeakMap,et=new WeakMap;function re(n){const t=n.currentTarget;if(!(t instanceof Vt))return;const{box:e,image:s}=et.get(t)||{};if(!e||!s)return;let i=0,r=0;if(n instanceof KeyboardEvent)n.key==="ArrowUp"?r=-1:n.key==="ArrowDown"?r=1:n.key==="ArrowLeft"?i=-1:n.key==="ArrowRight"&&(i=1);else if(ft.has(t)&&n instanceof MouseEvent){const o=ft.get(t);i=n.pageX-o.dragStartX,r=n.pageY-o.dragStartY}else if(ft.has(t)&&n instanceof TouchEvent){const{pageX:o,pageY:a}=n.changedTouches[0],{dragStartX:l,dragStartY:c}=ft.get(t);i=o-l,r=a-c}if(i!==0||r!==0){const o=Math.min(Math.max(0,e.offsetLeft+i),s.width-e.offsetWidth),a=Math.min(Math.max(0,e.offsetTop+r),s.height-e.offsetHeight);e.style.left=`${o}px`,e.style.top=`${a}px`,Ji(t,{x:o,y:a,width:e.offsetWidth,height:e.offsetHeight})}if(n instanceof MouseEvent)ft.set(t,{dragStartX:n.pageX,dragStartY:n.pageY});else if(n instanceof TouchEvent){const{pageX:o,pageY:a}=n.changedTouches[0];ft.set(t,{dragStartX:o,dragStartY:a})}}function Lt(n){const t=n.target;if(!(t instanceof HTMLElement))return;const e=Gi(t);if(!(e instanceof Vt))return;const{box:s}=et.get(e)||{};if(!s)return;const i=e.getBoundingClientRect();let r,o,a;if(n instanceof KeyboardEvent){if(n.key==="Escape")return Qi(e);if(n.key==="-"&&(a=-10),n.key==="="&&(a=10),!a)return;r=s.offsetWidth+a,o=s.offsetHeight+a,kt.set(e,{startX:s.offsetLeft,startY:s.offsetTop})}else if(n instanceof MouseEvent){const l=kt.get(e);if(!l)return;r=n.pageX-l.startX-i.left-window.pageXOffset,o=n.pageY-l.startY-i.top-window.pageYOffset}else if(n instanceof TouchEvent){const l=kt.get(e);if(!l)return;r=n.changedTouches[0].pageX-l.startX-i.left-window.pageXOffset,o=n.changedTouches[0].pageY-l.startY-i.top-window.pageYOffset}r&&o&&Zi(e,r,o,!(n instanceof KeyboardEvent))}function Gi(n){const t=n.getRootNode();return t instanceof ShadowRoot?t.host:n}function Fs(n){const t=n.currentTarget;if(!(t instanceof HTMLElement))return;const e=Gi(t);if(!(e instanceof Vt))return;const{box:s}=et.get(e)||{};if(!s)return;const i=n.target;if(i instanceof HTMLElement)if(i.hasAttribute("data-direction")){const r=i.getAttribute("data-direction")||"";e.addEventListener("mousemove",Lt),e.addEventListener("touchmove",Lt,{passive:!0}),["nw","se"].indexOf(r)>=0&&e.classList.add("nwse"),["ne","sw"].indexOf(r)>=0&&e.classList.add("nesw"),kt.set(e,{startX:s.offsetLeft+(["se","ne"].indexOf(r)>=0?0:s.offsetWidth),startY:s.offsetTop+(["se","sw"].indexOf(r)>=0?0:s.offsetHeight)}),Lt(n)}else e.addEventListener("mousemove",re),e.addEventListener("touchmove",re,{passive:!0})}function Zi(n,t,e,s=!0){let i=Math.max(Math.abs(t),Math.abs(e),10);const r=kt.get(n);if(!r)return;const{box:o,image:a}=et.get(n)||{};if(!o||!a)return;i=Math.min(i,e>0?a.height-r.startY:r.startY,t>0?a.width-r.startX:r.startX);const l=s?Math.round(Math.max(0,t>0?r.startX:r.startX-i)):o.offsetLeft,c=s?Math.round(Math.max(0,e>0?r.startY:r.startY-i)):o.offsetTop;o.style.left=`${l}px`,o.style.top=`${c}px`,o.style.width=`${i}px`,o.style.height=`${i}px`,Ji(n,{x:l,y:c,width:i,height:i})}function Qi(n){const{image:t}=et.get(n)||{};if(!t)return;const e=Math.round(t.clientWidth>t.clientHeight?t.clientHeight:t.clientWidth);kt.set(n,{startX:(t.clientWidth-e)/2,startY:(t.clientHeight-e)/2}),Zi(n,e,e)}function nn(n){const t=n.currentTarget;t instanceof Vt&&(ft.delete(t),t.classList.remove("nwse","nesw"),t.removeEventListener("mousemove",Lt),t.removeEventListener("mousemove",re),t.removeEventListener("touchmove",Lt),t.removeEventListener("touchmove",re))}function Ji(n,t){const{image:e}=et.get(n)||{};if(!e)return;const s=e.naturalWidth/e.width;for(const i in t){const r=Math.round(t[i]*s);t[i]=r;const o=n.querySelector(`[data-image-crop-input='${i}']`);o instanceof HTMLInputElement&&(o.value=r.toString())}n.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:t}))}class Vt extends HTMLElement{connectedCallback(){if(et.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
1
|
+
class Ho{constructor(t,e,{tabInsertsSuggestions:s,defaultFirstOption:i,scrollIntoViewOptions:r}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=s??!0,this.defaultFirstOption=i??!1,this.scrollIntoViewOptions=r??{block:"nearest",inline:"nearest"},this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=o=>Uo(o,this),this.compositionEventHandler=o=>qo(o,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Cs),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Cs)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Qe)[0])===null||t===void 0||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Qe)[0],s=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Qe),i=s.indexOf(e);if(i===s.length-1&&t===1||i===0&&t===-1){this.clearSelection(),this.input.focus();return}let r=t===1?0:s.length-1;if(e&&i>=0){const a=i+t;a>=0&&a<s.length&&(r=a)}const o=s[r];if(o)for(const a of s)a.removeAttribute("data-combobox-option-default"),o===a?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),zo(o),o.scrollIntoView(this.scrollIntoViewOptions)):a.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function Uo(n,t){if(!(n.shiftKey||n.metaKey||n.altKey)&&!(!t.ctrlBindings&&n.ctrlKey)&&!t.isComposing)switch(n.key){case"Enter":ks(t.input,t.list)&&n.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&ks(t.input,t.list)&&n.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),n.preventDefault();break;case"ArrowUp":t.navigate(-1),n.preventDefault();break;case"n":t.ctrlBindings&&n.ctrlKey&&(t.navigate(1),n.preventDefault());break;case"p":t.ctrlBindings&&n.ctrlKey&&(t.navigate(-1),n.preventDefault());break;default:if(n.ctrlKey)break;t.clearSelection()}}function Cs(n){if(!(n.target instanceof Element))return;const t=n.target.closest('[role="option"]');t&&t.getAttribute("aria-disabled")!=="true"&&Wo(t,{event:n})}function ks(n,t){const e=t.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return e?(e.getAttribute("aria-disabled")==="true"||e.click(),!0):!1}function Wo(n,t){n.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:t}))}function zo(n){n.dispatchEvent(new Event("combobox-select",{bubbles:!0}))}function Qe(n){return!n.hidden&&!(n instanceof HTMLInputElement&&n.type==="hidden")&&(n.offsetWidth>0||n.offsetHeight>0)}function qo(n,t){t.isComposing=n.type==="compositionstart",document.getElementById(t.input.getAttribute("aria-controls")||"")&&t.clearSelection()}function Yo(n,t=0){let e;return function(...s){clearTimeout(e),e=window.setTimeout(()=>{clearTimeout(e),n(...s)},t)}}const Xo=window.testScreenReaderDelay||100;class Go{constructor(t,e,s,i=!1){var r;if(this.container=t,this.input=e,this.results=s,this.combobox=new Ho(e,s,{defaultFirstOption:i}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=s.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const o=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(o==null?void 0:o.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=Yo(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),(r=this.clearButton)===null||r===void 0||r.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),this.input.getAttribute("aria-expanded")==="true"&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.close()}onKeydown(t){if(t.key==="Escape"&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&t.key==="ArrowUp"&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&t.key==="ArrowDown"&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement)||(this.close(),e instanceof HTMLAnchorElement))return;const s=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=s,s||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout(()=>{this.feedback&&(this.feedback.textContent=t)},Xo)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty){this.close();return}const e=this.container.src;if(!e)return;const s=new URL(e,window.location.href),i=new URLSearchParams(s.search.slice(1));i.append("q",t),s.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(s).then(r=>{this.results.innerHTML=r,this.identifyOptions(),this.combobox.indicateDefaultOption();const o=this.results.querySelectorAll('[role="option"]'),a=!!o.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,l=o.length,[c]=o,u=c==null?void 0:c.textContent;this.autoselectEnabled&&u?this.updateFeedbackForScreenReaders(`${l} results. ${u} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${l||"No"} results.`),a?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))}).catch(()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))})}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var tt=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Je=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},Zo=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(e[s[i]]=n[s[i]]);return e},St,Yt,Xt,Gt,Me;const Qo=globalThis.HTMLElement||null;class Jo extends Event{constructor(t,e){var{relatedTarget:s}=e,i=Zo(e,["relatedTarget"]);super(t,i),this.relatedTarget=s}}const ot=new WeakMap;let tn=null;class ta extends Qo{constructor(){super(...arguments),St.add(this),Yt.set(this,null),Xt.set(this,null),Me.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){tn=t===null?t:Promise.resolve(t)}get forElement(){var t;if(!((t=tt(this,Yt,"f"))===null||t===void 0)&&t.isConnected)return tt(this,Yt,"f");const e=this.getAttribute("for"),s=this.getRootNode();return e&&(s instanceof Document||s instanceof ShadowRoot)?s.getElementById(e):null}set forElement(t){Je(this,Yt,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return!((t=tt(this,Xt,"f"))===null||t===void 0)&&t.isConnected?tt(this,Xt,"f"):this.querySelector("input")}set inputElement(t){Je(this,Xt,t,"f"),tt(this,St,"m",Gt).call(this)}connectedCallback(){this.isConnected&&(tt(this,St,"m",Gt).call(this),new MutationObserver(()=>{ot.get(this)||tt(this,St,"m",Gt).call(this)}).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=ot.get(this);t&&(t.destroy(),ot.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;(e=tt(this,Me,"f"))===null||e===void 0||e.abort();const{signal:s}=Je(this,Me,new AbortController,"f"),i=await fetch(t.toString(),{signal:s,headers:{Accept:"text/fragment+html"}});if(!i.ok)throw new Error(await i.text());return tn?(await tn).createHTML(await i.text(),i):await i.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,s){var i,r;if(e===s)return;const o=ot.get(this);if(o)switch((this.forElement!==((i=ot.get(this))===null||i===void 0?void 0:i.results)||this.inputElement!==((r=ot.get(this))===null||r===void 0?void 0:r.input))&&tt(this,St,"m",Gt).call(this),t){case"open":s===null?o.close():o.open();break;case"value":s!==null&&(o.input.value=s),this.dispatchEvent(new Jo("auto-complete-change",{bubbles:!0,relatedTarget:o.input}));break}}}Yt=new WeakMap,Xt=new WeakMap,Me=new WeakMap,St=new WeakSet,Gt=function(){var t;(t=ot.get(this))===null||t===void 0||t.destroy();const{forElement:e,inputElement:s}=this;if(!e||!s)return;const i=this.getAttribute("data-autoselect")==="true";ot.set(this,new Go(this,s,e,i)),e.setAttribute("role","listbox")};const en=typeof globalThis<"u"?globalThis:window;try{en.AutocompleteElement=en.AutoCompleteElement=ta.define()}catch(n){if(!(en.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}class dn extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const s=[q(t,"compositionstart",i=>_s(this,i)),q(t,"compositionend",i=>_s(this,i)),q(t,"click",i=>Fs(t,i)),q(t,"change",i=>Fs(t,i)),q(t,"keydown",i=>oa(t,this,i)),q(t,"toggle",()=>Ds(t,this),{once:!0}),q(t,"toggle",()=>sa(t)),this.preload?q(t,"mouseover",()=>Ds(t,this),{once:!0}):ea,...na(t)];Ct.set(this,{subscriptions:s,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Ct.get(this);if(t){Ct.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Ct=new WeakMap,ea={unsubscribe(){}};function q(n,t,e,s=!1){return n.addEventListener(t,e,s),{unsubscribe:()=>{n.removeEventListener(t,e,s)}}}function Ds(n,t){const e=t.getAttribute("src");if(!e)return;const s=Ct.get(t);if(!s||s.loaded)return;s.loaded=!0;const i=t.querySelector("include-fragment");i&&!i.hasAttribute("src")&&(i.addEventListener("loadend",()=>Zi(n)),i.setAttribute("src",e))}function na(n){let t=!1;const e=()=>t=!0,s=()=>t=!1,i=()=>{n.hasAttribute("open")&&(Zi(n)||t||ia(n))};return[q(n,"mousedown",e),q(n,"keydown",s),q(n,"toggle",i)]}function sa(n){if(n.hasAttribute("open"))for(const t of document.querySelectorAll("details[open] > details-menu")){const e=t.closest("details");e&&e!==n&&!e.contains(n)&&e.removeAttribute("open")}}function Zi(n){if(!n.hasAttribute("open"))return!1;const t=n.querySelector("details-menu [autofocus]");return t?(t.focus(),!0):!1}function ia(n){const t=document.activeElement;if(t&&Qi(t)&&n.contains(t))return;const e=Zt(n,!0);e&&e.focus()}function Zt(n,t){const e=Array.from(n.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),s=document.activeElement,i=s instanceof HTMLElement?e.indexOf(s):-1,r=t?e[i+1]:e[i-1],o=t?e[0]:e[e.length-1];return r||o}const Ls=navigator.userAgent.match(/Macintosh/);function Fs(n,t){const e=t.target;if(e instanceof Element&&e.closest("details")===n){if(t.type==="click"){const s=e.closest('[role="menuitem"], [role="menuitemradio"]');if(!s)return;const i=s.querySelector("input");if(s.tagName==="LABEL"&&e===i)return;s.tagName==="LABEL"&&i&&!i.checked||Vs(s,n)}else if(t.type==="change"){const s=e.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');s&&Vs(s,n)}}}function ra(n,t){for(const e of t.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const s=e.querySelector('input[type="radio"], input[type="checkbox"]');let i=(e===n).toString();s instanceof HTMLInputElement&&(i=s.indeterminate?"mixed":s.checked.toString()),e.setAttribute("aria-checked",i)}}function Vs(n,t){if(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")return;const e=n.closest("details-menu");!e||!e.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:n}}))||(aa(n,t),ra(n,t),n.getAttribute("role")!=="menuitemcheckbox"&&Ji(t),e.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:n}})))}function oa(n,t,e){if(!(e instanceof KeyboardEvent)||n.querySelector("details[open]"))return;const s=Ct.get(t);if(!s||s.isComposing)return;const i=e.target instanceof Element&&e.target.tagName==="SUMMARY";switch(e.key){case"Escape":n.hasAttribute("open")&&(Ji(n),e.preventDefault(),e.stopPropagation());break;case"ArrowDown":{i&&!n.hasAttribute("open")&&n.setAttribute("open","");const r=Zt(n,!0);r&&r.focus(),e.preventDefault()}break;case"ArrowUp":{i&&!n.hasAttribute("open")&&n.setAttribute("open","");const r=Zt(n,!1);r&&r.focus(),e.preventDefault()}break;case"n":if(Ls&&e.ctrlKey){const r=Zt(n,!0);r&&r.focus(),e.preventDefault()}break;case"p":if(Ls&&e.ctrlKey){const r=Zt(n,!1);r&&r.focus(),e.preventDefault()}break;case" ":case"Enter":{const r=document.activeElement;r instanceof HTMLElement&&Qi(r)&&r.closest("details")===n&&(e.preventDefault(),e.stopPropagation(),r.click())}break}}function Qi(n){const t=n.getAttribute("role");return t==="menuitem"||t==="menuitemcheckbox"||t==="menuitemradio"}function Ji(n){if(!n.hasAttribute("open"))return;n.removeAttribute("open");const e=n.querySelector("summary");e&&e.focus()}function aa(n,t){const e=t.querySelector("[data-menu-button]");if(!e)return;const s=la(n);if(s)e.textContent=s;else{const i=ca(n);i&&(e.innerHTML=i)}}function la(n){if(!n)return null;const t=n.hasAttribute("data-menu-button-text")?n:n.querySelector("[data-menu-button-text]");return t?t.getAttribute("data-menu-button-text")||t.textContent:null}function ca(n){if(!n)return null;const t=n.hasAttribute("data-menu-button-contents")?n:n.querySelector("[data-menu-button-contents]");return t?t.innerHTML:null}function _s(n,t){const e=Ct.get(n);e&&(e.isComposing=t.type==="compositionstart")}window.customElements.get("details-menu")||(window.DetailsMenuElement=dn,window.customElements.define("details-menu",dn));const kt=new WeakMap,ft=new WeakMap,et=new WeakMap;function re(n){const t=n.currentTarget;if(!(t instanceof Vt))return;const{box:e,image:s}=et.get(t)||{};if(!e||!s)return;let i=0,r=0;if(n instanceof KeyboardEvent)n.key==="ArrowUp"?r=-1:n.key==="ArrowDown"?r=1:n.key==="ArrowLeft"?i=-1:n.key==="ArrowRight"&&(i=1);else if(ft.has(t)&&n instanceof MouseEvent){const o=ft.get(t);i=n.pageX-o.dragStartX,r=n.pageY-o.dragStartY}else if(ft.has(t)&&n instanceof TouchEvent){const{pageX:o,pageY:a}=n.changedTouches[0],{dragStartX:l,dragStartY:c}=ft.get(t);i=o-l,r=a-c}if(i!==0||r!==0){const o=Math.min(Math.max(0,e.offsetLeft+i),s.width-e.offsetWidth),a=Math.min(Math.max(0,e.offsetTop+r),s.height-e.offsetHeight);e.style.left=`${o}px`,e.style.top=`${a}px`,sr(t,{x:o,y:a,width:e.offsetWidth,height:e.offsetHeight})}if(n instanceof MouseEvent)ft.set(t,{dragStartX:n.pageX,dragStartY:n.pageY});else if(n instanceof TouchEvent){const{pageX:o,pageY:a}=n.changedTouches[0];ft.set(t,{dragStartX:o,dragStartY:a})}}function Dt(n){const t=n.target;if(!(t instanceof HTMLElement))return;const e=tr(t);if(!(e instanceof Vt))return;const{box:s}=et.get(e)||{};if(!s)return;const i=e.getBoundingClientRect();let r,o,a;if(n instanceof KeyboardEvent){if(n.key==="Escape")return nr(e);if(n.key==="-"&&(a=-10),n.key==="="&&(a=10),!a)return;r=s.offsetWidth+a,o=s.offsetHeight+a,kt.set(e,{startX:s.offsetLeft,startY:s.offsetTop})}else if(n instanceof MouseEvent){const l=kt.get(e);if(!l)return;r=n.pageX-l.startX-i.left-window.pageXOffset,o=n.pageY-l.startY-i.top-window.pageYOffset}else if(n instanceof TouchEvent){const l=kt.get(e);if(!l)return;r=n.changedTouches[0].pageX-l.startX-i.left-window.pageXOffset,o=n.changedTouches[0].pageY-l.startY-i.top-window.pageYOffset}r&&o&&er(e,r,o,!(n instanceof KeyboardEvent))}function tr(n){const t=n.getRootNode();return t instanceof ShadowRoot?t.host:n}function Ps(n){const t=n.currentTarget;if(!(t instanceof HTMLElement))return;const e=tr(t);if(!(e instanceof Vt))return;const{box:s}=et.get(e)||{};if(!s)return;const i=n.target;if(i instanceof HTMLElement)if(i.hasAttribute("data-direction")){const r=i.getAttribute("data-direction")||"";e.addEventListener("mousemove",Dt),e.addEventListener("touchmove",Dt,{passive:!0}),["nw","se"].indexOf(r)>=0&&e.classList.add("nwse"),["ne","sw"].indexOf(r)>=0&&e.classList.add("nesw"),kt.set(e,{startX:s.offsetLeft+(["se","ne"].indexOf(r)>=0?0:s.offsetWidth),startY:s.offsetTop+(["se","sw"].indexOf(r)>=0?0:s.offsetHeight)}),Dt(n)}else e.addEventListener("mousemove",re),e.addEventListener("touchmove",re,{passive:!0})}function er(n,t,e,s=!0){let i=Math.max(Math.abs(t),Math.abs(e),10);const r=kt.get(n);if(!r)return;const{box:o,image:a}=et.get(n)||{};if(!o||!a)return;i=Math.min(i,e>0?a.height-r.startY:r.startY,t>0?a.width-r.startX:r.startX);const l=s?Math.round(Math.max(0,t>0?r.startX:r.startX-i)):o.offsetLeft,c=s?Math.round(Math.max(0,e>0?r.startY:r.startY-i)):o.offsetTop;o.style.left=`${l}px`,o.style.top=`${c}px`,o.style.width=`${i}px`,o.style.height=`${i}px`,sr(n,{x:l,y:c,width:i,height:i})}function nr(n){const{image:t}=et.get(n)||{};if(!t)return;const e=Math.round(t.clientWidth>t.clientHeight?t.clientHeight:t.clientWidth);kt.set(n,{startX:(t.clientWidth-e)/2,startY:(t.clientHeight-e)/2}),er(n,e,e)}function nn(n){const t=n.currentTarget;t instanceof Vt&&(ft.delete(t),t.classList.remove("nwse","nesw"),t.removeEventListener("mousemove",Dt),t.removeEventListener("mousemove",re),t.removeEventListener("touchmove",Dt),t.removeEventListener("touchmove",re))}function sr(n,t){const{image:e}=et.get(n)||{};if(!e)return;const s=e.naturalWidth/e.width;for(const i in t){const r=Math.round(t[i]*s);t[i]=r;const o=n.querySelector(`[data-image-crop-input='${i}']`);o instanceof HTMLInputElement&&(o.value=r.toString())}n.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:t}))}class Vt extends HTMLElement{connectedCallback(){if(et.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
2
2
|
<style>
|
3
3
|
:host { touch-action: none; display: block; }
|
4
4
|
:host(.nesw) { cursor: nesw-resize; }
|
@@ -76,24 +76,24 @@ class No{constructor(t,e,{tabInsertsSuggestions:s,defaultFirstOption:i,scrollInt
|
|
76
76
|
</div>
|
77
77
|
</div>
|
78
78
|
</div>
|
79
|
-
`;const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const s=t.querySelector("img");s instanceof HTMLImageElement&&(et.set(this,{box:e,image:s}),s.addEventListener("load",()=>{this.loaded=!0,
|
80
|
-
`).length>1}function
|
81
|
-
`);let e=0;for(let s=0;s<t.length;s++){const i=t[s].length+1;n.selectionStart>=e&&n.selectionStart<e+i&&(n.selectionStart=e),n.selectionEnd>=e&&n.selectionEnd<e+i&&(n.selectionEnd=e+i-1),e+=i}}function
|
82
|
-
`,2-r)),e.match(/\S/)&&o<2&&(l=
|
83
|
-
`,2-o)),a==null&&(a=""),l==null&&(l=""),{newlinesToAppend:a,newlinesToPrepend:l}}function
|
79
|
+
`;const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const s=t.querySelector("img");s instanceof HTMLImageElement&&(et.set(this,{box:e,image:s}),s.addEventListener("load",()=>{this.loaded=!0,nr(this)}),this.addEventListener("mouseleave",nn),this.addEventListener("touchend",nn),this.addEventListener("mouseup",nn),e.addEventListener("mousedown",Ps),e.addEventListener("touchstart",Ps,{passive:!0}),this.addEventListener("keydown",re),this.addEventListener("keydown",Dt),this.src&&(s.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,s){const{image:i}=et.get(this)||{};t==="src"&&(this.loaded=!1,i&&(i.src=s))}}window.customElements.get("image-crop")||(window.ImageCropElement=Vt,window.customElements.define("image-crop",Vt));var Rs=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Oe,fn;const ua=["[data-md-button]","md-header","md-bold","md-italic","md-quote","md-code","md-link","md-image","md-unordered-list","md-ordered-list","md-task-list","md-mention","md-ref","md-strikethrough"];function ir(n){const t=[];for(const e of n.querySelectorAll(ua.join(", ")))e.hidden||e.offsetWidth<=0&&e.offsetHeight<=0||e.closest("markdown-toolbar")===n&&t.push(e);return t}function rr(n){return function(t){(t.key===" "||t.key==="Enter")&&n(t)}}const R=new WeakMap,ha={"header-1":{prefix:"# "},"header-2":{prefix:"## "},"header-3":{prefix:"### "},"header-4":{prefix:"#### "},"header-5":{prefix:"##### "},"header-6":{prefix:"###### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](url)",replaceNext:"url",scanFor:"https?://"},image:{prefix:"",replaceNext:"url",scanFor:"https?://"},"unordered-list":{prefix:"- ",multiline:!0,unorderedList:!0},"ordered-list":{prefix:"1. ",multiline:!0,orderedList:!0},"task-list":{prefix:"- [ ] ",multiline:!0,surroundWithNewlines:!0},mention:{prefix:"@",prefixSpace:!0},ref:{prefix:"#",prefixSpace:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0}};class H extends HTMLElement{constructor(){super();const t=e=>{const s=R.get(this);s&&(e.preventDefault(),pn(this,s))};this.addEventListener("keydown",rr(t)),this.addEventListener("click",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","button")}click(){const t=R.get(this);t&&pn(this,t)}}class Bs extends H{constructor(){super(...arguments),Oe.add(this)}connectedCallback(){const t=parseInt(this.getAttribute("level")||"3",10);Rs(this,Oe,"m",fn).call(this,t)}static get observedAttributes(){return["level"]}attributeChangedCallback(t,e,s){if(t!=="level")return;const i=parseInt(s||"3",10);Rs(this,Oe,"m",fn).call(this,i)}}Oe=new WeakSet,fn=function(t){if(t<1||t>6)return;const e=`${"#".repeat(t)} `;R.set(this,{prefix:e})};window.customElements.get("md-header")||(window.MarkdownHeaderButtonElement=Bs,window.customElements.define("md-header",Bs));class Is extends H{connectedCallback(){R.set(this,{prefix:"**",suffix:"**",trimFirst:!0})}}window.customElements.get("md-bold")||(window.MarkdownBoldButtonElement=Is,window.customElements.define("md-bold",Is));class Ns extends H{connectedCallback(){R.set(this,{prefix:"_",suffix:"_",trimFirst:!0})}}window.customElements.get("md-italic")||(window.MarkdownItalicButtonElement=Ns,window.customElements.define("md-italic",Ns));class $s extends H{connectedCallback(){R.set(this,{prefix:"> ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-quote")||(window.MarkdownQuoteButtonElement=$s,window.customElements.define("md-quote",$s));class js extends H{connectedCallback(){R.set(this,{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"})}}window.customElements.get("md-code")||(window.MarkdownCodeButtonElement=js,window.customElements.define("md-code",js));class Ks extends H{connectedCallback(){R.set(this,{prefix:"[",suffix:"](url)",replaceNext:"url",scanFor:"https?://"})}}window.customElements.get("md-link")||(window.MarkdownLinkButtonElement=Ks,window.customElements.define("md-link",Ks));class Hs extends H{connectedCallback(){R.set(this,{prefix:"",replaceNext:"url",scanFor:"https?://"})}}window.customElements.get("md-image")||(window.MarkdownImageButtonElement=Hs,window.customElements.define("md-image",Hs));class Us extends H{connectedCallback(){R.set(this,{prefix:"- ",multiline:!0,unorderedList:!0})}}window.customElements.get("md-unordered-list")||(window.MarkdownUnorderedListButtonElement=Us,window.customElements.define("md-unordered-list",Us));class Ws extends H{connectedCallback(){R.set(this,{prefix:"1. ",multiline:!0,orderedList:!0})}}window.customElements.get("md-ordered-list")||(window.MarkdownOrderedListButtonElement=Ws,window.customElements.define("md-ordered-list",Ws));class zs extends H{connectedCallback(){R.set(this,{prefix:"- [ ] ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-task-list")||(window.MarkdownTaskListButtonElement=zs,window.customElements.define("md-task-list",zs));class qs extends H{connectedCallback(){R.set(this,{prefix:"@",prefixSpace:!0})}}window.customElements.get("md-mention")||(window.MarkdownMentionButtonElement=qs,window.customElements.define("md-mention",qs));class Ys extends H{connectedCallback(){R.set(this,{prefix:"#",prefixSpace:!0})}}window.customElements.get("md-ref")||(window.MarkdownRefButtonElement=Ys,window.customElements.define("md-ref",Ys));class Xs extends H{connectedCallback(){R.set(this,{prefix:"~~",suffix:"~~",trimFirst:!0})}}window.customElements.get("md-strikethrough")||(window.MarkdownStrikethroughButtonElement=Xs,window.customElements.define("md-strikethrough",Xs));function Gs(n){const{target:t,currentTarget:e}=n;if(!(t instanceof Element))return;const s=t.closest("[data-md-button]");if(!s||s.closest("markdown-toolbar")!==e)return;const i=s.getAttribute("data-md-button"),r=ha[i];r&&(n.preventDefault(),pn(t,r))}function Zs(n){n.addEventListener("keydown",ar),n.setAttribute("tabindex","0"),n.addEventListener("focus",or,{once:!0})}function Qs(n){n.removeEventListener("keydown",ar),n.removeAttribute("tabindex"),n.removeEventListener("focus",or)}class ke extends HTMLElement{connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.hasAttribute("data-no-focus")||Zs(this),this.addEventListener("keydown",rr(Gs)),this.addEventListener("click",Gs)}attributeChangedCallback(t,e,s){t==="data-no-focus"&&(s===null?Zs(this):Qs(this))}disconnectedCallback(){Qs(this)}get field(){const t=this.getAttribute("for");if(!t)return null;const e="getRootNode"in this?this.getRootNode():document;let s;return(e instanceof Document||e instanceof ShadowRoot)&&(s=e.getElementById(t)),s instanceof HTMLTextAreaElement?s:null}}ke.observedAttributes=["data-no-focus"];function or({target:n}){if(!(n instanceof Element))return;n.removeAttribute("tabindex");let t="0";for(const e of ir(n))e.setAttribute("tabindex",t),t==="0"&&(e.focus(),t="-1")}function ar(n){const t=n.key;if(t!=="ArrowRight"&&t!=="ArrowLeft"&&t!=="Home"&&t!=="End")return;const e=n.currentTarget;if(!(e instanceof HTMLElement))return;const s=ir(e),i=s.indexOf(n.target),r=s.length;if(i===-1)return;let o=0;t==="ArrowLeft"&&(o=i-1),t==="ArrowRight"&&(o=i+1),t==="End"&&(o=r-1),o<0&&(o=r-1),o>r-1&&(o=0);for(let a=0;a<r;a+=1)s[a].setAttribute("tabindex",a===o?"0":"-1");n.preventDefault(),s[o].focus()}window.customElements.get("markdown-toolbar")||(window.MarkdownToolbarElement=ke,window.customElements.define("markdown-toolbar",ke));function mn(n){return n.trim().split(`
|
80
|
+
`).length>1}function Js(n,t){return Array(t+1).join(n)}function da(n,t){let e=t;for(;n[e]&&n[e-1]!=null&&!n[e-1].match(/\s/);)e--;return e}function fa(n,t,e){let s=t;const i=e?/\n/:/\s/;for(;n[s]&&!n[s].match(i);)s++;return s}let dt=null;function ma(n,{text:t,selectionStart:e,selectionEnd:s}){const i=n.selectionStart,r=n.value.slice(0,i),o=n.value.slice(n.selectionEnd);if(dt===null||dt===!0){n.contentEditable="true";try{dt=document.execCommand("insertText",!1,t)}catch{dt=!1}n.contentEditable="false"}if(dt&&!n.value.slice(0,n.selectionStart).endsWith(t)&&(dt=!1),!dt){try{document.execCommand("ms-beginUndoUnit")}catch{}n.value=r+t+o;try{document.execCommand("ms-endUndoUnit")}catch{}n.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))}e!=null&&s!=null?n.setSelectionRange(e,s):n.setSelectionRange(i,n.selectionEnd)}function pa(n,t){const e=n.value.slice(n.selectionStart,n.selectionEnd);let s;t.orderedList||t.unorderedList?s=Ea(n,t):t.multiline&&mn(e)?s=va(n,t):s=ya(n,t),ma(n,s)}function ga(n){const t=n.value.split(`
|
81
|
+
`);let e=0;for(let s=0;s<t.length;s++){const i=t[s].length+1;n.selectionStart>=e&&n.selectionStart<e+i&&(n.selectionStart=e),n.selectionEnd>=e&&n.selectionEnd<e+i&&(n.selectionEnd=e+i-1),e+=i}}function ba(n,t,e,s=!1){if(n.selectionStart===n.selectionEnd)n.selectionStart=da(n.value,n.selectionStart),n.selectionEnd=fa(n.value,n.selectionEnd,s);else{const i=n.selectionStart-t.length,r=n.selectionEnd+e.length,o=n.value.slice(i,n.selectionStart)===t,a=n.value.slice(n.selectionEnd,r)===e;o&&a&&(n.selectionStart=i,n.selectionEnd=r)}return n.value.slice(n.selectionStart,n.selectionEnd)}function Hn(n){const t=n.value.slice(0,n.selectionStart),e=n.value.slice(n.selectionEnd),s=t.match(/\n*$/),i=e.match(/^\n*/),r=s?s[0].length:0,o=i?i[0].length:0;let a,l;return t.match(/\S/)&&r<2&&(a=Js(`
|
82
|
+
`,2-r)),e.match(/\S/)&&o<2&&(l=Js(`
|
83
|
+
`,2-o)),a==null&&(a=""),l==null&&(l=""),{newlinesToAppend:a,newlinesToPrepend:l}}function ya(n,t){let e,s;const{prefix:i,suffix:r,blockPrefix:o,blockSuffix:a,replaceNext:l,prefixSpace:c,scanFor:u,surroundWithNewlines:h}=t,d=n.selectionStart,m=n.selectionEnd;let f=n.value.slice(n.selectionStart,n.selectionEnd),g=mn(f)&&o.length>0?`${o}
|
84
84
|
`:i,b=mn(f)&&a.length>0?`
|
85
|
-
${a}`:r;if(c){const w=n.value[n.selectionStart-1];n.selectionStart!==0&&w!=null&&!w.match(/\s/)&&(g=` ${g}`)}f=
|
85
|
+
${a}`:r;if(c){const w=n.value[n.selectionStart-1];n.selectionStart!==0&&w!=null&&!w.match(/\s/)&&(g=` ${g}`)}f=ba(n,g,b,t.multiline);let p=n.selectionStart,v=n.selectionEnd;const E=l.length>0&&b.indexOf(l)>-1&&f.length>0;if(h){const w=Hn(n);e=w.newlinesToAppend,s=w.newlinesToPrepend,g=e+i,b+=s}if(f.startsWith(g)&&f.endsWith(b)){const w=f.slice(g.length,f.length-b.length);if(d===m){let y=d-g.length;y=Math.max(y,p),y=Math.min(y,p+w.length),p=v=y}else v=p+w.length;return{text:w,selectionStart:p,selectionEnd:v}}else if(E)if(u.length>0&&f.match(u)){b=b.replace(l,f);const w=g+b;return p=v=p+g.length,{text:w,selectionStart:p,selectionEnd:v}}else{const w=g+f+b;return p=p+g.length+f.length+b.indexOf(l),v=p+l.length,{text:w,selectionStart:p,selectionEnd:v}}else{let w=g+f+b;p=d+g.length,v=m+g.length;const y=f.match(/^\s*|\s*$/g);if(t.trimFirst&&y){const T=y[0]||"",S=y[1]||"";w=T+g+f.trim()+b+S,p+=T.length,v-=S.length}return{text:w,selectionStart:p,selectionEnd:v}}}function va(n,t){const{prefix:e,suffix:s,surroundWithNewlines:i}=t;let r=n.value.slice(n.selectionStart,n.selectionEnd),o=n.selectionStart,a=n.selectionEnd;const l=r.split(`
|
86
86
|
`);if(l.every(u=>u.startsWith(e)&&u.endsWith(s)))r=l.map(u=>u.slice(e.length,u.length-s.length)).join(`
|
87
87
|
`),a=o+r.length;else if(r=l.map(u=>e+u+s).join(`
|
88
|
-
`),i){const{newlinesToAppend:u,newlinesToPrepend:h}=
|
88
|
+
`),i){const{newlinesToAppend:u,newlinesToPrepend:h}=Hn(n);o+=u.length,a=o+r.length,r=u+r+h}return{text:r,selectionStart:o,selectionEnd:a}}function ti(n){const t=n.split(`
|
89
89
|
`),e=/^\d+\.\s+/,s=t.every(r=>e.test(r));let i=t;return s&&(i=t.map(r=>r.replace(e,""))),{text:i.join(`
|
90
|
-
`),processed:s}}function
|
90
|
+
`),processed:s}}function ei(n){const t=n.split(`
|
91
91
|
`),e="- ",s=t.every(r=>r.startsWith(e));let i=t;return s&&(i=t.map(r=>r.slice(e.length,r.length))),{text:i.join(`
|
92
|
-
`),processed:s}}function zt(n,t){return t?"- ":`${n+1}. `}function
|
93
|
-
`).map((g,b)=>`${zt(b,t.unorderedList)}${g}`),u=c.reduce((g,b,p)=>g+zt(p,t.unorderedList).length,0),h=c.reduce((g,b,p)=>g+zt(p,!t.unorderedList).length,0);if(o.processed)return e?(s=Math.max(s-zt(0,t.unorderedList).length,0),i=s):(s=n.selectionStart,i=n.selectionEnd-u),{text:l,selectionStart:s,selectionEnd:i};const{newlinesToAppend:d,newlinesToPrepend:m}=
|
94
|
-
`)+m;return e?(s=Math.max(s+zt(0,t.unorderedList).length+d.length,0),i=s):a.processed?(s=Math.max(n.selectionStart+d.length,0),i=n.selectionEnd+d.length+u-h):(s=Math.max(n.selectionStart+d.length,0),i=n.selectionEnd+d.length+u),{text:f,selectionStart:s,selectionEnd:i}}function pn(n,t){const e=n.closest("markdown-toolbar");if(!(e instanceof ke))return;const i=Object.assign(Object.assign({},{prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,unorderedList:!1,trimFirst:!1}),t),r=e.field;r&&(r.focus(),ha(r,i))}localStorage.getItem("theme");window.matchMedia("(prefers-color-scheme: dark)").matches;class ya{constructor(t,e,s){this.eventTarget=t,this.eventName=e,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(t){this.unorderedBindings.add(t)}bindingDisconnected(t){this.unorderedBindings.delete(t)}handleEvent(t){const e=va(t);for(const s of this.bindings){if(e.immediatePropagationStopped)break;s.handleEvent(e)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((t,e)=>{const s=t.index,i=e.index;return s<i?-1:s>i?1:0})}}function va(n){if("immediatePropagationStopped"in n)return n;{const{stopImmediatePropagation:t}=n;return Object.assign(n,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}class wa{constructor(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(t=>t.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(t=>t.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((t,e)=>t.concat(Array.from(e.values())),[])}bindingConnected(t){this.fetchEventListenerForBinding(t).bindingConnected(t)}bindingDisconnected(t,e=!1){this.fetchEventListenerForBinding(t).bindingDisconnected(t),e&&this.clearEventListenersForBinding(t)}handleError(t,e,s={}){this.application.handleError(t,`Error ${e}`,s)}clearEventListenersForBinding(t){const e=this.fetchEventListenerForBinding(t);e.hasBindings()||(e.disconnect(),this.removeMappedEventListenerFor(t))}removeMappedEventListenerFor(t){const{eventTarget:e,eventName:s,eventOptions:i}=t,r=this.fetchEventListenerMapForEventTarget(e),o=this.cacheKey(s,i);r.delete(o),r.size==0&&this.eventListenerMaps.delete(e)}fetchEventListenerForBinding(t){const{eventTarget:e,eventName:s,eventOptions:i}=t;return this.fetchEventListener(e,s,i)}fetchEventListener(t,e,s){const i=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(e,s);let o=i.get(r);return o||(o=this.createEventListener(t,e,s),i.set(r,o)),o}createEventListener(t,e,s){const i=new ya(t,e,s);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(t){let e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e}cacheKey(t,e){const s=[t];return Object.keys(e).sort().forEach(i=>{s.push(`${e[i]?"":"!"}${i}`)}),s.join(":")}}const Ea={stop({event:n,value:t}){return t&&n.stopPropagation(),!0},prevent({event:n,value:t}){return t&&n.preventDefault(),!0},self({event:n,value:t,element:e}){return t?e===n.target:!0}},Ta=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Aa(n){const e=n.trim().match(Ta)||[];let s=e[2],i=e[3];return i&&!["keydown","keyup","keypress"].includes(s)&&(s+=`.${i}`,i=""),{eventTarget:xa(e[4]),eventName:s,eventOptions:e[7]?Sa(e[7]):{},identifier:e[5],methodName:e[6],keyFilter:e[1]||i}}function xa(n){if(n=="window")return window;if(n=="document")return document}function Sa(n){return n.split(":").reduce((t,e)=>Object.assign(t,{[e.replace(/^!/,"")]:!/^!/.test(e)}),{})}function Ma(n){if(n==window)return"window";if(n==document)return"document"}function Kn(n){return n.replace(/(?:[_-])([a-z0-9])/g,(t,e)=>e.toUpperCase())}function gn(n){return Kn(n.replace(/--/g,"-").replace(/__/g,"_"))}function de(n){return n.charAt(0).toUpperCase()+n.slice(1)}function ir(n){return n.replace(/([A-Z])/g,(t,e)=>`-${e.toLowerCase()}`)}function Oa(n){return n.match(/[^\s]+/g)||[]}function Qs(n){return n!=null}function bn(n,t){return Object.prototype.hasOwnProperty.call(n,t)}const Js=["meta","ctrl","alt","shift"];class Ca{constructor(t,e,s,i){this.element=t,this.index=e,this.eventTarget=s.eventTarget||t,this.eventName=s.eventName||ka(t)||Ee("missing event name"),this.eventOptions=s.eventOptions||{},this.identifier=s.identifier||Ee("missing identifier"),this.methodName=s.methodName||Ee("missing method name"),this.keyFilter=s.keyFilter||"",this.schema=i}static forToken(t,e){return new this(t.element,t.index,Aa(t.content),e)}toString(){const t=this.keyFilter?`.${this.keyFilter}`:"",e=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${t}${e}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(t){if(!this.keyFilter)return!1;const e=this.keyFilter.split("+");if(this.keyFilterDissatisfied(t,e))return!0;const s=e.filter(i=>!Js.includes(i))[0];return s?(bn(this.keyMappings,s)||Ee(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[s].toLowerCase()!==t.key.toLowerCase()):!1}shouldIgnoreMouseEvent(t){if(!this.keyFilter)return!1;const e=[this.keyFilter];return!!this.keyFilterDissatisfied(t,e)}get params(){const t={},e=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:s,value:i}of Array.from(this.element.attributes)){const r=s.match(e),o=r&&r[1];o&&(t[Kn(o)]=La(i))}return t}get eventTargetName(){return Ma(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(t,e){const[s,i,r,o]=Js.map(a=>e.includes(a));return t.metaKey!==s||t.ctrlKey!==i||t.altKey!==r||t.shiftKey!==o}}const ti={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:n=>n.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function ka(n){const t=n.tagName.toLowerCase();if(t in ti)return ti[t](n)}function Ee(n){throw new Error(n)}function La(n){try{return JSON.parse(n)}catch{return n}}class Fa{constructor(t,e){this.context=t,this.action=e}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(t){const e=this.prepareActionEvent(t);this.willBeInvokedByEvent(t)&&this.applyEventModifiers(e)&&this.invokeWithEvent(e)}get eventName(){return this.action.eventName}get method(){const t=this.controller[this.methodName];if(typeof t=="function")return t;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(t){const{element:e}=this.action,{actionDescriptorFilters:s}=this.context.application,{controller:i}=this.context;let r=!0;for(const[o,a]of Object.entries(this.eventOptions))if(o in s){const l=s[o];r=r&&l({name:o,value:a,event:t,element:e,controller:i})}else continue;return r}prepareActionEvent(t){return Object.assign(t,{params:this.action.params})}invokeWithEvent(t){const{target:e,currentTarget:s}=t;try{this.method.call(this.controller,t),this.context.logDebugActivity(this.methodName,{event:t,target:e,currentTarget:s,action:this.methodName})}catch(i){const{identifier:r,controller:o,element:a,index:l}=this,c={identifier:r,controller:o,element:a,index:l,event:t};this.context.handleError(i,`invoking action "${this.action}"`,c)}}willBeInvokedByEvent(t){const e=t.target;return t instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(t)||t instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(t)?!1:this.element===e?!0:e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):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}}class rr{constructor(t,e){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=t,this.started=!1,this.delegate=e,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(t){this.started&&(this.mutationObserver.disconnect(),this.started=!1),t(),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){const t=new Set(this.matchElementsInTree());for(const e of Array.from(this.elements))t.has(e)||this.removeElement(e);for(const e of Array.from(t))this.addElement(e)}}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){t.type=="attributes"?this.processAttributeChange(t.target,t.attributeName):t.type=="childList"&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))}processAttributeChange(t,e){this.elements.has(t)?this.delegate.elementAttributeChanged&&this.matchElement(t)?this.delegate.elementAttributeChanged(t,e):this.removeElement(t):this.matchElement(t)&&this.addElement(t)}processRemovedNodes(t){for(const e of Array.from(t)){const s=this.elementFromNode(e);s&&this.processTree(s,this.removeElement)}}processAddedNodes(t){for(const e of Array.from(t)){const s=this.elementFromNode(e);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}matchElement(t){return this.delegate.matchElement(t)}matchElementsInTree(t=this.element){return this.delegate.matchElementsInTree(t)}processTree(t,e){for(const s of this.matchElementsInTree(t))e.call(this,s)}elementFromNode(t){if(t.nodeType==Node.ELEMENT_NODE)return t}elementIsActive(t){return t.isConnected!=this.element.isConnected?!1:this.element.contains(t)}addElement(t){this.elements.has(t)||this.elementIsActive(t)&&(this.elements.add(t),this.delegate.elementMatched&&this.delegate.elementMatched(t))}removeElement(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(t))}}class or{constructor(t,e,s){this.attributeName=e,this.delegate=s,this.elementObserver=new rr(t,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(t){return t.hasAttribute(this.attributeName)}matchElementsInTree(t){const e=this.matchElement(t)?[t]:[],s=Array.from(t.querySelectorAll(this.selector));return e.concat(s)}elementMatched(t){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(t,this.attributeName)}elementUnmatched(t){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(t,this.attributeName)}elementAttributeChanged(t,e){this.delegate.elementAttributeValueChanged&&this.attributeName==e&&this.delegate.elementAttributeValueChanged(t,e)}}function Da(n,t,e){ar(n,t).add(e)}function Va(n,t,e){ar(n,t).delete(e),_a(n,t)}function ar(n,t){let e=n.get(t);return e||(e=new Set,n.set(t,e)),e}function _a(n,t){const e=n.get(t);e!=null&&e.size==0&&n.delete(t)}class yt{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,s)=>e.concat(Array.from(s)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,s)=>e+s.size,0)}add(t,e){Da(this.valuesByKey,t,e)}delete(t,e){Va(this.valuesByKey,t,e)}has(t,e){const s=this.valuesByKey.get(t);return s!=null&&s.has(e)}hasKey(t){return this.valuesByKey.has(t)}hasValue(t){return Array.from(this.valuesByKey.values()).some(s=>s.has(t))}getValuesForKey(t){const e=this.valuesByKey.get(t);return e?Array.from(e):[]}getKeysForValue(t){return Array.from(this.valuesByKey).filter(([e,s])=>s.has(t)).map(([e,s])=>e)}}class Pa{constructor(t,e,s,i){this._selector=e,this.details=i,this.elementObserver=new rr(t,this),this.delegate=s,this.matchesByElement=new yt}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(t){this._selector=t,this.refresh()}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(t){const{selector:e}=this;if(e){const s=t.matches(e);return this.delegate.selectorMatchElement?s&&this.delegate.selectorMatchElement(t,this.details):s}else return!1}matchElementsInTree(t){const{selector:e}=this;if(e){const s=this.matchElement(t)?[t]:[],i=Array.from(t.querySelectorAll(e)).filter(r=>this.matchElement(r));return s.concat(i)}else return[]}elementMatched(t){const{selector:e}=this;e&&this.selectorMatched(t,e)}elementUnmatched(t){const e=this.matchesByElement.getKeysForValue(t);for(const s of e)this.selectorUnmatched(t,s)}elementAttributeChanged(t,e){const{selector:s}=this;if(s){const i=this.matchElement(t),r=this.matchesByElement.has(s,t);i&&!r?this.selectorMatched(t,s):!i&&r&&this.selectorUnmatched(t,s)}}selectorMatched(t,e){this.delegate.selectorMatched(t,e,this.details),this.matchesByElement.add(e,t)}selectorUnmatched(t,e){this.delegate.selectorUnmatched(t,e,this.details),this.matchesByElement.delete(e,t)}}class Ba{constructor(t,e){this.element=t,this.delegate=e,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(const t of this.knownAttributeNames)this.refreshAttribute(t,null)}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){const e=t.attributeName;e&&this.refreshAttribute(e,t.oldValue)}refreshAttribute(t,e){const s=this.delegate.getStringMapKeyForAttribute(t);if(s!=null){this.stringMap.has(t)||this.stringMapKeyAdded(s,t);const i=this.element.getAttribute(t);if(this.stringMap.get(t)!=i&&this.stringMapValueChanged(i,s,e),i==null){const r=this.stringMap.get(t);this.stringMap.delete(t),r&&this.stringMapKeyRemoved(s,t,r)}else this.stringMap.set(t,i)}}stringMapKeyAdded(t,e){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(t,e)}stringMapValueChanged(t,e,s){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(t,e,s)}stringMapKeyRemoved(t,e,s){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(t,e,s)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(t=>t.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class lr{constructor(t,e,s){this.attributeObserver=new or(t,e,this),this.delegate=s,this.tokensByElement=new yt}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(t){this.attributeObserver.pause(t)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(t){this.tokensMatched(this.readTokensForElement(t))}elementAttributeValueChanged(t){const[e,s]=this.refreshTokensForElement(t);this.tokensUnmatched(e),this.tokensMatched(s)}elementUnmatchedAttribute(t){this.tokensUnmatched(this.tokensByElement.getValuesForKey(t))}tokensMatched(t){t.forEach(e=>this.tokenMatched(e))}tokensUnmatched(t){t.forEach(e=>this.tokenUnmatched(e))}tokenMatched(t){this.delegate.tokenMatched(t),this.tokensByElement.add(t.element,t)}tokenUnmatched(t){this.delegate.tokenUnmatched(t),this.tokensByElement.delete(t.element,t)}refreshTokensForElement(t){const e=this.tokensByElement.getValuesForKey(t),s=this.readTokensForElement(t),i=Ia(e,s).findIndex(([r,o])=>!Na(r,o));return i==-1?[[],[]]:[e.slice(i),s.slice(i)]}readTokensForElement(t){const e=this.attributeName,s=t.getAttribute(e)||"";return Ra(s,t,e)}}function Ra(n,t,e){return n.trim().split(/\s+/).filter(s=>s.length).map((s,i)=>({element:t,attributeName:e,content:s,index:i}))}function Ia(n,t){const e=Math.max(n.length,t.length);return Array.from({length:e},(s,i)=>[n[i],t[i]])}function Na(n,t){return n&&t&&n.index==t.index&&n.content==t.content}class cr{constructor(t,e,s){this.tokenListObserver=new lr(t,e,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(t){const{element:e}=t,{value:s}=this.fetchParseResultForToken(t);s&&(this.fetchValuesByTokenForElement(e).set(t,s),this.delegate.elementMatchedValue(e,s))}tokenUnmatched(t){const{element:e}=t,{value:s}=this.fetchParseResultForToken(t);s&&(this.fetchValuesByTokenForElement(e).delete(t),this.delegate.elementUnmatchedValue(e,s))}fetchParseResultForToken(t){let e=this.parseResultsByToken.get(t);return e||(e=this.parseToken(t),this.parseResultsByToken.set(t,e)),e}fetchValuesByTokenForElement(t){let e=this.valuesByTokenByElement.get(t);return e||(e=new Map,this.valuesByTokenByElement.set(t,e)),e}parseToken(t){try{return{value:this.delegate.parseValueForToken(t)}}catch(e){return{error:e}}}}class $a{constructor(t,e){this.context=t,this.delegate=e,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new cr(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(t){const e=new Fa(this.context,t);this.bindingsByAction.set(t,e),this.delegate.bindingConnected(e)}disconnectAction(t){const e=this.bindingsByAction.get(t);e&&(this.bindingsByAction.delete(t),this.delegate.bindingDisconnected(e))}disconnectAllActions(){this.bindings.forEach(t=>this.delegate.bindingDisconnected(t,!0)),this.bindingsByAction.clear()}parseValueForToken(t){const e=Ca.forToken(t,this.schema);if(e.identifier==this.identifier)return e}elementMatchedValue(t,e){this.connectAction(e)}elementUnmatchedValue(t,e){this.disconnectAction(e)}}class ja{constructor(t,e){this.context=t,this.receiver=e,this.stringMapObserver=new Ba(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(t){if(t in this.valueDescriptorMap)return this.valueDescriptorMap[t].name}stringMapKeyAdded(t,e){const s=this.valueDescriptorMap[e];this.hasValue(t)||this.invokeChangedCallback(t,s.writer(this.receiver[t]),s.writer(s.defaultValue))}stringMapValueChanged(t,e,s){const i=this.valueDescriptorNameMap[e];t!==null&&(s===null&&(s=i.writer(i.defaultValue)),this.invokeChangedCallback(e,t,s))}stringMapKeyRemoved(t,e,s){const i=this.valueDescriptorNameMap[t];this.hasValue(t)?this.invokeChangedCallback(t,i.writer(this.receiver[t]),s):this.invokeChangedCallback(t,i.writer(i.defaultValue),s)}invokeChangedCallbacksForDefaultValues(){for(const{key:t,name:e,defaultValue:s,writer:i}of this.valueDescriptors)s!=null&&!this.controller.data.has(t)&&this.invokeChangedCallback(e,i(s),void 0)}invokeChangedCallback(t,e,s){const i=`${t}Changed`,r=this.receiver[i];if(typeof r=="function"){const o=this.valueDescriptorNameMap[t];try{const a=o.reader(e);let 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(){const{valueDescriptorMap:t}=this;return Object.keys(t).map(e=>t[e])}get valueDescriptorNameMap(){const t={};return Object.keys(this.valueDescriptorMap).forEach(e=>{const s=this.valueDescriptorMap[e];t[s.name]=s}),t}hasValue(t){const e=this.valueDescriptorNameMap[t],s=`has${de(e.name)}`;return this.receiver[s]}}class Ka{constructor(t,e){this.context=t,this.delegate=e,this.targetsByName=new yt}start(){this.tokenListObserver||(this.tokenListObserver=new lr(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:t,content:e}){this.scope.containsElement(t)&&this.connectTarget(t,e)}tokenUnmatched({element:t,content:e}){this.disconnectTarget(t,e)}connectTarget(t,e){var s;this.targetsByName.has(e,t)||(this.targetsByName.add(e,t),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetConnected(t,e)))}disconnectTarget(t,e){var s;this.targetsByName.has(e,t)&&(this.targetsByName.delete(e,t),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetDisconnected(t,e)))}disconnectAllTargets(){for(const t of this.targetsByName.keys)for(const e of this.targetsByName.getValuesForKey(t))this.disconnectTarget(e,t)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function fe(n,t){const e=ur(n);return Array.from(e.reduce((s,i)=>(Ua(i,t).forEach(r=>s.add(r)),s),new Set))}function Ha(n,t){return ur(n).reduce((s,i)=>(s.push(...Wa(i,t)),s),[])}function ur(n){const t=[];for(;n;)t.push(n),n=Object.getPrototypeOf(n);return t.reverse()}function Ua(n,t){const e=n[t];return Array.isArray(e)?e:[]}function Wa(n,t){const e=n[t];return e?Object.keys(e).map(s=>[s,e[s]]):[]}class za{constructor(t,e){this.started=!1,this.context=t,this.delegate=e,this.outletsByName=new yt,this.outletElementsByName=new yt,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(t=>{this.setupSelectorObserverForOutlet(t),this.setupAttributeObserverForOutlet(t)}),this.started=!0,this.dependentContexts.forEach(t=>t.refresh()))}refresh(){this.selectorObserverMap.forEach(t=>t.refresh()),this.attributeObserverMap.forEach(t=>t.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(t=>t.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(t=>t.stop()),this.attributeObserverMap.clear())}selectorMatched(t,e,{outletName:s}){const i=this.getOutlet(t,s);i&&this.connectOutlet(i,t,s)}selectorUnmatched(t,e,{outletName:s}){const i=this.getOutletFromMap(t,s);i&&this.disconnectOutlet(i,t,s)}selectorMatchElement(t,{outletName:e}){const s=this.selector(e),i=this.hasOutlet(t,e),r=t.matches(`[${this.schema.controllerAttribute}~=${e}]`);return s?i&&r&&t.matches(s):!1}elementMatchedAttribute(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}elementAttributeValueChanged(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}elementUnmatchedAttribute(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}connectOutlet(t,e,s){var i;this.outletElementsByName.has(s,e)||(this.outletsByName.add(s,t),this.outletElementsByName.add(s,e),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletConnected(t,e,s)))}disconnectOutlet(t,e,s){var i;this.outletElementsByName.has(s,e)&&(this.outletsByName.delete(s,t),this.outletElementsByName.delete(s,e),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletDisconnected(t,e,s)))}disconnectAllOutlets(){for(const t of this.outletElementsByName.keys)for(const e of this.outletElementsByName.getValuesForKey(t))for(const s of this.outletsByName.getValuesForKey(t))this.disconnectOutlet(s,e,t)}updateSelectorObserverForOutlet(t){const e=this.selectorObserverMap.get(t);e&&(e.selector=this.selector(t))}setupSelectorObserverForOutlet(t){const e=this.selector(t),s=new Pa(document.body,e,this,{outletName:t});this.selectorObserverMap.set(t,s),s.start()}setupAttributeObserverForOutlet(t){const e=this.attributeNameForOutletName(t),s=new or(this.scope.element,e,this);this.attributeObserverMap.set(t,s),s.start()}selector(t){return this.scope.outlets.getSelectorForOutletName(t)}attributeNameForOutletName(t){return this.scope.schema.outletAttributeForScope(this.identifier,t)}getOutletNameFromOutletAttributeName(t){return this.outletDefinitions.find(e=>this.attributeNameForOutletName(e)===t)}get outletDependencies(){const t=new yt;return this.router.modules.forEach(e=>{const s=e.definition.controllerConstructor;fe(s,"outlets").forEach(r=>t.add(r,e.identifier))}),t}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const t=this.dependentControllerIdentifiers;return this.router.contexts.filter(e=>t.includes(e.identifier))}hasOutlet(t,e){return!!this.getOutlet(t,e)||!!this.getOutletFromMap(t,e)}getOutlet(t,e){return this.application.getControllerForElementAndIdentifier(t,e)}getOutletFromMap(t,e){return this.outletsByName.getValuesForKey(e).find(s=>s.element===t)}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}}class qa{constructor(t,e){this.logDebugActivity=(s,i={})=>{const{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=t,this.scope=e,this.controller=new t.controllerConstructor(this),this.bindingObserver=new $a(this,this.dispatcher),this.valueObserver=new ja(this,this.controller),this.targetObserver=new Ka(this,this),this.outletObserver=new za(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(t){this.handleError(t,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(t){this.handleError(t,"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(t,e,s={}){const{identifier:i,controller:r,element:o}=this;s=Object.assign({identifier:i,controller:r,element:o},s),this.application.handleError(t,`Error ${e}`,s)}targetConnected(t,e){this.invokeControllerMethod(`${e}TargetConnected`,t)}targetDisconnected(t,e){this.invokeControllerMethod(`${e}TargetDisconnected`,t)}outletConnected(t,e,s){this.invokeControllerMethod(`${gn(s)}OutletConnected`,t,e)}outletDisconnected(t,e,s){this.invokeControllerMethod(`${gn(s)}OutletDisconnected`,t,e)}invokeControllerMethod(t,...e){const s=this.controller;typeof s[t]=="function"&&s[t](...e)}}function Ya(n){return Xa(n,Ga(n))}function Xa(n,t){const e=tl(n),s=Za(n.prototype,t);return Object.defineProperties(e.prototype,s),e}function Ga(n){return fe(n,"blessings").reduce((e,s)=>{const i=s(n);for(const r in i){const o=e[r]||{};e[r]=Object.assign(o,i[r])}return e},{})}function Za(n,t){return Ja(t).reduce((e,s)=>{const i=Qa(n,t,s);return i&&Object.assign(e,{[s]:i}),e},{})}function Qa(n,t,e){const s=Object.getOwnPropertyDescriptor(n,e);if(!(s&&"value"in s)){const r=Object.getOwnPropertyDescriptor(t,e).value;return s&&(r.get=s.get||r.get,r.set=s.set||r.set),r}}const Ja=typeof Object.getOwnPropertySymbols=="function"?n=>[...Object.getOwnPropertyNames(n),...Object.getOwnPropertySymbols(n)]:Object.getOwnPropertyNames,tl=(()=>{function n(e){function s(){return Reflect.construct(e,arguments,new.target)}return s.prototype=Object.create(e.prototype,{constructor:{value:s}}),Reflect.setPrototypeOf(s,e),s}function t(){const s=n(function(){this.a.call(this)});return s.prototype.a=function(){},new s}try{return t(),n}catch{return s=>class extends s{}}})();function el(n){return{identifier:n.identifier,controllerConstructor:Ya(n.controllerConstructor)}}class nl{constructor(t,e){this.application=t,this.definition=el(e),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(t){const e=this.fetchContextForScope(t);this.connectedContexts.add(e),e.connect()}disconnectContextForScope(t){const e=this.contextsByScope.get(t);e&&(this.connectedContexts.delete(e),e.disconnect())}fetchContextForScope(t){let e=this.contextsByScope.get(t);return e||(e=new qa(this,t),this.contextsByScope.set(t,e)),e}}class sl{constructor(t){this.scope=t}has(t){return this.data.has(this.getDataKey(t))}get(t){return this.getAll(t)[0]}getAll(t){const e=this.data.get(this.getDataKey(t))||"";return Oa(e)}getAttributeName(t){return this.data.getAttributeNameForKey(this.getDataKey(t))}getDataKey(t){return`${t}-class`}get data(){return this.scope.data}}class il{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(t){const e=this.getAttributeNameForKey(t);return this.element.getAttribute(e)}set(t,e){const s=this.getAttributeNameForKey(t);return this.element.setAttribute(s,e),this.get(t)}has(t){const e=this.getAttributeNameForKey(t);return this.element.hasAttribute(e)}delete(t){if(this.has(t)){const e=this.getAttributeNameForKey(t);return this.element.removeAttribute(e),!0}else return!1}getAttributeNameForKey(t){return`data-${this.identifier}-${ir(t)}`}}class rl{constructor(t){this.warnedKeysByObject=new WeakMap,this.logger=t}warn(t,e,s){let i=this.warnedKeysByObject.get(t);i||(i=new Set,this.warnedKeysByObject.set(t,i)),i.has(e)||(i.add(e),this.logger.warn(s,t))}}function yn(n,t){return`[${n}~="${t}"]`}class ol{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,s)=>e||this.findTarget(s)||this.findLegacyTarget(s),void 0)}findAll(...t){return t.reduce((e,s)=>[...e,...this.findAllTargets(s),...this.findAllLegacyTargets(s)],[])}findTarget(t){const e=this.getSelectorForTargetName(t);return this.scope.findElement(e)}findAllTargets(t){const e=this.getSelectorForTargetName(t);return this.scope.findAllElements(e)}getSelectorForTargetName(t){const e=this.schema.targetAttributeForScope(this.identifier);return yn(e,t)}findLegacyTarget(t){const e=this.getLegacySelectorForTargetName(t);return this.deprecate(this.scope.findElement(e),t)}findAllLegacyTargets(t){const e=this.getLegacySelectorForTargetName(t);return this.scope.findAllElements(e).map(s=>this.deprecate(s,t))}getLegacySelectorForTargetName(t){const e=`${this.identifier}.${t}`;return yn(this.schema.targetAttribute,e)}deprecate(t,e){if(t){const{identifier:s}=this,i=this.schema.targetAttribute,r=this.schema.targetAttributeForScope(s);this.guide.warn(t,`target:${e}`,`Please replace ${i}="${s}.${e}" with ${r}="${e}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return t}get guide(){return this.scope.guide}}class al{constructor(t,e){this.scope=t,this.controllerElement=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,s)=>e||this.findOutlet(s),void 0)}findAll(...t){return t.reduce((e,s)=>[...e,...this.findAllOutlets(s)],[])}getSelectorForOutletName(t){const e=this.schema.outletAttributeForScope(this.identifier,t);return this.controllerElement.getAttribute(e)}findOutlet(t){const e=this.getSelectorForOutletName(t);if(e)return this.findElement(e,t)}findAllOutlets(t){const e=this.getSelectorForOutletName(t);return e?this.findAllElements(e,t):[]}findElement(t,e){return this.scope.queryElements(t).filter(i=>this.matchesElement(i,t,e))[0]}findAllElements(t,e){return this.scope.queryElements(t).filter(i=>this.matchesElement(i,t,e))}matchesElement(t,e,s){const i=t.getAttribute(this.scope.schema.controllerAttribute)||"";return t.matches(e)&&i.split(" ").includes(s)}}class Hn{constructor(t,e,s,i){this.targets=new ol(this),this.classes=new sl(this),this.data=new il(this),this.containsElement=r=>r.closest(this.controllerSelector)===this.element,this.schema=t,this.element=e,this.identifier=s,this.guide=new rl(i),this.outlets=new al(this.documentScope,e)}findElement(t){return this.element.matches(t)?this.element:this.queryElements(t).find(this.containsElement)}findAllElements(t){return[...this.element.matches(t)?[this.element]:[],...this.queryElements(t).filter(this.containsElement)]}queryElements(t){return Array.from(this.element.querySelectorAll(t))}get controllerSelector(){return yn(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Hn(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class ll{constructor(t,e,s){this.element=t,this.schema=e,this.delegate=s,this.valueListObserver=new cr(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(t){const{element:e,content:s}=t;return this.parseValueForElementAndIdentifier(e,s)}parseValueForElementAndIdentifier(t,e){const s=this.fetchScopesByIdentifierForElement(t);let i=s.get(e);return i||(i=this.delegate.createScopeForElementAndIdentifier(t,e),s.set(e,i)),i}elementMatchedValue(t,e){const s=(this.scopeReferenceCounts.get(e)||0)+1;this.scopeReferenceCounts.set(e,s),s==1&&this.delegate.scopeConnected(e)}elementUnmatchedValue(t,e){const s=this.scopeReferenceCounts.get(e);s&&(this.scopeReferenceCounts.set(e,s-1),s==1&&this.delegate.scopeDisconnected(e))}fetchScopesByIdentifierForElement(t){let e=this.scopesByIdentifierByElement.get(t);return e||(e=new Map,this.scopesByIdentifierByElement.set(t,e)),e}}class cl{constructor(t){this.application=t,this.scopeObserver=new ll(this.element,this.schema,this),this.scopesByIdentifier=new yt,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((t,e)=>t.concat(e.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(t){this.unloadIdentifier(t.identifier);const e=new nl(this.application,t);this.connectModule(e);const s=t.controllerConstructor.afterLoad;s&&s.call(t.controllerConstructor,t.identifier,this.application)}unloadIdentifier(t){const e=this.modulesByIdentifier.get(t);e&&this.disconnectModule(e)}getContextForElementAndIdentifier(t,e){const s=this.modulesByIdentifier.get(e);if(s)return s.contexts.find(i=>i.element==t)}proposeToConnectScopeForElementAndIdentifier(t,e){const s=this.scopeObserver.parseValueForElementAndIdentifier(t,e);s?this.scopeObserver.elementMatchedValue(s.element,s):console.error(`Couldn't find or create scope for identifier: "${e}" and element:`,t)}handleError(t,e,s){this.application.handleError(t,e,s)}createScopeForElementAndIdentifier(t,e){return new Hn(this.schema,t,e,this.logger)}scopeConnected(t){this.scopesByIdentifier.add(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.connectContextForScope(t)}scopeDisconnected(t){this.scopesByIdentifier.delete(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.disconnectContextForScope(t)}connectModule(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(s=>t.connectContextForScope(s))}disconnectModule(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(s=>t.disconnectContextForScope(s))}}const ul={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:n=>`data-${n}-target`,outletAttributeForScope:(n,t)=>`data-${n}-${t}-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"},ei("abcdefghijklmnopqrstuvwxyz".split("").map(n=>[n,n]))),ei("0123456789".split("").map(n=>[n,n])))};function ei(n){return n.reduce((t,[e,s])=>Object.assign(Object.assign({},t),{[e]:s}),{})}class hl{constructor(t=document.documentElement,e=ul){this.logger=console,this.debug=!1,this.logDebugActivity=(s,i,r={})=>{this.debug&&this.logFormattedMessage(s,i,r)},this.element=t,this.schema=e,this.dispatcher=new wa(this),this.router=new cl(this),this.actionDescriptorFilters=Object.assign({},Ea)}static start(t,e){const s=new this(t,e);return s.start(),s}async start(){await dl(),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(t,e){this.load({identifier:t,controllerConstructor:e})}registerActionOption(t,e){this.actionDescriptorFilters[t]=e}load(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(i=>{i.controllerConstructor.shouldLoad&&this.router.loadDefinition(i)})}unload(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(i=>this.router.unloadIdentifier(i))}get controllers(){return this.router.contexts.map(t=>t.controller)}getControllerForElementAndIdentifier(t,e){const s=this.router.getContextForElementAndIdentifier(t,e);return s?s.controller:null}handleError(t,e,s){var i;this.logger.error(`%s
|
92
|
+
`),processed:s}}function zt(n,t){return t?"- ":`${n+1}. `}function wa(n,t){let e,s,i;return n.orderedList?(s=ti(t),e=ei(s.text),i=e.text):(s=ei(t),e=ti(s.text),i=e.text),[s,e,i]}function Ea(n,t){const e=n.selectionStart===n.selectionEnd;let s=n.selectionStart,i=n.selectionEnd;ga(n);const r=n.value.slice(n.selectionStart,n.selectionEnd),[o,a,l]=wa(t,r),c=l.split(`
|
93
|
+
`).map((g,b)=>`${zt(b,t.unorderedList)}${g}`),u=c.reduce((g,b,p)=>g+zt(p,t.unorderedList).length,0),h=c.reduce((g,b,p)=>g+zt(p,!t.unorderedList).length,0);if(o.processed)return e?(s=Math.max(s-zt(0,t.unorderedList).length,0),i=s):(s=n.selectionStart,i=n.selectionEnd-u),{text:l,selectionStart:s,selectionEnd:i};const{newlinesToAppend:d,newlinesToPrepend:m}=Hn(n),f=d+c.join(`
|
94
|
+
`)+m;return e?(s=Math.max(s+zt(0,t.unorderedList).length+d.length,0),i=s):a.processed?(s=Math.max(n.selectionStart+d.length,0),i=n.selectionEnd+d.length+u-h):(s=Math.max(n.selectionStart+d.length,0),i=n.selectionEnd+d.length+u),{text:f,selectionStart:s,selectionEnd:i}}function pn(n,t){const e=n.closest("markdown-toolbar");if(!(e instanceof ke))return;const i=Object.assign(Object.assign({},{prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,unorderedList:!1,trimFirst:!1}),t),r=e.field;r&&(r.focus(),pa(r,i))}localStorage.getItem("theme");window.matchMedia("(prefers-color-scheme: dark)").matches;class Ta{constructor(t,e,s){this.eventTarget=t,this.eventName=e,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(t){this.unorderedBindings.add(t)}bindingDisconnected(t){this.unorderedBindings.delete(t)}handleEvent(t){const e=Aa(t);for(const s of this.bindings){if(e.immediatePropagationStopped)break;s.handleEvent(e)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((t,e)=>{const s=t.index,i=e.index;return s<i?-1:s>i?1:0})}}function Aa(n){if("immediatePropagationStopped"in n)return n;{const{stopImmediatePropagation:t}=n;return Object.assign(n,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}class xa{constructor(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(t=>t.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(t=>t.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((t,e)=>t.concat(Array.from(e.values())),[])}bindingConnected(t){this.fetchEventListenerForBinding(t).bindingConnected(t)}bindingDisconnected(t,e=!1){this.fetchEventListenerForBinding(t).bindingDisconnected(t),e&&this.clearEventListenersForBinding(t)}handleError(t,e,s={}){this.application.handleError(t,`Error ${e}`,s)}clearEventListenersForBinding(t){const e=this.fetchEventListenerForBinding(t);e.hasBindings()||(e.disconnect(),this.removeMappedEventListenerFor(t))}removeMappedEventListenerFor(t){const{eventTarget:e,eventName:s,eventOptions:i}=t,r=this.fetchEventListenerMapForEventTarget(e),o=this.cacheKey(s,i);r.delete(o),r.size==0&&this.eventListenerMaps.delete(e)}fetchEventListenerForBinding(t){const{eventTarget:e,eventName:s,eventOptions:i}=t;return this.fetchEventListener(e,s,i)}fetchEventListener(t,e,s){const i=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(e,s);let o=i.get(r);return o||(o=this.createEventListener(t,e,s),i.set(r,o)),o}createEventListener(t,e,s){const i=new Ta(t,e,s);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(t){let e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e}cacheKey(t,e){const s=[t];return Object.keys(e).sort().forEach(i=>{s.push(`${e[i]?"":"!"}${i}`)}),s.join(":")}}const Sa={stop({event:n,value:t}){return t&&n.stopPropagation(),!0},prevent({event:n,value:t}){return t&&n.preventDefault(),!0},self({event:n,value:t,element:e}){return t?e===n.target:!0}},Ma=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Oa(n){const e=n.trim().match(Ma)||[];let s=e[2],i=e[3];return i&&!["keydown","keyup","keypress"].includes(s)&&(s+=`.${i}`,i=""),{eventTarget:Ca(e[4]),eventName:s,eventOptions:e[7]?ka(e[7]):{},identifier:e[5],methodName:e[6],keyFilter:e[1]||i}}function Ca(n){if(n=="window")return window;if(n=="document")return document}function ka(n){return n.split(":").reduce((t,e)=>Object.assign(t,{[e.replace(/^!/,"")]:!/^!/.test(e)}),{})}function Da(n){if(n==window)return"window";if(n==document)return"document"}function Un(n){return n.replace(/(?:[_-])([a-z0-9])/g,(t,e)=>e.toUpperCase())}function gn(n){return Un(n.replace(/--/g,"-").replace(/__/g,"_"))}function de(n){return n.charAt(0).toUpperCase()+n.slice(1)}function lr(n){return n.replace(/([A-Z])/g,(t,e)=>`-${e.toLowerCase()}`)}function La(n){return n.match(/[^\s]+/g)||[]}function ni(n){return n!=null}function bn(n,t){return Object.prototype.hasOwnProperty.call(n,t)}const si=["meta","ctrl","alt","shift"];class Fa{constructor(t,e,s,i){this.element=t,this.index=e,this.eventTarget=s.eventTarget||t,this.eventName=s.eventName||Va(t)||Ee("missing event name"),this.eventOptions=s.eventOptions||{},this.identifier=s.identifier||Ee("missing identifier"),this.methodName=s.methodName||Ee("missing method name"),this.keyFilter=s.keyFilter||"",this.schema=i}static forToken(t,e){return new this(t.element,t.index,Oa(t.content),e)}toString(){const t=this.keyFilter?`.${this.keyFilter}`:"",e=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${t}${e}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(t){if(!this.keyFilter)return!1;const e=this.keyFilter.split("+");if(this.keyFilterDissatisfied(t,e))return!0;const s=e.filter(i=>!si.includes(i))[0];return s?(bn(this.keyMappings,s)||Ee(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[s].toLowerCase()!==t.key.toLowerCase()):!1}shouldIgnoreMouseEvent(t){if(!this.keyFilter)return!1;const e=[this.keyFilter];return!!this.keyFilterDissatisfied(t,e)}get params(){const t={},e=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:s,value:i}of Array.from(this.element.attributes)){const r=s.match(e),o=r&&r[1];o&&(t[Un(o)]=_a(i))}return t}get eventTargetName(){return Da(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(t,e){const[s,i,r,o]=si.map(a=>e.includes(a));return t.metaKey!==s||t.ctrlKey!==i||t.altKey!==r||t.shiftKey!==o}}const ii={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:n=>n.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Va(n){const t=n.tagName.toLowerCase();if(t in ii)return ii[t](n)}function Ee(n){throw new Error(n)}function _a(n){try{return JSON.parse(n)}catch{return n}}class Pa{constructor(t,e){this.context=t,this.action=e}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(t){const e=this.prepareActionEvent(t);this.willBeInvokedByEvent(t)&&this.applyEventModifiers(e)&&this.invokeWithEvent(e)}get eventName(){return this.action.eventName}get method(){const t=this.controller[this.methodName];if(typeof t=="function")return t;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(t){const{element:e}=this.action,{actionDescriptorFilters:s}=this.context.application,{controller:i}=this.context;let r=!0;for(const[o,a]of Object.entries(this.eventOptions))if(o in s){const l=s[o];r=r&&l({name:o,value:a,event:t,element:e,controller:i})}else continue;return r}prepareActionEvent(t){return Object.assign(t,{params:this.action.params})}invokeWithEvent(t){const{target:e,currentTarget:s}=t;try{this.method.call(this.controller,t),this.context.logDebugActivity(this.methodName,{event:t,target:e,currentTarget:s,action:this.methodName})}catch(i){const{identifier:r,controller:o,element:a,index:l}=this,c={identifier:r,controller:o,element:a,index:l,event:t};this.context.handleError(i,`invoking action "${this.action}"`,c)}}willBeInvokedByEvent(t){const e=t.target;return t instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(t)||t instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(t)?!1:this.element===e?!0:e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):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}}class cr{constructor(t,e){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=t,this.started=!1,this.delegate=e,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(t){this.started&&(this.mutationObserver.disconnect(),this.started=!1),t(),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){const t=new Set(this.matchElementsInTree());for(const e of Array.from(this.elements))t.has(e)||this.removeElement(e);for(const e of Array.from(t))this.addElement(e)}}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){t.type=="attributes"?this.processAttributeChange(t.target,t.attributeName):t.type=="childList"&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))}processAttributeChange(t,e){this.elements.has(t)?this.delegate.elementAttributeChanged&&this.matchElement(t)?this.delegate.elementAttributeChanged(t,e):this.removeElement(t):this.matchElement(t)&&this.addElement(t)}processRemovedNodes(t){for(const e of Array.from(t)){const s=this.elementFromNode(e);s&&this.processTree(s,this.removeElement)}}processAddedNodes(t){for(const e of Array.from(t)){const s=this.elementFromNode(e);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}matchElement(t){return this.delegate.matchElement(t)}matchElementsInTree(t=this.element){return this.delegate.matchElementsInTree(t)}processTree(t,e){for(const s of this.matchElementsInTree(t))e.call(this,s)}elementFromNode(t){if(t.nodeType==Node.ELEMENT_NODE)return t}elementIsActive(t){return t.isConnected!=this.element.isConnected?!1:this.element.contains(t)}addElement(t){this.elements.has(t)||this.elementIsActive(t)&&(this.elements.add(t),this.delegate.elementMatched&&this.delegate.elementMatched(t))}removeElement(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(t))}}class ur{constructor(t,e,s){this.attributeName=e,this.delegate=s,this.elementObserver=new cr(t,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(t){return t.hasAttribute(this.attributeName)}matchElementsInTree(t){const e=this.matchElement(t)?[t]:[],s=Array.from(t.querySelectorAll(this.selector));return e.concat(s)}elementMatched(t){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(t,this.attributeName)}elementUnmatched(t){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(t,this.attributeName)}elementAttributeChanged(t,e){this.delegate.elementAttributeValueChanged&&this.attributeName==e&&this.delegate.elementAttributeValueChanged(t,e)}}function Ra(n,t,e){hr(n,t).add(e)}function Ba(n,t,e){hr(n,t).delete(e),Ia(n,t)}function hr(n,t){let e=n.get(t);return e||(e=new Set,n.set(t,e)),e}function Ia(n,t){const e=n.get(t);e!=null&&e.size==0&&n.delete(t)}class yt{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,s)=>e.concat(Array.from(s)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,s)=>e+s.size,0)}add(t,e){Ra(this.valuesByKey,t,e)}delete(t,e){Ba(this.valuesByKey,t,e)}has(t,e){const s=this.valuesByKey.get(t);return s!=null&&s.has(e)}hasKey(t){return this.valuesByKey.has(t)}hasValue(t){return Array.from(this.valuesByKey.values()).some(s=>s.has(t))}getValuesForKey(t){const e=this.valuesByKey.get(t);return e?Array.from(e):[]}getKeysForValue(t){return Array.from(this.valuesByKey).filter(([e,s])=>s.has(t)).map(([e,s])=>e)}}class Na{constructor(t,e,s,i){this._selector=e,this.details=i,this.elementObserver=new cr(t,this),this.delegate=s,this.matchesByElement=new yt}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(t){this._selector=t,this.refresh()}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(t){const{selector:e}=this;if(e){const s=t.matches(e);return this.delegate.selectorMatchElement?s&&this.delegate.selectorMatchElement(t,this.details):s}else return!1}matchElementsInTree(t){const{selector:e}=this;if(e){const s=this.matchElement(t)?[t]:[],i=Array.from(t.querySelectorAll(e)).filter(r=>this.matchElement(r));return s.concat(i)}else return[]}elementMatched(t){const{selector:e}=this;e&&this.selectorMatched(t,e)}elementUnmatched(t){const e=this.matchesByElement.getKeysForValue(t);for(const s of e)this.selectorUnmatched(t,s)}elementAttributeChanged(t,e){const{selector:s}=this;if(s){const i=this.matchElement(t),r=this.matchesByElement.has(s,t);i&&!r?this.selectorMatched(t,s):!i&&r&&this.selectorUnmatched(t,s)}}selectorMatched(t,e){this.delegate.selectorMatched(t,e,this.details),this.matchesByElement.add(e,t)}selectorUnmatched(t,e){this.delegate.selectorUnmatched(t,e,this.details),this.matchesByElement.delete(e,t)}}class $a{constructor(t,e){this.element=t,this.delegate=e,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(const t of this.knownAttributeNames)this.refreshAttribute(t,null)}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){const e=t.attributeName;e&&this.refreshAttribute(e,t.oldValue)}refreshAttribute(t,e){const s=this.delegate.getStringMapKeyForAttribute(t);if(s!=null){this.stringMap.has(t)||this.stringMapKeyAdded(s,t);const i=this.element.getAttribute(t);if(this.stringMap.get(t)!=i&&this.stringMapValueChanged(i,s,e),i==null){const r=this.stringMap.get(t);this.stringMap.delete(t),r&&this.stringMapKeyRemoved(s,t,r)}else this.stringMap.set(t,i)}}stringMapKeyAdded(t,e){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(t,e)}stringMapValueChanged(t,e,s){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(t,e,s)}stringMapKeyRemoved(t,e,s){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(t,e,s)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(t=>t.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class dr{constructor(t,e,s){this.attributeObserver=new ur(t,e,this),this.delegate=s,this.tokensByElement=new yt}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(t){this.attributeObserver.pause(t)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(t){this.tokensMatched(this.readTokensForElement(t))}elementAttributeValueChanged(t){const[e,s]=this.refreshTokensForElement(t);this.tokensUnmatched(e),this.tokensMatched(s)}elementUnmatchedAttribute(t){this.tokensUnmatched(this.tokensByElement.getValuesForKey(t))}tokensMatched(t){t.forEach(e=>this.tokenMatched(e))}tokensUnmatched(t){t.forEach(e=>this.tokenUnmatched(e))}tokenMatched(t){this.delegate.tokenMatched(t),this.tokensByElement.add(t.element,t)}tokenUnmatched(t){this.delegate.tokenUnmatched(t),this.tokensByElement.delete(t.element,t)}refreshTokensForElement(t){const e=this.tokensByElement.getValuesForKey(t),s=this.readTokensForElement(t),i=Ka(e,s).findIndex(([r,o])=>!Ha(r,o));return i==-1?[[],[]]:[e.slice(i),s.slice(i)]}readTokensForElement(t){const e=this.attributeName,s=t.getAttribute(e)||"";return ja(s,t,e)}}function ja(n,t,e){return n.trim().split(/\s+/).filter(s=>s.length).map((s,i)=>({element:t,attributeName:e,content:s,index:i}))}function Ka(n,t){const e=Math.max(n.length,t.length);return Array.from({length:e},(s,i)=>[n[i],t[i]])}function Ha(n,t){return n&&t&&n.index==t.index&&n.content==t.content}class fr{constructor(t,e,s){this.tokenListObserver=new dr(t,e,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(t){const{element:e}=t,{value:s}=this.fetchParseResultForToken(t);s&&(this.fetchValuesByTokenForElement(e).set(t,s),this.delegate.elementMatchedValue(e,s))}tokenUnmatched(t){const{element:e}=t,{value:s}=this.fetchParseResultForToken(t);s&&(this.fetchValuesByTokenForElement(e).delete(t),this.delegate.elementUnmatchedValue(e,s))}fetchParseResultForToken(t){let e=this.parseResultsByToken.get(t);return e||(e=this.parseToken(t),this.parseResultsByToken.set(t,e)),e}fetchValuesByTokenForElement(t){let e=this.valuesByTokenByElement.get(t);return e||(e=new Map,this.valuesByTokenByElement.set(t,e)),e}parseToken(t){try{return{value:this.delegate.parseValueForToken(t)}}catch(e){return{error:e}}}}class Ua{constructor(t,e){this.context=t,this.delegate=e,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new fr(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(t){const e=new Pa(this.context,t);this.bindingsByAction.set(t,e),this.delegate.bindingConnected(e)}disconnectAction(t){const e=this.bindingsByAction.get(t);e&&(this.bindingsByAction.delete(t),this.delegate.bindingDisconnected(e))}disconnectAllActions(){this.bindings.forEach(t=>this.delegate.bindingDisconnected(t,!0)),this.bindingsByAction.clear()}parseValueForToken(t){const e=Fa.forToken(t,this.schema);if(e.identifier==this.identifier)return e}elementMatchedValue(t,e){this.connectAction(e)}elementUnmatchedValue(t,e){this.disconnectAction(e)}}class Wa{constructor(t,e){this.context=t,this.receiver=e,this.stringMapObserver=new $a(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(t){if(t in this.valueDescriptorMap)return this.valueDescriptorMap[t].name}stringMapKeyAdded(t,e){const s=this.valueDescriptorMap[e];this.hasValue(t)||this.invokeChangedCallback(t,s.writer(this.receiver[t]),s.writer(s.defaultValue))}stringMapValueChanged(t,e,s){const i=this.valueDescriptorNameMap[e];t!==null&&(s===null&&(s=i.writer(i.defaultValue)),this.invokeChangedCallback(e,t,s))}stringMapKeyRemoved(t,e,s){const i=this.valueDescriptorNameMap[t];this.hasValue(t)?this.invokeChangedCallback(t,i.writer(this.receiver[t]),s):this.invokeChangedCallback(t,i.writer(i.defaultValue),s)}invokeChangedCallbacksForDefaultValues(){for(const{key:t,name:e,defaultValue:s,writer:i}of this.valueDescriptors)s!=null&&!this.controller.data.has(t)&&this.invokeChangedCallback(e,i(s),void 0)}invokeChangedCallback(t,e,s){const i=`${t}Changed`,r=this.receiver[i];if(typeof r=="function"){const o=this.valueDescriptorNameMap[t];try{const a=o.reader(e);let 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(){const{valueDescriptorMap:t}=this;return Object.keys(t).map(e=>t[e])}get valueDescriptorNameMap(){const t={};return Object.keys(this.valueDescriptorMap).forEach(e=>{const s=this.valueDescriptorMap[e];t[s.name]=s}),t}hasValue(t){const e=this.valueDescriptorNameMap[t],s=`has${de(e.name)}`;return this.receiver[s]}}class za{constructor(t,e){this.context=t,this.delegate=e,this.targetsByName=new yt}start(){this.tokenListObserver||(this.tokenListObserver=new dr(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:t,content:e}){this.scope.containsElement(t)&&this.connectTarget(t,e)}tokenUnmatched({element:t,content:e}){this.disconnectTarget(t,e)}connectTarget(t,e){var s;this.targetsByName.has(e,t)||(this.targetsByName.add(e,t),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetConnected(t,e)))}disconnectTarget(t,e){var s;this.targetsByName.has(e,t)&&(this.targetsByName.delete(e,t),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetDisconnected(t,e)))}disconnectAllTargets(){for(const t of this.targetsByName.keys)for(const e of this.targetsByName.getValuesForKey(t))this.disconnectTarget(e,t)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function fe(n,t){const e=mr(n);return Array.from(e.reduce((s,i)=>(Ya(i,t).forEach(r=>s.add(r)),s),new Set))}function qa(n,t){return mr(n).reduce((s,i)=>(s.push(...Xa(i,t)),s),[])}function mr(n){const t=[];for(;n;)t.push(n),n=Object.getPrototypeOf(n);return t.reverse()}function Ya(n,t){const e=n[t];return Array.isArray(e)?e:[]}function Xa(n,t){const e=n[t];return e?Object.keys(e).map(s=>[s,e[s]]):[]}class Ga{constructor(t,e){this.started=!1,this.context=t,this.delegate=e,this.outletsByName=new yt,this.outletElementsByName=new yt,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(t=>{this.setupSelectorObserverForOutlet(t),this.setupAttributeObserverForOutlet(t)}),this.started=!0,this.dependentContexts.forEach(t=>t.refresh()))}refresh(){this.selectorObserverMap.forEach(t=>t.refresh()),this.attributeObserverMap.forEach(t=>t.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(t=>t.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(t=>t.stop()),this.attributeObserverMap.clear())}selectorMatched(t,e,{outletName:s}){const i=this.getOutlet(t,s);i&&this.connectOutlet(i,t,s)}selectorUnmatched(t,e,{outletName:s}){const i=this.getOutletFromMap(t,s);i&&this.disconnectOutlet(i,t,s)}selectorMatchElement(t,{outletName:e}){const s=this.selector(e),i=this.hasOutlet(t,e),r=t.matches(`[${this.schema.controllerAttribute}~=${e}]`);return s?i&&r&&t.matches(s):!1}elementMatchedAttribute(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}elementAttributeValueChanged(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}elementUnmatchedAttribute(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}connectOutlet(t,e,s){var i;this.outletElementsByName.has(s,e)||(this.outletsByName.add(s,t),this.outletElementsByName.add(s,e),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletConnected(t,e,s)))}disconnectOutlet(t,e,s){var i;this.outletElementsByName.has(s,e)&&(this.outletsByName.delete(s,t),this.outletElementsByName.delete(s,e),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletDisconnected(t,e,s)))}disconnectAllOutlets(){for(const t of this.outletElementsByName.keys)for(const e of this.outletElementsByName.getValuesForKey(t))for(const s of this.outletsByName.getValuesForKey(t))this.disconnectOutlet(s,e,t)}updateSelectorObserverForOutlet(t){const e=this.selectorObserverMap.get(t);e&&(e.selector=this.selector(t))}setupSelectorObserverForOutlet(t){const e=this.selector(t),s=new Na(document.body,e,this,{outletName:t});this.selectorObserverMap.set(t,s),s.start()}setupAttributeObserverForOutlet(t){const e=this.attributeNameForOutletName(t),s=new ur(this.scope.element,e,this);this.attributeObserverMap.set(t,s),s.start()}selector(t){return this.scope.outlets.getSelectorForOutletName(t)}attributeNameForOutletName(t){return this.scope.schema.outletAttributeForScope(this.identifier,t)}getOutletNameFromOutletAttributeName(t){return this.outletDefinitions.find(e=>this.attributeNameForOutletName(e)===t)}get outletDependencies(){const t=new yt;return this.router.modules.forEach(e=>{const s=e.definition.controllerConstructor;fe(s,"outlets").forEach(r=>t.add(r,e.identifier))}),t}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const t=this.dependentControllerIdentifiers;return this.router.contexts.filter(e=>t.includes(e.identifier))}hasOutlet(t,e){return!!this.getOutlet(t,e)||!!this.getOutletFromMap(t,e)}getOutlet(t,e){return this.application.getControllerForElementAndIdentifier(t,e)}getOutletFromMap(t,e){return this.outletsByName.getValuesForKey(e).find(s=>s.element===t)}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}}class Za{constructor(t,e){this.logDebugActivity=(s,i={})=>{const{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=t,this.scope=e,this.controller=new t.controllerConstructor(this),this.bindingObserver=new Ua(this,this.dispatcher),this.valueObserver=new Wa(this,this.controller),this.targetObserver=new za(this,this),this.outletObserver=new Ga(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(t){this.handleError(t,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(t){this.handleError(t,"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(t,e,s={}){const{identifier:i,controller:r,element:o}=this;s=Object.assign({identifier:i,controller:r,element:o},s),this.application.handleError(t,`Error ${e}`,s)}targetConnected(t,e){this.invokeControllerMethod(`${e}TargetConnected`,t)}targetDisconnected(t,e){this.invokeControllerMethod(`${e}TargetDisconnected`,t)}outletConnected(t,e,s){this.invokeControllerMethod(`${gn(s)}OutletConnected`,t,e)}outletDisconnected(t,e,s){this.invokeControllerMethod(`${gn(s)}OutletDisconnected`,t,e)}invokeControllerMethod(t,...e){const s=this.controller;typeof s[t]=="function"&&s[t](...e)}}function Qa(n){return Ja(n,tl(n))}function Ja(n,t){const e=il(n),s=el(n.prototype,t);return Object.defineProperties(e.prototype,s),e}function tl(n){return fe(n,"blessings").reduce((e,s)=>{const i=s(n);for(const r in i){const o=e[r]||{};e[r]=Object.assign(o,i[r])}return e},{})}function el(n,t){return sl(t).reduce((e,s)=>{const i=nl(n,t,s);return i&&Object.assign(e,{[s]:i}),e},{})}function nl(n,t,e){const s=Object.getOwnPropertyDescriptor(n,e);if(!(s&&"value"in s)){const r=Object.getOwnPropertyDescriptor(t,e).value;return s&&(r.get=s.get||r.get,r.set=s.set||r.set),r}}const sl=typeof Object.getOwnPropertySymbols=="function"?n=>[...Object.getOwnPropertyNames(n),...Object.getOwnPropertySymbols(n)]:Object.getOwnPropertyNames,il=(()=>{function n(e){function s(){return Reflect.construct(e,arguments,new.target)}return s.prototype=Object.create(e.prototype,{constructor:{value:s}}),Reflect.setPrototypeOf(s,e),s}function t(){const s=n(function(){this.a.call(this)});return s.prototype.a=function(){},new s}try{return t(),n}catch{return s=>class extends s{}}})();function rl(n){return{identifier:n.identifier,controllerConstructor:Qa(n.controllerConstructor)}}class ol{constructor(t,e){this.application=t,this.definition=rl(e),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(t){const e=this.fetchContextForScope(t);this.connectedContexts.add(e),e.connect()}disconnectContextForScope(t){const e=this.contextsByScope.get(t);e&&(this.connectedContexts.delete(e),e.disconnect())}fetchContextForScope(t){let e=this.contextsByScope.get(t);return e||(e=new Za(this,t),this.contextsByScope.set(t,e)),e}}class al{constructor(t){this.scope=t}has(t){return this.data.has(this.getDataKey(t))}get(t){return this.getAll(t)[0]}getAll(t){const e=this.data.get(this.getDataKey(t))||"";return La(e)}getAttributeName(t){return this.data.getAttributeNameForKey(this.getDataKey(t))}getDataKey(t){return`${t}-class`}get data(){return this.scope.data}}class ll{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(t){const e=this.getAttributeNameForKey(t);return this.element.getAttribute(e)}set(t,e){const s=this.getAttributeNameForKey(t);return this.element.setAttribute(s,e),this.get(t)}has(t){const e=this.getAttributeNameForKey(t);return this.element.hasAttribute(e)}delete(t){if(this.has(t)){const e=this.getAttributeNameForKey(t);return this.element.removeAttribute(e),!0}else return!1}getAttributeNameForKey(t){return`data-${this.identifier}-${lr(t)}`}}class cl{constructor(t){this.warnedKeysByObject=new WeakMap,this.logger=t}warn(t,e,s){let i=this.warnedKeysByObject.get(t);i||(i=new Set,this.warnedKeysByObject.set(t,i)),i.has(e)||(i.add(e),this.logger.warn(s,t))}}function yn(n,t){return`[${n}~="${t}"]`}class ul{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,s)=>e||this.findTarget(s)||this.findLegacyTarget(s),void 0)}findAll(...t){return t.reduce((e,s)=>[...e,...this.findAllTargets(s),...this.findAllLegacyTargets(s)],[])}findTarget(t){const e=this.getSelectorForTargetName(t);return this.scope.findElement(e)}findAllTargets(t){const e=this.getSelectorForTargetName(t);return this.scope.findAllElements(e)}getSelectorForTargetName(t){const e=this.schema.targetAttributeForScope(this.identifier);return yn(e,t)}findLegacyTarget(t){const e=this.getLegacySelectorForTargetName(t);return this.deprecate(this.scope.findElement(e),t)}findAllLegacyTargets(t){const e=this.getLegacySelectorForTargetName(t);return this.scope.findAllElements(e).map(s=>this.deprecate(s,t))}getLegacySelectorForTargetName(t){const e=`${this.identifier}.${t}`;return yn(this.schema.targetAttribute,e)}deprecate(t,e){if(t){const{identifier:s}=this,i=this.schema.targetAttribute,r=this.schema.targetAttributeForScope(s);this.guide.warn(t,`target:${e}`,`Please replace ${i}="${s}.${e}" with ${r}="${e}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return t}get guide(){return this.scope.guide}}class hl{constructor(t,e){this.scope=t,this.controllerElement=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,s)=>e||this.findOutlet(s),void 0)}findAll(...t){return t.reduce((e,s)=>[...e,...this.findAllOutlets(s)],[])}getSelectorForOutletName(t){const e=this.schema.outletAttributeForScope(this.identifier,t);return this.controllerElement.getAttribute(e)}findOutlet(t){const e=this.getSelectorForOutletName(t);if(e)return this.findElement(e,t)}findAllOutlets(t){const e=this.getSelectorForOutletName(t);return e?this.findAllElements(e,t):[]}findElement(t,e){return this.scope.queryElements(t).filter(i=>this.matchesElement(i,t,e))[0]}findAllElements(t,e){return this.scope.queryElements(t).filter(i=>this.matchesElement(i,t,e))}matchesElement(t,e,s){const i=t.getAttribute(this.scope.schema.controllerAttribute)||"";return t.matches(e)&&i.split(" ").includes(s)}}class Wn{constructor(t,e,s,i){this.targets=new ul(this),this.classes=new al(this),this.data=new ll(this),this.containsElement=r=>r.closest(this.controllerSelector)===this.element,this.schema=t,this.element=e,this.identifier=s,this.guide=new cl(i),this.outlets=new hl(this.documentScope,e)}findElement(t){return this.element.matches(t)?this.element:this.queryElements(t).find(this.containsElement)}findAllElements(t){return[...this.element.matches(t)?[this.element]:[],...this.queryElements(t).filter(this.containsElement)]}queryElements(t){return Array.from(this.element.querySelectorAll(t))}get controllerSelector(){return yn(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Wn(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class dl{constructor(t,e,s){this.element=t,this.schema=e,this.delegate=s,this.valueListObserver=new fr(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(t){const{element:e,content:s}=t;return this.parseValueForElementAndIdentifier(e,s)}parseValueForElementAndIdentifier(t,e){const s=this.fetchScopesByIdentifierForElement(t);let i=s.get(e);return i||(i=this.delegate.createScopeForElementAndIdentifier(t,e),s.set(e,i)),i}elementMatchedValue(t,e){const s=(this.scopeReferenceCounts.get(e)||0)+1;this.scopeReferenceCounts.set(e,s),s==1&&this.delegate.scopeConnected(e)}elementUnmatchedValue(t,e){const s=this.scopeReferenceCounts.get(e);s&&(this.scopeReferenceCounts.set(e,s-1),s==1&&this.delegate.scopeDisconnected(e))}fetchScopesByIdentifierForElement(t){let e=this.scopesByIdentifierByElement.get(t);return e||(e=new Map,this.scopesByIdentifierByElement.set(t,e)),e}}class fl{constructor(t){this.application=t,this.scopeObserver=new dl(this.element,this.schema,this),this.scopesByIdentifier=new yt,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((t,e)=>t.concat(e.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(t){this.unloadIdentifier(t.identifier);const e=new ol(this.application,t);this.connectModule(e);const s=t.controllerConstructor.afterLoad;s&&s.call(t.controllerConstructor,t.identifier,this.application)}unloadIdentifier(t){const e=this.modulesByIdentifier.get(t);e&&this.disconnectModule(e)}getContextForElementAndIdentifier(t,e){const s=this.modulesByIdentifier.get(e);if(s)return s.contexts.find(i=>i.element==t)}proposeToConnectScopeForElementAndIdentifier(t,e){const s=this.scopeObserver.parseValueForElementAndIdentifier(t,e);s?this.scopeObserver.elementMatchedValue(s.element,s):console.error(`Couldn't find or create scope for identifier: "${e}" and element:`,t)}handleError(t,e,s){this.application.handleError(t,e,s)}createScopeForElementAndIdentifier(t,e){return new Wn(this.schema,t,e,this.logger)}scopeConnected(t){this.scopesByIdentifier.add(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.connectContextForScope(t)}scopeDisconnected(t){this.scopesByIdentifier.delete(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.disconnectContextForScope(t)}connectModule(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(s=>t.connectContextForScope(s))}disconnectModule(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(s=>t.disconnectContextForScope(s))}}const ml={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:n=>`data-${n}-target`,outletAttributeForScope:(n,t)=>`data-${n}-${t}-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"},ri("abcdefghijklmnopqrstuvwxyz".split("").map(n=>[n,n]))),ri("0123456789".split("").map(n=>[n,n])))};function ri(n){return n.reduce((t,[e,s])=>Object.assign(Object.assign({},t),{[e]:s}),{})}class pl{constructor(t=document.documentElement,e=ml){this.logger=console,this.debug=!1,this.logDebugActivity=(s,i,r={})=>{this.debug&&this.logFormattedMessage(s,i,r)},this.element=t,this.schema=e,this.dispatcher=new xa(this),this.router=new fl(this),this.actionDescriptorFilters=Object.assign({},Sa)}static start(t,e){const s=new this(t,e);return s.start(),s}async start(){await gl(),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(t,e){this.load({identifier:t,controllerConstructor:e})}registerActionOption(t,e){this.actionDescriptorFilters[t]=e}load(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(i=>{i.controllerConstructor.shouldLoad&&this.router.loadDefinition(i)})}unload(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(i=>this.router.unloadIdentifier(i))}get controllers(){return this.router.contexts.map(t=>t.controller)}getControllerForElementAndIdentifier(t,e){const s=this.router.getContextForElementAndIdentifier(t,e);return s?s.controller:null}handleError(t,e,s){var i;this.logger.error(`%s
|
95
95
|
|
96
96
|
%o
|
97
97
|
|
98
|
-
%o`,e,t,s),(i=window.onerror)===null||i===void 0||i.call(window,e,"",0,0,t)}logFormattedMessage(t,e,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${t} #${e}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}}function dl(){return new Promise(n=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>n()):n()})}function fl(n){return fe(n,"classes").reduce((e,s)=>Object.assign(e,ml(s)),{})}function ml(n){return{[`${n}Class`]:{get(){const{classes:t}=this;if(t.has(n))return t.get(n);{const e=t.getAttributeName(n);throw new Error(`Missing attribute "${e}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${de(n)}Class`]:{get(){return this.classes.has(n)}}}}function pl(n){return fe(n,"outlets").reduce((e,s)=>Object.assign(e,gl(s)),{})}function ni(n,t,e){return n.application.getControllerForElementAndIdentifier(t,e)}function si(n,t,e){let s=ni(n,t,e);if(s||(n.application.router.proposeToConnectScopeForElementAndIdentifier(t,e),s=ni(n,t,e),s))return s}function gl(n){const t=gn(n);return{[`${t}Outlet`]:{get(){const e=this.outlets.find(n),s=this.outlets.getSelectorForOutletName(n);if(e){const i=si(this,e,n);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${n}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${n}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${t}Outlets`]:{get(){const e=this.outlets.findAll(n);return e.length>0?e.map(s=>{const i=si(this,s,n);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${n}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${t}OutletElement`]:{get(){const e=this.outlets.find(n),s=this.outlets.getSelectorForOutletName(n);if(e)return e;throw new Error(`Missing outlet element "${n}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(n)}},[`has${de(t)}Outlet`]:{get(){return this.outlets.has(n)}}}}function bl(n){return fe(n,"targets").reduce((e,s)=>Object.assign(e,yl(s)),{})}function yl(n){return{[`${n}Target`]:{get(){const t=this.targets.find(n);if(t)return t;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${de(n)}Target`]:{get(){return this.targets.has(n)}}}}function vl(n){const t=Ha(n,"values"),e={valueDescriptorMap:{get(){return t.reduce((s,i)=>{const r=hr(i,this.identifier),o=this.data.getAttributeNameForKey(r.key);return Object.assign(s,{[o]:r})},{})}}};return t.reduce((s,i)=>Object.assign(s,wl(i)),e)}function wl(n,t){const e=hr(n,t),{key:s,name:i,reader:r,writer:o}=e;return{[i]:{get(){const a=this.data.get(s);return a!==null?r(a):e.defaultValue},set(a){a===void 0?this.data.delete(s):this.data.set(s,o(a))}},[`has${de(i)}`]:{get(){return this.data.has(s)||e.hasCustomDefaultValue}}}}function hr([n,t],e){return xl({controller:e,token:n,typeDefinition:t})}function Le(n){switch(n){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function oe(n){switch(typeof n){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(n))return"array";if(Object.prototype.toString.call(n)==="[object Object]")return"object"}function El(n){const{controller:t,token:e,typeObject:s}=n,i=Qs(s.type),r=Qs(s.default),o=i&&r,a=i&&!r,l=!i&&r,c=Le(s.type),u=oe(n.typeObject.default);if(a)return c;if(l)return u;if(c!==u){const h=t?`${t}.${e}`:e;throw new Error(`The specified default value for the Stimulus Value "${h}" must match the defined type "${c}". The provided default value of "${s.default}" is of type "${u}".`)}if(o)return c}function Tl(n){const{controller:t,token:e,typeDefinition:s}=n,r=El({controller:t,token:e,typeObject:s}),o=oe(s),a=Le(s),l=r||o||a;if(l)return l;const c=t?`${t}.${s}`:e;throw new Error(`Unknown value type "${c}" for "${e}" value`)}function Al(n){const t=Le(n);if(t)return ii[t];const e=bn(n,"default"),s=bn(n,"type"),i=n;if(e)return i.default;if(s){const{type:r}=i,o=Le(r);if(o)return ii[o]}return n}function xl(n){const{token:t,typeDefinition:e}=n,s=`${ir(t)}-value`,i=Tl(n);return{type:i,key:s,name:Kn(s),get defaultValue(){return Al(e)},get hasCustomDefaultValue(){return oe(e)!==void 0},reader:Sl[i],writer:ri[i]||ri.default}}const ii={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Sl={array(n){const t=JSON.parse(n);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${n}" of type "${oe(t)}"`);return t},boolean(n){return!(n=="0"||String(n).toLowerCase()=="false")},number(n){return Number(n.replace(/_/g,""))},object(n){const t=JSON.parse(n);if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${n}" of type "${oe(t)}"`);return t},string(n){return n}},ri={default:Ml,array:oi,object:oi};function oi(n){return JSON.stringify(n)}function Ml(n){return`${n}`}let ut=class{constructor(t){this.context=t}static get shouldLoad(){return!0}static afterLoad(t,e){}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(t,{target:e=this.element,detail:s={},prefix:i=this.identifier,bubbles:r=!0,cancelable:o=!0}={}){const a=i?`${i}:${t}`:t,l=new CustomEvent(a,{detail:s,bubbles:r,cancelable:o});return e.dispatchEvent(l),l}};ut.blessings=[fl,bl,vl,pl];ut.targets=[];ut.outlets=[];ut.values={};function I(){return function({targets:t,values:e}={}){const i=class i extends ut{dispatchEvent(o,a,l={}){const c=new Event(a,{bubbles:l.bubbles||!1,cancelable:l.cancelable||!1});o.dispatchEvent(c)}};i.targets=Object.keys(t??{}),i.values=e??{};let s=i;return s}}class Ol extends I()({targets:{toggle:HTMLInputElement},values:{formMethod:String,formUrl:String,csrfToken:String,turbo:Boolean}}){connect(){this.toggling=!1}requiresFormSubmit(){return this.formUrlValue!=null}async toggle(){if(!this.toggling&&(this.toggling=!0,!this.isDisabled())){if(!this.requiresFormSubmit()){this.performToggle(),this.toggling=!1;return}this.performToggle();try{await this.submitForm()}catch(t){t instanceof Error&&this.performToggle();return}finally{this.toggling=!1}}}performToggle(){this.isOn()?this.turnOff():this.turnOn()}turnOn(){this.isDisabled()||this.toggleTarget.setAttribute("aria-pressed","true")}turnOff(){this.isDisabled()||this.toggleTarget.setAttribute("aria-pressed","false")}isOn(){return this.toggleTarget.getAttribute("aria-pressed")==="true"}isOff(){return!this.isOn()}isDisabled(){return this.toggleTarget.getAttribute("disabled")!=null}async submitForm(){const t=new FormData,e=this.documentCsrfToken()||this.csrfTokenValue;if(e&&t.append(this.csrfField(),e),t.append(this.toggleTarget.name,this.isOn()?"true":"false"),!this.formUrlValue)throw new Error("invalid src");let s;const i={"Requested-With":"XMLHttpRequest"};this.turboValue&&(i.Accept="text/vnd.turbo-stream.html");try{s=await fetch(this.formUrlValue,{credentials:"same-origin",method:this.formMethodValue,headers:i,body:t})}catch(o){throw new Error(`A network error occurred, please try again: ${o.message}`)}if(!s.ok)throw new Error(await s.text());const r=s.headers.get("Content-Type");window.Turbo&&this.turbo&&(r!=null&&r.startsWith("text/vnd.turbo-stream.html"))&&window.Turbo.renderStreamMessage(await s.text())}csrfField(){return this.toggleTarget.getAttribute("csrf-field")||"authenticity_token"}documentCsrfToken(){const t=document.querySelector("meta[name=csrf-token]");return t&&t.getAttribute("content")}}const Cl=Object.freeze(Object.defineProperty({__proto__:null,default:Ol},Symbol.toStringTag,{value:"Module"})),vs=class vs extends I()({targets:{content:HTMLElement,chevron:HTMLElement},values:{open:{type:Boolean,default:!1}}}){connect(){this.applyState(this.openValue)}toggle(t){t&&t.stopPropagation(),this.openValue=!this.openValue}openValueChanged(t){this.applyState(t)}applyState(t){const e=this.contentTarget,s=this.hasChevronTarget?this.chevronTarget:null,i=e.scrollHeight;t?(e.classList.add("ariadne:animate-accordion-down"),e.classList.remove("ariadne:animate-accordion-up"),e.style.height=`${i}px`,this.element.classList.add("ariadne-sidebar-group-open"),this.element.classList.remove("ariadne-sidebar-group-closed"),s&&s.classList.add("ariadne:rotate-90"),setTimeout(()=>{this.openValue&&(e.style.height="auto")},200)):(e.classList.add("ariadne:animate-accordion-up"),e.classList.remove("ariadne:animate-accordion-down"),e.style.height=`${i}px`,e.offsetHeight,e.style.height="0px",this.element.classList.add("ariadne-sidebar-group-closed"),this.element.classList.remove("ariadne-sidebar-group-open"),s&&s.classList.remove("ariadne:rotate-90"))}};vs.classes=["open","closed"];let vn=vs;const kl=Object.freeze(Object.defineProperty({__proto__:null,default:vn},Symbol.toStringTag,{value:"Module"})),Et=n=>n;let dr=Et;function Ll(n,t){n.indexOf(t)===-1&&n.push(t)}function fr(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}class mr{constructor(){this.subscriptions=[]}add(t){return Ll(this.subscriptions,t),()=>fr(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,e,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function pr(n,t){return t?n*(1e3/t):0}const Fl={useManualTiming:!1},Te=["read","resolveKeyframes","update","preRender","render","postRender"];function Dl(n,t){let e=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),n()),u(a)}const c={schedule:(u,h=!1,d=!1)=>{const f=d&&i?e:s;return h&&o.add(u),f.has(u)||f.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[e,s]=[s,e],e.forEach(l),e.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const Vl=40;function _l(n,t){let e=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>e=!0,o=Te.reduce((p,v)=>(p[v]=Dl(r),p),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:h,postRender:d}=o,m=()=>{const p=performance.now();e=!1,i.delta=s?1e3/60:Math.max(Math.min(p-i.timestamp,Vl),1),i.timestamp=p,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),i.isProcessing=!1,e&&t&&(s=!1,n(m))},f=()=>{e=!0,s=!0,i.isProcessing||n(m)};return{schedule:Te.reduce((p,v)=>{const E=o[v];return p[v]=(w,y=!1,T=!1)=>(e||f(),E.schedule(w,y,T)),p},{}),cancel:p=>{for(let v=0;v<Te.length;v++)o[Te[v]].cancel(p)},state:i,steps:o}}const{schedule:Z,cancel:wn,state:Fe}=_l(typeof requestAnimationFrame<"u"?requestAnimationFrame:Et,!0);let Ce;function Pl(){Ce=void 0}const ot={now:()=>(Ce===void 0&&ot.set(Fe.isProcessing||Fl.useManualTiming?Fe.timestamp:performance.now()),Ce),set:n=>{Ce=n,queueMicrotask(Pl)}},ai=30,Bl=n=>!isNaN(parseFloat(n));class Rl{constructor(t,e={}){this.version="12.6.1",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=ot.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=ot.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Bl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new mr);const s=this.events[t].add(e);return t==="change"?()=>{s(),Z.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){!e||!this.passiveEffect?this.updateAndNotify(t,e):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ot.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ai)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,ai);return pr(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ae(n,t){return new Rl(n,t)}function Il(n,t,e){var s;if(n instanceof EventTarget)return[n];if(typeof n=="string"){let i=document;const r=(s=e==null?void 0:e[n])!==null&&s!==void 0?s:i.querySelectorAll(n);return r?Array.from(r):[]}return Array.from(n)}const We=(n,t,e)=>{const s=t-n;return s===0?1:(e-n)/s};function Un(n){let t;return()=>(t===void 0&&(t=n()),t)}const Nl=Un(()=>window.ScrollTimeline!==void 0);class $l{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=e}attachTimeline(t,e){const s=this.animations.map(i=>{if(Nl()&&i.attachTimeline)return i.attachTimeline(t);if(typeof e=="function")return e(i)});return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class gr extends $l{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}const nt=n=>n*1e3,st=n=>n/1e3,De=2e4;function Wn(n){let t=0;const e=50;let s=n.next(t);for(;!s.done&&t<De;)t+=e,s=n.next(t);return t>=De?1/0:t}const br=(n,t,e=10)=>{let s="";const i=Math.max(Math.round(t/e),2);for(let r=0;r<i;r++)s+=n(We(0,i-1,r))+", ";return`linear(${s.substring(0,s.length-2)})`},Tt=(n,t,e)=>e>t?t:e<n?n:e,jl=5;function yr(n,t,e){const s=Math.max(t-jl,0);return pr(e-n(s),t-s)}const C={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},li=.001;function Kl({duration:n=C.duration,bounce:t=C.bounce,velocity:e=C.velocity,mass:s=C.mass}){let i,r,o=1-t;o=Tt(C.minDamping,C.maxDamping,o),n=Tt(C.minDuration,C.maxDuration,st(n)),o<1?(i=c=>{const u=c*o,h=u*n,d=u-e,m=En(c,o),f=Math.exp(-h);return li-d/m*f},r=c=>{const h=c*o*n,d=h*e+e,m=Math.pow(o,2)*Math.pow(c,2)*n,f=Math.exp(-h),g=En(Math.pow(c,2),o);return(-i(c)+li>0?-1:1)*((d-m)*f)/g}):(i=c=>{const u=Math.exp(-c*n),h=(c-e)*n+1;return-.001+u*h},r=c=>{const u=Math.exp(-c*n),h=(e-c)*(n*n);return u*h});const a=5/n,l=Ul(i,r,a);if(n=nt(n),isNaN(l))return{stiffness:C.stiffness,damping:C.damping,duration:n};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:n}}}const Hl=12;function Ul(n,t,e){let s=e;for(let i=1;i<Hl;i++)s=s-n(s)/t(s);return s}function En(n,t){return n*Math.sqrt(1-t*t)}const Wl=["duration","bounce"],zl=["stiffness","damping","mass"];function ci(n,t){return t.some(e=>n[e]!==void 0)}function ql(n){let t={velocity:C.velocity,stiffness:C.stiffness,damping:C.damping,mass:C.mass,isResolvedFromDuration:!1,...n};if(!ci(n,zl)&&ci(n,Wl))if(n.visualDuration){const e=n.visualDuration,s=2*Math.PI/(e*1.2),i=s*s,r=2*Tt(.05,1,1-(n.bounce||0))*Math.sqrt(i);t={...t,mass:C.mass,stiffness:i,damping:r}}else{const e=Kl(n);t={...t,...e,mass:C.mass},t.isResolvedFromDuration=!0}return t}function zn(n=C.visualDuration,t=C.bounce){const e=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:t}:n;let{restSpeed:s,restDelta:i}=e;const r=e.keyframes[0],o=e.keyframes[e.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:m}=ql({...e,velocity:-st(e.velocity||0)}),f=d||0,g=c/(2*Math.sqrt(l*u)),b=o-r,p=st(Math.sqrt(l/u)),v=Math.abs(b)<5;s||(s=v?C.restSpeed.granular:C.restSpeed.default),i||(i=v?C.restDelta.granular:C.restDelta.default);let E;if(g<1){const y=En(p,g);E=T=>{const S=Math.exp(-g*p*T);return o-S*((f+g*p*b)/y*Math.sin(y*T)+b*Math.cos(y*T))}}else if(g===1)E=y=>o-Math.exp(-p*y)*(b+(f+p*b)*y);else{const y=p*Math.sqrt(g*g-1);E=T=>{const S=Math.exp(-g*p*T),A=Math.min(y*T,300);return o-S*((f+g*p*b)*Math.sinh(A)+y*b*Math.cosh(A))/y}}const w={calculatedDuration:m&&h||null,next:y=>{const T=E(y);if(m)a.done=y>=h;else{let S=0;g<1&&(S=y===0?nt(f):yr(E,y,T));const A=Math.abs(S)<=s,M=Math.abs(o-T)<=i;a.done=A&&M}return a.value=a.done?o:T,a},toString:()=>{const y=Math.min(Wn(w),De),T=br(S=>w.next(y*S).value,y,30);return y+"ms "+T}};return w}function Yl(n,t=100,e){const s=e({...n,keyframes:[0,t]}),i=Math.min(Wn(s),De);return{type:"keyframes",ease:r=>s.next(i*r).value/t,duration:st(i)}}function ze(n){return typeof n=="function"}const Xl=(n,t,e)=>{const s=t-n;return((e-n)%s+s)%s+n},vr=n=>Array.isArray(n)&&typeof n[0]!="number";function wr(n,t){return vr(n)?n[Xl(0,n.length,t)]:n}const me=(n,t,e)=>n+(t-n)*e;function Er(n,t){const e=n[n.length-1];for(let s=1;s<=t;s++){const i=We(0,t,s);n.push(me(e,1,i))}}function Tr(n){const t=[0];return Er(t,n.length-1),t}const P=n=>!!(n&&n.getVelocity);function qn(n){return typeof n=="object"&&!Array.isArray(n)}function Ar(n,t,e,s){return typeof n=="string"&&qn(t)?Il(n,e,s):n instanceof NodeList?Array.from(n):Array.isArray(n)?n:[n]}function Gl(n,t,e){return n*(t+1)}function ui(n,t,e,s){var i;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,n+parseFloat(t)):t==="<"?e:(i=s.get(t))!==null&&i!==void 0?i:n}function Zl(n,t,e){for(let s=0;s<n.length;s++){const i=n[s];i.at>t&&i.at<e&&(fr(n,i),s--)}}function Ql(n,t,e,s,i,r){Zl(n,i,r);for(let o=0;o<t.length;o++)n.push({value:t[o],at:me(i,r,s[o]),easing:wr(e,o)})}function Jl(n,t){for(let e=0;e<n.length;e++)n[e]=n[e]/(t+1)}function tc(n,t){return n.at===t.at?n.value===null?1:t.value===null?-1:0:n.at-t.at}const ec="easeInOut";function nc(n,{defaultTransition:t={},...e}={},s,i){const r=t.duration||.3,o=new Map,a=new Map,l={},c=new Map;let u=0,h=0,d=0;for(let m=0;m<n.length;m++){const f=n[m];if(typeof f=="string"){c.set(f,h);continue}else if(!Array.isArray(f)){c.set(f.name,ui(h,f.at,u,c));continue}let[g,b,p={}]=f;p.at!==void 0&&(h=ui(h,p.at,u,c));let v=0;const E=(w,y,T,S=0,A=0)=>{const M=sc(w),{delay:O=0,times:F=Tr(M),type:R="keyframes",repeat:N,repeatType:V,repeatDelay:ht=0,...W}=y;let{ease:D=t.ease||"easeOut",duration:L}=y;const z=typeof O=="function"?O(S,A):O,ye=M.length,ws=ze(R)?R:i==null?void 0:i[R];if(ye<=2&&ws){let Ht=100;if(ye===2&&oc(M)){const Ut=M[1]-M[0];Ht=Math.abs(Ut)}const ve={...W};L!==void 0&&(ve.duration=nt(L));const we=Yl(ve,Ht,ws);D=we.ease,L=we.duration}L??(L=r);const Es=h+z;F.length===1&&F[0]===0&&(F[1]=1);const Ts=F.length-M.length;if(Ts>0&&Er(F,Ts),M.length===1&&M.unshift(null),N){L=Gl(L,N);const Ht=[...M],ve=[...F];D=Array.isArray(D)?[...D]:[D];const we=[...D];for(let Ut=0;Ut<N;Ut++){M.push(...Ht);for(let Wt=0;Wt<Ht.length;Wt++)F.push(ve[Wt]+(Ut+1)),D.push(Wt===0?"linear":wr(we,Wt-1))}Jl(F,N)}const As=Es+L;Ql(T,M,D,F,Es,As),v=Math.max(z+L,v),d=Math.max(As,d)};if(P(g)){const w=hi(g,a);E(b,p,di("default",w))}else{const w=Ar(g,b,s,l),y=w.length;for(let T=0;T<y;T++){b=b,p=p;const S=w[T],A=hi(S,a);for(const M in b)E(b[M],ic(p,M),di(M,A),T,y)}}u=h,h+=v}return a.forEach((m,f)=>{for(const g in m){const b=m[g];b.sort(tc);const p=[],v=[],E=[];for(let y=0;y<b.length;y++){const{at:T,value:S,easing:A}=b[y];p.push(S),v.push(We(0,d,T)),E.push(A||"easeOut")}v[0]!==0&&(v.unshift(0),p.unshift(p[0]),E.unshift(ec)),v[v.length-1]!==1&&(v.push(1),p.push(null)),o.has(f)||o.set(f,{keyframes:{},transition:{}});const w=o.get(f);w.keyframes[g]=p,w.transition[g]={...t,duration:d,ease:E,times:v,...e}}}),o}function hi(n,t){return!t.has(n)&&t.set(n,{}),t.get(n)}function di(n,t){return t[n]||(t[n]=[]),t[n]}function sc(n){return Array.isArray(n)?n:[n]}function ic(n,t){return n&&n[t]?{...n,...n[t]}:{...n}}const rc=n=>typeof n=="number",oc=n=>n.every(rc),le=new WeakMap;function xr(n,t){return n?n[t]||n.default||n:void 0}const Bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Rt=new Set(Bt),Sr=new Set(["width","height","top","left","right","bottom",...Bt]),ac=n=>Array.isArray(n),lc=n=>ac(n)?n[n.length-1]||0:n;function fi(n){const t=[{},{}];return n==null||n.values.forEach((e,s)=>{t[0][s]=e.get(),t[1][s]=e.getVelocity()}),t}function Mr(n,t,e,s){if(typeof t=="function"){const[i,r]=fi(s);t=t(e!==void 0?e:n.custom,i,r)}if(typeof t=="string"&&(t=n.variants&&n.variants[t]),typeof t=="function"){const[i,r]=fi(s);t=t(e!==void 0?e:n.custom,i,r)}return t}function cc(n,t,e){const s=n.getProps();return Mr(s,t,s.custom,n)}function uc(n,t,e){n.hasValue(t)?n.getValue(t).set(e):n.addValue(t,ae(e))}function hc(n,t){const e=cc(n,t);let{transitionEnd:s={},transition:i={},...r}=e||{};r={...r,...s};for(const o in r){const a=lc(r[o]);uc(n,o,a)}}function dc(n){return!!(P(n)&&n.add)}function fc(n,t){const e=n.getValue("willChange");if(dc(e))return e.add(t)}const Yn=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),mc="framerAppearId",pc="data-"+Yn(mc);function gc(n){return n.props[pc]}function mi(n,t){n.timeline=t,n.onfinish=null}const Xn=n=>Array.isArray(n)&&typeof n[0]=="number",bc={linearEasing:void 0};function yc(n,t){const e=Un(n);return()=>{var s;return(s=bc[t])!==null&&s!==void 0?s:e()}}const Ve=yc(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function Or(n){return!!(typeof n=="function"&&Ve()||!n||typeof n=="string"&&(n in Tn||Ve())||Xn(n)||Array.isArray(n)&&n.every(Or))}const Qt=([n,t,e,s])=>`cubic-bezier(${n}, ${t}, ${e}, ${s})`,Tn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qt([0,.65,.55,1]),circOut:Qt([.55,0,1,.45]),backIn:Qt([.31,.01,.66,-.59]),backOut:Qt([.33,1.53,.69,.99])};function Cr(n,t){if(n)return typeof n=="function"&&Ve()?br(n,t):Xn(n)?Qt(n):Array.isArray(n)?n.map(e=>Cr(e,t)||Tn.easeOut):Tn[n]}const kr=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n,vc=1e-7,wc=12;function Ec(n,t,e,s,i){let r,o,a=0;do o=t+(e-t)/2,r=kr(o,s,i)-n,r>0?e=o:t=o;while(Math.abs(r)>vc&&++a<wc);return o}function pe(n,t,e,s){if(n===t&&e===s)return Et;const i=r=>Ec(r,0,1,n,e);return r=>r===0||r===1?r:kr(i(r),t,s)}const Lr=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,Fr=n=>t=>1-n(1-t),Dr=pe(.33,1.53,.69,.99),Gn=Fr(Dr),Vr=Lr(Gn),_r=n=>(n*=2)<1?.5*Gn(n):.5*(2-Math.pow(2,-10*(n-1))),Zn=n=>1-Math.sin(Math.acos(n)),Tc=Fr(Zn),Pr=Lr(Zn),Br=n=>/^0[^.\s]+$/u.test(n);function Ac(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Br(n):!0}const It={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},ce={...It,transform:n=>Tt(0,1,n)},Ae={...It,default:1},ne=n=>Math.round(n*1e5)/1e5,Qn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xc(n){return n==null}const Sc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Jn=(n,t)=>e=>!!(typeof e=="string"&&Sc.test(e)&&e.startsWith(n)||t&&!xc(e)&&Object.prototype.hasOwnProperty.call(e,t)),Rr=(n,t,e)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Qn);return{[n]:parseFloat(i),[t]:parseFloat(r),[e]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Mc=n=>Tt(0,255,n),sn={...It,transform:n=>Math.round(Mc(n))},gt={test:Jn("rgb","red"),parse:Rr("red","green","blue"),transform:({red:n,green:t,blue:e,alpha:s=1})=>"rgba("+sn.transform(n)+", "+sn.transform(t)+", "+sn.transform(e)+", "+ne(ce.transform(s))+")"};function Oc(n){let t="",e="",s="",i="";return n.length>5?(t=n.substring(1,3),e=n.substring(3,5),s=n.substring(5,7),i=n.substring(7,9)):(t=n.substring(1,2),e=n.substring(2,3),s=n.substring(3,4),i=n.substring(4,5),t+=t,e+=e,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(e,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const An={test:Jn("#"),parse:Oc,transform:gt.transform},ge=n=>({test:t=>typeof t=="string"&&t.endsWith(n)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${n}`}),it=ge("deg"),Ft=ge("%"),x=ge("px"),Cc=ge("vh"),kc=ge("vw"),pi={...Ft,parse:n=>Ft.parse(n)/100,transform:n=>Ft.transform(n*100)},Ot={test:Jn("hsl","hue"),parse:Rr("hue","saturation","lightness"),transform:({hue:n,saturation:t,lightness:e,alpha:s=1})=>"hsla("+Math.round(n)+", "+Ft.transform(ne(t))+", "+Ft.transform(ne(e))+", "+ne(ce.transform(s))+")"},_={test:n=>gt.test(n)||An.test(n)||Ot.test(n),parse:n=>gt.test(n)?gt.parse(n):Ot.test(n)?Ot.parse(n):An.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?gt.transform(n):Ot.transform(n)},Lc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Fc(n){var t,e;return isNaN(n)&&typeof n=="string"&&(((t=n.match(Qn))===null||t===void 0?void 0:t.length)||0)+(((e=n.match(Lc))===null||e===void 0?void 0:e.length)||0)>0}const Ir="number",Nr="color",Dc="var",Vc="var(",gi="${}",_c=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ue(n){const t=n.toString(),e=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=t.replace(_c,l=>(_.test(l)?(s.color.push(r),i.push(Nr),e.push(_.parse(l))):l.startsWith(Vc)?(s.var.push(r),i.push(Dc),e.push(l)):(s.number.push(r),i.push(Ir),e.push(parseFloat(l))),++r,gi)).split(gi);return{values:e,split:a,indexes:s,types:i}}function $r(n){return ue(n).values}function jr(n){const{split:t,types:e}=ue(n),s=t.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=t[o],i[o]!==void 0){const a=e[o];a===Ir?r+=ne(i[o]):a===Nr?r+=_.transform(i[o]):r+=i[o]}return r}}const Pc=n=>typeof n=="number"?0:n;function Bc(n){const t=$r(n);return jr(n)(t.map(Pc))}const Nt={test:Fc,parse:$r,createTransformer:jr,getAnimatableNone:Bc},Rc=new Set(["brightness","contrast","saturate","opacity"]);function Ic(n){const[t,e]=n.slice(0,-1).split("(");if(t==="drop-shadow")return n;const[s]=e.match(Qn)||[];if(!s)return n;const i=e.replace(s,"");let r=Rc.has(t)?1:0;return s!==e&&(r*=100),t+"("+r+i+")"}const Nc=/\b([a-z-]*)\(.*?\)/gu,xn={...Nt,getAnimatableNone:n=>{const t=n.match(Nc);return t?t.map(Ic).join(" "):n}},$c={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,backgroundPositionX:x,backgroundPositionY:x},jc={rotate:it,rotateX:it,rotateY:it,rotateZ:it,scale:Ae,scaleX:Ae,scaleY:Ae,scaleZ:Ae,skew:it,skewX:it,skewY:it,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:ce,originX:pi,originY:pi,originZ:x},bi={...It,transform:Math.round},ts={...$c,...jc,zIndex:bi,size:x,fillOpacity:ce,strokeOpacity:ce,numOctaves:bi},Kc={...ts,color:_,backgroundColor:_,outlineColor:_,fill:_,stroke:_,borderColor:_,borderTopColor:_,borderRightColor:_,borderBottomColor:_,borderLeftColor:_,filter:xn,WebkitFilter:xn},Kr=n=>Kc[n];function Hr(n,t){let e=Kr(n);return e!==xn&&(e=Nt),e.getAnimatableNone?e.getAnimatableNone(t):void 0}const Hc=new Set(["auto","none","0"]);function Uc(n,t,e){let s=0,i;for(;s<n.length&&!i;){const r=n[s];typeof r=="string"&&!Hc.has(r)&&ue(r).values.length&&(i=n[s]),s++}if(i&&e)for(const r of t)n[r]=Hr(e,i)}const bt=n=>n*180/Math.PI,Sn=n=>{const t=bt(Math.atan2(n[1],n[0]));return Mn(t)},Wc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:Sn,rotateZ:Sn,skewX:n=>bt(Math.atan(n[1])),skewY:n=>bt(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},Mn=n=>(n=n%360,n<0&&(n+=360),n),yi=Sn,vi=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),wi=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),zc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vi,scaleY:wi,scale:n=>(vi(n)+wi(n))/2,rotateX:n=>Mn(bt(Math.atan2(n[6],n[5]))),rotateY:n=>Mn(bt(Math.atan2(-n[2],n[0]))),rotateZ:yi,rotate:yi,skewX:n=>bt(Math.atan(n[4])),skewY:n=>bt(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function Ei(n){return n.includes("scale")?1:0}function On(n,t){if(!n||n==="none")return Ei(t);const e=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(e)s=zc,i=e;else{const a=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Wc,i=a}if(!i)return Ei(t);const r=s[t],o=i[1].split(",").map(Yc);return typeof r=="function"?r(o):o[r]}const qc=(n,t)=>{const{transform:e="none"}=getComputedStyle(n);return On(e,t)};function Yc(n){return parseFloat(n.trim())}const Ti=n=>n===It||n===x,Xc=new Set(["x","y","z"]),Gc=Bt.filter(n=>!Xc.has(n));function Zc(n){const t=[];return Gc.forEach(e=>{const s=n.getValue(e);s!==void 0&&(t.push([e,s.get()]),s.set(e.startsWith("scale")?1:0))}),t}const _t={width:({x:n},{paddingLeft:t="0",paddingRight:e="0"})=>n.max-n.min-parseFloat(t)-parseFloat(e),height:({y:n},{paddingTop:t="0",paddingBottom:e="0"})=>n.max-n.min-parseFloat(t)-parseFloat(e),top:(n,{top:t})=>parseFloat(t),left:(n,{left:t})=>parseFloat(t),bottom:({y:n},{top:t})=>parseFloat(t)+(n.max-n.min),right:({x:n},{left:t})=>parseFloat(t)+(n.max-n.min),x:(n,{transform:t})=>On(t,"x"),y:(n,{transform:t})=>On(t,"y")};_t.translateX=_t.x;_t.translateY=_t.y;const vt=new Set;let Cn=!1,kn=!1;function Ur(){if(kn){const n=Array.from(vt).filter(s=>s.needsMeasurement),t=new Set(n.map(s=>s.element)),e=new Map;t.forEach(s=>{const i=Zc(s);i.length&&(e.set(s,i),s.render())}),n.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=e.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),n.forEach(s=>s.measureEndState()),n.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}kn=!1,Cn=!1,vt.forEach(n=>n.complete()),vt.clear()}function Wr(){vt.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(kn=!0)})}function Qc(){Wr(),Ur()}class es{constructor(t,e,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(vt.add(this),Cn||(Cn=!0,Z.read(Wr),Z.resolveKeyframes(Ur))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:i}=this;for(let r=0;r<t.length;r++)if(t[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&e){const l=s.readValue(e,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),vt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,vt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const zr=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),qr=n=>t=>typeof t=="string"&&t.startsWith(n),Yr=qr("--"),Jc=qr("var(--"),ns=n=>Jc(n)?tu.test(n.split("/*")[0].trim()):!1,tu=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,eu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function nu(n){const t=eu.exec(n);if(!t)return[,];const[,e,s,i]=t;return[`--${e??s}`,i]}function Xr(n,t,e=1){const[s,i]=nu(n);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const o=r.trim();return zr(o)?parseFloat(o):o}return ns(i)?Xr(i,t,e+1):i}const Gr=n=>t=>t.test(n),su={test:n=>n==="auto",parse:n=>n},Zr=[It,x,Ft,it,kc,Cc,su],Ai=n=>Zr.find(Gr(n));class Qr extends es{constructor(t,e,s,i,r){super(t,e,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:s}=this;if(!e||!e.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),ns(c))){const u=Xr(c,e.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Sr.has(s)||t.length!==2)return;const[i,r]=t,o=Ai(i),a=Ai(r);if(o!==a)if(Ti(o)&&Ti(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,s=[];for(let i=0;i<t.length;i++)Ac(t[i])&&s.push(i);s.length&&Uc(t,s,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_t[s](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:s,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=_t[s](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const xi=(n,t)=>t==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Nt.test(n)||n==="0")&&!n.startsWith("url("));function iu(n){const t=n[0];if(n.length===1)return!0;for(let e=0;e<n.length;e++)if(n[e]!==t)return!0}function ru(n,t,e,s){const i=n[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=n[n.length-1],o=xi(i,t),a=xi(r,t);return!o||!a?!1:iu(n)||(e==="spring"||ze(e))&&s}const ou=n=>n!==null;function qe(n,{repeat:t,repeatType:e="loop"},s){const i=n.filter(ou),r=t&&e!=="loop"&&t%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const au=40;class Jr{constructor({autoplay:t=!0,delay:e=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ot.now(),this.options={autoplay:t,delay:e,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>au?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Qc(),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=ot.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!ru(t,s,i,r))if(o)this.options.duration=0;else{l&&l(qe(t,this.options,e)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,e);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function rn(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*(2/3-e)*6:n}function lu({hue:n,saturation:t,lightness:e,alpha:s}){n/=360,t/=100,e/=100;let i=0,r=0,o=0;if(!t)i=r=o=e;else{const a=e<.5?e*(1+t):e+t-e*t,l=2*e-a;i=rn(l,a,n+1/3),r=rn(l,a,n),o=rn(l,a,n-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function _e(n,t){return e=>e>0?t:n}const on=(n,t,e)=>{const s=n*n,i=e*(t*t-s)+s;return i<0?0:Math.sqrt(i)},cu=[An,gt,Ot],uu=n=>cu.find(t=>t.test(n));function Si(n){const t=uu(n);if(!t)return!1;let e=t.parse(n);return t===Ot&&(e=lu(e)),e}const Mi=(n,t)=>{const e=Si(n),s=Si(t);if(!e||!s)return _e(n,t);const i={...e};return r=>(i.red=on(e.red,s.red,r),i.green=on(e.green,s.green,r),i.blue=on(e.blue,s.blue,r),i.alpha=me(e.alpha,s.alpha,r),gt.transform(i))},hu=(n,t)=>e=>t(n(e)),ss=(...n)=>n.reduce(hu),Ln=new Set(["none","hidden"]);function du(n,t){return Ln.has(n)?e=>e<=0?n:t:e=>e>=1?t:n}function fu(n,t){return e=>me(n,t,e)}function is(n){return typeof n=="number"?fu:typeof n=="string"?ns(n)?_e:_.test(n)?Mi:gu:Array.isArray(n)?to:typeof n=="object"?_.test(n)?Mi:mu:_e}function to(n,t){const e=[...n],s=e.length,i=n.map((r,o)=>is(r)(r,t[o]));return r=>{for(let o=0;o<s;o++)e[o]=i[o](r);return e}}function mu(n,t){const e={...n,...t},s={};for(const i in e)n[i]!==void 0&&t[i]!==void 0&&(s[i]=is(n[i])(n[i],t[i]));return i=>{for(const r in s)e[r]=s[r](i);return e}}function pu(n,t){var e;const s=[],i={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],a=n.indexes[o][i[o]],l=(e=n.values[a])!==null&&e!==void 0?e:0;s[r]=l,i[o]++}return s}const gu=(n,t)=>{const e=Nt.createTransformer(t),s=ue(n),i=ue(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ln.has(n)&&!i.values.length||Ln.has(t)&&!s.values.length?du(n,t):ss(to(pu(s,i),i.values),e):_e(n,t)};function eo(n,t,e){return typeof n=="number"&&typeof t=="number"&&typeof e=="number"?me(n,t,e):is(n)(n,t)}function Oi({keyframes:n,velocity:t=0,power:e=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=n[0],d={done:!1,value:h},m=A=>a!==void 0&&A<a||l!==void 0&&A>l,f=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let g=e*t;const b=h+g,p=o===void 0?b:o(b);p!==b&&(g=p-h);const v=A=>-g*Math.exp(-A/s),E=A=>p+v(A),w=A=>{const M=v(A),O=E(A);d.done=Math.abs(M)<=c,d.value=d.done?p:O};let y,T;const S=A=>{m(d.value)&&(y=A,T=zn({keyframes:[d.value,f(d.value)],velocity:yr(E,A,d.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:A=>{let M=!1;return!T&&y===void 0&&(M=!0,w(A),S(A)),y!==void 0&&A>=y?T.next(A-y):(!M&&w(A),d)}}}const bu=pe(.42,0,1,1),yu=pe(0,0,.58,1),no=pe(.42,0,.58,1),vu={linear:Et,easeIn:bu,easeInOut:no,easeOut:yu,circIn:Zn,circInOut:Pr,circOut:Tc,backIn:Gn,backInOut:Vr,backOut:Dr,anticipate:_r},Ci=n=>{if(Xn(n)){dr(n.length===4);const[t,e,s,i]=n;return pe(t,e,s,i)}else if(typeof n=="string")return vu[n];return n};function wu(n,t,e){const s=[],i=e||eo,r=n.length-1;for(let o=0;o<r;o++){let a=i(n[o],n[o+1]);if(t){const l=Array.isArray(t)?t[o]||Et:t;a=ss(l,a)}s.push(a)}return s}function Eu(n,t,{clamp:e=!0,ease:s,mixer:i}={}){const r=n.length;if(dr(r===t.length),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const o=n[0]===n[1];n[0]>n[r-1]&&(n=[...n].reverse(),t=[...t].reverse());const a=wu(t,s,i),l=a.length,c=u=>{if(o&&u<n[0])return t[0];let h=0;if(l>1)for(;h<n.length-2&&!(u<n[h+1]);h++);const d=We(n[h],n[h+1],u);return a[h](d)};return e?u=>c(Tt(n[0],n[r-1],u)):c}function Tu(n,t){return n.map(e=>e*t)}function Au(n,t){return n.map(()=>t||no).splice(0,n.length-1)}function Pe({duration:n=300,keyframes:t,times:e,ease:s="easeInOut"}){const i=vr(s)?s.map(Ci):Ci(s),r={done:!1,value:t[0]},o=Tu(e&&e.length===t.length?e:Tr(t),n),a=Eu(o,t,{ease:Array.isArray(i)?i:Au(t,i)});return{calculatedDuration:n,next:l=>(r.value=a(l),r.done=l>=n,r)}}const xu=n=>{const t=({timestamp:e})=>n(e);return{start:()=>Z.update(t,!0),stop:()=>wn(t),now:()=>Fe.isProcessing?Fe.timestamp:ot.now()}},Su={decay:Oi,inertia:Oi,tween:Pe,keyframes:Pe,spring:zn},Mu=n=>n/100;class rs extends Jr{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:e,motionValue:s,element:i,keyframes:r}=this.options,o=(i==null?void 0:i.KeyframeResolver)||es,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(r,a,e,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=ze(e)?e:Su[e]||Pe;let l,c;a!==Pe&&typeof t[0]!="number"&&(l=ss(Mu,eo(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});r==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Wn(u));const{calculatedDuration:h}=u,d=h+i,m=d*(s+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,e=!1){const{resolved:s}=this;if(!s){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:h}=s;if(this.startTime===null)return r.next(0);const{delay:d,repeat:m,repeatType:f,repeatDelay:g,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const p=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?p<0:p>u;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let E=this.currentTime,w=r;if(m){const A=Math.min(this.currentTime,u)/h;let M=Math.floor(A),O=A%1;!O&&A>=1&&(O=1),O===1&&M--,M=Math.min(M,m+1),!!(M%2)&&(f==="reverse"?(O=1-O,g&&(O-=g/h)):f==="mirror"&&(w=o)),E=Tt(0,1,O)*h}const y=v?{done:!1,value:l[0]}:w.next(E);a&&(y.value=a(y.value));let{done:T}=y;!v&&c!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return S&&i!==void 0&&(y.value=qe(l,this.options,i)),b&&b(y.value),S&&this.finish(),y}get duration(){const{resolved:t}=this;return t?st(t.calculatedDuration):0}get time(){return st(this.currentTime)}set time(t){t=nt(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=st(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=xu,onPlay:e,startTime:s}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),e&&e();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Ou=new Set(["opacity","clipPath","filter","transform"]);function Cu(n,t,e,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:e};l&&(c.offset=l);const u=Cr(a,i);return Array.isArray(u)&&(c.easing=u),n.animate(c,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}const ku=Un(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Be=10,Lu=2e4;function Fu(n){return ze(n.type)||n.type==="spring"||!Or(n.ease)}function Du(n,t){const e=new rs({...t,keyframes:n,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:n[0]};const i=[];let r=0;for(;!s.done&&r<Lu;)s=e.sample(r),i.push(s.value),r+=Be;return{times:void 0,keyframes:i,duration:r-Be,ease:"linear"}}const so={anticipate:_r,backInOut:Vr,circInOut:Pr};function Vu(n){return n in so}class ki extends Jr{constructor(t){super(t);const{name:e,motionValue:s,element:i,keyframes:r}=this.options;this.resolver=new Qr(r,(o,a)=>this.onKeyframesResolved(o,a),e,s,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof r=="string"&&Ve()&&Vu(r)&&(r=so[r]),Fu(this.options)){const{onComplete:h,onUpdate:d,motionValue:m,element:f,...g}=this.options,b=Du(t,g);t=b.keyframes,t.length===1&&(t[1]=t[0]),s=b.duration,i=b.times,r=b.ease,o="keyframes"}const u=Cu(a.owner.current,l,t,{...this.options,duration:s,times:i,ease:r});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(mi(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:h}=this.options;a.set(qe(t,this.options,e)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:s,times:i,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return st(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return st(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.currentTime=nt(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:e}=this;if(!e)return Et;const{animation:s}=e;mi(s,t)}return Et}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.playState==="finished"&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:s,duration:i,type:r,ease:o,times:a}=t;if(e.playState==="idle"||e.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:h,element:d,...m}=this.options,f=new rs({...m,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),g=nt(this.time);c.setWithVelocity(f.sample(g-Be).value,f.sample(g).value,Be)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return ku()&&s&&Ou.has(s)&&(s!=="transform"||!c)&&!l&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}const _u={type:"spring",stiffness:500,damping:25,restSpeed:10},Pu=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),Bu={type:"keyframes",duration:.8},Ru={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Iu=(n,{keyframes:t})=>t.length>2?Bu:Rt.has(n)?n.startsWith("scale")?Pu(t[1]):_u:Ru;function Nu({when:n,delay:t,delayChildren:e,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const io=(n,t,e,s={},i,r)=>o=>{const a=xr(s,n)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-nt(l);let u={keyframes:Array.isArray(e)?e:[null,e],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:n,motionValue:t,element:r?void 0:i};Nu(a)||(u={...u,...Iu(n,u)}),u.duration&&(u.duration=nt(u.duration)),u.repeatDelay&&(u.repeatDelay=nt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),u.allowFlatten=!a.type&&!a.ease,h&&!r&&t.get()!==void 0){const d=qe(u.keyframes,a);if(d!==void 0)return Z.update(()=>{u.onUpdate(d),u.onComplete()}),new gr([])}return!r&&ki.supports(u)?new ki(u):new rs(u)};function $u({protectedKeys:n,needsAnimating:t},e){const s=n.hasOwnProperty(e)&&t[e]!==!0;return t[e]=!1,s}function ju(n,t,{delay:e=0,transitionOverride:s,type:i}={}){var r;let{transition:o=n.getDefaultTransition(),transitionEnd:a,...l}=t;s&&(o=s);const c=[],u=i&&n.animationState&&n.animationState.getState()[i];for(const h in l){const d=n.getValue(h,(r=n.latestValues[h])!==null&&r!==void 0?r:null),m=l[h];if(m===void 0||u&&$u(u,h))continue;const f={delay:e,...xr(o||{},h)};let g=!1;if(window.MotionHandoffAnimation){const p=gc(n);if(p){const v=window.MotionHandoffAnimation(p,h,Z);v!==null&&(f.startTime=v,g=!0)}}fc(n,h),d.start(io(h,d,m,n.shouldReduceMotion&&Sr.has(h)?{type:!1}:f,n,g));const b=d.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{Z.update(()=>{a&&hc(n,a)})}),c}function Ku(n){return n instanceof SVGElement&&n.tagName!=="svg"}const Li=()=>({min:0,max:0}),os=()=>({x:Li(),y:Li()}),Fi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Fn={};for(const n in Fi)Fn[n]={isEnabled:t=>Fi[n].some(e=>!!t[e])};const Hu=typeof window<"u",Dn={current:null},ro={current:!1};function Uu(){if(ro.current=!0,!!Hu)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),t=()=>Dn.current=n.matches;n.addListener(t),t()}else Dn.current=!1}const Wu=[...Zr,_,Nt],zu=n=>Wu.find(Gr(n));function qu(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function Yu(n){return typeof n=="string"||Array.isArray(n)}const Xu=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gu=["initial",...Xu];function oo(n){return qu(n.animate)||Gu.some(t=>Yu(n[t]))}function Zu(n){return!!(oo(n)||n.variants)}function Qu(n,t,e){for(const s in t){const i=t[s],r=e[s];if(P(i))n.addValue(s,i);else if(P(r))n.addValue(s,ae(i,{owner:n}));else if(r!==i)if(n.hasValue(s)){const o=n.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=n.getStaticValue(s);n.addValue(s,ae(o!==void 0?o:i,{owner:n}))}}for(const s in e)t[s]===void 0&&n.removeValue(s);return t}const Di=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ao{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=es,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=ot.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Z.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=oo(e),this.isVariantNode=Zu(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const m in d){const f=d[m];l[m]!==void 0&&P(f)&&f.set(l[m],!1)}}mount(t){this.current=t,le.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,s)=>this.bindToMotionValue(s,e)),ro.current||Uu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Dn.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),wn(this.notifyUpdate),wn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Rt.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Z.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),r(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Fn){const e=Fn[t];if(!e)continue;const{isEnabled:s,Feature:i}=e;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):os()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let s=0;s<Di.length;s++){const i=Di[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=t[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Qu(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&e!==void 0&&(s=ae(e===null?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(zr(i)||Br(i))?i=parseFloat(i):!zu(i)&&Nt.test(e)&&(i=Hr(t,e)),this.setBaseTarget(t,P(i)?i.get():i)),P(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Mr(this.props,s,(e=this.presenceContext)===null||e===void 0?void 0:e.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!P(r)?r:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,e){return this.events[t]||(this.events[t]=new mr),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class lo extends ao{constructor(){super(...arguments),this.KeyframeResolver=Qr}sortInstanceNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:s}){delete e[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;P(t)&&(this.childSubscription=t.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}const co=(n,t)=>t&&typeof n=="number"?t.transform(n):n,Ju={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},th=Bt.length;function eh(n,t,e){let s="",i=!0;for(let r=0;r<th;r++){const o=Bt[r],a=n[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||e){const c=co(a,ts[o]);if(!l){i=!1;const u=Ju[o]||o;s+=`${u}(${c}) `}e&&(t[o]=c)}}return s=s.trim(),e?s=e(t,i?"":s):i&&(s="none"),s}function uo(n,t,e){const{style:s,vars:i,transformOrigin:r}=n;let o=!1,a=!1;for(const l in t){const c=t[l];if(Rt.has(l)){o=!0;continue}else if(Yr(l)){i[l]=c;continue}else{const u=co(c,ts[l]);l.startsWith("origin")?(a=!0,r[l]=u):s[l]=u}}if(t.transform||(o||e?s.transform=eh(t,n.transform,e):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;s.transformOrigin=`${l} ${c} ${u}`}}const nh={offset:"stroke-dashoffset",array:"stroke-dasharray"},sh={offset:"strokeDashoffset",array:"strokeDasharray"};function ih(n,t,e=1,s=0,i=!0){n.pathLength=1;const r=i?nh:sh;n[r.offset]=x.transform(-s);const o=x.transform(t),a=x.transform(e);n[r.array]=`${o} ${a}`}function Vi(n,t,e){return typeof n=="string"?n:x.transform(t+e*n)}function rh(n,t,e){const s=Vi(t,n.x,n.width),i=Vi(e,n.y,n.height);return`${s} ${i}`}function oh(n,{attrX:t,attrY:e,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,h){if(uo(n,c,h),u){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:d,style:m,dimensions:f}=n;d.transform&&(f&&(m.transform=d.transform),delete d.transform),f&&(i!==void 0||r!==void 0||m.transform)&&(m.transformOrigin=rh(f,i!==void 0?i:.5,r!==void 0?r:.5)),t!==void 0&&(d.x=t),e!==void 0&&(d.y=e),s!==void 0&&(d.scale=s),o!==void 0&&ih(d,o,a,l,!1)}const ho=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ah=n=>typeof n=="string"&&n.toLowerCase()==="svg";function lh(n,t){try{t.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function fo(n,{style:t,vars:e},s,i){Object.assign(n.style,t,i&&i.getProjectionStyles(s));for(const r in e)n.style.setProperty(r,e[r])}function ch(n,t,e,s){fo(n,t,void 0,s);for(const i in t.attrs)n.setAttribute(ho.has(i)?i:Yn(i),t.attrs[i])}const uh={};function hh(n,{layout:t,layoutId:e}){return Rt.has(n)||n.startsWith("origin")||(t||e!==void 0)&&(!!uh[n]||n==="opacity")}function mo(n,t,e){var s;const{style:i}=n,r={};for(const o in i)(P(i[o])||t.style&&P(t.style[o])||hh(o,n)||((s=e==null?void 0:e.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return r}function dh(n,t,e){const s=mo(n,t,e);for(const i in n)if(P(n[i])||P(t[i])){const r=Bt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=n[i]}return s}class fh extends lo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=os,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&lh(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Rt.has(e)){const s=Kr(e);return s&&s.default||0}return e=ho.has(e)?e:Yn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,s){return dh(t,e,s)}onBindTransform(){this.current&&!this.renderState.dimensions&&Z.postRender(this.updateDimensions)}build(t,e,s){oh(t,e,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,s,i){ch(t,e,s,i)}mount(t){this.isSVGTag=ah(t.tagName),super.mount(t)}}function mh({top:n,left:t,right:e,bottom:s}){return{x:{min:t,max:e},y:{min:n,max:s}}}function ph(n,t){if(!t)return n;const e=t({x:n.left,y:n.top}),s=t({x:n.right,y:n.bottom});return{top:e.y,left:e.x,bottom:s.y,right:s.x}}function gh(n,t){return mh(ph(n.getBoundingClientRect(),t))}function bh(n){return window.getComputedStyle(n)}class yh extends lo{constructor(){super(...arguments),this.type="html",this.renderInstance=fo}readValueFromInstance(t,e){if(Rt.has(e))return qc(t,e);{const s=bh(t),i=(Yr(e)?s.getPropertyValue(e):s[e])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:e}){return gh(t,e)}build(t,e,s){uo(t,e,s.transformTemplate)}scrapeMotionValuesFromProps(t,e,s){return mo(t,e,s)}}function vh(n,t){return n in t}class wh extends ao{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(vh(e,t)){const s=t[e];if(typeof s=="string"||typeof s=="number")return s}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return os()}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Eh(n){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},e=Ku(n)?new fh(t):new yh(t);e.mount(n),le.set(n,e)}function Th(n){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},e=new wh(t);e.mount(n),le.set(n,e)}function Ah(n,t,e){const s=P(n)?n:ae(n);return s.start(io("",s,t,e)),s.animation}function xh(n,t){return P(n)||typeof n=="number"||typeof n=="string"&&!qn(t)}function po(n,t,e,s){const i=[];if(xh(n,t))i.push(Ah(n,qn(t)&&t.default||t,e&&(e.default||e)));else{const r=Ar(n,t,s),o=r.length;for(let a=0;a<o;a++){const l=r[a],c=l instanceof Element?Eh:Th;le.has(l)||c(l);const u=le.get(l),h={...e};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),i.push(...ju(u,{...t,transition:h},{}))}}return i}function Sh(n,t,e){const s=[];return nc(n,t,e,{spring:zn}).forEach(({keyframes:r,transition:o},a)=>{s.push(...po(a,r,o))}),s}function Mh(n){return Array.isArray(n)&&n.some(Array.isArray)}function Oh(n){function t(e,s,i){let r=[];return Mh(e)?r=Sh(e,s,n):r=po(e,s,i,n),new gr(r)}return t}const an=Oh();let Ch=class extends I()({targets:{icon:HTMLElement,content:HTMLElement},values:{open:Boolean}}){connect(){this.animationDurationValue=.15,this.openValue?this.open():this.close()}toggle(){this.openValue=!this.openValue}openValueChanged(t){t?this.open():this.close()}open(){this.hasContentTarget&&(this.revealContent(),this.hasIconTarget&&this.rotateIcon(),this.openValue=!0)}close(){this.hasContentTarget&&(this.hideContent(),this.hasIconTarget&&this.rotateIcon(),this.openValue=!1)}revealContent(){const t=this.contentTarget.scrollHeight;an(this.contentTarget,{height:`${t}px`},{duration:this.animationDurationValue,easing:"ease-in-out"})}hideContent(){an(this.contentTarget,{height:0},{duration:this.animationDurationValue,easing:"ease-in-out"})}rotateIcon(){an(this.iconTarget,{rotate:`${this.openValue?180:0}deg`})}};const kh=Object.freeze(Object.defineProperty({__proto__:null,default:Ch},Symbol.toStringTag,{value:"Module"}));class Lh extends I()({targets:{banner:HTMLDivElement},values:{open:Boolean,autohide:{default:4e3,type:Number}}}){connect(){if(this.autohideValue!=0){const t=()=>{};setTimeout(()=>{this.hide().then(t).catch(t)},this.autohideValue)}}dismiss(){this.remove(),this.dispatchEvent(this.bannerTarget,"ariadne-banner:dismiss")}show(){this.bannerTarget.style.setProperty("display","initial")}remove(){const t=this.bannerTarget.parentElement;t&&t.removeChild(this.bannerTarget)}hide(){this.bannerTarget.style.setProperty("display","none")}}const Fh=Object.freeze(Object.defineProperty({__proto__:null,default:Lh},Symbol.toStringTag,{value:"Module"}));function Dh(n){const t=document.createElement("pre");return t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="5px",t.textContent=n,t}function go(n){if("clipboard"in navigator)return navigator.clipboard.writeText(n.textContent||"");const t=getSelection();if(t==null)return Promise.reject(new Error);t.removeAllRanges();const e=document.createRange();return e.selectNodeContents(n),t.addRange(e),document.execCommand("copy"),t.removeAllRanges(),Promise.resolve()}function Vn(n){if("clipboard"in navigator)return navigator.clipboard.writeText(n);const t=document.body;if(!t)return Promise.reject(new Error);const e=Dh(n);return t.appendChild(e),go(e),t.removeChild(e),Promise.resolve()}async function bo(n){const t=n.getAttribute("for"),e=n.getAttribute("value");function s(){n.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n.getAttribute("aria-disabled")!=="true"){if(e)await Vn(e),s();else if(t){const i="getRootNode"in Element.prototype?n.getRootNode():n.ownerDocument;if(!(i instanceof Document||"ShadowRoot"in window&&i instanceof ShadowRoot))return;const r=i.getElementById(t);r&&(await Vh(r),s())}}}function Vh(n){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?Vn(n.value):n instanceof HTMLAnchorElement&&n.hasAttribute("href")?Vn(n.href):go(n)}function _h(n){const t=n.currentTarget;t instanceof HTMLElement&&bo(t)}function yo(n){if(n.key===" "||n.key==="Enter"){const t=n.currentTarget;t instanceof HTMLElement&&(n.preventDefault(),bo(t))}}function Ph(n){n.currentTarget.addEventListener("keydown",yo)}function Bh(n){n.currentTarget.removeEventListener("keydown",yo)}class Rh extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",_h),this.addEventListener("focus",Ph),this.addEventListener("blur",Bh)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const _i=typeof globalThis<"u"?globalThis:window;try{_i.ClipboardCopyElement=Rh.define()}catch(n){if(!(_i.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}const Ih=2e3;class Nh extends I()({targets:{initial:HTMLElement,confirmed:null},values:{hiddenClass:String,showClass:String}}){connect(){this.clipboardCopyElementTimers=new WeakMap}copy(t){var o;const e=t.target,s=this.clipboardCopyElementTimers.get(e),i=(o=e.parentNode)==null?void 0:o.querySelector("[data-clipboard-copy-feedback]"),r="Copied!";s?(clearTimeout(s),this.clipboardCopyElementTimers.delete(e)):(this.showConfirm(),i&&(i.textContent===r?i.textContent=`${r} `:i.textContent=r)),this.clipboardCopyElementTimers.set(e,window.setTimeout(()=>{this.showInitial(),this.hideConfirm(),this.clipboardCopyElementTimers.delete(e)},Ih))}showConfirm(){this.hasConfirmedTarget&&(this.confirmedTarget.classList.remove(this.hiddenClassValue),this.confirmedTarget.classList.add(this.showClassValue),this.initialTarget.classList.add(this.hiddenClassValue))}showInitial(){this.initialTarget.classList.remove(this.hiddenClassValue),this.initialTarget.classList.add(this.showClassValue),this.hasConfirmedTarget&&this.confirmedTarget.classList.add(this.hiddenClassValue)}hideConfirm(){this.hasConfirmedTarget&&this.confirmedTarget.classList.remove(this.showClassValue)}}const $h=Object.freeze(Object.defineProperty({__proto__:null,default:Nh},Symbol.toStringTag,{value:"Module"})),at=Math.min,$=Math.max,Re=Math.round,xe=Math.floor,G=n=>({x:n,y:n}),jh={left:"right",right:"left",bottom:"top",top:"bottom"},Kh={start:"end",end:"start"};function _n(n,t,e){return $(n,at(t,e))}function $t(n,t){return typeof n=="function"?n(t):n}function lt(n){return n.split("-")[0]}function jt(n){return n.split("-")[1]}function vo(n){return n==="x"?"y":"x"}function as(n){return n==="y"?"height":"width"}function At(n){return["top","bottom"].includes(lt(n))?"y":"x"}function ls(n){return vo(At(n))}function Hh(n,t,e){e===void 0&&(e=!1);const s=jt(n),i=ls(n),r=as(i);let o=i==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=Ie(o)),[o,Ie(o)]}function Uh(n){const t=Ie(n);return[Pn(n),t,Pn(t)]}function Pn(n){return n.replace(/start|end/g,t=>Kh[t])}function Wh(n,t,e){const s=["left","right"],i=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(n){case"top":case"bottom":return e?t?i:s:t?s:i;case"left":case"right":return t?r:o;default:return[]}}function zh(n,t,e,s){const i=jt(n);let r=Wh(lt(n),e==="start",s);return i&&(r=r.map(o=>o+"-"+i),t&&(r=r.concat(r.map(Pn)))),r}function Ie(n){return n.replace(/left|right|bottom|top/g,t=>jh[t])}function qh(n){return{top:0,right:0,bottom:0,left:0,...n}}function wo(n){return typeof n!="number"?qh(n):{top:n,right:n,bottom:n,left:n}}function Ne(n){const{x:t,y:e,width:s,height:i}=n;return{width:s,height:i,top:e,left:t,right:t+s,bottom:e+i,x:t,y:e}}function Pi(n,t,e){let{reference:s,floating:i}=n;const r=At(t),o=ls(t),a=as(o),l=lt(t),c=r==="y",u=s.x+s.width/2-i.width/2,h=s.y+s.height/2-i.height/2,d=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:u,y:s.y-i.height};break;case"bottom":m={x:u,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:h};break;case"left":m={x:s.x-i.width,y:h};break;default:m={x:s.x,y:s.y}}switch(jt(t)){case"start":m[o]-=d*(e&&c?-1:1);break;case"end":m[o]+=d*(e&&c?-1:1);break}return m}const Yh=async(n,t,e)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=e,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:n,floating:t,strategy:i}),{x:u,y:h}=Pi(c,s,l),d=s,m={},f=0;for(let g=0;g<a.length;g++){const{name:b,fn:p}=a[g],{x:v,y:E,data:w,reset:y}=await p({x:u,y:h,initialPlacement:s,placement:d,strategy:i,middlewareData:m,rects:c,platform:o,elements:{reference:n,floating:t}});u=v??u,h=E??h,m={...m,[b]:{...m[b],...w}},y&&f<=50&&(f++,typeof y=="object"&&(y.placement&&(d=y.placement),y.rects&&(c=y.rects===!0?await o.getElementRects({reference:n,floating:t,strategy:i}):y.rects),{x:u,y:h}=Pi(c,d,l)),g=-1)}return{x:u,y:h,placement:d,strategy:i,middlewareData:m}};async function cs(n,t){var e;t===void 0&&(t={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:m=0}=$t(t,n),f=wo(m),b=a[d?h==="floating"?"reference":"floating":h],p=Ne(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(b)))==null||e?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=h==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),w=await(r.isElement==null?void 0:r.isElement(E))?await(r.getScale==null?void 0:r.getScale(E))||{x:1,y:1}:{x:1,y:1},y=Ne(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:E,strategy:l}):v);return{top:(p.top-y.top+f.top)/w.y,bottom:(y.bottom-p.bottom+f.bottom)/w.y,left:(p.left-y.left+f.left)/w.x,right:(y.right-p.right+f.right)/w.x}}const Xh=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:s,placement:i,rects:r,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=$t(n,t)||{};if(c==null)return{};const h=wo(u),d={x:e,y:s},m=ls(i),f=as(m),g=await o.getDimensions(c),b=m==="y",p=b?"top":"left",v=b?"bottom":"right",E=b?"clientHeight":"clientWidth",w=r.reference[f]+r.reference[m]-d[m]-r.floating[f],y=d[m]-r.reference[m],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let S=T?T[E]:0;(!S||!await(o.isElement==null?void 0:o.isElement(T)))&&(S=a.floating[E]||r.floating[f]);const A=w/2-y/2,M=S/2-g[f]/2-1,O=at(h[p],M),F=at(h[v],M),R=O,N=S-g[f]-F,V=S/2-g[f]/2+A,ht=_n(R,V,N),W=!l.arrow&&jt(i)!=null&&V!==ht&&r.reference[f]/2-(V<R?O:F)-g[f]/2<0,D=W?V<R?V-R:V-N:0;return{[m]:d[m]+D,data:{[m]:ht,centerOffset:V-ht-D,...W&&{alignmentOffset:D}},reset:W}}}),Gh=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...b}=$t(n,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};const p=lt(i),v=At(a),E=lt(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),y=d||(E||!g?[Ie(a)]:Uh(a)),T=f!=="none";!d&&T&&y.push(...zh(a,g,f,w));const S=[a,...y],A=await cs(t,b),M=[];let O=((s=r.flip)==null?void 0:s.overflows)||[];if(u&&M.push(A[p]),h){const V=Hh(i,o,w);M.push(A[V[0]],A[V[1]])}if(O=[...O,{placement:i,overflows:M}],!M.every(V=>V<=0)){var F,R;const V=(((F=r.flip)==null?void 0:F.index)||0)+1,ht=S[V];if(ht)return{data:{index:V,overflows:O},reset:{placement:ht}};let W=(R=O.filter(D=>D.overflows[0]<=0).sort((D,L)=>D.overflows[1]-L.overflows[1])[0])==null?void 0:R.placement;if(!W)switch(m){case"bestFit":{var N;const D=(N=O.filter(L=>{if(T){const z=At(L.placement);return z===v||z==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(z=>z>0).reduce((z,ye)=>z+ye,0)]).sort((L,z)=>L[1]-z[1])[0])==null?void 0:N[0];D&&(W=D);break}case"initialPlacement":W=a;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function Zh(n,t){const{placement:e,platform:s,elements:i}=n,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=lt(e),a=jt(e),l=At(e)==="y",c=["left","top"].includes(o)?-1:1,u=r&&l?-1:1,h=$t(t,n);let{mainAxis:d,crossAxis:m,alignmentAxis:f}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*u,y:d*c}:{x:d*c,y:m*u}}const Qh=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,s;const{x:i,y:r,placement:o,middlewareData:a}=t,l=await Zh(t,n);return o===((e=a.offset)==null?void 0:e.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},Jh=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:s,placement:i}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:p,y:v}=b;return{x:p,y:v}}},...l}=$t(n,t),c={x:e,y:s},u=await cs(t,l),h=At(lt(i)),d=vo(h);let m=c[d],f=c[h];if(r){const b=d==="y"?"top":"left",p=d==="y"?"bottom":"right",v=m+u[b],E=m-u[p];m=_n(v,m,E)}if(o){const b=h==="y"?"top":"left",p=h==="y"?"bottom":"right",v=f+u[b],E=f-u[p];f=_n(v,f,E)}const g=a.fn({...t,[d]:m,[h]:f});return{...g,data:{x:g.x-e,y:g.y-s,enabled:{[d]:r,[h]:o}}}}}},td=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,s;const{placement:i,rects:r,platform:o,elements:a}=t,{apply:l=()=>{},...c}=$t(n,t),u=await cs(t,c),h=lt(i),d=jt(i),m=At(i)==="y",{width:f,height:g}=r.floating;let b,p;h==="top"||h==="bottom"?(b=h,p=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(p=h,b=d==="end"?"top":"bottom");const v=g-u.top-u.bottom,E=f-u.left-u.right,w=at(g-u[b],v),y=at(f-u[p],E),T=!t.middlewareData.shift;let S=w,A=y;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(A=E),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(S=v),T&&!d){const O=$(u.left,0),F=$(u.right,0),R=$(u.top,0),N=$(u.bottom,0);m?A=f-2*(O!==0||F!==0?O+F:$(u.left,u.right)):S=g-2*(R!==0||N!==0?R+N:$(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:S});const M=await o.getDimensions(a.floating);return f!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Ye(){return typeof window<"u"}function Kt(n){return Eo(n)?(n.nodeName||"").toLowerCase():"#document"}function K(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function J(n){var t;return(t=(Eo(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Eo(n){return Ye()?n instanceof Node||n instanceof K(n).Node:!1}function Y(n){return Ye()?n instanceof Element||n instanceof K(n).Element:!1}function Q(n){return Ye()?n instanceof HTMLElement||n instanceof K(n).HTMLElement:!1}function Bi(n){return!Ye()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof K(n).ShadowRoot}function be(n){const{overflow:t,overflowX:e,overflowY:s,display:i}=X(n);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(i)}function ed(n){return["table","td","th"].includes(Kt(n))}function Xe(n){return[":popover-open",":modal"].some(t=>{try{return n.matches(t)}catch{return!1}})}function us(n){const t=hs(),e=Y(n)?X(n):n;return["transform","translate","scale","rotate","perspective"].some(s=>e[s]?e[s]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function nd(n){let t=ct(n);for(;Q(t)&&!Pt(t);){if(us(t))return t;if(Xe(t))return null;t=ct(t)}return null}function hs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pt(n){return["html","body","#document"].includes(Kt(n))}function X(n){return K(n).getComputedStyle(n)}function Ge(n){return Y(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ct(n){if(Kt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Bi(n)&&n.host||J(n);return Bi(t)?t.host:t}function To(n){const t=ct(n);return Pt(t)?n.ownerDocument?n.ownerDocument.body:n.body:Q(t)&&be(t)?t:To(t)}function he(n,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const i=To(n),r=i===((s=n.ownerDocument)==null?void 0:s.body),o=K(i);if(r){const a=Bn(o);return t.concat(o,o.visualViewport||[],be(i)?i:[],a&&e?he(a):[])}return t.concat(i,he(i,[],e))}function Bn(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Ao(n){const t=X(n);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Q(n),r=i?n.offsetWidth:e,o=i?n.offsetHeight:s,a=Re(e)!==r||Re(s)!==o;return a&&(e=r,s=o),{width:e,height:s,$:a}}function ds(n){return Y(n)?n:n.contextElement}function Dt(n){const t=ds(n);if(!Q(t))return G(1);const e=t.getBoundingClientRect(),{width:s,height:i,$:r}=Ao(t);let o=(r?Re(e.width):e.width)/s,a=(r?Re(e.height):e.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const sd=G(0);function xo(n){const t=K(n);return!hs()||!t.visualViewport?sd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function id(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==K(n)?!1:t}function xt(n,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const i=n.getBoundingClientRect(),r=ds(n);let o=G(1);t&&(s?Y(s)&&(o=Dt(s)):o=Dt(n));const a=id(r,e,s)?xo(r):G(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(r){const d=K(r),m=s&&Y(s)?K(s):s;let f=d,g=Bn(f);for(;g&&s&&m!==f;){const b=Dt(g),p=g.getBoundingClientRect(),v=X(g),E=p.left+(g.clientLeft+parseFloat(v.paddingLeft))*b.x,w=p.top+(g.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,h*=b.y,l+=E,c+=w,f=K(g),g=Bn(f)}}return Ne({width:u,height:h,x:l,y:c})}function fs(n,t){const e=Ge(n).scrollLeft;return t?t.left+e:xt(J(n)).left+e}function So(n,t,e){e===void 0&&(e=!1);const s=n.getBoundingClientRect(),i=s.left+t.scrollLeft-(e?0:fs(n,s)),r=s.top+t.scrollTop;return{x:i,y:r}}function rd(n){let{elements:t,rect:e,offsetParent:s,strategy:i}=n;const r=i==="fixed",o=J(s),a=t?Xe(t.floating):!1;if(s===o||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=G(1);const u=G(0),h=Q(s);if((h||!h&&!r)&&((Kt(s)!=="body"||be(o))&&(l=Ge(s)),Q(s))){const m=xt(s);c=Dt(s),u.x=m.x+s.clientLeft,u.y=m.y+s.clientTop}const d=o&&!h&&!r?So(o,l,!0):G(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:e.y*c.y-l.scrollTop*c.y+u.y+d.y}}function od(n){return Array.from(n.getClientRects())}function ad(n){const t=J(n),e=Ge(n),s=n.ownerDocument.body,i=$(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),r=$(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-e.scrollLeft+fs(n);const a=-e.scrollTop;return X(s).direction==="rtl"&&(o+=$(t.clientWidth,s.clientWidth)-i),{width:i,height:r,x:o,y:a}}function ld(n,t){const e=K(n),s=J(n),i=e.visualViewport;let r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;const c=hs();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a,y:l}}function cd(n,t){const e=xt(n,!0,t==="fixed"),s=e.top+n.clientTop,i=e.left+n.clientLeft,r=Q(n)?Dt(n):G(1),o=n.clientWidth*r.x,a=n.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function Ri(n,t,e){let s;if(t==="viewport")s=ld(n,e);else if(t==="document")s=ad(J(n));else if(Y(t))s=cd(t,e);else{const i=xo(n);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ne(s)}function Mo(n,t){const e=ct(n);return e===t||!Y(e)||Pt(e)?!1:X(e).position==="fixed"||Mo(e,t)}function ud(n,t){const e=t.get(n);if(e)return e;let s=he(n,[],!1).filter(a=>Y(a)&&Kt(a)!=="body"),i=null;const r=X(n).position==="fixed";let o=r?ct(n):n;for(;Y(o)&&!Pt(o);){const a=X(o),l=us(o);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||be(o)&&!l&&Mo(n,o))?s=s.filter(u=>u!==o):i=a,o=ct(o)}return t.set(n,s),s}function hd(n){let{element:t,boundary:e,rootBoundary:s,strategy:i}=n;const o=[...e==="clippingAncestors"?Xe(t)?[]:ud(t,this._c):[].concat(e),s],a=o[0],l=o.reduce((c,u)=>{const h=Ri(t,u,i);return c.top=$(h.top,c.top),c.right=at(h.right,c.right),c.bottom=at(h.bottom,c.bottom),c.left=$(h.left,c.left),c},Ri(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dd(n){const{width:t,height:e}=Ao(n);return{width:t,height:e}}function fd(n,t,e){const s=Q(t),i=J(t),r=e==="fixed",o=xt(n,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=G(0);if(s||!s&&!r)if((Kt(t)!=="body"||be(i))&&(a=Ge(t)),s){const d=xt(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=fs(i));const c=i&&!s&&!r?So(i,a):G(0),u=o.left+a.scrollLeft-l.x-c.x,h=o.top+a.scrollTop-l.y-c.y;return{x:u,y:h,width:o.width,height:o.height}}function ln(n){return X(n).position==="static"}function Ii(n,t){if(!Q(n)||X(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return J(n)===e&&(e=e.ownerDocument.body),e}function Oo(n,t){const e=K(n);if(Xe(n))return e;if(!Q(n)){let i=ct(n);for(;i&&!Pt(i);){if(Y(i)&&!ln(i))return i;i=ct(i)}return e}let s=Ii(n,t);for(;s&&ed(s)&&ln(s);)s=Ii(s,t);return s&&Pt(s)&&ln(s)&&!us(s)?e:s||nd(n)||e}const md=async function(n){const t=this.getOffsetParent||Oo,e=this.getDimensions,s=await e(n.floating);return{reference:fd(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function pd(n){return X(n).direction==="rtl"}const gd={convertOffsetParentRelativeRectToViewportRelativeRect:rd,getDocumentElement:J,getClippingRect:hd,getOffsetParent:Oo,getElementRects:md,getClientRects:od,getDimensions:dd,getScale:Dt,isElement:Y,isRTL:pd};function Co(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function bd(n,t){let e=null,s;const i=J(n);function r(){var a;clearTimeout(s),(a=e)==null||a.disconnect(),e=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=n.getBoundingClientRect(),{left:u,top:h,width:d,height:m}=c;if(a||t(),!d||!m)return;const f=xe(h),g=xe(i.clientWidth-(u+d)),b=xe(i.clientHeight-(h+m)),p=xe(u),E={rootMargin:-f+"px "+-g+"px "+-b+"px "+-p+"px",threshold:$(0,at(1,l))||1};let w=!0;function y(T){const S=T[0].intersectionRatio;if(S!==l){if(!w)return o();S?o(!1,S):s=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!Co(c,n.getBoundingClientRect())&&o(),w=!1}try{e=new IntersectionObserver(y,{...E,root:i.ownerDocument})}catch{e=new IntersectionObserver(y,E)}e.observe(n)}return o(!0),r}function ko(n,t,e,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=ds(n),u=i||r?[...c?he(c):[],...he(t)]:[];u.forEach(p=>{i&&p.addEventListener("scroll",e,{passive:!0}),r&&p.addEventListener("resize",e)});const h=c&&a?bd(c,e):null;let d=-1,m=null;o&&(m=new ResizeObserver(p=>{let[v]=p;v&&v.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),e()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?xt(n):null;l&&b();function b(){const p=xt(n);g&&!Co(g,p)&&e(),g=p,f=requestAnimationFrame(b)}return e(),()=>{var p;u.forEach(v=>{i&&v.removeEventListener("scroll",e),r&&v.removeEventListener("resize",e)}),h==null||h(),(p=m)==null||p.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const ms=Qh,ps=Jh,gs=Gh,yd=td,vd=Xh,bs=(n,t,e)=>{const s=new Map,i={platform:gd,...e},r={...i.platform,_c:s};return Yh(n,t,{...i,platform:r})},Ni=(n,t)=>{const e=n[t];return typeof e=="function"?e:(...s)=>{}},Rn=(n,t,e)=>{let s=n;return e===!0?s=`${t.identifier}:${n}`:typeof e=="string"&&(s=`${e}:${n}`),s},In=(n,t,e)=>{const{bubbles:s,cancelable:i,composed:r}=t||{bubbles:!0,cancelable:!0,composed:!0};return t&&Object.assign(e,{originalEvent:t}),new CustomEvent(n,{bubbles:s,cancelable:i,composed:r,detail:e})};function wd(n){const t=n.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,s=window.innerWidth||document.documentElement.clientWidth,i=t.top<=e&&t.top+t.height>0,r=t.left<=s&&t.left+t.width>0;return i&&r}function Ed(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(e[s[i]]=n[s[i]]);return e}const cn={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0};class Td{constructor(t,e={}){var s,i,r;this.log=(l,c)=>{this.debug&&(this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${l}`,"color: #3B82F6","color: unset"),this.logger.log(Object.assign({controllerId:this.controllerId},c)),this.logger.groupEnd())},this.warn=l=>{this.logger.warn(`%c${this.controller.identifier} %c${l}`,"color: #3B82F6; font-weight: bold","color: unset")},this.dispatch=(l,c={})=>{if(this.dispatchEvent){const{event:u}=c,h=Ed(c,["event"]),d=this.extendedEvent(l,u||null,h);this.targetElement.dispatchEvent(d),this.log("dispatchEvent",Object.assign({eventName:d.type},h))}},this.call=(l,c={})=>{const u=this.controller[l];if(typeof u=="function")return u.call(this.controller,c)},this.extendedEvent=(l,c,u)=>{const{bubbles:h,cancelable:d,composed:m}=c||{bubbles:!0,cancelable:!0,composed:!0};return c&&Object.assign(u,{originalEvent:c}),new CustomEvent(this.composeEventName(l),{bubbles:h,cancelable:d,composed:m,detail:u})},this.composeEventName=l=>{let c=l;return this.eventPrefix===!0?c=`${this.controller.identifier}:${l}`:typeof this.eventPrefix=="string"&&(c=`${this.eventPrefix}:${l}`),c},this.debug=(i=(s=e==null?void 0:e.debug)!==null&&s!==void 0?s:t.application.stimulusUseDebug)!==null&&i!==void 0?i:cn.debug,this.logger=(r=e==null?void 0:e.logger)!==null&&r!==void 0?r:cn.logger,this.controller=t,this.controllerId=t.element.id||t.element.dataset.id,this.targetElement=(e==null?void 0:e.element)||t.element;const{dispatchEvent:o,eventPrefix:a}=Object.assign({},cn,e);Object.assign(this,{dispatchEvent:o,eventPrefix:a}),this.controllerInitialize=t.initialize.bind(t),this.controllerConnect=t.connect.bind(t),this.controllerDisconnect=t.disconnect.bind(t)}}const Ad={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},xd=(n,t={})=>{const e=n,{onlyVisible:s,dispatchEvent:i,events:r,eventPrefix:o}=Object.assign({},Ad,t),a=h=>{const d=(t==null?void 0:t.element)||e.element;if(!(d.contains(h.target)||!wd(d)&&s)&&(e.clickOutside&&e.clickOutside(h),i)){const m=Rn("click:outside",e,o),f=In(m,h,{controller:e});d.dispatchEvent(f)}},l=()=>{r==null||r.forEach(h=>{window.addEventListener(h,a,!0)})},c=()=>{r==null||r.forEach(h=>{window.removeEventListener(h,a,!0)})},u=e.disconnect.bind(e);return Object.assign(e,{disconnect(){c(),u()}}),l(),[l,c]};class Sd extends ut{}Sd.debounces=[];const Md=200,$i=(n,t=Md)=>{let e=null;return function(){const s=Array.from(arguments),i=this,r=s.map(a=>a.params),o=()=>(s.forEach((a,l)=>a.params=r[l]),n.apply(i,s));e&&clearTimeout(e),e=setTimeout(o,t)}},Od=(n,t)=>{const e=n;e.constructor.debounces.forEach(i=>{if(typeof i=="string"&&(e[i]=$i(e[i],void 0)),typeof i=="object"){const{name:r,wait:o}=i;if(!r)return;e[r]=$i(e[r],o||void 0)}})},Cd={dispatchEvent:!0,eventPrefix:!0,visibleAttribute:"isVisible"},kd=(n,t={})=>{const e=n,{dispatchEvent:s,eventPrefix:i,visibleAttribute:r}=Object.assign({},Cd,t),o=(t==null?void 0:t.element)||e.element;e.intersectionElements||(e.intersectionElements=[]),e.intersectionElements.push(o);const a=w=>{const[y]=w;y.isIntersecting?c(y):o.hasAttribute(r)&&u(y)},l=new IntersectionObserver(a,t),c=w=>{if(o.setAttribute(r,"true"),Ni(e,"appear").call(e,w,l),s){const y=Rn("appear",e,i),T=In(y,null,{controller:e,entry:w,observer:l});o.dispatchEvent(T)}},u=w=>{if(o.removeAttribute(r),Ni(e,"disappear").call(e,w,l),s){const y=Rn("disappear",e,i),T=In(y,null,{controller:e,entry:w,observer:l});o.dispatchEvent(T)}},h=e.disconnect.bind(e),d=()=>{f(),h()},m=()=>{l.observe(o)},f=()=>{l.unobserve(o)},g=()=>e.intersectionElements.filter(w=>w.hasAttribute(r)).length===0,b=()=>e.intersectionElements.filter(w=>w.hasAttribute(r)).length===1,p=()=>e.intersectionElements.some(w=>w.hasAttribute(r)),v=()=>e.intersectionElements.every(w=>w.hasAttribute(r));return Object.assign(e,{isVisible:v,noneVisible:g,oneVisible:b,atLeastOneVisible:p,allVisible:v,disconnect:d}),m(),[m,f]};class Ld extends Td{constructor(t,e={}){super(t,e),this.observe=()=>{try{this.observer.observe(this.targetElement,this.options)}catch(s){this.controller.application.handleError(s,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},this.unobserve=()=>{this.observer.disconnect()},this.mutation=s=>{this.call("mutate",s),this.log("mutate",{entries:s}),this.dispatch("mutate",{entries:s})},this.targetElement=(e==null?void 0:e.element)||t.element,this.controller=t,this.options=e,this.observer=new MutationObserver(this.mutation),this.enhanceController(),this.observe()}enhanceController(){const t=this.controller.disconnect.bind(this.controller),e=()=>{this.unobserve(),t()};Object.assign(this.controller,{disconnect:e})}}const Lo=(n,t={})=>{const e=new Ld(n,t);return[e.observe,e.unobserve]};class Fd extends ut{}Fd.throttles=[];class Dd extends I()({targets:{wrapper:HTMLDetailsElement,button:HTMLElement,popover:dn,options:HTMLDivElement},values:{clamped:Boolean,placement:String,dynamicLabelPrefix:String}}){constructor(){super(...arguments),this.changedIds=new Set}clickOutside(){this.element.open=!1,this.setupAutoUpdate(),this.close()}close(){this.changedIds.size>0&&(this.dispatch("changed"),this.changedIds.clear(),this.buttonTarget.setAttribute("aria-expanded","false"))}connect(){xd(this),Lo(this,{childList:!0,subtree:!0}),this.setupAutoUpdate(),this.setupForm()}disconnect(){var t;(t=this.unsubAutoUpdate)==null||t.call(this)}setupForm(){for(const t of["checkbox","radio"])for(const e of this.popoverTarget.querySelectorAll(`input[type="${t}"]`))e.addEventListener("change",s=>{const i=s.target;this.changedIds.has(i)?this.changedIds.delete(i):this.changedIds.add(i),this.dispatch("clicked",{detail:i})})}setupAutoUpdate(){var e;if(!this.element.open){(e=this.unsubAutoUpdate)==null||e.call(this);return}const t=()=>{const s=this.optionsTarget,i=this.clampedValue;bs(this.buttonTarget,this.popoverTarget,{middleware:[ms(6),gs(),ps({padding:6}),yd({apply({availableHeight:r}){let o=r-6;i&&o>400&&(o=400),Object.assign(s.style,{maxHeight:`${o}px`})}})],placement:this.placementValue,strategy:"fixed"}).then(({x:r,y:o})=>{Object.assign(this.popoverTarget.style,{left:`${r}px`,top:`${o}px`})})};t(),this.unsubAutoUpdate=ko(this.buttonTarget,this.popoverTarget,t)}updateButtonLabel(t){var r;const s=t.target.querySelector("input[type=radio]:checked");if(!s)return;const i=((r=s.labels)==null?void 0:r.item(0)).textContent;this.buttonTarget.querySelector('[data-ariadne-ui-button-target="content"]').textContent=`${this.dynamicLabelPrefixValue}${i}`}toggle(){this.element.open=!this.element.open,this.setupAutoUpdate(),this.buttonTarget.setAttribute("aria-expanded","true")}}const Vd=Object.freeze(Object.defineProperty({__proto__:null,default:Dd},Symbol.toStringTag,{value:"Module"}));function _d(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t<n.length;t++)e[t]=n[t];return e}else return Array.from(n)}var ys=!1;if(typeof window<"u"){var ji={get passive(){ys=!0}};window.addEventListener("testPassive",null,ji),window.removeEventListener("testPassive",null,ji)}var $e=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),wt=[],je=!1,Fo=-1,se=void 0,pt=void 0,ie=void 0,Do=function(t){return wt.some(function(e){return!!(e.options.allowTouchMove&&e.options.allowTouchMove(t))})},Ke=function(t){var e=t||window.event;return Do(e.target)||e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)},Pd=function(t){if(ie===void 0){var e=!!t&&t.reserveScrollBarGap===!0,s=window.innerWidth-document.documentElement.clientWidth;if(e&&s>0){var i=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);ie=document.body.style.paddingRight,document.body.style.paddingRight=i+s+"px"}}se===void 0&&(se=document.body.style.overflow,document.body.style.overflow="hidden")},Bd=function(){ie!==void 0&&(document.body.style.paddingRight=ie,ie=void 0),se!==void 0&&(document.body.style.overflow=se,se=void 0)},Rd=function(){return window.requestAnimationFrame(function(){if(pt===void 0){pt={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var t=window,e=t.scrollY,s=t.scrollX,i=t.innerHeight;document.body.style.position="fixed",document.body.style.top=-e,document.body.style.left=-s,setTimeout(function(){return window.requestAnimationFrame(function(){var r=i-window.innerHeight;r&&e>=i&&(document.body.style.top=-(e+r))})},300)}})},Id=function(){if(pt!==void 0){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=pt.position,document.body.style.top=pt.top,document.body.style.left=pt.left,window.scrollTo(e,t),pt=void 0}},Nd=function(t){return t?t.scrollHeight-t.scrollTop<=t.clientHeight:!1},$d=function(t,e){var s=t.targetTouches[0].clientY-Fo;return Do(t.target)?!1:e&&e.scrollTop===0&&s>0||Nd(e)&&s<0?Ke(t):(t.stopPropagation(),!0)},jd=function(t,e){if(!t){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!wt.some(function(i){return i.targetElement===t})){var s={targetElement:t,options:e||{}};wt=[].concat(_d(wt),[s]),$e?Rd():Pd(e),$e&&(t.ontouchstart=function(i){i.targetTouches.length===1&&(Fo=i.targetTouches[0].clientY)},t.ontouchmove=function(i){i.targetTouches.length===1&&$d(i,t)},je||(document.addEventListener("touchmove",Ke,ys?{passive:!1}:void 0),je=!0))}},Kd=function(t){if(!t){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}wt=wt.filter(function(e){return e.targetElement!==t}),$e&&(t.ontouchstart=null,t.ontouchmove=null,je&&wt.length===0&&(document.removeEventListener("touchmove",Ke,ys?{passive:!1}:void 0),je=!1)),$e?Id():Bd()};class Hd extends I()({targets:{dialog:HTMLDialogElement}}){close(t){this.dialogTarget.open&&(this.dialogTarget.close(),Kd(this.dialogTarget))}disconnect(){this.close()}open(t){t.preventDefault(),this.dialogTarget.showModal(),jd(this.dialogTarget,{reserveScrollBarGap:!0})}windowClick(t){t.target===this.dialogTarget&&this.close()}}const Ud=Object.freeze(Object.defineProperty({__proto__:null,default:Hd},Symbol.toStringTag,{value:"Module"}));class Wd extends I()({targets:{emptyRoot:null,input:HTMLInputElement,searchString:null}}){handleNewQuery(t){let e=!1;for(const{el:s,searchString:i}of this.items){const r=i.includes(t.trim().toLowerCase());!e&&r&&(e=!0),r?s.classList.remove("ariadne:hidden"):s.classList.add("ariadne:hidden")}this.hasEmptyRootTarget&&(e?this.emptyRootTarget.classList.add("ariadne:hidden"):this.emptyRootTarget.classList.remove("ariadne:hidden"))}connect(){this.items=this.searchStringTargets.map(t=>({el:t,searchString:(t.textContent??"").trim().toLowerCase()})),kd(this)}appear(){this.reset()}handleInput(){this.hasSearchStringTarget&&this.handleNewQuery(this.inputTarget.value)}reset(){this.handleNewQuery(""),this.hasInputTarget&&(this.inputTarget.value="")}}const zd=Object.freeze(Object.defineProperty({__proto__:null,default:Wd},Symbol.toStringTag,{value:"Module"}));class qd extends I()({targets:{button:HTMLButtonElement,popover:HTMLElement},values:{placement:String}}){connect(){this.popoverTarget.addEventListener("toggle",t=>{t.newState==="open"&&this.updatePosition()})}toggle(){dispatchEvent(new CustomEvent("toggle",{detail:{newState:this.popoverTarget.open?"closed":"open"}}))}updatePosition(){ko(this.buttonTarget,this.popoverTarget,()=>{bs(this.buttonTarget,this.popoverTarget,{placement:this.placementValue,middleware:[ms(5),gs(),ps({padding:5})]}).then(({x:t,y:e})=>{Object.assign(this.popoverTarget.style,{left:`${t}px`,top:`${e}px`})})})}}const Yd=Object.freeze(Object.defineProperty({__proto__:null,default:qd},Symbol.toStringTag,{value:"Module"}));var Xd=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},Ki=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Jt;class Gd{formatToParts(t){const e=[];for(const s of t)e.push({type:"element",value:s}),e.push({type:"literal",value:", "});return e.slice(0,-1)}}const Zd=typeof Intl<"u"&&Intl.ListFormat||Gd,Qd=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Jd={minimumIntegerDigits:2};class tf{constructor(t,e={}){Jt.set(this,void 0);let s=String(e.style||"short");s!=="long"&&s!=="short"&&s!=="narrow"&&s!=="digital"&&(s="short");let i=s==="digital"?"numeric":s;const r=e.hours||i;i=r==="2-digit"?"numeric":r;const o=e.minutes||i;i=o==="2-digit"?"numeric":o;const a=e.seconds||i;i=a==="2-digit"?"numeric":a;const l=e.milliseconds||i;Xd(this,Jt,{locale:t,style:s,years:e.years||s==="digital"?"short":s,yearsDisplay:e.yearsDisplay==="always"?"always":"auto",months:e.months||s==="digital"?"short":s,monthsDisplay:e.monthsDisplay==="always"?"always":"auto",weeks:e.weeks||s==="digital"?"short":s,weeksDisplay:e.weeksDisplay==="always"?"always":"auto",days:e.days||s==="digital"?"short":s,daysDisplay:e.daysDisplay==="always"?"always":"auto",hours:r,hoursDisplay:e.hoursDisplay==="always"||s==="digital"?"always":"auto",minutes:o,minutesDisplay:e.minutesDisplay==="always"||s==="digital"?"always":"auto",seconds:a,secondsDisplay:e.secondsDisplay==="always"||s==="digital"?"always":"auto",milliseconds:l,millisecondsDisplay:e.millisecondsDisplay==="always"?"always":"auto"},"f")}resolvedOptions(){return Ki(this,Jt,"f")}formatToParts(t){const e=[],s=Ki(this,Jt,"f"),i=s.style,r=s.locale;for(const[o,a]of Qd){const l=t[o];if(s[`${o}Display`]==="auto"&&!l)continue;const c=s[o],u=c==="2-digit"?Jd:c==="numeric"?{}:{style:"unit",unit:a,unitDisplay:c};e.push(new Intl.NumberFormat(r,u).format(l))}return new Zd(r,{type:"unit",style:i==="digital"?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map(e=>e.value).join("")}}Jt=new WeakMap;const Vo=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,He=["year","month","week","day","hour","minute","second","millisecond"],ef=n=>Vo.test(n);class j{constructor(t=0,e=0,s=0,i=0,r=0,o=0,a=0,l=0){this.years=t,this.months=e,this.weeks=s,this.days=i,this.hours=r,this.minutes=o,this.seconds=a,this.milliseconds=l,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=this.sign===0}abs(){return new j(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds),Math.abs(this.milliseconds))}static from(t){var e;if(typeof t=="string"){const s=String(t).trim(),i=s.startsWith("-")?-1:1,r=(e=s.match(Vo))===null||e===void 0?void 0:e.slice(1).map(o=>(Number(o)||0)*i);return r?new j(...r):new j}else if(typeof t=="object"){const{years:s,months:i,weeks:r,days:o,hours:a,minutes:l,seconds:c,milliseconds:u}=t;return new j(s,i,r,o,a,l,c,u)}throw new RangeError("invalid duration")}static compare(t,e){const s=Date.now(),i=Math.abs(Hi(s,j.from(t)).getTime()-s),r=Math.abs(Hi(s,j.from(e)).getTime()-s);return i>r?-1:i<r?1:0}toLocaleString(t,e){return new tf(t,e).format(this)}}function Hi(n,t){const e=new Date(n);return t.sign<0?(e.setUTCSeconds(e.getUTCSeconds()+t.seconds),e.setUTCMinutes(e.getUTCMinutes()+t.minutes),e.setUTCHours(e.getUTCHours()+t.hours),e.setUTCDate(e.getUTCDate()+t.weeks*7+t.days),e.setUTCMonth(e.getUTCMonth()+t.months),e.setUTCFullYear(e.getUTCFullYear()+t.years)):(e.setUTCFullYear(e.getUTCFullYear()+t.years),e.setUTCMonth(e.getUTCMonth()+t.months),e.setUTCDate(e.getUTCDate()+t.weeks*7+t.days),e.setUTCHours(e.getUTCHours()+t.hours),e.setUTCMinutes(e.getUTCMinutes()+t.minutes),e.setUTCSeconds(e.getUTCSeconds()+t.seconds)),e}function nf(n,t="second",e=Date.now()){const s=n.getTime()-e;if(s===0)return new j;const i=Math.sign(s),r=Math.abs(s),o=Math.floor(r/1e3),a=Math.floor(o/60),l=Math.floor(a/60),c=Math.floor(l/24),u=Math.floor(c/30),h=Math.floor(u/12),d=He.indexOf(t)||He.length;return new j(d>=0?h*i:0,d>=1?(u-h*12)*i:0,0,d>=3?(c-u*30)*i:0,d>=4?(l-c*24)*i:0,d>=5?(a-l*60)*i:0,d>=6?(o-a*60)*i:0,d>=7?(r-o*1e3)*i:0)}function _o(n,{relativeTo:t=Date.now()}={}){if(t=new Date(t),n.blank)return n;const e=n.sign;let s=Math.abs(n.years),i=Math.abs(n.months),r=Math.abs(n.weeks),o=Math.abs(n.days),a=Math.abs(n.hours),l=Math.abs(n.minutes),c=Math.abs(n.seconds),u=Math.abs(n.milliseconds);u>=900&&(c+=Math.round(u/1e3)),(c||l||a||o||r||i||s)&&(u=0),c>=55&&(l+=Math.round(c/60)),(l||a||o||r||i||s)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||o||r||i||s)&&(l=0),o&&a>=12&&(o+=Math.round(a/24)),!o&&a>=21&&(o+=Math.round(a/24)),(o||r||i||s)&&(a=0);const h=t.getFullYear(),d=t.getMonth(),m=t.getDate();if(o>=27||s+i+o){const f=new Date(t);f.setDate(1),f.setMonth(d+i*e+1),f.setDate(0);const g=Math.max(0,m-f.getDate()),b=new Date(t);b.setFullYear(h+s*e),b.setDate(m-g),b.setMonth(d+i*e),b.setDate(m-g+o*e);const p=b.getFullYear()-t.getFullYear(),v=b.getMonth()-t.getMonth(),E=Math.abs(Math.round((Number(b)-Number(t))/864e5))+g,w=Math.abs(p*12+v);E<27?(o>=6?(r+=Math.round(o/7),o=0):o=E,i=s=0):w<=11?(i=w,s=0):(i=0,s=p*e),(i||s)&&(o=0)}return s&&(i=0),r>=4&&(i+=Math.round(r/4)),(i||s)&&(r=0),o&&r&&!i&&!s&&(r+=Math.round(o/7),o=0),new j(s*e,i*e,r*e,o*e,a*e,l*e,c*e,u*e)}function sf(n,t){const e=_o(n,t);if(e.blank)return[0,"second"];for(const s of He){if(s==="millisecond")continue;const i=e[`${s}s`];if(i)return[i,s]}return[0,"second"]}var k=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Se=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},U,te,ee,qt,mt,Nn,Po,Bo,Ro,Io,Mt;const rf=globalThis.HTMLElement||null,un=new j,Ui=new j(0,0,0,0,0,1);class of extends Event{constructor(t,e,s,i){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=s,this.newTitle=i}}function Wi(n){if(!n.date)return 1/0;if(n.format==="duration"||n.format==="elapsed"){const e=n.precision;if(e==="second")return 1e3;if(e==="minute")return 60*1e3}const t=Math.abs(Date.now()-n.date.getTime());return t<60*1e3?1e3:t<60*60*1e3?60*1e3:60*60*1e3}const hn=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(n){if(this.elements.has(n))return;this.elements.add(n);const t=n.date;if(t&&t.getTime()){const e=Wi(n),s=Date.now()+e;s<this.time&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),e),this.time=s)}}unobserve(n){this.elements.has(n)&&this.elements.delete(n)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let n=1/0;for(const t of this.elements)n=Math.min(n,Wi(t)),t.update();this.time=Math.min(60*60*1e3,n),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}};class af extends rf{constructor(){super(...arguments),U.add(this),te.set(this,!1),ee.set(this,!1),mt.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Mt.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title"]}get onRelativeTimeUpdated(){return k(this,Mt,"f")}set onRelativeTimeUpdated(t){k(this,Mt,"f")&&this.removeEventListener("relative-time-updated",k(this,Mt,"f")),Se(this,Mt,typeof t=="object"||typeof t=="function"?t:null,"f"),typeof t=="function"&&this.addEventListener("relative-time-updated",t)}get second(){const t=this.getAttribute("second");if(t==="numeric"||t==="2-digit")return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if(t==="numeric"||t==="2-digit")return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if(t==="numeric"||t==="2-digit")return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");if(t==="long"||t==="short"||t==="narrow")return t;if(this.format==="datetime"&&t!=="")return this.formatStyle}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=(t=this.getAttribute("day"))!==null&&t!==void 0?t:"numeric";if(e==="numeric"||e==="2-digit")return e}set day(t){this.setAttribute("day",t||"")}get month(){const t=this.format;let e=this.getAttribute("month");if(e!==""&&(e??(e=t==="datetime"?this.formatStyle:"short"),e==="numeric"||e==="2-digit"||e==="short"||e==="long"||e==="narrow"))return e}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");if(e==="numeric"||e==="2-digit")return e;if(!this.hasAttribute("year")&&new Date().getUTCFullYear()!==((t=this.date)===null||t===void 0?void 0:t.getUTCFullYear()))return"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if(t==="long"||t==="short"||t==="shortOffset"||t==="longOffset"||t==="shortGeneric"||t==="longGeneric")return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return(t=this.getAttribute("prefix"))!==null&&t!==void 0?t:this.format==="datetime"?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&ef(t)?t:"P30D"}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return t==="past"?"past":t==="future"?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return He.includes(t)?t:this.format==="micro"?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return t==="datetime"?"datetime":t==="relative"?"relative":t==="duration"?"duration":t==="micro"?"micro":t==="elapsed"?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if(t==="long")return"long";if(t==="short")return"short";if(t==="narrow")return"narrow";const e=this.format;return e==="elapsed"||e==="micro"?"narrow":e==="datetime"?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(t){this.toggleAttribute("no-title",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(t==null?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){hn.unobserve(this)}attributeChangedCallback(t,e,s){e!==s&&(t==="title"&&Se(this,te,s!==null&&(this.date&&k(this,U,"m",Nn).call(this,this.date))!==s,"f"),!k(this,ee,"f")&&!(t==="title"&&k(this,te,"f"))&&Se(this,ee,(async()=>{await Promise.resolve(),this.update(),Se(this,ee,!1,"f")})(),"f"))}update(){const t=k(this,mt,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let s=e;const i=this.date;if(typeof Intl>"u"||!Intl.DateTimeFormat||!i){k(this,mt,"f").textContent=t;return}const r=Date.now();k(this,te,"f")||(s=k(this,U,"m",Nn).call(this,i)||"",s&&!this.noTitle&&this.setAttribute("title",s));const o=nf(i,this.precision,r),a=k(this,U,"m",Po).call(this,o);let l=t;a==="duration"?l=k(this,U,"m",Bo).call(this,o):a==="relative"?l=k(this,U,"m",Ro).call(this,o):l=k(this,U,"m",Io).call(this,i),l?k(this,mt,"f").textContent=l:this.shadowRoot===k(this,mt,"f")&&this.textContent&&(k(this,mt,"f").textContent=this.textContent),(l!==t||s!==e)&&this.dispatchEvent(new of(t,l,e,s)),a==="relative"||a==="duration"?hn.observe(this):hn.unobserve(this)}}te=new WeakMap,ee=new WeakMap,mt=new WeakMap,Mt=new WeakMap,U=new WeakSet,qt=function(){var t;const e=((t=this.closest("[lang]"))===null||t===void 0?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale(e??"").toString()}catch{return"default"}},Nn=function(t){return new Intl.DateTimeFormat(k(this,U,"a",qt),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},Po=function(t){const e=this.format;if(e==="datetime")return"datetime";if(e==="duration"||e==="elapsed"||e==="micro")return"duration";if((e==="auto"||e==="relative")&&typeof Intl<"u"&&Intl.RelativeTimeFormat){const s=this.tense;if(s==="past"||s==="future"||j.compare(t,this.threshold)===1)return"relative"}return"datetime"},Bo=function(t){const e=k(this,U,"a",qt),s=this.format,i=this.formatStyle,r=this.tense;let o=un;s==="micro"?(t=_o(t),o=Ui,(this.tense==="past"&&t.sign!==-1||this.tense==="future"&&t.sign!==1)&&(t=Ui)):(r==="past"&&t.sign!==-1||r==="future"&&t.sign!==1)&&(t=o);const a=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:i,[a]:"always"}):t.abs().toLocaleString(e,{style:i})},Ro=function(t){const e=new Intl.RelativeTimeFormat(k(this,U,"a",qt),{numeric:"auto",style:this.formatStyle}),s=this.tense;s==="future"&&t.sign!==1&&(t=un),s==="past"&&t.sign!==-1&&(t=un);const[i,r]=sf(t);return r==="second"&&i<10?e.format(0,this.precision==="millisecond"?"second":this.precision):e.format(i,r)},Io=function(t){const e=new Intl.DateTimeFormat(k(this,U,"a",qt),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${e.format(t)}`.trim()};const zi=typeof globalThis<"u"?globalThis:window;try{zi.RelativeTimeElement=af.define()}catch(n){if(!(zi.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}class lf extends I()({targets:{}}){}const cf=Object.freeze(Object.defineProperty({__proto__:null,default:lf},Symbol.toStringTag,{value:"Module"}));function uf(){return/Mac|iMac|Macintosh|MacIntel/.test(navigator.userAgent)}class hf extends I()({targets:{alt:HTMLSpanElement,ctrl:HTMLSpanElement,shift:HTMLSpanElement}}){replaceSymbol(t,e){for(const s of t)s.innerText=e,s.classList.add("!font-fallback")}connect(){this.replaceSymbol(this.shiftTargets,"⇧"),uf()&&(this.replaceSymbol(this.ctrlTargets,"⌘"),this.replaceSymbol(this.altTargets,"⌥"))}}const df=Object.freeze(Object.defineProperty({__proto__:null,default:hf},Symbol.toStringTag,{value:"Module"})),Ue=class Ue extends ut{connect(){Od(this)}save(){this.hasFormTarget?this.formTarget.requestSubmit():this.element.requestSubmit()}};Ue.debounces=["save"],Ue.targets=["form"];let $n=Ue;const ff=Object.freeze(Object.defineProperty({__proto__:null,default:$n},Symbol.toStringTag,{value:"Module"}));class mf extends I()({targets:{button:HTMLButtonElement,form:HTMLFormElement}}){get form(){return this.hasFormTarget?this.formTarget:this.element}runCheck(){this.buttonTarget.disabled=!this.form.checkValidity()}connect(){this.form.addEventListener("input",()=>this.runCheck()),this.runCheck(),Lo(this,{childList:!0,subtree:!0})}mutate(){this.runCheck()}}const pf=Object.freeze(Object.defineProperty({__proto__:null,default:mf},Symbol.toStringTag,{value:"Module"}));class gf extends I()({targets:{perPage:HTMLSelectElement}}){connect(){}perPageChange(t){t.preventDefault();const s=t.target.value,i=new URL(window.location.href);new URLSearchParams(s.split("?")[1]).forEach((o,a)=>{i.searchParams.set(a,o)}),window.location.href=i.toString()}navigate(t){const e=t.target.closest("a");e&&(t.preventDefault(),window.location.href=e.href)}}const bf=Object.freeze(Object.defineProperty({__proto__:null,default:gf},Symbol.toStringTag,{value:"Module"})),yf=8,vf=8;class wf extends I()({targets:{activator:HTMLElement,wrapper:HTMLDivElement,tooltip:HTMLDivElement,arrow:HTMLDivElement,text:HTMLSpanElement}}){async update(){const t=this.element.getAttribute("data-placement")||"top";bs(this.activatorTarget,this.tooltipTarget,{placement:t,middleware:[ms(yf+vf),gs({padding:8}),ps({padding:8}),vd({element:this.arrowTarget})]}).then(({x:e,y:s,placement:i,middlewareData:r})=>{Object.assign(this.tooltipTarget.style,{left:`${e}px`,top:`${s}px`});const o=i.split("-")[0];this.tooltipTarget.setAttribute("data-side",o),this.arrowTarget.setAttribute("data-side",o);const{x:a,y:l}=r.arrow||{},c={top:"bottom",right:"left",bottom:"top",left:"right"}[o],u={left:a!=null?`${a}px`:"",top:l!=null?`${l}px`:"",right:"",bottom:""};c==="top"?u.bottom="-8px":c==="bottom"?u.top="-8px":c==="left"?u.right="-8px":c==="right"&&(u.left="-8px"),Object.assign(this.arrowTarget.style,u)})}showTooltip(t){this.wrapperTarget.classList.add("ariadne:block"),this.wrapperTarget.classList.remove("ariadne:hidden"),this.update()}hideTooltip(t){this.wrapperTarget.classList.add("ariadne:hidden"),this.wrapperTarget.classList.remove("ariadne:block")}}const Ef=Object.freeze(Object.defineProperty({__proto__:null,default:wf},Symbol.toStringTag,{value:"Module"})),Ze=hl.start();Ze.debug=!1;window.Stimulus=Ze;const Tf=Object.assign({"../../components/ariadne/form/toggle/component.ts":Cl,"../../components/ariadne/layout/sidebar/group/component.ts":kl,"../../components/ariadne/ui/accordion/component.ts":kh,"../../components/ariadne/ui/banner/component.ts":Fh,"../../components/ariadne/ui/clipboard_copy/component.ts":$h,"../../components/ariadne/ui/combobox/component.ts":Vd,"../../components/ariadne/ui/dialog/component.ts":Ud,"../../components/ariadne/ui/list/component.ts":zd,"../../components/ariadne/ui/popover/component.ts":Yd,"../../components/ariadne/ui/relative_time/component.ts":cf,"../../components/ariadne/ui/shortcut/component.ts":df});for(const[n,t]of Object.entries(Tf)){const e=n.split("/"),s=e.slice(3,e.length-1).join("-").replaceAll("_","-").toLocaleLowerCase();Ze.register(s,t.default)}const Af=Object.assign({"/controllers/form_autosubmit_controller.ts":ff,"/controllers/form_validity_controller.ts":pf,"/controllers/pagination_controller.ts":bf,"/controllers/tooltip_controller.ts":Ef});for(const[n,t]of Object.entries(Af)){const e=n.split("/"),s=e[e.length-1].replace("_controller.ts","").replaceAll("_","-").toLocaleLowerCase();Ze.register(`ariadne-${s}`,t.default)}
|
98
|
+
%o`,e,t,s),(i=window.onerror)===null||i===void 0||i.call(window,e,"",0,0,t)}logFormattedMessage(t,e,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${t} #${e}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}}function gl(){return new Promise(n=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>n()):n()})}function bl(n){return fe(n,"classes").reduce((e,s)=>Object.assign(e,yl(s)),{})}function yl(n){return{[`${n}Class`]:{get(){const{classes:t}=this;if(t.has(n))return t.get(n);{const e=t.getAttributeName(n);throw new Error(`Missing attribute "${e}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${de(n)}Class`]:{get(){return this.classes.has(n)}}}}function vl(n){return fe(n,"outlets").reduce((e,s)=>Object.assign(e,wl(s)),{})}function oi(n,t,e){return n.application.getControllerForElementAndIdentifier(t,e)}function ai(n,t,e){let s=oi(n,t,e);if(s||(n.application.router.proposeToConnectScopeForElementAndIdentifier(t,e),s=oi(n,t,e),s))return s}function wl(n){const t=gn(n);return{[`${t}Outlet`]:{get(){const e=this.outlets.find(n),s=this.outlets.getSelectorForOutletName(n);if(e){const i=ai(this,e,n);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${n}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${n}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${t}Outlets`]:{get(){const e=this.outlets.findAll(n);return e.length>0?e.map(s=>{const i=ai(this,s,n);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${n}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${t}OutletElement`]:{get(){const e=this.outlets.find(n),s=this.outlets.getSelectorForOutletName(n);if(e)return e;throw new Error(`Missing outlet element "${n}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(n)}},[`has${de(t)}Outlet`]:{get(){return this.outlets.has(n)}}}}function El(n){return fe(n,"targets").reduce((e,s)=>Object.assign(e,Tl(s)),{})}function Tl(n){return{[`${n}Target`]:{get(){const t=this.targets.find(n);if(t)return t;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${de(n)}Target`]:{get(){return this.targets.has(n)}}}}function Al(n){const t=qa(n,"values"),e={valueDescriptorMap:{get(){return t.reduce((s,i)=>{const r=pr(i,this.identifier),o=this.data.getAttributeNameForKey(r.key);return Object.assign(s,{[o]:r})},{})}}};return t.reduce((s,i)=>Object.assign(s,xl(i)),e)}function xl(n,t){const e=pr(n,t),{key:s,name:i,reader:r,writer:o}=e;return{[i]:{get(){const a=this.data.get(s);return a!==null?r(a):e.defaultValue},set(a){a===void 0?this.data.delete(s):this.data.set(s,o(a))}},[`has${de(i)}`]:{get(){return this.data.has(s)||e.hasCustomDefaultValue}}}}function pr([n,t],e){return Cl({controller:e,token:n,typeDefinition:t})}function De(n){switch(n){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function oe(n){switch(typeof n){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(n))return"array";if(Object.prototype.toString.call(n)==="[object Object]")return"object"}function Sl(n){const{controller:t,token:e,typeObject:s}=n,i=ni(s.type),r=ni(s.default),o=i&&r,a=i&&!r,l=!i&&r,c=De(s.type),u=oe(n.typeObject.default);if(a)return c;if(l)return u;if(c!==u){const h=t?`${t}.${e}`:e;throw new Error(`The specified default value for the Stimulus Value "${h}" must match the defined type "${c}". The provided default value of "${s.default}" is of type "${u}".`)}if(o)return c}function Ml(n){const{controller:t,token:e,typeDefinition:s}=n,r=Sl({controller:t,token:e,typeObject:s}),o=oe(s),a=De(s),l=r||o||a;if(l)return l;const c=t?`${t}.${s}`:e;throw new Error(`Unknown value type "${c}" for "${e}" value`)}function Ol(n){const t=De(n);if(t)return li[t];const e=bn(n,"default"),s=bn(n,"type"),i=n;if(e)return i.default;if(s){const{type:r}=i,o=De(r);if(o)return li[o]}return n}function Cl(n){const{token:t,typeDefinition:e}=n,s=`${lr(t)}-value`,i=Ml(n);return{type:i,key:s,name:Un(s),get defaultValue(){return Ol(e)},get hasCustomDefaultValue(){return oe(e)!==void 0},reader:kl[i],writer:ci[i]||ci.default}}const li={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},kl={array(n){const t=JSON.parse(n);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${n}" of type "${oe(t)}"`);return t},boolean(n){return!(n=="0"||String(n).toLowerCase()=="false")},number(n){return Number(n.replace(/_/g,""))},object(n){const t=JSON.parse(n);if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${n}" of type "${oe(t)}"`);return t},string(n){return n}},ci={default:Dl,array:ui,object:ui};function ui(n){return JSON.stringify(n)}function Dl(n){return`${n}`}let it=class{constructor(t){this.context=t}static get shouldLoad(){return!0}static afterLoad(t,e){}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(t,{target:e=this.element,detail:s={},prefix:i=this.identifier,bubbles:r=!0,cancelable:o=!0}={}){const a=i?`${i}:${t}`:t,l=new CustomEvent(a,{detail:s,bubbles:r,cancelable:o});return e.dispatchEvent(l),l}};it.blessings=[bl,El,Al,vl];it.targets=[];it.outlets=[];it.values={};function I(){return function({targets:t,values:e}={}){const i=class i extends it{dispatchEvent(o,a,l={}){const c=new Event(a,{bubbles:l.bubbles||!1,cancelable:l.cancelable||!1});o.dispatchEvent(c)}};i.targets=Object.keys(t??{}),i.values=e??{};let s=i;return s}}class Ll extends I()({targets:{toggle:HTMLInputElement},values:{formMethod:String,formUrl:String,csrfToken:String,turbo:Boolean}}){connect(){this.toggling=!1}requiresFormSubmit(){return this.formUrlValue!=null}async toggle(){if(!this.toggling&&(this.toggling=!0,!this.isDisabled())){if(!this.requiresFormSubmit()){this.performToggle(),this.toggling=!1;return}this.performToggle();try{await this.submitForm()}catch(t){t instanceof Error&&this.performToggle();return}finally{this.toggling=!1}}}performToggle(){this.isOn()?this.turnOff():this.turnOn()}turnOn(){this.isDisabled()||this.toggleTarget.setAttribute("aria-pressed","true")}turnOff(){this.isDisabled()||this.toggleTarget.setAttribute("aria-pressed","false")}isOn(){return this.toggleTarget.getAttribute("aria-pressed")==="true"}isOff(){return!this.isOn()}isDisabled(){return this.toggleTarget.getAttribute("disabled")!=null}async submitForm(){const t=new FormData,e=this.documentCsrfToken()||this.csrfTokenValue;if(e&&t.append(this.csrfField(),e),t.append(this.toggleTarget.name,this.isOn()?"true":"false"),!this.formUrlValue)throw new Error("invalid src");let s;const i={"Requested-With":"XMLHttpRequest"};this.turboValue&&(i.Accept="text/vnd.turbo-stream.html");try{s=await fetch(this.formUrlValue,{credentials:"same-origin",method:this.formMethodValue,headers:i,body:t})}catch(o){throw new Error(`A network error occurred, please try again: ${o.message}`)}if(!s.ok)throw new Error(await s.text());const r=s.headers.get("Content-Type");window.Turbo&&this.turbo&&(r!=null&&r.startsWith("text/vnd.turbo-stream.html"))&&window.Turbo.renderStreamMessage(await s.text())}csrfField(){return this.toggleTarget.getAttribute("csrf-field")||"authenticity_token"}documentCsrfToken(){const t=document.querySelector("meta[name=csrf-token]");return t&&t.getAttribute("content")}}const Fl=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"})),Es=class Es extends I()({targets:{content:HTMLElement,chevron:HTMLElement},values:{open:{type:Boolean,default:!1}}}){connect(){this.applyState(this.openValue)}toggle(t){t&&t.stopPropagation(),this.openValue=!this.openValue}openValueChanged(t){this.applyState(t)}applyState(t){const e=this.contentTarget,s=this.hasChevronTarget?this.chevronTarget:null,i=e.scrollHeight;t?(e.classList.add("ariadne:animate-accordion-down"),e.classList.remove("ariadne:animate-accordion-up"),e.style.height=`${i}px`,this.element.classList.add("ariadne-sidebar-group-open"),this.element.classList.remove("ariadne-sidebar-group-closed"),s&&s.classList.add("ariadne:rotate-90"),setTimeout(()=>{this.openValue&&(e.style.height="auto")},200)):(e.classList.add("ariadne:animate-accordion-up"),e.classList.remove("ariadne:animate-accordion-down"),e.style.height=`${i}px`,e.offsetHeight,e.style.height="0px",this.element.classList.add("ariadne-sidebar-group-closed"),this.element.classList.remove("ariadne-sidebar-group-open"),s&&s.classList.remove("ariadne:rotate-90"))}};Es.classes=["open","closed"];let vn=Es;const Vl=Object.freeze(Object.defineProperty({__proto__:null,default:vn},Symbol.toStringTag,{value:"Module"})),Et=n=>n;let gr=Et;function _l(n,t){n.indexOf(t)===-1&&n.push(t)}function br(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}class yr{constructor(){this.subscriptions=[]}add(t){return _l(this.subscriptions,t),()=>br(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,e,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function vr(n,t){return t?n*(1e3/t):0}const Pl={useManualTiming:!1},Te=["read","resolveKeyframes","update","preRender","render","postRender"];function Rl(n,t){let e=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),n()),u(a)}const c={schedule:(u,h=!1,d=!1)=>{const f=d&&i?e:s;return h&&o.add(u),f.has(u)||f.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[e,s]=[s,e],e.forEach(l),e.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const Bl=40;function Il(n,t){let e=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>e=!0,o=Te.reduce((p,v)=>(p[v]=Rl(r),p),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:h,postRender:d}=o,m=()=>{const p=performance.now();e=!1,i.delta=s?1e3/60:Math.max(Math.min(p-i.timestamp,Bl),1),i.timestamp=p,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),i.isProcessing=!1,e&&t&&(s=!1,n(m))},f=()=>{e=!0,s=!0,i.isProcessing||n(m)};return{schedule:Te.reduce((p,v)=>{const E=o[v];return p[v]=(w,y=!1,T=!1)=>(e||f(),E.schedule(w,y,T)),p},{}),cancel:p=>{for(let v=0;v<Te.length;v++)o[Te[v]].cancel(p)},state:i,steps:o}}const{schedule:Z,cancel:wn,state:Le}=Il(typeof requestAnimationFrame<"u"?requestAnimationFrame:Et,!0);let Ce;function Nl(){Ce=void 0}const at={now:()=>(Ce===void 0&&at.set(Le.isProcessing||Pl.useManualTiming?Le.timestamp:performance.now()),Ce),set:n=>{Ce=n,queueMicrotask(Nl)}},hi=30,$l=n=>!isNaN(parseFloat(n));class jl{constructor(t,e={}){this.version="12.6.1",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=at.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=at.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$l(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new yr);const s=this.events[t].add(e);return t==="change"?()=>{s(),Z.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){!e||!this.passiveEffect?this.updateAndNotify(t,e):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=at.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hi)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,hi);return vr(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ae(n,t){return new jl(n,t)}function Kl(n,t,e){var s;if(n instanceof EventTarget)return[n];if(typeof n=="string"){let i=document;const r=(s=e==null?void 0:e[n])!==null&&s!==void 0?s:i.querySelectorAll(n);return r?Array.from(r):[]}return Array.from(n)}const We=(n,t,e)=>{const s=t-n;return s===0?1:(e-n)/s};function zn(n){let t;return()=>(t===void 0&&(t=n()),t)}const Hl=zn(()=>window.ScrollTimeline!==void 0);class Ul{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=e}attachTimeline(t,e){const s=this.animations.map(i=>{if(Hl()&&i.attachTimeline)return i.attachTimeline(t);if(typeof e=="function")return e(i)});return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class wr extends Ul{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}const nt=n=>n*1e3,st=n=>n/1e3,Fe=2e4;function qn(n){let t=0;const e=50;let s=n.next(t);for(;!s.done&&t<Fe;)t+=e,s=n.next(t);return t>=Fe?1/0:t}const Er=(n,t,e=10)=>{let s="";const i=Math.max(Math.round(t/e),2);for(let r=0;r<i;r++)s+=n(We(0,i-1,r))+", ";return`linear(${s.substring(0,s.length-2)})`},Tt=(n,t,e)=>e>t?t:e<n?n:e,Wl=5;function Tr(n,t,e){const s=Math.max(t-Wl,0);return vr(e-n(s),t-s)}const C={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},di=.001;function zl({duration:n=C.duration,bounce:t=C.bounce,velocity:e=C.velocity,mass:s=C.mass}){let i,r,o=1-t;o=Tt(C.minDamping,C.maxDamping,o),n=Tt(C.minDuration,C.maxDuration,st(n)),o<1?(i=c=>{const u=c*o,h=u*n,d=u-e,m=En(c,o),f=Math.exp(-h);return di-d/m*f},r=c=>{const h=c*o*n,d=h*e+e,m=Math.pow(o,2)*Math.pow(c,2)*n,f=Math.exp(-h),g=En(Math.pow(c,2),o);return(-i(c)+di>0?-1:1)*((d-m)*f)/g}):(i=c=>{const u=Math.exp(-c*n),h=(c-e)*n+1;return-.001+u*h},r=c=>{const u=Math.exp(-c*n),h=(e-c)*(n*n);return u*h});const a=5/n,l=Yl(i,r,a);if(n=nt(n),isNaN(l))return{stiffness:C.stiffness,damping:C.damping,duration:n};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:n}}}const ql=12;function Yl(n,t,e){let s=e;for(let i=1;i<ql;i++)s=s-n(s)/t(s);return s}function En(n,t){return n*Math.sqrt(1-t*t)}const Xl=["duration","bounce"],Gl=["stiffness","damping","mass"];function fi(n,t){return t.some(e=>n[e]!==void 0)}function Zl(n){let t={velocity:C.velocity,stiffness:C.stiffness,damping:C.damping,mass:C.mass,isResolvedFromDuration:!1,...n};if(!fi(n,Gl)&&fi(n,Xl))if(n.visualDuration){const e=n.visualDuration,s=2*Math.PI/(e*1.2),i=s*s,r=2*Tt(.05,1,1-(n.bounce||0))*Math.sqrt(i);t={...t,mass:C.mass,stiffness:i,damping:r}}else{const e=zl(n);t={...t,...e,mass:C.mass},t.isResolvedFromDuration=!0}return t}function Yn(n=C.visualDuration,t=C.bounce){const e=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:t}:n;let{restSpeed:s,restDelta:i}=e;const r=e.keyframes[0],o=e.keyframes[e.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:m}=Zl({...e,velocity:-st(e.velocity||0)}),f=d||0,g=c/(2*Math.sqrt(l*u)),b=o-r,p=st(Math.sqrt(l/u)),v=Math.abs(b)<5;s||(s=v?C.restSpeed.granular:C.restSpeed.default),i||(i=v?C.restDelta.granular:C.restDelta.default);let E;if(g<1){const y=En(p,g);E=T=>{const S=Math.exp(-g*p*T);return o-S*((f+g*p*b)/y*Math.sin(y*T)+b*Math.cos(y*T))}}else if(g===1)E=y=>o-Math.exp(-p*y)*(b+(f+p*b)*y);else{const y=p*Math.sqrt(g*g-1);E=T=>{const S=Math.exp(-g*p*T),A=Math.min(y*T,300);return o-S*((f+g*p*b)*Math.sinh(A)+y*b*Math.cosh(A))/y}}const w={calculatedDuration:m&&h||null,next:y=>{const T=E(y);if(m)a.done=y>=h;else{let S=0;g<1&&(S=y===0?nt(f):Tr(E,y,T));const A=Math.abs(S)<=s,M=Math.abs(o-T)<=i;a.done=A&&M}return a.value=a.done?o:T,a},toString:()=>{const y=Math.min(qn(w),Fe),T=Er(S=>w.next(y*S).value,y,30);return y+"ms "+T}};return w}function Ql(n,t=100,e){const s=e({...n,keyframes:[0,t]}),i=Math.min(qn(s),Fe);return{type:"keyframes",ease:r=>s.next(i*r).value/t,duration:st(i)}}function ze(n){return typeof n=="function"}const Jl=(n,t,e)=>{const s=t-n;return((e-n)%s+s)%s+n},Ar=n=>Array.isArray(n)&&typeof n[0]!="number";function xr(n,t){return Ar(n)?n[Jl(0,n.length,t)]:n}const me=(n,t,e)=>n+(t-n)*e;function Sr(n,t){const e=n[n.length-1];for(let s=1;s<=t;s++){const i=We(0,t,s);n.push(me(e,1,i))}}function Mr(n){const t=[0];return Sr(t,n.length-1),t}const P=n=>!!(n&&n.getVelocity);function Xn(n){return typeof n=="object"&&!Array.isArray(n)}function Or(n,t,e,s){return typeof n=="string"&&Xn(t)?Kl(n,e,s):n instanceof NodeList?Array.from(n):Array.isArray(n)?n:[n]}function tc(n,t,e){return n*(t+1)}function mi(n,t,e,s){var i;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,n+parseFloat(t)):t==="<"?e:(i=s.get(t))!==null&&i!==void 0?i:n}function ec(n,t,e){for(let s=0;s<n.length;s++){const i=n[s];i.at>t&&i.at<e&&(br(n,i),s--)}}function nc(n,t,e,s,i,r){ec(n,i,r);for(let o=0;o<t.length;o++)n.push({value:t[o],at:me(i,r,s[o]),easing:xr(e,o)})}function sc(n,t){for(let e=0;e<n.length;e++)n[e]=n[e]/(t+1)}function ic(n,t){return n.at===t.at?n.value===null?1:t.value===null?-1:0:n.at-t.at}const rc="easeInOut";function oc(n,{defaultTransition:t={},...e}={},s,i){const r=t.duration||.3,o=new Map,a=new Map,l={},c=new Map;let u=0,h=0,d=0;for(let m=0;m<n.length;m++){const f=n[m];if(typeof f=="string"){c.set(f,h);continue}else if(!Array.isArray(f)){c.set(f.name,mi(h,f.at,u,c));continue}let[g,b,p={}]=f;p.at!==void 0&&(h=mi(h,p.at,u,c));let v=0;const E=(w,y,T,S=0,A=0)=>{const M=ac(w),{delay:O=0,times:L=Mr(M),type:B="keyframes",repeat:N,repeatType:V,repeatDelay:ht=0,...W}=y;let{ease:F=t.ease||"easeOut",duration:D}=y;const z=typeof O=="function"?O(S,A):O,ye=M.length,xs=ze(B)?B:i==null?void 0:i[B];if(ye<=2&&xs){let Ht=100;if(ye===2&&uc(M)){const Ut=M[1]-M[0];Ht=Math.abs(Ut)}const ve={...W};D!==void 0&&(ve.duration=nt(D));const we=Ql(ve,Ht,xs);F=we.ease,D=we.duration}D??(D=r);const Ss=h+z;L.length===1&&L[0]===0&&(L[1]=1);const Ms=L.length-M.length;if(Ms>0&&Sr(L,Ms),M.length===1&&M.unshift(null),N){D=tc(D,N);const Ht=[...M],ve=[...L];F=Array.isArray(F)?[...F]:[F];const we=[...F];for(let Ut=0;Ut<N;Ut++){M.push(...Ht);for(let Wt=0;Wt<Ht.length;Wt++)L.push(ve[Wt]+(Ut+1)),F.push(Wt===0?"linear":xr(we,Wt-1))}sc(L,N)}const Os=Ss+D;nc(T,M,F,L,Ss,Os),v=Math.max(z+D,v),d=Math.max(Os,d)};if(P(g)){const w=pi(g,a);E(b,p,gi("default",w))}else{const w=Or(g,b,s,l),y=w.length;for(let T=0;T<y;T++){b=b,p=p;const S=w[T],A=pi(S,a);for(const M in b)E(b[M],lc(p,M),gi(M,A),T,y)}}u=h,h+=v}return a.forEach((m,f)=>{for(const g in m){const b=m[g];b.sort(ic);const p=[],v=[],E=[];for(let y=0;y<b.length;y++){const{at:T,value:S,easing:A}=b[y];p.push(S),v.push(We(0,d,T)),E.push(A||"easeOut")}v[0]!==0&&(v.unshift(0),p.unshift(p[0]),E.unshift(rc)),v[v.length-1]!==1&&(v.push(1),p.push(null)),o.has(f)||o.set(f,{keyframes:{},transition:{}});const w=o.get(f);w.keyframes[g]=p,w.transition[g]={...t,duration:d,ease:E,times:v,...e}}}),o}function pi(n,t){return!t.has(n)&&t.set(n,{}),t.get(n)}function gi(n,t){return t[n]||(t[n]=[]),t[n]}function ac(n){return Array.isArray(n)?n:[n]}function lc(n,t){return n&&n[t]?{...n,...n[t]}:{...n}}const cc=n=>typeof n=="number",uc=n=>n.every(cc),le=new WeakMap;function Cr(n,t){return n?n[t]||n.default||n:void 0}const Rt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bt=new Set(Rt),kr=new Set(["width","height","top","left","right","bottom",...Rt]),hc=n=>Array.isArray(n),dc=n=>hc(n)?n[n.length-1]||0:n;function bi(n){const t=[{},{}];return n==null||n.values.forEach((e,s)=>{t[0][s]=e.get(),t[1][s]=e.getVelocity()}),t}function Dr(n,t,e,s){if(typeof t=="function"){const[i,r]=bi(s);t=t(e!==void 0?e:n.custom,i,r)}if(typeof t=="string"&&(t=n.variants&&n.variants[t]),typeof t=="function"){const[i,r]=bi(s);t=t(e!==void 0?e:n.custom,i,r)}return t}function fc(n,t,e){const s=n.getProps();return Dr(s,t,s.custom,n)}function mc(n,t,e){n.hasValue(t)?n.getValue(t).set(e):n.addValue(t,ae(e))}function pc(n,t){const e=fc(n,t);let{transitionEnd:s={},transition:i={},...r}=e||{};r={...r,...s};for(const o in r){const a=dc(r[o]);mc(n,o,a)}}function gc(n){return!!(P(n)&&n.add)}function bc(n,t){const e=n.getValue("willChange");if(gc(e))return e.add(t)}const Gn=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yc="framerAppearId",vc="data-"+Gn(yc);function wc(n){return n.props[vc]}function yi(n,t){n.timeline=t,n.onfinish=null}const Zn=n=>Array.isArray(n)&&typeof n[0]=="number",Ec={linearEasing:void 0};function Tc(n,t){const e=zn(n);return()=>{var s;return(s=Ec[t])!==null&&s!==void 0?s:e()}}const Ve=Tc(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function Lr(n){return!!(typeof n=="function"&&Ve()||!n||typeof n=="string"&&(n in Tn||Ve())||Zn(n)||Array.isArray(n)&&n.every(Lr))}const Qt=([n,t,e,s])=>`cubic-bezier(${n}, ${t}, ${e}, ${s})`,Tn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qt([0,.65,.55,1]),circOut:Qt([.55,0,1,.45]),backIn:Qt([.31,.01,.66,-.59]),backOut:Qt([.33,1.53,.69,.99])};function Fr(n,t){if(n)return typeof n=="function"&&Ve()?Er(n,t):Zn(n)?Qt(n):Array.isArray(n)?n.map(e=>Fr(e,t)||Tn.easeOut):Tn[n]}const Vr=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n,Ac=1e-7,xc=12;function Sc(n,t,e,s,i){let r,o,a=0;do o=t+(e-t)/2,r=Vr(o,s,i)-n,r>0?e=o:t=o;while(Math.abs(r)>Ac&&++a<xc);return o}function pe(n,t,e,s){if(n===t&&e===s)return Et;const i=r=>Sc(r,0,1,n,e);return r=>r===0||r===1?r:Vr(i(r),t,s)}const _r=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,Pr=n=>t=>1-n(1-t),Rr=pe(.33,1.53,.69,.99),Qn=Pr(Rr),Br=_r(Qn),Ir=n=>(n*=2)<1?.5*Qn(n):.5*(2-Math.pow(2,-10*(n-1))),Jn=n=>1-Math.sin(Math.acos(n)),Mc=Pr(Jn),Nr=_r(Jn),$r=n=>/^0[^.\s]+$/u.test(n);function Oc(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||$r(n):!0}const It={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},ce={...It,transform:n=>Tt(0,1,n)},Ae={...It,default:1},ne=n=>Math.round(n*1e5)/1e5,ts=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Cc(n){return n==null}const kc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,es=(n,t)=>e=>!!(typeof e=="string"&&kc.test(e)&&e.startsWith(n)||t&&!Cc(e)&&Object.prototype.hasOwnProperty.call(e,t)),jr=(n,t,e)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(ts);return{[n]:parseFloat(i),[t]:parseFloat(r),[e]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dc=n=>Tt(0,255,n),sn={...It,transform:n=>Math.round(Dc(n))},gt={test:es("rgb","red"),parse:jr("red","green","blue"),transform:({red:n,green:t,blue:e,alpha:s=1})=>"rgba("+sn.transform(n)+", "+sn.transform(t)+", "+sn.transform(e)+", "+ne(ce.transform(s))+")"};function Lc(n){let t="",e="",s="",i="";return n.length>5?(t=n.substring(1,3),e=n.substring(3,5),s=n.substring(5,7),i=n.substring(7,9)):(t=n.substring(1,2),e=n.substring(2,3),s=n.substring(3,4),i=n.substring(4,5),t+=t,e+=e,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(e,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const An={test:es("#"),parse:Lc,transform:gt.transform},ge=n=>({test:t=>typeof t=="string"&&t.endsWith(n)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${n}`}),rt=ge("deg"),Lt=ge("%"),x=ge("px"),Fc=ge("vh"),Vc=ge("vw"),vi={...Lt,parse:n=>Lt.parse(n)/100,transform:n=>Lt.transform(n*100)},Ot={test:es("hsl","hue"),parse:jr("hue","saturation","lightness"),transform:({hue:n,saturation:t,lightness:e,alpha:s=1})=>"hsla("+Math.round(n)+", "+Lt.transform(ne(t))+", "+Lt.transform(ne(e))+", "+ne(ce.transform(s))+")"},_={test:n=>gt.test(n)||An.test(n)||Ot.test(n),parse:n=>gt.test(n)?gt.parse(n):Ot.test(n)?Ot.parse(n):An.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?gt.transform(n):Ot.transform(n)},_c=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Pc(n){var t,e;return isNaN(n)&&typeof n=="string"&&(((t=n.match(ts))===null||t===void 0?void 0:t.length)||0)+(((e=n.match(_c))===null||e===void 0?void 0:e.length)||0)>0}const Kr="number",Hr="color",Rc="var",Bc="var(",wi="${}",Ic=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ue(n){const t=n.toString(),e=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=t.replace(Ic,l=>(_.test(l)?(s.color.push(r),i.push(Hr),e.push(_.parse(l))):l.startsWith(Bc)?(s.var.push(r),i.push(Rc),e.push(l)):(s.number.push(r),i.push(Kr),e.push(parseFloat(l))),++r,wi)).split(wi);return{values:e,split:a,indexes:s,types:i}}function Ur(n){return ue(n).values}function Wr(n){const{split:t,types:e}=ue(n),s=t.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=t[o],i[o]!==void 0){const a=e[o];a===Kr?r+=ne(i[o]):a===Hr?r+=_.transform(i[o]):r+=i[o]}return r}}const Nc=n=>typeof n=="number"?0:n;function $c(n){const t=Ur(n);return Wr(n)(t.map(Nc))}const Nt={test:Pc,parse:Ur,createTransformer:Wr,getAnimatableNone:$c},jc=new Set(["brightness","contrast","saturate","opacity"]);function Kc(n){const[t,e]=n.slice(0,-1).split("(");if(t==="drop-shadow")return n;const[s]=e.match(ts)||[];if(!s)return n;const i=e.replace(s,"");let r=jc.has(t)?1:0;return s!==e&&(r*=100),t+"("+r+i+")"}const Hc=/\b([a-z-]*)\(.*?\)/gu,xn={...Nt,getAnimatableNone:n=>{const t=n.match(Hc);return t?t.map(Kc).join(" "):n}},Uc={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,backgroundPositionX:x,backgroundPositionY:x},Wc={rotate:rt,rotateX:rt,rotateY:rt,rotateZ:rt,scale:Ae,scaleX:Ae,scaleY:Ae,scaleZ:Ae,skew:rt,skewX:rt,skewY:rt,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:ce,originX:vi,originY:vi,originZ:x},Ei={...It,transform:Math.round},ns={...Uc,...Wc,zIndex:Ei,size:x,fillOpacity:ce,strokeOpacity:ce,numOctaves:Ei},zc={...ns,color:_,backgroundColor:_,outlineColor:_,fill:_,stroke:_,borderColor:_,borderTopColor:_,borderRightColor:_,borderBottomColor:_,borderLeftColor:_,filter:xn,WebkitFilter:xn},zr=n=>zc[n];function qr(n,t){let e=zr(n);return e!==xn&&(e=Nt),e.getAnimatableNone?e.getAnimatableNone(t):void 0}const qc=new Set(["auto","none","0"]);function Yc(n,t,e){let s=0,i;for(;s<n.length&&!i;){const r=n[s];typeof r=="string"&&!qc.has(r)&&ue(r).values.length&&(i=n[s]),s++}if(i&&e)for(const r of t)n[r]=qr(e,i)}const bt=n=>n*180/Math.PI,Sn=n=>{const t=bt(Math.atan2(n[1],n[0]));return Mn(t)},Xc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:Sn,rotateZ:Sn,skewX:n=>bt(Math.atan(n[1])),skewY:n=>bt(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},Mn=n=>(n=n%360,n<0&&(n+=360),n),Ti=Sn,Ai=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),xi=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),Gc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ai,scaleY:xi,scale:n=>(Ai(n)+xi(n))/2,rotateX:n=>Mn(bt(Math.atan2(n[6],n[5]))),rotateY:n=>Mn(bt(Math.atan2(-n[2],n[0]))),rotateZ:Ti,rotate:Ti,skewX:n=>bt(Math.atan(n[4])),skewY:n=>bt(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function Si(n){return n.includes("scale")?1:0}function On(n,t){if(!n||n==="none")return Si(t);const e=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(e)s=Gc,i=e;else{const a=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Xc,i=a}if(!i)return Si(t);const r=s[t],o=i[1].split(",").map(Qc);return typeof r=="function"?r(o):o[r]}const Zc=(n,t)=>{const{transform:e="none"}=getComputedStyle(n);return On(e,t)};function Qc(n){return parseFloat(n.trim())}const Mi=n=>n===It||n===x,Jc=new Set(["x","y","z"]),tu=Rt.filter(n=>!Jc.has(n));function eu(n){const t=[];return tu.forEach(e=>{const s=n.getValue(e);s!==void 0&&(t.push([e,s.get()]),s.set(e.startsWith("scale")?1:0))}),t}const _t={width:({x:n},{paddingLeft:t="0",paddingRight:e="0"})=>n.max-n.min-parseFloat(t)-parseFloat(e),height:({y:n},{paddingTop:t="0",paddingBottom:e="0"})=>n.max-n.min-parseFloat(t)-parseFloat(e),top:(n,{top:t})=>parseFloat(t),left:(n,{left:t})=>parseFloat(t),bottom:({y:n},{top:t})=>parseFloat(t)+(n.max-n.min),right:({x:n},{left:t})=>parseFloat(t)+(n.max-n.min),x:(n,{transform:t})=>On(t,"x"),y:(n,{transform:t})=>On(t,"y")};_t.translateX=_t.x;_t.translateY=_t.y;const vt=new Set;let Cn=!1,kn=!1;function Yr(){if(kn){const n=Array.from(vt).filter(s=>s.needsMeasurement),t=new Set(n.map(s=>s.element)),e=new Map;t.forEach(s=>{const i=eu(s);i.length&&(e.set(s,i),s.render())}),n.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=e.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),n.forEach(s=>s.measureEndState()),n.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}kn=!1,Cn=!1,vt.forEach(n=>n.complete()),vt.clear()}function Xr(){vt.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(kn=!0)})}function nu(){Xr(),Yr()}class ss{constructor(t,e,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(vt.add(this),Cn||(Cn=!0,Z.read(Xr),Z.resolveKeyframes(Yr))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:i}=this;for(let r=0;r<t.length;r++)if(t[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&e){const l=s.readValue(e,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),vt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,vt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Gr=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),Zr=n=>t=>typeof t=="string"&&t.startsWith(n),Qr=Zr("--"),su=Zr("var(--"),is=n=>su(n)?iu.test(n.split("/*")[0].trim()):!1,iu=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ru=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ou(n){const t=ru.exec(n);if(!t)return[,];const[,e,s,i]=t;return[`--${e??s}`,i]}function Jr(n,t,e=1){const[s,i]=ou(n);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const o=r.trim();return Gr(o)?parseFloat(o):o}return is(i)?Jr(i,t,e+1):i}const to=n=>t=>t.test(n),au={test:n=>n==="auto",parse:n=>n},eo=[It,x,Lt,rt,Vc,Fc,au],Oi=n=>eo.find(to(n));class no extends ss{constructor(t,e,s,i,r){super(t,e,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:s}=this;if(!e||!e.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),is(c))){const u=Jr(c,e.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!kr.has(s)||t.length!==2)return;const[i,r]=t,o=Oi(i),a=Oi(r);if(o!==a)if(Mi(o)&&Mi(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,s=[];for(let i=0;i<t.length;i++)Oc(t[i])&&s.push(i);s.length&&Yc(t,s,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_t[s](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:s,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=_t[s](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Ci=(n,t)=>t==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Nt.test(n)||n==="0")&&!n.startsWith("url("));function lu(n){const t=n[0];if(n.length===1)return!0;for(let e=0;e<n.length;e++)if(n[e]!==t)return!0}function cu(n,t,e,s){const i=n[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=n[n.length-1],o=Ci(i,t),a=Ci(r,t);return!o||!a?!1:lu(n)||(e==="spring"||ze(e))&&s}const uu=n=>n!==null;function qe(n,{repeat:t,repeatType:e="loop"},s){const i=n.filter(uu),r=t&&e!=="loop"&&t%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const hu=40;class so{constructor({autoplay:t=!0,delay:e=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=at.now(),this.options={autoplay:t,delay:e,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>hu?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&nu(),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=at.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!cu(t,s,i,r))if(o)this.options.duration=0;else{l&&l(qe(t,this.options,e)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,e);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function rn(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*(2/3-e)*6:n}function du({hue:n,saturation:t,lightness:e,alpha:s}){n/=360,t/=100,e/=100;let i=0,r=0,o=0;if(!t)i=r=o=e;else{const a=e<.5?e*(1+t):e+t-e*t,l=2*e-a;i=rn(l,a,n+1/3),r=rn(l,a,n),o=rn(l,a,n-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function _e(n,t){return e=>e>0?t:n}const on=(n,t,e)=>{const s=n*n,i=e*(t*t-s)+s;return i<0?0:Math.sqrt(i)},fu=[An,gt,Ot],mu=n=>fu.find(t=>t.test(n));function ki(n){const t=mu(n);if(!t)return!1;let e=t.parse(n);return t===Ot&&(e=du(e)),e}const Di=(n,t)=>{const e=ki(n),s=ki(t);if(!e||!s)return _e(n,t);const i={...e};return r=>(i.red=on(e.red,s.red,r),i.green=on(e.green,s.green,r),i.blue=on(e.blue,s.blue,r),i.alpha=me(e.alpha,s.alpha,r),gt.transform(i))},pu=(n,t)=>e=>t(n(e)),rs=(...n)=>n.reduce(pu),Dn=new Set(["none","hidden"]);function gu(n,t){return Dn.has(n)?e=>e<=0?n:t:e=>e>=1?t:n}function bu(n,t){return e=>me(n,t,e)}function os(n){return typeof n=="number"?bu:typeof n=="string"?is(n)?_e:_.test(n)?Di:wu:Array.isArray(n)?io:typeof n=="object"?_.test(n)?Di:yu:_e}function io(n,t){const e=[...n],s=e.length,i=n.map((r,o)=>os(r)(r,t[o]));return r=>{for(let o=0;o<s;o++)e[o]=i[o](r);return e}}function yu(n,t){const e={...n,...t},s={};for(const i in e)n[i]!==void 0&&t[i]!==void 0&&(s[i]=os(n[i])(n[i],t[i]));return i=>{for(const r in s)e[r]=s[r](i);return e}}function vu(n,t){var e;const s=[],i={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],a=n.indexes[o][i[o]],l=(e=n.values[a])!==null&&e!==void 0?e:0;s[r]=l,i[o]++}return s}const wu=(n,t)=>{const e=Nt.createTransformer(t),s=ue(n),i=ue(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Dn.has(n)&&!i.values.length||Dn.has(t)&&!s.values.length?gu(n,t):rs(io(vu(s,i),i.values),e):_e(n,t)};function ro(n,t,e){return typeof n=="number"&&typeof t=="number"&&typeof e=="number"?me(n,t,e):os(n)(n,t)}function Li({keyframes:n,velocity:t=0,power:e=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=n[0],d={done:!1,value:h},m=A=>a!==void 0&&A<a||l!==void 0&&A>l,f=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let g=e*t;const b=h+g,p=o===void 0?b:o(b);p!==b&&(g=p-h);const v=A=>-g*Math.exp(-A/s),E=A=>p+v(A),w=A=>{const M=v(A),O=E(A);d.done=Math.abs(M)<=c,d.value=d.done?p:O};let y,T;const S=A=>{m(d.value)&&(y=A,T=Yn({keyframes:[d.value,f(d.value)],velocity:Tr(E,A,d.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:A=>{let M=!1;return!T&&y===void 0&&(M=!0,w(A),S(A)),y!==void 0&&A>=y?T.next(A-y):(!M&&w(A),d)}}}const Eu=pe(.42,0,1,1),Tu=pe(0,0,.58,1),oo=pe(.42,0,.58,1),Au={linear:Et,easeIn:Eu,easeInOut:oo,easeOut:Tu,circIn:Jn,circInOut:Nr,circOut:Mc,backIn:Qn,backInOut:Br,backOut:Rr,anticipate:Ir},Fi=n=>{if(Zn(n)){gr(n.length===4);const[t,e,s,i]=n;return pe(t,e,s,i)}else if(typeof n=="string")return Au[n];return n};function xu(n,t,e){const s=[],i=e||ro,r=n.length-1;for(let o=0;o<r;o++){let a=i(n[o],n[o+1]);if(t){const l=Array.isArray(t)?t[o]||Et:t;a=rs(l,a)}s.push(a)}return s}function Su(n,t,{clamp:e=!0,ease:s,mixer:i}={}){const r=n.length;if(gr(r===t.length),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const o=n[0]===n[1];n[0]>n[r-1]&&(n=[...n].reverse(),t=[...t].reverse());const a=xu(t,s,i),l=a.length,c=u=>{if(o&&u<n[0])return t[0];let h=0;if(l>1)for(;h<n.length-2&&!(u<n[h+1]);h++);const d=We(n[h],n[h+1],u);return a[h](d)};return e?u=>c(Tt(n[0],n[r-1],u)):c}function Mu(n,t){return n.map(e=>e*t)}function Ou(n,t){return n.map(()=>t||oo).splice(0,n.length-1)}function Pe({duration:n=300,keyframes:t,times:e,ease:s="easeInOut"}){const i=Ar(s)?s.map(Fi):Fi(s),r={done:!1,value:t[0]},o=Mu(e&&e.length===t.length?e:Mr(t),n),a=Su(o,t,{ease:Array.isArray(i)?i:Ou(t,i)});return{calculatedDuration:n,next:l=>(r.value=a(l),r.done=l>=n,r)}}const Cu=n=>{const t=({timestamp:e})=>n(e);return{start:()=>Z.update(t,!0),stop:()=>wn(t),now:()=>Le.isProcessing?Le.timestamp:at.now()}},ku={decay:Li,inertia:Li,tween:Pe,keyframes:Pe,spring:Yn},Du=n=>n/100;class as extends so{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:e,motionValue:s,element:i,keyframes:r}=this.options,o=(i==null?void 0:i.KeyframeResolver)||ss,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(r,a,e,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=ze(e)?e:ku[e]||Pe;let l,c;a!==Pe&&typeof t[0]!="number"&&(l=rs(Du,ro(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});r==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=qn(u));const{calculatedDuration:h}=u,d=h+i,m=d*(s+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,e=!1){const{resolved:s}=this;if(!s){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:h}=s;if(this.startTime===null)return r.next(0);const{delay:d,repeat:m,repeatType:f,repeatDelay:g,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const p=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?p<0:p>u;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let E=this.currentTime,w=r;if(m){const A=Math.min(this.currentTime,u)/h;let M=Math.floor(A),O=A%1;!O&&A>=1&&(O=1),O===1&&M--,M=Math.min(M,m+1),!!(M%2)&&(f==="reverse"?(O=1-O,g&&(O-=g/h)):f==="mirror"&&(w=o)),E=Tt(0,1,O)*h}const y=v?{done:!1,value:l[0]}:w.next(E);a&&(y.value=a(y.value));let{done:T}=y;!v&&c!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return S&&i!==void 0&&(y.value=qe(l,this.options,i)),b&&b(y.value),S&&this.finish(),y}get duration(){const{resolved:t}=this;return t?st(t.calculatedDuration):0}get time(){return st(this.currentTime)}set time(t){t=nt(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=st(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Cu,onPlay:e,startTime:s}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),e&&e();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Lu=new Set(["opacity","clipPath","filter","transform"]);function Fu(n,t,e,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:e};l&&(c.offset=l);const u=Fr(a,i);return Array.isArray(u)&&(c.easing=u),n.animate(c,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}const Vu=zn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Re=10,_u=2e4;function Pu(n){return ze(n.type)||n.type==="spring"||!Lr(n.ease)}function Ru(n,t){const e=new as({...t,keyframes:n,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:n[0]};const i=[];let r=0;for(;!s.done&&r<_u;)s=e.sample(r),i.push(s.value),r+=Re;return{times:void 0,keyframes:i,duration:r-Re,ease:"linear"}}const ao={anticipate:Ir,backInOut:Br,circInOut:Nr};function Bu(n){return n in ao}class Vi extends so{constructor(t){super(t);const{name:e,motionValue:s,element:i,keyframes:r}=this.options;this.resolver=new no(r,(o,a)=>this.onKeyframesResolved(o,a),e,s,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof r=="string"&&Ve()&&Bu(r)&&(r=ao[r]),Pu(this.options)){const{onComplete:h,onUpdate:d,motionValue:m,element:f,...g}=this.options,b=Ru(t,g);t=b.keyframes,t.length===1&&(t[1]=t[0]),s=b.duration,i=b.times,r=b.ease,o="keyframes"}const u=Fu(a.owner.current,l,t,{...this.options,duration:s,times:i,ease:r});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(yi(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:h}=this.options;a.set(qe(t,this.options,e)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:s,times:i,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return st(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return st(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.currentTime=nt(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:e}=this;if(!e)return Et;const{animation:s}=e;yi(s,t)}return Et}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.playState==="finished"&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:s,duration:i,type:r,ease:o,times:a}=t;if(e.playState==="idle"||e.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:h,element:d,...m}=this.options,f=new as({...m,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),g=nt(this.time);c.setWithVelocity(f.sample(g-Re).value,f.sample(g).value,Re)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Vu()&&s&&Lu.has(s)&&(s!=="transform"||!c)&&!l&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}const Iu={type:"spring",stiffness:500,damping:25,restSpeed:10},Nu=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),$u={type:"keyframes",duration:.8},ju={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ku=(n,{keyframes:t})=>t.length>2?$u:Bt.has(n)?n.startsWith("scale")?Nu(t[1]):Iu:ju;function Hu({when:n,delay:t,delayChildren:e,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const lo=(n,t,e,s={},i,r)=>o=>{const a=Cr(s,n)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-nt(l);let u={keyframes:Array.isArray(e)?e:[null,e],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:n,motionValue:t,element:r?void 0:i};Hu(a)||(u={...u,...Ku(n,u)}),u.duration&&(u.duration=nt(u.duration)),u.repeatDelay&&(u.repeatDelay=nt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),u.allowFlatten=!a.type&&!a.ease,h&&!r&&t.get()!==void 0){const d=qe(u.keyframes,a);if(d!==void 0)return Z.update(()=>{u.onUpdate(d),u.onComplete()}),new wr([])}return!r&&Vi.supports(u)?new Vi(u):new as(u)};function Uu({protectedKeys:n,needsAnimating:t},e){const s=n.hasOwnProperty(e)&&t[e]!==!0;return t[e]=!1,s}function Wu(n,t,{delay:e=0,transitionOverride:s,type:i}={}){var r;let{transition:o=n.getDefaultTransition(),transitionEnd:a,...l}=t;s&&(o=s);const c=[],u=i&&n.animationState&&n.animationState.getState()[i];for(const h in l){const d=n.getValue(h,(r=n.latestValues[h])!==null&&r!==void 0?r:null),m=l[h];if(m===void 0||u&&Uu(u,h))continue;const f={delay:e,...Cr(o||{},h)};let g=!1;if(window.MotionHandoffAnimation){const p=wc(n);if(p){const v=window.MotionHandoffAnimation(p,h,Z);v!==null&&(f.startTime=v,g=!0)}}bc(n,h),d.start(lo(h,d,m,n.shouldReduceMotion&&kr.has(h)?{type:!1}:f,n,g));const b=d.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{Z.update(()=>{a&&pc(n,a)})}),c}function zu(n){return n instanceof SVGElement&&n.tagName!=="svg"}const _i=()=>({min:0,max:0}),ls=()=>({x:_i(),y:_i()}),Pi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ln={};for(const n in Pi)Ln[n]={isEnabled:t=>Pi[n].some(e=>!!t[e])};const qu=typeof window<"u",Fn={current:null},co={current:!1};function Yu(){if(co.current=!0,!!qu)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),t=()=>Fn.current=n.matches;n.addListener(t),t()}else Fn.current=!1}const Xu=[...eo,_,Nt],Gu=n=>Xu.find(to(n));function Zu(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function Qu(n){return typeof n=="string"||Array.isArray(n)}const Ju=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],th=["initial",...Ju];function uo(n){return Zu(n.animate)||th.some(t=>Qu(n[t]))}function eh(n){return!!(uo(n)||n.variants)}function nh(n,t,e){for(const s in t){const i=t[s],r=e[s];if(P(i))n.addValue(s,i);else if(P(r))n.addValue(s,ae(i,{owner:n}));else if(r!==i)if(n.hasValue(s)){const o=n.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=n.getStaticValue(s);n.addValue(s,ae(o!==void 0?o:i,{owner:n}))}}for(const s in e)t[s]===void 0&&n.removeValue(s);return t}const Ri=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ho{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ss,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=at.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Z.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=uo(e),this.isVariantNode=eh(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const m in d){const f=d[m];l[m]!==void 0&&P(f)&&f.set(l[m],!1)}}mount(t){this.current=t,le.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,s)=>this.bindToMotionValue(s,e)),co.current||Yu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Fn.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),wn(this.notifyUpdate),wn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Bt.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Z.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),r(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ln){const e=Ln[t];if(!e)continue;const{isEnabled:s,Feature:i}=e;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ls()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let s=0;s<Ri.length;s++){const i=Ri[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=t[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=nh(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&e!==void 0&&(s=ae(e===null?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Gr(i)||$r(i))?i=parseFloat(i):!Gu(i)&&Nt.test(e)&&(i=qr(t,e)),this.setBaseTarget(t,P(i)?i.get():i)),P(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Dr(this.props,s,(e=this.presenceContext)===null||e===void 0?void 0:e.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!P(r)?r:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,e){return this.events[t]||(this.events[t]=new yr),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class fo extends ho{constructor(){super(...arguments),this.KeyframeResolver=no}sortInstanceNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:s}){delete e[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;P(t)&&(this.childSubscription=t.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}const mo=(n,t)=>t&&typeof n=="number"?t.transform(n):n,sh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ih=Rt.length;function rh(n,t,e){let s="",i=!0;for(let r=0;r<ih;r++){const o=Rt[r],a=n[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||e){const c=mo(a,ns[o]);if(!l){i=!1;const u=sh[o]||o;s+=`${u}(${c}) `}e&&(t[o]=c)}}return s=s.trim(),e?s=e(t,i?"":s):i&&(s="none"),s}function po(n,t,e){const{style:s,vars:i,transformOrigin:r}=n;let o=!1,a=!1;for(const l in t){const c=t[l];if(Bt.has(l)){o=!0;continue}else if(Qr(l)){i[l]=c;continue}else{const u=mo(c,ns[l]);l.startsWith("origin")?(a=!0,r[l]=u):s[l]=u}}if(t.transform||(o||e?s.transform=rh(t,n.transform,e):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;s.transformOrigin=`${l} ${c} ${u}`}}const oh={offset:"stroke-dashoffset",array:"stroke-dasharray"},ah={offset:"strokeDashoffset",array:"strokeDasharray"};function lh(n,t,e=1,s=0,i=!0){n.pathLength=1;const r=i?oh:ah;n[r.offset]=x.transform(-s);const o=x.transform(t),a=x.transform(e);n[r.array]=`${o} ${a}`}function Bi(n,t,e){return typeof n=="string"?n:x.transform(t+e*n)}function ch(n,t,e){const s=Bi(t,n.x,n.width),i=Bi(e,n.y,n.height);return`${s} ${i}`}function uh(n,{attrX:t,attrY:e,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,h){if(po(n,c,h),u){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:d,style:m,dimensions:f}=n;d.transform&&(f&&(m.transform=d.transform),delete d.transform),f&&(i!==void 0||r!==void 0||m.transform)&&(m.transformOrigin=ch(f,i!==void 0?i:.5,r!==void 0?r:.5)),t!==void 0&&(d.x=t),e!==void 0&&(d.y=e),s!==void 0&&(d.scale=s),o!==void 0&&lh(d,o,a,l,!1)}const go=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),hh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function dh(n,t){try{t.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function bo(n,{style:t,vars:e},s,i){Object.assign(n.style,t,i&&i.getProjectionStyles(s));for(const r in e)n.style.setProperty(r,e[r])}function fh(n,t,e,s){bo(n,t,void 0,s);for(const i in t.attrs)n.setAttribute(go.has(i)?i:Gn(i),t.attrs[i])}const mh={};function ph(n,{layout:t,layoutId:e}){return Bt.has(n)||n.startsWith("origin")||(t||e!==void 0)&&(!!mh[n]||n==="opacity")}function yo(n,t,e){var s;const{style:i}=n,r={};for(const o in i)(P(i[o])||t.style&&P(t.style[o])||ph(o,n)||((s=e==null?void 0:e.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return r}function gh(n,t,e){const s=yo(n,t,e);for(const i in n)if(P(n[i])||P(t[i])){const r=Rt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=n[i]}return s}class bh extends fo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&dh(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Bt.has(e)){const s=zr(e);return s&&s.default||0}return e=go.has(e)?e:Gn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,s){return gh(t,e,s)}onBindTransform(){this.current&&!this.renderState.dimensions&&Z.postRender(this.updateDimensions)}build(t,e,s){uh(t,e,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,s,i){fh(t,e,s,i)}mount(t){this.isSVGTag=hh(t.tagName),super.mount(t)}}function yh({top:n,left:t,right:e,bottom:s}){return{x:{min:t,max:e},y:{min:n,max:s}}}function vh(n,t){if(!t)return n;const e=t({x:n.left,y:n.top}),s=t({x:n.right,y:n.bottom});return{top:e.y,left:e.x,bottom:s.y,right:s.x}}function wh(n,t){return yh(vh(n.getBoundingClientRect(),t))}function Eh(n){return window.getComputedStyle(n)}class Th extends fo{constructor(){super(...arguments),this.type="html",this.renderInstance=bo}readValueFromInstance(t,e){if(Bt.has(e))return Zc(t,e);{const s=Eh(t),i=(Qr(e)?s.getPropertyValue(e):s[e])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:e}){return wh(t,e)}build(t,e,s){po(t,e,s.transformTemplate)}scrapeMotionValuesFromProps(t,e,s){return yo(t,e,s)}}function Ah(n,t){return n in t}class xh extends ho{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(Ah(e,t)){const s=t[e];if(typeof s=="string"||typeof s=="number")return s}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return ls()}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Sh(n){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},e=zu(n)?new bh(t):new Th(t);e.mount(n),le.set(n,e)}function Mh(n){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},e=new xh(t);e.mount(n),le.set(n,e)}function Oh(n,t,e){const s=P(n)?n:ae(n);return s.start(lo("",s,t,e)),s.animation}function Ch(n,t){return P(n)||typeof n=="number"||typeof n=="string"&&!Xn(t)}function vo(n,t,e,s){const i=[];if(Ch(n,t))i.push(Oh(n,Xn(t)&&t.default||t,e&&(e.default||e)));else{const r=Or(n,t,s),o=r.length;for(let a=0;a<o;a++){const l=r[a],c=l instanceof Element?Sh:Mh;le.has(l)||c(l);const u=le.get(l),h={...e};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),i.push(...Wu(u,{...t,transition:h},{}))}}return i}function kh(n,t,e){const s=[];return oc(n,t,e,{spring:Yn}).forEach(({keyframes:r,transition:o},a)=>{s.push(...vo(a,r,o))}),s}function Dh(n){return Array.isArray(n)&&n.some(Array.isArray)}function Lh(n){function t(e,s,i){let r=[];return Dh(e)?r=kh(e,s,n):r=vo(e,s,i,n),new wr(r)}return t}const an=Lh();let Fh=class extends I()({targets:{icon:HTMLElement,content:HTMLElement},values:{open:Boolean}}){connect(){this.animationDurationValue=.15,this.openValue?this.open():this.close()}toggle(){this.openValue=!this.openValue}openValueChanged(t){t?this.open():this.close()}open(){this.hasContentTarget&&(this.revealContent(),this.hasIconTarget&&this.rotateIcon(),this.openValue=!0)}close(){this.hasContentTarget&&(this.hideContent(),this.hasIconTarget&&this.rotateIcon(),this.openValue=!1)}revealContent(){const t=this.contentTarget.scrollHeight;an(this.contentTarget,{height:`${t}px`},{duration:this.animationDurationValue,easing:"ease-in-out"})}hideContent(){an(this.contentTarget,{height:0},{duration:this.animationDurationValue,easing:"ease-in-out"})}rotateIcon(){an(this.iconTarget,{rotate:`${this.openValue?180:0}deg`})}};const Vh=Object.freeze(Object.defineProperty({__proto__:null,default:Fh},Symbol.toStringTag,{value:"Module"}));class _h extends I()({targets:{banner:HTMLDivElement},values:{open:Boolean,autohide:{default:4e3,type:Number}}}){connect(){if(this.autohideValue!=0){const t=()=>{};setTimeout(()=>{this.hide().then(t).catch(t)},this.autohideValue)}}dismiss(){this.remove(),this.dispatchEvent(this.bannerTarget,"ariadne-banner:dismiss")}show(){this.bannerTarget.style.setProperty("display","initial")}remove(){const t=this.bannerTarget.parentElement;t&&t.removeChild(this.bannerTarget)}hide(){this.bannerTarget.style.setProperty("display","none")}}const Ph=Object.freeze(Object.defineProperty({__proto__:null,default:_h},Symbol.toStringTag,{value:"Module"}));function Rh(n){const t=document.createElement("pre");return t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="5px",t.textContent=n,t}function wo(n){if("clipboard"in navigator)return navigator.clipboard.writeText(n.textContent||"");const t=getSelection();if(t==null)return Promise.reject(new Error);t.removeAllRanges();const e=document.createRange();return e.selectNodeContents(n),t.addRange(e),document.execCommand("copy"),t.removeAllRanges(),Promise.resolve()}function Vn(n){if("clipboard"in navigator)return navigator.clipboard.writeText(n);const t=document.body;if(!t)return Promise.reject(new Error);const e=Rh(n);return t.appendChild(e),wo(e),t.removeChild(e),Promise.resolve()}async function Eo(n){const t=n.getAttribute("for"),e=n.getAttribute("value");function s(){n.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n.getAttribute("aria-disabled")!=="true"){if(e)await Vn(e),s();else if(t){const i="getRootNode"in Element.prototype?n.getRootNode():n.ownerDocument;if(!(i instanceof Document||"ShadowRoot"in window&&i instanceof ShadowRoot))return;const r=i.getElementById(t);r&&(await Bh(r),s())}}}function Bh(n){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?Vn(n.value):n instanceof HTMLAnchorElement&&n.hasAttribute("href")?Vn(n.href):wo(n)}function Ih(n){const t=n.currentTarget;t instanceof HTMLElement&&Eo(t)}function To(n){if(n.key===" "||n.key==="Enter"){const t=n.currentTarget;t instanceof HTMLElement&&(n.preventDefault(),Eo(t))}}function Nh(n){n.currentTarget.addEventListener("keydown",To)}function $h(n){n.currentTarget.removeEventListener("keydown",To)}class jh extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",Ih),this.addEventListener("focus",Nh),this.addEventListener("blur",$h)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const Ii=typeof globalThis<"u"?globalThis:window;try{Ii.ClipboardCopyElement=jh.define()}catch(n){if(!(Ii.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}const Kh=2e3;class Hh extends I()({targets:{initial:HTMLElement,confirmed:null},values:{hiddenClass:String,showClass:String}}){connect(){this.clipboardCopyElementTimers=new WeakMap}copy(t){var o;const e=t.target,s=this.clipboardCopyElementTimers.get(e),i=(o=e.parentNode)==null?void 0:o.querySelector("[data-clipboard-copy-feedback]"),r="Copied!";s?(clearTimeout(s),this.clipboardCopyElementTimers.delete(e)):(this.showConfirm(),i&&(i.textContent===r?i.textContent=`${r} `:i.textContent=r)),this.clipboardCopyElementTimers.set(e,window.setTimeout(()=>{this.showInitial(),this.hideConfirm(),this.clipboardCopyElementTimers.delete(e)},Kh))}showConfirm(){this.hasConfirmedTarget&&(this.confirmedTarget.classList.remove(this.hiddenClassValue),this.confirmedTarget.classList.add(this.showClassValue),this.initialTarget.classList.add(this.hiddenClassValue))}showInitial(){this.initialTarget.classList.remove(this.hiddenClassValue),this.initialTarget.classList.add(this.showClassValue),this.hasConfirmedTarget&&this.confirmedTarget.classList.add(this.hiddenClassValue)}hideConfirm(){this.hasConfirmedTarget&&this.confirmedTarget.classList.remove(this.showClassValue)}}const Uh=Object.freeze(Object.defineProperty({__proto__:null,default:Hh},Symbol.toStringTag,{value:"Module"})),lt=Math.min,$=Math.max,Be=Math.round,xe=Math.floor,G=n=>({x:n,y:n}),Wh={left:"right",right:"left",bottom:"top",top:"bottom"},zh={start:"end",end:"start"};function _n(n,t,e){return $(n,lt(t,e))}function $t(n,t){return typeof n=="function"?n(t):n}function ct(n){return n.split("-")[0]}function jt(n){return n.split("-")[1]}function Ao(n){return n==="x"?"y":"x"}function cs(n){return n==="y"?"height":"width"}function At(n){return["top","bottom"].includes(ct(n))?"y":"x"}function us(n){return Ao(At(n))}function qh(n,t,e){e===void 0&&(e=!1);const s=jt(n),i=us(n),r=cs(i);let o=i==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=Ie(o)),[o,Ie(o)]}function Yh(n){const t=Ie(n);return[Pn(n),t,Pn(t)]}function Pn(n){return n.replace(/start|end/g,t=>zh[t])}function Xh(n,t,e){const s=["left","right"],i=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(n){case"top":case"bottom":return e?t?i:s:t?s:i;case"left":case"right":return t?r:o;default:return[]}}function Gh(n,t,e,s){const i=jt(n);let r=Xh(ct(n),e==="start",s);return i&&(r=r.map(o=>o+"-"+i),t&&(r=r.concat(r.map(Pn)))),r}function Ie(n){return n.replace(/left|right|bottom|top/g,t=>Wh[t])}function Zh(n){return{top:0,right:0,bottom:0,left:0,...n}}function xo(n){return typeof n!="number"?Zh(n):{top:n,right:n,bottom:n,left:n}}function Ne(n){const{x:t,y:e,width:s,height:i}=n;return{width:s,height:i,top:e,left:t,right:t+s,bottom:e+i,x:t,y:e}}function Ni(n,t,e){let{reference:s,floating:i}=n;const r=At(t),o=us(t),a=cs(o),l=ct(t),c=r==="y",u=s.x+s.width/2-i.width/2,h=s.y+s.height/2-i.height/2,d=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:u,y:s.y-i.height};break;case"bottom":m={x:u,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:h};break;case"left":m={x:s.x-i.width,y:h};break;default:m={x:s.x,y:s.y}}switch(jt(t)){case"start":m[o]-=d*(e&&c?-1:1);break;case"end":m[o]+=d*(e&&c?-1:1);break}return m}const Qh=async(n,t,e)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=e,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:n,floating:t,strategy:i}),{x:u,y:h}=Ni(c,s,l),d=s,m={},f=0;for(let g=0;g<a.length;g++){const{name:b,fn:p}=a[g],{x:v,y:E,data:w,reset:y}=await p({x:u,y:h,initialPlacement:s,placement:d,strategy:i,middlewareData:m,rects:c,platform:o,elements:{reference:n,floating:t}});u=v??u,h=E??h,m={...m,[b]:{...m[b],...w}},y&&f<=50&&(f++,typeof y=="object"&&(y.placement&&(d=y.placement),y.rects&&(c=y.rects===!0?await o.getElementRects({reference:n,floating:t,strategy:i}):y.rects),{x:u,y:h}=Ni(c,d,l)),g=-1)}return{x:u,y:h,placement:d,strategy:i,middlewareData:m}};async function hs(n,t){var e;t===void 0&&(t={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:m=0}=$t(t,n),f=xo(m),b=a[d?h==="floating"?"reference":"floating":h],p=Ne(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(b)))==null||e?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=h==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),w=await(r.isElement==null?void 0:r.isElement(E))?await(r.getScale==null?void 0:r.getScale(E))||{x:1,y:1}:{x:1,y:1},y=Ne(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:E,strategy:l}):v);return{top:(p.top-y.top+f.top)/w.y,bottom:(y.bottom-p.bottom+f.bottom)/w.y,left:(p.left-y.left+f.left)/w.x,right:(y.right-p.right+f.right)/w.x}}const Jh=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:s,placement:i,rects:r,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=$t(n,t)||{};if(c==null)return{};const h=xo(u),d={x:e,y:s},m=us(i),f=cs(m),g=await o.getDimensions(c),b=m==="y",p=b?"top":"left",v=b?"bottom":"right",E=b?"clientHeight":"clientWidth",w=r.reference[f]+r.reference[m]-d[m]-r.floating[f],y=d[m]-r.reference[m],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let S=T?T[E]:0;(!S||!await(o.isElement==null?void 0:o.isElement(T)))&&(S=a.floating[E]||r.floating[f]);const A=w/2-y/2,M=S/2-g[f]/2-1,O=lt(h[p],M),L=lt(h[v],M),B=O,N=S-g[f]-L,V=S/2-g[f]/2+A,ht=_n(B,V,N),W=!l.arrow&&jt(i)!=null&&V!==ht&&r.reference[f]/2-(V<B?O:L)-g[f]/2<0,F=W?V<B?V-B:V-N:0;return{[m]:d[m]+F,data:{[m]:ht,centerOffset:V-ht-F,...W&&{alignmentOffset:F}},reset:W}}}),td=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...b}=$t(n,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};const p=ct(i),v=At(a),E=ct(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),y=d||(E||!g?[Ie(a)]:Yh(a)),T=f!=="none";!d&&T&&y.push(...Gh(a,g,f,w));const S=[a,...y],A=await hs(t,b),M=[];let O=((s=r.flip)==null?void 0:s.overflows)||[];if(u&&M.push(A[p]),h){const V=qh(i,o,w);M.push(A[V[0]],A[V[1]])}if(O=[...O,{placement:i,overflows:M}],!M.every(V=>V<=0)){var L,B;const V=(((L=r.flip)==null?void 0:L.index)||0)+1,ht=S[V];if(ht)return{data:{index:V,overflows:O},reset:{placement:ht}};let W=(B=O.filter(F=>F.overflows[0]<=0).sort((F,D)=>F.overflows[1]-D.overflows[1])[0])==null?void 0:B.placement;if(!W)switch(m){case"bestFit":{var N;const F=(N=O.filter(D=>{if(T){const z=At(D.placement);return z===v||z==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(z=>z>0).reduce((z,ye)=>z+ye,0)]).sort((D,z)=>D[1]-z[1])[0])==null?void 0:N[0];F&&(W=F);break}case"initialPlacement":W=a;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function ed(n,t){const{placement:e,platform:s,elements:i}=n,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=ct(e),a=jt(e),l=At(e)==="y",c=["left","top"].includes(o)?-1:1,u=r&&l?-1:1,h=$t(t,n);let{mainAxis:d,crossAxis:m,alignmentAxis:f}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*u,y:d*c}:{x:d*c,y:m*u}}const nd=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,s;const{x:i,y:r,placement:o,middlewareData:a}=t,l=await ed(t,n);return o===((e=a.offset)==null?void 0:e.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},sd=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:s,placement:i}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:p,y:v}=b;return{x:p,y:v}}},...l}=$t(n,t),c={x:e,y:s},u=await hs(t,l),h=At(ct(i)),d=Ao(h);let m=c[d],f=c[h];if(r){const b=d==="y"?"top":"left",p=d==="y"?"bottom":"right",v=m+u[b],E=m-u[p];m=_n(v,m,E)}if(o){const b=h==="y"?"top":"left",p=h==="y"?"bottom":"right",v=f+u[b],E=f-u[p];f=_n(v,f,E)}const g=a.fn({...t,[d]:m,[h]:f});return{...g,data:{x:g.x-e,y:g.y-s,enabled:{[d]:r,[h]:o}}}}}},id=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,s;const{placement:i,rects:r,platform:o,elements:a}=t,{apply:l=()=>{},...c}=$t(n,t),u=await hs(t,c),h=ct(i),d=jt(i),m=At(i)==="y",{width:f,height:g}=r.floating;let b,p;h==="top"||h==="bottom"?(b=h,p=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(p=h,b=d==="end"?"top":"bottom");const v=g-u.top-u.bottom,E=f-u.left-u.right,w=lt(g-u[b],v),y=lt(f-u[p],E),T=!t.middlewareData.shift;let S=w,A=y;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(A=E),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(S=v),T&&!d){const O=$(u.left,0),L=$(u.right,0),B=$(u.top,0),N=$(u.bottom,0);m?A=f-2*(O!==0||L!==0?O+L:$(u.left,u.right)):S=g-2*(B!==0||N!==0?B+N:$(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:S});const M=await o.getDimensions(a.floating);return f!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Ye(){return typeof window<"u"}function Kt(n){return So(n)?(n.nodeName||"").toLowerCase():"#document"}function K(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function J(n){var t;return(t=(So(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function So(n){return Ye()?n instanceof Node||n instanceof K(n).Node:!1}function Y(n){return Ye()?n instanceof Element||n instanceof K(n).Element:!1}function Q(n){return Ye()?n instanceof HTMLElement||n instanceof K(n).HTMLElement:!1}function $i(n){return!Ye()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof K(n).ShadowRoot}function be(n){const{overflow:t,overflowX:e,overflowY:s,display:i}=X(n);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(i)}function rd(n){return["table","td","th"].includes(Kt(n))}function Xe(n){return[":popover-open",":modal"].some(t=>{try{return n.matches(t)}catch{return!1}})}function ds(n){const t=fs(),e=Y(n)?X(n):n;return["transform","translate","scale","rotate","perspective"].some(s=>e[s]?e[s]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function od(n){let t=ut(n);for(;Q(t)&&!Pt(t);){if(ds(t))return t;if(Xe(t))return null;t=ut(t)}return null}function fs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pt(n){return["html","body","#document"].includes(Kt(n))}function X(n){return K(n).getComputedStyle(n)}function Ge(n){return Y(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ut(n){if(Kt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||$i(n)&&n.host||J(n);return $i(t)?t.host:t}function Mo(n){const t=ut(n);return Pt(t)?n.ownerDocument?n.ownerDocument.body:n.body:Q(t)&&be(t)?t:Mo(t)}function he(n,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const i=Mo(n),r=i===((s=n.ownerDocument)==null?void 0:s.body),o=K(i);if(r){const a=Rn(o);return t.concat(o,o.visualViewport||[],be(i)?i:[],a&&e?he(a):[])}return t.concat(i,he(i,[],e))}function Rn(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Oo(n){const t=X(n);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Q(n),r=i?n.offsetWidth:e,o=i?n.offsetHeight:s,a=Be(e)!==r||Be(s)!==o;return a&&(e=r,s=o),{width:e,height:s,$:a}}function ms(n){return Y(n)?n:n.contextElement}function Ft(n){const t=ms(n);if(!Q(t))return G(1);const e=t.getBoundingClientRect(),{width:s,height:i,$:r}=Oo(t);let o=(r?Be(e.width):e.width)/s,a=(r?Be(e.height):e.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const ad=G(0);function Co(n){const t=K(n);return!fs()||!t.visualViewport?ad:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ld(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==K(n)?!1:t}function xt(n,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const i=n.getBoundingClientRect(),r=ms(n);let o=G(1);t&&(s?Y(s)&&(o=Ft(s)):o=Ft(n));const a=ld(r,e,s)?Co(r):G(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(r){const d=K(r),m=s&&Y(s)?K(s):s;let f=d,g=Rn(f);for(;g&&s&&m!==f;){const b=Ft(g),p=g.getBoundingClientRect(),v=X(g),E=p.left+(g.clientLeft+parseFloat(v.paddingLeft))*b.x,w=p.top+(g.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,h*=b.y,l+=E,c+=w,f=K(g),g=Rn(f)}}return Ne({width:u,height:h,x:l,y:c})}function ps(n,t){const e=Ge(n).scrollLeft;return t?t.left+e:xt(J(n)).left+e}function ko(n,t,e){e===void 0&&(e=!1);const s=n.getBoundingClientRect(),i=s.left+t.scrollLeft-(e?0:ps(n,s)),r=s.top+t.scrollTop;return{x:i,y:r}}function cd(n){let{elements:t,rect:e,offsetParent:s,strategy:i}=n;const r=i==="fixed",o=J(s),a=t?Xe(t.floating):!1;if(s===o||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=G(1);const u=G(0),h=Q(s);if((h||!h&&!r)&&((Kt(s)!=="body"||be(o))&&(l=Ge(s)),Q(s))){const m=xt(s);c=Ft(s),u.x=m.x+s.clientLeft,u.y=m.y+s.clientTop}const d=o&&!h&&!r?ko(o,l,!0):G(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:e.y*c.y-l.scrollTop*c.y+u.y+d.y}}function ud(n){return Array.from(n.getClientRects())}function hd(n){const t=J(n),e=Ge(n),s=n.ownerDocument.body,i=$(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),r=$(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-e.scrollLeft+ps(n);const a=-e.scrollTop;return X(s).direction==="rtl"&&(o+=$(t.clientWidth,s.clientWidth)-i),{width:i,height:r,x:o,y:a}}function dd(n,t){const e=K(n),s=J(n),i=e.visualViewport;let r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;const c=fs();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a,y:l}}function fd(n,t){const e=xt(n,!0,t==="fixed"),s=e.top+n.clientTop,i=e.left+n.clientLeft,r=Q(n)?Ft(n):G(1),o=n.clientWidth*r.x,a=n.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function ji(n,t,e){let s;if(t==="viewport")s=dd(n,e);else if(t==="document")s=hd(J(n));else if(Y(t))s=fd(t,e);else{const i=Co(n);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ne(s)}function Do(n,t){const e=ut(n);return e===t||!Y(e)||Pt(e)?!1:X(e).position==="fixed"||Do(e,t)}function md(n,t){const e=t.get(n);if(e)return e;let s=he(n,[],!1).filter(a=>Y(a)&&Kt(a)!=="body"),i=null;const r=X(n).position==="fixed";let o=r?ut(n):n;for(;Y(o)&&!Pt(o);){const a=X(o),l=ds(o);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||be(o)&&!l&&Do(n,o))?s=s.filter(u=>u!==o):i=a,o=ut(o)}return t.set(n,s),s}function pd(n){let{element:t,boundary:e,rootBoundary:s,strategy:i}=n;const o=[...e==="clippingAncestors"?Xe(t)?[]:md(t,this._c):[].concat(e),s],a=o[0],l=o.reduce((c,u)=>{const h=ji(t,u,i);return c.top=$(h.top,c.top),c.right=lt(h.right,c.right),c.bottom=lt(h.bottom,c.bottom),c.left=$(h.left,c.left),c},ji(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function gd(n){const{width:t,height:e}=Oo(n);return{width:t,height:e}}function bd(n,t,e){const s=Q(t),i=J(t),r=e==="fixed",o=xt(n,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=G(0);if(s||!s&&!r)if((Kt(t)!=="body"||be(i))&&(a=Ge(t)),s){const d=xt(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=ps(i));const c=i&&!s&&!r?ko(i,a):G(0),u=o.left+a.scrollLeft-l.x-c.x,h=o.top+a.scrollTop-l.y-c.y;return{x:u,y:h,width:o.width,height:o.height}}function ln(n){return X(n).position==="static"}function Ki(n,t){if(!Q(n)||X(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return J(n)===e&&(e=e.ownerDocument.body),e}function Lo(n,t){const e=K(n);if(Xe(n))return e;if(!Q(n)){let i=ut(n);for(;i&&!Pt(i);){if(Y(i)&&!ln(i))return i;i=ut(i)}return e}let s=Ki(n,t);for(;s&&rd(s)&&ln(s);)s=Ki(s,t);return s&&Pt(s)&&ln(s)&&!ds(s)?e:s||od(n)||e}const yd=async function(n){const t=this.getOffsetParent||Lo,e=this.getDimensions,s=await e(n.floating);return{reference:bd(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function vd(n){return X(n).direction==="rtl"}const wd={convertOffsetParentRelativeRectToViewportRelativeRect:cd,getDocumentElement:J,getClippingRect:pd,getOffsetParent:Lo,getElementRects:yd,getClientRects:ud,getDimensions:gd,getScale:Ft,isElement:Y,isRTL:vd};function Fo(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Ed(n,t){let e=null,s;const i=J(n);function r(){var a;clearTimeout(s),(a=e)==null||a.disconnect(),e=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=n.getBoundingClientRect(),{left:u,top:h,width:d,height:m}=c;if(a||t(),!d||!m)return;const f=xe(h),g=xe(i.clientWidth-(u+d)),b=xe(i.clientHeight-(h+m)),p=xe(u),E={rootMargin:-f+"px "+-g+"px "+-b+"px "+-p+"px",threshold:$(0,lt(1,l))||1};let w=!0;function y(T){const S=T[0].intersectionRatio;if(S!==l){if(!w)return o();S?o(!1,S):s=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!Fo(c,n.getBoundingClientRect())&&o(),w=!1}try{e=new IntersectionObserver(y,{...E,root:i.ownerDocument})}catch{e=new IntersectionObserver(y,E)}e.observe(n)}return o(!0),r}function Vo(n,t,e,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=ms(n),u=i||r?[...c?he(c):[],...he(t)]:[];u.forEach(p=>{i&&p.addEventListener("scroll",e,{passive:!0}),r&&p.addEventListener("resize",e)});const h=c&&a?Ed(c,e):null;let d=-1,m=null;o&&(m=new ResizeObserver(p=>{let[v]=p;v&&v.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),e()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?xt(n):null;l&&b();function b(){const p=xt(n);g&&!Fo(g,p)&&e(),g=p,f=requestAnimationFrame(b)}return e(),()=>{var p;u.forEach(v=>{i&&v.removeEventListener("scroll",e),r&&v.removeEventListener("resize",e)}),h==null||h(),(p=m)==null||p.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const gs=nd,bs=sd,ys=td,Td=id,Ad=Jh,vs=(n,t,e)=>{const s=new Map,i={platform:wd,...e},r={...i.platform,_c:s};return Qh(n,t,{...i,platform:r})},Hi=(n,t)=>{const e=n[t];return typeof e=="function"?e:(...s)=>{}},Bn=(n,t,e)=>{let s=n;return e===!0?s=`${t.identifier}:${n}`:typeof e=="string"&&(s=`${e}:${n}`),s},In=(n,t,e)=>{const{bubbles:s,cancelable:i,composed:r}=t||{bubbles:!0,cancelable:!0,composed:!0};return t&&Object.assign(e,{originalEvent:t}),new CustomEvent(n,{bubbles:s,cancelable:i,composed:r,detail:e})};function xd(n){const t=n.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,s=window.innerWidth||document.documentElement.clientWidth,i=t.top<=e&&t.top+t.height>0,r=t.left<=s&&t.left+t.width>0;return i&&r}function Sd(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(e[s[i]]=n[s[i]]);return e}const cn={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0};class Md{constructor(t,e={}){var s,i,r;this.log=(l,c)=>{this.debug&&(this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${l}`,"color: #3B82F6","color: unset"),this.logger.log(Object.assign({controllerId:this.controllerId},c)),this.logger.groupEnd())},this.warn=l=>{this.logger.warn(`%c${this.controller.identifier} %c${l}`,"color: #3B82F6; font-weight: bold","color: unset")},this.dispatch=(l,c={})=>{if(this.dispatchEvent){const{event:u}=c,h=Sd(c,["event"]),d=this.extendedEvent(l,u||null,h);this.targetElement.dispatchEvent(d),this.log("dispatchEvent",Object.assign({eventName:d.type},h))}},this.call=(l,c={})=>{const u=this.controller[l];if(typeof u=="function")return u.call(this.controller,c)},this.extendedEvent=(l,c,u)=>{const{bubbles:h,cancelable:d,composed:m}=c||{bubbles:!0,cancelable:!0,composed:!0};return c&&Object.assign(u,{originalEvent:c}),new CustomEvent(this.composeEventName(l),{bubbles:h,cancelable:d,composed:m,detail:u})},this.composeEventName=l=>{let c=l;return this.eventPrefix===!0?c=`${this.controller.identifier}:${l}`:typeof this.eventPrefix=="string"&&(c=`${this.eventPrefix}:${l}`),c},this.debug=(i=(s=e==null?void 0:e.debug)!==null&&s!==void 0?s:t.application.stimulusUseDebug)!==null&&i!==void 0?i:cn.debug,this.logger=(r=e==null?void 0:e.logger)!==null&&r!==void 0?r:cn.logger,this.controller=t,this.controllerId=t.element.id||t.element.dataset.id,this.targetElement=(e==null?void 0:e.element)||t.element;const{dispatchEvent:o,eventPrefix:a}=Object.assign({},cn,e);Object.assign(this,{dispatchEvent:o,eventPrefix:a}),this.controllerInitialize=t.initialize.bind(t),this.controllerConnect=t.connect.bind(t),this.controllerDisconnect=t.disconnect.bind(t)}}const Od={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},Cd=(n,t={})=>{const e=n,{onlyVisible:s,dispatchEvent:i,events:r,eventPrefix:o}=Object.assign({},Od,t),a=h=>{const d=(t==null?void 0:t.element)||e.element;if(!(d.contains(h.target)||!xd(d)&&s)&&(e.clickOutside&&e.clickOutside(h),i)){const m=Bn("click:outside",e,o),f=In(m,h,{controller:e});d.dispatchEvent(f)}},l=()=>{r==null||r.forEach(h=>{window.addEventListener(h,a,!0)})},c=()=>{r==null||r.forEach(h=>{window.removeEventListener(h,a,!0)})},u=e.disconnect.bind(e);return Object.assign(e,{disconnect(){c(),u()}}),l(),[l,c]};class kd extends it{}kd.debounces=[];const Dd=200,Ui=(n,t=Dd)=>{let e=null;return function(){const s=Array.from(arguments),i=this,r=s.map(a=>a.params),o=()=>(s.forEach((a,l)=>a.params=r[l]),n.apply(i,s));e&&clearTimeout(e),e=setTimeout(o,t)}},Ld=(n,t)=>{const e=n;e.constructor.debounces.forEach(i=>{if(typeof i=="string"&&(e[i]=Ui(e[i],void 0)),typeof i=="object"){const{name:r,wait:o}=i;if(!r)return;e[r]=Ui(e[r],o||void 0)}})},Fd={dispatchEvent:!0,eventPrefix:!0,visibleAttribute:"isVisible"},Vd=(n,t={})=>{const e=n,{dispatchEvent:s,eventPrefix:i,visibleAttribute:r}=Object.assign({},Fd,t),o=(t==null?void 0:t.element)||e.element;e.intersectionElements||(e.intersectionElements=[]),e.intersectionElements.push(o);const a=w=>{const[y]=w;y.isIntersecting?c(y):o.hasAttribute(r)&&u(y)},l=new IntersectionObserver(a,t),c=w=>{if(o.setAttribute(r,"true"),Hi(e,"appear").call(e,w,l),s){const y=Bn("appear",e,i),T=In(y,null,{controller:e,entry:w,observer:l});o.dispatchEvent(T)}},u=w=>{if(o.removeAttribute(r),Hi(e,"disappear").call(e,w,l),s){const y=Bn("disappear",e,i),T=In(y,null,{controller:e,entry:w,observer:l});o.dispatchEvent(T)}},h=e.disconnect.bind(e),d=()=>{f(),h()},m=()=>{l.observe(o)},f=()=>{l.unobserve(o)},g=()=>e.intersectionElements.filter(w=>w.hasAttribute(r)).length===0,b=()=>e.intersectionElements.filter(w=>w.hasAttribute(r)).length===1,p=()=>e.intersectionElements.some(w=>w.hasAttribute(r)),v=()=>e.intersectionElements.every(w=>w.hasAttribute(r));return Object.assign(e,{isVisible:v,noneVisible:g,oneVisible:b,atLeastOneVisible:p,allVisible:v,disconnect:d}),m(),[m,f]};class _d extends Md{constructor(t,e={}){super(t,e),this.observe=()=>{try{this.observer.observe(this.targetElement,this.options)}catch(s){this.controller.application.handleError(s,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},this.unobserve=()=>{this.observer.disconnect()},this.mutation=s=>{this.call("mutate",s),this.log("mutate",{entries:s}),this.dispatch("mutate",{entries:s})},this.targetElement=(e==null?void 0:e.element)||t.element,this.controller=t,this.options=e,this.observer=new MutationObserver(this.mutation),this.enhanceController(),this.observe()}enhanceController(){const t=this.controller.disconnect.bind(this.controller),e=()=>{this.unobserve(),t()};Object.assign(this.controller,{disconnect:e})}}const _o=(n,t={})=>{const e=new _d(n,t);return[e.observe,e.unobserve]};class Pd extends it{}Pd.throttles=[];class Rd extends I()({targets:{wrapper:HTMLDetailsElement,button:HTMLElement,popover:dn,options:HTMLDivElement},values:{clamped:Boolean,placement:String,dynamicLabelPrefix:String}}){constructor(){super(...arguments),this.changedIds=new Set}clickOutside(){this.element.open=!1,this.setupAutoUpdate(),this.close()}close(){this.changedIds.size>0&&(this.dispatch("changed"),this.changedIds.clear(),this.buttonTarget.setAttribute("aria-expanded","false"))}connect(){Cd(this),_o(this,{childList:!0,subtree:!0}),this.setupAutoUpdate(),this.setupForm()}disconnect(){var t;(t=this.unsubAutoUpdate)==null||t.call(this)}setupForm(){for(const t of["checkbox","radio"])for(const e of this.popoverTarget.querySelectorAll(`input[type="${t}"]`))e.addEventListener("change",s=>{const i=s.target;this.changedIds.has(i)?this.changedIds.delete(i):this.changedIds.add(i),this.dispatch("clicked",{detail:i})})}setupAutoUpdate(){var e;if(!this.element.open){(e=this.unsubAutoUpdate)==null||e.call(this);return}const t=()=>{const s=this.optionsTarget,i=this.clampedValue;vs(this.buttonTarget,this.popoverTarget,{middleware:[gs(6),ys(),bs({padding:6}),Td({apply({availableHeight:r}){let o=r-6;i&&o>400&&(o=400),Object.assign(s.style,{maxHeight:`${o}px`})}})],placement:this.placementValue,strategy:"fixed"}).then(({x:r,y:o})=>{Object.assign(this.popoverTarget.style,{left:`${r}px`,top:`${o}px`})})};t(),this.unsubAutoUpdate=Vo(this.buttonTarget,this.popoverTarget,t)}updateButtonLabel(t){var r;const s=t.target.querySelector("input[type=radio]:checked");if(!s)return;const i=((r=s.labels)==null?void 0:r.item(0)).textContent;this.buttonTarget.querySelector('[data-ariadne-ui-button-target="content"]').textContent=`${this.dynamicLabelPrefixValue}${i}`}toggle(){this.element.open=!this.element.open,this.setupAutoUpdate(),this.buttonTarget.setAttribute("aria-expanded","true")}}const Bd=Object.freeze(Object.defineProperty({__proto__:null,default:Rd},Symbol.toStringTag,{value:"Module"}));function Id(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t<n.length;t++)e[t]=n[t];return e}else return Array.from(n)}var ws=!1;if(typeof window<"u"){var Wi={get passive(){ws=!0}};window.addEventListener("testPassive",null,Wi),window.removeEventListener("testPassive",null,Wi)}var $e=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),wt=[],je=!1,Po=-1,se=void 0,pt=void 0,ie=void 0,Ro=function(t){return wt.some(function(e){return!!(e.options.allowTouchMove&&e.options.allowTouchMove(t))})},Ke=function(t){var e=t||window.event;return Ro(e.target)||e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)},Nd=function(t){if(ie===void 0){var e=!!t&&t.reserveScrollBarGap===!0,s=window.innerWidth-document.documentElement.clientWidth;if(e&&s>0){var i=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);ie=document.body.style.paddingRight,document.body.style.paddingRight=i+s+"px"}}se===void 0&&(se=document.body.style.overflow,document.body.style.overflow="hidden")},$d=function(){ie!==void 0&&(document.body.style.paddingRight=ie,ie=void 0),se!==void 0&&(document.body.style.overflow=se,se=void 0)},jd=function(){return window.requestAnimationFrame(function(){if(pt===void 0){pt={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var t=window,e=t.scrollY,s=t.scrollX,i=t.innerHeight;document.body.style.position="fixed",document.body.style.top=-e,document.body.style.left=-s,setTimeout(function(){return window.requestAnimationFrame(function(){var r=i-window.innerHeight;r&&e>=i&&(document.body.style.top=-(e+r))})},300)}})},Kd=function(){if(pt!==void 0){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=pt.position,document.body.style.top=pt.top,document.body.style.left=pt.left,window.scrollTo(e,t),pt=void 0}},Hd=function(t){return t?t.scrollHeight-t.scrollTop<=t.clientHeight:!1},Ud=function(t,e){var s=t.targetTouches[0].clientY-Po;return Ro(t.target)?!1:e&&e.scrollTop===0&&s>0||Hd(e)&&s<0?Ke(t):(t.stopPropagation(),!0)},Wd=function(t,e){if(!t){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!wt.some(function(i){return i.targetElement===t})){var s={targetElement:t,options:e||{}};wt=[].concat(Id(wt),[s]),$e?jd():Nd(e),$e&&(t.ontouchstart=function(i){i.targetTouches.length===1&&(Po=i.targetTouches[0].clientY)},t.ontouchmove=function(i){i.targetTouches.length===1&&Ud(i,t)},je||(document.addEventListener("touchmove",Ke,ws?{passive:!1}:void 0),je=!0))}},zd=function(t){if(!t){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}wt=wt.filter(function(e){return e.targetElement!==t}),$e&&(t.ontouchstart=null,t.ontouchmove=null,je&&wt.length===0&&(document.removeEventListener("touchmove",Ke,ws?{passive:!1}:void 0),je=!1)),$e?Kd():$d()};const Ts=class Ts extends I()({targets:{dialog:HTMLDialogElement}}){connect(){this.element.tagName==="DIALOG"&&(window.AriadneDialogRegistry=window.AriadneDialogRegistry||{},window.AriadneDialogRegistry[this.element.id]=this)}disconnect(){this.element.tagName==="DIALOG"&&window.AriadneDialogRegistry&&window.AriadneDialogRegistry[this.element.id]&&delete window.AriadneDialogRegistry[this.element.id],this.close()}close(t){const e=this.hasDialogTarget?this.dialogTarget:this.element;e.open&&(t&&t.preventDefault(),e.close(),zd(e))}open(t){const e=this.hasDialogTarget?this.dialogTarget:this.element;e.open||(t&&t.preventDefault(),e.showModal(),Wd(e,{reserveScrollBarGap:!0}))}openDialogExternally(t){var i;t.preventDefault();const e=this.dialogIdValue;if(!e){console.error("Dialog trigger clicked without a data-ariadne-ui-dialog-dialog-id-value attribute.");return}const s=(i=window.AriadneDialogRegistry)==null?void 0:i[e];s?s.open():console.error(`Dialog with ID "${e}" not found in registry.`)}windowClick(t){const e=this.hasDialogTarget?this.dialogTarget:this.element;t.target===e&&this.close()}};Ts.values={dialogId:String};let Nn=Ts;const qd=Object.freeze(Object.defineProperty({__proto__:null,default:Nn},Symbol.toStringTag,{value:"Module"})),As=class As extends it{openDialog(t){t.preventDefault();const s=(window.AriadneDialogRegistry||{})[this.dialogIdValue];if(s)s.open();else{const i=document.getElementById(this.dialogIdValue);i&&i.tagName==="DIALOG"?i.showModal():console.warn(`Dialog with ID ${this.dialogIdValue} not found`)}}};As.values={dialogId:String};let $n=As;const Yd=Object.freeze(Object.defineProperty({__proto__:null,default:$n},Symbol.toStringTag,{value:"Module"}));class Xd extends I()({targets:{emptyRoot:null,input:HTMLInputElement,searchString:null}}){handleNewQuery(t){let e=!1;for(const{el:s,searchString:i}of this.items){const r=i.includes(t.trim().toLowerCase());!e&&r&&(e=!0),r?s.classList.remove("ariadne:hidden"):s.classList.add("ariadne:hidden")}this.hasEmptyRootTarget&&(e?this.emptyRootTarget.classList.add("ariadne:hidden"):this.emptyRootTarget.classList.remove("ariadne:hidden"))}connect(){this.items=this.searchStringTargets.map(t=>({el:t,searchString:(t.textContent??"").trim().toLowerCase()})),Vd(this)}appear(){this.reset()}handleInput(){this.hasSearchStringTarget&&this.handleNewQuery(this.inputTarget.value)}reset(){this.handleNewQuery(""),this.hasInputTarget&&(this.inputTarget.value="")}}const Gd=Object.freeze(Object.defineProperty({__proto__:null,default:Xd},Symbol.toStringTag,{value:"Module"}));class Zd extends I()({targets:{button:HTMLButtonElement,popover:HTMLElement},values:{placement:String}}){connect(){this.popoverTarget.addEventListener("toggle",t=>{t.newState==="open"&&this.updatePosition()})}toggle(){dispatchEvent(new CustomEvent("toggle",{detail:{newState:this.popoverTarget.open?"closed":"open"}}))}updatePosition(){Vo(this.buttonTarget,this.popoverTarget,()=>{vs(this.buttonTarget,this.popoverTarget,{placement:this.placementValue,middleware:[gs(5),ys(),bs({padding:5})]}).then(({x:t,y:e})=>{Object.assign(this.popoverTarget.style,{left:`${t}px`,top:`${e}px`})})})}}const Qd=Object.freeze(Object.defineProperty({__proto__:null,default:Zd},Symbol.toStringTag,{value:"Module"}));var Jd=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},zi=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Jt;class tf{formatToParts(t){const e=[];for(const s of t)e.push({type:"element",value:s}),e.push({type:"literal",value:", "});return e.slice(0,-1)}}const ef=typeof Intl<"u"&&Intl.ListFormat||tf,nf=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],sf={minimumIntegerDigits:2};class rf{constructor(t,e={}){Jt.set(this,void 0);let s=String(e.style||"short");s!=="long"&&s!=="short"&&s!=="narrow"&&s!=="digital"&&(s="short");let i=s==="digital"?"numeric":s;const r=e.hours||i;i=r==="2-digit"?"numeric":r;const o=e.minutes||i;i=o==="2-digit"?"numeric":o;const a=e.seconds||i;i=a==="2-digit"?"numeric":a;const l=e.milliseconds||i;Jd(this,Jt,{locale:t,style:s,years:e.years||s==="digital"?"short":s,yearsDisplay:e.yearsDisplay==="always"?"always":"auto",months:e.months||s==="digital"?"short":s,monthsDisplay:e.monthsDisplay==="always"?"always":"auto",weeks:e.weeks||s==="digital"?"short":s,weeksDisplay:e.weeksDisplay==="always"?"always":"auto",days:e.days||s==="digital"?"short":s,daysDisplay:e.daysDisplay==="always"?"always":"auto",hours:r,hoursDisplay:e.hoursDisplay==="always"||s==="digital"?"always":"auto",minutes:o,minutesDisplay:e.minutesDisplay==="always"||s==="digital"?"always":"auto",seconds:a,secondsDisplay:e.secondsDisplay==="always"||s==="digital"?"always":"auto",milliseconds:l,millisecondsDisplay:e.millisecondsDisplay==="always"?"always":"auto"},"f")}resolvedOptions(){return zi(this,Jt,"f")}formatToParts(t){const e=[],s=zi(this,Jt,"f"),i=s.style,r=s.locale;for(const[o,a]of nf){const l=t[o];if(s[`${o}Display`]==="auto"&&!l)continue;const c=s[o],u=c==="2-digit"?sf:c==="numeric"?{}:{style:"unit",unit:a,unitDisplay:c};e.push(new Intl.NumberFormat(r,u).format(l))}return new ef(r,{type:"unit",style:i==="digital"?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map(e=>e.value).join("")}}Jt=new WeakMap;const Bo=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,He=["year","month","week","day","hour","minute","second","millisecond"],of=n=>Bo.test(n);class j{constructor(t=0,e=0,s=0,i=0,r=0,o=0,a=0,l=0){this.years=t,this.months=e,this.weeks=s,this.days=i,this.hours=r,this.minutes=o,this.seconds=a,this.milliseconds=l,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=this.sign===0}abs(){return new j(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds),Math.abs(this.milliseconds))}static from(t){var e;if(typeof t=="string"){const s=String(t).trim(),i=s.startsWith("-")?-1:1,r=(e=s.match(Bo))===null||e===void 0?void 0:e.slice(1).map(o=>(Number(o)||0)*i);return r?new j(...r):new j}else if(typeof t=="object"){const{years:s,months:i,weeks:r,days:o,hours:a,minutes:l,seconds:c,milliseconds:u}=t;return new j(s,i,r,o,a,l,c,u)}throw new RangeError("invalid duration")}static compare(t,e){const s=Date.now(),i=Math.abs(qi(s,j.from(t)).getTime()-s),r=Math.abs(qi(s,j.from(e)).getTime()-s);return i>r?-1:i<r?1:0}toLocaleString(t,e){return new rf(t,e).format(this)}}function qi(n,t){const e=new Date(n);return t.sign<0?(e.setUTCSeconds(e.getUTCSeconds()+t.seconds),e.setUTCMinutes(e.getUTCMinutes()+t.minutes),e.setUTCHours(e.getUTCHours()+t.hours),e.setUTCDate(e.getUTCDate()+t.weeks*7+t.days),e.setUTCMonth(e.getUTCMonth()+t.months),e.setUTCFullYear(e.getUTCFullYear()+t.years)):(e.setUTCFullYear(e.getUTCFullYear()+t.years),e.setUTCMonth(e.getUTCMonth()+t.months),e.setUTCDate(e.getUTCDate()+t.weeks*7+t.days),e.setUTCHours(e.getUTCHours()+t.hours),e.setUTCMinutes(e.getUTCMinutes()+t.minutes),e.setUTCSeconds(e.getUTCSeconds()+t.seconds)),e}function af(n,t="second",e=Date.now()){const s=n.getTime()-e;if(s===0)return new j;const i=Math.sign(s),r=Math.abs(s),o=Math.floor(r/1e3),a=Math.floor(o/60),l=Math.floor(a/60),c=Math.floor(l/24),u=Math.floor(c/30),h=Math.floor(u/12),d=He.indexOf(t)||He.length;return new j(d>=0?h*i:0,d>=1?(u-h*12)*i:0,0,d>=3?(c-u*30)*i:0,d>=4?(l-c*24)*i:0,d>=5?(a-l*60)*i:0,d>=6?(o-a*60)*i:0,d>=7?(r-o*1e3)*i:0)}function Io(n,{relativeTo:t=Date.now()}={}){if(t=new Date(t),n.blank)return n;const e=n.sign;let s=Math.abs(n.years),i=Math.abs(n.months),r=Math.abs(n.weeks),o=Math.abs(n.days),a=Math.abs(n.hours),l=Math.abs(n.minutes),c=Math.abs(n.seconds),u=Math.abs(n.milliseconds);u>=900&&(c+=Math.round(u/1e3)),(c||l||a||o||r||i||s)&&(u=0),c>=55&&(l+=Math.round(c/60)),(l||a||o||r||i||s)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||o||r||i||s)&&(l=0),o&&a>=12&&(o+=Math.round(a/24)),!o&&a>=21&&(o+=Math.round(a/24)),(o||r||i||s)&&(a=0);const h=t.getFullYear(),d=t.getMonth(),m=t.getDate();if(o>=27||s+i+o){const f=new Date(t);f.setDate(1),f.setMonth(d+i*e+1),f.setDate(0);const g=Math.max(0,m-f.getDate()),b=new Date(t);b.setFullYear(h+s*e),b.setDate(m-g),b.setMonth(d+i*e),b.setDate(m-g+o*e);const p=b.getFullYear()-t.getFullYear(),v=b.getMonth()-t.getMonth(),E=Math.abs(Math.round((Number(b)-Number(t))/864e5))+g,w=Math.abs(p*12+v);E<27?(o>=6?(r+=Math.round(o/7),o=0):o=E,i=s=0):w<=11?(i=w,s=0):(i=0,s=p*e),(i||s)&&(o=0)}return s&&(i=0),r>=4&&(i+=Math.round(r/4)),(i||s)&&(r=0),o&&r&&!i&&!s&&(r+=Math.round(o/7),o=0),new j(s*e,i*e,r*e,o*e,a*e,l*e,c*e,u*e)}function lf(n,t){const e=Io(n,t);if(e.blank)return[0,"second"];for(const s of He){if(s==="millisecond")continue;const i=e[`${s}s`];if(i)return[i,s]}return[0,"second"]}var k=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Se=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},U,te,ee,qt,mt,jn,No,$o,jo,Ko,Mt;const cf=globalThis.HTMLElement||null,un=new j,Yi=new j(0,0,0,0,0,1);class uf extends Event{constructor(t,e,s,i){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=s,this.newTitle=i}}function Xi(n){if(!n.date)return 1/0;if(n.format==="duration"||n.format==="elapsed"){const e=n.precision;if(e==="second")return 1e3;if(e==="minute")return 60*1e3}const t=Math.abs(Date.now()-n.date.getTime());return t<60*1e3?1e3:t<60*60*1e3?60*1e3:60*60*1e3}const hn=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(n){if(this.elements.has(n))return;this.elements.add(n);const t=n.date;if(t&&t.getTime()){const e=Xi(n),s=Date.now()+e;s<this.time&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),e),this.time=s)}}unobserve(n){this.elements.has(n)&&this.elements.delete(n)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let n=1/0;for(const t of this.elements)n=Math.min(n,Xi(t)),t.update();this.time=Math.min(60*60*1e3,n),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}};class hf extends cf{constructor(){super(...arguments),U.add(this),te.set(this,!1),ee.set(this,!1),mt.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Mt.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title"]}get onRelativeTimeUpdated(){return k(this,Mt,"f")}set onRelativeTimeUpdated(t){k(this,Mt,"f")&&this.removeEventListener("relative-time-updated",k(this,Mt,"f")),Se(this,Mt,typeof t=="object"||typeof t=="function"?t:null,"f"),typeof t=="function"&&this.addEventListener("relative-time-updated",t)}get second(){const t=this.getAttribute("second");if(t==="numeric"||t==="2-digit")return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if(t==="numeric"||t==="2-digit")return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if(t==="numeric"||t==="2-digit")return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");if(t==="long"||t==="short"||t==="narrow")return t;if(this.format==="datetime"&&t!=="")return this.formatStyle}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=(t=this.getAttribute("day"))!==null&&t!==void 0?t:"numeric";if(e==="numeric"||e==="2-digit")return e}set day(t){this.setAttribute("day",t||"")}get month(){const t=this.format;let e=this.getAttribute("month");if(e!==""&&(e??(e=t==="datetime"?this.formatStyle:"short"),e==="numeric"||e==="2-digit"||e==="short"||e==="long"||e==="narrow"))return e}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");if(e==="numeric"||e==="2-digit")return e;if(!this.hasAttribute("year")&&new Date().getUTCFullYear()!==((t=this.date)===null||t===void 0?void 0:t.getUTCFullYear()))return"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if(t==="long"||t==="short"||t==="shortOffset"||t==="longOffset"||t==="shortGeneric"||t==="longGeneric")return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return(t=this.getAttribute("prefix"))!==null&&t!==void 0?t:this.format==="datetime"?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&of(t)?t:"P30D"}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return t==="past"?"past":t==="future"?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return He.includes(t)?t:this.format==="micro"?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return t==="datetime"?"datetime":t==="relative"?"relative":t==="duration"?"duration":t==="micro"?"micro":t==="elapsed"?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if(t==="long")return"long";if(t==="short")return"short";if(t==="narrow")return"narrow";const e=this.format;return e==="elapsed"||e==="micro"?"narrow":e==="datetime"?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(t){this.toggleAttribute("no-title",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(t==null?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){hn.unobserve(this)}attributeChangedCallback(t,e,s){e!==s&&(t==="title"&&Se(this,te,s!==null&&(this.date&&k(this,U,"m",jn).call(this,this.date))!==s,"f"),!k(this,ee,"f")&&!(t==="title"&&k(this,te,"f"))&&Se(this,ee,(async()=>{await Promise.resolve(),this.update(),Se(this,ee,!1,"f")})(),"f"))}update(){const t=k(this,mt,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let s=e;const i=this.date;if(typeof Intl>"u"||!Intl.DateTimeFormat||!i){k(this,mt,"f").textContent=t;return}const r=Date.now();k(this,te,"f")||(s=k(this,U,"m",jn).call(this,i)||"",s&&!this.noTitle&&this.setAttribute("title",s));const o=af(i,this.precision,r),a=k(this,U,"m",No).call(this,o);let l=t;a==="duration"?l=k(this,U,"m",$o).call(this,o):a==="relative"?l=k(this,U,"m",jo).call(this,o):l=k(this,U,"m",Ko).call(this,i),l?k(this,mt,"f").textContent=l:this.shadowRoot===k(this,mt,"f")&&this.textContent&&(k(this,mt,"f").textContent=this.textContent),(l!==t||s!==e)&&this.dispatchEvent(new uf(t,l,e,s)),a==="relative"||a==="duration"?hn.observe(this):hn.unobserve(this)}}te=new WeakMap,ee=new WeakMap,mt=new WeakMap,Mt=new WeakMap,U=new WeakSet,qt=function(){var t;const e=((t=this.closest("[lang]"))===null||t===void 0?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale(e??"").toString()}catch{return"default"}},jn=function(t){return new Intl.DateTimeFormat(k(this,U,"a",qt),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},No=function(t){const e=this.format;if(e==="datetime")return"datetime";if(e==="duration"||e==="elapsed"||e==="micro")return"duration";if((e==="auto"||e==="relative")&&typeof Intl<"u"&&Intl.RelativeTimeFormat){const s=this.tense;if(s==="past"||s==="future"||j.compare(t,this.threshold)===1)return"relative"}return"datetime"},$o=function(t){const e=k(this,U,"a",qt),s=this.format,i=this.formatStyle,r=this.tense;let o=un;s==="micro"?(t=Io(t),o=Yi,(this.tense==="past"&&t.sign!==-1||this.tense==="future"&&t.sign!==1)&&(t=Yi)):(r==="past"&&t.sign!==-1||r==="future"&&t.sign!==1)&&(t=o);const a=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:i,[a]:"always"}):t.abs().toLocaleString(e,{style:i})},jo=function(t){const e=new Intl.RelativeTimeFormat(k(this,U,"a",qt),{numeric:"auto",style:this.formatStyle}),s=this.tense;s==="future"&&t.sign!==1&&(t=un),s==="past"&&t.sign!==-1&&(t=un);const[i,r]=lf(t);return r==="second"&&i<10?e.format(0,this.precision==="millisecond"?"second":this.precision):e.format(i,r)},Ko=function(t){const e=new Intl.DateTimeFormat(k(this,U,"a",qt),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${e.format(t)}`.trim()};const Gi=typeof globalThis<"u"?globalThis:window;try{Gi.RelativeTimeElement=hf.define()}catch(n){if(!(Gi.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}class df extends I()({targets:{}}){}const ff=Object.freeze(Object.defineProperty({__proto__:null,default:df},Symbol.toStringTag,{value:"Module"}));function mf(){return/Mac|iMac|Macintosh|MacIntel/.test(navigator.userAgent)}class pf extends I()({targets:{alt:HTMLSpanElement,ctrl:HTMLSpanElement,shift:HTMLSpanElement}}){replaceSymbol(t,e){for(const s of t)s.innerText=e,s.classList.add("!font-fallback")}connect(){this.replaceSymbol(this.shiftTargets,"⇧"),mf()&&(this.replaceSymbol(this.ctrlTargets,"⌘"),this.replaceSymbol(this.altTargets,"⌥"))}}const gf=Object.freeze(Object.defineProperty({__proto__:null,default:pf},Symbol.toStringTag,{value:"Module"})),Ue=class Ue extends it{connect(){Ld(this)}save(){this.hasFormTarget?this.formTarget.requestSubmit():this.element.requestSubmit()}};Ue.debounces=["save"],Ue.targets=["form"];let Kn=Ue;const bf=Object.freeze(Object.defineProperty({__proto__:null,default:Kn},Symbol.toStringTag,{value:"Module"}));class yf extends I()({targets:{button:HTMLButtonElement,form:HTMLFormElement}}){get form(){return this.hasFormTarget?this.formTarget:this.element}runCheck(){this.buttonTarget.disabled=!this.form.checkValidity()}connect(){this.form.addEventListener("input",()=>this.runCheck()),this.runCheck(),_o(this,{childList:!0,subtree:!0})}mutate(){this.runCheck()}}const vf=Object.freeze(Object.defineProperty({__proto__:null,default:yf},Symbol.toStringTag,{value:"Module"}));class wf extends I()({targets:{perPage:HTMLSelectElement}}){connect(){}perPageChange(t){t.preventDefault();const s=t.target.value,i=new URL(window.location.href);new URLSearchParams(s.split("?")[1]).forEach((o,a)=>{i.searchParams.set(a,o)}),window.location.href=i.toString()}navigate(t){const e=t.target.closest("a");e&&(t.preventDefault(),window.location.href=e.href)}}const Ef=Object.freeze(Object.defineProperty({__proto__:null,default:wf},Symbol.toStringTag,{value:"Module"})),Tf=8,Af=8;class xf extends I()({targets:{activator:HTMLElement,wrapper:HTMLDivElement,tooltip:HTMLDivElement,arrow:HTMLDivElement,text:HTMLSpanElement}}){async update(){const t=this.element.getAttribute("data-placement")||"top";vs(this.activatorTarget,this.tooltipTarget,{placement:t,middleware:[gs(Tf+Af),ys({padding:8}),bs({padding:8}),Ad({element:this.arrowTarget})]}).then(({x:e,y:s,placement:i,middlewareData:r})=>{Object.assign(this.tooltipTarget.style,{left:`${e}px`,top:`${s}px`});const o=i.split("-")[0];this.tooltipTarget.setAttribute("data-side",o),this.arrowTarget.setAttribute("data-side",o);const{x:a,y:l}=r.arrow||{},c={top:"bottom",right:"left",bottom:"top",left:"right"}[o],u={left:a!=null?`${a}px`:"",top:l!=null?`${l}px`:"",right:"",bottom:""};c==="top"?u.bottom="-8px":c==="bottom"?u.top="-8px":c==="left"?u.right="-8px":c==="right"&&(u.left="-8px"),Object.assign(this.arrowTarget.style,u)})}showTooltip(t){this.wrapperTarget.classList.add("ariadne:block"),this.wrapperTarget.classList.remove("ariadne:hidden"),this.update()}hideTooltip(t){this.wrapperTarget.classList.add("ariadne:hidden"),this.wrapperTarget.classList.remove("ariadne:block")}}const Sf=Object.freeze(Object.defineProperty({__proto__:null,default:xf},Symbol.toStringTag,{value:"Module"})),Ze=pl.start();Ze.debug=!1;window.Stimulus=Ze;const Mf=Object.assign({"../../components/ariadne/form/toggle/component.ts":Fl,"../../components/ariadne/layout/sidebar/group/component.ts":Vl,"../../components/ariadne/ui/accordion/component.ts":Vh,"../../components/ariadne/ui/banner/component.ts":Ph,"../../components/ariadne/ui/clipboard_copy/component.ts":Uh,"../../components/ariadne/ui/combobox/component.ts":Bd,"../../components/ariadne/ui/dialog/component.ts":qd,"../../components/ariadne/ui/dialog_trigger/component.ts":Yd,"../../components/ariadne/ui/list/component.ts":Gd,"../../components/ariadne/ui/popover/component.ts":Qd,"../../components/ariadne/ui/relative_time/component.ts":ff,"../../components/ariadne/ui/shortcut/component.ts":gf});for(const[n,t]of Object.entries(Mf)){const e=n.split("/"),s=e.slice(3,e.length-1).join("-").replaceAll("_","-").toLocaleLowerCase();Ze.register(s,t.default)}const Of=Object.assign({"/controllers/form_autosubmit_controller.ts":bf,"/controllers/form_validity_controller.ts":vf,"/controllers/pagination_controller.ts":Ef,"/controllers/tooltip_controller.ts":Sf});for(const[n,t]of Object.entries(Of)){const e=n.split("/"),s=e[e.length-1].replace("_controller.ts","").replaceAll("_","-").toLocaleLowerCase();Ze.register(`ariadne-${s}`,t.default)}
|
99
99
|
//# sourceMappingURL=ariadne_view_components.js.map
|