@vite-hub/comments 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +6 -4
  2. package/dist/{client-diagnostics-D987sEK7.js → client-diagnostics-DoXqdnBd.js} +8 -0
  3. package/dist/client.d.ts +48 -3
  4. package/dist/client.js +231 -150
  5. package/dist/{database-Cguz3hZL.js → database-BuSNVwTx.js} +1 -1
  6. package/dist/database.js +1 -1
  7. package/dist/{define-C2tnAtBU.js → define-BqPcuDhf.js} +1 -1
  8. package/dist/{errors-ByCRdInk.js → errors-CBvIpwbo.js} +1 -1
  9. package/dist/hosted/hosted-comments/frame.js +1 -1
  10. package/dist/hosted/hosted-comments/tools.js +371 -0
  11. package/dist/hosted/hosted-comments.js +1 -19
  12. package/dist/index.js +4 -4
  13. package/dist/{install-D6hXZaSN.js → install-CqBWFmU7.js} +21 -15
  14. package/dist/{installed-bPUnazFf.js → installed-wUYjqk_k.js} +1 -1
  15. package/dist/{operations-8hqTi0DH.d.ts → operations-DFLer1fR.d.ts} +1 -0
  16. package/dist/{operations-BkkrI8a3.d.ts → operations-Qt8ASQqW.d.ts} +1 -1
  17. package/dist/{operations-B1ALn4VS.js → operations-kMPw-Cyb.js} +6 -7
  18. package/dist/operations.d.ts +1 -1
  19. package/dist/operations.js +2 -2
  20. package/dist/overlay/client-CrnKCZXc.js +4 -0
  21. package/dist/overlay/overlay.js +62 -35
  22. package/dist/page/loader.js +25 -23
  23. package/dist/{page-tools-shared-fvmJQCrP.js → page-tools-shared-BNw-aWEH.js} +2 -5
  24. package/dist/{plugin-l4sPt5-n.js → plugin-ChOHe7vq.js} +7 -7
  25. package/dist/realtime.d.ts +4 -1
  26. package/dist/realtime.js +1 -1
  27. package/dist/{request-origin-YPzfE2eh.js → request-origin-B-CPVAVk.js} +6 -1
  28. package/dist/{rpc-BYmbVkr8.js → rpc-kkxzQ3Qy.js} +1 -1
  29. package/dist/rpc.js +1 -1
  30. package/dist/runtime/auth.js +1 -1
  31. package/dist/runtime/console.js +1 -1
  32. package/dist/runtime/index.d.ts +1 -0
  33. package/dist/runtime/index.js +13 -13
  34. package/dist/{server-DvSehkPP.js → server-8o9u8leM.js} +1 -1
  35. package/dist/server.d.ts +1 -1
  36. package/dist/server.js +6 -6
  37. package/dist/{service-BIGe1Hpo.js → service-XT2A8YEF.js} +2 -2
  38. package/dist/{session-CCRLR9bf.js → session-DGdFKWDB.js} +7 -6
  39. package/dist/testing.js +1 -1
  40. package/dist/vite.d.ts +1 -1
  41. package/dist/vite.js +8 -4
  42. package/package.json +9 -8
  43. package/dist/hosted/hosted-comments/client-Czl2zu9P.js +0 -4
  44. package/dist/hosted/hosted-comments/dist-DyVmH21U.js +0 -14
  45. package/dist/hosted/hosted-comments/overlay-DpS0P-nd.js +0 -186
  46. package/dist/hosted/hosted-comments/protocol-DuB0Zhs-.js +0 -1
  47. package/dist/hosted/hosted-comments/rest-transport-CKZG_jZ4.js +0 -1
  48. package/dist/hosted/hosted-comments/tools-D8xg-kDW.js +0 -126
  49. package/dist/overlay/client-C7ftI-CB.js +0 -4
@@ -0,0 +1,371 @@
1
+ var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};function r(e,t){let n=new URLSearchParams(e);if(n.has(`vitehub`)||u.some(e=>n.has(e)))return!0;let r=t.split(`;`).map(e=>e.trim());return r.includes(`vitehub-tools=1`)?!0:r.includes(`vitehub_session=1`)&&!r.some(e=>e.startsWith(`vitehub-tools=`))}function i(e){let t=new URL(e,`http://localhost`).pathname,n=t.lastIndexOf(`${d}/`);return n===-1?f:`${t.slice(0,n)}${f}`}function a(e){return typeof e==`string`&&e?e:void 0}function o(e){if(typeof e!=`object`||!e)return;let t=a(Reflect.get(e,`id`)),n=a(Reflect.get(e,`script`));if(!t||!n)return;let r={id:t,label:a(Reflect.get(e,`label`))??t,icon:a(Reflect.get(e,`icon`))??``,script:n};Reflect.get(e,`lazy`)===!0&&(r.lazy=!0);let i=a(Reflect.get(e,`hotkey`));i&&(r.hotkey=i);let o=a(Reflect.get(e,`param`));return o&&(r.param=o),r}function s(e){if(typeof e!=`object`||!e)return;let t=a(Reflect.get(e,`name`)),n=a(Reflect.get(e,`signOut`));if(!t||!n?.startsWith(`/`)||n.startsWith(`//`)||n.includes(`\\`))return;let r={name:t,signOut:n},i=a(Reflect.get(e,`email`));i&&(r.email=i);let o=a(Reflect.get(e,`image`));return o&&/^https?:\/\//i.test(o)&&(r.image=o),Reflect.get(e,`via`)===`console`&&(r.via=`console`),Reflect.get(e,`guest`)===!0&&(r.guest=!0),r}function c(e){let t=typeof e==`object`&&e?Reflect.get(e,`tools`):void 0,n={tools:Array.isArray(t)?t.map(o).filter(e=>!!e):[]},r=typeof e==`object`&&e?s(Reflect.get(e,`account`)):void 0;return r&&(n.account=r),n}var l,u,d,f,p,m,h=t((()=>{l=`vitehub`,u=[`comment`],d=`/_vitehub/page/assets`,f=`/_vitehub/page/tools`,p=`button{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:var(--vitehub-pill-justify,center);gap:4px;min-width:28px;height:28px;padding:0 8px;border-radius:8px;font:inherit;white-space:nowrap;color:var(--vitehub-pill-text);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition-property:background-color,color;transition-duration:150ms;transition-timing-function:cubic-bezier(.23,1,.32,1)}
2
+ @media(hover:hover){button:where(:not(:disabled):hover){background:var(--vitehub-pill-hover);color:var(--vitehub-pill-strong)}}
3
+ button[aria-pressed=true],button[aria-expanded=true]{background:var(--vitehub-pill-on);color:var(--vitehub-pill-on-text)}
4
+ :host([aria-busy=true]) button,button[aria-busy=true]{background:var(--vitehub-pill-on);color:var(--vitehub-pill-on-text);cursor:progress}
5
+ button:focus-visible{outline:2px solid var(--vitehub-pill-on);outline-offset:1px}
6
+ button svg{width:14px;height:14px;flex:none}
7
+ @media(any-pointer:coarse){button{min-width:44px;height:44px}}
8
+ @media(prefers-reduced-motion:reduce){button{transition:none}}`,m=`data-vitehub-pill`,`${JSON.stringify([l,...u])}`}));h();var g=new Set,_,v=!1;function y(){return _?.matches??!1}function b(){let e=y();if(e!==v){v=e;for(let t of g)t(e)}}function x(){_||typeof matchMedia!=`function`||(_=matchMedia(`(prefers-reduced-motion: reduce)`),_.addEventListener?.(`change`,b),v=y())}function S(){return x(),y()}function C(e){return x(),g.add(e),()=>g.delete(e)}var w={snappy:{stiffness:520,damping:34},soft:{stiffness:380,damping:20}},T=new Map,E=new Set,D=0,O=!1,k=0,A=0,ee=1;function j(){return ee}function M(e){let t=Math.min(.032,A?(e-A)/1e3:.016)/ee;A=e;let n=Array.from(T),r=Array.from(E);for(let[e,r]of n)if(T.get(e)===r){if(e.tween){let n=e.tween;n.elapsed+=t;let r=Math.min(1,n.elapsed/n.duration),i=1-(1-r)**3,a=n.from+(e.target-n.from)*i;e.velocity=(a-e.value)/(t||1),e.value=a,r>=1&&N(e)}else{let{stiffness:n,damping:r}=e.preset,i=t/6;for(let t=0;t<6;t++){let t=-n*(e.value-e.target)-r*e.velocity;e.velocity+=t*i,e.value+=e.velocity*i}Math.abs(e.velocity)<.002&&Math.abs(e.value-e.target)<5e-4&&N(e)}e.frame(e.value,e.velocity)}for(let e of r)E.has(e)&&e(t)===!1&&E.delete(e);T.size||E.size?k=requestAnimationFrame(M):(k=0,A=0)}function N(e){e.value=e.target,e.velocity=0,e.tween=void 0,T.delete(e)}function te(e){T.set(e,++D),k||=requestAnimationFrame(M)}function P(e){let t=t=>e(t);return E.add(t),k||=requestAnimationFrame(M),()=>{E.delete(t)}}function ne(e){if(!e)return;let t=Array.from(T);for(let[e,n]of t)T.get(e)!==n||e.tween||(N(e),e.frame(e.value,0))}function F(e,t,n=w.snappy){let r={value:e,velocity:0,target:e,preset:n,tween:void 0,frame:t},i={get value(){return r.value},get velocity(){return r.velocity},get target(){return r.target},get active(){return T.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&S())return i.set(e);t.tween===void 0&&!O&&(O=!0,C(ne)),r.target=e,t.velocity!==void 0&&(r.velocity+=t.velocity),r.tween=t.tween===void 0?void 0:{from:r.value,elapsed:0,duration:t.tween},te(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,T.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,T.delete(r)}};return i}var re=`data-resize-handle-active`;function ie(e){let t=e;for(;t;){if(t.closest(`[data-motion="none"]`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}var ae=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],I=new Map,oe=new Set,L=Symbol.for(`vite-hub.motion.layer`),se;function ce(){let e=Reflect.get(globalThis,L);if(e&&e!==se&&typeof e==`object`&&`define`in e&&`install`in e)return e}function le(e){se=e,Reflect.get(globalThis,L)||Reflect.set(globalThis,L,e)}function ue(e){let t=[...I.values()];I.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function de(e,t=S){let n={effect:e,isReduced:t};I.set(e.name,n);for(let e of oe)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(I.get(e.name)===n){I.delete(e.name);for(let e of oe)e()}}}function fe(){return[...I.values()].map(e=>e.effect)}function pe(){return[...I.values()]}function me(e){return oe.add(e),()=>oe.delete(e)}function R(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}var he=new Map,ge,_e=new Map,ve,ye=[],be=Symbol.for(`vite-hub.motion.effect-presses`),xe=e=>{let t=Reflect.get(e,be);if(t)return t;let n=new Map;return Reflect.set(e,be,n),n},Se=new Set;function Ce(e,t){if(Se.has(t))return!1;try{return e.matches(t)}catch{return Se.add(t),!1}}function we(e){let t=e;for(;;){for(let e of he.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&he.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function Te(e,t){let n=-1;e.forEach((e,t)=>{e instanceof Element&&e.matches(`[data-motion="none"]`)&&(n=t)});let r=e.findIndex(e=>e instanceof HTMLElement&&Ce(e,t));return r===-1||r<=n||!we(e[r])?void 0:e[r]}function Ee(e,t,n){De(e,!0);let r=xe(t),i=[];for(let{effect:a,isReduced:o}of pe()){if(!a.press||o())continue;let s=Te(n,a.selector);if(!s||e===`key`&&s!==n[0])continue;let c=r.get(s);if(c?.has(a.name))continue;let l=a.press(s,t);if(!l)continue;c?c.add(a.name):r.set(s,new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>Oe(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(_e.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,Me,{capture:!0,passive:!0}))}function De(e,t=!1){let n=_e.get(e);if(n){_e.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();ke()}}function Oe(e,t,n=!1){let r=_e.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||_e.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),ke())}function ke(){[..._e.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,Me,{capture:!0})}function Ae(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(ve={event:e,path:t}),Ee(e.pointerId,e,t)}function je(e){ve?.event.pointerId===e.pointerId&&(ve=void 0),De(e.pointerId,e.type===`pointercancel`)}function Me(e){for(let{press:t}of _e.get(e.pointerId)??[])t.move?.(e)}function Ne(e){if(e.repeat||e.key!==` `&&e.key!==`Enter`)return;let t=e.composedPath();e.key===` `&&t[0]instanceof Element&&t[0].matches(`a[href], [role=link]`)||Ee(`key`,e,t)}function Pe(e){(e.key===` `||e.key===`Enter`)&&De(`key`)}function Fe(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=new Map;for(let t of e){if(t.type===`attributes`)continue;let e=t.type===`characterData`?t.target.parentElement:t.target;if(!(e instanceof HTMLElement||e instanceof SVGElement))continue;let n=r.get(e);n||(n={added:[],removed:[],oldText:void 0,texts:new Map},r.set(e,n)),t.type===`characterData`?n.texts.has(t.target)||n.texts.set(t.target,t.oldValue):(n.added.push(...t.addedNodes),n.removed.push(...t.removedNodes))}for(let[e,t]of r){if(!e.isConnected)continue;let r=t.added.filter(e=>!t.removed.includes(e)),i=t.removed.filter(e=>!t.added.includes(e)),a=t.texts,o,s=[...e.childNodes];i.length&&s.every(e=>r.includes(e))?o=i.map(e=>e.textContent??``).join(``):a.size===1&&s.length===1&&a.has(s[0])&&(o=a.get(s[0])??``);for(let t of n)Ce(e,t.selector)&&!ie(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function Ie(e){if(!ve||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=pe().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=ve,i=_e.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&Oe(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!we(e)||ie(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),_e.set(n.pointerId,i),document.addEventListener(`pointermove`,Me,{capture:!0,passive:!0}))}function Le(e){let t=[...new Set(e)],n=fe(),r=new Map;Fe(t,n);for(let e of t)if(e.type!==`characterData`){if(e.type===`attributes`){let t=e.target;if(!(t instanceof HTMLElement))continue;if(e.attributeName===`data-resize-handle-active`){Ie(t);continue}let i=e.attributeName,a=t.getAttribute(i);if(a===e.oldValue)continue;let o=r.get(t);o||r.set(t,o=new Map);let s=o.get(i);if(s||o.set(i,s=new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&Ce(t,r.selector)&&!ie(t)&&r.state(t,{attribute:i,oldValue:e.oldValue,value:a})}else for(let t of e.addedNodes)if(t instanceof HTMLElement&&t.isConnected)for(let e of n){if(!e.enter)continue;let n=Ce(t,e.selector);if(Se.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)ie(t)||e.enter(t)}}}function Re(e,t){let n=fe().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...ae,...fe().some(e=>e.name===`divider`)?[re]:[]],attributeOldValue:!0,childList:n||fe().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function ze(e,t){let n=fe();for(let[e,r]of t)n.includes(e)||(r(),t.delete(e));for(let r of n)r.watch&&!t.has(r)&&t.set(r,r.watch(e))}function Be(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,Ae,e),document.addEventListener(`pointerup`,je,e),document.addEventListener(`pointercancel`,je,e),document.addEventListener(`keydown`,Ne,e),document.addEventListener(`keyup`,Pe,e),ye=[()=>{document.removeEventListener(`pointerdown`,Ae,e),document.removeEventListener(`pointerup`,je,e),document.removeEventListener(`pointercancel`,je,e),document.removeEventListener(`keydown`,Ne,e),document.removeEventListener(`keyup`,Pe,e),ve=void 0;for(let e of _e.keys())De(e,!0)},C(e=>{if(e){ve=void 0;for(let e of _e.keys())De(e,!0)}})]}function Ve(e,t){if(typeof document>`u`)return()=>{};let n=ce();return n?(ue(n),n.install(e,t.effects,S)):(le(He),Ue(e,t.effects))}var He={define:de,install:Ue};function Ue(e,t,n=S){let r=new Set(fe().map(e=>e.name));for(let e of t)r.has(e.name)||de(e,n);if(!ge){Be();let e=new MutationObserver((e,t)=>Le(e.concat(t.takeRecords())));ge=e,ye.push(me(()=>{for(let[t,{watchers:n}]of he)Re(t,e),ze(t,n)}))}let i=he.get(e);if(i)i.installs++;else{let t=new Map;Re(e,ge),he.set(e,{installs:1,watchers:t}),ze(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=he.get(e);if(!t||--t.installs>0)return;he.delete(e);let n=ge,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if(he.size){for(let e of he.keys())Re(e,n);r.length&&queueMicrotask(()=>{if(ge!==n)return;let e=[...he.keys()];Le(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{ge=void 0;for(let e of ye)e();ye=[]}}}function We(e,t,n,r){let i=(e,t,n)=>3*t*e*(1-e)**2+3*n*e**2*(1-e)+e**3;return a=>{if(a<=0||a>=1)return a<=0?0:1;let o=0,s=1,c=a;for(let t=0;t<24;t++)i(c,e,n)<a?o=c:s=c,c=(o+s)/2;return i(c,t,r)}}var Ge=e=>e;function Ke(e,t,n,r,i){let a=(n.delay??0)/1e3,o=n.duration/1e3,s=n.ease??Ge,c=S(),l=0;return{stop:P(n=>{l+=n;let u=!c&&S()||l>=a+o?1:o>0?Math.max(0,(l-a)/o):0;return r(e+(t-e)*s(u)),u<1||(i?.(),!1)})}}function z(e,t,n=Ge,r=0){let i=()=>{},a=new Promise(e=>i=e),o=Ke(0,1,{duration:e*1e3,delay:r*1e3,ease:n},t,()=>i(!0));return{done:a,stop:()=>{o.stop(),i(!1)}}}var qe={stiffness:900,damping:40},Je={stiffness:380,damping:14},Ye=`:is(button, a[href], summary, input:is([type=button], [type=submit], [type=reset], [type=checkbox], [type=radio]), ${[`button`,`link`,`tab`,`radio`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`option`,`checkbox`].map(e=>`[role=${e}]`).join(`, `)}, [data-motion-press]:not([data-motion-press=none])):not(:disabled, [aria-disabled="true"], [role=switch])`,Xe=`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`,Ze=`:is(button, input:is([type=button], [type=submit], [type=reset])):is(:not([role]), [role=button])`,Qe=Symbol.for(`vite-hub.motion.press-mode`);function $e(){let e=Reflect.get(globalThis,Qe);return e===`opt-in`||e===`all`?e:`buttons`}var et=new WeakMap,tt=e=>e>=40?.03:e>=32?.04:.05,nt=e=>Math.min(tt(e.offsetHeight),6/Math.max(e.offsetWidth,e.offsetHeight));function rt(e,t){for(let n of t.composedPath()){if(!(n instanceof Element))continue;let t=n.getAttribute(`data-motion-press`);if(t===`none`||n===e&&t!==null)return t}}function it(e){let t=$e();return t===`buttons`?e.matches(Ze)&&e.offsetHeight<48&&e.offsetWidth<=4*e.offsetHeight:t===`all`}function at(e,t){if(t===`none`)return;if(t===`icon`){let t=e.querySelector(Xe);return t instanceof HTMLElement||t instanceof SVGElement?{target:t,amount:.15}:void 0}if(t===void 0&&!it(e))return;let n=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(n instanceof HTMLElement)return{target:n,amount:nt(n)};let r=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.matches(Xe)?{target:r,amount:.15}:{target:e,amount:nt(e)}}function ot(e){let t=e.transitionDuration.split(`,`);return e.transitionProperty.split(`,`).some((e,n)=>/^\s*(?:scale|all)\s*$/.test(e)&&Number.parseFloat(t[n%t.length])>0)}function st(e,t,n){let{left:r,right:i,top:a,bottom:o,width:s,height:c}=e;return Math.min(t.clientX-r,i-t.clientX)<=s*n||Math.min(t.clientY-a,o-t.clientY)<=c*n}var ct={name:`press`,selector:Ye,press(e,t){if(!(`pointerId`in t))return;let n=at(e,rt(e,t));if(!n)return;let{target:r,amount:i}=n,a=getComputedStyle(r);if(ot(a)||a.display===`contents`||a.display===`inline`&&r===e&&!(e instanceof HTMLInputElement))return;let o;if(r===e&&(o=e.getBoundingClientRect(),st(o,t,i)))return;let s=et.get(r);if(!s){let e={amount:i,spring:F(0,t=>{R(r,{scale:t?String(1-e.amount*t):null})},qe)};s=e,et.set(r,s)}s.amount=i;let{spring:c}=s;c.to(1,{preset:qe});let l=!1,u=()=>{l||(l=!0,c.set(0))};return{move:o?e=>{st(o,e,i)&&u()}:void 0,release:()=>{l||c.to(0,{preset:Je})},cancel:u}}};function lt(e){let t=e.cloneNode(!0);t.inert=!0,t.setAttribute(`aria-hidden`,`true`);for(let e of[t,...t.querySelectorAll(`[id], [name], [form], input, button, select, textarea, fieldset`)])e.removeAttribute(`id`),e.removeAttribute(`name`),e.removeAttribute(`form`),e.matches(`input, button, select, textarea, fieldset`)&&e.setAttribute(`disabled`,``);return t}var ut={stiffness:380,damping:26},dt={stiffness:260,damping:28},ft=.9,pt=.32,mt=We(.5,0,.75,0),ht=`data-motion-ghost`,gt=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function _t(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function vt(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(ht))}function yt(e,t={}){let n=t.items??vt,r=new Map,i=new Set,a=new Map,o=!1;function s(e){if(!e)return{x:0,y:0};let t=1-e.grow.value;return{x:e.x.value+e.from.x*t,y:e.y.value+e.from.y*t}}function c(e,t){let{x:n,y:i,grow:a,from:c}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){R(e,{translate:null,scale:null,opacity:null}),o||r.delete(e);return}let{x:l,y:u}=s(t),d=c.scale+(1-c.scale)*a.value;R(e,{translate:l||u?`${l.toFixed(2)}px ${u.toFixed(2)}px`:null,scale:d===1?null:d.toFixed(4),opacity:a.value>=1?null:Math.max(0,Math.min(1,a.value)).toFixed(3)})}function l(e){let t=r.get(e);if(t)return t;let n=()=>t&&c(e,t);return t={x:F(0,n,w.snappy),y:F(0,n,w.snappy),grow:F(1,n,ut),from:{x:0,y:0,scale:1}},r.set(e,t),t}function u(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),R(e,{translate:null,scale:null,opacity:null}))}function d(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:w.snappy,velocity:n})}function f(t,n,r){if(!_t(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let o=lt(t);o.setAttribute(ht,``),Object.assign(o.style,{boxSizing:`border-box`,height:`${n.height}px`,left:`${n.left-a.left-e.clientLeft+e.scrollLeft}px`,margin:`0`,pointerEvents:`none`,position:`absolute`,top:`${n.top-a.top-e.clientTop+e.scrollTop}px`,width:`${n.width}px`}),R(o,{translate:null,scale:null,opacity:null,filter:null}),e.append(o);let s={element:o,stop:()=>{}},c=()=>{s.stop(),o.remove(),i.delete(s)};if(i.add(s),S()){let e=z(.15,e=>R(o,{opacity:(1-e).toFixed(3)}));s.stop=e.stop,e.done.then(c);return}if(r){let e=gt(r.getBoundingClientRect()),t=gt(n),i=z(pt,n=>{R(o,{translate:`${((e.x-t.x)*n).toFixed(2)}px ${((e.y-t.y)*n).toFixed(2)}px`,scale:(1-.8*n).toFixed(4),opacity:(1-n).toFixed(3),filter:n>0?`blur(${(3*n).toFixed(2)}px)`:null})},mt);s.stop=i.stop,i.done.then(c);return}let l=F(1,e=>{R(o,{scale:(ft+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&c()},dt);s.stop=()=>l.stop(),l.to(0)}return{measure(){a=new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=gt(e),i=s(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let c=a;a=new Map;let p=ie(e),m=n(e),h=new Set(m),g=m.map(e=>{let t=e.getBoundingClientRect(),n=s(r.get(e)),i=gt(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),_=g.map(({element:e})=>{if(!c.has(e)&&i.origin)return(typeof i.origin==`function`?i.origin(e):i.origin)?.getBoundingClientRect()});for(let[e,{rect:n}]of c)h.has(e)||(u(e),p||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||f(e,n,i.target));o=!0,g.forEach(({element:e,rect:n,layout:r},i)=>{if(p)return u(e);let a=c.get(e);if(a){let t=a.x-r.x,i=a.y-r.y;if(Math.abs(t)<.5&&Math.abs(i)<.5)return;if(!_t(a.rect)&&!_t(n))return u(e);let o=l(e);d(o.x,o.x.value+t),d(o.y,o.y.value+i);return}if(!_t(n)||t.movesOnly)return;let o=l(e),s=_[i];if(S())o.from={x:0,y:0,scale:1};else if(s){let e=gt(s),t=Math.min(1,Math.max(.2,Math.min(s.width/(n.width||1),s.height/(n.height||1))));o.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else o.from={x:0,y:0,scale:ft};o.grow.set(0),o.grow.to(1,S()?{tween:.15}:{preset:ut})}),o=!1},destroy(){for(let e of r.keys())u(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=new Map}}}var bt=new Map,xt;function St(e,t){let n=e.parentElement;n&&!t.aborted&&(bt.set(e,n),t.addEventListener(`abort`,()=>{bt.delete(e),Et(e),bt.size||(xt?.stop(),xt=void 0)},{once:!0}),xt??=Ct(),xt.refresh())}function Ct(){let e=new AbortController,t=new Set([document]),n=new Set,r=document.createElement(`div`);r.popover=`manual`,r.style.cssText=`all:initial!important;display:block!important;position:fixed!important;inset:0 auto auto 0!important;width:2px!important;height:2px!important;opacity:0!important`;let i=(e=!1)=>{let t=wt(n,r)??Tt();for(let[n,r]of bt){if(!n.parentElement)continue;let i=t??r;i.isConnected&&(n.parentElement!==i&&(Et(n),i.append(n)),t?typeof n.showPopover==`function`&&(e||!n.matches(`:popover-open`))&&(Et(n),n.popover=`manual`,n.showPopover()):Et(n))}},a=new MutationObserver(e=>{let c=!1,l=!1;for(let t of e){t.target instanceof HTMLDialogElement&&t.type===`attributes`&&(c=!0,t.target.matches(`:modal`)&&(l=!0));for(let e of t.addedNodes)e instanceof Element&&e.isConnected&&e!==r&&!(e instanceof HTMLElement&&bt.has(e))&&s(e)&&(c=!0)}for(let e of n)e.isConnected||(n.delete(e),c=!0);let u=!1;for(let e of t)e instanceof ShadowRoot&&!e.host.isConnected&&(t.delete(e),u=!0);if(u){a.disconnect();for(let e of t)o(e)}(c||[...bt.keys()].some(e=>!e.isConnected&&e.parentElement))&&i(l)});function o(e){a.observe(e,{attributes:!0,attributeFilter:[`open`],childList:!0,subtree:!0})}function s(e){let t=!1,r=e=>{e instanceof HTMLDialogElement&&!n.has(e)&&(n.add(e),t=!0),e.shadowRoot&&c(e.shadowRoot)&&(t=!0)};e instanceof Element&&r(e);for(let t of e.querySelectorAll(`*`))r(t);return t}function c(e){return!t.has(e)&&(t.add(e),o(e),s(e))}return o(document),document.addEventListener(`focusin`,t=>{let n=!1;for(let e of t.composedPath())e instanceof ShadowRoot&&e.mode===`open`&&c(e)&&(n=!0);n&&queueMicrotask(()=>{e.signal.aborted||i()})},{signal:e.signal}),document.addEventListener(`fullscreenchange`,()=>i(!0),{signal:e.signal}),{refresh(){s(document.documentElement),i()},stop(){a.disconnect(),e.abort()}}}function wt(e,t){let n=[...e].filter(e=>e.isConnected&&e.matches(`:modal`));return n.length<2||typeof t.showPopover!=`function`?n[0]:n.find(e=>{let n=e.getRootNode();e.append(t),t.showPopover();let r=(n instanceof ShadowRoot?n:document).elementFromPoint(1,1);return t.hidePopover(),t.remove(),r===t})}function Tt(){let e=document.fullscreenElement;for(;e?.shadowRoot?.fullscreenElement&&e.shadowRoot.fullscreenElement!==e;)e=e.shadowRoot.fullscreenElement;return e}function Et(e){e.hasAttribute(`popover`)&&(e.matches(`:popover-open`)&&e.hidePopover(),e.removeAttribute(`popover`))}var Dt={effects:[ct]},Ot=[[`0px`,`6px`],[`6px`,`0px`],[`calc(100% - 6px)`,`0px`],[`100%`,`6px`],[`100%`,`50%`],[`100%`,`50%`],[`100%`,`calc(100% - 6px)`],[`calc(100% - 6px)`,`100%`],[`6px`,`100%`],[`0px`,`calc(100% - 6px)`],[`0px`,`50%`],[`0px`,`50%`]],kt=e=>e.map(([e,t])=>[`calc(50% + var(--vitehub-hex-w) * ${e})`,`calc(50% + var(--vitehub-hex-h) * ${t})`]),At=kt([[-.28,-.453],[-.208,-.5],[.208,-.5],[.28,-.453],[.488,-.047],[.488,.047],[.28,.453],[.208,.5],[-.208,.5],[-.28,.453],[-.488,.047],[-.488,-.047]]),jt=kt([[-.5,-.5],[-.5,-.5],[.5,-.5],[.5,-.5],[.5,0],[.5,0],[.5,.5],[.5,.5],[-.5,.5],[-.5,.5],[-.5,0],[-.5,0]]),Mt=e=>`polygon(${e.map(([e,t])=>`${e} ${t}`).join(`,`)})`;function Nt(e,t,n){let r=(1-n).toFixed(4),i=n.toFixed(4);return Mt(e.map(([e,n],a)=>[`calc(${e} * ${r} + ${t[a][0]} * ${i})`,`calc(${n} * ${r} + ${t[a][1]} * ${i})`]))}var Pt=Mt(Ot),Ft=Mt(At),It=Mt(jt),Lt=e=>`calc(var(--start) + ${e} / 2 + (100% - var(--start) - var(--end) - ${e}) * var(--at) / 100)`,Rt=`:host{all:initial;position:fixed;z-index:2147483001;pointer-events:none;filter:drop-shadow(0 8px 24px rgb(0 0 0/25%));color-scheme:dark;font:500 12px/1 ui-sans-serif,system-ui,sans-serif;color:#d4d4d4;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--vitehub-pill-text:#d4d4d4;--vitehub-pill-strong:#fafafa;--vitehub-pill-muted:#a3a3a3;--vitehub-pill-hover:rgb(255 255 255/8%);--vitehub-pill-on:#fafafa;--vitehub-pill-on-text:#0a0a0a;--vitehub-pill-line:rgb(255 255 255/12%);--vitehub-pill-surface:#111;--vitehub-pill-flow:row;--vitehub-hex-h:24px;--vitehub-hex-w:calc(var(--vitehub-hex-h) * 10 / 9);--vitehub-pill-fade:opacity 160ms ease-out 80ms,visibility 0s;--vitehub-pill-fade-end:opacity 160ms ease-out 120ms,visibility 0s;--at:50;--margin:16px;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
9
+ :host([collapsed]){--margin:2px;--vitehub-pill-fade:opacity 80ms ease-out,visibility 0s 80ms;--vitehub-pill-fade-end:opacity 40ms ease-out,visibility 0s 40ms}
10
+ :host(:is([edge=top],[edge=bottom])){left:${Lt(`0px`)};width:max-content;--start:max(var(--margin),var(--safe-left));--end:max(var(--margin),var(--safe-right));--x:calc(var(--at) * -1%)}
11
+ :host(:is([edge=left],[edge=right])){top:${Lt(`0px`)};--start:max(var(--margin),var(--safe-top));--end:max(var(--margin),var(--safe-bottom));--y:calc(var(--at) * -1%);--vitehub-pill-flow:column;--vitehub-pill-justify:flex-start}
12
+ :host([edge=bottom]){bottom:max(16px,var(--safe-bottom))}
13
+ :host([edge=top]){top:max(16px,var(--safe-top))}
14
+ :host([edge=right]){right:max(16px,var(--safe-right))}
15
+ :host([edge=left]){left:max(16px,var(--safe-left))}
16
+ :host([collapsed]:is([edge=top],[edge=bottom])){left:${Lt(`var(--vitehub-hex-w)`)};--x:-50%}
17
+ :host([collapsed]:is([edge=left],[edge=right])){top:${Lt(`var(--vitehub-hex-h)`)};--y:-50%}
18
+ :host([collapsed][edge=bottom]){bottom:calc(max(2px,var(--safe-bottom)) + var(--vitehub-hex-h) / 2);--y:50%}
19
+ :host([collapsed][edge=top]){top:calc(max(2px,var(--safe-top)) + var(--vitehub-hex-h) / 2);--y:-50%}
20
+ :host([collapsed][edge=right]){right:calc(max(2px,var(--safe-right)) + var(--vitehub-hex-w) / 2);--x:50%}
21
+ :host([collapsed][edge=left]){left:calc(max(2px,var(--safe-left)) + var(--vitehub-hex-w) / 2);--x:-50%}
22
+ :host{transform:translate(var(--x,0),var(--y,0))}
23
+ :host([dragging]){transition:none;cursor:grabbing;user-select:none;-webkit-user-select:none}
24
+ div{position:relative;box-sizing:border-box;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;scrollbar-width:none;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:8px;padding:4px;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:rgb(17 17 17/92%);pointer-events:auto;clip-path:${Pt};transition:background-color 150ms ease-out}
25
+ :host(:is([edge=left],[edge=right])) div{display:grid;grid-template-columns:auto 1fr;align-items:stretch;gap:8px 2px}
26
+ :host([collapsed]){filter:drop-shadow(0 0 .5px rgb(255 255 255/70%)) drop-shadow(0 0 .5px rgb(255 255 255/70%)) drop-shadow(0 8px 24px rgb(0 0 0/25%))}
27
+ :host([collapsed]) div{clip-path:${Ft};background:rgb(32 32 32/94%)}
28
+ @media(hover:hover){:host([collapsed]) div:hover{background:rgb(52 52 52/94%)}}
29
+ :host([dragging]) div{transition:none}
30
+ ::slotted(*){flex-shrink:0;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:2px;transition:var(--vitehub-pill-fade)}
31
+ :host(:is([edge=left],[edge=right])) ::slotted(*){grid-column:1/-1;align-items:stretch}
32
+ ::slotted([hidden]){display:none!important}
33
+ :host([collapsed]) ::slotted(*),:host([collapsed]) .exit{opacity:0;visibility:hidden}
34
+ .page-bar{position:absolute;bottom:0;width:0;height:var(--vitehub-page-bar,0px);visibility:hidden;pointer-events:none}
35
+ .tabs{position:absolute;display:flex;width:max-content;height:max-content;max-width:calc(100vw - max(16px,var(--safe-left)) - max(16px,var(--safe-right)));max-height:calc(100dvh - max(16px,var(--safe-top)) - max(16px,var(--safe-bottom)));gap:4px;overflow:auto;pointer-events:auto}
36
+ :host([collapsed]) .tabs{visibility:hidden}
37
+ :host(:is([edge=top],[edge=bottom])) .tabs{left:calc(var(--at) * 1%);translate:calc(var(--at) * -1%) 0;max-height:calc(100dvh - max(16px,var(--safe-top)) - max(16px,var(--safe-bottom)) - 100%)}
38
+ :host(:is([edge=left],[edge=right])) .tabs{top:calc(var(--at) * 1%);translate:0 calc(var(--at) * -1%);max-width:calc(100vw - max(16px,var(--safe-left)) - max(16px,var(--safe-right)) - 100%);flex-direction:column}
39
+ :host([edge=bottom]) .tabs{bottom:100%;align-items:safe flex-end}
40
+ :host([edge=top]) .tabs{top:100%;align-items:flex-start}
41
+ :host([edge=left]) .tabs{left:100%;align-items:flex-start}
42
+ :host([edge=right]) .tabs{right:100%;align-items:safe flex-end}
43
+ ::slotted([slot=tab]){padding:3px;border:1px solid var(--vitehub-pill-line);background:rgb(17 17 17/92%);pointer-events:auto}
44
+ :host([edge=bottom]) ::slotted([slot=tab]){border-bottom:0;border-radius:10px 10px 0 0}
45
+ :host([edge=top]) ::slotted([slot=tab]){border-top:0;border-radius:0 0 10px 10px}
46
+ :host([edge=left]) ::slotted([slot=tab]){border-left:0;border-radius:0 10px 10px 0}
47
+ :host([edge=right]) ::slotted([slot=tab]){border-right:0;border-radius:10px 0 0 10px}
48
+ ${p}
49
+ button{flex-shrink:0;padding:0;justify-content:center}
50
+ .exit{position:sticky;right:0;bottom:0;transition:background-color 150ms,color 150ms,var(--vitehub-pill-fade-end)}
51
+ :host(:is([edge=left],[edge=right])) .mark{justify-self:start}
52
+ :host(:is([edge=left],[edge=right])) .exit{grid-area:1/2;justify-self:end;top:0;bottom:auto}
53
+ .mark{position:sticky;left:0;top:0;z-index:1;cursor:grab}
54
+ :host([dragging]) .mark{cursor:grabbing}
55
+ .mark,.mark[aria-expanded=true]{background:none;color:var(--vitehub-pill-strong)}
56
+ @media(hover:hover){.mark:hover{background:var(--vitehub-pill-hover)}}
57
+ .mark svg{width:16px;height:16px;transition:opacity 160ms ease-out 120ms}
58
+ :host([collapsed]) .mark svg{opacity:0;transform:scale(.6);transition-duration:40ms;transition-delay:0s}
59
+ :host([collapsed]) .mark:is(:hover,:active){background:none}
60
+ :host([collapsed]) .mark{transform:translate(var(--vitehub-mark-x,0),var(--vitehub-mark-y,0))}
61
+ :host([collapsed]) .mark::before{content:"";position:absolute;inset:-8px}
62
+ :host([fold=mark]){transition:filter 240ms ease-out}
63
+ :host([fold=mark][collapsed]){filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
64
+ :host([fold=mark]:not([dragging])) div{transition:background-color 120ms ease-out,border-color 120ms ease-out}
65
+ :host([fold=mark][collapsed]) div,:host([fold=mark][collapsed]) div:hover{clip-path:${It};background-color:transparent;border-color:transparent}
66
+ :host([fold=mark]) .mark{transition:background-color 150ms ease-out,color 150ms ease-out}
67
+ :host([fold=mark]) .mark svg{transition:none}
68
+ :host([fold=mark][collapsed]) .mark svg{opacity:1;transform:scale(1.5)}
69
+ @media(any-pointer:coarse){:host{--vitehub-hex-h:40px}:host([fold=mark][collapsed]) .mark svg{transform:scale(2.5)}}
70
+ @media(prefers-reduced-motion:reduce){:host,div,::slotted(*),.exit,.mark svg,:host([fold=mark]) :is(div,.mark){transition:none}}`;function zt(e,t,n){let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[t,i]of Object.entries({viewBox:e,"aria-hidden":`true`,...n}))r.setAttribute(t,i);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return i.setAttribute(`d`,t),r.append(i),r}var Bt=[`top`,`right`,`bottom`,`left`];function Vt(e){return Bt.some(t=>t===e)}function Ht(e){let t=typeof e==`object`&&e?Reflect.get(e,`edge`):void 0,n=typeof e==`object`&&e?Reflect.get(e,`at`):void 0;return Vt(t)&&typeof n==`number`&&n>=0&&n<=100?{edge:t,at:n}:void 0}function Ut(e){try{return Ht(JSON.parse(localStorage.getItem(e)??`null`))}catch{return}}function Wt(e,t,n,r){let i=Math.min(70,r/4),a=Math.atan2(t-r/2,e-n/2),o=Math.atan2(i-r/2,-n/2),s=Math.atan2(i-r/2,n/2),c=Math.atan2(r/2-i,n/2),l=Math.atan2(r/2-i,-n/2);return a>=o&&a<=s?`top`:a>s&&a<c?`right`:a>=c&&a<=l?`bottom`:`left`}function Gt(e,t,n,r,i){let a=i-n-r-t,o=a>0?Math.min(100,Math.max(0,(e-n-t/2)/a*100)):50;return o<2?0:o>98?100:Math.abs(o-50)<3?50:Math.round(o*10)/10}function Kt(e,t,n,r={top:0,right:0,bottom:0,left:0},i=0){let a=e.width-Math.max(16,r.left)-Math.max(16,r.right),o=e.width>640?Math.max(12,r.top)+40:r.top,s=t=>e.height-o-Math.max(Math.max(16,r.bottom)+t,i)-8;return a-t.width-8>=300?{fit:`beside`,width:a-t.width-8,height:s(n?54:38)}:s(t.height)>=240?{fit:`above`,width:a,height:s(t.height)}:{fit:`fold`,width:a,height:s(n?54:38)}}var qt=new WeakMap;function Jt(e){let t=e?getComputedStyle(e).transform:`none`,n=/^matrix\(([^,]+)/.exec(t)?.[1];return n&&Number.parseFloat(n)||1}function Yt(e,t,n,r,i){let a=()=>e.getAttribute(`fold`)===`mark`?jt:At,o=()=>n.querySelector(`svg`),s={x:0,y:0},c=1,l=!1,u,d=[],f=()=>{if(!l&&!p.active&&!m.active&&!h.active){R(t,{"clip-path":null}),R(e,{translate:null}),R(n,{translate:null});let r=o();r&&R(r,{scale:null});for(let e of d)e();d=[],i();return}let r=e.hasAttribute(`collapsed`),u=p.value;R(t,{"clip-path":Nt(Ot,a(),u)}),R(e,{translate:`${m.value.toFixed(2)}px ${h.value.toFixed(2)}px`});let f=r?s:{x:0,y:0};R(n,{translate:`${(s.x*u-f.x).toFixed(2)}px ${(s.y*u-f.y).toFixed(2)}px`});let g=o();g&&R(g,{scale:((1+(c-1)*u)/(r?c:1)).toFixed(4)})},p=F(0,f,w.snappy),m=F(0,f,w.snappy),h=F(0,f,w.snappy),g=()=>{let e=t.getBoundingClientRect();return{x:e.left+e.width/2-m.value,y:e.top+e.height/2-h.value}},_=()=>{s={x:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-x`))||0,y:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-y`))||0},e.hasAttribute(`collapsed`)&&(c=Jt(o()))};return{get moving(){return l||p.active||m.active||h.active},move(t,n=0){r();let i=new Promise(e=>d.push(e)),a=g(),o=e.hasAttribute(`collapsed`);_(),t(),_();let s=g(),c=e.hasAttribute(`collapsed`);clearTimeout(u),l=!0;for(let[e,t]of[[m,a.x-s.x+m.value],[h,a.y-s.y+h.value]]){let n=e.velocity;e.set(t),n&&e.to(t,{velocity:n})}p.active||p.set(+!!o);let f=()=>{l=!1,m.to(0,{preset:w.snappy}),h.to(0,{preset:w.snappy}),p.to(+!!c,{preset:w.snappy})};return n>0&&!S()?u=setTimeout(f,n*j()):f(),i}}}function Xt(e){let{signal:t}=e,n=document.createElement(e.name);n.style.viewTransitionName=e.name,e.fold===`mark`&&n.setAttribute(`fold`,`mark`);let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=Rt;let a=document.createElement(`div`);a.setAttribute(`role`,`toolbar`),a.setAttribute(`aria-label`,e.label);let o=document.createElement(`button`);o.className=`mark`,o.dataset.motionPress=``,o.append(e.mark);let s=e.initial?.collapsed===!0,c=t=>{t&&a.scrollTo(0,0),n.toggleAttribute(`collapsed`,t),t&&e.fold!==`mark`?o.dataset.motionPressTarget=`[role=toolbar]`:delete o.dataset.motionPressTarget,o.setAttribute(`aria-expanded`,String(!t)),o.setAttribute(`aria-label`,`${t?`Show`:`Hide`} ${e.label}`),o.title=`${o.getAttribute(`aria-label`)}. Drag to move.`},l=()=>e.markOnly?.active()===!0,u=e.markOnly?.opened===!0,d=()=>l()?!u:en(e.storage.collapsed)??s;c(d());let f=e=>{let t=v,r=e&&n.contains(document.activeElement);y=void 0,e&&t.edge!==`bottom`&&b(_)&&(y=t),te.move(()=>{c(e),k(_)},e&&!n.hasAttribute(`collapsed`)?40:0).then(()=>{y&&(y=void 0,n.hasAttribute(`collapsed`)&&k(_))}),r&&o.focus({preventScroll:!0})};o.addEventListener(`click`,()=>{if(A())return;let t=!n.hasAttribute(`collapsed`);if(T=!1,f(t),!t&&D()&&e.windows?.hide(),l())u=!t;else try{t===s?localStorage.removeItem(e.storage.collapsed):localStorage.setItem(e.storage.collapsed,t?`1`:`0`)}catch{}});let p=e.exit,m;p&&(m=document.createElement(`button`),m.className=`exit`,m.dataset.motionPress=``,m.setAttribute(`aria-label`,p.label),m.title=p.label,m.append(zt(`0 0 24 24`,`M18 6 6 18M6 6l12 12`,{width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})),p.menu||m.addEventListener(`click`,e=>p.press(e.detail===0))),a.append(o,...m?[m]:[]);let h=document.createElement(`slot`);h.name=`tab`,h.className=`tabs`;let g=document.createElement(`span`);g.className=`page-bar`,r.append(i,h,a,g),m&&p?.menu&&r.append(...p.menu(m));for(let t of e.slots){let e=document.createElement(`slot`);e.name=t,a.insertBefore(e,m??null)}let _=Ut(e.storage.dock)??e.initial?.dock??{edge:`bottom`,at:50},v=_,y,b=e=>l()&&!n.hasAttribute(`dragging`)&&e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:void 0,x=()=>v.edge===`left`||v.edge===`right`,S=matchMedia(`(any-pointer: coarse)`),C={width:0,height:0},T=!1,E=()=>{let e=getComputedStyle(n),t=t=>Number.parseFloat(e.getPropertyValue(`--safe-${t}`))||0,r=Number.parseFloat(getComputedStyle(g).height)||0;return Kt({width:innerWidth,height:innerHeight},C,S.matches,{top:t(`top`),right:t(`right`),bottom:t(`bottom`),left:t(`left`)},r)},D=()=>e.windows?.shown()===!0&&b(_)!==void 0&&E().fit===`fold`,O=()=>{let e=!d()&&D();e===T||n.hasAttribute(`dragging`)||(T=e,f(d()||T))},k=t=>{_=t;let r=n.hasAttribute(`collapsed`),i=b(t);v=i?r?y??i:{edge:i.at===0?`left`:`right`,at:100}:t,n.setAttribute(`edge`,v.edge),a.setAttribute(`aria-orientation`,v.edge===`left`||v.edge===`right`?`vertical`:`horizontal`),n.style.setProperty(`--at`,String(v.at));let s=$t(n),c=r?x()?s.width:s.height:x()?a.offsetWidth:a.offsetHeight;i&&!r&&(C={width:a.offsetWidth,height:a.offsetHeight});let l=i&&!r&&E().fit===`beside`?{beside:C.width+8}:{thickness:a.offsetHeight};e.onPlace?.(i?{...i,collapsed:!1,...l}:{...v,collapsed:r,thickness:c}),o.style.setProperty(`--vitehub-mark-x`,`${a.clientWidth/2-o.offsetLeft-o.offsetWidth/2}px`),o.style.setProperty(`--vitehub-mark-y`,`${a.clientHeight/2-o.offsetTop-o.offsetHeight/2}px`)},A=Qt({host:n,handle:o,dock:()=>_,shape:e=>{let t=n.hasAttribute(`collapsed`),r=t?e?n.offsetHeight:n.offsetWidth:e?a.offsetHeight:a.offsetWidth;return{size:r,lead:t?r/2:e?o.offsetTop+o.offsetHeight/2:o.offsetLeft+o.offsetWidth/2,part:t?e?$t(n).height:$t(n).width:r,margin:t?2:16}},place:k,drop:()=>{te.move(()=>k(_)).then(O);try{localStorage.setItem(e.storage.dock,JSON.stringify({edge:_.edge,at:_.at}))}catch{}},signal:t}),ee=yt(a,{items:()=>[o,...[...n.children].filter(e=>e instanceof HTMLElement&&e.slot!==`tab`),...m?[m]:[]],movesOnly:!0}),j={width:0,height:0},M={top:0,right:0,bottom:0,left:0},N=F(0,(e,t)=>{R(a,{"clip-path":t===0&&e===0?null:`inset(${[M.top,M.right,M.bottom,M.left].map(t=>`${(t*e).toFixed(2)}px`).join(` `)} round 12px)`})},w.snappy),te=Yt(n,a,o,()=>N.stop(),()=>ee.measure());qt.set(n,te);let P=[Ve(n,Dt),Ve(r,Dt)];if(t.aborted){for(let e of P)e();return n}let ne=new ResizeObserver(e=>{if(k(_),O(),!e.some(e=>e.target===a))return;let t=j;if(j={width:a.offsetWidth,height:a.offsetHeight},n.hasAttribute(`collapsed`)||n.hasAttribute(`dragging`)||te.moving)return;if(!t.width)return ee.measure();ee.play(),ee.measure();let r={x:j.width-t.width,y:j.height-t.height},i={x:x()?v.edge===`right`?r.x:0:r.x*v.at/100,y:x()?r.y*v.at/100:v.edge===`bottom`?r.y:0};M={top:Math.max(0,i.y),right:Math.max(0,r.x-i.x),bottom:Math.max(0,r.y-i.y),left:Math.max(0,i.x)},(M.top||M.right||M.bottom||M.left)&&(N.set(1),N.to(0,{preset:w.snappy}))});return t.addEventListener(`abort`,()=>{n.remove(),ne.disconnect(),N.stop(),ee.destroy();for(let e of P)e()},{once:!0}),(e.parent??document.documentElement).append(n),St(n,t),k(_),t.aborted||(ne.observe(a),ne.observe(g),addEventListener(`resize`,()=>{k(_),O()},{signal:t}),e.windows?.watch(O,t),e.markOnly?.watch(()=>{u=!1,T=!1,f(d())},t)),n}async function Zt(e){if(e.inert=!0,e.hasAttribute(`collapsed`)||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e.shadowRoot?.querySelector(`div`),n=qt.get(e);if(!t?.offsetWidth||!n){e.setAttribute(`collapsed`,``);return}Object.assign(t.style,{width:`${t.offsetWidth}px`,height:`${t.offsetHeight}px`});let r=n.move(()=>e.setAttribute(`collapsed`,``),40);await Promise.race([r,new Promise(e=>setTimeout(e,600*j()))])}function Qt(e){let{host:t,handle:n}=e,r,i=!1;return n.style.touchAction=`none`,n.addEventListener(`pointerdown`,a=>{if(a.button!==0||r!==void 0)return;r=a.pointerId,i=!1;let o=n.getBoundingClientRect(),s={x:a.clientX-o.left-o.width/2,y:a.clientY-o.top-o.height/2};n.setPointerCapture(a.pointerId);let c=n=>{if(n.pointerId!==a.pointerId||!i&&Math.hypot(n.clientX-a.clientX,n.clientY-a.clientY)<4)return;i=!0,t.setAttribute(`dragging`,``);let r=document.documentElement.clientWidth,o=document.documentElement.clientHeight,c=n.clientX-s.x,l=n.clientY-s.y,u=Wt(c,l,r,o);u!==t.getAttribute(`edge`)&&e.place({edge:u,at:e.dock().at});let d=u===`left`||u===`right`,{size:f,lead:p,part:m,margin:h}=e.shape(d),g=(d?l:c)-p+f/2,_=getComputedStyle(t),v=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-top`:`--safe-left`))||0),y=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-bottom`:`--safe-right`))||0);e.place({edge:u,at:Gt(g,m,v,y,d?o:r)})};n.addEventListener(`pointermove`,c);let l=o=>{o.pointerId===a.pointerId&&(n.removeEventListener(`pointermove`,c),n.removeEventListener(`lostpointercapture`,l),r=void 0,i&&(t.removeAttribute(`dragging`),e.drop(),setTimeout(()=>{i=!1})))};n.addEventListener(`lostpointercapture`,l)},{signal:e.signal}),()=>i}function $t(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--vitehub-hex-h`))||24;return{width:t*10/9,height:t}}function en(e){try{let t=localStorage.getItem(e);return t===`1`||t!==`0`&&void 0}catch{return}}h();var tn=`[role=menu]{position:fixed;inset:auto;box-sizing:border-box;width:max-content;min-width:220px;max-width:min(300px,calc(100vw - 16px));margin:0;padding:6px;overflow:visible;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:#171717;color:var(--vitehub-pill-text);font:500 13px/1.3 ui-sans-serif,system-ui,sans-serif;box-shadow:0 16px 40px rgb(0 0 0/30%);color-scheme:dark;pointer-events:auto}
71
+ [role=menuitem]{display:flex;width:100%;height:32px;justify-content:flex-start;gap:8px;font-size:13px}
72
+ [role=menuitem] svg{width:15px;height:15px;color:var(--vitehub-pill-muted)}
73
+ [role=menuitem][hidden]{display:none}
74
+ [role=menuitem][aria-disabled=true]{cursor:progress}
75
+ @media(any-pointer:coarse){[role=menuitem]{height:44px}}`,nn=`${p}
76
+ ${tn}
77
+ .who{align-self:flex-start;padding:0 3px}
78
+ .avatar{box-sizing:border-box;display:grid;place-items:center;width:22px;height:22px;flex:none;overflow:hidden;border-radius:50%;background:#404040;color:var(--vitehub-pill-strong);font-size:10px;font-weight:600;line-height:1}
79
+ .avatar img{display:block;width:100%;height:100%;object-fit:cover}
80
+ .me{display:flex;align-items:center;gap:10px;margin-bottom:4px;padding:8px 8px 10px;border-bottom:1px solid var(--vitehub-pill-line)}
81
+ .me .avatar{width:32px;height:32px;font-size:12px}
82
+ .me div{min-width:0}
83
+ .me b,.me small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
84
+ .me b{color:var(--vitehub-pill-strong);font-weight:500}
85
+ .me small{margin-top:2px;color:var(--vitehub-pill-muted);font-size:12px}
86
+ .via{display:flex;align-items:center;gap:6px;padding:6px 8px;color:var(--vitehub-pill-muted);font-size:12px}
87
+ .via svg{width:11px;height:10px;flex:none;fill:var(--vitehub-pill-text)}
88
+ `,rn=`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 7h10v10M7 17 17 7"/></svg>`,an=`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49M14.084 14.158a3 3 0 0 1-4.242-4.242M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143M2 2l20 20"/></svg>`,on=`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m16 17 5-5-5-5M21 12H9M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/></svg>`;function sn(e){return e.trim().split(/\s+/).slice(0,2).map(e=>[...e][0]??``).join(``).toLocaleUpperCase()}function cn(e){let t=document.createElement(`span`);if(t.className=`avatar`,t.setAttribute(`aria-hidden`,`true`),t.textContent=sn(e.name),e.image){let n=document.createElement(`img`);n.alt=``,n.referrerPolicy=`no-referrer`,n.src=e.image,n.addEventListener(`load`,()=>t.replaceChildren(n),{once:!0})}return t}function ln(e,t){let n=document.createElement(`button`);n.type=`button`,n.setAttribute(`role`,`menuitem`),n.tabIndex=-1,n.insertAdjacentHTML(`beforeend`,e);let r=document.createElement(`span`);return r.textContent=t,n.append(r),{item:n,label:r}}function un(){let e=new URL(location.href);for(let t of[l,...u])e.searchParams.delete(t);return e}function dn(e){let{account:t,bar:n,signal:r}=e,i=n.parentElement,a=n.attachShadow({mode:`open`});r.addEventListener(`abort`,Ve(a,Dt),{once:!0});let o=document.createElement(`style`);o.textContent=nn;let s=document.createElement(`div`);s.id=`account-menu`,s.setAttribute(`popover`,`auto`),s.setAttribute(`role`,`menu`),s.setAttribute(`aria-label`,t.name);let c=document.createElement(`button`);c.type=`button`,c.className=`who`,c.dataset.motionPress=``,c.title=t.email?`${t.name} (${t.email})`:t.name,c.setAttribute(`aria-label`,`Account: ${t.name}`),c.setAttribute(`aria-haspopup`,`menu`),c.setAttribute(`aria-expanded`,`false`),c.setAttribute(`aria-controls`,s.id),c.setAttribute(`popovertarget`,s.id),c.append(cn(t));let l=document.createElement(`div`);l.className=`me`,l.setAttribute(`role`,`none`);let u=document.createElement(`div`),d=document.createElement(`b`);if(d.textContent=t.name,u.append(d),t.email){let e=document.createElement(`small`);e.textContent=t.email,u.append(e)}if(l.append(cn(t),u),s.append(l),t.via===`console`){let t=document.createElement(`div`);t.className=`via`,t.setAttribute(`role`,`none`),t.append(zt(`0 0 20 18`,e.mark,{}),`Signed in with ViteHub Console`),s.append(t)}let f=ln(rn,`Open in the Console`),p=ln(on,`Sign out of ${location.host}`);s.append(f.item,p.item),a.append(o,c,s);let m;pn({menu:s,button:c,pill:i,beforeOpen:()=>{m=e.openConsole?.(),f.item.hidden=!m},signal:r}),f.item.addEventListener(`click`,()=>{s.hidePopover(),m?.()},{signal:r}),mn(t,p,r)}function fn(e){let{account:t,button:n,turnOff:r,canExit:i,signal:a}=e,o=document.createElement(`style`);o.textContent=tn;let s=document.createElement(`vitehub-menu`);s.id=`exit-menu`,s.setAttribute(`popover`,`auto`),s.setAttribute(`role`,`menu`),s.setAttribute(`aria-label`,`Turn off tools or sign out`);let c=ln(an,r.label),l=ln(on,`Sign out of ${location.host}`);s.append(c.item,l.item);let u=`Turn off tools or sign out`;n.setAttribute(`aria-label`,u),n.title=u,n.setAttribute(`aria-haspopup`,`menu`),n.setAttribute(`aria-expanded`,`false`),n.setAttribute(`aria-controls`,s.id),n.setAttribute(`popovertarget`,s.id);let d=n.getRootNode();return pn({menu:s,button:n,pill:d instanceof ShadowRoot&&d.host instanceof HTMLElement?d.host:null,signal:a}),c.item.addEventListener(`click`,e=>{s.hidePopover(),r.press(e.detail===0)},{signal:a}),mn(t,l,a,i),[o,s]}function pn(e){let{menu:t,button:n,pill:r,signal:i}=e,a=()=>{let e=t.getRootNode();return e instanceof ShadowRoot||e instanceof Document?e.activeElement:null},o=()=>[...t.querySelectorAll(`[role=menuitem]`)].filter(e=>!e.hidden),s=e=>{let i=document.documentElement.clientWidth,a=document.documentElement.clientHeight,o=(r??n).getBoundingClientRect(),s=n.getBoundingClientRect(),c={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};e===`bottom`||e===`top`?(c.right=`${Math.max(8,i-s.right)}px`,e===`bottom`?c.bottom=`${a-o.top+8}px`:c.top=`${o.bottom+8}px`):(s.top<a/2?c.top=`${Math.max(8,s.top)}px`:c.bottom=`${Math.max(8,a-s.bottom)}px`,e===`left`?c.left=`${o.right+8}px`:c.right=`${i-o.left+8}px`),Object.assign(t.style,c)},c=e=>{if(e!==`bottom`&&e!==`top`)return;let r=document.documentElement.clientWidth,i=n.getBoundingClientRect(),a=t.getBoundingClientRect().width;t.style.right=`auto`,t.style.left=`${Math.max(8,Math.min(i.right-a,r-a-8))}px`};if(t.addEventListener(`beforetoggle`,i=>{if(i.newState===`closed`){t.contains(a())&&n.focus({preventScroll:!0});return}e.beforeOpen?.();let o=r?.getAttribute(`edge`)??`bottom`;s(o),requestAnimationFrame(()=>c(o))},{signal:i}),t.addEventListener(`toggle`,e=>{let t=e.newState===`open`;n.setAttribute(`aria-expanded`,String(t)),t&&o()[0]?.focus({preventScroll:!0})},{signal:i}),t.addEventListener(`keydown`,e=>{let n=o(),r=n.findIndex(e=>e===a()),i=e.key===`ArrowDown`?r+1:e.key===`ArrowUp`?r-1:e.key===`Home`?0:e.key===`End`?n.length-1:void 0;i===void 0?e.key===`Escape`?e.stopPropagation():e.key===`Tab`&&t.hidePopover():(e.preventDefault(),n[(i+n.length)%n.length]?.focus())},{signal:i}),r){let e=new MutationObserver(e=>{e.some(e=>e.oldValue!==r.getAttribute(e.attributeName??``))&&t.hidePopover()});e.observe(r,{attributes:!0,attributeOldValue:!0,attributeFilter:[`collapsed`,`dragging`,`edge`]}),i.addEventListener(`abort`,()=>e.disconnect(),{once:!0})}i.addEventListener(`abort`,()=>t.hidePopover(),{once:!0})}function mn(e,t,n,r){t.item.addEventListener(`click`,async()=>{if(t.item.getAttribute(`aria-disabled`)===`true`||r?.()===!1)return;t.item.setAttribute(`aria-disabled`,`true`),t.label.textContent=`Signing out…`;let n=await fetch(e.signOut,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:`{}`}).catch(e=>e);if(!(n instanceof Response)||!n.ok){console.error(`[vitehub] The sign-out failed. The session stays.`,n instanceof Response?`The sign-out answered ${n.status}.`:n),t.item.removeAttribute(`aria-disabled`),t.label.textContent=`Could not sign out. Try again`;return}let i=un();i.href===location.href?location.reload():location.replace(i)},{signal:n})}function hn(e,...t){return typeof e==`function`?e(...t):e}function gn(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}function _n(e){let t=e.reporters??[],n=Symbol(),r=Object.defineProperty({},"is",{value:bn(n)}),{docsBase:i}=e;for(let a of Object.keys(e.codes)){let o=e.codes[a],s=o.docs===!1?void 0:o.docs||gn(i,a),c=(e={},r={})=>{let i=new yn({code:a,why:hn(o.why,e),fix:hn(o.fix,e),docs:s,cause:e.cause,sources:e.sources,data:hn(o.data,e)},c);i[n]=1;for(let e of t)e(i,r);return i};c.is=e=>r.is(e)&&e.code===a,r[a]=c}return r}var vn,yn,bn,xn=t((()=>{vn=Error.captureStackTrace,yn=class e extends Error{get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.code=this.name=t.code,this.docs=t.docs,this.fix=t.fix,this.sources=t.sources,this.data=t.data,vn?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,data:this.data,stack:this.stack}}},bn=e=>t=>t instanceof yn&&e in t}));xn();var Sn=_n({docsBase:`https://vitehub.dev/docs/development/diagnostics`,codes:{INTERNAL_INVARIANT_FAILED:{why:({what:e})=>`ViteHub reached a state that it does not expect: ${e}`,fix:`This is a ViteHub bug. Open an issue at https://github.com/vite-hub/vitehub/issues with this error message and its stack trace.`}}});function Cn(e){return Sn.INTERNAL_INVARIANT_FAILED({what:e})}function wn(e,t){if(!e)throw Cn(t)}h();function Tn(e,t,n){let r=e.cloneNode(!0);for(let e of[r,...r.querySelectorAll(`*`)])for(let t of[`id`,`role`,`tabindex`,`hidden`,`inert`,`popover`,`data-ending-style`,`data-starting-style`,`aria-live`])e.removeAttribute(t);return r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`data-motion`,`none`),r instanceof HTMLElement&&(r.inert=!0),r.style.pointerEvents=`none`,t.insertBefore(r,n?.parentNode===t?n:null),r}function En(e,t){Object.assign(e.style,{position:`fixed`,inset:`auto`,left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,margin:`0`,boxSizing:`border-box`,transform:`none`,translate:`none`,zIndex:`2147483647`});let n=e.getBoundingClientRect();Math.abs(n.left-t.left)>.5&&(e.style.left=`${2*t.left-n.left}px`),Math.abs(n.top-t.top)>.5&&(e.style.top=`${2*t.top-n.top}px`)}function Dn(e,t){return window.setTimeout(t,e*j())}var On={stiffness:480,damping:36},kn={stiffness:380,damping:26},An={stiffness:440,damping:32},jn=30,Mn=120,Nn=70,Pn=40,Fn=90,In=520,Ln=.24,Rn=.15,zn=.14,Bn=.15,Vn=new WeakMap,Hn=new Set,Un=new Set,Wn;function Gn(e){let t=getComputedStyle(e);return t.clipPath===`inset(50%)`||t.clip===`rect(0px, 0px, 0px, 0px)`}function Kn(e){return e.matches(`[role=tooltip]`)?e:e.querySelector(`:scope > [role=tooltip]`)}var qn=`[data-motion-appear]`;function Jn(e){if(e.matches(qn))return e;if(e.matches(`[role=tooltip]`))return Gn(e)?e.parentElement:e;let t=e.querySelector(`:scope > [role=tooltip]`);return t&&Gn(t)?e:null}function Yn(e){let t=e.getAttribute(`data-state`);return t===null?!e.hidden&&!e.hasAttribute(`data-closed`):t!==`closed`}function Xn(e){let t=e.getAttribute(`data-motion-appear`);if(t!==null){let n=e.parentElement;return!t||!n?null:n.closest(t)??[...n.children].find(n=>n!==e&&n.matches(t))??null}let n=Kn(e)?.id;return n?e.getRootNode().querySelector(`[aria-describedby~="${CSS.escape(n)}"]`)??document.querySelector(`[aria-describedby~="${CSS.escape(n)}"]`):null}function Zn(e){let t=[`translate`,`scale`,`clip-path`,`opacity`].map(t=>[t,e.style.getPropertyValue(t)]);R(e,{translate:null,scale:null,"clip-path":null});let n=e.getBoundingClientRect();for(let[n,r]of t)r&&e.style.setProperty(n,r);return n}function Qn(e,t,n){let r=e.getAttribute(`data-side`);if(r===`top`||r===`bottom`||r===`left`||r===`right`)return r;if(!n)return`top`;let[i,a]=[[`top`,n.top-t.bottom],[`bottom`,t.top-n.bottom],[`left`,n.left-t.right],[`right`,t.left-n.right]].reduce((e,t)=>t[1]>e[1]?t:e);if(a>=0)return i;let o=n.left+n.width/2-(t.left+t.width/2),s=n.top+n.height/2-(t.top+t.height/2);return Math.abs(s)>=Math.abs(o)?s>0?`top`:`bottom`:o>0?`left`:`right`}function $n(e,t,n){return e===`top`?n?.top??t.bottom+8:e===`bottom`?n?.bottom??t.top-8:e===`left`?n?.left??t.right+8:n?.right??t.left-8}var er=e=>e===`top`||e===`bottom`;function tr(e){let{rest:t,side:n,edge:r}=e;return n===`top`?r+t.height/2:n===`bottom`?r-t.height/2:n===`left`?r+t.width/2:r-t.width/2}function nr(e){return[...e.element.children].filter(t=>t instanceof HTMLElement&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!Gn(t))}function rr(e){return[...e.element.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE||t instanceof Element&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!Gn(t)).map(e=>e.textContent??``).join(``)}function ir(e){return[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())}var ar=e=>`${Math.round(e*100)/100}px`;function or(e){let{element:t,rest:n,side:r,edge:i,origin:a}=e,o=Math.max(1,e.width.value),s=e.mode===`clip`&&o<n.width,c=s?1:o/n.width,l=e.x.value-o/2,u=s?e.x.value-(n.left+n.width/2):l-n.left-a*(1-c),d=e.y.value-(n.top+n.height/2),f=[-40,-40,-40,-40];r===`top`&&(f[2]=e.y.value+n.height/2-i),r===`bottom`&&(f[0]=i-(e.y.value-n.height/2)),r===`left`&&(f[1]=(e.x.value+o/2-i)/c),r===`right`&&(f[3]=(i-(e.x.value-o/2))/c);let p=f.some(e=>e>0),m=null;if(s){let t=(n.width-o)/2;m=`inset(${[Math.max(0,f[0]),t+Math.max(0,f[1]),Math.max(0,f[2]),t+Math.max(0,f[3])].map(ar).join(` `)} round ${e.radius})`}else p&&(m=`inset(${f.map(ar).join(` `)})`);R(t,{translate:Math.abs(u)>.01||Math.abs(d)>.01||e.old?`${ar(u)} ${ar(d)}`:null,scale:Math.abs(c-1)>.001?`${c} 1`:null,"clip-path":m,opacity:e.fade.active||e.fade.value<1?String(e.fade.value):null});let h=Math.abs(c-1)>.001?`${1/c} 1`:null,g=e.label.value;for(let t of nr(e))R(t,{scale:h,opacity:g<1?String(g):null,filter:g<1?`blur(${ar((1-g)*6)})`:null});if(e.old){let t=e.old.spring.value;R(e.old.element,{scale:h,opacity:String(t),filter:`blur(${ar((1-t)*5)})`})}}function sr(e){return e.holding||e.timers.size>0||[e.x,e.y,e.width,e.label,e.fade,e.old?.spring].some(e=>e?.active)}function cr(e){if(!sr(e)){e.old?.element.remove(),e.old=void 0,R(e.element,{translate:null,scale:null,"clip-path":null,opacity:null});for(let t of nr(e))R(t,{scale:null,opacity:null,filter:null});e.done?.()}}function lr(e,t,n){let r=getComputedStyle(e),i=Qn(e,t,n),a={element:e,rest:t,origin:Number.parseFloat(r.transformOrigin)||t.width/2,side:i,edge:$n(i,t,n),trigger:n,mode:ir(e)||e.matches(qn)?`clip`:`scale`,handoff:!e.matches(qn),radius:r.borderRadius||`0px`,timers:new Set,holding:!0},o=()=>{or(a),cr(a)};return a.x=F(t.left+t.width/2,o,On),a.y=F(t.top+t.height/2,o,On),a.width=F(t.width,o,An),a.label=F(1,o),a.fade=F(1,o),a}function ur(e,t,n){let r=Dn(t,()=>{e.timers.delete(r),n(),cr(e)});e.timers.add(r)}function dr(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[e.x,e.y,e.width,e.label,e.fade,e.old?.spring])t?.stop()}function fr(e){dr(e),Un.delete(e),Wn===e&&(Wn=void 0),e.element.closest(`[data-motion=none]`)?.remove()}function pr(e){if(e){for(let e of Un)fr(e);for(let e of Hn){let t=Vn.get(e)?.box;t&&(dr(t),t.holding=!0,t.x.set(t.rest.left+t.rest.width/2),t.y.set(t.rest.top+t.rest.height/2),t.width.set(t.rest.width),t.label.set(1),t.fade.set(1),t.holding=!1,cr(t))}}}function mr(e,t){let n=e.trigger,r=t.trigger;return!n||!r||e.side!==t.side?!1:er(t.side)?n.top<r.bottom&&r.top<n.bottom:n.left<r.right&&r.left<n.right}function hr(e){return er(e.side)?e.y:e.x}function gr(e,t,n){if(!t.length)return;let r=document.createElement(`span`);r.setAttribute(`aria-hidden`,`true`),Object.assign(r.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`inherit`,pointerEvents:`none`,whiteSpace:`nowrap`}),r.append(...t),e.element.append(r);let i=F(n,()=>{or(e),cr(e)});e.old={element:r,spring:i},i.to(0,{tween:Rn})}function _r(e){return e.mode===`clip`?[...e.element.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.cloneNode()):nr(e).map(e=>{let t=e.cloneNode(!0);return t.style.removeProperty(`scale`),t.style.removeProperty(`opacity`),t.style.removeProperty(`filter`),t})}function vr(e,t){let n=t.trigger?.getBoundingClientRect(),r=Zn(e),i=lr(e,r,n);t.box=i,t.text=rr(i),t.label=_r(i),R(e,{opacity:null});let a=i.handoff&&Wn&&mr(Wn,i)?Wn:void 0;if(a&&(Wn=void 0),S())a&&yr(a,!0),i.fade.set(0),i.holding=!1,i.fade.to(1,{tween:Bn});else if(a){let e=_r(a),t={x:[a.x.value,a.x.velocity],y:[a.y.value,a.y.velocity],width:[a.width.value,a.width.velocity]},n=a.old?0:a.label.value;fr(a),i.x.set(t.x[0]),i.y.set(t.y[0]),i.width.set(t.width[0]),i.label.set(0),gr(i,e,n),i.x.to(r.left+r.width/2,{preset:On,velocity:t.x[1]}),i.y.to(r.top+r.height/2,{preset:On,velocity:t.y[1]}),i.width.to(r.width,{preset:An,velocity:t.width[1]}),ur(i,Pn,()=>i.label.to(1,{tween:Ln})),i.holding=!1,or(i)}else hr(i).set(tr(i)),i.width.set(Math.min(jn,r.width)),i.label.set(0),or(i),hr(i).to(er(i.side)?r.top+r.height/2:r.left+r.width/2,{preset:kn}),ur(i,Mn,()=>{i.width.to(r.width,{preset:An}),ur(i,Nn,()=>i.label.to(1,{tween:Ln}))}),i.holding=!1}function yr(e,t){Un.add(e),e.holding=!1,t?(e.done=()=>fr(e),e.fade.to(0,{tween:Bn})):(e.handoff&&(Wn=e),e.old&&e.old.spring.to(0,{tween:zn}),e.label.to(0,{tween:zn}),e.width.to(Math.min(jn,e.rest.width),{preset:An}),ur(e,Fn,()=>{Wn===e&&(Wn=void 0),hr(e).to(tr(e),{preset:kn})}),ur(e,In,()=>fr(e)))}function br(e,t){if(!t.open)return;t.open=!1,Hn.delete(e),t.stopWatch?.(),t.stopWatch=void 0,Hn.size||jr();let n=t.box;if(t.box=void 0,R(e,{opacity:null}),!n)return;let r=t.root.parentNode??t.parent,i=r?.isConnected?Tn(t.root,r,t.root.isConnected?t.root.nextSibling:t.next):void 0,a={x:n.x,y:n.y,width:n.width,label:n.label,fade:n.fade},o=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,[t.value,t.velocity]])),s=n.old?.spring.value;dr(n),n.old?.element.remove(),R(e,{translate:null,scale:null,"clip-path":null,opacity:null});for(let e of nr(n))R(e,{scale:null,opacity:null,filter:null});if(!i)return;let c=xr(t.root,e).reduce((e,t)=>e?.children[t],i);if(!(c instanceof HTMLElement)){i.remove();return}e.hasAttribute(`popover`)&&(R(c,{scale:null}),En(c,n.rest));let l=lr(c,n.rest,void 0);Object.assign(l,{side:n.side,edge:n.edge,trigger:n.trigger,mode:n.mode,origin:n.origin,radius:n.radius,handoff:n.handoff});let u=c.querySelector(`:scope > [aria-hidden=true][style*=absolute]`);s!==void 0&&u&&(l.old={element:u,spring:F(s,()=>or(l))});for(let e of[`x`,`y`,`width`,`label`,`fade`])l[e].set(o[e][0]);or(l);for(let e of[`x`,`y`,`width`])o[e][1]&&l[e].to(o[e][0],{velocity:o[e][1]});yr(l,S())}function xr(e,t){let n=[];for(let r=t;r!==e&&r.parentElement;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function Sr(e,t,n,r=20){requestAnimationFrame(()=>{if(!t.open||!e.isConnected)return;let i=e.closest(`[data-reka-popper-content-wrapper]`);if(r>0&&i?.style.transform.includes(`-200%`))return Sr(e,t,n,r-1);n()})}function Cr(e,t){let n=()=>{r.disconnect();let t=e;for(;t;){let e=t.parentNode;e&&r.observe(e,{childList:!0}),t=e??(t instanceof ShadowRoot?t.host:null)}},r=new MutationObserver(()=>{e.isConnected?(t.parent=t.root.parentNode,t.next=t.root.nextSibling,n()):br(e,t)});return n(),()=>r.disconnect()}function wr(e){let t=Vn.get(e);if(t?.open)return;let n=Xn(e);if(n&&ie(n))return;let r=e.closest(`[data-reka-popper-content-wrapper]`)??e;t={open:!0,root:r,parent:r.parentNode,next:r.nextSibling,text:``,label:[],trigger:n},Vn.set(e,t),Hn.add(e),Ar(),R(e,{opacity:`0`}),t.stopWatch=Cr(e,t);let i=t;Sr(e,t,()=>vr(e,i))}var Tr=0;function Er(){Tr=0;for(let e of Hn){let t=Vn.get(e),n=t?.box;if(!t||!n)continue;let r=Zn(e),i=rr(n),a=Math.abs(r.left-n.rest.left)>1||Math.abs(r.top-n.rest.top)>1||Math.abs(r.width-n.rest.width)>1,o=(a||Math.abs(r.height-n.rest.height)>1)&&!n.handoff&&!sr(n)&&Math.abs(r.left+r.width/2-(n.rest.left+n.rest.width/2))<=1&&Math.abs(r.top-n.rest.top)<=1;if(!a&&!o&&i===t.text)continue;let s=i===t.text?[]:t.label;t.trigger=Xn(e)??t.trigger;let c=t.trigger?.getBoundingClientRect();t.text=i,t.label=_r(n),n.rest=r,n.side=Qn(e,r,c),n.edge=$n(n.side,r,c),S()||o?(n.x.set(r.left+r.width/2),n.y.set(r.top+r.height/2),n.width.set(r.width)):(n.x.to(r.left+r.width/2,{preset:On}),n.y.to(r.top+r.height/2,{preset:On}),n.width.to(r.width,{preset:An}),s.length&&(n.old?.spring.stop(),n.old?.element.remove(),gr(n,s,n.label.value),n.label.set(0),ur(n,Pn,()=>n.label.to(1,{tween:Ln}))))}}function Dr(){Tr||=requestAnimationFrame(Er)}var Or=!1,kr;function Ar(){kr??=C(pr),Or||(Or=!0,document.addEventListener(`pointerover`,Dr,{capture:!0,passive:!0}),document.addEventListener(`focusin`,Dr,{capture:!0,passive:!0}))}function jr(){Or=!1,cancelAnimationFrame(Tr),Tr=0,document.removeEventListener(`pointerover`,Dr,{capture:!0}),document.removeEventListener(`focusin`,Dr,{capture:!0})}var Mr={enter(e){Jn(e)===e&&Yn(e)&&wr(e)},state(e){if(Jn(e)!==e)return;let t=Vn.get(e);Yn(e)?wr(e):t&&br(e,t)}};({...Mr});var Nr={name:`appear`,selector:qn,...Mr},Pr=`
89
+ :host{all:initial;--surface:light-dark(#fff,#0a0a0a);--text:light-dark(#18181b,#fafafa);--muted:light-dark(#71717a,#a1a1aa);--line:light-dark(rgb(0 0 0/8%),rgb(255 255 255/9%));--hover:light-dark(rgb(0 0 0/5%),rgb(255 255 255/7%));--focus:light-dark(#18181b,#fafafa);--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--at:50;--margin:16px;--start:calc(max(var(--margin),var(--safe-left)) + var(--beside-start,0px));--end:calc(max(var(--margin),var(--safe-right)) + var(--beside-end,0px));--far:calc(max(12px,var(--safe-top)) + 40px);--along:calc(var(--start) + (100% - var(--start) - var(--end)) * var(--at) / 100);--shift:calc(var(--at) * -1%);--dock:calc(max(max(var(--margin),var(--safe-bottom)) + var(--thickness,38px),var(--vitehub-page-bar,0px)) + 8px);--width:calc(100vw - var(--start) - var(--end));--height:calc(100dvh - var(--dock) - var(--far));position:fixed;inset:0;z-index:2147483000;pointer-events:none;color:var(--text);font:400 .875rem/1.5 system-ui,sans-serif;color-scheme:light dark}
90
+ :host([collapsed]){--margin:2px}
91
+ :host([edge=top]){--dock:calc(max(var(--margin),var(--safe-top)) + var(--thickness,38px) + 8px);--far:max(16px,var(--safe-bottom))}
92
+ :host(:is([edge=left],[edge=right])){--start:calc(max(12px,var(--safe-top)) + 40px);--end:max(var(--margin),var(--safe-bottom));--width:calc(100vw - var(--dock) - var(--far));--height:calc(100dvh - var(--start) - var(--end))}
93
+ :host([edge=right]){--dock:calc(max(var(--margin),var(--safe-right)) + var(--thickness,38px) + 8px);--far:max(16px,var(--safe-left))}
94
+ :host([edge=left]){--dock:calc(max(var(--margin),var(--safe-left)) + var(--thickness,38px) + 8px);--far:max(16px,var(--safe-right))}
95
+ :host([hidden]){display:none}
96
+ .window{position:absolute;width:min(600px,var(--width));height:min(640px,var(--height));min-width:min(300px,var(--width));min-height:min(240px,var(--height));max-width:var(--width);max-height:var(--height);display:flex;flex-direction:column;pointer-events:auto;background:var(--surface);border-radius:12px;box-shadow:0 0 0 1px light-dark(rgb(0 0 0/8%),rgb(255 255 255/10%)),0 2px 4px light-dark(rgb(0 0 0/4%),rgb(0 0 0/24%)),0 16px 40px -8px light-dark(rgb(0 0 0/18%),rgb(0 0 0/56%));outline:none}
97
+ :host([edge=bottom]) .window{bottom:var(--dock);left:var(--along);translate:var(--shift) 0}
98
+ :host([edge=top]) .window{top:var(--dock);left:var(--along);translate:var(--shift) 0}
99
+ :host([edge=right]) .window{right:var(--dock);top:var(--along);translate:0 var(--shift)}
100
+ :host([edge=left]) .window{left:var(--dock);top:var(--along);translate:0 var(--shift)}
101
+ :host([edge]) .window.expanded{inset:max(12px,var(--safe-top)) calc(max(12px,var(--safe-right)) + var(--beside-end,0px)) max(12px,var(--safe-bottom)) calc(max(12px,var(--safe-left)) + var(--beside-start,0px));translate:none;width:auto!important;height:auto!important;max-width:none;max-height:none}
102
+ :host([edge=bottom]) .window.expanded{bottom:var(--dock)}:host([edge=top]) .window.expanded{top:var(--dock)}:host([edge=right]) .window.expanded{right:var(--dock)}:host([edge=left]) .window.expanded{left:var(--dock)}
103
+ .frame{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-radius:inherit}
104
+ .grip{position:absolute;z-index:1;touch-action:none}
105
+ .grip.top,.grip.bottom{left:12px;right:12px;height:8px;cursor:ns-resize}
106
+ .grip.top{top:-4px}.grip.bottom{bottom:-4px}
107
+ .grip.left,.grip.right{top:12px;bottom:12px;width:8px;cursor:ew-resize}
108
+ .grip.left{left:-4px}.grip.right{right:-4px}
109
+ :host([edge=bottom]) .grip.bottom,:host([edge=top]) .grip.top,:host([edge=right]) .grip.right,:host([edge=left]) .grip.left,.expanded .grip{display:none}
110
+ header{display:flex;align-items:center;gap:2px;min-height:44px;padding:0 6px 0 8px;border-bottom:1px solid var(--line);flex:none}
111
+ h2{font:600 .875rem/1.5 system-ui,sans-serif;margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px}
112
+ header :is(button,a){display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:var(--muted);cursor:pointer;font:inherit;touch-action:manipulation;transition:background-color 150ms ease-out,color 150ms ease-out}
113
+ header a[hidden]{display:none}
114
+ @media(hover:hover){header :is(button,a):hover{background:var(--hover);color:var(--text)}}
115
+ header :is(button,a):focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
116
+ @media(any-pointer:coarse){:host{--thickness:54px}.grip{display:none}header :is(button,a){width:44px;height:44px}}
117
+ .body{flex:1;min-height:0;overflow:auto;position:relative}iframe{display:block;border:0;width:100%;height:100%;background:var(--surface)}
118
+ @media(max-width:640px){:host(:is([edge=left],[edge=right])){--start:max(var(--margin),var(--safe-top))}:host([edge]) .window,:host([edge]) .window.expanded{inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);translate:none;width:auto!important;height:auto!important;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:0}:host([edge=bottom]) :is(.window,.window.expanded){bottom:var(--dock)}:host([edge=top]) :is(.window,.window.expanded){top:var(--dock)}:host([edge=right]) :is(.window,.window.expanded){right:var(--dock)}:host([edge=left]) :is(.window,.window.expanded){left:var(--dock)}:host(:is([edge=top],[edge=bottom])) :is(.window,.window.expanded){left:var(--start);right:var(--end)}:host(:is([edge=left],[edge=right])) :is(.window,.window.expanded){top:var(--start);bottom:var(--end)}.grip{display:none}header :is(button,a){width:44px;height:44px}.expand{display:none}}
119
+ @media(forced-colors:active){.window{border:1px solid CanvasText}header :is(button,a):focus-visible{outline-color:Highlight}}
120
+ `,Fr={edge:`bottom`,at:50},Ir=new Map,Lr=new Set,Rr=!1,zr=0;function Br(){Rr||(Rr=!0,queueMicrotask(()=>{Rr=!1;for(let e of Lr)e()}))}function Vr(){return[...Ir.keys()].some(e=>!e.hidden)}function Hr(){for(let[e,t]of Ir)e.hidden||t()}function Ur(e,t){Lr.add(e),t.addEventListener(`abort`,()=>Lr.delete(e),{once:!0})}function Wr(e){e.setAttribute(`edge`,Fr.edge),e.toggleAttribute(`collapsed`,!!Fr.collapsed),e.style.setProperty(`--at`,String(Fr.at)),Fr.thickness?e.style.setProperty(`--thickness`,`${Fr.thickness}px`):e.style.removeProperty(`--thickness`);for(let[t,n]of[[`start`,0],[`end`,100]])Fr.beside&&Fr.at===n?e.style.setProperty(`--beside-${t}`,`${Fr.beside}px`):e.style.removeProperty(`--beside-${t}`);for(let t of[`top`,`right`,`bottom`,`left`])e.shadowRoot.querySelector(`.grip.${t}`).hidden=Gr(t)===0}function Gr(e){return(e===`top`||e===`bottom`)==(Fr.edge===`top`||Fr.edge===`bottom`)?1:e===`top`||e===`left`?Fr.at/100:1-Fr.at/100}function Kr(e){Fr=e;for(let e of Ir.keys())Wr(e)}function qr(e){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[e,n]of Object.entries({width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.75`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`}))t.setAttribute(e,n);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return n.setAttribute(`d`,e),t.append(n),t}function Jr(e){let t=document.createElement(`vitehub-window`);t.hidden=!0;let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=Pr;let i=document.createElement(`section`);i.className=`window`,i.setAttribute(`role`,`dialog`),i.setAttribute(`aria-labelledby`,`title`),i.tabIndex=-1;let a=document.createElement(`header`),o=document.createElement(`h2`);o.id=`title`,o.textContent=e.title;let s=document.createElement(`div`);s.className=`body`;let c=(e,t,n)=>{let r=document.createElement(`button`);return r.className=e,r.type=`button`,r.setAttribute(`aria-label`,t),r.title=t,r.append(qr(n)),r},l=c(`expand`,`Expand window`,`M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5`),u=c(`hide`,`Minimize window`,`M5 12h14`),d=document.createElement(`a`);d.className=`tab`,d.target=`_blank`,d.rel=`noopener`,d.setAttribute(`aria-label`,`Open in new tab`),d.title=`Open in new tab`,d.append(qr(`M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`));let f=()=>{let t=e.href?.();d.hidden=!t,t?d.href=t:d.removeAttribute(`href`)};for(let e of[`pointerenter`,`pointerdown`,`focus`,`click`,`contextmenu`])d.addEventListener(e,f);f(),a.append(o,...e.href?[d]:[],...e.expand===!1?[]:[l],u);let p=document.createElement(`div`);p.className=`frame`,p.append(a,s);let m=[`top`,`right`,`bottom`,`left`].map(e=>{let t=document.createElement(`div`);return t.className=`grip ${e}`,t.addEventListener(`pointerdown`,n=>{if(n.button!==0)return;let r=Gr(e);if(r===0)return;n.preventDefault(),t.setPointerCapture(n.pointerId);let a=e===`top`||e===`bottom`,o=a?i.offsetHeight:i.offsetWidth,s=t=>{let s=a?t.clientY-n.clientY:t.clientX-n.clientX,c=o+(e===`top`||e===`left`?-s:s)/r;a?i.style.height=`${Math.max(240,c)}px`:i.style.width=`${Math.max(300,c)}px`};t.addEventListener(`pointermove`,s),t.addEventListener(`lostpointercapture`,()=>t.removeEventListener(`pointermove`,s),{once:!0})}),t});i.append(p,...m),n.append(r,i);let h=`vitehub-window:${e.id}`;try{let e=JSON.parse(localStorage.getItem(h)??`null`);e&&typeof e==`object`&&`width`in e&&`height`in e&&typeof e.width==`number`&&typeof e.height==`number`&&(Number.isFinite(e.width)&&(i.style.width=`${Math.max(300,e.width)}px`),Number.isFinite(e.height)&&(i.style.height=`${Math.max(240,e.height)}px`))}catch{}let g=new ResizeObserver(()=>{if(t.hidden||i.classList.contains(`expanded`)||innerWidth<=640)return;let e=i.offsetWidth,n=i.offsetHeight;try{localStorage.setItem(h,JSON.stringify({width:e,height:n}))}catch{}});g.observe(i);let _=()=>{t.hidden=!0,e.trigger.setAttribute(`aria-expanded`,`false`),e.trigger.focus({preventScroll:!0}),e.onHide?.(),Br()};l.addEventListener(`click`,()=>{let e=i.classList.toggle(`expanded`);l.setAttribute(`aria-label`,e?`Restore window size`:`Expand window`),l.title=e?`Restore window size`:`Expand window`,l.setAttribute(`aria-pressed`,String(e))}),u.addEventListener(`click`,_);let v=()=>{t.style.colorScheme=e.colorScheme?.()??``};e.colorScheme&&addEventListener(`storage`,v,{signal:e.signal}),n.addEventListener(`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),_())}),t.style.viewTransitionName=`vitehub-window-${++zr}`,Wr(t);let y=Ve(n,Dt),b=()=>{Ir.delete(t)&&!t.hidden&&Br(),g.disconnect(),t.remove(),y()};return e.signal.aborted?b():(e.signal.addEventListener(`abort`,b,{once:!0}),Ir.set(t,_),document.documentElement.append(t)),{body:s,show(){e.signal.aborted||(v(),f(),t.hidden=!1,Br(),e.trigger.setAttribute(`aria-expanded`,`true`),i.focus({preventScroll:!0}))},hide:_,destroy:b,syncColorScheme:v}}function Yr(e){let t=typeof e==`object`&&e?Reflect.get(e,`default`):void 0;return t instanceof Function?t:void 0}var Xr=`:host([off]){--vitehub-hex-h:14px;filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
121
+ :host([off]) button{position:relative;display:block;width:var(--vitehub-hex-w);min-width:0;height:var(--vitehub-hex-h);padding:0;border-radius:4px;pointer-events:auto;cursor:grab;opacity:.55;transition:opacity 150ms ease-out}
122
+ :host([off][edge=bottom]) button{transform-origin:calc(var(--at) * 1%) 100%}
123
+ :host([off][edge=top]) button{transform-origin:calc(var(--at) * 1%) 0}
124
+ :host([off][edge=left]) button{transform-origin:0 calc(var(--at) * 1%)}
125
+ :host([off][edge=right]) button{transform-origin:100% calc(var(--at) * 1%)}
126
+ :host([off][closing]) button{opacity:1}
127
+ :host([off][dragging]) button{opacity:1;cursor:grabbing}
128
+ :host([off]) button::before{content:"";position:absolute;inset:-6px}
129
+ svg{display:block;width:100%;height:100%;overflow:visible;fill:rgb(17 17 17/92%);stroke:rgb(255 255 255/18%);stroke-width:1px;vector-effect:non-scaling-stroke;transition:fill 150ms ease-out}
130
+ :host([off]) button:focus-visible{opacity:1}
131
+ :host([off][dragging]) svg{scale:none}
132
+ @media(hover:hover){:host([off]) button:hover{opacity:1;background:none}button:hover svg{fill:rgb(38 38 38/94%)}}
133
+ @media(any-pointer:coarse){:host([off]){--vitehub-hex-h:20px}:host([off]) button{min-width:0;height:var(--vitehub-hex-h)}:host([off]) button::before{inset:-10px}}
134
+ @media(prefers-reduced-motion:reduce){:host([off]) button,svg{transition:none}}`,Zr=`vitehub-tools-off`,Qr=`vitehub-tools-collapsed`,$r=`vitehub-tools-dock`,ei=`vitehub-account`,ti=`M19.734 8.156 15.576.844A1.66 1.66 0 0 0 14.135 0H5.819C5.226 0 4.677.32 4.38.844L.222 8.156a1.71 1.71 0 0 0 0 1.688l4.158 7.312c.297.523.846.844 1.439.844h8.316c.593 0 1.142-.32 1.438-.844l4.158-7.312c.3-.523.3-1.165.003-1.688Z`;function ni(e){try{return localStorage.getItem(e)===`1`}catch{return!1}}function ri(e,t){try{t?localStorage.setItem(e,`1`):localStorage.removeItem(e)}catch{}}function ii(){return document.documentElement.getAttribute(`data-vitehub-pill`)===`mark`||ai}var ai=!1,oi=!1;function si(){try{return localStorage.getItem($r)}catch{return null}}function ci(){if(oi||typeof document.elementsFromPoint!=`function`)return!1;let e=e=>{let t=e.getBoundingClientRect();return t.width*t.height<innerWidth*innerHeight/2},t=Array.from({length:36},(e,t)=>[Math.min(innerWidth-1,Math.max(0,innerWidth/2-140+t%18*16+8)),innerHeight-(t<18?24:44)]),n=new Set;for(let[r,i]of t)for(let t of document.elementsFromPoint(r,i))if(!n.has(t)){n.add(t);for(let n=t;n&&n!==document.body&&n!==document.documentElement&&!n.localName.startsWith(`vitehub-`);n=n.parentElement){let r=getComputedStyle(n);if(r.position===`fixed`||r.position===`sticky`&&r.bottom!==`auto`){if(e(n)||n!==t&&e(t))return!0;break}if(/auto|scroll/.test(r.overflowY)&&n.scrollHeight>n.clientHeight)break}}return!1}function li(e){return e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:e}function ui(e,t){let n=ii(),r=si(),i=()=>{oi||=si()!==r;let t=ai;if(ai=ci(),t&&!ai&&oi&&document.querySelector(`vitehub-pill`)?.hasAttribute(`collapsed`))try{localStorage.setItem(Qr,`1`)}catch{}ii()!==n&&(n=!n,e())},a=new MutationObserver(i);a.observe(document.documentElement,{attributes:!0,attributeFilter:[m]});let o,s=()=>{o??=setTimeout(()=>{o=void 0,i()},200)},c=new MutationObserver(e=>{e.some(e=>!(e.target instanceof Element&&e.target.localName.startsWith(`vitehub-`)))&&s()});c.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`class`,`style`]}),addEventListener(`scroll`,s,{capture:!0,passive:!0,signal:t}),addEventListener(`resize`,s,{signal:t}),addEventListener(`storage`,e=>{(e.key===null||e.key===$r)&&(r=si()),s()},{signal:t}),document.addEventListener(`pointerup`,s,{signal:t}),t.addEventListener(`abort`,()=>{a.disconnect(),c.disconnect(),clearTimeout(o)},{once:!0})}var di={name:`vitehub-pill`,label:`ViteHub tools`,off:Zr,collapsed:Qr,dock:$r};function fi(e,t,n,r,i){if(t.aborted)return;let a=document.createElement(e.off);a.setAttribute(`off`,``),a.setAttribute(`collapsed`,``),i&&a.setAttribute(`closing`,``),a.style.viewTransitionName=e.name;let o=Ut(e.dock)??e.initialDock??{edge:`bottom`,at:50},s=()=>{let t=e===di&&ii()&&!a.hasAttribute(`dragging`)?li(o):o;a.setAttribute(`edge`,t.edge),a.style.setProperty(`--at`,String(t.at))};s();let c=new AbortController;t.addEventListener(`abort`,()=>{c.abort(),a.remove()},{once:!0,signal:c.signal}),e===di&&ui(s,c.signal);let l=a.attachShadow({mode:`open`}),u=Ve(l,Dt);c.signal.addEventListener(`abort`,u,{once:!0});let d=document.createElement(`style`);d.textContent=`${Rt}\n${Xr}`;let f=document.createElement(`button`);if(f.type=`button`,f.title=`Turn on ${e.label}`,f.dataset.motionPress=``,f.setAttribute(`aria-label`,f.title),f.append(zt(`0 0 20 18`,ti,{})),l.append(d,f),document.documentElement.append(a),St(a,c.signal),i){let e=i/$t(a).height,t=F(e,(e,t)=>{let n=t===0&&e===1;R(f,{scale:n?null:e.toFixed(4)}),n&&a.removeAttribute(`closing`)},w.snappy);t.set(e),t.to(1,{preset:w.snappy})}let p=Qt({host:a,handle:f,dock:()=>o,shape:e=>{let t=e?a.offsetHeight:a.offsetWidth,n=$t(a);return{size:t,lead:t/2,part:e?n.height:n.width,margin:2}},place:e=>{o=e,s()},drop:()=>{s();try{localStorage.setItem(e.dock,JSON.stringify(o))}catch{}},signal:c.signal});f.addEventListener(`click`,()=>{p()||(c.abort(),a.remove(),n())}),r&&f.focus({preventScroll:!0})}async function pi(e={}){return await gi(e,!1)}var mi=new AbortController;function hi(){mi.abort(),mi=new AbortController}async function gi(e,t){let n=new URL(location.href),a=n.searchParams,o=a.get(l),s=typeof e.session==`function`?e.session:void 0,u=typeof e.session==`string`?e.session:i(import.meta.url);if(!s&&!r(location.search,document.cookie))return[];let{signal:d}=mi;try{CSS.registerProperty({name:`--vitehub-page-bar`,syntax:`<length>`,inherits:!0,initialValue:`0px`})}catch{}let f=e.pill??di;f===di&&(oi=Ut($r)!==void 0,ai=ci());let m=e.load??(e=>import(e)),h;try{if(s)h=await s();else{let e=new URL(u,location.href);e.searchParams.set(`page`,location.pathname);let t=await fetch(e.origin===location.origin?`${e.pathname}${e.search}`:e.href,{credentials:`same-origin`,headers:{accept:`application/json`}});if(!t.ok)return[];h=c(await t.json())}}catch{return[]}if(d.aborted||h.tools.length===0||document.querySelector(`${f.name}, ${f.off}`))return[];let g=o||h.tools.find(e=>e.param&&a.has(e.param))?.id;if(a.has(`vitehub`)||g||e.open)ri(f.off,!1);else if(ni(f.off))return fi(f,d,()=>{ri(f.off,!1),gi(e,!0)},!1),[];let _=e.open||g,v=h.tools.some(e=>e.id===_),y=new AbortController,b=h.tools.map(()=>new AbortController);d.addEventListener(`abort`,()=>{for(let e of b)e.abort();y.abort()},{once:!0,signal:y.signal});let x=new Set,S=!1,C=()=>!S&&[...x].every(e=>e()),w=(t=!1)=>{if(!C())return;S=!0;let n=h.tools.filter(e=>A(e.id));for(let e of h.tools)k(e.id,!1);ri(f.off,!0);let r=new URL(location.href);(f===di||h.tools.some(e=>e.id===r.searchParams.get(`vitehub`)))&&r.searchParams.delete(l);for(let e of h.tools)e.param&&r.searchParams.delete(e.param);r.href!==location.href&&history.replaceState(history.state,``,r);let i=$t(E).height,a=Zt(E);for(let e of b)e.abort();a.then(()=>{y.abort(),fi(f,d,()=>{ri(f.off,!1);for(let e of n)k(e.id,!0);gi(e,!0)},t,i&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches?i:void 0)})},T=h.account,E=Xt({name:f.name,label:f.label,mark:zt(`0 0 20 18`,ti,{fill:`currentColor`}),slots:[...h.tools.map(e=>e.id),...h.account?[ei]:[]],storage:{collapsed:f.collapsed,dock:f.dock},...f.initialDock?{initial:{dock:f.initialDock}}:{},exit:{label:`Turn off ${f.label}`,press:w,...T&&!T.guest?{menu:e=>fn({account:T,button:e,turnOff:{label:`Turn off ${f.label}`,press:w},canExit:C,signal:y.signal})}:{}},onPlace:Kr,windows:{shown:Vr,hide:Hr,watch:Ur},...f===di?{markOnly:{active:ii,watch:ui,opened:t}}:{},signal:y.signal});if(y.signal.addEventListener(`abort`,Ve(E,{effects:[ct,Nr]}),{once:!0}),h.account){let e=document.createElement(`vitehub-account`);e.slot=ei,E.append(e),dn({account:h.account,bar:e,mark:ti,openConsole:()=>{let e=E.querySelector(`vitehub-tool[slot="console"]`);return e&&!e.hidden?()=>void j(`console`):void 0},signal:y.signal})}let D=new Map,O=t=>`vitehub-open:${e.pill?.name??u}:${t}`,k=(e,t)=>{try{sessionStorage.setItem(O(e),String(t))}catch{}},A=e=>{try{return sessionStorage.getItem(O(e))===`true`}catch{return!1}},ee=new Map,j=async(e,t)=>await ee.get(e)?.(t)??!1,M=(await Promise.all(h.tools.map(async(e,t)=>{let{signal:n}=b[t],r=document.createElement(`vitehub-tool`);r.slot=e.id,E.append(r);let i,a,o,s=()=>(o||(o=m(e.script),o.catch(()=>{o=void 0})),o),c=!1,l=()=>{let t=document.createElement(`vitehub-tool`);t.slot=e.id,r.replaceWith(t),r=t},u=()=>{let e=r.attachShadow({mode:`open`}),t=Ve(e,Dt);n.addEventListener(`abort`,t,{once:!0});let i=document.createElement(`style`);i.textContent=p,e.append(i,f)},d=(t,o=!0)=>n.aborted?Promise.resolve(!1):c?(i?.(t),Promise.resolve(!0)):a?a.then(e=>(e&&i?.(t),e)):(a=(async()=>{let d=new AbortController,p=()=>d.abort();n.addEventListener(`abort`,p,{once:!0});try{r.setAttribute(`aria-busy`,`true`);let a=Yr(await s());if(wn(a,`the script of a page tool default-exports a function (${e.script})`),n.aborted)return!1;f.remove(),r.shadowRoot?l():r.replaceChildren();let u=a({beforeExit:e=>{let t=()=>e();x.add(t),d.signal.addEventListener(`abort`,()=>x.delete(t),{once:!0})},tool:e,bar:r,signal:d.signal,open:o&&(e.lazy===!0||e.id===_||A(e.id)),linked:o&&e.id===g,exit:()=>w(),createWindow:t=>{let n=Jr({...t,signal:d.signal,onHide:()=>{k(e.id,!1),E.hasAttribute(`collapsed`)&&E.shadowRoot.querySelector(`button.mark`).focus({preventScroll:!0}),t.onHide?.()}}),r={...n,show(){if(!d.signal.aborted){for(let[t,n]of D)t!==e.id&&n.hide();k(e.id,!0),n.show()}},destroy(){D.get(e.id)===r&&(D.delete(e.id),k(e.id,!1)),n.destroy()}};return D.set(e.id,r),r},openTool:j,createTab:()=>{let e=document.createElement(`vitehub-tab`);return e.slot=`tab`,e.setAttribute(`data-motion-appear`,`vitehub-pill`),E.append(e),d.signal.addEventListener(`abort`,()=>e.remove(),{once:!0}),e},onOpen:e=>{i=e}});return c=!0,t&&i?.(t),!r.shadowRoot&&!r.hasChildNodes()&&(r.hidden=!0),u instanceof Function&&(n.aborted?u():d.signal.addEventListener(`abort`,()=>u(),{once:!0})),!n.aborted}catch(t){return d.abort(),n.removeEventListener(`abort`,p),D.delete(e.id)&&k(e.id,!1),i=void 0,c=!1,console.error(`[vitehub] The page tool "${e.id}" did not start.`,t),l(),f.textContent=`Retry ${e.label}`,f.title=`The tool could not load. Try again.`,r.hidden=!1,u(),!1}finally{r.removeAttribute(`aria-busy`),a=void 0}})(),a),f=document.createElement(`button`);f.type=`button`,f.textContent=e.label,f.dataset.motionPress=``,f.addEventListener(`click`,()=>void d());for(let e of[`pointerenter`,`pointerdown`,`focus`])f.addEventListener(e,()=>void s());return ee.set(e.id,d),e.lazy&&e.id!==_&&!A(e.id)?(u(),e):(await d(void 0,!v||e.id===_),n.aborted?void 0:e)}))).filter(e=>!!e);if(M.length===0)y.abort();else if(o!==null){let e=new URL(location.href);e.pathname===n.pathname&&e.searchParams.get(`vitehub`)===o&&(f===di||h.tools.some(e=>e.id===o))&&(e.searchParams.delete(l),history.replaceState(history.state,``,e))}return M}function _i(e){let{code:t,details:n,fix:r,retryAfter:i,status:a,why:o}=e,s=t.startsWith(`COMMENTS_`)?`https://vitehub.dev/docs/comments/diagnostics/${t.toLowerCase()}`:void 0;return Object.assign(new yn({code:t,why:o,...r?{fix:r}:{},...s?{docs:s}:{}}),{status:a,...n?{details:n}:{},...i===void 0?{}:{retryAfter:i}})}function vi(e,t,n){return Object.assign(xi.COMMENTS_R0013(t===void 0?{}:{cause:t}),{status:e,...n===void 0?{}:{retryAfter:n}})}function yi(e){console.warn(`[vitehub] ${e.code}: ${e.why}${e.fix?` ${e.fix}`:``}`)}var bi,xi,Si=t((()=>{xn(),bi={COMMENTS_HOSTED_CONFLICT:{why:`This page runs the app's own Comments, so the Hosted Comments script does not start its overlay.`,fix:"Remove the Hosted Comments script, or keep it and set `comments: { overlay: false }` to turn off the app's overlay. See https://vitehub.dev/docs/comments/configure#add-hosted-comments"},COMMENTS_OUTBOX_ACCOUNT_CHANGED:{why:`The current author is not the author of this queued comment.`,fix:`Sign in as the original author and retry the outbox.`},COMMENTS_OUTBOX_RESOLVE_BLOCKED:{why:`Queued delivery must resume before the thread can close.`,fix:`Go online, then retry or dismiss any blocked comments and resolve the thread again.`},COMMENTS_OUTBOX_SENDING:{why:`The server may already have this comment, so the draft cannot change.`,fix:`Wait for delivery to finish, then edit or delete the server copy.`},COMMENTS_OVERLAY_ELEMENT_TAKEN:{why:({name:e})=>`Another script defined the <${e}> element, so this Comments overlay cannot start.`,fix:`Load one Comments overlay script on the page. Remove the other script that defines the element.`},COMMENTS_R0001:{why:({target:e})=>`createAnchor() found nothing to anchor to for ${e}.`,fix:`Pass an element, a non-empty selection, or a point that is over an element of the page.`},COMMENTS_R0013:{why:`The comments request did not get an answer from the server.`,fix:`Check the connection and the app URL, then try again.`},COMMENTS_R0015:{why:`The comment list kept changing while its pages were loading.`,fix:`Refresh again. The previous cache is kept until two complete scans agree.`}},xi=_n({docsBase:`https://vitehub.dev/docs/comments/diagnostics`,codes:bi})}));function Ci(e){return wi.test(e)&&URL.canParse(e)?new URL(e).pathname:e}var wi,Ti=t((()=>{wi=/^https?:\/\//i}));function Ei(e){let t=new URL(e).pathname,n=t.lastIndexOf(`${Mi}/assets/`);return n===-1?Mi:`${t.slice(0,n)}${Mi}`}function Di(e){let t=Ci(e).split(/[?#]/,1)[0]??``;return t.startsWith(`/`)||(t=`/${t}`),t=t.replace(/\/{2,}/g,`/`),t.length>1&&(t=t.replace(/\/+$/,``)),t||`/`}function Oi(e){let t=2166136261,n=1523705862;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619)>>>0,n=Math.imul(n^i,2671213388)>>>0}return`pages/${t.toString(16).padStart(8,`0`)}${n.toString(16).padStart(8,`0`)}`}function ki(e){return`subjects/${encodeURIComponent(JSON.stringify([e.kind,e.id]))}`}var Ai,ji,Mi,Ni=t((()=>{Ti(),Ai=`comments`,ji=`comments-notices`,Mi=`/_vitehub/comments`}));function Pi(){try{let e=JSON.parse(localStorage.getItem(Ri)??`null`);if(e&&typeof e==`object`&&`id`in e&&`name`in e&&typeof e.id==`string`&&typeof e.name==`string`)return{id:e.id,name:e.name}}catch{}}function Fi(e){let t={id:Pi()?.id??crypto.randomUUID(),name:e};localStorage.setItem(Ri,JSON.stringify(t));for(let e of zi)e(t);return t}function Ii(e){return zi.add(e),()=>zi.delete(e)}function Li(e){return{id:`guest:${e.id}`,name:e.name,guest:!0}}var Ri,zi,Bi=t((()=>{Ri=`vitehub-comments-guest`,zi=new Set}));async function Vi(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function Hi(e){if(e instanceof File&&e.name)return e.name;let t=/^[a-z]+\/([a-z0-9]+)/i.exec(e.type)?.[1];return t?`file.${t}`:`file`}async function Ui(e,t,n,r){let i=[];for(let a of e){let e=await n({name:Hi(a),type:a.type||`application/octet-stream`,data:await Vi(a),...t?{subject:t}:{}});await r?.(e.key),i.push(e.key)}return i}async function Wi(e,{files:t,outbox:n},r,i){if(!t?.length)return e;try{return{...e,attachments:[...e.attachments??[],...await Ui(t,r,i,n?.uploaded)]}}catch(e){throw n&&qi.set(n,{cause:e}),e}}function Gi(e,t=Date.now()){let n=e.headers.get(`retry-after`)?.trim();if(!n)return;if(/^\d+$/.test(n))return Number(n)*1e3;let r=Date.parse(n);return Number.isNaN(r)?void 0:Math.max(0,r-t)}var Ki,qi,Ji=t((()=>{Ki=`x-vitehub-comments-outbox-account`,qi=new WeakMap}));function Yi(e){return Object(e)===e&&!Array.isArray(e)}var Xi=t((()=>{}));function Zi(e,t=``){return`${t.replace(/\/+$/,``)}${Mi}/attachments/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function Qi(e={}){let t=e.route??`${(e.base??``).replace(/\/+$/,``)}/_vitehub/comments`;return async(n,r={})=>{let i=e.fetch??globalThis.fetch,a=new Headers(typeof e.headers==`function`?await e.headers():e.headers);for(let[e,t]of new Headers(r.headers))a.set(e,t);r.body!==void 0&&!a.has(`content-type`)&&a.set(`content-type`,`application/json`);let o=typeof e.guest==`function`?e.guest():e.guest;o&&(a.set(`x-vitehub-comments-guest-id`,o.id),a.set(`x-vitehub-comments-guest-name`,encodeURIComponent(o.name)));let s;try{s=await i(`${t}${n}`,{...r,headers:a,credentials:e.credentials??`same-origin`,cache:`no-store`})}catch(e){throw vi(0,e)}let c=await s.json().catch(()=>void 0),l=Gi(s);if(Yi(c)&&Yi(c.error)){let{code:e,why:t,fix:n}=c.error;throw typeof e!=`string`||typeof t!=`string`?vi(s.status,void 0,l):_i({code:e,why:t,...typeof n==`string`?{fix:n}:{},...l===void 0?{}:{retryAfter:l},status:s.status})}if(Yi(c)&&`data`in c){let t={data:c.data,people:Array.isArray(c.people)?c.people:[],...Yi(c.thread)?{thread:c.thread}:{}};return e.onAnswer?.(t),t}throw vi(s.status,void 0,l)}}function $i(e){let t=new URLSearchParams;return e.page!==void 0&&t.set(`page`,e.page),e.subject?(t.set(`subjectKind`,e.subject.kind),t.set(`subjectId`,e.subject.id)):e.subjectKind&&t.set(`subjectKind`,e.subjectKind),e.status&&t.set(`status`,e.status),e.mine!==void 0&&t.set(`mine`,String(e.mine)),e.mentions!==void 0&&t.set(`mentions`,String(e.mentions)),e.revision&&t.set(`revision`,String(e.revision.lte)),e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.before&&(t.set(`beforeId`,e.before.id),t.set(`beforeUpdatedAt`,String(e.before.updatedAt))),t}function ea(e={}){let t=Qi(e),n=(e.base??``).replace(/\/+$/,``),r=async(e,n)=>(await t(`/attachments`,na(e,n))).data;return{async list(e){return(await t(`/threads?${$i(e)}`)).data},async get(e){let n=`threadId`in e?ta(e.threadId):`/scopes/${encodeURIComponent(e.scope)}/threads/${e.n}`;return(await t(n)).data},async create({files:e,outbox:n,...i}){let a=await Wi(i,{files:e,outbox:n},i.subject,e=>r(e,n?.account));return(await t(`/threads`,na(a,n?.account))).data},async reply({threadId:e,subject:n,files:i,outbox:a,...o}){let s=await Wi(o,{files:i,outbox:a},n,e=>r(e,a?.account)),c=await t(`${ta(e)}/comments`,na(s,a?.account));if(!c.thread)throw vi(200);return c.thread},async edit({threadId:e,messageId:n,...r}){return(await t(`${ta(e)}/comments/${encodeURIComponent(n)}`,{method:`PATCH`,body:JSON.stringify(r)})).data},async delete({threadId:e,messageId:n}){let r=n===void 0?ta(e):`${ta(e)}/comments/${encodeURIComponent(n)}`;return(await t(r,{method:`DELETE`})).data},async resolve({threadId:e}){return(await t(`${ta(e)}/resolve`,na())).data},async reopen({threadId:e}){return(await t(`${ta(e)}/reopen`,na())).data},async users({query:e,limit:n,threadId:r,subject:i}){let a=new URLSearchParams({q:e});return n!==void 0&&a.set(`limit`,String(n)),r===void 0?i&&(a.set(`subjectKind`,i.kind),a.set(`subjectId`,i.id)):a.set(`thread`,r),(await t(`/people?${a}`)).data},upload:e=>r(e),attachmentUrl:e=>Zi(e,n)}}var ta,na,ra=t((()=>{Si(),Ji(),Ni(),Xi(),ta=e=>`/threads/${encodeURIComponent(e)}`,na=(e,t)=>({method:`POST`,...e===void 0?{}:{body:JSON.stringify(e)},...t===void 0?{}:{headers:{[Ki]:encodeURIComponent(t)}}})}));function ia(e={}){let t=Qi(e),n=()=>encodeURIComponent(typeof e.page==`function`?e.page():e.page??location.pathname),r=e=>({method:`POST`,...e===void 0?{}:{body:JSON.stringify(e)}}),i=e=>encodeURIComponent(e),a=new Map;return{status:async()=>(await t(`/send/status?page=${n()}`)).data,startPairing:async()=>{let e=n(),i=(await t(`/send/start?page=${e}`,r())).data;return a.set(i.code,e),i},pollPairing:async e=>(await t(`/send/pair/${i(e)}`)).data,allow:async(e,i)=>{let o=a.get(e)??n(),s=(await t(`/send/allow?page=${o}`,r({code:e,selection:i}))).data;return s.status!==`changed`&&a.delete(e),s},cancel:async e=>{a.delete(e),await t(`/send/pair/${i(e)}`,{method:`DELETE`})},send:async()=>(await t(`/send?page=${n()}`,r())).data}}var aa=t((()=>{ra()}));function oa(){return ha?ha.namespace:new URL(pa,location.href).href}function sa(e){if(!ca(e))throw e;return{code:e.code,why:e.message,...e.fix?{fix:e.fix}:{}}}function ca(e){return e instanceof yn?!0:!(e instanceof Error)||!(`code`in e)||typeof e.code!=`string`||e.name!==e.code?!1:!(`fix`in e)||e.fix===void 0||typeof e.fix==`string`}async function la(e,t={}){try{return[void 0,(await ma(e,t)).data]}catch(e){return[sa(e),void 0]}}function ua(e){ha=e}function da(e){let t=t=>t.people.length&&e.onPeople(t.people),n=ha?ha.transport(t):ea({base:pa.slice(0,-Mi.length),guest:Pi,onAnswer:t}),r=t=>async(...n)=>{let r=await t(...n);return e.onChange(),r};return{...n,create:r(n.create),reply:r(n.reply),edit:r(n.edit),delete:r(n.delete),resolve:r(n.resolve),reopen:r(n.reopen)}}function fa(e){return ia({base:pa.slice(0,-Mi.length),page:e})}var pa,ma,ha,ga,_a,va=t((()=>{Ni(),xn(),Bi(),ra(),aa(),pa=Ei(import.meta.url),ma=Qi({route:pa,guest:Pi}),ga=e=>({method:`POST`,body:JSON.stringify(e)}),_a={session:e=>ha?ha.session(e):la(`/session?page=${encodeURIComponent(e)}`),field:(e,t)=>la(`/fields?page=${encodeURIComponent(t)}&field=${encodeURIComponent(e)}`),saveField:(e,t)=>la(`/fields?page=${encodeURIComponent(t)}`,ga(e))}}));function ya(){let e={};return document.querySelector(Sa)?.dispatchEvent(new CustomEvent(Ca,{detail:e})),e.draft}function ba(){return customElements.get(`vitehub-comments`)?(yi(xi.COMMENTS_HOSTED_CONFLICT()),!0):!1}var xa,Sa,Ca,wa=t((()=>{Si(),xa=`vitehub-comments`,Sa=`vitehub-hosted-comments`,Ca=`vitehub:hosted-comments-draft`}));va(),wa();function Ta(e){return`/comments/${encodeURIComponent(e)}/embed`}var Ea,Da,Oa,ka,Aa,ja,Ma=t((()=>{Ea=`modulepreload`,Da=function(e,t){return new URL(e,t).href},Oa={},ka=function(e){return e.pathname.endsWith(`.css`)},Aa=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},ja=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Da(t,n);let r=s(t),i=ka(r);return Aa(Oa,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ea,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}})),Na,Pa=t((()=>{Na=`:root,:host{--vh-comment-default-mark:oklch(58.8% .158 241.966);--vh-comment-default-pin:oklch(20.5% 0 0);--vh-comment-default-pin-text:oklch(98.5% 0 0);--vh-comment-default-surface:oklch(100% 0 0);--vh-comment-default-muted:oklch(50% 0 0);--vh-comment-default-ink:oklch(20.5% 0 0);--vh-comment-shadow:oklch(0% 0 0/.18)}:root,:host,:where([data-slot^=comment-mark],[data-slot=comment-pin],[data-slot^=comment-layer-area]){--vh-comment-mark:var(--vh-ui-comment-mark,var(--vh-focus,var(--vh-comment-default-mark)));--vh-comment-pin:var(--vh-ui-comment-pin,var(--vh-primary,var(--vh-comment-default-pin)));--vh-comment-pin-text:var(--vh-ui-comment-pin-text,var(--vh-inverted,var(--vh-comment-default-pin-text)));--vh-comment-surface:var(--vh-ui-comment-surface,var(--vh-bg,var(--vh-comment-default-surface)));--vh-comment-muted:var(--vh-ui-comment-muted,var(--vh-muted,var(--vh-comment-default-muted)));--vh-comment-ink:var(--vh-ui-comment-ink,var(--vh-highlighted,var(--vh-comment-default-ink)));--vh-comment-pin-size:var(--vh-ui-comment-pin-size,28px)}:root.dark,:root[data-theme=dark],:host(.dark),:host([data-theme=dark]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}@media (prefers-color-scheme:dark){:root:not(.light,.dark,[data-theme]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]){background:var(--vh-comment-pin);border-radius:calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) 4px;box-shadow:0 0 0 2px var(--vh-comment-surface), 0 2px 8px var(--vh-comment-shadow);box-sizing:border-box;color:var(--vh-comment-pin-text);cursor:pointer;height:var(--vh-comment-pin-size);letter-spacing:.02em;transform:scale(var(--vh-comment-zoom,1));transform-origin:0 100%;width:var(--vh-comment-pin-size);border:0;place-items:center;padding:0;font-size:11px;font-weight:600;line-height:1;transition:opacity .15s ease-out;display:grid;position:absolute}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-shape=round]{border-radius:calc(var(--vh-comment-pin-size) / 2);transform-origin:50%}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])>img{border-radius:inherit;object-fit:cover;width:100%;height:100%;display:block}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):before{content:"";border-radius:50%;position:absolute;inset:-8px}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):is(:focus-visible,[data-active=true]){transform:scale(calc(var(--vh-comment-zoom,1) * 1.06))}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]{filter:grayscale();opacity:.55}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]:not(:has(img)){background:var(--vh-comment-muted)}:is([data-slot=comment-mark-area],[data-slot=comment-layer-area]){border:calc(1px * var(--vh-comment-zoom,1)) solid color-mix(in oklab, var(--vh-comment-ink) 22%, transparent);box-sizing:border-box;pointer-events:none;border-radius:4px;transition:border-color .12s ease-out,background-color .12s ease-out;position:absolute}[data-slot=comment-mark-area][data-status=resolved]{border-color:color-mix(in oklab, var(--vh-comment-muted) 50%, transparent);border-style:dashed}[data-slot=comment-mark-area][data-active=true]{border-color:color-mix(in oklab, var(--vh-comment-ink) 45%, transparent);border-style:solid}:is([data-slot=comment-mark-area][data-draft=true],[data-slot=comment-layer-area]){background:color-mix(in oklab, var(--vh-comment-mark) 16%, transparent);border:calc(2px * var(--vh-comment-zoom,1)) solid var(--vh-comment-mark);border-radius:3px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle]){background:var(--vh-comment-surface);border:1.5px solid var(--vh-comment-mark);box-sizing:border-box;border-radius:50%;width:8px;height:8px;position:absolute}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=top]{top:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=bottom]{bottom:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=left]{left:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=right]{right:-5px}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true],[data-slot=comment-layer-item][data-leaving=true]>*{pointer-events:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){animation:.13s cubic-bezier(.4,0,1,1) forwards vh-comment-mark-fade}[data-slot=comment-mark-pin][data-motion-leave-managed]{transition:none}@keyframes vh-comment-mark-fade{to{opacity:0}}@media (prefers-reduced-motion:reduce){:is([data-slot=comment-mark-pin],[data-slot=comment-pin],[data-slot=comment-mark-area],[data-slot=comment-layer-area]){transition:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){opacity:0;animation:none}}::highlight(vh-comment){background-color:color-mix(in oklab, var(--vh-comment-ink) 13%, transparent)}::highlight(vh-comment-resolved){background-color:color-mix(in oklab, var(--vh-comment-ink) 6%, transparent)}::highlight(vh-comment-active),::highlight(vh-comment-draft){background-color:color-mix(in oklab, var(--vh-comment-ink) 26%, transparent)}`})),Fa,Ia=t((()=>{Fa=`[data-slot=comment-send]{--vh-comment-send-text:var(--vitehub-pill-text,var(--ui-text-toned,currentColor));--vh-comment-send-strong:var(--vitehub-pill-strong,var(--ui-text-highlighted,currentColor));--vh-comment-send-muted:var(--vitehub-pill-muted,var(--ui-text-muted,currentColor));--vh-comment-send-hover:var(--vitehub-pill-hover,color-mix(in oklab, currentColor 8%, transparent));--vh-comment-send-on:var(--vitehub-pill-on,var(--ui-bg-inverted,currentColor));--vh-comment-send-on-text:var(--vitehub-pill-on-text,var(--ui-text-inverted,Canvas));--vh-comment-send-error:var(--vitehub-pill-error,var(--ui-error,currentColor));--vh-comment-send-warning:var(--vitehub-pill-warning,var(--ui-warning,currentColor));--vh-comment-send-success:var(--vitehub-pill-success,var(--ui-success,currentColor));color:var(--vh-comment-send-text);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;align-items:center;display:flex}[data-slot=comment-send][hidden]{display:none}[data-slot=comment-send-content]{align-items:center;gap:2px;animation:.18s cubic-bezier(.23,1,.32,1) vh-comment-send-in;display:flex}[data-slot=comment-send-action]{appearance:none;box-sizing:border-box;color:inherit;cursor:pointer;font:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:0 0;border:0;border-radius:8px;flex:none;justify-content:center;align-items:center;gap:4px;min-width:28px;height:28px;margin:0;padding:0 8px;text-decoration:none;transition-property:background-color,color,scale;transition-duration:.15s;transition-timing-function:cubic-bezier(.23,1,.32,1);display:inline-flex}[data-slot=comment-send-action][data-icon]{width:28px;padding:0}@media (hover:hover){[data-slot=comment-send-action]:hover{background:var(--vh-comment-send-hover);color:var(--vh-comment-send-strong)}}[data-slot=comment-send-action]:active{scale:.96}[data-slot=comment-send-action][data-variant=on],[data-slot=comment-send-action][data-variant=on]:hover{background:var(--vh-comment-send-on);color:var(--vh-comment-send-on-text)}@media (any-pointer:coarse){[data-slot=comment-send-action]{min-width:44px;height:44px}}[data-slot=comment-send-status]{box-sizing:border-box;cursor:default;flex:none;justify-content:center;align-items:center;gap:4px;height:28px;padding:0 8px;display:inline-flex}[data-slot=comment-send-status][data-icon]{width:28px;padding:0}[data-slot=comment-send-status][data-tone=error]{color:var(--vh-comment-send-error)}[data-slot=comment-send-status][data-tone=warning]{color:var(--vh-comment-send-warning)}[data-slot=comment-send-hold]{flex:none;display:inline-grid}[data-slot=comment-send-hold]>*{grid-area:1/1}[data-slot=comment-send-hold-copy]{box-sizing:border-box;visibility:hidden;align-items:center;gap:4px;height:28px;padding:0 8px;display:inline-flex}[data-slot=comment-send-message]{color:var(--vh-comment-send-muted);font-weight:400}[data-slot=comment-send-message] b{color:var(--vh-comment-send-strong);font-weight:500}@media (width<=600px){[data-slot=comment-send]:is([data-status=pairing],[data-status=confirm]){flex-shrink:1;max-inline-size:calc(100vw - 64px)}[data-slot=comment-send]:is([data-status=pairing],[data-status=confirm]) [data-slot=comment-send-content],[data-slot=comment-send-status]:has([data-slot=comment-send-message]){flex:0 auto;min-inline-size:0}[data-slot=comment-send-message]{text-overflow:ellipsis;overflow:hidden}[data-slot=comment-send-message]>[data-wide]{display:none}}[data-slot=comment-send] .vh-comment-send-icon{flex:none;width:14px;height:14px}[data-slot=comment-send-count]{background:var(--vh-comment-send-hover);box-sizing:border-box;text-align:center;border-radius:4px;min-width:16px;padding:0 4px;font-size:10px;line-height:17px}[data-slot=comment-send-dot]{background:var(--vh-comment-send-success);border-radius:9999px;flex:none;width:6px;height:6px;animation:1.4s ease-in-out infinite vh-comment-send-pulse}[data-slot=comment-send] .vh-comment-send-spin{animation:.8s linear infinite vh-comment-send-spin}[data-slot=comment-send-logo]{flex:none;place-items:center;width:14px;height:14px;display:inline-grid}[data-slot=comment-send-logo] svg{width:14px;height:14px;display:block}[data-slot=comment-send-logo][data-logo=t3]{color:#fff;background:#0a0a0a;border-radius:4px;width:16px;height:16px;box-shadow:0 0 0 1px #ffffff38}[data-slot=comment-send-logo][data-logo=t3] svg{width:64%;height:auto}[data-slot=comment-send-logo][data-logo=claude]{color:#d97757}@keyframes vh-comment-send-in{0%{opacity:0;transform:translateY(2px)scale(.97)}}@keyframes vh-comment-send-spin{to{rotate:360deg}}@keyframes vh-comment-send-pulse{50%{opacity:.4;scale:.8}}@media (prefers-reduced-motion:reduce){[data-slot=comment-send-content],[data-slot=comment-send-dot],[data-slot=comment-send] .vh-comment-send-spin{animation:none}[data-slot=comment-send-action]{transition-property:background-color,color}[data-slot=comment-send-action]:active{scale:none}}`}));function La(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e.replace(/[^\w-]/g,e=>`\\${e}`)}function Ra(e,t){return`[${e}="${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"]`}function za(e){let t=[],n=e;for(;n&&n!==document.documentElement&&t.length<Ka;){if(n.id)return t.unshift(`#${La(n.id)}`),t.join(` > `);let e=n.getAttribute(Ga);if(e)return t.unshift(Ra(Ga,e)),t.join(` > `);let r=n.tagName.toLowerCase(),i=n.parentElement;if(!i){t.unshift(r);break}let a=[...i.children].filter(e=>e.tagName===n.tagName);t.unshift(a.length>1?`${r}:nth-of-type(${a.indexOf(n)+1})`:r),n=i}return t.join(` > `)}function Ba(e){let t=(e.textContent??``).replace(/\s+/g,` `).trim().slice(0,40),n=e.tagName.toLowerCase();return t?`${n} ${t}`:n}function Va(e,t){return t?Math.min(1e3,Math.max(0,Math.round(e/t*1e3))):0}function Ha(){return Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth,1)}function Ua(e){return e.closest(`[data-content-field]`)??void 0}function Wa(e,t,n){let r=e.getBoundingClientRect(),i=Ua(e)?.getAttribute(`data-content-field`)??void 0;return{kind:`element`,...i?{field:i}:{},selector:za(e),label:Ba(e),x:Va(t-r.left,r.width),y:Va(n-r.top,r.height),page:{x:Va(t+window.scrollX,Ha()),y:Math.max(0,Math.round(n+window.scrollY))},viewport:{width:window.innerWidth}}}var Ga,Ka,qa=t((()=>{Ga=`data-content-field`,Ka=10}));function Ja(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}function Ya(e){if(_o(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=So(r)?Xa(r):Ya(r);if(i)for(let e in i)t[e]=i[e]}return t}if(So(e)||wo(e))return e}function Xa(e){let t={};return e.replace(Jo,e=>e.startsWith(`/*`)?``:e).split(Ko).forEach(e=>{if(e){let n=e.split(qo);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Za(e){let t=``;if(So(e))t=e;else if(_o(e))for(let n=0;n<e.length;n++){let r=Za(e[n]);r&&(t+=r+` `)}else if(wo(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function Qa(e){if(!e)return null;let{class:t,style:n}=e;return t&&!So(t)&&(e.class=Za(t)),n&&(e.style=Ya(n)),e}function $a(e){return!!e||e===``}function eo(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=io(e[i],t[i],n);return r}function to(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&io(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function no(e,t,n){let r=vo(e),i=vo(t);if(r||i||(r=yo(e),i=yo(t),r||i))return r&&i?to(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=go(e,r),a=go(t,r);if(i&&!a||!i&&a||!io(e[r],t[r],n))return!1}return ao(e)===ao(t)}function ro(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function io(e,t,n){if(e===t)return!0;let r=bo(e),i=bo(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=Co(e),i=Co(t),r||i?e===t:(r=_o(e),i=_o(t),r||i?r&&i?ro(e,t,n,eo):!1:(r=wo(e),i=wo(t),r||i?!r||!i?!1:ro(e,t,n,no):String(e)===String(t))))}function ao(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!=`function`&&typeof e.valueOf!=`function`?Do(e):String(e)}var oo,so,co,lo,uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts=t((()=>{oo={},so=[],co=()=>{},lo=()=>!1,uo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),fo=e=>e.startsWith(`onUpdate:`),po=Object.assign,mo=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},ho=Object.prototype.hasOwnProperty,go=(e,t)=>ho.call(e,t),_o=Array.isArray,vo=e=>Do(e)===`[object Map]`,yo=e=>Do(e)===`[object Set]`,bo=e=>Do(e)===`[object Date]`,xo=e=>typeof e==`function`,So=e=>typeof e==`string`,Co=e=>typeof e==`symbol`,wo=e=>typeof e==`object`&&!!e,To=e=>(wo(e)||xo(e))&&xo(e.then)&&xo(e.catch),Eo=Object.prototype.toString,Do=e=>Eo.call(e),Oo=e=>Do(e).slice(8,-1),ko=e=>Do(e)===`[object Object]`,Ao=e=>So(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,jo=Ja(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),Mo=1e4,No=e=>{let t=Object.create(null),n=0;return(r=>{let i=t[r];return i===void 0?(++n>Mo&&(t=Object.create(null),n=1),t[r]=e(r)):i})},Po=/-\w/g,Fo=No(e=>e.replace(Po,e=>e.slice(1).toUpperCase())),Io=/\B([A-Z])/g,Lo=No(e=>e.replace(Io,`-$1`).toLowerCase()),Ro=No(e=>e.charAt(0).toUpperCase()+e.slice(1)),zo=No(e=>e?`on${Ro(e)}`:``),Bo=(e,t)=>!Object.is(e,t),Vo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Ho=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Uo=e=>{let t=parseFloat(e);return isNaN(t)?e:t},Go=()=>Wo||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},Ko=/;(?![^(]*\))/g,qo=/:([^]+)/,Jo=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g,Yo=`itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`,Xo=Ja(Yo),Zo=e=>!!(e&&e.__v_isRef===!0),Qo=e=>So(e)?e:e==null?``:_o(e)||wo(e)&&(e.toString===Eo||!xo(e.toString))?Zo(e)?Qo(e.value):JSON.stringify(e,$o,2):String(e),$o=(e,t)=>Zo(t)?$o(e,t.value):vo(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[es(t,r)+` =>`]=n,e),{})}:yo(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>es(e))}:Co(t)?es(t):wo(t)&&!_o(t)&&!ko(t)?String(t):t,es=(e,t=``)=>Co(e)?`Symbol(${e.description??t})`:e}));function ns(e){return new nc(e)}function rs(){return tc}function is(e,t=!1){tc&&(tc.active?tc.cleanups.push(e):e())}function as(e,t=!1){e.flags|=8,t?(e.next=cc,cc=e):(e.next=sc,sc=e)}function os(){oc++}function ss(){if(--oc>0)return;if(cc){let e=cc;for(cc=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;sc;){let t=sc;for(sc=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function cs(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ls(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),fs(r),ps(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function us(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ds(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ds(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===dc)||(e.globalVersion=dc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!us(e))))return;e.flags|=2;let t=e.dep,n=rc,r=lc;rc=e,lc=!0;try{cs(e);let n=e.fn(e._value);(t.version===0||Bo(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{rc=n,lc=r,ls(e),e.flags&=-3}}function fs(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)fs(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ps(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function ms(){uc.push(lc),lc=!1}function hs(){let e=uc.pop();lc=e===void 0||e}function gs(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=rc;rc=void 0;try{t()}finally{rc=e}}}function _s(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)_s(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}function vs(e,t,n){if(lc&&rc){let t=mc.get(e);t||mc.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new pc),r.map=t,r.key=n),r.track()}}function ys(e,t,n,r,i,a){let o=mc.get(e);if(!o){dc++;return}let s=e=>{e&&e.trigger()};if(os(),t===`clear`)o.forEach(s);else{let i=_o(e),a=i&&Ao(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===_c||!Co(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(_c)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(hc)),vo(e)&&s(o.get(gc)));break;case`delete`:i||(s(o.get(hc)),vo(e)&&s(o.get(gc)));break;case`set`:vo(e)&&s(o.get(hc))}}ss()}function bs(e){let t=Us(e);return t===e||(vs(t,`iterate`,_c),Vs(e))?t:Bs(e)?zs(e)?t.map(e=>Rc(Lc(e))):t.map(Rc):t.map(Lc)}function xs(e){return vs(e=Us(e),`iterate`,_c),e}function Ss(e,t){return Bs(e)?Rc(zs(e)?Lc(t):t):Lc(t)}function Cs(e,t,n){let r=xs(e),i=r[t],a=i.call(r);if(r!==e&&!Vs(e)){if(a[Symbol.toStringTag]===`Array Iterator`){let e=Object.create(Object.getPrototypeOf(a));return e.next=()=>ws(a.next(),n),i!==yc[t]&&Object.defineProperties(e,{return:{get(){let e=a.return;return typeof e==`function`?e.bind(a):e}},throw:{get(){let e=a.throw;return typeof e==`function`?e.bind(a):e}}}),e}a._next=a.next,a.next=()=>ws(a._next(),n)}return a}function ws(e,t){return e.done||(e.value=t(e.value)),e}function Ts(e,t,n,r,i,a){let o=xs(e),s=o!==e&&!Vs(e),c=o[t];if(c!==yc[t]){let t=c.apply(e,a);return s?Lc(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,Ss(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Es(e,t,n,r){let i=xs(e),a=i!==e&&!Vs(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=Ss(e,t)),n.call(this,t,Ss(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?Ss(e,c):c}function Ds(e,t,n){let r=Us(e);vs(r,`iterate`,_c);let i=r[t](...n);return(i===-1||i===!1)&&Hs(n[0])?(n[0]=Us(n[0]),r[t](...n)):i}function Os(e,t,n=[]){ms(),os();let r=Us(e)[t].apply(e,n);return ss(),hs(),r}function ks(e){Co(e)||(e=String(e));let t=Us(this);return vs(t,`has`,e),t.hasOwnProperty(e)}function As(e,t,n){return function(...r){let i=this.__v_raw,a=Us(i),o=vo(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Oc:t?Rc:Lc;return!t&&vs(a,`iterate`,c?gc:hc),po(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function js(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Ms(e,t){let n={get(n){let r=this.__v_raw,i=Us(r),a=Us(n);e||(Bo(n,a)&&vs(i,`get`,n),vs(i,`get`,a));let{has:o}=kc(i),s=t?Oc:e?Rc:Lc;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&vs(Us(t),`iterate`,hc),t.size},has(t){let n=this.__v_raw,r=Us(n),i=Us(t);return e||(Bo(t,i)&&vs(r,`has`,t),vs(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=Us(a),s=t?Oc:e?Rc:Lc;return!e&&vs(o,`iterate`,hc),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return po(n,e?{add:js(`add`),set:js(`set`),delete:js(`delete`),clear:js(`clear`)}:{add(e){let n=Us(this),r=kc(n),i=Us(e),a=!t&&!Vs(e)&&!Bs(e)?i:e;return r.has.call(n,a)||Bo(e,a)&&r.has.call(n,e)||Bo(i,a)&&r.has.call(n,i)||(n.add(a),ys(n,`add`,a,a)),this},set(e,n){t||Vs(n)||Bs(n)||(n=Us(n));let r=Us(this),{has:i,get:a}=kc(r),o=i.call(r,e);o||=(e=Us(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?Bo(n,s)&&ys(r,`set`,e,n,s):ys(r,`add`,e,n),this},delete(e){let t=Us(this),{has:n,get:r}=kc(t),i=n.call(t,e);i||=(e=Us(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&ys(t,`delete`,e,void 0,a),o},clear(){let e=Us(this),t=e.size!==0,n=e.clear();return t&&ys(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=As(r,e,t)}),n}function Ns(e,t){let n=Ms(e,t);return(r,i,a)=>i===`__v_isReactive`?!e:i===`__v_isReadonly`?e:i===`__v_isShallow`?t:i===`__v_raw`?r:Reflect.get(go(n,i)&&i in r?n:r,i,a)}function Ps(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Fs(e){return Bs(e)?e:Rs(e,!1,Tc,Ac,Nc)}function Is(e){return Rs(e,!1,Dc,jc,Pc)}function Ls(e){return Rs(e,!0,Ec,Mc,Fc)}function Rs(e,t,n,r,i){if(!wo(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Ps(Oo(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function zs(e){return Bs(e)?zs(e.__v_raw):!!(e&&e.__v_isReactive)}function Bs(e){return!!(e&&e.__v_isReadonly)}function Vs(e){return!!(e&&e.__v_isShallow)}function Hs(e){return e?!!e.__v_raw:!1}function Us(e){let t=e&&e.__v_raw;return t?Us(t):e}function Ws(e){return!go(e,`__v_skip`)&&Object.isExtensible(e)&&Ho(e,`__v_skip`,!0),e}function Gs(e){return e?e.__v_isRef===!0:!1}function B(e){return qs(e,!1)}function Ks(e){return qs(e,!0)}function qs(e,t){return Gs(e)?e:new zc(e,t)}function V(e){return Gs(e)?e.value:e}function Js(e){return xo(e)?e():V(e)}function Ys(e){return zs(e)?e:new Proxy(e,Bc)}function Xs(e){return new Vc(e)}function Zs(e,t,n=!1){let r,i;return xo(e)?r=e:(r=e.get,i=e.set),new Hc(r,i,n)}function Qs(e,t=!1,n=Gc){if(n){let t=Wc.get(n);t||Wc.set(n,t=[]),t.push(e)}}function $s(e,t,n=oo){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:Vs(e)||i===!1||i===0?ec(e,1):ec(e),u,d,f,p,m=!1,h=!1;if(Gs(e)?(d=()=>e.value,m=Vs(e)):zs(e)?(d=()=>l(e),m=!0):_o(e)?(h=!0,m=e.some(e=>zs(e)||Vs(e)),d=()=>e.map(e=>{if(Gs(e))return e.value;if(zs(e))return l(e);if(xo(e))return c?c(e,2):e()})):d=xo(e)?t?c?()=>c(e,2):e:()=>{if(f){ms();try{f()}finally{hs()}}let t=Gc;Gc=u;try{return c?c(e,3,[p]):e(p)}finally{Gc=t}}:co,t&&i){let e=d,t=i===!0?1/0:i;d=()=>ec(e(),t)}let g=rs(),_=()=>{u.stop(),g&&g.active&&mo(g.effects,u)};if(a&&t){let e=t;t=(...t)=>{try{return e(...t)}finally{_()}}}let v=h?Array(e.length).fill(Uc):Uc,y=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let n=u.run();if(e||i||m||(h?n.some((e,t)=>Bo(e,v[t])):Bo(n,v))){let e=Gc;ms();try{f&&f(),Gc=u;let e=[n,v===Uc?void 0:h&&v[0]===Uc?[]:v,p];v=n,c?c(t,3,e):t(...e)}finally{Gc=e,hs()}}}else u.run()}};return s&&s(y),u=new ac(d),u.scheduler=o?()=>o(y,!1):y,p=e=>Qs(e,!1,u),f=u.onStop=()=>{let e=Wc.get(u);if(e){if(c)c(e,4);else for(let t of e)t();Wc.delete(u)}},t?r?y(!0):v=u.run():o?o(y.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function ec(e,t=1/0,n){if(t<=0||!wo(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Gs(e))ec(e.value,t,n);else if(_o(e))for(let r=0;r<e.length;r++)ec(e[r],t,n);else if(yo(e)||vo(e))e.forEach(e=>{ec(e,t,n)});else if(ko(e)){for(let r in e)ec(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ec(e[r],t,n)}return e}var tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc=t((()=>{ts(),nc=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&tc&&(tc.active?(this.parent=tc,this.index=(tc.scopes||(tc.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=tc;try{return tc=this,e()}finally{tc=t}}}on(){++this._on===1&&(this.prevScope=tc,tc=this)}off(){if(this._on>0&&--this._on===0){if(tc===this)tc=this.prevScope;else{let e=tc;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}},ic=new WeakSet,ac=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,tc&&(tc.active?tc.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ic.has(this)&&(ic.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||as(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,gs(this),cs(this);let e=rc,t=lc;rc=this,lc=!0;try{return this.fn()}finally{ls(this),rc=e,lc=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)fs(e);this.deps=this.depsTail=void 0,gs(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ic.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){us(this)&&this.run()}get dirty(){return us(this)}},oc=0,lc=!0,uc=[],dc=0,fc=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},pc=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!rc||!lc||rc===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==rc)t=this.activeLink=new fc(rc,this),rc.deps?(t.prevDep=rc.depsTail,rc.depsTail.nextDep=t,rc.depsTail=t):rc.deps=rc.depsTail=t,_s(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=rc.depsTail,t.nextDep=void 0,rc.depsTail.nextDep=t,rc.depsTail=t,rc.deps===t&&(rc.deps=e)}return t}trigger(e){this.version++,dc++,this.notify(e)}notify(e){os();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ss()}}},mc=new WeakMap,hc=Symbol(``),gc=Symbol(``),_c=Symbol(``),vc={__proto__:null,[Symbol.iterator](){return Cs(this,Symbol.iterator,e=>Ss(this,e))},concat(...e){return bs(this).concat(...e.map(e=>_o(e)?bs(e):e))},entries(){return Cs(this,`entries`,e=>(e[1]=Ss(this,e[1]),e))},every(e,t){return Ts(this,`every`,e,t,void 0,arguments)},filter(e,t){return Ts(this,`filter`,e,t,e=>e.map(e=>Ss(this,e)),arguments)},find(e,t){return Ts(this,`find`,e,t,e=>Ss(this,e),arguments)},findIndex(e,t){return Ts(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Ts(this,`findLast`,e,t,e=>Ss(this,e),arguments)},findLastIndex(e,t){return Ts(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Ts(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Ds(this,`includes`,e)},indexOf(...e){return Ds(this,`indexOf`,e)},join(e){return bs(this).join(e)},lastIndexOf(...e){return Ds(this,`lastIndexOf`,e)},map(e,t){return Ts(this,`map`,e,t,void 0,arguments)},pop(){return Os(this,`pop`)},push(...e){return Os(this,`push`,e)},reduce(e,...t){return Es(this,`reduce`,e,t)},reduceRight(e,...t){return Es(this,`reduceRight`,e,t)},shift(){return Os(this,`shift`)},some(e,t){return Ts(this,`some`,e,t,void 0,arguments)},splice(...e){return Os(this,`splice`,e)},toReversed(){return bs(this).toReversed()},toSorted(e){return bs(this).toSorted(e)},toSpliced(...e){return bs(this).toSpliced(...e)},unshift(...e){return Os(this,`unshift`,e)},values(){return Cs(this,`values`,e=>Ss(this,e))}},yc=Array.prototype,bc=Ja(`__proto__,__v_isRef,__isVue`),xc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(Co)),Sc=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Ic:Fc:i?Pc:Nc).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=_o(e);if(!r){let e;if(a&&(e=vc[t]))return e;if(t===`hasOwnProperty`)return ks}let o=Reflect.get(e,t,Gs(e)?e:n);if((Co(t)?xc.has(t):bc(t))||(r||vs(e,`get`,t),i))return o;if(Gs(o)){let e=a&&Ao(t)?o:o.value;return r&&wo(e)?Ls(e):e}return wo(o)?r?Ls(o):Fs(o):o}},Cc=class extends Sc{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=_o(e)&&Ao(t);if(!this._isShallow){let e=Bs(i);if(!Vs(n)&&!Bs(n)&&(i=Us(i),n=Us(n)),!a&&Gs(i)&&!Gs(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:go(e,t),s=Reflect.set(e,t,n,Gs(e)?e:r);return e===Us(r)&&s&&(o?Bo(n,i)&&ys(e,`set`,t,n,i):ys(e,`add`,t,n)),s}deleteProperty(e,t){let n=go(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&ys(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return Co(t)&&xc.has(t)||vs(e,`has`,t),n}ownKeys(e){return vs(e,`iterate`,_o(e)?`length`:hc),Reflect.ownKeys(e)}},wc=class extends Sc{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Tc=new Cc,Ec=new wc,Dc=new Cc(!0),Oc=e=>e,kc=e=>Reflect.getPrototypeOf(e),Ac={get:Ns(!1,!1)},jc={get:Ns(!1,!0)},Mc={get:Ns(!0,!1)},Nc=new WeakMap,Pc=new WeakMap,Fc=new WeakMap,Ic=new WeakMap,Lc=e=>wo(e)?Fs(e):e,Rc=e=>wo(e)?Ls(e):e,zc=class{constructor(e,t){this.dep=new pc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Us(e),this._value=t?e:Lc(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Vs(e)||Bs(e);e=n?e:Us(e),Bo(e,t)&&(this._rawValue=e,this._value=n?e:Lc(e),this.dep.trigger())}},Bc={get:(e,t,n)=>t===`__v_raw`?e:V(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return Gs(i)&&!Gs(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}},Vc=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new pc,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}},Hc=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new pc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=dc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&rc!==this)return as(this,!0),!0}get value(){let e=this.dep.track();return ds(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}},Uc={},Wc=new WeakMap,Gc=void 0}));function qc(e,t,n,r){try{return r?e(...r):e()}catch(e){Yc(e,t,n)}}function Jc(e,t,n,r){if(xo(e)){let i=qc(e,t,n,r);return i&&To(i)&&i.catch(e=>{Yc(e,t,n,void 0,!0)}),i}if(_o(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Jc(e[a],t,n,r));return i}}function Yc(e,t,n,r=!0,i=!1){let a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||oo;if(t){let r=t.parent,a=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t&&!r.isUnmounted&&(!i||r.scope.active)){for(let n=0;n<t.length;n++)if(t[n](e,a,s)===!1)return}r=r.parent}if(o){ms(),qc(o,null,10,[e,a,s]),hs();return}}Xc(e,n,a,r,s)}function Xc(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}function Zc(e){let t=id||rd;return e?t.then(this?e.bind(this):e):t}function Qc(e){let t=$u+1,n=Qu.length;for(;t<n;){let r=t+n>>>1,i=Qu[r],a=od(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function $c(e){if(!(e.flags&1)){let t=od(e),n=Qu[Qu.length-1];!n||!(e.flags&2)&&t>=od(n)?Qu.push(e):Qu.splice(Qc(t),0,e),e.flags|=1,el()}}function el(){id||=rd.then(al)}function tl(e){if(!_o(e))td&&e.id===-1?td.splice(nd+1,0,e):e.flags&1||(ed.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)ed.push(e[t]);el()}function nl(e,t,n,r=$u+1){for(;r<Qu.length;r++){let n=Qu[r];if(n&&n.flags&2){if(e&&n.id!==e.uid||t!==void 0&&!(n.id>=t))continue;Qu.splice(r,1),r=e?r-1:$u,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function rl(e,t,n=0){if(ed.length){let e=ed,r=0;if(t){e=[];for(let i=0;i<ed.length;i++){let a=ed[i];(a.i===void 0?t.has(a):!a.i||a.i.uid<n)?ed[r++]=a:e.push(a)}}let i=[...new Set(e)].sort((e,t)=>od(e)-od(t));if(ed.length=r,td){for(let e=0;e<i.length;e++)td.push(i[e]);return}for(td=i,nd=0;nd<td.length;nd++){let e=td[nd];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}td=null,nd=0}}function il(e,t){if(ad){e();return}let n=t===void 0?void 0:new Set(ed);e(),ad=!0;try{nl(void 0,t),rl(void 0,n,t)}finally{ad=!1}}function al(e){try{for($u=0;$u<Qu.length;$u++){let e=Qu[$u];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),qc(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;$u<Qu.length;$u++){let e=Qu[$u];e&&(e.flags&=-2)}$u=-1,Qu.length=0,rl(e),id=null,(Qu.length||ed.length)&&al(e)}}function ol(e){let t=sd;return sd=e,cd=e&&e.type.__scopeId||null,t}function sl(e,t=sd,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Eu(-1);let i=ol(t),a=cf.length,o;try{o=e(...n)}finally{for(let e=cf.length;e>a;e--)Tu();ol(i),r._d&&Eu(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function cl(e,t,n,r){let i=e;if(r===`beforeMount`)e._mount=e;else if(r===`beforeUpdate`){let n=t&&t._mount;n&&(n._latest=e,e._mount=n)}else if(r===`mounted`){let t=e._latest;e._mount=e._latest=void 0,t&&(i=t,t._mount=void 0)}let a=i.dirs,o=t&&t.dirs;for(let s=0;s<a.length;s++){let c=a[s];o?c.oldValue=o[s].value:r===`mounted`&&c.oldValue!==void 0&&(c=po({},c,{oldValue:void 0}));let l=c.dir[r];l&&(ms(),Jc(l,n,8,[e.el,c,i,t]),hs())}}function ll(e,t){if(hf){let n=hf.provides,r=hf.parent&&hf.parent.provides;r===n&&(n=hf.provides=Object.create(r)),n[e]=t}}function ul(e,t,n=!1){let r=gf();if(r||zd){let i=zd?zd._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&xo(t)?t.call(r&&r.proxy):t}}function dl(){return!!(gf()||zd)}function fl(e,t){return ml(e,null,t)}function pl(e,t){return ml(e,null,{flush:`sync`})}function H(e,t,n){return ml(e,t,n)}function ml(e,t,n=oo){let{immediate:r,deep:i,flush:a,once:o}=n,s=po({},n),c=t&&r||!t&&a!==`post`,l;if(xf){if(a===`sync`){let e=ud();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=co,e.resume=co,e.pause=co,e}}let u=hf;s.call=(e,t,n)=>Jc(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{e.i=u,ef(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():$c(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=$s(e,t,s);return xf&&(l?l.push(f):c&&f()),f}function hl(e,t,n,{o:{insert:r},m:i},a=2){a===0&&(e.targetStart&&r(e.targetStart,t,n),r(e.targetAnchor,t,n),n=e.targetAnchor);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!dd.has(e)&&(!d||md(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function gl(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=vd(t.props,c),h=md(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(f(m,c),p(e,t),t.targetAnchor||vl(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||vl(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),_l(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}function _l(e,t){let n=e.ctx;n&&n.ut&&(t?n.ut(e.el,e.anchor):n.ut(e.targetStart,e.targetAnchor))}function vl(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[fd]=o,e&&(r(a,e,i),r(o,e,i)),o}function yl(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==of){t=n;break}}return t}function bl(e){if(!Td(e))return pd(e.type)&&e.children?yl(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&xo(n.default))return n.default()}}function xl(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;xl(pd(n.type)&&bl(n)||n,t)}else if(e.shapeFlag&128){let n=e.suspense;if(n){let e=n.isHydrating?n.pendingBranch:n.activeBranch;e&&xl(e,t.clone(e))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===rf&&_o(e.children)){let n=ru(e.children,!1);n&&xl(n,t)}}function Sl(e){if(e.component)return Sl(e.component.subTree);if(e.type===rf){let t=_o(e.children)&&ru(e.children,!1);return t?Sl(t):void 0}if(e.type!==of)return e}function U(e,t){return xo(e)?po({name:e.name},t,{setup:e}):e}function Cl(){let e=gf();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function wl(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Tl(e){let t=gf(),n=Ks(null);if(t){let r=t.refs===oo?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function El(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}function Dl(e,t,n,r,i=!1){if(_o(e)){e.forEach((e,a)=>Dl(e,t&&(_o(t)?t[a]:t),n,r,i));return}if(wd(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Dl(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Yu(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===oo?s.refs={}:s.refs,d=s.setupState,f=Us(d),p=d===oo?lo:e=>!El(u,e)&&go(f,e),m=(e,t)=>!(t&&El(u,t));if(l!=null&&l!==c){if(Ol(t),So(l))u[l]=null,p(l)&&(d[l]=null);else if(Gs(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(xo(c))qc(c,s,12,[o,u]);else{let t=So(c),r=Gs(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)_o(n)&&mo(n,a);else if(_o(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Sd.delete(e)};t.id=-1,Sd.set(e,t),ef(t,n)}else Ol(e),s()}}}function Ol(e){let t=Sd.get(e);t&&(t.flags|=8,Sd.delete(e))}function kl(e,t){if(Cd(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Cd(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}function Al(e){xo(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return U({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>kl(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=hf;if(wl(e),u)return()=>jl(u,e);let t=t=>{l=null,Yc(t,e,13,!r,!0)};if(s&&e.suspense||xf)return p().then(t=>()=>jl(t,e)).catch(e=>(t(e),()=>r?J(r,{error:e}):null));let a=B(!1),c=B(),d=B(!!i),f,m;return is(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Td(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?l=null:(t(n),c.value=n)}),()=>{if(a.value&&u)return jl(u,e);if(c.value&&r)return J(r,{error:c.value});if(n&&!d.value)return jl(n,e)}}})}function jl(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=J(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}function Ml(e,t){Pl(e,`a`,t)}function Nl(e,t){Pl(e,`da`,t)}function Pl(e,t,n=hf){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Il(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Td(e.parent.vnode)&&Fl(r,t,n,e),e=e.parent}}function Fl(e,t,n,r){let i=Il(t,e,r,!0),a=Il(`um`,()=>mo(r[t],i),n);a.flags=16}function Il(e,t,n=hf,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{ms();let i=yf(n),a=Jc(t,n,e,r);return i(),hs(),a};return r?i.unshift(a):i.push(a),a}}function Ll(e,t=hf){Il(`ec`,e,t)}function Rl(e){return So(e)?zl(Md,e,!1)||e:e||Nd}function zl(e,t,n=!0,r=!1){let i=sd||hf;if(i){let n=i.type;if(e===Md){let e=Xu(n,!1);if(e&&(e===t||e===Fo(t)||e===Ro(Fo(t))))return n}let a=Bl(i[e]||n[e],t)||Bl(i.appContext[e],t);return!a&&r?n:a}}function Bl(e,t){return e&&(e[t]||e[Fo(t)]||e[Ro(Fo(t))])}function Vl(e,t,n,r){let i,a=n&&n[r],o=_o(e);if(o||So(e)){let n=o&&zs(e),r=!1,s=!1;n&&(r=!Vs(e),s=Bs(e),e=xs(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?Rc(Lc(e[n])):Lc(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){if(!Number.isInteger(e)||e<0)i=[];else{i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}}else if(wo(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function Hl(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(_o(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function Ul(e,t,n,r,i,a){if(n??={},sd.ce||sd.parent&&wd(sd.parent)&&sd.parent.ce){let e=a!=null&&n.key==null?po({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),W(),Ou(rf,null,[J(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=cf.length;W();let c;try{let i=o&&Wl(o(n)),s=n.key||a||i&&i.key;c=Ou(rf,{key:(s&&!Co(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=cf.length;e>s;e--)Tu();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function Wl(e){return e.some(e=>!ku(e)||!(e.type===of||e.type===rf&&!Wl(e.children)))?e:null}function Gl(){return ql(`useSlots`).slots}function Kl(){return ql(`useAttrs`).attrs}function ql(e){let t=gf();return t.setupContext||=Ju(t)}function Jl(e){return _o(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Yl(e,t){return!e||!t?e||t:_o(e)&&_o(t)?e.concat(t):po({},Jl(e),Jl(t))}function Xl(){return{app:null,config:{isNativeTag:lo,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}function Zl(e,t){return function(n,r=null){xo(n)||(n=po({},n)),r!=null&&!wo(r)&&(r=null);let i=Xl(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:Rd++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Ef,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&xo(e.install)?(a.add(e),e.install(c,...t)):xo(e)&&(a.add(e),e(c,...t))),c},mixin(e){return c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||J(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,Yu(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Jc(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=zd;zd=c;try{return e()}finally{zd=t}}};return c}}function Ql(e,t,n=oo){let r=gf(),i=Fo(t),a=Lo(t),o=Bd(e,i),s=Xs((o,s)=>{let c,l=oo,u;return pl(()=>{let t=e[i];Bo(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!Bo(o,c)&&!(l!==oo&&Bo(e,l)))return;let d=r.vnode.props,f=!!(d&&(t in d||i in d||a in d)&&(`onUpdate:${t}`in d||`onUpdate:${i}`in d||`onUpdate:${a}`in d));f||(c=e,s()),r.emit(`update:${t}`,o),Bo(e,l)&&(Bo(e,o)&&!Bo(o,u)||f&&l!==oo&&!Bo(o,c))&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||oo:s,done:!1}:{done:!0}}}},s}function $l(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||oo,i=n,a=t.startsWith(`update:`),o=a&&Bd(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>So(e)?e.trim():e)),o.number&&(i=i.map(Uo)));let s,c=r[s=zo(t)]||r[s=zo(Fo(t))];!c&&a&&(c=r[s=zo(Lo(t))]),c&&Jc(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Jc(l,e,6,i)}}function eu(e,t,n=!1){let r=t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={};return a?(_o(a)?a.forEach(e=>o[e]=null):po(o,a),wo(e)&&r.set(e,o),o):(wo(e)&&r.set(e,null),null)}function tu(e,t){return!e||!uo(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),go(e,t[0].toLowerCase()+t.slice(1))||go(e,Lo(t))||go(e,t))}function nu(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=ol(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=Iu(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=Iu(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:Vd(s)}}catch(t){cf.length=0,Yc(t,e,1),_=J(of)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(fo)&&(v=Hd(v,a)),y=Nu(y,v,!1,!0))}return n.dirs&&(y=Nu(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&xl(pd(y.type)&&bl(y)||y,n.transition),_=y,ol(g),_}function ru(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(ku(r)){if(r.type!==of||r.children===`v-if`){if(n)return;n=r}}else return}return n}function iu(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?au(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(ou(o,r,n)&&!tu(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||au(r,o,l):!!o;return!1}function au(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(!go(e,a)||ou(t,e,a)&&!tu(n,a))return!0}return!1}function ou(e,t,n){let r=e[n],i=t[n];return n===`style`&&wo(r)&&wo(i)?!io(r,i):r!==i}function su({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}function cu(e,t,n,r=!1){let i={},a=Wd();e.propsDefaults=Object.create(null),uu(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Is(i):e.type.props?i:a,e.attrs=a}function lu(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=Us(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(tu(e.emitsOptions,o))continue;let u=t[o];if(c){if(go(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=Fo(o);i[t]=du(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{uu(e,t,i,a)&&(l=!0);let r;for(let a in s)t&&(go(t,a)||(r=Lo(a))!==a&&go(t,r))||(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=du(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)t&&go(t,e)||(delete a[e],l=!0)}l&&ys(e.attrs,`set`,``)}function uu(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(jo(c))continue;let l=t[c],u;i&&go(i,u=Fo(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:tu(e.emitsOptions,c)||c in r&&l===r[c]||(r[c]=l,o=!0)}if(a){let t=Us(n),r=s||oo;for(let o=0;o<a.length;o++){let s=a[o];n[s]=du(i,t,s,r[s],e,!go(r,s))}}return o}function du(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=go(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&xo(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=yf(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===Lo(n))&&(r=!0))}return r}function fu(e,t,n=!1){let r=t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[];if(!a)return wo(e)&&r.set(e,so),so;if(_o(a))for(let e=0;e<a.length;e++){let t=Fo(a[e]);pu(t)&&(o[t]=oo)}else if(a)for(let e in a){let t=Fo(e);if(pu(t)){let n=a[e],r=o[t]=_o(n)||xo(n)?{type:n}:po({},n),i=r.type,c=!1,l=!0;if(_o(i))for(let e=0;e<i.length;++e){let t=i[e],n=xo(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=xo(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||go(r,`default`))&&s.push(t)}}let c=[o,s];return wo(e)&&r.set(e,c),c}function pu(e){return e[0]!==`$`&&!jo(e)}function mu(e){return hu(e)}function hu(e,t){let n=Go();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=co,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Au(e,t)&&(r=oe(e),F(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===so&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case af:g(e,t,n,r);break;case of:_(e,t,n,r);break;case sf:e??v(t,n,r,o);break;case rf:O(e,t,n,r,i,a,o,s,c);break;default:d&1?x(e,t,n,r,i,a,o,s,c):d&6?k(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,se)}u!=null&&i?Dl(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Dl(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},x=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)S(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),T(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},S=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&w(e.children,f,null,i,s,gu(e,c),l,d),_&&cl(e,null,i,`created`),C(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!jo(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&Bu(p,i,e)}_&&cl(e,null,i,`beforeMount`);let v=vu(s,g);v?g.beforeEnter(f):g&&!g.persisted&&(f[nf]=!0),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&ef(()=>{try{p&&Bu(p,i,e),v&&g.enter(f),_&&cl(e,null,i,`mounted`)}finally{}},s)},C=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(t===n||tf(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;C(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},w=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Lu(e[l]):Iu(e[l]);h(null,c,t,n,r,i,a,o,s)}},T=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||oo,m=t.props||oo,h;if(n&&_u(n,!1),(h=m.onVnodeBeforeUpdate)&&Bu(h,n,t,e),f&&cl(t,e,n,`beforeUpdate`),n&&_u(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?E(e.dynamicChildren,d,c,n,r,gu(t,i),o):s||N(e,t,c,null,n,r,gu(t,i),o,!1),l>0){if(l&16)D(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&D(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&ef(()=>{h&&Bu(h,n,t,e),f&&cl(t,e,n,`updated`)},r)},E=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el||Cu(c),f=u&&(c.type===rf||!Au(c,l)||c.shapeFlag&198)?d(u):n;h(c,l,f,null,r,i,a,o,!0)}},D=(e,t,n,r,i)=>{if(t!==n){if(t!==oo)for(let o in t)!jo(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(jo(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},O=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),w(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(E(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&yu(e,t,!0)):N(e,t,n,f,a,o,c,l,u)},k=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):A(t,n,r,i,a,o,c):ee(e,t,c)},A=(e,t,n,r,i,a,o)=>{let s=e.component=Hu(e,r,i);if(Td(e)&&(s.ctx.renderer=se),Wu(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,j,o,a),!e.el){let r=s.subTree=J(of);_(null,r,t,n),e.placeholder=r.el}}else j(s,e,t,n,i,a,o)},ee=(e,t,n)=>{let r=t.component=e.component;if(iu(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,t.placeholder=e.placeholder,M(r,t,n);return}r.next=t,r.update()}else t.el=e.el,t.placeholder=e.placeholder,r.vnode=t},j=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=xu(e);if(n){t&&(t.el=c.el,M(e,t,o)),n.asyncDep.then(()=>{let t=()=>{e.job.flags&8||(i&&i.pendingBranch?ef(t,i):l())};t.flags=48,ef(t,i)});return}}let u=t,f;_u(e,!1),t?(t.el=c.el,M(e,t,o)):t=c,n&&Vo(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&Bu(f,s,t,c),_u(e,!0);let p=nu(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el||Cu(m)),oe(m),e,i,a),t.el=p.el,u===null&&su(e,p.el),r&&ef(r,i),(f=t.props&&t.props.onVnodeUpdated)&&ef(()=>Bu(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=wd(t);if(_u(e,!1),l&&Vo(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Bu(o,d,t),_u(e,!0),s&&le){let t=()=>{e.subTree=nu(e),le(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=nu(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&ef(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;ef(()=>Bu(o,d,e),i)}(t.shapeFlag&256||d&&wd(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&ef(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new ac(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>$c(u),_u(e,!0),l()},M=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,lu(e,t.props,r,n),$d(e,t.children,n),ms(),nl(e),hs()},N=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){P(l,f,n,r,i,a,o,s,c);return}if(p&256){te(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&I(l,i,a),f!==l&&u(n,f)):d&16?m&16?P(l,f,n,r,i,a,o,s,c):I(l,i,a,!0):(d&8&&u(n,``),m&16&&w(f,n,r,i,a,o,s,c))},te=(e,t,n,r,i,a,o,s,c)=>{e||=so,t||=so;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?Lu(t[f]):Iu(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?I(e,i,a,!0,!1,d):w(t,n,r,i,a,o,s,c,d)},P=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?Lu(t[l]):Iu(t[l]);if(Au(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?Lu(t[f]):Iu(t[f]);if(Au(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?Lu(t[l]):Iu(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)F(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?Lu(t[l]):Iu(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,x=0,S=Array(y);for(l=0;l<y;l++)S[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){F(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(S[_-m]===0&&Au(r,t[_])){u=_;break}u===void 0?F(r,i,a,!0):(S[u-m]=l+1,u>=x?x=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let C=b?bu(S):so;for(_=C.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Cu(f):r;S[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==C[_]?ne(d,n,p,2):_--)}}},ne=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)ne(e.component.subTree,t,n,a);else if(d&128)e.suspense.move(t,n,a);else if(d&64)c.move(e,t,n,se);else if(c===rf){r(s,t,n);for(let e=0;e<u.length;e++)ne(u[e],t,n,a);r(e.anchor,t,n)}else if(c===sf)y(e,t,n);else if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[xd]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),ef(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[xd];s._isLeaving&&s[xd](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},F=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(ms(),Dl(s,null,n,e,!0),hs()),p==null||e.ctx&&e.ctx!==t||(t.renderCache[p]=void 0),u&256&&t.ctx.deactivate(e))return;let h=u&1&&f,g=!wd(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Bu(_,t,e),u&6)ae(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&cl(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,se,r):l&&!l.hasOnce&&(a!==rf||d>0&&d&64)?I(l,t,n,!1,!0):(a===rf&&d&384||!i&&u&16)&&I(c,t,n),r&&re(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&ef(()=>{_&&Bu(_,t,e),h&&cl(e,null,t,`unmounted`),v&&(e.el=null)},n)},re=e=>{let{type:t,el:n,anchor:r,transition:a}=e,o=t===rf;if(o&&!a){ie(n,r);return}if(t===sf){b(e),a&&!a.persisted&&a.afterLeave&&a.afterLeave();return}let s=o?Sl(e):e,c=()=>{o?d(n)&&ie(n,r):i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(s&&s.shapeFlag&1&&a&&!a.persisted){let{leave:e,delayLeave:t}=a,n=s.el,r=()=>e(n,c);t?t(n,c,r):r()}else c()},ie=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},ae=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Su(c),Su(l),r&&Vo(r),i.stop(),a?(a.flags|=8,F(o,e,t,n)):o&&(o.transition=e.vnode.transition,F(o,e,t,n)),s&&ef(s,t);let u=()=>{e.isUnmounted=!0};u.flags=16,ef(u,t)},I=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)F(e[o],t,n,r,i)},oe=e=>{if(e.shapeFlag&6)return oe(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[fd];return n?f(n):t},L=(e,t,n)=>{il(()=>{e==null?t._vnode&&F(t._vnode,null,null,!0):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e},e&&t._vnode?void 0:e&&e.component?e.component.uid:Vu())},se={p:h,um:F,m:ne,r:re,mt:A,mc:w,pc:N,pbc:E,n:oe,o:e},ce,le;return t&&([ce,le]=t(se)),{render:L,hydrate:ce,createApp:Zl(L,ce)}}function gu({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function _u({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function vu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function yu(e,t,n=!1){let r=e.children,i=t.children;if(_o(r)&&_o(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Lu(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&yu(t,a)),a.type===af&&(a.patchFlag===-1&&(a=i[e]=Lu(a)),a.el=t.el),a.type===of&&!a.el&&(a.el=t.el)}}function bu(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function xu(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:xu(t)}function Su(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Cu(e){if(e.placeholder)return e.placeholder;let t=e.component;if(t)return Cu(t.subTree);let n=e.suspense;return n&&n.activeBranch?Cu(n.activeBranch):null}function wu(e,t){t&&t.pendingBranch?_o(e)?t.effects.push(...e):t.effects.push(e):tl(e)}function W(e=!1){cf.push(lf=e?null:[])}function Tu(){cf.pop(),lf=cf[cf.length-1]||null}function Eu(e,t=!1){uf+=e,e<0&&lf&&t&&(lf.hasOnce=!0)}function Du(e){return e.dynamicChildren=uf>0?lf||so:null,Tu(),uf>0&&lf&&lf.push(e),e}function G(e,t,n,r,i,a){return Du(K(e,t,n,r,i,a,!0))}function Ou(e,t,n,r,i){return Du(J(e,t,n,r,i,!0))}function ku(e){return e?e.__v_isVNode===!0:!1}function Au(e,t){return e.type===t.type&&e.key===t.key}function K(e,t=null,n=null,r=0,i=null,a=e===rf?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&df(t),ref:t&&ff(t),scopeId:cd,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:sd};return s?(Ru(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=So(n)?8:16),uf>0&&!o&&lf&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&lf.push(c),c}function ju(e,t=null,n=null,r=0,i=null,a=!1){if(e&&e!==Nd||(e=of),ku(e)){let r=Nu(e,t,!0);return n&&Ru(r,n),uf>0&&!a&&lf&&(r.shapeFlag&6?lf[lf.indexOf(e)]=r:lf.push(r)),r.patchFlag=-2,r}if(Zu(e)&&(e=e.__vccOpts),t){t=Mu(t);let{class:e,style:n}=t;e&&!So(e)&&(t.class=Za(e)),wo(n)&&(Hs(n)&&!_o(n)&&(n=po({},n)),t.style=Ya(n))}let o=So(e)?1:tf(e)?128:pd(e)?64:wo(e)?4:xo(e)?2:0;return K(e,t,n,r,i,o,a,!0)}function Mu(e){return e?Hs(e)?po({},e):Gd(e)?po({},e[wf]||e):e:null}function Nu(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?zu(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&df(l),ref:t&&t.ref?n&&a?_o(a)?a.concat(ff(t)):[a,ff(t)]:ff(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==rf?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Nu(e.ssContent),ssFallback:e.ssFallback&&Nu(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&xl(u,c.clone(u)),u}function Pu(e=` `,t=0){return J(af,null,e,t)}function Fu(e=``,t=!1){return t?(W(),Ou(of,null,e)):J(of,null,e)}function Iu(e){return e==null||typeof e==`boolean`?J(of):_o(e)?J(rf,null,e.slice()):ku(e)?Lu(e):J(af,null,String(e))}function Lu(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Nu(e)}function Ru(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(_o(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Ru(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Gd(t)?t._ctx=sd:r===3&&sd&&(sd.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(xo(t)){if(r&65){Ru(e,{default:t});return}t={default:t,_ctx:sd},n=32}else t=String(t),r&64?(n=16,t=[Pu(t)]):n=8;e.children=t,e.shapeFlag|=n}function zu(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=Za([t.class,r.class]));else if(e===`style`)t.style=Ya([t.style,r.style]);else if(uo(e)){let n=t[e],i=r[e];i&&n!==i&&!(_o(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!fo(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Bu(e,t,n,r=null){Jc(e,t,7,[n,r])}function Vu(){return mf}function Hu(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||pf,a={uid:mf++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new nc(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:fu(r,i),emitsOptions:eu(r,i),emit:null,emitted:null,propsDefaults:oo,inheritAttrs:r.inheritAttrs,ctx:oo,data:oo,props:oo,attrs:oo,slots:oo,refs:oo,setupState:oo,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=$l.bind(null,a),e.ce&&e.ce(a),a}function Uu(e){return e.vnode.shapeFlag&4}function Wu(e,t=!1,n=!1){t&&vf(t);let{props:r,children:i}=e.vnode,a=Uu(e);cu(e,r,a,t),Qd(e,i,n||t);let o=a?Gu(e,t):void 0;return t&&vf(!1),o}function Gu(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ld);let{setup:r}=n;if(r){ms();let n=e.setupContext=r.length>1?Ju(e):null,i=yf(e),a=qc(r,e,0,[e.props,n]),o=To(a);if(hs(),i(),(o||e.sp)&&!wd(e)&&wl(e),o){if(a.then(bf,bf),t)return a.then(n=>{vf(!0);try{Ku(e,n,t)}finally{vf(!1)}}).catch(t=>{Yc(t,e,0,void 0,!0),e.ssrRender=(e,t)=>t(`<!---->`)});e.asyncDep=a}else Ku(e,a,t)}else qu(e,t)}function Ku(e,t,n){xo(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:wo(t)&&(e.setupState=Ys(t)),qu(e,n)}function qu(e,t,n){let r=e.type;if(!e.render){if(!t&&Sf&&!r.render){let t=r.template||!1;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Sf(t,po(po({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||co,Cf&&Cf(e)}}function Ju(e){return{attrs:new Proxy(e.attrs,Tf),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Yu(e){return e.exposed?e.exposeProxy||=new Proxy(Ys(Ws(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Fd)return Fd[n](e)},has(e,t){return t in e||t in Fd}}):e.proxy}function Xu(e,t=!0){return xo(e)?e.displayName||e.name:e.name||t&&e.__name}function Zu(e){return xo(e)&&`__vccOpts`in e}function q(e,t,n){try{Eu(-1);let r=arguments.length;return r===2?wo(t)&&!_o(t)?ku(t)?J(e,null,[t]):J(e,t):J(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ku(n)&&(n=[n]),J(e,t,n))}finally{Eu(1)}}var Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,lf,uf,df,ff,J,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Y,Ef,Df=t((()=>{Kc(),ts(),Qu=[],$u=-1,ed=[],td=null,nd=0,rd=Promise.resolve(),id=null,ad=!1,od=e=>e.id==null?e.flags&2?-1:1/0:e.id,sd=null,cd=null,ld=Symbol.for(`v-scx`),ud=()=>ul(ld),dd=new WeakMap,fd=Symbol(`_vte`),pd=e=>e.__isTeleport,md=e=>e&&(e.disabled||e.disabled===``),hd=e=>e&&(e.defer||e.defer===``),gd=e=>typeof SVGElement<`u`&&e instanceof SVGElement,_d=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,vd=(e,t)=>{let n=e&&e.to;return So(n)?t?t(n):null:n},yd={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=md(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=md(e.props),r=e.target=vd(e.props,m),a=vl(r,e,h,p);r&&(o!==`svg`&&gd(r)?o=`svg`:o!==`mathml`&&_d(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),_l(e,!1)))},S=e=>{let t=()=>{if(dd.get(e)===t){if(dd.delete(e),md(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),_l(e,!0)}x(e)}};dd.set(e,t),ef(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),hd(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),_l(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=dd.get(e);if(u){u.flags|=8,dd.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=md(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||gd(p)?o=`svg`:(o===`mathml`||_d(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),yu(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):hl(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=vd(t.props,m);e&&(t.target=e,hl(t,e,null,l,0))}else g&&hl(t,p,h,l,1);_l(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=md(f),m=a||!p,h=dd.get(e);if(h&&(h.flags|=8,dd.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:hl,hydrate:gl},bd=yd,xd=Symbol(`_leaveCb`),Sd=new WeakMap,Cd=e=>e.nodeType===8,Go().requestIdleCallback,Go().cancelIdleCallback,wd=e=>!!e.type.__asyncLoader,Td=e=>e.type.__isKeepAlive,Ed=e=>(t,n=hf)=>{xf&&e!==`sp`||Il(e,(...e)=>t(...e),n)},Ed(`bm`),Dd=Ed(`m`),Od=Ed(`bu`),kd=Ed(`u`),Ad=Ed(`bum`),jd=Ed(`um`),Ed(`sp`),Ed(`rtg`),Ed(`rtc`),Md=`components`,Nd=Symbol.for(`v-ndc`),Pd=e=>e?Uu(e)?Yu(e):Pd(e.parent):null,Fd=po(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Pd(e.parent),$root:e=>Pd(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>e.type,$forceUpdate:e=>e.f||=()=>{$c(e.update)},$nextTick:e=>e.n||=Zc.bind(e.proxy),$watch:e=>co}),Id=(e,t)=>e!==oo&&!e.__isScriptSetup&&go(e,t),Ld={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Id(r,t))return o[t]=1,r[t];else if(go(a,t))return o[t]=3,a[t];else if(n!==oo&&go(n,t))return o[t]=4,n[t];else o[t]=0}let l=Fd[t],u,d;if(l)return t===`$attrs`&&vs(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==oo&&go(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,go(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Id(i,t)?(i[t]=n,!0):go(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||Id(t,s)||go(a,s)||go(r,s)||go(Fd,s)||go(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?go(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},Rd=0,zd=null,Bd=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${Fo(t)}Modifiers`]||e[`${Lo(t)}Modifiers`],Vd=e=>{let t;for(let n in e)(n===`class`||n===`style`||uo(n))&&((t||={})[n]=e[n]);return t},Hd=(e,t)=>{let n={};for(let r in e)fo(r)&&r.slice(9)in t||(n[r]=e[r]);return n},Ud={},Wd=()=>Object.create(Ud),Gd=e=>Object.getPrototypeOf(e)===Ud,Kd=e=>e===`_`||e===`_ctx`||e===`$stable`,qd=e=>_o(e)?e.map(Iu):[Iu(e)],Jd=(e,t,n)=>{if(t._n)return t;let r=sl((...e)=>qd(t(...e)),n);return r._c=!1,r},Yd=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Kd(n))continue;let i=e[n];if(xo(i))t[n]=Jd(n,i,r);else if(i!=null){let e=qd(i);t[n]=()=>e}}},Xd=(e,t)=>{let n=qd(t);e.slots.default=()=>n},Zd=(e,t,n)=>{for(let r in t)(n||!Kd(r))&&(e[r]=t[r])},Qd=(e,t,n)=>{let r=e.slots=Wd();if(e.vnode.shapeFlag&32){let e=t._;e?(Zd(r,t,n),n&&Ho(r,`_`,e,!0)):Yd(t,r)}else t&&Xd(e,t)},$d=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=oo;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:Zd(i,t,n):(a=!t.$stable,Yd(t,i)),o=t}else t&&(Xd(e,t),o={default:1});if(a)for(let e in i)!Kd(e)&&o[e]==null&&delete i[e]},ef=wu,tf=e=>e.__isSuspense,nf=Symbol(`_deferredEnter`),rf=Symbol.for(`v-fgt`),af=Symbol.for(`v-txt`),of=Symbol.for(`v-cmt`),sf=Symbol.for(`v-stc`),cf=[],lf=null,uf=1,df=({key:e})=>e??null,ff=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:So(e)||Gs(e)||xo(e)?{i:sd,r:e,k:t,f:!!n}:e),J=ju,pf=Xl(),mf=0,hf=null,gf=()=>hf||sd;{let e=Go(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};_f=t(`__VUE_INSTANCE_SETTERS__`,e=>hf=e),vf=t(`__VUE_SSR_SETTERS__`,e=>xf=e)}yf=e=>{let t=hf;return _f(e),e.scope.on(),()=>{e.scope.off(),_f(t)}},bf=()=>{hf&&hf.scope.off(),_f(null)},xf=!1,wf=Symbol(),Tf={get(e,t){return vs(e,`get`,``),t===wf?e:e[t]}},Y=(e,t)=>Zs(e,t,xf),Ef=`3.5.46`}));function Of(e,t,n){let r=e[$f];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}function kf(e,t,n){let r=e.style,i=So(n),a=!1;if(n&&!i){if(t){if(So(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Af(r,t,``)}else for(let e in t)n[e]??Af(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Af(r,i,``):Mf(e,i,!So(t)&&t?t[i]:void 0,o)||Af(r,i,o)}}else if(i){if(t!==n){let e=r[np];e&&(n+=`;`+e),r.cssText=n,a=rp.test(n)}}else t&&e.removeAttribute(`style`);ep in e&&(i&&t===n||(e[ep]=a?r.display:``),e[tp]&&(r.display=`none`))}function Af(e,t,n){if(_o(n))n.forEach(n=>Af(e,t,n));else if(n??=``,t.startsWith(`--`))ip.test(n)?e.setProperty(t,n.replace(ip,``),`important`):e.setProperty(t,n);else{let r=jf(e,t);ip.test(n)?e.setProperty(Lo(r),n.replace(ip,``),`important`):e[r]=n}}function jf(e,t){let n=op[t];if(n)return n;let r=Fo(t);if(r!==`filter`&&r in e)return op[t]=r;r=Ro(r);for(let n=0;n<ap.length;n++){let i=ap[n]+r;if(i in e)return op[t]=i}return t}function Mf(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&So(r)&&n===r}function Nf(e,t,n,r,i,a=Xo(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(sp,t.slice(6,t.length)):e.setAttributeNS(sp,t,n):n==null||a&&!$a(n)?e.removeAttribute(t):e.setAttribute(t,a?``:Co(n)?String(n):n)}function Pf(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?qf(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);r===i&&`_value`in e||(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=$a(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Ff(e,t,n,r){e.addEventListener(t,n,r)}function If(e,t,n,r){e.removeEventListener(t,n,r)}function Lf(e,t,n,r,i=null){let a=e[cp]||(e[cp]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Rf(t);r?Ff(e,n,a[t]=zf(r,i),s):o&&(If(e,n,o,s),a[t]=void 0)}}function Rf(e){let t,n;for(;(n=e.match(lp))&&!up.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):Lo(e.slice(2)),t]}function zf(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(_o(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Jc(e,t,5,a)}}else Jc(r,t,5,[e])};return n.value=e,n.attached=pp(),n}function Bf(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&mp(t)&&xo(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return mp(t)&&So(n)?!1:t in e}function Vf(e,t){let n=e._def.props;if(!n)return!1;let r=Fo(t);return Array.isArray(n)?n.some(e=>Fo(e)===r):Object.keys(n).some(e=>Fo(e)===r)}function Hf(){return bp||=mu(yp)}function Uf(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Wf(e){return So(e)?document.querySelector(e):e}var Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp=t((()=>{if(Df(),Df(),ts(),Gf=void 0,Kf=typeof window<`u`&&window.trustedTypes,Kf)try{Gf=Kf.createPolicy(`vue`,{createHTML:e=>e})}catch{}qf=Gf?e=>Gf.createHTML(e):e=>e,Jf=`http://www.w3.org/2000/svg`,Yf=`http://www.w3.org/1998/Math/MathML`,Xf=typeof document<`u`?document:null,Zf=Xf&&Xf.createElement(`template`),Qf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?Xf.createElementNS(Jf,e):t===`mathml`?Xf.createElementNS(Yf,e):n?Xf.createElement(e,{is:n}):Xf.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>Xf.createTextNode(e),createComment:e=>Xf.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Xf.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Zf.innerHTML=qf(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Zf.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},$f=Symbol(`_vtc`),ep=Symbol(`_vod`),tp=Symbol(`_vsh`),np=Symbol(``),rp=/(?:^|;)\s*display\s*:/,ip=/\s*!important$/,ap=[`Webkit`,`Moz`,`ms`],op={},sp=`http://www.w3.org/1999/xlink`,cp=Symbol(`_vei`),lp=/(Once|Passive|Capture)$/,up=/^on:?(?:Once|Passive|Capture)$/,dp=0,fp=Promise.resolve(),pp=()=>dp||=(fp.then(()=>dp=0),Date.now()),mp=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,hp=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Of(e,r,o):t===`style`?kf(e,n,r):uo(t)?fo(t)||Lf(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Bf(e,t,r,o))?(Pf(e,t,r),e.tagName.includes(`-`)||t!==`value`&&t!==`checked`&&t!==`selected`||Nf(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Vf(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!So(r)))?Pf(e,Fo(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Nf(e,t,r,o))},gp=[`ctrl`,`shift`,`alt`,`meta`],_p={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>gp.some(n=>e[`${n}Key`]&&!t.includes(n))},vp=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=_p[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},yp=po({patchProp:hp},Qf),xp=((...e)=>{let t=Hf().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Wf(e);if(!r)return;let i=t._component;xo(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Uf(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t})})),X=t((()=>{Sp()}));function Cp(){let e=e=>{e.stopPropagation(),e.preventDefault(),t()},t=()=>{document.removeEventListener(`click`,e,!0),document.removeEventListener(`pointerdown`,t,!0)};document.addEventListener(`click`,e,!0),document.addEventListener(`pointerdown`,t,!0)}function wp(e){Dd(()=>document.addEventListener(`pointerdown`,e,!0)),Ad(()=>document.removeEventListener(`pointerdown`,e,!0))}function Tp(e=document,t){return[...e.querySelectorAll(Ap)].some(e=>!t||!e.matches(t))}function Ep(e=document,t=!1){let n=[...e.querySelectorAll(Ap)];for(let e of n)e.dispatchEvent(new CustomEvent(kp,{detail:{escape:t}}));return n.length>0}var Dp,Op,kp,Ap,jp,Mp=t((()=>{X(),Dp=Symbol(`comment-thread-portals`),Op=new WeakSet,kp=`comments:shake`,Ap=`[data-slot='comment-composer'][data-dirty='true']`,jp=e=>e.composedPath().filter(e=>e instanceof Element)}));function Np(e){let t;return{listen(e){let t=()=>e(`online`),n=()=>e(`offline`),r=()=>e(document.visibilityState===`hidden`?`hidden`:`visible`);return window.addEventListener(`online`,t),window.addEventListener(`offline`,n),document.addEventListener(`visibilitychange`,r),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n),document.removeEventListener(`visibilitychange`,r)}},isVisible:()=>document.visibilityState!==`hidden`,isOnline:()=>navigator.onLine!==!1,lock(e,t){let n=navigator.locks;return n?n.request(e,t):t()},lead(e,t){let n=new AbortController,r=()=>n.signal.aborted?Promise.resolve():t(n.signal),i=navigator.locks;return i?i.request(e,{signal:n.signal},r).catch(()=>void 0):r(),()=>n.abort()},post(n){t?t.postMessage(n):Pp(e.channel,n)},receive(n){if(typeof BroadcastChannel!=`function`)return()=>void 0;let r=new BroadcastChannel(e.channel);return t=r,r.onmessage=t=>{e.isMessage(t.data)&&n(t.data)},()=>{r.close(),t===r&&(t=void 0)}},schedule(e,t){let n=setTimeout(e,t);return()=>clearTimeout(n)},random:Math.random}}function Pp(e,t){if(typeof BroadcastChannel!=`function`)return;let n=new BroadcastChannel(e);n.postMessage(t),n.close()}function Fp(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Ip(e,t){let n=Math.min(3e4,1e3*2**e);return n/2+t*n/2}var Lp=t((()=>{}));async function Rp(e,t){let n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(JSON.stringify([e,t]))));return`message_${Array.from(n.subarray(0,16),e=>e.toString(16).padStart(2,`0`)).join(``)}`}var zp=t((()=>{}));function Bp(e){return e.status!==`sending`&&!e.uncertain}function Vp(e){if(!e||typeof e!=`object`)return!1;let t=Reflect.get(e,`type`);if(typeof Reflect.get(e,`account`)!=`string`)return!1;if(t===`change`)return!0;let n=Reflect.get(e,`kind`);return t===`sent`&&(n===`create`||n===`reply`)&&typeof Reflect.get(e,`id`)==`string`&&typeof Reflect.get(e,`key`)==`string`&&!!Reflect.get(e,`thread`)}function Hp(e){let t=JSON.parse(JSON.stringify(e.input)),n=e.kind===`reply`&&e.subject?{kind:e.subject.kind,id:e.subject.id}:void 0;return{...e,input:t,files:[...e.files],...n?{subject:n}:{},...e.uploaded?{uploaded:[...e.uploaded]}:{},...e.error?{error:{...e.error}}:{}}}function Up(e){return e.sort((e,t)=>e.order-t.order)}function Wp(){let e=new Map;return{persisted:!1,async list(t){return Up([...e.get(t)?.values()??[]].map(Hp))},async update(t,n){let r=new Map([...e.get(t)??[]].map(([e,t])=>[e,Hp(t)])),i=n(r);return e.set(t,new Map([...r].map(([e,t])=>[e,Hp(t)]))),i}}}function Gp(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onabort=()=>n(e.error??Error(`The IndexedDB transaction was aborted.`)),e.onerror=()=>n(e.error??Error(`The IndexedDB transaction failed.`))})}function Kp(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error??Error(`The IndexedDB request failed.`))})}function qp(e){return new Promise((t,n)=>{let r=indexedDB.open(e,$p);r.onupgradeneeded=e=>{let t=r.result.createObjectStore(`drafts`,{keyPath:[`account`,`id`]});if(t.createIndex(`account`,`account`),e.oldVersion===1&&r.transaction){let e=r.transaction.objectStore(`outbox`).openCursor();e.onsuccess=()=>{let n=e.result;if(!n){r.result.deleteObjectStore(`outbox`);return}let i=n.value;t.put({...i,id:i.requestId,uncertain:!0}),n.continue()}}},r.onsuccess=()=>{let e=r.result;e.onversionchange=()=>e.close(),t(e)},r.onerror=()=>n(r.error??Error(`IndexedDB did not open.`)),r.onblocked=()=>n(Error(`IndexedDB is blocked by another tab.`))})}function Jp(e){let t,n=typeof indexedDB<`u`,r=()=>t??=(n?qp(e):Promise.reject(Error(`No IndexedDB.`))).then(e=>({database:e}),()=>(n=!1,{memory:Wp()})),i=async(e,t)=>{let n=await r();return`database`in n?t(n.database):e(n.memory)};return{get persisted(){return n},list:e=>i(t=>t.list(e),async t=>Up(await Kp(t.transaction(`drafts`,`readonly`).objectStore(`drafts`).index(`account`).getAll(e)))),update:(e,t)=>i(n=>n.update(e,t),async n=>{let r=n.transaction(`drafts`,`readwrite`),i=r.objectStore(`drafts`),a=i.index(`account`).getAll(e),o=Gp(r),s=new Promise((n,o)=>{a.onsuccess=()=>{let s=new Map(a.result.map(e=>[e.id,e])),c=new Map(s);try{let r=t(c);for(let t of s.keys())c.has(t)||i.delete([e,t]);for(let[e,t]of c)s.get(e)!==t&&i.put(Hp(t));n(r)}catch(e){o(e),r.abort()}},a.onerror=()=>o(a.error)});return(await Promise.all([s,o]))[0]})}}function Yp(e){let t=t=>e&&typeof e==`object`?Reflect.get(e,t):void 0,n=t(`status`),r=t(`code`),i=t(`why`)??t(`message`),a=t(`fix`),o=t(`retryAfter`);return{status:typeof n==`number`?n:0,why:typeof i==`string`&&i?i:String(e),...typeof r==`string`?{code:r}:{},...typeof a==`string`?{fix:a}:{},...typeof o==`number`&&o>=0?{retryAfter:o}:{}}}function Xp(e){return e===401||e===402?`hold`:e===408||e===429?`wait`:e>=400&&e<500?`fail`:`wait`}function Zp(e,t){let{account:n,namespace:r}=e,i=r===void 0?Qp:`${Qp}:${JSON.stringify(r)}`,a=!!(e.environment||globalThis.navigator?.locks),o=!(!e.store||a),s=e.store??(a?Jp(i):Wp()),c=e.environment??Np({channel:i,isMessage:Vp}),l=r===void 0?n:JSON.stringify([r,n]),u=e.store?l:n,d=`vitehub-comments-outbox:${l}`,f=e=>`vitehub-comments-files:${l}:${e}`,p=[],m=[],h=new Map,g=new Map,_=new Map,v=new Map,y=e=>v.get(e)??e,b=new Set,x=()=>{for(let e of b)e()},S=new Set,C=0,w=new Map,T=new Map,E=e=>e.kind===`create`?JSON.stringify([e.kind,e.input.subject.kind,e.input.subject.id,e.requestId]):JSON.stringify([e.kind,e.input.threadId,e.requestId]),D=(e,t)=>JSON.stringify([e,t]),O=new Map,k=Promise.resolve(),A,ee=!1,j=!1,M,N=e=>c.post(e),te=()=>k=k.catch(()=>void 0).then(async()=>{let e=[...h].flatMap(([e,t])=>t.saved?[e]:[]),t=await s.list(u),n=new Map;globalThis.crypto?.subtle&&await Promise.all(t.map(async e=>{if(e.kind!==`reply`)return;let t=I(e.input.threadId),r=D(t,e.requestId);n.set(r,O.get(r)??await Rp(t,e.requestId))})),O=n,m=t;for(let t of e)h.delete(t);P()}),P=()=>{let e=new Set(m.map(e=>e.id));p=Up([...m,...[...h.values()].flatMap(t=>e.has(t.entry.id)||t.duplicate?[]:[t.entry])]).map(e=>{let t=_.get(e.id);return t?{...e,status:`failed`,files:[...e.files,...t.files],error:t.error}:e}),re(!s.persisted&&p.length>0||_.size>0||[...h.values()].some(e=>!e.saved)),t.changed(),x()},ne=!1,F=e=>{e.preventDefault(),Reflect.set(e,`returnValue`,``)},re=e=>{e!==ne&&typeof globalThis.addEventListener==`function`&&(ne=e,e?globalThis.addEventListener(`beforeunload`,F):globalThis.removeEventListener(`beforeunload`,F))},ie=async()=>{await te(),N({type:`change`,account:l})},ae=e=>{for(let n of t.threads())if(n.id===e)return n},I=e=>{let t=y(e);return w.get(t)?.id??t},oe=e=>({status:e.status===`failed`?`failed`:`pending`,requestId:e.requestId,files:e.files,...e.error?{error:e.error}:{}}),L=()=>t.user?.id===n?t.user:{id:n},se=(e,t)=>({id:e.id,threadId:t,body:e.input.body,author:L(),mentions:e.input.mentions??[],attachments:e.input.attachments??[],createdAt:e.createdAt,delivery:oe(e)}),ce=e=>{let t=new Map;for(let e of p){if(e.kind!==`reply`)continue;let n=I(e.input.threadId);t.set(n,[...t.get(n)??[],e])}let r=e=>{let r=t.get(e.id);if(!r)return e;let i=new Set(e.messages.filter(e=>e.author.id===n).map(e=>e.id)),a=r.filter(t=>{let n=e.delivery?void 0:O.get(D(e.id,t.requestId));return!(n&&i.has(n))}).map(t=>se(t,e.id));return a.length?{...e,messages:[...e.messages,...a]}:e},i=e.map(r),a=[];for(let t of p)t.kind!==`create`||w.has(t.id)||e.some(e=>le(t,e))||a.push(r(ue(t)));return{server:i,local:a}},le=(e,t)=>t.requestId===e.requestId&&t.author.id===n&&t.subject.kind===e.input.subject.kind&&t.subject.id===e.input.subject.id,ue=e=>{let{input:t}=e;return{id:e.id,scope:``,n:0,subject:t.subject,anchor:t.anchor,status:`open`,author:L(),messages:[se(e,e.id)],...t.metadata===void 0?{}:{metadata:t.metadata},...t.revision===void 0?{}:{revision:t.revision},createdAt:e.createdAt,updatedAt:e.createdAt,requestId:e.requestId,delivery:oe(e)}},de=e=>{let t=new Set([...e,...[...h.values()].map(e=>e.entry)].flatMap(e=>e.kind===`create`?[e.id]:[]));return e.find(e=>e.status!==`failed`&&!(e.kind===`reply`&&t.has(e.input.threadId)))},fe=e=>[...h.values()].some(t=>!t.saved&&!t.parked&&t.entry.status!==`failed`&&t.entry.order<e),pe=e=>new Promise(t=>{e.aborted?t():e.addEventListener(`abort`,()=>t(),{once:!0})}),me=e=>{M?.(),M=c.schedule(()=>{M=void 0,_e()},e)},R=e=>s.update(u,e),he=async e=>{let r=t=>R(n=>{let r=n.get(e.id);if(r&&r.claim===e.claim)return t(r,n)}),i,a=!1,o={account:n,async uploaded(t){if(!await r((n,r)=>r.set(e.id,{...n,uploaded:[...n.uploaded??[],t]})))throw new DOMException(`This draft is no longer in the outbox.`,`AbortError`)}};try{let n={files:e.files.slice(e.uploaded?.length??0),outbox:o},s=[...e.input.attachments??[],...e.uploaded??[]],c={...n,requestId:e.requestId,...s.length?{attachments:s}:{}};if(e.kind===`create`){if(!await r(()=>!0))return;a=!0,i=await t.transport.create({...e.input,...c})}else{let o=I(e.input.threadId),s=e.subject??ae(o)?.subject??(n.files?.length?(await t.transport.get({threadId:o}))?.subject:void 0);if(n.files?.length&&!s)throw Object.assign(Error(`The thread for this reply does not exist.`),{status:404});if(!await r(()=>!0))return;a=!0,i=await t.transport.reply({...e.input,...c,threadId:o,...s?{subject:s}:{}})}}catch(t){let n=qi.get(o),i=n!==void 0&&Object.is(n.cause,t),{retryAfter:s,...l}=Yp(t),u=Xp(l.status),d=e.attempts??0;await r((t,n)=>n.set(e.id,{...t,status:u===`fail`?`failed`:`pending`,uncertain:e.uncertain||a&&!i&&u===`wait`&&l.status!==429,held:u===`hold`,retryAt:u===`wait`?Date.now()+Math.max(1,s??Ip(d,c.random())):void 0,attempts:d+1,error:l}))&&await ie();return}if(!await r((t,n)=>{if(t.kind===`create`)for(let t of n.values())t.kind===`reply`&&t.input.threadId===e.id&&n.set(t.id,{...t,subject:i.subject,input:{...t.input,threadId:i.id}});return n.delete(e.id)}))return;let s=E(e);e.kind===`create`&&w.set(e.id,i),T.set(s,i),t.upsert(i),await te(),N({type:`sent`,account:l,id:e.id,kind:e.kind,key:s,thread:i})},ge=async e=>{for(M?.(),M=void 0;!e.aborted&&c.isOnline();){let t=Fp(),n=await R(n=>{if(e.aborted)return;let r=de(Up([...n.values()]));if(!r||r.held||fe(r.order))return;if(r.awaitingFiles)return{files:r.id};let i=(r.retryAt??0)-Date.now();if(i>0)return{delay:i};let a={...r,claim:t,status:`sending`,uncertain:r.uncertain||r.status===`sending`};return n.set(r.id,a),{claimed:a}});if(!n)return;if(`delay`in n){me(n.delay);return}if(`files`in n){if(o||g.has(n.files)||(await Promise.race([c.lock(f(n.files),async()=>void 0),pe(e)]),e.aborted))return;await R(e=>{let t=e.get(n.files);t?.awaitingFiles&&!g.has(t.id)&&e.set(t.id,{...t,awaitingFiles:!1})}),await ie()}else await te(),await he(n.claimed)}};function _e(){if(j)return;if(A){ee=!0;return}let e={giveUp:()=>void 0};A=e,e.giveUp=c.lead(d,async t=>{try{do ee=!1,await ge(t);while(ee&&!t.aborted)}finally{A===e&&(A=void 0)}})}let ve=e=>{let t=h.get(e);if(!t)return Promise.resolve();let n=Promise.resolve().then(async()=>{t.parked=!1;let r=[t];try{if(await R(i=>{if(h.get(e)!==t)return!1;t.entry.kind===`reply`&&(t.entry={...t.entry,input:{...t.entry.input,threadId:I(t.entry.input.threadId)}});let a=t.entry.kind===`reply`?h.get(t.entry.input.threadId):void 0;if(a&&!a.saved&&!i.has(a.entry.id))return!0;let o=t.entry.order;for(let e of i.values())S.has(e.id)||(o=Math.max(o,e.order+1));let s=[...h.values()].filter(e=>e!==t&&!i.has(e.entry.id)&&e.entry.order>t.entry.order),c=o;for(let e of s.sort((e,t)=>e.entry.order-t.entry.order))c=Math.max(e.entry.order,c+1),e.entry={...e.entry,order:c};C=Math.max(C,c),t.entry={...t.entry,order:o},r=[t,...[...h.values()].filter(t=>t.parked&&t.entry.kind===`reply`&&t.entry.input.threadId===e)];for(let e of r)e.write??=n;let l=new Map([...i.values()].map(e=>[E(e),e]));for(let e of r){e.entry.kind===`reply`&&(e.entry={...e.entry,input:{...e.entry.input,threadId:I(e.entry.input.threadId)}});let t=E(e.entry),n=l.get(t);n?(e.duplicate=n,v.set(e.entry.id,n.id)):(i.set(e.entry.id,e.entry),l.set(t,e.entry))}return!1})){t.parked=!0;return}}catch(e){t.entry={...t.entry,status:`failed`,error:Yp(e)},P(),_e();return}finally{for(let e of r)e.write===n&&(e.write=void 0)}for(let e of r)Object.assign(e,{saved:!0,parked:!1});await ie().catch(()=>void 0),_e()});return t.write=n,n},ye=()=>{let e=[...h.values()];if(e.some(e=>e.write))return;let t=e.find(e=>!e.saved&&!e.parked&&e.entry.status===`pending`);t&&!t.entry.awaitingFiles&&ve(t.entry.id).then(ye)},be=e=>o?(e.parked=!1,ye(),e.write??Promise.resolve()):ve(e.entry.id),xe=(e,t)=>{let n=t!==void 0&&!Array.isArray(t),r=Math.max(Date.now(),C+1,...p.map(e=>e.order+1));C=r,S.add(e.id);let i={entry:Hp({...e,order:r,...n?{awaitingFiles:!0}:{}}),saved:!1};return h.set(e.id,i),n&&Ce(e.id,Promise.resolve(t)),P(),{local:i,write:be(i)}},Se=(e,t)=>{let n=p.find(t=>E(t)===E(e));if(!n)return{entry:e,...xe(e,t)};let r=h.get(n.id);return{entry:n,local:r,write:r?.write}},Ce=(e,t)=>{let n=c.lock(f(e),async()=>{let n=await t.then(e=>[...e],()=>[]),r=h.get(e);await r?.write;let i=e=>({...e,files:[...e.files,...n],awaitingFiles:!1});if(r&&!r.saved)r.entry=i(r.entry),P(),o&&ye();else for(;g.has(e);)try{await R(t=>{let n=t.get(e);n?.awaitingFiles&&t.set(e,i(n))});break}catch(t){if(!g.has(e))break;let r=new Promise(r=>{_.set(e,{files:n,error:Yp(t),resume:r})});P(),await r}}).catch(()=>void 0).then(async()=>{g.delete(e),_.delete(e),await ie().catch(()=>void 0),_e()});g.set(e,n)},we=async e=>{await h.get(e)?.write;let t=h.get(e);return t&&!t.saved?t:void 0},Te=(e,t)=>{let r=Date.now(),i=Fp();return{id:i,requestId:e??i,account:n,files:Array.isArray(t)?[...t]:[],createdAt:r,order:r,status:`pending`}};return te(),{get entries(){return p},get queued(){return p.filter(e=>e.status!==`failed`)},get failures(){return p.filter(e=>e.status===`failed`)},get persisted(){return s.persisted},overlay:ce,owns:(e,t)=>p.some(n=>n.id===y(t??e)),async beforeResolve(e){for(await te();;){let t=I(e),n=p.filter(e=>e.id===t||e.kind===`reply`&&I(e.input.threadId)===t);if(!n.length)return t;if(j||!c.isOnline()||n.some(e=>e.held||e.status===`failed`||e.retryAt!==void 0)||p.some(e=>e.held))return;await new Promise(e=>{let t=()=>{b.delete(t),e()};b.add(t)})}},async create({files:e,deferredFiles:n,requestId:r,...i}){let a={...Te(r,e),kind:`create`,input:i},o=()=>T.get(E(a))??[...t.threads()].find(e=>le(a,e)),s=o();if(s)return s;let c=Se(a,n??e);if(r!==void 0){await c.write;let e=o();if(e)return e}let l=c.local?.duplicate??p.find(e=>e.id===c.entry.id)??c.entry;return ue(l.kind===`create`?l:a)},async reply({files:e,deferredFiles:t,requestId:n,subject:r,...i}){let a=I(i.threadId),o=p.find(e=>e.kind===`create`&&e.id===a),s=ae(a),c=r??s?.subject??(o?.kind===`create`?o.input.subject:void 0),l={...Te(n,e),kind:`reply`,input:{...i,threadId:a},...c?{subject:c}:{}},u=T.get(E(l));if(u)return ae(u.id)??u;let d=Se(l,t??e);n!==void 0&&await d.write;let f=d.local?.duplicate??d.local?.entry??d.entry,m=T.get(E(f));if(m)return ae(m.id)??m;let h=I(a),g=ae(h)??s;return g?ce([g]).server[0]??g:ce([]).local.find(e=>e.id===h)||{id:h,scope:``,n:0,subject:c??{kind:``,id:``},anchor:{kind:`page`},status:`open`,author:L(),messages:[se(f,h)],createdAt:l.createdAt,updatedAt:l.createdAt}},async retry(e){if(e!==void 0){e=y(e);let t=_.get(e);if(t){t.resume();return}}let t=e===void 0?void 0:await we(e);t?(t.entry={...t.entry,status:`pending`,error:void 0},P(),await be(t)):(await R(t=>{for(let n of t.values())n.status===`sending`||e!==void 0&&n.id!==e||(n.status!==`failed`||e!==void 0)&&t.set(n.id,{...n,status:`pending`,held:!1,attempts:0,retryAt:void 0,error:void 0})}),await ie(),_e())},async dismiss(e){if(e=y(e),await we(e)){for(let[t,n]of h)(t===e||n.entry.kind===`reply`&&n.entry.input.threadId===e)&&h.delete(t);return await R(t=>{for(let n of t.values())n.kind===`reply`&&n.input.threadId===e&&t.delete(n.id)}),await ie(),o&&ye(),_e(),!0}let t=await R(t=>{let n=t.get(e);if(!n||!Bp(n))return!1;if(n.kind===`create`)for(let n of t.values())n.kind===`reply`&&n.input.threadId===e&&t.delete(n.id);return t.delete(e)});return t&&(g.delete(e),_.get(e)?.resume(),await ie(),_e()),t},async edit(e,t,n){e=y(e);let r=await we(e);if(r){let e={...r.entry.input,body:t,...n?{mentions:n}:{}};return r.entry={...r.entry,input:e,status:`pending`,error:void 0},P(),await be(r),!0}let i=await R(r=>{let i=r.get(e);if(!i||!Bp(i))return!1;let a={body:t,...n?{mentions:n}:{}};return i.kind,r.set(e,{...i,input:{...i.input,...a},status:`pending`,error:void 0}),!0});return i&&(await ie(),_e()),i},async clear(){M?.(),M=void 0,h.clear(),await R(e=>e.clear()),g.clear();for(let e of _.values())e.resume();_.clear(),v.clear(),w.clear(),T.clear(),await ie()},start(){j=!1;let e=[c.listen(e=>{e===`offline`&&x(),(e===`online`||e===`visible`)&&R(e=>{for(let t of e.values())t.status===`pending`&&t.retryAt!==void 0&&e.set(t.id,{...t,retryAt:void 0})}).then(ie).then(_e)}),c.receive(e=>{e.account===l&&(e.type===`sent`&&(e.kind===`create`&&w.set(e.id,e.thread),T.set(e.key,e.thread),t.upsert(e.thread)),te())})];return te(),_e(),()=>{for(let t of e.splice(0))t();j=!0,x(),M?.(),M=void 0,A?.giveUp(),A=void 0}}}}var Qp,$p,em=t((()=>{Lp(),Ji(),zp(),Qp=`vitehub-comments`,$p=2}));function tm(e,t,n,{thread:r,message:i}){if(!e)return!1;let a=r.can??{comment:!!t?.comment,resolve:!!t?.resolve,delete:!!t?.delete};if(n===`reply`)return r.status===`open`&&a.comment;if(n===`resolve`)return a.resolve;let o=t=>!e.guest&&!t.author.guest&&t.author.id===e.id;return!i||t?.change===!1?!1:n===`edit`?o(i):(r.messages[0]?.id===i.id?r.messages.every(o):o(i))?a.comment:a.delete===!0&&!e.guest}function nm(){let e=typeof __VITEHUB_APP_BASE_URL__>`u`?`/`:__VITEHUB_APP_BASE_URL__;return e.startsWith(`/`)&&!e.startsWith(`//`)?e.replace(/\/+$/,``):``}var rm=t((()=>{}));function im(e){return e&&hm.test(e)?e:void 0}function am(e,t){return e.length>t?`${e.slice(0,t).trimEnd()}…`:e}function om(e,t){return e.kind===`page`?`on the whole page`:e.kind===`text`?`on the text "${am(e.exact,t)}" in ${am(e.selector,t)}`:`on ${am(e.selector,t)}`}function sm(e,t){let[n,...r]=e.messages,i=e.revision===void 0?``:` (version ${e.revision})`;return[`"${am(n?.body??``,t)}" — ${n?.author??`Someone`}, ${om(e.anchor,t)}${i}`,...r.map(e=>`Reply: "${am(e.body,t)}" — ${e.author}`),...e.files?.length?[`Files: ${e.files.join(` `)}`]:[]]}function cm(e,t){if(!e)return[`When you are done, tell me what you changed.`];let{mcp:n,project:r,resolve:i}=e,a=`operation "comments.get", and input { threadId } for ${t.length===1?`thread ${t[0]}`:`each ID in ${JSON.stringify(t)}`}`;return[`In the ViteHub MCP (${n}), use list_apps to verify team ${r.teamId} and app ${r.url} (id: ${r.id}). If the team is different, ask me to switch to that team in the Console; if the app is missing, ask me to check the link. Only after both match, call read_operation with the app id, ${a}.`,i?`When the fix is live, use run_operation with the app id, operation "comments.resolve", and input { threadId, reply }. In the reply, say what you changed.`:`Report the fixes to me without resolving the threads.`]}function lm(e){return`${e.id}: "${am(e.messages[0]?.body??``,gm)}"`}function um({agent:e,threads:t,url:n},r){let i=new URL(n).href,a=t.length===1,o=cm(e,t.map(e=>e.id)),s=a?`Fix this comment on ${i}`:`Fix these ${t.length} comments on ${i}`;return r===`ids`?[s,...o].join(`
135
+
136
+ `):r===`titles`?[s,t.map((e,t)=>a?lm(e):`${t+1}. ${lm(e)}`).join(`
137
+ `),...o].join(`
138
+
139
+ `):a?[s,...sm(t[0],r),...o].join(`
140
+ `):[s,...t.map((e,t)=>sm(e,r).map((e,n)=>n===0?`${t+1}. ${e}`:` ${e}`).join(`
141
+ `)),o.join(`
142
+ `)].join(`
143
+
144
+ `)}function dm(e){return um(e,1/0)}function fm(e,t){let n=im(t),r=t=>{let r=new URL(mm);return r.searchParams.set(`prompt`,um(e,t)),n&&r.searchParams.set(`repo`,n),r.href},i=[1/0];for(let e=2e3;e>=gm;e=Math.floor(e/2))i.push(e);for(let t of[...i,`titles`,...e.agent?[`ids`]:[]]){let e=r(t);if(e.length<=8e3)return e}}function pm(e){let{agent:t,threads:n,url:r}=e;if(!t)return dm(e);let i=new URL(r),a=n.length===1?`a comment`:`${n.length} comments`,o=t.project.name?`"${t.project.name}" (${new URL(t.project.url).host})`:new URL(t.project.url).host,s=n.map(e=>e.id);return[`I left ${a} on ${i.href}`,`In the ViteHub Console, open app ${o} through the ViteHub MCP (${t.mcp}): find it with list_apps (id: ${t.project.id}, team ${t.project.teamId}; if it is missing, ask me to switch team), then call read_operation with the app id, operation "comments.get", and input { threadId } for each ID in ${JSON.stringify(s)}.`,t.resolve?`Fix each comment, then resolve it with run_operation, the app id, operation "comments.resolve", and input { threadId, reply }. Say what you changed in the reply.`:`Fix each comment and tell me what you changed.`].join(`
145
+ `)}var mm,hm,gm,_m=t((()=>{mm=`https://app.t3.codes/new`,hm=/^[A-Za-z0-9][A-Za-z0-9-]{0,38}\/(?!\.+$)[A-Za-z0-9._-]{1,100}$/,gm=40}));function vm(e,t){return t>0?Ym(Math.round(e/t*1e3)):0}function ym(e){return e.nodeType===9?e:e.ownerDocument}function bm(e){let t=e.getRootNode();return t.nodeType===11?t:ym(e)??document}function xm(e){return`"${e.replace(/["\\]/g,`\\$&`)}"`}function Sm(e,t){if(t===`:scope`&&e.nodeType===1)return[e];try{return[...e.querySelectorAll(t)]}catch{return[]}}function Cm(e,t,n){let r=Sm(e,t);return r.length===1&&r[0]===n}function wm(e){if(Xm.some(t=>t.test(e)))return!0;let t=e.replace(/\D/g,``).length;return e.length>=6&&t/e.length>.5}function Tm(e,t){let n=[],r=e.getAttribute(`data-comment-id`);r&&n.push(`[data-comment-id=${xm(r)}]`);let i=e.getAttribute(`id`);i&&!wm(i)&&n.push(/^[A-Za-z][\w-]*$/.test(i)?`#${i}`:`[id=${xm(i)}]`);let a=e.getAttribute(`data-testid`);return a&&n.push(`[data-testid=${xm(a)}]`),n.find(n=>Cm(t,n,e))}function Em(e){let t=e.localName,n=e.parentElement;if(!n)return t;let r=[...n.children].filter(e=>e.localName===t);return r.length>1?`${t}:nth-of-type(${r.indexOf(e)+1})`:t}function Dm(e,t=bm(e)){if(e===t)return`:scope`;let n=Tm(e,t);if(n)return n;let r=[],i=e;for(;i&&i!==t;){let n=i===e?void 0:Tm(i,t);r.unshift(n??Em(i));let a=r.join(` > `);if(n||Cm(t,a,e))return a;i=i.parentElement}return r.join(` > `)}function Om(e){let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{left:t,top:n,width:r,height:i}}function km(e,t){let n=t.root,r=n?.nodeType===11?n:n&&ym(n)||document;return(typeof r.elementsFromPoint==`function`?r.elementsFromPoint(e.x,e.y):[r.elementFromPoint(e.x,e.y)]).find(e=>e!==null&&(!n||n.contains(e))&&!t.ignore?.(e))}function Am(e,t=[]){for(let n of e.childNodes)n.nodeType===3?t.push(n):n.nodeType===1&&Am(n,t);return t}function jm(e,t,n){let r=0,i=t.nodeType===3?void 0:t.childNodes[n];for(let a of Am(e)){if(t.nodeType===3){if(a===t)return r+n}else if(i?a===i||i.compareDocumentPosition(a)&Zm:!t.contains(a)&&t.compareDocumentPosition(a)&Zm)break;r+=a.data.length}return r}function Mm(e){return`rangeCount`in e?e.rangeCount>0&&!e.isCollapsed?e.getRangeAt(0):void 0:e.collapsed?void 0:e}function Nm(e){return e.nodeType===1?e:e.parentElement}function Pm(e,t){let n=Mm(e),r=n?.toString()??``,i=n&&Nm(n.commonAncestorContainer);if(!n||!i||r===``)throw xi.COMMENTS_R0001({target:`an empty selection`});let a=Fm(i,t)??i;if(t.root&&(!t.root.contains(n.startContainer)||!t.root.contains(n.endContainer)||!t.root.contains(a)))throw xi.COMMENTS_R0001({target:`a selection outside the configured root`});let o=jm(a,n.startContainer,n.startOffset),s=Am(a).map(e=>e.data).join(``),c=t.context??Jm;return{kind:`text`,selector:Dm(a,t.root??bm(a)),exact:r,prefix:s.slice(Math.max(0,o-c),o),suffix:s.slice(o+r.length,o+r.length+c)}}function Fm(e,t){let n=e;for(;n&&t.ignore?.(n);)n=n.parentElement;return n??void 0}function Im(e){return e.localName===`img`}function Lm(e,t,n){if(t.root&&!t.root.contains(e))throw xi.COMMENTS_R0001({target:`an element outside the configured root`});let r=Om(e),i=Dm(e,t.root??bm(e)),a=Im(e)?`image`:void 0;if(t.area){let e=vm(t.area.left-r.left,r.width),n=vm(t.area.top-r.top,r.height),o={selector:i,x:e,y:n,width:Math.max(0,vm(t.area.left+t.area.width-r.left,r.width)-e),height:Math.max(0,vm(t.area.top+t.area.height-r.top,r.height)-n)};if(o.width>0&&o.height>0)return a?{kind:a,...o}:{kind:`area`,...o}}let o=n?vm(n.x-r.left,r.width):500,s=n?vm(n.y-r.top,r.height):500;return a?{kind:a,selector:i,x:o,y:s}:{kind:`element`,selector:i,x:o,y:s}}function Rm(e,t={}){if(e===`page`)return{kind:`page`};if(`nodeType`in e)return Lm(e,t,t.point);if(`rangeCount`in e||`startContainer`in e)return Pm(e,t);let n=km(e,t);if(!n)throw xi.COMMENTS_R0001({target:`the point ${Math.round(e.x)}, ${Math.round(e.y)}`});return Lm(n,t,e)}function zm(e,t){let n=[];for(let r=e.indexOf(t.exact);r!==-1;r=e.indexOf(t.exact,r+1)){let i=e.slice(0,r),a=e.slice(r+t.exact.length),o=0;for(;o<t.prefix.length&&i.at(-1-o)===t.prefix.at(-1-o);)o++;let s=0;for(;s<t.suffix.length&&a[s]===t.suffix[s];)s++;n.push({start:r,score:o+s,ambiguous:!1})}if(n.length===1)return n[0];let r=Math.min(Qm,t.prefix.length+t.suffix.length),i=n.reduce((e,t)=>!e||t.score>e.score?t:e,void 0);if(!(!i||r===0||i.score<r))return{...i,ambiguous:n.filter(e=>e.score===i.score).length>1}}function Bm(e,t,n){let r=0;for(let i of e){let e=r+i.data.length;if(n?t>r&&t<=e:t>=r&&t<e)return{node:i,offset:t-r};r=e}let i=e.at(-1);return i&&t===r?{node:i,offset:i.data.length}:void 0}function Vm(e){return e.width>0||e.height>0}function Hm(e){let t=ym(e)?.defaultView;for(let n=e;n;n=n.parentElement){let e=t?.getComputedStyle(n).display??`block`;if(!e.startsWith(`inline`)&&e!==`contents`)return n}return e}function Um(e,t){let n=Am(t),r=zm(n.map(e=>e.data).join(``),e);if(!r)return;let i=r.start,a=Bm(n,i,!1),o=Bm(n,i+e.exact.length,!0),s=Om(t),c=s,l=s;if(a&&o){let e=(ym(t)??document).createRange();if(e.setStart(a.node,a.offset),e.setEnd(o.node,o.offset),typeof e.getBoundingClientRect==`function`){let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();Vm({left:t,top:n,width:r,height:i})&&(c={left:t,top:n,width:r,height:i})}let n=(typeof e.getClientRects==`function`?[...e.getClientRects()].filter(Vm):[]).at(-1);l=n?{left:n.left,top:n.top,width:n.width,height:n.height}:c}if(!Vm(c))return;let u=ym(t)?.defaultView,d=Om(Hm(t)),f=Math.min(Math.max(d.left+d.width,l.left+l.width)+$m,(u?.innerWidth??1/0)-eh),p=l.top+l.height/2;return{position:{clipped:Gm(t,l.left+Math.max(0,l.width-1),p),detached:!1,kind:`text`,x:f,y:p,width:c.width,height:c.height,element:t},score:r.score,ambiguous:r.ambiguous}}function Wm(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}function Gm(e,t,n){let r=e.ownerDocument.defaultView;if(!r)return!1;for(let i=Wm(e);i;i=Wm(i)){let{overflow:e,overflowX:a,overflowY:o}=r.getComputedStyle(i);if(![e,a,o].some(e=>e!==``&&e!==`visible`))continue;let s=Om(i);if(Vm(s)&&(t<s.left-1||t>s.left+s.width+1||n<s.top-1||n>s.top+s.height+1))return!0}return!1}function Km(e,t=document){let n;for(let r of Sm(t,e.selector)){let t=Am(r),i=zm(t.map(e=>e.data).join(``),e),a=i&&Bm(t,i.start,!1),o=i&&Bm(t,i.start+e.exact.length,!0);if(!i||!a||!o)continue;if(n&&i.score===n.score){n.ambiguous=!0;continue}if(n&&i.score<n.score)continue;let s=(ym(r)??document).createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset),n={range:s,score:i.score,ambiguous:i.ambiguous}}return n&&!n.ambiguous?n.range:void 0}function qm(e,t=document){if(e.kind===`page`)return{clipped:!1,detached:!1,kind:`page`,x:0,y:0,width:0,height:0};let n=Sm(t,e.selector);if(e.kind===`text`){let t;for(let r of n){let n=Um(e,r);n&&(!t||n.score>t.score)?t=n:n&&t&&n.score===t.score&&(t.ambiguous=!0)}return t&&!t.ambiguous?t.position:{detached:!0}}let r=n.length===1?n[0]:void 0;if(!r)return{detached:!0};let i=Om(r);if(!Vm(i))return{detached:!0};let a=`width`in e&&e.width?e.width/1e3*i.width:0,o=`height`in e&&e.height?e.height/1e3*i.height:0,s=i.left+e.x/1e3*i.width,c=i.top+e.y/1e3*i.height;return{clipped:Gm(r,s,c),detached:!1,kind:e.kind,x:s,y:c,width:a,height:o,element:r}}var Jm,Ym,Xm,Zm,Qm,$m,eh,th=t((()=>{Si(),Jm=32,Ym=e=>Math.min(1e3,Math.max(0,e)),Xm=[/^:[\w-]+:$/,/^«[^»]*»$/,/^_r_[\w-]+_$/,/^radix-/,/^headlessui-/,/^reka-/,/^v-\d/,/^data-v-/,/^ember\d/,/^[\da-f-]{8,}$/i],Zm=4,Qm=4,$m=8,eh=30}));function nh(e,t={}){let n=t.pairingInterval??1500,r=t.statusInterval??5e3,i=t.sentFor??2e3,a=new Set,o={status:`idle`,count:0,inbox:!1},s,c=0,l=0,u=``,d=0,f,p=!1,m,h,g=!1,_,v=0,y=0,b,x=0,S=`send`,C=()=>{for(let e of a)e()},w=e=>{v++,clearTimeout(b),b=void 0,o=e,C()},T=(e,t)=>{let n=v;clearTimeout(b),b=setTimeout(()=>n===v&&t(),e)},E=()=>!(!s||s.host),D=()=>o.status===`failed`&&S===`allow`,O=()=>({status:`idle`,count:c,inbox:E(),...s&&c>0?{canPairAnother:!0}:{}}),k=()=>w(O()),A=()=>({status:`sent`,count:c,inbox:g,...s?{agent:s}:{}}),ee=()=>{m=void 0,h=void 0,k()},j=()=>{w({status:`working`,count:c,...s?{agent:s}:{},...h?{thread:h}:{}}),e.subscribe||T(r,()=>void F(j))},M=()=>{w(A()),e.subscribe||T(r,()=>void F(M))},N=()=>o.status===`sent`&&Date.now()<y,te=e=>{w({status:`limited`,count:c,retryAt:e}),T(Math.max(0,e-Date.now()),()=>void F(k))},P=()=>{w({status:`sending`,count:c}),T(r,()=>void F(P,!0))},ne=e=>{if(s=e.agent,e.pending)return P();let t=e.working??e.sent;if(t){e.sent&&(g=e.sent.inbox??E());let n=N()&&m===t.id;return m=t.id,h=n?h??t.thread:t.thread,n?(o=A(),C()):e.working?j():M()}if(m=void 0,h=void 0,e.retryAt!==void 0&&e.retryAt>Date.now())return te(e.retryAt);k()},F=async(t,n=!1)=>{let r=v,i=()=>r===v&&!p&&o.status!==`pairing`&&o.status!==`confirm`&&(o.status!==`sending`||n);if(!i())return;let a=l;try{let t=await e.status();if(!i())return;a===l&&(c=t.count),u=t.selection??``,ne(t)}catch(e){if(!t)throw e;i()&&t()}},re=(e,t,n)=>{let r=_;if(_=void 0,e.status===`changed`)return c=e.count,u=e.selection,n?(f=n.code,w({status:`confirm`,count:c,agent:n.agent})):w({status:`failed`,count:c,reason:`The waiting comments changed.`});if(e.status===`failed`)return w({status:`failed`,count:c,reason:e.reason});if(n&&(s=n.agent),e.status===`limited`)return te(e.retryAt);if(e.status===`pending`)return P();m=e.id;let a=r?.get(e.id);h=a?.thread??e.thread,t===l&&(c=0),g=e.inbox??E(),w(A()),y=Date.now()+i,T(i,a?.done?ee:a?j:()=>void F(M))},ie=t=>void e.cancel(t).catch(()=>void 0),ae=async(t,n)=>{let r=l;_=e.subscribe?new Map:void 0,w({status:`sending`,count:c});let i=v,a;try{a=await t()}catch(e){a={status:`failed`,reason:rh(e)}}let o=i===v;o&&re(a,r,n),n&&(a.status===`failed`||a.status===`limited`||!o&&a.status===`changed`)&&ie(n.code)},I=()=>{T(n,async()=>{if(o.status!==`pairing`||!f)return;if(Date.now()>=o.expiresAt)return w({...o,reason:`expired`});let t=v,n=await e.pollPairing(f).catch(()=>({status:`waiting`}));if(t===v&&o.status===`pairing`){if(n.status===`waiting`)return I();if(n.status===`paired`)return w({status:`confirm`,count:c,agent:n.agent});w({...o,reason:n.status})}})},oe=async t=>{if(p)return;p=!0,S=`pair`;let n=++v;try{let r=e.startPairing(),i=r.then(e=>e.prompt);i.catch(()=>void 0);let a=(async()=>!t||t(i))().then(e=>({ok:e}),e=>({ok:!1,error:e})),o=await r,s=await a;if(n!==v)return ie(o.code);if(p=!1,!s.ok){ie(o.code);let e=`error`in s?rh(s.error):`The browser did not let the page copy the setup prompt.`;return w({status:`failed`,count:c,reason:e})}f&&ie(f),f=o.code,c=o.count,u=o.selection,w({status:`pairing`,count:c,prompt:o.prompt,expiresAt:o.expiresAt,agent:o.agent}),I()}catch(e){n===v&&(p=!1,w({status:`failed`,count:c,reason:rh(e)}))}},L=async()=>{let t=++d,n=f,r=await e.status().catch(()=>void 0);r&&t===d&&n&&n===f&&(o.status===`pairing`||o.status===`confirm`)&&(c=r.count,u=r.selection??``,o={...o,count:c},C())};return{get state(){return o},onChange(e){return a.add(e),()=>{a.delete(e)}},start(){let t=++x,n=e.subscribe?.(e=>{if(t===x){if(e.type===`count`){if(l++,o.status===`pairing`||o.status===`confirm`)return void L();c=e.count,o.status!==`sending`&&(o=o.status===`idle`?O():{...o,count:c},C())}else if(o.status===`sending`){let t=_?.get(e.id);_?.set(e.id,e.type===`done`?{...t,done:!0}:{...t,thread:e.thread??t?.thread})}else p||o.status===`pairing`||o.status===`confirm`||D()||(o.status!==`working`&&o.status!==`sent`||m===e.id)&&(e.type===`working`?(h=e.thread??(e.id===m?h:void 0),m=e.id,N()?T(y-Date.now(),j):j()):e.id===m&&ee())}});return F(()=>void 0),()=>{n?.(),t===x&&(x++,f&&ie(f),f=void 0,p=!1,_=void 0,s=void 0,c=0,ee())}},refresh:()=>F(),async send(t){if(!(p||o.status!==`idle`&&o.status!==`failed`&&o.status!==`sent`&&o.status!==`working`)&&(o.status===`failed`||c!==0))return o.status===`failed`&&S===`pair`?oe(t):D()?F(()=>void 0):s?(S=`send`,ae(()=>e.send())):oe(t)},async pairAnother(e){if(o.status===`idle`&&o.canPairAnother)return oe(e)},async allow(){if(o.status!==`confirm`||!f)return;let t=f;return f=void 0,S=`allow`,ae(()=>e.allow(t,u),{code:t,agent:o.agent})},async copyAgain(e){if(o.status===`pairing`&&o.reason)return oe(e)},cancel(){(o.status===`pairing`||o.status===`confirm`)&&(f&&ie(f),f=void 0,p=!1,k())}}}var rh,ih=t((()=>{rh=e=>e instanceof Error?e.message:String(e)}));function ah(e){return e.normalize(`NFD`).replace(/\p{M}/gu,``).toLowerCase()}var oh=t((()=>{}));function sh(e){for(let t of[e.files,e.deferredFiles])t&&!Array.isArray(t)&&t.catch(()=>{});return e}async function ch({files:e,deferredFiles:t,...n}){return t?{...n,files:[...e??[],...await t]}:{...n,...e?{files:await e}:{}}}function lh(e={}){let t=e.transport??ea({base:nm(),guest:Pi}),n=new Set,r=new Map,i=new Set,a=new Set,o=new Set,s=[],c=`idle`,l,u=e.query??{},d=0,f=()=>!e.user&&!!(u.mine||u.mentions),p=()=>{for(let e of n)e()},m=(t,n=!1)=>{let r=e.user;return u.subject&&(t.subject.kind!==u.subject.kind||t.subject.id!==u.subject.id)||u.subjectKind!==void 0&&t.subject.kind!==u.subjectKind||u.page!==void 0&&(t.subject.kind!==`page`||t.subject.id!==u.page)||u.revision&&(t.revision===void 0||t.revision>u.revision.lte)||u.status&&t.status!==u.status||r&&u.mine&&t.author.id!==r.id||r&&u.mentions&&!t.messages.some(e=>e.mentions.includes(r.id))?!1:n?!(u.mentions&&!r):!(f()&&!i.has(t.id))},h=()=>{let e=[...r.values()],{server:t,local:n}=S?S.overlay(e):{server:e,local:[]};s=[...t.filter(e=>m(e)).sort((e,t)=>e.n-t.n),...n.filter(e=>m(e,!0))],p()},g=e=>{let t=r.get(e.id);return o.has(e.id)||t&&t.updatedAt>e.updatedAt?t??e:(r.set(e.id,e),a.add(e.id),h(),f()&&C(),e)},_=e=>{o.add(e),a.delete(e),r.delete(e)&&h()},v=new Map,y=async(e,t)=>{let n=v.get(e),r=(async()=>(await n?.catch(()=>void 0),t()))();v.set(e,r);try{return await r}finally{v.get(e)===r&&v.delete(e)}},b=async()=>{let e=++d;a=new Set,o=new Set,c=`loading`,p();try{let n={...u},f=n.limit??200,p=[],m;for(let r=0;;r++){p=[];let i=n.before,a=0;for(;;){let r=await t.list({...n,limit:f,...i?{before:i}:{}});if(e!==d)return s;if(a++,p.push(...r),n.limit!==void 0||r.length<f)break;let o=r.at(-1);i={id:o.id,updatedAt:o.updatedAt}}if(n.limit!==void 0||a===1&&m===void 0)break;let o=JSON.stringify(p);if(o===m)break;if(r===2)throw xi.COMMENTS_R0015();m=o}if(e!==d)return s;let g=new Map;for(let e of p){let t=r.get(e.id);o.has(e.id)||g.set(e.id,t&&(t.updatedAt>e.updatedAt||a.has(e.id)&&t.updatedAt===e.updatedAt)?t:e)}for(let e of a){let t=r.get(e);t&&!g.has(e)&&g.set(e,t)}r.clear();for(let[e,t]of g)r.set(e,t);i=new Set(p.map(e=>e.id)),c=`ready`,l=void 0,h()}catch(t){throw e===d&&(c=`error`,l=t,p()),t}return s},x=e=>{let t=r.get(e),{server:n,local:i}=S?S.overlay(t?[t]:[]):{server:t?[t]:[],local:[]};return n[0]??i.find(t=>t.id===e)??null},S=e.outbox&&Zp(e.outbox,{transport:t,user:e.user,threads:()=>r.values(),upsert:e=>void g(e),changed:h}),C=()=>{b().catch(()=>void 0)},w=t=>{if(t.type===`thread`){if(!e.user&&(u.mine||u.mentions))return C();r.get(t.thread.id)?.updatedAt===t.thread.updatedAt?C():g(t.thread)}else t.type===`deleted`?_(t.threadId):C()};return{transport:t,user:e.user,get threads(){return s},get status(){return c},get error(){return l},get query(){return u},set query(e){u=e,d++,i.clear(),h()},refresh:b,get:async e=>{let n=await t.get(e);return!n||!S?n:(g(n),x(n.id)??n)},create:async e=>(sh(e),S?S.create(e):g(await t.create(await ch(e)))),reply:e=>(sh(e),S?S.reply(e):y(e.threadId,async()=>g(await t.reply(await ch(e))))),edit:async e=>{if(S?.owns(e.threadId,e.messageId)){if(!await S.edit(e.messageId,e.body,e.mentions))throw xi.COMMENTS_OUTBOX_SENDING();return x(e.threadId)}return y(e.threadId,async()=>g(await t.edit(e)))},delete:async e=>{if(S?.owns(e.threadId,e.messageId)){if(!await S.dismiss(e.messageId??e.threadId))throw xi.COMMENTS_OUTBOX_SENDING();return x(e.threadId)}return y(e.threadId,async()=>{let n=await t.delete(e);return n?g(n):_(e.threadId),n})},resolve:e=>y(e.threadId,async()=>{let n=S?await S.beforeResolve(e.threadId):e.threadId;if(n===void 0)throw xi.COMMENTS_OUTBOX_RESOLVE_BLOCKED();return g(await t.resolve({...e,threadId:n}))}),reopen:e=>y(e.threadId,async()=>g(await t.reopen(e))),users:e=>t.users(e),outbox:S,onChange(e){return n.add(e),()=>{n.delete(e)}},start(){let n=[];return t.subscribe?n.push(t.subscribe(w)):e.refreshOnFocus!==!1&&typeof window<`u`&&(window.addEventListener(`focus`,C),n.push(()=>window.removeEventListener(`focus`,C))),S&&n.push(S.start()),C(),()=>{for(let e of n.splice(0))e()}}}}var uh=t((()=>{Si(),em(),rm(),Bi(),ra(),_m(),th(),xn(),ih(),aa(),oh()}));function dh(e){return{id:e.id,image:e.image,name:hh(e)}}function fh(e){let{author:t,actor:n}=e;return n?{id:`${t.id}:${n.id}`,image:n.image,name:n.name??n.id}:dh(t)}function ph(e){let t=e.replace(/\\([\\`*_{}[\]()#+\-.!>~|])/g,(e,t)=>String.fromCharCode(57344+t.charCodeAt(0))).replace(/^\s*(?:```|~~~).*$/gm,``).replace(/^\s*::+[\w-]*(?:\{[^}\n]*\})?\s*$/gm,``).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/<\/?[a-z][^>]*>/gi,``).replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+\[[ xX]\]\s+|[-*+]\s+|\d+[.)]\s+)/gm,``);for(let e=0;e<3;e++)t=t.replace(/(`+)([^`]+?)\1/g,`$2`).replace(/(\*\*|~~|\*)(?=\S)(.*?\S)\1/g,`$2`).replace(/(?<![\p{L}\p{N}_])(__|_)(?=\S)(.*?\S)\1(?![\p{L}\p{N}_])/gu,`$2`);return t.replace(/[\ue000-\ue07f]/g,e=>String.fromCharCode(e.charCodeAt(0)-57344)).replace(/\s+/g,` `).trim()}function mh(e,t=60){let n=ph(e);return n.length>t?`${n.slice(0,t-1)}…`:n}var hh,gh,_h=t((()=>{hh=e=>e.name??e.id,gh=({author:e,actor:t})=>t?`${t.name??t.id} (${hh(e)})`:hh(e)}));function vh(e,t){let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0||r>0&&!wh.test(n[r-1]))return;let i=n.slice(r+1);if(!(i.length>40||/^\s|\n|\s{2}|@/u.test(i)))return{start:r,query:i}}function yh(e,t,n={}){let r=ah(t),i=new Set(n.participants),a=new Set,o=[[],[],[],[]];for(let t of e){if(t.id===n.exclude||a.has(t.id))continue;a.add(t.id);let e=ah(hh(t)),s=e.startsWith(r)?0:e.split(/\s+/u).some((e,t)=>t>0&&e.startsWith(r))?1:void 0;s!==void 0&&o[s*2+ +!i.has(t.id)].push(t)}return o.flat().slice(0,n.limit??6)}function bh(e,t){let n=[...t].filter(e=>e.name).sort((e,t)=>t.name.length-e.name.length);if(n.length===0)return[e];let r=RegExp(`@(${n.map(e=>Th(e.name)).join(`|`)})(?![\\p{L}\\p{N}_])`,`uy`),i=[],a=0;for(let t=e.indexOf(`@`);t!==-1;t=e.indexOf(`@`,t+1)){if(t>0&&!wh.test(e[t-1]))continue;r.lastIndex=t;let o=r.exec(e),s=o&&n.find(e=>e.name===o[1]);o&&s&&(t>a&&i.push(e.slice(a,t)),i.push(s),a=t+o[0].length,t=a-1)}return a<e.length&&i.push(e.slice(a)),i}function xh(e){return Eh.get(e)}function Sh(e){let t=[...new Map(e.filter(e=>e.name).map(e=>[e.name,e])).values()].sort((e,t)=>t.name.length-e.name.length),n=t.length>0?RegExp(`@(${t.map(e=>Th(e.name)).join(`|`)})(?![\\p{L}\\p{N}_])`,`iuy`):void 0,r={name:`vitehub-comment-mentions`,markdownItPlugins:[e=>{e.inline.ruler.before(`text`,`vitehub_comment_mention`,(e,r)=>{if(!n||e.src[e.pos]!==`@`)return!1;let i=e.src[e.pos-1];if(i!==void 0&&!wh.test(i))return!1;n.lastIndex=e.pos;let a=n.exec(e.src);if(!a)return!1;let o=a[1].toLowerCase(),s=t.find(e=>e.name.toLowerCase()===o);if(!s)return!1;if(!r){let t=e.push(`mdc_inline_component`,Ch,0);t.attrs=[[`user`,s.id],[`label`,s.name]]}return e.pos+=a[0].length,!0})}]};return Eh.set(r,t),r}var Ch,wh,Th,Eh,Dh=t((()=>{uh(),_h(),Ch=`comment-mention`,wh=/[\s([{"'“]/u,Th=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Eh=new WeakMap}));function Oh(){return Fh??Ph?.matches??!1}function kh(){let e=Oh();if(e!==Ih){Ih=e;for(let t of Nh)t(e)}}function Ah(){Ph||typeof matchMedia!=`function`||(Ph=matchMedia(`(prefers-reduced-motion: reduce)`),Ph.addEventListener?.(`change`,kh),Ih=Oh())}function jh(){return Ah(),Oh()}function Mh(e){return Ah(),Nh.add(e),()=>Nh.delete(e)}var Nh,Ph,Fh,Ih,Lh=t((()=>{Nh=new Set,Ih=!1}));function Rh(){let e=Reflect.get(globalThis,Jh);if(e&&e!==Yh&&typeof e==`object`&&`define`in e&&`install`in e)return e}function zh(e){Yh=e,Reflect.get(globalThis,Jh)||Reflect.set(globalThis,Jh,e)}function Bh(e){let t=[...Kh.values()];Kh.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function Vh(e,t=jh){let n={effect:e,isReduced:t};Kh.set(e.name,n);for(let e of qh)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(Kh.get(e.name)===n){Kh.delete(e.name);for(let e of qh)e()}}}function Hh(){return[...Kh.values()].map(e=>e.effect)}function Uh(){return[...Kh.values()]}function Wh(e){return qh.add(e),()=>qh.delete(e)}function Z(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}var Gh,Kh,qh,Jh,Yh,Xh=t((()=>{Lh(),Gh=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],Kh=new Map,qh=new Set,Jh=Symbol.for(`vite-hub.motion.layer`)}));function Zh(){return dg}function Qh(e){let t=Math.min(.032,ug?(e-ug)/1e3:.016)/dg;ug=e;let n=Array.from(ag),r=Array.from(og);for(let[e,r]of n)if(ag.get(e)===r){if(e.tween){let n=e.tween;n.elapsed+=t;let r=Math.min(1,n.elapsed/n.duration),i=1-(1-r)**3,a=n.from+(e.target-n.from)*i;e.velocity=(a-e.value)/(t||1),e.value=a,r>=1&&$h(e)}else{let{stiffness:n,damping:r}=e.preset,i=t/6;for(let t=0;t<6;t++){let t=-n*(e.value-e.target)-r*e.velocity;e.velocity+=t*i,e.value+=e.velocity*i}Math.abs(e.velocity)<.002&&Math.abs(e.value-e.target)<5e-4&&$h(e)}e.frame(e.value,e.velocity)}for(let e of r)og.has(e)&&e(t)===!1&&og.delete(e);ag.size||og.size?lg=requestAnimationFrame(Qh):(lg=0,ug=0)}function $h(e){e.value=e.target,e.velocity=0,e.tween=void 0,ag.delete(e)}function eg(e){ag.set(e,++sg),lg||=requestAnimationFrame(Qh)}function tg(e){let t=t=>e(t);return og.add(t),lg||=requestAnimationFrame(Qh),()=>{og.delete(t)}}function ng(e){if(!e)return;let t=Array.from(ag);for(let[e,n]of t)ag.get(e)!==n||e.tween||($h(e),e.frame(e.value,0))}function rg(e,t,n=ig.snappy){let r={value:e,velocity:0,target:e,preset:n,tween:void 0,frame:t},i={get value(){return r.value},get velocity(){return r.velocity},get target(){return r.target},get active(){return ag.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&jh())return i.set(e);t.tween===void 0&&!cg&&(cg=!0,Mh(ng)),r.target=e,t.velocity!==void 0&&(r.velocity+=t.velocity),r.tween=t.tween===void 0?void 0:{from:r.value,elapsed:0,duration:t.tween},eg(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,ag.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,ag.delete(r)}};return i}var ig,ag,og,sg,cg,lg,ug,dg,fg=t((()=>{Lh(),ig={snappy:{stiffness:520,damping:34},soft:{stiffness:380,damping:20}},ag=new Map,og=new Set,sg=0,cg=!1,lg=0,ug=0,dg=1}));function pg(e,t){let n=e.getAttribute(`aria-orientation`);return n===`vertical`?`x`:n===`horizontal`?`y`:t.height>=t.width?`x`:`y`}function mg(e){return!/^transparent$|rgba\([^)]*,\s*0\)$|\/\s*0\)$/.test(e.trim())}function hg(e,t){let n=e=>Number.parseFloat(t===`x`?e.width:e.height),r=[[getComputedStyle(e),e],[getComputedStyle(e,`::before`),e],[getComputedStyle(e,`::after`),e]];for(let t of e.children)t instanceof HTMLElement&&r.push([getComputedStyle(t),t]);for(let[e,t]of r){let r=n(e);if(e.display!==`none`&&mg(e.backgroundColor)&&r>0&&r<=4)return{color:e.backgroundColor,width:r,element:t}}return{color:`var(--ui-border, var(--vh-border, currentColor))`,width:1}}function gg(e,t){let{handle:n,axis:r,line:i}=e;if(Math.abs(t)<.5&&!e.spring.active){e.lane?.svg.remove(),i.element&&e.opacity&&i.element.style.setProperty(`opacity`,e.opacity.value,e.opacity.priority),Cg.get(n)===e&&Cg.delete(n);return}if(!e.lane){let t=document.createElementNS(xg,`svg`);t.setAttribute(`aria-hidden`,`true`),t.dataset.motion=`bend`,t.style.cssText=`position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible;pointer-events:none;z-index:1`;let n=document.createElementNS(xg,`path`);if(n.setAttribute(`fill`,`none`),n.style.stroke=i.color,n.style.strokeWidth=`${i.width}px`,t.append(n),e.lane={svg:t,path:n},i.element){let{style:t}=i.element;e.opacity={value:t.opacity,priority:t.getPropertyPriority(`opacity`)},t.setProperty(`opacity`,`0`)}}let{svg:a,path:o}=e.lane;a.isConnected||n.after(a);let s=n.offsetHeight&&n.getBoundingClientRect().height/n.offsetHeight||1,c=e=>({left:e.left/s,top:e.top/s,width:e.width/s,height:e.height/s}),l=c(a.getBoundingClientRect()),u=c(n.getBoundingClientRect()),d=r===`x`?u.left+u.width/2-l.left:u.top+u.height/2-l.top,f=r===`x`?u.top-l.top:u.left-l.left,p=f+(r===`x`?u.height:u.width),m=(f+p)/2,h=p-f>80?Math.max(f+bg,Math.min(p-bg,e.at/s-(r===`x`?l.top:l.left))):m,g=(e,t)=>r===`x`?`${t.toFixed(2)},${e.toFixed(2)}`:`${e.toFixed(2)},${t.toFixed(2)}`,_=d+t;o.setAttribute(`d`,`M${g(f,d)} C${g(h-70,d)} ${g(h-40,_)} ${g(h,_)} C${g(h+40,_)} ${g(h+70,d)} ${g(p,d)}`)}function _g(e){return e.matches(`[aria-disabled=true], [data-disabled]:not([data-disabled=false]), [data-panel-resize-handle-enabled=false]`)?!1:/resize/.test(getComputedStyle(e).cursor)||e.tabIndex>=0||e.hasAttribute(`aria-valuenow`)}var vg,yg,bg,xg,Sg,Cg,wg,Tg=t((()=>{fg(),vg={stiffness:500,damping:14},yg=60,bg=40,xg=`http://www.w3.org/2000/svg`,Sg=`data-resize-handle-active`,Cg=new WeakMap,wg={name:`divider`,selector:`[role=separator]`,press(e,t){if(!(t instanceof PointerEvent)||!_g(e)||e.matches(`[role=separator][data-panel-resize-handle-id]`)&&e.getAttribute(`data-resize-handle-active`)!==`pointer`)return;let n=e.getBoundingClientRect(),r=pg(e,n),i=e=>r===`x`?e.clientX:e.clientY,a=e=>r===`x`?e.clientY:e.clientX,o=e=>r===`x`?e.left+e.width/2:e.top+e.height/2,s=i(t)-o(n),c=Cg.get(e);if(!c){let n={handle:e,axis:r,line:hg(e,r),at:a(t),spring:rg(0,e=>gg(n,e),vg)};c=n,Cg.set(e,c)}let l=c;l.at=a(t);let u=t,d=0,f=()=>{d=0;let t=e.getBoundingClientRect(),n=e.offsetHeight&&t.height/e.offsetHeight||1,r=(i(u)-s-o(t))/n;l.at=a(u),l.spring.set(Math.abs(r)<1?0:r/(1+Math.abs(r)/yg))};return{move(e){u=e,d||=requestAnimationFrame(f)},release(){cancelAnimationFrame(d),l.spring.to(0,{preset:vg})}}}}}));function Eg(e){let t=e;for(;t;){if(t.closest(`[data-motion="none"]`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}var Dg=t((()=>{}));function Og(e,t){if(t_.has(t))return!1;try{return e.matches(t)}catch{return t_.add(t),!1}}function kg(e){let t=e;for(;;){for(let e of Jg.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&Jg.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function Ag(e,t){let n=-1;e.forEach((e,t)=>{e instanceof Element&&e.matches(`[data-motion="none"]`)&&(n=t)});let r=e.findIndex(e=>e instanceof HTMLElement&&Og(e,t));return r===-1||r<=n||!kg(e[r])?void 0:e[r]}function jg(e,t,n){Mg(e,!0);let r=e_(t),i=[];for(let{effect:a,isReduced:o}of Uh()){if(!a.press||o())continue;let s=Ag(n,a.selector);if(!s||e===`key`&&s!==n[0])continue;let c=r.get(s);if(c?.has(a.name))continue;let l=a.press(s,t);if(!l)continue;c?c.add(a.name):r.set(s,new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>Ng(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(Xg.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,Lg,{capture:!0,passive:!0}))}function Mg(e,t=!1){let n=Xg.get(e);if(n){Xg.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();Pg()}}function Ng(e,t,n=!1){let r=Xg.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||Xg.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),Pg())}function Pg(){[...Xg.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,Lg,{capture:!0})}function Fg(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(Zg={event:e,path:t}),jg(e.pointerId,e,t)}function Ig(e){Zg?.event.pointerId===e.pointerId&&(Zg=void 0),Mg(e.pointerId,e.type===`pointercancel`)}function Lg(e){for(let{press:t}of Xg.get(e.pointerId)??[])t.move?.(e)}function Rg(e){if(e.repeat||e.key!==` `&&e.key!==`Enter`)return;let t=e.composedPath();e.key===` `&&t[0]instanceof Element&&t[0].matches(`a[href], [role=link]`)||jg(`key`,e,t)}function zg(e){(e.key===` `||e.key===`Enter`)&&Mg(`key`)}function Bg(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=new Map;for(let t of e){if(t.type===`attributes`)continue;let e=t.type===`characterData`?t.target.parentElement:t.target;if(!(e instanceof HTMLElement||e instanceof SVGElement))continue;let n=r.get(e);n||(n={added:[],removed:[],oldText:void 0,texts:new Map},r.set(e,n)),t.type===`characterData`?n.texts.has(t.target)||n.texts.set(t.target,t.oldValue):(n.added.push(...t.addedNodes),n.removed.push(...t.removedNodes))}for(let[e,t]of r){if(!e.isConnected)continue;let r=t.added.filter(e=>!t.removed.includes(e)),i=t.removed.filter(e=>!t.added.includes(e)),a=t.texts,o,s=[...e.childNodes];i.length&&s.every(e=>r.includes(e))?o=i.map(e=>e.textContent??``).join(``):a.size===1&&s.length===1&&a.has(s[0])&&(o=a.get(s[0])??``);for(let t of n)Og(e,t.selector)&&!Eg(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function Vg(e){if(!Zg||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=Uh().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=Zg,i=Xg.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&Ng(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!kg(e)||Eg(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),Xg.set(n.pointerId,i),document.addEventListener(`pointermove`,Lg,{capture:!0,passive:!0}))}function Hg(e){let t=[...new Set(e)],n=Hh(),r=new Map;Bg(t,n);for(let e of t)if(e.type!==`characterData`){if(e.type===`attributes`){let t=e.target;if(!(t instanceof HTMLElement))continue;if(e.attributeName===`data-resize-handle-active`){Vg(t);continue}let i=e.attributeName,a=t.getAttribute(i);if(a===e.oldValue)continue;let o=r.get(t);o||r.set(t,o=new Map);let s=o.get(i);if(s||o.set(i,s=new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&Og(t,r.selector)&&!Eg(t)&&r.state(t,{attribute:i,oldValue:e.oldValue,value:a})}else for(let t of e.addedNodes)if(t instanceof HTMLElement&&t.isConnected)for(let e of n){if(!e.enter)continue;let n=Og(t,e.selector);if(t_.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)Eg(t)||e.enter(t)}}}function Ug(e,t){let n=Hh().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...Gh,...Hh().some(e=>e.name===`divider`)?[Sg]:[]],attributeOldValue:!0,childList:n||Hh().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function Wg(e,t){let n=Hh();for(let[e,r]of t)n.includes(e)||(r(),t.delete(e));for(let r of n)r.watch&&!t.has(r)&&t.set(r,r.watch(e))}function Gg(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,Fg,e),document.addEventListener(`pointerup`,Ig,e),document.addEventListener(`pointercancel`,Ig,e),document.addEventListener(`keydown`,Rg,e),document.addEventListener(`keyup`,zg,e),Qg=[()=>{document.removeEventListener(`pointerdown`,Fg,e),document.removeEventListener(`pointerup`,Ig,e),document.removeEventListener(`pointercancel`,Ig,e),document.removeEventListener(`keydown`,Rg,e),document.removeEventListener(`keyup`,zg,e),Zg=void 0;for(let e of Xg.keys())Mg(e,!0)},Mh(e=>{if(e){Zg=void 0;for(let e of Xg.keys())Mg(e,!0)}})]}function Kg(e,t){if(typeof document>`u`)return()=>{};let n=Rh();return n?(Bh(n),n.install(e,t.effects,jh)):(zh(n_),qg(e,t.effects))}function qg(e,t,n=jh){let r=new Set(Hh().map(e=>e.name));for(let e of t)r.has(e.name)||Vh(e,n);if(!Yg){Gg();let e=new MutationObserver((e,t)=>Hg(e.concat(t.takeRecords())));Yg=e,Qg.push(Wh(()=>{for(let[t,{watchers:n}]of Jg)Ug(t,e),Wg(t,n)}))}let i=Jg.get(e);if(i)i.installs++;else{let t=new Map;Ug(e,Yg),Jg.set(e,{installs:1,watchers:t}),Wg(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=Jg.get(e);if(!t||--t.installs>0)return;Jg.delete(e);let n=Yg,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if(Jg.size){for(let e of Jg.keys())Ug(e,n);r.length&&queueMicrotask(()=>{if(Yg!==n)return;let e=[...Jg.keys()];Hg(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{Yg=void 0;for(let e of Qg)e();Qg=[]}}}var Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_=t((()=>{Tg(),Dg(),Lh(),Xh(),Jg=new Map,Xg=new Map,Qg=[],$g=Symbol.for(`vite-hub.motion.effect-presses`),e_=e=>{let t=Reflect.get(e,$g);if(t)return t;let n=new Map;return Reflect.set(e,$g,n),n},t_=new Set,n_={define:Vh,install:qg}}));function i_(e){return m_.add(e),e}function a_(e){return m_.has(e)}function o_(e){let t=e.getRootNode(),n=t instanceof ShadowRoot?t:e.ownerDocument.head;if(!n)return!1;let r=g_.get(t);if(r?.parentNode===n)return!!r.sheet;let i=i_(e.ownerDocument.createElement(`style`));return i.dataset.motionGlyphs=``,i.textContent=h_,n.append(i),g_.set(t,i),!!i.sheet}function s_(e){let t=i_(document.createElement(`span`));return t.dataset.motionGlyph=e,t.style.whiteSpace=`pre`,t}function c_(e){return!e.isConnected||typeof requestAnimationFrame!=`function`||Eg(e)}function l_(e){return c_(e)||!e.getClientRects().length||!o_(e)}function u_(){return jh()}function d_(e){return y_.get(e)}function f_(e,t,n){let r=v_.map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)]),i=getComputedStyle(e);t===`end`?(e.style.display=i.display.startsWith(`inline`)||i.display===`contents`?`inline-flex`:`flex`,e.style.justifyContent=`flex-end`):(i.display===`inline`||i.display===`contents`)&&(e.style.display=`inline-block`),i.position===`static`&&(e.style.position=`relative`),e.style.whiteSpace=`nowrap`,e.style.boxSizing=`border-box`,e.style.overflow=`visible`;let a=i_(document.createElement(`span`));a.dataset.motionCopy=``,a.style.cssText=`position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0`;let o=i_(document.createElement(`span`));o.setAttribute(`aria-hidden`,`true`),o.dataset.motionGlyphs=``,o.style.display=`contents`,e.replaceChildren(a,o);let s=rg(0,(t,r)=>{e.style.width=`${t}px`,r===0&&t===s.target&&n()},__),c={element:e,holder:o,width:s,name(e){a.textContent=e},restore(){(o.parentNode!==e||a.parentNode!==e)&&e.replaceChildren(a,o)},natural(){let t=e.style.width;e.style.width=`max-content`;let n=getComputedStyle(e),r=Number.parseFloat(n.width),i=Number.isFinite(r)?r:e.offsetWidth;return e.style.width=t,i},collapse(t){c.discard(),e.replaceChildren(i_(document.createTextNode(t)))},discard(){s.stop(),y_.delete(e),a.remove(),o.remove();for(let[t,n,i]of r)n?e.style.setProperty(t,n,i):e.style.removeProperty(t);e.getAttribute(`style`)||e.removeAttribute(`style`)}};return y_.set(e,c),c}function p_(e,t){let n=y_.get(e);n?n.collapse(t):e.textContent!==t&&e.replaceChildren(i_(document.createTextNode(t)))}var m_,h_,g_,__,v_,y_,b_=t((()=>{r_(),Lh(),fg(),m_=new WeakSet,h_=`[data-motion-glyph]::before{content:attr(data-motion-glyph)}`,g_=new WeakMap,__={stiffness:380,damping:34},v_=[`display`,`position`,`width`,`white-space`,`box-sizing`,`overflow`,`justify-content`,`vertical-align`],y_=new WeakMap}));function x_(e,t,n,r){let i=(e,t,n)=>3*t*e*(1-e)**2+3*n*e**2*(1-e)+e**3;return a=>{if(a<=0||a>=1)return a<=0?0:1;let o=0,s=1,c=a;for(let t=0;t<24;t++)i(c,e,n)<a?o=c:s=c,c=(o+s)/2;return i(c,t,r)}}function S_(e,t,n,r,i){let a=(n.delay??0)/1e3,o=n.duration/1e3,s=n.ease??w_,c=jh(),l=0;return{stop:tg(n=>{l+=n;let u=!c&&jh()||l>=a+o?1:o>0?Math.max(0,(l-a)/o):0;return r(e+(t-e)*s(u)),u<1||(i?.(),!1)})}}function C_(e,t,n=w_,r=0){let i=()=>{},a=new Promise(e=>i=e),o=S_(0,1,{duration:e*1e3,delay:r*1e3,ease:n},t,()=>i(!0));return{done:a,stop:()=>{o.stop(),i(!1)}}}var w_,T_,E_,D_=t((()=>{Lh(),fg(),w_=e=>e,T_=x_(.42,0,1,1),E_=x_(0,0,.58,1)}));function O_(e){let t=Math.max(0,M_.findIndex(([t])=>t>=e)-1),[n,r]=M_[t],[i,a]=M_[t+1]??M_[t],o=i>n?(e-n)/(i-n):1;return r+(a-r)*j_(Math.min(1,Math.max(0,o)))}function k_(e){if(N_.get(e)?.(),c_(e)||u_())return;let t=C_(A_,t=>Z(e,{translate:t>=1?null:`${O_(t).toFixed(2)}px 0`})),n=()=>{t.stop(),N_.delete(e),Z(e,{translate:null})};N_.set(e,n),t.done.then(e=>e&&n())}var A_,j_,M_,N_,P_=t((()=>{Xh(),b_(),D_(),A_=.4,j_=x_(.36,.07,.19,.97),M_=[[0,0],[.1,-1],[.2,3],[.3,-5],[.4,5],[.5,-5],[.6,5],[.7,-5],[.8,3],[.9,-1],[1,0]],N_=new WeakMap})),F_,I_,L_=t((()=>{X(),F_=Symbol(`ViteHubComments`),I_=()=>ul(F_,null)??void 0}));function R_(e,t,n){return n?t.slice(-1):[...e,...t]}function z_(e,t){return!t||t.split(`,`).some(t=>{let n=t.trim();return n.startsWith(`.`)?e.name.toLowerCase().endsWith(n.toLowerCase()):n.endsWith(`/*`)?e.type.startsWith(n.slice(0,-1)):e.type===n})}function B_(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??new DOMException(`Could not read ${e.name}.`,`NotReadableError`)),r.onload=()=>t({filename:e.name,mediaType:e.type||`application/octet-stream`,type:`file`,url:String(r.result)}),r.readAsDataURL(e)})}function V_(){return typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches&&!matchMedia(`(any-pointer: fine)`).matches}var H_=t((()=>{})),U_=t((()=>{H_()}));function W_(e,t,n){let r=e.cloneNode(!0);for(let e of[r,...r.querySelectorAll(`*`)])for(let t of[`id`,`role`,`tabindex`,`hidden`,`inert`,`popover`,`data-ending-style`,`data-starting-style`,`aria-live`])e.removeAttribute(t);return r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`data-motion`,`none`),r instanceof HTMLElement&&(r.inert=!0),r.style.pointerEvents=`none`,t.insertBefore(r,n?.parentNode===t?n:null),r}function G_(e,t){Object.assign(e.style,{position:`fixed`,inset:`auto`,left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,margin:`0`,boxSizing:`border-box`,transform:`none`,translate:`none`,zIndex:`2147483647`});let n=e.getBoundingClientRect();Math.abs(n.left-t.left)>.5&&(e.style.left=`${2*t.left-n.left}px`),Math.abs(n.top-t.top)>.5&&(e.style.top=`${2*t.top-n.top}px`)}function K_(e,t){return window.setTimeout(t,e*Zh())}var q_=t((()=>{fg()}));function J_(e){let t=[];for(let n of e.querySelectorAll(`svg, .iconify`))n instanceof SVGSVGElement&&n.parentElement?.closest(`svg`)||(n instanceof SVGSVGElement||Y_(n))&&t.push(n);return t}function Y_(e){let t=getComputedStyle(e).getPropertyValue(`--svg`).trim(),n=/^url\(\s*(["']?)(.*)\1\s*\)$/s.exec(t)?.[2];if(!n?.startsWith(`data:image/svg+xml`))return;let r=n.indexOf(`,`),i=n.slice(r+1);try{return n.slice(0,r).endsWith(`;base64`)?atob(i):decodeURIComponent(i)}catch{return}}function X_(e){let t=new Map;return{set(e,n,r){let i=t.get(e);i||t.set(e,i=new Map),i.has(n)||i.set(n,e.getAttribute(n)),e.setAttribute(n,r)},putBack(){for(let[e,n]of t)for(let[t,r]of n)r===null?e.removeAttribute(t):e.setAttribute(t,r);t.clear()},shapes:e}}function Z_(e){if(e instanceof SVGSVGElement){let{set:t,putBack:n,shapes:r}=X_([...e.querySelectorAll(ev)]);return r.length?{shapes:r,set:t,commit(){},restore:n,measure:e=>e(r)}:void 0}let t=Y_(e);if(!t)return;let n=new DOMParser().parseFromString(t,`image/svg+xml`).documentElement;if(!(n instanceof SVGSVGElement)||n.matches(`[style], [class], [transform]`))return;let r=[],i=[];for(let e of n.children){let t=$_.get(e.localName);if(!t||!(e instanceof SVGGeometryElement)||e.childElementCount||e.matches(`[style], [class], [transform]`))return;let n=document.createElementNS(Q_,e.localName);if(!(n instanceof SVGGeometryElement))return;for(let r of t){let t=e.getAttribute(r);t!==null&&n.setAttribute(r,t)}r.push(n),i.push(e)}if(!r.length)return;let{set:a,putBack:o,shapes:s}=X_(i),c=()=>({value:e.style.getPropertyValue(`--svg`),priority:e.style.getPropertyPriority(`--svg`)}),l=c(),u,d=e=>{let t=c();return e.value===t.value&&e.priority===t.priority};return{shapes:s,set:a,commit(){d(u??l)&&(e.style.setProperty(`--svg`,`url("data:image/svg+xml,${encodeURIComponent(new XMLSerializer().serializeToString(n))}")`,l.priority),u=c())},restore(){if(o(),u&&d(u)){let{value:t,priority:n}=l;t?e.style.setProperty(`--svg`,t,n):e.style.removeProperty(`--svg`)}u=void 0},measure(e){let t=document.createElementNS(Q_,`svg`);t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;visibility:hidden`,t.append(...r),document.body.append(t);try{return e(r)}finally{t.remove()}}}}var Q_,$_,ev,tv=t((()=>{Q_=`http://www.w3.org/2000/svg`,$_=new Map([[`path`,[`d`]],[`line`,[`x1`,`y1`,`x2`,`y2`]],[`polyline`,[`points`]],[`polygon`,[`points`]],[`circle`,[`cx`,`cy`,`r`]],[`ellipse`,[`cx`,`cy`,`rx`,`ry`]],[`rect`,[`x`,`y`,`width`,`height`,`rx`,`ry`]]]),ev=[...$_.keys()].join(`, `)}));function nv(e){return e===`true`||e===`mixed`}function rv(e){return e instanceof HTMLElement||e instanceof SVGElement?e:void 0}function iv(e,t){let n=t;for(;n.parentElement&&n.parentElement!==e;)n=n.parentElement;return n}function av(e){let{indicator:t}=e;if(e.drawn.target||e.ghost||!t||t.isConnected)return;let n=rv(t);if(!n)return;let r=W_(n,e.element,null);e.ghost=r,lv(e,J_(r)[0],r)}function ov(e,t){av(e);let n=Math.min(1,Math.max(0,t));if(e.icon&&!e.reduced){let{icon:t,lengths:r}=e;t.shapes.forEach((e,i)=>{let a=r[i];t.set(e,`stroke-dasharray`,`${a} ${a}`),t.set(e,`stroke-dashoffset`,String(a*(1-n)))}),t.commit()}e.fade&&Z(e.fade,{opacity:String(n)})}function sv(e){e.icon?.restore(),e.icon=void 0,e.fade&&Z(e.fade,{opacity:null}),e.fade=void 0,e.ghost?.remove(),e.ghost=void 0}function cv(e,t){let n=uv.get(e);if(n)return n;let r={element:e,drawn:rg(+!!t,e=>{r.drawn.active?ov(r,e):sv(r)}),icon:void 0,lengths:[],fade:void 0,indicator:void 0,ghost:void 0,reduced:!1};return uv.set(e,r),r}function lv(e,t,n){return e.icon?.restore(),e.fade&&e.fade!==n&&Z(e.fade,{opacity:null}),e.icon=t&&!e.reduced?Z_(t):void 0,e.lengths=e.icon?.measure(e=>e.map(e=>e.getTotalLength()))??[],e.fade=n,!!e.icon||!!n}var uv,dv,fv=t((()=>{Xh(),Lh(),fg(),q_(),tv(),uv=new WeakMap,dv={name:`check`,selector:`[role=checkbox]`,state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-checked`)return;let i=cv(e,nv(n));i.ghost?.remove(),i.ghost=void 0,i.reduced=jh();let a=i.reduced?{tween:.15}:void 0;if(nv(r)){let t=J_(e)[0];if(i.indicator=t&&iv(e,t),nv(n)&&i.drawn.set(0),!lv(i,t,i.reduced?rv(i.indicator):void 0))return;ov(i,i.drawn.value),i.drawn.to(1,a);return}if(n!==`true`){i.drawn.set(0),i.indicator=void 0;return}let o=J_(e)[0];o&&(i.indicator=iv(e,o)),(lv(i,o,i.reduced?rv(i.indicator):void 0)||i.indicator)&&(i.drawn.to(0,a),ov(i,i.drawn.value))}}}));function pv(e){return e instanceof HTMLDetailsElement?e.querySelector(`:scope > summary`):e}function mv(e){if(!e||e===`none`)return 0;let t=e.trim().split(/\s+/),n=t.pop();if(t.length===1&&t[0]!==`z`||t.length===3&&(Number(t[0])!==0||Number(t[1])!==0))return 0;let r=Number.parseFloat(n);return n.endsWith(`turn`)?r*360:n.endsWith(`grad`)?r*.9:n.endsWith(`rad`)?r*180/Math.PI:Number.isFinite(r)?r:0}function hv(e){let t=/^matrix(?:3d)?\(([^)]+)\)$/.exec(e);if(!t)return 0;let[n=1,r=0]=t[1].split(`,`).map(Number);return Math.atan2(r,n)*180/Math.PI}function gv(e){let t=e.style.getPropertyValue(`rotate`);t&&e.style.removeProperty(`rotate`);let n=getComputedStyle(e),r=hv(n.transform),i=r+mv(n.rotate);return t&&e.style.setProperty(`rotate`,t),{total:i,base:r}}function _v(e){let t=getComputedStyle(e),n=t.transitionDuration.split(`,`);return t.transitionProperty.split(`,`).some((e,t)=>/^\s*(?:transform|rotate|all)\s*$/.test(e)&&Number.parseFloat(n[t%n.length])>0)}function vv(e){return[...e.querySelectorAll(bv)].filter(e=>!e.parentElement?.closest(bv)||e.matches(`[data-motion-chevron]`))}function yv(e){let t=Sv.get(e);if(t)return t;let n={base:0,spring:rg(0,(t,r)=>{Eg(e)?(n.spring.stop(),Z(e,{rotate:null})):Z(e,{rotate:r===0&&t===n.spring.target?null:`${(t*xv-n.base).toFixed(2)}deg`})},ig.snappy)};return Sv.set(e,n),n}var bv,xv,Sv,Cv,wv,Tv=t((()=>{r_(),Lh(),Xh(),fg(),bv=`[data-motion-chevron], svg, img, .iconify, [data-slot=icon], [data-slot$=Icon]`,xv=90,Sv=new WeakMap,Cv=new WeakMap,wv={name:`disclosure`,selector:`details, summary, [aria-expanded]`,press(e){let t=e.tagName===`SUMMARY`?e.parentElement:e.matches(`[aria-expanded]`)?e:null;if(!t||!(t instanceof HTMLDetailsElement||t.matches(`[aria-expanded]`)))return;let n=pv(t);if(!n)return;let r=new Map;for(let e of vv(n)){if(Eg(e)||_v(e))continue;let t=Sv.get(e)?.spring;r.set(e,t?.active?t.target*xv:gv(e).total)}if(r.size)return Cv.set(t,r),{release(){setTimeout(()=>{Cv.get(t)===r&&Cv.delete(t)})}}},state(e,{attribute:t}){if(t!==(e instanceof HTMLDetailsElement?`open`:`aria-expanded`))return;let n=Cv.get(e);Cv.delete(e);let r=pv(e);if(r)for(let e of vv(r)){let t=Sv.get(e),r=n?.get(e);if(Eg(e)||r===void 0||jh()||_v(e)){t?.spring.active&&(t.spring.stop(),Z(e,{rotate:null}));continue}let i=yv(e),a=i.spring.active?i.spring.value*xv:r,{total:o,base:s}=gv(e);i.base=s,Math.abs(o-a)<.5?i.spring.active&&i.spring.set(o/xv):(i.spring.active||i.spring.set(a/xv),i.spring.to(o/xv),i.spring.active&&Z(e,{rotate:`${(i.spring.value*xv-s).toFixed(2)}deg`}))}}}}));function Ev({outline:e,box:t},n){let r=n<=1?.5*Math.sin(Math.PI*n):-.12*Math.sin(Math.PI*(n-1)/.5),i=-.15+1.35*Math.min(1,Math.max(0,n)),a=4*t.height/18;return`M${e.map(([e,n])=>{let o=(n-t.top)/t.height,s=Math.exp(-(((o-i)/.3)**2)),c=r*s*(.12+1.1*Math.max(0,o)**1.6),l=t.center+(e-t.center)*(1+c),u=o>.8?n-r*s*a*(o-.8):n;return`${l.toFixed(2)} ${u.toFixed(2)}`}).join(`L`)}Z`}function Dv(e){let[t,...n]=e.shapes;if(n.length||!(t instanceof SVGPathElement))return;let r=t.getAttribute(`d`)??``;return/^[Mm][^MmZz]+[Zz]\s*$/.test(r.trim())?t:void 0}function Ov(e){let t=Nv.get(e);if(t){t.clock.set(0),t.clock.to(1,{tween:jv});return}let n=Z_(e),r=n&&Dv(n);if(!n||!r)return;let i=n.measure(([e])=>{let t=e.getTotalLength(),n=e.getBBox();return{outline:Array.from({length:Mv},(n,r)=>{let i=e.getPointAtLength(t*r/Mv);return[i.x,i.y]}),box:{top:n.y,height:n.height,center:n.x+n.width/2}}});if(!i.box.height)return;let a={shape:n,path:r,...i,clock:rg(0,t=>{let i=1-Math.cbrt(1-Math.min(1,t));i>=1||!e.isConnected?(Nv.delete(e),a.clock.stop(),n.restore()):(n.set(r,`d`,Ev(a,i*Av)),n.commit())})};Nv.set(e,a),a.clock.to(1,{tween:jv})}function kv(){let e=Pv;Pv=void 0;for(let t of e.values())if(!(new Set(t.map(e=>e.getAttribute(`aria-pressed`)===`true`)).size>1))for(let e of t){let t=J_(e);t.length===1&&Ov(t[0])}}var Av,jv,Mv,Nv,Pv,Fv,Iv=t((()=>{Lh(),fg(),tv(),Av=1.5,jv=.56*Av,Mv=120,Nv=new WeakMap,Fv={name:`jelly`,selector:`[aria-pressed]`,state(e,{attribute:t}){if(t!==`aria-pressed`||jh())return;Pv||(Pv=new Map,queueMicrotask(kv));let n=Pv.get(e.parentElement)??[];n.push(e),Pv.set(e.parentElement,n)}}}));function Lv(e){let t=ty.get(e);return t||(t={shown:1,leaving:!1},ty.set(e,t)),t}function Rv(e){return e instanceof HTMLElement||e instanceof SVGElement}function zv(e){let t=e instanceof SVGSVGElement?e:e.querySelector(`svg`),n=t?Z_(t):void 0,r=n?.shapes.filter(e=>getComputedStyle(e).stroke!==`none`)??[];return n&&r.length?{shape:n,parts:r}:void 0}function Bv(e,t){let n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return()=>{n?e.setProperty(t,n,r):e.removeProperty(t)}}function Vv(e,t,n){if(!Rv(e))return;let r=t.styles??=new Map;for(let[t,i]of Object.entries(n))r.has(t)||r.set(t,Bv(e.style,t)),e.style.setProperty(t,i)}function Hv(e){e.stroke?.restore(),e.stroke=void 0;for(let t of e.styles?.values()??[])t();e.styles=void 0}function Uv(e){let t=ty.get(e);t&&(t.fade?.stop(),Hv(t),t.restorePlacement?.(),ty.delete(e))}function Wv(e,t,n,r){let i=Lv(e);i.fade?.stop(),Hv(i),i.leaving=!0;let[a,o]=t===`blur`?[0,0]:ey[t];i.fade=S_(i.shown,0,{duration:n?$v:Yv.duration,ease:n?E_:T_},r=>{i.shown=r;let s=1-r;Vv(e,i,{opacity:String(r),...n?{}:t===`blur`?{filter:`blur(${(Yv.blur*s).toFixed(2)}px)`,scale:String(1-(1-Yv.scale)*s)}:{translate:`${a*Yv.travel*s}px ${o*Yv.travel*s}px`}})},()=>{i.fade=void 0,r()})}function Gv(e,t,n,r){let i=Lv(e);i.fade?.stop(),i.restorePlacement?.(),i.restorePlacement=void 0,i.leaving=!1,Hv(i);let a=t===`draw`&&!n?zv(e):void 0;i.stroke=a?.shape;let o=()=>{i.fade=void 0,i.shown=1,Hv(i)};if(n){i.fade=S_(r,1,{duration:$v,ease:E_},t=>{i.shown=t,Vv(e,i,{opacity:String(t)})},o);return}if(a){let{shape:t,parts:n}=a;for(let e of n)t.set(e,`pathLength`,`1`),t.set(e,`stroke-dasharray`,`1`),t.set(e,`stroke-dashoffset`,`1`);t.commit();let r=e.matches(`.animate-spin`)||!!e.querySelector(`.animate-spin`);i.shown=1,i.fade=S_(1,0,{duration:r?Qv.spinner:Qv.duration,delay:Qv.delay,ease:Qv.ease},e=>{for(let r of n)t.set(r,`stroke-dashoffset`,String(e));t.commit()},o);return}let s=t===`draw`?`blur`:t;if(s===`blur`){i.fade=S_(r,1,{duration:Xv.duration,delay:r?0:Xv.delay,ease:Xv.ease},t=>{i.shown=Math.min(1,t);let n=1-t;Vv(e,i,{opacity:String(Math.min(1,Math.max(0,t))),filter:`blur(${Math.max(0,Xv.blur*n).toFixed(2)}px)`,scale:String(1-(1-Xv.scale)*n)})},o);return}let[c,l]=ey[s];i.fade=S_(r,1,{duration:Zv.duration,delay:r?0:Zv.delay,ease:Zv.ease},t=>{i.shown=t;let n=1-t;Vv(e,i,{opacity:String(Math.min(1,t)),translate:`${-c*Zv.travel*n}px ${-l*Zv.travel*n}px`})},o)}function Kv(e,t,n,r,i){let a=u_(),o=ny.get(e);!o&&getComputedStyle(e).position===`static`&&(o={exits:0,restore:Bv(e.style,`position`)},ny.set(e,o),e.style.position=`relative`),o&&o.exits++;let s=[];if(Rv(t)){let e={position:`absolute`,left:`${n.left}px`,top:`${n.top}px`,"pointer-events":`none`,"margin-top":`0`,"margin-right":`0`,"margin-bottom":`0`,"margin-left":`0`};for(let[n,r]of Object.entries(e))s.push(Bv(t.style,n)),t.style.setProperty(n,r)}let c=t.getAttribute(`aria-hidden`);t.setAttribute(`aria-hidden`,`true`),Lv(t).restorePlacement=()=>{for(let e of s)e();c===null?t.removeAttribute(`aria-hidden`):t.setAttribute(`aria-hidden`,c),o&&--o.exits===0&&(o.restore(),ny.delete(e))},Wv(t,r,a,()=>{Uv(t),i(t)})}function qv(e,t,n){let r=e.matches(`.animate-spin`)||!!e.querySelector(`.animate-spin`);Gv(e,t??(r?`draw`:`blur`),u_(),n)}function Jv(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=e.offsetWidth?n.width/e.offsetWidth:1;return{left:(r.left-n.left)/(i||1)-e.clientLeft,top:(r.top-n.top)/(i||1)-e.clientTop}}var Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry=t((()=>{tv(),b_(),D_(),Yv={duration:200,travel:12,scale:.6,blur:2},Xv={duration:260,delay:40,scale:.5,blur:3,ease:x_(.3,1.5,.5,1)},Zv={duration:260,delay:80,travel:10,ease:x_(.2,.8,.2,1)},Qv={duration:340,spinner:420,delay:120,ease:x_(.6,0,.2,1)},$v=150,ey={left:[-1,0],right:[1,0],up:[0,-1],down:[0,1]},ty=new WeakMap,ny=new WeakMap}));function iy(e,t){let n=[...e],r=[...t],i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return{kept:n.slice(0,i).join(``),gone:n.slice(i).join(``),typed:r.slice(i).join(``)}}function ay(e){return by.get(e)?.text}function oy(e,t,n){e.shown=t,Z(e.node,{opacity:t>=1?null:String(t),filter:n||t>=1?null:`blur(${(gy*(1-t)).toFixed(2)}px)`})}function sy(e){return s_(e)}function cy(e,t){by.get(e)===t&&(t.leaving.size||t.timers.size||t.frame.width.active||t.letters.some(e=>e.fade||e.waiting)||(by.delete(e),t.frame.collapse(t.text)))}function ly(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[...e.letters,...e.leaving])t.fade?.stop()}function uy(e){let t=by.get(e);t&&(ly(t),by.delete(e),t.frame.discard())}function dy(e,t){py(e,t,void 0)}function fy(e){let t=e;for(;t;){if(t.getClientRects().length)return!0;if(getComputedStyle(t).display!==`contents`)return!1;let e=t.getRootNode();t=t.parentElement??(e instanceof ShadowRoot?e.host:null)}return!1}function py(e,t,n){let r=by.get(e),i=r?.text??n??e.textContent??``;if(!r&&i===t||l_(e)||!fy(e)){r&&(ly(r),by.delete(e)),p_(e,t);return}let a=u_();if(!r){let t=d_(e)??f_(e,`inline`,()=>{let t=by.get(e);t&&cy(e,t)}),n=[...i].map(e=>({node:sy(e),char:e,shown:1,waiting:!1}));t.holder.append(...n.map(e=>e.node)),t.width.set(t.natural()),r={frame:t,text:i,letters:n,leaving:new Set,timers:new Set},by.set(e,r)}let o=r,s=o.frame.width;o.frame.restore();for(let e of o.timers)clearTimeout(e);if(o.timers.clear(),o.text=t,o.frame.name(t),a){hy(o,o.letters,!0),o.letters=[...t].map(e=>{let t={node:sy(e),char:e,shown:0,waiting:!1};return oy(t,0,!0),o.frame.holder.append(t.node),t}),s.set(o.frame.natural());for(let t of o.letters)my(e,o,t,0,yy,!0);return}let c=iy(o.letters.map(e=>e.char).join(``),t),l=[...c.kept].length,u=o.letters.slice(0,l);hy(o,o.letters.slice(l),!1);let d=[...u.filter(e=>e.waiting),...[...c.typed].map(e=>{let t={node:sy(e),char:e,shown:0,waiting:!0};return oy(t,0,!1),o.frame.holder.append(t.node),t})];o.letters=[...u,...d.filter(e=>!u.includes(e))];let f=o.frame.natural();if(!d.length){s.to(f);return}let p=s.value,m=f-d.reduce((e,t)=>e+t.node.offsetWidth,0),h=Zh();d.forEach((t,n)=>{m+=t.node.offsetWidth;let r=n===d.length-1?f:Math.max(m,n===0?Math.min(p,f):0),i=setTimeout(()=>{o.timers.delete(i),t.waiting=!1,s.to(r),my(e,o,t,t.shown,vy.duration,!1)},(vy.lead+n*vy.stagger)*h);o.timers.add(i)})}function my(e,t,n,r,i,a){n.fade?.stop(),n.fade=S_(r,1,{duration:i,ease:E_},e=>oy(n,e,a),()=>{n.fade=void 0,oy(n,1,a),cy(e,t)})}function hy(e,t,n){let r=e.frame.element,i=t.map(e=>({letter:e,left:e.node.offsetLeft,top:e.node.offsetTop})),a=0;for(let{letter:t,left:o,top:s}of i)t.fade?.stop(),t.fade=void 0,t.waiting||t.shown<=0?t.node.remove():(t.node.style.position=`absolute`,t.node.style.left=`${o}px`,t.node.style.top=`${s}px`,e.leaving.add(t),t.fade=S_(t.shown,0,{duration:n?yy:_y.duration,delay:n?0:a++*_y.stagger,ease:n?E_:T_},e=>oy(t,e,n),()=>{t.fade=void 0,t.node.remove(),e.leaving.delete(t),cy(r,e)}))}var gy,_y,vy,yy,by,xy=t((()=>{Xh(),fg(),b_(),D_(),gy=6,_y={duration:200,stagger:30},vy={duration:240,lead:30,stagger:55},yy=150,by=new WeakMap})),Sy,Cy,wy,Ty=t((()=>{b_(),ry(),xy(),Sy=`:is(button, a, [role=button])`,Cy={name:`label`,selector:`${Sy} > [data-slot=label]`,content(e,{added:t,removed:n,oldText:r}){if(!(e instanceof HTMLElement))return;if([...e.childNodes].some(e=>e.nodeType!==Node.TEXT_NODE&&!a_(e))){uy(e);return}if(t.length?t.every(a_):n.length>0)return;let i=ay(e)??r;i!==void 0&&py(e,e.textContent??``,i)}},wy={name:`button-icon`,selector:`${Sy}, ${Sy} > svg:is([data-slot=leadingIcon], [data-slot=trailingIcon])`,content(e,{added:t,removed:n}){if(e instanceof HTMLElement){for(let r of[`leadingIcon`,`trailingIcon`]){let i=e=>e instanceof SVGSVGElement&&e.getAttribute(`data-slot`)===r&&!a_(e),a=t.find(t=>i(t)&&t.parentNode===e),o=n.find(i);if(o){let t=i_(o.cloneNode(!0));t.classList.remove(`animate-spin`),t.removeAttribute(`data-slot`),a?a.after(t):r===`leadingIcon`?e.prepend(t):e.append(t),Kv(e,t,Jv(e,a??t),`blur`,e=>e.remove())}a&&qv(a,void 0,0)}return}let r=e.parentElement;if(!(e instanceof SVGSVGElement)||!r||!n.length||t.every(a_)||!n.some(e=>e instanceof SVGElement))return;let i=Jv(r,e),a=i_(e.cloneNode(!1));a.classList.remove(`animate-spin`),a.removeAttribute(`data-slot`),a.append(...n),e.after(a),Kv(r,a,i,`blur`,e=>e.remove()),qv(e,void 0,0)}}}));function Ey(e){let t=Ay.get(e);t&&(Ay.delete(e),t.spring.stop(),t.ghost.remove(),e.removeAttribute(`data-motion-leave-managed`),Z(e,{opacity:null}))}var Dy,Oy,ky,Ay,jy,My=t((()=>{Lh(),Xh(),fg(),q_(),Dy={stiffness:260,damping:28},Oy=.9,ky=.15,Ay=new WeakMap,jy={name:`leave`,selector:`*`,state(e,{attribute:t,value:n}){if(t!==`data-leaving`||(Ey(e),n!==`true`||!e.parentNode))return;e.setAttribute(`data-motion-leave-managed`,``);let r=e.getBoundingClientRect(),i=W_(e,e.parentNode,e.nextSibling),a=getComputedStyle(e).position;a!==`absolute`&&a!==`fixed`&&G_(i,r),Z(e,{opacity:`0`});let o=jh(),s=rg(1,e=>{Z(i,{scale:o?null:(Oy+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&(s.stop(),i.remove())},Dy);Ay.set(e,{ghost:i,spring:s}),s.to(0,o?{tween:ky}:{preset:Dy})}}}));function Ny(e){let t=zy.get(e)?.spring;t?.active&&(t.stop(),Z(e,{width:null}))}function Py(e){let t=new Set,n=new ResizeObserver(e=>{for(let{target:n}of e)n instanceof HTMLElement&&t.has(n)&&!zy.get(n)?.spring.active&&By.set(n,n.getBoundingClientRect().width)});function r(r){if(t.has(r)||!e.contains(r)||!r.matches(Ry))return;t.add(r);let i=Vy.get(r)??0;i===0&&By.set(r,r.getBoundingClientRect().width),Vy.set(r,i+1),n.observe(r,{box:`border-box`})}function i(e){t.delete(e),n.unobserve(e);let r=Vy.get(e)??1;r>1?Vy.set(e,r-1):(Vy.delete(e),Ny(e),By.delete(e))}let a=new MutationObserver(n=>{for(let n of t)e.contains(n)&&n.matches(Ry)||i(n);for(let e of n){e.type===`attributes`&&e.target instanceof HTMLElement&&r(e.target);for(let t of e.addedNodes)if(t instanceof HTMLElement){r(t);for(let e of t.querySelectorAll(Ry))r(e)}}});e instanceof HTMLElement&&r(e);for(let t of e.querySelectorAll(Ry))r(t);return a.observe(e,{subtree:!0,childList:!0,attributeFilter:[`data-motion-panel`]}),()=>{a.disconnect();for(let e of t)i(e);n.disconnect()}}function Fy(e){let t=getComputedStyle(e);return t.boxSizing===`border-box`?0:[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+Number.parseFloat(t),0)}function Iy(e,t){Z(e,{width:`${t.spring.value*Hy-t.frame}px`})}var Ly,Ry,zy,By,Vy,Hy,Uy,Wy=t((()=>{Lh(),Xh(),fg(),Ly={stiffness:420,damping:30},Ry=`[data-motion-panel]`,zy=new WeakMap,By=new WeakMap,Vy=new WeakMap,Hy=100,Uy={name:`panel`,selector:Ry,watch:Py,state(e){let t=zy.get(e),n=t?.spring.active?t.spring.value*Hy:By.get(e);t?.spring.active&&Z(e,{width:null});let r=e.getBoundingClientRect().width;if(By.set(e,r),n===void 0||jh()||Math.abs(r-n)<.5)Ny(e);else{if(!t){let r={frame:0,spring:rg(n/Hy,(t,n)=>{n===0&&t===r.spring.target?Z(e,{width:null}):Iy(e,r)},Ly)};t=r,zy.set(e,t)}t.frame=Fy(e),t.spring.active||t.spring.set(n/Hy),t.spring.to(r/Hy),t.spring.active&&Iy(e,t)}}}}));function Gy(){let e=Reflect.get(globalThis,rb);return e===`opt-in`||e===`all`?e:`buttons`}function Ky(e,t){for(let n of t.composedPath()){if(!(n instanceof Element))continue;let t=n.getAttribute(`data-motion-press`);if(t===`none`||n===e&&t!==null)return t}}function qy(e){let t=Gy();return t===`buttons`?e.matches(nb)&&e.offsetHeight<48&&e.offsetWidth<=4*e.offsetHeight:t===`all`}function Jy(e,t){if(t===`none`)return;if(t===`icon`){let t=e.querySelector(tb);return t instanceof HTMLElement||t instanceof SVGElement?{target:t,amount:.15}:void 0}if(t===void 0&&!qy(e))return;let n=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(n instanceof HTMLElement)return{target:n,amount:ob(n)};let r=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.matches(tb)?{target:r,amount:.15}:{target:e,amount:ob(e)}}function Yy(e){let t=e.transitionDuration.split(`,`);return e.transitionProperty.split(`,`).some((e,n)=>/^\s*(?:scale|all)\s*$/.test(e)&&Number.parseFloat(t[n%t.length])>0)}function Xy(e,t,n){let{left:r,right:i,top:a,bottom:o,width:s,height:c}=e;return Math.min(t.clientX-r,i-t.clientX)<=s*n||Math.min(t.clientY-a,o-t.clientY)<=c*n}var Zy,Qy,$y,eb,tb,nb,rb,ib,ab,ob,sb,cb=t((()=>{Xh(),fg(),Zy={stiffness:900,damping:40},Qy={stiffness:380,damping:14},$y=[`button`,`link`,`tab`,`radio`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`option`,`checkbox`],eb=`:is(button, a[href], summary, input:is([type=button], [type=submit], [type=reset], [type=checkbox], [type=radio]), ${$y.map(e=>`[role=${e}]`).join(`, `)}, [data-motion-press]:not([data-motion-press=none])):not(:disabled, [aria-disabled="true"], [role=switch])`,tb=`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`,nb=`:is(button, input:is([type=button], [type=submit], [type=reset])):is(:not([role]), [role=button])`,rb=Symbol.for(`vite-hub.motion.press-mode`),ib=new WeakMap,ab=e=>e>=40?.03:e>=32?.04:.05,ob=e=>Math.min(ab(e.offsetHeight),6/Math.max(e.offsetWidth,e.offsetHeight)),sb={name:`press`,selector:eb,press(e,t){if(!(`pointerId`in t))return;let n=Jy(e,Ky(e,t));if(!n)return;let{target:r,amount:i}=n,a=getComputedStyle(r);if(Yy(a)||a.display===`contents`||a.display===`inline`&&r===e&&!(e instanceof HTMLInputElement))return;let o;if(r===e&&(o=e.getBoundingClientRect(),Xy(o,t,i)))return;let s=ib.get(r);if(!s){let e={amount:i,spring:rg(0,t=>{Z(r,{scale:t?String(1-e.amount*t):null})},Zy)};s=e,ib.set(r,s)}s.amount=i;let{spring:c}=s;c.to(1,{preset:Zy});let l=!1,u=()=>{l||(l=!0,c.set(0))};return{move:o?e=>{Xy(o,e,i)&&u()}:void 0,release:()=>{l||c.to(0,{preset:Qy})},cancel:u}}}}));function lb(e,t){return e===`aria-selected`||e===`aria-checked`?t===`true`:e===`data-state`?t===`active`||t===`checked`||t===`on`:e===`data-checked`&&t!==null&&t!==`false`}function ub(e){let t=e.parentElement?.closest(Pb);if(!t||t.matches(`[role=listbox][aria-multiselectable=true]`))return null;let n=e.getAttribute(`role`),r=n?Mb[n]:void 0;return t.matches(Nb)||r&&t.matches(r)?t:null}function db(e){return Lb.some(t=>lb(t,e.getAttribute(t)))}function fb(e,t){for(let n=t;n&&n!==e;n=n.parentElement)if(Kb.has(n)||n.matches(Rb))return n}function pb(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top,k:e.offsetWidth?t.width/e.offsetWidth:1}}function mb(e,t){let n=e.getBoundingClientRect(),r=e.offsetWidth||n.width/t.k,i=e.offsetHeight||n.height/t.k;return{x:(n.left+n.width/2-t.left)/t.k-r/2,y:(n.top+n.height/2-t.top)/t.k-i/2,width:r,height:i}}function hb(e,t){for(let n of t.querySelectorAll(zb))if(n.closest(Pb)===e&&fb(e,n)===t)return n;for(let t of e.querySelectorAll(Bb))if(t.closest(Pb)===e&&!fb(e,t))return t}function gb(e){let t=getComputedStyle(e),n=e.clientLeft+Number.parseFloat(t.paddingLeft),r=e.clientTop+Number.parseFloat(t.paddingTop),i=e.clientLeft+e.clientWidth-Number.parseFloat(t.paddingRight),a=e.clientTop+e.clientHeight-Number.parseFloat(t.paddingBottom);return[[n,i],[r,a]]}function _b(e,t){return e.endsWith(`%`)?Number.parseFloat(e)/100*t:Number.parseFloat(e)||0}function vb(e){Z(e.element,{translate:null,scale:null});let t=getComputedStyle(e.element);e.rest=mb(e.element,pb(e.group));let[n=`0`,r=`0`]=t.translate===`none`?[]:t.translate.split(` `),[i=`50%`,a=`50%`]=t.transformOrigin.split(` `);e.translate=[_b(n,e.rest.width),_b(r,e.rest.height)],e.origin=[_b(i,e.rest.width),_b(a,e.rest.height)]}function yb(e,t,n){let r=t.width?n.width/t.width:1,i=t.height?n.height/t.height:1;return{x:n.x+(e.x-t.x)*r,y:n.y+(e.y-t.y)*i,width:e.width*r,height:e.height*i}}function bb(e){return!!e&&(e.x.active||e.y.active||e.width.active||e.height.active)}function xb(e){e.queued||(e.queued=!0,queueMicrotask(()=>{e.queued=!1,Cb(e)}))}function Sb(e,t,n,r,i,a,o,s){let c=r*t,l=Math.min(a[0],o,e),u=Math.max(a[1],o+s,e+t),d=n<0?Math.max(l,e-c):e,f=n<0?e+t:Math.min(u,e+t+c),p=(f-d)*i*Ub/2;return d+=p,f-=p,[d,f-d]}function Cb(e){if(!e.ready)return;let{element:t,rest:n,translate:r,origin:i,x:a,y:o,width:s,height:c,span:l}=e;if(!bb(e)){Z(t,{translate:null,scale:null}),Ob(e);return}let u=Math.min(Hb,Math.abs(a.velocity)/l[0]*Vb),d=Math.min(Hb,Math.abs(o.velocity)/l[1]*Vb),[f,p]=Sb(a.value,s.value,a.velocity,u,d,e.bounds[0],n.x,n.width),[m,h]=Sb(o.value,c.value,o.velocity,d,u,e.bounds[1],n.y,n.height),g=n.width?p/n.width:1,_=n.height?h/n.height:1;Z(t,{translate:`${f-(n.x-r[0])-i[0]*(1-g)}px ${m-(n.y-r[1])-i[1]*(1-_)}px`,scale:`${g} ${_}`})}function wb(e,t,n,r,i){let a=Wb.get(e),o=bb(a);a&&a.element!==t&&(Z(a.element,{translate:null,scale:null}),Ob(a));let s=a??{element:t,group:e,ready:!1,rest:{x:0,y:0,width:0,height:0},translate:[0,0],origin:[0,0],span:[1,1],bounds:[[0,0],[0,0]],queued:!1,x:rg(0,()=>xb(s),ig.snappy),y:rg(0,()=>xb(s),ig.snappy),width:rg(0,()=>xb(s),ig.snappy),height:rg(0,()=>xb(s),ig.snappy)};Wb.set(e,s),s.ready=!1,s.element=t,s.copyOf=i,vb(s),s.bounds=gb(e);let{rest:c}=s;if(!c.width||!c.height||!o&&!n)return s.ready=!0,Ob(s);if(!o&&n){let t=pb(e),i=yb(c,mb(r,t),mb(n,t));s.x.set(i.x),s.y.set(i.y),s.width.set(i.width),s.height.set(i.height)}s.span=[Math.max(Math.abs(c.x-s.x.value),c.width,1),Math.max(Math.abs(c.y-s.y.value),c.height,1)],s.x.to(c.x),s.y.to(c.y),s.width.to(c.width),s.height.to(c.height),s.ready=!0,Cb(s)}function Tb(e){getComputedStyle(e).backgroundColor;for(let t of e.getAnimations())t instanceof CSSTransition&&Xb.includes(t.transitionProperty)&&t.finish()}function Eb(e){let t=e.getRootNode();(t instanceof Document||t instanceof ShadowRoot)&&(Qb||(Qb=new CSSStyleSheet,Qb.replaceSync(Zb)),t.adoptedStyleSheets.includes(Qb)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,Qb]))}function Db(e,t,n){Tb(t),Tb(n);let r=getComputedStyle(t),i=getComputedStyle(n),a=[],o={position:`absolute`,"z-index":`-1`,"box-sizing":`border-box`,margin:`0`,"pointer-events":`none`,"border-radius":i.borderRadius,"background-color":`transparent`,"box-shadow":`none`};i.backgroundColor!==r.backgroundColor&&!$b.test(i.backgroundColor)&&(o[`background-color`]=i.backgroundColor,a.push(`background`)),i.boxShadow!==r.boxShadow&&i.boxShadow!==`none`&&(o[`box-shadow`]=i.boxShadow,a.push(`shadow`));for(let e of Jb){let t=`border-${e}`,n=i.getPropertyValue(`${t}-width`),s=i.getPropertyValue(`${t}-color`);o[`${t}-width`]=n,o[`${t}-style`]=i.getPropertyValue(`${t}-style`),o[`${t}-color`]=`transparent`,Number.parseFloat(n)>0&&!$b.test(s)&&Yb.some(e=>{let n=`${t}-${e}`;return i.getPropertyValue(n)!==r.getPropertyValue(n)})&&(o[`${t}-color`]=s,a.push(t))}if(!a.length)return;let s=document.createElement(`span`);s.setAttribute(`aria-hidden`,`true`),s.setAttribute(`data-motion-copy`,``);for(let[e,t]of Object.entries(o))s.style.setProperty(e,t);Eb(e),e.append(s);let c=s.offsetParent instanceof HTMLElement?s.offsetParent:null,l=c&&(c!==document.body||getComputedStyle(c).position!==`static`)?c:null,u=mb(n,pb(l??document.documentElement));return s.style.left=`${u.x-(l?l.clientLeft-l.scrollLeft:0)}px`,s.style.top=`${u.y-(l?l.clientTop-l.scrollTop:0)}px`,s.style.width=`${u.width}px`,s.style.height=`${u.height}px`,{element:s,hidden:a}}function Ob(e){let t=e.copyOf;t&&(e.copyOf=void 0,t.removeAttribute(`data-motion-select-hidden`),Tb(t),e.element.remove(),e.group.removeAttribute(`data-motion-select-moving`))}function kb(e){let t=Wb.get(e);if(t){Wb.delete(e),t.ready=!1;for(let e of[t.x,t.y,t.width,t.height])e.stop();Z(t.element,{translate:null,scale:null}),Ob(t)}}function Ab(e,t,n){if(jh()||Eg(n))return kb(e);let r=hb(e,n);if(r)return Eg(r)?kb(e):wb(e,r,t,n);let i=Wb.get(e),a=t??(bb(i)?i?.copyOf:void 0);if(!a)return;let o=Db(e,a,n);o&&(n.setAttribute(`data-motion-select-hidden`,o.hidden.join(` `)),Tb(n),wb(e,o.element,t,n,n),o.element.isConnected&&e.setAttribute(`data-motion-select-moving`,``))}function jb(){qb=0;let e=[...Gb];Gb.clear();for(let[t,{from:n,to:r}]of e)r?.isConnected&&ub(r)===t&&db(r)?Ab(t,n?.isConnected&&ub(n)===t?n:void 0,r):(!t.isConnected||Wb.has(t)&&![...t.querySelectorAll(Ib)].some(e=>db(e)&&ub(e)===t))&&kb(t)}var Mb,Nb,Pb,Fb,Ib,Lb,Rb,zb,Bb,Vb,Hb,Ub,Wb,Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx=t((()=>{Dg(),Lh(),Xh(),fg(),Mb={tab:`[role=tablist]`,radio:`[role=radiogroup]`,option:`[role=listbox]`,menuitemradio:`[role=group], [role=menu]`},Nb=`[data-motion-select]`,Pb=`[role=tablist], [role=radiogroup], [role=listbox], [role=group], [role=menu], ${Nb}`,Fb=Object.keys(Mb).map(e=>`[role=${e}]`).join(`, `),Ib=`${Fb}, ${Nb} *`,Lb=[`aria-selected`,`aria-checked`,`data-state`,`data-checked`],Rb=`${Fb}, [aria-selected], [aria-checked], [data-checked], ${[`active`,`inactive`,`checked`,`unchecked`,`on`,`off`].map(e=>`[data-state=${e}]`).join(`, `)}`,zb=`[data-motion-indicator], [data-slot=indicator]`,Bb=`${zb}, [data-slot$="-indicator"]`,Vb=.09,Hb=.55,Ub=.25,Wb=new WeakMap,Gb=new Map,Kb=new WeakSet,qb=0,Jb=[`top`,`right`,`bottom`,`left`],Yb=[`width`,`style`,`color`],Xb=[`background-color`,`box-shadow`,...Jb.flatMap(e=>Yb.map(t=>`border-${e}-${t}`))],Zb=[`[data-motion-select-moving] { isolation: isolate; }`,`[data-motion-select-hidden~="background"] { background-color: transparent !important; }`,`[data-motion-select-hidden~="shadow"] { box-shadow: none !important; }`,...Jb.map(e=>`[data-motion-select-hidden~="border-${e}"] { border-${e}-color: transparent !important; }`)].join(`
146
+ `),$b=/^transparent$|^rgba\((?:[^,]+,){3}\s*0(?:\.0+)?\)$|\/\s*0(?:\.0+)?%?\s*\)$/,ex={name:`select`,selector:Ib,state(e,{attribute:t,oldValue:n,value:r}){let i=lb(t,n),a=lb(t,r);if(i===a)return;let o=ub(e);if(!o)return;Kb.add(e);let s=Gb.get(o)??{};a?s.to=e:s.from=e,Gb.set(o,s),qb||=requestAnimationFrame(jb)}}}));function nx(e){if(!(e instanceof HTMLInputElement))return e;let t=e.parentElement;return t?.matches(jx)?t:void 0}function rx(e){return e.querySelectorAll(`:scope > [role=slider], :scope > ${jx} > input[type=range]`)}function ix(e){return e.getAttribute(`aria-orientation`)===`vertical`||e.closest(`[data-orientation=vertical]`)?`y`:`x`}function ax(e,t){let{left:n,top:r,width:i,height:a}=e.getBoundingClientRect();return{left:n/t.zoom,top:r/t.zoom,width:i/t.zoom,height:a/t.zoom}}function ox(e){return e.offsetWidth&&e.getBoundingClientRect().width/e.offsetWidth||1}function sx(e,t){return t===`x`?{start:e.left,size:e.width}:{start:e.top,size:e.height}}function cx(e){let{thumb:t,track:n,axis:r}=e;e.zoom=ox(n);let i=sx(ax(t,e),r),a=sx(ax(n,e),r);return e.length=a.size,i.start+i.size/2-a.start-(Px.get(t)===e?e.position.value-e.layout:0)}function lx(e){return Number.parseFloat(e??``)}function ux({thumb:e,axis:t}){let{style:n}=e,r=t===`x`?n.left:n.top,i=t===`x`?n.right:n.bottom;return r&&!i?1:i&&!r||t===`y`||getComputedStyle(e).direction===`rtl`?-1:1}function dx(e,t,n,r){let i=lx(t.getAttribute(`aria-valuemin`)??t.getAttribute(`min`)),a=lx(t.getAttribute(`aria-valuemax`)??t.getAttribute(`max`)),o=Number.isFinite(i)?i:0,s=Number.isFinite(a)?a:100;if(!(s>o)||!Number.isFinite(n)||!Number.isFinite(r))return;let c=sx(ax(e.thumb,e),e.axis).size,l=(r-o)/(s-o),u=ux(e),d;for(let t of[e.length-c,e.length])for(let n of[u,-u]){let r=e.length/2+n*(l-.5)*t,i=Math.abs(r-e.layout);(!d||i<d.error)&&(d={error:i,travel:t,sign:n})}if(!(!d||d.error>3))return e.layout-d.sign*((r-n)/(s-o))*d.travel}function fx(e){let[t=`0px`,n=`0px`]=e.split(` `).filter(Boolean);return{raw:e,x:t,y:n}}function px(e,t){let n=e.parentElement;if(!n)return;let r=ix(t),i={thumb:e,track:n,range:n.querySelector(`:scope > [data-slot=range], :scope > [data-slot=slider-indicator]`),axis:r,layout:0,length:0,zoom:1,direction:1,held:!1,position:rg(0,(e,t)=>{Math.abs(t)>Tx*i.length&&(i.direction=t>0?1:-1),i.tail.to(Math.min(Cx,Math.abs(t)*wx)),_x(i)},bx),tail:rg(0,()=>_x(i),xx),ownTranslate:fx(e.style.translate)};return i.layout=cx(i),i.position.set(i.layout),Px.set(e,i),i}function mx(e){Px.delete(e.thumb),e.position.stop(),e.tail.stop(),Z(e.thumb,{translate:e.ownTranslate.raw||null,scale:null}),hx(e),e.lane?.ownerSVGElement?.remove()}function hx(e){let{range:t,axis:n,track:r}=e;if(!t)return;let i=[...rx(r)].flatMap(t=>{let r=nx(t);if(!r)return[];let i=Px.get(r),a=sx(ax(r,e),n);return[{center:a.start+a.size/2,moving:!!i&&Math.abs(i.position.value-i.layout)>=.01}]}),a=n===`x`?`minWidth`:`minHeight`,o=Fx.get(t);if(!i.some(e=>e.moving)){o&&(t.style[a]=o.minSize,Z(t,{translate:o.translate,scale:o.scale}),Fx.delete(t));return}o||(o={minSize:t.style[a],scale:t.style.scale,translate:t.style.translate,shift:0},Fx.set(t,o),t.style[a]=`1px`);let s=Number.parseFloat(getComputedStyle(t)[n===`x`?`width`:`height`]);if(!(s>0))return;let c=sx(ax(t,e),n),l=c.start+c.size/2-o.shift-s/2,u=l+s,d=i.map(e=>e.center),f=Math.min(...d),p=Math.max(...d);i.length===1&&(ux(e)>0?f=l:p=u);let m=Math.max(0,p-f)/s,h=o.shift=(f+p)/2-(l+u)/2;Z(t,{translate:n===`x`?`${h}px 0px`:`0px ${h}px`,scale:n===`x`?`${m} 1`:`1 ${m}`})}function gx(e){let{thumb:t,track:n,axis:r,direction:i,length:a,range:o}=e,s=Math.min(Cx,e.tail.value);if(s<=2){e.lane?.setAttribute(`d`,``);return}if(!e.lane){let n=document.createElementNS(kx,`svg`);n.setAttribute(`aria-hidden`,`true`),n.dataset.motion=`tail`,n.style.cssText=`position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible;pointer-events:none;margin:0`;let r=document.createElementNS(kx,`path`);r.style.fill=getComputedStyle(o??t).backgroundColor,n.append(r),e.lane=r}let c=e.lane.ownerSVGElement;c.isConnected||t.before(c);let l=ax(c,e),u=ax(n,e),d=ax(t,e),f=(r===`x`?d.height:d.width)/2/(e.held?Sx:1),p=r===`x`?d.top+d.height/2-l.top:d.left+d.width/2-l.left,m=r===`x`?u.left-l.left:u.top-l.top,h=Math.max(0,Math.min(a,e.position.value)),g=Math.min(s,i>0?h:a-h),_=i>0&&o?(r===`x`?o.offsetHeight:o.offsetWidth)/2:0,v=[],y=[];for(let e=0;e<=Ex;e++){let t=e/Ex,n=(m+h-i*g*t).toFixed(1),a=Math.max(_,f*.95*(1-t)**1.3),o=(p-a).toFixed(2),s=(p+a).toFixed(2);v.push(r===`x`?`${n} ${o}`:`${o} ${n}`),y.push(r===`x`?`${n} ${s}`:`${s} ${n}`)}e.lane.setAttribute(`d`,`M${v.join(`L`)}L${y.reverse().join(`L`)}Z`)}function _x(e){if(Px.get(e.thumb)!==e)return;if(!e.held&&!e.position.active&&!e.tail.active){mx(e);return}let{thumb:t,axis:n}=e,r=e.position.value-e.layout,{x:i,y:a}=e.ownTranslate,o=n===`x`?`calc(${i} + ${r.toFixed(2)}px) ${a}`:`${i} calc(${a} + ${r.toFixed(2)}px)`,s=Math.abs(e.position.velocity)/Math.max(1,e.length),c=Math.min(Ox,s*Dx),l=e.held?Sx:1,u=(l*(1+c)).toFixed(4),d=(l*(1-c*.25)).toFixed(4);Z(t,{translate:o,scale:n===`x`?`${u} ${d}`:`${d} ${u}`}),hx(e),gx(e)}function vx(e,t,n,r){if(jh()){let t=Px.get(e);t&&mx(t);return}let i=Px.get(e),a=i??px(e,t);if(!a)return;let o=cx(a);if(!i){let e=n===void 0||r===void 0?void 0:dx(a,t,n,r);a.position.set(e??o)}Math.abs(o-a.layout)<.01&&i||(a.layout=o,a.position.to(o),_x(a))}function yx(e){return e.matches(`:disabled, [aria-disabled=true], [data-disabled]:not([data-disabled=false])`)}var bx,xx,Sx,Cx,wx,Tx,Ex,Dx,Ox,kx,Ax,jx,Mx,Nx,Px,Fx,Ix,Lx=t((()=>{r_(),Xh(),Lh(),fg(),bx={stiffness:520,damping:38},xx={stiffness:260,damping:30},Sx=1.12,Cx=150,wx=.13,Tx=.05,Ex=28,Dx=.09,Ox=.55,kx=`http://www.w3.org/2000/svg`,Ax=`[role=slider], input[type=range]`,jx=`[data-slot=slider-thumb]`,Mx=`[data-slot=range], [data-slot=slider-indicator]`,Nx=`[data-slot=track], [data-slot=slider-track], :has(> [data-slot=range])`,Px=new WeakMap,Fx=new WeakMap,Ix={name:`slider`,selector:`${Ax}, ${Nx}, [data-slot=slider-control]`,press(e,t){if(!(t instanceof PointerEvent))return;let n=t.composedPath()[0];if(!(n instanceof Element))return;let r=e.matches(`[data-slot=slider-control]`)?e.querySelector(`[data-slot=slider-track]`):e,i=e.matches(Ax)?[e]:r&&(n===e||n===r||n.closest(Mx)?.parentElement===r)?rx(r):[],a,o=1/0;for(let e of i){let n=nx(e);if(!n||yx(e)||Eg(e))continue;let r=n.getBoundingClientRect(),i=Math.hypot(r.left+r.width/2-t.clientX,r.top+r.height/2-t.clientY);i<o&&(o=i,a={thumb:n,value:e})}if(!a)return;let{thumb:s,value:c}=a,l=Px.get(s)??px(s,c);if(!l)return;l.held=!0,_x(l);let u=0;return{move(){u||=requestAnimationFrame(()=>{u=0,vx(s,c)})},release(){cancelAnimationFrame(u);let e=Px.get(s);e&&(e.held=!1,vx(s,c),_x(e))}}},state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-valuenow`&&t!==`aria-valuetext`||!e.matches(Ax))return;let i=nx(e);i&&vx(i,e,lx(n),lx(r))}}}));function Rx(e){let t=e.querySelector($x)??e.firstElementChild;return t instanceof HTMLElement?t:void 0}function zx(e){return e===`true`}function Bx(e,t){Z(t,{translate:null,scale:null});let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),[i=`0px`,a=`0px`]=getComputedStyle(t).translate.split(` `),o=e.offsetWidth?n.width/e.offsetWidth:1;return{rest:{center:(r.left+r.width/2-n.left)/o,width:r.width/o,height:r.height/o},translate:i===`none`?[`0px`,`0px`]:[i,a],width:t.offsetWidth,height:t.offsetHeight}}function Vx(e,t,n){let r=e.rest[+!!t];if(r)return r;let i=e.rest[+!t];return{...i,center:n-i.center}}function Hx(e,t){let{knob:n,now:r}=t;if(!t.position.active&&!t.size.active&&!t.press.active&&!t.press.target&&!t.wobble.active&&t.wobbleTimer===void 0){Z(n,{translate:null,scale:null});return}let i=e.offsetWidth,a=Vx(t,!1,i),o=Vx(t,!0,i),s=t.position.value,c=t.size.value,l=Math.min(.55,Math.abs(t.velocity)*.09)+t.press.value*.4,u=1+l+t.wobble.value*.14,d=1-l*.25-t.wobble.value*.14,f=(a.width+(o.width-a.width)*c)*u,p=(a.height+(o.height-a.height)*c)*d,m=Math.min(a.center-a.width/2,o.center-o.width/2),h=Math.max(a.center+a.width/2,o.center+o.width/2),g=a.center+(o.center-a.center)*s,_=f/2,v=(m+_>h-_?(m+h)/2:Math.max(m+_,Math.min(h-_,g)))-(r.on?o:a).center;Z(n,{translate:`calc(${r.translate[0]} + ${v.toFixed(2)}px) ${r.translate[1]}`,scale:`${(f/r.width).toFixed(4)} ${(p/r.height).toFixed(4)}`})}function Ux(e){let t=getComputedStyle(e),n=t.transitionDuration.split(`,`);return t.transitionProperty.split(`,`).some((e,t)=>/^\s*(?:transform|translate|scale|all)\s*$/.test(e)&&Number.parseFloat(n[t%n.length])>0)}function Wx(e,t){let n=eS.get(e);if(n&&n.knob.isConnected&&e.contains(n.knob))return n;let r=Rx(e);if(!r||Ux(r))return;let i=+!!t,a=()=>Hx(e,o),o={knob:r,rest:[void 0,void 0],now:{on:t,translate:[`0px`,`0px`],width:1,height:1},position:rg(i,(e,t)=>{o.velocity=t,a()},qx),velocity:0,size:rg(i,a,Jx),press:rg(0,a,Yx),wobble:rg(0,a,Xx),wobbleTimer:void 0};return eS.set(e,o),o}function Gx(e,t,n){let{rest:r,translate:i,width:a,height:o}=Bx(e,t.knob);t.rest[+!!n]=r,t.now={on:n,translate:i,width:a,height:o}}function Kx(e){return e.matches(`:disabled, [aria-disabled="true"]`)}var qx,Jx,Yx,Xx,Zx,Qx,$x,eS,tS,nS=t((()=>{Xh(),Lh(),fg(),qx={stiffness:300,damping:24},Jx={stiffness:320,damping:16},Yx={stiffness:700,damping:32},Xx={stiffness:520,damping:9},Zx=170,Qx=-5,$x=`[data-slot=thumb], [data-slot=switch-thumb]`,eS=new WeakMap,tS={name:`switch`,selector:`[role=switch]`,press(e){if(Kx(e))return;let t=zx(e.getAttribute(`aria-checked`)),n=Wx(e,t);if(n)return n.position.active||Gx(e,n,t),n.press.to(1),{release:()=>n.press.to(0)}},state(e,{attribute:t,oldValue:n,value:r}){if(t!==`aria-checked`)return;let i=zx(r),a=Wx(e,zx(n));a&&(Gx(e,a,i),a.position.to(+!!i),a.size.to(+!!i),clearTimeout(a.wobbleTimer),a.wobbleTimer=void 0,jh()||(a.wobbleTimer=setTimeout(()=>{a.wobbleTimer=void 0,a.wobble.to(0,{velocity:Qx})},Zx*Zh())),Hx(e,a))}}}));function rS(e){let t=e.parentElement;if(!t||t.tagName!==`OL`&&t.tagName!==`UL`)return!1;let n=t.closest(`[role=region], [data-slot=toast-region]`);return!!n&&(vS(t)||vS(t.parentElement)||vS(n))}function iS(e){return e.top+e.height/2>innerHeight/2?`bottom`:`top`}function aS(e){return iS(e)===`bottom`?innerHeight-e.top:-(e.top+e.height)}function oS(e,t){if(t===`left`)return{axis:`x`,distance:-e.right};if(t===`right`)return{axis:`x`,distance:innerWidth-e.left};if(t===`up`)return{axis:`y`,distance:-e.bottom};if(t===`down`)return{axis:`y`,distance:innerHeight-e.top};let n=e.left+e.width/2;return Math.abs(n-innerWidth/2)<innerWidth/8?{axis:`y`,distance:aS(e)}:{axis:`x`,distance:n>innerWidth/2?innerWidth-e.left:-e.right}}function sS(e,t){let n=e.region.getAttribute(`data-align`);return n===`center`?e.region.getAttribute(`data-side`)===`top`?`up`:`down`:n===`start`||n===`end`?n===`start`==(getComputedStyle(e.region).direction===`rtl`)?`right`:`left`:t.getAttribute(`data-swipe-direction`)}function cS(e,t,n=!1){let r=`--reka-toast-swipe-${n?`end`:`move`}-${t}`;return Number.parseFloat(e.style.getPropertyValue(r)||e.style.getPropertyValue(`--toast-swipe-${t}`))||0}function lS(e,t,n,r){let i=Math.abs(t.value)<.01&&Math.abs(n.value)<.01,a=(e,t)=>`calc(${`${Math.round(e*100)/100}px`} + var(--reka-toast-swipe-move-${t}, var(--toast-swipe-${t}, 0px)))`;Z(e,{translate:i&&!t.active&&!n.active?null:`${a(t.value,`x`)} ${a(n.value,`y`)}`,opacity:r&&(r.active||r.value<1)?String(r.value):null})}function uS(e,t){let n={element:e,rest:t},r=()=>lS(e,n.x,n.y,n.fade);return n.x=rg(0,r,ig.snappy),n.y=rg(0,r,ig.snappy),n}function dS(e,t){let n=e.velocity;e.set(e.value+t),e.to(0,{velocity:n})}function fS(e){for(let t of e.items.values()){if(!t.element.isConnected)continue;let e=t.element.getBoundingClientRect(),n={left:e.left-t.x.value-cS(t.element,`x`),top:e.top-t.y.value-cS(t.element,`y`),width:e.width,height:e.height},r=t.rest.left-n.left,i=t.rest.top-n.top;t.rest=n,Math.abs(r)>.5&&dS(t.x,r),Math.abs(i)>.5&&dS(t.y,i)}}function pS(e){if(e.watchFrames=12,e.frame)return;let t=()=>{fS(e),e.watchFrames=[...e.items.values()].some(e=>e.x.active||e.y.active)?Math.max(e.watchFrames,2):e.watchFrames-1,e.frame=e.watchFrames>0?requestAnimationFrame(t):0};e.frame=requestAnimationFrame(t)}function mS(e,t){let n=e.items.get(t);if(!n)return;e.items.delete(t),n.x.stop(),n.y.stop();let r=sS(e,t),i=t.getAttribute(`data-swipe`)===`end`||t.matches(`[data-slot=toast]`)&&t.hasAttribute(`data-swipe-direction`),a=i?t.getAttribute(`data-swipe-direction`):null,o=e.region.parentNode;if(o){let s=new DOMRect(n.rest.left+n.x.value+(i?cS(t,`x`,!0):0),n.rest.top+n.y.value+(i?cS(t,`y`,!0):0),n.rest.width,n.rest.height),c=W_(t,o,e.region.nextSibling);if(Z(c,{translate:null,opacity:null}),G_(c,s),jh()){let e=rg(1,t=>{Z(c,{opacity:String(t)}),!e.active&&t===0&&c.remove()});e.to(0,{tween:gS})}else{let{axis:e,distance:t}=oS(s,a??r),n=rg(0,r=>{let i=`${Math.round(r*100)/100}px`;Z(c,{translate:e===`x`?`${i} 0px`:`0px ${i}`}),((t>0?r>=t:r<=t)||!n.active)&&(n.stop(),c.remove())},ig.snappy);n.to(t)}}fS(e),pS(e),e.items.size||(e.observer.disconnect(),_S.delete(e.element))}function hS(e){let t=e.parentElement,n=_S.get(t);if(n)return n;let r={element:t,items:new Map,observer:new MutationObserver(e=>{for(let t of e)for(let e of t.removedNodes)e instanceof HTMLElement&&!e.isConnected&&mS(r,e)}),region:t.closest(`[role=region], [data-slot=toast-region]`)??t,watchFrames:0,frame:0};return r.observer.observe(t,{childList:!0}),_S.set(t,r),n=r,n}var gS,_S,vS,yS,bS=t((()=>{Lh(),Xh(),fg(),q_(),gS=.15,_S=new WeakMap,vS=e=>!!e&&getComputedStyle(e).position===`fixed`,yS={name:`toast`,selector:`[role=region] li, [data-slot=toast]`,enter(e){if(!rS(e))return;let t=hS(e);if(t.items.has(e))return;fS(t);let n=e.getBoundingClientRect(),r=uS(e,{left:n.left,top:n.top,width:n.width,height:n.height});if(t.items.set(e,r),jh()){let t=rg(0,()=>lS(e,r.x,r.y,t));r.fade=t,t.set(0),t.to(1,{tween:gS})}else r.y.set(aS(n)),r.y.to(0);pS(t)}}}));function xS(e){let t=getComputedStyle(e);return t.clipPath===`inset(50%)`||t.clip===`rect(0px, 0px, 0px, 0px)`}function SS(e){return e.matches(`[role=tooltip]`)?e:e.querySelector(`:scope > [role=tooltip]`)}function CS(e){if(e.matches(yC))return e;if(e.matches(`[role=tooltip]`))return xS(e)?e.parentElement:e;let t=e.querySelector(`:scope > [role=tooltip]`);return t&&xS(t)?e:null}function wS(e){let t=e.getAttribute(`data-state`);return t===null?!e.hidden&&!e.hasAttribute(`data-closed`):t!==`closed`}function TS(e){let t=e.getAttribute(`data-motion-appear`);if(t!==null){let n=e.parentElement;return!t||!n?null:n.closest(t)??[...n.children].find(n=>n!==e&&n.matches(t))??null}let n=SS(e)?.id;return n?e.getRootNode().querySelector(`[aria-describedby~="${CSS.escape(n)}"]`)??document.querySelector(`[aria-describedby~="${CSS.escape(n)}"]`):null}function ES(e){let t=[`translate`,`scale`,`clip-path`,`opacity`].map(t=>[t,e.style.getPropertyValue(t)]);Z(e,{translate:null,scale:null,"clip-path":null});let n=e.getBoundingClientRect();for(let[n,r]of t)r&&e.style.setProperty(n,r);return n}function DS(e,t,n){let r=e.getAttribute(`data-side`);if(r===`top`||r===`bottom`||r===`left`||r===`right`)return r;if(!n)return`top`;let[i,a]=[[`top`,n.top-t.bottom],[`bottom`,t.top-n.bottom],[`left`,n.left-t.right],[`right`,t.left-n.right]].reduce((e,t)=>t[1]>e[1]?t:e);if(a>=0)return i;let o=n.left+n.width/2-(t.left+t.width/2),s=n.top+n.height/2-(t.top+t.height/2);return Math.abs(s)>=Math.abs(o)?s>0?`top`:`bottom`:o>0?`left`:`right`}function OS(e,t,n){return e===`top`?n?.top??t.bottom+8:e===`bottom`?n?.bottom??t.top-8:e===`left`?n?.left??t.right+8:n?.right??t.left-8}function kS(e){let{rest:t,side:n,edge:r}=e;return n===`top`?r+t.height/2:n===`bottom`?r-t.height/2:n===`left`?r+t.width/2:r-t.width/2}function AS(e){return[...e.element.children].filter(t=>t instanceof HTMLElement&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!xS(t))}function jS(e){return[...e.element.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE||t instanceof Element&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!xS(t)).map(e=>e.textContent??``).join(``)}function MS(e){return[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())}function NS(e){let{element:t,rest:n,side:r,edge:i,origin:a}=e,o=Math.max(1,e.width.value),s=e.mode===`clip`&&o<n.width,c=s?1:o/n.width,l=e.x.value-o/2,u=s?e.x.value-(n.left+n.width/2):l-n.left-a*(1-c),d=e.y.value-(n.top+n.height/2),f=[-40,-40,-40,-40];r===`top`&&(f[2]=e.y.value+n.height/2-i),r===`bottom`&&(f[0]=i-(e.y.value-n.height/2)),r===`left`&&(f[1]=(e.x.value+o/2-i)/c),r===`right`&&(f[3]=(i-(e.x.value-o/2))/c);let p=f.some(e=>e>0),m=null;if(s){let t=(n.width-o)/2;m=`inset(${[Math.max(0,f[0]),t+Math.max(0,f[1]),Math.max(0,f[2]),t+Math.max(0,f[3])].map(xC).join(` `)} round ${e.radius})`}else p&&(m=`inset(${f.map(xC).join(` `)})`);Z(t,{translate:Math.abs(u)>.01||Math.abs(d)>.01||e.old?`${xC(u)} ${xC(d)}`:null,scale:Math.abs(c-1)>.001?`${c} 1`:null,"clip-path":m,opacity:e.fade.active||e.fade.value<1?String(e.fade.value):null});let h=Math.abs(c-1)>.001?`${1/c} 1`:null,g=e.label.value;for(let t of AS(e))Z(t,{scale:h,opacity:g<1?String(g):null,filter:g<1?`blur(${xC((1-g)*6)})`:null});if(e.old){let t=e.old.spring.value;Z(e.old.element,{scale:h,opacity:String(t),filter:`blur(${xC((1-t)*5)})`})}}function PS(e){return e.holding||e.timers.size>0||[e.x,e.y,e.width,e.label,e.fade,e.old?.spring].some(e=>e?.active)}function FS(e){if(!PS(e)){e.old?.element.remove(),e.old=void 0,Z(e.element,{translate:null,scale:null,"clip-path":null,opacity:null});for(let t of AS(e))Z(t,{scale:null,opacity:null,filter:null});e.done?.()}}function IS(e,t,n){let r=getComputedStyle(e),i=DS(e,t,n),a={element:e,rest:t,origin:Number.parseFloat(r.transformOrigin)||t.width/2,side:i,edge:OS(i,t,n),trigger:n,mode:MS(e)||e.matches(yC)?`clip`:`scale`,handoff:!e.matches(yC),radius:r.borderRadius||`0px`,timers:new Set,holding:!0},o=()=>{NS(a),FS(a)};return a.x=rg(t.left+t.width/2,o,nC),a.y=rg(t.top+t.height/2,o,nC),a.width=rg(t.width,o,iC),a.label=rg(1,o),a.fade=rg(1,o),a}function LS(e,t,n){let r=K_(t,()=>{e.timers.delete(r),n(),FS(e)});e.timers.add(r)}function RS(e){for(let t of e.timers)clearTimeout(t);e.timers.clear();for(let t of[e.x,e.y,e.width,e.label,e.fade,e.old?.spring])t?.stop()}function zS(e){RS(e),_C.delete(e),vC===e&&(vC=void 0),e.element.closest(`[data-motion=none]`)?.remove()}function BS(e){if(e){for(let e of _C)zS(e);for(let e of gC){let t=hC.get(e)?.box;t&&(RS(t),t.holding=!0,t.x.set(t.rest.left+t.rest.width/2),t.y.set(t.rest.top+t.rest.height/2),t.width.set(t.rest.width),t.label.set(1),t.fade.set(1),t.holding=!1,FS(t))}}}function VS(e,t){let n=e.trigger,r=t.trigger;return!n||!r||e.side!==t.side?!1:bC(t.side)?n.top<r.bottom&&r.top<n.bottom:n.left<r.right&&r.left<n.right}function HS(e){return bC(e.side)?e.y:e.x}function US(e,t,n){if(!t.length)return;let r=document.createElement(`span`);r.setAttribute(`aria-hidden`,`true`),Object.assign(r.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`inherit`,pointerEvents:`none`,whiteSpace:`nowrap`}),r.append(...t),e.element.append(r);let i=rg(n,()=>{NS(e),FS(e)});e.old={element:r,spring:i},i.to(0,{tween:fC})}function WS(e){return e.mode===`clip`?[...e.element.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.cloneNode()):AS(e).map(e=>{let t=e.cloneNode(!0);return t.style.removeProperty(`scale`),t.style.removeProperty(`opacity`),t.style.removeProperty(`filter`),t})}function GS(e,t){let n=t.trigger?.getBoundingClientRect(),r=ES(e),i=IS(e,r,n);t.box=i,t.text=jS(i),t.label=WS(i),Z(e,{opacity:null});let a=i.handoff&&vC&&VS(vC,i)?vC:void 0;if(a&&(vC=void 0),jh())a&&KS(a,!0),i.fade.set(0),i.holding=!1,i.fade.to(1,{tween:mC});else if(a){let e=WS(a),t={x:[a.x.value,a.x.velocity],y:[a.y.value,a.y.velocity],width:[a.width.value,a.width.velocity]},n=a.old?0:a.label.value;zS(a),i.x.set(t.x[0]),i.y.set(t.y[0]),i.width.set(t.width[0]),i.label.set(0),US(i,e,n),i.x.to(r.left+r.width/2,{preset:nC,velocity:t.x[1]}),i.y.to(r.top+r.height/2,{preset:nC,velocity:t.y[1]}),i.width.to(r.width,{preset:iC,velocity:t.width[1]}),LS(i,cC,()=>i.label.to(1,{tween:dC})),i.holding=!1,NS(i)}else HS(i).set(kS(i)),i.width.set(Math.min(aC,r.width)),i.label.set(0),NS(i),HS(i).to(bC(i.side)?r.top+r.height/2:r.left+r.width/2,{preset:rC}),LS(i,oC,()=>{i.width.to(r.width,{preset:iC}),LS(i,sC,()=>i.label.to(1,{tween:dC}))}),i.holding=!1}function KS(e,t){_C.add(e),e.holding=!1,t?(e.done=()=>zS(e),e.fade.to(0,{tween:mC})):(e.handoff&&(vC=e),e.old&&e.old.spring.to(0,{tween:pC}),e.label.to(0,{tween:pC}),e.width.to(Math.min(aC,e.rest.width),{preset:iC}),LS(e,lC,()=>{vC===e&&(vC=void 0),HS(e).to(kS(e),{preset:rC})}),LS(e,uC,()=>zS(e)))}function qS(e,t){if(!t.open)return;t.open=!1,gC.delete(e),t.stopWatch?.(),t.stopWatch=void 0,gC.size||tC();let n=t.box;if(t.box=void 0,Z(e,{opacity:null}),!n)return;let r=t.root.parentNode??t.parent,i=r?.isConnected?W_(t.root,r,t.root.isConnected?t.root.nextSibling:t.next):void 0,a={x:n.x,y:n.y,width:n.width,label:n.label,fade:n.fade},o=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,[t.value,t.velocity]])),s=n.old?.spring.value;RS(n),n.old?.element.remove(),Z(e,{translate:null,scale:null,"clip-path":null,opacity:null});for(let e of AS(n))Z(e,{scale:null,opacity:null,filter:null});if(!i)return;let c=JS(t.root,e).reduce((e,t)=>e?.children[t],i);if(!(c instanceof HTMLElement)){i.remove();return}e.hasAttribute(`popover`)&&(Z(c,{scale:null}),G_(c,n.rest));let l=IS(c,n.rest,void 0);Object.assign(l,{side:n.side,edge:n.edge,trigger:n.trigger,mode:n.mode,origin:n.origin,radius:n.radius,handoff:n.handoff});let u=c.querySelector(`:scope > [aria-hidden=true][style*=absolute]`);s!==void 0&&u&&(l.old={element:u,spring:rg(s,()=>NS(l))});for(let e of[`x`,`y`,`width`,`label`,`fade`])l[e].set(o[e][0]);NS(l);for(let e of[`x`,`y`,`width`])o[e][1]&&l[e].to(o[e][0],{velocity:o[e][1]});KS(l,jh())}function JS(e,t){let n=[];for(let r=t;r!==e&&r.parentElement;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function YS(e,t,n,r=20){requestAnimationFrame(()=>{if(!t.open||!e.isConnected)return;let i=e.closest(`[data-reka-popper-content-wrapper]`);if(r>0&&i?.style.transform.includes(`-200%`))return YS(e,t,n,r-1);n()})}function XS(e,t){let n=()=>{r.disconnect();let t=e;for(;t;){let e=t.parentNode;e&&r.observe(e,{childList:!0}),t=e??(t instanceof ShadowRoot?t.host:null)}},r=new MutationObserver(()=>{e.isConnected?(t.parent=t.root.parentNode,t.next=t.root.nextSibling,n()):qS(e,t)});return n(),()=>r.disconnect()}function ZS(e){let t=hC.get(e);if(t?.open)return;let n=TS(e);if(n&&Eg(n))return;let r=e.closest(`[data-reka-popper-content-wrapper]`)??e;t={open:!0,root:r,parent:r.parentNode,next:r.nextSibling,text:``,label:[],trigger:n},hC.set(e,t),gC.add(e),eC(),Z(e,{opacity:`0`}),t.stopWatch=XS(e,t);let i=t;YS(e,t,()=>GS(e,i))}function QS(){SC=0;for(let e of gC){let t=hC.get(e),n=t?.box;if(!t||!n)continue;let r=ES(e),i=jS(n),a=Math.abs(r.left-n.rest.left)>1||Math.abs(r.top-n.rest.top)>1||Math.abs(r.width-n.rest.width)>1,o=(a||Math.abs(r.height-n.rest.height)>1)&&!n.handoff&&!PS(n)&&Math.abs(r.left+r.width/2-(n.rest.left+n.rest.width/2))<=1&&Math.abs(r.top-n.rest.top)<=1;if(!a&&!o&&i===t.text)continue;let s=i===t.text?[]:t.label;t.trigger=TS(e)??t.trigger;let c=t.trigger?.getBoundingClientRect();t.text=i,t.label=WS(n),n.rest=r,n.side=DS(e,r,c),n.edge=OS(n.side,r,c),jh()||o?(n.x.set(r.left+r.width/2),n.y.set(r.top+r.height/2),n.width.set(r.width)):(n.x.to(r.left+r.width/2,{preset:nC}),n.y.to(r.top+r.height/2,{preset:nC}),n.width.to(r.width,{preset:iC}),s.length&&(n.old?.spring.stop(),n.old?.element.remove(),US(n,s,n.label.value),n.label.set(0),LS(n,cC,()=>n.label.to(1,{tween:dC}))))}}function $S(){SC||=requestAnimationFrame(QS)}function eC(){wC??=Mh(BS),CC||(CC=!0,document.addEventListener(`pointerover`,$S,{capture:!0,passive:!0}),document.addEventListener(`focusin`,$S,{capture:!0,passive:!0}))}function tC(){CC=!1,cancelAnimationFrame(SC),SC=0,document.removeEventListener(`pointerover`,$S,{capture:!0}),document.removeEventListener(`focusin`,$S,{capture:!0})}var nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC=t((()=>{r_(),Lh(),Xh(),fg(),q_(),nC={stiffness:480,damping:36},rC={stiffness:380,damping:26},iC={stiffness:440,damping:32},aC=30,oC=120,sC=70,cC=40,lC=90,uC=520,dC=.24,fC=.15,pC=.14,mC=.15,hC=new WeakMap,gC=new Set,_C=new Set,yC=`[data-motion-appear]`,bC=e=>e===`top`||e===`bottom`,xC=e=>`${Math.round(e*100)/100}px`,SC=0,CC=!1,TC={enter(e){CS(e)===e&&wS(e)&&ZS(e)},state(e){if(CS(e)!==e)return;let t=hC.get(e);wS(e)?ZS(e):t&&qS(e,t)}},EC={name:`tooltip`,selector:`[role=tooltip], :has(> [role=tooltip])`,...TC},DC={name:`appear`,selector:yC,...TC}})),kC,AC=t((()=>{fv(),Tv(),Tg(),Iv(),Ty(),My(),Wy(),cb(),tx(),Lx(),nS(),bS(),OC(),kC=[sb,ex,tS,dv,Fv,EC,DC,yS,Ix,wg,Cy,wy,wv,jy,Uy]}));function jC(e){let t=s_(e);return t.style.gridArea=`1 / 1`,{node:t,shown:1}}function MC(e){let t=i_(document.createElement(`span`));t.style.cssText=`display:inline-grid;overflow:hidden;justify-items:center`;let n=e?jC(e):void 0;return n&&t.append(n.node),{node:t,char:e,current:n,leaving:new Set}}function NC(e,t,n,r){e.shown=t;let i=1-t;Z(e.node,{opacity:t>=1?null:String(Math.max(0,t)),filter:r||t>=1?null:`blur(${Math.max(0,BC*i).toFixed(2)}px)`,scale:r||t===1?null:String(1-.44999999999999996*i),translate:r||t===1?null:`0 ${(n*zC*i).toFixed(3)}em`})}function PC(e){return!e.frame.width.active&&e.columns.every(e=>!e.leaving.size&&!e.current?.fade)}function FC(e,t){WC.get(e)===t&&PC(t)&&(WC.delete(e),t.frame.collapse(t.text))}function IC(e,t,n=String){let r=n(t),i=WC.get(e),a=i?.text??e.textContent??``,o=i?.value??GC.get(e)??LC(a);if(GC.set(e,t),o===void 0||!i&&a===r||l_(e)){if(i){for(let e of i.columns)for(let t of[e.current,...e.leaving])t?.fade?.stop();WC.delete(e)}p_(e,r);return}let s=t>o?1:t<o?-1:0,c=u_();if(!i){let t=d_(e)??f_(e,`end`,()=>{let t=WC.get(e);t&&FC(e,t)}),n=[...a].map(MC);t.holder.append(...n.map(e=>e.node)),t.width.set(t.natural()),i={frame:t,text:a,value:o,columns:n},WC.set(e,i)}let l=i;l.frame.restore(),l.text=r,l.value=t,l.frame.name(r);let u=[...r],d=Math.max(u.length,l.columns.length);for(;l.columns.length<d;){let e=MC(``);l.frame.holder.prepend(e.node),l.columns.unshift(e)}let f=d-u.length;l.columns.forEach((t,n)=>{let r=u[n-f]??``;if(r===t.char)return;t.char=r;let i=t.current;if(i&&(i.fade?.stop(),t.leaving.add(i),i.fade=S_(i.shown,0,c?{duration:UC,ease:E_}:VC,e=>NC(i,e,-s,c),()=>{i.fade=void 0,i.node.remove(),t.leaving.delete(i),RC(e,l)})),t.current=void 0,!r)return;let a=jC(r);t.current=a,t.node.append(a.node),NC(a,0,s,c),a.fade=S_(0,1,c?{duration:UC,ease:E_}:HC,e=>NC(a,e,s,c),()=>{a.fade=void 0,NC(a,1,s,c),RC(e,l)})});let p=l.frame.width,m=l.columns.filter(e=>!e.char);for(let e of m)e.node.style.display=`none`;let h=l.frame.natural();for(let e of m)e.node.style.display=`inline-grid`;c?p.set(h):p.to(h)}function LC(e){let t=e.replace(/[^\d.-]/g,``),n=t?Number(t):NaN;return Number.isFinite(n)?n:void 0}function RC(e,t){WC.get(e)===t&&(t.columns=t.columns.filter(e=>e.char||e.leaving.size?!0:(e.node.remove(),!1)),FC(e,t))}var zC,BC,VC,HC,UC,WC,GC,KC=t((()=>{Xh(),b_(),D_(),zC=1,BC=2,VC={duration:240,ease:T_},HC={duration:380,delay:60,ease:x_(.3,1.4,.5,1)},UC=150,WC=new WeakMap,GC=new WeakMap}));function qC(e,t,n){let r=e.width?n.width/e.width:1,i=e.height?n.height/e.height:1;return{x:n.left-t.x-r*(e.left-t.x),y:n.top-t.y-i*(e.top-t.y),scaleX:r,scaleY:i}}function JC(e){let{translate:t,scale:n}=e.style;Z(e,{translate:null,scale:null});let r=e.getBoundingClientRect();Z(e,{scale:`0.5`});let i=e.getBoundingClientRect();Z(e,{translate:`100px 100px`});let a=e.getBoundingClientRect();return Z(e,{translate:t,scale:n}),{box:r,origin:{x:2*i.left-r.left,y:2*i.top-r.top},pixels:{x:(a.left-i.left)/100||1,y:(a.top-i.top)/100||1}}}function YC(e,t){let n=XC.get(e);if(c_(e)||u_())return n?.stop(),{done:Promise.resolve(!1),stop(){}};let{box:r,origin:i,pixels:a}=JC(e),o=t.to??r,s=t.preset??ig.snappy,c,l=new Promise(e=>{c=e}),u=()=>{if(XC.get(e)!==h)return;let n=qC(r,i,{left:f.left.value,top:f.top.value,width:f.width.value,height:f.height.value});Z(e,{translate:`${n.x/a.x}px ${n.y/a.y}px`,scale:`${n.scaleX} ${n.scaleY}`}),ZC.some(e=>f[e].active)||(m(),t.to||(XC.delete(e),Z(e,{translate:null,scale:null})),c(!0))},d=e=>rg(t.from?.[e]??n?.parts[e].value??r[e],u,s),f={left:d(`left`),top:d(`top`),width:d(`width`),height:d(`height`)},p=ZC.map(e=>n?.parts[e].velocity??0),m=Mh(e=>{if(e)for(let e of ZC)f[e].set(o[e])}),h={parts:f,stop(){if(XC.get(e)===h){m();for(let e of ZC)f[e].stop();XC.delete(e),Z(e,{translate:null,scale:null}),c(!1)}}};return n?.stop(),XC.set(e,h),ZC.forEach((e,t)=>f[e].to(o[e],{velocity:p[t]})),u(),{done:l,stop:h.stop}}var XC,ZC,QC=t((()=>{Lh(),Xh(),fg(),b_(),XC=new WeakMap,ZC=[`left`,`top`,`width`,`height`]}));function $C(e){let t=e.cloneNode(!0);t.inert=!0,t.setAttribute(`aria-hidden`,`true`);for(let e of[t,...t.querySelectorAll(`[id], [name], [form], input, button, select, textarea, fieldset`)])e.removeAttribute(`id`),e.removeAttribute(`name`),e.removeAttribute(`form`),e.matches(`input, button, select, textarea, fieldset`)&&e.setAttribute(`disabled`,``);return t}var ew=t((()=>{}));function tw(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function nw(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(lw))}function rw(e,t={}){let n=t.items??nw,r=new Map,i=new Set,a=new Map,o=!1;function s(e){if(!e)return{x:0,y:0};let t=1-e.grow.value;return{x:e.x.value+e.from.x*t,y:e.y.value+e.from.y*t}}function c(e,t){let{x:n,y:i,grow:a,from:c}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){Z(e,{translate:null,scale:null,opacity:null}),o||r.delete(e);return}let{x:l,y:u}=s(t),d=c.scale+(1-c.scale)*a.value;Z(e,{translate:l||u?`${l.toFixed(2)}px ${u.toFixed(2)}px`:null,scale:d===1?null:d.toFixed(4),opacity:a.value>=1?null:Math.max(0,Math.min(1,a.value)).toFixed(3)})}function l(e){let t=r.get(e);if(t)return t;let n=()=>t&&c(e,t);return t={x:rg(0,n,ig.snappy),y:rg(0,n,ig.snappy),grow:rg(1,n,iw),from:{x:0,y:0,scale:1}},r.set(e,t),t}function u(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),Z(e,{translate:null,scale:null,opacity:null}))}function d(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:ig.snappy,velocity:n})}function f(t,n,r){if(!tw(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let o=$C(t);o.setAttribute(lw,``),Object.assign(o.style,{boxSizing:`border-box`,height:`${n.height}px`,left:`${n.left-a.left-e.clientLeft+e.scrollLeft}px`,margin:`0`,pointerEvents:`none`,position:`absolute`,top:`${n.top-a.top-e.clientTop+e.scrollTop}px`,width:`${n.width}px`}),Z(o,{translate:null,scale:null,opacity:null,filter:null}),e.append(o);let s={element:o,stop:()=>{}},c=()=>{s.stop(),o.remove(),i.delete(s)};if(i.add(s),jh()){let e=C_(.15,e=>Z(o,{opacity:(1-e).toFixed(3)}));s.stop=e.stop,e.done.then(c);return}if(r){let e=uw(r.getBoundingClientRect()),t=uw(n),i=C_(sw,n=>{Z(o,{translate:`${((e.x-t.x)*n).toFixed(2)}px ${((e.y-t.y)*n).toFixed(2)}px`,scale:(1-.8*n).toFixed(4),opacity:(1-n).toFixed(3),filter:n>0?`blur(${(3*n).toFixed(2)}px)`:null})},cw);s.stop=i.stop,i.done.then(c);return}let l=rg(1,e=>{Z(o,{scale:(ow+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&c()},aw);s.stop=()=>l.stop(),l.to(0)}return{measure(){a=new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=uw(e),i=s(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let c=a;a=new Map;let p=Eg(e),m=n(e),h=new Set(m),g=m.map(e=>{let t=e.getBoundingClientRect(),n=s(r.get(e)),i=uw(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),_=g.map(({element:e})=>{if(!c.has(e)&&i.origin)return(typeof i.origin==`function`?i.origin(e):i.origin)?.getBoundingClientRect()});for(let[e,{rect:n}]of c)h.has(e)||(u(e),p||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||f(e,n,i.target));o=!0,g.forEach(({element:e,rect:n,layout:r},i)=>{if(p)return u(e);let a=c.get(e);if(a){let t=a.x-r.x,i=a.y-r.y;if(Math.abs(t)<.5&&Math.abs(i)<.5)return;if(!tw(a.rect)&&!tw(n))return u(e);let o=l(e);d(o.x,o.x.value+t),d(o.y,o.y.value+i);return}if(!tw(n)||t.movesOnly)return;let o=l(e),s=_[i];if(jh())o.from={x:0,y:0,scale:1};else if(s){let e=uw(s),t=Math.min(1,Math.max(.2,Math.min(s.width/(n.width||1),s.height/(n.height||1))));o.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else o.from={x:0,y:0,scale:ow};o.grow.set(0),o.grow.to(1,jh()?{tween:.15}:{preset:iw})}),o=!1},destroy(){for(let e of r.keys())u(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=new Map}}}var iw,aw,ow,sw,cw,lw,uw,dw=t((()=>{D_(),ew(),r_(),Lh(),Xh(),fg(),iw={stiffness:380,damping:26},aw={stiffness:260,damping:28},ow=.9,sw=.32,cw=x_(.5,0,.75,0),lw=`data-motion-ghost`,uw=e=>({x:e.left+e.width/2,y:e.top+e.height/2})}));function fw(e){let t=e.closest(`[role=dialog], [role=alertdialog]`)??e.ownerDocument.body;for(let e of t.children)if(e instanceof HTMLElement&&e.dataset.slot===hw)return e;let n=e.ownerDocument.createElement(`div`);return n.dataset.slot=hw,n.setAttribute(`aria-live`,`polite`),n.setAttribute(`aria-atomic`,`true`),n.style.cssText=gw,t.append(n),n}function pw(e){e&&fw(e)}function mw(e,t,n=2e3){if(!e)return;let r=fw(e);clearTimeout(_w.get(r)),r.textContent=``,requestAnimationFrame(()=>{r.textContent=t}),_w.set(r,setTimeout(()=>r.textContent=``,n))}var hw,gw,_w,vw=t((()=>{hw=`live-announcer`,gw=`position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0`,_w=new WeakMap})),yw=t((()=>{r_(),AC(),fv(),Tv(),Tg(),Iv(),Ty(),My(),Wy(),cb(),tx(),Lx(),nS(),bS(),OC(),Xh(),Lh(),fg(),xy(),ry(),KC(),b_(),D_(),P_(),QC(),dw(),vw()}));function bw(e){return typeof document>`u`?()=>{}:Kg(e??document,{effects:kC})}var xw=t((()=>{AC(),r_()})),Sw=t((()=>{yw(),xw()}));function Cw(e){let t=e instanceof Element?e:e?.$el;return t instanceof HTMLElement?t:void 0}var ww=t((()=>{})),Tw,Ew=t((()=>{X(),Sw(),ww(),Tw=U({inheritAttrs:!1,__name:`MotionList`,props:{origin:{type:Function},target:{type:Function}},setup(e){let t=Gl(),n,r;function i(e){let t=Cw(e);t!==n&&(r?.destroy(),n=t,r=t?rw(t):void 0)}Od(()=>r?.measure()),kd(()=>r?.play({origin:e.origin,target:e.target?.()})),Ad(()=>{r?.destroy(),r=void 0,n=void 0});let a=()=>q(rf,t.default?.());return(e,t)=>Ul(e.$slots,`render`,{props:{...e.$attrs,"data-slot":`motion-list`,ref:i},children:a()},()=>[K(`div`,zu(e.$attrs,{ref:i,"data-slot":`motion-list`}),[Ul(e.$slots,`default`)],16)])}})})),Dw,Ow=t((()=>{Ew(),Ew(),Dw=Tw})),kw,Aw=t((()=>{X(),Sw(),ww(),kw=U({inheritAttrs:!1,__name:`RollNumber`,props:{value:{},format:{type:Function},text:{}},setup(e){let t=e,n=e=>t.text??(t.format??String)(e),r=n(t.value),i=Ks();function a(e){let r=Cw(e);r&&(i.value&&r!==i.value&&(r.textContent=n(t.value)),i.value=r)}return H(()=>[i.value,t.value,t.text,t.format],([e,t])=>{e&&IC(e,t,n)},{flush:`post`}),(e,t)=>Ul(e.$slots,`render`,{props:{...e.$attrs,"data-slot":`roll-number`,style:[e.$attrs.style,{fontVariantNumeric:`tabular-nums`}],ref:a},children:Pu(V(r))},()=>[K(`span`,zu(e.$attrs,{ref:a,"data-slot":`roll-number`,style:{fontVariantNumeric:`tabular-nums`}}),Qo(V(r)),17)])}})})),jw,Mw=t((()=>{Aw(),Aw(),jw=kw})),Nw=t((()=>{X(),Sw(),Ow(),Mw()})),Pw=t((()=>{Nw()}));function Fw(e){return ul(Iw,void 0)?.[e]??gf()?.appContext.components[e]}var Iw,Lw=t((()=>{X(),Iw=Symbol(`ViteHubUIComponents`)}));function Rw(){let e=ul(zw,void 0);return Y(()=>({...Bw,...Object.fromEntries(Object.entries(Js(e)??{}).filter(([,e])=>e))}))}var zw,Bw,Vw=t((()=>{X(),zw=Symbol(`ViteHubUIIcons`),Bw={arrowLeft:`i-lucide-arrow-left`,arrowUp:`i-lucide-arrow-up`,check:`i-lucide-check`,chevronLeft:`i-lucide-chevron-left`,chevronRight:`i-lucide-chevron-right`,close:`i-lucide-x`,copy:`i-lucide-copy`,copyCheck:`i-lucide-check`,loading:`i-lucide-loader-circle`,external:`i-lucide-external-link`,file:`i-lucide-file`,plus:`i-lucide-plus`,reload:`i-lucide-refresh-cw`,stop:`i-lucide-square`,comment:`i-lucide-message-circle`,commentList:`i-lucide-list`,commentPage:`i-lucide-square-pen`,delete:`i-lucide-trash-2`,edit:`i-lucide-pencil`,reopen:`i-lucide-rotate-ccw`}})),Hw,Uw=t((()=>{Hw={"i-lucide-arrow-left":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m12 19l-7-7l7-7m7 7H5`}]],"i-lucide-arrow-up":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m5 12l7-7l7 7m-7 7V5`}]],"i-lucide-arrow-up-right":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 7h10v10M7 17L17 7`}]],"i-lucide-check":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 6L9 17l-5-5`}]],"i-lucide-circle-alert":[[`circle`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,cx:`12`,cy:`12`,r:`10`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4m0 4h.01`}]],"i-lucide-copy":[[`rect`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],"i-lucide-external-link":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]],"i-lucide-file":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M14 2v5a1 1 0 0 0 1 1h5`}]],"i-lucide-inbox":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M22 12h-6l-2 3h-4l-2-3H2`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11`}]],"i-lucide-list":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 5h.01M3 12h.01M3 19h.01M8 5h13M8 12h13M8 19h13`}]],"i-lucide-loader-circle":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 12a9 9 0 1 1-6.219-8.56`}]],"i-lucide-message-circle":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092a10 10 0 1 0-4.777-4.719`}]],"i-lucide-pencil":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4`}]],"i-lucide-plus":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-7-7v14`}]],"i-lucide-refresh-cw":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 16H3v5`}]],"i-lucide-rotate-ccw":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 3v5h5`}]],"i-lucide-send":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11zm7.318-19.539l-10.94 10.939`}]],"i-lucide-square":[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,rx:`2`}]],"i-lucide-square-pen":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}],[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`}]],"i-lucide-trash-2":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]],"i-lucide-x":[[`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M18 6L6 18M6 6l12 12`}]]}}));function Ww(e){let t=e.getRootNode();return t instanceof ShadowRoot?t:e.ownerDocument.body}function Gw(e){e.component(`UButton`,qw),e.component(`UIcon`,Kw),e.component(`UModal`,Jw),e.component(`UTooltip`,Yw)}var Kw,qw,Jw,Yw,Xw=t((()=>{X(),Uw(),Kw=U({name:`UIcon`,inheritAttrs:!1,props:{name:{default:``,type:String}},setup(e,{attrs:t}){return()=>{let n=Hw[e.name];return n?q(`svg`,{...t,"aria-hidden":`true`,"data-slot":`standalone-icon`,fill:`none`,viewBox:`0 0 24 24`},n.map(([e,t])=>q(e,t))):q(`span`,{...t,"aria-hidden":`true`,"data-slot":`standalone-icon`})}}}),qw=U({name:`UButton`,inheritAttrs:!1,props:{color:{default:`primary`,type:String},disabled:{default:!1,type:Boolean},icon:{type:String},label:{type:String},loading:{default:!1,type:Boolean},size:{default:`md`,type:String},square:{default:!1,type:Boolean},to:{type:String},type:{default:`button`,type:String},variant:{default:`solid`,type:String}},setup(e,{attrs:t,slots:n}){return()=>{let r={...t,"aria-busy":e.loading?`true`:void 0,"data-color":e.color,"data-size":e.size,"data-square":e.square||!e.label&&!n.default?`true`:void 0,"data-variant":e.variant,"data-standalone-button":``},i=[e.icon?q(Kw,{name:e.icon}):null,e.label?q(`span`,e.label):null,n.default?.()];return e.to?q(`a`,{...r,href:e.to},i):q(`button`,{...r,disabled:e.disabled||e.loading,type:e.type},i)}}}),Jw=U({name:`UModal`,inheritAttrs:!1,props:{title:{type:String},ui:{default:()=>({}),type:Object}},setup(e,{slots:t}){let n=B(!1),r=B(null),i=B(null),a=()=>{n.value=!1,r.value?.querySelector(`button, a`)?.focus()},o=e=>{e.key===`Escape`&&n.value&&(e.stopPropagation(),a())};return H(n,e=>{e&&requestAnimationFrame(()=>i.value?.focus())}),Ad(()=>{n.value=!1}),()=>{let s=e.ui;return[q(`span`,{"data-slot":`standalone-modal-trigger`,onClick:()=>n.value=!0,ref:r},t.default?.()),n.value&&r.value?q(bd,{to:Ww(r.value)},q(`div`,{class:s.overlay,"data-slot":`standalone-modal`,onClick:e=>e.target===e.currentTarget&&a()},q(`div`,{"aria-label":e.title,"aria-modal":`true`,class:s.content,onKeydown:o,ref:i,role:`dialog`,tabindex:-1},t.content?.({close:a})))):null]}}}),Yw=U({name:`UTooltip`,inheritAttrs:!1,props:{text:String},setup(e,{slots:t}){return()=>(t.default?.()??[]).map(t=>Nu(t,{title:e.text}))}})})),Zw=n({uiSdkComponents:()=>$w}),Qw,$w,eT=t((()=>{Xw(),Qw={name:`StandIn`,render:()=>null},$w={UButton:qw,UIcon:Kw,UModal:Jw,UTooltip:Yw,UDropdownMenu:Qw,UInput:Qw,UTabs:Qw}}));function tT(e){return Al({loader:()=>Promise.resolve(Zw).then(t=>t.uiSdkComponents[e]),suspensible:!1})}function nT(e){let t=Fw(e);if(t)return t;let n=rT.get(e)??tT(e);return rT.set(e,n),n}var rT,iT=t((()=>{eT(),X(),Lw(),rT=new Map}));function aT(e){if(!e)return!1;if(/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(e)||e.startsWith(`blob:`))return!0;try{let t=new URL(e,`https://vitehub.invalid`);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}var oT,sT=t((()=>{X(),Vw(),iT(),oT=U({name:`ImagePreview`,inheritAttrs:!1,props:{alt:{default:``,type:String},compact:{default:!1,type:Boolean},src:{default:``,type:String},title:{type:String}},setup(e){let t=B(!1),n=Y(()=>e.alt||e.title||`Image`),r=nT(`UModal`),i=nT(`UButton`),a=Rw();return H(()=>e.src,()=>{t.value=!1}),()=>aT(e.src)?q(r,{title:n.value,transition:!1,ui:{overlay:`vh-image-overlay`,content:`vh-image-dialog`}},{default:()=>q(`button`,{"aria-label":`Preview ${n.value}`,class:[`vh-image-preview`,e.compact&&`vh-image-preview--compact`],title:e.title||n.value,type:`button`},t.value?q(`span`,{class:`vh-image-unavailable`},`Image unavailable`):q(`img`,{alt:n.value,loading:`lazy`,onError:()=>{t.value=!0},src:e.src})),content:({close:r})=>[q(`div`,{class:`vh-image-dialog__toolbar`},[q(`span`,{class:`vh-image-dialog__name`,title:n.value},n.value),q(i,{"aria-label":`Open original image`,class:`vh-image-dialog__action`,color:`neutral`,icon:a.value.external,external:!0,to:e.src,target:`_blank`,rel:`noreferrer`,variant:`ghost`}),q(i,{"aria-label":`Close image preview`,class:`vh-image-dialog__action`,color:`neutral`,icon:a.value.close,onClick:r,variant:`ghost`})]),t.value?q(`p`,{class:`vh-image-dialog__error`,role:`status`},`Image unavailable. The file may have been moved or deleted.`):q(`img`,{alt:n.value,class:`vh-image-dialog__image`,onError:()=>{t.value=!0},src:e.src})]}):q(`span`,{class:`vh-image-unavailable`},n.value)}})})),cT,lT,uT=t((()=>{X(),Pw(),Vw(),dw(),QC(),sT(),iT(),cT=250,lT=U({name:`CommentImageStack`,props:{images:{required:!0,type:Array},disabled:{default:!1,type:Boolean},origin:{type:Function}},emits:[`remove`],setup(e,{emit:t}){let n=Rw(),r=nT(`UButton`),i=B(),a=B(),o=B(!1),s=B({left:0,width:0,scrollable:!1,below:!1}),c,l,u,d=!1,f=!1,p=!1,m,h=()=>[...a.value?.children??[]].filter(e=>e instanceof HTMLElement&&e.hasAttribute(`data-key`)&&!e.hasAttribute(`data-motion-ghost`));function g(){let t=i.value;if(!t)return;let n=(t.closest(`[data-slot=comment-composer-box]`)??t).getBoundingClientRect(),r=Math.max(0,n.left),a=t.ownerDocument.documentElement,o=Math.max(0,Math.min(a.clientWidth,n.right)-r),c=t.getBoundingClientRect(),l=r-c.left,u=Number.parseFloat(getComputedStyle(a).fontSize)||16,d=o<(e.images.length*4+.5)*u,f=c.top<4.5*u&&a.clientHeight-c.bottom>c.top;(s.value.left!==l||s.value.width!==o||s.value.scrollable!==d||s.value.below!==f)&&(s.value={left:l,width:o,scrollable:d,below:f})}function _(t){clearTimeout(u),t&&e.images.length===0&&(t=!1),o.value!==t&&(m=new Map(h().map(e=>[e,e.getBoundingClientRect()])),t&&g(),o.value=t)}let v=()=>{clearTimeout(u),u=setTimeout(()=>{!f&&!d&&_(!1)},cT)};Dd(()=>{a.value&&(l=rw(a.value));let e=i.value?.closest(`[data-slot=comment-composer-box]`);e&&typeof ResizeObserver<`u`&&(c=new ResizeObserver(()=>{o.value&&g()}),c.observe(e))}),Od(()=>{m||l?.measure()}),kd(()=>{e.images.length===0&&o.value&&_(!1),o.value&&g();let t=m;if(m=void 0,!t)return l?.play({origin:e.origin?.()??void 0});for(let[e,n]of t)e.isConnected&&YC(e,{from:n})}),Ad(()=>{clearTimeout(u),c?.disconnect(),l?.destroy()});let y=Y(()=>e.images.length===1?`1 picture`:`${e.images.length} pictures`);return()=>{let c=e.images.length;return q(`div`,{"data-fanned":o.value?`true`:void 0,"data-slot":`comment-image-stack`,onFocusin:e=>{f=!0,p||e.target instanceof Element&&e.target.matches(`:focus-visible`)&&_(!0)},onFocusout:e=>{e.relatedTarget instanceof Node&&i.value?.contains(e.relatedTarget)||(f=!1,v())},onKeydown:e=>{e.key===`Escape`&&o.value&&(e.preventDefault(),e.stopPropagation(),_(!1),p=!0,i.value?.querySelector(`[data-slot=comment-image-stack-toggle]`)?.focus(),p=!1)},onPointerenter:e=>{e.pointerType===`mouse`&&(d=!0,_(!0))},onPointerleave:e=>{e.pointerType===`mouse`&&(d=!1,v())},ref:i,role:`group`,"aria-label":`Attached ${y.value}`,style:{"--vh-fan-left":`${s.value.left}px`,"--vh-fan-room":`${s.value.width}px`,"--vh-fan-count":c}},[q(`button`,{"aria-expanded":String(o.value),"aria-label":`Show ${y.value}`,"data-slot":`comment-image-stack-toggle`,onClick:()=>_(d||!o.value),type:`button`}),q(`div`,{"data-slot":`comment-image-stack-cards`,"data-scrollable":o.value&&s.value.scrollable?`true`:void 0,"data-below":s.value.below?``:void 0,ref:a},e.images.map((i,a)=>q(`div`,{"data-key":i.key,"data-slot":`comment-image-stack-card`,inert:!o.value||void 0,key:i.key,style:{"--vh-stack-depth":c-1-a}},[q(oT,{alt:i.name,compact:!0,src:i.url}),q(r,{"aria-label":`Remove ${i.name}`,color:`neutral`,"data-slot":`comment-image-stack-remove`,disabled:e.disabled,icon:n.value.close,onClick:()=>t(`remove`,i.key),size:`xs`,square:!0,variant:`ghost`})]))),c>1?q(jw,{value:c},{render:({props:e,children:t})=>q(`span`,{...e,"aria-hidden":`true`,"data-slot":`comment-image-stack-count`},[t])}):null])}}})})),dT,fT,pT=t((()=>{X(),dT=[`data-status`,`data-size`,`data-orientation`],fT=U({__name:`Attachment`,props:{status:{default:`done`},size:{default:`md`},orientation:{default:`horizontal`}},setup(e){return(t,n)=>(W(),G(`div`,{"data-slot":`attachment`,"data-status":e.status,"data-size":e.size,"data-orientation":e.orientation},[Ul(t.$slots,`default`)],8,dT))}})})),mT,hT=t((()=>{pT(),pT(),mT=fT})),gT,_T=t((()=>{gT={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}})),vT,yT=t((()=>{vT=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)}}));function bT(e){return e!=null}function xT(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??gT.width,a=e.size??e.height??gT.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?vT(...c):vT(`lucide`,...s,...c),u=t.strokeWidth??gT[`stroke-width`];if(t.absoluteStrokeWidth){let n=Number(u)*Number(e.size??e.width??gT.width)/Number(t.size??t.width??gT.width);Number.isFinite(n)&&(u=n)}return[`svg`,{...Object.entries(gT).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&bT(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&bT(t.width)&&{[r(`width`)]:t.width},...`height`in t&&bT(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}var ST=t((()=>{_T(),yT()})),CT,wT=t((()=>{CT=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1}})),TT,ET=t((()=>{TT=e=>e===``})),DT,OT=t((()=>{DT=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase()}));function kT(){return ul(AT,{})}var AT,jT=t((()=>{X(),AT=Symbol(`lucide-icons`)})),MT,NT=t((()=>{X(),ST(),wT(),ET(),OT(),jT(),MT=({name:e,iconNode:t,"icon-node":n,icon:r={name:e&&DT(e),node:t??n??[],size:24,aliases:[]},absoluteStrokeWidth:i,"absolute-stroke-width":a,nonScalingStroke:o,"non-scaling-stroke":s,strokeWidth:c,"stroke-width":l,size:u,width:d=u,height:f=u,color:p,...m},{slots:h})=>{let{size:g,color:_,strokeWidth:v=2,absoluteStrokeWidth:y=!1,nonScalingStroke:b=!1,class:x=``}=kT(),S=TT(i)||TT(a)||i===!0||a===!0||y===!0,C=TT(o)||TT(s)||o===!0||s===!0||b===!0;delete m.class;let w=h.default?.(),[,T,E=[]]=xT(r,{color:p??_,width:d??u??g,height:f??u??g,strokeWidth:c??l??v,absoluteStrokeWidth:S,nonScalingStroke:C,className:x,hasA11yProp:w!=null&&w.length>0||CT(m),attributes:m});return q(`svg`,T,[...E.map(([e,t])=>q(e,t)),...w??[]])}}));function PT(e,t=[]){let n=typeof e==`string`?{name:e,node:t}:e;return(e,{slots:t})=>q(MT,{...e,icon:n},t.default?{default:t.default}:void 0)}var FT=t((()=>{X(),NT()})),IT,LT,RT=t((()=>{FT(),IT={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]},LT=PT(IT)})),zT,BT,VT=t((()=>{FT(),zT={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]},BT=PT(zT)})),HT,UT,WT=t((()=>{FT(),HT={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]},UT=PT(HT)})),GT,KT,qT=t((()=>{FT(),GT={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]},KT=PT(GT)})),JT,YT,XT=t((()=>{FT(),JT={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]},YT=PT(JT)})),ZT,QT,$T=t((()=>{FT(),ZT={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]},QT=PT(ZT)})),eE,tE,nE=t((()=>{FT(),eE={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]},tE=PT(eE)})),rE,iE,aE=t((()=>{FT(),rE={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]},iE=PT(rE)})),oE,sE,cE=t((()=>{FT(),oE={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]},sE=PT(oE)})),lE,uE,dE=t((()=>{FT(),lE={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]},uE=PT(lE)})),fE,pE,mE=t((()=>{FT(),fE={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]},pE=PT(fE)})),hE,gE,_E=t((()=>{FT(),hE={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]},gE=PT(hE)})),vE,yE,bE=t((()=>{FT(),vE={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]},yE=PT(vE)})),xE,SE,CE=t((()=>{FT(),xE={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]},SE=PT(xE)})),wE,TE,EE=t((()=>{FT(),wE={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]},TE=PT(wE)})),DE,OE,kE=t((()=>{FT(),DE={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]},OE=PT(DE)})),AE,jE,ME=t((()=>{FT(),AE={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]},jE=PT(AE)})),NE,PE,FE=t((()=>{FT(),NE={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]},PE=PT(NE)})),IE,LE,RE=t((()=>{FT(),IE={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]},LE=PT(IE)})),zE=t((()=>{FT(),RT(),VT(),WT(),qT(),XT(),$T(),nE(),aE(),cE(),dE(),mE(),_E(),bE(),CE(),EE(),kE(),ME(),FE(),RE(),jT(),NT()})),BE,VE,HE=t((()=>{X(),zE(),BE=[`aria-label`,`disabled`],VE=U({__name:`AttachmentAction`,props:{label:{default:`Remove`},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>(W(),G(`button`,{type:`button`,"data-slot":`attachment-action`,"aria-label":e.label,disabled:e.disabled},[Ul(t.$slots,`default`,{},()=>[J(V(LE),{"aria-hidden":`true`})])],8,BE))}})})),UE,WE=t((()=>{HE(),HE(),UE=VE})),GE,KE,qE=t((()=>{X(),GE={"data-slot":`attachment-actions`},KE=U({__name:`AttachmentActions`,setup(e){return(e,t)=>(W(),G(`div`,GE,[Ul(e.$slots,`default`)]))}})})),JE,YE=t((()=>{qE(),qE(),JE=KE})),XE,ZE,QE=t((()=>{X(),XE={"data-slot":`attachment-content`},ZE=U({__name:`AttachmentContent`,setup(e){return(e,t)=>(W(),G(`div`,XE,[Ul(e.$slots,`default`)]))}})})),$E,eD=t((()=>{QE(),QE(),$E=ZE})),tD,nD,rD=t((()=>{X(),tD={"data-slot":`attachment-group`},nD=U({__name:`AttachmentGroup`,setup(e){return(e,t)=>(W(),G(`div`,tD,[Ul(e.$slots,`default`)]))}})})),iD,aD=t((()=>{rD(),rD(),iD=nD})),oD,sD,cD=t((()=>{X(),oD=[`data-kind`],sD=U({__name:`AttachmentMedia`,props:{kind:{default:`icon`}},setup(e){return(t,n)=>(W(),G(`div`,{"data-slot":`attachment-media`,"data-kind":e.kind},[Ul(t.$slots,`default`)],8,oD))}})})),lD,uD=t((()=>{cD(),cD(),lD=sD})),dD,fD,pD=t((()=>{X(),dD={"data-slot":`attachment-title`},fD=U({__name:`AttachmentTitle`,setup(e){return(e,t)=>(W(),G(`span`,dD,[Ul(e.$slots,`default`)]))}})})),mD,hD=t((()=>{pD(),pD(),mD=fD})),gD=t((()=>{hT(),WE(),YE(),eD(),X(),aD(),uD(),hD()})),_D=t((()=>{gD()}));function vD(e){let t=e.replace(/@.*/,``).trim().split(/[\s._-]+/).filter(Boolean),n=t[0]??``,r=t.length>1?t.at(-1)??``:n.slice(1);return(n.slice(0,1)+r.slice(0,1)).toUpperCase()||`?`}var yD=t((()=>{})),bD,xD,SD,CD,wD,TD,ED=t((()=>{X(),Nw(),yD(),bD=[`data-size`,`data-variant`,`aria-label`],xD=[`title`],SD=[`src`],CD={key:1,"data-slot":`avatar-stack-fallback`},wD=[`title`],TD=U({__name:`AvatarStack`,props:{people:{},max:{default:3},size:{default:`md`},variant:{default:`solid`}},setup(e){let t=Y(()=>{let t=new Set;return e.people.filter(e=>!t.has(e.id)&&t.add(e.id))}),n=Y(()=>{let n=e.max===null?1/0:Math.max(2,e.max);return t.value.length>n?t.value.slice(0,n-1):t.value}),r=Y(()=>t.value.slice(n.value.length)),i=Y(()=>`${t.value.length} ${t.value.length===1?`person`:`people`}: ${t.value.map(e=>e.name).join(`, `)}`);return(t,a)=>(W(),G(`div`,{"data-slot":`avatar-stack`,"data-size":e.size,"data-variant":e.variant,role:`group`,"aria-label":i.value},[(W(!0),G(rf,null,Vl(n.value,e=>(W(),G(`span`,{key:e.id,"data-slot":`avatar-stack-item`,"aria-hidden":`true`,title:e.name,style:Ya(e.color?{"--vh-avatar-color":e.color}:void 0)},[e.image?(W(),G(`img`,{key:0,"data-slot":`avatar-stack-image`,alt:``,src:e.image},null,8,SD)):(W(),G(`span`,CD,Qo(V(vD)(e.name)),1))],12,xD))),128)),r.value.length?(W(),G(`span`,{key:0,"data-slot":`avatar-stack-count`,"aria-hidden":`true`,title:r.value.map(e=>e.name).join(`, `)},[a[0]||=Pu(`+`,-1),J(V(jw),{value:r.value.length},null,8,[`value`])],8,wD)):Fu(``,!0)],8,bD))}})})),DD,OD=t((()=>{ED(),ED(),DD=TD})),kD=t((()=>{OD()})),AD=t((()=>{kD()}));function jD(){return ul(MD,void 0)}var MD,ND=t((()=>{X(),MD=Symbol(`PromptInput`)})),PD,FD,ID,LD=t((()=>{X(),zE(),ND(),PD=[`accept`,`aria-label`,`disabled`,`multiple`],FD=[`data-variant`,`aria-label`,`disabled`],ID=U({inheritAttrs:!1,__name:`PromptInputAttach`,props:{variant:{default:`outline`},disabled:{type:Boolean,default:!1},label:{default:`Add attachment`}},setup(e){let t=Kl(),n=jD(),r=Tl(`input`);n&&is(n.addAttach(()=>e.disabled));let i=()=>e.disabled||(n?.disabled.value??!0);async function a(e){let t=e.currentTarget;t instanceof HTMLInputElement&&n&&(await n.addFiles(t.files??[]),t.value=``)}return(o,s)=>V(n)?(W(),G(rf,{key:0},[K(`input`,{ref_key:`input`,ref:r,type:`file`,"data-slot":`visually-hidden`,tabindex:`-1`,accept:V(n).accept.value,"aria-label":e.label,disabled:i(),multiple:!V(n).single.value,onChange:a},null,40,PD),K(`button`,zu(V(t),{type:`button`,"data-slot":`prompt-input-attach`,"data-variant":e.variant,"aria-label":e.label,disabled:i(),onClick:s[0]||=e=>r.value?.click()}),[Ul(o.$slots,`default`,{},()=>[J(V(yE),{"data-slot":`prompt-input-attach-icon`,"aria-hidden":`true`})])],16,FD)],64)):Fu(``,!0)}})})),RD,zD=t((()=>{LD(),LD(),RD=ID})),BD,VD,HD=t((()=>{X(),zE(),gD(),ND(),BD=[`src`,`alt`],VD=U({__name:`PromptInputAttachments`,props:{disabled:{type:Boolean,default:!1}},setup(e){let t=jD();return(n,r)=>V(t)&&V(t).files.value.length>0?(W(),Ou(V(iD),{key:0,"data-slot":`prompt-input-attachments`},{default:sl(()=>[(W(!0),G(rf,null,Vl(V(t).files.value,(n,r)=>(W(),Ou(V(mT),{key:`${n.filename}-${r}`,size:`xs`},{default:sl(()=>[J(V(lD),{kind:n.mediaType.startsWith(`image/`)?`image`:`icon`},{default:sl(()=>[n.mediaType.startsWith(`image/`)?(W(),G(`img`,{key:0,src:n.url,alt:n.filename??n.mediaType},null,8,BD)):(W(),Ou(V(QT),{key:1,"aria-hidden":`true`}))]),_:2},1032,[`kind`]),J(V($E),null,{default:sl(()=>[J(V(mD),null,{default:sl(()=>[Pu(Qo(n.filename??n.mediaType),1)]),_:2},1024)]),_:2},1024),J(V(JE),null,{default:sl(()=>[J(V(UE),{label:`Remove ${n.filename??`attachment`}`,disabled:e.disabled||V(t).disabled.value,onClick:e=>V(t).removeFile(r)},null,8,[`label`,`disabled`,`onClick`])]),_:2},1024)]),_:2},1024))),128))]),_:1})):Fu(``,!0)}})})),UD,WD=t((()=>{HD(),HD(),UD=VD})),GD,KD,qD=t((()=>{X(),zE(),ND(),GD=[`data-status`,`data-variant`,`data-loading`,`aria-label`,`disabled`],KD=U({inheritAttrs:!1,__name:`PromptInputSubmit`,setup(e){let t=Kl(),n=jD(),r={error:`Retry prompt`,ready:`Send prompt`,streaming:`Stop response`,submitted:`Stop response`},i=Y(()=>n?.status.value??`ready`),a=Y(()=>i.value===`ready`&&n?.submitLabel.value||r[i.value]),o=Y(()=>i.value===`ready`&&!!(n?.preparing.value||n?.readonly.value)),s=Y(()=>i.value===`ready`&&!n?.canSubmit.value||i.value===`error`&&!!n?.disabled.value),c=Y(()=>i.value===`ready`&&!n?.canSubmit.value?`soft`:`solid`),l=Y(()=>({canSubmit:n?.canSubmit.value??!1,preparing:n?.preparing.value??!1,status:i.value}));return(e,r)=>V(n)?(W(),G(rf,{key:0},[r[1]||=K(`span`,{"data-slot":`prompt-input-spacer`},null,-1),K(`button`,zu(V(t),{type:`button`,"data-slot":`prompt-input-submit`,"data-status":i.value,"data-variant":c.value,"data-loading":o.value?``:void 0,"aria-label":a.value,disabled:s.value||o.value,onClick:r[0]||=e=>V(n).press()}),[Ul(e.$slots,`default`,Qa(Mu(l.value)),()=>[o.value?(W(),Ou(V(uE),{key:0,class:`vh-prompt-input-spinner`,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):i.value===`ready`?(W(),Ou(V(BT),{key:1,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):i.value===`error`?(W(),Ou(V(SE),{key:2,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`})):(W(),Ou(V(PE),{key:3,"data-slot":`prompt-input-submit-icon`,"aria-hidden":`true`}))])],16,GD)],64)):Fu(``,!0)}})})),JD,YD=t((()=>{qD(),qD(),JD=KD})),XD,ZD,QD=t((()=>{X(),ND(),H_(),XD=[`aria-label`,`enterkeyhint`,`placeholder`,`aria-busy`,`disabled`,`readonly`,`value`],ZD=U({__name:`PromptInputTextarea`,setup(e){let t=jD(),n=B(!1);Dd(()=>{n.value=V_()});function r(e){!t||e.key!==`Enter`||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||e.isComposing||V_()||(e.preventDefault(),t.status.value===`ready`&&!t.disabled.value&&!t.readonly.value&&t.requestSubmit())}async function i(e){let n=e.clipboardData;if(!t?.takesFiles.value||!n)return;let r=n.getData(`text/plain`).length>0,i=Array.from(n.files).filter(e=>e.type.startsWith(`image/`)||!r);i.length>0&&await t.addFiles(i,()=>e.preventDefault())}function a(e){t&&e.target instanceof HTMLTextAreaElement&&(t.text.value=e.target.value)}return(e,o)=>V(t)?(W(),G(`textarea`,{key:0,"data-slot":`prompt-input-textarea`,"aria-label":V(t).label.value,enterkeyhint:n.value?`enter`:`send`,placeholder:V(t).placeholder.value,"aria-busy":V(t).readonly.value?`true`:void 0,disabled:V(t).disabled.value,readonly:V(t).readonly.value,rows:`1`,value:V(t).text.value,onInput:a,onKeydown:r,onPaste:i},null,40,XD)):Fu(``,!0)}})})),$D,eO=t((()=>{QD(),QD(),$D=ZD})),tO,nO,rO=t((()=>{X(),tO={"data-slot":`prompt-input-toolbar`},nO=U({__name:`PromptInputToolbar`,setup(e){return(e,t)=>(W(),G(`div`,tO,[Ul(e.$slots,`default`)]))}})})),iO,aO=t((()=>{rO(),rO(),iO=nO})),oO,sO,cO=t((()=>{X(),ND(),H_(),zD(),WD(),YD(),eO(),aO(),oO={"data-focus-frame":``,"data-slot":`prompt-input-group`},sO=U({inheritAttrs:!1,__name:`PromptInput`,props:{modelValue:{},defaultValue:{default:``},files:{},defaultFiles:{},status:{default:`ready`},accept:{},single:{type:Boolean,default:!1},filterFiles:{type:Function},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{},submitLabel:{}},emits:[`update:modelValue`,`update:files`,`submit`,`stop`,`retry`,`error`],setup(e,{emit:t}){let n=t,r=Kl(),i=Tl(`form`),a=B(e.defaultValue),o=Y({get:()=>e.modelValue??a.value,set:e=>{a.value=e,n(`update:modelValue`,e)}}),s=Ks(e.defaultFiles??[]),c=Y(()=>e.files??s.value);function l(e){s.value=e,n(`update:files`,e)}let u=B(0),d=Y(()=>u.value>0),f=Y(()=>e.status===`ready`&&!e.disabled&&!e.readonly&&!d.value&&(o.value.trim().length>0||c.value.length>0)),p=Ks([]),m=Y(()=>!e.disabled&&p.value.some(e=>!e()));function h(e){return p.value=[...p.value,e],()=>{p.value=p.value.filter(t=>t!==e)}}let g=!1,_=0,v=new Map;Ad(()=>{g=!0});async function y(t,r){if(e.disabled)return;let i=_++;u.value++;try{let n=Array.from(t),a=e.filterFiles?.(n)??n;if(a.length===0)return;r?.();let o=await Promise.all(Array.from(a,B_));g||v.set(i,o)}catch(e){g||n(`error`,{error:e})}finally{if(u.value--,!g&&u.value===0&&v.size>0){let t=[...v].sort(([e],[t])=>e-t).flatMap(([,e])=>e);v.clear(),l(R_(c.value,t,e.single))}}}function b(e){e.preventDefault(),f.value&&n(`submit`,{files:c.value,text:o.value.trim()})}return ll(MD,{text:o,files:c,status:Y(()=>e.status),disabled:Y(()=>e.disabled),readonly:Y(()=>e.readonly),placeholder:Y(()=>e.placeholder),accept:Y(()=>e.accept),single:Y(()=>e.single),submitLabel:Y(()=>e.submitLabel),label:Y(()=>typeof r[`aria-label`]==`string`?r[`aria-label`]:`Message`),canSubmit:f,preparing:d,takesFiles:m,addAttach:h,addFiles:y,removeFile:t=>{e.disabled||l(c.value.filter((e,n)=>n!==t))},requestSubmit:()=>i.value?.requestSubmit(),press:()=>{e.status===`streaming`||e.status===`submitted`?n(`stop`):e.status===`error`?n(`retry`):i.value?.requestSubmit()}}),(t,n)=>(W(),G(`form`,zu({ref_key:`form`,ref:i},V(r),{"data-slot":`prompt-input`,onSubmit:b}),[K(`div`,oO,[Ul(t.$slots,`default`,{canSubmit:f.value,preparing:d.value,status:e.status},()=>[J(UD),J($D),J(iO,null,{default:sl(()=>[J(RD),J(JD)]),_:1})])])],16))}})})),lO,uO=t((()=>{cO(),cO(),lO=sO})),dO=t((()=>{uO(),zD(),WD(),YD(),eO(),aO()})),fO=t((()=>{dO()})),pO,mO,hO,gO,_O,vO,yO,bO,xO=t((()=>{X(),Mp(),Dh(),P_(),_h(),L_(),U_(),uT(),iT(),Vw(),_D(),AD(),fO(),pO=/^\S{2,}$/u,mO={comment:`Add a comment`,edit:`Edit your comment`,reply:`Reply`},hO={comment:`Comment`,edit:`Save`,reply:`Reply`},gO={comment:`Comment`,edit:`Edit comment`,reply:`Reply`},_O=e=>{let t=e.getData(`text/plain`).length>0;return Array.from(e.files).filter(e=>e.type.startsWith(`image/`)||!t)},vO=2e3,yO=1e3,bO=U({name:`CommentComposer`,props:{modelValue:{default:``,type:String},mentions:{default:()=>[],type:Array},files:{type:Array},user:{type:Object},variant:{default:`comment`,type:String},placeholder:{type:String},busy:{default:!1,type:Boolean},error:{type:String},autofocus:{default:!0,type:Boolean},guard:{default:!0,type:Boolean},people:{default:()=>[],type:Array},participants:{default:()=>[],type:Array},users:{type:Function},attachments:{default:!0,type:Boolean},accept:{type:String},allowEmpty:{default:void 0,type:Boolean},layout:{default:`box`,type:String},size:{default:`md`,type:String},frame:{default:`field`,type:String}},emits:[`update:modelValue`,`update:mentions`,`update:files`,`submit`,`cancel`],slots:Object,setup(e,{emit:t,expose:n,slots:r}){let i=I_(),a=B(null),o=B(null),s=B(null),c=B(),l=B(!1),u=new Map,d=Cl(),f=e=>`${d}-option-${e}`,p,m=B(!1),h;H(m,e=>{clearTimeout(h),e&&(h=setTimeout(()=>m.value=!1,vO))});let g=0,_,v,y=B([]),b=Y(()=>e.files??y.value);H([()=>e.modelValue,b],()=>m.value=!1);let x=Y(()=>e.attachments&&e.variant!==`edit`),S=Y(()=>e.allowEmpty??e.variant===`reply`),C=new WeakMap,w=new Set,T=[],E=e=>{let t=C.get(e);return t||(t={filename:e.name,mediaType:e.type||`application/octet-stream`,type:`file`,url:URL.createObjectURL(e)},C.set(e,t),w.add(t.url)),t},D=Y(()=>b.value.map(E));H(()=>[...b.value],(e,t)=>{for(let n of t){let t=C.get(n);t&&!e.includes(n)&&(C.delete(n),T.push(setTimeout(()=>{URL.revokeObjectURL(t.url),w.delete(t.url)},yO)))}});function O(n){e.busy||(y.value=n,c.value=void 0,t(`update:files`,n))}function k(t){if(!x.value)return[];let n=Array.from(t).filter(t=>z_(t,e.accept));return n.length>0&&O([...b.value,...n]),n}let A=Y(()=>[...e.people,...i?.people.value??[]]),ee=e=>{let t=A.value.find(t=>t.id===e);return u.get(e)??(t?hh(t):void 0)},j=()=>e.users?e.users:i?i.users:e.people.length>0?async()=>e.people:void 0,M=()=>e.user?.id??i?.user.value?.id,N=()=>a.value?.querySelector(`textarea`)??null,te=()=>e.modelValue.trim().length>0,P=()=>te()||b.value.length>0,ne=()=>N()?.focus(),F=B(!1),re=0;function ie(){let t=N(),n=t?.parentElement;if(e.layout!==`row`||!t||!n||!e.modelValue){F.value=!1;return}let r=getComputedStyle(t),i=Number.parseFloat(r.lineHeight);if(!(i>0))return;F.value?(t.style.boxSizing=`border-box`,t.style.maxWidth=`${n.clientWidth-re}px`):re=n.clientWidth-t.offsetWidth;let a=t.scrollHeight-Number.parseFloat(r.paddingTop)-Number.parseFloat(r.paddingBottom);t.style.removeProperty(`box-sizing`),t.style.removeProperty(`max-width`),F.value=a>i*1.5}let ae=typeof ResizeObserver==`function`?new ResizeObserver(()=>ie()):void 0;H([()=>e.modelValue,()=>e.layout,()=>e.size],ie,{flush:`post`});async function I(){let e=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;o.value=null,await Zc(),a.value?.offsetWidth,o.value=e?`flash`:`shake`,!e&&a.value&&k_(a.value),clearTimeout(p),p=setTimeout(()=>o.value=null,450),ne()}let oe=e=>{e instanceof CustomEvent&&e.detail?.escape===!0&&(m.value=!0),I()};Dd(()=>{a.value?.addEventListener(kp,oe);let t=N()?.parentElement;t&&ae?.observe(t),ie(),e.autofocus&&Zc(ne)}),Ad(()=>{ae?.disconnect(),a.value?.removeEventListener(kp,oe),clearTimeout(p),clearTimeout(h);for(let e of T)clearTimeout(e);for(let e of w)URL.revokeObjectURL(e)}),n({focus:ne,shake:I}),H(s,e=>{let t=N();if(!t)return;t.setAttribute(`role`,`combobox`),t.setAttribute(`aria-autocomplete`,`list`);let n=e!==null&&e.items.length>0;t.setAttribute(`aria-expanded`,String(n)),n?(t.setAttribute(`aria-controls`,`${d}-list`),t.setAttribute(`aria-activedescendant`,f(e.index))):(t.removeAttribute(`aria-controls`),t.removeAttribute(`aria-activedescendant`))},{deep:!0}),wp(n=>{e.guard&&a.value&&!jp(n).includes(a.value)&&(Op.add(n),P()?(n.stopPropagation(),Cp(),I()):t(`cancel`))});function L(){let e=N();!e||e.selectionStart===_&&e.selectionEnd===_||(g++,_=void 0,s.value=null)}function se(n){L();let r=N(),i=s.value;if(!r||!i)return;if(r.selectionStart!==r.selectionEnd||r.value.slice(0,r.selectionStart)!==i.before){s.value=null;return}let a=r.selectionStart,o=`@${hh(n)} `,c=e.modelValue.slice(0,i.start)+o+e.modelValue.slice(a).replace(/^ /u,``);u.set(n.id,hh(n)),t(`update:modelValue`,c),e.mentions.includes(n.id)||t(`update:mentions`,[...e.mentions,n.id]),s.value=null,Zc(()=>{let e=i.start+o.length;r.setSelectionRange(e,e),r.focus()})}async function ce(t){let n=++g;_=t.selectionStart;let r=j(),i=t.value.slice(0,t.selectionStart),a=t.selectionStart===t.selectionEnd?vh(t.value,t.selectionStart):void 0;if(a?.start!==v&&(v=void 0),!r||!a||a.start===v){s.value=null;return}let o=[],c=!1;try{o=await r(a.query)}catch(e){c=!0,console.warn(`[vitehub] The comment box could not load people to mention:`,e)}let l=yh(o,a.query,{exclude:M(),participants:e.participants});if(L(),n!==g||a.start===v)return;let u=t.selectionStart===t.selectionEnd&&t.value.slice(0,t.selectionStart)===i,d=l.length>0||pO.test(a.query);s.value=u&&d?{before:i,failed:c,index:0,items:l,query:a.query,start:a.start}:null}function le(n){if(e.busy)return;let r=[...b.value];if(!n.text&&(r.length===0||!S.value)){r.length>0&&(c.value=`Write a comment to send with the files.`);return}let i=e.mentions.filter(e=>{let t=ee(e);if(t===void 0)return!1;let r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|[^\\p{L}\\p{N}\\p{M}_])@${r}(?=$|[^\\p{L}\\p{N}\\p{M}_])`,`iu`).test(n.text)});t(`submit`,{body:n.text,files:r,mentions:[...i]})}function ue(e){if(e.isComposing||e.target instanceof Element&&e.target.closest(`[data-slot=comment-image-stack][data-fanned]`))return;let t=s.value,n=t!==null&&t.items.length>0;if(n&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault();let n=e.key===`ArrowDown`?1:-1;t.index=(t.index+n+t.items.length)%t.items.length}else n&&(e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey?(e.preventDefault(),e.stopPropagation(),se(t.items[t.index])):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),e.repeat||(t?(g++,v=t.start,s.value=null):P()&&!m.value?(m.value=!0,I()):de()))}async function de(){e.busy||(m.value=!1,P()&&(t(`update:modelValue`,``),t(`update:mentions`,[]),O([]),await Zc()),t(`cancel`))}let fe=e=>x.value&&(e.dataTransfer?.types.includes(`Files`)??!1),pe,me=()=>{let e=pe;return pe=void 0,e},R=nT(`UIcon`),he=Rw(),ge=e=>{let t=D.value[e];O(b.value.filter(e=>E(e)!==t))},_e=({files:t,remove:n})=>{let r=[],i=[];return t.forEach((e,t)=>{e.mediaType.startsWith(`image/`)?r.push({key:e.url,name:e.filename??`Picture`,url:e.url}):i.push({file:e,index:t})}),[q(lT,{disabled:e.busy,images:r,onRemove:e=>n(t.findIndex(t=>t.url===e)),origin:me}),i.length>0?q(iD,{"data-slot":`prompt-input-attachments`},()=>i.map(({file:t,index:r})=>q(mT,{key:t.url,size:`xs`},()=>[q(lD,{kind:`icon`},()=>q(R,{name:he.value.file})),q($E,()=>q(mD,()=>t.filename??t.mediaType)),q(JE,()=>q(UE,{disabled:e.busy,label:`Remove ${t.filename??`attachment`}`,onClick:()=>n(r)},()=>q(R,{name:he.value.close})))]))):null]};return()=>q(`div`,{"data-busy":e.busy?`true`:void 0,"data-dirty":P()?`true`:void 0,"data-dragging":l.value?`true`:void 0,"data-frame":e.frame,"data-layout":e.layout,"data-multiline":F.value?`true`:void 0,"data-shake":o.value??void 0,"data-size":e.size,"data-slot":`comment-composer`,"data-variant":e.variant,onKeydownCapture:ue,onKeyupCapture:L,onClickCapture:L,onSelectCapture:L,onInputCapture:e=>{e.target instanceof HTMLTextAreaElement&&ce(e.target)},onPasteCapture:t=>{x.value&&t.clipboardData&&(pe=N(),_O(t.clipboardData).some(t=>z_(t,e.accept))&&t.preventDefault())},onDragover:e=>{fe(e)&&(e.preventDefault(),l.value=!0)},onDragleave:e=>{e.relatedTarget instanceof Node&&a.value?.contains(e.relatedTarget)||(l.value=!1)},onDrop:e=>{l.value=!1,fe(e)&&(e.preventDefault(),pe=a.value?.querySelector(`[data-slot=prompt-input-group]`),k(e.dataTransfer?.files??[]),ne())},onChangeCapture:e=>{e.target instanceof HTMLInputElement&&e.target.type===`file`&&(pe=a.value?.querySelector(`[data-slot=prompt-input-attach]`))},ref:a},[q(`div`,{"data-slot":`comment-composer-box`},[r.extra?q(`div`,{"data-slot":`comment-composer-extra`},r.extra()):null,q(lO,{accept:e.accept,"aria-label":gO[e.variant],files:D.value,readonly:e.busy,filterFiles:e=>(k(e),[]),modelValue:e.modelValue,placeholder:e.placeholder??mO[e.variant],submitLabel:hO[e.variant],onSubmit:le,"onUpdate:files":e=>O(b.value.filter(t=>e.includes(E(t)))),"onUpdate:modelValue":e=>t(`update:modelValue`,e)},()=>[x.value?_e({files:D.value,remove:ge}):null,q($D),q(iO,()=>[x.value?q(RD,{disabled:e.busy,variant:e.layout===`row`?`ghost`:`outline`},()=>q(R,{name:he.value.plus})):null,q(JD,null,()=>q(R,{name:he.value.arrowUp}))])]),s.value&&s.value.items.length===0?q(`div`,{"data-slot":`comment-composer-mentions`,"data-state":s.value.failed?`error`:`empty`,role:`status`},q(`p`,{"data-slot":`comment-composer-mention-empty`},r[`mention-empty`]?.({failed:s.value.failed,query:s.value.query})??(s.value.failed?`Could not load people.`:`No one by that name can be mentioned here.`))):s.value?q(`ul`,{"aria-label":`People`,"data-slot":`comment-composer-mentions`,id:`${d}-list`,role:`listbox`},s.value.items.map((e,t)=>{let n=t===s.value?.index;return q(`li`,{"aria-selected":String(n),"data-slot":`comment-composer-mention`,id:f(t),key:e.id,onMousedown:t=>{t.preventDefault(),se(e)},role:`option`},r[`mention-item`]?.({active:n,person:e})??[q(DD,{"aria-hidden":`true`,people:[dh(e)],size:`sm`}),q(`span`,{"data-slot":`comment-composer-mention-name`},hh(e))])})):null,e.error??c.value?q(`p`,{"data-slot":`comment-composer-error`,role:`alert`},e.error??c.value):null,q(`p`,{"aria-live":`polite`,"data-slot":`comment-composer-status`},m.value?`Press Esc again to discard.`:``)])])}})})),SO,CO,wO=t((()=>{xn(),SO={why:({message:e})=>e===void 0?``:String(e)},CO=_n({docsBase:`https://vitehub.dev/docs/ui/diagnostics`,codes:{UI_R0001:{...SO,fix:`Pick the file again. The browser could not read the file that the message names.`},UI_R0002:{...SO,fix:"Use the component that the message names as it says: inside its parent, such as `CommentLayer`, `ChoicesInput`, or `MessageScroller`, or with the props that the message names."},UI_CLIPBOARD_UNAVAILABLE:{why:`The clipboard is not available.`,fix:"Serve the page over HTTPS or from `localhost`, where the browser gives pages the clipboard API."},UI_MARKDOWN_UPLOAD_URL_MISSING:{why:({route:e,file:t})=>`${e} stored ${t} without a URL. Serve the Blob store with \`blob.serve\` so the editor can link it.`,fix:"Add `serve` to the Blob options, such as `vitehub({ blob: { serve: { access: 'public' } } })`, so the upload route returns a URL for each file that it stores."},UI_RELATIVE_TIME_NOW_INVALID:{why:`RelativeTime cannot read the supplied clock value.`,fix:`Pass a valid Date, an ISO date string, or milliseconds as now.`},UI_RELATIVE_TIME_THRESHOLD_INVALID:{why:({threshold:e})=>`RelativeTime threshold "${e}" is not a duration.`,fix:`Pass a number and a unit, such as "3w", or "none" as threshold.`},UI_ZIP_PATH_UNSAFE:{why:`ZIP files must use safe project-relative paths.`,fix:"Pass `zipFiles()` and `downloadZip()` a folder name and file paths that are relative to the project, without empty, `.`, or `..` segments, `:`, or a backslash."}}})}));function TO(e={}){let t=e.flashMs??2500,n=e.visibility??`all`,r=null,i=null,a=[],o=[],s=[],c=new Set,l=new Map,u=new Map,d=new Map,f=new Map,p=new Set,m=(e,t)=>{let n=setTimeout(()=>{c.delete(n),e()},t);return c.add(n),n};function h(){let e=o;o=n===`hidden`?[...new Set([...r?[r]:[],...a])]:[];let t=n===`hidden`?e.filter(e=>!o.includes(e)):[];s=n===`hidden`?[...s.filter(e=>!o.includes(e)),...t.filter(e=>!s.includes(e))]:[];for(let e of t)clearTimeout(f.get(e)),f.set(e,m(()=>{f.delete(e),s=s.filter(t=>t!==e);for(let e of p)e()},130));for(let e of p)e()}function g(e){let t=l.get(e);t&&(clearTimeout(t),c.delete(t),l.delete(e))}function _(e,t){g(e),d.delete(e),e===i?d.set(e,t):(u.set(e,Date.now()+t),l.set(e,m(()=>{l.delete(e),u.delete(e),a=a.filter(t=>t!==e),h()},t)))}return{get visibility(){return n},get only(){return o},get leaving(){return s},set(e){if(e!==n){if(n=e,e===`all`){for(let e of[...l.keys()])g(e);u.clear(),d.clear(),a=[]}h()}},open(e){e!==r&&(r=e,h())},flash(e){n===`hidden`&&(_(e,t),a.includes(e)||(a=[...a,e],h()))},hover(e){if(e===i)return;let t=i;if(i=e,t!==null){let e=d.get(t);e!==void 0&&_(t,e)}if(e!==null&&l.has(e)){let t=Math.max(0,(u.get(e)??0)-Date.now());g(e),u.delete(e),d.set(e,t)}},isShown:e=>n===`all`||o.includes(e),subscribe(e){return p.add(e),()=>p.delete(e)},stop(){for(let e of c)clearTimeout(e);c.clear(),l.clear(),u.clear(),d.clear(),f.clear()}}}var EO=t((()=>{}));function DO(e){return e.requestId===void 0?e.id:JSON.stringify([e.subject.kind,e.subject.id,e.author.id,e.requestId])}function OO(e,t){let n=Y(n=>{let r=t.value,i=e.value,a=i.find(e=>e.id===r),o=n?.id===r?n.thread:void 0,s=o?.requestId===void 0?void 0:DO(o);return{id:r,thread:a??(s===void 0?void 0:i.find(e=>DO(e)===s))}});return Y(()=>n.value.thread)}var kO=t((()=>{X()}));function AO(e){return(t,{message:n})=>e?t===`edit`||t===`delete`?n?.author.id===e.id:!0:!1}function jO(e){for(let t=e;t;){if(t.closest(zO))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}function MO(e,t){return e.kind===t.kind&&e.id===t.id}function NO(e,t){return!e||!t?e===t:e.detached||t.detached?e.detached===t.detached:e.element===t.element&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height&&e.clipped===t.clipped}function PO(e){return e instanceof Error?e.message:`The comment could not be sent. Try again.`}function FO(e){let t=e.client??lh(),n=Ks(),r=Ks(e.client?void 0:Pi()),i=Ks(),a=Y(()=>n.value??(r.value?Li(r.value):void 0)),o=e.param??`comment`,s=e.hotkey===void 0?`c`:e.hotkey!==!1&&e.hotkey.toLowerCase(),c=e.ignore??jO,l=Y(()=>Js(e.subject)),u=Y(()=>Js(e.user)??t.user??a.value),d=B(!1),f=B(`page`),p=Y({get:()=>f.value,set:e=>{if(e!==f.value){if(ce())return le();f.value=e}}}),m=Fs({open:!0,resolved:!1,mine:!1}),h=B(t.status),g=Ks(t.threads),_=Ks(t.outbox?.entries??[]),v=Ks(new Map),y=B(null),b=B(null),x=Ks(new Map),S=Y(()=>new Set(x.value.values())),C=e=>{let t=Symbol();return x.value=new Map(x.value).set(t,e),()=>{let e=new Map(x.value);e.delete(t),x.value=e}},w=B(null),T=B(!1),E=B(0),D=e=>e.status===`open`,O=e=>m.open&&D(e)||m.resolved&&e.status===`resolved`?!m.mine||e.author.id===u.value?.id:!1,k=e=>MO(e.subject,l.value),A=Y(()=>g.value.filter(e=>k(e)&&O(e))),ee=Y(()=>g.value.filter(e=>(p.value===`site`||k(e))&&O(e))),j=Y(()=>g.value.filter(e=>p.value===`site`||k(e))),M=Y(()=>j.value.filter(D)),N=Y(()=>({open:M.value.length,resolved:j.value.filter(e=>e.status===`resolved`).length})),te=OO(g,b);H(te,e=>{e&&e.id!==b.value&&(b.value=e.id)},{flush:`sync`});let P=Gs(e.visibility)?e.visibility:B(e.visibility??`all`),ne=TO({visibility:P.value,flashMs:e.flashMs}),F=B(0);ne.subscribe(()=>F.value++),H(P,e=>ne.set(e),{flush:`sync`}),H(b,e=>ne.open(e),{flush:`sync`}),H(w,e=>ne.hover(e),{flush:`sync`});let re=Y(()=>{F.value;let e=new Set(A.value.map(e=>e.id));te.value&&k(te.value)&&e.add(te.value.id);for(let t of g.value){let n=P.value===`hidden`&&(ne.isShown(t.id)||ne.leaving.includes(t.id));k(t)&&(S.value.has(t.id)||n)&&e.add(t.id)}return e}),ie=Y(()=>(F.value,new Set([...re.value].filter(e=>ne.isShown(e)||S.value.has(e))))),ae=Y(()=>(F.value,new Set(ne.leaving.filter(e=>re.value.has(e)&&!S.value.has(e))))),I=e=>ne.flash(e),oe=()=>Js(e.root)??document,L=()=>Js(e.uiRoot)??document;function se(){let e=new Map;for(let t of g.value.filter(e=>re.value.has(e.id)))e.set(t.id,qm(t.anchor,oe()));y.value&&e.set(RO,qm(y.value.anchor,oe()));let t=v.value;e.size===t.size&&[...e].every(([e,n])=>NO(n,t.get(e)))||(v.value=e)}let ce=()=>(y.value?.body.trim().length??0)>0||Tp(L(),y.value?void 0:BO),le=(e=!1)=>{E.value++,Ep(L(),e)};function ue(){d.value=!0;let e=typeof window>`u`?void 0:window.getSelection();if(e&&!e.isCollapsed&&e.rangeCount>0){let t=e.getRangeAt(0).commonAncestorContainer,n=t instanceof Element?t:t.parentElement;if(n?.isConnected&&!c(n)){let t=e.getRangeAt(0).getBoundingClientRect();try{R(e,{point:{x:t.left,y:t.top}}),e.removeAllRanges()}catch{}}}}function de(){y.value=null}function fe(){return ce()?(le(),!1):(b.value=null,w.value=null,!0)}function pe(e=!1){if(ce())return le(e);de(),fe(),d.value=!1}function me(){d.value?pe():ue()}function R(e,{files:t,...n}={}){if(ce())return le();fe();let r=Rm(e,{root:oe(),ignore:c,...n}),i=n.point??{x:0,y:0};if(e===`page`)i={x:Math.max(16,window.innerWidth/2-180),y:96};else if(`nodeType`in e){let t=e.getBoundingClientRect();i=n.point??{x:t.left+t.width/2,y:t.top+t.height/2}}else!(`rangeCount`in e)&&!(`startContainer`in e)&&(i=e);y.value={anchor:r,point:i,body:``,mentions:[],attachments:[],...t?.length?{files:t}:{},busy:!1,error:void 0},se()}async function he(e={}){let n=y.value,r=n?.body.trim()??``,i=e.files,a=WO(i);if(!n||n.busy||!r&&n.attachments.length===0&&!a)return;let o=n.body,s=[...n.mentions],c=[...n.attachments],u={subject:l.value,anchor:Us(n.anchor),body:r,mentions:s,...c.length>0?{attachments:c}:{},...a?{files:i}:{}};if(n.error=void 0,t.outbox){y.value=null;try{let e=await t.create(u);return I(e.id),e}catch(e){n.error=PO(e),y.value||=n;return}}n.busy=!0;try{let e=await t.create(u);return n.busy=!1,I(e.id),y.value===n&&n.body===o&&n.mentions.length===s.length&&n.mentions.every((e,t)=>e===s[t])&&(y.value=null),e}catch(e){n.busy=!1,n.error=PO(e);return}}let ge;function _e(e){clearTimeout(ge);let t=0,n=()=>{se();let r=v.value.get(e);r&&!r.detached?(r.element?.scrollIntoView?.({block:`center`}),se()):++t<20&&(ge=setTimeout(n,150))};n()}function ve(e,t={}){let n=typeof e==`string`?e:e.id;if(ce())return le();de(),b.value=n,w.value=null;let r=g.value.find(e=>e.id===n);r&&k(r)&&(t.scroll?_e(n):se())}function ye(t){let n=e.location?.()??window.location,r=e.subjectUrl?.(t.subject)??(t.subject.kind===`page`?t.subject.id:n.href),i=new URL(r,n.origin);return i.searchParams.set(o,String(t.n)),`${i.pathname.startsWith(`//`)?`/%2F${i.pathname.slice(2)}`:i.pathname}${i.search}${i.hash}`}let be=!1;function xe(){if(be||h.value!==`ready`)return;be=!0;let t=e.location?.()??window.location,n=Number(new URLSearchParams(t.search).get(o));if(!Number.isInteger(n)||n<1)return;let r=g.value.find(e=>e.n===n&&k(e));r&&(r.status===`resolved`&&(m.resolved=!0),m.mine=!1,ve(r,{scroll:!0}))}function Se(e){if(e.defaultPrevented||e.isComposing||e.repeat)return;let t=VO(e),n=t[0];if(e.key===`Escape`){if(t.some(e=>e.matches(`[data-slot='comment-composer']`)))return;(d.value||y.value||b.value)&&pe(!0)}else if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||UO(t))){if(e.key===`Enter`&&d.value&&n&&!t.some(c)&&n!==document.body&&n!==document.documentElement){e.preventDefault();try{R(n)}catch{}}else s!==!1&&e.key.toLowerCase()===s&&(e.preventDefault(),me())}}function Ce(){let a=[];if(t.query=p.value===`page`?{subject:l.value}:{},a.push(t.onChange(()=>{h.value=t.status,g.value=t.threads,_.value=t.outbox?.entries??[]})),h.value=t.status,g.value=t.threads,a.push(t.start()),!e.client){let e=Qi({base:nm(),guest:Pi});a.push(H([()=>l.value.kind,()=>l.value.id],([t,r],a,o)=>{i.value=void 0;let s=new AbortController;o(()=>s.abort());let c=new URLSearchParams({subjectKind:t,subjectId:r});e(`/session?${c}`,{signal:s.signal}).then(({data:e})=>{s.signal.aborted||(n.value=e.user??void 0,i.value=e.can)},()=>{})},{immediate:!0})),a.push(Ii(e=>{r.value=e}))}document.addEventListener(`keydown`,Se),a.push(()=>document.removeEventListener(`keydown`,Se));let o=0,s=()=>{o||=requestAnimationFrame(()=>{o=0,se()})};window.addEventListener(`scroll`,s,{capture:!0,passive:!0}),window.addEventListener(`resize`,s),window.addEventListener(`load`,s,{capture:!0}),document.fonts?.addEventListener(`loadingdone`,s);let c=()=>{be=!1,xe()};window.addEventListener(`popstate`,c),a.push(H(()=>e.location?.().search,c));let u=new MutationObserver(e=>{e.every(e=>e.target instanceof Element&&jO(e.target))||s()}),d={attributes:!0,characterData:!0,childList:!0,subtree:!0};a.push(H(oe,e=>{u.disconnect(),u.observe(document.documentElement,d),e!==document&&u.observe(e,d),s()},{immediate:!0,flush:`post`}));let f=typeof ResizeObserver>`u`?void 0:new ResizeObserver(s),m=new Set;return a.push(()=>{window.removeEventListener(`scroll`,s,{capture:!0}),window.removeEventListener(`resize`,s),window.removeEventListener(`load`,s,{capture:!0}),window.removeEventListener(`popstate`,c),document.fonts?.removeEventListener(`loadingdone`,s),u.disconnect(),f?.disconnect(),clearTimeout(ge),o&&cancelAnimationFrame(o),ne.stop()}),a.push(H(v,()=>{let e=new Set;for(let t of v.value.values())!t.detached&&t.element&&e.add(t.element);for(let t of m)e.has(t)||(f?.unobserve(t),m.delete(t));for(let t of e)m.has(t)||(f?.observe(t),m.add(t))},{flush:`post`})),a.push(H([re,()=>y.value?.anchor,b],()=>se(),{flush:`post`})),a.push(H(()=>h.value===`ready`,e=>e&&xe(),{immediate:!0})),a.push(H(()=>`${l.value.kind}\u0000${l.value.id}\u0000${p.value}`,()=>{t.query=p.value===`page`?{subject:l.value}:{},de(),b.value=null,w.value=null,be=!1,t.refresh().catch(()=>void 0)})),()=>{for(let e of a.splice(0))e()}}let we=Ks(new Map),Te=Y(()=>{let t=new Map,n=e=>{e&&(!t.has(e.id)||e.name)&&t.set(e.id,e)};for(let e of we.value.values())n(e);for(let t of Js(e.people)??[])n(t);for(let e of g.value){n(e.author),n(e.resolvedBy);for(let t of e.messages)n(t.author)}return n(u.value),[...t.values()]});async function Ee(e,n){let r=await t.users({query:e,...n?{threadId:n}:{subject:l.value}});if(r.some(e=>we.value.get(e.id)!==e)){let e=new Map(we.value);for(let t of r)e.set(t.id,t);we.value=e}return r}let De=(e,t)=>tm(u.value,i.value,e,t),Oe={client:t,subject:l,user:u,can:(t,n)=>u.value!==void 0&&(e.can??(e.client?AO(u.value):De))(t,n),people:Te,active:d,scope:p,filters:m,status:h,threads:g,outbox:{enabled:t.outbox!==void 0,queued:Y(()=>_.value.filter(e=>e.status!==`failed`)),failures:Y(()=>_.value.filter(e=>e.status===`failed`)),delivery(e,t){let n=g.value.find(t=>t.id===e);return t===void 0?n?.delivery:n?.messages.find(e=>e.id===t)?.delivery},retry:async e=>t.outbox?.retry(e),dismiss:async e=>await t.outbox?.dismiss(e)??!1,edit:async(e,n,r)=>await t.outbox?.edit(e,n,r)??!1},pageThreads:A,listed:ee,openThreads:M,counts:N,positions:v,draft:y,openId:b,hoverId:w,opened:te,listOpen:T,blocked:E,visibility:P,shown:ie,leaving:ae,retainMark:C,isShown:e=>ie.value.has(e),flash:I,enter:ue,exit:pe,toggle:me,startDraft:R,cancelDraft:de,send:he,open:ve,close:fe,create:async({anchor:e={kind:`page`},attachments:n,body:r,files:i,mentions:a})=>{let o=await t.create({subject:l.value,anchor:e,body:r,mentions:a,...n?.length?{attachments:n}:{},...WO(i)?{files:i}:{}});return I(o.id),o},reply:async(e,n,r,i,a)=>{let o=await t.reply({threadId:e,body:n,mentions:r,...i?.length?{attachments:i}:{},...WO(a)?{files:a}:{}});return I(e),o},edit:(e,n,r,i)=>t.edit({threadId:e,messageId:n,body:r,mentions:i}),remove:async(e,n)=>{let r=await t.delete({threadId:e,messageId:n});return!r&&b.value===e&&(b.value=null,w.value=null),r},resolve:e=>t.resolve({threadId:e}),reopen:e=>t.reopen({threadId:e}),users:Ee,link:ye,measure:se,start:Ce};if(e.autoStart!==!1&&gf()){let e;Dd(()=>{e=Ce()}),Ad(()=>e?.())}return Oe}function IO(e){ll(F_,e)}function LO(e){let t=e??I_();if(!t)throw CO.UI_R0002({message:"Comment parts need a comments state. Put them inside CommentLayer, or pass the result of useComments() as the `comments` prop."});return t}var RO,zO,BO,VO,HO,UO,WO,GO=t((()=>{X(),uh(),wO(),EO(),Mp(),kO(),L_(),RO=`draft`,zO=`[data-comments-ui]`,BO=`[data-draft] [data-slot='comment-composer']`,VO=e=>e.composedPath().filter(e=>e instanceof Element),HO=`input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox'], [role='combobox'], [role='searchbox']`,UO=e=>e.some(e=>e.matches(HO)),WO=e=>e!==void 0&&(!Array.isArray(e)||e.length>0)}));function KO(e,t){let n=Y(()=>{if(e.client.transport.supportsAttachments!==!1){if(t.upload)return`upload`;if(e.outbox.enabled&&t.queueFiles)return`queue`}});return{enabled:Y(()=>n.value!==void 0),queued(t){if(!(!e.outbox.enabled||n.value===`upload`&&t.length>0))return n.value===`queue`?t:[]},async prepare(e){return{files:n.value===`queue`?e:[],attachments:n.value===`upload`&&e.length>0&&t.upload?await t.upload(e):[]}}}}var qO=t((()=>{X()}));function JO(e,t={}){let[n,r,i,a]=[1e3,6e4,36e5,864e5],[o,s,c]=[7*a,30*a,365*a],l={s:n,m:r,h:i,d:a,w:o,mo:s,y:c},{threshold:u=`3w`,locale:d=`en-US`,style:f=`long`}=t,[,p,m]=/^(\d+(?:\.\d+)?)\s*(s|m|h|d|w|mo|y)$/i.exec(u)??[],h=/^(none|never)$/i.test(u)?1/0:p&&m?Number(p)*(l[m.toLowerCase()]??NaN):NaN;if(Number.isNaN(h))throw CO.UI_RELATIVE_TIME_THRESHOLD_INVALID({threshold:u});let g=t.now===void 0?Date.now():new Date(t.now).getTime();if(!Number.isFinite(g))throw CO.UI_RELATIVE_TIME_NOW_INVALID();let _=t.timeZone??new Intl.DateTimeFormat().resolvedOptions().timeZone,v=new Intl.RelativeTimeFormat(d,{numeric:`auto`,style:f}),y=e=>Object.fromEntries(new Intl.DateTimeFormat(`en-US`,{timeZone:_,hourCycle:`h23`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}).formatToParts(e).map(e=>[e.type,Number(e.value)])),b=e=>{let t=y(e);return Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second)-Math.floor(e/1e3)*1e3},x=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?\s*(Z|[+-]\d{2}:?\d{2})?)?$/i.exec(e);if(!t)return;let[n,r,i,o,s,c]=[1,2,3,4,5,6].map(e=>Number(t[e]??0)),l=Date.UTC(n,r-1,i,o,s,c,Number((t[7]??``).slice(0,3).padEnd(3,`0`))),u=new Date(l);if(u.getUTCFullYear()!==n||u.getUTCMonth()!==r-1||u.getUTCDate()!==i||o>23||s>59||c>59)return;if(t[4]===void 0)return{at:Math.floor(l/a)*a,wall:!0};let d=t[8];if(d?.toUpperCase()===`Z`)return{at:l,wall:!1};if(d){let e=d.replace(/\D/g,``),t=Number(e.slice(0,2)),n=Number(e.slice(2));return t>23||n>59?void 0:{at:l-(d.startsWith(`-`)?-1:1)*(t*60+n)*6e4,wall:!1}}let f=[...new Set([l-a,l,l+a].map(e=>l-b(e)))].filter(e=>e+b(e)===l).sort((e,t)=>e-t)[0];return f===void 0?void 0:{at:f,wall:!1}},S=Math.floor((g+b(g))/a),C=typeof e==`string`?NaN:new Date(e).getTime(),w=typeof e==`string`?x(e.trim()):Number.isFinite(C)?{at:C,wall:!1}:void 0;if(!w)return;let T=w.wall?(w.at/a-S)*a:w.at-g,E=w.wall?Math.max(Math.abs(T),a):Math.abs(T),[D,O]=E<r?[`second`,n]:E<i?[`minute`,r]:E<a?[`hour`,i]:E<o?[`day`,a]:E<s?[`week`,o]:E<c?[`month`,s]:[`year`,c],k=v.format(Math.trunc(T/O)||0,D),A=e=>new Intl.DateTimeFormat(d,{timeZone:w.wall?`UTC`:_,...e}).format(w.at),ee={day:`numeric`,month:`short`},j={hour:`numeric`,minute:`2-digit`,timeZoneName:`short`},M=Math.abs(T)>=h,N=w.wall?new Date(w.at).getUTCFullYear():y(w.at).year;return{datetime:w.wall?new Date(w.at).toISOString().slice(0,10):new Date(w.at).toISOString().replace(/\.000Z$/,`Z`),mode:M?`absolute`:`relative`,label:M?A(N===y(g).year?ee:{...ee,year:`numeric`}):k,tip:M?w.wall?k:`${k} · ${A(j)}`:A({weekday:`short`,...ee,year:`numeric`,...w.wall?{}:j})}}var YO=t((()=>{wO()}));function XO(e){let t,n=()=>e.value=Date.now(),r=()=>clearInterval(t),i=()=>{r(),n(),t=setInterval(n,ek)},a=()=>document.visibilityState===`hidden`?r():i();return document.addEventListener(`visibilitychange`,a),a(),()=>{r(),document.removeEventListener(`visibilitychange`,a)}}function ZO(){return nk++===0&&(rk=XO(tk)),tk}function QO(){--nk===0&&rk?.()}var $O,ek,tk,nk,rk,ik=t((()=>{X(),$O=Symbol(`ViteHubRelativeNow`),ek=3e4,tk=B(0),nk=0}));function ak(e){let t=ul($O,void 0),n=Ks(),r=B(!1);Dd(()=>{t||(n.value=ZO()),r.value=!0}),Ad(()=>{n.value&&QO()});let i=Y(()=>t?.value??n.value?.value),a=t=>{let n=i.value;if(n===void 0)return;let{at:r,format:a,locale:o,threshold:s}=e(),c={locale:o,style:a,threshold:s,timeZone:t},l=JO(r,{...c,now:n});if(!l?.datetime.includes(`T`))return l;let u=Date.parse(l.datetime);return Math.abs(u-n)<ok?JO(r,{...c,now:u}):l},o=Y(()=>{let{at:t,locale:n}=e(),r=JO(t,{locale:n,now:0,threshold:`none`,timeZone:`UTC`});if(!r)return;let i=new Intl.DateTimeFormat(n,{day:`numeric`,month:`short`,timeZone:`UTC`,year:`numeric`}).format(Date.parse(r.datetime));return{...r,label:i,mode:`absolute`}});return{time:Y(()=>a(r.value?void 0:`UTC`)??o.value),tip:Y(()=>r.value?a()?.tip:void 0)}}var ok,sk=t((()=>{X(),YO(),ik(),ok=6e4}));function ck(e){e()}var lk=t((()=>{})),uk=t((()=>{})),dk,fk=t((()=>{dk=e=>e.isTrusted}));function pk(e){(e.key===`Enter`||e.key===` `)&&(Nk=e.target,setTimeout(Pk))}function mk(e){pk(e),kk=!1;let t=e.metaKey||e.ctrlKey||e.altKey||/^(Meta|Control|Alt|Shift)$/.test(e.key);e.key!==`Tab`&&t||(wk=`keyboard`)}function hk(e){if(wk=`pointer`,kk=!1,!(`pointerType`in e)){jk||(Ak=`touch`);return}jk=!0,setTimeout(Mk);let t=e.pointerType;Ak=vk(e)?`virtual`:t===`touch`||t===`pen`?t:`mouse`}function gk(){Tk||typeof document>`u`||(Tk=!0,document.addEventListener(`keydown`,mk,!0),document.addEventListener(`keyup`,pk,!0),document.addEventListener(`pointerdown`,hk,!0),document.addEventListener(`touchstart`,hk,{capture:!0,passive:!0}),window.addEventListener(`blur`,e=>{e.target===window&&(kk=!0)}))}function _k(){Tk||Ek||(Ek=!0,queueMicrotask(gk))}function vk(e){return e.type===`pointermove`?!1:e.width===0&&e.height===0&&e.pressure===0||e.pointerType===`mouse`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0}function yk(e){return e.detail>0?Ak:Nk&&Nk.contains(e.target)?`keyboard`:`virtual`}function bk(e){if(gk(),!e)return Fk();if(!dk(e))return`programmatic`;if(e.type.startsWith(`key`))return`keyboard`;if(e.type.startsWith(`touch`))return`touch`;if(e.type===`click`)return yk(e);let t=e.pointerType;return t===`mouse`||t===`touch`||t===`pen`?vk(e)?`virtual`:t:`button`in e?Ak:Fk()}function xk(){return gk(),wk===`keyboard`&&!Dk&&!Ok&&!kk}function Sk(e){gk(),Dk=!0;try{e.focus({preventScroll:!0})}finally{Dk=!1}}function Ck(e){gk(),Ok=!0;try{e.focus({preventScroll:!0})}finally{Ok=!1}}var wk,Tk,Ek,Dk,Ok,kk,Ak,jk,Mk,Nk,Pk,Fk,Ik=t((()=>{fk(),wk=`pointer`,Tk=!1,Ek=!1,Dk=!1,Ok=!1,kk=!1,Ak=`mouse`,jk=!1,Mk=()=>jk=!1,Nk=null,Pk=()=>Nk=null,Fk=()=>wk===`keyboard`?`keyboard`:Ak}));function Lk(e,t){let n=zk.get(e);n||zk.set(e,n={});let r=n[t];if(r?.isConnected)return r;let i=e.createElement(`div`);return i.setAttribute(`role`,t===`assertive`?`alert`:`status`),i.setAttribute(`aria-live`,t),i.setAttribute(`aria-atomic`,`true`),i.setAttribute(`data-ui-sdk-announcer`,t===`assertive`?`assertive`:``),i.style.cssText=`position:fixed;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap`,e.body.append(i),n[t]=i,i}function Rk(e,{priority:t=`polite`,doc:n=typeof document>`u`?void 0:document}={}){if(!e)return;if(Bk)return Bk(e,t);if(!n?.body)return;let r=Lk(n,t);r.textContent=``,clearTimeout(Vk[t]),Vk[t]=setTimeout(()=>{r.textContent=e},100)}var zk,Bk,Vk,Hk=t((()=>{zk=new WeakMap,Vk={}}));function Uk(){return Wk&&(/iP(hone|ad|od)/.test(navigator.platform)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1)}var Wk,Gk=t((()=>{Wk=typeof window<`u`&&typeof document<`u`}));function Kk(){return Wk&&typeof HTMLElement.prototype.showPopover==`function`}function qk(e){return e||(Wk&&!Kk()?document.body:null)}function Jk(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function Yk(e){let t=[e],n=e;for(;n;){let e=n.assignedSlot??n.parentNode??n.host;e&&e!==n.parentNode&&t.push(e),n=e}return t}function Xk(e,t){return Yk(t).some(t=>e.contains(t))}function Zk(){return tA?tA===`apple`:nA??=Wk&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}function Qk(){return tA===`apple`}function $k(e,t=Zk()){return e.split(`+`).map(e=>{let n=e.toLowerCase();return n===`mod`?t?`Meta`:`Control`:rA[n]?rA[n]:e.length>1?e[0].toUpperCase()+e.slice(1):e.toUpperCase()}).join(`+`)}function eA(e,t=Zk()){let n=$k(e,t);if(!n)return``;let r=n.split(`+`);return`\u2066${t?r.map(e=>iA[e]??e).join(``):r.map(e=>aA[e]??e).join(`+`)}\u2069`}var tA,nA,rA,iA,aA,oA=t((()=>{Gk(),rA={alt:`Alt`,option:`Alt`,opt:`Alt`,shift:`Shift`,ctrl:`Control`,control:`Control`,cmd:`Meta`,command:`Meta`,meta:`Meta`,backspace:`Backspace`,delete:`Delete`,del:`Delete`,enter:`Enter`,return:`Enter`,escape:`Escape`,esc:`Escape`,tab:`Tab`,space:`Space`,up:`ArrowUp`,down:`ArrowDown`,left:`ArrowLeft`,right:`ArrowRight`,arrowup:`ArrowUp`,arrowdown:`ArrowDown`,arrowleft:`ArrowLeft`,arrowright:`ArrowRight`,home:`Home`,end:`End`,pageup:`PageUp`,pagedown:`PageDown`},iA={Meta:`⌘`,Control:`⌃`,Alt:`⌥`,Shift:`⇧`,Backspace:`⌫`,Delete:`⌦`,Enter:`↩`,Escape:`⎋`,Tab:`⇥`,Space:`␣`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`,PageUp:`⇞`,PageDown:`⇟`,Home:`↖`,End:`↘`},aA={Control:`Ctrl`,Delete:`Del`,Escape:`Esc`,ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`}}));function sA(e){return{"data-open":e?``:void 0,"data-closed":e?void 0:``}}var cA=t((()=>{}));function lA(e){bA++;try{e()}finally{bA--}}function uA(e){let t=vA,n={starts:[]};vA=n;let r;try{r=e()}finally{vA=t}return _A.set(r,n),t?t.starts.push(()=>(mA(r),()=>hA(r))):!yA&&typeof document<`u`&&mA(r),r}function dA(e){let t=yA;yA=!0;try{return e()}finally{yA=t}}function fA(e){vA&&vA.starts.push(e)}function pA(e,t){let n=vA,r={starts:[]};vA=r;try{t()}finally{vA=n}let i=_A.get(e);if(i){i.starts.push(...r.starts);for(let e of i.stops?r.starts:[]){let t=e();t&&i.stops.push(t)}}}function mA(e){let t=_A.get(e);if(!t||t.stops)return;let n=t.stops=[];for(let e of t.starts){let t=e();t&&n.push(t)}}function hA(e){let t=_A.get(e),n=t?.stops;n&&(t.stops=void 0,n.forEach(e=>e()))}function gA(e){hA(e),_A.delete(e)}var _A,vA,yA,bA,xA=t((()=>{lk(),_A=new WeakMap,yA=!1,bA=0}));function SA(e,t){e?.[TA]?.(t)}function CA(e,t){e?.[EA]?.(t)}function wA(e,t){let n=e.options().controller,r=!1;fA(()=>(r=!0,SA(n,t),()=>{r=!1,CA(n,t)})),e.onOptions(({controller:e})=>{e!==n&&(CA(n,t),n=e,r&&SA(e,t))})}var TA,EA,DA=t((()=>{xA(),TA=Symbol.for(`ui-sdk.controller.attach`),EA=Symbol.for(`ui-sdk.controller.detach`)}));function OA(e,t){let n=jA.get(e);n||jA.set(e,n=[]),n.push(t)}function kA(e,t,n){OA(e.store,{from:`options`,keys:t,derive:n})}function AA(e,t,n,r){let i=jA.get(e);if(!i)return n;let a=n??{},o=!n,s=!!n;for(let c=0;c<i.length;c++){let l=i[c];if(!n&&l.from===`state`)continue;let u=s?{...r,...a}:r,d=l.from===`state`?e.view(u,()=>l.derive(u)):l.derive(a,r,t);if(d||l.from!==`options`){o||=(a={...a},!0);for(let e=0;e<l.keys.length;e++){let t=l.keys[e];d&&t in d?(a[t]=d[t],s=!0):l.from===`state`&&(a[t]=u[t],s=!0)}}}return s?a:void 0}var jA,MA,NA=t((()=>{jA=new WeakMap,MA=e=>jA.has(e)}));function PA(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function FA(e){let t=`nativeEvent`in e?e.nativeEvent:e;return t.isComposing===!0||t.keyCode===229}var IA=t((()=>{}));function LA(e,t){let{x:n,y:r}=e,{borders:i}=t,a=n>=i.left&&n<t.width-i.right&&r>=i.top&&r<t.height-i.bottom,o=n>=t.clientLeft&&n<t.clientLeft+t.clientWidth&&r>=t.clientTop&&r<t.clientTop+t.clientHeight;return a&&!o}function RA(e,t){if(!(t instanceof Element))return!1;if(t===t.ownerDocument.documentElement)return e.clientX>=t.clientWidth||e.clientY>=t.clientHeight;if(t.clientWidth===0&&t.clientHeight===0)return!1;let n=t.getBoundingClientRect(),r=getComputedStyle(t);return LA({x:e.clientX-n.left,y:e.clientY-n.top},{width:n.width,height:n.height,clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,borders:{top:parseFloat(r.borderTopWidth)||0,right:parseFloat(r.borderRightWidth)||0,bottom:parseFloat(r.borderBottomWidth)||0,left:parseFloat(r.borderLeftWidth)||0}})}var zA=t((()=>{}));function BA(){return oj.persistent??=new Set}function VA(e){for(let t of BA())if(Xk(t,e))return!0;return!1}function HA(){return[...BA()].filter(e=>e.isConnected)}function UA(){return oj.pushed??0}function WA(e){return GA().some(t=>(t.order??0)>e)}function GA(){return oj.stack.filter(e=>e.active())}function KA(){return GA()}function qA(){return oj.escapeAt??-1/0}function JA(e,t,n){return YA(e,Yk(t),n)}function YA(e,t,n){return t.some(t=>e.contains(t,n))?!0:GA().some(r=>r.parent===e&&(t.some(e=>r.covers?.(e))||YA(r,t,n)))}function XA(e,t){let n=!1,r,i;function a(e,t,n){let r=[],i=!1;if(VA(t))return{dismissed:r,consume:i};for(let a of[...oj.stack].reverse())if(a.active()){if(JA(a,t,e)||(a.modal!==!1&&(i=!0),r.push(a),a.shield))break}else if(a.exiting?.()){if(JA(a,t,e))break;if(a.modal===!1)continue;a.overBackdrop?.(n.x,n.y)&&(i=!0);break}return{dismissed:r,consume:i}}function o(e,t,n){let{dismissed:r,consume:i}=a(e,t,n);for(let t of r)t.onOutsidePress?.(e);return i}let s=PA(t,`pointerdown`,e=>{n=!1;let t=e.composedPath()[0];if(e.pointerType===`touch`){r={x:e.clientX,y:e.clientY,target:t};return}if(r=void 0,i=void 0,RA(e,t))return;let o={x:e.clientX,y:e.clientY},{dismissed:s,consume:c}=a(e,t,o);if(s[0]?.outsidePress===`click`){if(e.button!==0)return;i={layer:s[0],target:t,point:o},c&&(e.preventDefault(),n=!0)}else{c&&(e.preventDefault(),n=!0);for(let t of s)t.onOutsidePress?.(e)}},{capture:!0}),c=PA(t,`pointerup`,e=>{let t=i;i=void 0,t&&t.layer.active()&&(JA(t.layer,e.composedPath()[0],e)||o(e,t.target,t.point))},{capture:!0}),l=PA(t,`click`,e=>{if(n&&e.detail){n=!1,e.preventDefault(),e.stopPropagation();return}if(n=!1,!r)return;let t=r;r=void 0,Math.hypot(e.clientX-t.x,e.clientY-t.y)>10||o(e,t.target,{x:t.x,y:t.y})&&(e.preventDefault(),e.stopPropagation())},{capture:!0}),u=PA(e,`keydown`,t=>rj(e,t)),d=PA(t,`blur`,e=>{for(let t of GA().reverse())t.onBlur?.(e)});return()=>{if(s(),c(),u(),d(),!n)return l();let e=()=>(l(),r(),i()),r=PA(t,`pointerdown`,e,{capture:!0}),i=PA(t,`click`,e,{capture:!0})}}function ZA(e,t){return JA(e,t)}function QA(e){let t=Yk(e);return GA().reverse().find(e=>t.some(t=>e.contains(t)))}function $A(e){oj.closed=e,setTimeout(()=>{oj.closed===e&&(oj.closed=void 0)})}function ej(){return oj.closed}function tj(e){let t=e.defaultView;if(!t)return()=>{};let n=oj.listening.get(e);n||oj.listening.set(e,n={layers:0,stop:XA(e,t)});let r=n;return r.layers++,()=>{--r.layers>0||(oj.listening.delete(e),r.stop())}}function nj(e){return e.el?.ownerDocument??document}function rj(e,t,n){if(t.key!==`Escape`||t.defaultPrevented||FA(t))return;let r=GA().filter(t=>nj(t)===e).at(-1);!r?.onEscape||r.takesEscape?.()===!1||n&&r!==n||(oj.escapeAt=performance.now(),r.onEscape(t))}function ij(e,t){rj(nj(e),t,e)}function aj(e){oj.pushed=(oj.pushed??0)+1,e.order=oj.pushed,oj.stack.push(e);let t=tj(nj(e)),n=!1;return()=>{if(n)return;n=!0;let r=oj.stack.indexOf(e);r!==-1&&oj.stack.splice(r,1),t()}}var oj,sj=t((()=>{lk(),IA(),oA(),zA(),oj=globalThis[Symbol.for(`ui-sdk.layers@2`)]??={stack:[],listening:new Map}}));function cj(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);e.style.setProperty(t,n);let a=e.style.getPropertyValue(t);return()=>{e.style.getPropertyValue(t)===a&&(r?e.style.setProperty(t,r,i):e.style.removeProperty(t))}}function lj(e){if(typeof CSS<`u`&&CSS.registerProperty){for(let t of e)if(!_j.has(t)){_j.add(t);try{CSS.registerProperty({name:t,syntax:`*`,inherits:!1})}catch{}}}}function uj(e){if(yj.has(e))return yj.get(e);let t;for(let n=e;n&&!t;n=n.defaultView?.frameElement?.ownerDocument)t=n.head?.querySelector(`meta[property="csp-nonce"]`);let n=t?t.nonce||t.getAttribute(`nonce`)||``:null;return yj.set(e,n),n}function dj(e,t,n){if(!e.head)return;let r=e.defaultView;uj(e)===``&&r&&`adoptedStyleSheets`in e?pj(e,r,t,n):fj(e,t,n)}function fj(e,t,n){let r=e.getElementById(t);if(r){if(bj.get(r)===n)return;r.textContent!==n&&(r.textContent=n),bj.set(r,n);return}let i=e.createElement(`style`);i.id=t;let a=uj(e);a&&(i.nonce=a),i.textContent=n,bj.set(i,n);let o=e.head.querySelectorAll(`:scope > style[id^="ui-sdk-"]`);o.length?o[o.length-1].after(i):e.head.prepend(i)}function pj(e,t,n,r){let i=vj().get(e);i||vj().set(e,i=new Map);let a=i.get(n);a||i.set(n,a={sheet:new t.CSSStyleSheet,css:``}),a.css!==r&&(a.sheet.replaceSync(r),a.css=r),e.adoptedStyleSheets.includes(a.sheet)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a.sheet])}function mj(e){dj(e,`ui-sdk-hidden`,`@layer ui-sdk { :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important } }`)}function hj(e){typeof window<`u`&&(performance.getEntriesByType(`paint`).length?xj?xj.push(e):(xj=[e],(window.requestIdleCallback??setTimeout)(()=>{let e=xj;xj=void 0,e.forEach(e=>e())})):e())}function gj(e){let t,n=requestAnimationFrame(()=>{t=setTimeout(e)});return()=>{cancelAnimationFrame(n),clearTimeout(t)}}var _j,vj,yj,bj,xj,Sj,Cj=t((()=>{_j=new Set,vj=()=>globalThis[Symbol.for(`ui-sdk.styles@1`)]??=new WeakMap,yj=new WeakMap,bj=new WeakMap,Sj=new WeakSet}));function wj(e=document,t){let n={},r=Lj.holders.get(e);r||Lj.holders.set(e,r=new Set),r.size||Lj.thaw.set(e,Ej(e)),r.add(n);let i=t&&Uk()?Nj(t):void 0;return()=>{r.delete(n)&&(i?.(),r.size||(Lj.thaw.get(e)?.(),Lj.thaw.delete(e)))}}function Tj({scrollbar:e,gutter:t,padding:n}){let r={overflow:`hidden`,"scroll-behavior":`auto`};return e>0&&(t?r[`scrollbar-gutter`]=`stable`:r[`padding-right`]=`${n+e}px`),r}function Ej(e){let{scroller:t,gutter:n,padding:r}=Rj.get(e)??Dj(e),i=Tj({scrollbar:n,gutter:typeof CSS<`u`&&CSS.supports(`scrollbar-gutter`,`stable`),padding:r}),a=Object.entries(i).map(([e,n])=>cj(t,e,n));return n>0&&a.push(cj(e.documentElement,`--scrollbar-width`,`${n}px`)),()=>a.forEach(e=>e())}function Dj(e){let t=e.defaultView??window,n=Oj(e,t),r=t.getComputedStyle(n);return{scroller:n,gutter:kj(n,e,t,r),padding:parseFloat(r.paddingRight)||0}}function Oj(e,t){let{body:n,documentElement:r}=e;return!n||t.getComputedStyle(r).overflowY===`visible`?r:/auto|scroll/.test(t.getComputedStyle(n).overflowY)?n:r}function kj(e,t,n,r){if(e===t.documentElement)return n.innerWidth-e.clientWidth;let i=(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0);return e.offsetWidth-e.clientWidth-i}function Aj(e,t){let n=t.getComputedStyle(e),r=/auto|scroll/.test(n.overflowY)&&e.scrollHeight>e.clientHeight,i=/auto|scroll/.test(n.overflowX)&&e.scrollWidth>e.clientWidth;return r||i}function jj(e,t){let{body:n,documentElement:r}=e.ownerDocument;for(let i=e;i&&i!==n&&i!==r;i=i.parentElement)if(Aj(i,t))return!0;return!1}function Mj(e){return e.fingers>1||e.zoomed?`browser`:e.scroller||e.slider||e.selecting?`element`:`page`}function Nj(e){let t=e.ownerDocument,n=t.defaultView??window;dj(t,`ui-sdk-scroll-guard`,zj);let r=!e.hasAttribute(`data-scroll-guard`);r&&e.setAttribute(`data-scroll-guard`,``);let i=`browser`,a={x:0,y:0},o=!1,s=!0,c=PA(t,`touchstart`,e=>{let r=e.target instanceof Element?e.target:null,c=e.touches[0];a={x:c?.clientX??0,y:c?.clientY??0},o=!1,s=!0,i=Mj({fingers:e.touches.length,zoomed:(n.visualViewport?.scale??1)!==1,scroller:!!r&&jj(r,n),slider:!!r?.closest(`input[type="range"]`),selecting:t.getSelection()?.type===`Range`})},{capture:!0,passive:!0}),l=PA(t,`touchmove`,e=>{let t=e.touches[0];(!t||Math.hypot(t.clientX-a.x,t.clientY-a.y)>Bj)&&(s=!1),i===`page`&&e.cancelable&&(e.preventDefault(),o=!0)},{passive:!1}),u=PA(t,`touchend`,e=>{let t=e.target;!e.defaultPrevented&&o&&s&&e.cancelable&&t instanceof n.Element&&(e.preventDefault(),t.closest(`input, textarea, select, [contenteditable]`)?.focus(),t instanceof n.HTMLElement?t.click():t.dispatchEvent(new n.MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0})))},{passive:!1});return()=>{c(),l(),u(),r&&e.removeAttribute(`data-scroll-guard`)}}function Pj(e){let t=e.parentNode;return t instanceof ShadowRoot?t.host:t}function Fj(e){let t=e[0]?.ownerDocument??document,n=[...e,...Array.from(t.querySelectorAll(Vj)),...HA()],r=n.filter(e=>!n.some(t=>t!==e&&t.contains(e))),i=new Set;for(let e of r)for(let t=e;t;t=Pj(t))i.add(t);let a=[];for(let e of r)for(let n=e;n&&n!==t.body;n=Pj(n))for(let e of Array.from(n.parentNode?.children??[])){if(i.has(e)||!(e instanceof HTMLElement))continue;let t=Lj.inert.get(e)??(e.inert?1/0:0);t===0&&(e.inert=!0),t!==1/0&&Lj.inert.set(e,t+1),a.push(e)}return()=>{for(let e of a){let t=Lj.inert.get(e);t!==void 0&&(t<=1?(e.inert=!1,Lj.inert.delete(e)):Lj.inert.set(e,t-1))}}}function Ij(e){let t=e,n=Fj(t),r=!1,i=e=>{let r=n;t=e,n=Fj(e),r()};return Object.assign(()=>{r||(r=!0,n())},{keep(e){return r?()=>{}:(i([...t,e]),()=>{r||i(t.filter(t=>t!==e))})}})}var Lj,Rj,zj,Bj,Vj,Hj=t((()=>{IA(),sj(),Gk(),Cj(),Lj=globalThis[Symbol.for(`ui-sdk.modal@2`)]??={holders:new WeakMap,thaw:new WeakMap,inert:new WeakMap},Rj=new WeakMap,zj=`@layer ui-sdk { [data-scroll-guard], [data-scroll-guard] * { overscroll-behavior: contain } }`,Bj=8,Vj=`[aria-live]:not([aria-live="off"]):not([data-slot="carousel-content"]),[role="status"],[role="alert"],[role="log"],output`}));function Uj(e){let t=e.length;if(t<=1)return e;let n=e[0].el.parentNode;if(n){let r=!0,i=!0;for(let a=1;a<t;a++){let t=e[a].el;if(t.parentNode!==n){r=!1;break}i&&e[a-1].el.nextElementSibling!==t&&(i=!1)}if(r){if(i)return e;if(`firstElementChild`in n){let r=new Map;for(let n=0;n<t;n++)r.set(e[n].el,e[n]);let i=[],a=t*Jj;for(let e=n.firstElementChild;e&&a--;e=e.nextElementSibling){let n=r.get(e);if(n&&i.push(n)===t)return i}}}}let r=t<qj?null:n;for(;r;){let n=!0;for(let i=0;i<t;i++)if(!r.contains(e[i].el)){n=!1;break}if(n)break;r=r.parentNode}if(r){let n=new Map;for(let r=0;r<t;r++)n.set(e[r].el,e[r]);let i=[],a=e[0].el.ownerDocument.createTreeWalker(r,1),o=t*Jj;for(let e=r;e&&o--;e=a.nextNode()){let r=n.get(e);if(r&&i.push(r)===t)return i}}return e.sort((e,t)=>Kj(e.el,t.el))}var Wj,Gj,Kj,qj,Jj,Yj=t((()=>{Wj=4,Gj=(e,t)=>!!(e.compareDocumentPosition(t)&Wj),Kj=(e,t)=>Gj(e,t)?-1:1,qj=16,Jj=32}));function Xj(e,t){let n={...$j[e]};for(let e of Object.keys(Zj)){let r=t[e];r!==void 0&&Object.assign(n,{[e]:r})}return n}var Zj,Qj,$j,eM=t((()=>{Zj={tab:`close`,blur:`always`,outsidePress:`pointerdown`,shield:!1,keepTrigger:!0,focusOnMount:!1,dismissOnFocusLoss:!0,closeWatcher:!1,blocking:!1,movesFocus:!0},Qj=e=>e.trapFocus?`trap`:`flow`,$j={menu:Zj,select:Zj,combobox:{...Zj,tab:`native`},popover:{...Zj,tab:Qj,blur:`iframe`},dialog:{...Zj,tab:Qj,blur:`never`,outsidePress:`click`,shield:!0,keepTrigger:!1,focusOnMount:!0,dismissOnFocusLoss:!1,closeWatcher:!0,blocking:e=>e.inertAndLock},tooltip:{...Zj,tab:`native`,movesFocus:!1},hoverCard:{...Zj,tab:`flow`},navigationMenu:{...Zj,tab:`flow`,blur:`never`}}}));function tM(e){let t=rM();t.set(e,(t.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(t.get(e)??1)-1;r>0?t.set(e,r):t.delete(e)}}function nM(e,t,n=`[data-slot="${e.getAttribute(`data-slot`)}"]`){return t.target.closest(n)===e}var rM,iM=t((()=>{rM=()=>globalThis[Symbol.for(`ui-sdk.popup-elements@1`)]??=new WeakMap}));function aM(e){return!(e instanceof HTMLElement)||e.tabIndex<0||e.matches(`:disabled`)||e.closest(`[inert]`)||(e.checked?[]:oM(e)).some(e=>e.checked&&aM(e))?!1:typeof e.checkVisibility==`function`?e.checkVisibility({visibilityProperty:!0}):e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`}function oM(e){return!(e instanceof HTMLInputElement)||e.type!==`radio`||!e.name?[]:(e.form?Array.from(e.form.elements):Array.from(e.getRootNode().querySelectorAll(`input[name="${CSS.escape(e.name)}"]`))).filter(t=>t instanceof HTMLInputElement&&t.type===`radio`&&t.name===e.name&&t.form===e.form)}function sM(e){return Array.from(e.querySelectorAll(fM)).filter(aM)}function cM(e){let t=e=>[...e.filter(e=>e.index>0).sort((e,t)=>e.index-t.index),...e.filter(e=>e.index<=0)].flatMap(e=>e.stops),n=(e,r)=>{for(let i of e){let e=i.hasAttribute(`tabindex`)?i.tabIndex:0;if(i.hasAttribute(`inert`)||i.shadowRoot&&e<0)continue;let a=i.matches(fM)&&!i.shadowRoot?.delegatesFocus&&aM(i)?[i]:[],o=i instanceof HTMLSlotElement?i.assignedElements():[];if(i.shadowRoot||o.length){let s=[];n(i.shadowRoot?.children??o,s),r.push({index:e,stops:[...a,...t(s)]})}else r.push({index:e,stops:a}),n(i.children,r)}},r=[];return n(e.children,r),r.flatMap(e=>e.stops)}function lM(e,t){let n=e=>{for(let n=e;n&&n!==t;n=n.parentElement)if(n.assignedSlot)return!0;return!1};return e.filter(e=>e.tabIndex>0&&!n(e)).sort((e,t)=>e.tabIndex-t.tabIndex)}function uM(e,t,n){let r=e=>{for(let t of e.children)if(i(t))return!0;return!1},i=e=>{if(e===n)return!1;if(t(e))return!0;if(e.shadowRoot)return r(e.shadowRoot);if(e.localName===`slot`){let t=e.assignedElements({flatten:!0});if(t.length)return t.some(i)}return r(e)};r(e)}function dM(e,t){let n=e.ownerDocument??document,r=!1,i;return uM(n.body,t=>r&&t.matches(fM)&&aM(t)?(i=t,!0):(r||=t===e,!1),t),i}var fM,pM=t((()=>{fM=`a[href],area[href],button,input:not([type='hidden']),select,textarea,iframe,summary,audio[controls],video[controls],[contenteditable]:not([contenteditable='false']),[tabindex]`}));function mM(e,t){let n=e.ownerDocument,r=!1,i,a=[],o=()=>{a.forEach(e=>e.remove()),a=[],i=void 0},s=()=>{let e=n.createElement(`span`);return e.tabIndex=0,e.setAttribute(`aria-hidden`,`true`),e.style.cssText=hM,e},c=()=>{let o=Jk(n);!r&&!a.length&&t()&&o instanceof HTMLIFrameElement&&Xk(e,o)&&(i=o,a=[s(),s()],o.before(a[0]),o.after(a[1]))},l=()=>{c(),setTimeout(c)},u=PA(n.defaultView??window,`blur`,l),d=PA(n,`focusout`,l),f=PA(n,`focusin`,t=>{let n=a.indexOf(t.composedPath()[0]),r=i;if(o(),n<0||!r)return;let s=cM(e),c=n===0?-1:1;(s.at((s.indexOf(r)+c)%s.length)??e).focus({preventScroll:!0})});return()=>{r=!0,u(),d(),f(),o()}}var hM,gM=t((()=>{IA(),pM(),oA(),hM=`position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;outline:none`}));function _M(e,t){EM.get(e)?.();let n=Sj.delete(e)?[]:e.getAnimations?.({subtree:!0}).filter(DM),r=n?.every(t=>OM(t)!==e);if(e.setAttribute(`data-starting-style`,``),n&&r)for(let t of e.getAnimations?.({subtree:!0})??[])DM(t)&&!n.some(e=>kM(t,e))&&t.finish();let i,a,o=requestAnimationFrame(()=>a=setTimeout(()=>{e.removeAttribute(`data-starting-style`),t&&(i=SM(e,t))}));return()=>{cancelAnimationFrame(o),clearTimeout(a),i?.(),e.removeAttribute(`data-starting-style`)}}function vM(e){return e.split(`,`).map(e=>{let t=parseFloat(e)||0;return e.trim().endsWith(`ms`)?t/1e3:t})}function yM(e){return Math.max(bM(getComputedStyle(e)),bM(getComputedStyle(e,`::backdrop`)))}function bM(e){let t=(e,t,n=`1`)=>{let r=vM(e),i=vM(t),a=n.split(`,`).map(e=>e.trim()===`infinite`?1:parseFloat(e)||1);return r.map((e,t)=>(e*(a[t%a.length]??1)+(i[t%i.length]??0))*1e3)};return Math.max(0,...t(e.transitionDuration,e.transitionDelay),...t(e.animationDuration,e.animationDelay,e.animationIterationCount))}function xM(e){let t=0;for(let n of e){let e=n.effect?.getComputedTiming(),r=Number(e?.endTime);e&&Number.isFinite(r)&&(t=Math.max(t,r-(Number(e.localTime)||0)))}return t}function SM(e,t){let n=!1,r=e.getAnimations({subtree:!0}).filter(AM),i=()=>{n||(n=!0,clearTimeout(a),t())},a=r.length?setTimeout(i,Math.max(yM(e),xM(r))+50):void 0;return r.length?Promise.allSettled(r.map(e=>e.finished)).then(i):ck(i),()=>{n=!0,clearTimeout(a)}}function CM(e,t){e.toggleAttribute(`data-open`,t),e.toggleAttribute(`data-closed`,!t)}function wM(e,t){let n=e.length,r=!1,i=[],a=e.map(e=>TM(e,(e,a)=>{i.push(e),r||=a,--n>0||(i.forEach(e=>e(r)),t())}));return()=>a.forEach(e=>e())}function TM(e,t){EM.get(e)?.(),e.removeAttribute(`data-starting-style`),e.setAttribute(`data-ending-style`,``);let n=e.hasAttribute(`inert`);e.setAttribute(`inert`,``);let r=e.ownerDocument?.defaultView?.MutationObserver,i=!1,a=r&&new r(()=>i=!0);a?.observe(e,{attributeFilter:[`inert`]});let o=0,s=()=>{cancelAnimationFrame(o),EM.delete(e),e.removeAttribute(`data-ending-style`),i||=!!a?.takeRecords().length,a?.disconnect(),i||e.toggleAttribute(`inert`,n)},c=t=>{if(!t)return s();EM.set(e,s),o=requestAnimationFrame(()=>{o=requestAnimationFrame(s)})},l=!1,u=SM(e,()=>t(c,l));return l=!0,()=>{u(),s()}}var EM,DM,OM,kM,AM,jM=t((()=>{lk(),Cj(),EM=new WeakMap,DM=e=>`transitionProperty`in e,OM=e=>e.effect?.target,kM=(e,t)=>OM(e)===OM(t)&&e.transitionProperty===t.transitionProperty,AM=e=>!e.timeline||!(`source`in e.timeline)}));function MM(e){return{consumeOutsidePress:e===!0||e===`pointer`,trapFocus:e===!0||e===`trap-focus`,inertAndLock:e===!0}}function NM(e){return e===`initial`||e===`hover`?`none`:e===`touch`?`popup`:`auto`}function PM(e){return e.focusable&&!e.consumed?!1:e.type!==`pointerdown`||`later`}function FM(e){e.localName===`input`&&$M.has(e.type)&&e.value&&e.getAttribute(`aria-expanded`)!==`true`&&e.select()}function IM(e,t){for(let n of e){let e=n();if(e&&t(e))return e}}function LM(e,t,n){kA(e,t,(e,t)=>`open`in e&&e.open!==t.open?n(!!e.open,t):void 0)}function RM(e,t){return{id:`${t}-content`,tabindex:`-1`,hidden:e.mounted?void 0:``,...sA(e.open)}}function zM(e,t){return typeof e==`function`?e()??void 0:typeof e==`string`?t.querySelector(e)??void 0:e}function BM(e){return e.isConnected&&!e.closest(`[inert]`)}function VM(e){let t=e.getRangeAt(0).cloneRange();return{range:t,backward:!t.collapsed&&e.anchorNode===t.endContainer&&e.anchorOffset===t.endOffset}}function HM(){let e=Jk();return!e||e===e.ownerDocument.body||!BM(e)||e.checkVisibility?.()===!1}function UM(e,t){return e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom}function WM(e){return e.getRootNode().activeElement}function GM(e,t){let n=tN().get(e);n||tN().set(e,n={selectors:new Set,css:``});let r=n.selectors;t.every(e=>r.has(e))||(t.forEach(e=>r.add(e)),n.css=`@layer ui-sdk { :where(${[...r].map(e=>`${e}[popover]`).join(`, `)}) { inset: auto; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; color: inherit; background: none } }`),n.css&&dj(e,`ui-sdk-popover-reset`,n.css)}function KM(e){Wk&&!nN.has(e)&&(nN.add(e),hj(()=>{GM(document,e),mj(document)}))}function qM(e){let t=globalThis.CloseWatcher;if(!t||!/Android/.test(navigator.userAgent))return;let n;try{n=new t}catch{return}return n.addEventListener(`close`,t=>{performance.now()-qA()<100||e(t)}),()=>n?.destroy()}function JM(e,t){for(let n=e;n;n=n.parent)if(n===t||iN.has(n)&&(n.order??0)>(t.order??0))return!0;return!1}function YM(e){let t=Xj(e.preset,e),n=()=>typeof t.tab==`function`?t.tab(e.modal()):t.tab,{store:r}=e,i,a,o,s=!1,c,l,u,d=r.get().open?`initial`:`imperative`,f=t.focusOnMount&&r.get().open,p=!1,m=!1,h=!1,g=!0,_=!1,v,y=!1,b,x=r.get().open,S=()=>void 0,C=[],w=e.returnTrigger??e.trigger,T,E,D,O,k=(t,n)=>e.onOpenChangeComplete?.(t,n),A=e=>e||!!a?.el&&Wk;LM({store:r},[`mounted`],e=>A(e)===e?{mounted:e}:void 0);function ee(e){v=e;let t=e?.isContentEditable?e.ownerDocument.getSelection():null;b=t?.rangeCount&&e.contains(t.anchorNode)?VM(t):void 0;let n=v&&QA(v),r=n?void 0:ej();S=n?.returnTarget??(()=>r)}let j=r.get().open;r.subscribe(()=>{let{open:n}=r.get();if(n===j)return;if(j=n,n){if(O?.(!0),e.onOpenChange?.(!0),c?.(),c=void 0,a)for(let e of[a.el,a.backdrop])e&&CM(e,!0);let t=e.trigger();_=d===`imperative`&&!!t&&QM.has(t),f=!_,p=!0,g=!0;let n=Wk?Jk():null;ee(n&&n!==n.ownerDocument.body?n:void 0);let o=w();x=d===`imperative`||h&&!!v&&!QA(v)&&!ej()&&!(o&&Xk(o,v));let s=!!a;r.set({mounted:!0}),i?(s&&oe(),ie()):Wk||(p=!1,k(!0));return}let m=t.movesFocus&&!_&&g;g=!0,f=!1,p=!1,d=`imperative`,h=!1;let y=O?.(!1);s=y?.reason===`outside-press`;let C=a?.el;o&&$A(te());let T=S,E=b;if(b=void 0,!C||!Wk){e.onOpenChange?.(!1,y),r.set({mounted:!1}),k(!1,y);return}let D=Jk(),A=e.trigger(),M=!D||D===C.ownerDocument.body||Xk(C,D)||!!o&&ZA(o,D)&&!(A&&Xk(A,D));e.onOpenChange?.(!1,y),i?.config.onClose?.();let N=UA(),P=e.finalFocus?.()??`trigger`,F=[C,...a?.backdrop?[a.backdrop]:[]];F.forEach(e=>CM(e,!1));let re=!1,ae=wM(F,()=>{re=!0,c=void 0,r.set({mounted:!1}),oe(),k(!1,y)});if(re||(c=ae),l?.(),l=void 0,u?.(),u=void 0,!m||!M)return;if(m===!0){ne(C,T,!1,E,P);let e=Jk();setTimeout(()=>{e&&!e.isConnected&&HM()&&!WA(N)&&ne(C,T,!1,void 0,P)});return}if(m===`unless-moved`){queueMicrotask(()=>{let e=Jk();e&&e!==C.ownerDocument.body&&!Xk(C,e)||WA(N)||ne(C,T,!1,E,P)});return}let I=()=>{L(),clearTimeout(se),setTimeout(()=>{let e=Jk();e&&e!==C.ownerDocument.body||ne(C,T,!1,E,P)})},L=PA(window,`pointerup`,I,{capture:!0}),se=setTimeout(I,1e3)});function M(t,n,r=S,i=!1){let a=()=>r(n,i),o=()=>P(t,i);return x?[()=>v,a,w,o,e.trigger]:[w,()=>v,a,o,e.trigger]}let N=!1;function te(e=BM,t=!1){if(!N){N=!0;try{return IM(M(a?.el,e,S,t),e)}finally{N=!1}}}function P(e,t=!1){let n=C[0]?.node;if(n?.isConnected&&!e?.contains(n)){for(let t of[...C.slice(1).map(e=>e.node),n.ownerDocument.body]){let r=sM(t).filter(t=>!e?.contains(t)),i=r.find(e=>Gj(n,e)&&!n.contains(e))??r.filter(e=>Gj(e,n)).pop();if(i)return i}return}let r=C.findIndex((e,t)=>!e.node.isConnected&&C[t+1]?.node.isConnected);if(r===-1)return;let i=C[r],a=i.next?.deref(),o=i.previous?.deref(),s=C[r+1].node,c=e=>!!e?.isConnected&&e.parentNode===s,l=c(a)?a.previousElementSibling===(i.previous?o:null):!i.next&&(i.previous?c(o)&&!o.nextElementSibling:!s.firstElementChild);if(t&&!l)return;let u=(e,t)=>e.contains(t)||Gj(e,t),d=c(a)?e=>u(a,e):c(o)?e=>Gj(o,e)&&!o.contains(e):e=>u(s,e);for(let{node:t}of C.slice(r+1)){let n=sM(t).filter(t=>!e?.contains(t)),r=c(o)?n.filter(e=>!u(o,e)||o.contains(e)).pop():void 0,i=n.find(d)??r??n[0];if(i)return i}}function ne(t,n,r=!1,i,a=e.finalFocus?.()??`trigger`){if(a===`none`)return;let o=e=>{if(!BM(e)||t.contains(e))return!1;let n=e.ownerDocument.getSelection(),r=i&&e===v?n?.rangeCount&&e.contains(n.anchorNode)?VM(n):i:void 0;if(Sk(e),Jk()!==e)return!1;if(r&&e.contains(r.range.startContainer)){let{startContainer:e,startOffset:t,endContainer:i,endOffset:a}=r.range;r.backward?n?.setBaseAndExtent(i,a,e,t):n?.setBaseAndExtent(e,t,i,a)}return!0},s=M(t,o,n,r);a!==`trigger`&&s.unshift(()=>zM(a,t.ownerDocument)),IM(s,o)}function F(e,n){if(!f||!a||!r.get().open||!t.movesFocus)return;f=!1;let i=NM(d),o=d===`initial`&&t.focusOnMount||i===`popup`&&n?.()?`auto`:i;if(o===`none`)return;let s=()=>{if(!a||!r.get().open)return;let t=o===`popup`?a.el:e?.();if(!t||(Ck(t),!a||!r.get().open))return;let n=Jk();!n||!Xk(t,n)&&!Xk(a.el,n)?Ck(a.el):FM(t)};m?requestAnimationFrame(()=>{let e=Jk();a&&e&&Xk(a.el,e)||s()}):s()}function re(i,c,m){let h=[],g=e.trigger(),b=c.host?.()??i;if(d===`initial`&&!v){let e=Jk();ee(e&&e!==e.ownerDocument.body&&!Xk(i,e)?e:void 0)}i.removeAttribute(`hidden`),b.removeAttribute(`hidden`);let x=a?.backdrop;if(x){let e=ae(x,c.inline);h.push(()=>{e(),I(x)})}if(!c.inline){b.setAttribute(`popover`,`manual`);try{b.showPopover()}catch{}}if(m&&Sj.add(i),c.position&&e.position){let t=e.position(()=>c.anchor?.()??e.trigger(),i,c.position,()=>e.close(`anchor-hidden`,{focus:!1}));T=t.place,E=t.follow,h.push(t,()=>T=E=void 0),c.rendered&&h.push(c.rendered(t.follow))}c.inline||Kk()||b.style.zIndex||(b.style.zIndex=`2147483000`),h.push(_M(i,p?()=>{p=!1,k(!0)}:void 0)),_k();let S=_?MM(!1):e.modal(),O=t.blur,A=e.persistent?.()??[],j=(e,t)=>e===i&&!!t&&`clientX`in t&&UM({x:t.clientX,y:t.clientY},i.getBoundingClientRect()),M=w()??(!g&&v?.isConnected?v:void 0);(M||!g)&&(C=[]);for(let e=M??null;e&&e!==i.ownerDocument.body;e=e.parentElement){let{nextElementSibling:t,previousElementSibling:n}=e;C.push({node:e,next:t&&new WeakRef(t),previous:n&&new WeakRef(n)})}let N={parent:e.parent?.()??(g&&QA(g)),active:()=>r.get().open,exiting:()=>!r.get().open&&r.get().mounted,modal:S.consumeOutsidePress,blocking:typeof t.blocking==`function`?t.blocking(S):t.blocking,outsidePress:t.outsidePress,shield:t.shield,component:e.owner?.component,id:e.owner?.id,el:i,covers:e=>b.contains(e),contains:(t,n)=>i.contains(t)&&!j(t,n)||A.some(e=>e.contains(t))||(e.contains?e.contains(t,n):!!e.trigger()?.contains(t)),overBackdrop:(e,t)=>s&&!!a?.backdrop&&!UM({x:e,y:t},a.backdrop.getBoundingClientRect())&&UM({x:e,y:t},i.getBoundingClientRect()),returnTarget:te,onOutsidePress:t=>{let n=t.composedPath()[0];e.close(`outside-press`,{event:t,focus:PM({type:t.type,focusable:!!n?.closest?.(eN),consumed:S.consumeOutsidePress})})},takesEscape:e.takesEscape,onEscape:t=>{t.preventDefault(),e.onEscape?e.onEscape(t):e.close(`escape-key`,{event:t,focus:!0})},onBlur:O===`never`?void 0:O===`always`?t=>e.close(`window-blur`,{event:t,focus:!1}):(t=>setTimeout(()=>{let n=WM(i)??i.ownerDocument.activeElement;n?.tagName===`IFRAME`&&!i.contains(n)&&e.close(`focus-out`,{event:t,focus:!1})}))};o=N,rN.set(N,[i,...x?[x]:[]]),h.push(aj(N)),aN.set(N,{inside:e=>e.contains(i)||!!g&&e.contains(g),again:()=>{let e=Jk();oe();for(let e of[b,x])try{e?.hidePopover()}catch{}ie(),e&&e!==Jk()&&e.focus({preventScroll:!0})}}),S.inertAndLock&&iN.add(N);for(let t of[e.onShow,c.onShow]){let e=t?.(N);e&&h.push(e)}let P,ne,re,L=()=>{let e=[i,...a?.backdrop?[a.backdrop]:[],...A];g&&t.keepTrigger&&e.push(g);for(let t of KA())t!==N&&JM(t,N)&&e.push(...rN.get(t)??[]);P=wj(i.ownerDocument,i);let n=Ij(e);N.keep=n.keep,l=ne=n},se=()=>{re?.(),ne?.(),P?.(),l===ne&&(l=void 0),ne=P=N.keep=void 0};S.inertAndLock&&(re=gj(()=>{if(re=void 0,!r.get().open)return;let e=Jk();L(),n()===`trap`&&e&&!BM(e)&&(f=!0,F(c.initialFocus,c.chosenFocus))})),D=()=>{let n=_?MM(!1):e.modal();N.modal=n.consumeOutsidePress,N.blocking=typeof t.blocking==`function`?t.blocking(n):t.blocking,n.inertAndLock?iN.add(N):iN.delete(N),n.inertAndLock&&!S.inertAndLock&&r.get().open?L():!n.inertAndLock&&S.inertAndLock&&se(),S=n},h.push(se,()=>D=void 0);let ce=new Set(KA());for(let e=N.parent;e;e=e.parent)ce.add(e);ce.delete(N);for(let e of ce)if(e.keep&&JM(N,e))for(let t of[i,...x?[x]:[]])h.push(e.keep(t));if(n()===`flow`&&t.dismissOnFocusLoss){let t;h.push(PA(i.ownerDocument,`mousedown`,e=>{t=e,y=!1,setTimeout(()=>{t===e&&(t=void 0)})},{capture:!0}),PA(i.ownerDocument,`focusin`,n=>{y=!1;let a=WM(i)??n.target;r.get().open&&!ZA(N,a)&&(t&&N.contains(a,t)||e.close(`focus-out`,{event:n,focus:!1}))}),PA(i,`focusout`,t=>{y&&!t.relatedTarget&&setTimeout(()=>{let n=Jk(i.ownerDocument);r.get().open&&!(n&&ZA(N,n))&&e.close(`focus-out`,{event:t,focus:!1})})}))}if(h.push(mM(i,()=>n()===`trap`)),t.closeWatcher){let t=qM(t=>e.close(`back`,{event:t,focus:!0}));t&&(u=t,h.push(()=>{t(),u===t&&(u=void 0)}))}let le=t=>{let n=t.target,r=t.submitter;(r?.getAttribute(`formmethod`)??n.getAttribute(`method`))?.toLowerCase()===`dialog`&&QA(n)===N&&(t.preventDefault(),e.close(`close-press`,{event:t,focus:!0,returnValue:r?.value||void 0}))};i.addEventListener(`submit`,le),h.push(()=>i.removeEventListener(`submit`,le)),r.get().open&&!f&&n()===`trap`&&HM()&&(f=!0);for(let e of KA()){let t=aN.get(e);e!==N&&t?.inside(i)&&t.again()}return queueMicrotask(()=>F(c.initialFocus,c.chosenFocus)),()=>{if(h.forEach(e=>e()),o===N&&(o=void 0),!r.get().mounted&&!c.inline)try{b.hidePopover()}catch{}}}function ie(e=!1){if(!i||a)return;let{el:t,config:n}=i;a={el:t,cleanup:()=>{},backdrop:n.backdrop?.()},a.cleanup=re(t,n,e)}function ae(e,t=!1){if(e.removeAttribute(`hidden`),t)return _M(e);e.setAttribute(`popover`,`manual`);try{e.showPopover()}catch{}return!Kk()&&!e.style.zIndex&&(e.style.zIndex=`2147483000`),_M(e)}function I(e){if(!r.get().mounted)try{e.hidePopover()}catch{}}function oe(){if(!a)return;let{cleanup:e}=a;a=void 0,e()}function L(t){if(y=t.key===`Tab`,t.key===`Escape`&&o)return ij(o,t);let r=a?.el;if(t.key!==`Tab`||!r)return;let i=n();if(i===`native`)return;if(i===`close`)return e.close(`focus-out`,{event:t,focus:!1});let s=sM(r),c=cM(r),l=c[0],u=c.at(-1),d=Jk(),f=!l||d===l||d===r,p=!u||d===u,m=i===`trap`?lM(s,r):[];if(m.length){let e=[...m,...s.filter(e=>!m.includes(e))],n=e.indexOf(d),i=d===r?e.at(t.shiftKey?-1:0):e.at((n+(t.shiftKey?-1:1))%e.length),a=m.includes(d)||!!i&&m.includes(i),o=d?.shadowRoot,c=!t.shiftKey&&!!o&&sM(o).length>0;if(d!==r&&(n<0||!a||c))return;t.preventDefault(),i?.focus({preventScroll:!0});return}if(i===`trap`){if(t.shiftKey?f:p){t.preventDefault(),((t.shiftKey?u:l)??r).focus({preventScroll:!0});return}let e=s.indexOf(d),n=e<0?void 0:s[e+(t.shiftKey?-1:1)],i=n&&!n.checked?oM(n):[];if(i.some(e=>e.checked)&&!i.includes(d)){t.preventDefault(),n?.focus({preventScroll:!0});return}setTimeout(()=>{let e=Jk(r.ownerDocument);a?.el===r&&!(e&&(Xk(r,e)||o&&ZA(o,e)))&&((t.shiftKey?u:l)??r).focus({preventScroll:!0})});return}let h=e.trigger()??(v?.isConnected?v:void 0);if(h){if(t.shiftKey&&f)t.preventDefault(),h.focus({preventScroll:!0});else if(!t.shiftKey&&p){let e=dM(h,r);if(!e)return;t.preventDefault(),e.focus()}}}return{bind(n,o={}){let s=!1,c=tM(n),l=()=>{i={el:n,config:o},r.get().mounted&&(a&&a.el!==n&&oe(),ie(!0))};return n.isConnected?l():queueMicrotask(()=>{!s&&n.isConnected&&l()}),()=>{s=!0;let o=e.finalFocus?.()??`trigger`;if(c(),i?.el===n&&(i=void 0,a?.el===n)){let e=Jk(),a=r.get().open&&t.movesFocus&&!_&&(!e||e===n.ownerDocument.body||Xk(n,e)),s=S;if(oe(),a){let e=b;b=void 0,queueMicrotask(()=>{!i&&!n.isConnected&&HM()&&ne(n,s,!0,e,o)})}}}},keydown:L,triggerKeydown(e){let t=a?.el;e.key===`Tab`&&!e.shiftKey&&t&&r.get().open&&n()===`flow`&&(e.preventDefault(),(cM(t)[0]??t).focus({preventScroll:!0}))},opening(e,t){d=e,m=t?.type===`pointerdown`,h=t?.type===`keydown`},opener:()=>d,observe(e){O=e},requestClose:(t,n)=>e.close(t,{event:n,focus:!0}),returnFocus(e){g=e},initialFocus:F,place:()=>T?.(),checkPlacement:()=>E?.(),updateModal:()=>D?.(),layer:()=>o,element:()=>a?.el,mountedAs:A,backdrop(e){if(!a||a.backdrop===e)return()=>{};let{el:t}=a,n=i?.config.host?.()??t,r=!!i?.config.inline;a.backdrop=e;let s=ae(e,r),c=Jk();if(!r)try{n.hidePopover(),n.showPopover()}catch{}c&&c!==Jk()&&c.focus({preventScroll:!0});let l=o?.keep?.(e);return()=>{l?.(),s(),a?.backdrop===e&&(a.backdrop=void 0),I(e)}}}}var XM,ZM,QM,$M,eN,tN,nN,rN,iN,aN,oN=t((()=>{cA(),NA(),IA(),sj(),Hj(),Ik(),Yj(),Gk(),Cj(),oA(),eM(),iM(),gM(),jM(),pM(),XM={mouse:`pointer`,pen:`pointer`,touch:`touch`,keyboard:`keyboard`,virtual:`keyboard`,programmatic:`imperative`,agent:`imperative`},ZM=e=>e?XM[bk(e)]:`imperative`,QM=new Set,$M=new Set([`text`,`search`,`url`,`tel`,`email`,`password`]),eN=`a[href],button,input,select,textarea,summary,[tabindex],[contenteditable]`,tN=()=>globalThis[Symbol.for(`ui-sdk.popover-reset@2`)]??=new WeakMap,nN=new WeakSet,rN=new WeakMap,iN=new WeakSet,aN=new WeakMap}));function sN(e,t=!1){return e===`start`?t?`right`:`left`:e===`end`?t?`left`:`right`:e}var cN,lN=t((()=>{cN={top:`bottom`,bottom:`top`,left:`right`,right:`left`}}));function uN(){return hN??=typeof CSS<`u`&&typeof CSS.supports==`function`&&[`position-anchor: --a`,`position-try-fallbacks: flip-y`,`position-visibility: always`].every(e=>CSS.supports(e)),hN}function dN(e,t,n,r,i){if(!uN()||e.getRootNode()!==n.getRootNode()||!(t.width||t.height)||!gN(i))return!1;let a=e=>e.split(`,`).some(e=>parseFloat(e)>0);return!a(r.transitionDuration)&&(r.animationName===`none`||!a(r.animationDuration))}function fN(e,t,n,r,i){let{sideOffset:a,alignOffset:o,collisionPadding:s}=r,c=t===`top`||t===`bottom`,[l,u]=c?[`left`,`right`]:[`top`,`bottom`],d=c?i.width:i.height,f=n===`start`?`anchor(${l}) + ${o}px`:n===`end`?`anchor(${u}) - ${d+o}px`:`anchor(center) - ${d/2-o}px`,p=cN[t];return{[p]:`round(anchor(${t}), 1px)`,[t]:`auto`,[`margin-${p}`]:`${a}px`,[`margin-${t}`]:`${s}px`,[l]:`round(min(max(${f}, min(${s}px, anchor(${u}))), max(100% - ${d+s}px, anchor(${l}) - ${d}px)), 1px)`,"position-anchor":e,"position-try-fallbacks":c?`flip-y`:`flip-x`,"position-visibility":`always`}}function pN(e){let t=_N.get(e);if(t||(t=`--ui-anchor-${++vN.count}`,_N.set(e,t)),!e.style.getPropertyValue(`anchor-name`).split(`,`).some(e=>e.trim()===t)){let n=getComputedStyle(e).getPropertyValue(`anchor-name`);e.style.setProperty(`anchor-name`,n&&n!==`none`?`${n}, ${t}`:t)}return t}function mN(e){let t=_N.get(e),n=e.style.getPropertyValue(`anchor-name`).split(`,`).map(e=>e.trim()).filter(e=>e&&e!==t);n.length?e.style.setProperty(`anchor-name`,n.join(`, `)):e.style.removeProperty(`anchor-name`),e.getAttribute(`style`)||e.removeAttribute(`style`)}var hN,gN,_N,vN,yN=t((()=>{lN(),gN=e=>{let t=document.documentElement;return!e.x&&!e.y&&Math.abs(e.width-t.clientWidth)<1&&Math.abs(e.height-t.clientHeight)<1},_N=new WeakMap,vN=globalThis[Symbol.for(`ui-sdk.anchor-names@1`)]??={count:0}}));function bN(){let e=new AbortController,t={capture:!0,passive:!0,signal:e.signal},n=[[document,[`scroll`,`load`,`input`,`pointermove`,`focusin`,`transitionstart`,`animationstart`]],[window,[`resize`]],[window.visualViewport,[`resize`,`scroll`]],[document.fonts,[`loadingdone`]]];for(let[e,r]of n)for(let n of r)e?.addEventListener(n,ON,t);let r=new MutationObserver(kN);return r.observe(document,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{e.abort(),r.disconnect()}}function xN(e){let t=new AbortController,n={capture:!0,passive:!0,signal:t.signal};for(let t of[`scroll`,`load`,`transitionstart`,`animationstart`])e.addEventListener(t,ON,n);let r=new MutationObserver(kN);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),()=>{t.abort(),r.disconnect()}}function SN(e){let t=[];for(let n=e;n;)n.nodeType===11&&`host`in n?(t.push(n),n=n.host):n=n.assignedSlot??n.parentNode;return t}function CN(e){let t=[...e];for(let e of t){let t=AN.get(e)??{count:0,stop:xN(e)};t.count++,AN.set(e,t)}return()=>{for(let e of t.splice(0)){let t=AN.get(e);--t.count||(t.stop(),AN.delete(e))}}}function wN(e,t){TN.size||(DN=bN());let n=typeof ResizeObserver==`function`?new ResizeObserver(e):void 0;return t&&n?.observe(t),TN.set(e,n&&t),()=>{n?.disconnect(),TN.delete(e),TN.size||(DN(),DN=EN)}}var TN,EN,DN,ON,kN,AN,jN=t((()=>{TN=new Map,EN=()=>{},DN=EN,ON=e=>TN.forEach((t,n)=>e.target instanceof Node&&t?.contains(e.target)||n()),kN=e=>TN.forEach((t,n)=>e.some(e=>e.attributeName!=`aria-activedescendant`&&!t?.contains(e.target))&&n()),AN=new Map}));function MN(e){let t=e;if(!e.getClientRects().length&&(getComputedStyle(e).display!==`contents`||(t=e.ownerDocument.createRange(),t.selectNodeContents(e),!t.getClientRects().length)))return;let{x:n,y:r,width:i,height:a}=t.getBoundingClientRect();return{x:n,y:r,width:i,height:a}}function NN(e){let t=`getBoundingClientRect`in e?e.getBoundingClientRect():{width:0,height:0,...e};return{x:t.x,y:t.y,width:t.width,height:t.height,left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height}}function PN(e,t,n,r,i){let{sideOffset:a,alignOffset:o}=i,s=n===`top`||n===`bottom`,c=0,l=0;return n===`bottom`&&(l=e.y+e.height+a),n===`top`&&(l=e.y-t.height-a),n===`right`&&(c=e.x+e.width+a),n===`left`&&(c=e.x-t.width-a),s?(r===`start`&&(c=e.x+o),r===`center`&&(c=e.x+e.width/2-t.width/2+o),r===`end`&&(c=e.x+e.width-t.width-o)):(r===`start`&&(l=e.y+o),r===`center`&&(l=e.y+e.height/2-t.height/2+o),r===`end`&&(l=e.y+e.height-t.height-o)),{x:c,y:l}}function FN(e,t,n,r,i){return e===`bottom`?t.y+n.height-(r.y+r.height-i):e===`top`?r.y+i-t.y:e===`right`?t.x+n.width-(r.x+r.width-i):r.x+i-t.x}function IN(e,t,n,r){let{sideOffset:i,collisionPadding:a}=r,o=e===`bottom`?n.y+n.height-a-(t.y+t.height+i):e===`top`?t.y-i-a-n.y:n.height-a*2,s=e===`right`?n.x+n.width-a-(t.x+t.width+i):e===`left`?t.x-i-a-n.x:n.width-a*2;return{width:Math.max(0,s),height:Math.max(0,o)}}function LN(e,t,n,r){let i={x:0,y:0,...n},a={...r,side:sN(r.side,r.rtl)},o=JN(a.side,a.align,a.rtl),s=a.side,c=PN(e,t,s,o,a),l=FN(s,c,t,i,a.collisionPadding);if(l>0){let n=cN[s],r=PN(e,t,n,o,a);FN(n,r,t,i,a.collisionPadding)<l&&(s=n,c=r)}let u=a.collisionPadding,d=IN(s,e,i,a),f=!1;if(FN(s,c,t,i,u)>0&&((s===`top`||s===`bottom`)&&t.height&&(e.height>=t.height||a.inside)?(f=!0,c.y=YN(YN(c.y,i.y+u,i.y+i.height-t.height-u),e.y,e.y+e.height-t.height),d.height=Math.max(0,i.height-u*2)):(s===`left`||s===`right`)&&t.width&&(e.width>=t.width||a.inside)&&(f=!0,c.x=YN(YN(c.x,i.x+u,i.x+i.width-t.width-u),e.x,e.x+e.width-t.width),d.width=Math.max(0,i.width-u*2))),s===`top`||s===`bottom`){let n=YN(c.x,i.x+u,i.x+i.width-t.width-u);c.x=n===c.x?n:YN(n,e.x-t.width,e.x+e.width)}else{let n=YN(c.y,i.y+u,i.y+i.height-t.height-u);c.y=n===c.y?n:YN(n,e.y-t.height,e.y+e.height)}return{...c,side:s,align:a.align,available:d,inside:f}}function RN(){$N||($N=!0,hj(()=>lj(QN)))}function zN(e){let t=new Map,n=(e,n)=>t.get(e)!==n&&(t.set(e,n),!0);return{style(t,r){n(`style:${t}`,r)&&e.style.setProperty(t,r)},attribute(t,r){n(t,r)&&(r===null?e.removeAttribute(t):e.setAttribute(t,r))},reset:()=>t.clear()}}function BN(){let e=window.visualViewport;return{x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.width??document.documentElement.clientWidth,height:e?.height??document.documentElement.clientHeight}}function VN(e,t,n={},r){let i=()=>typeof n==`function`?n():n,a=()=>typeof e==`function`?e():e,o=e=>({side:e.side??`bottom`,align:e.align??`start`,sideOffset:Number(e.sideOffset??4),alignOffset:Number(e.alignOffset??0),collisionPadding:Number(e.collisionPadding??8)});lj(QN),Object.assign(t.style,{position:`fixed`,inset:`auto`,margin:`0`,left:`0`,top:`0`});let s=zN(t),c=getComputedStyle(t),l,u=``,d=``,f=!1,p,m=!1,h=!1,g=[],_=()=>{},v=!1,y,b={left:`0`,top:`0`},x,S=new Set;function C(e={left:`0`,top:`0`}){y&&mN(y.anchor),y=void 0;for(let e of S)s.style(e,``);S.clear(),u=``,s.style(`inset`,`auto`),s.style(`margin`,`0`),s.style(`left`,e.left),s.style(`top`,e.top)}function w(){if(h)return!1;let e=i(),n=o(e),T=Number(e.arrowPadding??6),E=a();if(!E)return!1;let D=`nodeType`in E?E:void 0,O=D&&MN(D);if(D&&f&&(!D.isConnected||!O))return y&&C(b),D.isConnected&&p===D&&(p=void 0,r?.()),!1;p=O?D:void 0;let k=D?SN(D):[];(k.length!==g.length||k.some((e,t)=>e!==g[t]))&&(_(),g=k,_=CN(k)),m=!D&&`getBoundingClientRect`in E;let A=BN();if(y&&(D!==y.anchor||!gN(A))&&C(),v)y&&pN(y.anchor);else if(v=!0,D&&O&&dN(D,O,t,c,A))y={anchor:D,name:pN(D)};else for(let e of eP)t.style.getPropertyValue(e)&&t.style.removeProperty(e);let ee=!f,j=ee&&Sj.has(t),M=t.style.transition;ee&&!j&&(t.style.transition=`none`);let N=NN(O??E),te={width:t.offsetWidth,height:t.offsetHeight},P=tP(e),ne=P?{width:P.offsetWidth,height:P.offsetHeight}:void 0,F=`${N.x},${N.y},${N.width},${N.height},${A.x},${A.y},${A.width},${A.height},${n.side},${n.align},${n.sideOffset},${n.alignOffset},${n.collisionPadding}`,re=`${F},${te.width},${te.height},${ne?.width??``},${ne?.height??``},${T}`;if(re===u&&(!P||P===l?.el))return!1;u=re;let ie={left:t.clientLeft,top:t.clientTop,width:t.clientWidth,height:t.clientHeight},ae=c.direction===`rtl`,I=HN(c,te);if(y){let e=sN(n.side,ae),t=fN(y.name,e,JN(e,n.align,ae),n,I);for(let[e,n]of Object.entries(t))S.add(e),s.style(e,n)}let oe=UN(t.getBoundingClientRect(),I,c),{scale:L}=oe,se={width:I.width*L.x,height:I.height*L.y},ce={...n,inside:d===F,sideOffset:n.sideOffset*(qN(n.side)?L.y:L.x),alignOffset:n.alignOffset*(qN(n.side)?L.x:L.y),rtl:ae},le={x:N.x,y:N.y,width:N.width,height:N.height},ue=LN(le,se,A,ce);d=ue.inside?F:``;let de=x;x=le;let fe=e=>Math.abs(oe.x-e.x)<=1&&Math.abs(oe.y-e.y)<=1;if(y){let e=fe(ue),n=!e&&!!de&&fe(LN(de,se,A,ce));if(!e&&!n)return C(),j||(t.style.transition=M),w();n&&(u=``),b={left:`${parseFloat(c.left)+parseFloat(c.marginLeft)}px`,top:`${parseFloat(c.top)+parseFloat(c.marginTop)}px`}}else{let e={x:oe.x-(parseFloat(c.left)||0)*L.x,y:oe.y-(parseFloat(c.top)||0)*L.y},n=t.ownerDocument.defaultView?.devicePixelRatio||1,r=e=>Math.round(e*n)/n;s.style(`left`,`${r((ue.x-e.x)/L.x)}px`),s.style(`top`,`${r((ue.y-e.y)/L.y)}px`)}let pe=qN(ue.side)?L.x:L.y;ee&&(f=!0,j||(c.left,t.style.transition=M)),s.attribute(`data-side`,ue.side),s.attribute(`data-align`,ue.align),s.style(`--available-height`,`${ue.available.height/L.y}px`),s.style(`--available-width`,`${ue.available.width/L.x}px`),s.style(`--anchor-width`,`${N.width/L.x}px`),s.style(`--anchor-height`,`${N.height/L.y}px`);let[me,R]=KN(ue.side,ue.align,ae,N,se,ue);s.style(`--transform-origin`,`${Math.round(me/L.x)}px ${Math.round(R/L.y)}px`);let he={x:ue.x+ie.left*L.x,y:ue.y+ie.top*L.y,width:ie.width*L.x,height:ie.height*L.y},ge=GN(N,he,ue.side,T*pe);if(s.style(`--arrow-offset`,`${Math.round(ge/pe)}px`),P&&ne){let e=WN(N,{...he,...se},{width:ne.width*L.x,height:ne.height*L.y},ue.side,T*pe),t=Math.round(e.offset/pe);l?.el!==P&&(l={el:P,write:zN(P)});let{write:n}=l;n.style(`position`,`absolute`),n.style(`left`,qN(ue.side)?`${t}px`:``),n.style(`top`,qN(ue.side)?``:`${t}px`),n.attribute(`data-side`,ue.side),n.attribute(`data-align`,ue.align),n.attribute(`data-arrow-clamped`,e.clamped?``:null)}return!0}let T=0,E=0;function D(){T=0,E=w()?0:E+1,(E<XN||m)&&(T=requestAnimationFrame(D))}function O(){E=0,T||=requestAnimationFrame(D)}let k=wN(O,t),A=setInterval(()=>T||w()&&O(),ZN);w(),O();let ee=()=>{cancelAnimationFrame(T),clearInterval(A),k(),_(),g=[],h=!0},j=i(),M=nP(j),N=tP(j);function te(){let e=i(),t=nP(e),n=tP(e);(t!==M||n!==N)&&(M=t,N=n,O())}return Object.assign(ee,{follow:te,place(){f=!1,u=``,s.reset(),l?.write.reset(),w()}})}function HN(e,t){let n=t=>parseFloat(e.getPropertyValue(t))||0,r=(t,r)=>e.boxSizing===`border-box`?0:n(`padding-${t}`)+n(`padding-${r}`)+n(`border-${t}-width`)+n(`border-${r}-width`),i=parseFloat(e.width)+r(`left`,`right`),a=parseFloat(e.height)+r(`top`,`bottom`),o={width:Math.abs(i-t.width)<1,height:Math.abs(a-t.height)<1};return{width:o.width?i:t.width,height:o.height?a:t.height,exact:o}}function UN(e,t,n){let r=!!n.translate&&n.translate!==`none`,i=!!n.rotate&&n.rotate!==`none`,a=!!n.scale&&n.scale!==`none`,o=!!n.transform&&n.transform!==`none`;if(!r&&!i&&!a&&!o)return{x:e.x,y:e.y,scale:{x:iP(e.width,t.width,t.exact?.width),y:iP(e.height,t.height,t.exact?.height)}};let[s=0,c=0]=n.transformOrigin.split(` `).map(e=>parseFloat(e)||0),l=(e,t)=>e?e.endsWith(`%`)?parseFloat(e)/100*t:parseFloat(e)||0:0,u=r?n.translate.split(` `):[],d=l(u[0],t.width),f=l(u[1],t.height),p=i?n.rotate.split(` `):[],[m,h,g]={x:[1,0,0],y:[0,1,0],z:[0,0,1]}[p[0]]??(p.length===4?p.slice(0,3).map(parseFloat):[0,0,1]),_=Math.hypot(m,h,g)||1,[v,y,b]=[m/_,h/_,g/_],x=p.length?rP(p[p.length-1]):0,[S,C]=[Math.cos(x),Math.sin(x)],w=[S+(1-S)*v*v,(1-S)*v*y-C*b,(1-S)*v*y+C*b,S+(1-S)*y*y],[T=1,E=T]=a?n.scale.split(` `).map(parseFloat):[],D=o?/^matrix(3d)?\((.*)\)$/.exec(n.transform):null,O=D?.[2].split(`,`).map(parseFloat)??[],[k,A,ee,j,M,N,te,P,ne]=D?D[1]?[O[0],O[1],O[4],O[5],O[12],O[13],O[3],O[7],O[15]]:[...O,0,0,1]:[1,0,0,1,0,0,0,0,1],F=(e,t)=>{let[n,r]=[e-s,t-c],i=te*n+P*r+ne||1,a=T*(k*n+ee*r+M)/i,o=E*(A*n+j*r+N)/i;return[s+d+w[0]*a+w[1]*o,c+f+w[2]*a+w[3]*o]},re=[F(0,0),F(t.width,0),F(0,t.height),F(t.width,t.height)],ie=re.map(([e])=>e),ae=re.map(([,e])=>e),I=Math.min(...ie),oe=Math.min(...ae),L={x:iP(e.width,Math.max(...ie)-I,t.exact?.width),y:iP(e.height,Math.max(...ae)-oe,t.exact?.height)};return{x:e.x-L.x*I,y:e.y-L.y*oe,scale:L}}function WN(e,t,n,r,i){let a=r===`top`||r===`bottom`,o=a?n.width:n.height,s=(a?e.x+e.width/2-t.x:e.y+e.height/2-t.y)-o/2,c=(a?t.width:t.height)-o-i,l=Math.max(i,Math.min(s,c));return{offset:Math.round(l),clamped:Math.abs(l-s)>.5}}function GN(e,t,n,r){let i=n===`top`||n===`bottom`,a=i?e.x+e.width/2-t.x:e.y+e.height/2-t.y,o=i?t.width:t.height;return Math.round(Math.min(Math.max(a,r),Math.max(r,o-r)))}function KN(e,t,n,r,i,a){if(e===`top`||e===`bottom`){let o=n?r.right-a.x:r.left-a.x,s=n?r.left-a.x:r.right-a.x;return[t===`center`?r.left+r.width/2-a.x:t===`start`?o:s,e===`bottom`?0:i.height]}let o=t===`center`?r.top+r.height/2-a.y:t===`start`?r.top-a.y:r.bottom-a.y;return[e===`right`?0:i.width,o]}var qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP=t((()=>{yN(),jN(),lN(),Cj(),qN=e=>e===`top`||e===`bottom`,JN=(e,t,n=!1)=>n&&qN(e)&&t!==`center`?t===`start`?`end`:`start`:t,YN=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n)),XN=3,ZN=500,QN=[`--available-height`,`--available-width`],$N=!1,eP=[`position-anchor`,`position-try-fallbacks`,`position-visibility`],tP=e=>typeof e.arrow==`function`?e.arrow():e.arrow,nP=e=>[e.side,e.align,e.sideOffset,e.alignOffset,e.collisionPadding,e.arrowPadding].join(),rP=e=>{let t=parseFloat(e)||0;return e.endsWith(`turn`)?t*2*Math.PI:e.endsWith(`grad`)?t*Math.PI/200:e.endsWith(`rad`)?t:t*Math.PI/180},iP=(e,t,n=!1)=>t>.01&&Math.abs(e-t)>=(n?.05:1)?e/t:1}));function oP(e){return e.getAttribute(`role`)?.trim().split(/\s+/)[0]||(mP.find(([t])=>e.matches(t))?.[1]??``)}function sP(e){if(e.hasAttribute(`hidden`)||e.getAttribute(`aria-hidden`)===`true`)return!0;let t=e.ownerDocument.defaultView?.getComputedStyle(e);return t?.display===`none`||t?.visibility===`hidden`}function cP(e,t){return e.getRootNode().getElementById?.(t)??null}function lP(e){return(e.getAttribute(`aria-labelledby`)??``).split(/\s+/).map(t=>t&&cP(e,t)).filter(e=>!!e).map(e=>e.getAttribute(`aria-label`)??fP(e,!0)).join(` `)}function uP(e){return e.localName===`img`?e.getAttribute(`alt`)??``:e.localName===`svg`?[...e.children].find(e=>e.localName===`title`)?.textContent??``:``}function dP(e,t,n){if(e.matches(`input, select, textarea`))return``;let r=!t&&lP(e)||e.getAttribute(`aria-label`)?.trim()||uP(e);if(r)return` ${r} `;if(e.localName===`svg`)return``;let i=fP(e,t,n),a=e.getAttribute(`title`);return i||(a?` ${a} `:``)}function fP(e,t=!1,n=sP(e)){let r=``;for(let i of e.childNodes)if(i.nodeType===Node.TEXT_NODE)r+=i.nodeValue;else if(i.nodeType===Node.ELEMENT_NODE&&(n||!sP(i))){let e=dP(i,t,n);r+=pP(i,e)?` ${e} `:e}return r}function pP(e,t){let n=e.ownerDocument.defaultView?.getComputedStyle(e).display;return!!n&&n!==`inline`&&(!n.startsWith(`inline`)||!!t.trim())}var mP,hP,gP,_P,vP=t((()=>{mP=[[`button`,`button`],[`a[href]`,`link`],[`input[type=checkbox][switch]`,`switch`],[`input[type=checkbox]`,`checkbox`],[`input[type=radio]`,`radio`],[`input[type=range]`,`slider`],[`dialog`,`dialog`],[`h1, h2, h3, h4, h5, h6`,`heading`]],hP=new Set([`button`,`cell`,`checkbox`,`columnheader`,`gridcell`,`heading`,`link`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`row`,`rowheader`,`switch`,`tab`,`treeitem`]),gP=e=>[...e.labels??[]].map(e=>fP(e)).join(` `),_P=[lP,e=>e.getAttribute(`aria-label`)??``,gP,uP,e=>hP.has(oP(e))?fP(e):``,e=>e.getAttribute(`title`)??``],[..._P.filter(e=>e!==gP)]}));function yP(e){let t=``;for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType===3)t+=n.nodeValue;else if(n.nodeType===1){let e=n;if(e.hasAttribute(`hidden`)||e.hasAttribute(`aria-hidden`)&&e.getAttribute(`aria-hidden`)===`true`)continue;t+=e.firstElementChild?yP(e):e.textContent??``}return t}function bP(e){return e.hasAttribute(`aria-hidden`)&&e.getAttribute(`aria-hidden`)===`true`?``:e.firstElementChild?yP(e):e.textContent??``}var xP=t((()=>{}));function SP(e,t){if(EP===`agent`)return EP;if(TP.has(e))return`programmatic`;if(t){let e=t();return e===`programmatic`&&EP?EP:e}return EP??`programmatic`}function CP(e,t){let n=EP;EP=e;try{return t()}finally{EP=n}}function wP(e,t,n=!0){if(!n)return{...e,source:t};let r=!1;return{...e,source:t,cancel:()=>{r=!0},get canceled(){return r}}}var TP,EP,DP=t((()=>{TP=new Set([`image-load`,`image-error`,`imperative`,`item-removed`,`unmount`,`reset`,`restore`,`timeout`,`resize`,`page-hide`])})),OP,kP,AP,jP=t((()=>{OP=e=>`${e[0].toUpperCase()}${e.slice(1)}`,kP=(e,t)=>`on${OP(e)}${t}`,AP=e=>`default${OP(e)}`}));function MP(e){return zP.add(e),e}function NP(e,t){return Object.is(e,t)?!0:!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length||zP.has(e)||zP.has(t)?!1:e.every((e,n)=>Object.is(e,t[n]))}function PP(e,t){return FP(e,t,void 0)}function FP(e,t,n){if(Object.is(e,t))return!0;let r=Array.isArray(e)&&Array.isArray(t);if(!r&&!(BP(e)&&BP(t)))return!1;if(n){for(let r=0;r<n.length;r+=2)if(n[r]===e&&n[r+1]===t)return!0}let i=n??[];i.push(e,t);try{if(r){let n=e,r=t;if(n.length!==r.length||zP.has(n)||zP.has(r))return!1;for(let e=0;e<n.length;e++)if(!FP(n[e],r[e],i))return!1;return!0}let n=e,a=t,o=Object.keys(n);if(o.length!==Object.keys(a).length)return!1;for(let e of o)if(!(e in a)||!FP(n[e],a[e],i))return!1;return!0}finally{i.length-=2}}function IP(e,t){let n=e,r,i,a=!1,o,s=new Set,c=new Map,l,u={state:e,renders:0,writes:0,touch:()=>p([],n,!1,!1),skipping:c},d={get(){return o??f()},set(e,i=!1){if(r&&!i&&!a){let t=f();if(t!==n){let n={...t};for(let t in e)delete n[t];d.set(n,!0)}}let o;for(let t in e)NP(n[t],e[t])||(o??=[]).push(t);if(!o)return;let s=n;n={...n,...e},u.state=n;let c=t.length>0;if(c){for(let e=0;e<o.length;e++)if(!t.includes(o[e])){c=!1;break}}p(o,s,c,i)},subscribe(e){return s.add(e),()=>{s.delete(e)}},setFanout(e){l=e},follow(e){r=e},view(e,t){let n=o;o=e;try{return t()}finally{o=n}}};function f(){if(!r||a)return n;a=!0;let e;try{e=r(n)}finally{a=!1}if(!e)return n;if(i?.state===n&&i.over===e)return i.result;let t=n;for(let r in e)if(!NP(n[r],e[r])){t={...n,...e};break}return i={state:n,over:e,result:t},t}function p(e,t,n,r){n||u.renders++,r||u.writes++;for(let t of s)t(n,r,e);for(let[t,i]of c){let a=!e.length;if(!a){for(let n=0;n<e.length;n++)if(!Object.hasOwn(t,e[n])){a=!0;break}}if(a)for(let t of i)t(n,r,e)}l?.(e,t,n,r)}return VP.set(d,u),d}function LP(e,t,n){return RP(VP.get(e).skipping,t,n)}function RP(e,t,n){let r=e.get(t);return r||e.set(t,r=new Set),r.add(n),()=>{r.delete(n),!r.size&&e.get(t)===r&&e.delete(t)}}var zP,BP,VP,HP,UP,WP,GP,KP=t((()=>{zP=new WeakSet,BP=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},VP=new WeakMap,HP=e=>VP.get(e).state,UP=e=>VP.get(e).renders,WP=(e,t)=>{VP.set(e,VP.get(t))},GP=e=>VP.get(e).touch()}));function qP(e,t,n,r){fA(()=>{let i,a,o;if(JP.add)i=JP.add(e,t,n,r);else if(typeof document<`u`&&(YP.add(a=new WeakRef(e)),o={parts:t,definition:n,options:r},XP.set(e,o),YP.size%1e3==0))for(let e of YP)e.deref()||YP.delete(e);return()=>{(i??o?.unwatch)?.(),i=void 0,o&&(o.unwatch=void 0),a&&=(YP.delete(a),void 0)}})}var JP,YP,XP,ZP=t((()=>{xA(),JP={},YP=new Set,XP=new WeakMap}));function QP(e,t){let{store:n,options:r}=e,i=new Map,a=new Map,o=new Map;return e.onOptions((e,t)=>{if(!t)return;let n;for(let[e,r]of i)e in t&&(NP(t[e],r.value)&&(n=r.source),i.delete(e));return n}),(s,c,l)=>{if(o.has(s)&&NP(o.get(s),c))return!1;let u=(a.get(s)??0)+1;a.set(s,u);let d=n.get()[s];if(NP(d,c))return!1;let{reason:f,event:p}=l,m=wP(l,l.source??t(f,p));m.source;let h=r(),g=h[s]!==void 0,_=o.has(s),v=o.get(s);o.set(s,c);try{CP(m.source,()=>{let e=kP(s,`Change`),t=h[e];typeof t==`function`&&t(c,m);let r=a.get(s)!==u;m.canceled||g||r||n.set({[s]:c})})}finally{_?o.set(s,v):o.delete(s)}return!m.canceled&&(JP.change?.(e.id,s,c,m,d),g&&i.set(s,{value:c,source:m.source}),!0)}}var $P=t((()=>{lk(),DP(),jP(),KP(),ZP()}));function eF(){return _k(),nF}function tF(e,t=eF()){return QP(e,t)}var nF,rF=t((()=>{Ik(),$P(),DP(),nF=(e,t)=>SP(e,t&&(()=>bk(t)))}));function iF(e,t){return Uj([...e.parts()].filter(e=>e.slot===t&&!!e.el?.isConnected)).map(({el:e,key:t,props:n})=>({el:e,key:t,props:n}))}var aF=t((()=>{Yj()})),oF,sF,cF=t((()=>{oF=new WeakSet,sF=e=>(oF.add(e),e)}));function lF(e,t){return sF(Promise.resolve({reason:e,source:nF(e,t)}))}function uF(e){let{popup:t,store:n,rules:r={}}=e,i=`imperative`,a,o,s;t.observe(e=>{let t=e?void 0:o??{reason:i,source:`programmatic`};if(o=void 0,t)return a?.resolve(t),a=void 0,t}),e.onDestroy(()=>{a?.resolve({reason:`unmount`,source:`programmatic`}),a=void 0});function c(e){if(!a){let e;a={promise:sF(new Promise(t=>e=t)),resolve:e}}if(e&&!e.aborted){let n=()=>t.requestClose(`imperative`);e.addEventListener(`abort`,n,{once:!0}),a.promise.then(()=>e.removeEventListener(`abort`,n))}return a.promise}let l,u=(t,n)=>{let r=l;l=t;try{return e.change(t,n)}finally{l=r}};function d(e={},t){return f(e,t).result}function f(a,o){let{event:l,signal:d}=a;if(d?.aborted)return{opened:!1,result:lF(i)};let f=a.reason??(l?`trigger-press`:i),p=o??f,m={...a,reason:p,payloadReason:f},h=!1,g=(n=a.by??`imperative`)=>{s=a.anchor;let r=e.payload?.opening(a.trigger,a.payload,{reason:f,event:l});return t.opening(n,l),h=u(!0,{reason:p,event:l}),h||r?.(),h};return n.get().open?(t.opener()===`hover`&&a.by!==`hover`&&t.opening(a.by??`imperative`,l),a.trigger===void 0&&e.payload?.reopening(a,{reason:f})&&a.anchor&&(s=a.anchor),r.reopen?.(m,g),{opened:h,result:c(d)}):(r.open?r.open(m,g):g(),{opened:h,result:h?c(d):lF(p,l)})}function p(a={}){if(!n.get().open)return!1;let{event:s,returnValue:c}=a,l=a.reason??i;if(e.dismissal&&!e.dismissal.allows(l,s))return!1;let d=!1,f=()=>{o={reason:l,source:nF(l,s),returnValue:c},t.returnFocus(a.focus??e.returnFocus??!0);let n=u(!1,{reason:l,event:s,...c!==void 0&&{returnValue:c}});return n||(t.returnFocus(!0),o=void 0),d=n,n};return r.close?r.close({...a,reason:l},f):f(),d}function m({trigger:t,payload:n,anchor:r,reason:i,event:a}){s=r,e.payload?.handOver(t,n,{reason:i,event:a})}let h=(e,t)=>f({reason:i,event:t},e).opened;return{api:{isOpen:()=>n.get().open,setOpen:(e,{reason:t,event:r}={})=>e!==(l??n.get().open)&&(e?h(t,r):p({reason:t,event:r})),open:(e={})=>d({...e,reason:e.reason??i}),close:({reason:e,event:t,returnValue:n}={})=>p({reason:e,event:t,returnValue:n}),toggle:({reason:e,event:t}={})=>n.get().open?p({reason:e,event:t}):h(e,t)},show:d,attempt:f,hide:p,takeOver:m,result:c,anchor:()=>s}}var dF=t((()=>{cF(),rF()}));function fF(e,t){let n=e,{store:r,element:i,options:a}=n,{preset:o}=t,s=t.slot??`content`,c=t.trigger??`trigger`,l=tF(n),u=e=>e!==void 0&&n.props(s,e)||iF(n,s)[0]?.props||n.props(s)||{},d=()=>{if(v?.trigger)return v.trigger();let e=r.get().trigger;return e!==null&&i(c,e)||i(c)},f=null,p,m=()=>{let e=r.get().trigger;if(v?.trigger||e===null||e===f)return d();let t=p??iF(n,c).length<=1;return i(c,e)??(t?i(c):void 0)},h=r.get().open;r.subscribe(()=>{let{open:e,trigger:t}=r.get();e!==h&&(h=e,e&&(f=t!==null&&!i(c,t)?t:null,p=iF(n,c).length<=1))});function g(e){for(let t of n.parts())if(t.slot===c&&t.key!==e&&t.el?.isConnected)return t.key}let _={label:n.label,role:t.role??o.role,store:r,options:a,onOptions:n.onOptions,onDestroy:n.onDestroy,element:i,parts:n.parts,preset:o,get popup(){return k},get control(){return A},triggerElement:d,triggerSlot:c,nextTrigger:g,firstTrigger(){for(let e of n.parts())if(e.slot===c)return g()??e.key},triggerDisabled:e=>!!n.props(c,e)?.disabled,contentProps:u},v=_.rules=t.rules?.(_),y=o.dismissal?.(a,v),b=o.presentation?.(_,y),x=o.press?.(_),S=o.group?.(_),C=o.hover?.(_,S),w=o.focus?.(_),T=o.triggerName?.(_);o.resetStyles?.prepare(n.label,s),o.placement?.prepare();function E(e,t){if(o.modal!==void 0)return{modal:e.modal??(t.presentation===`sheet`||o.modal)}}function D(){let e=E(a(),r.get());e&&r.set(e)}function O(e,t){v?.dismiss?v.dismiss(e,t):A.hide({reason:e,...t})}let k=YM({...t.behavior,preset:o.behavior,position:o.placement?.position,owner:{component:n.label,id:n.id},store:r,trigger:d,returnTrigger:m,contains:(e,t)=>v?.contains?v.contains(e,t):!!d()?.contains(e)||!!x?.contains(e,t),close:O,modal:()=>v?.modal?.()??MM(r.get().modal),parent:()=>v?.parent?.(),persistent:()=>v?.persistent?.()??[],finalFocus:()=>u().finalFocus,takesEscape:v?.takesEscape,onEscape:e=>v?.onEscape?v.onEscape(e):O(`escape-key`,{event:e,focus:!0}),onShow:e=>v?.onShow?.(e),onOpenChange(e,t){v?.onOpenChange?.(e,t),S?.change(e),e?(b?.open(),D()):(C?.clear(),w?.clear())},onOpenChangeComplete(e,t){v?.onOpenChangeComplete?.(e,t),a().onOpenChangeComplete?.(e)}}),A=uF({dismissal:y,popup:k,store:r,payload:o.payload?.(r,(e,t)=>l(`payload`,e,t)),change:(e,t)=>l(`open`,e,{...t,...v?.details?.()}),onDestroy:n.onDestroy,get returnFocus(){return v?.returnFocus},rules:{open(e,t){C?.clear(),S?.opening(e.event),v?.open?v.open(e,t):t()},reopen(e){if(C?.clear(),v?.reopen)return v.reopen(e);let{trigger:t,payload:n,payloadReason:i,event:a}=e;t!==void 0&&t!==r.get().trigger&&A.takeOver({trigger:t,payload:n,reason:i,event:a})},close:(e,t)=>v?.close?v.close(e,t):t()}});D(),kA(n,[`modal`],(e,t,n)=>E(n,{...t,...e}));let ee=r.get().modal;r.subscribe(()=>{let{modal:e}=r.get();e!==ee&&(ee=e,k.updateModal())});let j={dismissal:y,presentation:b,press:x,group:S,hover:C,focus:w,triggerName:T,rules:v};return{...A.api,getPayload:()=>r.get().payload,focus:()=>d()?.focus(),internal:Object.assign(_,j)}}function pF(e){let t=e.open??e.defaultOpen??!1;return{open:t,mounted:t,trigger:null,payload:void 0,titled:null,described:!1,modal:!1,presentation:`popover`}}var mF=t((()=>{NA(),rF(),aF(),oN(),dF()}));function hF(e){_F.add(e),vF||(vF=!0,queueMicrotask(gF))}function gF(){vF=!1;try{for(let e of _F)_F.delete(e),e()}finally{_F.size&&!vF&&(vF=!0,queueMicrotask(gF))}}var _F,vF,yF=t((()=>{_F=new Set,vF=!1}));function bF(e,t){let n=e;if(n.owner.sleeping)return new tI(n,t);let r=n.view;if(r&&r.props===t&&r.api===e.api)return r;let i={id:e.id,key:e.key,props:t,api:e.api};return t===e.props&&(n.view=i),i}function xF(e){e.dropped&&!e.owner.parts.has(e.mapKey)&&(TF(e),e.dropped=!1),e.leases++;let t=!0;return()=>{if(!t||(t=!1,--e.leases))return;let{owner:n}=e;n.released?n.released.push(e):(n.released=[e],queueMicrotask(()=>CF(n)))}}function SF(e){let{owner:t}=e;t.released?t.released.push(e):(t.released=[e],queueMicrotask(()=>CF(t)))}function CF(e){let t=e.released;if(t){e.released=void 0;for(let n=0;n<t.length;n++){let r=t[n];if(!r.leases&&e.parts.get(r.mapKey)===r){e.parts.delete(r.mapKey);let t=e.keyed.get(r.slot);t===r?e.keyed.delete(r.slot):t instanceof Map&&t.get(r.key)===r&&t.delete(r.key),r.dropped=!0}}}}function wF(e){let{parts:t}=e;if(e.unordered){e.unordered=!1;let n=0,r=!0;for(let e of t.values()){if(e.rank<n){r=!1;break}n=e.rank}if(!r){let e=[...t.values()].sort((e,t)=>e.rank-t.rank);t.clear();for(let n of e)t.set(n.mapKey,n)}}return t}function TF(e){let{owner:t}=e,{parts:n,keyed:r}=t;e.rank=++t.rank,n.set(e.mapKey,e);let i=r.get(e.slot);if(!i)r.set(e.slot,e);else if(i instanceof Map)i.set(e.key,e);else if(i.key===e.key)r.set(e.slot,e);else{let t=new Map;t.set(i.key,i),t.set(e.key,e),r.set(e.slot,t)}}function EF(e,t=e.props,n=e.store.get()){let r=QF(e),i=r.slots[e.slot],a=i.role,o=i.attrs||typeof a==`function`?bF(e,t):void 0,s=i.attrs?.(n,o),c=typeof a==`function`?a(n,o):a;if(s){let e=uI.get(i);e===void 0?uI.set(i,(`hidden`in s?cI:0)|(`id`in s?lI:0)):!(e&lI)&&`id`in s&&uI.set(i,e|lI)}let l=t.id;e.made=l===void 0||s?.id!==l?s?.id??null:void 0;let u=r.slotNames[e.slot]??(r.slotNames[e.slot]=e.slot===`root`?r.name:`${r.name}-${e.slot}`),d=a===void 0?{"data-slot":u,...s}:{"data-slot":u,role:c,...s};return a!==void 0&&(d.role=c),zF(e,d)}function DF(e,t){let n;for(let r in e)e[r]!==void 0&&iI.has(r)&&t(r)&&((n??={...e})[r]=void 0);return n??e}function OF(e,t=e.props,n=e.store.get()){let r=$F(e).state;return r?r(n,bF(e,t)):YF}function kF(e,t=e.props,n=e.store.get()){let r=$F(e).present;return!r||r(n,bF(e,t))}function AF(e,t,n=e.props){let r=$F(e).selects,i=xF(e),a=r?r.subscribe(e,t,n):LP(e.store,sI,t);return()=>{i(),a()}}function jF(e){let t=e,n=$F(e);if(t.handlersFor===n&&t.handlers)return t.handlers;let{on:r,press:i}=n;if(!r&&typeof i!=`function`)return t.handlersFor=n,t.handlers=XF;let a={};for(let t in r){let n=r[t];a[t]=t=>{t.defaultPrevented||JF(t)||n(t,rI(e))}}return typeof i==`function`&&!a.click&&(a.click=n=>{n.defaultPrevented||(t.owner.sleeping?.wake(),i(rI(e),n))}),t.handlersFor=n,t.handlers=a}function MF(e){e.propsListeners?.forEach(e=>e())}function NF(e){return QF(e).sleeping?.wake(),e.api}function PF(e,t){let n=e.propsListeners??=new Set;return n.add(t),()=>{n.delete(t)}}function FF(e){let t=dI.get(e);return t||(t=new Set(e),dI.set(e,t)),t}function IF(e){let t=$F(e),n=uI.get(t);if(n===void 0){let r=t.attrs?.(e.store.get(),bF(e,e.props));n=r?(`hidden`in r?cI:0)|(`id`in r?lI:0):0,uI.set(t,n)}return n}function LF(e,t,n={by:`core`}){let r=e,{owner:i}=r,a=e.el?r:i.parts.get(r.mapKey);a?!e.el&&a===r&&r.rank!==i.rank&&(r.rank=++i.rank,i.unordered=!0):TF(r);let o=$F(e),s={};e.el=t,r.binding=s;let c=[xF(r)],l=IF(e);if(l&cI&&mj(t.ownerDocument),(n.by===`core`||n.attaches!==`all`)&&(o.on||typeof o.press==`function`)){let r=n.by===`framework`&&n.attaches!==`all`?FF(n.attaches):void 0,i=n.by===`core`;if(r){for(let e in o.on)if(!r.has(e)){i=!0;break}!i&&typeof o.press==`function`&&!r.has(`click`)&&(i=!0)}if(i){let n=jF(e);for(let e in n)r&&r.has(e)||c.push(PA(t,e,n[e]))}}o.live&&c.push(o.live.attach(e,t)),n.by===`framework`&&o.direct&&c.push(o.direct.attach(e,t));let u=o.asleep?.(t,e);u&&c.push(u);let{sleeping:d}=i;if(d&&o.bind){let n=()=>{let n=o.bind?.(t,e);n&&c.push(n)};d.binds.add(n),c.push(()=>d.binds.delete(n))}else if(o.bind){let n=o.bind(t,e);n&&c.push(n)}return l&lI&&typeof MutationObserver<`u`&&c.push(VF(r,t)),()=>{for(let e=0;e<c.length;e++)c[e]();r.binding===s&&(e.el=r.binding=void 0,r.own!==void 0&&UF(r))}}function RF(e,t){let n=e;if(n.ref)return n.ref;let r=null,i=()=>{};return n.ref=n=>{n!==r&&(i(),r=n,i=n?LF(e,n,t):()=>{})}}function zF(e,t){let{owner:n}=e;if(!n.named?.size||!fI.some(e=>t[e]))return t;let r=BF(n,e.store);if(!r.size)return t;let i={...t};for(let e of fI){let t=i[e];t&&(i[e]=t.split(` `).map(e=>r.get(e)??e).join(` `))}return i}function BF(e,t){let n=UP(t);if(e.aliases?.version===n)return e.aliases.map;let r=new Map;for(let t of e.named){let e=pI(t);e!==void 0&&e!==t.own&&r.set(e,t.own)}return e.aliases={version:n,map:r},r}function VF(e,t){let n=GF(t);(e.own!==void 0||n&&n!==e.made)&&UF(e);let r=hI.get(t);r?r instanceof Set?r.add(e):r!==e&&hI.set(t,new Set([r,e])):(hI.set(t,e),HF().observe(t,mI)),_I++;let i=!0;return()=>{if(!i)return;i=!1;let n=hI.get(t);n===e?hI.delete(t):n instanceof Set&&(n.delete(e),n.size||hI.delete(t)),!--_I&&gI&&(gI.disconnect(),gI=void 0)}}function HF(){return gI||=new MutationObserver(e=>{for(let{target:t}of e){let e=hI.get(t);if(e instanceof Set)for(let t of e)UF(t);else e&&UF(e)}}),gI}function UF(e){let{owner:t}=e;t.unread||(t.unread=new Set,hF(()=>WF(t,e.store))),t.unread.add(e)}function WF(e,t){let n=e.unread;e.unread=void 0;let r=e.renamed===!0;e.renamed=void 0;for(let e of n)r=qF(e,e.el&&GF(e.el))||r;r&&GP(t)}function GF(e){let t=e.id;return t&&typeof t==`object`?e.getAttribute(`id`):t}function KF(e,t){!e.el&&typeof t==`string`&&$F(e).attrs&&qF(e,t)&&(QF(e).renamed=!0)}function qF(e,t){let n=pI(e),r=t&&t!==n?t:void 0;if(r===e.own)return!1;let{owner:i}=e;return e.own=r,i.named??=new Set,r===void 0?i.named.delete(e):i.named.add(e),i.aliases=void 0,n!==void 0}function JF(e){return(e.type===`keydown`||e.type===`keyup`)&&(typeof e.key!=`string`||FA(e))}var YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I,vI=t((()=>{yF(),lk(),Cj(),IA(),KP(),YF=Object.freeze({}),Object.freeze({}),XF=Object.freeze({}),ZF=Symbol(),QF=e=>e.owner,$F=e=>QF(e).slots[e.slot],eI=class{slot;key;mapKey;id;store;props;el=void 0;owner;leases=0;constructor(e,t,n,r,i,a,o){this.slot=e,this.key=t,this.mapKey=n,this.id=r,this.store=i,this.props=a,this.owner=o}get api(){return this.owner.api}},tI=class{id;key;props;[ZF];constructor(e,t){this.id=e.id,this.key=e.key,this.props=t,this[ZF]=e}get api(){return NF(this[ZF])}},nI=class{el;id;key;props;store;#e;constructor(e,t){this.el=e.el,this.id=e.id,this.key=e.key,this.props=t,this.store=e.store,this.#e=e}get api(){return NF(this.#e)}},rI=(e,t=e.props)=>QF(e).sleeping?new nI(e,t):{el:e.el,id:e.id,key:e.key,props:t,store:e.store,api:e.api},iI=new Set([`aria-label`,`aria-labelledby`,`aria-description`,`title`,`autocomplete`,`autocapitalize`,`autocorrect`,`spellcheck`,`inputmode`,`enterkeyhint`]),aI=e=>$F(e).direct?.names,oI=(e,t=e.props)=>$F(e).selects?.selection(e,t)??``,sI={},cI=1,lI=2,uI=new WeakMap,dI=new WeakMap,fI=[`aria-activedescendant`,`aria-controls`,`aria-describedby`,`aria-details`,`aria-errormessage`,`aria-flowto`,`aria-labelledby`,`aria-owns`,`for`,`headers`],pI=e=>$F(e).attrs?.(e.store.get(),bF(e,{...e.props,id:void 0})).id,mI={attributeFilter:[`id`]},hI=new WeakMap,_I=0}));function yI(e,t,n=4){let r=xI([e,t].flatMap(e=>[{x:e.left-n,y:e.top-n},{x:e.right+n,y:e.top-n},{x:e.right+n,y:e.bottom+n},{x:e.left-n,y:e.bottom+n}]));return(e,t)=>{for(let n=0;n<r.length;n++){let i=r[n],a=r[(n+1)%r.length];if((a.x-i.x)*(t-i.y)-(a.y-i.y)*(e-i.x)<0)return!1}return!0}}function bI(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function xI(e){let t=[...e].sort((e,t)=>e.x-t.x||e.y-t.y),n=e=>{let t=[];for(let n of e){for(;t.length>=2&&bI(t[t.length-2],t[t.length-1],n)<=0;)t.pop();t.push(n)}return t.pop(),t};return[...n(t),...n(t.reverse())]}var SI=t((()=>{}));function CI(e){let t,n,r;function i(){r?.(),r=void 0}function a(){clearTimeout(t),clearTimeout(n),i()}function o(t){i(),clearTimeout(n),n=setTimeout(()=>e.close(t),e.closeDelay())}return{clear:a,enter(e,r,a=0){e.pointerType!==`touch`&&(clearTimeout(n),i(),r&&(clearTimeout(t),a>0?t=setTimeout(r,a):r()))},leave(n){if(n.pointerType===`touch`||(clearTimeout(t),!e.closesOnLeave()))return;let a=e.trigger(),s=e.popup();if(!a||!s)return o(n);let c=yI(a.getBoundingClientRect(),s.getBoundingClientRect());if(!c(n.clientX,n.clientY))return o(n);i(),r=PA(s.ownerDocument,`pointermove`,e=>{c(e.clientX,e.clientY)||o(e)})}}}var wI=t((()=>{IA(),SI()}));function TI(e,t,n){if(typeof t!=`string`)return t??n();let r=e.getRootNode();return(r===e.ownerDocument?null:r.querySelector(t))??e.ownerDocument.querySelector(t)}function EI(e,t,n){return{side:e.side??t.side??`bottom`,align:e.align??t.align,sideOffset:e.sideOffset??t.sideOffset??4,alignOffset:e.alignOffset??t.alignOffset??0,collisionPadding:e.collisionPadding,arrow:n,arrowPadding:e.arrowPadding}}function DI(e,t,n){for(let r of PI){let i=r.popup.element();!r.store.get().open||r.popup.opener()!==`hover`?PI.delete(r):r!==e&&!i?.contains(t??null)&&!i?.contains(document.activeElement)&&r.control.hide({reason:`trigger-hover`,event:n,focus:!1})}}function OI(e,t){let{store:n,options:r,preset:i}=e;e.onDestroy(()=>PI.delete(e));let a=CI({trigger:e.triggerElement,popup:()=>e.popup.element(),closesOnLeave:()=>n.get().open&&e.popup.opener()===`hover`,closeDelay:()=>r().closeDelay??i.closeDelay??0,close(t){e.popup.element()?.contains(document.activeElement)||e.control.hide({reason:`trigger-hover`,event:t,focus:!1})}});e.onDestroy(a.clear);let o=()=>(!i.press||!!r().openOnHover)&&!r().disabled,s=e=>o()&&a.leave(e);return{clear:a.clear,enter(s,c,l){if(!o())return;if(c===void 0)return a.enter(s);let u=()=>{o()&&!e.triggerDisabled(c)&&(t||(DI(e,e.element(e.triggerSlot,c),s),PI.add(e)),e.control.show({by:`hover`,event:s,reason:`trigger-hover`,trigger:c,payload:l}))};if(n.get().open){a.enter(s),n.get().trigger!==c&&u();return}let d=r().delay??i.delay??300;a.enter(s,u,t?t.delay(d):d)},leave:s,leaveContent(t){let n=t.relatedTarget;n&&e.triggerElement()?.contains(n)||s(t)}}}function kI(e){let{store:t,options:n,preset:r}=e,i,a=()=>clearTimeout(i);return e.onDestroy(a),{clear:a,enter(o,s,c){if(n().disabled||!xk())return;let l=()=>{!n().disabled&&!e.triggerDisabled(o)&&e.element(e.triggerSlot,o)?.contains(document.activeElement)&&e.control.show({by:`keyboard`,event:c,reason:`trigger-focus`,trigger:o,payload:s})},u=r.focusDelay??n().delay??r.delay??0;a(),t.get().open?l():u>0?i=setTimeout(l,u):l()},leave(n){if(a(),!t.get().open||e.popup.opener()===`hover`)return;let r=n.relatedTarget;r&&(e.popup.element()?.contains(r)||[...e.parts()].some(t=>t.slot===e.triggerSlot&&t.el?.contains(r)&&!e.triggerDisabled(t.key)))||e.control.hide({reason:`focus-out`,event:n,focus:!1})},keydown(t){let n=e.popup.element();return t.key===`Tab`&&!(n&&cM(n).length)},triggerAttrs(e,t,n,r,i){let a=e.trigger===null||e.trigger===n;return{...sA(e.open&&a),"aria-describedby":i===`tooltip`&&a?`${t}-content`:void 0,"data-disabled":r.disabled?``:void 0}}}}function AI(e){return e?e.type.startsWith(`focus`)?`focus-out`:e.type.startsWith(`pointer`)?`trigger-hover`:`outside-press`:`imperative`}function jI(e){let t=t=>e.control.hide({reason:AI(t),event:t});function n(e){II.close!==t&&II.close?.(e)}let r=!1;return e.onDestroy(()=>{II.close===t&&(II.close=void 0)}),{delay:e=>LI()?0:e,opening:n,change(e){e?(r=LI(),n(),II.close=t):II.close===t&&(II.close=void 0,II.closedAt=performance.now())},instant:()=>r,join(){e.store.get().open&&!II.close&&(II.close=t)}}}function MI(e,t){let n=`${e}-${t}`,r=RI.get(n);return r||(r=[`[data-slot="${n}"]`,`[data-slot="${e}-backdrop"]`],RI.set(n,r)),r}var NI,PI,FI,II,LI,RI,zI,BI=t((()=>{xA(),Ik(),cA(),aP(),pM(),wI(),oN(),NI={position:VN,prepare:()=>fA(RN),anchor:TI,options:EI},PI=new Set,FI=400,II={close:void 0,closedAt:-1/0},LI=()=>!!II.close||performance.now()-II.closedAt<FI,RI=new Map,zI={prepare(e,t){let n=MI(e,t);fA(()=>KM(n))},prepareClient(e,t){KM(MI(e,t))},bind(e){GM(e.ownerDocument,[`[data-slot="${e.getAttribute(`data-slot`)}"]`])}}}));function VI(e,t){return{opening(n,r,i){let a={trigger:e.get().trigger,payload:e.get().payload};return n!==void 0&&e.set({trigger:n}),t(r,i),()=>e.set(a)},handOver(n,r,i){e.set({trigger:n}),t(r,i)},reopening(e,n){return`payload`in e&&t(e.payload,n)}}}var HI=t((()=>{})),UI,WI=t((()=>{BI(),HI(),UI={payload:VI,behavior:`tooltip`,role:`tooltip`,side:`top`,delay:600,closeDelay:0,focusDelay:0,placement:NI,hover:OI,focus:kI,group:jI,resetStyles:zI}}));function GI(e,t){let n=qI.get(e);if(n){n.push(t);return}let r=[t];qI.set(e,r),hF(()=>{qI.delete(e);let t={};for(let e of r)e(t);e.set(t)})}function KI(e,t){GI(e,n=>{n[t]===void 0&&e.get()[t]===null&&(n[t]=!1)})}var qI,JI=t((()=>{yF(),qI=new WeakMap}));function YI(e,t,n,r,i){e.press?.keydown(t,n,r,i)||e.focus?.keydown(t)||e.popup.triggerKeydown(t)}function XI(e,t,n){nM(n,t)&&e.popup.keydown(t)}function ZI(e,t,n,r){let{preset:i,control:a,contentProps:o,triggerElement:s,element:c,popup:l,press:u,rules:d,presentation:f}=t,{placement:p}=i;i.resetStyles?.bind(e);let m=!!o(n).inline;return(f??l).bind(e,{inline:m,anchor:()=>a.anchor()??p?.anchor(e,o().anchor,s),position:p&&!m?()=>p.options(o(n),{side:i.side,align:`center`},c(`arrow`)):void 0,rendered:r&&(e=>PF(r,e)),initialFocus:u&&(()=>u.initialFocus(l.element(),o().initialFocus,d?.preferredFocus)),chosenFocus:u&&(()=>(o().initialFocus??`auto`)!==`auto`),backdrop:()=>c(`backdrop`),...d?.bind?.()})}function QI(e,t,n){return e.get().trigger===null&&e.set({trigger:t}),()=>{e.get().trigger===t&&!e.get().open&&e.set({trigger:n?.(t)??null})}}function $I(e){return e({props:{id:`id`,disabled:`boolean`,focusableWhenDisabled:`boolean`,payload:`value`},state:(e,{key:t,props:n})=>({open:e.open&&(e.trigger===null||e.trigger===t),disabled:!!n.disabled}),attrs:(e,{id:t,key:n,props:r,api:i})=>{let{press:a,focus:o,role:s}=i.internal;return(a??o)?.triggerAttrs(e,t,n,r,s)??{}},on:{pointerenter:(e,{api:t,key:n,props:r})=>!r.disabled&&t.internal.hover?.enter(e,n,r.payload),pointerleave:(e,{api:t})=>t.internal.hover?.leave(e),focusin:(e,{api:t,key:n,props:r})=>!r.disabled&&t.internal.focus?.enter(n,r.payload,e),focusout:(e,{api:t})=>t.internal.focus?.leave(e),keydown:(e,{api:t,el:n,key:r,props:i})=>n&&YI(t.internal,e,n,r,i)},press:({api:e,key:t,props:n},r)=>e.internal.press?.press(t,n,r),bind(e,{api:t,key:n,id:r,store:i}){let a=QI(i,n,t.internal.nextTrigger);return i.get().trigger===n&&!e.hasAttribute(`id`)&&(e.id=`${r}-trigger`),a}})}function eL(e){return e({props:{side:`string`,align:`string`,sideOffset:`number`,alignOffset:`number`,collisionPadding:`number`,container:`value`,arrowPadding:`number`,anchor:`string`,initialFocus:`string`,finalFocus:`string`,keepMounted:`boolean`},connect:tM,role:(e,{api:t})=>t.internal.role,roles:[`dialog`,`alertdialog`,`menu`,`tooltip`],keys:[`Tab`],state:e=>({open:e.open,modal:e.modal,presentation:e.presentation,payload:e.payload}),present:(e,{props:t,api:n})=>e.mounted||!!t.keepMounted||n.internal.role===`tooltip`,attrs:(e,{id:t,api:n})=>{let{role:r,press:i,triggerName:a}=n.internal;return{...RM(e,t),tabindex:r===`tooltip`?void 0:`-1`,...i?.contentAttrs(e,t,r),...a?.contentAttrs(e,t)}},on:{keydown:(e,{api:t,el:n})=>n&&XI(t.internal,e,n),pointerenter:(e,{api:t})=>t.internal.hover?.enter(e),pointerleave:(e,{api:t})=>t.internal.hover?.leaveContent(e)},bind(e,t){KI(t.store,`titled`);let n=()=>{let n=e.hasAttribute(`aria-label`);n!==!!t.store.get().named&&GI(t.store,e=>{e.named=n})};n();let r=new MutationObserver(n);r.observe(e,{attributeFilter:[`aria-label`]});let i=ZI(e,t.api.internal,t.key,t);return()=>{r.disconnect(),i?.()}}})}function tL(e){return e({state:e=>({open:e.open}),attrs:e=>({"aria-hidden":`true`,...sA(e.open)}),bind(e,{api:t}){t.internal.popup.checkPlacement()}})}var nL=t((()=>{lk(),uk(),JI(),cA(),vI(),oN(),iM()}));function rL(e){let t=e.slots(e=>e),n=e.name,r=e.label??n,i={};for(let e in t)i[e]=e===`root`?n:`${n}-${e}`;let a=a=>{let o=a,s=a.id,c=e.state(o),l=e.sync?.(o),u=IP(l?{...c,...l}:c,e.live??aL),d,f,p=t,m;function h(e){m?.has(e)||(m||(m=new Set,g.slots=Object.create(p)),m.add(e),Object.assign(g.slots,e.slots),E(),e.extend?.(C))}let g={name:n,label:r,slots:p,slotNames:i,parts:new Map,keyed:new Map,rank:0},{parts:_}=g;function v(e={}){return e.id??(e.value==null?``:String(e.value))}let y;function b(e,t={},n=!1){let r=v(t),i=g.keyed.get(e),a=i instanceof Map?i.get(r):i?.key===r?i:void 0;if(!a){let i=`${e}:${r}`;a=g.sleeping?new eI(e,r,i,s,u,t,g):{slot:e,key:r,mapKey:i,id:s,api:C,store:u,props:t,el:void 0,owner:g,leases:0},TF(a),n&&SF(a)}else if(n)return a;return a.props=t,MF(a),a}function x(e,t){if(t===void 0){for(let t of wF(g).values())if(t.slot===e&&t.el?.isConnected)return t.el;return}let n=_.get(`${e}:${t}`)?.el;return n?.isConnected?n:void 0}let S={id:s,label:r,store:u,options:()=>o,onOptions:e=>{(f??=[]).push(e)},onDestroy:e=>{(d??=[]).push(e)},parts:()=>wF(g).values(),element:x,props:(e,t=``)=>{let n=y?.[e];return n&&v(n)===t?n:_.get(`${e}:${t}`)?.props}},C;function w(){C=e.api(S),g.api=C,wA(S,C)}let T=!1;function E(){let{sleeping:e}=g;if(e&&!T){T=!0,pA(k,w),g.sleeping=void 0;for(let t of[...e.binds])t()}}e.asleep?.(o)?g.sleeping={wake:E,binds:new Set}:w();let D=!1,O=(t,n)=>AA(u,t,e.sync?.(t),n),k={types:void 0,name:n,id:s,get:u.get,subscribe:u.subscribe,get api(){return E(),C},part:b,use:h,preview(e){let t=O({...e,id:s},u.get()),n=u.get();for(let e in t)if(!NP(n[e],t[e]))return{...n,...t}},get derives(){return MA(u)},view(e,t,n){let r=y;y=n;try{return u.view(e,t)}finally{y=r}},setOptions(t){let n=HP(u);o=t.id===s?t:{...t,id:s},g.sleeping&&!e.asleep(o)&&E();let r=O(o,n),i;try{if(f)for(let e of f)i=e(o,r)??i;let e=HP(u)===n?r:O(o,HP(u));e&&CP(i,()=>u.set(e,!0))}finally{}},startState:t=>e.state({...t,id:s}),follow(e){let t,n,r=(r=HP(u),i)=>{if(i)return O({...i,id:s},r);if(D)return n;let a=e();return(t?.options!==a||t.state!==r)&&(t={options:a,state:r},n=O({...a,id:s},r)),n};return u.follow(r),r},destroy(){D||(D=!0,gA(k),d&&lA(()=>{for(let e=0;e<d.length;e++)d[e]()}))}};return WP(k,u),qP(k,_,e,S.options),k},o=e=>uA(()=>a(e));return Object.defineProperty(o,"name",{value:n}),Object.assign(o,{options:e.options,slots:t})}function iL(e){let t=oL.get(e);if(!t){let{options:n,slots:r={}}=e;t={options:{debug:`boolean`,...n},slots:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t.props??{}]))},oL.set(e,t)}return t}var aL,oL,sL,cL=t((()=>{lk(),DA(),NA(),DP(),xA(),vI(),KP(),ZP(),aL=[],oL=new WeakMap,sL=e=>UP(e)}));function lL(e,t){return e?eA(e,t):``}function uL(e){queueMicrotask(()=>e.get().apple!==Zk()&&e.set({apple:Zk()}))}function dL(e,t){return e({props:{shortcut:`string`},state:(e,n)=>({text:lL(n.props.shortcut??t(e),e.apple)}),attrs:()=>({"aria-hidden":`true`,translate:`no`}),asleep(e,n){let{store:r,props:i}=n;if(uL(r),e.childNodes.length)return;let a=()=>{let a=r.get();e.textContent=lL(i.shortcut??t(a,e,n),a.apple)};a();let o=r.subscribe(a);return()=>{o(),e.textContent=``}}})}var fL=t((()=>{oA()}));function pL(e,t){let n=e.getAttribute(`aria-labelledby`);return!!e.getAttribute(`aria-label`)?.trim()||!!n&&n!==t||!!e.getAttribute(`title`)?.trim()||!!bP(e).trim()||!!e.querySelector(`img[alt]:not([alt=''])`)}function mL(e,t){let n=``;for(let r of e.childNodes)if(r.nodeType===Node.TEXT_NODE)n+=r.nodeValue;else if(r.nodeType===Node.ELEMENT_NODE&&!(t&&vL(r))){let e=mL(r,t);n+=e.trim()&&pP(r,e)?` ${e} `:e}return n}function hL(e){let t=null,n=()=>{let n=e.getAttribute(`aria-label`);if(n!==null&&n!==t)return;let r=bL(e),i=r===yL(mL(e,!1))?null:r;i!==t&&(t=i,i===null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,i))};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,characterData:!0,attributeFilter:[`aria-hidden`,`hidden`]}),()=>{r.disconnect(),t!==null&&e.getAttribute(`aria-label`)===t&&e.removeAttribute(`aria-label`)}}function gL(e){let{store:t,options:n}=e,r=fF(e,{preset:UI}),{control:i,hover:a,group:o}=r.internal,s=!1,c=!1,l=t.get().open;t.subscribe(()=>{let{open:e}=t.get();e!==l&&(l=e,e&&t.set({instant:!!o?.instant()}),e&&c&&queueMicrotask(()=>{let e=r.internal.popup.element();e&&Rk(bL(e),{doc:e.ownerDocument})}),c=!1)});function u(e,o,l,u){let d=ZM(l);if(n().toggleable){if(t.get().open&&r.internal.popup.opener()!==`hover`)return i.hide({reason:`trigger-press`,event:l});if(n().disabled)return;c=!t.get().open,i.show({event:l,by:d,reason:`trigger-press`,trigger:e,payload:o})}else n().closeOnPress!==!1&&u?.getAttribute(`aria-disabled`)!==`true`&&(a?.clear(),s=!!l&&d!==`keyboard`,i.hide({reason:`trigger-press`,event:l}))}return{...r,internal:Object.assign(r.internal,{tooltipPress:u,enter(e,t,n){s||a?.enter(e,t,n)},leave(e){s=!1,a?.leave(e)}})}}var _L,vL,yL,bL,xL,SL=t((()=>{lk(),uk(),Ik(),Hk(),oA(),oN(),vP(),xP(),mF(),WI(),nL(),cL(),fL(),_L=e=>(e.type??(e.unnamed?`label`:`description`))===`label`,vL=e=>e.hasAttribute(`hidden`)||e.getAttribute(`aria-hidden`)===`true`,yL=e=>e.replace(/\s+/g,` `).trim(),bL=e=>yL(mL(e,!0)),xL=rL({name:`tooltip`,options:{container:`value`,open:`boolean`,defaultOpen:`boolean`,onOpenChange:`callback`,onOpenChangeComplete:`callback`,onPayloadChange:`callback`,delay:`number`,closeDelay:`number`,disabled:`boolean`,toggleable:`boolean`,closeOnPress:`boolean`,type:`string`,shortcut:`string`,controller:`value`},state:e=>({...pF(e),instant:!1,unnamed:!1,type:e.type,shortcut:e.shortcut,apple:Qk()}),asleep:e=>e.open===void 0&&!e.defaultOpen&&!e.controller,sync:e=>({...e.open!==void 0&&{open:e.open},type:e.type,shortcut:e.shortcut}),api:gL,slots:e=>{let t=$I(e),n=eL(e);return{trigger:e({...t,props:{id:`id`,payload:`value`},state:(e,{key:t})=>({open:e.open&&(e.trigger===null||e.trigger===t)}),attrs:(e,{id:t,key:n})=>{let r=e.trigger===null||e.trigger===n,i=_L(e);return{type:`button`,"aria-labelledby":i?`${t}-content`:void 0,"aria-describedby":!i&&r?`${t}-content`:void 0,"aria-keyshortcuts":e.shortcut?$k(e.shortcut,e.apple):void 0}},on:{...t.on,pointerenter:(e,{api:t,key:n,props:r})=>t.internal.enter(e,n,r.payload),pointerleave:(e,{api:t})=>t.internal.leave(e)},press:({api:e,key:t,props:n,el:r},i)=>e.internal.tooltipPress(t,n.payload,i,r),bind:void 0,asleep(e,{key:t,store:n,id:r}){let i=QI(n,t);_k();let a=!0,o;return queueMicrotask(()=>{let i=n.get(),s={};i.trigger===t&&(s.unnamed=!pL(e,`${r}-content`)),i.apple!==Zk()&&(i.shortcut?s.apple=Zk():a&&(o=n.subscribe(()=>{n.get().shortcut&&(o(),uL(n))}))),(s.unnamed!==void 0||s.apple!==void 0)&&n.set(s)}),e.matches(`:disabled`),()=>{a=!1,o?.(),i()}}}),content:e({...n,props:{side:`string`,align:`string`,sideOffset:`number`,alignOffset:`number`,collisionPadding:`number`,container:`value`,arrowPadding:`number`,anchor:`string`},state:e=>({open:e.open,instant:e.instant,payload:e.payload}),role:`tooltip`,present:()=>!0,attrs:(e,{id:t})=>({...RM(e,t),tabindex:void 0,"data-instant":e.instant?``:void 0}),asleep:e=>hL(e),bind(e,t){return t.api.internal.group?.join(),n.bind(e,t)}}),arrow:tL(e),shortcut:dL(e,e=>e.shortcut)}},agent:{actions:[`setOpen`]}})})),CL=t((()=>{X()}));function wL(){if(!(TL||typeof document>`u`)){TL=new WeakMap;for(let e of Array.from(document.querySelectorAll(`input`)))e.value!==e.defaultValue&&TL.set(e,e.value)}}var TL,EL=t((()=>{}));function DL(e){let t=jL.get(e);if(t)return t;let n=iL(e).options,r=Object.keys(n).filter(e=>AP(e)in n||kP(e,`Change`)in n),i=new Set(r.map(AP));return t={controlled:r,data:Object.keys(n).filter(e=>{let t=n[e],a=typeof t==`object`?t.kind:t;return(a===`value`||a===`list`)&&!r.includes(e)&&!i.has(e)})},jL.set(e,t),t}function OL(e,t){if(typeof e==`object`&&e&&!t.includes(e)){if(t.push(e),Array.isArray(e))for(let n=0;n<e.length;n++)OL(e[n],t);else if(BP(e))for(let n in e)OL(e[n],t);t.pop()}}function kL(e,t){let n=!1;return t(()=>(OL(e,[]),n?MP([...e]):(n=!0,e)))}function AL(e,t){let n=DL(e);if(!n.controlled.length&&!n.data.length)return e=>e;let r,i;return e=>{let a=e,o;for(let e of n.controlled){let t=a[e];if(!Array.isArray(t))continue;let n=[...t];r??={};let i=r[e];i&&NP(i,n)||(r[e]=i=n),o??={...a},o[e]=i}for(let e of n.data){let n=a[e];if(!Array.isArray(n)){i&&e in i&&delete i[e];continue}i??={};let r=i[e];r?.list!==n&&(i[e]=r={list:n,handed:kL(n,t)});let s=r.handed();s!==n&&(o??={...a},o[e]=s)}return o??e}}var jL,ML=t((()=>{jP(),cL(),KP(),jL=new WeakMap})),NL=t((()=>{lk(),ML(),vI(),EL(),xA(),cL(),KP(),oA()}));function PL(e){for(let t=e;t;t=t.parent)if(t.isDeactivated)return!0;return!1}function FL(){let e=Ks(PL(gf()));return Nl(()=>e.value=!0),Ml(()=>e.value=!1),e}function IL(){let e=new Map,t=rs(),n=PL(gf()),r,i=i=>{if(!r){let i=Ks(n);r=i;let a=()=>H(i,()=>{n=i.value,e.forEach((e,t)=>t(n?null:e))},{flush:`post`});t?t.run(a):a()}r.value=i};Nl(()=>i(!0)),Ml(()=>i(!1));let a=new WeakMap,o=new WeakMap,s={};return(t,r)=>{let i=gf()??s,c=a.get(i);c||a.set(i,c=new WeakMap);let l=c.get(t);if(l)return l;let u=i.suspense,d=null;return l=i=>{let a=i&&typeof i==`object`&&`$el`in i?i.$el:i;if(!a){let n=d;return d=null,e.get(t)===n?(e.delete(t),t(null)):void 0}let s=o.get(a);s||o.set(a,s=new Map);let c=s.get(r);s.set(r,t),c&&c!==t&&e.get(c)===a&&(e.delete(c),n||c(null)),d=a,e.set(t,a),n||(u?.pendingBranch?u.effects.push(()=>e.get(t)===a&&t(a)):t(a))},c.set(t,l),l}}var LL=t((()=>{X()}));function RL(e){if(!gf()&&dl())throw Error(`${e} isn't set up in a VDOM component's setup. In a Vapor app, install vaporInteropPlugin, and define your own parts with defineComponent.`)}function zL(e,t){if(!e||!t)return e??t;let n=cR.get(e);n||cR.set(e,n=new WeakMap);let r=n.get(t);return r||(r=n=>{e(n),t(n)},n.set(t,r)),r}function BL(e){let t=lR.get(e);if(t)return t;t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);e!==-1&&(t[n.slice(0,e).trim()]=n.slice(e+1).trim())}return lR.size>=500&&lR.clear(),lR.set(e,t),t}function VL(e){let t=uR.get(e);return t||uR.set(e,t=`on${e[0].toUpperCase()}${e.slice(1)}`),t}function HL(e){let t=jF(e),n=mR.get(e);if(n&&n.source===t)return n.entries;let r=null;for(let e in t){let n=t[e];wR.add(n),(r??=[]).push({prop:VL(e),handler:n})}return mR.set(e,{source:t,entries:r}),r}function UL(e,t,n){let r=DF(t,n?t=>e[t]!=null:dR);for(let t in r){let i=r[t];i===void 0||n&&t===`id`&&e.id!=null||(t===`style`?e.style=n&&e.style?Ya([e.style,BL(i)]):BL(i):e[t]=n&&t===`class`&&e.class?Za([e.class,i]):i)}return e}function WL(e){let t=gR.get(e);return t||gR.set(e,t=Symbol(e.name)),t}function GL(e){return ul(WL(e),null)}function KL(e){let t=GL(e);if(!t){let t=_R(e.name);throw Error(`${t} parts must be used inside <${t}>.`)}return t.handle}function qL(e){ll(WL(e.primitive),{handle:e,around:{}})}function JL(e,t,n){let r=GL(e);r&&ll(WL(e),{...r,around:{...r.around,[t]:n}})}function YL(e,t){RL(`A ui-sdk root`);let n=`ui-sdk-${Cl()}`,r=AL(e,vR);wL();let i;fl(()=>{let a=r({...t(),id:n});i?i.setOptions(a):(i=dA(()=>e(a)),i.preview(a)&&i.setOptions(a))}),Dd(()=>mA(i));let a,o,s=()=>{if(!a){let e=Ks(sL(i));a=e,o=i.subscribe(()=>e.value=sL(i))}a.value};is(()=>{o?.(),i.destroy()});let c=IL(),l=XL(i);yR.set(i,l);let u=e=>{let t=gf();if(t)return l(t,e);s()},d=(e,t,n,r)=>{let i={},a=!1;for(let e in n)e!==`ref`&&(i[e]=n[e],a=!0);UL(i,r,a);let o=HL(e);if(o)for(let e=0;e<o.length;e++){let{prop:t,handler:n}=o[e],r=a?i[t]:void 0;if(r){let e=e=>{if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]?.(e);else r(e);n(e)};wR.add(e),i[t]=e}else i[t]=n}return i.ref=zL(n.ref,c(RF(e,fR),t)),i},f={primitive:e,instance:i,get api(){return i.api},get state(){return s(),i.get()},present(e,t){let n=i.part(e,t),r=kF(n),a=u(n);return a&&(a.present=r),r},slot(e,t,n=pR){let r=i.part(e,t);KF(r,n.id);let a=EF(r),o=u(r);return o&&(o.attrs=a),d(r,e,n,a)}};return hR.set(f,(e,t,n)=>{let r=i.part(e,t),a=kF(r),o=u(r);if(o&&(o.present=a),!a)return null;KF(r,n.id);let s=EF(r);return o&&(o.attrs=s),d(r,e,n,s)}),qL(f),f}function XL(e){let t=new WeakMap;function n(t,n,r){n.onChange?.();let i=()=>n.present!==void 0&&kF(t,n.props)!==n.present;if(r){i()&&n.tick.value++;return}let a=sL(e);a!==n.version&&(n.version=a,(i()||n.attrs&&!ZL(EF(t,n.props),n.attrs,aI(t)))&&n.tick.value++)}return(r,i)=>{let a=t.get(r);if(!a){let e=a=new Map;t.set(r,e),jd(()=>e.forEach(e=>e.unsubscribe?.()),r)}let o=a.get(i);o||a.set(i,o={tick:Ks(0),props:i.props,version:0}),o.props=i.props,o.version=sL(e);let s=oI(i);if(o.subscription!==s){let e=o;e.unsubscribe?.(),e.subscription=s,e.unsubscribe=AF(i,t=>n(i,e,t))}return o.tick.value,o}}function ZL(e,t,n){let r=0;for(let i in e)if(r++,(e[i]!==t[i]||!(i in t))&&!n?.includes(i))return!1;let i=0;for(let e in t)i++;return r===i}function QL(e,t){let n={};for(let r in Us(e))r!==t&&(n[r]=e[r]);return n}function $L(e,t,n,r=gf()){let i=Ks(0),a,o,s=new Set,c=()=>OF(e.part(t,n())),l=e=>{for(let t of s)if(!PP(e[t],a[t]))return!0;return!1},u=()=>{let e=c();l(e)&&(a=e,s.clear(),i.value++)},d=r&&yR.get(e),f,p,m,h=e=>{let t=oI(e);(e!==p||t!==m)&&(p=e,m=t,d?(f&&(f.onChange=void 0),f=d(r,e),f.onChange=u):(o?.(),o=AF(e,u)))};return r?jd(()=>o?.(),r):is(()=>o?.()),new Proxy({},{get(r,o){i.value;let c=e.part(t,n());return a=OF(c),typeof o==`string`&&s.add(o),h(c),a[o]}})}function eR(e,t){let n=bR.get(e);if(!n){let r=Ks(t);bR.set(e,n={own:r,component:()=>r.value()})}return n.own.value=t,n.component}function tR(e,t,n,r){let{tag:i,children:a,hidden:o}=r;if(t.render){let r=a?()=>a(n()):()=>t.default?.({get state(){return n()}}),{ref:i,...s}=e,c=t.render({props:i?{...s,...rR(i)}:s,get state(){return n()},children:eR(t,r)});return i&&iR(c,i,e[`data-slot`]),o?[...c,o()]:c.length===1?c[0]:c}let s=a?a(n()):t.default?.({get state(){return n()}});return q(i,e,o?[s,o()]:s)}function nR(e,t,n,r){return tR(e,t,()=>n,r)}function rR(e){let t=xR.get(e);if(!t){let n=t=>{!CR.has(t)&&t.el?.nodeType===Node.ELEMENT_NODE&&SR.get(e)!==t.el&&(SR.set(e,t.el),e(t.el))};t={onVnodeMounted:n,onVnodeUpdated:n,onVnodeUnmounted:t=>{SR.get(e)===t.el&&(SR.delete(e),e(null))}},xR.set(e,t)}return t}function iR(e,t,n){let r=[...e];for(;r.length;){let e=r.shift();if(Array.isArray(e))r.unshift(...e);else if(ku(e)&&e.props?.[`data-slot`]===n){CR.has(e)||(CR.add(e),e.ref=Nu(e,{ref:t},!0).ref);return}else ku(e)&&(e.type===rf||e.type===bd)&&Array.isArray(e.children)&&r.unshift(...e.children)}}function aR(e,t,n=()=>({}),r,i=`div`){RL(`The ${t} part`);let a=gf();if(!a)throw Error(`The ${t} part must call usePart in its setup.`);let o=typeof e==`function`?GL(e)?.handle:e;if(!o)throw Error(`The ${t} part must be used inside its primitive's root.`);let s=Kl(),c=Gl(),l=typeof i==`string`?{tag:i}:i,u=hR.get(o),d,f=()=>d??=$L(o.instance,t,n,a);return Object.defineProperty(()=>{let e=n(),i=r?r():s,a;if(u){if(a=u(t,e,i),!a)return null}else{if(!o.present(t,e))return null;a=o.slot(t,e,i)}return tR(l.extend?l.extend(a):a,c,f,l)},"state",{get:f,enumerable:!0})}var oR,sR,cR,lR,uR,dR,fR,pR,mR,hR,gR,_R,vR,yR,bR,xR,SR,CR,wR,TR=t((()=>{NL(),X(),CL(),LL(),oR={type:Boolean,default:void 0},sR=(e,t)=>e===void 0?t:e,cR=new WeakMap,lR=new Map,uR=new Map,dR=()=>!1,fR={by:`framework`,attaches:`all`},pR=Object.freeze({}),mR=new WeakMap,hR=new WeakMap,gR=new WeakMap,_R=e=>e.replace(/(^|-)(\w)/g,(e,t,n)=>n.toUpperCase()),vR=e=>{let t=Y(e);return()=>t.value},yR=new WeakMap,bR=new WeakMap,xR=new WeakMap,SR=new WeakMap,CR=new WeakSet,wR=new WeakSet}));function ER(e){let t=NR.get(e);return t||NR.set(e,t=Ks(void 0)),t}function DR(e,t){let n=GL(e)?.handle;return()=>{let e=t();return(e&&ER(e).value)??n}}function OR(e,t){Dd(()=>H(e,(e,n,r)=>{if(!e)return;let i=ER(e);i.value=t,r(()=>{i.value===t&&(i.value=void 0)})},{flush:`post`,immediate:!!e()}))}function kR(e,t,{slots:n,state:r,children:i}){return nR(t,n,r,{tag:e,children:i})}function AR(e){let t,n=Object.create(e);n.slot=(n,r,i)=>{let a=e.slot(n,r,i);return t=a.ref,a};let r=hR.get(e);return r&&hR.set(n,(e,n,i)=>{let a=r(e,n,i);return a&&(t=a.ref),a}),{handle:n,release:()=>t?.(null)}}function jR(e,t,n){let r,i;return is(()=>i?.scope.stop()),()=>{let a=e();return a!==r&&(r=a,i?.release(),i?.scope.stop(),i=a&&MR(a,t)),i?i.render():n()}}function MR(e,t){let n=ns(!0),r=AR(e);return{scope:n,render:n.run(()=>t(r.handle)),release:r.release}}var NR,PR=t((()=>{X(),TR(),NR=new WeakMap}));function FR(e){let t=ul(RR,()=>void 0);return()=>e()??t()}function IR(e,t){let n=qk(t),r=t?[q(zR,{container:t},()=>e)]:[].concat(e);return n?q(BR,{to:n},()=>r):r.length===1?r[0]:r}var LR,RR,zR,BR,VR,HR=t((()=>{NL(),X(),LL(),PR(),LR=Object,RR=Symbol(`popup-container`),zR=U({name:`PopupContainerScope`,props:{container:Object},setup(e,{slots:t}){return ll(RR,()=>e.container),()=>t.default?.()}}),BR=U({name:`PopupTeleport`,props:{to:{type:Object,required:!0}},slots:Object,setup(e,{slots:t}){let n=FL();return()=>q(bd,{to:e.to,disabled:n.value},t.default())}}),VR=e=>e}));function UR(e,t,n=[]){let r=!1;for(let e in t)if(!n.includes(e)){r=!0;break}if(!r)return;let i=Object.keys(t).filter(e=>!n.includes(e)).join(`, `);i&&!GR.has(`${e} ${i}`)&&(GR.add(`${e} ${i}`),`${e}${i}`)}function WR(e){let t=e,n=t.setup;t.inheritAttrs=!1;let r=t.props&&`readOnly`in t.props?[`readonly`]:[];return t.setup=(e,i)=>(UR(t.name??`This root`,i.attrs,r),n?.(e,i)),e}var GR,KR=t((()=>{NL(),GR=new Set}));function qR(e){let t=[];for(let n in e){let r=e[n],i=$R(r);i!==`callback`&&t.push({prop:n,isId:i===`id`,from:ez(r,n),required:typeof r==`object`&&!!r.required,key:i===`key`})}return t}function JR(...e){let t={};for(let n of e)for(let e in n){let r=$R(n[e]);r!==`callback`&&(t[e]=iz[r])}return t}function YR(e){return Object.keys(e).filter(t=>$R(e[t])===`callback`).map(t=>{let n=t[2].toLowerCase()+t.slice(3),r=n.endsWith(`Change`)?n.slice(0,-6):``;return{key:t,event:n,update:r in e?`update:${r}`:void 0}})}function XR(e,t){let n={};for(let{key:r,event:i,update:a}of e)n[r]=(...e)=>{t(i,...e),a&&!e[1]?.canceled&&t(a,e[0])};return n}function ZR(e,t){return t}function QR(e,t){let n=iL(e),r=_R(e.name),i=t,a=new Set(Object.values(n.slots).flatMap(e=>Object.entries(e).flatMap(([e,t])=>ez(t,e)?.slot??[]))),o=new Set(Object.entries(n.slots).flatMap(([e,t])=>Object.values(t).some(e=>$R(e)===`key`)?[e]:[])),s=Object.keys(n.options).filter(e=>$R(n.options[e])!==`callback`),c=i.root?n.slots.root??{}:{},l=i.root?qR(c):[],u=YR({...n.options,...c}),d=oz(u);function f(t,n,i,a,o){if(!n.length&&!a)return rz;let s=GL(e),c=s?.around??nz,l=n.some(e=>e.isId)?n.map(e=>e.isId?Cl():void 0):void 0;for(let e=0;e<n.length;e++){let i=n[e];if(i.from&&!c[i.from.slot]&&i.required)throw Error(`<${r}${_R(t)}> must be used inside <${r}${_R(i.from.slot)}>.`)}return()=>{let e=a?{...a}:{};for(let t=0;t<n.length;t++){let{prop:r,from:a,key:u}=n[t],d=i[r];d===void 0&&r===o&&(d=i.modelValue),d===void 0&&(d=l?.[t]??(a&&c[a.slot]?.()[a.prop])),e[r]=d,u&&(e.id=(s?.handle.api).internal.keyOf(d))}return e}}let p=u.length>0,m={Root:U({name:r,inheritAttrs:!1,props:{...JR(n.options,c),...d?{modelValue:null}:{}},emits:[...sz(u),...d?[`update:modelValue`]:[]],setup(t,{slots:n,emit:a,attrs:o}){let c=p?XR(u,(e,...t)=>{a(e,...t),e===`update:${d}`&&a(`update:modelValue`,...t)}):void 0,m=YL(e,()=>{let e=c?{...c}:{};for(let n=0;n<s.length;n++){let r=s[n];e[r]=t[r]}return d&&e[d]===void 0&&(e[d]=t.modelValue),e});return i.root?aR(m,`root`,f(`root`,l,t,c,d),void 0,i.root):(UR(r,o),()=>n.default?.())}})};for(let t in i){if(t===`root`)continue;let s=`${r}${_R(t)}`,c=n.slots[t]??{},l=qR(c),u=YR(c),d=u.length>0,p=a.has(t),h=o.has(t),g=`id`in c;m[_R(t)]=U({name:s,inheritAttrs:!1,props:JR(c),emits:sz(u),setup(n,{emit:a,attrs:o}){if(!GL(e))throw Error(`<${s}> must be used inside <${r}>.`);let c=f(t,l,n,d?XR(u,a):void 0);return p&&JL(e,t,h?()=>{let e=c();return{...e,value:e.id}}:c),aR(e,t,c,g?()=>n.id==null?o:{...o,id:n.id}:void 0,i[t])}})}return m}var $R,ez,tz,nz,rz,iz,az,oz,sz,cz=t((()=>{NL(),X(),TR(),KR(),$R=e=>typeof e==`string`?e:typeof e==`object`?e.kind:`value`,ez=(e,t)=>{if(typeof e!=`object`)return;let[n,r=t]=e.from.split(`.`);return{slot:n,prop:r}},tz=Object.freeze({}),nz=Object.freeze({}),rz=()=>tz,iz={string:String,number:Number,boolean:oR,list:[Array,String],value:null,id:null,key:null,action:Function},az=[`value`,`checked`,`pressed`,`open`,`page`,`layout`],oz=e=>az.find(t=>e.some(({update:e})=>e===`update:${t}`)),sz=e=>e.flatMap(({event:e,update:t})=>t?[e,t]:[e])})),lz,uz,dz,fz,pz,mz,hz=t((()=>{SL(),X(),CL(),HR(),cz(),TR(),KR(),lz=Symbol(`tooltip-container`),uz=Symbol(`tooltip-trigger`),dz=QR(xL,{arrow:`div`}),fz=WR(U({name:`Tooltip`,props:{open:oR,modelValue:oR,defaultOpen:oR,delay:Number,closeDelay:Number,disabled:oR,toggleable:oR,closeOnPress:oR,type:String,shortcut:String,controller:Object,debug:oR,container:LR},emits:{"update:open":e=>!0,"update:modelValue":e=>!0,openChange:(e,t)=>!0,openChangeComplete:e=>!0,payloadChange:(e,t)=>!0},setup(e,{slots:t,emit:n}){ll(lz,()=>e.container);let r={onOpenChange:(e,t)=>{n(`openChange`,e,t),t.canceled||(n(`update:open`,e),n(`update:modelValue`,e))},onOpenChangeComplete:e=>n(`openChangeComplete`,e),onPayloadChange:(e,t)=>n(`payloadChange`,e,t)};return OR(()=>e.controller,YL(xL,()=>({...QL(e,`container`),open:sR(e.open,e.modelValue),...r}))),()=>t.default?.()}})),pz=ZR(`button`,U({name:`TooltipTrigger`,inheritAttrs:!1,props:{payload:null,controller:Object},slots:Object,setup(e,{slots:t,attrs:n}){let r=DR(xL,()=>e.controller);ll(uz,r);let i=Cl();return jR(r,t=>aR(t,`trigger`,()=>({id:i,payload:e.payload}),void 0,`button`),()=>kR(`button`,{type:`button`,...n},{slots:t,state:{open:!1}}))}})),mz=VR(ZR(`div`,U({name:`TooltipContent`,inheritAttrs:!1,props:{side:String,align:String,sideOffset:Number,alignOffset:Number,collisionPadding:Number,arrowPadding:Number,anchor:[Object,String],container:LR},slots:Object,setup(e){let t=KL(xL),n=ul(lz,()=>void 0),r=FR(()=>e.container??n()),i=aR(t,`content`,()=>QL(e,`container`));return()=>{let e=i();return e&&IR(e,r())}}}))),dz.Arrow})),gz,_z=t((()=>{X(),hz(),gz=U({__name:`TooltipContent`,props:{side:{default:`top`},sideOffset:{default:6}},setup(e){return(t,n)=>(W(),Ou(V(mz),{"data-slot":`tooltip-content`,side:e.side,"side-offset":e.sideOffset},{default:sl(()=>[Ul(t.$slots,`default`)]),_:3},8,[`side`,`side-offset`]))}})})),vz,yz=t((()=>{_z(),_z(),vz=gz})),bz,xz=t((()=>{X(),hz(),yz(),bz=U({__name:`Tooltip`,props:Yl({open:{type:Boolean},defaultOpen:{type:Boolean,default:!1},delay:{},label:{}},{open:{type:Boolean,default:void 0},openModifiers:{}}),emits:Yl([`update:open`],[`update:open`]),setup(e){let t=Ql(e,`open`);return(n,r)=>(W(),Ou(V(fz),{open:t.value,"onUpdate:open":r[0]||=e=>t.value=e,"default-open":e.defaultOpen||void 0,delay:e.delay},{default:sl(()=>[Ul(n.$slots,`default`),e.label?(W(),Ou(vz,{key:0},{default:sl(()=>[Pu(Qo(e.label),1)]),_:1})):Fu(``,!0)]),_:3},8,[`open`,`default-open`,`delay`]))}})})),Sz,Cz=t((()=>{xz(),xz(),Sz=bz})),wz=t((()=>{Cz(),yz(),X(),hz()})),Tz,Ez,Dz,Oz=t((()=>{X(),sk(),hz(),wz(),Tz=[`data-mode`,`datetime`],Ez=[`data-mode`,`data-slot`,`datetime`],Dz=U({inheritAttrs:!1,__name:`RelativeTime`,props:{at:{},threshold:{default:`3w`},format:{default:`long`},locale:{default:`en`},plain:{type:Boolean,default:!1}},setup(e){let t=Kl(),{time:n,tip:r}=ak(()=>({at:e.at,threshold:e.threshold,format:e.format,locale:e.locale})),i=Y(()=>t[`data-slot`]??`relative-time`),a=e=>{if(!r.value)return t;let{type:n,...i}=e;return{...i,...t}};return(o,s)=>V(n)?e.plain?(W(),G(`time`,zu({key:1,"data-slot":`relative-time`},V(t),{"data-mode":V(n).mode,datetime:V(n).datetime}),Qo(V(n).label),17,Tz)):(W(),Ou(V(Sz),{key:2,label:V(r)},{default:sl(()=>[J(V(pz),null,{render:sl(({props:e,children:t})=>[K(`time`,zu(a(e),{"data-mode":V(n).mode,"data-slot":i.value,datetime:V(n).datetime}),[(W(),Ou(Rl(t)))],16,Ez)]),default:sl(()=>[Pu(Qo(V(n).label),1)]),_:1})]),_:1},8,[`label`])):(W(),G(`time`,zu({key:0,"data-slot":`relative-time`},V(t)),Qo(String(e.at)),17))}})})),kz,Az=t((()=>{Oz(),Oz(),kz=Dz})),jz=t((()=>{Az()}));function Mz(e){let t=e.anchor.kind===`text`?e.anchor.exact:``;return ph(e.messages[0]?.body??``)||t}function Nz(e){return{thread:e,text:Mz(e)}}var Pz=t((()=>{_h()})),Fz,Iz,Lz,Rz,zz,Bz,Vz,Hz,Uz,Wz=t((()=>{X(),kD(),jz(),_h(),Pz(),Fz={"data-slot":`comment-list-number`},Iz={"data-slot":`comment-list-body`},Lz={"data-slot":`comment-list-text`},Rz={"data-slot":`comment-list-meta`},zz={key:0},Bz={key:1},Vz={key:2,"data-slot":`comment-list-detached`},Hz={key:3},Uz=U({name:`CommentRow`,__name:`CommentRow`,props:{thread:{},detached:{type:Boolean,default:!1},site:{type:Boolean,default:!1}},setup(e){let t=Y(()=>e.thread.messages.length-1);return(n,r)=>(W(),G(rf,null,[K(`span`,Fz,Qo(e.thread.n?String(e.thread.n):``),1),J(V(DD),{"aria-hidden":`true`,people:[V(fh)(e.thread)],size:`sm`},null,8,[`people`]),K(`span`,Iz,[K(`span`,Lz,[Ul(n.$slots,`preview`,{},()=>[Pu(Qo(V(Mz)(e.thread)),1)])]),K(`span`,Rz,[K(`span`,null,Qo(V(gh)(e.thread)),1),J(V(kz),{at:e.thread.updatedAt},null,8,[`at`]),t.value>0?(W(),G(`span`,zz,Qo(t.value)+` `+Qo(t.value===1?`reply`:`replies`),1)):Fu(``,!0),e.thread.status===`resolved`?(W(),G(`span`,Bz,`Resolved`)):Fu(``,!0),e.detached?(W(),G(`span`,Vz,`Detached`)):Fu(``,!0),e.site&&e.thread.subject.kind===`page`?(W(),G(`span`,Hz,Qo(e.thread.subject.id),1)):Fu(``,!0)])])],64))}})})),Gz,Kz=t((()=>{Wz(),Wz(),Gz=Uz}));function qz(e,t){let n=e.subject.value;return t.anchor.kind===`page`&&t.subject.kind===n.kind&&t.subject.id===n.id}var Jz,Yz,Xz,Zz=t((()=>{X(),AD(),Vw(),xy(),Mp(),_h(),Kz(),iT(),Jz=3,Yz=`Comment on the whole page`,Xz=U({name:`CommentPageIsland`,props:{comments:{required:!0,type:Object},canComment:{required:!0,type:Boolean}},slots:Object,setup(e,{slots:t}){let n=nT(`UIcon`),r=Rw(),i=e.comments,a=B(),o=B(),s=new Set;ll(Dp,s);let c=Y(()=>i.pageThreads.value.filter(e=>e.anchor.kind===`page`)),l=Y(()=>c.value.filter(e=>e.status===`open`)),u=Y(()=>i.draft.value?.anchor.kind===`page`?i.draft.value:null),d=Y(()=>i.opened.value&&qz(i,i.opened.value)?i.opened.value:null),f=Y(()=>e.canComment&&!!i.user.value),p=B(!1),m=Y(()=>i.visibility.value===`hidden`),h=Y(()=>m.value?c.value.filter(e=>i.isShown(e.id)):c.value),g=()=>{let e=a.value?.getRootNode();return e instanceof ShadowRoot?e:document},_=Y(()=>u.value||d.value||p.value&&(h.value.length>0||f.value)?`open`:i.active.value&&f.value?`hint`:m.value?`none`:l.value.length>0?`count`:`none`),v=B(),y=Y(()=>m.value?0:l.value.length),b=Y(()=>_.value===`hint`||_.value===`open`&&f.value);H([v,Y(()=>b.value?Yz:String(y.value))],([e,t],n)=>{e&&(e===n?.[0]?dy(e,t):e.textContent=t)},{flush:`post`,immediate:!0});let x=!1,S;H(m,e=>{e&&(p.value=!1)}),H(d,(e,t)=>{if(e){p.value=!0;return}if(!t||_.value!==`open`)return;let n=g().activeElement;n&&a.value?.contains(n)||Zc(()=>a.value?.querySelector(`[data-slot='comment-page-island-item'][data-thread-id='${t.id}']`)?.focus())},{flush:`post`});let C=()=>(a.value?Tp(a.value):!1)||(u.value?.body.trim().length??0)>0,w=e=>[...s].some(t=>t.value&&e.includes(t.value)),T=()=>{let e=g().activeElement,t=!!(e&&a.value?.contains(e));p.value=!1,u.value&&i.cancelDraft(),d.value&&i.close(),t&&Zc(()=>o.value?.focus({preventScroll:!0}))},E=(e=!1)=>C()?(a.value&&Ep(a.value,e),!1):(T(),!0);wp(e=>{if(_.value!==`open`||!a.value)return;let t=jp(e);t.includes(a.value)||w(t)||Op.has(e)||(t.some(e=>e.matches(`[data-slot='comment-pin']`))||Op.add(e),E()||(e.stopPropagation(),Cp()))});let D=e=>{if(e.key!==`Escape`||e.defaultPrevented||e.isComposing||e.repeat||_.value!==`open`)return;let t=jp(e);w(t)||t.some(e=>e.matches(`[data-slot='comment-composer']`))||(e.preventDefault(),E(!0))};Dd(()=>document.addEventListener(`keydown`,D,!0)),Ad(()=>{document.removeEventListener(`keydown`,D,!0)});let O=()=>{if(_.value===`open`)E();else if(_.value===`hint`)try{i.startDraft(`page`)}catch{}else p.value=!0},k=()=>{let e=new Map;for(let t of l.value){let n=fh(t);e.has(n.id)||e.set(n.id,n)}return[...e.values()].slice(0,Jz)},A=()=>q(`ul`,{"data-slot":`comment-page-island-items`},h.value.map(e=>q(`li`,{key:e.id},q(`button`,{"data-focus-inset":``,"data-slot":`comment-page-island-item`,"data-status":e.status,"data-thread-id":e.id,onClick:()=>{p.value=!0,i.open(e)},type:`button`},[q(Gz,{thread:e})])))),ee=()=>{let e=d.value;return e&&t.thread?t.thread({thread:e}):[h.value.length>0?A():null,f.value&&t.composer?q(`div`,{"data-draft":`true`,"data-slot":`comment-page-island-composer`,key:`composer`},t.composer({autofocus:!!u.value,draft:u.value,onCancel:T})):null]};return()=>{let e=_.value,t=e===`open`,s=y.value,c=b.value?Yz:`${s} ${s===1?`comment`:`comments`} on the whole page`;return e===`none`?S=void 0:S??=x&&!t,x=i.status.value===`ready`||i.status.value===`error`,q(`div`,{"data-slot":`comment-page-island`,"data-state":e,ref:a},e===`none`?[]:[q(`div`,{"data-motion-appear":S?``:void 0,"data-open":t?``:void 0,"data-side":`bottom`,"data-slot":`comment-page-island-card`},[q(`button`,{"aria-expanded":String(t),"aria-label":b.value&&s>0?`${c}, ${s} open`:c,"data-motion-press":``,"data-slot":`comment-page-island-trigger`,onClick:O,ref:o,type:`button`},[s>0?q(`span`,{"data-slot":`comment-page-island-faces`},q(DD,{"aria-hidden":`true`,max:null,people:k(),size:`sm`})):q(n,{"aria-hidden":`true`,name:r.value.commentPage}),q(`span`,{"data-slot":`comment-page-island-label`,ref:v})]),t?q(`div`,{"data-slot":`comment-page-island-content`},ee()):null])])}}})}));function Qz(e){let{resolvedAt:t}=e;return e.status!==`resolved`||t===void 0?[]:e.messages.filter(e=>e.createdAt>t)}function $z(e){return e.n?`Comment ${e.n}`:`Comment`}function eB(e){return e.n?`#${e.n}`:`Comment`}function tB(e){return{"data-failed":e?.status===`failed`?`true`:void 0,"data-pending":e?.status===`pending`?`true`:void 0}}var nB=t((()=>{})),rB=t((()=>{X()})),iB=t((()=>{X(),wO(),GO(),EO(),rB(),sk()})),aB,oB,sB,cB,lB=t((()=>{X(),iB(),Nw(),aB={"data-slot":`comment-filters`,role:`group`,"aria-label":`Filter comments`},oB=[`data-variant`,`data-active`,`aria-pressed`,`onClick`],sB={key:0},cB=U({name:`CommentFilters`,__name:`CommentFilters`,props:{comments:{}},setup(e){let t=LO(e.comments),n=Y(()=>[{key:`open`,label:`Open`,count:t.counts.value.open},{key:`resolved`,label:`Resolved`,count:t.counts.value.resolved},{key:`mine`,label:`Mine`}]);return(e,r)=>(W(),G(`div`,aB,[(W(!0),G(rf,null,Vl(n.value,e=>(W(),G(`button`,{key:e.key,type:`button`,"data-slot":`comment-filter`,"data-comment-button":``,"data-size":`xs`,"data-variant":V(t).filters[e.key]?`soft`:`ghost`,"data-active":V(t).filters[e.key]?``:void 0,"aria-pressed":V(t).filters[e.key],onClick:n=>V(t).filters[e.key]=!V(t).filters[e.key]},[e.count===void 0?(W(),G(`span`,sB,Qo(e.label),1)):(W(),G(rf,{key:1},[Pu(Qo(`${e.label} `),1),J(V(jw),{value:e.count},null,8,[`value`])],64))],8,oB))),128))]))}})})),uB,dB=t((()=>{lB(),lB(),uB=cB})),fB,pB,mB,hB,gB,_B,vB,yB=t((()=>{X(),iB(),Nw(),dB(),Kz(),Pz(),nB(),fB={"data-slot":`comment-list`,"data-comments-ui":``,"aria-label":`Comments`},pB={"data-slot":`comment-list-header`},mB={"data-slot":`comment-list-scopes`,role:`group`,"aria-label":`Scope`},hB=[`data-variant`,`aria-pressed`,`onClick`],gB={key:0,"data-slot":`comment-list-empty`,role:`status`},_B=[`data-status`,`data-detached`,`aria-current`,`href`,`onClick`],vB=U({name:`CommentList`,__name:`CommentList`,props:{comments:{},navigate:{type:Function}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=LO(n.comments),a=[{value:`page`,label:`This page`},{value:`site`,label:`All pages`}],o=Y(()=>i.listed.value),s=Y(()=>i.status.value===`loading`&&i.threads.value.length===0?`Loading comments.`:i.status.value===`error`?`The comments could not load.`:`No comments here.`);function c(e,t){r(`select`,{thread:e}),t.ctrlKey||t.metaKey||t.shiftKey||t.button!==0||(t.preventDefault(),e.subject.kind===i.subject.value.kind&&e.subject.id===i.subject.value.id?i.open(e,{scroll:!0}):i.close()&&(n.navigate??(e=>window.location.assign(e)))(i.link(e)))}return(e,t)=>(W(),G(`section`,fB,[K(`header`,pB,[K(`div`,mB,[(W(),G(rf,null,Vl(a,e=>K(`button`,{key:e.value,type:`button`,"data-slot":`comment-list-scope`,"data-comment-button":``,"data-size":`xs`,"data-variant":V(i).scope.value===e.value?`soft`:`ghost`,"aria-pressed":V(i).scope.value===e.value,onClick:t=>V(i).scope.value=e.value},[K(`span`,null,Qo(e.label),1)],8,hB)),64))]),J(uB,{comments:V(i)},null,8,[`comments`])]),o.value.length===0?(W(),G(`p`,gB,Qo(s.value),1)):(W(),Ou(V(Dw),{key:1},{render:sl(({props:e,children:t})=>[K(`ol`,zu(e,{"data-slot":`comment-list-items`}),[(W(),Ou(Rl(t)))],16)]),default:sl(()=>[(W(!0),G(rf,null,Vl(o.value,t=>(W(),G(`li`,{key:t.id},[K(`a`,zu({"data-slot":`comment-list-item`,"data-focus-inset":``,"data-status":t.status,"data-detached":V(i).positions.value.get(t.id)?.detached===!0?`true`:void 0},{ref_for:!0},V(tB)(t.delivery),{"aria-current":V(i).openId.value===t.id?`true`:void 0,href:V(i).link(t),onClick:e=>c(t,e)}),[Ul(e.$slots,`row`,zu({ref_for:!0},V(Nz)(t)),()=>[J(Gz,{thread:t,detached:V(i).positions.value.get(t.id)?.detached===!0,site:V(i).scope.value===`site`},Hl({_:2},[e.$slots.preview?{name:`preview`,fn:sl(()=>[Ul(e.$slots,`preview`,zu({ref_for:!0},V(Nz)(t)))]),key:`0`}:void 0]),1032,[`thread`,`detached`,`site`])])],16,_B)]))),128))]),_:3}))]))}})})),bB,xB=t((()=>{yB(),yB(),bB=vB})),SB,CB,wB,TB=t((()=>{X(),kD(),_h(),SB=[`data-status`,`data-active`,`data-draft`,`aria-expanded`,`aria-label`],CB={key:1,"data-slot":`comment-pin-number`},wB=U({name:`CommentPin`,__name:`CommentPin`,props:{number:{},author:{},status:{default:`open`},excerpt:{},active:{type:Boolean,default:!1},draft:{type:Boolean,default:!1}},emits:[`select`,`hover`,`leave`],setup(e,{emit:t}){let n=t,r=Y(()=>{if(e.draft)return`New comment`;let t=e.author?` by ${hh(e.author)}`:``,n=e.excerpt?`: ${e.excerpt}`:``;return`Comment${e.number===void 0?``:` ${e.number}`}${t}${n}${e.status===`resolved`?`, resolved`:``}`}),i=!1,a=!1;function o(){a=!0,n(`hover`)}function s(){a=!1,i||n(`leave`)}function c(){i=!0,n(`hover`)}function l(){i=!1,a||n(`leave`)}return(t,i)=>(W(),G(`button`,{type:`button`,"data-slot":`comment-pin`,"data-status":e.status,"data-active":e.active?`true`:void 0,"data-draft":e.draft?`true`:void 0,"aria-expanded":e.draft?void 0:e.active,"aria-label":r.value,onClick:i[0]||=e=>n(`select`),onFocus:o,onBlur:s,onPointerenter:c,onPointerleave:l},[e.author?(W(),Ou(V(DD),{key:0,"aria-hidden":`true`,people:[V(dh)(e.author)],size:`sm`},null,8,[`people`])):Fu(``,!0),!e.draft&&e.number!==void 0?(W(),G(`span`,CB,Qo(e.number),1)):Fu(``,!0)],40,SB))}})})),EB,DB=t((()=>{TB(),TB(),EB=wB})),OB,kB,AB,jB=t((()=>{X(),zE(),OB=[`data-side`],kB=[`data-action`,`aria-keyshortcuts`,`title`,`onClick`],AB=U({name:`CommentSelectionBar`,__name:`CommentSelectionBar`,props:{suggest:{type:Boolean,default:!1},side:{default:`top`},tooltip:{type:[Object,Function]}},emits:[`comment`,`suggest`],setup(e,{emit:t}){let n=t,r=(e,{slots:t})=>t.default?.(),i=Y(()=>[{name:`comment`,label:`Comment`,hint:`Comment on the selected text`,key:`C`,icon:pE},...e.suggest?[{name:`suggest`,label:`Suggest`,hint:`Suggest new words`,key:`E`,icon:gE}]:[]]);function a(e){n(e===`comment`?`comment`:`suggest`)}return(t,n)=>(W(),G(`div`,{"data-slot":`comment-selection-bar`,"data-motion-appear":``,"data-side":e.side,role:`group`,"aria-label":`Selected text`,onMousedown:n[0]||=vp(()=>{},[`prevent`])},[(W(!0),G(rf,null,Vl(i.value,n=>(W(),Ou(Rl(e.tooltip||r),zu({key:n.name},{ref_for:!0},e.tooltip?{side:e.side,hint:n.hint,shortcut:n.key}:{}),{default:sl(()=>[K(`button`,{type:`button`,"data-slot":`comment-selection-bar-action`,"data-action":n.name,"aria-keyshortcuts":n.key,title:e.tooltip?void 0:`${n.hint} (${n.key})`,onClick:e=>a(n.name)},[Ul(t.$slots,`${n.name}-icon`,{},()=>[(W(),Ou(Rl(n.icon),{"data-slot":`comment-icon`,"aria-hidden":`true`}))]),Pu(Qo(n.label),1)],8,kB)]),_:2},1040))),128))],40,OB))}})})),MB,NB=t((()=>{jB(),jB(),MB=AB}));async function PB(e){let t=typeof e==`function`?e():e;try{if(await FB(t))return!0}catch{}return IB(await t)}async function FB(e){let t=globalThis.navigator?.clipboard;return typeof t?.writeText==`function`&&(typeof e==`string`?await t.writeText(e):typeof ClipboardItem==`function`&&typeof t.write==`function`?await t.write([new ClipboardItem({"text/plain":e.then(e=>new Blob([e],{type:`text/plain`}))})]):await t.writeText(await e),!0)}function IB(e){let t=globalThis.document;if(typeof t?.execCommand!=`function`||!t.body)return!1;let n=t.activeElement,r=t.createElement(`textarea`);r.value=e,r.readOnly=!0,r.style.position=`fixed`,r.style.opacity=`0`,t.body.append(r),r.focus({preventScroll:!0}),r.select();try{return t.execCommand(`copy`)}catch{return!1}finally{r.remove(),n instanceof HTMLElement&&n.focus({preventScroll:!0})}}function LB(e={}){let t=B(!1),n=B(!1),r;rs()&&is(()=>clearTimeout(r));async function i(i){clearTimeout(r),t.value=!1,n.value=!1;try{t.value=await PB(i)}catch{t.value=!1}return n.value=!t.value,r=setTimeout(()=>{t.value=!1,n.value=!1},Js(e.duration)??2e3),t.value}return{copy:i,copied:Ls(t),failed:Ls(n)}}var RB=t((()=>{X()})),zB,BB=t((()=>{zB={t3:{viewBox:`15.5309 37 94.3941 56.96`,path:`M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z`,thread:`T3 thread`},claude:{viewBox:`0 0 24 24`,path:`m4.714 15.956l4.718-2.648l.079-.23l-.08-.128h-.23l-.79-.048l-2.695-.073l-2.337-.097l-2.265-.122l-.57-.121l-.535-.704l.055-.353l.48-.321l.685.06l1.518.104l2.277.157l1.651.098l2.447.255h.389l.054-.158l-.133-.097l-.103-.098l-2.356-1.596l-2.55-1.688l-1.336-.972l-.722-.491L2 6.223l-.158-1.008l.656-.722l.88.06l.224.061l.893.686l1.906 1.476l2.49 1.833l.364.304l.146-.104l.018-.072l-.164-.274l-1.354-2.446l-1.445-2.49l-.644-1.032l-.17-.619a3 3 0 0 1-.103-.729L6.287.133L6.7 0l.995.134l.42.364l.619 1.415L9.735 4.14l1.555 3.03l.455.898l.243.832l.09.255h.159V9.01l.127-1.706l.237-2.095l.23-2.695l.08-.76l.376-.91l.747-.492l.583.28l.48.685l-.067.444l-.286 1.851l-.558 2.903l-.365 1.942h.213l.243-.242l.983-1.306l1.652-2.064l.728-.82l.85-.904l.547-.431h1.032l.759 1.129l-.34 1.166l-1.063 1.347l-.88 1.142l-1.263 1.7l-.79 1.36l.074.11l.188-.02l2.853-.606l1.542-.28l1.84-.315l.832.388l.09.395l-.327.807l-1.967.486l-2.307.462l-3.436.813l-.043.03l.049.061l1.548.146l.662.036h1.62l3.018.225l.79.522l.473.638l-.08.485l-1.213.62l-1.64-.389l-3.825-.91l-1.31-.329h-.183v.11l1.093 1.068l2.003 1.81l2.508 2.33l.127.578l-.321.455l-.34-.049l-2.204-1.657l-.85-.747l-1.925-1.62h-.127v.17l.443.649l2.343 3.521l.122 1.08l-.17.353l-.607.213l-.668-.122l-1.372-1.924l-1.415-2.168l-1.141-1.943l-.14.08l-.674 7.254l-.316.37l-.728.28l-.607-.461l-.322-.747l.322-1.476l.388-1.924l.316-1.53l.285-1.9l.17-.632l-.012-.042l-.14.018l-1.432 1.967l-2.18 2.945l-1.724 1.845l-.413.164l-.716-.37l.066-.662l.401-.589l2.386-3.036l1.439-1.882l.929-1.086l-.006-.158h-.055L4.138 18.56l-1.13.146l-.485-.456l.06-.746l.231-.243l1.907-1.312Z`,thread:`Claude Code session`},codex:{viewBox:`0 0 24 24`,path:`M22.282 9.821a6 6 0 0 0-.516-4.91a6.05 6.05 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a6 6 0 0 0-3.998 2.9a6.05 6.05 0 0 0 .743 7.097a5.98 5.98 0 0 0 .51 4.911a6.05 6.05 0 0 0 6.515 2.9A6 6 0 0 0 13.26 24a6.06 6.06 0 0 0 5.772-4.206a6 6 0 0 0 3.997-2.9a6.06 6.06 0 0 0-.747-7.073M13.26 22.43a4.48 4.48 0 0 1-2.876-1.04l.141-.081l4.779-2.758a.8.8 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494M3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085l4.783 2.759a.77.77 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646M2.34 7.896a4.5 4.5 0 0 1 2.366-1.973V11.6a.77.77 0 0 0 .388.677l5.815 3.354l-2.02 1.168a.08.08 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.08.08 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667m2.01-3.023l-.141-.085l-4.774-2.782a.78.78 0 0 0-.785 0L9.409 9.23V6.897a.07.07 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.8.8 0 0 0-.393.681zm1.097-2.365l2.602-1.5l2.607 1.5v2.999l-2.597 1.5l-2.607-1.5Z`,thread:`Codex thread`}}})),VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,QB,$B,eV,tV,nV,rV,iV,aV,oV,sV,cV,lV,uV,dV,fV,pV,mV=t((()=>{X(),zE(),Sw(),RB(),vw(),BB(),VB=[`data-status`,`data-reason`,`hidden`],HB={key:0,"data-slot":`comment-send-status`,"data-tone":`warning`},UB={key:1,"data-slot":`comment-send-status`,"data-tone":`error`},WB={"data-slot":`comment-send-status`},GB=[`data-logo`],KB=[`viewBox`],qB=[`d`],JB={"data-slot":`comment-send-message`},YB={"data-slot":`comment-send-status`,"aria-label":`Waiting for the agent`,"data-icon":``,role:`img`},XB={"data-slot":`comment-send-status`},ZB=[`data-logo`],QB=[`viewBox`],$B=[`d`],eV=[`title`],tV=[`aria-label`,`title`],nV={key:6,"data-slot":`comment-send-hold`},rV={"data-slot":`comment-send-status`},iV={"aria-hidden":`true`,"data-slot":`comment-send-hold-copy`},aV={"data-slot":`comment-send-count`},oV={key:7,"data-slot":`comment-send-status`},sV=[`aria-label`,`href`],cV=[`aria-label`,`title`],lV={"data-slot":`comment-send-count`},uV=[`title`],dV=[`aria-label`],fV={key:12,"data-slot":`comment-send-status`,"data-tone":`warning`},pV=U({name:`CommentSend`,__name:`CommentSend`,props:{client:{}},setup(e){let t=e,n=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),r=e=>`${e} ${e===1?`comment`:`comments`}`;function i(e){switch(e.status){case`pairing`:return e.reason===`expired`?`Setup code expired.`:e.reason===`refused`?`That URL isn't ${e.agent.host}.`:`Setup prompt copied. Paste it in the ${zB[e.agent.logo].thread} that should get your comments.`;case`confirm`:return`${e.agent.name} at ${e.agent.host} wants your comments from this site.`;case`sent`:return e.inbox?`In inbox.`:`Sent.`;case`working`:return`Working.`;case`failed`:return`Not delivered.`;case`limited`:return`Limit reached, try at ${n.format(e.retryAt)}.`;default:return}}let{copy:a}=LB(),o=e=>a(()=>e),s=Ks(t.client.state),c=Tl(`root`),l,u;function d(e){u?.(),l?.(),s.value=e.state,u=e.onChange(()=>s.value=e.state),l=e.start()}Dd(()=>{pw(c.value),d(t.client)}),H(()=>t.client,d),Ad(()=>{u?.(),l?.()}),H(()=>s.value.status===`pairing`?`${s.value.status}:${s.value.reason??``}`:s.value.status,()=>{let e=i(s.value);e&&mw(c.value,e)});function f(e){e.key!==`Escape`||e.defaultPrevented||(s.value.status===`pairing`||s.value.status===`confirm`)&&(e.preventDefault(),t.client.cancel())}H(()=>s.value.status===`pairing`||s.value.status===`confirm`,e=>{e?document.addEventListener(`keydown`,f):document.removeEventListener(`keydown`,f)}),Ad(()=>document.removeEventListener(`keydown`,f));let p=0,m=!1;function h(e){e.style.removeProperty(`width`),e.style.removeProperty(`overflow`),e.style.removeProperty(`box-sizing`)}function g(e){let t=c.value;if(t){if(!_.active)return h(t);t.style.boxSizing=`border-box`,t.style.overflow=`hidden`,t.style.width=`${e}px`}}let _=rg(0,g);Ad(()=>_.stop());let v=e=>!e.isConnected||typeof requestAnimationFrame!=`function`||Eg(e),y=()=>{let e=c.value?.getRootNode();return e instanceof Document||e instanceof ShadowRoot?e.activeElement:null};Od(()=>{p=c.value?.offsetWidth??0;let e=y();m||=!!(e&&c.value?.contains(e))}),kd(()=>{let e=c.value;if(!e)return;h(e);let t=e.offsetWidth;p&&t&&p!==t&&!v(e)?(_.active||_.set(p),_.to(t),_.active&&g(_.value)):_.stop();let n=y();if(!m||n&&n!==e.ownerDocument.body&&!e.contains(n))return void(m=!1);if(n&&e.contains(n))return;let r=e.querySelector(`button, a`);r&&(m=!1,Zc(()=>r.focus({preventScroll:!0})))});let b=!1,x=Y(()=>{let e=s.value;if(e.status===`idle`)return e.count>0?{count:e.count,inbox:e.inbox}:void 0;if(e.status===`sent`||e.status===`working`)return e.count>0?{count:e.count,inbox:!(!e.agent||e.agent.host)}:void 0});H(x,e=>{e&&(b=e.inbox)},{flush:`sync`,immediate:!0});let S=Y(()=>s.value.status===`sending`?{count:s.value.count,inbox:b}:void 0),C=Y(()=>s.value.status===`idle`&&s.value.count===0),w=Y(()=>s.value.status===`pairing`?`pairing-${s.value.reason??``}`:s.value.status),T=()=>void t.client.send(o);return(e,i)=>(W(),G(`div`,{ref_key:`root`,ref:c,"data-slot":`comment-send`,role:`group`,"aria-label":`Send comments to your agent`,"data-status":s.value.status,"data-reason":s.value.status===`pairing`?s.value.reason:void 0,hidden:C.value||void 0},[(W(),G(`span`,{key:w.value,"data-slot":`comment-send-content`},[s.value.status===`pairing`&&s.value.reason===`expired`?(W(),G(`span`,HB,[J(V(KT),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),i[4]||=Pu(`Setup code expired`,-1)])):s.value.status===`pairing`&&s.value.reason===`refused`?(W(),G(`span`,UB,[J(V(KT),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),Pu(`That URL isn't `+Qo(s.value.agent.host),1)])):s.value.status===`pairing`?(W(),G(rf,{key:2},[K(`span`,WB,[K(`span`,{"aria-hidden":`true`,"data-logo":s.value.agent.logo,"data-slot":`comment-send-logo`},[(W(),G(`svg`,{fill:`currentColor`,viewBox:V(zB)[s.value.agent.logo].viewBox,xmlns:`http://www.w3.org/2000/svg`},[K(`path`,{d:V(zB)[s.value.agent.logo].path},null,8,qB)],8,KB))],8,GB),K(`span`,JB,[i[5]||=K(`span`,{"data-wide":``},`Setup prompt copied. `,-1),K(`b`,null,`Paste it in the `+Qo(V(zB)[s.value.agent.logo].thread),1),i[6]||=K(`span`,{"data-wide":``},` that should get your comments`,-1)])]),K(`span`,YB,[J(V(uE),{class:`vh-comment-send-icon vh-comment-send-spin`,"aria-hidden":`true`})])],64)):Fu(``,!0),s.value.status===`pairing`&&s.value.reason?(W(),G(`button`,{key:3,type:`button`,"data-slot":`comment-send-action`,"data-action":`copy-again`,onClick:i[0]||=e=>void t.client.copyAgain(o)},[J(V(YT),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),i[7]||=Pu(`Copy again`,-1)])):Fu(``,!0),s.value.status===`confirm`?(W(),G(rf,{key:4},[K(`span`,XB,[K(`span`,{"aria-hidden":`true`,"data-logo":s.value.agent.logo,"data-slot":`comment-send-logo`},[(W(),G(`svg`,{fill:`currentColor`,viewBox:V(zB)[s.value.agent.logo].viewBox,xmlns:`http://www.w3.org/2000/svg`},[K(`path`,{d:V(zB)[s.value.agent.logo].path},null,8,$B)],8,QB))],8,ZB),K(`span`,{"data-slot":`comment-send-message`,title:s.value.agent.host},[K(`b`,null,Qo(s.value.agent.name),1),s.value.agent.host?(W(),G(rf,{key:0},[Pu(` · `+Qo(s.value.agent.host),1)],64)):Fu(``,!0),i[8]||=K(`span`,{"data-wide":``},` wants your comments from this site`,-1)],8,eV)]),K(`button`,{type:`button`,"data-slot":`comment-send-action`,"data-action":`allow`,"data-variant":`on`,onClick:i[1]||=e=>void t.client.allow()},[J(V(UT),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),Pu(`Allow and send `+Qo(s.value.count),1)])],64)):Fu(``,!0),s.value.status===`pairing`||s.value.status===`confirm`?(W(),G(`button`,{key:5,type:`button`,"data-slot":`comment-send-action`,"data-action":`cancel`,"data-icon":``,"aria-label":s.value.status===`confirm`?`Don't allow`:`Cancel connect`,title:`${s.value.status===`confirm`?`Don't allow`:`Cancel connect`} (Esc)`,onClick:i[2]||=e=>t.client.cancel()},[J(V(LE),{class:`vh-comment-send-icon`,"aria-hidden":`true`})],8,tV)):Fu(``,!0),S.value?(W(),G(`span`,nV,[K(`span`,rV,[J(V(uE),{class:`vh-comment-send-icon vh-comment-send-spin`,"aria-hidden":`true`}),i[9]||=Pu(`Sending`,-1)]),K(`span`,iV,[S.value.inbox?(W(),Ou(V(tE),{key:0,class:`vh-comment-send-icon`,"aria-hidden":`true`})):(W(),Ou(V(OE),{key:1,class:`vh-comment-send-icon`,"aria-hidden":`true`})),Pu(Qo(S.value.inbox?`To inbox`:`Send`),1),K(`span`,aV,Qo(S.value.count),1)])])):Fu(``,!0),s.value.status===`sent`?(W(),G(`span`,oV,[J(V(UT),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),Pu(Qo(s.value.inbox?`In inbox`:`Sent`),1)])):Fu(``,!0),s.value.status===`working`?(W(),G(rf,{key:8},[i[11]||=K(`span`,{"data-slot":`comment-send-status`},[K(`span`,{"aria-hidden":`true`,"data-slot":`comment-send-dot`}),Pu(`Working`)],-1),s.value.thread?(W(),G(`a`,{key:0,"data-slot":`comment-send-action`,"data-action":`open`,"aria-label":`Open the ${s.value.agent?.name??`agent`} thread`,href:s.value.thread,rel:`noopener`,target:`_blank`},[i[10]||=Pu(`Open thread`,-1),J(V(LT),{class:`vh-comment-send-icon`,"aria-hidden":`true`})],8,sV)):Fu(``,!0)],64)):Fu(``,!0),x.value?(W(),G(`button`,{key:9,type:`button`,"data-slot":`comment-send-action`,"data-action":`send`,"aria-label":`${x.value.inbox?`Send to inbox`:`Send`}: ${r(x.value.count)}`,title:`Send ${r(x.value.count)} that wait for an answer to your agent`,onClick:T},[x.value.inbox?(W(),Ou(V(tE),{key:0,class:`vh-comment-send-icon`,"aria-hidden":`true`})):(W(),Ou(V(OE),{key:1,class:`vh-comment-send-icon`,"aria-hidden":`true`})),Pu(Qo(x.value.inbox?`To inbox`:`Send`),1),K(`span`,lV,Qo(x.value.count),1)],8,cV)):Fu(``,!0),s.value.status===`idle`&&s.value.count>0&&s.value.canPairAnother?(W(),G(`button`,{key:10,type:`button`,"data-slot":`comment-send-action`,"data-action":`pair-another`,onClick:i[3]||=e=>void t.client.pairAnother(o)},[J(V(iE),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),i[12]||=Pu(`Pair another agent`,-1)])):Fu(``,!0),s.value.status===`failed`?(W(),G(rf,{key:11},[K(`span`,{"data-slot":`comment-send-status`,"data-tone":`error`,title:s.value.reason},[J(V(KT),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),i[13]||=Pu(`Not delivered`,-1)],8,uV),K(`button`,{type:`button`,"data-slot":`comment-send-action`,"data-action":`retry`,"aria-label":`Retry: send ${r(s.value.count)} again`,onClick:T},[J(V(TE),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),i[14]||=Pu(`Retry`,-1)],8,dV)],64)):Fu(``,!0),s.value.status===`limited`?(W(),G(`span`,fV,[J(V(KT),{class:`vh-comment-send-icon`,"aria-hidden":`true`}),Pu(`Limit reached, try at `+Qo(V(n).format(s.value.retryAt)),1)])):Fu(``,!0)]))],8,VB))}})})),hV,gV=t((()=>{mV(),mV(),hV=pV})),_V,vV,yV,bV,xV=t((()=>{X(),zE(),iB(),kD(),_V={"data-slot":`comment-toolbar`,"data-comments-ui":``,role:`toolbar`,"aria-label":`Comments`},vV=[`data-variant`,`aria-pressed`],yV=[`data-variant`,`aria-label`,`aria-pressed`],bV=U({name:`CommentToolbar`,__name:`CommentToolbar`,props:{comments:{},people:{default:()=>[]}},setup(e){let t=e,n=LO(t.comments),r=Y(()=>n.pageThreads.value.length);return(e,i)=>(W(),G(`div`,_V,[K(`button`,{type:`button`,"data-slot":`comment-toolbar-mode`,"data-comment-button":``,"data-size":`sm`,"data-square":``,"data-variant":V(n).active.value?`solid`:`ghost`,"aria-keyshortcuts":`C`,"aria-label":`Comment mode`,"aria-pressed":V(n).active.value,title:`Comment (C)`,onClick:i[0]||=e=>V(n).toggle()},[Ul(e.$slots,`mode-icon`,{},()=>[J(V(pE),{"data-slot":`comment-icon`,"aria-hidden":`true`})])],8,vV),K(`button`,{type:`button`,"data-slot":`comment-toolbar-list`,"data-comment-button":``,"data-size":`sm`,"data-variant":V(n).listOpen.value?`solid`:`ghost`,"aria-label":`Comment list, ${r.value} on this page`,"aria-pressed":V(n).listOpen.value,onClick:i[1]||=e=>V(n).listOpen.value=!V(n).listOpen.value},[Ul(e.$slots,`list-icon`,{},()=>[J(V(sE),{"data-slot":`comment-icon`,"aria-hidden":`true`})]),K(`span`,null,Qo(r.value),1)],8,yV),K(`button`,{type:`button`,"data-slot":`comment-toolbar-page`,"data-comment-button":``,"data-size":`sm`,"data-square":``,"data-variant":`ghost`,"aria-label":`Comment on page`,title:`Comment on the whole page`,onClick:i[2]||=e=>V(n).startDraft(`page`)},[Ul(e.$slots,`page-icon`,{},()=>[J(V(jE),{"data-slot":`comment-icon`,"aria-hidden":`true`})])]),t.people.length>0?(W(),Ou(V(DD),{key:0,people:t.people,size:`sm`,variant:`outline`},null,8,[`people`])):Fu(``,!0),Ul(e.$slots,`default`)]))}})})),SV,CV=t((()=>{xV(),xV(),SV=bV})),wV=t((()=>{dB(),xB(),DB(),NB(),gV(),CV()}));function TV(e,t,n){if(!t||!n||!e.width||!e.height)return e;let r=Math.max(e.width/t,e.height/n),i=t*r,a=n*r;return{left:e.left+(e.width-i)/2,top:e.top+(e.height-a)/2,width:i,height:a}}var EV,DV,OV=t((()=>{X(),Pw(),Vw(),QC(),Mp(),iT(),EV=4,DV=U({name:`ImageGallery`,props:{images:{required:!0,type:Array}},setup(e){let t=nT(`UModal`),n=nT(`UButton`),r=Rw(),i=B(null),a=B(!1),o=B(new Map),s=B(),c=ul(Dp,void 0);c?.add(s);let l=[],u=B(null),d,f=e=>l[Math.min(e,3)],p=Y(()=>i.value===null?void 0:e.images[i.value]);H(()=>e.images,e=>{o.value=new Map(e.filter(({key:e,src:t})=>o.value.get(e)===t).map(({key:e,src:t})=>[e,t]))});let m=({key:t,src:n})=>{e.images.some(e=>e.key===t&&e.src===n)&&o.value.set(t,n)};async function h(e){await Zc();let t=u.value,n=f(e);t&&n&&i.value===e&&(t.complete||await new Promise(e=>t.addEventListener(`load`,e,{once:!0})),i.value===e&&t.isConnected&&(d=YC(t,{from:TV(n.getBoundingClientRect(),t.offsetWidth,t.offsetHeight)})))}function g(e){d?.stop(),a.value=!1,i.value=e,h(e)}async function _(){if(i.value===null||a.value)return;let e=u.value,t=f(i.value);a.value=!0,e&&t&&e.complete&&e.naturalWidth&&(d=YC(e,{to:TV(t.getBoundingClientRect(),e.offsetWidth,e.offsetHeight)}),await d.done),d?.stop(),a.value&&(a.value=!1,i.value=null)}function v(t){i.value===null||a.value||e.images.length<2||(d?.stop(),i.value=(i.value+t+e.images.length)%e.images.length)}return Ad(()=>{d?.stop(),c?.delete(s)}),()=>{let c=e.images.length;l.length=0;let d=c>1,f=p.value;return q(`div`,{"data-count":Math.min(c,EV),"data-slot":`comment-reply-images`},[...e.images.slice(0,EV).map((e,t)=>q(`button`,{"aria-label":`Preview ${e.name}`,"data-open":i.value!==null&&Math.min(i.value,3)===t?`true`:void 0,"data-slot":`comment-reply-image`,key:e.key,onClick:()=>g(t),ref:e=>{e instanceof HTMLElement&&(l[t]=e)},title:e.name,type:`button`},[o.value.get(e.key)===e.src?q(`span`,{class:`vh-image-unavailable`},`Image unavailable`):q(`img`,{alt:``,loading:`lazy`,key:e.src,onError:()=>m(e),src:e.src}),t===3&&c>EV?q(`span`,{"aria-hidden":`true`,"data-slot":`comment-reply-image-more`},`+${c-EV+1}`):null])),q(t,{open:i.value!==null,title:p.value?.name??`Image`,transition:!1,ui:{content:`vh-image-dialog vh-image-gallery`,overlay:a.value?`vh-image-overlay vh-image-overlay--closing`:`vh-image-overlay`},"onUpdate:open":e=>{e||_()}},{content:()=>q(`div`,{class:`vh-image-gallery__body`,ref:s,onKeydown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),v(e.key===`ArrowLeft`?-1:1))}},[q(`div`,{class:`vh-image-dialog__toolbar`,"data-closing":a.value?`true`:void 0},[q(`span`,{class:`vh-image-dialog__name`,title:p.value?.name},p.value?.name),d?q(`span`,{class:`vh-image-gallery__count`},[q(jw,{value:(i.value??0)+1}),` of ${c}`]):null,q(n,{"aria-label":`Open original image`,class:`vh-image-dialog__action`,color:`neutral`,external:!0,icon:r.value.external,rel:`noreferrer`,target:`_blank`,to:p.value?.src,variant:`ghost`}),q(n,{"aria-label":`Close image preview`,class:`vh-image-dialog__action`,color:`neutral`,icon:r.value.close,onClick:()=>void _(),variant:`ghost`})]),q(`div`,{class:`vh-image-gallery__stage`},[d?q(n,{"aria-label":`Previous picture`,class:`vh-image-gallery__step vh-image-gallery__step--previous rounded-full`,color:`neutral`,icon:r.value.chevronLeft,onClick:()=>v(-1),variant:`solid`}):null,f&&o.value.get(f.key)===f.src?q(`p`,{class:`vh-image-dialog__error`,role:`status`},`Image unavailable. The file may have been moved or deleted.`):q(`img`,{alt:f?.name??``,class:`vh-image-dialog__image`,key:f?.src,onError:()=>f&&m(f),ref:u,src:f?.src}),d?q(n,{"aria-label":`Next picture`,class:`vh-image-gallery__step vh-image-gallery__step--next rounded-full`,color:`neutral`,icon:r.value.chevronRight,onClick:()=>v(1),variant:`solid`}):null])])})])}}})}));function kV(e,t){return q(`a`,{href:e,rel:`noopener noreferrer`,target:`_blank`},t)}function AV(e,t,n){return!n||t.length===0?[e]:bh(e,t).map(e=>typeof e==`string`?e:q(n,{label:e.name,user:e.id}))}function jV(e,t=[],n){let r=[],i=0;for(let a of e.matchAll(MV)){let o=a.index;o>i&&r.push(...AV(e.slice(i,o),t,n));let s=a[0];if(a[1])r.push(q(`code`,s.slice(1,-1)));else if(a[2])r.push(q(`strong`,AV(s.slice(2,-2),t,n)));else if(a[3])r.push(q(`em`,AV(s.slice(1,-1),t,n)));else if(a[4]){let e=s.indexOf(`](`);r.push(kV(s.slice(e+2,-1),s.slice(1,e)))}else r.push(kV(s,s));i=o+s.length}return i<e.length&&r.push(...AV(e.slice(i),t,n)),r}var MV,NV,PV=t((()=>{X(),Dh(),MV=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)|(\[[^\]\n]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s<>)]+)/g,NV=U({name:`Markdown`,inheritAttrs:!1,props:{components:{type:Object},plugins:{type:Array},value:{default:``,type:String}},setup(e,{attrs:t}){return()=>{let n=(e.plugins??[]).flatMap(e=>xh(Us(e))??[]),r=e.components?.[`comment-mention`];return q(`div`,{...t,class:[`vh-markdown`,t.class]},e.value.split(/\n{2,}/).filter(e=>e.trim()).map(e=>q(`p`,e.split(`
147
+ `).flatMap((e,t)=>t?[q(`br`),...jV(e,n,r)]:jV(e,n,r)))))}}})})),FV,IV,LV=t((()=>{X(),FV=[`data-variant`],IV=U({inheritAttrs:!1,__name:`Marker`,props:{variant:{default:`ghost`}},setup(e){let t=Gl(),n=()=>q(rf,t.default?.());return(t,r)=>Ul(t.$slots,`render`,{props:{...t.$attrs,"data-slot":`marker`,"data-variant":e.variant},children:n()},()=>[K(`div`,zu(t.$attrs,{"data-slot":`marker`,"data-variant":e.variant}),[Ul(t.$slots,`default`)],16,FV)])}})})),RV,zV=t((()=>{LV(),LV(),RV=IV})),BV,VV,HV=t((()=>{X(),BV={"data-slot":`marker-content`},VV=U({__name:`MarkerContent`,setup(e){return(e,t)=>(W(),G(`span`,BV,[Ul(e.$slots,`default`)]))}})})),UV,WV=t((()=>{HV(),HV(),UV=VV})),GV=t((()=>{zV(),WV(),X()})),KV=t((()=>{GV()})),qV=t((()=>{Nw()})),JV=t((()=>{jz()}));function YV(e){return e instanceof Error?e.message:`That did not work. Try again.`}function XV(e){if(e)try{let{protocol:t}=new URL(e,`https://vitehub.invalid`);return t===`http:`||t===`https:`||t===`blob:`?e:void 0}catch{return}}function ZV(e,t,n,r){if(e.attachments.length===0)return null;let i=e.attachments.map(e=>{let n=t?.(e),r=typeof n==`string`?{url:n}:n,i=r?.name||$V(e),a=/\.([a-z0-9]+)$/i.exec(i)?.[1]?.toLowerCase(),o=XV(r?.url);return{href:o,image:o!==void 0&&(r?.type?r.type.startsWith(`image/`):a===void 0||QV.has(a)),key:e,name:i}}),a=i.flatMap(e=>e.image&&e.href?[{key:e.key,name:e.name,src:e.href}]:[]),o=i.filter(e=>!e.image);return[a.length>0?q(DV,{images:a}):null,o.length>0?q(iD,{"data-slot":`comment-reply-attachments`},()=>o.map(e=>q(mT,{key:e.key,size:`xs`},()=>[q(lD,{kind:`icon`},()=>q(n,{name:r})),q($E,()=>q(mD,()=>e.href?q(`a`,{href:e.href,rel:`noreferrer`,target:`_blank`},e.name):e.name))]))):null]}var QV,$V,eH,tH,nH,rH=t((()=>{X(),Pw(),Mp(),Dh(),_h(),nB(),L_(),GO(),OV(),_D(),AD(),xO(),PV(),KV(),qV(),JV(),iT(),Vw(),QV=new Set([`apng`,`avif`,`bmp`,`gif`,`heic`,`jpeg`,`jpg`,`png`,`svg`,`webp`]),$V=e=>e.split(/[/\\]/).at(-1)||e,eH=U({name:`CommentReply`,props:{message:{required:!0,type:Object},user:{type:Object},editable:{default:!1,type:Boolean},deletable:{default:void 0,type:Boolean},compact:{default:!1,type:Boolean},confirmDelete:{default:!1,type:Boolean},size:{default:`md`,type:String},people:{default:()=>[],type:Array},users:{type:Function},attachmentUrl:{type:Function},onEdit:{type:Function},onDelete:{type:Function}},slots:Object,setup(e,{slots:t}){let n=nT(`UButton`),r=nT(`UIcon`),i=Rw(),a=I_(),o=B(!1),s=B(!1),c=B(!1),l=B(),u=B(``),d=B([]),f=()=>e.user?.id??a?.user.value?.id,p=U({props:{label:{default:``,type:String},user:{default:``,type:String}},setup(t){return()=>e.message.mentions.includes(t.user)?q(`span`,{"data-self":t.user===f()?`true`:void 0,"data-slot":`comment-mention`},`@${t.label}`):`@${t.label}`}}),m={[Ch]:p},h=Y(()=>{let t=new Map;for(let n of[...a?.people.value??[],...e.people,...e.user?[e.user]:[]])t.set(n.id,n);return[Sh(e.message.mentions.flatMap(e=>{let n=t.get(e);return n?[{id:e,name:hh(n)}]:[]}))]});async function g(e){if(c.value)return!1;c.value=!0,l.value=void 0;try{return await e(),!0}catch(e){return l.value=YV(e),!1}finally{c.value=!1}}function _(){u.value=e.message.body,d.value=[...e.message.mentions],l.value=void 0,o.value=!0}async function v(t){if(!e.onEdit)return;let n=u.value,r=d.value,i=t.body===e.message.body?[...new Set([...e.message.mentions,...t.mentions])]:t.mentions;await g(()=>e.onEdit?.(e.message.id,t.body,i))&&u.value===n&&d.value===r&&(o.value=!1)}let y=()=>e.editable&&e.onEdit!==void 0,b=()=>(e.deletable??e.editable)&&e.onDelete!==void 0;async function x(){e.onDelete&&await g(()=>e.onDelete?.(e.message.id))&&(s.value=!1)}let S=(n,r)=>{if(!t.status)return null;let i=a?.outbox,o=()=>!e.compact&&e.message.id===n.id&&e.message.delivery!==void 0,s=()=>o()&&e.editable,c=()=>o()&&(e.deletable??e.editable);return q(`div`,{"data-slot":`comment-reply-status`},t.status({delivery:r,dismiss:i?.enabled&&c()?async()=>c()&&await i.dismiss(n.id):void 0,edit:i?.enabled&&s()?async(e,t)=>s()&&await i.edit(n.id,e,t):void 0,message:n,retry:i?.enabled&&s()?async()=>{s()&&await i.retry(n.id)}:void 0}))};return()=>{let{message:a}=e;return q(`div`,{"data-compact":e.compact?`true`:void 0,"data-editing":o.value?`true`:void 0,...tB(a.delivery),"data-size":e.size,"data-slot":`comment-reply`},[q(`div`,{"data-slot":`comment-reply-content`},[q(`div`,{"data-slot":`comment-reply-header`},[q(DD,{"aria-hidden":`true`,people:[fh(a)],size:`sm`}),q(`span`,{"data-agent":a.actor?`true`:void 0,"data-slot":`comment-reply-author`},gh(a)),q(kz,{at:a.createdAt,"data-slot":`comment-reply-time`}),a.editedAt?q(`span`,{"data-slot":`comment-reply-edited`},`edited`):null]),o.value?q(bO,{autofocus:!0,busy:c.value,error:l.value,layout:`row`,mentions:d.value,modelValue:u.value,onCancel:()=>{c.value||(o.value=!1)},onSubmit:v,"onUpdate:mentions":e=>d.value=e,"onUpdate:modelValue":e=>u.value=e,people:e.people,size:e.size,users:e.users,variant:`edit`},{...t[`mention-item`]?{"mention-item":t[`mention-item`]}:{},...t[`mention-empty`]?{"mention-empty":t[`mention-empty`]}:{}}):t.body?.({message:a})??q(NV,{components:m,"data-slot":`comment-reply-body`,plugins:h.value,value:a.body}),o.value||e.compact?null:t.attachments?.({message:a})??ZV(a,e.attachmentUrl,r,i.value.file),o.value||e.compact||!t.footer?null:q(`div`,{"data-slot":`comment-reply-footer`},t.footer({message:a})),!o.value&&a.delivery?S(a,a.delivery):null,s.value?q(`div`,{"aria-label":`Confirm delete`,"data-slot":`comment-reply-confirm`,role:`group`},[q(`p`,`Delete this comment and every reply to it?`),q(n,{color:`error`,label:`Delete thread`,loading:c.value,onClick:x,size:`xs`}),q(n,{color:`neutral`,label:`Cancel`,onClick:()=>s.value=!1,size:`xs`,variant:`ghost`})]):null,!o.value&&l.value?q(`p`,{"data-slot":`comment-reply-error`,role:`alert`},l.value):null]),(y()||b())&&!o.value&&!s.value&&!e.compact?q(`div`,{"data-slot":`comment-reply-actions`},[y()?q(n,{"aria-label":`Edit`,color:`neutral`,icon:i.value.edit,onClick:_,size:`xs`,variant:`ghost`}):null,b()?q(n,{"aria-label":`Delete`,color:`neutral`,icon:i.value.delete,onClick:()=>e.confirmDelete?s.value=!0:void x(),size:`xs`,variant:`ghost`}):null]):null])}}}),tH=e=>q(RV,{key:`resolved`,variant:`separator`},()=>q(UV,()=>`Resolved${e.resolvedBy?` by ${gh({author:e.resolvedBy,...e.resolvedActor?{actor:e.resolvedActor}:{}})}`:``}`)),nH=U({name:`CommentThread`,props:{thread:{required:!0,type:Object},user:{type:Object},preview:{default:!1,type:Boolean},readOnly:{default:!1,type:Boolean},can:{type:Function},busy:{default:!1,type:Boolean},error:{type:String},detached:{default:!1,type:Boolean},people:{default:()=>[],type:Array},users:{type:Function},attachments:{default:!0,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},navigation:{default:`close`,type:String},dismissible:{default:!0,type:Boolean},size:{default:`md`,type:String},onReply:{type:Function},onEdit:{type:Function},onDelete:{type:Function},onResolve:{type:Function},onReopen:{type:Function}},emits:[`close`],slots:Object,setup(e,{emit:t,expose:n,slots:r}){let i=nT(`UButton`),a=Rw(),o=I_(),s=B(null),c=B(``),l=B([]),u=B([]),d=B(!1),f=B(),p=B(null),m=ul(Dp,void 0)??new Set;ll(Dp,m);let h=Y(()=>e.user??o?.user.value),g=Y(()=>e.users??(o?t=>o.users(t,e.thread.id):void 0)),_=(t,n)=>!e.readOnly&&(e.can??o?.can??AO(h.value))(t,{message:n,thread:e.thread}),v=Y(()=>{let t=new Map;for(let n of[...e.people,e.thread.author,...e.thread.messages.map(e=>e.author),...h.value?[h.value]:[]])t.set(n.id,n);return[...t.values()]}),y=Y(()=>[...new Set([e.thread.author.id,...e.thread.messages.map(e=>e.author.id)])]);wp(n=>{let r=jp(n);if(e.preview||!e.dismissible||!s.value||r.includes(s.value))return;for(let e of m)if(e.value&&r.includes(e.value))return;if(r.some(e=>e.matches(`[data-slot='comment-pin']`))||Op.has(n))return;Op.add(n);let i=s.value.getRootNode();Ep(i instanceof ShadowRoot?i:document)?(n.stopPropagation(),Cp()):t(`close`)});async function b(t){if(d.value||!e.onReply)return;d.value=!0,f.value=void 0;let n=c.value,r=l.value,i=u.value;try{await e.onReply(t.body,[...t.mentions],[...t.files]),c.value===n&&l.value===r&&u.value===i&&(c.value=``,l.value=[],u.value=[]),Zc(()=>p.value?.focus())}catch(e){f.value=YV(e)}finally{d.value=!1}}async function x(e){if(!(s.value&&Ep(s.value))){f.value=void 0;try{await e?.()}catch(e){f.value=YV(e)}}}function S(){s.value&&Ep(s.value)||t(`close`)}n({close:S});let C=()=>({...r.body?{body:r.body}:{},...r.attachments?{attachments:r.attachments}:{},...r.footer?{footer:r.footer}:{},...r.status?{status:r.status}:{},...r[`mention-item`]?{"mention-item":r[`mention-item`]}:{},...r[`mention-empty`]?{"mention-empty":r[`mention-empty`]}:{}}),w=()=>({...r.extra?{extra:r.extra}:{},...r[`mention-item`]?{"mention-item":r[`mention-item`]}:{},...r[`mention-empty`]?{"mention-empty":r[`mention-empty`]}:{}});return()=>{let{thread:t}=e,n=t.status===`resolved`,o=Qz(t),m=t.messages[0],T=t.anchor.kind===`text`?t.anchor.exact:void 0;if(e.preview){let n=t.messages.length-1;return q(`div`,{...tB(t.delivery),"data-preview":`true`,"data-size":e.size,"data-slot":`comment-thread`,"data-status":t.status},[m?q(eH,{compact:!0,message:m,people:v.value,size:e.size,user:h.value},{...r.body?{body:r.body}:{},...r.status?{status:r.status}:{}}):null,n>0?q(`p`,{"data-slot":`comment-thread-count`},[q(jw,{value:n}),n===1?` reply`:` replies`]):null])}let E=e.navigation===`back`,D=r.anchor?r.anchor({thread:t}):T?q(`blockquote`,{"data-slot":`comment-thread-quote`},T):null;return q(`section`,{"aria-label":$z(t),...tB(t.delivery),"data-size":e.size,"data-slot":`comment-thread`,"data-status":t.status,ref:s,role:`dialog`,tabindex:-1},[q(`header`,{"data-slot":`comment-thread-header`},[E?q(i,{"aria-label":`Back to comments`,color:`neutral`,icon:a.value.arrowLeft,onClick:S,size:`xs`,variant:`ghost`}):null,q(`span`,{"data-slot":`comment-thread-title`},eB(t)),q(`span`,{"data-slot":`comment-thread-spacer`}),r.actions?q(`div`,{"data-slot":`comment-thread-actions`},r.actions({thread:t})):null,_(`resolve`)?q(i,{"aria-label":n?`Reopen`:`Resolve`,color:`neutral`,icon:n?a.value.reopen:a.value.check,onClick:()=>void x(n?e.onReopen:e.onResolve),size:`xs`,variant:`ghost`}):null,E?null:q(i,{"aria-label":`Close`,color:`neutral`,icon:a.value.close,onClick:S,size:`xs`,variant:`ghost`})]),q(Dw,null,{render:({props:e,children:t})=>q(`div`,{...e,"data-slot":`comment-thread-messages`},[t]),default:()=>[D,e.detached?q(`p`,{"data-slot":`comment-thread-detached`,role:`status`},`The place of this comment is no longer on the page.`):null,...t.messages.flatMap((r,i)=>[n&&r===o[0]?tH(t):null,q(eH,{attachmentUrl:e.attachmentUrl,confirmDelete:i===0,deletable:_(`delete`,r),editable:_(`edit`,r),key:r.id,message:r,onDelete:e.onDelete,onEdit:e.onEdit,people:v.value,size:e.size,user:h.value,users:g.value},C())]),n&&o.length===0?tH(t):null,r.after?q(`div`,{"data-slot":`comment-thread-after`},r.after({thread:t})):null]}),!_(`reply`)&&(f.value??e.error)?q(`p`,{role:`alert`},f.value??e.error):null,_(`reply`)?q(bO,{accept:e.accept,attachments:e.attachments,autofocus:!1,busy:e.busy||d.value,error:f.value??e.error,files:u.value,guard:!1,layout:`row`,mentions:l.value,modelValue:c.value,onCancel:S,onSubmit:b,participants:y.value,"onUpdate:files":e=>u.value=e,"onUpdate:mentions":e=>l.value=e,"onUpdate:modelValue":e=>c.value=e,people:v.value,ref:p,size:e.size,user:h.value,users:g.value,variant:`reply`},w()):null])}}})}));function iH(e,t,n){let r=(Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)||16)/2,i=e.x,a=i>n/2&&i+r+t>n-r,o=Math.max(r,Math.min(a?i-r-t:i+r,n-r-t));return{x:i,y:e.y,flipX:a,left:o-i}}function aH(e){let t={x:e.left+e.width/2,y:e.top+e.height/2},n=document.elementsFromPoint(t.x,t.y).find(e=>!e.closest(`[data-comments-ui]`)&&!e.localName.startsWith(`vitehub-`)&&e!==document.documentElement);for(let t=n??null;t&&t!==document.documentElement;t=t.parentElement){let n=t.getBoundingClientRect();if(n.left<=e.left+1&&n.top<=e.top+1&&n.right>=e.left+e.width-1&&n.bottom>=e.top+e.height-1)return t}}var oH,sH,cH,lH,uH,dH,fH,pH,mH,hH,gH=t((()=>{X(),GO(),wO(),qO(),Mp(),Zz(),_h(),Kz(),kO(),nB(),dw(),xO(),wV(),rH(),oH=360,sH=420,cH=e=>e===`area`||e===`image`?`round`:`point`,lH=6,uH=32,dH=8,fH=900,pH=8,mH=72,hH=U({name:`CommentLayer`,props:{client:{type:Object},subject:{type:Object},user:{type:Object},comments:{type:Object},people:{default:()=>[],type:Array},hotkey:{default:`c`,type:[String,Boolean]},readOnly:{default:!1,type:Boolean},canComment:{default:!0,type:Boolean},subjectUrl:{type:Function},navigate:{type:Function},can:{type:Function},upload:{type:Function},queueFiles:{default:!1,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},placement:{default:`pin`,type:String},size:{default:`sm`,type:String}},setup(e,{slots:t}){let{client:n,subject:r}=e;if(!e.comments&&!r)throw CO.UI_R0002({message:"CommentLayer needs a `subject`, or the `comments` state from useComments()."});let i=B(null),a=()=>{let e=i.value?.getRootNode();return e instanceof ShadowRoot?e:document},o=e.comments??FO({client:n,hotkey:e.hotkey,subject:()=>e.subject,subjectUrl:e.subjectUrl,uiRoot:a,user:()=>e.user});IO(o);let s=B([]),c=Ks(null);H(()=>o.draft.value,(e,t)=>{e!==t&&(s.value=e?.files?[...e.files]:[])});let{enabled:l,prepare:u,queued:d}=KO(o,e),f=Y(()=>o.user.value),p=Y(()=>o.threads.value.filter(e=>o.pageThreads.value.includes(e)||o.shown.value.has(e.id)||o.leaving.value.has(e.id))),m=Y(()=>p.value.filter(e=>o.shown.value.has(e.id)||o.leaving.value.has(e.id))),h=null,g=B(null),_=(e,t)=>({left:Math.min(e.x,t.clientX),top:Math.min(e.y,t.clientY),width:Math.abs(t.clientX-e.x),height:Math.abs(t.clientY-e.y)}),v=e=>{g.value=null,h=Op.has(e)||e.button!==0?null:{x:e.clientX,y:e.clientY,draw:e.pointerType!==`touch`},h?.draw&&e.target instanceof Element&&e.target.setPointerCapture?.(e.pointerId)},y=e=>{h?.draw&&(!g.value&&Math.hypot(e.clientX-h.x,e.clientY-h.y)<=lH||(g.value=_(h,e)))},b=e=>{let t=h,n=g.value;if(h=null,g.value=null,t){if(n){let n=_(t,e),r=n.width>=dH&&n.height>=dH?aH(n):void 0;if(!r)return;e.preventDefault();try{o.startDraft(r,{area:n,point:{x:n.left,y:n.top}})}catch{}}else if(!(Math.hypot(e.clientX-t.x,e.clientY-t.y)>lH)){e.preventDefault();try{o.startDraft({x:e.clientX,y:e.clientY})}catch{}}}},x=null,S=!1;H(()=>o.opened.value&&DO(o.opened.value),e=>{e&&Zc(()=>i.value?.querySelector(`[data-slot='comment-thread']:not([data-preview])`)?.focus())}),H(()=>o.openId.value,(e,t)=>{if(e)return;x=null;let n=a().activeElement,r=i.value?.querySelector(`[data-slot='comment-thread']:not([data-preview])`),s=o.threads.value.some(e=>e.id===t&&qz(o,e));t&&!s&&(!n||n===document.body||r?.contains(n))&&(x=t)},{flush:`pre`}),H(()=>o.openId.value,e=>{if(e||!x)return;let t=x;x=null,Zc(()=>{let e=i.value?.querySelectorAll(`[data-slot='comment-pin']`)??[];S=!0,([...e].find(e=>e.getAttribute(`data-thread-id`)===t)??i.value?.querySelector(`[data-slot='comment-toolbar-mode']`))?.focus(),S=!1})},{flush:`post`});let C=null;H(()=>o.draft.value,(e,t)=>{if(e&&!t){let e=document.activeElement,t=a();C=e instanceof HTMLElement&&e!==document.body&&!(t instanceof ShadowRoot&&e===t.host)&&!i.value?.contains(e)?e:null;return}if(e||!t)return;let n=C;C=null,Zc(()=>{let e=a().activeElement;n?.isConnected&&(!e||e===document.body)&&n.focus({preventScroll:!0})})},{flush:`sync`});let w=B(null),T=B(!1),E=B(0),D=()=>{E.value=w.value?.offsetWidth??0};H(()=>o.draft.value,(e,t)=>{e!==t&&(T.value=!1)});let O=typeof ResizeObserver==`function`?new ResizeObserver(()=>{D();let e=w.value;e?.parentElement?.hasAttribute(`data-above`)&&e.getBoundingClientRect().top<8&&(T.value=!0)}):void 0;H(w,(e,t)=>{t&&O?.unobserve(t),e&&O?.observe(e),D()}),Ad(()=>O?.disconnect());let k=({x:e,y:t})=>({left:`${e}px`,top:`${t}px`,"--vh-comment-x":`${e}px`}),A=Fs(new Map),ee=new Map,j=new Map,M=(e,t)=>{let n=j.get(e);n!==t&&(n&&te?.unobserve(n),j.delete(e),t&&(j.set(e,t),te?.observe(t)))},N=()=>{for(let[e,t]of ee){let n=t.querySelector(`:scope > [data-slot='comment-layer-popover']`),r=n?getComputedStyle(n).getPropertyValue(`position-area`):``;if(M(e,n&&r&&r!==`none`?n:null),!n||!r||r===`none`){A.delete(e);continue}let i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o={x:a.left+a.right<i.left*2,y:a.top+a.bottom<i.top*2},s=A.get(e);(s?.x!==o.x||s?.y!==o.y)&&A.set(e,o)}},te=typeof ResizeObserver==`function`?new ResizeObserver(N):void 0,P=0,ne=()=>{P||=requestAnimationFrame(()=>{P=0,N()})};Dd(()=>{N(),window.addEventListener(`resize`,ne,{passive:!0}),window.visualViewport?.addEventListener(`resize`,ne,{passive:!0})});let F,re=()=>{let e=i.value;e&&(F?F.play():F=rw(e,{items:e=>[...e.querySelectorAll(`[data-margin-key]`)],movesOnly:!0}),F.measure())};Dd(re),kd(()=>{N(),re()}),Ad(()=>{F?.destroy(),te?.disconnect(),cancelAnimationFrame(P),window.removeEventListener(`resize`,ne),window.visualViewport?.removeEventListener(`resize`,ne)});let ie=e=>t=>{t instanceof HTMLElement?ee.set(e,t):(ee.delete(e),M(e,null),A.delete(e))},ae=(e,t,n)=>{let r=n===void 0?void 0:A.get(n),i=r?r.x:e+oH>window.innerWidth,a=r?r.y:t+sH>window.innerHeight;return{"data-flip-x":i?`true`:void 0,"data-flip-y":a?`true`:void 0}},I=e=>{let t=o.draft.value;if(t?.anchor.kind===`page`)return t;try{o.startDraft(`page`,e?.length?{files:e}:{})}catch{}let n=o.draft.value;return n?.anchor.kind===`page`?n:null},oe=(t,n)=>q(bO,{accept:e.accept,attachments:l.value,autofocus:!n||n.autofocus,busy:t?t.busy||c.value===t:!1,error:t?.error,guard:!n,key:n?`page-island-composer`:void 0,mentions:t?.mentions??[],modelValue:t?.body??``,onCancel:n?n.onCancel:()=>o.cancelDraft(),files:s.value,frame:`none`,layout:`row`,onSubmit:async e=>{let n=t??I(e.files);if(!n||n.busy||c.value===n||o.draft.value!==n)return;n.error=void 0,n.mentions=e.mentions;let r=d(e.files);if(r){n.attachments=[],await o.send({files:r});return}c.value=n;let i=s.value,a=n.body,l=n.mentions;try{let{attachments:t,files:r}=await u(e.files);if(o.draft.value!==n||n.body!==a||n.mentions!==l||s.value!==i)return;n.attachments=t,await o.send({files:r})&&s.value===i&&(s.value=[])}catch(e){n.error=e instanceof Error?e.message:`The files could not be uploaded. Try again.`}finally{c.value===n&&(c.value=null)}},"onUpdate:files":e=>{t||!e.length?s.value=e:I(e)},"onUpdate:mentions":e=>{let n=t??(e.length?I():null);n&&(n.mentions=e)},"onUpdate:modelValue":e=>{let n=t??(e?I():null);n&&(n.body=e)},people:f.value?[f.value]:[],size:e.size,user:f.value,users:o.users}),L=B(0),se=()=>{L.value=window.innerWidth,D()};Dd(()=>{L.value=window.innerWidth,window.addEventListener(`resize`,se,{passive:!0})}),Ad(()=>window.removeEventListener(`resize`,se));let ce=Y(()=>e.placement===`margin`&&L.value>=fH),le=Fs(new Map),ue=new Map,de=typeof ResizeObserver==`function`?new ResizeObserver(e=>{for(let t of e){let e=t.target.getAttribute(`data-margin-key`),n=Math.round(t.target.getBoundingClientRect().height);e&&n&&le.get(e)!==n&&le.set(e,n)}}):void 0;Ad(()=>de?.disconnect());let fe=e=>t=>{let n=ue.get(e);n&&n!==t&&de?.unobserve(n),t instanceof Element?(ue.set(e,t),de?.observe(t)):ue.delete(e)},pe=()=>t.status?{status:t.status}:void 0,me=()=>({...pe(),...t.actions?{actions:t.actions}:{}}),R=(t,n=!1)=>q(nH,{accept:e.accept,attachmentUrl:e.attachmentUrl,attachments:l.value,can:e.can,key:DO(t),detached:o.positions.value.get(t.id)?.detached===!0,...n?{dismissible:!1,navigation:`back`}:{},readOnly:e.readOnly,size:e.size,onClose:()=>o.close(),onDelete:e=>o.remove(t.id,e),onEdit:(e,n,r)=>o.edit(t.id,e,n,r),onReopen:()=>o.reopen(t.id),onReply:async(e,n,r)=>{let{attachments:i,files:a}=await u(r);return o.reply(t.id,e,n,i,a)},onResolve:async()=>{await o.resolve(t.id),o.close()},thread:t,user:f.value},me()),he=(e,t)=>{let n=p.value.flatMap(t=>{let n=o.shown.value.has(t.id)?e.get(t.id):void 0;return n?[{active:o.openId.value===t.id,key:t.id,thread:t,y:n.y}]:[]});t!==void 0&&n.push({active:!0,key:RO,y:t}),n.sort((e,t)=>e.y-t.y);let r=e=>le.get(e.key)??(e.active?sH:mH),i=[],a=-1/0;for(let e of n){let t=Math.max(e.y-16,a+pH);i.push(t),a=t+r(e)}let s=window.innerHeight-16;return n.forEach((e,t)=>{if(!(!e.active||i[t]+r(e)<=s)){i[t]=Math.max(16,s-r(e));for(let e=t-1;e>=0;e--)i[e]=Math.min(i[e],i[e+1]-pH-r(n[e]));for(let e=t+1;e<n.length;e++)i[e]=Math.max(i[e],i[e-1]+pH+r(n[e-1]))}}),{at:new Map(n.map((e,t)=>[e.key,i[t]])),node:q(`div`,{"data-slot":`comment-margin`},n.flatMap((e,t)=>{let n=e.thread;return!n||e.active?[]:[q(`button`,{"aria-label":`${$z(n)}: ${mh(n.messages[0]?.body??``)}`,"data-margin-key":e.key,"data-slot":`comment-margin-card`,"data-status":n.status,...tB(n.delivery),key:e.key,onClick:()=>o.open(n),onPointerenter:()=>{o.draft.value||(o.hoverId.value=n.id)},onPointerleave:()=>{o.hoverId.value===n.id&&(o.hoverId.value=null)},ref:fe(e.key),style:{top:`${i[t]}px`},type:`button`},[q(Gz,{thread:n})])]}))}};return()=>{let n=new Map;for(let e of m.value){let t=o.positions.value.get(e.id);if(!t||t.detached||t.clipped||e.anchor.kind===`page`)continue;let r=e=>[...n.values()].some(n=>Math.abs(n.x-t.x)<uH&&Math.abs(n.y-e)<uH),i=t.y;for(;r(i);)i+=uH;if(i!==t.y&&i>window.innerHeight-uH)for(i=t.y-uH;r(i);)i-=uH;n.set(e.id,{...t,y:i})}let r=m.value.flatMap(t=>{let r=n.get(t.id);if(!r)return[];let i=!o.shown.value.has(t.id),a=o.openId.value===t.id,s=o.hoverId.value===t.id&&!i&&!a&&!o.draft.value&&!ce.value;return[q(`div`,{...ae(r.x,r.y,t.id),"data-kind":t.anchor.kind,"data-leaving":i?`true`:void 0,"data-slot":`comment-layer-item`,inert:i||void 0,key:t.id,ref:ie(t.id),style:k(r)},[q(EB,{active:a,author:t.author,"data-shape":cH(t.anchor.kind),"data-thread-id":t.id,...tB(t.delivery),excerpt:mh(t.messages[0]?.body??``),...t.n?{number:t.n}:{},onHover:()=>{a||S||o.draft.value||(o.hoverId.value=t.id)},onLeave:()=>{o.hoverId.value===t.id&&(o.hoverId.value=null)},onSelect:()=>a?o.close():o.open(t),status:t.status}),s?q(`div`,{"data-preview":`true`,"data-slot":`comment-layer-popover`},q(nH,{preview:!0,size:e.size,thread:t},pe())):null])]}),a=o.draft.value,s=a&&o.positions.value.get(`draft`),c=a&&a.anchor.kind!==`page`?a:null,l=c&&s&&!s.detached?s:c?.point,u=!!(ce.value&&c&&l),d=ce.value?he(n,u?l.y:void 0):null,p=e=>{let t=d?.at.get(e);return t===void 0?void 0:{"data-margin":`true`,"data-margin-key":e,style:{top:`${t}px`}}},_=o.opened.value,x=_&&!qz(o,_)?_:void 0,C=x&&o.positions.value.get(x.id),D=x&&C&&!C.detached&&!C.clipped&&x.anchor.kind!==`page`?n.get(x.id)??C:void 0,O=x&&D?p(x.id):void 0,A=x?q(`div`,{...D?ae(D.x,D.y,`opened-thread`):{},"data-kind":x.anchor.kind,"data-slot":`comment-layer-item`,key:`opened-thread`,ref:ie(`opened-thread`),style:D?k(D):void 0},q(`div`,{...O,"data-floating":D?void 0:`true`,"data-slot":`comment-layer-popover`,ref:e=>O&&fe(x.id)(e)},R(x))):null,ee=c&&l?iH(l,E.value,L.value):void 0,j=u?p(RO):void 0,M=c&&ee?q(`div`,{...ae(ee.x,ee.y),"data-flip-x":ee.flipX?`true`:void 0,...(c.anchor.kind===`area`||c.anchor.kind===`image`)&&ee.y>72&&!T.value?{"data-above":`true`}:{},"data-draft":`true`,"data-kind":c.anchor.kind,"data-slot":`comment-layer-item`,style:k(ee)},[q(EB,{author:f.value,"data-shape":cH(c.anchor.kind),draft:!0}),q(`div`,{...j,"data-motion-appear":j?void 0:`[data-slot=comment-pin]`,"data-slot":`comment-layer-popover`,style:j?.style??{"--vh-comment-draft-left":`${ee.left}px`},ref:e=>{w.value=e instanceof HTMLElement?e:null,j&&fe(RO)(e)}},oe(c))]):null;return q(`div`,{"data-active":o.active.value?`true`:void 0,"data-comments-ui":``,"data-slot":`comment-layer`,ref:i},[o.active.value?q(`div`,{"data-slot":`comment-layer-overlay`,onPointercancel:()=>{h=null,g.value=null},onPointerdown:v,onPointermove:y,onPointerup:b},g.value?[q(`div`,{"data-slot":`comment-layer-area`,style:{left:`${g.value.left}px`,top:`${g.value.top}px`,width:`${g.value.width}px`,height:`${g.value.height}px`}},[...[`top-left`,`top-right`,`bottom-left`,`bottom-right`].map(e=>q(`span`,{"data-corner":e,"data-slot":`comment-layer-area-handle`,key:e})),q(`span`,{"data-slot":`comment-layer-area-size`},`${Math.round(g.value.width)} × ${Math.round(g.value.height)}`)])]:[]):null,...r,M,A,q(Xz,{comments:o,canComment:e.canComment&&!e.readOnly},{composer:e=>[oe(e.draft,e)],thread:({thread:e})=>[R(e,!0)]}),d?.node,t.default?.({comments:o})??[q(SV,{comments:o,people:e.people}),o.listOpen.value?q(bB,{comments:o,navigate:e.navigate}):null]])}}})}));function _H(e){return e instanceof Error?e.message:`The comment could not be sent. Try again.`}var vH,yH,bH,xH=t((()=>{X(),Pw(),GO(),wO(),qO(),Kz(),Pz(),kO(),nB(),L_(),xO(),rH(),iT(),vH=new Set([`row`,`preview`,`group-header`,`list-actions`]),yH=(e,t)=>e.kind===t.kind&&e.id===t.id,bH=U({name:`CommentPanel`,props:{comments:{type:Object},client:{type:Object},subject:{type:Object},user:{type:Object},variant:{default:`docked`,type:String},thread:{default:void 0,type:[String,null]},status:{type:String},title:{default:`Comments`,type:String},heading:{default:!0,type:Boolean},composer:{default:!0,type:Boolean},readOnly:{default:!1,type:Boolean},upload:{type:Function},queueFiles:{default:!1,type:Boolean},accept:{type:String},attachmentUrl:{type:Function},allowEmpty:{default:!1,type:Boolean},people:{default:()=>[],type:Array},can:{type:Function},group:{type:Function}},emits:[`update:thread`,`update:status`,`select`],slots:Object,setup(e,{emit:t,slots:n}){let r=nT(`UButton`),i=e.comments??I_();if(!i&&!e.subject)throw CO.UI_R0002({message:"CommentPanel needs a comments state: put it inside CommentLayer, pass `comments`, or pass a `subject`."});let a=LO(i??FO({client:e.client,hotkey:!1,subject:()=>e.subject,user:()=>e.user}));IO(a);let o=B(null),s=B(null),c=B(`open`),l=Y(()=>e.thread===void 0?s.value:e.thread),u=Y(()=>e.status??c.value),d=Y(()=>a.threads.value.filter(e=>a.scope.value===`site`||yH(e.subject,a.subject.value))),f=Y(()=>d.value.filter(e=>e.status===u.value)),p=OO(a.threads,l);H(p,(e,t,n)=>{e&&n(a.retainMark(e.id))},{immediate:!0,flush:`sync`}),H(p,e=>{e&&e.id!==l.value&&y(e.id)});let m=B(``),h=B([]),g=B([]),_=B(!1),v=B();function y(e){s.value=e,t(`update:thread`,e)}function b(e){c.value=e,t(`update:status`,e)}function x(e){t(`select`,e),y(e.id),Zc(()=>o.value?.querySelector(`[data-slot='comment-thread']`)?.focus())}function S(){let e=p.value?.id;y(null),Zc(()=>{[...o.value?.querySelectorAll(`[data-slot='comment-panel-item']`)??[]].find(t=>t.dataset.threadId===e)?.focus()})}let{enabled:C,prepare:w,queued:T}=KO(a,e),E=()=>`${a.subject.value.kind}\u0000${a.subject.value.id}`,D=0;H(E,()=>{D++,m.value=``,h.value=[],g.value=[],v.value=void 0,_.value=!1});async function O(e){if(_.value)return;let t=++D;v.value=void 0;let n={body:m.value,files:g.value,mentions:h.value},r=T(e.files);if(r){m.value=``,h.value=[],g.value=[];try{await a.create({files:r,body:e.body,mentions:e.mentions})}catch(e){if(t!==D)return;v.value=_H(e),!m.value&&!g.value.length&&(m.value=n.body,h.value=n.mentions,g.value=n.files)}}else{_.value=!0;try{let r=await w(e.files);if(t!==D)return;await a.create({...r,body:e.body,mentions:e.mentions}),t===D&&m.value===n.body&&g.value===n.files&&h.value===n.mentions&&(m.value=``,h.value=[],g.value=[])}catch(e){t===D&&(v.value=_H(e))}finally{t===D&&(_.value=!1)}}}let k=()=>Object.fromEntries(Object.entries(n).filter(([e,t])=>t!==void 0&&!vH.has(e))),A=Y(()=>{let t=[];for(let n of f.value){let r=e.group?.(n),i=t.find(e=>e.label===r);i||t.push(i={label:r,threads:[]}),i.threads.push(n)}return t.sort((e,t)=>Number(e.label!==void 0)-Number(t.label!==void 0))}),ee=e=>q(`li`,{key:e.id},[q(`button`,{"data-focus-inset":``,"data-slot":`comment-panel-item`,"data-status":e.status,...tB(e.delivery),"data-thread-id":e.id,onClick:()=>x(e),type:`button`},n.row?.(Nz(e))??q(Gz,{detached:a.positions.value.get(e.id)?.detached===!0,site:a.scope.value===`site`,thread:e},n.preview?{preview:()=>n.preview?.(Nz(e))}:void 0))]),j=(e,t,n)=>q(`ol`,{"aria-label":t,"data-slot":`comment-panel-items`,key:n},e.map(ee)),M=()=>A.value.map(({label:t,threads:r})=>t===void 0?j(r,e.title,`ungrouped`):q(`section`,{"aria-label":t,"data-slot":`comment-panel-group`,key:t},[q(`h3`,{"data-slot":`comment-panel-group-header`},n[`group-header`]?.({group:t,threads:r})??t),j(r,t)])),N=()=>{let t=a.counts.value,i=(e,t,n)=>q(r,{"aria-checked":String(u.value===e),color:`neutral`,"data-slot":`comment-panel-filter`,"data-state":u.value===e?`on`:`off`,onClick:()=>b(e),onKeydown:t=>{if(![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(t.key))return;t.preventDefault();let n=t.currentTarget.closest(`[role=radiogroup]`);b(e===`open`?`resolved`:`open`),Zc(()=>n?.querySelector(`[role=radio][aria-checked=true]`)?.focus())},role:`radio`,size:`xs`,tabindex:u.value===e?0:-1,variant:u.value===e?`soft`:`ghost`},{default:()=>[`${t} `,q(jw,{value:n})]}),o=a.status.value===`loading`&&a.threads.value.length===0?`Loading comments.`:a.status.value===`error`?`The comments could not load.`:u.value===`open`?`No open comments.`:`No resolved comments.`;return[q(`header`,{"data-slot":`comment-panel-header`},[e.heading?q(`h2`,{"data-slot":`comment-panel-title`},e.title):null,q(`div`,{"aria-label":`Filter comments`,"data-slot":`comment-panel-filters`,role:`radiogroup`},[i(`open`,`Open`,t.open),i(`resolved`,`Resolved`,t.resolved)]),n[`list-actions`]?q(`div`,{"data-slot":`comment-panel-actions`},n[`list-actions`]()):null]),f.value.length===0?q(`p`,{"data-slot":`comment-panel-empty`,role:`status`},o):e.group||A.value.some(e=>e.label!==void 0)?q(`div`,{"data-slot":`comment-panel-groups`},M()):j(f.value,e.title),e.readOnly||!e.composer?null:q(`div`,{"data-slot":`comment-panel-composer`},[q(bO,{accept:e.accept,allowEmpty:e.allowEmpty,attachments:C.value,autofocus:!1,busy:_.value,error:v.value,files:g.value,guard:!1,layout:`row`,mentions:h.value,modelValue:m.value,onSubmit:O,"onUpdate:files":e=>g.value=e,"onUpdate:mentions":e=>h.value=e,"onUpdate:modelValue":e=>m.value=e,people:e.people,placeholder:`Comment on this page`,user:a.user.value},{...n.extra?{extra:n.extra}:{},...n[`mention-item`]?{"mention-item":n[`mention-item`]}:{},...n[`mention-empty`]?{"mention-empty":n[`mention-empty`]}:{}})])]},te=t=>q(nH,{accept:e.accept,attachmentUrl:e.attachmentUrl,attachments:C.value,can:e.can,detached:a.positions.value.get(t.id)?.detached===!0,dismissible:!1,key:DO(t),navigation:`back`,onClose:S,onDelete:async e=>{await a.remove(t.id,e)||S()},onEdit:(e,n,r)=>a.edit(t.id,e,n,r),onReopen:()=>a.reopen(t.id),onReply:async(e,n,r)=>{let{attachments:i,files:o}=await w(r);return a.reply(t.id,e,n,i,o)},onResolve:()=>a.resolve(t.id),people:e.people,readOnly:e.readOnly,thread:t,user:a.user.value},k());return()=>q(`section`,{"aria-label":p.value?$z(p.value):e.title,"data-comments-ui":``,"data-slot":`comment-panel`,"data-variant":e.variant,"data-view":p.value?`thread`:`list`,ref:o},p.value?te(p.value):N())}})})),SH,CH,wH=t((()=>{X(),NB(),iT(),SH=U({props:{hint:{required:!0,type:String},shortcut:{required:!0,type:String},side:{required:!0,type:String}},setup(e,{slots:t}){let n=nT(`UTooltip`),r=B(!1),i=!1;return Ll(()=>{if(!(i||r.value))return r.value=!0,!1}),()=>{let a=`${e.hint} (${e.shortcut})`;return r.value?t.default?.().map(e=>Nu(e,{title:a})):q(n,{content:{side:e.side,sideOffset:8},onVnodeMounted:()=>i=!0,text:a},{content:()=>[e.hint,q(`kbd`,{"data-slot":`comment-selection-bar-kbd`},e.shortcut)],default:t.default})}}}),CH=U({name:`CommentSelectionBar`,props:{side:{default:`top`,type:String},suggest:{default:!1,type:Boolean}},emits:{comment:()=>!0,suggest:()=>!0},slots:Object,setup(e,{emit:t,slots:n}){return()=>q(MB,{...e,"data-slot":`comment-selection-bar`,tooltip:SH,onComment:()=>t(`comment`),onSuggest:()=>t(`suggest`)},n)}})})),TH=t((()=>{xO(),gH(),xH(),rH(),wV(),wH(),nB()})),EH=t((()=>{TH()})),DH,OH=t((()=>{DH=`:host{color:canvastext;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font:14px/1.45 system-ui,-apple-system,Segoe UI,sans-serif}*,:before,:after{box-sizing:border-box}[data-slot=standalone-icon]{flex:none;width:1.1em;height:1.1em;display:inline-block}[data-standalone-button]{appearance:none;border-radius:var(--vh-radius);color:inherit;cursor:pointer;font:inherit;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:.375rem;padding:.375rem .625rem;font-size:.875rem;font-weight:500;line-height:1.25rem;text-decoration:none;display:inline-flex}[data-standalone-button][data-size=xs]{gap:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem}[data-standalone-button][data-size=sm]{padding:.375rem .625rem;font-size:.75rem}[data-standalone-button][data-square=true]{padding:.375rem}[data-standalone-button][data-size=xs][data-square=true]{padding:.25rem}[data-standalone-button][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-standalone-button][data-variant=solid][data-color=primary]{background:var(--vh-primary);color:var(--vh-inverted)}[data-standalone-button][data-variant=solid][data-color=error]{background:var(--vh-error);color:var(--vh-inverted)}[data-standalone-button][data-variant=outline]{border-color:var(--vh-border)}[data-standalone-button][data-variant=soft]{background:var(--vh-bg-accented)}[data-standalone-button][data-variant=ghost]{color:var(--vh-muted)}[data-standalone-button]:is([data-variant=ghost],[data-variant=outline],[data-variant=soft]):hover:not(:disabled){background:var(--vh-bg-accented);color:var(--vh-highlighted)}[data-standalone-button][data-variant=solid]:hover:not(:disabled){opacity:.9}[data-standalone-button].rounded-full{border-radius:9999px}[data-standalone-button][aria-busy=true]{opacity:.6}[data-standalone-button]:disabled{cursor:default;opacity:.4}[data-slot=standalone-modal-trigger]{display:contents}[data-slot=standalone-modal]{background:color-mix(in oklab, var(--vh-bg-elevated) 75%, transparent);pointer-events:auto;z-index:2147483002;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}[data-slot=standalone-modal]>[role=dialog]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);color:var(--vh-text);max-width:calc(100vw - 2rem);max-height:calc(100dvh - 2rem);overflow:auto}`})),kH,AH=t((()=>{kH=`@layer theme,base,comark;@layer components{:root,:host{--vh-comment-default-mark:oklch(58.8% .158 241.966);--vh-comment-default-pin:oklch(20.5% 0 0);--vh-comment-default-pin-text:oklch(98.5% 0 0);--vh-comment-default-surface:oklch(100% 0 0);--vh-comment-default-muted:oklch(50% 0 0);--vh-comment-default-ink:oklch(20.5% 0 0);--vh-comment-shadow:oklch(0% 0 0/.18)}:root,:host,:where([data-slot^=comment-mark],[data-slot=comment-pin],[data-slot^=comment-layer-area]){--vh-comment-mark:var(--vh-ui-comment-mark,var(--vh-focus,var(--vh-comment-default-mark)));--vh-comment-pin:var(--vh-ui-comment-pin,var(--vh-primary,var(--vh-comment-default-pin)));--vh-comment-pin-text:var(--vh-ui-comment-pin-text,var(--vh-inverted,var(--vh-comment-default-pin-text)));--vh-comment-surface:var(--vh-ui-comment-surface,var(--vh-bg,var(--vh-comment-default-surface)));--vh-comment-muted:var(--vh-ui-comment-muted,var(--vh-muted,var(--vh-comment-default-muted)));--vh-comment-ink:var(--vh-ui-comment-ink,var(--vh-highlighted,var(--vh-comment-default-ink)));--vh-comment-pin-size:var(--vh-ui-comment-pin-size,28px)}:root.dark,:root[data-theme=dark],:host(.dark),:host([data-theme=dark]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}@media (prefers-color-scheme:dark){:root:not(.light,.dark,[data-theme]){--vh-comment-default-mark:oklch(74.6% .16 232.661);--vh-comment-default-pin:oklch(98.5% 0 0);--vh-comment-default-pin-text:oklch(20.5% 0 0);--vh-comment-default-surface:oklch(14.5% 0 0);--vh-comment-default-muted:oklch(70.8% 0 0);--vh-comment-default-ink:oklch(98.5% 0 0)}}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]){background:var(--vh-comment-pin);border-radius:calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) calc(var(--vh-comment-pin-size) / 2) 4px;box-shadow:0 0 0 2px var(--vh-comment-surface), 0 2px 8px var(--vh-comment-shadow);box-sizing:border-box;color:var(--vh-comment-pin-text);cursor:pointer;height:var(--vh-comment-pin-size);letter-spacing:.02em;transform:scale(var(--vh-comment-zoom,1));transform-origin:0 100%;width:var(--vh-comment-pin-size);border:0;place-items:center;padding:0;font-size:11px;font-weight:600;line-height:1;transition:opacity .15s ease-out;display:grid;position:absolute}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-shape=round]{border-radius:calc(var(--vh-comment-pin-size) / 2);transform-origin:50%}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])>img{border-radius:inherit;object-fit:cover;width:100%;height:100%;display:block}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):before{content:"";border-radius:50%;position:absolute;inset:-8px}:is([data-slot=comment-mark-pin],[data-slot=comment-pin]):is(:focus-visible,[data-active=true]){transform:scale(calc(var(--vh-comment-zoom,1) * 1.06))}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]{filter:grayscale();opacity:.55}:is([data-slot=comment-mark-pin],[data-slot=comment-pin])[data-status=resolved]:not(:has(img)){background:var(--vh-comment-muted)}:is([data-slot=comment-mark-area],[data-slot=comment-layer-area]){border:calc(1px * var(--vh-comment-zoom,1)) solid color-mix(in oklab, var(--vh-comment-ink) 22%, transparent);box-sizing:border-box;pointer-events:none;border-radius:4px;transition:border-color .12s ease-out,background-color .12s ease-out;position:absolute}[data-slot=comment-mark-area][data-status=resolved]{border-color:color-mix(in oklab, var(--vh-comment-muted) 50%, transparent);border-style:dashed}[data-slot=comment-mark-area][data-active=true]{border-color:color-mix(in oklab, var(--vh-comment-ink) 45%, transparent);border-style:solid}:is([data-slot=comment-mark-area][data-draft=true],[data-slot=comment-layer-area]){background:color-mix(in oklab, var(--vh-comment-mark) 16%, transparent);border:calc(2px * var(--vh-comment-zoom,1)) solid var(--vh-comment-mark);border-radius:3px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle]){background:var(--vh-comment-surface);border:1.5px solid var(--vh-comment-mark);box-sizing:border-box;border-radius:50%;width:8px;height:8px;position:absolute}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=top]{top:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner^=bottom]{bottom:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=left]{left:-5px}:is([data-slot=comment-mark-handle],[data-slot=comment-layer-area-handle])[data-corner$=right]{right:-5px}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true],[data-slot=comment-layer-item][data-leaving=true]>*{pointer-events:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){animation:.13s cubic-bezier(.4,0,1,1) forwards vh-comment-mark-fade}@keyframes vh-comment-mark-fade{to{opacity:0}}@media (prefers-reduced-motion:reduce){:is([data-slot=comment-mark-pin],[data-slot=comment-pin],[data-slot=comment-mark-area],[data-slot=comment-layer-area]){transition:none}:is([data-slot=comment-mark-pin],[data-slot=comment-mark-area])[data-leaving=true]:not([data-motion-leave-managed]){opacity:0;animation:none}}::highlight(vh-comment){background-color:color-mix(in oklab, var(--vh-comment-ink) 13%, transparent)}::highlight(vh-comment-resolved){background-color:color-mix(in oklab, var(--vh-comment-ink) 6%, transparent)}::highlight(vh-comment-active),::highlight(vh-comment-draft){background-color:color-mix(in oklab, var(--vh-comment-ink) 26%, transparent)}[data-slot=comment-send]{--vh-comment-send-text:var(--vitehub-pill-text,var(--ui-text-toned,currentColor));--vh-comment-send-strong:var(--vitehub-pill-strong,var(--ui-text-highlighted,currentColor));--vh-comment-send-muted:var(--vitehub-pill-muted,var(--ui-text-muted,currentColor));--vh-comment-send-hover:var(--vitehub-pill-hover,color-mix(in oklab, currentColor 8%, transparent));--vh-comment-send-on:var(--vitehub-pill-on,var(--ui-bg-inverted,currentColor));--vh-comment-send-on-text:var(--vitehub-pill-on-text,var(--ui-text-inverted,Canvas));--vh-comment-send-error:var(--vitehub-pill-error,var(--ui-error,currentColor));--vh-comment-send-warning:var(--vitehub-pill-warning,var(--ui-warning,currentColor));--vh-comment-send-success:var(--vitehub-pill-success,var(--ui-success,currentColor));color:var(--vh-comment-send-text);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;align-items:center;display:flex}[data-slot=comment-send][hidden]{display:none}[data-slot=comment-send-content]{align-items:center;gap:2px;animation:.18s cubic-bezier(.23,1,.32,1) vh-comment-send-in;display:flex}[data-slot=comment-send-action]{appearance:none;box-sizing:border-box;color:inherit;cursor:pointer;font:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:0 0;border:0;border-radius:8px;flex:none;justify-content:center;align-items:center;gap:4px;min-width:28px;height:28px;margin:0;padding:0 8px;text-decoration:none;transition-property:background-color,color,scale;transition-duration:.15s;transition-timing-function:cubic-bezier(.23,1,.32,1);display:inline-flex}[data-slot=comment-send-action][data-icon]{width:28px;padding:0}@media (hover:hover){[data-slot=comment-send-action]:hover{background:var(--vh-comment-send-hover);color:var(--vh-comment-send-strong)}}[data-slot=comment-send-action]:active{scale:.96}[data-slot=comment-send-action][data-variant=on],[data-slot=comment-send-action][data-variant=on]:hover{background:var(--vh-comment-send-on);color:var(--vh-comment-send-on-text)}@media (any-pointer:coarse){[data-slot=comment-send-action]{min-width:44px;height:44px}}[data-slot=comment-send-status]{box-sizing:border-box;cursor:default;flex:none;justify-content:center;align-items:center;gap:4px;height:28px;padding:0 8px;display:inline-flex}[data-slot=comment-send-status][data-icon]{width:28px;padding:0}[data-slot=comment-send-status][data-tone=error]{color:var(--vh-comment-send-error)}[data-slot=comment-send-status][data-tone=warning]{color:var(--vh-comment-send-warning)}[data-slot=comment-send-hold]{flex:none;display:inline-grid}[data-slot=comment-send-hold]>*{grid-area:1/1}[data-slot=comment-send-hold-copy]{box-sizing:border-box;visibility:hidden;align-items:center;gap:4px;height:28px;padding:0 8px;display:inline-flex}[data-slot=comment-send-message]{color:var(--vh-comment-send-muted);font-weight:400}[data-slot=comment-send-message] b{color:var(--vh-comment-send-strong);font-weight:500}@media (width<=600px){[data-slot=comment-send]:is([data-status=pairing],[data-status=confirm]){flex-shrink:1;max-inline-size:calc(100vw - 64px)}[data-slot=comment-send]:is([data-status=pairing],[data-status=confirm]) [data-slot=comment-send-content],[data-slot=comment-send-status]:has([data-slot=comment-send-message]){flex:0 auto;min-inline-size:0}[data-slot=comment-send-message]{text-overflow:ellipsis;overflow:hidden}[data-slot=comment-send-message]>[data-wide]{display:none}}[data-slot=comment-send] .vh-comment-send-icon{flex:none;width:14px;height:14px}[data-slot=comment-send-count]{background:var(--vh-comment-send-hover);box-sizing:border-box;text-align:center;border-radius:4px;min-width:16px;padding:0 4px;font-size:10px;line-height:17px}[data-slot=comment-send-dot]{background:var(--vh-comment-send-success);border-radius:9999px;flex:none;width:6px;height:6px;animation:1.4s ease-in-out infinite vh-comment-send-pulse}[data-slot=comment-send] .vh-comment-send-spin{animation:.8s linear infinite vh-comment-send-spin}[data-slot=comment-send-logo]{flex:none;place-items:center;width:14px;height:14px;display:inline-grid}[data-slot=comment-send-logo] svg{width:14px;height:14px;display:block}[data-slot=comment-send-logo][data-logo=t3]{color:#fff;background:#0a0a0a;border-radius:4px;width:16px;height:16px;box-shadow:0 0 0 1px #ffffff38}[data-slot=comment-send-logo][data-logo=t3] svg{width:64%;height:auto}[data-slot=comment-send-logo][data-logo=claude]{color:#d97757}@keyframes vh-comment-send-in{0%{opacity:0;transform:translateY(2px)scale(.97)}}@keyframes vh-comment-send-spin{to{rotate:360deg}}@keyframes vh-comment-send-pulse{50%{opacity:.4;scale:.8}}@media (prefers-reduced-motion:reduce){[data-slot=comment-send-content],[data-slot=comment-send-dot],[data-slot=comment-send] .vh-comment-send-spin{animation:none}[data-slot=comment-send-action]{transition-property:background-color,color}[data-slot=comment-send-action]:active{scale:none}}[data-slot=status]{align-items:center;gap:.375rem;min-width:0;font-size:.75rem;line-height:1rem;display:inline-flex}[data-slot=status][data-size=md]{font-size:.875rem;line-height:1.25rem}[data-slot=status][data-colored][data-tone=success]{color:var(--vh-text-success,var(--vh-success))}[data-slot=status][data-colored][data-tone=warning]{color:var(--vh-text-warning,var(--vh-warning))}[data-slot=status][data-colored][data-tone=error]{color:var(--vh-text-error,var(--vh-error))}[data-slot=status][data-colored][data-tone=info]{color:var(--vh-text-info,var(--vh-info))}@keyframes status-pulse{50%{opacity:.35}}[data-slot=copy-button]{border-radius:calc(var(--vh-radius) * .75);color:var(--vh-text);cursor:pointer;font:inherit;background:0 0;border:0;flex-shrink:0;align-items:center;gap:.375rem;padding:.375rem .625rem;font-size:.75rem;font-weight:500;line-height:1rem;transition:color .15s ease-out,background-color .15s ease-out,box-shadow .15s ease-out;display:inline-flex}[data-slot=copy-button][data-size=xs]{gap:.25rem;padding:.25rem .5rem}[data-slot=copy-button][data-size=md]{font-size:.875rem;line-height:1.25rem}[data-slot=copy-button]:not(:has([data-slot=copy-button-label])){padding:.375rem}[data-slot=copy-button][data-size=xs]:not(:has([data-slot=copy-button-label])){padding:.25rem}[data-slot=copy-button][data-variant=outline]{background:var(--vh-bg);box-shadow:inset 0 0 0 1px var(--vh-border-accented)}[data-slot=copy-button][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}@media (hover:hover){[data-slot=copy-button]:not([data-variant=solid]):hover:not(:disabled){background:var(--vh-bg-elevated)}[data-slot=copy-button][data-variant=solid]:hover:not(:disabled){background:color-mix(in oklab, var(--vh-highlighted) 90%, transparent)}}[data-slot=copy-button]:focus-visible{outline:2px solid var(--vh-ring);outline-offset:2px}[data-field-group][data-orientation=horizontal]>[data-slot=copy-button]:not(:only-child){&:first-child{border-start-end-radius:0;border-end-end-radius:0}&:last-child{border-start-start-radius:0;border-end-start-radius:0}}[data-field-group][data-orientation=vertical]>[data-slot=copy-button]:not(:only-child){&:first-child{border-end-end-radius:0;border-end-start-radius:0}&:last-child{border-start-start-radius:0;border-start-end-radius:0}}[data-field-group][data-orientation]>[data-slot=copy-button]:not(:first-child,:last-child){border-radius:0}[data-field-group][data-orientation]>[data-slot=copy-button]:not(:only-child):focus-visible{z-index:1}[data-slot=copy-button]:disabled{cursor:not-allowed;opacity:.5}[data-slot=copy-button][data-loading]{cursor:progress}@keyframes copy-button-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){[data-slot=copy-button]{transition:none}}[data-slot=message][data-align]{gap:.5rem;width:100%;min-width:0;font-size:.875rem;line-height:1.25rem;display:flex;position:relative}[data-slot=message][data-align=end]{flex-direction:row-reverse}:is([data-slot=message-header],[data-slot=message-footer]){color:var(--vh-muted);align-items:center;min-width:0;max-width:100%;padding-inline:.75rem;font-size:.75rem;font-weight:500;line-height:1rem;display:flex}[data-slot=message][data-align]:is(:has([data-variant=ghost]),:not(:has([data-slot=bubble]))) :is([data-slot=message-header],[data-slot=message-footer]){padding-inline:0}[data-slot=bubble]{flex-direction:column;gap:.25rem;width:fit-content;min-width:0;max-width:80%;display:flex;position:relative}:is([data-slot=bubble][data-align=end],[data-slot=message][data-align=end] [data-slot=bubble]){align-self:flex-end}[data-slot=bubble][data-variant=ghost]{max-width:100%}[data-slot=bubble][data-variant=soft][data-tone=info]{--vh-bubble-tone:var(--vh-info)}[data-slot=bubble][data-variant=soft][data-tone=success]{--vh-bubble-tone:var(--vh-success)}[data-slot=bubble][data-variant=soft][data-tone=warning]{--vh-bubble-tone:var(--vh-warning)}[data-slot=bubble][data-variant=soft][data-tone=error]{--vh-bubble-tone:var(--vh-error)}[data-slot=attachment]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * 1.5);color:var(--vh-text);flex-wrap:wrap;flex-shrink:0;width:fit-content;min-width:0;max-width:100%;transition:background-color .15s,border-color .15s;display:flex;position:relative}[data-slot=attachment]:has(>a,>button):hover{background:color-mix(in oklab, var(--vh-bg-elevated) 50%, var(--vh-bg))}[data-slot=attachment][data-status=error]{border-color:color-mix(in oklab, var(--vh-error) 30%, transparent)}[data-slot=attachment][data-status=idle]{border-style:dashed}[data-slot=attachment][data-size=md]{gap:.5rem;font-size:.875rem;line-height:1.25rem}[data-slot=attachment][data-size=md]:has([data-slot=attachment-media]){padding:.5rem}[data-slot=attachment][data-size=md]:has([data-slot=attachment-content]){padding:.5rem .625rem}[data-slot=attachment][data-size=sm]{gap:.625rem;font-size:.75rem;line-height:1rem}[data-slot=attachment][data-size=sm]:has([data-slot=attachment-media]){padding:.375rem}[data-slot=attachment][data-size=sm]:has([data-slot=attachment-content]){padding:.375rem .5rem}[data-slot=attachment][data-size=xs]{border-radius:var(--vh-radius);gap:.375rem;font-size:.75rem;line-height:1rem}[data-slot=attachment][data-size=xs]:has([data-slot=attachment-media]){padding:.25rem}[data-slot=attachment][data-size=xs]:has([data-slot=attachment-content]){padding:.25rem .375rem}[data-slot=attachment][data-orientation=horizontal]{align-items:center;min-width:10rem}[data-slot=attachment][data-orientation=vertical]{flex-direction:column;width:6rem}[data-slot=attachment][data-orientation=vertical]:has([data-slot=attachment-content]){width:7.5rem}[data-slot=attachment-media]{aspect-ratio:1;background:var(--vh-bg-elevated);border-radius:var(--vh-radius);color:var(--vh-highlighted);flex-shrink:0;justify-content:center;align-items:center;width:2.5rem;display:flex;position:relative;overflow:hidden}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-media]{width:100%}[data-slot=attachment][data-size=sm] [data-slot=attachment-media]{width:2rem}[data-slot=attachment][data-size=xs] [data-slot=attachment-media]{border-radius:calc(var(--vh-radius) * .75);width:1.75rem}[data-slot=attachment][data-status=error] [data-slot=attachment-media]{background:color-mix(in oklab, var(--vh-error) 10%, transparent);color:var(--vh-error)}[data-slot=attachment-media] svg{pointer-events:none}[data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:1rem;height:1rem}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:1.5rem;height:1.5rem}[data-slot=attachment][data-size=xs] [data-slot=attachment-media] :is(svg,.iconify):not([class*=size-]){width:.875rem;height:.875rem}[data-slot=attachment-media][data-kind=image]{opacity:.6}[data-slot=attachment]:is([data-status=done],[data-status=idle]) [data-slot=attachment-media][data-kind=image]{opacity:1}[data-slot=attachment-media][data-kind=image]>img{aspect-ratio:1;object-fit:cover;width:100%}[data-slot=attachment-content]{flex:1;min-width:0;max-width:100%;line-height:1.25}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-content]{padding-inline:.25rem}[data-slot=attachment-title]{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;font-weight:500;display:block;overflow:hidden}[data-slot=attachment-description]{color:var(--vh-muted);text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;margin-top:.125rem;font-size:.75rem;line-height:1rem;display:block;overflow:hidden}[data-slot=attachment][data-status=error] [data-slot=attachment-description]{color:color-mix(in oklab, var(--vh-error) 80%, transparent)}[data-slot=attachment-actions]{z-index:20;flex-shrink:0;align-items:center;display:flex;position:relative}[data-slot=attachment][data-orientation=vertical] [data-slot=attachment-actions]{gap:.25rem;position:absolute;top:.75rem;right:.75rem}[data-slot=attachment-action]{border-radius:calc(var(--vh-radius) * .75);color:var(--vh-text);cursor:pointer;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;padding:.25rem;transition:color .15s cubic-bezier(.4,0,.2,1),background-color .15s cubic-bezier(.4,0,.2,1);display:inline-flex}[data-slot=attachment-action]>*{opacity:.8;flex-shrink:0;width:1rem;height:1rem}@media (hover:hover){[data-slot=attachment-action]:hover:not(:disabled){background:var(--vh-bg-elevated)}}[data-slot=attachment-action]:active:not(:disabled){background:var(--vh-bg-elevated)}[data-slot=attachment-action]:focus-visible{outline:3px solid color-mix(in oklab, var(--vh-highlighted) 25%, transparent)}[data-slot=attachment-action]:disabled{cursor:not-allowed;opacity:.5}[data-slot=attachment-trigger]{border-radius:inherit;cursor:pointer;z-index:10;background:0 0;border:0;padding:0;position:absolute;inset:0}[data-slot=attachment-group]{overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;gap:.75rem;min-width:0;padding-block:.25rem;scroll-padding-inline:.25rem;display:flex;overflow-x:auto}[data-slot=attachment-group]>[data-slot=attachment]{scroll-snap-align:start;flex:none}[data-slot=prompt-input]{width:100%}[data-slot=prompt-input-group]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * 2);flex-direction:column;min-width:0;display:flex}[data-slot=prompt-input-attachments]{padding:.5rem .5rem 0}[data-slot=prompt-input-textarea]{color:var(--vh-highlighted);field-sizing:content;font:inherit;resize:none;background:0 0;border:0;width:100%;min-height:3.5rem;max-height:12rem;padding:.75rem .875rem .25rem;font-size:.875rem;line-height:1.5rem}@media (any-pointer:coarse){[data-slot=prompt-input-textarea]{font-size:max(1rem,16px)}}[data-slot=prompt-input-textarea]::placeholder{color:var(--vh-muted)}[data-slot=prompt-input-toolbar]{align-items:center;gap:.375rem;min-width:0;padding:.25rem .5rem .5rem;display:flex}[data-slot=prompt-input-spacer]{flex:1}@media (pointer:coarse){[data-slot=prompt-input-toolbar] button{position:relative}[data-slot=prompt-input-toolbar] button:before{content:"";position:absolute;inset:-8px}}[data-slot=prompt-input-attach],[data-slot=prompt-input-submit]{color:var(--vh-text);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:9999px;flex-shrink:0;justify-content:center;align-items:center;padding:.375rem;font-weight:500;transition-property:color,background-color,border-color,box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:inline-flex}[data-slot=prompt-input-attach]>*,[data-slot=prompt-input-submit]>*{opacity:.8;flex-shrink:0;width:1rem;height:1rem}[data-slot=prompt-input-attach]:focus-visible,[data-slot=prompt-input-submit]:focus-visible{outline:3px solid color-mix(in oklab, var(--vh-highlighted) 25%, transparent);outline-offset:0}[data-slot=prompt-input-attach]:disabled,[data-slot=prompt-input-submit]:disabled{cursor:not-allowed;opacity:.5}[data-slot=prompt-input-attach][data-variant=outline]{background:var(--vh-bg);box-shadow:inset 0 0 0 1px var(--vh-border-accented)}[data-slot=prompt-input-attach][data-variant=outline]:not(:disabled):hover{background:var(--vh-bg-elevated)}[data-slot=prompt-input-attach][data-variant=ghost]{color:var(--vh-muted)}[data-slot=prompt-input-attach][data-variant=ghost]:not(:disabled):hover{background:var(--vh-bg-elevated);color:var(--vh-text)}[data-slot=prompt-input-submit][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-slot=prompt-input-submit][data-variant=solid]:not(:disabled):hover{background:color-mix(in oklab, var(--vh-highlighted) 90%, transparent)}[data-slot=prompt-input-submit][data-variant=soft]{background:var(--vh-bg-elevated)}[data-slot=prompt-input-submit][data-variant=soft]:not(:disabled):hover{background:color-mix(in oklab, var(--vh-bg-accented) 75%, transparent)}[data-slot=prompt-input-submit]>.vh-prompt-input-spinner{animation:1s linear infinite vh-prompt-input-spin}@media (prefers-reduced-motion:reduce){[data-slot=prompt-input-submit]>.vh-prompt-input-spinner{animation-duration:3s}}[data-slot=swap-icon-item][data-spin]>*{animation:1s linear infinite swap-icon-spin}@keyframes swap-icon-spin{to{transform:rotate(360deg)}}@keyframes sync-status-pulse{50%{opacity:.35}}@keyframes connection-status-pulse{50%{opacity:.35}}[data-slot=progress]{color:var(--vh-highlighted);align-items:center;gap:.5rem;min-width:0;display:flex}[data-slot=drop-field]{--vh-drop-dot:var(--vh-highlighted);background:var(--vh-bg);border:1px solid var(--vh-border-accented);border-radius:var(--vh-radius);color:var(--vh-highlighted);cursor:pointer;text-align:center;align-content:center;justify-items:center;gap:.125rem;min-height:10rem;padding:1rem;display:grid;overflow:hidden}[data-slot=drop-field][data-disabled]{cursor:not-allowed;opacity:.6}[data-slot=hold-to-delete] [data-part=icon]{flex:none;display:inline-flex}[data-slot=hold-to-delete] [data-part=icon]>svg{overflow:visible}[data-slot=hold-to-delete] [data-part=icon] [data-part=lid]{rotate:var(--vh-hold-lid,none);transform-box:fill-box;transform-origin:0 100%}[data-slot=hold-to-delete]{background:var(--vh-bg);border:1px solid color-mix(in oklch, var(--vh-error) calc(var(--vh-hold,0) * 100%), var(--vh-border-accented));border-radius:calc(var(--vh-radius) * .75);color:var(--vh-highlighted);cursor:pointer;justify-content:flex-start;align-items:center;gap:.375rem;height:1.75rem;padding:0 .625rem;font-size:.75rem;font-weight:500;display:inline-flex;overflow:visible}[data-slot=hold-to-delete][data-status=undo]{border-color:color-mix(in oklch, var(--vh-error) 40%, var(--vh-border-accented))}[data-slot=hold-to-delete][data-icon-only]:not([data-status=undo]){border-color:#0000;justify-content:center;width:1.75rem;padding:0}[data-slot=avatar-stack]{--vh-avatar-size:2rem;isolation:isolate;align-items:center;display:inline-flex}[data-slot=avatar-stack][data-size=sm]{--vh-avatar-size:1.5rem}[data-slot=avatar-stack][data-size=lg]{--vh-avatar-size:2.5rem}:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){background:var(--vh-bg-accented);box-shadow:0 0 0 2px var(--vh-bg);color:var(--vh-highlighted);font-size:calc(var(--vh-avatar-size) * .4);height:var(--vh-avatar-size);-webkit-user-select:none;user-select:none;width:var(--vh-avatar-size);border-radius:9999px;flex:none;justify-content:center;align-items:center;font-weight:500;line-height:1;display:inline-flex;overflow:hidden}:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count])+:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){margin-inline-start:calc(var(--vh-avatar-size) * -.15)}[data-slot=avatar-stack-count]{color:var(--vh-muted);font-size:calc(var(--vh-avatar-size) * .34)}[data-slot=avatar-stack][data-variant=outline] [data-slot=avatar-stack-item]{box-shadow:0 0 0 2px var(--vh-bg), 0 0 0 4px var(--vh-avatar-color,var(--vh-border))}[data-slot=avatar-stack][data-variant=outline] :is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count])+:is([data-slot=avatar-stack-item],[data-slot=avatar-stack-count]){margin-inline-start:calc(var(--vh-avatar-size) * .05)}[data-slot=avatar-stack-image]{object-fit:cover;width:100%;height:100%}:is([data-slot=marker],[data-slot=marker-separator]){color:var(--vh-muted);text-align:left;align-items:center;gap:.5rem;width:100%;min-height:1rem;font-size:.875rem;line-height:1.25rem;display:flex;position:relative}:is([data-slot=marker],[data-slot=marker-separator]) :is(svg,.iconify):not([class*=size-]),[data-slot=marker-icon]{flex-shrink:0;width:1rem;height:1rem}:is(a[data-slot=marker],[data-slot=marker-content]>a){color:inherit;text-underline-offset:3px;text-decoration:underline}@media (hover:hover){:is(a[data-slot=marker],[data-slot=marker-content]>a):hover{color:var(--vh-highlighted)}}[data-slot=marker-separator]:before,[data-slot=marker-separator]:after{background:var(--vh-border);content:"";flex:1;min-width:0;height:1px}[data-slot=marker-separator]:before{margin-right:.25rem}[data-slot=marker-separator]:after{margin-left:.25rem}[data-slot=marker][data-variant=outline]{border-bottom:1px solid var(--vh-border);padding-bottom:.5rem}[data-slot=marker-content]{overflow-wrap:break-word;min-width:0}[data-slot=marker-separator] [data-slot=marker-content]{text-align:center;flex:none}[data-slot=tooltip-content]{border-radius:calc(var(--vh-radius) * .75);text-wrap:balance;max-width:20rem;font-size:.75rem;line-height:1rem}:is([data-slot=relative-time],[data-slot=comment-reply-time]){font-variant-numeric:tabular-nums}:is([data-slot=filter-search-leading],[data-slot=filter-search-trailing]){align-items:center;display:flex;position:absolute;inset-block:0}@keyframes vh-filter-search-spin{to{transform:rotate(360deg)}}:is([data-slot=code-view],[data-slot=file-diff],[data-slot=file-view],[data-slot=multi-file-diff],[data-slot=patch-diff],[data-slot=unresolved-file]){box-sizing:content-box;--diffs-addition-base:var(--vh-success);--diffs-bg:var(--vh-bg);--diffs-bg-addition:color-mix(in oklab, var(--vh-success) 12%, var(--vh-bg));--diffs-bg-addition-emphasis:color-mix(in oklab, var(--vh-success) 22%, var(--vh-bg));--diffs-bg-buffer:var(--vh-bg-muted);--diffs-bg-context:var(--vh-bg);--diffs-bg-context-gutter:color-mix(in oklab, var(--vh-bg-muted) 72%, var(--vh-bg));--diffs-bg-deletion:color-mix(in oklab, var(--vh-error) 12%, var(--vh-bg));--diffs-bg-deletion-emphasis:color-mix(in oklab, var(--vh-error) 22%, var(--vh-bg));--diffs-bg-separator:var(--vh-bg-muted);--diffs-deletion-base:var(--vh-error);--diffs-fg:var(--vh-text);--diffs-fg-conflict-marker:var(--vh-muted);--diffs-fg-number:var(--vh-dimmed);--diffs-font-family:var(--font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);--diffs-font-size:.8125rem;--diffs-header-font-family:var(--font-sans,ui-sans-serif, system-ui, sans-serif);--diffs-modified-base:var(--vh-info);background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-text);min-height:4rem;display:block;overflow:hidden}:is([data-slot=markdown-editor-content],.vh-markdown-editor-content) .ProseMirror{outline:none;min-height:100%}:is([data-slot=editor-suggestion-label],[data-slot=editor-suggestion-description]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}[data-slot=comment-layer]{pointer-events:none;z-index:2147483000;position:fixed;inset:0}[data-slot=comment-layer]>*{pointer-events:auto}[data-slot=comment-layer-overlay]{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M2 26V14a12 12 0 1 1 12 12H2z' fill='%23fff' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") 2 26,crosshair;position:absolute;inset:0}[data-slot=comment-layer-area-size]{background:color-mix(in oklab, var(--vh-comment-mark), black 10%);color:var(--vh-on-media,white);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:.25rem;padding:.0625rem .3125rem;font:500 .6875rem/1rem ui-monospace,SFMono-Regular,Menlo,monospace;position:absolute;top:calc(100% + .375rem);left:-2px}[data-slot=comment-margin]{pointer-events:none;width:18rem;position:absolute;top:0;right:1rem}[data-slot=comment-margin-card]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));box-sizing:border-box;color:var(--vh-text);font:inherit;pointer-events:auto;text-align:start;border:0;font-size:.875rem;position:absolute;left:0;right:0}button[data-slot=comment-margin-card]{cursor:pointer;align-items:flex-start;gap:.5rem;padding:.625rem .75rem;display:flex}button[data-slot=comment-margin-card]:hover{background:var(--vh-bg-elevated)}button[data-slot=comment-margin-card][data-status=resolved]{opacity:.65}[data-slot=comment-layer-item]>[data-slot=comment-layer-popover][data-margin=true][data-margin-key]{z-index:1;width:18rem;position:fixed;bottom:auto;left:auto;right:1rem}[data-slot=comment-layer-popover][data-margin=true][data-margin-key]{flex-direction:column;max-height:calc(100dvh - 2rem);display:flex}[data-slot=comment-layer-popover][data-margin=true]>[data-slot=comment-thread]{flex-direction:column;flex:auto;min-height:0;display:flex}[data-slot=comment-layer-popover][data-margin=true] [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}[data-slot=comment-margin-card] [data-slot=comment-list-text]{-webkit-line-clamp:3}[data-slot=comment-layer-item]{pointer-events:none;position:absolute}[data-slot=comment-layer-item]>*{pointer-events:auto}[data-slot=comment-pin]{translate:0 -100%}[data-slot=comment-pin] [data-slot=avatar-stack]{--vh-avatar-size:var(--vh-comment-pin-size);border-radius:inherit}[data-slot=comment-pin] [data-slot=avatar-stack-item]{border-radius:inherit;box-shadow:none;color:inherit;font-size:inherit;font-weight:inherit;background:0 0}[data-slot=comment-pin-number]{background:var(--vh-highlighted);color:var(--vh-inverted);text-align:center;border-radius:9999px;min-width:1rem;padding:.15rem .25rem;font-size:.625rem;font-weight:600;line-height:1;position:absolute;top:-.4rem;right:-.4rem}[data-slot=comment-selection-bar]{--vh-selection-bar-text:color-mix(in oklab, var(--vh-inverted) 82%, var(--vh-highlighted));background:var(--vh-highlighted);border:1px solid color-mix(in oklab, var(--vh-inverted) 12%, transparent);-webkit-font-smoothing:antialiased;transform-origin:50% 100%;border-radius:12px;align-items:center;gap:4px;width:max-content;padding:4px;font-size:12px;font-weight:500;line-height:1;display:flex;box-shadow:0 8px 24px oklab(0% none none/.25)}[data-slot=comment-selection-bar][data-side=bottom]{transform-origin:50% 0}[data-slot=comment-selection-bar-action]{color:var(--vh-selection-bar-text);cursor:pointer;font:inherit;touch-action:manipulation;white-space:nowrap;background:0 0;border:0;border-radius:8px;align-items:center;gap:6px;height:28px;padding:0 10px;transition-property:background-color,color;transition-duration:.15s;transition-timing-function:cubic-bezier(.23,1,.32,1);display:inline-flex;position:relative}[data-slot=comment-selection-bar-action]:before{content:"";position:absolute;inset:-8px -2px}[data-slot=comment-selection-bar-action]>:first-child{flex:none;width:1.1em;height:1.1em}@media (hover:hover) and (pointer:fine){[data-slot=comment-selection-bar-action]:hover{background:color-mix(in oklab, var(--vh-inverted) 8%, transparent);color:var(--vh-inverted)}}[data-slot=comment-selection-bar-kbd]{font:inherit;opacity:.6;margin-inline-start:6px}[data-slot=comment-layer-popover]{--vh-comment-card-width:22.5rem;background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-text);max-width:calc(100vw - 1rem);width:var(--vh-comment-card-width);font-size:.875rem;position:absolute;top:.5rem;left:.5rem;overflow:visible}[data-slot=comment-layer-item][data-flip-x=true]>[data-slot=comment-layer-popover]{left:auto;right:clamp(calc(var(--vh-comment-x,0px) + .5rem - 100vw), .5rem, calc(var(--vh-comment-x,100vw) - min(var(--vh-comment-card-width), 100vw - 1rem) - .5rem))}[data-slot=comment-layer-item][data-flip-y=true]>[data-slot=comment-layer-popover]{top:auto;bottom:2.5rem}[data-slot=comment-layer-popover]:not([data-margin],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){--vh-comment-card-radius:1rem;--vh-comment-card-width:21.25rem;flex-direction:column;max-height:min(28rem,60dvh);display:flex;&>[data-slot=comment-thread]{flex:auto;min-height:0}& [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}}[data-slot=comment-layer-item]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:.375rem var(--vh-comment-card-radius) var(--vh-comment-card-radius)}[data-slot=comment-layer-item][data-flip-x=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) .375rem var(--vh-comment-card-radius) var(--vh-comment-card-radius)}[data-slot=comment-layer-item][data-flip-y=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) var(--vh-comment-card-radius) var(--vh-comment-card-radius) .375rem}[data-slot=comment-layer-item][data-flip-x=true][data-flip-y=true]>[data-slot=comment-layer-popover]:not([data-margin],[data-floating],[data-preview]):has(>[data-slot=comment-thread][data-size=sm]){border-radius:var(--vh-comment-card-radius) var(--vh-comment-card-radius) .375rem}@position-try --vh-comment-above{margin:0 0 2.5rem .5rem;position-area:top right}@position-try --vh-comment-above-left{margin:0 .5rem 2.5rem 0;position-area:top left}@position-try --vh-comment-below-inside{margin:.5rem .5rem 0;position-area:bottom span-all}@position-try --vh-comment-above-inside{margin:0 .5rem 2.5rem;position-area:top span-all}@supports (anchor-name:--a){[data-slot=comment-layer-item]{anchor-name:--vh-comment-spot;anchor-scope:--vh-comment-spot}[data-slot=comment-layer-item]:not([data-draft])>[data-slot=comment-layer-popover]:not([data-margin],[data-floating]){position-anchor:--vh-comment-spot;position-area:bottom right;position-try-fallbacks:flip-inline, --vh-comment-above, --vh-comment-above-left, --vh-comment-below-inside, --vh-comment-above-inside;margin:.5rem 0 0 .5rem;position:fixed;inset:auto}}[data-slot=comment-layer-popover][data-preview=true]{pointer-events:none;width:18rem}[data-slot=comment-layer-popover][data-floating=true]{position:fixed;inset:auto 1rem 4.5rem auto}[data-slot=comment-layer-item][data-draft=true]>[data-slot=comment-layer-popover]{--vh-bubble-edge:var(--vh-border);--vh-bubble-radius:1.4375rem;border-radius:.375rem var(--vh-bubble-radius) var(--vh-bubble-radius);left:var(--vh-comment-draft-left,.5rem);box-shadow:0 0 0 1px var(--vh-bubble-edge), 0 2px 4px color-mix(in oklab, var(--vh-comment-shadow) calc(100% / 3), transparent), 0 10px 24px -6px var(--vh-comment-shadow);border:0;width:18rem;right:auto}[data-slot=comment-layer-item][data-draft=true]>[data-slot=comment-layer-popover]:has(>[data-slot=comment-composer][data-size=sm]){--vh-bubble-radius:1.125rem}[data-slot=comment-layer-popover]:has([data-slot=comment-composer][data-frame=none] [data-slot=prompt-input-textarea]:focus-visible){--vh-bubble-edge:color-mix(in oklab, var(--vh-highlighted) 22%, transparent)}[data-slot=comment-layer-item][data-draft=true][data-flip-x=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) .375rem var(--vh-bubble-radius) var(--vh-bubble-radius)}[data-slot=comment-layer-item][data-draft=true][data-flip-y=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) var(--vh-bubble-radius) var(--vh-bubble-radius) .375rem}[data-slot=comment-layer-item][data-draft=true][data-flip-x=true][data-flip-y=true]>[data-slot=comment-layer-popover]{border-radius:var(--vh-bubble-radius) var(--vh-bubble-radius) .375rem}[data-slot=comment-layer]>[data-slot=comment-page-island]{pointer-events:none;left:0;right:0;top:var(--vh-comment-island-top,max(12px, env(safe-area-inset-top)));place-items:start center;display:grid;position:fixed;&>*{grid-area:1/1}}[data-slot=comment-page-island-card]{background:var(--vh-bg);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-text);pointer-events:auto;border-radius:1rem;flex-direction:column;max-width:calc(100vw - 1.5rem);font-size:.875rem;line-height:1.25rem;display:flex}[data-slot=comment-page-island-card][data-open]{width:min(21.25rem,100vw - 1.5rem)}@media (hover:hover) and (pointer:fine){[data-slot=comment-page-island-card]:not([data-open]):hover{background:var(--vh-bg-elevated)}}[data-slot=comment-page-island-trigger]{color:inherit;cursor:pointer;font:inherit;font-variant-numeric:tabular-nums;text-align:start;white-space:nowrap;background:0 0;border:0;border-radius:1rem;flex:none;align-items:center;gap:.375rem;height:2rem;padding:0 .75rem 0 .4375rem;font-weight:500;display:flex;&>svg,&>[data-slot=icon]{flex:none;width:1rem;height:1rem;margin-inline-start:.0625rem}}[data-slot=comment-page-island-label]{text-overflow:ellipsis;min-width:0;overflow:hidden}[data-slot=comment-page-island-faces]{flex:none;display:flex;& [data-slot=avatar-stack]{--vh-avatar-size:1.125rem}}[data-slot=comment-page-island-content]{flex-direction:column;min-height:0;max-height:min(26rem,60dvh - 2rem);display:flex;&>*{border-block-start:1px solid var(--vh-border)}&>[data-slot=comment-thread]{flex:auto;min-height:0}&>[data-slot=comment-thread] [data-slot=comment-thread-messages]{flex:auto;min-height:0;max-height:none}}[data-slot=comment-page-island-items]{flex:0 auto;min-height:0;margin:0;padding:0;list-style:none;overflow-y:auto;&>li:last-child>[data-slot=comment-page-island-item]{border-block-end:0}}[data-slot=comment-page-island-composer]{flex:none}[data-slot=comment-composer]{align-items:flex-start;gap:.5rem;padding:.5rem;display:flex}[data-slot=comment-composer-box]{flex:1;min-width:0;position:relative}[data-slot=comment-composer] [data-slot=prompt-input-textarea]{min-height:2.25rem;padding-block:.5rem .125rem}[data-slot=comment-composer][data-shake=flash] [data-slot=prompt-input-group]{animation:.45s both vh-comment-flash}@keyframes vh-comment-flash{0%,60%{border-color:var(--vh-error);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-error) 25%, transparent)}}[data-slot=comment-composer-mentions]{background:var(--vh-bg);border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));z-index:1;width:100%;margin:.25rem 0 0;padding:.25rem;list-style:none;position:absolute;top:100%;left:0}[data-slot=comment-composer-mention]{border-radius:calc(var(--vh-radius) * .75);cursor:pointer;padding:.375rem .5rem}[data-slot=comment-composer-mention][aria-selected=true]{background:var(--vh-bg-accented)}[data-slot=comment-composer-mention-empty]{color:var(--vh-muted);margin:0;padding:.375rem .5rem}[data-slot=comment-composer-error]{color:var(--vh-error);margin:.375rem 0 0;font-size:.75rem}[data-slot=comment-composer-status]{color:var(--vh-muted);margin:0;font-size:.75rem}[data-slot=comment-composer-status]:not(:empty){padding:.25rem .625rem .125rem}[data-slot=comment-thread]{flex-direction:column;display:flex}[data-slot=comment-thread-header]{border-block-end:1px solid var(--vh-border);align-items:center;gap:.25rem;padding:.375rem .5rem .375rem .75rem;display:flex}@media (pointer:coarse){:is([data-slot=comment-thread-header],[data-slot=comment-reply-actions])>:is(button,a){justify-content:center;min-width:2.75rem;min-height:2.75rem}}[data-slot=comment-thread-title]{color:var(--vh-highlighted);font-weight:600}[data-slot=comment-thread-spacer]{flex:1}[data-slot=comment-thread-messages]{flex-direction:column;max-height:22rem;display:flex;overflow-y:auto}[data-slot=comment-thread-quote]{border-inline-start:2px solid var(--vh-border);color:var(--vh-muted);margin:.75rem .75rem 0;padding-inline-start:.625rem}:is([data-slot=comment-thread-detached],[data-slot=comment-thread-count]){color:var(--vh-muted);margin:.5rem .75rem 0;font-size:.75rem}[data-slot=comment-reply]{gap:.5rem;padding:.75rem;display:flex}[data-slot=comment-reply-content]{flex:1;min-width:0}[data-slot=comment-reply-header]{flex-wrap:wrap;align-items:center;gap:.375rem;min-height:1.5rem;display:flex}[data-slot=comment-reply-header]>[data-slot=avatar-stack]{margin-inline-end:.125rem}[data-slot=comment-reply-content]>:not([data-slot=comment-reply-header]){margin-inline-start:2rem}[data-slot=comment-reply-author]{color:var(--vh-highlighted);font-weight:500}:is([data-slot=comment-reply-time],[data-slot=comment-reply-edited]){color:var(--vh-muted);font-size:.75rem}[data-slot=comment-reply-body]{overflow-wrap:anywhere}[data-slot=comment-reply-actions]{opacity:0;transition:opacity .12s;display:flex}[data-slot=comment-reply]:is(:hover,:focus-within) [data-slot=comment-reply-actions]{opacity:1}@media (any-pointer:coarse){[data-slot=comment-reply-actions]{opacity:1}}[data-slot=comment-reply][data-compact=true] [data-slot=comment-reply-body]{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}[data-slot=comment-reply][data-editing=true] [data-slot=comment-composer]{padding:.25rem 0 0}[data-slot=comment-thread]:has([data-slot=comment-reply][data-editing=true])>[data-slot=comment-composer]{display:none}[data-slot=comment-toolbar]{background:var(--vh-bg);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));border-radius:9999px;align-items:center;gap:.25rem;padding:.25rem;display:flex;position:fixed;bottom:1rem;left:50%;transform:translate(-50%)}[data-slot=comment-filters]{flex-wrap:wrap;gap:.25rem;display:flex}[data-slot=comment-list]{background:var(--vh-bg);border-inline-start:1px solid var(--vh-border);color:var(--vh-text);flex-direction:column;width:20rem;max-width:100vw;font-size:.875rem;display:flex;position:fixed;top:0;bottom:0;right:0;overflow-y:auto}[data-slot=comment-list-header]{border-block-end:1px solid var(--vh-border);flex-direction:column;gap:.5rem;padding:.75rem;display:flex}[data-slot=comment-list-scopes]{gap:.25rem;display:flex}[data-slot=comment-list-empty]{color:var(--vh-muted);margin:0;padding:1rem .75rem}[data-slot=comment-list-items]{margin:0;padding:0;list-style:none}[data-slot=comment-list-item]{border-block-end:1px solid var(--vh-border);color:inherit;align-items:flex-start;gap:.5rem;padding:.625rem .75rem;text-decoration:none;display:flex}[data-slot=comment-list-item]:is(:hover,[aria-current=true]){background:var(--vh-bg-elevated)}[data-slot=comment-list-item][data-status=resolved]{opacity:.65}[data-slot=comment-list-number]{color:var(--vh-muted);flex:none;min-width:1.25rem;padding-top:.25rem;font-size:.75rem}[data-slot=comment-list-body]{flex-direction:column;flex:1;gap:.125rem;min-width:0;display:flex}[data-slot=comment-list-text]{-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}[data-slot=comment-list-meta]{color:var(--vh-muted);flex-wrap:wrap;gap:.25rem .5rem;font-size:.75rem;display:flex}[data-slot=comment-reply-confirm]{flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:.5rem;display:flex}[data-slot=comment-reply-confirm]>p{flex-basis:100%;margin:0}[data-slot=comment-reply-error]{color:var(--vh-error);margin:.375rem 0 0;font-size:.75rem}[data-slot=comment-mention]{background:var(--vh-comment-mention-bg,color-mix(in oklab, var(--vh-bg-accented) 80%, transparent));border-radius:calc(var(--vh-radius) * .5);color:var(--vh-highlighted);padding:0 .125rem;font-weight:500}[data-slot=comment-mention][data-self=true]{background:var(--vh-comment-mention-self-bg,color-mix(in oklab, var(--vh-warning) 25%, transparent))}[data-slot=comment-composer-extra]{margin-block-end:.375rem}[data-slot=comment-composer-mention]{align-items:center;gap:.5rem;display:flex}[data-slot=comment-composer-mention] [data-slot=avatar-stack]{--vh-avatar-size:1.25rem}[data-slot=comment-composer][data-dragging=true] [data-slot=prompt-input-group]{border-color:var(--vh-primary);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-primary) 20%, transparent)}[data-slot=comment-composer] [data-slot=prompt-input-attachments]{flex-wrap:wrap;gap:.375rem;overflow:visible}[data-slot=comment-reply-attachments]{flex-wrap:wrap;margin-top:.5rem}[data-slot=comment-panel-groups]{flex:1;min-height:0;overflow-y:auto}[data-slot=comment-panel-groups] [data-slot=comment-panel-items]{flex:none;overflow:visible}[data-slot=comment-panel-group-header]{border-block-start:1px solid var(--vh-border);color:var(--vh-muted);margin:0;padding:.75rem .75rem .25rem;font-size:.75rem;font-weight:500}[data-slot=comment-reply-images]{gap:.25rem;margin-top:.5rem;display:grid;&[data-count="1"]{display:flex}&[data-count="2"]{grid-template-rows:7rem;grid-template-columns:1fr 1fr}&[data-count="3"]{grid-template-rows:4.75rem 4.75rem;grid-template-columns:2fr 1fr;&>[data-slot=comment-reply-image]:first-child{grid-row:span 2}}&[data-count="4"]{grid-template-rows:5.25rem 5.25rem;grid-template-columns:1fr 1fr}}[data-slot=comment-reply-image]{appearance:none;background:var(--vh-bg-elevated);border:1px solid var(--vh-border);border-radius:calc(var(--vh-radius) * .75);color:var(--vh-muted);cursor:zoom-in;min-width:0;padding:0;display:flex;position:relative;overflow:hidden;& img{object-fit:cover;width:100%;height:100%;display:block}&[data-open=true]{visibility:hidden}}[data-count="1"]>[data-slot=comment-reply-image]{max-width:100%;& img{width:auto;max-width:100%;height:auto;max-height:10rem}}[data-slot=comment-reply-image-more]{background:color-mix(in oklab, var(--vh-highlighted) 55%, transparent);color:var(--vh-inverted);font-variant-numeric:tabular-nums;place-items:center;font-size:.9375rem;font-weight:500;display:grid;position:absolute;inset:0}[data-slot=comment-image-stack]{flex:none;align-self:flex-end;width:2.5rem;height:2rem;position:relative;&:not(:has([data-slot=comment-image-stack-card])){display:none}}[data-slot=comment-image-stack-cards]{position:absolute;inset:0}[data-slot=comment-image-stack-card]{--vh-stack-near:clamp(0, var(--vh-stack-depth), 2);background:var(--vh-bg-elevated);border-radius:calc(var(--vh-radius) * .75);box-shadow:0 0 0 2px var(--vh-bg), 0 1px 3px color-mix(in oklab, var(--vh-highlighted) 18%, transparent);height:1.75rem;left:calc(.125rem + var(--vh-stack-near) * .1875rem);opacity:clamp(0, 3 - var(--vh-stack-depth), 1);top:calc(.25rem - var(--vh-stack-near) * .1875rem);width:1.75rem;z-index:calc(10 - var(--vh-stack-near));position:absolute;& .vh-image-preview{border-radius:inherit}& [data-slot=comment-image-stack-remove]{visibility:hidden;position:absolute;top:-.375rem;right:-.375rem}}[data-slot=comment-image-stack][data-fanned=true] [data-slot=comment-image-stack-cards]{--vh-fan-width:min(var(--vh-fan-room), calc(var(--vh-fan-count) * 4rem + .5rem));box-sizing:border-box;bottom:100%;inset-inline:auto;left:clamp(var(--vh-fan-left), -.5rem, calc(var(--vh-fan-left) + var(--vh-fan-room) - var(--vh-fan-width)));width:var(--vh-fan-width);z-index:20;gap:.5rem;padding:.5rem;display:flex;top:auto;&[data-scrollable=true]{overflow-x:auto}&[data-below]{top:100%;bottom:auto}}[data-slot=comment-image-stack][data-fanned=true] [data-slot=comment-image-stack-card]{opacity:1;z-index:auto;flex:none;width:3.5rem;height:3.5rem;position:relative;top:auto;left:auto;& [data-slot=comment-image-stack-remove]{visibility:visible}}[data-slot=comment-image-stack-toggle]{appearance:none;border-radius:calc(var(--vh-radius) * .75);cursor:pointer;z-index:15;background:0 0;border:0;padding:0;position:absolute;inset:0}[data-slot=comment-image-stack-count]{background:var(--vh-highlighted);box-shadow:0 0 0 2px var(--vh-bg);color:var(--vh-inverted);font-variant-numeric:tabular-nums;pointer-events:none;text-align:center;z-index:16;border-radius:9999px;min-width:1.125rem;height:1.125rem;padding:0 .3125rem;font-size:.6875rem;font-weight:600;line-height:1.125rem;transition:opacity .15s;position:absolute;top:-.25rem;right:-.25rem}[data-fanned=true]>[data-slot=comment-image-stack-count]{opacity:0}[data-slot=comment-composer][data-layout=row][data-multiline=true] [data-slot=comment-image-stack]{order:1}[data-slot=comment-thread-actions]{align-items:center;gap:.25rem;display:flex}[data-slot=comment-thread-after]{padding:0 .75rem .75rem}[data-slot=comment-panel]{background:var(--vh-bg);color:var(--vh-text);flex-direction:column;min-height:0;font-size:.875rem;display:flex}[data-slot=comment-panel][data-variant=docked]{border-inline-start:1px solid var(--vh-border);height:100%}[data-slot=comment-panel][data-variant=floating]{border-radius:calc(var(--vh-radius) * 1.5);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));width:min(22.5rem,100vw - 1rem);max-height:min(36rem,100dvh - 2rem);overflow:hidden}[data-slot=comment-panel-header]{border-block-end:1px solid var(--vh-border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;padding:.5rem .5rem .5rem .75rem;display:flex}[data-slot=comment-panel-title]{color:var(--vh-highlighted);font-size:inherit;margin:0;font-weight:600}[data-slot=comment-panel-filters]{flex-wrap:wrap;flex:1;gap:.25rem;display:flex}[data-slot=comment-panel-actions]{flex-wrap:wrap;align-items:center;gap:.25rem;margin-block:-.25rem;display:flex}[data-slot=comment-panel-actions]:empty{display:none}[data-slot=comment-panel-items]{flex:1;min-height:0;margin:0;padding:0;list-style:none;overflow-y:auto}:is([data-slot=comment-panel-item],[data-slot=comment-page-island-item]){border:0;border-block-end:1px solid var(--vh-border);color:inherit;cursor:pointer;font:inherit;text-align:start;background:0 0;align-items:flex-start;gap:.5rem;width:100%;padding:.625rem .75rem;display:flex}:is([data-slot=comment-panel-item],[data-slot=comment-page-island-item]):hover{background:var(--vh-bg-elevated)}[data-slot=comment-panel-empty]{color:var(--vh-muted);flex:1;margin:0;padding:1rem .75rem}[data-slot=comment-panel-composer],[data-slot=comment-thread]>[data-slot=comment-composer]{border-block-start:1px solid var(--vh-border)}[data-slot=comment-composer][data-layout=row]{padding:.25rem;& [data-slot=prompt-input-group]{box-shadow:none;background:0 0;border-color:#0000;border-radius:calc(1.125rem + 1px);flex-flow:wrap;align-items:flex-end;gap:.25rem;padding:.125rem}& [data-slot=prompt-input-attachments]{flex-basis:100%;padding:.25rem .25rem 0}& [data-slot=prompt-input-textarea]{flex:1;order:1;width:auto;min-width:0;min-height:2rem;padding:.25rem}& [data-slot=prompt-input-toolbar]{display:contents}& [data-slot=prompt-input-spacer]{display:none}& [data-slot=prompt-input-toolbar]>button:last-child{order:2}& [data-slot=prompt-input-toolbar]>button{justify-content:center;min-width:2rem;height:2rem}}[data-slot=comment-thread][data-size=sm]{font-size:.875rem;line-height:1.25rem}[data-slot=comment-thread][data-size=sm] [data-slot=comment-thread-quote]{margin-top:.5rem}[data-slot=comment-thread][data-size=sm]>[data-slot=comment-composer]{border-block-start:0;& [data-slot=prompt-input-group]{background:var(--vh-bg-elevated);box-shadow:none;border-color:#0000}}[data-slot=comment-reply][data-size=sm]{padding:.5rem .75rem;position:relative;& [data-slot=comment-reply-header]{align-items:baseline}& [data-slot=comment-reply-header]>[data-slot=avatar-stack]{align-self:center}& [data-slot=comment-reply-author]{font-size:.875rem;line-height:1.5rem}& [data-slot=comment-reply-body]{--vh-typeset-leading:1.5;font-size:.875rem}}@media not (any-pointer:coarse){[data-slot=comment-reply][data-size=sm] [data-slot=comment-reply-actions]{background:var(--vh-bg);border-radius:var(--vh-radius);position:absolute;top:.375rem;right:.5rem}}[data-slot=comment-composer][data-size=sm] [data-slot=prompt-input-textarea]{min-height:2rem;padding:.375rem .625rem 0}[data-slot=comment-composer][data-size=sm][data-layout=row]{& [data-slot=prompt-input-group]{border-radius:calc(1rem + 1px)}& [data-slot=prompt-input-textarea]{min-height:1.75rem;padding:.21875rem .25rem;line-height:1.3125rem}& [data-slot=prompt-input-toolbar]>button{min-width:1.75rem;height:1.75rem}}[data-slot=comment-composer][data-layout=row][data-multiline=true]{& [data-slot=prompt-input-group]{row-gap:0}& [data-slot=prompt-input-attachments]{padding-bottom:.25rem}& [data-slot=prompt-input-textarea]{flex-basis:100%;order:0;padding-block-end:0;padding-inline:.5rem}& [data-slot=prompt-input-spacer]{display:block}@media (pointer:coarse){& [data-slot=prompt-input-toolbar]>button:before{inset-block-start:0}}}[data-slot=comment-panel-composer] [data-slot=comment-composer-mentions],[data-slot=comment-thread]>[data-slot=comment-composer] [data-slot=comment-composer-mentions]{margin:0 0 .25rem;top:auto;bottom:100%}[data-slot=comment-panel]>[data-slot=comment-thread]{flex:1;min-height:0}[data-slot=comment-panel]>[data-slot=comment-thread] [data-slot=comment-thread-messages]{flex:1;max-height:none}[data-comment-button]{appearance:none;border-radius:var(--vh-radius);color:inherit;cursor:pointer;font:inherit;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:.375rem;padding:.375rem .625rem;font-size:.875rem;font-weight:500;line-height:1.25rem;text-decoration:none;display:inline-flex}[data-comment-button][data-size=xs]{gap:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1rem}[data-comment-button][data-size=sm]{font-size:.75rem}[data-comment-button][data-square]{padding:.375rem}[data-comment-button][data-variant=solid]{background:var(--vh-highlighted);color:var(--vh-inverted)}[data-comment-button][data-variant=soft]{background:var(--vh-bg-accented)}[data-comment-button][data-variant=ghost]{color:var(--vh-muted)}[data-comment-button]:is([data-variant=ghost],[data-variant=soft]):hover:not(:disabled){background:var(--vh-bg-accented);color:var(--vh-highlighted)}[data-comment-button][data-variant=solid]:hover:not(:disabled){opacity:.9}[data-comment-button]:disabled{cursor:default;opacity:.4}[data-slot=comment-icon]{flex:none;width:1.1em;height:1.1em;display:inline-block}[data-slot=message-scroller]{flex-direction:column;width:100%;height:100%;min-height:0;display:flex;position:relative;overflow:hidden}[data-slot=message-scroller-viewport]{overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;width:100%;min-width:0;height:100%;min-height:0;overflow-y:auto}[data-slot=message-scroller-content]{flex-direction:column;gap:1.5rem;height:max-content;min-height:100%;display:flex}[data-slot=message-scroller-item]{flex-shrink:0;min-width:0}[data-slot=message-scroller-button]{background:var(--vh-bg);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-highlighted);cursor:pointer;justify-content:center;align-items:center;width:2rem;height:2rem;transition:background-color .15s;display:flex;position:absolute;bottom:1rem;left:50%;transform:translate(-50%)}@media (hover:hover){[data-slot=message-scroller-button]:hover{background:var(--vh-bg-elevated)}}[data-slot=message-scroller-button][hidden]{display:none}[data-slot=chat]{grid-template-rows:minmax(0,1fr);width:100%;min-width:0;height:100%;min-height:0;display:grid;position:relative;overflow:hidden}[data-slot=chat]>[data-slot=message-scroller-viewport]{overscroll-behavior-y:contain}[data-slot=chat]>[data-slot=message-scroller-viewport]>[data-slot=message-scroller-content]{max-width:48rem;padding:var(--vh-chat-content-padding,1.5rem 1rem 6rem);gap:1.25rem;margin-inline:auto}[data-slot=chat]>[data-slot=message-scroller-button]{background:var(--vh-bg-elevated);box-shadow:var(--vh-shadow-floating,0 0 0 1px var(--vh-border));color:var(--vh-muted);font:inherit;letter-spacing:normal;white-space:nowrap;z-index:2;border:0;border-radius:999px;gap:.375rem;width:auto;padding:.25rem .75rem;font-size:.75rem;font-weight:500;line-height:1rem;transition:color .15s ease-out,background-color .15s ease-out,box-shadow .15s ease-out}[data-slot=chat]>[data-slot=message-scroller-button]>svg{flex:none;width:.875rem;height:.875rem}@media (hover:hover){[data-slot=chat]>[data-slot=message-scroller-button]:hover{background:var(--vh-bg-elevated);color:var(--vh-text)}}[data-slot=chat]:has(>[data-slot=chat-composer])>[data-slot=message-scroller-button]{bottom:var(--vh-chat-scroll-button-offset,7rem)}@media (prefers-reduced-motion:reduce){[data-slot=chat]>[data-slot=message-scroller-viewport]{scroll-behavior:auto}}[data-slot=trace]{flex-direction:column;gap:.5rem;width:100%;min-width:0;display:flex}[data-slot=trace]>:has(>[data-slot=trace-line]){border-radius:calc(var(--vh-radius) * .75);text-align:left;width:fit-content;min-width:0;max-width:100%;display:flex}[data-trace-chevron] svg{stroke:currentColor;stroke-width:2px}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab]){color:var(--vh-muted);cursor:pointer;height:var(--vh-agent-control);width:var(--vh-agent-control);background:0 0;border:0;border-radius:.5rem;flex:none;justify-content:center;align-items:center;padding:0;transition:background-color .15s ease-out,color .15s ease-out;display:inline-flex}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab])>*{width:1rem;height:1rem}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab]):hover{background:var(--vh-agent-hover);color:var(--vh-text)}:is([data-slot=agent-session-details-toggle],[data-slot=agent-session-panel-toggle],[data-slot=agent-session-maximize],[data-slot=agent-session-new-tab])[aria-pressed=true]{background:var(--vh-agent-pressed);color:var(--vh-highlighted)}.collaboration-carets__caret{pointer-events:none;word-break:normal;border-inline:1px solid;margin-inline:-1px;position:relative}.collaboration-carets__label{border-radius:calc(var(--vh-radius) * .5) calc(var(--vh-radius) * .5) calc(var(--vh-radius) * .5) 0;color:var(--vh-inverted);inset-inline-start:-1px;-webkit-user-select:none;user-select:none;white-space:nowrap;padding:.0625rem .375rem;font-size:.75rem;font-style:normal;font-weight:600;line-height:1.25;position:absolute;top:-1.4em}.vh-image-preview{appearance:none;aspect-ratio:4/3;background:var(--vh-bg-elevated);border:1px solid var(--vh-border);border-radius:var(--vh-radius);color:var(--vh-muted);cursor:zoom-in;vertical-align:top;justify-content:center;align-items:center;width:13rem;max-width:100%;padding:0;display:inline-flex;overflow:hidden}.vh-image-preview img{object-fit:cover;width:100%;height:100%;display:block}.vh-image-preview--compact{aspect-ratio:1;border:0;width:100%;height:100%}.vh-image-unavailable{overflow-wrap:anywhere;padding:.5rem;font-size:.75rem}.vh-image-dialog__toolbar{color:var(--vh-on-media,var(--vh-highlighted));border:0;flex:none;align-items:center;gap:.25rem;padding-bottom:.5rem;display:flex}.vh-image-dialog__name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:.75rem;overflow:hidden}.vh-image-dialog__image{border-radius:var(--vh-radius);object-fit:contain;max-width:92vw;max-height:calc(92dvh - 3rem);display:block}.vh-image-gallery__body{display:contents}.vh-image-gallery .vh-image-dialog__toolbar{transition:opacity .15s;&[data-closing=true]{opacity:0}}.vh-image-gallery__count{color:var(--vh-on-media,var(--vh-muted));font-variant-numeric:tabular-nums;opacity:.8;white-space:pre;margin-inline-end:.25rem;font-size:.75rem;display:inline-flex}.vh-image-gallery__stage{justify-content:center;display:flex;position:relative}.vh-image-gallery__step{z-index:1;border-radius:9999px;position:absolute;top:50%;transform:translateY(-50%);&.vh-image-gallery__step--previous{left:.5rem}&.vh-image-gallery__step--next{right:.5rem}}.vh-image-dialog__error{background:var(--vh-media-scrim,var(--vh-bg-elevated));border-radius:var(--vh-radius);color:var(--vh-on-media,var(--vh-highlighted));max-width:24rem;padding:2rem;font-size:.875rem}[data-slot=invocation] [data-activity-id][data-selected=true]{background:var(--vh-bg-elevated);border-radius:calc(var(--vh-radius) * .85);scroll-margin-block:5rem}[data-slot=visually-hidden]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}:where(:root,[class^=vh-ws-],[class*=\\ vh-ws-]){--vh-ws-font-mono:var(--font-mono,"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace);--vh-ws-code-bg:var(--vh-bg);--vh-ws-code-fg:var(--vh-highlighted);--vh-ws-code-cursor:var(--vh-highlighted);--vh-ws-code-selection:color-mix(in oklab, var(--vh-highlighted) 14%, transparent);--vh-ws-code-line:color-mix(in oklab, var(--vh-highlighted) 4%, transparent);--vh-ws-code-gutter:var(--vh-dimmed);--vh-ws-code-gutter-active:var(--vh-text);--vh-ws-code-comment:var(--vh-dimmed);--vh-ws-code-punctuation:var(--vh-muted);--vh-ws-terminal-bg:var(--vh-ws-code-bg);--vh-ws-terminal-fg:var(--vh-text);--vh-ws-ink:var(--ui-text-highlighted,CanvasText);--vh-ws-ink-inverted:var(--ui-bg,Canvas);--vh-ws-accent:var(--vh-focus,var(--ring,var(--vh-highlighted)))}:is(.vh-ws-preview-path,.vh-ws-input) input{font-family:var(--vh-ws-font-mono)}@keyframes vh-ws-pulse{50%{opacity:.35}}:where(.vh-ws-guide-content)>:where(p,ul,ol,blockquote){max-width:62ch;margin:0 0 10px}:where(.vh-ws-guide-content) :where(code:not(pre code)){background:var(--vh-bg-elevated);font:.75rem var(--vh-ws-font-mono);border-radius:4px;padding:1px 4px}}@layer utilities;:where([data-focus-ring]):has(:focus-visible){outline:2px solid var(--vh-focus,var(--vh-primary));outline-offset:2px}[data-slot=comment-composer][data-layout=row]{& [data-slot=prompt-input-textarea]:focus-visible{outline:none}&:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){border-color:color-mix(in oklab, var(--vh-highlighted) 22%, transparent);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-highlighted) 6%, transparent)}&[data-dragging=true] [data-slot=prompt-input-group]{border-color:var(--vh-primary);box-shadow:0 0 0 3px color-mix(in oklab, var(--vh-primary) 14%, transparent)}&[data-size=sm]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){box-shadow:none}}[data-slot=comment-thread][data-size=sm]>[data-slot=comment-composer][data-layout=row]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){background:var(--vh-bg);border-color:var(--vh-border-accented)}[data-slot=comment-composer][data-frame=none]:not([data-dragging=true]) [data-slot=prompt-input-group]:has([data-slot=prompt-input-textarea]:focus-visible){box-shadow:none;border-color:#0000}@keyframes vh-prompt-input-spin{to{transform:rotate(360deg)}}[data-markdown-image] [data-markdown-image-action]{border-radius:calc(var(--vh-radius) / 2);color:var(--vh-on-media,var(--vh-highlighted));cursor:pointer;font:inherit;background:0 0;border:0;flex:none;justify-content:center;align-items:center;width:2rem;height:2rem;margin:0;padding:0;text-decoration:none;display:inline-flex}[data-markdown-image] [data-markdown-image-action] svg{width:1rem;height:1rem}@media (hover:hover){[data-markdown-image] [data-markdown-image-action]:hover{background:color-mix(in oklab, var(--vh-on-media,var(--vh-highlighted)) 10%, transparent)}}:where(:root,[data-slot],[class^=vh-],[class*=\\ vh-]){--vh-radius:var(--vh-ui-radius,calc(var(--ui-radius,.25rem) * 2));--vh-border:var(--vh-ui-border,var(--ui-border,color-mix(in oklab, currentColor 14%, transparent)));--vh-border-accented:var(--vh-ui-border-accented,var(--ui-border-accented,color-mix(in oklab, currentColor 24%, transparent)));--vh-muted:var(--vh-ui-muted,var(--ui-text-muted,color-mix(in oklab, currentColor 68%, transparent)));--vh-dimmed:var(--vh-ui-dimmed,var(--ui-text-dimmed,color-mix(in oklab, currentColor 68%, transparent)));--vh-text:var(--vh-ui-text,var(--ui-text,currentColor));--vh-bg:var(--vh-ui-bg,var(--ui-bg,Canvas));--vh-bg-muted:var(--vh-ui-bg-muted,var(--ui-bg-muted,color-mix(in oklab, Canvas 94%, currentColor)));--vh-bg-elevated:var(--vh-ui-bg-elevated,var(--ui-bg-elevated,color-mix(in oklab, Canvas 96%, currentColor)));--vh-bg-accented:var(--vh-ui-bg-accented,var(--ui-bg-accented,color-mix(in oklab, Canvas 90%, currentColor)));--vh-highlighted:var(--vh-ui-highlighted,var(--ui-text-highlighted,currentColor));--vh-inverted:var(--vh-ui-inverted,var(--ui-text-inverted,Canvas));--vh-primary:var(--vh-ui-primary,var(--ui-primary,var(--vh-highlighted)));--vh-ring:var(--vh-ui-ring,color-mix(in oklab, var(--vh-primary) 50%, transparent));--vh-error:var(--vh-ui-error,var(--ui-error,var(--vh-highlighted)));--vh-info:var(--vh-ui-info,var(--ui-info,var(--vh-highlighted)));--vh-success:var(--vh-ui-success,var(--ui-success,var(--vh-highlighted)));--vh-warning:var(--vh-ui-warning,var(--ui-warning,var(--vh-highlighted)))}.vh-image-overlay{background:rgb(from var(--vh-media-scrim,var(--vh-bg-elevated)) r g b / 80%);z-index:59;transition:opacity .15s}.vh-image-overlay--closing{opacity:0}.vh-image-dialog{box-shadow:none;z-index:60;background:0 0;border-radius:0;width:max-content;max-width:92vw;max-height:92dvh;overflow:visible}.vh-image-dialog__action{color:var(--vh-on-media,var(--vh-highlighted));flex:none}.vh-image-dialog__action:hover{background:color-mix(in oklab, var(--vh-on-media,var(--vh-highlighted)) 10%, transparent)}[data-slot=comment-image-stack-remove]{background:var(--vh-highlighted);box-shadow:0 1px 3px color-mix(in oklab, var(--vh-highlighted) 10%, transparent), 0 1px 2px -1px color-mix(in oklab, var(--vh-highlighted) 10%, transparent);color:var(--vh-inverted);border:0;border-radius:9999px;place-items:center;width:1.25rem;min-width:0;height:1.25rem;padding:0;display:grid;& :is(svg,.iconify){width:.75rem;height:.75rem}}`}));function jH(e){return typeof e==`string`&&e?e:void 0}function MH(e){let t=jH(e?.__name)??jH(e?.name);return t?{name:t}:void 0}function NH(){let e=[];for(let t of document.querySelectorAll(`[data-v-app], #__nuxt, #app`))t._vnode&&e.push(t);return e}function PH(e){let t=new Map,n=(e,r,i)=>{if(!e||typeof e!=`object`||i>4e3)return;let a=e;if(a.component){let e=MH(a.component.type);n(a.component.subTree,e?[...r,e]:r,i+1)}else if(a.el&&!t.has(a.el)&&t.set(a.el,r),a.suspense?.activeBranch&&n(a.suspense.activeBranch,r,i+1),Array.isArray(a.children))for(let e of a.children)n(e,r,i+1)};for(let e of NH())n(e._vnode,[],0);for(let n=e;n;n=n.parentElement){let e=t.get(n);if(e)return e.slice(-12)}return[]}function FH(){for(let e of NH()){let t=e.__vue_app__?.config?.globalProperties?.$router?.currentRoute?.value?.matched,n=t?.length?jH(t.at(-1)?.path):void 0;if(n)return n}}function IH(e,t){if(t===`a`)return e.hasAttribute(`href`)?`link`:void 0;if(t===`select`)return e.hasAttribute(`multiple`)||Number(e.getAttribute(`size`))>1?`listbox`:`combobox`;if(t===`input`){let t=e.getAttribute(`type`)?.toLowerCase()??`text`;switch(t){case`checkbox`:return`checkbox`;case`radio`:return`radio`;case`button`:case`submit`:case`reset`:case`image`:return`button`;case`range`:return`slider`;case`number`:return`spinbutton`;case`hidden`:case`password`:case`file`:case`color`:case`date`:case`datetime-local`:case`month`:case`time`:case`week`:return;default:{let n=e.getAttribute(`list`);return n&&e.ownerDocument.getElementById(n)?.localName===`datalist`?`combobox`:t===`search`?`searchbox`:`textbox`}}}return Object.hasOwn(zH,t)?zH[t]:void 0}function LH(e){let t=e.tagName.toLowerCase(),n={tag:t};e.id&&(n.id=e.id.slice(0,128));let r=e.closest(`[data-testid], [data-test], [data-cy]`),i=r?.getAttribute(`data-testid`)??r?.getAttribute(`data-test`)??r?.getAttribute(`data-cy`);i&&(n.testId=i.slice(0,128));let a=e.getAttribute(`role`)??IH(e,t);a&&(n.role=a.slice(0,64));let o=e.getAttribute(`aria-label`)??e.getAttribute(`alt`)??e.getAttribute(`title`)??e.textContent?.replace(/\s+/g,` `).trim();o&&(n.name=o.slice(0,120));let s=[...e.classList].slice(0,8).map(e=>e.slice(0,64));return s.length&&(n.classes=s),n}function RH(e){let t=new URL(location.href),n={url:`${t.origin}${t.pathname}`.slice(0,2048),environment:{viewport:{width:innerWidth,height:innerHeight},devicePixelRatio,userAgent:navigator.userAgent.slice(0,512),language:navigator.language,colorScheme:matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}};document.title&&(n.title=document.title.slice(0,256));let r=FH();if(r&&(n.route=r.slice(0,256)),e){n.element=LH(e);let t=PH(e);t.length&&(n.components=t)}return n}var zH,BH=t((()=>{zH={button:`button`,h1:`heading`,h2:`heading`,h3:`heading`,h4:`heading`,h5:`heading`,h6:`heading`,img:`img`,nav:`navigation`,textarea:`textbox`}}));function VH(e){let t,n,r=0;async function i(i){r++;let a=t;if(!a)return;t=void 0,n?.();let{element:o,field:s,page:c,digest:l,original:u,initial:d}=a;o.contentEditable=`inherit`,o.removeAttribute(`data-vitehub-editing`);let f=(o.textContent??``).trim();if(!i){o.textContent=u;return}if(f===d.trim())return;let[p]=await _a.saveField({field:s,value:f,ifDigest:l},c);if(p)return o.textContent=u,e.failed(p);e.drafted(s),e.info(`Saved as a draft. Publish it in the Console.`)}async function a(a){let o=i(!0),s=r;if(await o,s!==r||!a.isConnected)return;let c=a.getAttribute(Ga);if(!c)return;let l=e.page(),[u,d]=await _a.field(c,l);if(s!==r||!a.isConnected)return;if(u)return e.failed(u);if(!d.editable||d.value===null){e.info(`This field is not plain text. Edit it in the Console.`);return}t={element:a,field:c,page:l,digest:d.digest,original:a.textContent??``,initial:d.value},a.textContent=d.value,a.setAttribute(`data-vitehub-editing`,``),a.contentEditable=`plaintext-only`,a.contentEditable!==`plaintext-only`&&(a.contentEditable=`true`),a.focus();let f=document.createRange();f.selectNodeContents(a),getSelection()?.removeAllRanges(),getSelection()?.addRange(f);let p=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),i(!0)),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i(!1))},m=()=>void i(!0);a.addEventListener(`keydown`,p),a.addEventListener(`blur`,m,{once:!0}),n=()=>{a.removeEventListener(`keydown`,p),a.removeEventListener(`blur`,m)}}return{start:a,finish:i,get element(){return t?.element}}}var HH=t((()=>{qa()}));function UH(e){let t=B(),n=e?.getRootNode(),r=(n instanceof ShadowRoot&&n.host instanceof HTMLElement?n.host:e)?.parentElement;if(!r)return t;let i=0,a=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>{t.value=r.getAttribute(`edge`)===`top`&&!r.hidden?`${Math.round(r.getBoundingClientRect().bottom)+WH}px`:void 0})},o=new MutationObserver(a),s=typeof ResizeObserver==`function`?new ResizeObserver(a):void 0;return Dd(()=>{o.observe(r,{attributeFilter:[`edge`,`collapsed`,`hidden`,`style`]}),s?.observe(r),r.addEventListener(`transitionend`,a),addEventListener(`resize`,a,{passive:!0}),a()}),Ad(()=>{o.disconnect(),s?.disconnect(),r.removeEventListener(`transitionend`,a),removeEventListener(`resize`,a),cancelAnimationFrame(i)}),t}var WH,GH=t((()=>{X(),WH=8})),KH=n({createContext:()=>mU,destroyContext:()=>FU,domToBlob:()=>eW,domToCanvas:()=>$U,domToDataUrl:()=>tW,domToForeignObjectSvg:()=>ZU,domToImage:()=>rW,domToJpeg:()=>iW,domToPixel:()=>aW,domToPng:()=>oW,domToSvg:()=>nW,domToWebp:()=>sW,loadMedia:()=>cU,waitUntilLoad:()=>lU});function qH(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function JH(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function YH(e){let t=-1;fW||=JH();for(let n=0;n<e.length;n++)t=fW[(t^e[n])&255]^t>>>8;return t^-1}function XH(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===cW&&e[n-2]===lW&&e[n-1]===uW&&e[n]===dW)return n-3;return 0}function ZH(e,t,n=!1){let r=new Uint8Array(13);t*=39.3701,r[0]=cW,r[1]=lW,r[2]=uW,r[3]=dW,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=YH(r),a=new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=XH(e);return e.set(r,t),e.set(a,t+13),e}{let t=new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}function QH(e){let t=e.indexOf(pW);return t===-1&&(t=e.indexOf(mW)),t===-1&&(t=e.indexOf(hW)),t}function $H(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}function eU(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(_W&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!_W)return e;let n=tU().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function tU(e){return(e&&kW(e)?e?.ownerDocument:e)??window.document}function nU(e,t,n){let r=tU(n).createElementNS(JW,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function rU(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}async function iU(e,t=`image/png`,n=1){try{return await new Promise((r,i)=>{e.toBlob(e=>{e?r(e):i(Error(`Blob is null`))},t,n)})}catch(r){if(yW)return aU(e.toDataURL(t,n));throw r}}function aU(e){let[t,n]=e.split(`,`),r=t.match(/data:(.+);/)?.[1]??void 0,i=window.atob(n),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e+=1)o[e]=i.charCodeAt(e);return new Blob([o],{type:r})}function oU(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}function sU(e,t){let n=tU(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function cU(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?sU(e,tU(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),LW(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?cU(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=jW(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(IW(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(IW(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function lU(e,t){NW(e)&&(IW(e)||LW(e)?await cU(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>cU(e,t)))))}function uU(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}function dU(e){let t=`${gW}[#${QW}]`;return QW++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&KW(...t)}}function fU(e){return{cache:e?`no-cache`:`force-cache`}}async function pU(e,t){return TW(e)?e:mU(e,{...t,autoDestruct:!0})}async function mU(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(_W?window.document:void 0),c=e.ownerDocument?.defaultView??(_W?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:fU(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:dU(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:hU(s),svgDefsElement:s?.createElementNS(JW,`defs`),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:vW&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[$H(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await lU(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=gU(e,u);return u.width=d,u.height=f,u}function hU(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
148
+ .______background-clip--text {
149
+ background-clip: text;
150
+ -webkit-background-clip: text;
151
+ }
152
+ `);return t.appendChild(n),t}function gU(e,t){let{width:n,height:r}=t;if(kW(e)&&(!n||!r)){let t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute(`width`))||0,r=r||t.height||Number(e.getAttribute(`height`))||0}return{width:n,height:r}}async function _U(e,t){let{log:n,timeout:r,drawImageCount:i,drawImageInterval:a}=t;n.time(`image to canvas`);let o=await cU(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=vU(e.ownerDocument,t),l=()=>{try{c?.drawImage(o,0,0,s.width,s.height)}catch(e){t.log.warn(`Failed to drawImage`,e)}};if(l(),t.isEnable(`fixSvgXmlDecode`))for(let e=0;e<i;e++)await new Promise(t=>{setTimeout(()=>{c?.clearRect(0,0,s.width,s.height),l(),t()},e+a)});return t.drawImageCount=0,n.timeEnd(`image to canvas`),s}function vU(e,t){let{width:n,height:r,scale:i,backgroundColor:a,maximumCanvasSize:o}=t,s=e.createElement(`canvas`);s.width=Math.floor(n*i),s.height=Math.floor(r*i),s.style.width=`${n}px`,s.style.height=`${r}px`,o&&(s.width>o||s.height>o)&&(s.width>o&&s.height>o?s.width>s.height?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o):s.width>o?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o));let c=s.getContext(`2d`);return c&&a&&(c.fillStyle=a,c.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:c}}function yU(e,t){if(e.ownerDocument)try{let t=e.toDataURL();if(t!==`data:,`)return sU(t,e.ownerDocument)}catch(e){t.log.warn(`Failed to clone canvas`,e)}let n=e.cloneNode(!1),r=e.getContext(`2d`),i=n.getContext(`2d`);try{return r&&i&&i.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(e){t.log.warn(`Failed to clone canvas`,e)}return n}function bU(e,t){try{if(e?.contentDocument?.documentElement)return PU(e.contentDocument.documentElement,t)}catch(e){t.log.warn(`Failed to clone iframe`,e)}return e.cloneNode(!1)}function xU(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=``),t.loading===`lazy`&&(t.loading=`eager`),t}async function SU(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return sU(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin=`anonymous`,e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let r=n.ownerDocument;if(r){let i=!0;if(await cU(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?sU(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(e=>{n.addEventListener(`seeked`,e,{once:!0})});let a=r.createElement(`canvas`);a.width=e.offsetWidth,a.height=e.offsetHeight;try{let e=a.getContext(`2d`);e&&e.drawImage(n,0,0,a.width,a.height)}catch(r){return t.log.warn(`Failed to clone video`,r),e.poster?sU(e.poster,e.ownerDocument):n}return yU(a,t)}return n}function CU(e,t){return RW(e)?yU(e,t):GW(e)?bU(e,t):IW(e)?xU(e):LW(e)?SU(e,t):e.cloneNode(!1)}function wU(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement(`iframe`),t.id=`__SANDBOX__${ZW()}`,t.width=`0`,t.height=`0`,t.style.visibility=`hidden`,t.style.position=`fixed`,n.body.appendChild(t),t.srcdoc=`<!DOCTYPE html><meta charset="UTF-8"><title></title><body>`,e.sandbox=t)}catch(t){e.log.warn(`Failed to getSandBox`,t)}}return t}function TU(e,t,n){let{defaultComputedStyles:r}=n,i=e.nodeName.toLowerCase(),a=AW(e)&&i!==`svg`,o=a?eG.map(t=>[t,e.getAttribute(t)]).filter(([,e])=>e!==null):[],s=[a&&`svg`,i,o.map((e,t)=>`${e}=${t}`).join(`,`),t].filter(Boolean).join(`:`);if(r.has(s))return r.get(s);let c=wU(n)?.contentWindow;if(!c)return new Map;let l=c?.document,u,d;a?(u=l.createElementNS(JW,`svg`),d=u.ownerDocument.createElementNS(u.namespaceURI,i),o.forEach(([e,t])=>{d.setAttributeNS(null,e,t)}),u.appendChild(d)):u=d=l.createElement(i),d.textContent=` `,l.body.appendChild(u);let f=c.getComputedStyle(d,t),p=new Map;for(let e=f.length,t=0;t<e;t++){let e=f.item(t);$W.includes(e)||p.set(e,f.getPropertyValue(e))}return l.body.removeChild(u),r.set(s,p),p}function EU(e,t,n){let r=new Map,i=[],a=new Map;if(n)for(let e of n)o(e);else for(let t=e.length,n=0;n<t;n++)o(e.item(n));for(let e=i.length,t=0;t<e;t++)a.get(i[t])?.forEach((e,t)=>r.set(t,e));function o(n){let o=e.getPropertyValue(n),s=e.getPropertyPriority(n),c=n.lastIndexOf(`-`),l=c>-1?n.substring(0,c):void 0;if(l){let e=a.get(l);e||(e=new Map,a.set(l,e)),e.set(n,[o,s])}(t.get(n)!==o||s)&&(l?i.push(l):r.set(n,[o,s]))}return r}function DU(e,t,n,r){let{ownerWindow:i,includeStyleProperties:a,currentParentNodeStyle:o}=r,s=t.style,c=i.getComputedStyle(e),l=TU(e,null,r);o?.forEach((e,t)=>{l.delete(t)});let u=EU(c,l,a);u.delete(`transition-property`),u.delete(`all`),u.delete(`d`),u.delete(`content`),n&&(u.delete(`position`),u.delete(`margin-top`),u.delete(`margin-right`),u.delete(`margin-bottom`),u.delete(`margin-left`),u.delete(`margin-block-start`),u.delete(`margin-block-end`),u.delete(`margin-inline-start`),u.delete(`margin-inline-end`),u.set(`box-sizing`,[`border-box`,``])),u.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`),SW&&(u.has(`font-kerning`)||u.set(`font-kerning`,[`normal`,``]),(u.get(`overflow-x`)?.[0]===`hidden`||u.get(`overflow-y`)?.[0]===`hidden`)&&u.get(`text-overflow`)?.[0]===`ellipsis`&&e.scrollWidth===e.clientWidth&&u.set(`text-overflow`,[`clip`,``]));for(let e=s.length,t=0;t<e;t++)s.removeProperty(s.item(t));return u.forEach(([e,t],n)=>{s.setProperty(n,e,t)}),u}function OU(e,t){(zW(e)||BW(e)||UW(e))&&t.setAttribute(`value`,e.value)}function kU(e,t,n,r,i){let{ownerWindow:a,svgStyleElement:o,svgStyles:s,currentNodeStyle:c}=r;if(!o||!a)return;function l(n){let o=a.getComputedStyle(e,n),l=o.getPropertyValue(`content`);if(!l||l===`none`)return;i?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,``);let u=[ZW()],d=TU(e,n,r);c?.forEach((e,t)=>{d.delete(t)});let f=EU(o,d,r.includeStyleProperties);f.delete(`content`),f.delete(`-webkit-locale`),f.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`);let p=[`content: '${l}';`];if(f.forEach(([e,t],n)=>{p.push(`${n}: ${e}${t?` !important`:``};`)}),p.length===1)return;try{t.className=[t.className,...u].join(` `)}catch(e){r.log.warn(`Failed to copyPseudoClass`,e);return}let m=p.join(`
153
+ `),h=s.get(m);h||(h=[],s.set(m,h)),h.push(`.${u[0]}${n}`)}tG.forEach(l),n&&nG.forEach(l)}async function AU(e,t,n,r,i){if(kW(n)&&(VW(n)||HW(n))||r.filter&&!r.filter(n))return;r.currentParentNodeStyle=rG.has(t.nodeName)||rG.has(n.nodeName)?void 0:r.currentNodeStyle;let a=await PU(n,r,!1,i);r.isEnable(`restoreScrollPosition`)&&MU(e,a),t.appendChild(a)}async function jU(e,t,n,r){let i=e.firstChild;kW(e)&&e.shadowRoot&&(i=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let a=i;a;a=a.nextSibling)if(!PW(a)){if(kW(a)&&WW(a)&&typeof a.assignedNodes==`function`){let i=a.assignedNodes();for(let a=0;a<i.length;a++)await AU(e,t,i[a],n,r)}else await AU(e,t,a,n,r)}}function MU(e,t){if(!NW(e)||!NW(t))return;let{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;let{transform:i}=t.style,a=new DOMMatrix(i),{a:o,b:s,c,d:l}=a;a.a=1,a.b=0,a.c=0,a.d=1,a.translateSelf(-r,-n),a.a=o,a.b=s,a.c=c,a.d=l,t.style.transform=a.toString()}function NU(e,t){let{backgroundColor:n,width:r,height:i,style:a}=t,o=e.style;if(n&&o.setProperty(`background-color`,n,`important`),r&&o.setProperty(`width`,`${r}px`,`important`),i&&o.setProperty(`height`,`${i}px`,`important`),a)for(let e in a)o[e]=a[e]}async function PU(e,t,n=!1,r){let{ownerDocument:i,ownerWindow:a,fontFamilies:o,onCloneEachNode:s}=t;if(i&&FW(e))return r&&/\S/.test(e.data)&&r(e.data),i.createTextNode(e.data);if(i&&a&&kW(e)&&(NW(e)||AW(e))){let r=await CU(e,t);if(t.isEnable(`removeAbnormalAttributes`)){let e=r.getAttributeNames();for(let t=e.length,n=0;n<t;n++){let t=e[n];iG.test(t)||r.removeAttribute(t)}}let i=t.currentNodeStyle=DU(e,r,n,t);n&&NU(r,t);let a=!1;if(t.isEnable(`copyScrollbar`)){let t=[i.get(`overflow-x`)?.[0],i.get(`overflow-y`)?.[0]];a=t.includes(`scroll`)||(t.includes(`auto`)||t.includes(`overlay`))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let c=i.get(`text-transform`)?.[0],l=uU(i.get(`font-family`)?.[0]),u=l?e=>{c===`uppercase`?e=e.toUpperCase():c===`lowercase`?e=e.toLowerCase():c===`capitalize`&&(e=e[0].toUpperCase()+e.substring(1)),l.forEach(t=>{let n=o.get(t);n||o.set(t,n=new Set),e.split(``).forEach(e=>n.add(e))})}:void 0;return kU(e,r,a,t,u),OU(e,r),LW(e)||await jU(e,r,t,u),await s?.(r),r}let c=e.cloneNode(!1);return await jU(e,c,t),await s?.(c),c}function FU(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn(`Failed to destroyContext`,t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function IU(e){let{url:t,timeout:n,responseType:r,...i}=e,a=new AbortController,o=n?setTimeout(()=>a.abort(),n):void 0;return fetch(t,{signal:a.signal,...i}).then(e=>{if(!e.ok)throw Error(`Failed fetch, not 2xx response`,{cause:e});switch(r){case`arrayBuffer`:return e.arrayBuffer();case`dataUrl`:return e.blob().then(YW);default:return e.text()}}).finally(()=>clearTimeout(o))}function LU(e,t){let{url:n,requestType:r=`text`,responseType:i=`text`,imageDom:a}=t,o=n,{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:f,placeholderImage:p},font:m,workers:h,fontFamilies:g}=e;r===`image`&&(CW||wW)&&e.drawImageCount++;let _=l.get(n);if(!_){f&&f instanceof RegExp&&f.test(o)&&(o+=(/\?/.test(o)?`&`:`?`)+new Date().getTime());let t=r.startsWith(`font`)&&m&&m.minify,v=new Set;t&&r.split(`;`)[1].split(`,`).forEach(e=>{g.has(e)&&g.get(e).forEach(e=>v.add(e))});let y=t&&v.size,b={url:o,timeout:s,responseType:y?`arrayBuffer`:i,headers:r===`image`?{accept:c}:void 0,...d};_={type:r,resolve:void 0,reject:void 0,response:null},_.response=(async()=>{if(u&&r===`image`){let e=await u(n);if(e)return e}return!CW&&n.startsWith(`http`)&&h.length?new Promise((e,t)=>{h[l.size&h.length-1].postMessage({rawUrl:n,...b}),_.resolve=e,_.reject=t}):IU(b)})().catch(t=>{if(l.delete(n),r===`image`&&p)return e.log.warn(`Failed to fetch image base64, trying to use placeholder image`,o),typeof p==`string`?p:p(a);throw t}),l.set(n,_)}return _.response}async function RU(e,t,n,r){if(!zU(e))return e;for(let[i,a]of BU(e,t))try{let t=await LU(n,{url:a,requestType:r?`image`:`text`,responseType:`dataUrl`});e=e.replace(VU(i),`$1${t}$3`)}catch(e){n.log.warn(`Failed to fetch css data url`,i,e)}return e}function zU(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}function BU(e,t){let n=[];return e.replace(aG,(e,r,i)=>(n.push([i,eU(i,t)]),e)),n.filter(([e])=>!qW(e))}function VU(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function HU(e,t){return oG.map(n=>{let r=e.getPropertyValue(n);return!r||r===`none`?null:((CW||wW)&&t.drawImageCount++,RU(r,null,t,!0).then(t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))}).filter(Boolean)}function UU(e,t){if(IW(e)){let n=e.currentSrc||e.src;if(!qW(n))return[LU(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.srcset=``,e.dataset.originalSrc=n,e.src=t||``)})];(CW||wW)&&t.drawImageCount++}else if(AW(e)&&!qW(e.href.baseVal)){let n=e.href.baseVal;return[LU(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||``)})]}return[]}function WU(e,t){let{ownerDocument:n,svgDefsElement:r}=t,i=e.getAttribute(`href`)??e.getAttribute(`xlink:href`);if(!i)return[];let[a,o]=i.split(`#`);if(o){let i=`#${o}`,s=t.shadowRoots.reduce((e,t)=>e??t.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(a&&e.setAttribute(`href`,i),r?.querySelector(i))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(a)return[LU(t,{url:a,responseType:`text`}).then(e=>{r?.insertAdjacentHTML(`beforeend`,e)})]}return[]}function GU(e,t){let{tasks:n}=t;kW(e)&&((IW(e)||jW(e))&&n.push(...UU(e,t)),MW(e)&&n.push(...WU(e,t))),NW(e)&&n.push(...HU(e.style,t)),e.childNodes.forEach(e=>{GU(e,t)})}async function KU(e,t){let{ownerDocument:n,svgStyleElement:r,fontFamilies:i,fontCssTexts:a,tasks:o,font:s}=t;if(n&&r&&i.size){if(s&&s.cssText){let e=JU(s.cssText,t);r.appendChild(n.createTextNode(`${e}
154
+ `))}else{let e=Array.from(n.styleSheets).filter(e=>{try{return`cssRules`in e&&!!e.cssRules.length}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}}),s=n.implementation.createHTMLDocument(``),c=s.createElement(`style`);s.head.appendChild(c);let l=c.sheet;await Promise.all(e.flatMap(e=>Array.from(e.cssRules).map(async e=>{if(DW(e)){let n=e.href,r=``;try{r=await LU(t,{url:n,requestType:`text`,responseType:`text`})}catch(e){t.log.warn(`Error fetch remote css import from ${n}`,e)}let i=r.replace(aG,(e,t,r)=>e.replace(r,eU(r,n)));for(let e of qU(i))try{l.insertRule(e,l.cssRules.length)}catch(n){t.log.warn(`Error inserting rule from remote css import`,{rule:e,error:n})}}}))),l.cssRules.length&&e.push(l);let u=[];e.forEach(e=>{YU(e.cssRules,u)}),u.filter(e=>EW(e)&&zU(e.style.getPropertyValue(`src`))&&uU(e.style.getPropertyValue(`font-family`))?.some(e=>i.has(e))).forEach(e=>{let i=e,s=a.get(i.cssText);s?r.appendChild(n.createTextNode(`${s}
155
+ `)):o.push(RU(i.cssText,i.parentStyleSheet?i.parentStyleSheet.href:null,t).then(e=>{e=JU(e,t),a.set(i.cssText,e),r.appendChild(n.createTextNode(`${e}
156
+ `))}))})}}}function qU(e){if(e==null)return[];let t=[],n=e.replace(sG,``);for(;;){let e=cG.exec(n);if(!e)break;t.push(e[0])}n=n.replace(cG,``);let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=r.exec(n);if(e)i.lastIndex=r.lastIndex;else if(e=i.exec(n),e)r.lastIndex=i.lastIndex;else break;t.push(e[0])}return t}function JU(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(uG,e=>{for(;;){let[t,,n]=lG.exec(e)||[];if(!n)return``;if(n===r)return`src: ${t};`}}):e}function YU(e,t=[]){for(let n of Array.from(e))OW(n)?t.push(...YU(n.cssRules)):`cssRules`in n?YU(n.cssRules,t):t.push(n);return t}function XU(e){return dG.test(e.innerHTML)}async function ZU(e,t){let n=await pU(e,t);if(kW(n.node)&&AW(n.node)&&!XU(n.node))return n.node;let{ownerDocument:r,log:i,tasks:a,svgStyleElement:o,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:f,onEmbedNode:p,onCreateForeignObjectSvg:m}=n;i.time(`clone node`);let h=await PU(n.node,n,!0);if(o&&r){let e=``;c.forEach((t,n)=>{e+=`${t.join(`,
157
+ `)} {
158
+ ${n}
159
+ }
160
+ `}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&kW(h)&&(i.time(`embed web font`),await KU(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),GU(h,n);let g=a.length,_=0,v=async()=>{for(;;){let e=a.pop();if(!e)break;try{await e}catch(e){n.log.warn(`Failed to run task`,e)}u?.(++_,g)}};u?.(_,g),await Promise.all([...Array.from({length:4})].map(v)),i.timeEnd(`embed node`),await p?.(h);let y=QU(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&FU(n),await m?.(y),y}function QU(e,t){let{width:n,height:r}=t,i=nU(n,r,e.ownerDocument),a=i.ownerDocument.createElementNS(i.namespaceURI,`foreignObject`);return a.setAttributeNS(null,`x`,`0%`),a.setAttributeNS(null,`y`,`0%`),a.setAttributeNS(null,`width`,`100%`),a.setAttributeNS(null,`height`,`100%`),a.append(e),i.appendChild(a),i}async function $U(e,t){let n=await pU(e,t),r=await ZU(n),i=rU(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=hU(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(JW,`defs`),n.svgStyles.clear()),await _U(sU(i,r.ownerDocument),n)}async function eW(e,t){let n=await pU(e,t),{log:r,type:i,quality:a,dpi:o}=n,s=await $U(n);r.time(`canvas to blob`);let c=await iU(s,i,a);if([`image/png`,`image/jpeg`].includes(i)&&o){let e=await XW(c.slice(0,33)),t=new Uint8Array(e);return i===`image/png`?t=ZH(t,o):i===`image/jpeg`&&(t=qH(t,o)),r.timeEnd(`canvas to blob`),new Blob([t,c.slice(33)],{type:i})}return r.timeEnd(`canvas to blob`),c}async function tW(e,t){let n=await pU(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await $U(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&yW&&bW){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=QH(t);e>=0?(n=Math.ceil((e+28)/3)*4,r=!0):n=44}else a===`image/jpeg`&&(n=24);let i=t.substring(0,n),s=t.substring(n),l=window.atob(i),u=new Uint8Array(l.length);for(let e=0;e<u.length;e++)u[e]=l.charCodeAt(e);let d=a===`image/png`?ZH(u,o,r):qH(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function nW(e,t){let n=await pU(e,t),{width:r,height:i,ownerDocument:a}=n,o=await tW(n),s=nU(r,i,a),c=s.ownerDocument.createElementNS(s.namespaceURI,`image`);return c.setAttributeNS(null,`href`,o),c.setAttributeNS(null,`height`,`100%`),c.setAttributeNS(null,`width`,`100%`),s.appendChild(c),rU(s,n.isEnable(`removeControlCharacter`))}async function rW(e,t){let n=await pU(e,t),{ownerDocument:r,width:i,height:a,scale:o,type:s}=n,c=sU(s===`image/svg+xml`?await nW(n):await tW(n),r);return c.width=Math.floor(i*o),c.height=Math.floor(a*o),c.style.width=`${i}px`,c.style.height=`${a}px`,c}async function iW(e,t){return tW(await pU(e,{...t,type:`image/jpeg`}))}async function aW(e,t){let n=await $U(await pU(e,t));return n.getContext(`2d`).getImageData(0,0,n.width,n.height).data}async function oW(e,t){return tW(await pU(e,{...t,type:`image/png`}))}async function sW(e,t){return tW(await pU(e,{...t,type:`image/webp`}))}var cW,lW,uW,dW,fW,pW,mW,hW,gW,_W,vW,yW,bW,xW,SW,CW,wW,TW,EW,DW,OW,kW,AW,jW,MW,NW,PW,FW,IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW,qW,JW,YW,XW,ZW,QW,$W,eG,tG,nG,rG,iG,aG,oG,sG,cG,lG,uG,dG,fG=t((()=>{cW=112,lW=72,uW=89,dW=115,pW=`AAlwSFlz`,mW=`AAAJcEhZ`,hW=`AAAACXBI`,gW=`[modern-screenshot]`,_W=typeof window<`u`,vW=_W&&`Worker`in window,yW=_W&&`atob`in window,bW=_W&&`btoa`in window,xW=_W?window.navigator?.userAgent:``,SW=xW.includes(`Chrome`),CW=xW.includes(`AppleWebKit`)&&!SW,wW=xW.includes(`Firefox`),TW=e=>e&&`__CONTEXT__`in e,EW=e=>e.constructor.name===`CSSFontFaceRule`,DW=e=>e.constructor.name===`CSSImportRule`,OW=e=>e.constructor.name===`CSSLayerBlockRule`,kW=e=>e.nodeType===1,AW=e=>typeof e.className==`object`,jW=e=>e.tagName===`image`,MW=e=>e.tagName===`use`,NW=e=>kW(e)&&e.style!==void 0&&!AW(e),PW=e=>e.nodeType===8,FW=e=>e.nodeType===3,IW=e=>e.tagName===`IMG`,LW=e=>e.tagName===`VIDEO`,RW=e=>e.tagName===`CANVAS`,zW=e=>e.tagName===`TEXTAREA`,BW=e=>e.tagName===`INPUT`,VW=e=>e.tagName===`STYLE`,HW=e=>e.tagName===`SCRIPT`,UW=e=>e.tagName===`SELECT`,WW=e=>e.tagName===`SLOT`,GW=e=>e.tagName===`IFRAME`,KW=(...e)=>console.warn(gW,...e),qW=e=>e.startsWith(`data:`),JW=`http://www.w3.org/2000/svg`,YW=e=>oU(e,`dataUrl`),XW=e=>oU(e,`arrayBuffer`),ZW=function(){let e=0,t=()=>`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}(),QW=0,$W=[`width`,`height`,`-webkit-text-fill-color`],eG=[`stroke`,`fill`],tG=[`::before`,`::after`],nG=[`::-webkit-scrollbar`,`::-webkit-scrollbar-button`,`::-webkit-scrollbar-thumb`,`::-webkit-scrollbar-track`,`::-webkit-scrollbar-track-piece`,`::-webkit-scrollbar-corner`,`::-webkit-resizer`],rG=new Set([`symbol`]),iG=/^[\w-:]+$/,aG=/url\((['"]?)([^'"]+?)\1\)/g,oG=[`background-image`,`border-image-source`,`-webkit-border-image`,`-webkit-mask-image`,`list-style-image`],sG=/(\/\*[\s\S]*?\*\/)/g,cG=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi,lG=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,uG=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g,dG=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i}));function pG(e){let[t,...n]=e;if(!t)return``;if(n.length===0)return`M${zG(t)}l0.1 0`;let r=`M${zG(t)}`;for(let t=1;t<e.length-1;t++){let n=e[t],i=e[t+1];r+=`Q${zG(n)} ${zG([(n[0]+i[0])/2,(n[1]+i[1])/2])}`}return`${r}L${zG(e[e.length-1])}`}function mG(e,t,n=!1){let r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i)||1,o=n?0:Math.min(18,a*.08),s=[(e[0]+t[0])/2-i/a*o,(e[1]+t[1])/2+r/a*o],c=Math.atan2(t[1]-s[1],t[0]-s[0]),l=Math.min(14,a*.4)+jG.arrow.width,u=e=>[t[0]-l*Math.cos(c+e),t[1]-l*Math.sin(c+e)];return{control:s,left:u(-.5),right:u(.5)}}function hG(e){if(PG(e)!==`arrow`)return pG(e.points);let t=e.points[0],n=e.points[e.points.length-1];if(!t||!n)return``;let{control:r,left:i,right:a}=mG(t,n,e.straight);return`M${zG(t)}Q${zG(r)} ${zG(n)}M${zG(i)}L${zG(n)}L${zG(a)}`}function gG(e){return BG??=document.createElement(`canvas`).getContext(`2d`),BG?(BG.font=IG,BG.measureText(e).width):e.length*jG.text.width*.55}function _G(e){let t=jG.text.width,n=Math.round(t*.45),r=Math.round(t*1.5),[i,a]=e.points[0]??[0,0];return{left:i,top:a-r/2,width:Math.ceil(gG(e.text??``))+n*2,height:r,padding:n,radius:Math.round(t*.35)}}function vG(e){let[t,n,r]=[1,3,5].map(t=>{let n=Number.parseInt(e.slice(t,t+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r>.4?`#0a0a0a`:`#ffffff`}function yG(e){let t=e.flatMap(e=>{if(PG(e)===`text`){let t=_G(e);return[{left:t.left,top:t.top,width:t.width,height:t.height+2}]}let t=FG(e)/2,n=e.points,r=e.points[0],i=e.points[e.points.length-1];if(PG(e)===`arrow`&&r&&i){let{control:t,left:a,right:o}=mG(r,i,e.straight);n=[r,t,i,a,o]}return n.map(([e,n])=>({left:e-t,top:n-t,width:t*2,height:t*2}))});if(t.length===0)return;let n=Math.min(...t.map(e=>e.left)),r=Math.min(...t.map(e=>e.top)),i=Math.max(...t.map(e=>e.left+e.width)),a=Math.max(...t.map(e=>e.top+e.height));return{left:n,top:r,width:i-n,height:a-r}}function bG(e,t){if(e===`arrow`)return`crosshair`;if(e===`text`)return`text`;let n=jG[e].width,r=Math.max(8,n+4),i=`<svg xmlns="${NG}" width="${r}" height="${r}"><circle cx="${r/2}" cy="${r/2}" r="${Math.max(2,n/2)}" fill="${t}" fill-opacity="${e===`marker`?.4:.9}" stroke="#0a0a0a" stroke-opacity=".55"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}") ${r/2} ${r/2}, crosshair`}function xG(e,t){let n=_G(t),r=document.createElementNS(NG,`rect`),i=document.createElementNS(NG,`text`);for(let[e,t]of Object.entries({x:n.left,y:n.top,width:n.width,height:n.height,rx:n.radius}))r.setAttribute(e,String(t));r.setAttribute(`fill`,t.color),i.setAttribute(`x`,String(n.left+n.padding)),i.setAttribute(`y`,String(t.points[0][1])),i.setAttribute(`dominant-baseline`,`central`),i.setAttribute(`fill`,vG(t.color)),i.textContent=t.text??``,e.replaceChildren(r,i)}function SG(e,t){if(PG(e)===`text`){let n=document.createElementNS(NG,`g`);return n.setAttribute(`class`,`label`),xG(n,e),t.append(n),n}let n=document.createElementNS(NG,`path`);return n.setAttribute(`class`,PG(e)),n.setAttribute(`stroke`,e.color),n.setAttribute(`d`,hG(e)),t.append(n),n}function CG(e,t){for(let n of t){if(e.save(),PG(n)===`text`){let t=_G(n),r=e.getTransform().a;e.shadowColor=`rgb(0 0 0 / 30%)`,e.shadowBlur=1.5*r,e.shadowOffsetY=r,e.fillStyle=n.color,e.beginPath(),e.roundRect(t.left,t.top,t.width,t.height,t.radius),e.fill(),e.shadowColor=`transparent`,e.font=IG,e.textBaseline=`middle`,e.fillStyle=vG(n.color),e.fillText(n.text??``,t.left+t.padding,n.points[0][1])}else{let t=PG(n)===`marker`;e.globalAlpha=t?.4:1,e.globalCompositeOperation=t?`multiply`:`source-over`,e.strokeStyle=n.color,e.lineWidth=FG(n),e.lineCap=t?`butt`:`round`,e.lineJoin=`round`,e.stroke(new Path2D(hG(n)))}e.restore()}}function wG(e){let t=document.createElement(`vitehub-marker`);t.setAttribute(`data-comments-ui`,``);let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=RG;let i=document.createElement(`div`);i.className=`layer`;let a=document.createElementNS(NG,`svg`);i.append(a),n.append(r,i),document.documentElement.append(t);let o=[],s,c,l,u=()=>{if(!l)return;let{input:e,stroke:t}=l,n=_G({...t,text:e.value||` `}),r=(t,n)=>e.style.setProperty(t,n);r(`left`,`${n.left}px`),r(`top`,`${n.top}px`),r(`width`,`${n.width+2}px`),r(`height`,`${n.height}px`),r(`padding`,`0 ${n.padding}px`),r(`border-radius`,`${n.radius}px`),r(`background`,t.color),r(`color`,vG(t.color))},d=()=>{if(!l)return;let{input:t,stroke:n,label:r}=l;l=void 0;let i=t.value.trim();if(t.remove(),r)i?(r.text=i,r.color=n.color,xG(r.element,r),r.element.removeAttribute(`visibility`)):o.splice(o.indexOf(r),1)[0]?.element.remove();else{if(!i)return;o.push({...n,text:i,element:SG({...n,text:i},a)})}e.onChange()},f=(e,t)=>{let n=document.createElement(`input`);n.type=`text`,n.maxLength=200,n.spellcheck=!1,n.value=e.text??``,n.setAttribute(`aria-label`,`Label`),n.setAttribute(`enterkeyhint`,`done`),l={input:n,stroke:{...e},label:t},u(),t?.element.setAttribute(`visibility`,`hidden`),n.addEventListener(`input`,u),n.addEventListener(`blur`,d),i.append(n),n.focus({preventScroll:!0}),t&&n.select()},p=t=>{l&&t.composedPath()[0]===l.input&&(t.stopPropagation(),t.isComposing||((t.key===`PageUp`||t.key===`PageDown`)&&t.preventDefault(),(t.key===`Enter`||t.key===`Escape`)&&(t.preventDefault(),d(),t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&e.onSubmit?.())))};addEventListener(`keydown`,p,!0);let m=(e,t)=>o.findLast(n=>{if(PG(n)!==`text`)return!1;let r=_G(n);return e>=r.left-4&&e<=r.left+r.width+4&&t>=r.top-4&&t<=r.top+r.height+4}),h=()=>{i.style.cursor=bG(e.tip(),e.color()),l&&l.stroke.color!==e.color()&&(l.stroke.color=e.color(),u())};h(),i.addEventListener(`pointerdown`,t=>{if(l&&t.composedPath().includes(l.input)||t.button!==0||i.hasAttribute(`data-frozen`))return;if(t.preventDefault(),l)return d();i.setPointerCapture(t.pointerId);let n=e.tip(),r=e.color();if(n===`text`){let e=m(t.clientX,t.clientY);c={label:e,from:[t.clientX,t.clientY],at:e?.points[0],moved:!1,color:r};return}let o={tip:n,color:r,points:[[t.clientX,t.clientY]]};s={...o,element:SG(o,a)}}),i.addEventListener(`pointermove`,e=>{if(c){let{label:t,from:n,at:r}=c;if(!t||!r)return;let i=e.clientX-n[0],a=e.clientY-n[1];if(!c.moved&&Math.hypot(i,a)<3)return;c.moved=!0,t.points=[[r[0]+i,r[1]+a]],xG(t.element,t);return}if(!s)return;let t=[e.clientX,e.clientY],n=s.points[0];if(s.tip===`arrow`||e.shiftKey)e.shiftKey?s.straight=!0:delete s.straight,s.points=[n,s.tip===`marker`&&e.shiftKey?[t[0],n[1]]:t];else{let e=s.points[s.points.length-1];Math.hypot(t[0]-e[0],t[1]-e[1])>2&&s.points.push(t)}s.element.setAttribute(`d`,hG(s))});let g=t=>{if(c){let{label:n,from:r,moved:i,color:a}=c;if(c=void 0,t.type===`pointercancel`)return;if(n){i?e.onChange():f(n,n);return}return f({tip:`text`,color:a,points:[[r[0]-Math.round(jG.text.width*.45),r[1]]],text:``})}if(!s)return;let n=s;s=void 0;let r=n.points[0],i=n.points[n.points.length-1];if(n.tip===`arrow`&&Math.hypot(i[0]-r[0],i[1]-r[1])<10)return n.element.remove();o.push(n),e.onChange()};i.addEventListener(`pointerup`,g),i.addEventListener(`pointercancel`,g);for(let e of[`wheel`,`touchmove`])i.addEventListener(e,e=>e.preventDefault(),{passive:!1});return{strokes:()=>o.map(e=>{let t={tip:e.tip,color:e.color,points:e.points.map(([e,t])=>[e,t])};return e.straight&&(t.straight=!0),e.text!==void 0&&(t.text=e.text),t}),restyle:h,commit:d,undo(){d(),o.pop()?.element.remove(),e.onChange()},freeze(){d(),t.setAttribute(`frozen`,``),i.setAttribute(`data-frozen`,``),Object.assign(i.style,{left:`${scrollX}px`,top:`${scrollY}px`,width:`${innerWidth}px`,height:`${innerHeight}px`,cursor:``})},remove(){removeEventListener(`keydown`,p,!0),l&&=(l.input.removeEventListener(`blur`,d),void 0),t.remove()}}}function TG(){for(let e of[document.documentElement,document.body]){let t=e?getComputedStyle(e).backgroundColor:``;if(t&&t!==`transparent`&&!/^rgba\(.*,\s*0\)$/.test(t))return t}return`#ffffff`}function EG(e){return e.position!==`static`||e.transform!==`none`||e.filter!==`none`||e.perspective!==`none`||/paint|layout|strict|content/.test(e.contain)||/transform|perspective|filter/.test(e.willChange)}function DG(e){for(let t=e.parentElement;t&&t!==document.documentElement;t=t.parentElement){if(EG(getComputedStyle(t)))return t;let e=t.parentElement;if(e&&(e.scrollTop||e.scrollLeft))return t}}function OG(e){let t=`data-vitehub-pin`,n=[],r=document.createTreeWalker(document.documentElement,NodeFilter.SHOW_ELEMENT);for(let t=r.nextNode();t;t=r.nextNode()){if(!(t instanceof HTMLElement)||e(t))continue;let r=getComputedStyle(t);if(r.position!==`fixed`&&r.position!==`sticky`||r.visibility===`hidden`)continue;let i=t.getBoundingClientRect();i.bottom<=0||i.right<=0||i.top>=innerHeight||i.left>=innerWidth||n.push({element:t,sticky:r.position===`sticky`,rect:i})}for(let e of n.filter(e=>e.sticky)){let t=e.element.getAttribute(`style`);e.element.style.setProperty(`position`,`static`,`important`),e.from=e.element.getBoundingClientRect(),e.element.style.removeProperty(`position`),e.element.getAttribute(`style`)!==t&&(t===null?e.element.removeAttribute(`style`):e.element.setAttribute(`style`,t))}return n.forEach((e,n)=>{if(!e.sticky){let t=DG(e.element),n=t?.getBoundingClientRect(),r=e.element.parentElement;e.left=e.rect.left-(t&&n?n.left+t.clientLeft:0)+(r?.scrollLeft??0),e.top=e.rect.top-(t&&n?n.top+t.clientTop:0)+(r?.scrollTop??0)}e.element.setAttribute(t,String(n))}),{apply(e){if(!(e instanceof HTMLElement)||!e.hasAttribute(t))return;let r=n[Number(e.getAttribute(t))];if(e.removeAttribute(t),!r)return;let i=(t,n)=>e.style.setProperty(t,n,`important`);for(let t of[`inset`,`right`,`bottom`,`margin-block-start`,`margin-block-end`,`margin-inline-start`,`margin-inline-end`])e.style.removeProperty(t);if(r.sticky&&r.from)i(`position`,`relative`),i(`left`,`${r.rect.left-r.from.left}px`),i(`top`,`${r.rect.top-r.from.top}px`);else{i(`position`,`absolute`),i(`left`,`${r.left}px`),i(`top`,`${r.top}px`),i(`width`,`${r.rect.width}px`),i(`height`,`${r.rect.height}px`),i(`margin`,`0`),i(`box-sizing`,`border-box`);for(let e of[`transform`,`translate`,`rotate`,`scale`])i(e,`none`)}},release(){for(let e of n)e.element.removeAttribute(t)}}}function kG(e){let t=new Map,n=``;for(let r of e.querySelectorAll(`[style]`)){if(r.namespaceURI!==`http://www.w3.org/1999/xhtml`||r.closest(`defs, symbol`))continue;let e=r.getAttribute(`style`),i=t.get(e);if(!t.has(e)){let a=``;for(let e=0;e<r.style.length;e++){let t=r.style.item(e),n=r.style.getPropertyValue(t);if(!n){a=void 0;break}a+=`${t}:${n}!important;`}i=a===void 0?void 0:`_s${t.size.toString(36)}`,t.set(e,i),i&&(n+=`.${i}{${a}}\n`)}i&&(r.removeAttribute(`style`),r.classList.add(i))}let r=e.firstElementChild;(r?.localName===`style`?r:e.insertBefore(document.createElement(`style`),r)).append(n)}async function AG(e,t){let n=OG(t);try{let{domToCanvas:r}=await ja(async()=>{let{domToCanvas:e}=await Promise.resolve().then(()=>(fG(),KH));return{domToCanvas:e}},[],import.meta.url),i=Math.min(devicePixelRatio||1,2),a=await r(document.documentElement,{width:innerWidth,height:innerHeight,scale:i,backgroundColor:TG(),filter:e=>!t(e),features:{restoreScrollPosition:!0},onCloneEachNode:e=>n.apply(e),onCreateForeignObjectSvg:kG,timeout:3e3}),o=a.getContext(`2d`);return o?(o.setTransform(i,0,0,i,0,0),CG(o,e),await new Promise(e=>a.toBlob(t=>e(t??void 0),`image/webp`,.85))):void 0}catch{return}finally{n.release()}}var jG,MG,NG,PG,FG,IG,LG,RG,zG,BG,VG=t((()=>{Ma(),jG={marker:{label:`Marker`,key:`B`,width:14},pen:{label:`Pen`,key:`P`,width:3},arrow:{label:`Arrow`,key:`A`,width:3},text:{label:`Text`,key:`T`,width:20}},MG={pink:`#ec4899`,amber:`#f59e0b`,blue:`#2563eb`,green:`#16a34a`},NG=`http://www.w3.org/2000/svg`,PG=e=>e.tip??`marker`,FG=e=>jG[PG(e)].width,IG=`600 ${jG.text.width}px ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif`,LG=`0 1px 1.5px rgb(0 0 0 / 30%)`,RG=`:host{position:absolute;left:0;top:0;width:0;height:0;z-index:2147482999}
161
+ :host([frozen]){z-index:2147482998}
162
+ .layer{position:fixed;inset:0;touch-action:none}
163
+ .layer[data-frozen]{position:absolute;pointer-events:none}
164
+ svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
165
+ path{fill:none;stroke-linecap:round;stroke-linejoin:round}
166
+ path.marker{stroke-width:${jG.marker.width}px;stroke-opacity:.4;stroke-linecap:butt;mix-blend-mode:multiply}
167
+ path.pen{stroke-width:${jG.pen.width}px}
168
+ path.arrow{stroke-width:${jG.arrow.width}px}
169
+ .label{filter:drop-shadow(${LG})}
170
+ .label text{font:${IG};white-space:pre}
171
+ input{position:fixed;z-index:1;box-sizing:border-box;margin:0;border:0;outline:0;font:${IG};caret-color:currentColor;box-shadow:${LG},0 0 0 2px rgb(255 255 255 / 90%)}`,zG=([e,t])=>`${e.toFixed(1)} ${t.toFixed(1)}`})),HG,UG,WG,GG,KG,qG,JG,YG=t((()=>{HG=`
172
+ [data-slot="comment-reply-status"] { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ui-text-muted); }
173
+ .delivery[data-failed] { color: var(--vh-error); }
174
+ `,UG=`
175
+ :host {
176
+ all: initial;
177
+ --ui-bg: #fff; --ui-bg-elevated: #f5f5f5; --ui-bg-accented: #e5e5e5; --ui-bg-muted: #fafafa; --ui-border: #e5e5e5;
178
+ --ui-text: #404040; --ui-text-muted: #737373; --ui-text-highlighted: #171717; --ui-text-inverted: #fff; --ui-primary: #171717;
179
+ }
180
+ :host(.dark) {
181
+ --ui-bg: #171717; --ui-bg-elevated: #262626; --ui-bg-accented: #404040; --ui-bg-muted: #1f1f1f; --ui-border: rgb(255 255 255 / 12%);
182
+ --ui-text: #e5e5e5; --ui-text-muted: #a3a3a3; --ui-text-highlighted: #fafafa; --ui-text-inverted: #171717; --ui-primary: #fafafa;
183
+ }
184
+ `,WG=`
185
+ ${UG}
186
+ .root { position: fixed; inset: 0; pointer-events: none; z-index: 2147482999; font-family: "Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
187
+ .root > * { pointer-events: auto; }
188
+ /* The comment layer covers the page. Only its parts and the comment mode overlay take the pointer, as @vite-hub/ui styles them. */
189
+ .root > .cursors, .root > .outlines, .root > .areas, .root > [data-slot="comment-layer"] { pointer-events: none; }
190
+ .avatar { width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #18181b; overflow: hidden; }
191
+ .avatar img { width: 100%; height: 100%; object-fit: cover; }
192
+
193
+ /* Each cursor moves to its next place with the list mover of the motion layer. */
194
+ .cursor { position: fixed; transform: translate(-2px, -2px); }
195
+ .cursor svg { display: block; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .25)); }
196
+ .cursor span { display: inline-block; margin: 2px 0 0 12px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #18181b; white-space: nowrap; box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
197
+
198
+ .outline { position: fixed; border: 2px solid var(--vh-comment-mark); border-radius: 4px; }
199
+ .outline[data-kind="draft"] { border-style: dashed; border-color: #f59e0b; }
200
+ .tag { position: fixed; transform: translateY(-100%); padding: 2px 6px; border-radius: 4px 4px 0 0; background: #f59e0b; color: #18181b; font-size: 11px; font-weight: 600; }
201
+ .outline[data-kind="hover"] + .tag { background: var(--vh-comment-mark); color: #fff; }
202
+
203
+ .card { position: fixed; left: 50%; bottom: 68px; translate: -50% 0; z-index: 2147483001; width: min(320px, calc(100vw - 32px)); display: grid; gap: 8px; padding: 12px; background: var(--vh-bg); color: var(--vh-text); border: 1px solid var(--vh-border); border-radius: calc(var(--vh-radius) * 1.5); box-shadow: 0 8px 24px rgb(0 0 0 / .16); font-size: 13px; }
204
+ .card label { display: grid; gap: 4px; font-weight: 500; }
205
+ .card input { font: inherit; color: inherit; background: var(--vh-bg-elevated); border: 1px solid var(--vh-border); border-radius: var(--vh-radius); padding: 6px 8px; }
206
+ .card input:focus-visible { outline: 2px solid var(--vh-ring); outline-offset: 0; }
207
+ @media (pointer: coarse) { .card input { font-size: 16px; } }
208
+ .card .row { display: flex; justify-content: flex-end; gap: 6px; }
209
+
210
+ /* The toast is the item of a notifications region, so the toast effect of the motion layer brings it in from the bottom edge. */
211
+ .toasts { position: fixed; left: 50%; bottom: 68px; translate: -50% 0; z-index: 2147483001; display: grid; justify-items: center; margin: 0; padding: 0; list-style: none; }
212
+ .toast { max-width: min(520px, calc(100vw - 32px)); padding: 8px 8px 8px 14px; background: var(--vh-bg); color: var(--vh-text); border: 1px solid var(--vh-border); border-radius: 12px; box-shadow: 0 8px 24px -6px rgb(0 0 0 / .16); display: flex; gap: 12px; align-items: center; font-size: 13px; text-wrap: pretty; }
213
+ .toast[data-kind="error"] { border-color: color-mix(in oklab, var(--vh-error) 45%, transparent); }
214
+ .toast a { color: var(--vh-primary); font-weight: 500; white-space: nowrap; text-underline-offset: 3px; }
215
+ .toast > span { padding: 4px 0; }
216
+
217
+ /*
218
+ * Where the pins go. Their look is Drop's, in @vite-hub/ui/comment-marks.css. A pin sits in the gutter right of a
219
+ * quote's block, level with its last line; at the corner of an area; at the point of a click. --pin-x and --pin-y place
220
+ * the pin's corner from the spot, and the card opens beside the pin, level with it, or under it near the right edge of
221
+ * the screen.
222
+ */
223
+ [data-slot="comment-layer-item"] { --pin-x: 0px; --pin-y: calc(var(--vh-comment-pin-size) * -1); }
224
+ [data-slot="comment-layer-item"][data-kind="text"] { --pin-x: 0px; --pin-y: calc(var(--vh-comment-pin-size) / -2); }
225
+ [data-slot="comment-layer-item"]:is([data-kind="area"], [data-kind="image"]) { --pin-x: calc(var(--vh-comment-pin-size) / -2); --pin-y: calc(var(--vh-comment-pin-size) / -2); }
226
+ /* The pin's own transform is its zoom and its active size, from comment-marks.css. */
227
+ [data-slot="comment-pin"] { touch-action: manipulation; translate: var(--pin-x) var(--pin-y); }
228
+ [data-kind="text"] > [data-slot="comment-pin"] { transform-origin: 0 50%; }
229
+ [data-slot="comment-pin"] [data-slot="avatar-stack"] { --vh-avatar-size: var(--vh-comment-pin-size); display: block; }
230
+ [data-slot="comment-pin"] [data-slot="avatar-stack-item"] {
231
+ border-radius: inherit; box-shadow: none; background: none; color: inherit; font: 600 11px/var(--vh-comment-pin-size) "Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .02em;
232
+ }
233
+ [data-slot="comment-pin-number"] { display: none; }
234
+ [data-slot="comment-pin"][data-draft="true"] { outline: none; }
235
+
236
+ /*
237
+ * --popover-width is the width the card wants. On a narrow screen it is the screen less 12px each side, and the card
238
+ * moves toward the middle so that no part of it goes off screen. --vh-comment-x is the x of the spot on the screen.
239
+ * A dark page hides the shadow, and a Nuxt UI page's \`.dark\` tokens also reach the host, so a card can have the page's
240
+ * color. The hairline keeps its edge in view: a new comment's bubble edge, else the border color.
241
+ */
242
+ [data-slot="comment-layer-popover"] {
243
+ --popover-width: 340px; --popover-room: min(var(--popover-width), calc(100vw - 24px));
244
+ --popover-side-left: calc(var(--pin-x) + 36px);
245
+ --popover-left: min(var(--popover-side-left), calc(100vw - 12px - var(--popover-room) - var(--vh-comment-x, 0px)));
246
+ left: var(--popover-left);
247
+ top: var(--pin-y); width: var(--popover-room); max-width: none;
248
+ border-radius: 6px 16px 16px 16px; box-shadow: 0 0 0 1px var(--vh-bubble-edge, var(--vh-border)), 0 8px 24px rgb(0 0 0 / .16), 0 1px 3px rgb(0 0 0 / .08);
249
+ }
250
+ [data-draft="true"] > [data-slot="comment-layer-popover"] { --popover-width: 300px; border-radius: 6px 18px 18px 18px; }
251
+ [data-draft="true"][data-kind="page"] > [data-slot="comment-layer-popover"] { --popover-left: var(--vh-comment-draft-left); }
252
+ [data-draft="true"]:not([data-flip-x="true"], [data-above="true"]) > [data-slot="comment-layer-popover"] {
253
+ --popover-side-left: calc(var(--pin-x) + var(--vh-comment-pin-size) + 8px);
254
+ --draft-clearance: calc(max(0, sign(var(--popover-side-left) - var(--popover-left))) * (var(--vh-comment-pin-size) + 8px));
255
+ top: calc(var(--pin-y) + var(--draft-clearance));
256
+ }
257
+ [data-slot="comment-layer-popover"][data-preview="true"] { --popover-width: 18rem; }
258
+ [data-slot="comment-layer-item"][data-flip-x="true"] > [data-slot="comment-layer-popover"] {
259
+ left: auto; right: clamp(calc(var(--vh-comment-x, 0px) + 12px - 100vw), calc(-28px - var(--pin-x)), calc(var(--vh-comment-x, 100vw) - var(--popover-room) - 12px)); top: calc(var(--pin-y) + 36px); border-radius: 16px 6px 16px 16px;
260
+ }
261
+ [data-slot="comment-layer-item"][data-flip-y="true"] > [data-slot="comment-layer-popover"] {
262
+ top: auto; bottom: calc(-28px - var(--pin-y)); border-radius: 16px 16px 16px 6px;
263
+ }
264
+ [data-slot="comment-layer-item"][data-flip-x="true"][data-flip-y="true"] > [data-slot="comment-layer-popover"] {
265
+ bottom: calc(8px - var(--pin-y)); border-radius: 16px 16px 6px 16px;
266
+ }
267
+ [data-draft="true"][data-flip-y="true"]:not([data-flip-x="true"], [data-above="true"]) > [data-slot="comment-layer-popover"] {
268
+ bottom: calc(var(--draft-clearance) - var(--vh-comment-pin-size) - var(--pin-y));
269
+ }
270
+ [data-slot="comment-layer-item"][data-above="true"] > [data-slot="comment-layer-popover"] {
271
+ top: auto; bottom: calc(var(--pin-y) * -1 + 4px); border-radius: 16px 16px 16px 6px;
272
+ }
273
+ [data-slot="comment-layer-popover"][data-floating="true"] { border-radius: 16px; }
274
+ /* The whole-page island has the cards' surface and shadow. */
275
+ [data-slot="comment-page-island-card"] { box-shadow: 0 0 0 1px var(--vh-border), 0 8px 24px rgb(0 0 0 / .16), 0 1px 3px rgb(0 0 0 / .08); }
276
+ /* The overlay places a card beside its pin itself, so it turns off the CSS anchor placement of @vite-hub/ui/styles.css. */
277
+ [data-slot="comment-layer-item"]:not([data-draft]) > [data-slot="comment-layer-popover"]:not([data-margin], [data-floating]) {
278
+ position: absolute; margin: 0; position-area: none; position-try-fallbacks: none;
279
+ }
280
+
281
+ /*
282
+ * On a touch screen the small buttons of a card, such as Resolve and Close, take a 44px hit area. The box's own toolbar
283
+ * already has one, and an attachment's trigger covers its attachment.
284
+ */
285
+ [data-slot="comment-layer-popover"] button { touch-action: manipulation; }
286
+ @media (pointer: coarse) {
287
+ [data-slot="comment-layer-popover"] button:not([data-slot="attachment-trigger"], [data-slot="prompt-input-toolbar"] button) { position: relative; }
288
+ [data-slot="comment-layer-popover"] button:not([data-slot="attachment-trigger"], [data-slot="prompt-input-toolbar"] button)::after {
289
+ content: ""; position: absolute; inset: min(0px, calc((100% - 44px) / 2));
290
+ }
291
+ }
292
+
293
+ /* The area that a drag in comment mode draws, as comment-marks.css draws it. The overlay is fixed to the screen. The
294
+ areas of threads are in their own root, under the page's floating controls (see areaStyles). */
295
+ [data-slot="comment-layer-area"] { position: fixed; }
296
+
297
+ /* The bar over selected text is CommentSelectionBar of @vite-hub/ui. The overlay places it over the text, or under it
298
+ near the top of the screen. The page's theme does not reach the shadow root, so the overlay draws the focus ring. */
299
+ .selection { position: fixed; z-index: 2147483001; translate: -50% -100%; }
300
+ .selection[data-below="true"] { translate: -50% 0; }
301
+ [data-slot="comment-selection-bar-action"]:focus-visible { outline: 2px solid var(--vh-inverted); outline-offset: 1px; }
302
+ ${HG}
303
+ `,GG=`
304
+ ${UG}
305
+ :host { display: block; height: 100%; color-scheme: light; }
306
+ :host(.dark) { color-scheme: dark; }
307
+ .panel-root { height: 100%; }
308
+ [data-slot="comment-panel"] { height: 100%; background: none; border: 0; container-type: inline-size; }
309
+ /* One row under the window's title: the filters on the left, the page's actions on the right. It never wraps. */
310
+ [data-slot="comment-panel-header"] { flex-wrap: nowrap; gap: 8px; padding: 6px 8px; }
311
+ /* In a window too narrow for the row, the filters scroll sideways and the actions keep their size. */
312
+ [data-slot="comment-panel-filters"] { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
313
+ [data-slot="comment-panel-filters"] > * { flex: none; }
314
+ [data-slot="comment-panel-actions"] { flex: none; flex-wrap: nowrap; }
315
+ [data-slot="comment-panel-header"] button, [data-slot="comment-panel-header"] a { white-space: nowrap; }
316
+ @container (max-width: 479px) {
317
+ [data-slot="comment-panel-actions"] [data-action="open-in-t3-code"] > span { display: none; }
318
+ }
319
+ @container (max-width: 299px) {
320
+ [data-slot="comment-panel-actions"] [data-action="copy-page-prompt"] > span:not([data-slot]) { display: none; }
321
+ }
322
+ ${HG}
323
+ `,KG=`
324
+ :host { font: inherit; color: inherit; color-scheme: inherit; }
325
+ /* The tones of a status in the dark pill, such as Send's Not delivered, Limit reached, and the Working dot. */
326
+ :host { --vitehub-pill-error: oklch(0.704 0.191 22.216); --vitehub-pill-warning: #fbbf24; --vitehub-pill-success: #34d399; }
327
+ /* The overlay's mount point sits between the segment and the toolbar. It passes the pill's alignment on, so items such as the avatars center like the buttons. */
328
+ :host > div { align-items: inherit; }
329
+ .toolbar { display: flex; flex-direction: var(--vitehub-pill-flow, row); align-items: inherit; gap: 2px; font-variant-numeric: tabular-nums; }
330
+ .toolbar svg { flex: none; }
331
+ .sep { width: 4px; height: 4px; flex: none; }
332
+ /* Comments and its eye stay one row, also when the pill docks to a side and stacks the other controls. */
333
+ .lead { display: flex; align-items: center; align-self: stretch; gap: 2px; }
334
+ .lead > :first-child { flex: 1 1 auto; }
335
+ .more { display: flex; flex-direction: inherit; align-items: inherit; gap: 2px; }
336
+ .more[hidden] { display: none; }
337
+ /* While Send pairs an agent, its message stands between dividers: 1px along the bar, across it on a side. */
338
+ [data-slot="comment-send"]:is([data-status="pairing"], [data-status="confirm"])::before,
339
+ [data-slot="comment-send"]:is([data-status="pairing"], [data-status="confirm"])::after { content: ""; flex: 0 0 1px; align-self: stretch; margin: 6px; background: var(--vitehub-pill-line); }
340
+ .count { min-width: 16px; padding: 0 4px; border-radius: 4px; background: var(--vitehub-pill-hover); font-size: 10px; line-height: 17px; text-align: center; }
341
+ button[aria-pressed="true"] .count, button[aria-expanded="true"] .count { display: none; }
342
+ /* The tips and the colors stay rows of square buttons, also when the pill docks to a side and stacks the other controls. */
343
+ .swatches { display: flex; gap: 2px; }
344
+ .swatch, .icon, .eye, .toggle { width: 28px; padding: 0; justify-content: center; }
345
+ .eye[data-comments-hidden="true"] { background: var(--vitehub-pill-on); color: var(--vitehub-pill-on-text); }
346
+ .toggle[aria-expanded="true"] .plus { rotate: 45deg; }
347
+ /* Open, the toggle keeps a plain fill, so its × does not look like a second pill close button. */
348
+ .toggle[aria-expanded="true"]:not(:hover) { background: none; color: inherit; }
349
+ /* Both labels share one cell, so the button and the pill keep their width when Copy prompt turns to Copied. */
350
+ .swap { display: inline-grid; justify-items: start; }
351
+ .swap > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 4px; }
352
+ .swap > [data-shown="false"] { visibility: hidden; }
353
+ .icon { align-self: flex-start; }
354
+ .swatch span { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 20%); }
355
+ .swatch[aria-pressed="true"] { background: var(--vitehub-pill-hover); box-shadow: inset 0 0 0 1.5px var(--vitehub-pill-strong); color: inherit; }
356
+ button.done:not(:disabled) { background: var(--vitehub-pill-on); color: var(--vitehub-pill-on-text); }
357
+ button:disabled { opacity: .45; cursor: default; }
358
+ .people { display: flex; padding: 0 2px; }
359
+ .avatar { width: 20px; height: 20px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; color: #18181b; overflow: hidden; }
360
+ .avatar img { width: 100%; height: 100%; object-fit: cover; }
361
+ .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--vitehub-pill-surface); }
362
+ img.me { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
363
+ `,qG=`
364
+ html.vitehub-edit-mode [data-content-field] { cursor: text !important; }
365
+ [data-vitehub-editing] { outline: 2px solid #2563eb !important; outline-offset: 2px; border-radius: 2px; }
366
+ `,JG=`
367
+ :host { all: initial; position: fixed; inset: 0; z-index: 1; pointer-events: none; }
368
+ `})),XG,ZG,QG,$G=t((()=>{xn(),XG={why:({message:e})=>e===void 0?``:String(e)},ZG={RUNTIME_R0001:{...XG,fix:"Pass `maxDepth` to `normalizeRuntimeDiagnosticError()` as an integer of 0 or more, or remove it to use the default."},RUNTIME_R0002:{...XG,fix:"Pass `maxErrors` to `normalizeRuntimeDiagnosticError()` as an integer of 1 or more, or remove it to use the default."},RUNTIME_R0003:{...XG,fix:"Pass `maxStringLength` to `normalizeRuntimeDiagnosticError()` as an integer of 64 or more, or remove it to use the default."},RUNTIME_R0004:{...XG,fix:"Read the logs of the process that `vitehub drain` waited for to find why its drain failed, then fix that failure and run `vitehub drain` again."},RUNTIME_R0005:{...XG,fix:"Read the logs of the process that the message names to find why it stopped, then start it again before you run `vitehub drain`."},RUNTIME_R0006:{...XG,fix:"Pass `new ViteHubError()` a nonempty `code` and `message` string within the length limits, and plain JSON `details`."},RUNTIME_R0007:{...XG,fix:"Give the execution authority a valid value for each of `credentials`, `environment`, `filesystem.access`, `filesystem.scope`, `isolation`, `network`, and `processes`."},RUNTIME_R0009:{...XG,fix:"Set `intervalMs` of the process reconciler to a number of milliseconds from 1 to 2147483647."},RUNTIME_R0010:{...XG,fix:"Give the process reconciler a `signal` other than `SIGKILL` or `SIGSTOP`, or set `signal: false`."},RUNTIME_R0011:{...XG,fix:"Call `drain()` of the process reconciler after its callback returns, not from inside the callback."},RUNTIME_R0015:{...XG,fix:"Pass the `Request` of a Fetchable handler, or the event of an H3 or Nitro route, to `getStandardContext()`."},RUNTIME_R0016:{...XG,fix:"Return the body or a `Response` from the handler, in place of setting `~standard.res.body`."},RUNTIME_R0017:XG,RUNTIME_R0018:XG,RUNTIME_CONSOLE_PATH_INVALID:{why:({value:e})=>`${e} is not a Console path. Use a path that starts with one /, such as /agents/<agent>.`,fix:"Pass `hostedConsoleUrl()` a Console path that starts with one `/`, such as `/kv` or `/agents/<agent>/invocations/<id>`."},RUNTIME_CONSOLE_PROJECT_URL_INVALID:{why:({value:e})=>`${e} is not a project URL. Use the https:// origin of the app, with its base path if it has one.`,fix:"Pass `hostedConsoleUrl()` the `https://` origin of the app, or `http://localhost` in development, with its base path and without a user name or password."},RUNTIME_DURATION_INVALID:{why:({option:e,value:t})=>`${e?`\`${e}\``:`The value`} is ${t}, which is not a duration. A duration is a string with a number of 0 or more and a unit, such as "30s", "5m", or "1 day".`,fix:({suggestion:e,unit:t=`milliseconds`,value:n})=>e?`Write the time as a string with a unit: ${n} ${t} is ${e}.`:'Write a number of 0 or more and one unit: `ms`, `s`, `m`, `h`, `d`, or `w`, or a long name such as `minutes` or `days`. For example `"30s"`, `"5m"`, or `"1 day"`.'},RUNTIME_EVENT_LOOP_WARNING_INVALID:{why:({value:e})=>`\`watchEventLoop()\` received \`afterMs: ${e}\`. The threshold must be a whole number of milliseconds of 100 or more.`,fix:"Pass a whole number of milliseconds of 100 or more, or omit `afterMs` to use the default of 10 000 ms."},RUNTIME_EXECUTION_BUDGET_AMOUNT_INVALID:{why:({counter:e})=>`[vitehub] Execution budget ${e} amount must be a finite non-negative number.`,fix:"Pass `consume()` and the `record*()` methods of the execution budget a finite number of 0 or more."},RUNTIME_EXECUTION_BUDGET_EXCEEDED:{why:({counter:e})=>`[vitehub] Execution budget exhausted for ${e}.`,fix:"Raise the `executionBudget` limit that `error.counter` names, such as `maxToolCalls`, `maxRetries`, `maxInputBytes`, or `maxOutputBytes`, or give the run less work."},RUNTIME_EXECUTION_BUDGET_LIMIT_INVALID:{why:()=>`[vitehub] Execution budget limits must be finite non-negative numbers.`,fix:"Set each limit of `executionBudget`, such as `maxToolCalls` or `maxOutputBytes`, to a finite number of 0 or more, or remove it."},RUNTIME_HIDDEN_ERROR:{why:()=>`The server failed. The error is not a ViteHub error, so its message and stack stay on the server.`,fix:"Read the server logs for the error. To send a code, a why, and a fix to the client, return a `ResultError` from `defineErrors()` and pass it to `toResponse()`."},RUNTIME_PUBLIC_URL_INVALID:{why:()=>"`VITEHUB_PUBLIC_URL` must be an http or https origin without a path.",fix:"Set `VITEHUB_PUBLIC_URL` on the server to the origin that serves the app, such as `https://shop.example.com`, with no path, query, or user name. Then restart or deploy the server."},RUNTIME_SERIALIZED_RESPONSE_INVALID:{why:()=>`Invalid serialized Response`,fix:"Pass `deserializeResponse()` the record that `serializeResponse()` returned, unchanged. Check it first with `isSerializedResponse()`."}},QG=_n({docsBase:`https://vitehub.dev/docs/runtime/diagnostics`,codes:ZG})}));function eK(){throw QG.RUNTIME_R0006({message:`[vitehub] ViteHubError requires a valid public error contract.`})}function tK(e){try{return Array.isArray(e)}catch{eK()}}function nK(e,t,n=!1){try{let r=Object.getOwnPropertyDescriptor(e,t);return r===void 0?void 0:((!(`value`in r)||n&&!r.enumerable)&&eK(),r.value)}catch{eK()}}function rK(e,t,n,r){if(t.nodes+=1,t.nodes>lK&&eK(),e===void 0&&r)return;if(e===null||typeof e==`boolean`||typeof e==`string`&&e.length<=uK||typeof e==`number`&&Number.isFinite(e))return e;(typeof e!=`object`||n>oK||t.ancestors.has(e))&&eK();let i,a;try{i=Object.getPrototypeOf(e),a=Reflect.ownKeys(e)}catch{eK()}t.ancestors.add(e);try{if(tK(e)){let r=nK(e,`length`);(!Number.isSafeInteger(r)||r<0||r>sK||a.length!==r+1||!a.includes(`length`))&&eK();let i=[];for(let o=0;o<r;o+=1){let r=String(o);a.includes(r)||eK(),i.push(rK(nK(e,r,!0),t,n+1,!1))}return Object.freeze(i)}i!==Object.prototype&&i!==null&&eK(),(a.length>sK||a.some(e=>typeof e!=`string`))&&eK();let r={};for(let i of a)(i.length===0||i.length>cK)&&eK(),Object.defineProperty(r,i,{enumerable:!0,value:rK(nK(e,i,!0),t,n+1,!0),writable:!0});return Object.freeze(r)}finally{t.ancestors.delete(e)}}function iK(e){if(e!==void 0)return(typeof e!=`object`||!e||tK(e))&&eK(),rK(e,{ancestors:new Set,nodes:0},0,!1)}function aK(e,t,n){(typeof e!=`string`||e.length===0||e.length>dK)&&eK(),(typeof t!=`string`||t.length===0||t.length>fK)&&eK(),(typeof n!=`object`||!n||tK(n))&&eK();let r=nK(n,`cause`),i=iK(nK(n,`details`)),a=nK(n,`requestId`);return a!==void 0&&(typeof a!=`string`||a.length===0||a.length>pK)&&eK(),{cause:r,code:e,details:i,message:t,name:`ViteHubError`,requestId:a,shape:Object.freeze({code:e,...i===void 0?{}:{details:i},message:t,name:`ViteHubError`,...a===void 0?{}:{requestId:a}})}}var oK,sK,cK,lK,uK,dK,fK,pK,mK,hK,gK=t((()=>{$G(),oK=8,sK=128,cK=128,lK=1024,uK=16384,dK=128,fK=16384,pK=256,mK=new WeakMap,hK=class extends Error{code;details;requestId;constructor(e,t,n={}){let r=aK(e,t,n);super(r.message,r.cause===void 0?void 0:{cause:r.cause}),this.name=`ViteHubError`,this.code=r.code,this.details=r.details,this.requestId=r.requestId;let i=this.toJSON.bind(this);Object.defineProperties(this,{code:{configurable:!0,enumerable:!0,value:r.code,writable:!1},details:{configurable:!0,enumerable:!0,value:r.details,writable:!1},message:{configurable:!0,enumerable:!1,value:r.message,writable:!1},name:{configurable:!1,enumerable:!1,value:r.name,writable:!1},requestId:{configurable:!0,enumerable:!0,value:r.requestId,writable:!1},toJSON:{configurable:!1,enumerable:!1,value:i,writable:!1}}),mK.set(this,r.shape)}toJSON(){let e=mK.get(this);if(e)return e;let t=aK(nK(this,`code`),nK(this,`message`),{details:nK(this,`details`),requestId:nK(this,`requestId`)});return mK.set(this,t.shape),t.shape}}}));function _K(e){return e!==null&&Object(e)===e}var vK=t((()=>{}));function yK(e){if(!_K(e))return!1;try{let t=Reflect.get(Error,`isError`);return typeof t==`function`?t(e)===!0:e instanceof Error||!(Symbol.toStringTag in e)&&Object.prototype.toString.call(e)===`[object Error]`}catch{return!1}}function bK(e){if(!yK(e))return!1;try{let t=Reflect.get(e,`message`),n=Reflect.get(e,`code`),r=Reflect.get(e,`name`),i=Reflect.get(e,`why`),a=Reflect.get(e,`fix`),o=Reflect.get(e,`docs`),s=Reflect.get(e,`sources`);return typeof n==`string`&&n.length>0&&typeof r==`string`&&typeof t==`string`&&i===t&&(a===void 0||typeof a==`string`)&&(o===void 0||typeof o==`string`)&&(s===void 0||Array.isArray(s)&&s.every(e=>typeof e==`string`))&&typeof Reflect.get(e,`toJSON`)==`function`}catch{return!1}}var xK=t((()=>{vK()}));function SK(e){let t=t=>{let n=Object.getOwnPropertyDescriptor(e,t);return n?n.configurable===!0:Object.isExtensible(e)},n=t(`name`)&&t(`toJSON`)&&(Object.hasOwn(e,wK)||Object.isExtensible(e))?e:new yn({code:e.code,why:e.why,fix:e.fix,docs:e.docs,cause:e.cause,data:e.data,sources:e.sources});if(n!==e){n.stack=e.stack;let t=Reflect.get(e,`status`);typeof t==`number`&&Object.defineProperty(n,"status",{configurable:!0,value:t})}return Object.defineProperty(n,"name",{configurable:!0,value:n.code,writable:!0}),Object.defineProperty(n,wK,{value:!0}),Object.defineProperty(n,"toJSON",{configurable:!0,value:()=>({code:n.code,docs:n.docs,fix:n.fix,name:n.name,why:n.why})}),n}function CK(e){let t=_n({codes:e.codes,docsBase:e.docs}),n=new Set(Object.keys(e.codes)),r=Object.defineProperty({},"is",{value:e=>bK(e)&&n.has(e.code)});for(let i of n){let n=t[i],a=e.codes[i]?.status;r[i]=Object.assign(e=>{let t=SK(n(e));return a!==void 0&&Object.defineProperty(t,"status",{configurable:!0,enumerable:!1,value:a}),t},{is:e=>bK(e)&&e.code===i})}return r}var wK,TK=t((()=>{xK(),xn(),wK=Symbol.for(`vitehub.runtime.resultError`)})),EK=t((()=>{gK(),TK()})),DK,OK=t((()=>{EK(),DK=CK({docs:`https://vitehub.dev/docs/realtime/diagnostics`,codes:{REALTIME_DISABLED:{why:({action:e})=>`Realtime is disabled, so \`${e}()\` cannot run.`,fix:"Set `enabled` to `true` on `useRealtimeTiptap()` before you call the method."},REALTIME_DISCONNECTED:{why:({action:e})=>`The realtime document disconnected or changed during \`${e}()\`.`,fix:"Call the method again after the new document connects. Read `synced` to know when it is ready."},REALTIME_INVALID_DOCUMENT:{why:({action:e})=>`The room body does not fit the editor schema, so \`${e}()\` did not write it. Writing it would lose content.`,fix:`Keep editing until the document fits the editor extensions of the Realtime Definition, then call the method again. The room keeps the edits.`},REALTIME_INVALID_RESPONSE:{why:({action:e})=>`The realtime server answered \`${e}()\` with a response that the client cannot use.`,fix:"Use the same `@vite-hub/realtime` version on the client and the server, and build again."},REALTIME_MISSING_DOCUMENT:{why:({action:e})=>`\`${e}()\` needs a document, and \`documentId\` is empty.`,fix:"Pass a document path to `useRealtimeTiptap(definition, documentId)` before you call the method."},REALTIME_READ_ONLY:{why:({action:e})=>`The room is read-only, so \`${e}()\` cannot write the document.`,fix:"Read `readOnlyReason` of `useRealtimeTiptap()` for the reason. Do not offer save or publish while it is set."},REALTIME_REQUEST_FAILED:{why:({action:e,message:t,status:n})=>`The realtime \`${e}()\` request failed${n===void 0?``:` with HTTP ${n}`}${t?`: ${t}`:`.`}`,fix:"Read `error.why` for the server message, `error.data.status` for the HTTP status, and `error.cause` for a network error. Retry when the server is available again.",data:({status:e})=>({status:e})},REALTIME_SOURCE_CHANGED:{why:({action:e})=>`The server refused \`${e}()\` because the stored document changed outside the room.`,fix:"Tell the person that the stored document changed. Use `onReset()` to detect a room reset and read unsaved edits from the event's `previous` document."},REALTIME_SYNC_PENDING:{why:({action:e})=>`The room did not receive every edit of this client in time, so \`${e}()\` did not run. The composable tried 20 times.`,fix:"Call the method again when `synced` is true. When it keeps failing, check that the WebSocket stays connected."},REALTIME_ROOM_ABORTED:{why:`The request to the room stopped because its signal aborted.`,fix:`Nothing to fix when the caller stopped on purpose, such as a cancelled Agent run. Call again to ask once more.`},REALTIME_ROOM_CROWDED:{why:({count:e})=>`${e} browsers are in the room, and a request goes to one browser only.`,fix:`Give each browser its own room, such as a random id for each tab, so that one browser answers.`},REALTIME_ROOM_ELSEWHERE:{why:`No browser in this instance is in the room. With Redis or Postgres, the browser can be connected to another instance, and requests reach only the browsers of the same instance.`,fix:`Route the browser and the caller to the same instance, such as with sticky sessions, or run one Node instance.`},REALTIME_ROOM_EMPTY:{why:`No browser is in the room. The page is closed, or it has not joined yet.`,fix:`Open the page again. The request waits a few seconds for a browser to join before it gives up.`},REALTIME_ROOM_REFUSED:{why:({reason:e})=>`The browser could not answer: ${e}`,fix:"Read the reason. Add `room.onRequest(handler)` on the page, and keep each answer under 1 MiB."},REALTIME_ROOM_REQUESTS_OFF:{why:({definition:e})=>`The Realtime Definition "${e}" does not take requests.`,fix:'Define it with `defineRealtime({ access: "public", document: false, requests: true })`.'},REALTIME_ROOM_TIMEOUT:{why:({timeout:e})=>`The browser did not answer in ${e/1e3} seconds.`,fix:"Make the page answer sooner, or pass a longer `timeout` to `requestRealtimeRoom()`."},REALTIME_AWARENESS_OWNERSHIP_CONFLICT:{why:`A realtime awareness client id belongs to another peer.`,fix:`Let each editor tab use its own Yjs awareness client. Do not reuse a client id on two connections.`},REALTIME_AWARENESS_TOO_LARGE:{why:`Realtime awareness state exceeds the 8 MiB room quota.`,fix:`Keep less data in awareness state. Store large values in the document or in Workspace.`},REALTIME_DOCUMENT_TOO_LARGE:{why:`The realtime document exceeds the 8 MiB room quota.`,fix:`Split the document into smaller documents, or keep large assets in Workspace or Blob.`},REALTIME_INVALID_AWARENESS:{why:`A realtime awareness update has a state that is not a plain object.`,fix:"Set awareness state to a plain object, for example `awareness.setLocalStateField('user', { name })`."},REALTIME_TOO_MANY_AWARENESS_CLIENTS:{why:`One realtime peer sent more than 1,024 awareness clients.`,fix:`Use one awareness client for each editor tab.`},REALTIME_ROOM_WRITE_CONFLICT:{why:`Realtime room record compare-and-set failed.`,fix:`Connect again. Another Realtime instance changed the room at the same time. If it keeps failing, check that every instance uses the same Realtime bus.`},REALTIME_WRITE_REJECTED:{why:({problem:e,readOnly:t})=>e===`missing-state`?`Realtime update depends on state this room does not have.`:e===`status`?`Realtime document status is written by the server.`:t??`This realtime connection is read-only.`,fix:"Write only through a writable connection, and do not change the `status` map, which the server writes. A client that misses room state connects again to sync it."},REALTIME_DOCUMENT_CONFLICT:{why:({problem:e})=>e??`The stored document changed since the realtime room loaded it.`,fix:"Realtime re-seeds the room from the stored document. Listen to `onReset()` to recover text that the room did not save."},REALTIME_BLOB_ETAG_MISSING:{why:({pathname:e})=>`The Blob store returned no \`httpEtag\` for ${e}, so \`blobDocument()\` cannot save the file only if it is unchanged.`,fix:"Pass a ViteHub Blob store, such as `blob` from `vite-hub/blob`, whose `head()` returns `httpEtag` on every driver. A store of your own must return `httpEtag` from `head()` and accept `ifMatch` in `put()`."},REALTIME_INVALID_PERSISTENCE:{why:({name:e,reason:t})=>t===`below-debounce`?"Realtime `persistence.maxWait` must be at least `persistence.debounce`.":`Realtime \`persistence.${e}\` must be a non-negative number of milliseconds.`,fix:"Set `persistence: { debounce: 2_000, maxWait: 10_000 }`, or remove the option to use these defaults."},REALTIME_MISSING_ACCESS:{why:`The Realtime definition sets no access rule, so it does not say who can read and write its rooms.`,fix:'Set `authorize: true` to require a signed-in user, set `authorize()` to decide each request, or set `access: "public"` to let anyone read and write.'},REALTIME_INVALID_ACCESS:{why:({reason:e})=>e===`auth`?"The Realtime definition sets `auth`. Realtime replaced it with `authorize: true`, and an `authorize()` callback now also runs for signed-out callers.":e===`public-with-rule`?'The Realtime definition sets `access: "public"` together with `authorize`, so its access rule is not clear.':e===`not-public`?'The Realtime definition sets `access` to a value other than "public".':e===`not-authorize`?"The Realtime definition sets `authorize` to a value that is not `true` or a function.":"The Realtime definition sets `origins()` with `authorize: true` and no `identify()`. Only the Auth trusted-origin policy can allow a different origin to use the ViteHub Auth session.",fix:({reason:e})=>e===`auth`?"Replace `auth: true` with `authorize: true`. With an `authorize()` callback, remove `auth` and return `false` from the callback when `user` is `null`.":e===`origins-without-identify`?"Remove `origins()`, or add `identify()` that reads a credential the page sends on purpose, such as a ticket in `params`.":e===`not-authorize`?"Set `authorize: true` to require a signed-in user, or set `authorize()` to a function that returns `true` to allow.":'Use `access: "public"` alone for open rooms. To limit access, remove `access` and set `authorize`.'},REALTIME_CHECKPOINT_UNSUPPORTED:{why:"The Realtime definition sets `history.checkpoint`, but its document adapter has no `checkpoint()` method, so `history.checkpoint()` could never run.",fix:"Add `checkpoint(context, { digest, message, user })` to the document adapter, use `document: { workspace }`, or remove `history`."},REALTIME_INVALID_USER:{why:"The realtime identity needs a user `id` that is a non-empty string of at most 256 characters.",fix:"Return a user with an `id` from the Auth session or from `authorize()`."},REALTIME_MISSING_DIGEST:{why:({operation:e})=>e===`save`?`Realtime saves need Workspace file digests, and the Workspace Store did not return one.`:`Realtime checkpoints need a stored document, and the save returned no digest.`,fix:"Use a Workspace Store that returns file digests, or return `digest` from the document adapter `save()`."},REALTIME_INVALID_POSTGRES_URL:{why:"REALTIME_POSTGRES_URL is set, and it is not a `postgres://` or `postgresql://` URL.",fix:`Set REALTIME_POSTGRES_URL to a Postgres URL, or remove it so that Realtime uses the connection of the Default Database.`},REALTIME_MISSING_BUS_CONNECTION:{why:({driver:e})=>e===`redis`?`Realtime driver "redis" shares rooms through Redis, and REDIS_URL and a Redis KV_URL are not set.`:`Realtime driver "postgres" needs REALTIME_POSTGRES_URL or a Default Database that uses postgres.js.`,fix:'Set REDIS_URL for Redis. For Postgres, set REALTIME_POSTGRES_URL or use a Default Database with `dialect: "postgresql"` and no `driver` override. A Default Database with `driver: "node-postgres"` needs a separate REALTIME_POSTGRES_URL for the Postgres bus.'},REALTIME_MISSING_SHARED_BUS:{why:`This host runs each request in one of many function instances. Realtime must use Redis or Postgres to share rooms, but it found no bus connection.`,fix:'Set REDIS_URL, a Redis KV_URL, or REALTIME_POSTGRES_URL. Realtime can also use the Default Database with `dialect: "postgresql"` and no `driver` override.'},REALTIME_ROOM_LOCK_TIMEOUT:{why:`Realtime waited 30 seconds for the save lock of a room, and another instance still holds it.`,fix:"Make the document adapter `save()` finish in less than 30 seconds. Realtime tries the save again."},REALTIME_DRIVER_CONFLICT:{why:({driver:e,host:t})=>e===`memory`?`Realtime driver "memory" is single-process only, and the ${t} host runs more than one process.`:e===`cloudflare`?`Realtime driver "cloudflare" does not work with the ${t} host.`:`Realtime driver "${e}" needs a Node.js server, and the ${t} host does not run one.`,fix:'Set `realtime.driver` to "cloudflare" with a Cloudflare host. With the Node host, use "auto", "postgres", "redis", or "memory". With the Vercel host, use "auto", "postgres", or "redis".'},REALTIME_MISSING_DRIVER:{why:`Realtime production builds need one room driver, and ViteHub cannot select one for this deployment.`,fix:`Deploy with a Cloudflare host to use Durable Objects, or with the Node or Vercel host to share rooms through Postgres or Redis.`},REALTIME_RENAMED_AUTHORITY_KEY:{why:({value:e})=>`\`realtime.authority\` is ${e}. ViteHub renamed this key to \`driver\`, and it does not read \`authority\`, so Realtime would not use the driver you chose.`,fix:({value:e})=>`Set \`realtime: { driver: ${e} }\`, or run \`npx @vite-hub/codemods driver-key\` to rename it in every config file.`}}})})),kK=t((()=>{})),AK,jK,MK,NK,PK,FK,IK=t((()=>{AK=Math.floor,jK=Math.abs,MK=(e,t)=>e<t?e:t,NK=(e,t)=>e>t?e:t,Number.isNaN,PK=Math.pow,FK=e=>e===0?1/e<0:e<0})),LK,RK,zK,BK=t((()=>{IK(),LK=2**53-1,RK=-(2**53-1),zK=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&AK(e)===e),Number.isNaN,Number.parseInt})),VK,HK=t((()=>{VK=()=>new Set})),UK,WK,GK,KK,qK,JK,YK,XK=t((()=>{UK=e=>e[e.length-1],WK=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},GK=Array.from,KK=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},qK=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},JK=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},YK=Array.isArray})),ZK,QK,$K,eq,tq,nq,rq,iq,aq,oq,sq,cq,lq=t((()=>{XK(),ZK=String.fromCharCode,String.fromCodePoint,ZK(65535),QK=e=>e.toLowerCase(),$K=/^\s*/g,eq=e=>e.replace($K,``),tq=/([A-Z])/g,nq=(e,t)=>eq(e.replace(tq,e=>`${t}${QK(e)}`)),rq=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},iq=typeof TextEncoder<`u`?new TextEncoder:null,aq=e=>iq.encode(e),oq=iq?aq:rq,sq=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}),sq&&sq.decode(new Uint8Array).length===1&&(sq=null),cq=(e,t)=>JK(t,()=>e).join(``)})),uq,dq,fq,pq=t((()=>{uq=e=>Error(e),dq=()=>{throw uq(`Method unimplemented`)},fq=()=>{throw uq(`Unexpected case`)}})),mq,hq,gq,_q,vq,yq,bq,Q,xq,Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq=t((()=>{IK(),BK(),kK(),lq(),XK(),mq=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},hq=()=>new mq,gq=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},_q=e=>{let t=new Uint8Array(gq(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},vq=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(NK(n,t)*2),e.cpos=0)},yq=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},bq=yq,Q=(e,t)=>{for(;t>127;)yq(e,128|127&t),t=AK(t/128);yq(e,127&t)},xq=(e,t)=>{let n=FK(t);for(n&&(t=-t),yq(e,(t>63?128:0)|(n?64:0)|63&t),t=AK(t/64);t>0;)yq(e,(t>127?128:0)|127&t),t=AK(t/128)},Sq=new Uint8Array(3e4),Cq=Sq.length/3,wq=(e,t)=>{if(t.length<Cq){let n=iq.encodeInto(t,Sq).written||0;Q(e,n);for(let t=0;t<n;t++)yq(e,Sq[t])}else Oq(e,oq(t))},Tq=(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;Q(e,r);for(let t=0;t<r;t++)yq(e,n.codePointAt(t))},Eq=iq&&iq.encodeInto?wq:Tq,Dq=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=MK(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(NK(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},Oq=(e,t)=>{Q(e,t.byteLength),Dq(e,t)},kq=(e,t)=>{vq(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},Aq=(e,t)=>kq(e,4).setFloat32(0,t,!1),jq=(e,t)=>kq(e,8).setFloat64(0,t,!1),Mq=(e,t)=>kq(e,8).setBigInt64(0,t,!1),Nq=new DataView(new ArrayBuffer(4)),Pq=e=>(Nq.setFloat32(0,e),Nq.getFloat32(0)===e),Fq=(e,t)=>{switch(typeof t){case`string`:yq(e,119),Eq(e,t);break;case`number`:zK(t)&&jK(t)<=2147483647?(yq(e,125),xq(e,t)):Pq(t)?(yq(e,124),Aq(e,t)):(yq(e,123),jq(e,t));break;case`bigint`:yq(e,122),Mq(e,t);break;case`object`:if(t===null)yq(e,126);else if(YK(t)){yq(e,117),Q(e,t.length);for(let n=0;n<t.length;n++)Fq(e,t[n])}else if(t instanceof Uint8Array)yq(e,116),Oq(e,t);else{yq(e,118);let n=Object.keys(t);Q(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];Eq(e,i),Fq(e,t[i])}}break;case`boolean`:yq(e,t?120:121);break;default:yq(e,127)}},Iq=class extends mq{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Q(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},Lq=e=>{e.count>0&&(xq(e.encoder,e.count===1?e.s:-e.s),e.count>1&&Q(e.encoder,e.count-2))},Rq=class{constructor(){this.encoder=new mq,this.s=0,this.count=0}write(e){this.s===e?this.count++:(Lq(this),this.count=1,this.s=e)}toUint8Array(){return Lq(this),_q(this.encoder)}},zq=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);xq(e.encoder,t),e.count>1&&Q(e.encoder,e.count-2)}},Bq=class{constructor(){this.encoder=new mq,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(zq(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return zq(this),_q(this.encoder)}},Vq=class{constructor(){this.sarr=[],this.s=``,this.lensE=new Rq}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new mq;return this.sarr.push(this.s),this.s=``,Eq(e,this.sarr.join(``)),Dq(e,this.lensE.toUint8Array()),_q(e)}}})),Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ=t((()=>{kK(),IK(),BK(),lq(),pq(),Uq=uq(`Unexpected end of array`),Wq=uq(`Integer out of Range`),Gq=(e,t,n)=>{if(t<0||n<0||t+n>e.length)throw Uq;return new Uint8Array(e.buffer,e.byteOffset+t,n)},Kq=(e,t,n)=>{if(t<0||n<0||t+n>e.length)throw Uq;return new DataView(e.buffer,e.byteOffset+t,n)},qq=class{constructor(e){this.arr=e,this.pos=0}},Jq=e=>new qq(e),Yq=e=>e.pos!==e.arr.length,Xq=(e,t)=>{let n=Gq(e.arr,e.pos,t);return e.pos+=t,n},Zq=e=>Xq(e,$q(e)),Qq=e=>e.arr[e.pos++],$q=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>LK)throw Wq}throw Uq},eJ=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>LK)throw Wq}throw Uq},tJ=e=>{let t=$q(e);if(t===0)return``;{let n=String.fromCodePoint(Qq(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Qq(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},nJ=e=>sq.decode(Zq(e)),rJ=sq?nJ:tJ,iJ=(e,t)=>{let n=Kq(e.arr,e.pos,t);return e.pos+=t,n},aJ=e=>iJ(e,4).getFloat32(0,!1),oJ=e=>iJ(e,8).getFloat64(0,!1),sJ=e=>iJ(e,8).getBigInt64(0,!1),cJ=[e=>void 0,e=>null,eJ,aJ,oJ,sJ,e=>!1,e=>!0,rJ,e=>{let t=$q(e),n={};for(let r=0;r<t;r++){let t=rJ(e);n[t]=lJ(e)}return n},e=>{let t=$q(e),n=[];for(let r=0;r<t;r++)n.push(lJ(e));return n},Zq],lJ=e=>cJ[127-Qq(e)](e),uJ=class extends qq{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),this.count=Yq(this)?$q(this)+1:-1),this.count--,this.s}},dJ=class extends qq{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=eJ(this);let e=FK(this.s);this.count=1,e&&(this.s=-this.s,this.count=$q(this)+2)}return this.count--,this.s}},fJ=class extends qq{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=eJ(this),t=e&1;this.diff=AK(e/2),this.count=1,t&&(this.count=$q(this)+2)}return this.s+=this.diff,this.count--,this.s}},pJ=class{constructor(e){this.decoder=new dJ(e),this.str=rJ(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}})),hJ,$,gJ,_J=t((()=>{xn(),hJ={why:({message:e})=>e===void 0?``:String(e)},$=e=>({...hJ,fix:e}),gJ=_n({docsBase:`https://vitehub.dev/docs/workspace/diagnostics`,codes:{WORKSPACE_CONFLICT:{...hJ,fix:({conditionalRemovalUnsupported:e})=>e?"Use a Store that supports conditional removal to keep the `ifDigest` check. Remove a file without `ifDigest` only if you intend to delete it even if it changed since you read it.":"Another write changed the file or ref after you read it. Read it again, apply your change to the new content, and retry with its new digest in `ifDigest` or its new head in `ifHead`. For a merge conflict or a publish that is in progress, do the step that the message names first."},WORKSPACE_FORBIDDEN:{why:`An Agent may not write past an edit lease that a person holds.`,fix:`Tell the person you work for who is editing the files, and try again after they finish. A developer allows overrides with operations({ overrideLeases: true }).`},WORKSPACE_HISTORY_FAILED:{why:({workspace:e})=>`The history operation of Workspace "${e}" failed.`,fix:"Read `error.cause` for the Store error. Check that the Store of the Workspace is reachable, then retry."},WORKSPACE_HISTORY_INVALID:{why:({problem:e})=>e===`empty-commit`?"The commit has no changes. Pass `put` or `delete`.":`The cursor belongs to one ref. Pass the same ref.`,fix:"Pass `put` or `delete` to `workspace.commit`, and pass a `cursor` only with the `ref` of the `workspace.history` call that returned it."},WORKSPACE_NOT_FOUND:{why:({id:e,path:t,problem:n,workspace:r})=>({path:`Revision ${e} has no path "${t}".`,revision:`The Workspace has no revision "${e}". Pull again without a base revision.`,target:`Workspace "${r}" has no ref or revision "${e}". Run \`vitehub workspace refs ${r}\` to list refs.`,workspace:`Unknown Workspace: ${r}.`})[n],fix:"Check the Workspace name, the ref or revision, and the path. `vitehub workspace refs <workspace>` lists the refs, and `vitehub workspace get <workspace> <ref>` lists the files. When a base revision is gone, pull again without it."},WORKSPACE_PATH_INVALID:{why:({path:e,problem:t})=>t===`reserved`?`The Workspace path ${e} uses a reserved name. ViteHub keeps \`.git\` at any depth for Git and \`.vitehub\` at the root for its own data. It also reserves their NTFS short names \`git~N\` and \`vitehu~N\`.`:`The Workspace path ${e} is not a relative path inside the Workspace root. It is empty or absolute, starts with a drive letter, has a NUL byte, or has a \`.\` or \`..\` part.`,fix:({problem:e})=>e===`reserved`?"Rename the file or folder, for example `.git/config` to `git/config`. No part of a Workspace path can be `.git` or `git~1`, and the first part cannot be `.vitehub` or `vitehu~1`.":"Pass a relative path inside the Workspace, for example `docs/guide.md`. Remove a leading `/` or drive letter, NUL bytes, and `.` or `..` parts. `error.details.path` has the path that the Workspace rejected."},WORKSPACE_SOURCE_READ_ONLY:{why:({path:e,source:t})=>t===void 0?`The Workspace path "${e}" belongs to a Source. Source paths are read-only: a write, removal, or move cannot change them.`:`The Workspace path "${e}" belongs to Source "${t}". Source paths are read-only: a write, removal, or move cannot change them.`,fix:"Write the file outside the Source mount, for example under `drafts/`. To change a Source file, change it where the Source reads it, such as its GitHub repository, its URL, or its local files. For a Source with `sync: true`, run `workspace.sync({ sources: ['handbook'] })` with its Source key in place of `handbook`."},WORKSPACE_CHECKOUT_CONFLICT:{why:({conflicted:e,workspace:t})=>`Workspace "${t}" has unresolved conflicts: ${e}.`,fix:"Edit each file and remove the conflict markers, or run `vitehub resolve` for a binary file. Then push again."},WORKSPACE_CHECKOUT_DIR:{why:({dir:e,workspace:t})=>e===void 0?`Workspace "${t}" is not checked out yet.`:`The checkout folder "${e}" must be a folder inside the project, not the project root.`,fix:"Pass `--dir` with a folder inside the project, such as `vitehub pull <workspace> --dir content`."},WORKSPACE_CHECKOUT_FAILED:{why:({message:e})=>e,fix:"Read the message. Run `vitehub status` to see the state of the checkout, then run the command again."},WORKSPACE_CHECKOUT_MISSING:{why:({workspace:e})=>e===void 0?`vitehub.lock has no checked-out Workspace.`:`Workspace "${e}" is not checked out.`,fix:"Run `vitehub pull <workspace> --dir <folder>` first."},WORKSPACE_CHECKOUT_OPTIONS:{why:({actual:e,expected:t,key:n,workspace:r})=>r===void 0?`This checkout uses ${t}, not "${e}".`:`Workspace "${r}" is checked out with ${n} "${t}", not "${e}".`,fix:"Edit `vitehub.lock` to change the `dir` or `ref` of the entry. To change the remote, remove the entry from `vitehub.lock` and pull into a new folder."},WORKSPACE_CHECKOUT_OVERLAP:{why:({dir:e,other:t,otherDir:n,workspace:r})=>`Workspace "${r}" folder "${e}" overlaps Workspace "${t}" folder "${n}".`,fix:`Use separate checkout folders that do not contain one another.`},WORKSPACE_CHECKOUT_PATH:{why:({other:e,path:t,problem:n})=>({excluded:`The path "${t}" is excluded from the checkout.`,"not-portable":`The path "${t}" has a component that is not portable between file systems.`,"not-relative":`The remote path "${t}" is not a relative Workspace path.`,reserved:`The top-level file name "${t}" is reserved by the operation input map.`,spelling:`The checkout paths "${e}" and "${t}" use different spellings for one file-system path, or replace a file with a directory.`})[n],fix:"Rename the path to a portable name that the checkout does not exclude, before you pull or push it. For two spellings of one path, rename one. For a file that a folder replaces, keep local edits elsewhere, remove the `vitehub.lock` entry, and pull into a new empty folder."},WORKSPACE_CHECKOUT_SYMLINK:{why:({path:e})=>e===`vitehub.lock`?`vitehub.lock is a symbolic link. A checkout reads and writes only a real lock file.`:`${e} is a symbolic link. A checkout reads and writes only real files and folders.`,fix:`Replace the symbolic link with a real folder or file, then try again.`},WORKSPACE_CHECKOUT_TOO_LARGE:{why:({largest:e,limit:t,size:n,workspace:r})=>`The push of Workspace "${r}" is ${n}, over the ${t} limit of one push.${e?` Largest files: ${e}.`:``}`,fix:`A push is one revision and sends each changed file whole, with binary files in base64. Keep large media in Blob, or add new files in smaller groups with a push after each group.`},WORKSPACE_CHECKOUT_USAGE:{why:({command:e,flag:t,problem:n})=>({flag:`Unknown flag --${t}.`,names:`${e} accepts at most one Workspace name.`,value:`--${t} needs a value.`})[n],fix:"Pass only the flags of the command, each with its value, and at most one Workspace name, for example `vitehub pull docs --dir content`."},WORKSPACE_LOCK_BUSY:{why:`Another vitehub command is writing vitehub.lock: vitehub.lock.lock exists.`,fix:"Wait for that command to finish and try again. If no vitehub command runs, delete `vitehub.lock.lock`."},WORKSPACE_LOCK_INVALID:{why:({problem:e})=>e===`json`?`vitehub.lock is not valid JSON.`:"vitehub.lock has no `version: 1` and `workspaces` object.",fix:"Fix the conflict in `vitehub.lock`, or delete the entry and pull again."},WORKSPACE_RENAMED_STORE_PROVIDER_KEY:{why:({provider:e})=>`The Workspace \`store\` sets \`provider: ${e}\`. ViteHub renamed this key to \`driver\`, and it does not read \`provider\`, so the Store would not be the one you chose.`,fix:({driver:e})=>`Set \`store: { driver: ${e} }\`, or run \`npx @vite-hub/codemods driver-key\` to rename it in every config file.`},WORKSPACE_RENAMED_STORE_REPOSITORY_KEY:{why:()=>"The GitHub Workspace `store` sets `repository`. ViteHub renamed this key to `repo`, and it does not read `repository`, so the Store would use `VITEHUB_WORKSPACE_GITHUB_REPOSITORY` or no repository.",fix:()=>'Rename `repository` to `repo` in `store: { driver: "github" }`, or run `vitehub migrate` to rename it in every file.'},WORKSPACE_UNKNOWN_STORE_DRIVER:{why:({driver:e,renamed:t})=>t?`The Workspace \`store.driver\` is ${e}. ViteHub renamed this driver to "${t}", and it does not read ${e}.`:`The Workspace \`store.driver\` ${e} is not a Workspace Store driver.`,fix:({renamed:e})=>e?`Set \`store: { driver: "${e}" }\`, or run \`npx @vite-hub/codemods driver-key\` to rename it in every config file.`:'Set `store.driver` to "local", "memory", "github", "cloudflare", or "vercel", or pass a Store object.'},WORKSPACE_DEFAULT_REF_DELETE:{why:"`history.deleteRef()` cannot delete `main` or the ref that the Workspace working tree follows.",fix:"Delete another ref, such as the ref of one run. To remove files from the working ref, commit without them. To remove the whole Workspace history, call `delete()` on the Blob + Database Store."},WORKSPACE_POSTGRES_HISTORY_SCHEMA_MISSING:{why:`The Postgres Database for this Workspace is missing its history catalog table.`,fix:"Apply the migrations for `workspaceHistorySchema` from `vite-hub/workspace/blob-database/postgres`. For a ViteHub Database, add the schema to its Definition and run `vitehub database generate` and `vitehub database migrate`. With PGlite, stop the dev server before running `vitehub database migrate` and start it again afterward, because only one process can open the local PGlite folder at a time."},WORKSPACE_REGISTRY_LOAD_FAILED:{why:({reason:e,workspace:t})=>`The module of Workspace "${t}" did not load: ${e}`,fix:"Read `error.cause` for the first error. Make sure that the module of the Workspace loads without errors and exports its Definition: the default export of a file in `server/workspaces/`, or the export that the Vite plugin names in its Workspace contribution. Then restart the dev server or build again."},WORKSPACE_STORE_IN_WORKER_MEMORY:{why:`At least one Workspace in this Cloudflare build uses the default Memory Store. It keeps the files that the app writes in the memory of the Worker isolate. The files are lost when the isolate stops, and other isolates do not see them. Sources still read from the bundle.`,fix:'Set `workspace: { store: { driver: "cloudflare" } }` in `vitehub()` to keep the files in Cloudflare Artifacts, or use `{ driver: "github" }`. To keep the memory Store on purpose, set `store: { driver: "memory" }`, and the build does not print this notice.'},WORKSPACE_SOURCE_ACCESS_FAILED:{why:({source:e,workspace:t})=>`Source "${e}" of Workspace "${t}" cannot reach its data with the credentials of the build. The deployed app would fail on its first read.`,fix:"Read `error.cause` for the response of the provider. For a GitHub Source, check that `repo` and `ref` exist and that the token of the build (`auth`, `VITEHUB_GITHUB_TOKEN`, or `gh auth token`) can read the repository. Then build again."},WORKSPACE_R0069:$("Use a Store with retained history: `createBlobDatabaseWorkspaceStore()` or the `github` Store. Open the Workspace with a scope that grants the complete Workspace, not selected paths."),WORKSPACE_R0070:$("Pass a `limit` from 1 to 100, and pass a `cursor` only with the `ref` of the `history.list()` call that returned it."),WORKSPACE_R0071:$("Use a ref name with up to 128 letters, numbers, `_`, and `-`, joined by single `.` or `/`, for example `draft` or `team/review`. In a GitHub Store with `refs`, use `published` or `draft`, not the branch name."),WORKSPACE_R0072:$("Set the `repo` option of the GitHub Store or `VITEHUB_WORKSPACE_GITHUB_REPOSITORY`, for example `owner/repo`. Set the `token` option or `VITEHUB_GITHUB_TOKEN`."),WORKSPACE_R0073:$("Make the commit message or metadata shorter, as the message says. Remove each `Vitehub-Metadata:` line from the message, and pass the values in the `metadata` option."),WORKSPACE_R0001:$("Pass the path of a file or folder in the Workspace, for example `docs/guide.md`. The Workspace root itself cannot be written, moved, or deleted."),WORKSPACE_R0002:$("Enable at least one operation in `createWorkspaceTools(workspace, { operations })`, for example `{ operations: { read: true } }`."),WORKSPACE_R0003:$('Get write tools from `useWorkspace(name, { mode: "write" }).tools.write()`. Do not pass the result of `useWorkspace()` to `createWorkspaceTools()`. Or remove `write` from `operations`.'),WORKSPACE_B0001:$("Export the Workspace Definition from the file, for example `export default defineWorkspace({ ... })`. For a contributed Workspace, set `definition.export` to the name of the export."),WORKSPACE_B0002:$("Use `defineWorkspace()` in `server/workspaces/<name>.ts`. Move the `defineAgent()` call to `server/agents/<name>/agent.ts`."),WORKSPACE_B0003:$(`Rename or remove one of the definitions that the message lists. Each Workspace name has one definition.`),WORKSPACE_B0004:$("Set `vitehub.workspaces` in the plugin to an array of `{ name, definition: { module, export? }, reason? }` entries, or to a function that returns one. Set `module` to an absolute path, a `file:` URL, or a package specifier."),WORKSPACE_B0005:$('Set the Cloudflare Artifacts Store in the `workspace` config, for example `vitehub({ workspace: { store: { driver: "cloudflare", binding: "WORKSPACE_ARTIFACTS", namespace: "vitehub" } } })`, and remove `store` from the Workspace Definition. Or remove the import that the build cannot load from the Definition file, so that the build can read its `store`.'),WORKSPACE_R0004:$("Put a value after the option, for example `--timeout 30000` or `--url http://localhost:5173`."),WORKSPACE_R0005:$("Pass a whole number of milliseconds from 1 to 2147483647, for example `--timeout 30000`."),WORKSPACE_R0006:$("Pass a whole number of milliseconds from 1 to 2147483647, for example `--timeout 30000`."),WORKSPACE_R0007:$("Remove the option. `vitehub workspace dev --help` lists the options."),WORKSPACE_R0008:$("Put a command after `exec`, for example `vitehub workspace dev docs exec ls`."),WORKSPACE_R0009:$("Put `exec` before the command, for example `vitehub workspace dev docs exec ls -la`. Or omit the command to open the interactive command loop."),WORKSPACE_C0001:$('Set `workspace` to an object, for example `workspace: { store: { driver: "memory" } }`, or to `false`.'),WORKSPACE_C0002:$("Remove the option. The `workspace` config accepts `assets`, `projectRoot`, `root`, and `store`."),WORKSPACE_R0015:$("Remove the option. `defineWorkspace()` accepts `bindings`, `commit`, `hooks`, `loaders`, `plugins`, `rootDir`, `rules`, `sourceRootDir`, `sources`, and `store`."),WORKSPACE_R0016:$("Pass an object to `defineWorkspace()`, for example `defineWorkspace({ sources: {} })`."),WORKSPACE_R0017:$("Remove `name` from the Workspace Definition. The file name sets the Workspace name, for example `server/workspaces/docs.ts` defines `docs`."),WORKSPACE_R0018:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0019:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0020:$("Use fewer and shorter glob patterns with fewer `{a,b}` and `*` parts, for example `docs/**/*.md` in place of a list of patterns."),WORKSPACE_R0021:$("Remove `name` from the Workspace Definition. The file name sets the Workspace name, for example `server/workspaces/docs.ts` defines `docs`."),WORKSPACE_R0022:$('Pass the Workspace name as a non-empty string, for example `registerWorkspace("docs", definition)` or `registerWorkspacePlugin("docs", plugin)`.'),WORKSPACE_R0023:$('Set `maxBytes` to a number of bytes or to a string such as `"512kb"` or `"10mb"`.'),WORKSPACE_R0024:$('Give each Workspace plugin a non-empty string `id`, for example `{ id: "my-plugin", rules }`.'),WORKSPACE_R0025:$("Declare the target as a `url()` Source in the Workspace Definition, and make the Source visible in the Workspace scope."),WORKSPACE_R0026:$("Use a Store that supports rebase: `github` or `cloudflare`. Or do not call `rebase()` on this Workspace."),WORKSPACE_R0027:$("Set another `binding` in the Workspace `store` options, or set `namespace` to the namespace that Wrangler config already has for that binding."),WORKSPACE_R0028:$(`The client closed the Workspace Dev connection before the command finished. Run the command again and keep the connection open.`),WORKSPACE_R0029:$("Give each Cloudflare Artifacts namespace its own `binding` in the Workspace `store` options."),WORKSPACE_R0033:$(`Run the operation again. If it fails again, check the Blob store of the project in the Vercel dashboard.`),WORKSPACE_R0034:$('Pass the Workspace name, for example `createWorkspacePreparation({ workspace: "docs" })`.'),WORKSPACE_R0035:$('Pass Source keys of the Workspace as non-empty strings, for example `sources: ["handbook"]`, or omit `sources`.'),WORKSPACE_R0036:$("Set `retryDelayMs` to a number of milliseconds from 0 to 2147483647, or omit it to use 10000."),WORKSPACE_R0037:$('Set `materialize: "startup"` on the Sources to prepare, or pass their keys in `sources`.'),WORKSPACE_R0038:$("Check each Source that the message names: its URL, repository, or files, and its credentials. Without `requireNonEmpty`, an empty Source is ready."),WORKSPACE_R0039:$("`stop()` cancelled this preparation. Call `start()` again to prepare the Workspace."),WORKSPACE_R0040:$("Pass a non-empty command, for example `vitehub workspace dev docs exec ls`."),WORKSPACE_R0041:$('Pass a Workspace name, or a Workspace from `useWorkspace(name, { mode: "write" })`, that can start a Workspace Session.'),WORKSPACE_R0042:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0043:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0044:$("Make sure that the Workspace Session host can run `readlink` and can read the path in the message."),WORKSPACE_R0045:$("Set `executionAuthority` on the Workspace Session host. Use `unknownExecutionAuthority` from `@vite-hub/runtime` when the host cannot describe it."),WORKSPACE_C0003:$("Rename the Source key to one file name without `/` and without a `.json` ending, for example `issues`. ViteHub keeps the request descriptor at `.vitehub/sources/<key>.json`."),WORKSPACE_C0004:$('Set `mount` on the Source to a folder, for example `mount: "docs"`, or set `probeKeys`. A Workspace Scope grant needs paths, and a Source at the root has none.'),WORKSPACE_C0005:$('Use a Source helper so that the Source kind is explicit, for example `github({ repo: "owner/name" })`, `url({ url, workspacePath: "issues.json" })`, or `file({ path: "README.md" })`. A `{ source: { ... } }` wrapper does not help, because ViteHub reads the options in it the same way.'),WORKSPACE_C0006:$('Pass `path` or `workspacePath` to `file()`, for example `file({ path: "README.md" })`.'),WORKSPACE_C0007:$('When the URL has a query, set `path` on the Source config, for example `{ url, path: "issues.json" }`. Or use the `url()` helper with `workspacePath: "issues.json"`.'),WORKSPACE_R0046:$("Set `workspacePath` on the `url()` Source to read the response as a file. A request-only Source answers only `curl` Source requests."),WORKSPACE_R0047:$("Read the `url()` Source at its `workspacePath`. The Source has no other file."),WORKSPACE_R0048:$(`Read this Source in an Agent Invocation. The Agent runs the resolver with the Invocation context before it reads the Source. Outside an Invocation, the Source has no files.`),WORKSPACE_R0049:$('Set `responseType` to `"json"` or `"text"`.'),WORKSPACE_R0050:$('Set `method` to `"GET"`, `"HEAD"`, or `"POST"`.'),WORKSPACE_R0051:$("Use `query` for a fixed query or `querySchema` for a query that the Agent sets. Remove the other one, and remove the query from `url` when you use `querySchema`."),WORKSPACE_R0052:$("Use `body` for a fixed body or `bodySchema` for a body that the Agent sets. Remove the other one."),WORKSPACE_R0053:$('Set `method: "POST"` to send a body, or remove `body` and `bodySchema`.'),WORKSPACE_R0054:$("Pass a schema that has `~standard.jsonSchema.input()`, the Standard JSON Schema interface. Or use a fixed `query` or `body`."),WORKSPACE_R0055:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0056:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0057:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0058:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0059:$("Send the request with the method, URL, query, and body that the Source declares. Read `.vitehub/sources/<source>.json` in the Workspace to get them."),WORKSPACE_R0060:$(`Read this Source in an Agent Invocation. The Agent runs the resolver with the Invocation context before it reads the Source. Outside an Invocation, the Source has no files.`),WORKSPACE_R0061:$('Return `repo` from the `github()` resolver, for example `{ repo: "owner/name" }`, or start the Agent Invocation with a `pullRequest` context value.'),WORKSPACE_R0063:$("Use the URL of exactly one Source that the Workspace scope can see. Read `.vitehub/sources/<source>.json` in the Workspace and send the URL, method, query, and body that it declares."),WORKSPACE_R0064:$(`This is a ViteHub bug. Report it at https://github.com/vite-hub/vitehub/issues with the message and your Workspace Definition.`),WORKSPACE_R0065:$("The Cloudflare Artifacts Store keeps its Git checkout in memory. A Git step used the path in the message in a way that the error code rejects, for example `ENOENT` for a missing file. Run the operation again. If it fails again, report it at https://github.com/vite-hub/vitehub/issues with the message."),WORKSPACE_R0066:$("Connect a Blob store to the Vercel project so that it gets `BLOB_STORE_ID`. Off Vercel, set `BLOB_READ_WRITE_TOKEN`."),WORKSPACE_R0074:$(`The Workspace Store keeps no file revisions, so ViteHub cannot prove that the file at the path in the message is the one it started to remove. Check the file. If it must go, delete it in the Store itself, for example in its directory or bucket, because the Workspace rejects writes under a Source. Then run the Source operation again.`),WORKSPACE_R0075:$("Remove `read` from the rule. Workspace rules limit writes only, so `read: false` would not hide the files. Keep files that a reader must not see out of the Workspace, for example in another Workspace or in an Env secret."),WORKSPACE_R0076:$("Remove the option from the rule. A Workspace rule accepts `commit`, `maxBytes`, `mediaType`, `validate`, and `write`."),WORKSPACE_R0077:$('Pass the name of the history Database, `database: "history"`, or its Drizzle database, `database: () => useDatabase("history").db` with `import { useDatabase } from "vite-hub/database"`. The Database can be SQLite, libSQL, D1, or Postgres. A Database Definition from `defineDatabase()` is not a Drizzle database.')}})}));function vJ(e,t={},n=`[vitehub] ${e.why}`){let r=new hK(e.code,n,t);return Object.defineProperties(r,{docs:{configurable:!0,enumerable:!1,value:e.docs,writable:!1},fix:{configurable:!0,enumerable:!1,value:e.fix,writable:!1},why:{configurable:!0,enumerable:!1,value:e.why,writable:!1}})}function yJ(e,t=`not-relative`){let n=e.slice(0,4096);return vJ(gJ.WORKSPACE_PATH_INVALID({path:JSON.stringify(n),problem:t}),{details:{path:n}})}function bJ(e){let t=e.toLowerCase().split(`:`,1)[0];return{normalized:t.replace(/[ .]+$/,``),isTraversal:/^(?:\.(?: +[. ]*)?|\.\.(?: +[. ]*)?)$/.test(t)}}function xJ(e=``,t={}){let n=e.replace(/\\/g,`/`),r=n.replace(/^\/+/,``).replace(/\/+$/,``),i=r.split(`/`).filter(Boolean);if(!t.allowEmpty&&!r||n.startsWith(`/`)||/^[a-z]:/i.test(n)||n.includes(`\0`))throw yJ(e);let a=i.map((e,t)=>({classification:bJ(e),index:t,name:e.toLowerCase()}));if(a.some(({classification:e})=>e.isTraversal))throw yJ(e);if(a.some(({classification:e,index:n,name:r})=>{let i=e.normalized===`.git`||/^git~\d+$/.test(e.normalized)||n===0&&e.normalized===`.vitehub`||n===0&&/^vitehu~\d+$/.test(e.normalized),a=(e.normalized===`.git`||n===0&&e.normalized===`.vitehub`)&&r===e.normalized;return i&&(!t.allowReserved||!a)}))throw yJ(e,`reserved`);return r}var SJ=t((()=>{_J(),EK()}));function CJ(e){try{let t=JSON.parse(rJ(e));if(!t||typeof t!=`object`||!(`epoch`in t)||!(`type`in t)||typeof t.epoch!=`string`||!t.epoch)return;if(t.type===`session`&&`access`in t&&(t.access===`read`||t.access===`write`))return t.access===`read`&&`reason`in t&&(t.reason===`access`||t.reason===`document`||t.reason===`version`)?{type:`session`,access:t.access,epoch:t.epoch,reason:t.reason}:{type:`session`,access:t.access,epoch:t.epoch};if(t.type===`reset`&&`reason`in t&&(t.reason===`source-changed`||t.reason===`stale`))return{type:`reset`,epoch:t.epoch,reason:t.reason}}catch{}}function wJ(e){if(typeof e!=`string`||e.length===0||e.length>4096||e.includes(`\0`)||e.startsWith(`/`)||e.endsWith(`/`)||e.includes(`\\`)||e.includes(`//`)||/^[a-z]:/i.test(e))return!1;try{return xJ(e)===e}catch{return!1}}function TJ(e){try{let t=JSON.parse(rJ(e));if((t.operation===`create`||t.operation===`delete`||t.operation===`update`)&&wJ(t.path))return{operation:t.operation,path:t.path};if(t.operation===`move`&&wJ(t.from)&&wJ(t.to))return{operation:t.operation,from:t.from,to:t.to}}catch{}}function EJ(e){let t=hq();return Q(t,4),Eq(t,JSON.stringify(e)),_q(t)}function DJ(e){let t=hq();return Q(t,6),Eq(t,JSON.stringify(e)),_q(t)}function OJ(e){try{let t=JSON.parse(rJ(e));if(t&&typeof t==`object`&&`kind`in t&&t.kind===`notice`)return{kind:`notice`,body:`body`in t?t.body:void 0};if(!t||typeof t!=`object`||!(`id`in t)||typeof t.id!=`string`||!t.id||t.id.length>128||!(`kind`in t))return;if(t.kind===`request`)return{kind:`request`,id:t.id,body:`body`in t?t.body:void 0};if(t.kind!==`answer`||!(`ok`in t))return;if(t.ok===!0)return{kind:`answer`,id:t.id,ok:!0,body:`body`in t?t.body:void 0};if(t.ok===!1&&`why`in t&&typeof t.why==`string`)return{kind:`answer`,id:t.id,ok:!1,why:t.why}}catch{}}function kJ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var AJ,jJ,MJ=t((()=>{mJ(),Hq(),SJ(),AJ=`@workspace`,jJ=`ping`})),NJ,PJ=t((()=>{NJ=Date.now}));function FJ(e,t=typeof __VITEHUB_APP_BASE_URL__>`u`?`/`:__VITEHUB_APP_BASE_URL__){return t===`/`?e:`${t.replace(/\/+$/,``)}${e}`}function IJ(e){let t;e.on(`status`,({status:n})=>{clearInterval(t),t=void 0;let r=e.ws;if(n!==`connected`||!r)return;let i=r.onmessage;r.onmessage=function(t){if(t.data!==`pong`)return i?.call(this,t);e.ws===r&&(e.wsLastMessageReceived=NJ())},t=setInterval(()=>{e.ws===r&&r.readyState===r.OPEN&&r.send(jJ)},LJ)})}var LJ,RJ=t((()=>{MJ(),PJ(),LJ=15e3}));function zJ(e){return typeof e==`string`?e:null}function BJ(e){let t=e.getMap(VJ.status),n=t.get(`issues`),r=t.get(`savedBy`),i={issues:Array.isArray(n)?n:[],savedBy:r&&!Array.isArray(r)&&r instanceof Object?r:null};return{digest:zJ(t.get(`digest`)),error:zJ(t.get(`error`)),issues:i.issues,savedAt:zJ(t.get(`savedAt`)),savedBy:i.savedBy}}var VJ,HJ=t((()=>{VJ=Object.freeze({body:`body`,fields:`fields`,status:`status`})}));function UJ(e){try{return String(e)===e}catch{return!1}}function WJ(e){if(!UJ(e.id)||!e.id||e.id.length>256)throw DK.REALTIME_INVALID_USER();let t=0;for(let n=0;n<e.id.length;n++)t=Math.imul(31,t)+e.id.charCodeAt(n)|0;let n=(UJ(e.name)&&e.name||UJ(e.email)&&e.email||`Anonymous`).slice(0,256),r={color:qJ[Math.abs(t)%qJ.length],id:e.id,name:n};return UJ(e.image)&&e.image&&e.image.length<=2048&&(r.image=e.image),r}function GJ(e){return kJ(e)?UJ(e.id)&&e.id.length>0&&e.id.length<=256&&UJ(e.name)&&e.name.length>0&&e.name.length<=256&&UJ(e.color)&&/^#[\da-f]{6}$/i.test(e.color)&&(e.image===void 0||UJ(e.image)&&e.image.length<=2048):!1}function KJ(e){let t=[];for(let[n,r]of e)if(GJ(r.user)){let{color:e,id:i,image:a,name:o}=r.user,s={color:e,id:i,name:o,clientId:n};a!==void 0&&(s.image=a),t.push(s)}return t}var qJ,JJ=t((()=>{MJ(),OK(),qJ=[`#E11D48`,`#D97706`,`#059669`,`#0891B2`,`#2563EB`,`#7C3AED`,`#C026D3`]})),YJ,XJ,ZJ,QJ,$J,eY=t((()=>{YJ=()=>new Map,XJ=e=>{let t=YJ();return e.forEach((e,n)=>{t.set(n,e)}),t},ZJ=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},QJ=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},$J=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1}})),tY,nY,rY=t((()=>{eY(),HK(),XK(),tY=class{constructor(){this._observers=YJ()}on(e,t){return ZJ(this._observers,e,VK).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return GK((this._observers.get(e)||YJ()).values()).forEach(e=>e(...t))}destroy(){this._observers=YJ()}},nY=class{constructor(){this._observers=YJ()}on(e,t){ZJ(this._observers,e,VK).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return GK((this._observers.get(e)||YJ()).values()).forEach(e=>e(...t))}destroy(){this._observers=YJ()}}})),iY,aY,oY=t((()=>{iY=Symbol(`Equality`),aY=(e,t)=>e===t||!!e?.[iY]?.(t)||!1})),sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY=t((()=>{oY(),sY=e=>typeof e==`object`,cY=Object.assign,lY=Object.keys,uY=(e,t)=>{for(let n in e)t(e[n],n)},dY=(e,t)=>{let n=[];for(let r in e)n.push(t(e[r],r));return n},fY=e=>lY(e).length,pY=e=>{for(let t in e)return!1;return!0},mY=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},hY=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),gY=(e,t)=>e===t||fY(e)===fY(t)&&mY(e,(e,n)=>(e!==void 0||hY(t,n))&&aY(t[n],e)),_Y=Object.freeze,vY=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&vY(e[t])}return _Y(e)}})),bY,xY,SY,CY,wY=t((()=>{yY(),oY(),bY=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&bY(e,t,n+1)}},xY=e=>e,SY=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[iY]!=null)return e[iY](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!SY(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(fY(e)!==fY(t))return!1;for(let n in e)if(!hY(e,n)||!SY(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!SY(e[n],t[n]))return!1;break;default:return!1}return!0},CY=(e,t)=>t.includes(e)})),TY,EY=t((()=>{crypto.subtle,TY=crypto.getRandomValues.bind(crypto)})),DY,OY,kY,AY=t((()=>{EY(),DY=()=>TY(new Uint32Array(1))[0],OY=`10000000-1000-4000-8000-100000000000`,kY=()=>OY.replace(/[018]/g,e=>(e^DY()&15>>e/4).toString(16))})),jY,MY=t((()=>{jY=e=>new Promise(e),Promise.all.bind(Promise)})),NY,PY=t((()=>{NY=e=>e===void 0?null:e})),FY,IY,LY,RY,zY,BY,VY=t((()=>{FY=class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},IY=new FY,LY=!0;try{typeof window<`u`&&typeof localStorage<`u`&&localStorage&&(IY=localStorage,LY=!1)}catch{}RY=IY,zY=e=>LY||addEventListener(`storage`,e),BY=e=>LY||removeEventListener(`storage`,e)})),HY,UY,WY,GY,KY,qY,JY,YY,XY,ZY,QY,$Y=t((()=>{eY(),lq(),PY(),VY(),wY(),HY=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,UY=typeof window<`u`&&typeof document<`u`&&!HY,typeof navigator<`u`&&/Mac/.test(navigator.platform),GY=[],KY=()=>{if(WY===void 0){if(HY){WY=YJ();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&WY.set(t,``),t=r):t===null?GY.push(r):(WY.set(t,r),t=null)}t!==null&&WY.set(t,``)}else typeof location==`object`?(WY=YJ(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);WY.set(`--${nq(t,`-`)}`,n),WY.set(`-${nq(t,`-`)}`,n)}})):WY=YJ()}return WY},qY=e=>KY().has(e),JY=e=>NY(HY?{}[e.toUpperCase().replaceAll(`-`,`_`)]:RY.getItem(e)),YY=e=>qY(`--`+e)||JY(e)!==null,XY=YY(`production`),ZY=HY&&CY({}.FORCE_COLOR,[`true`,`1`,`2`]),QY=ZY||!qY(`--no-colors`)&&!YY(`no-color`)&&(!HY||process.stdout.isTTY)&&(!HY||qY(`--color`)||JY(`COLORTERM`)!==null||(JY(`TERM`)||``).includes(`color`))})),eX,tX,nX,rX,iX,aX,oX,sX,cX,lX=t((()=>{lq(),$Y(),eX=e=>new Uint8Array(e),tX=e=>new Uint8Array(e),nX=e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=ZK(e[n]);return btoa(t)},rX=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),iX=e=>{let t=atob(e),n=eX(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},aX=e=>new Uint8Array(Buffer.from(e,`base64`)),oX=UY?nX:rX,sX=UY?iX:aX,cX=e=>{let t=eX(e.byteLength);return t.set(e),t}})),uX,dX,fX=t((()=>{uX=class{constructor(e,t){this.left=e,this.right=t}},dX=(e,t)=>new uX(e,t)})),pX,mX,hX,gX,_X,vX,yX,bX=t((()=>{lq(),IK(),pX=e=>e.next()>=.5,mX=(e,t,n)=>AK(e.next()*(n+1-t)+t),hX=(e,t,n)=>AK(e.next()*(n+1-t)+t),gX=(e,t,n)=>hX(e,t,n),_X=e=>ZK(gX(e,97,122)),vX=(e,t=0,n=20)=>{let r=gX(e,t,n),i=``;for(let t=0;t<r;t++)i+=_X(e);return i},yX=(e,t)=>t[gX(e,0,t.length-1)]})),xX,SX,CX,wX,TX,EX,DX,OX,kX,AX,jX,MX,NX,PX,FX,IX,LX,RX,zX,BX,VX,HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ=t((()=>{yY(),XK(),pq(),$Y(),oY(),wY(),lq(),bX(),BK(),xX=Symbol(`0schema`),SX=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(cq(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
369
+ `)}},CX=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[iY]?aY(e,t):YK(e)?KK(e,e=>qK(t,t=>CX(e,t))):sY(e)?mY(e,(e,n)=>CX(e,t[n])):!1,wX=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),CX(t,n)}equals(e){return this.constructor===e.constructor&&SY(this.shape,e.shape)}[xX](){return!0}[iY](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){dq()}get nullable(){return oZ(this,xZ)}get optional(){return new IX(this)}cast(e){return TZ(e,this),e}expect(e){return TZ(e,this),e}},TX=class extends wX{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},EX=(e,t=null)=>new TX(e,t),EX(TX),DX=class extends wX{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},OX=e=>new DX(e),EX(DX),kX=class extends wX{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},AX=(...e)=>new kX(e),jX=EX(kX),MX=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),NX=e=>{if(gZ.check(e))return[MX(e)];if(jX.check(e))return e.shape.map(e=>e+``);if(hZ.check(e))return[`[+-]?\\d+.?\\d*`];if(_Z.check(e))return[`.*`];if(sZ.check(e))return e.shape.map(NX).flat(1);fq()},PX=class extends wX{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(NX).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}},EX(PX),FX=Symbol(`optional`),IX=class extends wX{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[FX](){return!0}},LX=EX(IX),RX=class extends wX{check(e,t){return t?.extend(null,`never`,typeof e),!1}},new RX,EX(RX),zX=class e extends wX{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):mY(this.shape,(n,r)=>{let i=this._isPartial&&!hY(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},BX=e=>new zX(e),VX=EX(zX),HX=OX(e=>e!=null&&(e.constructor===Object||e.constructor==null)),UX=class extends wX{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&mY(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},WX=(e,t)=>new UX(e,t),GX=EX(UX),KX=class extends wX{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&mY(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},qX=(...e)=>new KX(e),EX(KX),JX=class extends wX{constructor(e){super(),this.shape=e.length===1?e[0]:new aZ(e)}check(e,t){let n=YK(e)&&KK(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},YX=(...e)=>new JX(e),XX=EX(JX),ZX=OX(e=>YK(e)),QX=class extends wX{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},$X=(e,t=null)=>new QX(e,t),EX(QX),eZ=$X(wX),tZ=class extends wX{constructor(e){super(),this.len=e.length-1,this.args=qX(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}},nZ=EX(tZ),rZ=OX(e=>typeof e==`function`),iZ=class extends wX{constructor(e){super(),this.shape=e}check(e,t){let n=KK(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},EX(iZ,e=>e.shape.length>0),aZ=class extends wX{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=qK(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},oZ=(...e)=>e.findIndex(e=>sZ.check(e))>=0?oZ(...e.map(e=>wZ(e)).map(e=>sZ.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new aZ(e),sZ=EX(aZ),cZ=()=>!0,lZ=OX(cZ),uZ=EX(DX,e=>e.shape===cZ),dZ=OX(e=>typeof e==`bigint`),fZ=OX(e=>e===dZ),pZ=OX(e=>typeof e==`symbol`),OX(e=>e===pZ),mZ=OX(e=>typeof e==`number`),hZ=OX(e=>e===mZ),gZ=OX(e=>typeof e==`string`),_Z=OX(e=>e===gZ),vZ=OX(e=>typeof e==`boolean`),yZ=OX(e=>e===vZ),bZ=AX(void 0),EX(kX,e=>e.shape.length===1&&e.shape[0]===void 0),AX(void 0),xZ=AX(null),SZ=EX(kX,e=>e.shape.length===1&&e.shape[0]===null),EX(Uint8Array),EX(TX,e=>e.shape===Uint8Array),CZ=oZ(mZ,gZ,xZ,bZ,dZ,vZ,pZ),(()=>{let e=YX(lZ),t=WX(gZ,lZ),n=oZ(mZ,gZ,xZ,vZ,e,t);return e.shape=n,t.shape.values=n,n})(),wZ=e=>{if(eZ.check(e))return e;if(HX.check(e)){let t={};for(let n in e)t[n]=wZ(e[n]);return BX(t)}if(ZX.check(e))return oZ(...e.map(wZ));if(CZ.check(e))return AX(e);if(rZ.check(e))return EX(e);fq()},TZ=XY?()=>{}:(e,t)=>{let n=new SX;if(!t.check(e,n))throw uq(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},EZ=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:wZ(e),h:t}),this}else(e){return this.if(lZ,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw uq(`Unhandled pattern`)}}},DZ=e=>new EZ(e),OZ=DZ(lZ).if(hZ,(e,t)=>mX(t,RK,LK)).if(_Z,(e,t)=>vX(t)).if(yZ,(e,t)=>pX(t)).if(fZ,(e,t)=>BigInt(mX(t,RK,LK))).if(sZ,(e,t)=>kZ(t,yX(t,e.shape))).if(VX,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(LX.check(i)){if(pX(t))continue;i=i.shape}n[r]=OZ(i,t)}return n}).if(XX,(e,t)=>{let n=[],r=hX(t,0,42);for(let i=0;i<r;i++)n.push(kZ(t,e.shape));return n}).if(jX,(e,t)=>yX(t,e.shape)).if(SZ,(e,t)=>null).if(nZ,(e,t)=>{let n=kZ(t,e.res);return()=>n}).if(uZ,(e,t)=>kZ(t,yX(t,[mZ,gZ,xZ,bZ,dZ,vZ,YX(mZ),WX(oZ(`a`,`b`,`c`),mZ)]))).if(GX,(e,t)=>{let n={},r=mX(t,0,3);for(let i=0;i<r;i++){let r=kZ(t,e.shape.keys);n[r]=kZ(t,e.shape.values)}return n}).done(),kZ=(e,t)=>OZ(wZ(t),e)})),jZ,MZ,NZ,PZ,FZ,IZ,LZ=t((()=>{eY(),AZ(),jZ=typeof document<`u`?document:{},OX(e=>e.nodeType===IZ),typeof DOMParser<`u`&&new DOMParser,OX(e=>e.nodeType===NZ),OX(e=>e.nodeType===PZ),MZ=e=>QJ(e,(e,t)=>`${t}:${e};`).join(``),NZ=jZ.ELEMENT_NODE,PZ=jZ.TEXT_NODE,jZ.CDATA_SECTION_NODE,jZ.COMMENT_NODE,FZ=jZ.DOCUMENT_NODE,jZ.DOCUMENT_TYPE_NODE,IZ=jZ.DOCUMENT_FRAGMENT_NODE,OX(e=>e.nodeType===FZ)})),RZ,zZ=t((()=>{RZ=Symbol})),BZ,VZ,HZ,UZ,WZ,GZ,KZ,qZ,JZ,YZ,XZ=t((()=>{zZ(),PJ(),BZ=RZ(),VZ=RZ(),HZ=RZ(),UZ=RZ(),WZ=RZ(),GZ=RZ(),KZ=RZ(),qZ=RZ(),JZ=RZ(),YZ=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n},NJ()})),ZZ,QZ,$Z,eQ,tQ,nQ,rQ=t((()=>{$Y(),HK(),fX(),LZ(),eY(),XZ(),ZZ={[BZ]:dX(`font-weight`,`bold`),[VZ]:dX(`font-weight`,`normal`),[HZ]:dX(`color`,`blue`),[WZ]:dX(`color`,`green`),[UZ]:dX(`color`,`grey`),[GZ]:dX(`color`,`red`),[KZ]:dX(`color`,`purple`),[qZ]:dX(`color`,`orange`),[JZ]:dX(`color`,`black`)},QZ=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=YJ(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=ZZ[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=MZ(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i},$Z=QY?QZ:YZ,eQ=(...e)=>{console.log(...$Z(e)),nQ.forEach(t=>t.print(e))},tQ=(...e)=>{console.warn(...$Z(e)),e.unshift(qZ),nQ.forEach(t=>t.print(e))},nQ=VK()})),iQ,aQ,oQ,sQ=t((()=>{iQ=e=>({[Symbol.iterator](){return this},next:e}),aQ=(e,t)=>iQ(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),oQ=(e,t)=>iQ(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})}));function*cQ(e){let t=$q(e.restDecoder);for(let n=0;n<t;n++){let t=$q(e.restDecoder),n=e.readClient(),r=$q(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=$q(e.restDecoder);yield new N0(n$(n,r),t),r+=t}else if(31&t){let i=!(t&192),a=new k0(n$(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,A0(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new $1(n$(n,r),t),r+=t}}}}var lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$,D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,l1,u1,d1,f1,p1,m1,h1,g1,_1,v1,y1,b1,x1,S1,C1,w1,T1,E1,D1,O1,k1,A1,j1,M1,N1,P1,F1,I1,L1,R1,z1,B1,V1,H1,U1,W1,G1,K1,q1,J1,Y1,X1,Z1,Q1,$1,e0,t0,n0,r0,i0,a0,o0,s0,c0,l0,u0,d0,f0,p0,m0,h0,g0,_0,v0,y0,b0,x0,S0,C0,w0,T0,E0,D0,O0,k0,A0,j0,M0,N0,P0,F0,I0=t((()=>{rY(),XK(),IK(),eY(),Hq(),mJ(),AY(),MY(),lX(),pq(),kK(),wY(),HK(),rQ(),sQ(),yY(),$Y(),lQ=class{constructor(e,t){this.clock=e,this.len=t}},uQ=class{constructor(){this.clients=new Map}},dQ=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])y$(e,i,o.clock,o.len,n)}}),fQ=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=AK((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},pQ=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&fQ(n,t.clock)!==null},mQ=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new lQ(r.clock,NK(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},hQ=e=>{let t=new uQ;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)WK(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return mQ(t),t},gQ=(e,t,n,r)=>{ZJ(e.clients,t,()=>[]).push(new lQ(n,r))},_Q=()=>new uQ,vQ=e=>{let t=_Q();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new lQ(i,a))}}r.length>0&&t.clients.set(n,r)}),t},yQ=(e,t)=>{Q(e.restEncoder,t.clients.size),GK(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),Q(e.restEncoder,t);let r=n.length;Q(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},bQ=e=>{let t=new uQ,n=$q(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=$q(e.restDecoder),r=$q(e.restDecoder);if(r>0){let i=ZJ(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new lQ(e.readDsClock(),e.readDsLen()))}}return t},xQ=(e,t,n)=>{let r=new uQ,i=$q(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=$q(e.restDecoder),a=$q(e.restDecoder),o=n.clients.get(i)||[],s=u$(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&gQ(r,i,s,a-s);let e=f$(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,O0(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,O0(t,c,a-c.id.clock)),c.delete(t))}else gQ(r,i,n,a-n)}}if(r.clients.size>0){let e=new jQ;return Q(e.restEncoder,0),yQ(e,r),e.toUint8Array()}return null},SQ=DY,CQ=class e extends tY{constructor({guid:e=kY(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=SQ(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new c$,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=jY(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>jY(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&D$(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(GK(this.subdocs).map(e=>e.guid))}transact(e,t=null){return D$(this,e,t)}get(e,t=Q$){let n=ZJ(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==Q$&&r!==t){if(r===Q$){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=``){return this.get(e,v1)}getText(e=``){return this.get(e,z1)}getMap(e=``){return this.get(e,x1)}getXmlElement(e=``){return this.get(e,W1)}getXmlFragment(e=``){return this.get(e,H1)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,GK(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,D$(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},wQ=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return $q(this.restDecoder)}readDsLen(){return $q(this.restDecoder)}},TQ=class extends wQ{readLeftID(){return n$($q(this.restDecoder),$q(this.restDecoder))}readRightID(){return n$($q(this.restDecoder),$q(this.restDecoder))}readClient(){return $q(this.restDecoder)}readInfo(){return Qq(this.restDecoder)}readString(){return rJ(this.restDecoder)}readParentInfo(){return $q(this.restDecoder)===1}readTypeRef(){return $q(this.restDecoder)}readLen(){return $q(this.restDecoder)}readAny(){return lJ(this.restDecoder)}readBuf(){return cX(Zq(this.restDecoder))}readJSON(){return JSON.parse(rJ(this.restDecoder))}readKey(){return rJ(this.restDecoder)}},EQ=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=$q(this.restDecoder),this.dsCurrVal}readDsLen(){let e=$q(this.restDecoder)+1;return this.dsCurrVal+=e,e}},DQ=class extends EQ{constructor(e){super(e),this.keys=[],$q(e),this.keyClockDecoder=new fJ(Zq(e)),this.clientDecoder=new dJ(Zq(e)),this.leftClockDecoder=new fJ(Zq(e)),this.rightClockDecoder=new fJ(Zq(e)),this.infoDecoder=new uJ(Zq(e),Qq),this.stringDecoder=new pJ(Zq(e)),this.parentInfoDecoder=new uJ(Zq(e),Qq),this.typeRefDecoder=new dJ(Zq(e)),this.lenDecoder=new dJ(Zq(e))}readLeftID(){return new e$(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new e$(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return lJ(this.restDecoder)}readBuf(){return Zq(this.restDecoder)}readJSON(){return lJ(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},OQ=class{constructor(){this.restEncoder=hq()}toUint8Array(){return _q(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Q(this.restEncoder,e)}writeDsLen(e){Q(this.restEncoder,e)}},kQ=class extends OQ{writeLeftID(e){Q(this.restEncoder,e.client),Q(this.restEncoder,e.clock)}writeRightID(e){Q(this.restEncoder,e.client),Q(this.restEncoder,e.clock)}writeClient(e){Q(this.restEncoder,e)}writeInfo(e){bq(this.restEncoder,e)}writeString(e){Eq(this.restEncoder,e)}writeParentInfo(e){Q(this.restEncoder,+!!e)}writeTypeRef(e){Q(this.restEncoder,e)}writeLen(e){Q(this.restEncoder,e)}writeAny(e){Fq(this.restEncoder,e)}writeBuf(e){Oq(this.restEncoder,e)}writeJSON(e){Eq(this.restEncoder,JSON.stringify(e))}writeKey(e){Eq(this.restEncoder,e)}},AQ=class{constructor(){this.restEncoder=hq(),this.dsCurrVal=0}toUint8Array(){return _q(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,Q(this.restEncoder,t)}writeDsLen(e){e===0&&fq(),Q(this.restEncoder,e-1),this.dsCurrVal+=e}},jQ=class extends AQ{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Bq,this.clientEncoder=new Rq,this.leftClockEncoder=new Bq,this.rightClockEncoder=new Bq,this.infoEncoder=new Iq(bq),this.stringEncoder=new Vq,this.parentInfoEncoder=new Iq(bq),this.typeRefEncoder=new Rq,this.lenEncoder=new Rq}toUint8Array(){let e=hq();return Q(e,0),Oq(e,this.keyClockEncoder.toUint8Array()),Oq(e,this.clientEncoder.toUint8Array()),Oq(e,this.leftClockEncoder.toUint8Array()),Oq(e,this.rightClockEncoder.toUint8Array()),Oq(e,_q(this.infoEncoder)),Oq(e,this.stringEncoder.toUint8Array()),Oq(e,_q(this.parentInfoEncoder)),Oq(e,this.typeRefEncoder.toUint8Array()),Oq(e,this.lenEncoder.toUint8Array()),Dq(e,_q(this.restEncoder)),_q(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Fq(this.restEncoder,e)}writeBuf(e){Oq(this.restEncoder,e)}writeJSON(e){Fq(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},MQ=(e,t,n,r)=>{r=NK(r,t[0].id.clock);let i=f$(t,r);Q(e.restEncoder,t.length-i),e.writeClient(n),Q(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},NQ=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{u$(t,n)>e&&r.set(n,e)}),l$(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),Q(e.restEncoder,r.size),GK(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{MQ(e,t.clients.get(n),n,r)})},PQ=(e,t)=>{let n=YJ(),r=$q(e.restDecoder);for(let i=0;i<r;i++){let r=$q(e.restDecoder),i=Array(r),a=e.readClient(),o=$q(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new $1(n$(a,o),t),o+=t;break}case 10:{let t=$q(e.restDecoder);i[n]=new N0(n$(a,o),t),o+=t;break}default:{let s=!(r&192),c=new k0(n$(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,A0(e,r));i[n]=c,o+=c.length}}}}return n},FQ=(e,t,n)=>{let r=[],i=GK(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new c$,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==N0){let i=ZJ(d,u.id.client,()=>u$(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,u$(t,a)),f();else{u=e.refs[e.i++];continue}}else(i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new jQ;return NQ(e,s,new Map),Q(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},IQ=(e,t)=>NQ(e,t.doc.store,t.beforeState),LQ=(e,t,n,r=new DQ(e))=>D$(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=PQ(r,n),o=FQ(e,i,a),s=i.pendingStructs;if(s){for(let[e,n]of s.missing)if(n<u$(i,e)){t=!0;break}if(o){for(let[e,t]of o.missing){let n=s.missing.get(e);(n==null||n>t)&&s.missing.set(e,t)}s.update=M$([s.update,o.update])}}else i.pendingStructs=o;let c=xQ(r,e,i);if(i.pendingDs){let t=new DQ(Jq(i.pendingDs));$q(t.restDecoder);let n=xQ(t,e,i);i.pendingDs=c&&n?M$([c,n]):c||n}else i.pendingDs=c;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,RQ(e.doc,t)}},n,!1),RQ=(e,t,n,r=DQ)=>{let i=Jq(t);LQ(i,e,n,new r(i))},zQ=(e,t,n)=>RQ(e,t,n,TQ),BQ=(e,t,n=new Map)=>{NQ(e,t.store,n),yQ(e,vQ(t.store))},VQ=(e,t=new Uint8Array([0]),n=new jQ)=>{let r=WQ(t);BQ(n,e,r);let i=[n.toUint8Array()];if(e.store.pendingDs&&i.push(e.store.pendingDs),e.store.pendingStructs&&i.push(N$(e.store.pendingStructs.update,t)),i.length>1){if(n.constructor===kQ)return A$(i.map((e,t)=>t===0?e:R$(e)));if(n.constructor===jQ)return M$(i)}return i[0]},HQ=(e,t)=>VQ(e,t,new kQ),UQ=e=>{let t=new Map,n=$q(e.restDecoder);for(let r=0;r<n;r++){let n=$q(e.restDecoder),r=$q(e.restDecoder);t.set(n,r)}return t},WQ=e=>UQ(new wQ(Jq(e))),GQ=(e,t)=>(Q(e.restEncoder,t.size),GK(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{Q(e.restEncoder,t),Q(e.restEncoder,n)}),e),KQ=(e,t)=>GQ(e,l$(t.store)),qQ=(e,t=new AQ)=>(e instanceof Map?GQ(t,e):KQ(t,e),t.toUint8Array()),JQ=e=>qQ(e,new OQ),YQ=class{constructor(){this.l=[]}},XQ=()=>new YQ,ZQ=(e,t)=>e.l.push(t),QQ=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},$Q=(e,t,n)=>bY(e.l,[t,n]),e$=class{constructor(e,t){this.client=e,this.clock=t}},t$=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,n$=(e,t)=>new e$(e,t),r$=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw fq()},i$=class{constructor(e,t){this.ds=e,this.sv=t}},a$=(e,t)=>new i$(e,t),a$(_Q(),new Map),o$=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!pQ(t.ds,e.id),s$=(e,t)=>{let n=ZJ(e.meta,s$,VK),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<u$(r,n)&&g$(e,n$(n,t))}),dQ(e,t.ds,e=>{}),n.add(t))},c$=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},l$=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},u$=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},d$=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw fq()}n.push(t)},f$=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=AK(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=AK((n+r)/2)}throw fq()},p$=(e,t)=>{let n=e.clients.get(t.client);return n[f$(n,t.clock)]},m$=p$,h$=(e,t,n)=>{let r=f$(t,n),i=t[r];return i.id.clock<n&&i instanceof k0?(t.splice(r+1,0,O0(e,i,n-i.id.clock)),r+1):r},g$=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[h$(e,n,t.clock)]},_$=(e,t,n)=>{let r=t.clients.get(n.client),i=f$(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==$1&&r.splice(i+1,0,O0(e,a,n.clock-a.id.clock+1)),a},v$=(e,t,n)=>{let r=e.clients.get(t.id.client);r[f$(r,t.id.clock)]=n},y$=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=h$(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&h$(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},b$=class{constructor(e,t,n){this.doc=e,this.deleteSet=new uQ,this.beforeState=l$(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},x$=(e,t)=>t.deleteSet.clients.size===0&&!$J(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(mQ(t.deleteSet),IQ(e,t),yQ(e,t.deleteSet),!0),S$=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&ZJ(e.changed,t,VK).add(n)},C$=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=e[--i-1])n instanceof k0&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);let a=t-i;return a&&e.splice(t+1-a,a),a},w$=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=f$(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof k0&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},T$=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=MK(r.length-1,1+f$(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+C$(r,e)}})},E$=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{mQ(a),n.afterState=l$(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{r._item!==null&&r._item.deleted||r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&e.push(()=>{t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),$Q(r._dEH,t,n)})}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&I1(n)})}),bY(e,[])}finally{r.gc&&w$(a,i,r.gcFilter),T$(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=NK(f$(e,r),1);for(let t=e.length-1;t>=n;)t-=1+C$(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=f$(r,n);a+1<r.length&&C$(r,a+1)>1||a>0&&C$(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(eQ(qZ,BZ,`[yjs] `,VZ,GZ,`Changed the client-id because another client seems to be using it.`),r.clientID=SQ()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new kQ;x$(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new jQ;x$(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):E$(e,t+1)}}},D$=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new b$(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&E$(i,0)}}return o},O$=class{constructor(e,t){this.gen=cQ(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===N0);return this.curr}},k$=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},A$=e=>M$(e,TQ,kQ),j$=(e,t)=>{if(e.constructor===$1){let{client:n,clock:r}=e.id;return new $1(n$(n,r+t),e.length-t)}if(e.constructor===N0){let{client:n,clock:r}=e.id;return new N0(n$(n,r+t),e.length-t)}{let n=e,{client:r,clock:i}=n.id;return new k0(n$(r,i+t),null,n$(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},M$=(e,t=DQ,n=jQ)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(Jq(e))),i=r.map(e=>new O$(e,!0)),a=null,o=new n,s=new k$(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===N0?1:-1:n}return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)F$(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock){if(a.struct.constructor===N0)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{F$(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new N0(n$(t,a.struct.id.clock+a.struct.length),e),offset:0}}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===N0?a.struct.length-=t:n=j$(n,t)),a.struct.mergeWith(n)||(F$(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==N0;n=e.next())F$(s,a.struct,a.offset),a={struct:n,offset:0}}a!==null&&(F$(s,a.struct,a.offset),a=null),I$(s);let c=r.map(e=>bQ(e)),l=hQ(c);return yQ(o,l),o.toUint8Array()},N$=(e,t,n=DQ,r=jQ)=>{let i=WQ(t),a=new r,o=new k$(a),s=new n(Jq(e)),c=new O$(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===N0)c.next();else if(e.id.clock+e.length>n)for(F$(o,e,NK(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)F$(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}I$(o);let l=bQ(s);return yQ(a,l),a.toUint8Array()},P$=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:_q(e.encoder.restEncoder)}),e.encoder.restEncoder=hq(),e.written=0)},F$=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&P$(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Q(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},I$=e=>{P$(e);let t=e.encoder.restEncoder;Q(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];Q(t,r.written),Dq(t,r.restEncoder)}},L$=(e,t,n,r)=>{let i=new n(Jq(e)),a=new O$(i,!1),o=new r,s=new k$(o);for(let e=a.curr;e!==null;e=a.next())F$(s,t(e),0);I$(s);let c=bQ(i);return yQ(o,c),o.toUint8Array()},R$=e=>L$(e,xY,DQ,kQ),z$=`You must not compute changes after the event-handler fired.`,B$=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=V$(this.currentTarget,this.target)}deletes(e){return pQ(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw uq(z$);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r)){if(e!==null&&this.deletes(e))i=`delete`,a=UK(e.content.getContent());else return}else e!==null&&this.deletes(e)?(i=`update`,a=UK(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=UK(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw uq(z$);let t=this.target,n=VK(),r=VK(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},V$=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},H$=()=>{tQ(`Invalid access: Add Yjs type to a document before reading data.`)},U$=80,W$=0,G$=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=W$++}},K$=e=>{e.timestamp=W$++},q$=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=W$++},J$=(e,t,n)=>{if(e.length>=U$){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return q$(r,t,n),r}{let r=new G$(t,n);return e.push(r),r}},Y$=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>jK(t-e.index)<jK(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,K$(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&jK(n.index-i)<r.parent.length/U$?(q$(n,r,i),n):J$(e._searchMarker,r,i)},X$=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=NK(t,i.index+n))}},Z$=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;ZJ(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;$Q(r._eH,n,t)},Q$=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=XQ(),this._dEH=XQ(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw dq()}clone(){throw dq()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){ZQ(this._eH,e)}observeDeep(e){ZQ(this._dEH,e)}unobserve(e){QQ(this._eH,e)}unobserveDeep(e){QQ(this._dEH,e)}toJSON(){}},$$=(e,t,n)=>{e.doc??H$(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},e1=e=>{e.doc??H$();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},t1=(e,t)=>{let n=0,r=e._start;for(e.doc??H$();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},n1=(e,t)=>{let n=[];return t1(e,(r,i)=>{n.push(t(r,i,e))}),n},r1=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},i1=(e,t)=>{e.doc??H$();let n=Y$(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},a1=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new k0(n$(o,u$(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new m0(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new k0(n$(o,u$(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new e0(new Uint8Array(n))),i.integrate(e,0);break;case CQ:i=new k0(n$(o,u$(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new a0(n)),i.integrate(e,0);break;default:if(n instanceof Q$)i=new k0(n$(o,u$(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new E0(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},o1=()=>uq(`Length exceeded!`),s1=(e,t,n,r)=>{if(n>t._length)throw o1();if(n===0)return t._searchMarker&&X$(t._searchMarker,n,r.length),a1(e,t,null,r);let i=n,a=Y$(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&g$(e,n$(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&X$(t._searchMarker,i,r.length),a1(e,t,o,r)},c1=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return a1(e,t,r,n)},l1=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=Y$(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&g$(e,n$(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&g$(e,n$(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw o1();t._searchMarker&&X$(t._searchMarker,i,-a+r)},u1=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},d1=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new m0([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new m0([r]);break;case Uint8Array:s=new e0(r);break;case CQ:s=new a0(r);break;default:if(r instanceof Q$)s=new E0(r);else throw Error(`Unexpected content type`)}new k0(n$(o,u$(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},f1=(e,t)=>{e.doc??H$();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},p1=e=>{let t={};return e.doc??H$(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},m1=(e,t)=>{e.doc??H$();let n=e._map.get(t);return n!==void 0&&!n.deleted},h1=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&o$(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},g1=e=>(e.doc??H$(),aQ(e._map.entries(),e=>!e[1].deleted)),_1=class extends B${},v1=class e extends Q${constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof Q$?e.clone():e)),t}get length(){return this.doc??H$(),this._length}_callObserver(e,t){super._callObserver(e,t),Z$(this,e,new _1(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):D$(this.doc,n=>{s1(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):D$(this.doc,t=>{c1(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):D$(this.doc,n=>{l1(n,this,e,t)})}get(e){return i1(this,e)}toArray(){return e1(this)}slice(e=0,t=this.length){return $$(this,e,t)}toJSON(){return this.map(e=>e instanceof Q$?e.toJSON():e)}map(e){return n1(this,e)}forEach(e){t1(this,e)}[Symbol.iterator](){return r1(this)}_write(e){e.writeTypeRef(y0)}},y1=e=>new v1,b1=class extends B${constructor(e,t,n){super(e,t),this.keysChanged=n}},x1=class e extends Q${constructor(e){super(),this._prelimContent=null,this._prelimContent=e===void 0?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof Q$?e.clone():e)}),t}_callObserver(e,t){Z$(this,e,new b1(this,e,t))}toJSON(){this.doc??H$();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof Q$?r.toJSON():r}}),e}get size(){return[...g1(this)].length}keys(){return oQ(g1(this),e=>e[0])}values(){return oQ(g1(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return oQ(g1(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??H$(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):D$(this.doc,t=>{u1(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):D$(this.doc,n=>{d1(n,this,e,t)}),t}get(e){return f1(this,e)}has(e){return m1(this,e)}clear(){this.doc===null?this._prelimContent.clear():D$(this.doc,e=>{this.forEach(function(t,n,r){u1(e,r,n)})})}_write(e){e.writeTypeRef(b0)}},S1=e=>new x1,C1=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&gY(e,t),w1=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&fq(),this.right.content.constructor){case l0:this.right.deleted||O1(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length)}this.left=this.right,this.right=this.right.right}},T1=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case l0:t.right.deleted||O1(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&g$(e,n$(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length)}t.left=t.right,t.right=t.right.right}return t},E1=(e,t,n,r)=>{let i=new Map,a=r?Y$(t,n):null;if(a){let t=new w1(a.p.left,a.p,a.index,i);return T1(e,t,n-a.index)}{let r=new w1(null,t._start,0,i);return T1(e,r,n)}},D1=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===l0&&C1(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new k0(n$(a,u$(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new l0(o,r));l.integrate(e,0),n.right=l,n.forward()})},O1=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},k1=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===l0&&C1(t[e.right.content.key]??null,e.right.content.value));)e.forward()},A1=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!C1(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new k0(n$(a,u$(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new l0(s,c)),n.right.integrate(e,0),n.forward()}}return o},j1=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;k1(n,i);let s=A1(e,t,n,i),c=r.constructor===String?new g0(r):r instanceof Q$?new E0(r):new s0(r),{left:l,right:u,index:d}=n;t._searchMarker&&X$(t._searchMarker,n.index,c.getLength()),u=new k0(n$(o,u$(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),D1(e,t,n,s)},M1=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;k1(n,i);let s=A1(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===l0));){if(!n.right.deleted)switch(n.right.content.constructor){case l0:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(C1(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&g$(e,n$(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
370
+ `;n.right=new k0(n$(o,u$(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new g0(i)),n.right.integrate(e,0),n.forward()}D1(e,t,n,s)},N1=(e,t,n,r,i)=>{let a=t,o=YJ();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===l0){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case l0:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&O1(i,n);break}}}t=t.right}return s},P1=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===l0){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},F1=e=>{let t=0;return D$(e.doc,n=>{let r=e._start,i=e._start,a=YJ(),o=XJ(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case l0:O1(o,i.content);break;default:t+=N1(n,r,i,a,o),a=XJ(o),r=i}i=i.right}}),t},I1=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&y$(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===l0&&e.constructor!==$1&&t.add(e.parent)})}D$(n,n=>{dQ(e,e.deleteSet,e=>{if(e instanceof $1||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===l0?t.add(r):P1(n,e)});for(let e of t)F1(e)})},L1=(e,t,n)=>{let r=n,i=XJ(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case E0:case s0:case g0:n<t.right.length&&g$(e,n$(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e)}t.forward()}a&&N1(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&X$(o._searchMarker,t.index,-r+n),t},R1=class extends B${constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){if(this._changes===null){let e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];D$(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},pY(o)||(e.attributes=cY({},o))),c=0}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case E0:case s0:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case g0:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case l0:{let{key:t,value:s}=i.content;if(this.adds(i)){if(!this.deletes(i)){let c=n.get(t)??null;C1(c,s)?s!==null&&i.delete(e):(a===`retain`&&u(),C1(s,r.get(t)??null)?delete o[t]:o[t]=s)}}else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;C1(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(C1(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),O1(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},z1=class e extends Q${constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??H$(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new R1(this,e,t);Z$(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??H$();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===g0&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):D$(this.doc,n=>{let r=new w1(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
371
+ `?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&j1(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&L1(n,r,a.delete):M1(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??H$();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(o$(s,e)||t!==void 0&&o$(s,t))switch(s.content.constructor){case g0:{let r=i.get(`ychange`);e!==void 0&&!o$(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!o$(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case E0:case s0:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case l0:o$(s,e)&&(c(),O1(i,s.content))}s=s.right}c()};return e||t?D$(a,n=>{e&&s$(n,e),t&&s$(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):D$(r,r=>{let i=E1(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),j1(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):D$(r,r=>{let i=E1(r,this,e,!n);j1(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):D$(n,n=>{L1(n,E1(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):D$(r,r=>{let i=E1(r,this,e,!1);i.right!==null&&M1(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):D$(this.doc,t=>{u1(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):D$(this.doc,n=>{d1(n,this,e,t)})}getAttribute(e){return f1(this,e)}getAttributes(){return p1(this)}_write(e){e.writeTypeRef(x0)}},B1=e=>new z1,V1=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??H$()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===W1||t.constructor===H1)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},H1=class e extends Q${constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof Q$?e.clone():e)),t}get length(){return this.doc??H$(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new V1(this,e)}querySelector(e){e=e.toUpperCase();let t=new V1(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),GK(new V1(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){Z$(this,e,new K1(this,t,e))}toString(){return n1(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),t1(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):D$(this.doc,n=>{s1(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)D$(this.doc,n=>{let r=e&&e instanceof Q$?e._item:e;a1(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw uq(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):D$(this.doc,n=>{l1(n,this,e,t)})}toArray(){return e1(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return i1(this,e)}slice(e=0,t=this.length){return $$(this,e,t)}forEach(e){t1(this,e)}_write(e){e.writeTypeRef(C0)}},U1=e=>new H1,W1=class e extends H1{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName),n=this.getAttributes();return uY(n,(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof Q$?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):D$(this.doc,t=>{u1(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):D$(this.doc,n=>{d1(n,this,e,t)})}getAttribute(e){return f1(this,e)}hasAttribute(e){return m1(this,e)}getAttributes(e){return e?h1(this,e):p1(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return t1(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(S0),e.writeKey(this.nodeName)}},G1=e=>new W1(e.readKey()),K1=class extends B${constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},q1=class e extends x1{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(w0),e.writeKey(this.hookName)}},J1=e=>new q1(e.readKey()),Y1=class e extends z1{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(T0)}},X1=e=>new Y1,Z1=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw dq()}mergeWith(e){return!1}write(e,t,n){throw dq()}integrate(e,t){throw dq()}},Q1=0,$1=class extends Z1{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),d$(e.doc.store,this)}write(e,t){e.writeInfo(Q1),e.writeLen(this.length-t)}getMissing(e,t){return null}},e0=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw dq()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},t0=e=>new e0(e.readBuf()),n0=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){gQ(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},r0=e=>new n0(e.readLen()),i0=(e,t)=>new CQ({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),a0=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(i0(this.doc.guid,this.opts))}splice(e){throw dq()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},o0=e=>new a0(i0(e.readString(),e.readAny())),s0=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw dq()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},c0=e=>new s0(e.readJSON()),l0=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw dq()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},u0=e=>new l0(e.readKey(),e.readJSON()),d0=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},f0=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new d0(n)},p0=JY(`node_env`)===`development`,m0=class e{constructor(e){this.arr=e,p0&&vY(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},h0=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new m0(n)},g0=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},_0=e=>new g0(e.readString()),v0=[y1,S1,B1,G1,U1,J1,X1],y0=0,b0=1,x0=2,S0=3,C0=4,w0=5,T0=6,E0=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw dq()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},D0=e=>new E0(v0[e.readTypeRef()](e)),O0=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new k0(n$(r,i+n),t,n$(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=n$(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},k0=class e extends Z1{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=u$(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=u$(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===e$&&this.id.client!==this.parent.client&&this.parent.clock>=u$(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=_$(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=g$(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===$1||this.right&&this.right.constructor===$1)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===e$){let e=m$(n,this.parent);this.parent=e.constructor===$1?null:e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=_$(e,e.doc.store,n$(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),t$(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(t$(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(m$(e.doc.store,n.origin)))r.has(m$(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null){let e=this.left.right;this.right=e,this.left.right=this}else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),d$(e.doc.store,this),this.content.integrate(e,this),S$(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new $1(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:n$(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&t$(e.origin,this.lastId)&&this.right===e&&t$(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),gQ(e.deleteSet,this.id.client,this.id.clock,this.length),S$(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw fq();this.content.gc(e),t?v$(e,this,new $1(this.id,this.length)):this.content=new n0(this.length)}write(e,t){let n=t>0?n$(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=r$(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===e$?(e.writeParentInfo(!1),e.writeLeftID(t)):fq();i!==null&&e.writeString(i)}this.content.write(e,t)}},A0=(e,t)=>j0[t&31](e),j0=[()=>{fq()},r0,f0,t0,_0,c0,u0,D0,h0,o0,()=>{fq()}],M0=10,N0=class extends Z1{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){fq()}write(e,t){e.writeInfo(M0),Q(e.restEncoder,this.length-t)}getMissing(e,t){return null}},P0=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},F0=`__ $YJS$ __`,P0[F0]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),P0[F0]=!0})),L0,R0,z0,B0,V0,H0=t((()=>{Hq(),mJ(),PJ(),IK(),rY(),wY(),L0=3e4,R0=class extends nY{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=NJ();this.getLocalState()!==null&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&z0(this,t,`timeout`)},AK(L0/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:NJ()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),SY(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},z0=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:NJ()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},B0=(e,t,n=e.states)=>{let r=t.length,i=hq();Q(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;Q(i,r),Q(i,s),Eq(i,JSON.stringify(o))}return _q(i)},V0=(e,t,n)=>{let r=Jq(t),i=NJ(),a=[],o=[],s=[],c=[],l=$q(r);for(let t=0;t<l;t++){let t=$q(r),n=$q(r),l=JSON.parse(rJ(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(SY(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])}})),U0,W0,G0,K0,q0,J0,Y0,X0=t((()=>{eY(),HK(),lX(),VY(),U0=new Map,W0=class{constructor(e){this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&this.onmessage!==null&&this.onmessage({data:sX(t.newValue||``)}),zY(this._onChange)}postMessage(e){RY.setItem(this.room,oX(tX(e)))}close(){BY(this._onChange)}},G0=typeof BroadcastChannel>`u`?W0:BroadcastChannel,K0=e=>ZJ(U0,e,()=>{let t=VK(),n=new G0(e);return n.onmessage=e=>t.forEach(t=>t(e.data,`broadcastchannel`)),{bc:n,subs:t}}),q0=(e,t)=>(K0(e).subs.add(t),t),J0=(e,t)=>{let n=K0(e),r=n.subs.delete(t);return r&&n.subs.size===0&&(n.bc.close(),U0.delete(e)),r},Y0=(e,t,n=null)=>{let r=K0(e);r.bc.postMessage(t),r.subs.forEach(e=>e(t,n))}})),Z0,Q0,$0,e2,t2,n2,r2,i2=t((()=>{Hq(),mJ(),I0(),Z0=(e,t)=>{Q(e,0);let n=JQ(t);Oq(e,n)},Q0=(e,t,n)=>{Q(e,1),Oq(e,HQ(t,n))},$0=(e,t,n)=>Q0(t,n,Zq(e)),e2=(e,t,n,r)=>{try{zQ(t,Zq(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},t2=(e,t)=>{Q(e,2),Oq(e,t)},n2=e2,r2=(e,t,n,r,i)=>{let a=$q(e);switch(a){case 0:$0(e,t,n);break;case 1:e2(e,n,r,i);break;case 2:n2(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a}})),a2,o2=t((()=>{mJ(),a2=(e,t,n)=>{$q(e)===0&&n(t,rJ(e))}})),s2,c2=t((()=>{yY(),s2=e=>dY(e,(e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join(`&`)})),l2,u2,d2,f2,p2,m2,h2,g2,_2,v2=t((()=>{X0(),PJ(),Hq(),mJ(),i2(),o2(),H0(),rY(),IK(),c2(),$Y(),l2=[],l2[0]=(e,t,n,r,i)=>{Q(e,0);let a=r2(t,e,n.doc,n);r&&a===1&&!n.synced&&(n.synced=!0)},l2[3]=(e,t,n,r,i)=>{Q(e,1),Oq(e,B0(n.awareness,Array.from(n.awareness.getStates().keys())))},l2[1]=(e,t,n,r,i)=>{V0(n.awareness,Zq(t),n)},l2[2]=(e,t,n,r,i)=>{a2(t,n.doc,(e,t)=>d2(n,t))},u2=3e4,d2=(e,t)=>console.warn(`Permission denied to access ${e.url}.\n${t}`),f2=(e,t,n)=>{let r=Jq(t),i=hq(),a=$q(r),o=e.messageHandlers[a];return o?o(i,r,e,n,a):console.error(`Unable to compute message`),i},p2=e=>!(e.code>=4400&&e.code<4500),m2=(e,t,n)=>{if(t!==null&&t===e.ws){e.emit(`connection-close`,[n,e]),e.ws=null,t.onmessage=null,t.onopen=null,t.onclose=null,t.onerror=()=>{},t.close(),e.wsconnecting=!1,e.wsconnected&&(e.wsconnected=!1,e.synced=!1,z0(e.awareness,Array.from(e.awareness.getStates().keys()).filter(t=>t!==e.doc.clientID),e),e.emit(`status`,[{status:`disconnected`}])),e.wsUnsuccessfulReconnects++;let r=null;n!=null&&!e.shouldReconnect(n,e)&&(e.shouldConnect=!1,r={code:n.code,reason:n.reason}),setTimeout(h2,MK(PK(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime),e),r!==null&&e.emit(`closed`,[r,e])}},h2=e=>{if(e.shouldConnect&&e.ws===null){let t=new e._WS(e.url,e.protocols);t.binaryType=`arraybuffer`,e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=n=>{if(e.ws!==t)return;e.wsLastMessageReceived=NJ();let r=f2(e,new Uint8Array(n.data),!0);gq(r)>1&&t.send(_q(r))},t.onerror=n=>{e.ws===t&&e.emit(`connection-error`,[n,e])},t.onclose=n=>{m2(e,t,n)},t.onopen=()=>{if(e.ws!==t)return;e.wsLastMessageReceived=NJ(),e.wsconnecting=!1,e.wsconnected=!0,e.emit(`status`,[{status:`connected`}]);let n=hq();if(Q(n,0),Z0(n,e.doc),t.send(_q(n)),e.awareness.getLocalState()!==null){let n=hq();Q(n,1),Oq(n,B0(e.awareness,[e.doc.clientID])),t.send(_q(n))}},e.emit(`status`,[{status:`connecting`}])}},g2=(e,t)=>{let n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&Y0(e.bcChannel,t,e)},_2=class extends tY{constructor(e,t,n,{connect:r=!0,awareness:i=new R0(n),params:a={},protocols:o=[],WebSocketPolyfill:s=WebSocket,resyncInterval:c=-1,maxBackoffTime:l=2500,disableBc:u=!1,shouldReconnect:d=p2}={}){for(super();e[e.length-1]===`/`;)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+`/`+t,this.maxBackoffTime=l,this.shouldReconnect=d,this.params=a,this.protocols=o,this.roomname=t,this.doc=n,this._WS=s,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=u,this.wsUnsuccessfulReconnects=0,this.messageHandlers=l2.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=r,this._resyncInterval=0,c>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){let e=hq();Q(e,0),Z0(e,n),this.ws.send(_q(e))}},c)),this._bcSubscriber=(e,t)=>{if(t!==this){let t=f2(this,new Uint8Array(e),!1);gq(t)>1&&Y0(this.bcChannel,_q(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){let t=hq();Q(t,0),t2(t,e),g2(this,_q(t))}},this.doc.on(`update`,this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{let a=e.concat(t).concat(n),o=hq();Q(o,1),Oq(o,B0(i,a)),g2(this,_q(o))},this._exitHandler=()=>{z0(this.awareness,[n.clientID],`app closed`)},HY&&typeof process<`u`&&process.on(`exit`,this._exitHandler),i.on(`update`,this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&u2<NJ()-this.wsLastMessageReceived&&m2(this,this.ws,null)},u2/10),r&&this.connect()}get url(){let e=s2(this.params);return this.serverUrl+`/`+this.roomname+(e.length===0?``:`?`+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,e&&(this.wsUnsuccessfulReconnects=0),this.emit(`synced`,[e]),this.emit(`sync`,[e]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),HY&&typeof process<`u`&&process.off(`exit`,this._exitHandler),this.awareness.off(`update`,this._awarenessUpdateHandler),this.doc.off(`update`,this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||=(q0(this.bcChannel,this._bcSubscriber),!0);let e=hq();Q(e,0),Z0(e,this.doc),Y0(this.bcChannel,_q(e),this);let t=hq();Q(t,0),Q0(t,this.doc),Y0(this.bcChannel,_q(t),this);let n=hq();Q(n,3),Y0(this.bcChannel,_q(n),this);let r=hq();Q(r,1),Oq(r,B0(this.awareness,[this.doc.clientID])),Y0(this.bcChannel,_q(r),this)}disconnectBc(){let e=hq();Q(e,1),Oq(e,B0(this.awareness,[this.doc.clientID],new Map)),g2(this,_q(e)),this.bcconnected&&=(J0(this.bcChannel,this._bcSubscriber),!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&m2(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(h2(this),this.connectBc())}}})),y2=n({connectRealtimeRoom:()=>b2});function b2(e,t,n={}){let r=new Set,i=new Set,a=new Set,o=[],s,c=`connecting`,l=!1,u=!1,d,f,p=()=>{for(let e of r)e()},m=()=>{let t=n.origin?new URL(n.origin):window.location;return`${t.protocol===`https:`?`wss:`:`ws:`}//${t.host}${FJ(`/_vitehub/realtime/${encodeURIComponent(e)}`,n.baseURL)}`},h=t.split(`/`).map(encodeURIComponent).join(`/`),g={};function _(){l=!1,d=new CQ,f=new _2(m(),h,d,{disableBc:!0,params:{...n.params,clientId:String(d.clientID)}});let e=f;IJ(e),e.messageHandlers[5]=(t,n)=>{let r=CJ(n);r&&(r.type===`session`?e.params.epoch=r.epoch:(e.destroy(),d.destroy(),u||(_(),p())))},e.messageHandlers[6]=(t,n)=>{let r=OJ(n);if(r?.kind===`request`&&y(e,r.id,r.body),r?.kind===`notice`)for(let e of a)e(r.body)},e.awareness.off(`update`,e._awarenessUpdateHandler),e.awareness.on(`update`,({added:t,removed:n,updated:r})=>{let i=[...t,...r,...n].filter(t=>t===e.doc.clientID),a=e.ws;if(!i.length||!e.wsconnected||!a||a.readyState!==a.OPEN)return;let o=hq();Q(o,1),Oq(o,B0(e.awareness,i)),a.send(_q(o))});let t=n.identity??{id:`guest:${d.clientID}`};e.awareness.setLocalState({...g,user:WJ({...t,id:t.id||`guest:${d.clientID}`})}),e.awareness.on(`change`,p),d.getMap(VJ.status).observe(p),e.on(`sync`,t=>{f===e&&(l=t,p())}),e.on(`status`,e=>{c=e.status,p()})}_();let v;n.changes&&(v=new _2(m(),encodeURIComponent(AJ),new CQ,{disableBc:!0,params:{...n.params,workspace:`events`}}),v.awareness.setLocalState(null),IJ(v),v.messageHandlers[4]=(e,t)=>{let n=TJ(t);if(n)for(let e of i)e(n)},v.on(`status`,e=>{e.status===`connected`&&b()}));async function y(e,t,n){let r=e=>DJ({kind:`answer`,id:t,ok:!1,why:e}),i;try{i=s?DJ({kind:`answer`,id:t,ok:!0,body:await s(n)}):r(`This page does not answer requests.`),i.byteLength>x2&&(i=r(`The answer has ${i.byteLength} bytes, over the 1 MiB limit.`))}catch(e){i=r(e instanceof Error?e.message:String(e))}let a=e.ws;e.wsconnected&&a&&a.readyState===a.OPEN&&a.send(Uint8Array.from(i))}function b(){let e=v?.ws;if(v?.wsconnected&&e&&e.readyState===e.OPEN)for(;o.length;)e.send(Uint8Array.from(EJ(o.shift())))}return{get awareness(){return f.awareness},get clientId(){return d.clientID},people:()=>KJ(f.awareness.getStates()),states:()=>{let e=new Map(f.awareness.getStates());return e.delete(d.clientID),e},status:()=>c,saveStatus:()=>l?BJ(d):void 0,setLocal(e,t){if(t!==null){g[e]=t,f.awareness.setLocalStateField(e,t);return}delete g[e];let n=f.awareness.getLocalState();if(!n||!Object.hasOwn(n,e))return;let{[e]:r,...i}=n;f.awareness.setLocalState(i)},notify(e){v&&(o.push(e),b())},onUpdate(e){return r.add(e),()=>r.delete(e)},onChange(e){return i.add(e),()=>i.delete(e)},onRequest(e){return s=e,()=>{s===e&&(s=void 0)}},onNotice(e){return a.add(e),()=>a.delete(e)},destroy(){u=!0,f.destroy(),d.destroy(),v?.destroy(),v?.doc.destroy(),r.clear(),i.clear(),a.clear(),s=void 0}}}var x2,S2=t((()=>{RJ(),HJ(),JJ(),MJ(),Hq(),H0(),v2(),I0(),x2=1047552}));function C2(e){let t=document.createElement(`style`);return t.textContent=e,t}function w2(e,t){let n=new Map;for(let r of e){if(r.id===t)continue;let e=n.get(r.id);e?e.tabs++:n.set(r.id,{person:r,tabs:1})}return[...n.values()]}function T2(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0].toUpperCase()).join(``)||`?`}function E2(e){let t=[`#fb7185`,`#fbbf24`,`#34d399`,`#22d3ee`,`#60a5fa`,`#a78bfa`,`#f472b6`],n=0;for(let t=0;t<e.length;t++)n=Math.imul(31,n)+e.charCodeAt(t)|0;return t[Math.abs(n)%t.length]}function D2(e,t){let{files:n,deferredFiles:r,...i}=e,a=e=>Promise.all([e,t]).then(e=>e.flat());return n!==void 0&&!Array.isArray(n)?{...i,files:a(n)}:{...i,...n?{files:n}:{},deferredFiles:r?a(r):t}}function O2(){let e=document.documentElement;if(e.classList.contains(`dark`))return!0;if(e.classList.contains(`light`))return!1;if(e.dataset.theme===`dark`)return!0;if(e.dataset.theme===`light`)return!1;let t=getComputedStyle(e).colorScheme;return t===`dark`||t!==`light`&&matchMedia(`(prefers-color-scheme: dark)`).matches}function k2(e){e.preventDefault(),e.stopPropagation()}function A2(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))}function j2(e){if(!(e.metaKey||e.ctrlKey||e.altKey))return Object.keys(jG).find(t=>jG[t].key===e.key.toUpperCase())}function M2(){try{return localStorage.getItem(X2)===`hidden`?`hidden`:`all`}catch{return`all`}}function N2(e){try{e===`hidden`?localStorage.setItem(X2,e):localStorage.removeItem(X2)}catch{}}function P2(e,t=1){let n=document.elementsFromPoint(e.left+e.width/2,e.top+e.height/2).find(e=>!L2(e)&&e!==document.documentElement);for(let r=n??null;r&&r!==document.documentElement;r=r.parentElement){let n=r.getBoundingClientRect();if(n.left<=e.left+t&&n.top<=e.top+t&&n.right>=e.left+e.width-t&&n.bottom>=e.top+e.height-t)return r}}function F2(e,t){let n=t.getBoundingClientRect(),r=Math.max(e.left,n.left),i=Math.max(e.top,n.top);return{left:r,top:i,width:Math.min(e.left+e.width,n.right)-r,height:Math.min(e.top+e.height,n.bottom)-i}}function I2(){let e=new URL(location.href);e.searchParams.has(e4)&&(e.searchParams.delete(e4),history.replaceState(history.state,``,e))}function L2(e){for(let t=e;t;){if(t.closest(`[data-comments-ui], vitehub-pill, vitehub-window`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}function R2(e){let{host:t,context:n,session:r}=e,i=t.shadowRoot,a=document.createElement(`div`);a.className=`root`,i.replaceChildren(C2(B2(WG)),a);let o=[i,e.toolbar?.getRootNode(),e.areas].filter(e=>e instanceof ShadowRoot).map(e=>bw(e)),s=B(Di(location.pathname)),c=Ks(r?.subject??{kind:`page`,id:s.value}),u=r?.revision,d=B(!1),f=B(!1),p=0,m=B(location.search),h=Ks(),g=new WeakMap,_=0,v=e=>{let t=g.get(e);return t===void 0&&g.set(e,t=++_),t},y=B(),b=B(!1),x=Ks(),S=B(!1),C,w=B(!1),T=B(0),E=B(`marker`),D=B(`pink`),O,k=new WeakMap,A=Ks(),ee=B(new Set),j=B(!1),M=B(`comment`),N,te=B(Pi()),P=B(0),ne=Ks([]),F=B(`open`),re=B(null),ie=Ks(),ae=B(0),I=B(M2()===`hidden`),oe,L,se=0,ce,le,ue=new Set,de=new WeakMap,fe=(e,t=!1)=>{clearTimeout(le),h.value=e,t||(le=setTimeout(()=>h.value=void 0,e.kind===`error`?8e3:5e3))},pe=e=>fe({text:e.fix?`${e.why} ${e.fix}`:e.why,kind:`error`}),me=()=>r?.user??void 0,R=r?.presence!==!1,he=Y(()=>me()??(te.value?{id:`guest:${te.value.id}`,name:te.value.name,guest:!0}:void 0)),ge=Ks(r?.can),_e=Ks(r?.agent),ve=Ks(r?.repository),ye=Y(()=>!!ge.value?.comment),be=Y(()=>ye.value&&r?.attachments!==!1),xe=Y(()=>ye.value&&!he.value),Se=Y({get:()=>I.value&&ye.value?`hidden`:`all`,set:e=>{I.value=e===`hidden`,N2(e)}}),Ce=(e,t)=>{let n=he.value;return!n||xe.value?!1:t.message?.delivery&&(e===`edit`||e===`delete`)?!0:tm(n,ge.value,e,t)},we=da({onPeople(e){let t=new Map(ne.value.map(e=>[e.id,e]));for(let n of e)t.set(n.id,n);ne.value=[...t.values()]},onChange:()=>oe?.setLocal(`commentsChange`,crypto.randomUUID())});function Te(e){let t=oa(),n=lh({transport:{...we,subscribe(e){return ue.add(e),()=>ue.delete(e)}},user:e,...e?{outbox:{account:e.id,namespace:t}}:{}}),r=n.create;return n.create=e=>{let t=e.revision??u,n=k.get(e.anchor);k.delete(e.anchor),n&&(n.sent=!0);let i={...n?D2(e,n.files):e,context:de.get(e.anchor)??RH(void 0),...t===void 0?{}:{revision:t}};return r(i)},n}let Ee=Ks(Te(he.value));H(()=>he.value?.id,()=>Ee.value=Te(he.value));let De=()=>{for(let e of ue)e({type:`reconnected`})},Oe,ke=()=>{clearTimeout(Oe),Oe=setTimeout(De,100)},Ae=Y(()=>{let e=s.value;return r?.send?nh(fa(()=>e)):void 0}),je=e=>{let t=we.attachmentUrl(e);return t?[new URL(t,location.href).href]:[]},Me=e=>({id:e.id,anchor:e.anchor,messages:e.messages.map(e=>({author:e.author.name??e.author.id,body:e.body})),...e.revision===void 0?{}:{revision:e.revision},files:e.messages.flatMap(e=>e.attachments.flatMap(je))}),Ne=e=>({url:new URL(s.value,location.origin).href,threads:e.map(Me),..._e.value?{agent:_e.value}:{}});async function Pe(e){let t=await navigator.clipboard?.writeText(dm(Ne(e))).then(()=>!0,()=>!1);fe(t?{text:`Prompt copied. Paste it in your agent.`,kind:`info`}:{text:`Could not copy the prompt. Allow clipboard access and try again.`,kind:`error`})}let Fe=Y(()=>z.openThreads.value.filter(e=>!e.delivery)),Ie=Y(()=>!d.value&&Fe.value.length>0),Le=B(!1),Re=B(!1),ze;async function Be(){if(!Ie.value)return;let e=p,t=await navigator.clipboard?.writeText(pm(Ne(Fe.value))).then(()=>!0,()=>!1);if(e===p){if(!t)return fe({text:`Could not copy the prompt. Allow clipboard access and try again.`,kind:`error`});Le.value=!0,clearTimeout(ze),ze=setTimeout(()=>Le.value=!1,1500)}}let Ve=e=>{let t=fm(Ne(e),ve.value);return t?q(qw,{"aria-label":`Open in T3 Code`,color:`neutral`,"data-action":`open-in-t3-code`,label:`Open in T3 Code`,rel:`noopener noreferrer`,size:`xs`,target:`_blank`,title:`Open in T3 Code`,to:t,variant:`ghost`},()=>q(Kw,{name:`i-lucide-arrow-up-right`})):q(`small`,`Too long for T3 Code. Copy the prompt instead.`)},He=({thread:e})=>e.status===`open`&&!e.delivery?[Ve([e]),q(qw,{color:`neutral`,"data-action":`copy-prompt`,icon:`i-lucide-copy`,label:`Copy`,onClick:()=>void Pe([e]),size:`xs`,variant:`ghost`})]:[],Ue=()=>{let e=Fe.value;return F.value===`open`&&Ie.value?[q(qw,{"aria-label":Le.value?`Copied`:`Copy prompt`,color:`neutral`,"data-action":`copy-page-prompt`,icon:Le.value?`i-lucide-check`:`i-lucide-copy`,label:Le.value?`Copied`:`Copy prompt`,onClick:()=>void Be(),size:`xs`,title:We(),variant:`ghost`}),Ve(e)]:[]},We=()=>_e.value?`Copy a prompt that sends your agent to these comments in the ViteHub Console`:`Copy a prompt with the open comments for your agent`,Ge=({delivery:{status:e,error:t},retry:n})=>{let r=e===`failed`,i=t?.status===401||t?.status===402,a=r?`Not sent.`:t?`Waiting to send.`:`Sending…`;return[q(`span`,{class:`delivery`,"data-failed":r?`true`:void 0},t?`${a} ${t.why}`:a),...n&&(r||i)?[q(qw,{color:`neutral`,label:`Retry`,onClick:()=>void n(),size:`xs`,variant:`ghost`})]:[]]},Ke=VH({page:()=>s.value,info:e=>fe({text:e,kind:`info`}),failed:pe,drafted(e){ee.value=new Set([...ee.value,e])}}),z;function qe(e){if(e!==`mark`&&Ze(),d.value&&(f.value=e===`comment`&&ye.value),!(d.value&&e!==`edit`&&e!==`view`)){if(e===`mark`){if(!be.value||w.value)return;if(xe.value){M.value=e,N=void 0,j.value=!0;return}Ke.finish(!0),S.value=!1,z.exit(),Xe()}else if(e===`comment`){if(!ye.value)return;if(xe.value){M.value=e,N=void 0,j.value=!0;return}Ke.finish(!0),S.value=!1,z.enter()}else if(e===`edit`){if(!r?.content||!ye.value||(z.exit(),z.active.value))return;S.value=!0,Re.value=!0}else j.value=!1,N=void 0,z.exit(),S.value=!1,Ke.finish(!0);A.value=void 0}}let Je=Y(()=>w.value?`mark`:S.value?`edit`:z?.active.value?`comment`:`view`),Ye=Y(()=>Je.value===`comment`||d.value&&f.value||j.value&&M.value!==`mark`);function Xe(){Qe(),C=wG({tip:()=>E.value,color:()=>MG[D.value],onChange:()=>T.value=C?.strokes().length??0,onSubmit:$e}),T.value=0,w.value=!0}function Ze(){C?.remove(),C=void 0,T.value=0,w.value=!1}function Qe(){O?.session.remove(),O=void 0}function $e(){let e=C;e?.commit();let t=e?.strokes()??[],n=yG(t);if(!e||!n)return;e.freeze();let r=AG(t,e=>e instanceof Element&&L2(e));C=void 0,w.value=!1,T.value=0;let i=z.draft.value,a=P2(n,jG.marker.width/2+1);try{if(a){let e=F2(n,a);z.startDraft(a,{area:e,point:{x:e.left,y:e.top}})}else z.startDraft(`page`)}catch{}let o=z.draft.value;if(!o||o===i){e.remove();return}O={session:e,draft:o};let s={files:r.then(e=>e?[new File([e],`highlight.webp`,{type:e.type})]:[],()=>[]),sent:!1};k.set(Us(o.anchor),s),s.files.then(e=>{!e.length&&(s.sent||z.draft.value===o)&&fe({text:`This page could not be drawn as a picture. The comment marks the area without one.`,kind:`info`})})}async function et(e=!1){if(!r?.realtime||!t.isConnected||n?.signal.aborted||oe&&!e)return;let i=++se,a=await ja(()=>Promise.resolve().then(()=>(S2(),y2)),void 0,import.meta.url).catch(()=>void 0);if(!a||i!==se||!t.isConnected||n?.signal.aborted)return;oe?.destroy(),L?.destroy();let o=me()??(te.value?{id:`guest:${te.value.id}`,name:`${te.value.name} (guest)`}:void 0),l=Ei(import.meta.url).slice(0,-Mi.length),u=a.connectRealtimeRoom(Ai,Oi(s.value),{identity:o,baseURL:l,params:{page:s.value}}),d=new Map;u.onUpdate(()=>{P.value++;let e=new Map,t=!1;for(let[n,r]of u.states())n!==u.clientId&&typeof r.commentsChange==`string`&&(e.set(n,r.commentsChange),d.get(n)!==r.commentsChange&&(t=!0));d=e,t&&ke()}),L=a.connectRealtimeRoom(ji,ki(c.value),{baseURL:l,params:{page:s.value}}),L.onNotice(ke),oe=u}function tt(){se++,clearTimeout(Oe),oe?.destroy(),oe=void 0,L?.destroy(),L=void 0}function nt(){if(n){if(!ce){let e=()=>t.classList.contains(`dark`),r=n.createWindow({id:`comments`,title:`Comments`,trigger:n.bar,colorScheme:()=>e()?`dark`:`light`,expand:!1,onHide:()=>b.value=!1});ce=r;let i=document.createElement(`div`);i.setAttribute(`data-comments-ui`,``);let a=i.attachShadow({mode:`open`});o.push(bw(a));let s=document.createElement(`div`);s.className=`panel-root`;let c=()=>{i.classList.toggle(`dark`,e()),s.classList.toggle(`dark`,e()),r.syncColorScheme?.()};c();let l=new MutationObserver(c);l.observe(t,{attributes:!0,attributeFilter:[`class`]}),o.push(()=>l.disconnect()),a.append(C2(B2(GG)),s),r.body.append(i),x.value=s}b.value=!0,ce.show()}}async function rt(e){te.value=Fi(e),j.value=!1,et(!0);let t=M.value;M.value=`comment`;let n=N;if(N=void 0,await Zc(),n?.startContainer.isConnected){let e=getSelection();if(e?.removeAllRanges(),e?.addRange(n),ut())return}qe(t)}async function it(e){await fetch(e,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:`{}`}).catch(()=>void 0),location.reload()}function at(t){let n=new URL(location.href);n.searchParams.set(l,`comments`);let r=t.signIn,i=r?.provider===`console`,a=t.github;if(a&&t.signOut){let e=t.signOut,n=a.repository?`@${a.login} cannot push to ${a.repository}, so cannot comment here.`:`Signed in as @${a.login}, but this site does not say which GitHub repository it is built from.`;fe({text:n,kind:`error`,action:[`Use another account`,()=>void it(e)]},!0)}else fe(r?{text:`Sign in to comment on this page.`,kind:`info`,link:i?{label:`Sign in to ViteHub`,href:r.url,newTab:!0}:{label:`Sign in with GitHub`,href:`${r.url}?return=${encodeURIComponent(n.pathname+n.search+n.hash)}`},action:[`Close`,e.exit]}:{text:`Comments are only for the site's team. Sign in with an account that may comment.`,kind:`error`,action:[`Close`,e.exit]},!0)}function ot(){let e=getSelection();if(!ye.value||S.value||d.value||!e||e.isCollapsed||e.rangeCount===0||!e.toString().trim())return;let t=e.getRangeAt(0),n=t.commonAncestorContainer,r=n instanceof Element?n:n.parentElement;if(!(!r?.isConnected||L2(r)||r.closest(`input, textarea, select, [contenteditable]:not([contenteditable='false'])`)))return t.cloneRange()}let st,ct=!1;function lt(){if(ct)return;st=z?.draft.value?void 0:ot();let e=st?.getBoundingClientRect();ie.value=e&&(e.width||e.height)?{left:e.left+e.width/2,top:e.top,bottom:e.bottom}:void 0}function ut(e=ot()){if(ct=!1,!e)return!1;if(xe.value)return M.value=`comment`,N=e,j.value=!0,!0;Ke.finish(!0);let t=e.getBoundingClientRect();try{z.startDraft(e,{point:{x:t.right,y:t.top}}),getSelection()?.removeAllRanges()}catch{return!1}return st=void 0,ie.value=void 0,!0}let dt=typeof CSS<`u`&&`highlights`in CSS&&typeof Highlight==`function`;function ft(){if(!dt)return;let e={open:[],resolved:[],active:[],draft:[]},t=new Set([z.openId.value,z.hoverId.value].filter(Boolean)),n=z.threads.value.filter(e=>z.isShown(e.id));for(let r of n){if(r.anchor.kind!==`text`||!z.isShown(r.id))continue;let n=Km(r.anchor);n&&e[t.has(r.id)?`active`:r.status===`resolved`?`resolved`:`open`].push(n)}let r=z.draft.value?.anchor;if(r?.kind===`text`){let t=Km(Us(r));t&&e.draft.push(t)}for(let[t,n]of Object.entries(z2))CSS.highlights.set(n,new Highlight(...e[t]))}function pt(){if(dt)for(let e of Object.values(z2))CSS.highlights.delete(e)}let mt=U({setup(){let e=B(null);Zc(()=>e.value?.focus());let t=t=>{t.preventDefault();let n=e.value?.value.trim();n?rt(n):e.value?.focus()};return()=>q(`form`,{class:`card`,role:`dialog`,"aria-label":`Your name`,onSubmit:t,onKeydown:e=>e.key===`Escape`&&(j.value=!1)},[q(`label`,[`Your name`,q(`input`,{"aria-label":`Your name`,autocomplete:`name`,maxlength:64,placeholder:`Shown next to your comments`,ref:e})]),q(`div`,{class:`row`},[q(qw,{color:`neutral`,label:`Cancel`,onClick:()=>j.value=!1,size:`sm`,variant:`ghost`}),q(qw,{label:`Comment`,size:`sm`,type:`submit`})])])}}),ht=U({name:`CommentsOverlay`,setup(){z=FO({client:Ee.value,subject:()=>c.value,location:()=>({href:location.href,origin:location.origin,search:m.value}),user:()=>he.value,people:ne,hotkey:!1,ignore:L2,can:Ce,uiRoot:()=>i,autoStart:!!r?.can.read,visibility:Se}),H(Je,t=>e.onMode(t),{immediate:!0,flush:`sync`}),H(()=>z.status.value,e=>{e===`ready`&&!oe&&et()}),H(()=>z.status.value===`ready`&&!d.value?m.value:void 0,e=>{let t=p;e&&Zc(()=>{t===p&&!d.value&&location.search===e&&I2()})},{immediate:!0}),H(()=>z.counts.value.open,()=>P.value++);let t,n=()=>{let e=y.value;t&&t.element!==e&&(t.motion.destroy(),t=void 0),e&&(t?t.motion.play():t={element:e,motion:rw(e)},t.motion.measure())};Dd(n),kd(n),Ad(()=>t?.motion.destroy()),r?.send&&H(()=>z.threads.value,()=>void Ae.value?.refresh().catch(()=>void 0)),H(F,e=>{z.filters.resolved=e===`resolved`}),H(()=>z.filters.resolved,e=>{e&&(F.value=`resolved`)}),H(()=>z.draft.value,e=>{if(!e||e.anchor.kind===`page`)return;let t=document.elementsFromPoint(e.point.x,e.point.y).find(e=>!L2(e)&&e!==document.documentElement);t&&(e.anchor.kind===`element`&&(e.anchor=Wa(t,e.point.x,e.point.y)),de.set(Us(e.anchor),RH(t)))},{flush:`sync`}),H([ae,z.pageThreads,z.openId,z.hoverId,()=>z.draft.value?.anchor,z.shown],ft,{flush:`post`}),H(()=>z.draft.value,lt),H(()=>z.draft.value,e=>{O&&e!==O.draft&&Qe(),e?.anchor.kind===`page`&&b.value&&ce?.hide()});let a=UH(e.toolbar);return()=>{let t=[];if(ge.value?.read&&!d.value){t.push(q(hH,{comments:z,readOnly:!he.value,canComment:ye.value,queueFiles:be.value,attachmentUrl:we.attachmentUrl,style:a.value?{"--vh-comment-island-top":a.value}:void 0},{default:()=>[],status:Ge,actions:He})),t.push(q(`div`,{class:`cursors`,ref:y},bt())),t.push(q(`div`,{class:`outlines`},xt())),t.push(e.areas?q(bd,{to:e.areas},yt()):q(`div`,{class:`areas`},yt()));let n=ie.value;if(n&&!z.draft.value){let e=matchMedia(`(pointer: coarse)`).matches,r=n.bottom+(e?20:8),i=n.top<(e?102:56)||e&&r<=innerHeight-46,a=i?Math.min(r,innerHeight-46):n.top-(e?64:8);t.push(q(`div`,{class:`selection`,"data-below":i?`true`:void 0,style:{left:`${Math.min(Math.max(64,n.left),innerWidth-64)}px`,top:`${a}px`},onPointerdown:e=>{e.preventDefault(),ct=!0,addEventListener(`pointerup`,()=>setTimeout(()=>{ct&&(ct=!1,lt())},300),{capture:!0,once:!0})}},q(CH,{side:i?`bottom`:`top`,onComment:()=>ut(st)})))}x.value&&!d.value&&t.push(q(bd,{to:x.value},q(bH,{key:s.value,comments:z,attachmentUrl:we.attachmentUrl,readOnly:!he.value||!z.threads.value.some(e=>e.id===re.value)&&!ye.value,"onUpdate:thread":e=>re.value=e,status:F.value,"onUpdate:status":e=>F.value=e,title:s.value,heading:!1,composer:!1,queueFiles:be.value,onSelect:e=>{let t=z.positions.value.get(e.id);t&&!t.detached&&t.element?.scrollIntoView({block:`center`,behavior:`smooth`})}},{status:Ge,actions:He,"list-actions":Ue})))}ge.value?.read&&e.toolbar&&t.push(q(bd,{to:e.toolbar},vt())),j.value&&t.push(q(mt));let n=h.value;return t.push(q(`section`,{role:`region`,"aria-label":`Comments notifications`},q(`ol`,{class:`toasts`},n?[q(`li`,{class:`toast`,role:`status`,"data-kind":n.kind,key:v(n)},[q(`span`,n.text),n.link?q(`a`,{href:n.link.href,...n.link.newTab?{target:`_blank`,rel:`noopener noreferrer`}:{}},n.link.label):null,n.action?q(qw,{color:`neutral`,label:n.action[0],onClick:n.action[1],size:`sm`,variant:`ghost`}):null])]:[]))),t}}});function gt(e){E.value=e,C?.restyle()}function _t(){let e=e=>e.preventDefault();return q(`div`,{class:`toolbar`,role:`group`,"aria-label":`Highlight`},[q(`div`,{class:`swatches`},Object.keys(jG).map(e=>q(`button`,{key:e,class:`swatch`,type:`button`,"aria-label":jG[e].label,"aria-keyshortcuts":jG[e].key,"aria-pressed":String(E.value===e),title:`${jG[e].label} (${jG[e].key})`,onClick:()=>gt(e)},W2[e]()))),q(`span`,{class:`sep`}),q(`div`,{class:`swatches`},Object.keys(MG).map(t=>q(`button`,{key:t,class:`swatch`,type:`button`,"aria-label":`${t[0].toUpperCase()}${t.slice(1)} ink`,"aria-pressed":String(D.value===t),onMousedown:e,onClick:()=>{D.value=t,C?.restyle()}},q(`span`,{style:{background:MG[t]}})))),q(`span`,{class:`sep`}),q(`button`,{type:`button`,class:`icon`,"aria-label":`Undo`,"aria-keyshortcuts":`Meta+Z Control+Z`,title:`Undo`,disabled:T.value===0,onClick:()=>C?.undo()},G2()),q(`button`,{type:`button`,onClick:()=>qe(`view`),title:`Cancel (Esc)`},`Cancel`),q(`button`,{type:`button`,class:`done`,"aria-keyshortcuts":`Enter`,disabled:T.value===0,onClick:$e,title:`Comment on the highlighted area (Enter)`},`Done`)])}function vt(){if(P.value,w.value)return _t();let e=r?.signOut,t=e?r?.github:void 0,n=R?w2(oe?.people()??[],he.value?.id):[],i=n.slice(0,5).map(({person:e,tabs:t})=>q(`span`,{class:`avatar`,key:e.id,title:t>1?`${e.name} · ${t} tabs`:e.name,style:{background:e.color}},e.image?q(`img`,{src:e.image,alt:``}):T2(e.name))),a=`${n.length} other ${n.length===1?`person`:`people`} on this page`,o=z.counts.value.open,c=Ye.value,l=Se.value===`hidden`,u=l?`Show comments`:`Hide comments`,d=e=>e&&o>0?q(V2,{value:o}):null,f=()=>b.value?ce?.hide():nt(),p=[be.value?q(`button`,{"aria-keyshortcuts":`B`,"aria-pressed":`false`,onClick:()=>qe(`mark`),title:`Highlight the page and comment (B)`,type:`button`},[U2(),`Highlight`]):null,r?.content&&ye.value?q(`button`,{"aria-keyshortcuts":`E`,"aria-pressed":String(Je.value===`edit`),onClick:()=>qe(Je.value===`edit`?`view`:`edit`),title:`Edit text (E)`,type:`button`},[K2(),`Edit`]):null].filter(e=>e!==null);return q(`div`,{class:`toolbar`,role:`group`,"aria-label":`Comments`},[q(`span`,{class:`lead`},[ye.value?q(`button`,{"aria-keyshortcuts":`C`,"aria-label":c?`Comments: click anywhere on the page`:o?`Comments, ${o} open`:`Comments`,"aria-pressed":String(c),onClick:()=>qe(c?`view`:`comment`),title:c?`Stop commenting (C)`:`Comment on the page (C)`,type:`button`},[H2(),c?`Click anywhere`:`Comments`,d(!c)]):q(`button`,{"aria-expanded":String(b.value),"aria-label":o?`Comments, ${o} open`:`Comments`,onClick:f,title:`Show comments`,type:`button`},[H2(),`Comments`,d(!0)]),ye.value?q(`button`,{"aria-keyshortcuts":`Shift+C`,"aria-label":u,class:`eye`,"data-comments-hidden":String(l),onClick:()=>Se.value=l?`all`:`hidden`,title:`${u} (Shift+C)`,type:`button`},l?Y2():J2()):null]),c?q(`button`,{"aria-expanded":String(b.value),onClick:f,title:`All comments on this page`,type:`button`},[$2(),`All comments`,d(!b.value)]):null,Ae.value&&ye.value?q(hV,{client:Ae.value,key:`send:${s.value}`}):null,Ie.value?q(`button`,{"data-action":`copy-page-prompt`,onClick:()=>void Be(),title:We(),type:`button`},q(`span`,{class:`swap`},[q(`span`,{"data-shown":String(!Le.value)},[Z2(),`Copy prompt`]),q(`span`,{"data-shown":String(Le.value)},[Q2(),`Copied`])])):null,p.length===1?p[0]:null,p.length>1?q(`div`,{class:`more`,hidden:!Re.value,id:`vitehub-comments-more`,role:`group`,"aria-label":`More comment tools`},p):null,p.length>1?q(`button`,{"aria-controls":`vitehub-comments-more`,"aria-expanded":String(Re.value),"aria-label":Re.value?`Fewer tools`:`More tools`,class:`toggle`,"data-action":`more-tools`,onClick:()=>Re.value=!Re.value,title:Re.value?`Fewer tools`:`More tools`,type:`button`},q2()):null,i.length>0?q(`span`,{"aria-label":a,class:`people`},i):null,e&&t?q(`button`,{"aria-label":`Sign out @${t.login}`,onClick:()=>void it(e),title:`Signed in as @${t.login}. Sign out`,type:`button`},r?.user?.image?q(`img`,{alt:``,class:`me`,src:r.user.image}):T2(r?.user?.name??t.login)):null])}function yt(){let e=[],t=(t,n,r)=>{let i=z.positions.value.get(t);if(!i||i.detached||i.clipped||n!==`area`&&n!==`image`||!i.width||!i.height)return;let a=t!==`draft`&&z.leaving.value.has(t);(t===`draft`||a||z.isShown(t))&&e.push(q(`div`,{key:t,"data-leaving":a?`true`:void 0,"data-active":r.active?`true`:void 0,"data-draft":r.draft?`true`:void 0,"data-slot":`comment-mark-area`,"data-status":r.status,style:{left:`${i.x}px`,top:`${i.y}px`,width:`${i.width}px`,height:`${i.height}px`}}))},n=new Set([z.openId.value,z.hoverId.value]);for(let e of z.threads.value)t(e.id,e.anchor.kind,{status:e.status,active:n.has(e.id)});let r=z.draft.value;return r&&t(`draft`,r.anchor.kind,{draft:!0}),e}function bt(){P.value;let e=[];if(!R)return e;for(let[t,n]of oe?.states()??[]){let r=n.cursor,i=n.user;if(!r||!i?.id||i.id===he.value?.id)continue;let a=null;try{a=document.querySelector(r.selector)}catch{}if(!a)continue;let o=a.getBoundingClientRect(),s=typeof i.color==`string`&&/^#[\da-f]{6}$/i.test(i.color)?i.color:E2(i.id);e.push(q(`div`,{class:`cursor`,key:t,style:{left:`${o.left+r.x/1e3*o.width}px`,top:`${o.top+r.y/1e3*o.height}px`}},[q(`svg`,{width:15,height:15,viewBox:`0 0 24 24`,"aria-hidden":`true`},q(`path`,{d:`M4 2l16 7-7 2-3 8z`,fill:s,stroke:`#000`,"stroke-width":1.5})),q(`span`,{style:{background:s}},i.name??`Someone`)]))}return e}function xt(){if(P.value,!S.value)return[];let e=[];for(let t of document.querySelectorAll(`[${Ga}]`)){let n=t.getAttribute(Ga),r=t===A.value?`hover`:ee.value.has(n)?`draft`:void 0;if(!r)continue;let i=t.getBoundingClientRect();e.push(q(`div`,{class:`outline`,"data-kind":r,key:`${n}-outline`,style:{left:`${i.left-3}px`,top:`${i.top-3}px`,width:`${i.width+6}px`,height:`${i.height+6}px`}})),e.push(q(`div`,{class:`tag`,key:`${n}-tag`,style:{left:`${i.left-3}px`,top:`${i.top-3}px`}},r===`draft`?`Draft`:n))}return e}let St=xp({render:()=>q(ht,{key:he.value?.id??``})});Gw(St),St.mount(a),r&&!r.can.read?e.prompt!==!1&&at(r):e.failure&&fe({text:e.failure.why,kind:`error`,action:[`Close`,e.exit]},!0);let Ct;function wt(){h.value===Ct&&(h.value=void 0),Ct=void 0}function Tt(e){let t=++p;_a.session(e).then(async([n,r])=>{if(t!==p||s.value!==e)return;if(n){Ct={text:`${n.why} Comments are paused on this page.`,kind:`error`,action:[`Retry`,()=>{s.value===e&&Tt(e)}]},fe(Ct,!0);return}wt(),ge.value=r.can,_e.value=r.agent,ve.value=r.repository,u=r.revision;let i=r.subject??{kind:`page`,id:e};if(i.kind!==c.value.kind||i.id!==c.value.id?c.value=i:!oe&&z.status.value===`ready`&&et(),await Zc(),t!==p)return;d.value=!1;let a=f.value;f.value=!1,a&&qe(`comment`)})}let Et={text:`Comments hidden. Press Shift+C to show them.`,kind:`info`};function Dt(){let e=Se.value!==`hidden`;Se.value=e?`hidden`:`all`,e?fe(Et):h.value===Et&&(h.value=void 0)}function Ot(){ye.value?qe(`comment`):nt()}let kt=()=>[i,x.value?.getRootNode()].filter(e=>e instanceof ShadowRoot),At=()=>kt().some(e=>e.querySelector(`[data-slot='comment-composer'][data-dirty='true']`)!==null),jt=()=>At()||!!Ee.value.outbox?.entries.length,Mt,Nt;return{app:St,hasUnsentComment:At,waitForPendingComment:()=>(Nt||!jt()||(fe({text:`Send or discard your Hosted Comments draft to switch to the app's Comments.`,kind:`info`}),Nt=new Promise(e=>{let t=()=>{jt()||Mt?.()},n=new MutationObserver(t),r=Ee.value.onChange(t);Mt=()=>{n.disconnect(),r(),Mt=void 0,Nt=void 0,e()};for(let e of kt())n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-dirty`]})})),Nt),showPanel:nt,pressComments:Ot,setMode:qe,finishEdit:Ke.finish,navigated(e){if(e===s.value)m.value=location.search;else{if(At()){if(!window.confirm(`Discard your unsent comment and show comments for the new page?`))return;z.cancelDraft()}j.value=!1,N=void 0,s.value=e,clearTimeout(ze),Le.value=!1,m.value=location.search,re.value=null,w.value&&qe(`view`),Qe(),wt(),f.value=f.value||z.active.value,z.active.value=!1,d.value=!0,Tt(e),tt()}},refresh:De,pointer(e,t){if(S.value){let e=t?Ua(t):void 0;e!==A.value&&(A.value=e)}if(!oe||!t||!R)return;let n=t.getBoundingClientRect();oe.setLocal(`cursor`,{selector:za(t),x:n.width?Math.round((e.clientX-n.left)/n.width*1e3):0,y:n.height?Math.round((e.clientY-n.top)/n.height*1e3):0})},leave:()=>oe?.setLocal(`cursor`,null),layout:e=>{P.value++,e&&ae.value++,ie.value&&lt()},selectionChanged:lt,promptAccess:()=>{r&&!r.can.read&&at(r)},editMode:()=>S.value,editElement:()=>Ke.element,startEdit:e=>Ke.start(e),key(e){if(e.key===`Escape`&&S.value){qe(`view`);return}let t=n?.bar.parentElement?.hasAttribute(`collapsed`)===!0,i=e.metaKey||e.ctrlKey||e.altKey;if(e.shiftKey&&e.key.toLowerCase()===`c`&&!i&&!A2(e)&&ye.value)k2(e),e.repeat||Dt();else if(!(t&&!i&&/^[a-z]$/i.test(e.key))){if(w.value&&(e.key!==`b`||E.value!==`marker`)){let t=j2(e);if(t)gt(t);else if(e.key===`Escape`)qe(`view`);else if(e.key===`Enter`)$e();else if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`z`)C?.undo();else if(![` `,`PageUp`,`PageDown`,`Home`,`End`,`ArrowUp`,`ArrowDown`].includes(e.key))return;k2(e)}else A2(e)||i||(e.key===`c`&&!e.shiftKey&&ye.value&&(k2(e),ut()||qe(Ye.value?`view`:`comment`)),e.key===`b`&&be.value&&(k2(e),qe(Je.value===`mark`?`view`:`mark`)),e.key===`e`&&r?.content&&ye.value&&(k2(e),qe(Je.value===`edit`?`view`:`edit`)))}},destroy(){Mt?.(),Ze(),Qe(),pt(),clearTimeout(le),Ke.finish(!1),tt(),St.unmount(),ce?.destroy();for(let e of o)e()}}}var z2,B2,V2,H2,U2,W2,G2,K2,q2,J2,Y2,X2,Z2,Q2,$2,e4,t4=t((()=>{h(),EH(),iB(),Sw(),Xw(),OH(),AH(),X(),qa(),uh(),rm(),_m(),ih(),Ni(),Bi(),va(),BH(),HH(),GH(),VG(),YG(),Ma(),z2={open:`vh-comment`,resolved:`vh-comment-resolved`,active:`vh-comment-active`,draft:`vh-comment-draft`},B2=e=>`${e}\n${kH.replaceAll(`:root.dark`,`:host(.dark)`).replaceAll(`:root`,`:host`)}\n${DH}`,V2=U({props:{value:{required:!0,type:Number}},setup(e){let t=B(),n=String(e.value);return Dd(()=>t.value&&IC(t.value,e.value)),H(()=>e.value,e=>t.value&&IC(t.value,e),{flush:`post`}),()=>q(`span`,{class:`count`,ref:t},n)}}),H2=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`})),U2=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`m9 11-6 6v3h9l3-3M22 12l-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`})),W2={marker:U2,pen:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z`})),arrow:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M7 17 17 7M7 7h10v10`})),text:()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M4 7V4h16v3M9 20h6M12 4v16`}))},G2=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M9 14 4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 0 11H11`})),K2=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M21.17 6.81a1 1 0 0 0-3.98-3.98L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5zM15 5l4 4`})),q2=()=>q(`svg`,{class:`plus`,width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M12 5v14M5 12h14`})),J2=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[q(`path`,{d:`M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0`}),q(`circle`,{cx:12,cy:12,r:3})]),Y2=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M10.73 5.08A10.43 10.43 0 0 1 12 5c4.97 0 8.9 3.06 9.94 6.65a1 1 0 0 1 0 .7 10.8 10.8 0 0 1-1.44 2.49M14.08 14.16a3 3 0 0 1-4.24-4.24M17.48 17.5a10.75 10.75 0 0 1-15.42-5.15 1 1 0 0 1 0-.7 10.75 10.75 0 0 1 4.45-5.14M2 2l20 20`})),X2=`vitehub-comments-visibility`,Z2=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[q(`rect`,{width:14,height:14,x:8,y:8,rx:2}),q(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]),Q2=()=>q(`svg`,{width:14,height:14,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M20 6 9 17l-5-5`})),$2=()=>q(`svg`,{width:15,height:15,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},q(`path`,{d:`M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01`})),e4=`comment`})),n4=n({default:()=>s4,startHostedOverlay:()=>c4});function r4(e){let t=document.createElement(`style`);return t.textContent=e,t}function i4(e){return t=>{customElements.get(e)||customElements.define(e,class extends a4{});let n=document.createElement(e);if(!(n instanceof a4))yi(xi.COMMENTS_OVERLAY_ELEMENT_TAKEN({name:e}));else return n.context=t,e===`vitehub-hosted-comments`&&n.addEventListener(Ca,e=>{if(!(e instanceof CustomEvent))return;let t=e.detail,r=n.waitForPendingComment();r&&(t.draft={ready:r,stop:()=>n.stop()})}),document.documentElement.append(n),()=>n.stop()}}var a4,o4,s4,c4,l4=t((()=>{h(),Pa(),Ia(),qa(),Si(),Ni(),va(),t4(),YG(),a4=class extends HTMLElement{context;documentStyle=r4(`@layer components {\n${Na}\n}\n${qG}`);areas=document.createElement(`vitehub-comment-areas`);toolbar=document.createElement(`div`);control;mode=`view`;frame=0;changed=!1;lastCursor=0;cleanups=[];waitForPendingComment(){return this.control?.waitForPendingComment()}get active(){return this.isConnected&&!this.context?.signal.aborted}async connectedCallback(){this.setAttribute(`data-comments-ui`,``),this.shadowRoot||this.attachShadow({mode:`open`});let e=this.context?.bar;if(e){e.tabIndex=-1,e.setAttribute(`data-comments-ui`,``);let t=e.shadowRoot??e.attachShadow({mode:`open`}),n=document.createElement(`button`);n.disabled=!0,n.setAttribute(`aria-busy`,`true`),n.textContent=this.context?.tool.label??`Comments`,t.replaceChildren(r4(p+KG+Fa),this.toolbar),this.toolbar.replaceChildren(n)}this.restoreDocumentState(),this.cleanups.push(()=>this.documentStyle.remove());let t=this.areas.shadowRoot??this.areas.attachShadow({mode:`open`});t.replaceChildren(r4(Na+JG)),this.areas.setAttribute(`data-comments-ui`,``),document.documentElement.append(this.areas),this.cleanups.push(()=>this.areas.remove()),this.followTheme();let[n,r]=await _a.session(Di(location.pathname)),i=this.active&&!n&&r.can.read;if(e&&(e.hidden=!i),this.active){if(this.toolbar.replaceChildren(),this.control=R2({host:this,...this.context?{context:this.context}:{},...e?{toolbar:this.toolbar}:{},areas:t,...n?{failure:n}:{session:r},onMode:e=>{this.mode=e,this.restoreDocumentState()},exit:()=>this.context?.exit(),prompt:this.context?.open!==!1}),!i){if(e&&r&&this.active&&!this.context?.open&&(r.signIn||r.signOut)){let t=document.createElement(`button`);t.type=`button`,t.textContent=this.context?.tool.label??`Comments`,t.addEventListener(`click`,()=>this.control?.promptAccess()),this.toolbar.replaceChildren(t),e.hidden=!1}}else this.listen(),this.context?.onOpen(()=>this.control?.showPanel()),this.context?.beforeExit(()=>!this.control?.hasUnsentComment()||window.confirm(`Turn off tools without sending your comment?`)),new URLSearchParams(location.search).has(`comment`)||(this.context?.linked?this.control.pressComments():this.context?.open&&this.control.showPanel())}}disconnectedCallback(){for(let e of this.cleanups.splice(0))e();cancelAnimationFrame(this.frame),this.control?.destroy(),this.control=void 0}followTheme(){let e=()=>{let e=O2();this.style.colorScheme=e?`dark`:`light`,this.classList.toggle(`dark`,e),this.areas.classList.toggle(`dark`,e),this.dataset.theme=e?`dark`:`light`;let t=getComputedStyle(this.areas).getPropertyValue(`--vh-comment-default-ink`).trim(),n=`@layer components {\n${Na}\n:root { --vh-comment-ink: var(--vh-ui-comment-ink, var(--vh-highlighted, ${t})); }\n}\n${qG}`;this.documentStyle.textContent!==n&&(this.documentStyle.textContent=n)};e();let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`style`,`data-theme`]});let n=matchMedia(`(prefers-color-scheme: dark)`);n.addEventListener(`change`,e),this.cleanups.push(()=>{t.disconnect(),n.removeEventListener(`change`,e)})}on(e,t,n,r){e.addEventListener(t,n,r),this.cleanups.push(()=>e.removeEventListener(t,n,r))}schedule(){cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>{let e=this.changed;this.changed=!1,this.control?.layout(e)})}listen(){let e=()=>this.schedule();this.on(window,`scroll`,e,{capture:!0,passive:!0}),this.on(window,`resize`,e);let t=new MutationObserver(t=>{if(t.every(e=>e.target===this||this.contains(e.target)))return;let n=this.control?.editElement();n&&!n.isConnected&&this.control?.finishEdit(!0),this.restoreDocumentState(),this.changed=!0,e()});t.observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`class`,`style`,`hidden`]}),this.cleanups.push(()=>t.disconnect());let n=()=>queueMicrotask(()=>{this.active&&this.control?.navigated(Di(location.pathname))});for(let e of[`astro:before-swap`,`turbo:before-render`])this.on(document,e,()=>void this.control?.finishEdit(!0));for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(...e){let r=t.apply(this,e);return n(),r},this.cleanups.push(()=>{history[e]=t})}this.on(window,`popstate`,n);let r,i=e=>{clearTimeout(r),r=setTimeout(()=>this.control?.selectionChanged(),e)};this.on(document,`selectionchange`,()=>i(200)),this.on(document,`pointerup`,()=>i(0)),this.cleanups.push(()=>clearTimeout(r)),this.on(document,`pointermove`,e=>this.pointerMoved(e),{passive:!0}),this.on(document,`pointerleave`,()=>this.control?.leave()),this.on(document,`click`,e=>this.clicked(e),{capture:!0}),this.on(document,`keydown`,e=>this.control?.key(e)),this.on(document,`visibilitychange`,()=>{document.visibilityState===`visible`&&this.control?.refresh()});let a=setInterval(()=>{document.visibilityState===`visible`&&this.control?.refresh()},3e4);this.cleanups.push(()=>clearInterval(a))}ours(e){let t=e.composedPath(),n=this.context?.bar.parentElement;return t.includes(this)||t.some(e=>e instanceof Element&&e.localName===`vitehub-window`)||!!(n&&t.includes(n))}elementAt(e,t){return document.elementsFromPoint(e,t).find(e=>e!==this&&!this.contains(e)&&e!==document.documentElement)}pointerMoved(e){this.ours(e)||!this.control?.editMode()&&e.timeStamp-this.lastCursor<80||(this.lastCursor=e.timeStamp,this.control?.pointer(e,this.elementAt(e.clientX,e.clientY)))}clicked(e){if(this.ours(e)||!this.control?.editMode())return;let t=this.elementAt(e.clientX,e.clientY),n=t?Ua(t):void 0;n&&n!==this.control.editElement()&&(e.preventDefault(),e.stopPropagation(),this.control.startEdit(n))}restoreDocumentState(){this.documentStyle.parentElement!==document.head&&document.head.append(this.documentStyle);for(let e of[`comment`,`edit`]){let t=`vitehub-${e}-mode`,n=this.mode===e;document.documentElement.classList.contains(t)!==n&&document.documentElement.classList.toggle(t,n)}}stop(){this.isConnected&&(this.control?.finishEdit(!1),this.control?.setMode(`view`),this.mode=`view`,this.restoreDocumentState(),this.remove())}},o4=i4(xa),s4=e=>{let t=ya();if(!t)return o4(e);let n=!1,r;return t.ready.then(()=>{n||e.signal.aborted||(t.stop(),r=o4(e))}),()=>{n=!0,r?.()}},c4=i4(Sa)}));h(),Si(),va(),wa(),Ma();var u4={id:`comments`,label:`Comments`,icon:`i-lucide-message-square-text`,script:`comments`,param:`comment`},d4={id:`console`,label:`Console`,icon:`i-lucide-layout-dashboard`,script:`console`},f4={id:`projects`,label:`Choose a team for Comments`,icon:``,script:`projects`},p4={name:`vitehub-hosted-comments-pill`,label:`ViteHub Comments`,off:`vitehub-hosted-comments-off`,collapsed:`vitehub-hosted-comments-collapsed`,dock:`vitehub-hosted-comments-dock`,initialDock:{edge:`right`,at:85}};function m4(){return Promise.reject(vi(405))}function h4(e,t){return{namespace:new URL(Ta(t.id),t.console).href,async session(n){try{let r=(await(await e).call(`session`,n)).value;if(t.consoleUrl&&r.signIn?.provider===`console`){let e=new URL(r.signIn.url);e.searchParams.set(`linked`,``),r.signIn={...r.signIn,url:e.href}}return[void 0,t.repository?{...r,repository:t.repository}:r]}catch(e){return[sa(e),void 0]}},transport(t){let n=async(n,r)=>{let i=await(await e).call(n,r);return t({data:i.value,people:i.people}),i.value};return{list:e=>n(`list`,e),get:e=>n(`get`,e),create:({files:e,outbox:t,...r})=>n(`create`,r),reply:({files:e,outbox:t,...r})=>n(`reply`,r),resolve:e=>n(`resolve`,{threadId:e.threadId}),reopen:e=>n(`reopen`,{threadId:e.threadId}),edit:m4,delete:m4,users:async()=>[],upload:m4,attachmentUrl:()=>``}}}}var g4;function _4(){return!ba()&&(g4??=customElements.whenDefined(xa).then(async()=>{ba();let e=ya();e&&await e.ready,hi()}),!0)}async function v4(e,t){if(!_4())return;hi(),ua(h4(e,t));let{consoleUrl:n}=t;await pi({pill:p4,session:async()=>({tools:n?[u4,d4]:[u4]}),load:async e=>e===`console`&&n?y4(n):{default:(await ja(async()=>{let{startHostedOverlay:e}=await Promise.resolve().then(()=>(l4(),n4));return{startHostedOverlay:e}},void 0,import.meta.url)).startHostedOverlay}})}function y4(e){return{default({bar:t,onOpen:n}){let r=document.createElement(`a`);r.href=e,r.textContent=`Console`;let i=document.createElement(`style`);i.textContent=p.replaceAll(`button`,`a`),t.attachShadow({mode:`open`}).append(i,r),n(()=>(r.click(),!0))}}}async function b4(e,t){_4()&&await pi({pill:p4,session:async()=>({tools:t.length?[f4,d4]:[d4]}),load:async n=>n===`console`?y4(e):{default({bar:e}){let n=document.createElement(`select`);n.setAttribute(`aria-label`,f4.label),n.append(new Option(f4.label,``));for(let[e,r]of t.entries())n.append(new Option(r.team,String(e)));n.addEventListener(`change`,()=>{n.selectedIndex>0&&t[n.selectedIndex-1]?.choose()}),e.append(n)}}})}export{v4 as mountHostedComments,b4 as mountHostedProjectChoice};