@p4code/cli 0.7.3 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/bin.mjs +94 -48
  2. package/dist/client/assets/DiffPanel-BYKR1lez.js +98 -0
  3. package/dist/client/assets/FilePreviewPanel-Cs9BMyNQ.js +2230 -0
  4. package/dist/client/assets/P4DesignScreen-B2KfGz1K.js +19 -0
  5. package/dist/client/assets/P4DesignScreen-D6gkHJN-.css +1 -0
  6. package/dist/client/assets/PreviewPanel-Cb5mnizs.js +2 -0
  7. package/dist/client/assets/PullRequestCodeTab-C_g7YA7o.js +251 -0
  8. package/dist/client/assets/collapsible-C5OZcGTw.js +2 -0
  9. package/dist/client/assets/entities-DT_qhLch.js +2 -0
  10. package/dist/client/assets/fileCommentAnnotations-CwEFBcQo.js +2 -0
  11. package/dist/client/assets/index-CJxJFMPU.js +3274 -0
  12. package/dist/client/assets/{index-XfE7ve8U.css → index-DQqa12Zh.css} +1 -1
  13. package/dist/client/assets/{renderFileChildren-B7uYxWA9.js → renderFileChildren-Bwk6pWNb.js} +2 -2
  14. package/dist/client/assets/textarea-B7H3jk59.js +48 -0
  15. package/dist/client/assets/toggle-group-NddHXOMC.js +2 -0
  16. package/dist/client/index.html +5 -5
  17. package/dist/{renderer-Dd2mDvu6.mjs → renderer-DZwr3Qmo.mjs} +2 -2
  18. package/dist/{runtime-Bv8fNDZe.mjs → runtime-DC_ewLnZ.mjs} +2 -2
  19. package/dist/{src-BLvXVs9y.mjs → src-DjTfFS-z.mjs} +29 -3
  20. package/package.json +1 -1
  21. package/dist/client/assets/DiffPanel-1TZXju6q.js +0 -98
  22. package/dist/client/assets/FilePreviewPanel-DGKHFQQ_.js +0 -2230
  23. package/dist/client/assets/P4DesignScreen-DIBwDYjN.js +0 -19
  24. package/dist/client/assets/P4DesignScreen-D_8l8WCl.css +0 -1
  25. package/dist/client/assets/PreviewPanel-B5bhhzbx.js +0 -2
  26. package/dist/client/assets/PullRequestCodeTab-ENp-K16o.js +0 -251
  27. package/dist/client/assets/entities-fvtdKO2-.js +0 -2
  28. package/dist/client/assets/fileCommentAnnotations-BPIepn3Q.js +0 -2
  29. package/dist/client/assets/index-B4Nxc2w0.js +0 -3265
  30. package/dist/client/assets/previewAssetResource-J1WeeXS-.js +0 -4
  31. package/dist/client/assets/textarea-CVN2-Kkx.js +0 -47
  32. package/dist/client/assets/toggle-group-Bs73JkcK.js +0 -2
@@ -1,4 +0,0 @@
1
- import{n as e,r as t}from"./rolldown-runtime-QTnfLwEv.js";import{r as n}from"./preload-helper-CEhsl8MR.js";import{n as r,r as i,t as a}from"./compiler-runtime-CLAvuQ-D.js";import{$f as o,$u as s,Bc as c,Bo as l,Ca as u,Co as d,Cs as f,Do as p,Es as m,F as h,Fl as g,Gc as _,Gs as v,Hf as y,Ho as b,Ia as x,Is as S,Ja as C,Jf as w,Ki as T,L as E,Ll as D,Lo as O,Ls as k,Ms as A,Ns as j,Oi as M,P as N,Ps as ee,Qa as P,Qf as F,Qi as te,R as ne,Rc as I,Rl as L,Rs as re,Sl as R,Uc as z,Vo as ie,Wc as ae,Wf as oe,Ws as se,Yi as ce,Za as le,Zf as ue,_ as de,_l as fe,_o as pe,an as me,bo as he,co as ge,d as _e,di as ve,do as B,dp as ye,ep as V,et as be,g as xe,go as Se,h as Ce,ho as we,jo as Te,js as Ee,ks as De,ll as Oe,lo as ke,m as Ae,mo as je,ot as Me,p as Ne,pn as Pe,po as Fe,pp as Ie,qf as Le,ui as Re,vl as ze,vo as H,vs as Be,ws as Ve,xn as He,xo as Ue,yl as We,ys as U,za as W,zh as Ge,zo as Ke}from"./textarea-CVN2-Kkx.js";function qe(e){return Ge({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}var G=t(i()),Je=t(n()),K=r(),q=a();function Ye(e){return e.bootstrapComplete?e.serverThreadDetailExists||e.draftThreadExists?`ready`:e.serverThreadDetailDeleted?`missing`:e.serverThreadShellExists?`loading`:`missing`:`loading`}function Xe(e){return{environmentId:e.environmentId,threadId:e.threadId}}function Ze(e){return{draftId:e}}function Qe(e){return!e.environmentId||!e.threadId?null:g(e.environmentId,e.threadId)}function $e(e,t,n){let r=e.filter(e=>e.detachedAt===null&&(e.implementerThreadId===t||e.watcherThreadId===t));return r.find(e=>e.id===n)??r[0]??null}function et(e){return e.environmentId&&e.threadId?{kind:`server`,threadRef:g(e.environmentId,e.threadId)}:e.draftId?{kind:`draft`,draftId:e.draftId}:null}function tt(e,t){return e?.kind===`server`?e.threadRef:e?.kind!==`draft`||!t?.promotedTo?null:t.promotedTo}var nt=re(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),rt=re(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),it=re(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),at=re(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ot=G.createContext(void 0);function st(){let e=G.useContext(ot);if(!e)throw Error(De(73));return e}var ct=0;function lt(e){return ct+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ct}`}function ut(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function dt(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}var ft=e=>e.toastMetadata,J={toasts:W(e=>e.toasts),isEmpty:W(e=>e.toasts.length===0),toast:W(ft,(e,t)=>e.get(t)?.value),toastIndex:W(ft,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:W(ft,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:W(ft,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:W(e=>e.hovering),focused:W(e=>e.focused),expanded:W(e=>e.hovering||e.focused),expandedOrOutOfFocus:W(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:W(e=>e.prevFocusElement)},pt=class extends x{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:dt(e.toasts)},{},J)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t={}){let n=J.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t.skipOnRemove||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||lt(`toast`);if(e.id){let t=J.toast(this.state,e.id);if(t)if(t.transitionStatus===`ending`)this.removeToast(e.id,{skipOnRemove:!0});else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,{resetTimer:!0,markUpdated:!0}),e.id}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts],o=a.filter(e=>e.transitionStatus!==`ending`);if(o.length>n){let e=o.length-n,t=o.slice(-e),r=new Set(t.map(e=>e.id));this.setToasts(a.map(e=>{let t=r.has(e.id);return e.limited===t?e:{...e,limited:t}}))}else this.setToasts(a.map(e=>e.limited?{...e,limited:!1}:e));let s=i.timeout??t;return i.type!==`loading`&&s>0&&this.scheduleTimer(r,s,()=>this.closeToast(r)),J.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,{markUpdated:!0})};updateToastInternal=(e,t,n={})=>{let{timeout:r,toasts:i}=this.state,a=J.toast(this.state,e)??null;if(!a||a.transitionStatus===`ending`)return;let o={...a,...t,...n.markUpdated&&{updateKey:(a.updateKey??0)+1}};this.setToasts(i.map(t=>t.id===e?o:t));let s=o.timeout??r,c=a?.timeout??r,l=Object.hasOwn(t,`timeout`),u=o.transitionStatus!==`ending`&&o.type!==`loading`&&s>0,d=this.timers.has(e),f=c!==s,p=a?.type===`loading`;if(!u&&d){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e);return}if(u&&(!d||f||l||p||n.resetTimer)){let t=this.timers.get(e);t&&(t.timeout?.clear(),this.timers.delete(e)),this.scheduleTimer(e,s,()=>this.closeToast(e)),J.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear();else{let t=J.toast(this.state,e);if(!t)return;i=[t];let n=this.timers.get(e);n?.timeout&&(n.timeout.clear(),this.timers.delete(e))}let a=0,o=r.map(r=>{if(t||r.id===e)return{...r,transitionStatus:`ending`,height:0};if(r.transitionStatus===`ending`)return r;let i=a>=n;return a+=1,r.limited===i?r:{...r,limited:i}}),s={toasts:o,toastMetadata:dt(o)};(t||r.length===1)&&(s.hovering=!1,s.focused=!1),this.update(s),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=ut(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=ut(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=ut(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=he.create(),e.timeout.start(e.remaining,()=>{this.timers.delete(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=H(e);pe(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!J.expandedOrOutOfFocus(this.state),a=i?he.create():void 0;a?.start(t,()=>{this.timers.delete(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}setToasts(e){let t={toasts:e,toastMetadata:dt(e)};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=Se(B(this.state.viewport));if(!this.state.viewport||!pe(this.state.viewport,t)||!we(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=J.toasts(this.state),r=J.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},mt=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=m(()=>new pt({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return p(a.disposeEffect),G.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),a.useSyncedValues({timeout:n,limit:r}),(0,K.jsx)(ot.Provider,{value:a,children:t})},ht=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),gt=G.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=st(),c=Ue(),l=G.useRef(!1),u=G.useRef(!1),d=G.useRef(!1),f=s.useState(`isEmpty`),p=s.useState(`toasts`),m=s.useState(`focused`),h=s.useState(`expanded`),g=s.useState(`prevFocusElement`),_=p[0]?.height??0,v=G.useMemo(()=>p.some(e=>e.transitionStatus===`ending`),[p]),y=G.useMemo(()=>p.filter(e=>e.priority===`high`),[p]);G.useEffect(()=>{let e=s.state.viewport;if(!e)return;function t(t){f||t.key===`F6`&&H(t)!==e&&(t.preventDefault(),s.setPrevFocusElement(Se(B(e))),e?.focus({preventScroll:!0}),s.pauseTimers(),s.setFocused(!0))}return je(ie(e),`keydown`,t)},[s,f]),G.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=ie(e);function n(e){H(e)===t&&(s.setIsWindowFocused(!1),s.pauseTimers())}function r(n){if(n.relatedTarget)return;let r=H(n),i=Se(B(e));(r===t||!pe(e,r)||!we(i))&&s.resumeTimers(),c.start(0,()=>s.setIsWindowFocused(!0))}return Fe(je(t,`blur`,n,!0),je(t,`focus`,r,!0))},[s,c,f]),G.useEffect(()=>{let e=s.state.viewport;if(!(!e||f))return je(B(e),`pointerdown`,s.handleDocumentPointerDown,!0)},[f,s]);function b(e){let t=s.state.viewport;t&&(l.current=!0,e.relatedTarget===t?p[0]?.ref?.current?.focus():s.restoreFocusToPrevElement())}function x(e){e.key===`Tab`&&e.shiftKey&&H(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement(),s.resumeTimers())}function S(){let e=s.state.toasts.some(e=>e.transitionStatus===`ending`);!s.state.isWindowFocused||e||d.current||!u.current||(s.resumeTimers(),s.setHovering(!1),u.current=!1)}G.useEffect(S,[v,s]);function C(){s.pauseTimers(),s.setHovering(!0),u.current=!1}function w(){v||d.current?u.current=!0:(s.resumeTimers(),s.setHovering(!1))}function T(e){e.pointerType===`touch`&&(d.current=!0)}function E(e){e.pointerType===`touch`&&(d.current=!1,S())}function D(){if(l.current){l.current=!1;return}m||we(Se(B(s.state.viewport)))&&(s.setFocused(!0),s.pauseTimers())}function O(e){!m||pe(s.state.viewport,e.relatedTarget)||(s.setFocused(!1),s.resumeTimers())}let k={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:C,onMouseMove:C,onMouseLeave:w,onFocus:D,onBlur:O,onKeyDown:x,onClick:D,onPointerDown:T,onPointerUp:E,onPointerCancel:E},A={expanded:h},j=U(`div`,e,{ref:[t,s.setViewport],state:A,props:[k,{style:{[ht.frontmostHeight]:_?`${_}px`:void 0}},o,{children:(0,K.jsxs)(G.Fragment,{children:[!f&&g&&(0,K.jsx)(ge,{onFocus:b}),a,!f&&g&&(0,K.jsx)(ge,{onFocus:b})]})}]});return(0,K.jsxs)(G.Fragment,{children:[!f&&g&&(0,K.jsx)(ge,{onFocus:b}),j,!m&&y.length>0&&(0,K.jsx)(`div`,{style:ke,children:y.map(e=>(0,K.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,K.jsx)(`div`,{children:e.title}),(0,K.jsx)(`div`,{children:e.description})]},e.id))})]})}),_t=G.createContext(void 0);function vt(){let e=G.useContext(_t);if(!e)throw Error(De(66));return e}var Y=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({});function yt(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function bt(e){let t=ie(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var xt={...Be,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},St=40,Ct=10,X=.5,wt=1,Tt=`${C},${le}`,Et=G.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,u=[];c||(u=Array.isArray(a)?a:[a]);let f=u.length>0,p=st(),[m,h]=G.useState(void 0),[g,_]=G.useState(!1),[v,y]=G.useState(!1),[b,x]=G.useState(!1),[S,C]=G.useState({x:0,y:0}),[w,T]=G.useState({x:0,y:0,scale:1}),[E,D]=G.useState(),[O,k]=G.useState(),[A,j]=G.useState(null),M=G.useRef(null),N=G.useRef({x:0,y:0}),ee=G.useRef({x:0,y:0,scale:1}),P=G.useRef(void 0),F=G.useRef(0),ne=G.useRef(!1),I=G.useRef({x:0,y:0}),L=G.useRef(!1),re=G.useRef({x:0,y:0}),R=G.useRef(null),z=G.useRef(null),ie=p.useState(`toastIndex`,n.id),ae=p.useState(`toastVisibleIndex`,n.id),oe=p.useState(`toastOffsetY`,n.id),se=p.useState(`focused`),ce=p.useState(`expanded`);d({open:n.transitionStatus!==`ending`,ref:M,onComplete(){n.transitionStatus===`ending`&&p.removeToast(n.id)}});let le=l((e=!1)=>{let t=M.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){p.updateToastInternal(n.id,{ref:M,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?Je.flushSync(a):a()});Ke(le,[le]);function ue(e){re.current=e,C(e)}Ke(()=>()=>{z.current?.abort()},[]);function de(e,t){let n=e,r=t;return!u.includes(`left`)&&!u.includes(`right`)?n=e>0?e**X:-(Math.abs(e)**X):(!u.includes(`right`)&&e>0&&(n=e**X),!u.includes(`left`)&&e<0&&(n=-(Math.abs(e)**X))),!u.includes(`up`)&&!u.includes(`down`)?r=t>0?t**X:-(Math.abs(t)**X):(!u.includes(`down`)&&t>0&&(r=t**X),!u.includes(`up`)&&t<0&&(r=-(Math.abs(t)**X))),{x:n,y:r}}let fe=l(e=>{if(e.pointerId!==R.current)return;R.current=null,z.current?.abort(),z.current=null,_(!1),y(!1),j(null);let t=ee.current;if(e.type===`pointercancel`||ne.current){ue({x:t.x,y:t.y}),h(void 0);return}let r=!1,i=re.current,a=i.x-t.x,o=i.y-t.y,s;for(let e of u){switch(e){case`right`:a>St&&(r=!0,s=`right`);break;case`left`:a<-40&&(r=!0,s=`left`);break;case`down`:o>St&&(r=!0,s=`down`);break;case`up`:o<-40&&(r=!0,s=`up`);break;default:break}if(r)break}r?(h(s),x(!0),p.closeToast(n.id)):(ue({x:t.x,y:t.y}),h(void 0))});function me(e){if(e.button!==0)return;e.pointerType===`touch`&&p.pauseTimers();let t=H(e.nativeEvent);if(t&&t.closest(`button,a,input,textarea,[role="button"],${Tt}`))return;if(ne.current=!1,P.current=void 0,F.current=0,R.current=e.pointerId,N.current={x:e.clientX,y:e.clientY},I.current=N.current,M.current){let e=bt(M.current);ee.current=e,T(e),ue({x:e.x,y:e.y})}p.setHovering(!0),_(!0),y(!1),j(null),L.current=!0;let n=M.current;if(n){z.current?.abort();let t=new AbortController;z.current=t;let r=B(n);r.addEventListener(`pointerup`,fe,{signal:t.signal}),r.addEventListener(`pointercancel`,fe,{signal:t.signal}),n.setPointerCapture?.(e.pointerId)}}function he(e){if(e.pointerId!==R.current)return;e.preventDefault(),L.current&&=(N.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>I.current.y||i>0&&t<I.current.y)&&(I.current={x:I.current.x,y:t}),(r<0&&n>I.current.x||r>0&&n<I.current.x)&&(I.current={x:n,y:I.current.y});let a=n-N.current.x,o=t-N.current.y,s=t-I.current.y,c=n-I.current.x;if(!v&&Math.sqrt(a*a+o*o)>=wt&&(y(!0),A===null)){let e=u.includes(`left`)||u.includes(`right`),t=u.includes(`up`)||u.includes(`down`);e&&t&&j(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let l;if(!P.current)A===`vertical`?o>0?l=`down`:o<0&&(l=`up`):A===`horizontal`?a>0?l=`right`:a<0&&(l=`left`):l=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,l&&u.includes(l)&&(P.current=l,F.current=yt(l,a,o),h(l));else{let e=P.current,t=yt(e,c,s);t>St?(ne.current=!1,h(e)):!(u.includes(`left`)&&u.includes(`right`))&&!(u.includes(`up`)&&u.includes(`down`))&&F.current-t>=Ct&&(ne.current=!0)}let d=de(a,o),f=ee.current.x,p=ee.current.y;A===`horizontal`?(u.includes(`left`)||u.includes(`right`))&&(f+=d.x):(A===`vertical`||(u.includes(`left`)||u.includes(`right`))&&(f+=d.x),(u.includes(`up`)||u.includes(`down`))&&(p+=d.y)),ue({x:f,y:p})}function ge(e){if(e.key===`Escape`){if(!M.current||!pe(M.current,Se(B(M.current))))return;p.closeToast(n.id)}}G.useEffect(()=>{if(!f)return;let e=M.current;if(!e)return;function t(t){pe(e,H(t))&&t.preventDefault()}return je(e,`touchmove`,t,{passive:!1})},[f]);function _e(){if(!g&&S.x===w.x&&S.y===w.y&&!b)return{[Y.swipeMovementX]:`0px`,[Y.swipeMovementY]:`0px`};let e=S.x-w.x,t=S.y-w.y;return{transition:g?`none`:void 0,transform:g?`translateX(${S.x}px) translateY(${S.y}px) scale(${w.scale})`:void 0,[Y.swipeMovementX]:`${e}px`,[Y.swipeMovementY]:`${t}px`}}let ve=n.priority===`high`,ye={role:ve?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":E,"aria-describedby":O,"aria-hidden":ve&&!se?!0:void 0,onPointerDown:f?me:void 0,onPointerMove:f?he:void 0,onPointerUp:f?fe:void 0,onPointerCancel:f?fe:void 0,onKeyDown:ge,inert:te(n.limited),style:{..._e(),[Y.index]:n.transitionStatus===`ending`?ie:ae,[Y.offsetY]:`${oe}px`,[Y.height]:n.height?`${n.height}px`:void 0}},V=G.useMemo(()=>({rootRef:M,toast:n,titleId:E,setTitleId:D,descriptionId:O,setDescriptionId:k,swiping:g,swipeDirection:m,recalculateHeight:le,index:ie,visibleIndex:ae,expanded:ce}),[n,E,O,g,m,le,ie,ae,ce]),be={transitionStatus:n.transitionStatus,expanded:ce,limited:n.limited||!1,type:n.type,swiping:V.swiping,swipeDirection:V.swipeDirection},xe=U(`div`,e,{ref:[t,V.rootRef],state:be,stateAttributesMapping:xt,props:[ye,s]});return(0,K.jsx)(_t.Provider,{value:V,children:xe})}),Dt=G.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=vt(),l=G.useRef(null);return Ke(()=>{let e=l.current;if(!e||(c(),typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`))return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),U(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})}),Ot=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setDescriptionId:l}=vt(),u=o??c.description,d=!!u,f=Te(a);Ke(()=>{if(d)return l(f),()=>{l(void 0)}},[d,f,l]);let p=U(`p`,e,{ref:t,state:{type:c.type},props:{...s,id:f,children:u}});return d?p:null}),kt=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setTitleId:l}=vt(),u=o??c.title,d=!!u,f=Te(a);Ke(()=>{if(d)return l(f),()=>{l(void 0)}},[d,f,l]);let p=U(`h2`,e,{ref:t,state:{type:c.type},props:{...s,id:f,children:u}});return d?p:null}),At=G.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=st(),{toast:l}=vt(),u=c.useState(`expanded`),[d,f]=G.useState(!1),{getButtonProps:p,buttonRef:m}=O({disabled:a,native:o}),h={type:l.type};return U(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),jt=G.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=vt(),l=c.actionProps?.children??s.children,u=!!l,{getButtonProps:d,buttonRef:f}=O({disabled:a,native:o}),p={type:c.type},m=U(`button`,e,{ref:[t,f],state:p,props:[s,c.actionProps,d,{children:l}]});return u?m:null}),Mt=ne,Nt=G.createContext(void 0);function Pt(){let e=G.useContext(Nt);if(e===void 0)throw Error(De(84));return e}var Ft=G.forwardRef(function(e,t){let{toast:n,...r}=e,i=st(),a=n.positionerProps??f,{render:o,className:s,anchor:c=a.anchor,positionMethod:l=a.positionMethod??`absolute`,side:d=a.side??`top`,align:p=a.align??`center`,sideOffset:m=a.sideOffset??0,alignOffset:h=a.alignOffset??0,collisionBoundary:g=a.collisionBoundary??`clipping-ancestors`,collisionPadding:_=a.collisionPadding??5,arrowPadding:v=a.arrowPadding??5,sticky:y=a.sticky??!1,disableAnchorTracking:x=a.disableAnchorTracking??!1,collisionAvoidance:S=a.collisionAvoidance??P,style:C,...w}=r,[E,D]=G.useState(null),O=i.useState(`toastIndex`,n.id),k=i.useState(`toastVisibleIndex`,n.id),A=b(c)?c:null,j=ce({anchor:A,positionMethod:l,floatingRootContext:u({open:!0,onOpenChange:Ve,elements:{floating:E,reference:A}}),mounted:!0,side:d,sideOffset:m,align:p,alignOffset:h,collisionBoundary:g,collisionPadding:_,sticky:y,arrowPadding:v,disableAnchorTracking:x,keepMounted:!0,collisionAvoidance:S}),M=T(e,G.useMemo(()=>({side:j.side,align:j.align,anchorHidden:j.anchorHidden}),[j.side,j.align,j.anchorHidden]),{styles:{...j.positionerStyles,[Y.index]:n.transitionStatus===`ending`?O:k},transitionStatus:n.transitionStatus,props:w,refs:[t,D]});return(0,K.jsx)(Nt.Provider,{value:j,children:M})}),It=G.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{arrowRef:o,side:s,align:c,arrowUncentered:l,arrowStyles:u}=Pt();return U(`div`,e,{state:{side:s,align:c,uncentered:l},ref:[t,o],props:[{style:u,"aria-hidden":!0},a]})});function Lt(){let e=G.useContext(ot);if(!e)throw Error(De(73));let t=e.useState(`toasts`);return G.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Rt(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||lt(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var zt=e({Action:()=>jt,Arrow:()=>It,Close:()=>At,Content:()=>Dt,Description:()=>Ot,Portal:()=>Mt,Positioner:()=>Ft,Provider:()=>mt,Root:()=>Et,Title:()=>kt,Viewport:()=>gt,createToastManager:()=>Rt,useToastManager:()=>Lt}),Bt=class extends V()(`ClipboardApiUnavailableError`,{target:F}){get message(){return`Clipboard API is unavailable while copying ${this.target}.`}},Vt=class extends V()(`ClipboardWriteError`,{target:F,cause:oe()}){get message(){return`Failed to copy ${this.target} to the clipboard.`}};async function Ht(e,t=`text`){if(typeof window>`u`||typeof navigator>`u`||!navigator.clipboard?.writeText)throw new Bt({target:t});if(!e)return!1;try{return await navigator.clipboard.writeText(e),!0}catch(e){throw new Vt({target:t,cause:e})}}function Ut({timeout:e=2e3,target:t=`text`,onCopy:n,onError:r}={}){let[i,a]=G.useState(!1),o=G.useRef(null),s=G.useRef(n),c=G.useRef(r),l=G.useRef(t),u=G.useRef(e);s.current=n,c.current=r,l.current=t,u.current=e;let d=G.useCallback((e,t)=>{Ht(e,l.current).then(e=>{e&&(o.current&&clearTimeout(o.current),a(!0),s.current?.(t),u.current!==0&&(o.current=setTimeout(()=>{a(!1),o.current=null},u.current)))},e=>{console.error(e),c.current?.(e,t)})},[]);return G.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{copyToClipboard:d,isCopied:i}}function Wt(e,t){return t<=1?!1:e>0}function Gt(e){let t=0,n=0,r=0,i=0,a=e.map(e=>{let a=Kt(e.height);if(e.transitionStatus===`ending`){let r={toast:e,visibleIndex:t,offsetY:n};return n+=a,t+=1,r}let o={toast:e,visibleIndex:r,offsetY:i};return n+=a,t+=1,i+=a,r+=1,o});return{frontmostHeight:Kt(e.find(e=>e.transitionStatus!==`ending`)?.height),items:a}}function Kt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function qt(e,t){if(e?.threadRef)return t!==null&&e.threadRef.environmentId===t.environmentId&&e.threadRef.threadId===t.threadId;let n=e?.threadId;return n?t?.threadId===n:!0}function Jt(e){let{type:t,title:n,description:r,timeout:i,priority:a,actionProps:o,actionVariant:s,data:c}=e,l={...c===void 0?{}:c,actionLayout:`stacked-end`};s!==void 0&&(l.actionVariant=s);let u={type:t,title:n,data:l};return r!==void 0&&(u.description=r),i!==void 0&&(u.timeout=i),a!==void 0&&(u.priority=a),o!==void 0&&(u.actionProps=o),u}var Yt=Rt(),Xt=Rt(),Zt=new Map,Qt={error:j,info:rt,loading:it,success:nt,warning:at},$t=180;function en(e,t){if(!(e!==`error`||typeof t!=`string`)&&!(t.length<$t))return`line-clamp-4`}var tn=`absolute z-20 -top-1.5 -right-1.5`,nn=M(`inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-popover/92 text-muted-foreground shadow-sm outline-none backdrop-blur-sm`,`transition-[color,background-color,box-shadow] hover:bg-popover hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`);function rn(e,t,n){n?.(),e.close(t)}function an(e){let t=(0,q.c)(17),{text:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`error-message`},t[0]=r):r=t[0];let{copyToClipboard:i,isCopied:a}=Ut(r),o=a?`Copied error`:`Copy error`,s;t[1]!==i||t[2]!==n?(s=()=>i(n),t[1]=i,t[2]=n,t[3]=s):s=t[3];let c;t[4]!==o||t[5]!==s?(c=(0,K.jsx)(`button`,{"aria-label":o,className:`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-md p-0 text-muted-foreground/80 transition-colors hover:text-muted-foreground`,onClick:s,type:`button`}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;t[7]===a?l=t[8]:(l=a?(0,K.jsx)(k,{className:`size-3 text-success`}):(0,K.jsx)(A,{className:`size-3`}),t[7]=a,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,K.jsx)(E,{render:c,children:l}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]===o?d=t[13]:(d=(0,K.jsx)(h,{side:`top`,children:o}),t[12]=o,t[13]=d);let f;return t[14]!==u||t[15]!==d?(f=(0,K.jsxs)(N,{children:[u,d]}),t[14]=u,t[15]=d,t[16]=f):f=t[16],f}var on=`mt-2 max-h-40 min-h-0 overflow-y-auto overscroll-contain pr-0.5 select-text`;function sn(e){let t=(0,q.c)(13),{children:n,labels:r}=e,[i,a]=(0,G.useState)(!1),o=r.expand??`Show details`,s=r.collapse??`Hide details`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(cn),t[0]=c):c=t[0];let l;t[1]===i?l=t[2]:(l=i?(0,K.jsx)(ee,{className:`size-3.5 shrink-0 opacity-80`,strokeWidth:2.25}):(0,K.jsx)(S,{className:`size-3.5 shrink-0 opacity-80`,strokeWidth:2.25}),t[1]=i,t[2]=l);let u=i?s:o,d;t[3]!==i||t[4]!==l||t[5]!==u?(d=(0,K.jsxs)(`button`,{"aria-expanded":i,className:`inline-flex cursor-pointer items-center gap-1 rounded-md py-0.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,onClick:c,type:`button`,children:[l,u]}),t[3]=i,t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==i?(f=i?(0,K.jsx)(`div`,{className:on,children:n}):null,t[7]=n,t[8]=i,t[9]=f):f=t[9];let p;return t[10]!==d||t[11]!==f?(p=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function cn(e){return!e}function ln(e){let t=(0,q.c)(43),{toastData:n,toastDescription:r,toastType:i}=e,a=n?.expandableContent,o;t[0]===n?.expandableLabels?o=t[1]:(o=n?.expandableLabels??{},t[0]=n?.expandableLabels,t[1]=o);let s=o,c=n?.expandableDescriptionTrigger??!1,l;t[2]!==r||t[3]!==i?(l=M(`min-w-0 select-text wrap-break-word text-muted-foreground`,en(i,r)),t[2]=r,t[3]=i,t[4]=l):l=t[4];let u=l,[d,f]=(0,G.useState)(!1);if(!a){let e;return t[5]===u?e=t[6]:(e=(0,K.jsx)(Ot,{className:u,"data-slot":`toast-description`}),t[5]=u,t[6]=e),e}if(!c){let e;t[7]===u?e=t[8]:(e=(0,K.jsx)(Ot,{className:u,"data-slot":`toast-description`}),t[7]=u,t[8]=e);let n;t[9]!==a||t[10]!==s?(n=(0,K.jsx)(sn,{labels:s,children:a}),t[9]=a,t[10]=s,t[11]=n):n=t[11];let r;return t[12]!==e||t[13]!==n?(r=(0,K.jsxs)(K.Fragment,{children:[e,n]}),t[12]=e,t[13]=n,t[14]=r):r=t[14],r}let p=s.expand??`Show details`,m=s.collapse??`Hide details`,g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>f(un),t[15]=g):g=t[15];let _=g,v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_())},t[16]=v):v=t[16];let y=v,b=d?m:p,x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=M(`group flex min-w-0 w-full cursor-pointer select-none items-start gap-1.5 rounded-sm text-left outline-none ring-offset-background`,`transition-colors hover:bg-muted/40`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`),t[17]=x):x=t[17];let C;t[18]!==d||t[19]!==b?(C=(0,K.jsx)(`div`,{"aria-label":b,"aria-expanded":d,className:x,onClick:_,onKeyDown:y,role:`button`,tabIndex:0}),t[18]=d,t[19]=b,t[20]=C):C=t[20];let w;t[21]!==r||t[22]!==i?(w=M(`min-w-0 select-none wrap-break-word text-muted-foreground`,en(i,r),`underline-offset-2 decoration-muted-foreground/60 group-hover:underline`),t[21]=r,t[22]=i,t[23]=w):w=t[23];let T;t[24]===w?T=t[25]:(T=(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(Ot,{className:w,"data-slot":`toast-description`})}),t[24]=w,t[25]=T);let D;t[26]===d?D=t[27]:(D=d?(0,K.jsx)(ee,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,strokeWidth:2.25}):(0,K.jsx)(S,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,strokeWidth:2.25}),t[26]=d,t[27]=D);let O;t[28]!==D||t[29]!==C||t[30]!==T?(O=(0,K.jsxs)(E,{render:C,children:[T,D]}),t[28]=D,t[29]=C,t[30]=T,t[31]=O):O=t[31];let k=d?m:p,A;t[32]===k?A=t[33]:(A=(0,K.jsx)(h,{side:`top`,children:k}),t[32]=k,t[33]=A);let j;t[34]!==O||t[35]!==A?(j=(0,K.jsxs)(N,{children:[O,A]}),t[34]=O,t[35]=A,t[36]=j):j=t[36];let P;t[37]!==a||t[38]!==d?(P=d?(0,K.jsx)(`div`,{className:on,children:a}):null,t[37]=a,t[38]=d,t[39]=P):P=t[39];let F;return t[40]!==j||t[41]!==P?(F=(0,K.jsxs)(K.Fragment,{children:[j,P]}),t[40]=j,t[41]=P,t[42]=F):F=t[42],F}function un(e){return!e}function dn(e){let t=e.type?Qt[e.type]:null,n=e.actionProps!==void 0&&e.data?.actionLayout===`stacked-end`,r=e.data?.actionVariant??`default`,i=e.data?.secondaryActionVariant??`outline`,a=e.type===`error`&&typeof e.description==`string`&&!e.data?.hideCopyButton?e.description:null,o=(e.data?.additionalActions?.length??0)>0,s=e.data?.secondaryActionProps!==void 0,c=a!==null||e.actionProps!==void 0||o||s;return{Icon:t,stackedActionLayout:n,actionVariant:r,secondaryActionVariant:i,copyErrorText:a,hasTrailingControls:c,inlineContentEndPad:c?`pr-6`:`pr-10`}}function fn(e){let t=(0,q.c)(40),{stackedActionLayout:n,Icon:r,copyErrorText:i,actionProps:a,actionVariant:o,secondaryActionVariant:s,hasTrailingControls:c,toastData:l,toastDescription:u,toastType:d}=e,f;t[0]===l?.additionalActions?f=t[1]:(f=l?.additionalActions??[],t[0]=l?.additionalActions,t[1]=f);let p=f,m=l?.secondaryActionProps,h=l?.leadingIcon,g;t[2]===m?g=t[3]:(g=m??{},t[2]=m,t[3]=g);let _,v;t[4]===g?(_=t[5],v=t[6]):({className:_,...v}=g,t[4]=g,t[5]=_,t[6]=v);let y=!n&&`flex-1`,b;t[7]===y?b=t[8]:(b=M(`flex min-w-0 gap-2`,y),t[7]=y,t[8]=b);let x;t[9]!==r||t[10]!==h?(x=h?(0,K.jsx)(`div`,{className:`flex h-lh w-4 shrink-0 items-center justify-center`,"data-slot":`toast-icon`,children:h}):r?(0,K.jsx)(`div`,{className:`[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,"data-slot":`toast-icon`,children:(0,K.jsx)(r,{className:`in-data-[type=loading]:animate-spin in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80`})}):null,t[9]=r,t[10]=h,t[11]=x):x=t[11];let S=n&&`pr-5`,C;t[12]===S?C=t[13]:(C=M(`flex min-h-0 min-w-0 flex-1 flex-col gap-0.5`,S),t[12]=S,t[13]=C);let w;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsx)(kt,{className:`min-w-0 wrap-break-word font-medium`,"data-slot":`toast-title`}),t[14]=w):w=t[14];let T;t[15]!==l||t[16]!==u||t[17]!==d?(T=(0,K.jsx)(ln,{toastData:l,toastDescription:u,toastType:d}),t[15]=l,t[16]=u,t[17]=d,t[18]=T):T=t[18];let E;t[19]!==C||t[20]!==T?(E=(0,K.jsxs)(`div`,{className:C,children:[w,T]}),t[19]=C,t[20]=T,t[21]=E):E=t[21];let D;t[22]!==E||t[23]!==b||t[24]!==x?(D=(0,K.jsxs)(`div`,{className:b,children:[x,E]}),t[22]=E,t[23]=b,t[24]=x,t[25]=D):D=t[25];let O;t[26]!==a||t[27]!==o||t[28]!==p||t[29]!==i||t[30]!==c||t[31]!==_||t[32]!==m||t[33]!==v||t[34]!==s||t[35]!==n?(O=c?(0,K.jsxs)(`div`,{className:M(`flex items-center gap-1.5`,n?`w-full justify-end`:`shrink-0`),children:[i===null?null:(0,K.jsx)(an,{text:i}),p.map(e=>{let{id:t,props:n}=e,{className:r,...i}=n;return(0,G.createElement)(`button`,{...i,className:M(ve({size:`xs`,variant:s}),r),key:t,type:`button`})}),m?(0,K.jsx)(`button`,{...v,className:M(ve({size:`xs`,variant:s}),_),type:`button`}):null,a?(0,K.jsx)(jt,{className:M(ve({size:`xs`,variant:o}),`shrink-0`),"data-slot":`toast-action`,children:a.children}):null]}):null,t[26]=a,t[27]=o,t[28]=p,t[29]=i,t[30]=c,t[31]=_,t[32]=m,t[33]=v,t[34]=s,t[35]=n,t[36]=O):O=t[36];let k;return t[37]!==D||t[38]!==O?(k=(0,K.jsxs)(K.Fragment,{children:[D,O]}),t[37]=D,t[38]=O,t[39]=k):k=t[39],k}function pn(){let e=(0,q.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1,select:mn},e[0]=t):t=e[0];let n=qe(t),r;e[1]===n?r=e[2]:(r=e=>n?.kind===`draft`?e.getDraftSession(n.draftId):null,e[1]=n,e[2]=r);let i=He(r),a;bb0:{if(n?.kind===`server`){a=n.threadRef;break bb0}if(n?.kind===`draft`&&i){let t;e[3]!==i.environmentId||e[4]!==i.threadId?(t={environmentId:i.environmentId,threadId:i.threadId},e[3]=i.environmentId,e[4]=i.threadId,e[5]=t):t=e[5],a=t;break bb0}a=null}return a}function mn(e){return et(e)}function hn(e){let t=(0,q.c)(4),{toastId:n,dismissAfterVisibleMs:r}=e,i,a;return t[0]!==r||t[1]!==n?(i=()=>{if(!r||r<=0||typeof window>`u`||typeof document>`u`)return;let e=Zt.get(n)??r,t=null,i=null,a=!1,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{a||(a=!0,Zt.delete(n),Yt.close(n))},c=()=>{t!==null&&(e=Math.max(0,e-(Date.now()-t)),t=null,o(),Zt.set(n,e))},l=()=>{if(!(a||t!==null)){if(e<=0){s();return}t=Date.now(),o(),i=window.setTimeout(()=>{e=0,t=null,s()},e)}},u=()=>{if(document.visibilityState===`visible`&&document.hasFocus()){l();return}c()};return u(),document.addEventListener(`visibilitychange`,u),window.addEventListener(`focus`,u),window.addEventListener(`blur`,u),()=>{document.removeEventListener(`visibilitychange`,u),window.removeEventListener(`focus`,u),window.removeEventListener(`blur`,u),c(),o()}},a=[r,n],t[0]=r,t[1]=n,t[2]=i,t[3]=a):(i=t[2],a=t[3]),(0,G.useEffect)(i,a),null}function gn(e){let t=(0,q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,position:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`top-right`:i,o;t[4]===a?o=t[5]:(o=(0,K.jsx)(_n,{position:a}),t[4]=a,t[5]=o);let s;return t[6]!==n||t[7]!==r||t[8]!==o?(s=(0,K.jsxs)(mt,{toastManager:Yt,...r,children:[n,o]}),t[6]=n,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function _n(e){let t=(0,q.c)(19),{position:n}=e,{toasts:r}=Lt(),i=pn(),a;t[0]===n?a=t[1]:(a=n.startsWith(`top`),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=e=>qt(e.data,i),t[2]=i,t[3]=s);let c=Gt(r.filter(s)),l,u;t[4]===r?(l=t[5],u=t[6]):(l=()=>{let e=new Set(r.map(vn));for(let t of Zt.keys())e.has(t)||Zt.delete(t)},u=[r],t[4]=r,t[5]=l,t[6]=u),(0,G.useEffect)(l,u);let d=zt,f=zt,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=M(`fixed z-100 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] max-w-90 [--toast-header-offset:52px] [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]`,`data-[position*=top]:top-[calc(var(--toast-inset)+var(--toast-header-offset))]`,`data-[position*=bottom]:bottom-(--toast-inset)`,`data-[position*=left]:left-(--toast-inset)`,`data-[position*=right]:right-(--toast-inset)`,`data-[position*=center]:-translate-x-1/2 data-[position*=center]:left-1/2`),t[7]=p):p=t[7];let m=`${c.frontmostHeight}px`,h;t[8]===m?h=t[9]:(h={"--toast-frontmost-height":m},t[8]=m,t[9]=h);let g=h,_=c.items.map(e=>{let{toast:t,visibleIndex:r,offsetY:i}=e,a=Wt(r,c.items.length),s=dn(t),{stackedActionLayout:l,inlineContentEndPad:u}=s;return(0,K.jsxs)(Et,{className:M(`dropdown-glass absolute z-[calc(9999-var(--toast-index))] w-full overflow-visible select-none rounded-lg text-popover-foreground shadow-xl shadow-black/25 [transition:transform_240ms_cubic-bezier(.22,1,.36,1),opacity_240ms_cubic-bezier(.22,1,.36,1),height_.15s]`,`data-[position*=right]:right-0 data-[position*=right]:left-auto`,`data-[position*=left]:right-auto data-[position*=left]:left-0`,`data-[position*=center]:right-0 data-[position*=center]:left-0`,`data-[position*=top]:top-0 data-[position*=top]:bottom-auto data-[position*=top]:origin-top`,`data-[position*=bottom]:top-auto data-[position*=bottom]:bottom-0 data-[position*=bottom]:origin-bottom`,`after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full`,`data-[position*=top]:after:top-full`,`data-[position*=bottom]:after:bottom-full`,r>0?`not-data-expanded:[--toast-calc-height:var(--toast-frontmost-height)] data-expanded:[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`:`[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`,`[--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]`,r>0?`not-data-expanded:h-(--toast-calc-height) data-expanded:h-auto`:`h-auto`,`data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]`,`data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]`,`data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-limited:opacity-0`,`data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]`,`data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]`,`data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]`,`data-[position*=top]:data-[position*=right]:data-starting-style:transform-[translateX(calc(100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:opacity-0`,`data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(100%+var(--toast-inset)))]`,`data-[position*=top]:data-[position*=right]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateX(calc(100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`),"data-position":n,"data-slot":`toast-popup`,style:{"--toast-index":r,"--toast-offset-y":`${i}px`},swipeDirection:n.includes(`center`)?[o?`up`:`down`]:n.includes(`left`)?[`left`,o?`up`:`down`]:[`right`,o?`up`:`down`],toast:t,children:[(0,K.jsx)(hn,{dismissAfterVisibleMs:t.data?.dismissAfterVisibleMs,toastId:t.id}),(0,K.jsx)(`div`,{className:tn,children:(0,K.jsx)(`button`,{"aria-label":`Dismiss notification`,className:nn,"data-slot":`toast-close`,onClick:()=>rn(Yt,t.id,t.data?.onClose),type:`button`,children:(0,K.jsx)(Ee,{className:`size-3`,strokeWidth:2.25})})}),(0,K.jsx)(Dt,{className:M(`pointer-events-auto min-h-0 overflow-y-visible pl-3.5 text-sm transition-opacity duration-250 [overflow-x:clip] data-expanded:opacity-100`,l?`flex flex-col gap-2 py-2.5 pr-3.5`:M(`py-3`,`flex items-center justify-between gap-1.5`,u),a&&`not-data-expanded:pointer-events-none not-data-expanded:opacity-0`),children:(0,K.jsx)(fn,{...s,actionProps:t.actionProps,toastData:t.data,toastDescription:t.description,toastType:t.type})})]},t.id)}),v;t[10]!==n||t[11]!==g||t[12]!==_||t[13]!==f.Viewport||t[14]!==p?(v=(0,K.jsx)(f.Viewport,{className:p,"data-position":n,"data-slot":`toast-viewport`,style:g,children:_}),t[10]=n,t[11]=g,t[12]=_,t[13]=f.Viewport,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==d.Portal?(y=(0,K.jsx)(d.Portal,{"data-slot":`toast-portal`,children:v}),t[16]=v,t[17]=d.Portal,t[18]=y):y=t[18],y}function vn(e){return e.id}function yn(e){let t=(0,q.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(bn,{}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,K.jsxs)(mt,{toastManager:Xt,...r,children:[n,i]}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function bn(){let e=(0,q.c)(7),{toasts:t}=Lt(),n=pn(),r;if(e[0]!==n||e[1]!==t){let i;e[3]===n?i=e[4]:(i=e=>qt(e.data,n),e[3]=n,e[4]=i),r=t.filter(i).map(xn),e[0]=n,e[1]=t,e[2]=r}else r=e[2];let i;return e[5]===r?i=e[6]:(i=(0,K.jsx)(Mt,{"data-slot":`toast-portal-anchored`,children:(0,K.jsx)(gt,{className:`outline-none`,"data-slot":`toast-viewport-anchored`,children:r})}),e[5]=r,e[6]=i),i}function xn(e){let t=e.data?.tooltipStyle??!1,n=e.positionerProps,r=dn(e),{stackedActionLayout:i,inlineContentEndPad:a}=r;return n?.anchor?(0,K.jsx)(Ft,{className:`z-100 max-w-[min(--spacing(64),var(--available-width))]`,"data-slot":`toast-positioner`,sideOffset:n.sideOffset??4,toast:e,children:(0,K.jsx)(Et,{className:M(`dropdown-glass relative overflow-visible text-balance text-popover-foreground text-xs shadow-xl shadow-black/25 transition-[scale,opacity] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0`,t?`rounded-md`:`rounded-lg`),"data-slot":`toast-popup`,toast:e,children:t?(0,K.jsx)(Dt,{className:`pointer-events-auto px-2 py-1`,children:(0,K.jsx)(kt,{"data-slot":`toast-title`})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:tn,children:(0,K.jsx)(`button`,{"aria-label":`Dismiss notification`,className:nn,"data-slot":`toast-close`,onClick:()=>rn(Xt,e.id,e.data?.onClose),type:`button`,children:(0,K.jsx)(Ee,{className:`size-3`,strokeWidth:2.25})})}),(0,K.jsx)(Dt,{className:M(`pointer-events-auto min-h-0 overflow-y-visible pl-3.5 text-sm [overflow-x:clip]`,i?`flex flex-col gap-2 py-2.5 pr-3.5`:M(`py-3`,`flex items-center justify-between gap-1.5`,a)),children:(0,K.jsx)(fn,{...r,actionProps:e.actionProps,toastData:e.data,toastDescription:e.description,toastType:e.type})})]})})},e.id):null}var Sn=`http://www.w3.org/2000/svg`,Cn={"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m8 12 3 3 5-6`}}],"rotate-ccw":[{tag:`path`,attrs:{d:`M3 10a9 9 0 1 1 2.6 8.4`}},{tag:`path`,attrs:{d:`M3 4v6h6`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{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.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.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.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],"copy-x":[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}},{tag:`path`,attrs:{d:`m13 13 4 4`}},{tag:`path`,attrs:{d:`m17 13-4 4`}}],"panel-right-close":[{tag:`rect`,attrs:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}},{tag:`path`,attrs:{d:`M15 3v18`}},{tag:`path`,attrs:{d:`m8 9 3 3-3 3`}}],"square-x":[{tag:`rect`,attrs:{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}},{tag:`path`,attrs:{d:`m9 9 6 6`}},{tag:`path`,attrs:{d:`m15 9-6 6`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 18 6-6-6-6`}}],"share-2":[{tag:`circle`,attrs:{cx:`18`,cy:`5`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`12`,r:`3`}},{tag:`circle`,attrs:{cx:`18`,cy:`19`,r:`3`}},{tag:`line`,attrs:{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`}},{tag:`line`,attrs:{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 7v6`}},{tag:`path`,attrs:{d:`M9 10h6`}}],"git-fork":[{tag:`circle`,attrs:{cx:`12`,cy:`18`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`path`,attrs:{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`}},{tag:`path`,attrs:{d:`M12 12v3`}}],clock:[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`polyline`,attrs:{points:`12 6 12 12 16 14`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],unlink:[{tag:`path`,attrs:{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`}},{tag:`path`,attrs:{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`}},{tag:`line`,attrs:{x1:`8`,x2:`8`,y1:`2`,y2:`5`}},{tag:`line`,attrs:{x1:`2`,x2:`5`,y1:`8`,y2:`8`}},{tag:`line`,attrs:{x1:`16`,x2:`16`,y1:`19`,y2:`22`}},{tag:`line`,attrs:{x1:`19`,x2:`22`,y1:`16`,y2:`16`}}]};function wn(e,t){let n=Cn[e];if(!n)return null;let r=document.createElementNS(Sn,`svg`);r.setAttribute(`xmlns`,Sn),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-3.5 shrink-0`:`size-3.5 shrink-0 text-muted-foreground`);for(let e of n){let t=document.createElementNS(Sn,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Tn(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function En(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}function Dn(e,t){return new Promise(n=>{let r=[],i=!1,a=!1,o=e=>{if(!i){i=!0,document.removeEventListener(`keydown`,s),document.removeEventListener(`pointerdown`,c,!0),document.removeEventListener(`contextmenu`,l,!0);for(let e of r)e.remove();n(e)}},s=e=>{if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){let t=Array.from(r.at(-1)?.querySelectorAll(`button`)??[]).filter(e=>!e.disabled);if(t.length===0)return;e.preventDefault();let n=t.findIndex(e=>e===document.activeElement),i=e.key===`Home`?0:e.key===`End`?t.length-1:n<0?e.key===`ArrowDown`?0:t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length;t[i]?.focus(),t[i]?.scrollIntoView({block:`nearest`})}e.key===`Escape`&&(e.preventDefault(),o(null))},c=e=>{!a||En(e.target,r)||o(null)},l=e=>{!a||En(e.target,r)||(e.preventDefault(),o(null))},u=e=>{for(;r.length>e;)r.pop()?.remove()},d=(e,t,n,i)=>{u(i);let s=document.createElement(`div`);s.className=`dropdown-glass fixed z-[10000] min-w-32 max-w-[min(20rem,calc(100vw-1rem))] overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,s.style.cssText=`position:fixed;z-index:10000;width:max-content;min-width:min(8rem,calc(100vw - 1rem));max-width:min(20rem,calc(100vw - 1rem));overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--popover-foreground);outline:none;pointer-events:auto;`,s.style.left=`${t}px`,s.style.top=`${n}px`,s.dataset.level=String(i);let c=document.createElement(`div`);c.className=`context-menu-scroll max-h-[calc(100dvh-1rem)] min-w-0 max-w-full overflow-y-auto overflow-x-hidden p-1`,c.style.cssText=`max-height:calc(100dvh - 1rem);min-width:0;max-width:100%;overflow-x:hidden;overflow-y:auto;scrollbar-width:none;padding:0.25rem;`;for(let t of e){if(t.separator===!0){let e=document.createElement(`div`);e.setAttribute(`role`,`separator`),e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`margin:0.25rem 0.5rem;height:1px;background:var(--border);flex-shrink:0;`,c.appendChild(e);continue}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,c.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),s=document.createElement(`button`);s.type=`button`;let l=t.disabled===!0;s.disabled=l;let f=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(s.className=l?`${f} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${f} text-destructive-foreground hover:bg-primary hover:text-primary-foreground`:`${f} text-foreground hover:bg-primary hover:text-primary-foreground`,s.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(s.style.color=`var(--destructive-foreground)`),l&&(s.style.color=`var(--muted-foreground)`,s.style.opacity=`0.64`,s.style.pointerEvents=`none`),typeof t.icon==`string`){let e=wn(t.icon,n?`destructive`:`neutral`);e&&s.appendChild(e)}let p=document.createElement(`span`);if(p.className=`min-w-0 flex-1 whitespace-normal wrap-anywhere`,p.style.cssText=`min-width:0;flex:1;white-space:normal;overflow-wrap:anywhere;`,p.textContent=t.label,s.appendChild(p),typeof t.shortcut==`string`&&t.shortcut.length>0&&!e){let e=document.createElement(`kbd`);e.className=`ms-auto font-sans text-muted-foreground/72 text-xs tracking-widest`,e.style.cssText=`margin-left:auto;font-family:inherit;font-size:0.75rem;opacity:0.72;`,e.textContent=t.shortcut,s.appendChild(e)}if(e){let e=wn(`chevron-right`,`neutral`);e&&(e.style.marginLeft=`auto`,s.appendChild(e))}if(!l)if(s.addEventListener(`focus`,()=>{s.style.background=`var(--primary)`,s.style.color=`var(--primary-foreground)`}),s.addEventListener(`blur`,()=>{s.style.background=`transparent`,s.style.color=n?`var(--destructive-foreground)`:`var(--foreground)`}),s.addEventListener(`mouseenter`,()=>{s.style.background=`var(--primary)`,s.style.color=`var(--primary-foreground)`;for(let e of s.querySelectorAll(`svg`))e.style.color=`inherit`}),s.addEventListener(`mouseleave`,()=>{s.style.background=`transparent`,s.style.color=n?`var(--destructive-foreground)`:`var(--foreground)`;for(let e of s.querySelectorAll(`svg`))e.style.color=``}),e){let e=()=>{let e=s.getBoundingClientRect(),n=e.right+4,a=e.top;d(t.children,n,a,i+1);let o=r[i+1];if(!o)return;let c=o.getBoundingClientRect();c.right>window.innerWidth&&Tn(o,e.left-c.width-4,e.top)};s.addEventListener(`mouseenter`,e),s.addEventListener(`click`,t=>{t.preventDefault(),e(),r[i+1]?.querySelector(`button:not(:disabled)`)?.focus()})}else s.addEventListener(`mouseenter`,()=>{u(i+1)}),s.addEventListener(`click`,()=>{a&&o(t.id)});c.appendChild(s)}s.appendChild(c),s.addEventListener(`mouseenter`,()=>{u(i+1)}),document.body.appendChild(s),r[i]=s,requestAnimationFrame(()=>{Tn(s,t,n)})};document.addEventListener(`keydown`,s),document.addEventListener(`pointerdown`,c,!0),document.addEventListener(`contextmenu`,l,!0),d(e,t?.x??0,t?.y??0,0),requestAnimationFrame(()=>{a=!0})})}var On=`p4code:client-settings:v1`;function kn(){return typeof window<`u`}function An(){if(!kn())return null;try{return se(On,s)}catch(e){return console.error(`Could not read persisted client settings.`,e),null}}function jn(e){kn()&&v(On,e,s)}function Mn(e){let t=e.split(`
2
- `).map(e=>e.trim()),n=t.findIndex(e=>e.length>0);return n===-1?{title:e.trim(),body:[]}:{title:t[n]??``,body:t.slice(n+1).filter(e=>e.length>0)}}var Nn=[],Pn=1,Fn=new Set;function In(){for(let e of Fn)e()}function Ln(e){return Fn.add(e),()=>{Fn.delete(e)}}function Rn(){return Nn}function zn(e,t){let n=Nn.find(t=>t.id===e);n&&(Nn=Nn.filter(t=>t.id!==e),In(),n.resolve(t))}function Bn(e,t={}){return new Promise(n=>{Nn=[...Nn,{id:Pn++,message:e,options:t,resolve:n}],In()})}function Vn(){let e=(0,q.c)(2),t=(0,G.useSyncExternalStore)(Ln,Rn,Rn)[0];if(!t)return null;let n;return e[0]===t?n=e[1]:(n=(0,K.jsx)(Hn,{request:t},t.id),e[0]=t,e[1]=n),n}function Hn(e){let t=(0,q.c)(46),{request:n}=e,r=(0,G.useRef)(null),i,a,o,s,c,l,u,d,f,p,m,h;if(t[0]!==n.id||t[1]!==n.message||t[2]!==n.options){let{title:e,body:g}=Mn(n.message),{confirmLabel:_,cancelLabel:v,destructive:y}=n.options;c=_===void 0?`Confirm`:_,s=v===void 0?`Cancel`:v,l=y===void 0?!1:y,o=_e,m=!0,t[15]===n.id?h=t[16]:(h=e=>{e||zn(n.id,!1)},t[15]=n.id,t[16]=h),a=xe,f=`max-w-md`,p=r,i=Ce,u=(0,K.jsx)(de,{children:e}),d=g.length>0?(0,K.jsx)(Ne,{className:`space-y-2`,render:(0,K.jsx)(`div`,{}),children:g.map(Un)}):null,t[0]=n.id,t[1]=n.message,t[2]=n.options,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h}else i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14];let g;t[17]!==i||t[18]!==u||t[19]!==d?(g=(0,K.jsxs)(i,{children:[u,d]}),t[17]=i,t[18]=u,t[19]=d,t[20]=g):g=t[20];let _;t[21]===n.id?_=t[22]:(_=()=>zn(n.id,!1),t[21]=n.id,t[22]=_);let v;t[23]!==s||t[24]!==_?(v=(0,K.jsx)(Re,{variant:`outline`,onClick:_,children:s}),t[23]=s,t[24]=_,t[25]=v):v=t[25];let y=l?`destructive`:`default`,b;t[26]===n.id?b=t[27]:(b=()=>zn(n.id,!0),t[26]=n.id,t[27]=b);let x;t[28]!==c||t[29]!==y||t[30]!==b?(x=(0,K.jsx)(Re,{ref:r,variant:y,onClick:b,children:c}),t[28]=c,t[29]=y,t[30]=b,t[31]=x):x=t[31];let S;t[32]!==x||t[33]!==v?(S=(0,K.jsxs)(Ae,{children:[v,x]}),t[32]=x,t[33]=v,t[34]=S):S=t[34];let C;t[35]!==a||t[36]!==S||t[37]!==f||t[38]!==p||t[39]!==g?(C=(0,K.jsxs)(a,{className:f,initialFocus:p,children:[g,S]}),t[35]=a,t[36]=S,t[37]=f,t[38]=p,t[39]=g,t[40]=C):C=t[40];let w;return t[41]!==o||t[42]!==C||t[43]!==m||t[44]!==h?(w=(0,K.jsx)(o,{open:m,onOpenChange:h,children:C}),t[41]=o,t[42]=C,t[43]=m,t[44]=h,t[45]=w):w=t[45],w}function Un(e){return(0,K.jsx)(`p`,{children:e},e)}var Wn;function Z(){return Error(`Local backend API is unavailable before a backend is paired.`)}function Gn(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:e=>Bn(e)},shell:{openInEditor:()=>Promise.reject(Z()),openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)},showItemInFolder:async e=>{if(!window.desktopBridge)throw Error(`Revealing files is unavailable in this browser.`);if(!await window.desktopBridge.showItemInFolder(e))throw Error(`Unable to reveal the file.`)},canRevealItemInFolder:()=>!!window.desktopBridge},contextMenu:{show:async(e,t)=>Dn(e,t)},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():An(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);jn(e)}},server:{getConfig:()=>Promise.reject(Z()),refreshProviders:()=>Promise.reject(Z()),updateProvider:()=>Promise.reject(Z()),upsertKeybinding:()=>Promise.reject(Z()),removeKeybinding:()=>Promise.reject(Z()),getSettings:()=>Promise.reject(Z()),updateSettings:()=>Promise.reject(Z()),discoverSourceControl:()=>Promise.reject(Z()),getTraceDiagnostics:()=>Promise.reject(Z()),getProcessDiagnostics:()=>Promise.reject(Z()),getProcessResourceHistory:()=>Promise.reject(Z()),signalProcess:()=>Promise.reject(Z())}}}function Kn(){if(!(typeof window>`u`))return Wn||(window.nativeApi?(Wn=window.nativeApi,Wn):(Wn=Gn(),Wn))}function qn(){return Kn()?.shell.canRevealItemInFolder()??!1}function Jn(){let e=Kn();if(!e)throw Error(`Local API not found`);return e}var Yn=e=>JSON.stringify([e.environmentId,e.input.clientId,e.input.connectionId]);function Xn(e){let t=c(),n=c(),r=c(),i={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId])};return{list:ae(e,{label:`environment-data:preview:list`,tag:L.previewList,staleTimeMs:5e3}),events:_(e,{label:`environment-data:preview:events`,tag:L.subscribePreviewEvents}),discoveredServers:_(e,{label:`environment-data:preview:discovered-servers`,tag:L.subscribeDiscoveredLocalServers}),automationRequests:_(e,{label:`environment-data:preview:automation-requests`,tag:L.previewAutomationConnect,idleTtlMs:0}),open:z(e,{label:`environment-data:preview:open`,tag:L.previewOpen,scheduler:t,concurrency:i}),navigate:z(e,{label:`environment-data:preview:navigate`,tag:L.previewNavigate,scheduler:t,concurrency:i}),resize:z(e,{label:`environment-data:preview:resize`,tag:L.previewResize,scheduler:t,concurrency:i}),refresh:z(e,{label:`environment-data:preview:refresh`,tag:L.previewRefresh,scheduler:t,concurrency:i}),close:z(e,{label:`environment-data:preview:close`,tag:L.previewClose,scheduler:t,concurrency:i}),reportStatus:z(e,{label:`environment-data:preview:report-status`,tag:L.previewReportStatus,scheduler:n,concurrency:{mode:`latest`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.threadId,t.tabId])}}),respondToAutomation:z(e,{label:`environment-data:preview:automation-respond`,tag:L.previewAutomationRespond,scheduler:r,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.connectionId,t.requestId])}}),focusAutomationHost:z(e,{label:`environment-data:preview:automation-focus-host`,tag:L.previewAutomationFocusHost,scheduler:r,concurrency:{mode:`latest`,key:Yn}})}}var Zn=Xn(be),Qn=Object.freeze({ERR_NAME_NOT_RESOLVED:`DNS address could not be found`,ERR_NAME_RESOLUTION_FAILED:`DNS address could not be found`,ERR_CONNECTION_REFUSED:`Connection refused`,ERR_CONNECTION_RESET:`Connection was reset`,ERR_CONNECTION_CLOSED:`Connection was closed`,ERR_CONNECTION_TIMED_OUT:`Connection timed out`,ERR_INTERNET_DISCONNECTED:`No internet connection`,ERR_TIMED_OUT:`Connection timed out`,ERR_CERT_AUTHORITY_INVALID:`Certificate authority is not trusted`,ERR_CERT_COMMON_NAME_INVALID:`Certificate hostname mismatch`,ERR_CERT_DATE_INVALID:`Certificate is expired or not yet valid`,ERR_TOO_MANY_REDIRECTS:`Too many redirects`}),$n=Object.freeze({snapshot:null,sessions:{},suppressedTabIds:new Set,activeTabId:null,desktopOverlay:null,desktopByTabId:{},recentlySeenUrls:[],serverEpoch:null,serverRevision:0}),er=We($n).pipe(R(`preview:empty-thread`)),tr=fe(e=>We($n).pipe(ze,R(`preview:thread:${e}`))),nr=We({keys:new Set}).pipe(ze,R(`preview:active-thread-keys`)),rr=We(e=>{let t={};for(let n of e(nr).keys){let r=e(tr(n));Object.keys(r.sessions).length>0&&(t[n]=r)}return t}).pipe(R(`preview:active-sessions`)),ir=new Set;function ar(e,t){let n=Object.keys(t.sessions).length>0;Me.update(nr,t=>{if(t.keys.has(e)===n)return t;let r=new Set(t.keys);return n?r.add(e):r.delete(e),{keys:r}})}function Q(e,t){let n=D(e),r=tr(n),i=Me.get(r);Me.modify(r,e=>(i=t(e),[i!==e,i]))&&(ir.add(n),ar(n,i))}var or=(e,t)=>[t,...e.filter(e=>e!==t)].slice(0,10),sr=(e,t)=>t.navStatus._tag===`Idle`?e:or(e,t.navStatus.url),cr=e=>Object.values(e).toSorted((e,t)=>e.updatedAt.localeCompare(t.updatedAt)).at(-1)??null,lr=(e,t)=>{if(!e.sessions[t])return e;let{[t]:n,...r}=e.sessions,{[t]:i,...a}=e.desktopByTabId,o=cr(r),s=e.activeTabId===t?o?.tabId??null:e.activeTabId,c=s?r[s]??o:o;return{...e,sessions:r,desktopByTabId:a,activeTabId:c?.tabId??null,snapshot:c,desktopOverlay:c?a[c.tabId]??null:null}};function ur(e){let t=(0,q.c)(2),n;return t[0]===e?n=t[1]:(n=e?tr(D(e)):er,t[0]=e,t[1]=n),I(n)}function dr(){return I(rr)}function fr(e){return Me.get(tr(D(e)))}function pr(e,t){Q(e,e=>{if(e.serverEpoch!==null&&t.serverEpoch!==e.serverEpoch||t.revision<e.serverRevision)return e;let n=(()=>{switch(t.type){case`opened`:case`navigated`:case`resized`:{let n=t.snapshot;if(e.suppressedTabIds.has(n.tabId))return e;let r=n.navStatus._tag===`Idle`?e.recentlySeenUrls:or(e.recentlySeenUrls,n.navStatus.url),i={...e.sessions,[n.tabId]:n},a=t.type===`opened`?n.tabId:e.activeTabId,o=i[a??n.tabId]??n;return{...e,sessions:i,activeTabId:a??n.tabId,snapshot:o,desktopOverlay:e.desktopByTabId[o.tabId]??null,recentlySeenUrls:r}}case`failed`:{let n=e.sessions[t.tabId];if(!n)return e;let r={...n,navStatus:{_tag:`LoadFailed`,url:t.url,title:t.title,code:t.code,description:t.description},updatedAt:t.createdAt},i={...e.sessions,[t.tabId]:r};return{...e,sessions:i,snapshot:e.activeTabId===t.tabId?r:e.snapshot}}case`closed`:{let n=lr(e,t.tabId);if(!n.suppressedTabIds.has(t.tabId))return n;let r=new Set(n.suppressedTabIds);return r.delete(t.tabId),{...n,suppressedTabIds:r}}}})();return n.serverRevision===t.revision&&n.serverEpoch===t.serverEpoch?n:{...n,serverEpoch:t.serverEpoch,serverRevision:t.revision}})}function mr(e,t){Q(e,e=>{if(!t&&e.snapshot===null)return e;if(!t)return{...e,snapshot:null,sessions:{},activeTabId:null,desktopOverlay:null,desktopByTabId:{}};if(e.suppressedTabIds.has(t.tabId))return e;let n=e.sessions[t.tabId];if(n&&n.updatedAt>t.updatedAt)return e;let r=sr(e.recentlySeenUrls,t);return{...e,snapshot:t,sessions:{...e.sessions,[t.tabId]:t},activeTabId:t.tabId,desktopOverlay:e.desktopByTabId[t.tabId]??null,recentlySeenUrls:r}})}function hr(e,t){Q(e,e=>{if(e.suppressedTabIds.has(t.tabId))return e;let n=e.sessions[t.tabId];if(n&&n.updatedAt>t.updatedAt)return e;let r={...e.sessions,[t.tabId]:t},i=e.activeTabId&&r[e.activeTabId]?e.activeTabId:t.tabId,a=r[i]??t;return{...e,sessions:r,activeTabId:i,snapshot:a,desktopOverlay:e.desktopByTabId[i]??null,recentlySeenUrls:sr(e.recentlySeenUrls,t)}})}function gr(e,t){Q(e,e=>{let n=e.serverEpoch===t.serverEpoch;if(n&&t.revision<e.serverRevision)return e;let r=t.sessions,i={},a=n?e.suppressedTabIds:new Set,o=e.recentlySeenUrls;for(let t of r){if(a.has(t.tabId))continue;let r=n?e.sessions[t.tabId]:void 0,s=r&&r.updatedAt>t.updatedAt?r:t;i[s.tabId]=s,o=sr(o,s)}let s=cr(i),c=e.activeTabId&&i[e.activeTabId]?e.activeTabId:s?.tabId??null,l=c?i[c]??null:null,u=n?Object.fromEntries(Object.entries(e.desktopByTabId).filter(([e])=>i[e]!==void 0)):{},d=new Set([...a].filter(e=>r.some(t=>t.tabId===e)));return{...e,sessions:i,suppressedTabIds:d,activeTabId:c,snapshot:l,desktopByTabId:u,desktopOverlay:c?u[c]??null:null,recentlySeenUrls:o,serverEpoch:t.serverEpoch,serverRevision:t.revision}})}function _r(e,t,n){Q(e,e=>{let r={...e.desktopByTabId};return n?r[t]=n:delete r[t],{...e,desktopByTabId:r,desktopOverlay:e.activeTabId===t?n:e.desktopOverlay}})}function vr(e,t){Q(e,e=>{let n=new Set(e.suppressedTabIds);return n.add(t),{...lr(e,t),suppressedTabIds:n}})}function yr(e,t,n){Q(e,e=>{if(!e.suppressedTabIds.has(n))return e;let r=new Set(e.suppressedTabIds);if(r.delete(n),!t)return{...e,suppressedTabIds:r};let i=t.navStatus._tag===`Idle`?e.recentlySeenUrls:or(e.recentlySeenUrls,t.navStatus.url);return{...e,snapshot:t,sessions:{...e.sessions,[t.tabId]:t},suppressedTabIds:r,activeTabId:t.tabId,desktopOverlay:e.desktopByTabId[t.tabId]??null,recentlySeenUrls:i}})}function br(e,t){Q(e,e=>{let n=e.sessions[t];return!n||e.activeTabId===t?e:{...e,activeTabId:t,snapshot:n,desktopOverlay:e.desktopByTabId[t]??null}})}function xr(e,t){t.trim().length!==0&&Q(e,e=>({...e,recentlySeenUrls:or(e.recentlySeenUrls,t)}))}function Sr(){return typeof window>`u`?!1:!!window.desktopBridge?.preview}var Cr=[{id:`p4code`,label:`P4 Code`,light:{"--background":`oklch(0.988 0.001 286)`,"--foreground":`oklch(0.274 0.006 286)`,"--card":`oklch(1 0 0)`,"--popover":`oklch(1 0 0)`,"--primary":`oklch(0.546 0.215 262.881)`,"--primary-foreground":`oklch(1 0 0)`,"--accent":`oklch(0.967 0.001 286)`,"--accent-foreground":`oklch(0.21 0.006 286)`,"--muted":`oklch(0.977 0.001 286)`,"--muted-foreground":`oklch(0.442 0.006 286)`,"--border":`oklch(0.92 0.004 286)`,"--input":`oklch(0.871 0.006 286)`,"--ring":`oklch(0.546 0.215 262.881)`,"--sidebar":`oklch(0.967 0.001 286)`,"--destructive":`oklch(0.637 0.237 25.331)`,"--destructive-foreground":`oklch(0.505 0.213 27.518)`},dark:{"--background":`oklch(0.145 0.005 286)`,"--foreground":`oklch(0.967 0.001 286)`,"--card":`oklch(0.185 0.006 286)`,"--popover":`oklch(0.205 0.006 286)`,"--primary":`oklch(0.707 0.165 254.624)`,"--primary-foreground":`oklch(0.145 0.005 286)`,"--accent":`oklch(0.245 0.006 286)`,"--accent-foreground":`oklch(0.967 0.001 286)`,"--muted":`oklch(0.225 0.006 286)`,"--muted-foreground":`oklch(0.674 0.006 286)`,"--border":`oklch(0.274 0.006 286)`,"--input":`oklch(0.311 0.006 286)`,"--ring":`oklch(0.707 0.165 254.624)`,"--sidebar":`oklch(0.185 0.006 286)`,"--destructive":`oklch(0.704 0.191 22.216)`,"--destructive-foreground":`oklch(0.783 0.157 21.5)`}},{id:`grove`,label:`Grove`,light:{"--background":`oklch(0.972369 0.005497 157.15)`,"--foreground":`oklch(0.222003 0.03479 328.979)`,"--card":`oklch(0.972369 0.005497 157.15)`,"--popover":`oklch(0.932695 0.003778 160.944)`,"--primary":`oklch(0.523295 0.112292 158.089)`,"--primary-foreground":`oklch(0.990339 0.008411 325.64)`,"--accent":`oklch(0.949276 0.004496 159.002)`,"--accent-foreground":`oklch(0.222003 0.03479 328.979)`,"--muted":`oklch(0.945455 0.012308 162.879)`,"--muted-foreground":`oklch(0.527266 0.012309 320.683)`,"--border":`oklch(0.864831 0.01312 167.255)`,"--input":`oklch(0.829746 0.016084 168.234)`,"--ring":`oklch(0.523295 0.112292 158.089)`,"--sidebar":`oklch(0.972369 0.005497 157.15)`,"--destructive":`oklch(0.637823 0.237287 25.436)`,"--destructive-foreground":`oklch(0.509494 0.208583 28.513)`},dark:{"--background":`oklch(0.260865 0.02152 162.75)`,"--foreground":`oklch(0.990339 0.008411 325.64)`,"--card":`oklch(0.260865 0.02152 162.75)`,"--popover":`oklch(0.411828 0.014378 166.627)`,"--primary":`oklch(0.796228 0.133058 157.319)`,"--primary-foreground":`oklch(0.222003 0.03479 328.979)`,"--accent":`oklch(0.363192 0.016572 165.32)`,"--accent-foreground":`oklch(0.990339 0.008411 325.64)`,"--muted":`oklch(0.339728 0.039456 160.274)`,"--muted-foreground":`oklch(0.715427 0.010896 171.428)`,"--border":`oklch(0.457475 0.044046 160.971)`,"--input":`oklch(0.519849 0.049896 160.863)`,"--ring":`oklch(0.796228 0.133058 157.319)`,"--sidebar":`oklch(0.260865 0.02152 162.75)`,"--destructive":`oklch(0.655108 0.221148 23.473)`,"--destructive-foreground":`oklch(0.704237 0.187511 22.228)`}},{id:`ocean`,label:`Ocean`,light:{"--background":`oklch(0.974199 0.002856 241.597)`,"--foreground":`oklch(0.222003 0.03479 328.979)`,"--card":`oklch(0.974199 0.002856 241.597)`,"--popover":`oklch(0.934442 0.003181 269.1)`,"--primary":`oklch(0.536684 0.120219 247.01)`,"--primary-foreground":`oklch(0.990339 0.008411 325.64)`,"--accent":`oklch(0.951058 0.002962 258.339)`,"--accent-foreground":`oklch(0.222003 0.03479 328.979)`,"--muted":`oklch(0.948004 0.009649 241.695)`,"--muted-foreground":`oklch(0.528741 0.01828 313.823)`,"--border":`oklch(0.867646 0.013482 252.362)`,"--input":`oklch(0.832939 0.017389 252.598)`,"--ring":`oklch(0.536684 0.120219 247.01)`,"--sidebar":`oklch(0.974199 0.002856 241.597)`,"--destructive":`oklch(0.637823 0.237287 25.436)`,"--destructive-foreground":`oklch(0.509494 0.208583 28.513)`},dark:{"--background":`oklch(0.242641 0.024125 250.573)`,"--foreground":`oklch(0.990339 0.008411 325.64)`,"--card":`oklch(0.242641 0.024125 250.573)`,"--popover":`oklch(0.398517 0.018232 255.72)`,"--primary":`oklch(0.758933 0.105833 241.548)`,"--primary-foreground":`oklch(0.222003 0.03479 328.979)`,"--accent":`oklch(0.348439 0.019942 253.696)`,"--accent-foreground":`oklch(0.990339 0.008411 325.64)`,"--muted":`oklch(0.319287 0.036766 246.065)`,"--muted-foreground":`oklch(0.691936 0.016294 261.588)`,"--border":`oklch(0.438653 0.039496 245.44)`,"--input":`oklch(0.500905 0.043574 244.781)`,"--ring":`oklch(0.758933 0.105833 241.548)`,"--sidebar":`oklch(0.242641 0.024125 250.573)`,"--destructive":`oklch(0.655108 0.221148 23.473)`,"--destructive-foreground":`oklch(0.702184 0.189226 22.228)`}},{id:`ember`,label:`Ember`,light:{"--background":`oklch(0.976527 0.002685 60.725)`,"--foreground":`oklch(0.222003 0.03479 328.979)`,"--card":`oklch(0.976527 0.002685 60.725)`,"--popover":`oklch(0.936659 0.002879 29.96)`,"--primary":`oklch(0.552831 0.129438 44.656)`,"--primary-foreground":`oklch(0.990339 0.008411 325.64)`,"--accent":`oklch(0.953321 0.002701 42.266)`,"--accent-foreground":`oklch(0.222003 0.03479 328.979)`,"--muted":`oklch(0.950842 0.009273 51.528)`,"--muted-foreground":`oklch(0.530413 0.018453 341.181)`,"--border":`oklch(0.870631 0.013204 39.431)`,"--input":`oklch(0.836213 0.017153 38.661)`,"--ring":`oklch(0.552831 0.129438 44.656)`,"--sidebar":`oklch(0.976527 0.002685 60.725)`,"--destructive":`oklch(0.637823 0.237287 25.436)`,"--destructive-foreground":`oklch(0.509494 0.208583 28.513)`},dark:{"--background":`oklch(0.245899 0.019144 42.044)`,"--foreground":`oklch(0.990339 0.008411 325.64)`,"--card":`oklch(0.245899 0.019144 42.044)`,"--popover":`oklch(0.401111 0.014308 34.896)`,"--primary":`oklch(0.762174 0.124117 52.082)`,"--primary-foreground":`oklch(0.222003 0.03479 328.979)`,"--accent":`oklch(0.351262 0.01565 37.592)`,"--accent-foreground":`oklch(0.990339 0.008411 325.64)`,"--muted":`oklch(0.322144 0.03574 48.309)`,"--muted-foreground":`oklch(0.692479 0.015227 30.963)`,"--border":`oklch(0.44099 0.040202 48.807)`,"--input":`oklch(0.503003 0.045721 49.44)`,"--ring":`oklch(0.762174 0.124117 52.082)`,"--sidebar":`oklch(0.245899 0.019144 42.044)`,"--destructive":`oklch(0.655108 0.221148 23.473)`,"--destructive-foreground":`oklch(0.702184 0.189226 22.228)`}},{id:`iris`,label:`Iris`,light:{"--background":`oklch(0.976531 0.003855 303.226)`,"--foreground":`oklch(0.222003 0.03479 328.979)`,"--card":`oklch(0.976531 0.003855 303.226)`,"--popover":`oklch(0.936665 0.005041 310.132)`,"--primary":`oklch(0.525348 0.15373 294.176)`,"--primary-foreground":`oklch(0.990339 0.008411 325.64)`,"--accent":`oklch(0.953326 0.004536 307.676)`,"--accent-foreground":`oklch(0.222003 0.03479 328.979)`,"--muted":`oklch(0.950194 0.011956 300.733)`,"--muted-foreground":`oklch(0.529955 0.022319 321.556)`,"--border":`oklch(0.869608 0.018226 303.859)`,"--input":`oklch(0.834773 0.023405 303.676)`,"--ring":`oklch(0.525348 0.15373 294.176)`,"--sidebar":`oklch(0.976531 0.003855 303.226)`,"--destructive":`oklch(0.637823 0.237287 25.436)`,"--destructive-foreground":`oklch(0.509494 0.208583 28.513)`},dark:{"--background":`oklch(0.225975 0.031062 293.741)`,"--foreground":`oklch(0.990339 0.008411 325.64)`,"--card":`oklch(0.225975 0.031062 293.741)`,"--popover":`oklch(0.386739 0.024023 297.509)`,"--primary":`oklch(0.671712 0.169136 293.929)`,"--primary-foreground":`oklch(0.222003 0.03479 328.979)`,"--accent":`oklch(0.335291 0.026008 296.394)`,"--accent-foreground":`oklch(0.990339 0.008411 325.64)`,"--muted":`oklch(0.291515 0.05276 294.209)`,"--muted-foreground":`oklch(0.663321 0.025932 301.862)`,"--border":`oklch(0.40874 0.058536 295.893)`,"--input":`oklch(0.46756 0.065775 296.265)`,"--ring":`oklch(0.671712 0.169136 293.929)`,"--sidebar":`oklch(0.225975 0.031062 293.741)`,"--destructive":`oklch(0.655108 0.221148 23.473)`,"--destructive-foreground":`oklch(0.702184 0.189226 22.228)`}}];function wr(e){return Cr.find(t=>t.id===e)??null}function Tr(e,t){return t===`dark`?e.dark:e.light}var Er=`p4code:custom-themes`,Dr=[{cssVar:`--background`,label:`Background`},{cssVar:`--foreground`,label:`Foreground`},{cssVar:`--card`,label:`Card`},{cssVar:`--popover`,label:`Popover`},{cssVar:`--primary`,label:`Primary`},{cssVar:`--primary-foreground`,label:`Primary foreground`},{cssVar:`--accent`,label:`Accent`},{cssVar:`--accent-foreground`,label:`Accent foreground`},{cssVar:`--muted`,label:`Muted`},{cssVar:`--muted-foreground`,label:`Muted foreground`},{cssVar:`--border`,label:`Border`},{cssVar:`--input`,label:`Input`},{cssVar:`--ring`,label:`Ring`},{cssVar:`--sidebar`,label:`Sidebar`},{cssVar:`--destructive`,label:`Destructive`},{cssVar:`--destructive-foreground`,label:`Destructive foreground`},{cssVar:`--warning`,label:`Warning`},{cssVar:`--warning-foreground`,label:`Warning foreground`},{cssVar:`--success`,label:`Success`},{cssVar:`--success-foreground`,label:`Success foreground`},{cssVar:`--info`,label:`Info`},{cssVar:`--info-foreground`,label:`Info foreground`}],Or=new Set(Dr.map(e=>e.cssVar)),kr=o({id:F,name:F,base:w([`light`,`dark`]),colors:ue(F,F)}),Ar=ye(o({version:Le(1),themes:y(kr)})),jr=`custom:`,Mr=`preset:`;function Nr(e){return`${Mr}${e}`}function Pr(e){if(!e.startsWith(`preset:`))return null;let t=e.slice(7);return t.length>0?t:null}function Fr(e){return`${jr}${e}`}function Ir(e){if(!e.startsWith(`custom:`))return null;let t=e.slice(7);return t.length>0?t:null}function Lr(){if(typeof window>`u`)return[];let e;try{e=window.localStorage.getItem(Er)}catch{return[]}if(e===null)return[];try{let t=JSON.parse(e);return Ar(t)?t.themes:[]}catch{return[]}}function Rr(e){typeof window>`u`||window.localStorage.setItem(Er,JSON.stringify({version:1,themes:e}))}function zr(e,t){return e.find(e=>e.id===t)??null}function Br(e,t){return e.findIndex(e=>e.id===t.id)===-1?[...e,t]:e.map(e=>e.id===t.id?t:e)}function Vr(e,t){return e.filter(e=>e.id!==t)}var Hr=/^[\w#(),./%\s-]+$/;function Ur(e){return Object.entries(e.colors).map(([e,t])=>({cssVar:e,value:t.trim()})).filter(({cssVar:e,value:t})=>Or.has(e)&&t.length>0&&Hr.test(t))}function Wr(e){let t=e.trim().toLowerCase();if(/^#[\da-f]{6}$/.test(t))return t;if(/^#[\da-f]{3}$/.test(t)){let[e,n,r]=t.slice(1);return`#${e}${e}${n}${n}${r}${r}`}return null}function Gr(e){return{id:Pe(),name:e.name,base:e.base,colors:e.colors??{}}}var Kr=`p4code:theme-pair`,qr={light:null,dark:null};function Jr(e){return e.startsWith(`preset:`)||e.startsWith(`custom:`)}function Yr(e){return e===null||!Jr(e)?qr:{light:e,dark:e}}function Xr(e){if(e===null)return null;try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t,r=e=>typeof e==`string`&&Jr(e)?e:null;return{light:r(n.light),dark:r(n.dark)}}catch{return null}}function Zr(e){return JSON.stringify({light:e.light,dark:e.dark})}function Qr(e,t){return t===`dark`?e.dark:e.light}function $r(e,t,n){return t===`dark`?{...e,dark:n}:{...e,light:n}}function ei(e,t){let n=[];return e.light===t&&n.push(`light`),e.dark===t&&n.push(`dark`),n}var ti=w([`light`,`dark`,`system`]),$=`p4code:theme`,ni=`(prefers-color-scheme: dark)`,ri={theme:`system`,systemDark:!1,themePair:qr},ii=`theme-color`,ai=`meta[name="${ii}"][data-dynamic-theme-color="true"]`,oi=class extends V()(`ThemeStorageError`,{operation:w([`read`,`write`]),storageKey:F,theme:Ie(F),cause:oe()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},si=ye(oi),ci=class extends V()(`DesktopThemeSyncError`,{theme:ti,cause:oe()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},li=ye(ci),ui=[],di=null,fi=null,pi=null,mi=``,hi=[],gi=null;function _i(){for(let e of ui)e()}function vi(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(ni).matches}function yi(){if(typeof window>`u`)return ri.theme;let e;try{e=window.localStorage.getItem($)}catch(e){throw new oi({operation:`read`,storageKey:$,cause:e})}if(e===`light`||e===`dark`||e===`system`)return e;if(e!==null){let t=Ir(e);if(t!==null&&zr(Lr(),t)!==null)return e;let n=Pr(e);if(n!==null&&wr(n)!==null)return e}return ri.theme}function bi(e){let t=Ir(e);return t===null?null:zr(Lr(),t)}var xi=null;function Si(){if(xi!==null)return xi;if(typeof window>`u`)return qr;let e=null;try{e=Xr(window.localStorage.getItem(Kr))}catch{e=null}if(e!==null)return xi=e,e;let t=null;try{t=window.localStorage.getItem($)}catch{t=null}let n=Yr(t);return Ci(n),n}function Ci(e){if(xi={light:e.light,dark:e.dark},!(typeof window>`u`))try{window.localStorage.setItem(Kr,Zr(xi))}catch{}}function wi(e,t){Ci($r(Si(),e,t)),Vi()}function Ti(e){return e===`light`||e===`dark`||e===`system`?e:Pr(e)===null?bi(e)?.base??`system`:`system`}function Ei(e){if(!(typeof window>`u`))try{window.localStorage.setItem($,e),gi=null}catch(t){throw new oi({operation:`write`,storageKey:$,theme:e,cause:t})}}function Di(){if(gi!==null)return ri.theme;try{return yi()}catch(e){let t=si(e)?e:new oi({operation:`read`,storageKey:$,cause:e});return gi=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...Oe(t)}),ri.theme}}function Oi(){let e=document.querySelector(ai);return e||(e=document.createElement(`meta`),e.name=ii,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function ki(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function Ai(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function ji(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=ki(getComputedStyle(Ai()).backgroundColor),t=ki(getComputedStyle(document.body).backgroundColor),n=e??t;n&&(document.documentElement.style.backgroundColor=n,document.body.style.backgroundColor=n,Oi().setAttribute(`content`,n))}var Mi=`p4code-custom-theme-overrides`;function Ni(e){let t=document.getElementById?.(Mi);if(e.length===0){t?.remove();return}let n=`html [data-app-sidebar],\nhtml.dark [data-app-sidebar] {\n${e.map(e=>` ${e.cssVar}: ${e.value};`).join(`
3
- `)}\n}`;if(t){t.textContent=n;return}if(typeof document.createElement!=`function`||!document.head)return;let r=document.createElement(`style`);r.id=Mi,r.textContent=n,document.head.appendChild(r)}function Pi(e){if(e.length===0&&hi.length===0)return;let t=document.documentElement.style;if(typeof t?.setProperty==`function`){for(let e of hi)t.removeProperty(e);for(let n of e)t.setProperty(n.cssVar,n.value);hi=e.map(e=>e.cssVar),Ni(e)}}function Fi(e,t=!1){if(typeof document>`u`||typeof window>`u`)return;let n=Ti(e),r=n===`system`?vi():!1,i=n===`dark`||n===`system`&&r,a=Qr(Si(),i?`dark`:`light`)??e,o=Pr(a),s=o===null?null:wr(o),c=bi(a),l=s===null?c===null?[]:Ur(c):Object.entries(Tr(s,i?`dark`:`light`)).map(([e,t])=>({cssVar:e,value:t})),u=JSON.stringify([n,a,l]);if(pi?.theme===e&&pi.systemDark===r&&mi===u){Li(n);return}t&&document.documentElement.classList.add(`no-transitions`),document.documentElement.classList.toggle(`dark`,i),Pi(l),pi={theme:e,systemDark:r},mi=u,ji(),Li(n),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function Ii(e,t){try{await e.setTheme(t)}catch(e){throw new ci({theme:t,cause:e})}}function Li(e){if(typeof window>`u`)return;let t=window.desktopBridge;!t||typeof t.setTheme!=`function`||fi===e||(fi=e,Ii(t,e).catch(t=>{let n=li(t)?t:new ci({theme:e,cause:t});console.error(n.message,{theme:n.theme,...Oe(n)}),fi===e&&(fi=null)}))}typeof document<`u`&&typeof window<`u`&&Fi(Di());function Ri(){if(typeof window>`u`)return ri;let e=Di(),t=Ti(e)===`system`?vi():!1,n=Si();return di&&di.theme===e&&di.systemDark===t&&di.themePair===n||(di={theme:e,systemDark:t,themePair:n}),di}function zi(){return ri}function Bi(e){if(typeof window>`u`)return()=>{};ui.push(e);let t=typeof window.matchMedia==`function`?window.matchMedia(ni):null,n=()=>{let e=Di();Ti(e)===`system`&&Fi(e,!0),_i()};t?.addEventListener(`change`,n);let r=e=>{(e.key===$||e.key===`p4code:custom-themes`)&&(gi=null,Fi(Di(),!0),_i())};return window.addEventListener(`storage`,r),()=>{ui=ui.filter(t=>t!==e),t?.removeEventListener(`change`,n),window.removeEventListener(`storage`,r)}}function Vi(){Fi(Di(),!0),_i()}function Hi(){let e=(0,q.c)(9),t=(0,G.useSyncExternalStore)(Bi,Ri,zi),n=t.theme,r;e[0]===n?r=e[1]:(r=Ti(n),e[0]=n,e[1]=r);let i=r,a=i===`system`?t.systemDark?`dark`:`light`:i,o=Ui,s,c;e[2]===n?(s=e[3],c=e[4]):(s=()=>{Fi(n)},c=[n],e[2]=n,e[3]=s,e[4]=c),(0,G.useEffect)(s,c);let l=t.themePair,u;return e[5]!==a||e[6]!==n||e[7]!==l?(u={theme:n,setTheme:o,resolvedTheme:a,themePair:l,assignThemeToAppearance:wi},e[5]=a,e[6]=n,e[7]=l,e[8]=u):u=e[8],u}function Ui(e){if(!(typeof window>`u`)){try{Ei(e)}catch(t){let n=t,r=si(n)?n:new oi({operation:`write`,storageKey:$,theme:e,cause:n});console.error(r.message,{operation:r.operation,storageKey:r.storageKey,theme:e,...Oe(r)});return}Fi(e,!0),_i()}}var Wi=/https?:\/\/[^\s"'`<>]+/g,Gi=/(?:~\/|\.{1,2}\/|\/|[A-Za-z]:[\\/]|\\\\)[^\s"'`<>]+|[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)+(?::\d+){0,2}/g,Ki=/[.,;!?]+$/;function qi(e){let t=e.replace(Ki,``);if(t.length===0)return t;let n=(e,n)=>{for(;t.endsWith(n);){if(t.split(e).length-1>=t.split(n).length-1)return;t=t.slice(0,-1)}};return n(`(`,`)`),n(`[`,`]`),n(`{`,`}`),t}function Ji(e,t){return e.start<t.end&&t.start<e.end}function Yi(e,t,n,r){let i=[];n.lastIndex=0;for(let a of e.matchAll(n)){let e=a[0],n=a.index??-1;if(n<0||e.length===0)continue;let o=qi(e);if(o.length===0||t===`path`&&/^https?:\/\//i.test(o))continue;let s={kind:t,text:o,start:n,end:n+o.length};[...r,...i].some(e=>Ji(s,e))||i.push(s)}return i}function Xi(e){return/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`)}function Zi(e){return e.startsWith(`/`)||Xi(e)}function Qi(e){return Xi(e)||/[A-Za-z]:\\/.test(e)}function $i(e,t,n){let r=e.replace(/[\\/]+$/,``);return n===`\\`?`${r}\\${t.replaceAll(`/`,`\\`)}`:`${r}/${t.replace(/^\/+/,``)}`}function ea(e){let t=e.match(/^\/Users\/([^/]+)/);if(t?.[1])return`/Users/${t[1]}`;let n=e.match(/^\/home\/([^/]+)/);if(n?.[1])return`/home/${n[1]}`;let r=e.match(/^([A-Za-z]:\\Users\\[^\\]+)/);if(r?.[1])return r[1]}function ta(e){let t=e,n,r,i=t.match(/:(\d+)$/);if(!i?.[1])return{path:t,line:void 0,column:void 0};n=i[1],t=t.slice(0,-i[0].length);let a=t.match(/:(\d+)$/);return a?.[1]?(r=a[1],t=t.slice(0,-a[0].length)):(r=n,n=void 0),{path:t,line:r,column:n}}function na(e){let t=Yi(e,`url`,Wi,[]),n=Yi(e,`path`,Gi,t);return[...t,...n].toSorted((e,t)=>e.start-t.start)}function ra(e,t){let n=t(e-1);if(!n)return null;let r=e,i=n;for(;r>1&&i.isWrapped;){let e=t(r-2);if(!e)return null;--r,i=e}let a=[],o=0,s=r;for(;;){let e=t(s-1);if(!e)break;let n=t(s)?.isWrapped===!0,r=e.translateToString(!n);if(a.push({bufferLineNumber:s,text:r,startIndex:o,endIndex:o+r.length}),o+=r.length,!n)break;s+=1}return{text:a.map(e=>e.text).join(``),segments:a}}function ia(e,t){for(let n of e)if(t<n.endIndex)return{x:t-n.startIndex+1,y:n.bufferLineNumber};let n=e[e.length-1];return{x:Math.max(n?.text.length??0,1),y:n?.bufferLineNumber??1}}function aa(e,t){return{start:ia(e.segments,t.start),end:ia(e.segments,t.end-1)}}function oa(e,t){return e.start.y<=t&&t<=e.end.y}function sa(e,t=typeof navigator>`u`?``:navigator.platform){return t.length===0?!1:me(t)?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function ca(e,t){let{path:n,line:r,column:i}=ta(e),a=n;if(n.startsWith(`~/`)){let e=ea(t);if(e){let t=Qi(e)?`\\`:`/`;a=$i(e,n.slice(2),t)}}else Zi(n)||(a=$i(t,n,Qi(t)?`\\`:`/`));return r?`${a}:${r}${i?`:${i}`:``}`:a}function la(e){return e.replaceAll(`\\`,`/`)}function ua(e){return/^\/[A-Za-z]:\//.test(e)?e.slice(1):e}function da(e){return e.replace(/[\\/]+$/,``)}function fa(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>=0?e.slice(t+1):e}function pa(e){return e.replace(/^\.\/+/,``).replace(/^\/+/,``)}function ma(e,t){let{path:n,line:r,column:i}=ta(e),a=ua(la(n)),o=a;if(t){let e=ua(la(da(t))),n=fa(e),r=a.toLowerCase(),i=e.toLowerCase(),s=`${i}/`,c=`${n.toLowerCase()}/`;if(r===i)o=n;else if(r.startsWith(s))o=`${n}/${a.slice(e.length+1)}`;else if(!a.startsWith(`/`)){let e=pa(a);o=r.startsWith(c)?a:`${n}/${e}`}}return r?`${o}:${r}${i?`:${i}`:``}`:o}var ha=/^[A-Za-z]:[\\/]/,ga=/^\\\\/,_a=/^([A-Za-z][A-Za-z0-9+.-]*):(.*)$/,va=/^(~\/|\.{1,2}\/)/,ya=/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)+(?::\d+){0,2}$/,ba=/^[A-Za-z0-9._-]+\.[A-Za-z0-9_-]+(?::\d+){0,2}$/,xa=/:\d+(?::\d+)?$/,Sa=/^\d+(?::\d+)?$/,Ca=/:(\d+)-\d+$/,wa=[`/Users/`,`/home/`,`/tmp/`,`/var/`,`/etc/`,`/opt/`,`/mnt/`,`/Volumes/`,`/private/`,`/root/`,`/usr/`,`/bin/`,`/sbin/`,`/lib/`,`/lib64/`,`/srv/`,`/dev/`,`/proc/`,`/sys/`,`/run/`,`/boot/`,`/media/`,`/workspace/`,`/workspaces/`];function Ta(e){return e.replace(Ca,`:$1`)}function Ea(e){try{return decodeURIComponent(e)}catch{return e}}function Da(e){return e.startsWith(`<`)&&e.endsWith(`>`)?e.slice(1,-1):e}function Oa(e){return Da(e.trim())}function ka(e){let t=e.indexOf(`#`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t):``,i=n.indexOf(`?`);return{path:i>=0?n.slice(0,i):n,hash:r}}function Aa(e){return/^\/[A-Za-z]:[\\/]/.test(e)?e.slice(1):e}function ja(e,t){try{let n=new URL(e);if(n.protocol.toLowerCase()!==`file:`)return null;let r=n.pathname;if(r.length===0)return null;let i=Aa(r);return{path:t?.decodePath===!1?i:Ea(i),hash:n.hash}}catch{return null}}function Ma(e){if(!e)return null;let t=ja(Oa(e),{decodePath:!1});return t?`${t.path}${t.hash}`:null}function Na(e){if(!e.startsWith(`/`))return!1;if(wa.some(t=>e.startsWith(t))||xa.test(e))return!0;let t=e.slice(e.lastIndexOf(`/`)+1);return/\.[A-Za-z0-9_-]+$/.test(t)}function Pa(e,t){if(!t||xa.test(e))return e;let n=t.match(/^#L(\d+)(?:C(\d+))?$/i);if(!n?.[1])return e;let r=n[1],i=n[2];return`${e}:${r}${i?`:${i}`:``}`}function Fa(e){return ha.test(e)||ga.test(e)||va.test(e)?!0:e.startsWith(`/`)?Na(e):ya.test(e)||ba.test(e)}function Ia(e){return va.test(e)||!e.startsWith(`/`)&&!ha.test(e)&&!ga.test(e)}function La(e){let t=e.match(_a);if(!t)return!1;let n=t[2]??``;return n.startsWith(`//`)?!0:!Sa.test(n)}function Ra(e,t){if(!e)return null;let n=Oa(e);if(n.length===0||n.startsWith(`#`))return null;let r=n.toLowerCase().startsWith(`file:`)?ja(n):null,i=r??ka(n),a=Ta(Aa(r?i.path.trim():Ea(i.path.trim()))),o=Ea(i.hash.trim());if(a.length===0||!ha.test(a)&&!ga.test(a)&&La(a)||!Fa(a))return null;let s=Pa(a,o);return Ia(s)?t?ca(s,t):null:s}var za=/[\s`]/,Ba=/[\\/]/,Va=/\.[A-Za-z0-9_-]+$/,Ha=/^\d+(?:\.\d+)+$/,Ua=/^[A-Za-z0-9_-]+(?::\d+){1,2}$/,Wa=new Set(`Makefile.makefile.GNUmakefile.Dockerfile.Containerfile.Justfile.justfile.Rakefile.Gemfile.Procfile.Brewfile.Caddyfile.Vagrantfile.Jenkinsfile.Podfile.Fastfile.BUILD.WORKSPACE.LICENSE.LICENCE.COPYING.NOTICE.AUTHORS.CONTRIBUTORS.CHANGELOG.README.CODEOWNERS`.split(`.`)),Ga=new Set([`localhost`]),Ka=new Set([`com`,`net`,`org`,`io`,`dev`,`app`,`ai`,`co`,`edu`,`gov`,`mil`,`info`,`biz`,`xyz`,`me`,`tv`,`cc`,`gg`,`chat`,`cloud`,`site`,`online`,`tech`,`store`,`link`]),qa=new Set(`uk.de.fr.nl.se.no.fi.dk.pl.ch.at.be.es.it.pt.eu.us.ca.au.nz.jp.kr.cn.br.ru.mx.ie.cz.tr.sg.hk`.split(`.`));function Ja(e,t){if(e.startsWith(`.`))return!1;let n=e.toLowerCase();if(Ga.has(n)||Ha.test(e))return!0;let r=n.split(`.`),i=r[r.length-1];return r.length<2||i===void 0?!1:Ka.has(i)?!0:!t&&qa.has(i)}function Ya(e,t){let n=e.trim();if(n.length===0||za.test(n))return null;let r=Ta(ha.test(n)||ga.test(n)?n:n.replaceAll(`\\`,`/`)),i=xa.test(r);if(!i&&!Ba.test(r))return null;if(!(va.test(r)||r.startsWith(`/`)||ha.test(r)||ga.test(r))){let e=r.replace(xa,``);if(Ja(e.split(`/`)[0]??e,i)||!i&&!Va.test(Xa(e)))return null}return Qa(r,t)||(t&&Ua.test(r)&&Wa.has(r.replace(xa,``))?$a(ca(r,t),t):null)}function Xa(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>=0?e.slice(t+1):e}function Za(e,t){if(!t)return null;let n=Aa(e.replaceAll(`\\`,`/`));if(n.split(`/`).includes(`..`))return null;let r=Aa(t.replaceAll(`\\`,`/`)).replace(/\/+$/,``),i=n.toLowerCase(),a=r.toLowerCase();return i.startsWith(`${a}/`)?n.slice(r.length+1):null}function Qa(e,t){let n=Ra(e,t);return n?$a(n,t):null}function $a(e,t){let{path:n,line:r,column:i}=ta(e),a=r?Number.parseInt(r,10):NaN,o=i?Number.parseInt(i,10):NaN,s=Number.isFinite(a)?a:void 0,c=Number.isFinite(o)?o:void 0;return{filePath:n,targetPath:e,displayPath:ma(e,t),workspaceRelativePath:Za(n,t),basename:Xa(n),...s===void 0?{}:{line:s},...c===void 0?{}:{column:c}}}var eo=[`.htm`,`.html`,`.pdf`],to=[`.avif`,`.gif`,`.ico`,`.jpeg`,`.jpg`,`.png`,`.svg`,`.webp`];function no(e,t){let n=e.split(/[?#]/,1)[0]?.toLowerCase()??``;return t.some(e=>n.endsWith(e))}function ro(e){return no(e,eo)}function io(e){return no(e,to)}var ao=[`.mdx`];function oo(e){return no(e,ao)}function so(e){return ro(e)||oo(e)}var co=`theme`,lo=`/mdx-host.html`;function uo(e){let t=Za(e.filePath,e.workspaceRoot??void 0);return t===null&&!e.allowLocalFiles?null:oo(e.filePath)?{_tag:`mdx-preview`,path:e.filePath}:t===null?{_tag:`local-file`,path:e.filePath}:{_tag:`workspace-file`,threadId:e.threadId,path:t}}function fo(e){let t;try{t=new URL(e.assetUrl)}catch{return null}let n=new URL(`.`,t).href,r=new URL(lo,t);return r.searchParams.set(`src`,n),r.searchParams.set(co,e.theme),r.href}function po(e,t){let n;try{n=new URL(e)}catch{return null}return n.pathname!==`/mdx-host.html`||n.searchParams.get(`theme`)===t?null:(n.searchParams.set(co,t),n.href)}export{Zn as $,Pr as A,pr as B,Er as C,qe as Ct,zr as D,Fr as E,Rr as F,fr as G,vr as H,Cr as I,br as J,gr as K,wr as L,Vr as M,Nr as N,Wr as O,Br as P,Qn as Q,Tr as R,ei as S,et as St,Gr as T,yr as U,mr as V,Sr as W,dr as X,hr as Y,ur as Z,aa as _,Xe as _t,oo as a,yn as at,ji as b,Qe as bt,Ya as c,Yt as ct,Za as d,Ht as dt,qn as et,ma as f,at as ft,ca as g,Ze as gt,sa as h,nt as ht,so as i,Bn as it,Lr as j,Ir as k,Qa as l,Jt as lt,na as m,rt as mt,uo as n,Kn as nt,io as o,gn as ot,ra as p,it as pt,xr as q,po as r,Vn as rt,Oa as s,Xt as st,fo as t,Jn as tt,Ma as u,Ut as ut,oa as v,$e as vt,Dr as w,Hi as x,Ye as xt,Vi as y,tt as yt,_r as z};
4
- //# sourceMappingURL=previewAssetResource-J1WeeXS-.js.map