@vite-hub/comments 0.7.0 → 0.9.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.
- package/README.md +4 -10
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +0 -1
- package/dist/{client-files-lC6X7XyS.js → client-files-CMPJEd21.js} +0 -1
- package/dist/client-request-B1DCz3a9.js +29 -0
- package/dist/client.d.ts +21 -241
- package/dist/client.js +4 -425
- package/dist/database.d.ts +1 -2
- package/dist/database.js +1 -1
- package/dist/{define-BqPcuDhf.js → define-hs9Z38io.js} +1 -2
- package/dist/{errors-C0VwRHiy.js → errors-C5utwZ5H.js} +0 -24
- package/dist/{errors-CBvIpwbo.js → errors-DeSEHzRf.js} +0 -12
- package/dist/hosted/hosted-comments/frame.js +4 -1
- package/dist/hosted/hosted-comments/tools.js +71 -77
- package/dist/hosted/hosted-comments.js +1 -1
- package/dist/{index-D1T7RJ4R.d.ts → index-CbXek64X.d.ts} +5 -113
- package/dist/index.d.ts +5 -6
- package/dist/index.js +6 -23
- package/dist/{install-CqBWFmU7.js → install--HecUN5c.js} +8 -789
- package/dist/{install-9L4ASzUC.d.ts → install-C3CW6Vvw.d.ts} +6 -12
- package/dist/{installed-wUYjqk_k.js → installed-BqQKo6WC.js} +2 -7
- package/dist/{database-BuSNVwTx.js → migrate-cxoJK4JQ.js} +2 -64
- package/dist/{operations-Qt8ASQqW.d.ts → operations-D0EO1pzL.d.ts} +36 -8
- package/dist/{operations-kMPw-Cyb.js → operations-DHXmbtb3.js} +47 -75
- package/dist/operations.d.ts +3 -3
- package/dist/operations.js +2 -2
- package/dist/overlay/client-BszZKIf8.js +4 -0
- package/dist/overlay/overlay.js +50 -43
- package/dist/page/loader.js +37 -30
- package/dist/{page-2NzFladc.js → page-CJz1K67L.js} +25 -2
- package/dist/page-DRM1j84-.d.ts +32 -0
- package/dist/{page-tools-shared-BNw-aWEH.js → page-tools-shared-BCdvqA4S.js} +40 -2
- package/dist/{path-8yqMd8zR.js → path-sv8kjq3i.js} +0 -4
- package/dist/{plugin-ChOHe7vq.js → plugin-DczA2K-y.js} +9 -9
- package/dist/realtime.d.ts +7 -9
- package/dist/realtime.js +2 -4
- package/dist/{rpc-kkxzQ3Qy.js → rpc-51X1TWKb.js} +1 -1
- package/dist/{rpc-D-eqtyfh.d.ts → rpc-DZB3yU0z.d.ts} +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +1 -1
- package/dist/runtime/auth.d.ts +1 -2
- package/dist/runtime/auth.js +1 -1
- package/dist/runtime/client-request-plugin.d.ts +2 -0
- package/dist/runtime/client-request-plugin.js +21 -0
- package/dist/runtime/console.js +2 -2
- package/dist/runtime/index.d.ts +6 -9
- package/dist/runtime/index.js +25 -175
- package/dist/{server-8o9u8leM.js → server-CAMs6viR.js} +1 -1
- package/dist/server.d.ts +12 -8
- package/dist/server.js +8 -7
- package/dist/{service-XT2A8YEF.js → service-DFMwCr60.js} +34 -42
- package/dist/{store-DvNTDNgn.d.ts → service-qaMuJ7UX.d.ts} +68 -2
- package/dist/{session-DGdFKWDB.js → session-1SI3_wLJ.js} +212 -66
- package/dist/{session-CN4irEqf.d.ts → session-CK3Rnjto.d.ts} +2 -3
- package/dist/{table-names-BIHjuEFK.js → table-names-DUmWROM4.js} +1 -3
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -2
- package/dist/{tokens-Bx4lZ0yt.js → tokens-WRh__ppm.js} +0 -1
- package/dist/{types-BX3vH18p.d.ts → types-BmzTyGt-.d.ts} +4 -0
- package/dist/{define-B1jLSPe9.d.ts → types-VSVs4jIw.d.ts} +157 -4
- package/dist/vite.d.ts +3 -20
- package/dist/vite.js +15 -82
- package/package.json +8 -8
- package/dist/database-CPua6Q6_.d.ts +0 -573
- package/dist/overlay/client-CrnKCZXc.js +0 -4
- package/dist/overlay/dist-yIZmvSaU.js +0 -1
- package/dist/page-DE71P_gQ.d.ts +0 -11
- package/dist/request-origin-B-CPVAVk.js +0 -53
- package/dist/service-IvgrI4XM.d.ts +0 -71
- package/dist/types-l6GOb_yc.d.ts +0 -206
package/dist/page/loader.js
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
const e=/* @__PURE__ */ new Set;let t,n=!1;function r(){return t?.matches??!1}function i(){let t=r();if(t!==n){n=t;for(let n of e)n(t)}}function a(){t||typeof matchMedia!=`function`||(t=matchMedia(`(prefers-reduced-motion: reduce)`),t.addEventListener?.(`change`,i),n=r())}function o(){return a(),r()}function s(t){return a(),e.add(t),()=>e.delete(t)}const c={snappy:{stiffness:520,damping:34},soft:{stiffness:380,damping:20}},l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Set;let d=0,f=!1,p=0,m=0;function h(){return 1}function g(e){let t=Math.min(.032,m?(e-m)/1e3:.016)/1;m=e;let n=Array.from(l),r=Array.from(u);for(let[e,r]of n)if(l.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&&_(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&&_(e)}e.frame(e.value,e.velocity)}for(let e of r)u.has(e)&&e(t)===!1&&u.delete(e);l.size||u.size?p=requestAnimationFrame(g):(p=0,m=0)}function _(e){e.value=e.target,e.velocity=0,e.tween=void 0,l.delete(e)}function v(e){l.set(e,++d),p||=requestAnimationFrame(g)}function y(e){let t=t=>e(t);return u.add(t),p||=requestAnimationFrame(g),()=>{u.delete(t)}}function b(e){if(!e)return;let t=Array.from(l);for(let[e,n]of t)l.get(e)!==n||e.tween||(_(e),e.frame(e.value,0))}function x(e,t,n=c.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 l.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&o())return i.set(e);t.tween===void 0&&!f&&(f=!0,s(b)),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},v(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,l.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,l.delete(r)}};return i}function S(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}const C=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],w=/* @__PURE__ */ new Map,T=/* @__PURE__ */ new Set,E=Symbol.for(`vite-hub.motion.layer`);let D;function ee(){let e=Reflect.get(globalThis,E);if(e&&e!==D&&typeof e==`object`&&`define`in e&&`install`in e)return e}function O(e){D=e,Reflect.get(globalThis,E)||Reflect.set(globalThis,E,e)}function k(e){let t=[...w.values()];w.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function te(e,t=o){let n={effect:e,isReduced:t};w.set(e.name,n);for(let e of T)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(w.get(e.name)===n){w.delete(e.name);for(let e of T)e()}}}function A(){return[...w.values()].map(e=>e.effect)}function j(){return[...w.values()]}function M(e){return T.add(e),()=>T.delete(e)}function N(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}const P=/* @__PURE__ */ new Map;let F;const I=/* @__PURE__ */ new Map;let L,ne=[];const re=Symbol.for(`vite-hub.motion.effect-presses`),ie=e=>{let t=Reflect.get(e,re);if(t)return t;let n=/* @__PURE__ */ new Map;return Reflect.set(e,re,n),n},ae=/* @__PURE__ */ new Set;function oe(e,t){if(ae.has(t))return!1;try{return e.matches(t)}catch{return ae.add(t),!1}}function se(e){let t=e;for(;;){for(let e of P.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&P.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function ce(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&&oe(e,t));return r===-1||r<=n||!se(e[r])?void 0:e[r]}function le(e,t,n){R(e,!0);let r=ie(t),i=[];for(let{effect:a,isReduced:o}of j()){if(!a.press||o())continue;let s=ce(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,/* @__PURE__ */ new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>ue(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(I.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,me,{capture:!0,passive:!0}))}function R(e,t=!1){let n=I.get(e);if(n){I.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();de()}}function ue(e,t,n=!1){let r=I.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||I.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),de())}function de(){[...I.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,me,{capture:!0})}function fe(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(L={event:e,path:t}),le(e.pointerId,e,t)}function pe(e){L?.event.pointerId===e.pointerId&&(L=void 0),R(e.pointerId,e.type===`pointercancel`)}function me(e){for(let{press:t}of I.get(e.pointerId)??[])t.move?.(e)}function he(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]`)||le(`key`,e,t)}function ge(e){(e.key===` `||e.key===`Enter`)&&R(`key`)}function _e(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=/* @__PURE__ */ 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:/* @__PURE__ */ 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)oe(e,t.selector)&&!S(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function ve(e){if(!L||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=j().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=L,i=I.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&ue(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!se(e)||S(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),I.set(n.pointerId,i),document.addEventListener(`pointermove`,me,{capture:!0,passive:!0}))}function ye(e){let t=[...new Set(e)],n=A(),r=/* @__PURE__ */ new Map;_e(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`){ve(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=/* @__PURE__ */ new Map);let s=o.get(i);if(s||o.set(i,s=/* @__PURE__ */ new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&oe(t,r.selector)&&!S(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=oe(t,e.selector);if(ae.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)S(t)||e.enter(t)}}}function be(e,t){let n=A().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...C,...A().some(e=>e.name===`divider`)?[`data-resize-handle-active`]:[]],attributeOldValue:!0,childList:n||A().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function xe(e,t){let n=A();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 Se(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,fe,e),document.addEventListener(`pointerup`,pe,e),document.addEventListener(`pointercancel`,pe,e),document.addEventListener(`keydown`,he,e),document.addEventListener(`keyup`,ge,e),ne=[()=>{document.removeEventListener(`pointerdown`,fe,e),document.removeEventListener(`pointerup`,pe,e),document.removeEventListener(`pointercancel`,pe,e),document.removeEventListener(`keydown`,he,e),document.removeEventListener(`keyup`,ge,e),L=void 0;for(let e of I.keys())R(e,!0)},s(e=>{if(e){L=void 0;for(let e of I.keys())R(e,!0)}})]}function z(e,t){if(typeof document>`u`)return()=>{};let n=ee();return n?(k(n),n.install(e,t.effects,o)):(O(Ce),we(e,t.effects))}const Ce={define:te,install:we};function we(e,t,n=o){let r=new Set(A().map(e=>e.name));for(let e of t)r.has(e.name)||te(e,n);if(!F){Se();let e=new MutationObserver((e,t)=>ye(e.concat(t.takeRecords())));F=e,ne.push(M(()=>{for(let[t,{watchers:n}]of P)be(t,e),xe(t,n)}))}let i=P.get(e);if(i)i.installs++;else{let t=/* @__PURE__ */ new Map;be(e,F),P.set(e,{installs:1,watchers:t}),xe(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=P.get(e);if(!t||--t.installs>0)return;P.delete(e);let n=F,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if(P.size){for(let e of P.keys())be(e,n);r.length&&queueMicrotask(()=>{if(F!==n)return;let e=[...P.keys()];ye(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{F=void 0;for(let e of ne)e();ne=[]}}}function Te(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 Ee(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 De(e,t){return window.setTimeout(t,e*h())}function Oe(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)}}const ke=e=>e;function Ae(e,t,n,r,i){let a=(n.delay??0)/1e3,s=n.duration/1e3,c=n.ease??ke,l=o(),u=0;return{stop:y(n=>{u+=n;let d=!l&&o()||u>=a+s?1:s>0?Math.max(0,(u-a)/s):0;return r(e+(t-e)*c(d)),d<1||(i?.(),!1)})}}function je(e,t,n=ke,r=0){let i=()=>{},a=new Promise(e=>i=e),o=Ae(0,1,{duration:e*1e3,delay:r*1e3,ease:n},t,()=>i(!0));return{done:a,stop:()=>{o.stop(),i(!1)}}}const Me={stiffness:900,damping:40},Ne={stiffness:380,damping:14},Pe=`: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])`,Fe=`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`,Ie=Symbol.for(`vite-hub.motion.press-mode`);function Le(){let e=Reflect.get(globalThis,Ie);return e===`opt-in`||e===`all`?e:`buttons`}const Re=/* @__PURE__ */ new WeakMap,ze=e=>e>=40?.03:e>=32?.04:.05,Be=e=>Math.min(ze(e.offsetHeight),6/Math.max(e.offsetWidth,e.offsetHeight));function Ve(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 He(e){let t=Le();return t===`buttons`?e.matches(`:is(button, input:is([type=button], [type=submit], [type=reset])):is(:not([role]), [role=button])`)&&e.offsetHeight<48&&e.offsetWidth<=4*e.offsetHeight:t===`all`}function Ue(e,t){if(t===`none`)return;if(t===`icon`){let t=e.querySelector(Fe);return t instanceof HTMLElement||t instanceof SVGElement?{target:t,amount:.15}:void 0}if(t===void 0&&!He(e))return;let n=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(n instanceof HTMLElement)return{target:n,amount:Be(n)};let r=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.matches(Fe)?{target:r,amount:.15}:{target:e,amount:Be(e)}}function We(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 Ge(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}const Ke={name:`press`,selector:Pe,press(e,t){if(!(`pointerId`in t))return;let n=Ue(e,Ve(e,t));if(!n)return;let{target:r,amount:i}=n,a=getComputedStyle(r);if(We(a)||a.display===`contents`||a.display===`inline`&&r===e&&!(e instanceof HTMLInputElement))return;let o;if(r===e&&(o=e.getBoundingClientRect(),Ge(o,t,i)))return;let s=Re.get(r);if(!s){let e={amount:i,spring:x(0,t=>{N(r,{scale:t?String(1-e.amount*t):null})},Me)};s=e,Re.set(r,s)}s.amount=i;let{spring:c}=s;c.to(1,{preset:Me});let l=!1,u=()=>{l||(l=!0,c.set(0))};return{move:o?e=>{Ge(o,e,i)&&u()}:void 0,release:()=>{l||c.to(0,{preset:Ne})},cancel:u}}},B={stiffness:480,damping:36},qe={stiffness:380,damping:26},V={stiffness:440,damping:32},Je=.24,Ye=.14,Xe=.15,Ze=/* @__PURE__ */ new WeakMap,Qe=/* @__PURE__ */ new Set,$e=/* @__PURE__ */ new Set;let H;function et(e){let t=getComputedStyle(e);return t.clipPath===`inset(50%)`||t.clip===`rect(0px, 0px, 0px, 0px)`}function tt(e){return e.matches(`[role=tooltip]`)?e:e.querySelector(`:scope > [role=tooltip]`)}const nt=`[data-motion-appear]`;function rt(e){if(e.matches(nt))return e;if(e.matches(`[role=tooltip]`))return et(e)?e.parentElement:e;let t=e.querySelector(`:scope > [role=tooltip]`);return t&&et(t)?e:null}function it(e){let t=e.getAttribute(`data-state`);return t===null?!e.hidden&&!e.hasAttribute(`data-closed`):t!==`closed`}function at(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=tt(e)?.id;return n?e.getRootNode().querySelector(`[aria-describedby~="${CSS.escape(n)}"]`)??document.querySelector(`[aria-describedby~="${CSS.escape(n)}"]`):null}function ot(e){let t=[`translate`,`scale`,`clip-path`,`opacity`].map(t=>[t,e.style.getPropertyValue(t)]);N(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 st(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 ct(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}const lt=e=>e===`top`||e===`bottom`;function ut(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 dt(e){return[...e.element.children].filter(t=>t instanceof HTMLElement&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!et(t))}function ft(e){return[...e.element.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE||t instanceof Element&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!et(t)).map(e=>e.textContent??``).join(``)}function pt(e){return[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())}const U=e=>`${Math.round(e*100)/100}px`;function W(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(U).join(` `)} round ${e.radius})`}else p&&(m=`inset(${f.map(U).join(` `)})`);N(t,{translate:Math.abs(u)>.01||Math.abs(d)>.01||e.old?`${U(u)} ${U(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 dt(e))N(t,{scale:h,opacity:g<1?String(g):null,filter:g<1?`blur(${U((1-g)*6)})`:null});if(e.old){let t=e.old.spring.value;N(e.old.element,{scale:h,opacity:String(t),filter:`blur(${U((1-t)*5)})`})}}function mt(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 ht(e){if(!mt(e)){e.old?.element.remove(),e.old=void 0,N(e.element,{translate:null,scale:null,"clip-path":null,opacity:null});for(let t of dt(e))N(t,{scale:null,opacity:null,filter:null});e.done?.()}}function gt(e,t,n){let r=getComputedStyle(e),i=st(e,t,n),a={element:e,rest:t,origin:Number.parseFloat(r.transformOrigin)||t.width/2,side:i,edge:ct(i,t,n),trigger:n,mode:pt(e)||e.matches(nt)?`clip`:`scale`,handoff:!e.matches(nt),radius:r.borderRadius||`0px`,timers:/* @__PURE__ */ new Set,holding:!0},o=()=>{W(a),ht(a)};return a.x=x(t.left+t.width/2,o,B),a.y=x(t.top+t.height/2,o,B),a.width=x(t.width,o,V),a.label=x(1,o),a.fade=x(1,o),a}function G(e,t,n){let r=De(t,()=>{e.timers.delete(r),n(),ht(e)});e.timers.add(r)}function _t(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 vt(e){_t(e),$e.delete(e),H===e&&(H=void 0),e.element.closest(`[data-motion=none]`)?.remove()}function yt(e){if(e){for(let e of $e)vt(e);for(let e of Qe){let t=Ze.get(e)?.box;t&&(_t(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,ht(t))}}}function bt(e,t){let n=e.trigger,r=t.trigger;return!n||!r||e.side!==t.side?!1:lt(t.side)?n.top<r.bottom&&r.top<n.bottom:n.left<r.right&&r.left<n.right}function xt(e){return lt(e.side)?e.y:e.x}function St(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=x(n,()=>{W(e),ht(e)});e.old={element:r,spring:i},i.to(0,{tween:.15})}function Ct(e){return e.mode===`clip`?[...e.element.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.cloneNode()):dt(e).map(e=>{let t=e.cloneNode(!0);return t.style.removeProperty(`scale`),t.style.removeProperty(`opacity`),t.style.removeProperty(`filter`),t})}function wt(e,t){let n=t.trigger?.getBoundingClientRect(),r=ot(e),i=gt(e,r,n);t.box=i,t.text=ft(i),t.label=Ct(i),N(e,{opacity:null});let a=i.handoff&&H&&bt(H,i)?H:void 0;if(a&&(H=void 0),o())a&&Tt(a,!0),i.fade.set(0),i.holding=!1,i.fade.to(1,{tween:Xe});else if(a){let e=Ct(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;vt(a),i.x.set(t.x[0]),i.y.set(t.y[0]),i.width.set(t.width[0]),i.label.set(0),St(i,e,n),i.x.to(r.left+r.width/2,{preset:B,velocity:t.x[1]}),i.y.to(r.top+r.height/2,{preset:B,velocity:t.y[1]}),i.width.to(r.width,{preset:V,velocity:t.width[1]}),G(i,40,()=>i.label.to(1,{tween:Je})),i.holding=!1,W(i)}else xt(i).set(ut(i)),i.width.set(Math.min(30,r.width)),i.label.set(0),W(i),xt(i).to(lt(i.side)?r.top+r.height/2:r.left+r.width/2,{preset:qe}),G(i,120,()=>{i.width.to(r.width,{preset:V}),G(i,70,()=>i.label.to(1,{tween:Je}))}),i.holding=!1}function Tt(e,t){$e.add(e),e.holding=!1,t?(e.done=()=>vt(e),e.fade.to(0,{tween:Xe})):(e.handoff&&(H=e),e.old&&e.old.spring.to(0,{tween:Ye}),e.label.to(0,{tween:Ye}),e.width.to(Math.min(30,e.rest.width),{preset:V}),G(e,90,()=>{H===e&&(H=void 0),xt(e).to(ut(e),{preset:qe})}),G(e,520,()=>vt(e)))}function Et(e,t){if(!t.open)return;t.open=!1,Qe.delete(e),t.stopWatch?.(),t.stopWatch=void 0,Qe.size||Lt();let n=t.box;if(t.box=void 0,N(e,{opacity:null}),!n)return;let r=t.root.parentNode??t.parent,i=r?.isConnected?Te(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},s=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,[t.value,t.velocity]])),c=n.old?.spring.value;_t(n),n.old?.element.remove(),N(e,{translate:null,scale:null,"clip-path":null,opacity:null});for(let e of dt(n))N(e,{scale:null,opacity:null,filter:null});if(!i)return;let l=Dt(t.root,e).reduce((e,t)=>e?.children[t],i);if(!(l instanceof HTMLElement)){i.remove();return}e.hasAttribute(`popover`)&&(N(l,{scale:null}),Ee(l,n.rest));let u=gt(l,n.rest,void 0);Object.assign(u,{side:n.side,edge:n.edge,trigger:n.trigger,mode:n.mode,origin:n.origin,radius:n.radius,handoff:n.handoff});let d=l.querySelector(`:scope > [aria-hidden=true][style*=absolute]`);c!==void 0&&d&&(u.old={element:d,spring:x(c,()=>W(u))});for(let e of[`x`,`y`,`width`,`label`,`fade`])u[e].set(s[e][0]);W(u);for(let e of[`x`,`y`,`width`])s[e][1]&&u[e].to(s[e][0],{velocity:s[e][1]});Tt(u,o())}function Dt(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 Ot(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 Ot(e,t,n,r-1);n()})}function kt(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()):Et(e,t)});return n(),()=>r.disconnect()}function At(e){let t=Ze.get(e);if(t?.open)return;let n=at(e);if(n&&S(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},Ze.set(e,t),Qe.add(e),It(),N(e,{opacity:`0`}),t.stopWatch=kt(e,t);let i=t;Ot(e,t,()=>wt(e,i))}let jt=0;function Mt(){jt=0;for(let e of Qe){let t=Ze.get(e),n=t?.box;if(!t||!n)continue;let r=ot(e),i=ft(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,s=(a||Math.abs(r.height-n.rest.height)>1)&&!n.handoff&&!mt(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&&!s&&i===t.text)continue;let c=i===t.text?[]:t.label;t.trigger=at(e)??t.trigger;let l=t.trigger?.getBoundingClientRect();t.text=i,t.label=Ct(n),n.rest=r,n.side=st(e,r,l),n.edge=ct(n.side,r,l),o()||s?(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:B}),n.y.to(r.top+r.height/2,{preset:B}),n.width.to(r.width,{preset:V}),c.length&&(n.old?.spring.stop(),n.old?.element.remove(),St(n,c,n.label.value),n.label.set(0),G(n,40,()=>n.label.to(1,{tween:Je}))))}}function Nt(){jt||=requestAnimationFrame(Mt)}let Pt=!1,Ft;function It(){Ft??=s(yt),Pt||(Pt=!0,document.addEventListener(`pointerover`,Nt,{capture:!0,passive:!0}),document.addEventListener(`focusin`,Nt,{capture:!0,passive:!0}))}function Lt(){Pt=!1,cancelAnimationFrame(jt),jt=0,document.removeEventListener(`pointerover`,Nt,{capture:!0}),document.removeEventListener(`focusin`,Nt,{capture:!0})}const Rt={enter(e){rt(e)===e&&it(e)&&At(e)},state(e){if(rt(e)!==e)return;let t=Ze.get(e);it(e)?At(e):t&&Et(e,t)}};({...Rt});const zt={name:`appear`,selector:nt,...Rt};function Bt(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}const Vt={stiffness:380,damping:26},Ht={stiffness:260,damping:28},Ut=.9,Wt=Oe(.5,0,.75,0),Gt=`data-motion-ghost`,K=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function Kt(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function qt(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(Gt))}function Jt(e,t={}){let n=t.items??qt,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=/* @__PURE__ */ new Map,s=!1;function l(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 u(e,t){let{x:n,y:i,grow:a,from:o}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){N(e,{translate:null,scale:null,opacity:null}),s||r.delete(e);return}let{x:c,y:u}=l(t),d=o.scale+(1-o.scale)*a.value;N(e,{translate:c||u?`${c.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 d(e){let t=r.get(e);if(t)return t;let n=()=>t&&u(e,t);return t={x:x(0,n,c.snappy),y:x(0,n,c.snappy),grow:x(1,n,Vt),from:{x:0,y:0,scale:1}},r.set(e,t),t}function f(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),N(e,{translate:null,scale:null,opacity:null}))}function p(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:c.snappy,velocity:n})}function m(t,n,r){if(!Kt(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let s=Bt(t);s.setAttribute(Gt,``),Object.assign(s.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`}),N(s,{translate:null,scale:null,opacity:null,filter:null}),e.append(s);let c={element:s,stop:()=>{}},l=()=>{c.stop(),s.remove(),i.delete(c)};if(i.add(c),o()){let e=je(.15,e=>N(s,{opacity:(1-e).toFixed(3)}));c.stop=e.stop,e.done.then(l);return}if(r){let e=K(r.getBoundingClientRect()),t=K(n),i=je(.32,n=>{N(s,{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})},Wt);c.stop=i.stop,i.done.then(l);return}let u=x(1,e=>{N(s,{scale:(Ut+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&l()},Ht);c.stop=()=>u.stop(),u.to(0)}return{measure(){a=/* @__PURE__ */ new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=K(e),i=l(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let c=a;a=/* @__PURE__ */ new Map;let u=S(e),h=n(e),g=new Set(h),_=h.map(e=>{let t=e.getBoundingClientRect(),n=l(r.get(e)),i=K(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),v=_.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)g.has(e)||(f(e),u||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||m(e,n,i.target));s=!0,_.forEach(({element:e,rect:n,layout:r},i)=>{if(u)return f(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(!Kt(a.rect)&&!Kt(n))return f(e);let o=d(e);p(o.x,o.x.value+t),p(o.y,o.y.value+i);return}if(!Kt(n)||t.movesOnly)return;let s=d(e),l=v[i];if(o())s.from={x:0,y:0,scale:1};else if(l){let e=K(l),t=Math.min(1,Math.max(.2,Math.min(l.width/(n.width||1),l.height/(n.height||1))));s.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else s.from={x:0,y:0,scale:Ut};s.grow.set(0),s.grow.to(1,o()?{tween:.15}:{preset:Vt})}),s=!1},destroy(){for(let e of r.keys())f(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=/* @__PURE__ */ new Map}}}const q=`vitehub`,Yt=[`comment`];function Xt(e,t){let n=new URLSearchParams(e);if(n.has(`vitehub`)||Yt.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=`))}const Zt=`/_vitehub/page/tools`,Qt=`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)}
|
|
1
|
+
const e=/* @__PURE__ */ new Set;let t,n=!1;function r(){return t?.matches??!1}function i(){let t=r();if(t!==n){n=t;for(let n of e)n(t)}}function a(){t||typeof matchMedia!=`function`||(t=matchMedia(`(prefers-reduced-motion: reduce)`),t.addEventListener?.(`change`,i),n=r())}function o(){return a(),r()}function s(t){return a(),e.add(t),()=>e.delete(t)}const c={snappy:{stiffness:520,damping:34},glide:{stiffness:800,damping:57},soft:{stiffness:380,damping:20}},l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Set;let d=0,f=!1,p=0,m=0;function h(){return 1}function g(e){let t=Math.min(.032,m?(e-m)/1e3:.016)/1;m=e;let n=Array.from(l),r=Array.from(u);for(let[e,r]of n)if(l.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&&_(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&&_(e)}e.frame(e.value,e.velocity)}for(let e of r)u.has(e)&&e(t)===!1&&u.delete(e);l.size||u.size?p=requestAnimationFrame(g):(p=0,m=0)}function _(e){e.value=e.target,e.velocity=0,e.tween=void 0,l.delete(e)}function v(e){l.set(e,++d),p||=requestAnimationFrame(g)}function y(e){let t=t=>e(t);return u.add(t),p||=requestAnimationFrame(g),()=>{u.delete(t)}}function b(e){if(!e)return;let t=Array.from(l);for(let[e,n]of t)l.get(e)!==n||e.tween||(_(e),e.frame(e.value,0))}function x(e,t,n=c.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 l.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&o())return i.set(e);t.tween===void 0&&!f&&(f=!0,s(b)),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},v(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,l.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,l.delete(r)}};return i}function S(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}const C=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],w=/* @__PURE__ */ new Map,T=/* @__PURE__ */ new Set,E=Symbol.for(`vite-hub.motion.layer`);let D;function O(){let e=Reflect.get(globalThis,E);if(e&&e!==D&&typeof e==`object`&&`define`in e&&`install`in e)return e}function k(e){D=e,Reflect.get(globalThis,E)||Reflect.set(globalThis,E,e)}function A(e){let t=[...w.values()];w.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function ee(e,t=o){let n={effect:e,isReduced:t};w.set(e.name,n);for(let e of T)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(w.get(e.name)===n){w.delete(e.name);for(let e of T)e()}}}function j(){return[...w.values()].map(e=>e.effect)}function M(){return[...w.values()]}function N(e){return T.add(e),()=>T.delete(e)}function P(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}const F=/* @__PURE__ */ new Map;let I;const L=/* @__PURE__ */ new Map;let R,te=[];const ne=Symbol.for(`vite-hub.motion.effect-presses`),re=e=>{let t=Reflect.get(e,ne);if(t)return t;let n=/* @__PURE__ */ new Map;return Reflect.set(e,ne,n),n},ie=/* @__PURE__ */ new Set;function ae(e,t){if(ie.has(t))return!1;try{return e.matches(t)}catch{return ie.add(t),!1}}function oe(e){let t=e;for(;;){for(let e of F.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&F.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function se(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&&ae(e,t));return r===-1||r<=n||!oe(e[r])?void 0:e[r]}function ce(e,t,n){z(e,!0);let r=re(t),i=[];for(let{effect:a,isReduced:o}of M()){if(!a.press||o())continue;let s=se(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,/* @__PURE__ */ new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>le(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(L.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,pe,{capture:!0,passive:!0}))}function z(e,t=!1){let n=L.get(e);if(n){L.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();ue()}}function le(e,t,n=!1){let r=L.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||L.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),ue())}function ue(){[...L.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,pe,{capture:!0})}function de(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(R={event:e,path:t}),ce(e.pointerId,e,t)}function fe(e){R?.event.pointerId===e.pointerId&&(R=void 0),z(e.pointerId,e.type===`pointercancel`)}function pe(e){for(let{press:t}of L.get(e.pointerId)??[])t.move?.(e)}function me(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]`)||ce(`key`,e,t)}function he(e){(e.key===` `||e.key===`Enter`)&&z(`key`)}function ge(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=/* @__PURE__ */ 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:/* @__PURE__ */ 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)ae(e,t.selector)&&!S(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function _e(e){if(!R||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=M().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=R,i=L.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&le(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!oe(e)||S(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),L.set(n.pointerId,i),document.addEventListener(`pointermove`,pe,{capture:!0,passive:!0}))}function ve(e){let t=[...new Set(e)],n=j(),r=/* @__PURE__ */ new Map;ge(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`){_e(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=/* @__PURE__ */ new Map);let s=o.get(i);if(s||o.set(i,s=/* @__PURE__ */ new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&ae(t,r.selector)&&!S(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=ae(t,e.selector);if(ie.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)S(t)||e.enter(t)}}}function ye(e,t){let n=j().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...C,...j().some(e=>e.name===`divider`)?[`data-resize-handle-active`]:[]],attributeOldValue:!0,childList:n||j().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function be(e,t){let n=j();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 xe(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,de,e),document.addEventListener(`pointerup`,fe,e),document.addEventListener(`pointercancel`,fe,e),document.addEventListener(`keydown`,me,e),document.addEventListener(`keyup`,he,e),te=[()=>{document.removeEventListener(`pointerdown`,de,e),document.removeEventListener(`pointerup`,fe,e),document.removeEventListener(`pointercancel`,fe,e),document.removeEventListener(`keydown`,me,e),document.removeEventListener(`keyup`,he,e),R=void 0;for(let e of L.keys())z(e,!0)},s(e=>{if(e){R=void 0;for(let e of L.keys())z(e,!0)}})]}function B(e,t){if(typeof document>`u`)return()=>{};let n=O();return n?(A(n),n.install(e,t.effects,o)):(k(Se),Ce(e,t.effects))}const Se={define:ee,install:Ce};function Ce(e,t,n=o){let r=new Set(j().map(e=>e.name));for(let e of t)r.has(e.name)||ee(e,n);if(!I){xe();let e=new MutationObserver((e,t)=>ve(e.concat(t.takeRecords())));I=e,te.push(N(()=>{for(let[t,{watchers:n}]of F)ye(t,e),be(t,n)}))}let i=F.get(e);if(i)i.installs++;else{let t=/* @__PURE__ */ new Map;ye(e,I),F.set(e,{installs:1,watchers:t}),be(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=F.get(e);if(!t||--t.installs>0)return;F.delete(e);let n=I,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if(F.size){for(let e of F.keys())ye(e,n);r.length&&queueMicrotask(()=>{if(I!==n)return;let e=[...F.keys()];ve(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{I=void 0;for(let e of te)e();te=[]}}}function we(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 Te(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 Ee(e,t){return window.setTimeout(t,e*h())}function De(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)}}const Oe=e=>e;function ke(e,t,n,r,i){let a=(n.delay??0)/1e3,s=n.duration/1e3,c=n.ease??Oe,l=o(),u=0;return{stop:y(n=>{u+=n;let d=!l&&o()||u>=a+s?1:s>0?Math.max(0,(u-a)/s):0;return r(e+(t-e)*c(d)),d<1||(i?.(),!1)})}}function Ae(e,t,n=Oe,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)}}}const je={stiffness:900,damping:40},Me={stiffness:380,damping:14},Ne=`: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])`,Pe=`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`,Fe=Symbol.for(`vite-hub.motion.press-mode`);function Ie(){let e=Reflect.get(globalThis,Fe);return e===`opt-in`||e===`all`?e:`buttons`}const Le=/* @__PURE__ */ new WeakMap,Re=e=>e>=40?.03:e>=32?.04:.05,ze=e=>Math.min(Re(e.offsetHeight),6/Math.max(e.offsetWidth,e.offsetHeight));function Be(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 Ve(e){let t=Ie();return t===`buttons`?e.matches(`:is(button, input:is([type=button], [type=submit], [type=reset])):is(:not([role]), [role=button])`)&&e.offsetHeight<48&&e.offsetWidth<=4*e.offsetHeight:t===`all`}function He(e,t){if(t===`none`)return;if(t===`icon`){let t=e.querySelector(Pe);return t instanceof HTMLElement||t instanceof SVGElement?{target:t,amount:.15}:void 0}if(t===void 0&&!Ve(e))return;let n=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(n instanceof HTMLElement)return{target:n,amount:ze(n)};let r=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(r instanceof HTMLElement||r instanceof SVGElement)&&r.matches(Pe)?{target:r,amount:.15}:{target:e,amount:ze(e)}}function Ue(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 We(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}const Ge={name:`press`,selector:Ne,press(e,t){if(!(`pointerId`in t))return;let n=He(e,Be(e,t));if(!n)return;let{target:r,amount:i}=n,a=getComputedStyle(r);if(Ue(a)||a.display===`contents`||a.display===`inline`&&r===e&&!(e instanceof HTMLInputElement))return;let o;if(r===e&&(o=e.getBoundingClientRect(),We(o,t,i)))return;let s=Le.get(r);if(!s){let e={amount:i,spring:x(0,t=>{P(r,{scale:t?String(1-e.amount*t):null})},je)};s=e,Le.set(r,s)}s.amount=i;let{spring:c}=s;c.to(1,{preset:je});let l=!1,u=()=>{l||(l=!0,c.set(0))};return{move:o?e=>{We(o,e,i)&&u()}:void 0,release:()=>{l||c.to(0,{preset:Me})},cancel:u}}},V={stiffness:480,damping:36},Ke={stiffness:380,damping:26},qe={stiffness:440,damping:32},Je={widenAfter:120,labelAfterRise:70,labelIn:.24,sinkAfter:90,goneAfter:520},Ye={widenAfter:60,labelAfterRise:40,labelIn:.18,sinkAfter:50,goneAfter:320},Xe=.14,Ze=.15,Qe=/* @__PURE__ */ new WeakMap,$e=/* @__PURE__ */ new Set,et=/* @__PURE__ */ new Set;let H;function tt(e){let t=getComputedStyle(e);return t.clipPath===`inset(50%)`||t.clip===`rect(0px, 0px, 0px, 0px)`}function nt(e){return e.matches(`[role=tooltip]`)?e:e.querySelector(`:scope > [role=tooltip]`)}const rt=`[data-motion-appear]`;function it(e){if(e.matches(rt))return e;if(e.matches(`[role=tooltip]`))return tt(e)?e.parentElement:e;let t=e.querySelector(`:scope > [role=tooltip]`);return t&&tt(t)?e:null}function at(e){let t=e.getAttribute(`data-state`);return t===null?!e.hidden&&!e.hasAttribute(`data-closed`):t!==`closed`}function ot(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=nt(e)?.id;return n?e.getRootNode().querySelector(`[aria-describedby~="${CSS.escape(n)}"]`)??document.querySelector(`[aria-describedby~="${CSS.escape(n)}"]`):null}function st(e){let t=[`translate`,`scale`,`clip-path`,`opacity`].map(t=>[t,e.style.getPropertyValue(t)]);P(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 ct(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 lt(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}const ut=e=>e===`top`||e===`bottom`;function dt(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 ft(e){return[...e.element.children].filter(t=>t instanceof HTMLElement&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!tt(t))}function pt(e){return[...e.element.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE||t instanceof Element&&t!==e.old?.element&&!t.matches(`[role=tooltip]`)&&!tt(t)).map(e=>e.textContent??``).join(``)}function mt(e){return[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())}const U=e=>`${Math.round(e*100)/100}px`;function W(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(U).join(` `)} round ${e.radius})`}else p&&(m=`inset(${f.map(U).join(` `)})`);P(t,{translate:Math.abs(u)>.01||Math.abs(d)>.01||e.old?`${U(u)} ${U(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 ft(e))P(t,{scale:h,opacity:g<1?String(g):null,filter:g<1?`blur(${U((1-g)*6)})`:null});if(e.old){let t=e.old.spring.value;P(e.old.element,{scale:h,opacity:String(t),filter:`blur(${U((1-t)*5)})`})}}function ht(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 gt(e){if(!ht(e)){e.old?.element.remove(),e.old=void 0,P(e.element,{translate:null,scale:null,"clip-path":null,opacity:null});for(let t of ft(e))P(t,{scale:null,opacity:null,filter:null});e.done?.()}}function _t(e,t,n){let r=getComputedStyle(e),i=ct(e,t,n),a={element:e,rest:t,origin:Number.parseFloat(r.transformOrigin)||t.width/2,side:i,edge:lt(i,t,n),trigger:n,mode:mt(e)||e.matches(rt)?`clip`:`scale`,handoff:!e.matches(rt),radius:r.borderRadius||`0px`,timers:/* @__PURE__ */ new Set,holding:!0},o=()=>{W(a),gt(a)};return a.x=x(t.left+t.width/2,o,V),a.y=x(t.top+t.height/2,o,V),a.width=x(t.width,o,qe),a.label=x(1,o),a.fade=x(1,o),a}function vt(e){return e.handoff?Je:Ye}function G(e,t,n){let r=Ee(t,()=>{e.timers.delete(r),n(),gt(e)});e.timers.add(r)}function yt(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 bt(e){yt(e),et.delete(e),H===e&&(H=void 0),e.element.closest(`[data-motion=none]`)?.remove()}function xt(e){if(e){for(let e of et)bt(e);for(let e of $e){let t=Qe.get(e)?.box;t&&(yt(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,gt(t))}}}function St(e,t){let n=e.trigger,r=t.trigger;return!n||!r||e.side!==t.side?!1:ut(t.side)?n.top<r.bottom&&r.top<n.bottom:n.left<r.right&&r.left<n.right}function Ct(e){return ut(e.side)?e.y:e.x}function wt(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=x(n,()=>{W(e),gt(e)});e.old={element:r,spring:i},i.to(0,{tween:.15})}function Tt(e){return e.mode===`clip`?[...e.element.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.cloneNode()):ft(e).map(e=>{let t=e.cloneNode(!0);return t.style.removeProperty(`scale`),t.style.removeProperty(`opacity`),t.style.removeProperty(`filter`),t})}function Et(e,t){let n=t.trigger?.getBoundingClientRect(),r=st(e),i=_t(e,r,n);t.box=i,t.text=pt(i),t.label=Tt(i),P(e,{opacity:null});let a=i.handoff&&H&&St(H,i)?H:void 0;if(a&&(H=void 0),o()){a&&Dt(a,!0),i.fade.set(0),i.holding=!1,i.fade.to(1,{tween:Ze});return}if(a){let e=Tt(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;bt(a),i.x.set(t.x[0]),i.y.set(t.y[0]),i.width.set(t.width[0]),i.label.set(0),wt(i,e,n),i.x.to(r.left+r.width/2,{preset:V,velocity:t.x[1]}),i.y.to(r.top+r.height/2,{preset:V,velocity:t.y[1]}),i.width.to(r.width,{preset:qe,velocity:t.width[1]}),G(i,40,()=>i.label.to(1,{tween:Je.labelIn})),i.holding=!1,W(i);return}Ct(i).set(dt(i)),i.width.set(Math.min(30,r.width)),i.label.set(0),W(i),Ct(i).to(ut(i.side)?r.top+r.height/2:r.left+r.width/2,{preset:Ke});let s=vt(i);G(i,s.widenAfter,()=>{i.width.to(r.width,{preset:qe}),G(i,s.labelAfterRise,()=>i.label.to(1,{tween:s.labelIn}))}),i.holding=!1}function Dt(e,t){if(et.add(e),e.holding=!1,t){e.done=()=>bt(e),e.fade.to(0,{tween:Ze});return}e.handoff&&(H=e),e.old&&e.old.spring.to(0,{tween:Xe}),e.label.to(0,{tween:Xe}),e.width.to(Math.min(30,e.rest.width),{preset:qe});let n=vt(e);G(e,n.sinkAfter,()=>{H===e&&(H=void 0),Ct(e).to(dt(e),{preset:Ke})}),G(e,n.goneAfter,()=>bt(e))}function Ot(e,t){if(!t.open)return;t.open=!1,$e.delete(e),t.stopWatch?.(),t.stopWatch=void 0,$e.size||zt();let n=t.box;if(t.box=void 0,P(e,{opacity:null}),!n)return;let r=t.root.parentNode??t.parent,i=r?.isConnected?we(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},s=Object.fromEntries(Object.entries(a).map(([e,t])=>[e,[t.value,t.velocity]])),c=n.old?.spring.value;yt(n),n.old?.element.remove(),P(e,{translate:null,scale:null,"clip-path":null,opacity:null});for(let e of ft(n))P(e,{scale:null,opacity:null,filter:null});if(!i)return;let l=kt(t.root,e).reduce((e,t)=>e?.children[t],i);if(!(l instanceof HTMLElement)){i.remove();return}e.hasAttribute(`popover`)&&(P(l,{scale:null}),Te(l,n.rest));let u=_t(l,n.rest,void 0);Object.assign(u,{side:n.side,edge:n.edge,trigger:n.trigger,mode:n.mode,origin:n.origin,radius:n.radius,handoff:n.handoff});let d=l.querySelector(`:scope > [aria-hidden=true][style*=absolute]`);c!==void 0&&d&&(u.old={element:d,spring:x(c,()=>W(u))});for(let e of[`x`,`y`,`width`,`label`,`fade`])u[e].set(s[e][0]);W(u);for(let e of[`x`,`y`,`width`])s[e][1]&&u[e].to(s[e][0],{velocity:s[e][1]});Dt(u,o())}function kt(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 At(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 At(e,t,n,r-1);n()})}function jt(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()):Ot(e,t)});return n(),()=>r.disconnect()}function Mt(e){let t=Qe.get(e);if(t?.open)return;let n=ot(e);if(n&&S(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},Qe.set(e,t),$e.add(e),Rt(),P(e,{opacity:`0`}),t.stopWatch=jt(e,t);let i=t;At(e,t,()=>Et(e,i))}let Nt=0;function Pt(){Nt=0;for(let e of $e){let t=Qe.get(e),n=t?.box;if(!t||!n)continue;let r=st(e),i=pt(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,s=(a||Math.abs(r.height-n.rest.height)>1)&&!n.handoff&&!ht(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&&!s&&i===t.text)continue;let c=i===t.text?[]:t.label;t.trigger=ot(e)??t.trigger;let l=t.trigger?.getBoundingClientRect();t.text=i,t.label=Tt(n),n.rest=r,n.side=ct(e,r,l),n.edge=lt(n.side,r,l),o()||s?(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:V}),n.y.to(r.top+r.height/2,{preset:V}),n.width.to(r.width,{preset:qe}),c.length&&(n.old?.spring.stop(),n.old?.element.remove(),wt(n,c,n.label.value),n.label.set(0),G(n,40,()=>n.label.to(1,{tween:vt(n).labelIn}))))}}function Ft(){Nt||=requestAnimationFrame(Pt)}let It=!1,Lt;function Rt(){Lt??=s(xt),It||(It=!0,document.addEventListener(`pointerover`,Ft,{capture:!0,passive:!0}),document.addEventListener(`focusin`,Ft,{capture:!0,passive:!0}))}function zt(){It=!1,cancelAnimationFrame(Nt),Nt=0,document.removeEventListener(`pointerover`,Ft,{capture:!0}),document.removeEventListener(`focusin`,Ft,{capture:!0})}const Bt={enter(e){it(e)===e&&at(e)&&Mt(e)},state(e){if(it(e)!==e)return;let t=Qe.get(e);at(e)?Mt(e):t&&Ot(e,t)}};({...Bt});const Vt={name:`appear`,selector:rt,...Bt};function Ht(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}const Ut={stiffness:380,damping:26},Wt={stiffness:260,damping:28},Gt=.9,Kt=De(.5,0,.75,0),qt=`data-motion-ghost`,K=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function Jt(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function Yt(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(qt))}function Xt(e,t={}){let n=t.items??Yt,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=/* @__PURE__ */ new Map,s=!1;function l(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 u(e,t){let{x:n,y:i,grow:a,from:o}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){P(e,{translate:null,scale:null,opacity:null}),s||r.delete(e);return}let{x:c,y:u}=l(t),d=o.scale+(1-o.scale)*a.value;P(e,{translate:c||u?`${c.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 d(e){let t=r.get(e);if(t)return t;let n=()=>t&&u(e,t);return t={x:x(0,n,c.snappy),y:x(0,n,c.snappy),grow:x(1,n,Ut),from:{x:0,y:0,scale:1}},r.set(e,t),t}function f(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),P(e,{translate:null,scale:null,opacity:null}))}function p(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:c.snappy,velocity:n})}function m(t,n,r){if(!Jt(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let s=Ht(t);s.setAttribute(qt,``),Object.assign(s.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`}),P(s,{translate:null,scale:null,opacity:null,filter:null}),e.append(s);let c={element:s,stop:()=>{}},l=()=>{c.stop(),s.remove(),i.delete(c)};if(i.add(c),o()){let e=Ae(.15,e=>P(s,{opacity:(1-e).toFixed(3)}));c.stop=e.stop,e.done.then(l);return}if(r){let e=K(r.getBoundingClientRect()),t=K(n),i=Ae(.32,n=>{P(s,{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})},Kt);c.stop=i.stop,i.done.then(l);return}let u=x(1,e=>{P(s,{scale:(Gt+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&l()},Wt);c.stop=()=>u.stop(),u.to(0)}return{measure(){a=/* @__PURE__ */ new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=K(e),i=l(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let c=a;a=/* @__PURE__ */ new Map;let u=S(e),h=n(e),g=new Set(h),_=h.map(e=>{let t=e.getBoundingClientRect(),n=l(r.get(e)),i=K(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),v=_.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)g.has(e)||(f(e),u||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||m(e,n,i.target));s=!0,_.forEach(({element:e,rect:n,layout:r},i)=>{if(u)return f(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(!Jt(a.rect)&&!Jt(n))return f(e);let o=d(e);p(o.x,o.x.value+t),p(o.y,o.y.value+i);return}if(!Jt(n)||t.movesOnly)return;let s=d(e),l=v[i];if(o())s.from={x:0,y:0,scale:1};else if(l){let e=K(l),t=Math.min(1,Math.max(.2,Math.min(l.width/(n.width||1),l.height/(n.height||1))));s.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else s.from={x:0,y:0,scale:Gt};s.grow.set(0),s.grow.to(1,o()?{tween:.15}:{preset:Ut})}),s=!1},destroy(){for(let e of r.keys())f(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=/* @__PURE__ */ new Map}}}const Zt=`vitehub`,Qt=[`comment`];function $t(e){return`vitehub-tools=${+!!e}; Path=/; Max-Age=2592000; SameSite=Lax`}function en(e,t){let n=new URLSearchParams(e);if(n.has(`vitehub`)||Qt.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=`))}const tn=`/_vitehub/page/tools`,nn=`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
2
|
@media(hover:hover){button:where(:not(:disabled):hover){background:var(--vitehub-pill-hover);color:var(--vitehub-pill-strong)}}
|
|
3
3
|
button[aria-pressed=true],button[aria-expanded=true]{background:var(--vitehub-pill-on);color:var(--vitehub-pill-on-text)}
|
|
4
4
|
:host([aria-busy=true]) button,button[aria-busy=true]{background:var(--vitehub-pill-on);color:var(--vitehub-pill-on-text);cursor:progress}
|
|
5
5
|
button:focus-visible{outline:2px solid var(--vitehub-pill-on);outline-offset:1px}
|
|
6
6
|
button svg{width:14px;height:14px;flex:none}
|
|
7
7
|
@media(any-pointer:coarse){button{min-width:44px;height:44px}}
|
|
8
|
-
@media(prefers-reduced-motion:reduce){button{transition:none}}`;`${JSON.stringify([
|
|
8
|
+
@media(prefers-reduced-motion:reduce){button{transition:none}}`;`${JSON.stringify([Zt,...Qt])}`;function rn(e){let t=new URL(e,`http://localhost`).pathname,n=t.lastIndexOf(`/_vitehub/page/assets/`);return n===-1?tn:`${t.slice(0,n)}${tn}`}function q(e){return typeof e==`string`&&e?e:void 0}function an(e){if(typeof e!=`object`||!e)return;let t=q(Reflect.get(e,`id`)),n=q(Reflect.get(e,`script`));if(!t||!n)return;let r={id:t,label:q(Reflect.get(e,`label`))??t,icon:q(Reflect.get(e,`icon`))??``,script:n};Reflect.get(e,`lazy`)===!0&&(r.lazy=!0);let i=q(Reflect.get(e,`hotkey`));i&&(r.hotkey=i);let a=q(Reflect.get(e,`param`));return a&&(r.param=a),r}function on(e){if(typeof e!=`object`||!e)return;let t=q(Reflect.get(e,`name`)),n=q(Reflect.get(e,`signOut`));if(!t||!n?.startsWith(`/`)||n.startsWith(`//`)||n.includes(`\\`))return;let r={name:t,signOut:n},i=q(Reflect.get(e,`email`));i&&(r.email=i);let a=q(Reflect.get(e,`image`));return a&&/^https?:\/\//i.test(a)&&(r.image=a),Reflect.get(e,`via`)===`console`&&(r.via=`console`),Reflect.get(e,`guest`)===!0&&(r.guest=!0),r}function sn(e){let t=typeof e==`object`&&e?Reflect.get(e,`tools`):void 0,n={tools:Array.isArray(t)?t.map(an).filter(e=>!!e):[]},r=typeof e==`object`&&e?on(Reflect.get(e,`account`)):void 0;return r&&(n.account=r),n}const J=/* @__PURE__ */ new Map;let cn;function ln(e,t){let n=e.parentElement;n&&!t.aborted&&(J.set(e,n),t.addEventListener(`abort`,()=>{J.delete(e),pn(e),J.size||(cn?.stop(),cn=void 0)},{once:!0}),cn??=un(),cn.refresh())}function un(){let e=new AbortController,t=/* @__PURE__ */ new Set([document]),n=/* @__PURE__ */ 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=dn(n,r)??fn();for(let[n,r]of J){if(!n.parentElement)continue;let i=t??r;i.isConnected&&(n.parentElement!==i&&(pn(n),i.append(n)),t?typeof n.showPopover==`function`&&(e||!n.matches(`:popover-open`))&&(pn(n),n.popover=`manual`,n.showPopover()):pn(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&&J.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||[...J.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 dn(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 fn(){let e=document.fullscreenElement;for(;e?.shadowRoot?.fullscreenElement&&e.shadowRoot.fullscreenElement!==e;)e=e.shadowRoot.fullscreenElement;return e}function pn(e){e.hasAttribute(`popover`)&&(e.matches(`:popover-open`)&&e.hidePopover(),e.removeAttribute(`popover`))}const Y={effects:[Ge]},mn=[[`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%`]],hn=e=>e.map(([e,t])=>[`calc(50% + var(--vitehub-hex-w) * ${e})`,`calc(50% + var(--vitehub-hex-h) * ${t})`]),gn=hn([[-.28,-.453],[-.208,-.5],[.208,-.5],[.28,-.453],[.488,-.047],[.488,.047],[.28,.453],[.208,.5],[-.208,.5],[-.28,.453],[-.488,.047],[-.488,-.047]]),_n=hn([[-.5,-.5],[-.5,-.5],[.5,-.5],[.5,-.5],[.5,0],[.5,0],[.5,.5],[.5,.5],[-.5,.5],[-.5,.5],[-.5,0],[-.5,0]]),vn=e=>`polygon(${e.map(([e,t])=>`${e} ${t}`).join(`,`)})`;function yn(e,t,n){let r=(1-n).toFixed(4),i=n.toFixed(4);return vn(e.map(([e,n],a)=>[`calc(${e} * ${r} + ${t[a][0]} * ${i})`,`calc(${n} * ${r} + ${t[a][1]} * ${i})`]))}const bn=`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`,xn=vn(mn),Sn=vn(gn),Cn=vn(_n),wn=e=>`calc(var(--start) + ${e} / 2 + (100% - var(--start) - var(--end) - ${e}) * var(--at) / 100)`,Tn=`: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:20px;--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
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:${
|
|
11
|
-
:host(:is([edge=left],[edge=right])){top:${
|
|
10
|
+
:host(:is([edge=top],[edge=bottom])){left:${wn(`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:${wn(`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
12
|
:host([edge=bottom]){bottom:max(16px,var(--safe-bottom))}
|
|
13
13
|
:host([edge=top]){top:max(16px,var(--safe-top))}
|
|
14
14
|
:host([edge=right]){right:max(16px,var(--safe-right))}
|
|
15
15
|
:host([edge=left]){left:max(16px,var(--safe-left))}
|
|
16
|
-
:host([collapsed]:is([edge=top],[edge=bottom])){left:${
|
|
17
|
-
:host([collapsed]:is([edge=left],[edge=right])){top:${
|
|
16
|
+
:host([collapsed]:is([edge=top],[edge=bottom])){left:${wn(`var(--vitehub-hex-w)`)};--x:-50%}
|
|
17
|
+
:host([collapsed]:is([edge=left],[edge=right])){top:${wn(`var(--vitehub-hex-h)`)};--y:-50%}
|
|
18
18
|
:host([collapsed][edge=bottom]){bottom:calc(max(2px,var(--safe-bottom)) + var(--vitehub-hex-h) / 2);--y:50%}
|
|
19
19
|
:host([collapsed][edge=top]){top:calc(max(2px,var(--safe-top)) + var(--vitehub-hex-h) / 2);--y:-50%}
|
|
20
20
|
:host([collapsed][edge=right]){right:calc(max(2px,var(--safe-right)) + var(--vitehub-hex-w) / 2);--x:50%}
|
|
21
21
|
:host([collapsed][edge=left]){left:calc(max(2px,var(--safe-left)) + var(--vitehub-hex-w) / 2);--x:-50%}
|
|
22
22
|
:host{transform:translate(var(--x,0),var(--y,0))}
|
|
23
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:${
|
|
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:${xn};transition:background-color 150ms ease-out}
|
|
25
25
|
:host(:is([edge=left],[edge=right])) div{display:grid;grid-template-columns:auto 1fr;align-items:stretch;gap:8px 2px}
|
|
26
|
-
:host([collapsed]){
|
|
27
|
-
:host([collapsed]) div{
|
|
28
|
-
|
|
26
|
+
:host([collapsed]) div{clip-path:${Sn};background-color:rgb(32 32 32/94%)}
|
|
27
|
+
@media(hover:hover){:host([collapsed]) div:hover{background-color:rgb(52 52 52/94%)}}
|
|
28
|
+
:host([collapsed]:not([folding],[fold=mark])) div{clip-path:${Cn};background-color:transparent;border-color:transparent}
|
|
29
|
+
.pill-hexagon{display:none;position:absolute;left:50%;top:50%;translate:-50% -50%;width:var(--vitehub-hex-w);height:var(--vitehub-hex-h);pointer-events:none;fill:rgb(32 32 32/94%)}
|
|
30
|
+
.pill-hexagon path{clip-path:path("${bn}") view-box;stroke:#9e9e9e}
|
|
31
|
+
:host([collapsed]:not([folding],[fold=mark])) .pill-hexagon{display:block}
|
|
32
|
+
@media(hover:hover){div:hover>.pill-hexagon{fill:rgb(52 52 52/94%)}}
|
|
29
33
|
:host([dragging]) div{transition:none}
|
|
30
34
|
::slotted(*){flex-shrink:0;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:2px;transition:var(--vitehub-pill-fade)}
|
|
31
35
|
:host(:is([edge=left],[edge=right])) ::slotted(*){grid-column:1/-1;align-items:stretch}
|
|
@@ -45,7 +49,7 @@ div{position:relative;box-sizing:border-box;max-width:calc(100vw - 32px);max-hei
|
|
|
45
49
|
:host([edge=top]) ::slotted([slot=tab]){border-top:0;border-radius:0 0 10px 10px}
|
|
46
50
|
:host([edge=left]) ::slotted([slot=tab]){border-left:0;border-radius:0 10px 10px 0}
|
|
47
51
|
:host([edge=right]) ::slotted([slot=tab]){border-right:0;border-radius:10px 0 0 10px}
|
|
48
|
-
${
|
|
52
|
+
${nn}
|
|
49
53
|
button{flex-shrink:0;padding:0;justify-content:center}
|
|
50
54
|
.exit{position:sticky;right:0;bottom:0;transition:background-color 150ms,color 150ms,var(--vitehub-pill-fade-end)}
|
|
51
55
|
:host(:is([edge=left],[edge=right])) .mark{justify-self:start}
|
|
@@ -62,31 +66,34 @@ button{flex-shrink:0;padding:0;justify-content:center}
|
|
|
62
66
|
:host([fold=mark]){transition:filter 240ms ease-out}
|
|
63
67
|
:host([fold=mark][collapsed]){filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
|
|
64
68
|
: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:${
|
|
69
|
+
:host([fold=mark][collapsed]) div,:host([fold=mark][collapsed]) div:hover{clip-path:${Cn};background-color:transparent;border-color:transparent}
|
|
66
70
|
:host([fold=mark]) .mark{transition:background-color 150ms ease-out,color 150ms ease-out}
|
|
67
71
|
:host([fold=mark]) .mark svg{transition:none}
|
|
68
72
|
:host([fold=mark][collapsed]) .mark svg{opacity:1;transform:scale(1.5)}
|
|
69
73
|
@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 xn(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}const Sn=[`top`,`right`,`bottom`,`left`];function Cn(e){return Sn.some(t=>t===e)}function wn(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 Cn(t)&&typeof n==`number`&&n>=0&&n<=100?{edge:t,at:n}:void 0}function Tn(e){try{return wn(JSON.parse(localStorage.getItem(e)??`null`))}catch{return}}function En(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 Dn(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 On(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)}}const kn=/* @__PURE__ */ new WeakMap;function An(e){let t=e?getComputedStyle(e).transform:`none`,n=/^matrix\(([^,]+)/.exec(t)?.[1];return n&&Number.parseFloat(n)||1}function jn(e,t,n,r,i){let a=()=>e.getAttribute(`fold`)===`mark`?pn:fn,s=()=>n.querySelector(`svg`),l={x:0,y:0},u=1,d=!1,f,p=[],m=()=>{if(!d&&!g.active&&!_.active&&!v.active){N(t,{"clip-path":null}),N(e,{translate:null}),N(n,{translate:null});let r=s();r&&N(r,{scale:null});for(let e of p)e();p=[],i();return}let r=e.hasAttribute(`collapsed`),o=g.value;N(t,{"clip-path":hn(un,a(),o)}),N(e,{translate:`${_.value.toFixed(2)}px ${v.value.toFixed(2)}px`});let c=r?l:{x:0,y:0};N(n,{translate:`${(l.x*o-c.x).toFixed(2)}px ${(l.y*o-c.y).toFixed(2)}px`});let f=s();f&&N(f,{scale:((1+(u-1)*o)/(r?u:1)).toFixed(4)})},g=x(0,m,c.snappy),_=x(0,m,c.snappy),v=x(0,m,c.snappy),y=()=>{let e=t.getBoundingClientRect();return{x:e.left+e.width/2-_.value,y:e.top+e.height/2-v.value}},b=()=>{l={x:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-x`))||0,y:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-y`))||0},e.hasAttribute(`collapsed`)&&(u=An(s()))};return{get moving(){return d||g.active||_.active||v.active},move(t,n=0){r();let i=new Promise(e=>p.push(e)),a=y(),s=e.hasAttribute(`collapsed`);b(),t(),b();let l=y(),u=e.hasAttribute(`collapsed`);clearTimeout(f),d=!0;for(let[e,t]of[[_,a.x-l.x+_.value],[v,a.y-l.y+v.value]]){let n=e.velocity;e.set(t),n&&e.to(t,{velocity:n})}g.active||g.set(+!!s);let m=()=>{d=!1,_.to(0,{preset:c.snappy}),v.to(0,{preset:c.snappy}),g.to(+!!u,{preset:c.snappy})};return n>0&&!o()?f=setTimeout(m,n*h()):m(),i}}}function Mn(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=bn;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,l=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.`},u=()=>e.markOnly?.active()===!0,d=e.markOnly?.opened===!0,f=()=>u()?!d:Fn(e.storage.collapsed)??s;l(f());let p=e=>{let t=y,r=e&&n.contains(document.activeElement);b=void 0,e&&t.edge!==`bottom`&&S(v)&&(b=t),F.move(()=>{l(e),k(v)},e&&!n.hasAttribute(`collapsed`)?40:0).then(()=>{b&&(b=void 0,n.hasAttribute(`collapsed`)&&k(v))}),r&&o.focus({preventScroll:!0})};o.addEventListener(`click`,()=>{if(te())return;let t=!n.hasAttribute(`collapsed`);if(E=!1,p(t),!t&&ee()&&e.windows?.hide(),u())d=!t;else try{t===s?localStorage.removeItem(e.storage.collapsed):localStorage.setItem(e.storage.collapsed,t?`1`:`0`)}catch{}});let m=e.exit,h;m&&(h=document.createElement(`button`),h.className=`exit`,h.dataset.motionPress=``,h.setAttribute(`aria-label`,m.label),h.title=m.label,h.append(xn(`0 0 24 24`,`M18 6 6 18M6 6l12 12`,{width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})),m.menu||h.addEventListener(`click`,e=>m.press(e.detail===0))),a.append(o,...h?[h]:[]);let g=document.createElement(`slot`);g.name=`tab`,g.className=`tabs`;let _=document.createElement(`span`);_.className=`page-bar`,r.append(i,g,a,_),h&&m?.menu&&r.append(...m.menu(h));for(let t of e.slots){let e=document.createElement(`slot`);e.name=t,a.insertBefore(e,h??null)}let v=Tn(e.storage.dock)??e.initial?.dock??{edge:`bottom`,at:50},y=v,b,S=e=>u()&&!n.hasAttribute(`dragging`)&&e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:void 0,C=()=>y.edge===`left`||y.edge===`right`,w=matchMedia(`(any-pointer: coarse)`),T={width:0,height:0},E=!1,D=()=>{let e=getComputedStyle(n),t=t=>Number.parseFloat(e.getPropertyValue(`--safe-${t}`))||0,r=Number.parseFloat(getComputedStyle(_).height)||0;return On({width:innerWidth,height:innerHeight},T,w.matches,{top:t(`top`),right:t(`right`),bottom:t(`bottom`),left:t(`left`)},r)},ee=()=>e.windows?.shown()===!0&&S(v)!==void 0&&D().fit===`fold`,O=()=>{let e=!f()&&ee();e===E||n.hasAttribute(`dragging`)||(E=e,p(f()||E))},k=t=>{v=t;let r=n.hasAttribute(`collapsed`),i=S(t);y=i?r?b??i:{edge:i.at===0?`left`:`right`,at:100}:t,n.setAttribute(`edge`,y.edge),a.setAttribute(`aria-orientation`,y.edge===`left`||y.edge===`right`?`vertical`:`horizontal`),n.style.setProperty(`--at`,String(y.at));let s=Z(n),c=r?C()?s.width:s.height:C()?a.offsetWidth:a.offsetHeight;i&&!r&&(T={width:a.offsetWidth,height:a.offsetHeight});let l=i&&!r&&D().fit===`beside`?{beside:T.width+8}:{thickness:a.offsetHeight};e.onPlace?.(i?{...i,collapsed:!1,...l}:{...y,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`)},te=Pn({host:n,handle:o,dock:()=>v,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?Z(n).height:Z(n).width:r,margin:t?2:16}},place:k,drop:()=>{F.move(()=>k(v)).then(O);try{localStorage.setItem(e.storage.dock,JSON.stringify({edge:v.edge,at:v.at}))}catch{}},signal:t}),A=Jt(a,{items:()=>[o,...[...n.children].filter(e=>e instanceof HTMLElement&&e.slot!==`tab`),...h?[h]:[]],movesOnly:!0}),j={width:0,height:0},M={top:0,right:0,bottom:0,left:0},P=x(0,(e,t)=>{N(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)`})},c.snappy),F=jn(n,a,o,()=>P.stop(),()=>A.measure());kn.set(n,F);let I=[z(n,X),z(r,X)];if(t.aborted){for(let e of I)e();return n}let L=new ResizeObserver(e=>{if(k(v),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`)||F.moving)return;if(!t.width)return A.measure();A.play(),A.measure();let r={x:j.width-t.width,y:j.height-t.height},i={x:C()?y.edge===`right`?r.x:0:r.x*y.at/100,y:C()?r.y*y.at/100:y.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)&&(P.set(1),P.to(0,{preset:c.snappy}))});return t.addEventListener(`abort`,()=>{n.remove(),L.disconnect(),P.stop(),A.destroy();for(let e of I)e()},{once:!0}),(e.parent??document.documentElement).append(n),an(n,t),k(v),t.aborted||(L.observe(a),L.observe(_),addEventListener(`resize`,()=>{k(v),O()},{signal:t}),e.windows?.watch(O,t),e.markOnly?.watch(()=>{d=!1,E=!1,p(f())},t)),n}async function Nn(e){if(e.inert=!0,e.hasAttribute(`collapsed`)||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e.shadowRoot?.querySelector(`div`),n=kn.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*h()))])}function Pn(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=En(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:Dn(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 Z(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--vitehub-hex-h`))||24;return{width:t*10/9,height:t}}function Fn(e){try{let t=localStorage.getItem(e);return t===`1`||t!==`0`&&void 0}catch{return}}const In=`[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
|
|
72
|
-
[role
|
|
73
|
-
[role
|
|
74
|
-
[role
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.
|
|
78
|
-
|
|
74
|
+
@media(prefers-reduced-motion:reduce){:host,div,::slotted(*),.exit,.mark svg,:host([fold=mark]) :is(div,.mark){transition:none}}`;function X(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}function En(){let e=X(`0 0 20 18`,bn,{class:`pill-hexagon`}),t=e.querySelector(`path`);return t.setAttribute(`stroke-width`,`2`),t.setAttribute(`vector-effect`,`non-scaling-stroke`),e}const Dn=[`top`,`right`,`bottom`,`left`];function On(e){return Dn.some(t=>t===e)}function kn(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 On(t)&&typeof n==`number`&&n>=0&&n<=100?{edge:t,at:n}:void 0}function An(e){try{return kn(JSON.parse(localStorage.getItem(e)??`null`))}catch{return}}function jn(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 Mn(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 Nn(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)}}const Pn=/* @__PURE__ */ new WeakMap;function Fn(e){let t=e?getComputedStyle(e).transform:`none`,n=/^matrix\(([^,]+)/.exec(t)?.[1];return n&&Number.parseFloat(n)||1}function In(e,t,n,r,i){let a=()=>e.getAttribute(`fold`)===`mark`?_n:gn,s=()=>n.querySelector(`svg`),l={x:0,y:0},u=1,d=!1,f,p=[],m=()=>{if(e.toggleAttribute(`folding`,d||g.active),!d&&!g.active&&!_.active&&!v.active){P(t,{"clip-path":null}),P(e,{translate:null}),P(n,{translate:null});let r=s();r&&P(r,{scale:null});for(let e of p)e();p=[],i();return}let r=e.hasAttribute(`collapsed`),o=g.value;P(t,{"clip-path":d||g.active?yn(mn,a(),o):null}),P(e,{translate:`${_.value.toFixed(2)}px ${v.value.toFixed(2)}px`});let c=r?l:{x:0,y:0};P(n,{translate:`${(l.x*o-c.x).toFixed(2)}px ${(l.y*o-c.y).toFixed(2)}px`});let f=s();f&&P(f,{scale:((1+(u-1)*o)/(r?u:1)).toFixed(4)})},g=x(0,m,c.snappy),_=x(0,m,c.snappy),v=x(0,m,c.snappy),y=()=>{let e=t.getBoundingClientRect();return{x:e.left+e.width/2-_.value,y:e.top+e.height/2-v.value}},b=()=>{l={x:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-x`))||0,y:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-y`))||0},e.hasAttribute(`collapsed`)&&(u=Fn(s()))};return{get moving(){return d||g.active||_.active||v.active},move(t,n=0){r();let i=new Promise(e=>p.push(e)),a=y(),s=e.hasAttribute(`collapsed`);b(),t(),b();let l=y(),u=e.hasAttribute(`collapsed`);clearTimeout(f),d=!0;for(let[e,t]of[[_,a.x-l.x+_.value],[v,a.y-l.y+v.value]]){let n=e.velocity;e.set(t),n&&e.to(t,{velocity:n})}g.active||g.set(+!!s);let m=()=>{d=!1,_.to(0,{preset:c.snappy}),v.to(0,{preset:c.snappy}),g.to(+!!u,{preset:c.snappy})};return n>0&&!o()?f=setTimeout(m,n*h()):m(),i}}}function Ln(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=Tn;let a=document.createElement(`div`);a.setAttribute(`role`,`toolbar`),a.setAttribute(`aria-label`,e.label),e.fold!==`mark`&&a.append(En());let o=document.createElement(`button`);o.className=`mark`,o.dataset.motionPress=``,o.append(e.mark);let s=e.initial?.collapsed===!0,l=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.`},u=()=>e.markOnly?.active()===!0,d=e.markOnly?.opened===!0,f=()=>u()?!d:Bn(e.storage.collapsed)??s;l(f());let p=e=>{let t=y,r=e&&n.contains(document.activeElement);b=void 0,e&&t.edge!==`bottom`&&S(v)&&(b=t),I.move(()=>{l(e),A(v)},e&&!n.hasAttribute(`collapsed`)?40:0).then(()=>{b&&(b=void 0,n.hasAttribute(`collapsed`)&&A(v))}),r&&o.focus({preventScroll:!0})};o.addEventListener(`click`,()=>{if(ee())return;let t=!n.hasAttribute(`collapsed`);if(E=!1,p(t),!t&&O()&&e.windows?.hide(),u())d=!t;else try{t===s?localStorage.removeItem(e.storage.collapsed):localStorage.setItem(e.storage.collapsed,t?`1`:`0`)}catch{}});let m=e.exit,h;m&&(h=document.createElement(`button`),h.className=`exit`,h.dataset.motionPress=``,h.setAttribute(`aria-label`,m.label),h.title=m.label,h.append(X(`0 0 24 24`,`M18 6 6 18M6 6l12 12`,{width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})),m.menu||h.addEventListener(`click`,e=>m.press(e.detail===0))),a.append(o,...h?[h]:[]);let g=document.createElement(`slot`);g.name=`tab`,g.className=`tabs`;let _=document.createElement(`span`);_.className=`page-bar`,r.append(i,g,a,_),h&&m?.menu&&r.append(...m.menu(h));for(let t of e.slots){let e=document.createElement(`slot`);e.name=t,a.insertBefore(e,h??null)}let v=An(e.storage.dock)??e.initial?.dock??{edge:`bottom`,at:50},y=v,b,S=e=>u()&&!n.hasAttribute(`dragging`)&&e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:void 0,C=()=>y.edge===`left`||y.edge===`right`,w=matchMedia(`(any-pointer: coarse)`),T={width:0,height:0},E=!1,D=()=>{let e=getComputedStyle(n),t=t=>Number.parseFloat(e.getPropertyValue(`--safe-${t}`))||0,r=Number.parseFloat(getComputedStyle(_).height)||0;return Nn({width:innerWidth,height:innerHeight},T,w.matches,{top:t(`top`),right:t(`right`),bottom:t(`bottom`),left:t(`left`)},r)},O=()=>e.windows?.shown()===!0&&S(v)!==void 0&&D().fit===`fold`,k=()=>{let e=!f()&&O();e===E||n.hasAttribute(`dragging`)||(E=e,p(f()||E))},A=t=>{v=t;let r=n.hasAttribute(`collapsed`),i=S(t);y=i?r?b??i:{edge:i.at===0?`left`:`right`,at:100}:t,n.setAttribute(`edge`,y.edge),a.setAttribute(`aria-orientation`,y.edge===`left`||y.edge===`right`?`vertical`:`horizontal`),n.style.setProperty(`--at`,String(y.at));let s=Z(n),c=r?C()?s.width:s.height:C()?a.offsetWidth:a.offsetHeight;i&&!r&&(T={width:a.offsetWidth,height:a.offsetHeight});let l=i&&!r&&D().fit===`beside`?{beside:T.width+8}:{thickness:a.offsetHeight};e.onPlace?.(i?{...i,collapsed:!1,...l}:{...y,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`)},ee=zn({host:n,handle:o,dock:()=>v,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?Z(n).height:Z(n).width:r,margin:t?2:16}},place:A,drop:()=>{I.move(()=>A(v)).then(k);try{localStorage.setItem(e.storage.dock,JSON.stringify({edge:v.edge,at:v.at}))}catch{}},signal:t}),j=Xt(a,{items:()=>[o,...[...n.children].filter(e=>e instanceof HTMLElement&&e.slot!==`tab`),...h?[h]:[]],movesOnly:!0}),M={width:0,height:0},N={top:0,right:0,bottom:0,left:0},F=x(0,(e,t)=>{P(a,{"clip-path":t===0&&e===0?null:`inset(${[N.top,N.right,N.bottom,N.left].map(t=>`${(t*e).toFixed(2)}px`).join(` `)} round 12px)`})},c.snappy),I=In(n,a,o,()=>F.stop(),()=>j.measure());Pn.set(n,I);let L=[B(n,Y),B(r,Y)];if(t.aborted){for(let e of L)e();return n}let R=new ResizeObserver(e=>{if(A(v),k(),!e.some(e=>e.target===a))return;let t=M;if(M={width:a.offsetWidth,height:a.offsetHeight},n.hasAttribute(`collapsed`)||n.hasAttribute(`dragging`)||I.moving)return;if(!t.width)return j.measure();j.play(),j.measure();let r={x:M.width-t.width,y:M.height-t.height},i={x:C()?y.edge===`right`?r.x:0:r.x*y.at/100,y:C()?r.y*y.at/100:y.edge===`bottom`?r.y:0};N={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)},(N.top||N.right||N.bottom||N.left)&&(F.set(1),F.to(0,{preset:c.snappy}))});return t.addEventListener(`abort`,()=>{n.remove(),R.disconnect(),F.stop(),j.destroy();for(let e of L)e()},{once:!0}),(e.parent??document.documentElement).append(n),ln(n,t),A(v),t.aborted||(R.observe(a),R.observe(_),addEventListener(`resize`,()=>{A(v),k()},{signal:t}),e.windows?.watch(k,t),e.markOnly?.watch(()=>{d=!1,E=!1,p(f())},t)),n}async function Rn(e){if(e.inert=!0,e.hasAttribute(`collapsed`)||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e.shadowRoot?.querySelector(`div`),n=Pn.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*h()))])}function zn(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=jn(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:Mn(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 Z(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--vitehub-hex-h`))||20;return{width:t*10/9,height:t}}function Bn(e){try{let t=localStorage.getItem(e);return t===`1`||t!==`0`&&void 0}catch{return}}const Vn=`[role=menu]{position:fixed;inset:auto;box-sizing:border-box;width:max-content;min-width:min(220px,var(--menu-width));max-width:min(300px,var(--menu-width));margin:0;padding:6px;overflow:auto;overscroll-behavior:contain;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}
|
|
75
|
+
[role^=menuitem]{display:flex;width:100%;height:32px;justify-content:flex-start;gap:8px;font-size:13px}
|
|
76
|
+
[role^=menuitem] svg{width:15px;height:15px;flex:none;color:var(--vitehub-pill-muted)}
|
|
77
|
+
[role^=menuitem] span{overflow:hidden;text-overflow:ellipsis}
|
|
78
|
+
[role^=menuitem][hidden]{display:none}
|
|
79
|
+
[role^=menuitem][aria-disabled=true]{cursor:progress}
|
|
80
|
+
[role^=menuitem] .end{display:flex;align-items:center;gap:6px;margin-left:auto;padding-left:16px}
|
|
81
|
+
[role^=menuitem] .end svg{color:var(--vitehub-pill-strong)}
|
|
82
|
+
[role^=menuitem] kbd{box-sizing:border-box;display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:4px;background:rgb(255 255 255/8%);font:500 11px/1 ui-sans-serif,system-ui,sans-serif;color:var(--vitehub-pill-muted)}
|
|
83
|
+
[role=menu] hr{height:1px;margin:4px 0;border:0;background:var(--vitehub-pill-line)}
|
|
84
|
+
@media(any-pointer:coarse){[role^=menuitem]{height:44px}}`,Hn=`${nn}
|
|
85
|
+
${Vn}
|
|
86
|
+
.who{position:relative;align-self:flex-start;width:28px;padding:0;justify-content:center}
|
|
87
|
+
.who[data-on]::after{content:"";position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:50%;background:var(--vitehub-pill-strong)}
|
|
88
|
+
.avatar{box-sizing:border-box;display:grid;place-items:center;width:32px;height:32px;flex:none;overflow:hidden;border-radius:50%;background:#404040;color:var(--vitehub-pill-strong);font-size:12px;font-weight:600;line-height:1}
|
|
79
89
|
.avatar img{display:block;width:100%;height:100%;object-fit:cover}
|
|
80
90
|
.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
91
|
.me div{min-width:0}
|
|
83
92
|
.me b,.me small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
84
93
|
.me b{color:var(--vitehub-pill-strong);font-weight:500}
|
|
85
94
|
.me small{margin-top:2px;color:var(--vitehub-pill-muted);font-size:12px}
|
|
86
|
-
.
|
|
87
|
-
.
|
|
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="m16 17 5-5-5-5M21 12H9M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/></svg>`;function zn(e){return e.trim().split(/\s+/).slice(0,2).map(e=>[...e][0]??``).join(``).toLocaleUpperCase()}function Bn(e){let t=document.createElement(`span`);if(t.className=`avatar`,t.setAttribute(`aria-hidden`,`true`),t.textContent=zn(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 Vn(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 Hn(){let e=new URL(location.href);for(let t of[q,...Yt])e.searchParams.delete(t);return e}function Un(e){let{account:t,bar:n,signal:r}=e,i=n.parentElement,a=n.attachShadow({mode:`open`});r.addEventListener(`abort`,z(a,X),{once:!0});let o=document.createElement(`style`);o.textContent=Ln;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(Bn(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(Bn(t),u),s.append(l),t.via===`console`){let t=document.createElement(`div`);t.className=`via`,t.setAttribute(`role`,`none`),t.append(xn(`0 0 20 18`,e.mark,{}),`Signed in with ViteHub Console`),s.append(t)}let f=Vn(`<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>`,`Open in the Console`),p=Vn(Rn,`Sign out of ${location.host}`);s.append(f.item,p.item),a.append(o,c,s);let m;Gn({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}),Kn(t,p,r)}function Wn(e){let{account:t,button:n,turnOff:r,canExit:i,signal:a}=e,o=document.createElement(`style`);o.textContent=In;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=Vn(`<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>`,r.label),l=Vn(Rn,`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 Gn({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}),Kn(t,l,a,i),[o,s]}function Gn(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 Kn(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=Hn();i.href===location.href?location.reload():location.replace(i)},{signal:n})}function qn(e,...t){return typeof e==`function`?e(...t):e}const Jn=Error.captureStackTrace;var 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,Jn?.(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}}};function Xn(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}const Zn=e=>t=>t instanceof Yn&&e in t;/* @__NO_SIDE_EFFECTS__ */
|
|
89
|
-
function Qn(e){let t=e.reporters??[],n=Symbol(),r=Object.defineProperty({},"is",{value:Zn(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||Xn(i,a),c=(e={},r={})=>{let i=new Yn({code:a,why:qn(o.why,e),fix:qn(o.fix,e),docs:s,cause:e.cause,sources:e.sources,data:qn(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}const $n=/*#__PURE__*/ Qn({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 er(e){return $n.INTERNAL_INVARIANT_FAILED({what:e})}function tr(e,t){if(!e)throw er(t)}let Q={edge:`bottom`,at:50};const nr=/* @__PURE__ */ new Map,rr=/* @__PURE__ */ new Set;let ir=!1,ar=0;function or(){ir||(ir=!0,queueMicrotask(()=>{ir=!1;for(let e of rr)e()}))}function sr(){return[...nr.keys()].some(e=>!e.hidden)}function cr(){for(let[e,t]of nr)e.hidden||t()}function lr(e,t){rr.add(e),t.addEventListener(`abort`,()=>rr.delete(e),{once:!0})}function ur(e){e.setAttribute(`edge`,Q.edge),e.toggleAttribute(`collapsed`,!!Q.collapsed),e.style.setProperty(`--at`,String(Q.at)),Q.thickness?e.style.setProperty(`--thickness`,`${Q.thickness}px`):e.style.removeProperty(`--thickness`);for(let[t,n]of[[`start`,0],[`end`,100]])Q.beside&&Q.at===n?e.style.setProperty(`--beside-${t}`,`${Q.beside}px`):e.style.removeProperty(`--beside-${t}`);for(let t of[`top`,`right`,`bottom`,`left`])e.shadowRoot.querySelector(`.grip.${t}`).hidden=dr(t)===0}function dr(e){return(e===`top`||e===`bottom`)==(Q.edge===`top`||Q.edge===`bottom`)?1:e===`top`||e===`left`?Q.at/100:1-Q.at/100}function fr(e){Q=e;for(let e of nr.keys())ur(e)}function pr(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 mr(e){let t=document.createElement(`vitehub-window`);t.hidden=!0;let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=`
|
|
95
|
+
`,Un=e=>X(`0 0 24 24`,e,{fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),Wn=`<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 Gn(e){return e.trim().split(/\s+/).slice(0,2).map(e=>[...e][0]??``).join(``).toLocaleUpperCase()}function Kn(e){let t=document.createElement(`span`);if(t.className=`avatar`,t.setAttribute(`aria-hidden`,`true`),t.textContent=Gn(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 qn(e,t){let n=document.createElement(`button`);n.type=`button`,n.setAttribute(`role`,`menuitem`),n.tabIndex=-1,e&&n.insertAdjacentHTML(`beforeend`,e);let r=document.createElement(`span`);return r.textContent=t,n.append(r),{item:n,label:r}}function Jn(){let e=new URL(location.href);for(let t of[Zt,...Qt])e.searchParams.delete(t);return e}function Yn(e){let{account:t,bar:n,pill:r=n.parentElement,signal:i}=e,a=n.attachShadow({mode:`open`});i.addEventListener(`abort`,B(a,Y),{once:!0});let o=document.createElement(`style`);o.textContent=Hn;let s=document.createElement(`div`);s.id=`account-menu`,s.setAttribute(`popover`,`auto`),s.setAttribute(`role`,`menu`),s.setAttribute(`aria-label`,t?.name??`More`);let c=document.createElement(`button`);c.type=`button`,c.className=`who`,c.dataset.motionPress=``,c.title=t?`More. Signed in as ${t.email?`${t.name} (${t.email})`:t.name}`:`More`,c.setAttribute(`aria-label`,t?`More. Signed in as ${t.name}`:`More`),c.setAttribute(`aria-haspopup`,`menu`),c.setAttribute(`aria-expanded`,`false`),c.setAttribute(`aria-controls`,s.id),c.setAttribute(`popovertarget`,s.id),c.append(Un(`M5 12h.01M12 12h.01M19 12h.01`));let l=[];if(t){let e=document.createElement(`div`);e.className=`me`,e.setAttribute(`role`,`none`);let n=document.createElement(`div`),r=document.createElement(`b`);if(r.textContent=t.name,n.append(r),t.email){let e=document.createElement(`small`);e.textContent=t.email,n.append(e)}e.append(Kn(t),n),l.push(e)}let u=t?qn(Wn,`Sign out of ${location.host}`):void 0;a.append(o,c,s);let d=!1,f=!1,p=()=>{f=!1;let r=e.items().filter(e=>e.length>0);n.hidden=!t&&r.length===0;let a=[...l];for(let[e,t]of r.entries()){e>0&&a.push(Object.assign(document.createElement(`hr`),{role:`separator`}));for(let e of t){let{item:t}=qn(``,e.label);if(e.icon&&t.prepend(Un(e.icon)),t.dataset.item=e.id,e.keys&&t.setAttribute(`aria-keyshortcuts`,e.keys),e.checked!==void 0&&(t.setAttribute(`role`,`menuitemcheckbox`),t.setAttribute(`aria-checked`,String(e.checked))),e.checked||e.keys){let n=document.createElement(`span`);n.className=`end`,e.checked&&n.append(Un(`M20 6 9 17l-5-5`)),e.keys&&n.append(Object.assign(document.createElement(`kbd`),{textContent:e.keys})),t.append(n)}t.addEventListener(`click`,()=>{d&&s.hidePopover(),e.press()},{signal:i}),a.push(t)}}u&&a.push(u.item),s.replaceChildren(...a),c.toggleAttribute(`data-on`,r.some(e=>e.some(e=>e.checked)))};return p(),Zn({menu:s,button:c,pill:r,beforeOpen:p,signal:i}),t&&u&&Qn(t,u,i),s.addEventListener(`beforetoggle`,e=>{d=e.newState===`open`,!d&&f&&p()},{signal:i}),{update:()=>{d?f=!0:p()}}}function Xn(e){let{account:t,button:n,turnOff:r,canExit:i,signal:a}=e,o=document.createElement(`style`);o.textContent=Vn;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=qn(`<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>`,r.label),l=qn(Wn,`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 Zn({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}),Qn(t,l,a,i),[o,s]}function Zn(e){let{menu:t,button:n,pill:r,signal:i}=e,a=()=>{n.getAttribute(`aria-expanded`)===`true`&&t.hidePopover()},o=()=>{let e=t.getRootNode();return e instanceof ShadowRoot||e instanceof Document?e.activeElement:null},s=()=>[...t.querySelectorAll(`[role^=menuitem]`)].filter(e=>!e.hidden),c=()=>r?.getAttribute(`edge`)??`bottom`,l=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`},l,u=i-16;if(e===`bottom`||e===`top`)c.right=`${Math.max(8,i-s.right)}px`,l=e===`bottom`?a-o.top+8:o.bottom+8,c[e]=`${l}px`;else{let t=s.top<a/2?`top`:`bottom`;l=Math.max(8,t===`top`?s.top:a-s.bottom),c[t]=`${l}px`;let n=e===`left`?`left`:`right`,r=n===`left`?o.right+8:i-o.left+8;c[n]=`${r}px`,u=i-r-8}Object.assign(t.style,c),t.style.maxHeight=`${Math.max(0,a-l-8)}px`,t.style.setProperty(`--menu-width`,`${Math.max(0,u)}px`)},u=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`,r=>{if(r.newState===`closed`){t.contains(o())&&n.focus({preventScroll:!0});return}e.beforeOpen?.();let i=c();l(i),requestAnimationFrame(()=>u(i))},{signal:i}),t.addEventListener(`toggle`,e=>{let r=e.newState===`open`;n.setAttribute(`aria-expanded`,String(r)),r&&(t.scrollTop=0,s()[0]?.focus({preventScroll:!0}))},{signal:i}),window.addEventListener(`resize`,()=>{if(n.getAttribute(`aria-expanded`)!==`true`)return;let e=c();l(e),u(e)},{signal:i}),t.addEventListener(`keydown`,e=>{let t=s(),n=t.findIndex(e=>e===o()),r=e.key===`ArrowDown`?n+1:e.key===`ArrowUp`?n-1:e.key===`Home`?0:e.key===`End`?t.length-1:void 0;r===void 0?e.key===`Escape`?e.stopPropagation():e.key===`Tab`&&a():(e.preventDefault(),t[(r+t.length)%t.length]?.focus())},{signal:i}),r){let e=new MutationObserver(e=>{e.some(e=>e.oldValue!==r.getAttribute(e.attributeName??``))&&a()});e.observe(r,{attributes:!0,attributeOldValue:!0,attributeFilter:[`collapsed`,`dragging`,`edge`]}),i.addEventListener(`abort`,()=>e.disconnect(),{once:!0})}i.addEventListener(`abort`,a,{once:!0})}function Qn(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=Jn();i.href===location.href?location.reload():location.replace(i)},{signal:n})}function $n(e,...t){return typeof e==`function`?e(...t):e}const er=Error.captureStackTrace;var tr=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,er?.(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}}};function nr(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}const rr=e=>t=>t instanceof tr&&e in t;/* @__NO_SIDE_EFFECTS__ */
|
|
96
|
+
function ir(e){let t=e.reporters??[],n=Symbol(),r=Object.defineProperty({},"is",{value:rr(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||nr(i,a),c=(e={},r={})=>{let i=new tr({code:a,why:$n(o.why,e),fix:$n(o.fix,e),docs:s,cause:e.cause,sources:e.sources,data:$n(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}const ar=/*#__PURE__*/ ir({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 or(e){return ar.INTERNAL_INVARIANT_FAILED({what:e})}function sr(e,t){if(!e)throw or(t)}let Q={edge:`bottom`,at:50};const cr=/* @__PURE__ */ new Map,lr=/* @__PURE__ */ new Set;let ur=!1,dr=0;function fr(){ur||(ur=!0,queueMicrotask(()=>{ur=!1;for(let e of lr)e()}))}function pr(){return[...cr.keys()].some(e=>!e.hidden)}function mr(){for(let[e,t]of cr)e.hidden||t()}function hr(e,t){lr.add(e),t.addEventListener(`abort`,()=>lr.delete(e),{once:!0})}function gr(e){e.setAttribute(`edge`,Q.edge),e.toggleAttribute(`collapsed`,!!Q.collapsed),e.style.setProperty(`--at`,String(Q.at)),Q.thickness?e.style.setProperty(`--thickness`,`${Q.thickness}px`):e.style.removeProperty(`--thickness`);for(let[t,n]of[[`start`,0],[`end`,100]])Q.beside&&Q.at===n?e.style.setProperty(`--beside-${t}`,`${Q.beside}px`):e.style.removeProperty(`--beside-${t}`);for(let t of[`top`,`right`,`bottom`,`left`])e.shadowRoot.querySelector(`.grip.${t}`).hidden=_r(t)===0}function _r(e){return(e===`top`||e===`bottom`)==(Q.edge===`top`||Q.edge===`bottom`)?1:e===`top`||e===`left`?Q.at/100:1-Q.at/100}function vr(e){Q=e;for(let e of cr.keys())gr(e)}function yr(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 br(e){let t=document.createElement(`vitehub-window`);t.hidden=!0;let n=t.attachShadow({mode:`open`}),r=document.createElement(`style`);r.textContent=`
|
|
90
97
|
: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}
|
|
91
98
|
:host([collapsed]){--margin:2px}
|
|
92
99
|
:host([edge=top]){--dock:calc(max(var(--margin),var(--safe-top)) + var(--thickness,38px) + 8px);--far:max(16px,var(--safe-bottom))}
|
|
@@ -118,7 +125,7 @@ header :is(button,a):focus-visible{outline:2px solid var(--focus);outline-offset
|
|
|
118
125
|
.body{flex:1;min-height:0;overflow:auto;position:relative}iframe{display:block;border:0;width:100%;height:100%;background:var(--surface)}
|
|
119
126
|
@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}}
|
|
120
127
|
@media(forced-colors:active){.window{border:1px solid CanvasText}header :is(button,a):focus-visible{outline-color:Highlight}}
|
|
121
|
-
`;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(
|
|
128
|
+
`;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(yr(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(yr(`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=_r(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?.(),fr()};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-${++dr}`,gr(t);let y=B(n,Y),b=()=>{cr.delete(t)&&!t.hidden&&fr(),g.disconnect(),t.remove(),y()};return e.signal.aborted?b():(e.signal.addEventListener(`abort`,b,{once:!0}),cr.set(t,_),document.documentElement.append(t)),{body:s,show(){e.signal.aborted||(v(),f(),t.hidden=!1,fr(),e.trigger.setAttribute(`aria-expanded`,`true`),i.focus({preventScroll:!0}))},hide:_,destroy:b,syncColorScheme:v}}function xr(e){let t=typeof e==`object`&&e?Reflect.get(e,`default`):void 0;return t instanceof Function?t:void 0}const Sr=`vitehub-tools-collapsed`,Cr=`vitehub-tools-dock`,wr=`vitehub-account`;function Tr(e){try{return localStorage.getItem(e)===`1`}catch{return!1}}function Er(e){try{let t=JSON.parse(localStorage.getItem(e)??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function Dr(e){let t=document.createElement(`link`);t.rel=`modulepreload`,t.href=e;let n=document.querySelector(`script[data-vitehub-page-tools]`)?.nonce;n&&(t.nonce=n),document.head.append(t)}function Or(e,t,n){let r=Symbol.for(`vitehub.page-tools.session`),i=Reflect.get(globalThis,r);if(Reflect.deleteProperty(globalThis,r),typeof i!=`object`||!i)return;let a=new URL(e,t);if(a.origin!==t.origin||a.search||Reflect.get(i,`route`)!==a.pathname||Reflect.get(i,`page`)!==t.pathname||Reflect.get(i,`open`)!==(n||void 0))return;let o=sn(Reflect.get(i,`session`));return o.tools.length>0?o:void 0}function kr(e,t){try{localStorage.setItem(e,JSON.stringify(t.filter(e=>!e.lazy).map(e=>e.script)))}catch{}}function Ar(e,t){try{t?localStorage.setItem(e,`1`):localStorage.removeItem(e)}catch{}}function jr(){return document.documentElement.getAttribute(`data-vitehub-pill`)===`mark`||Mr}let Mr=!1,Nr=!1;function Pr(){try{return localStorage.getItem(Cr)}catch{return null}}function Fr(){if(Nr||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=/* @__PURE__ */ 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 Ir(e){return e.edge===`bottom`?{edge:`bottom`,at:e.at<50?0:100}:e}function Lr(e,t){let n=jr(),r=Pr(),i=()=>{Nr||=Pr()!==r;let t=Mr;if(Mr=Fr(),t&&!Mr&&Nr&&document.querySelector(`vitehub-pill`)?.hasAttribute(`collapsed`))try{localStorage.setItem(Sr,`1`)}catch{}jr()!==n&&(n=!n,e())},a=new MutationObserver(i);a.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-vitehub-pill`]});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===Cr)&&(r=Pr()),s()},{signal:t}),document.addEventListener(`pointerup`,s,{signal:t}),t.addEventListener(`abort`,()=>{a.disconnect(),c.disconnect(),clearTimeout(o)},{once:!0})}const $={name:`vitehub-pill`,label:`ViteHub tools`,off:`vitehub-tools-off`,collapsed:Sr,dock:Cr};function Rr(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=An(e.dock)??e.initialDock??{edge:`bottom`,at:50},s=()=>{let t=e===$&&jr()&&!a.hasAttribute(`dragging`)?Ir(o):o;a.setAttribute(`edge`,t.edge),a.style.setProperty(`--at`,String(t.at))};s();let l=new AbortController;t.addEventListener(`abort`,()=>{l.abort(),a.remove()},{once:!0,signal:l.signal}),e===$&&Lr(s,l.signal);let u=a.attachShadow({mode:`open`}),d=B(u,Y);l.signal.addEventListener(`abort`,d,{once:!0});let f=document.createElement(`style`);f.textContent=`${Tn}\n:host([off]){--vitehub-hex-h:14px;filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
|
|
122
129
|
: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}
|
|
123
130
|
:host([off][edge=bottom]) button{transform-origin:calc(var(--at) * 1%) 100%}
|
|
124
131
|
:host([off][edge=top]) button{transform-origin:calc(var(--at) * 1%) 0}
|
|
@@ -127,11 +134,11 @@ header :is(button,a):focus-visible{outline:2px solid var(--focus);outline-offset
|
|
|
127
134
|
:host([off][closing]) button{opacity:1}
|
|
128
135
|
:host([off][dragging]) button{opacity:1;cursor:grabbing}
|
|
129
136
|
:host([off]) button::before{content:"";position:absolute;inset:-6px}
|
|
130
|
-
svg{display:block;width:100%;height:100%;overflow:visible;fill:rgb(17 17 17/92%);stroke:
|
|
137
|
+
svg{display:block;width:100%;height:100%;overflow:visible;fill:rgb(17 17 17/92%);stroke:oklch(0.95 0 0);stroke-width:1px;vector-effect:non-scaling-stroke;transition:fill 150ms ease-out}
|
|
131
138
|
:host([off]) button:focus-visible{opacity:1}
|
|
132
139
|
:host([off][dragging]) svg{scale:none}
|
|
133
140
|
@media(hover:hover){:host([off]) button:hover{opacity:1;background:none}button:hover svg{fill:rgb(38 38 38/94%)}}
|
|
134
141
|
@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}}
|
|
135
|
-
@media(prefers-reduced-motion:reduce){:host([off]) button,svg{transition:none}}`;let p=document.createElement(`button`);if(p.type=`button`,p.title=`Turn on ${e.label}`,p.dataset.motionPress=``,p.setAttribute(`aria-label`,p.title),p.append(
|
|
142
|
+
@media(prefers-reduced-motion:reduce){:host([off]) button,svg{transition:none}}`;let p=document.createElement(`button`);if(p.type=`button`,p.title=`Turn on ${e.label}`,p.dataset.motionPress=``,p.setAttribute(`aria-label`,p.title),p.append(X(`0 0 20 18`,bn,{})),u.append(f,p),document.documentElement.append(a),ln(a,l.signal),i){let e=i/Z(a).height,t=x(e,(e,t)=>{let n=t===0&&e===1;P(p,{scale:n?null:e.toFixed(4)}),n&&a.removeAttribute(`closing`)},c.snappy);t.set(e),t.to(1,{preset:c.snappy})}let m=zn({host:a,handle:p,dock:()=>o,shape:e=>{let t=e?a.offsetHeight:a.offsetWidth,n=Z(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:l.signal});p.addEventListener(`click`,()=>{m()||(l.abort(),a.remove(),n())}),r&&p.focus({preventScroll:!0})}async function zr(e={}){return await Vr(e,!1)}let Br=new AbortController;async function Vr(e,t){let n=new URL(location.href),r=n.searchParams,i=r.get(Zt),a=typeof e.session==`function`?e.session:void 0,o=typeof e.session==`string`?e.session:rn(import.meta.url);if(!a&&!en(location.search,document.cookie))return[];let{signal:s}=Br;try{CSS.registerProperty({name:`--vitehub-page-bar`,syntax:`<length>`,inherits:!0,initialValue:`0px`})}catch{}let c=e.pill??$;c===$&&(Nr=An(Cr)!==void 0,Mr=Fr());let l=e.load??(e=>import(
|
|
136
143
|
/* @vite-ignore */
|
|
137
|
-
e)),u;try{if(a)
|
|
144
|
+
e)),u=`vitehub-tools-scripts:${o}`,d;try{let e=a?void 0:Or(o,n,i);if(a)d=await a();else if(e)d=e,document.cookie=$t(!0),kr(u,d.tools);else{if(!Tr(c.off))for(let e of Er(u))Dr(e);let e=new URL(o,location.href);e.searchParams.set(`page`,location.pathname),i&&e.searchParams.set(`open`,i);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[];d=sn(await t.json()),kr(u,d.tools)}}catch{return[]}if(s.aborted||d.tools.length===0||document.querySelector(`${c.name}, ${c.off}`))return[];let f=i||d.tools.find(e=>e.param&&r.has(e.param))?.id;if(r.has(`vitehub`)||f||e.open)Ar(c.off,!1);else if(Tr(c.off))return Rr(c,s,()=>{Ar(c.off,!1),Vr(e,!0)},!1),[];let p=e.open||f,m=d.tools.some(e=>e.id===p),h=new AbortController,g=d.tools.map(()=>new AbortController);s.addEventListener(`abort`,()=>{for(let e of g)e.abort();h.abort()},{once:!0,signal:h.signal});let _=/* @__PURE__ */ new Set,v=!1,y=()=>!v&&[..._].every(e=>e()),b=(t=!1)=>{if(!y())return;v=!0;let n=d.tools.filter(e=>k(e.id));for(let e of d.tools)O(e.id,!1);Ar(c.off,!0);let r=new URL(location.href);(c===$||d.tools.some(e=>e.id===r.searchParams.get(`vitehub`)))&&r.searchParams.delete(Zt);for(let e of d.tools)e.param&&r.searchParams.delete(e.param);r.href!==location.href&&history.replaceState(history.state,``,r);let i=Z(S).height,a=Rn(S);for(let e of g)e.abort();a.then(()=>{h.abort(),Rr(c,s,()=>{Ar(c.off,!1);for(let e of n)O(e.id,!0);Vr(e,!0)},t,i&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches?i:void 0)})},x=d.account,S=Ln({name:c.name,label:c.label,mark:X(`0 0 20 18`,bn,{fill:`currentColor`}),slots:[...d.tools.map(e=>e.id),wr],storage:{collapsed:c.collapsed,dock:c.dock},...c.initialDock?{initial:{dock:c.initialDock}}:{},exit:{label:`Turn off ${c.label}`,press:b,...x&&!x.guest?{menu:e=>Xn({account:x,button:e,turnOff:{label:`Turn off ${c.label}`,press:b},canExit:y,signal:h.signal})}:{}},onPlace:vr,windows:{shown:pr,hide:mr,watch:hr},...c===$?{markOnly:{active:jr,watch:Lr,opened:t}}:{},signal:h.signal});h.signal.addEventListener(`abort`,B(S,{effects:[Ge,Vt]}),{once:!0});let C=/* @__PURE__ */ new Map,w=document.createElement(`vitehub-account`);w.slot=wr,S.append(w);let T=Yn({...d.account?{account:d.account}:{},bar:w,items:()=>d.tools.map(e=>C.get(e.id)??[]),signal:h.signal}),E=/* @__PURE__ */ new Map,D=t=>`vitehub-open:${e.pill?.name??o}:${t}`,O=(e,t)=>{try{sessionStorage.setItem(D(e),String(t))}catch{}},k=e=>{try{return sessionStorage.getItem(D(e))===`true`}catch{return!1}},A=/* @__PURE__ */ new Map,ee=async(e,t)=>await A.get(e)?.(t)??!1,j=(await Promise.all(d.tools.map(async(e,t)=>{let{signal:n}=g[t],r=document.createElement(`vitehub-tool`);r.slot=e.id,S.append(r);let i,a,o,s=()=>(o||(o=l(e.script),o.catch(()=>{o=void 0})),o),c=!1,u=()=>{let t=document.createElement(`vitehub-tool`);t.slot=e.id,r.replaceWith(t),r=t},d=()=>{let e=r.attachShadow({mode:`open`}),t=B(e,Y);n.addEventListener(`abort`,t,{once:!0});let i=document.createElement(`style`);i.textContent=nn,e.append(i,v)},h=(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 l=new AbortController,m=()=>l.abort();n.addEventListener(`abort`,m,{once:!0}),l.signal.addEventListener(`abort`,()=>{C.delete(e.id)&&T.update()},{once:!0});try{r.setAttribute(`aria-busy`,`true`);let a=xr(await s());if(sr(a,`the script of a page tool default-exports a function (${e.script})`),n.aborted)return!1;v.remove(),r.shadowRoot?u():r.replaceChildren();let d=a({beforeExit:e=>{let t=()=>e();_.add(t),l.signal.addEventListener(`abort`,()=>_.delete(t),{once:!0})},tool:e,bar:r,signal:l.signal,open:o&&(e.lazy===!0||e.id===p||k(e.id)),linked:o&&e.id===f,exit:()=>b(),createWindow:t=>{let n=br({...t,signal:l.signal,onHide:()=>{O(e.id,!1),S.hasAttribute(`collapsed`)&&S.shadowRoot.querySelector(`button.mark`).focus({preventScroll:!0}),t.onHide?.()}}),r={...n,show(){if(!l.signal.aborted){for(let[t,n]of E)t!==e.id&&n.hide();O(e.id,!0),n.show()}},destroy(){E.get(e.id)===r&&(E.delete(e.id),O(e.id,!1)),n.destroy()}};return E.set(e.id,r),r},openTool:ee,menu:t=>{l.signal.aborted||(C.set(e.id,t),T.update())},createTab:()=>{let e=document.createElement(`vitehub-tab`);return e.slot=`tab`,e.setAttribute(`data-motion-appear`,`vitehub-pill`),S.append(e),l.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),d instanceof Function&&(n.aborted?d():l.signal.addEventListener(`abort`,()=>d(),{once:!0})),!n.aborted}catch(t){return l.abort(),n.removeEventListener(`abort`,m),E.delete(e.id)&&O(e.id,!1),i=void 0,c=!1,console.error(`[vitehub] The page tool "${e.id}" did not start.`,t),u(),v.textContent=`Retry ${e.label}`,v.title=`The tool could not load. Try again.`,r.hidden=!1,d(),!1}finally{r.removeAttribute(`aria-busy`),a=void 0}})(),a),v=document.createElement(`button`);v.type=`button`,v.textContent=e.label,v.dataset.motionPress=``,v.addEventListener(`click`,()=>void h());for(let e of[`pointerenter`,`pointerdown`,`focus`])v.addEventListener(e,()=>void s());return A.set(e.id,h),e.lazy&&e.id!==p&&!k(e.id)?(d(),e):(await h(void 0,!m||e.id===p),n.aborted?void 0:e)}))).filter(e=>!!e);if(j.length===0)h.abort();else if(i!==null){let e=new URL(location.href);e.pathname===n.pathname&&e.searchParams.get(`vitehub`)===i&&(c===$||d.tools.some(e=>e.id===i))&&(e.searchParams.delete(Zt),history.replaceState(history.state,``,e))}return j}zr({session:new URL(`../tools`,import.meta.url).pathname});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as pagePathOf } from "./path-
|
|
1
|
+
import { n as pagePathOf } from "./path-sv8kjq3i.js";
|
|
2
2
|
// src/page.ts
|
|
3
3
|
/**
|
|
4
4
|
* The numbering scope of page threads: subjects of kind `page`, which the overlay pins on the app's pages. Threads on
|
|
@@ -40,4 +40,27 @@ function commentRoom(page) {
|
|
|
40
40
|
function commentNoticeRoom(subject) {
|
|
41
41
|
return `subjects/${encodeURIComponent(JSON.stringify([subject.kind, subject.id]))}`;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
/** The notice that tells the open pages of a thread to load their threads again. */
|
|
44
|
+
const commentsChangeNotice = { type: "comments" };
|
|
45
|
+
/** Name of the Realtime Definition of the Console that holds the notice rooms of Hosted Comments sites. */
|
|
46
|
+
const hostedCommentsNoticeDefinition = "hosted-comments";
|
|
47
|
+
/**
|
|
48
|
+
* The notice room of a Hosted Comments project. Each session of the project has its own room, so the server sends a
|
|
49
|
+
* notice only to the sessions that may still read the project.
|
|
50
|
+
*/
|
|
51
|
+
function hostedCommentNoticeRoom(projectId) {
|
|
52
|
+
return `projects/${encodeURIComponent(projectId)}`;
|
|
53
|
+
}
|
|
54
|
+
/** The notice of a Hosted Comments project that the threads of `subject` changed. */
|
|
55
|
+
function hostedCommentsChangeNotice(subject) {
|
|
56
|
+
return {
|
|
57
|
+
type: "comments",
|
|
58
|
+
subject: {
|
|
59
|
+
kind: subject.kind,
|
|
60
|
+
id: subject.id
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** The notice that the session of a Hosted Comments page ended, such as when its pass was revoked. */
|
|
65
|
+
const hostedCommentsEndedNotice = { type: "ended" };
|
|
66
|
+
export { commentsPageScope as a, hostedCommentNoticeRoom as c, hostedCommentsNoticeDefinition as d, mountedCommentsRoute as f, commentsNoticeDefinition as i, hostedCommentsChangeNotice as l, commentRoom as n, commentsRealtimeDefinition as o, normalizeCommentPage as p, commentsChangeNotice as r, commentsRoute as s, commentNoticeRoom as t, hostedCommentsEndedNotice as u };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { w as CommentSubject } from "./types-BmzTyGt-.js";
|
|
2
|
+
/** Mount Comments under the application path, ignoring Vite asset URLs such as a CDN origin. */
|
|
3
|
+
declare function mountedCommentsRoute(base?: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* The key of a page: its pathname without query or hash, and without a trailing slash except for `/`. Threads and
|
|
6
|
+
* presence rooms belong to a page key. A full URL of the page, such as `https://site.test/pricing/`, gives the key of
|
|
7
|
+
* its path, `/pricing`.
|
|
8
|
+
*/
|
|
9
|
+
declare function normalizeCommentPage(path: string): string;
|
|
10
|
+
/** The Realtime document id of the presence room of a page: `pages/<hash>`, a safe Workspace path for any page. */
|
|
11
|
+
declare function commentRoom(page: string): string;
|
|
12
|
+
/** The notice that tells the open pages of a thread to load their threads again. */
|
|
13
|
+
declare const commentsChangeNotice: {
|
|
14
|
+
readonly type: "comments";
|
|
15
|
+
};
|
|
16
|
+
/** Name of the Realtime Definition of the Console that holds the notice rooms of Hosted Comments sites. */
|
|
17
|
+
declare const hostedCommentsNoticeDefinition = "hosted-comments";
|
|
18
|
+
/**
|
|
19
|
+
* The notice room of a Hosted Comments project. Each session of the project has its own room, so the server sends a
|
|
20
|
+
* notice only to the sessions that may still read the project.
|
|
21
|
+
*/
|
|
22
|
+
declare function hostedCommentNoticeRoom(projectId: string): string;
|
|
23
|
+
/** The notice of a Hosted Comments project that the threads of `subject` changed. */
|
|
24
|
+
declare function hostedCommentsChangeNotice(subject: CommentSubject): {
|
|
25
|
+
type: "comments";
|
|
26
|
+
subject: CommentSubject;
|
|
27
|
+
};
|
|
28
|
+
/** The notice that the session of a Hosted Comments page ended, such as when its pass was revoked. */
|
|
29
|
+
declare const hostedCommentsEndedNotice: {
|
|
30
|
+
readonly type: "ended";
|
|
31
|
+
};
|
|
32
|
+
export { hostedCommentsEndedNotice as a, normalizeCommentPage as c, hostedCommentsChangeNotice as i, commentsChangeNotice as n, hostedCommentsNoticeDefinition as o, hostedCommentNoticeRoom as r, mountedCommentsRoute as s, commentRoom as t };
|