getborg 0.0.125 → 0.0.126

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 (75) hide show
  1. package/dist/bin.mjs +4900 -2407
  2. package/dist/client/.vite/manifest.json +359 -359
  3. package/dist/client/assets/{ArrowRight-D8u8fAtz.js → ArrowRight-sXL3WqRj.js} +2 -2
  4. package/dist/client/assets/{ArrowSquareOut-B_f6YUhV.js → ArrowSquareOut-BXw7kBJ2.js} +2 -2
  5. package/dist/client/assets/{ArrowsClockwise-DQYZ1Xbo.js → ArrowsClockwise-C2ZJkkb1.js} +2 -2
  6. package/dist/client/assets/{CaretLeft-CfrkuxuJ.js → CaretLeft-u94enBjz.js} +2 -2
  7. package/dist/client/assets/{ChatMarkdown-DvWtIvZP.js → ChatMarkdown-PlWZFDnz.js} +5 -5
  8. package/dist/client/assets/{CircleNotch-BcVOnWaH.js → CircleNotch-DqcpMoTY.js} +2 -2
  9. package/dist/client/assets/{DesignWorkspace-5_CopTlF.js → DesignWorkspace-DmKoQxKI.js} +3 -3
  10. package/dist/client/assets/DiffPanel-D77xCxTK.js +2 -0
  11. package/dist/client/assets/{DiffWorkerPoolProvider-B0GAJHHf.js → DiffWorkerPoolProvider-ClROlLBb.js} +2 -2
  12. package/dist/client/assets/{DocxPreview-B3Ldhzps.js → DocxPreview-HJVaPJXL.js} +4 -4
  13. package/dist/client/assets/{FilePreviewPanel-DG9JDM1b.js → FilePreviewPanel-CFCxGnPA.js} +9 -9
  14. package/dist/client/assets/{HtmlPreview-Cln7r1CE.js → HtmlPreview-CJQuCP2x.js} +2 -2
  15. package/dist/client/assets/{PdfPreview-C5IVpvDo.js → PdfPreview-BgV8uugr.js} +3 -3
  16. package/dist/client/assets/{PptxPreview-DgUlZkyA.js → PptxPreview-BVdzk7UG.js} +3 -3
  17. package/dist/client/assets/PreviewPanel-C8wYTZ3K.js +2 -0
  18. package/dist/client/assets/PullRequestCodeTab-6b-pnSLs.js +6 -0
  19. package/dist/client/assets/{PullRequestReactions-DagCwQZQ.js → PullRequestReactions-kdg3iZ85.js} +4 -4
  20. package/dist/client/assets/{RightPanelResizeHandle-XlC9gY5e.js → RightPanelResizeHandle-kUStdA3L.js} +2 -2
  21. package/dist/client/assets/{VirtualizedFile-CFgSsBl7.js → VirtualizedFile-DuJYdYdq.js} +2 -2
  22. package/dist/client/assets/{XlsxPreview-D-aoM4SG.js → XlsxPreview-Bi4rmMAb.js} +3 -3
  23. package/dist/client/assets/accountData-B88fzgQo.js +16 -0
  24. package/dist/client/assets/assetUrls-CF9bvkMB.js +2 -0
  25. package/dist/client/assets/assets-CkgNlvqv.js +2 -0
  26. package/dist/client/assets/{browserHistoryStore-DKruSW2y.js → browserHistoryStore-DIuEAuCl.js} +3 -3
  27. package/dist/client/assets/{browserRecording-CZz89Zcp.js → browserRecording-2dQePGOK.js} +2 -2
  28. package/dist/client/assets/clientAnalytics-BbUHu8ei.js +1 -0
  29. package/dist/client/assets/{clientPersistenceStorage-CeJLSpQl.js → clientPersistenceStorage-DsdIKJBh.js} +2 -2
  30. package/dist/client/assets/{combobox-r8GBhxUE.js → combobox-DVmHwJKi.js} +2 -2
  31. package/dist/client/assets/{composerMentionDrag-3h9AstHI.js → composerMentionDrag-CB6wqaTe.js} +2 -2
  32. package/dist/client/assets/{designCanvas.logic-BT66Jt7h.js → designCanvas.logic-Ce5c0YLY.js} +4 -4
  33. package/dist/client/assets/{designOpenFileContext-CThLSHGp.js → designOpenFileContext-B0d1oDHN.js} +2 -2
  34. package/dist/client/assets/{diffFileContents-Cw_j-FVi.js → diffFileContents-DuZ8MpUA.js} +2 -2
  35. package/dist/client/assets/{empty--ZI_pbsa.js → empty-d8cb8Ewx.js} +2 -2
  36. package/dist/client/assets/entities-DI7lpu_V.js +2 -0
  37. package/dist/client/assets/{followUpQueuePersistence-igYPNSUl.js → followUpQueuePersistence-BL42ySpK.js} +1 -1
  38. package/dist/client/assets/{index-CaTemWmz.js → index-e-hiL6eh.js} +3 -3
  39. package/dist/client/assets/{input-DrYFVaUj.js → input-DzNFHo2W.js} +2 -2
  40. package/dist/client/assets/{lib-D8z7BdAf.js → lib-IA-5-mGB.js} +2 -2
  41. package/dist/client/assets/{main-C0iNAqq8.css → main-BM6qmGP4.css} +1 -1
  42. package/dist/client/assets/main-U2I6YwT-.js +169 -0
  43. package/dist/client/assets/{pdf-C0dNXL7f.js → pdf-Bh3amywC.js} +2 -2
  44. package/dist/client/assets/{popover-CQHPzmuS.js → popover-DZf7p2yc.js} +2 -2
  45. package/dist/client/assets/{pptxDocument-DlyhIyQx.js → pptxDocument-Bsm1SylK.js} +2 -2
  46. package/dist/client/assets/{projectFilesQueryState-BV4ypgkS.js → projectFilesQueryState-DWDFHsif.js} +2 -2
  47. package/dist/client/assets/queries-B-YwYiCl.js +2 -0
  48. package/dist/client/assets/{scroll-area-D_qtwL2R.js → scroll-area-C5ps_bkR.js} +46 -46
  49. package/dist/client/assets/session-BKSQ__kZ.js +68 -0
  50. package/dist/client/assets/{spinner-K3N_kbJr.js → spinner-BYvweYT_.js} +2 -2
  51. package/dist/client/assets/textarea-bjEgsW0n.js +2 -0
  52. package/dist/client/assets/{toggle-Sui8J_p3.js → toggle-D4wtRT7F.js} +2 -2
  53. package/dist/client/assets/{toggle-group-BDgfPfOF.js → toggle-group-iSglhZY5.js} +2 -2
  54. package/dist/client/assets/useSettings-BgyJJ6VZ.js +5 -0
  55. package/dist/client/assets/{useWorkspaceMutationRefresh-ApasU6PB.js → useWorkspaceMutationRefresh-C-GODI1R.js} +2 -2
  56. package/dist/client/assets/utils-dD8AT1Cf.js +30 -0
  57. package/dist/client/assets/{xlsxDocument-BTR6qc2R.js → xlsxDocument-C12kQUhH.js} +2 -2
  58. package/dist/client/index.html +1 -1
  59. package/dist/service-launcher.mjs +20 -2
  60. package/dist/sharedChatWorker.mjs +21887 -0
  61. package/package.json +2 -1
  62. package/dist/client/assets/DiffPanel-BETQvwD0.js +0 -2
  63. package/dist/client/assets/PreviewPanel-D9Co2Yoo.js +0 -2
  64. package/dist/client/assets/PullRequestCodeTab-Can_YY2q.js +0 -6
  65. package/dist/client/assets/accountData-BKyjOPQm.js +0 -16
  66. package/dist/client/assets/assetUrls-BKDVxvlE.js +0 -2
  67. package/dist/client/assets/assets-B29JwqPY.js +0 -2
  68. package/dist/client/assets/clientAnalytics-D4y5ZOAM.js +0 -1
  69. package/dist/client/assets/entities-D-MTx85j.js +0 -2
  70. package/dist/client/assets/main-CZEtfXqq.js +0 -167
  71. package/dist/client/assets/queries-D_4HUuyY.js +0 -2
  72. package/dist/client/assets/session-qsdF94mu.js +0 -68
  73. package/dist/client/assets/textarea-xndIoUCV.js +0 -2
  74. package/dist/client/assets/useSettings-DD7ohMuP.js +0 -5
  75. package/dist/client/assets/utils-ClZ5OxbV.js +0 -30
@@ -1,2 +0,0 @@
1
- import{o as e,r as t}from"./rolldown-runtime-DAXXjFlN.js";import{Bd as n,Pd as r,b as i,do as a,ho as o,p as s,to as c,v as l,y as u,zd as d}from"./accountData-BKyjOPQm.js";import{$a as f,$i as p,$r as m,Ai as h,Bo as g,Br as _,Di as v,Ei as y,Eo as b,F as x,Fi as S,Fr as C,Ga as w,Gi as T,Ha as E,Hi as D,Ho as O,Hr as k,Ii as A,Ir as j,Ja as M,Ji as N,Jr as P,Kr as F,Li as ee,Lr as te,Mi as I,Mr as L,Ni as R,Nr as ne,On as re,Or as ie,Pa as ae,Pr as oe,Qa as se,Qi as ce,Qr as le,Ra as ue,Ri as de,Rr as fe,Sa as pe,Sn as me,Ti as he,Tn as ge,To as _e,Ua as ve,Ui as ye,Ur as be,Vr as xe,Wi as Se,Wr as Ce,Xi as we,Ya as Te,Yi as Ee,Zr as De,_n as Oe,_o as ke,bn as Ae,ca as z,cr as je,da as Me,dr as Ne,er as Pe,fa as Fe,ir as Ie,ji as Le,jr as Re,ki as B,la as V,li as ze,lr as Be,ma as Ve,mi as He,mn as Ue,no as We,oa as Ge,pa as Ke,pi as qe,pn as Je,qa as Ye,qr as Xe,sr as Ze,t as H,ti as Qe,to as $e,ua as et,ui as tt,ur as nt,ya as rt,za as it,zi as at,zo as ot,zr as st}from"./utils-ClZ5OxbV.js";import{$ as ct,A as lt,At as ut,Cn as dt,Ct as ft,Dn as pt,En as mt,Gt as ht,K as gt,Kt as _t,Mt as vt,Nt as yt,On as U,Ot as bt,Pt as xt,Rn as St,St as Ct,Wt as wt,Z as Tt,at as Et,bn as Dt,bt as Ot,gt as kt,i as At,it as jt,jn as W,jt as Mt,l as G,lt as Nt,ot as Pt,p as Ft,qt as It,s as Lt,st as Rt,ut as zt,vt as Bt,xt as Vt,yn as Ht,yt as Ut,zn as Wt}from"./session-qsdF94mu.js";import{qt as Gt}from"./useSettings-DD7ohMuP.js";import{t as Kt}from"./CircleNotch-BcVOnWaH.js";function qt(e){return e[e.length-1]}function Jt(e){return typeof e==`function`}function Yt(e,t){return Jt(e)?e(t):e}var Xt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;function Qt(e){for(let t in e)if(Xt.call(e,t))return!0;return!1}var $t=()=>Object.create(null),en=(e,t)=>tn(e,t,$t);function tn(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=on(e)&&on(i);if(!a&&!(rn(e)&&rn(i)))return i;let o=a?e:nn(e);if(!o)return i;let s=a?i:nn(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:Xt.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=tn(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function nn(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Zt.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!Zt.call(e,t))return!1;r.push(t)}return r}function rn(e){if(!an(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!an(n)||!n.hasOwnProperty(`isPrototypeOf`))}function an(e){return Object.prototype.toString.call(e)===`[object Object]`}function on(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sn(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!sn(e[r],t[r],n))return!1;return!0}if(rn(e)&&rn(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!sn(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!sn(e[o],t[o],n)))return!1;return i===a}return!1}function cn(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function ln(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function un(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function dn(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return un(t)}var fn=[`http:`,`https:`,`mailto:`,`tel:`];function pn(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function mn(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=dn(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=dn(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function hn(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function gn(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function _n(){throw Error(`Invariant failed`)}var K=e(u(),1),vn=K.createContext(null);function yn(e){return K.useContext(vn)}var bn=K.createContext(void 0),xn=K.createContext(void 0),Sn=g();function Cn(e,t){return e===t}function wn(e,t,n=Cn){let r=(0,K.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,K.useCallback)(()=>e?.get(),[e]);return(0,Sn.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Tn={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function En(e){let t=yn(),n=K.useContext(e.from?xn:bn),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=K.useRef(void 0);return wn(i??Tn,n=>{if((e.shouldThrow??!0)&&!n&&_n(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=tn(a.current,r);return a.current=e,e}return r})}function Dn(e){return En({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 On=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),kn=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),An=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),jn=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),Mn=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),Nn=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z`}))]]),Pn=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),Fn=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),In=Object.defineProperty,Ln=Object.defineProperties,Rn=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,Bn=Object.prototype.hasOwnProperty,Vn=Object.prototype.propertyIsEnumerable,Hn=(e,t,n)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Un=(e,t)=>{for(var n in t||={})Bn.call(t,n)&&Hn(e,n,t[n]);if(zn)for(var n of zn(t))Vn.call(t,n)&&Hn(e,n,t[n]);return e},Wn=(e,t)=>Ln(e,Rn(t)),Gn=(0,K.forwardRef)((e,t)=>K.createElement(b,Wn(Un({ref:t},e),{weights:On})));Gn.displayName=`CaretUp`;var Kn=Object.defineProperty,qn=Object.defineProperties,Jn=Object.getOwnPropertyDescriptors,Yn=Object.getOwnPropertySymbols,Xn=Object.prototype.hasOwnProperty,Zn=Object.prototype.propertyIsEnumerable,Qn=(e,t,n)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$n=(e,t)=>{for(var n in t||={})Xn.call(t,n)&&Qn(e,n,t[n]);if(Yn)for(var n of Yn(t))Zn.call(t,n)&&Qn(e,n,t[n]);return e},er=(e,t)=>qn(e,Jn(t)),tr=(0,K.forwardRef)((e,t)=>K.createElement(b,er($n({ref:t},e),{weights:kn})));tr.displayName=`Check`;var nr=Object.defineProperty,rr=Object.defineProperties,ir=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertySymbols,or=Object.prototype.hasOwnProperty,sr=Object.prototype.propertyIsEnumerable,cr=(e,t,n)=>t in e?nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lr=(e,t)=>{for(var n in t||={})or.call(t,n)&&cr(e,n,t[n]);if(ar)for(var n of ar(t))sr.call(t,n)&&cr(e,n,t[n]);return e},ur=(e,t)=>rr(e,ir(t)),dr=(0,K.forwardRef)((e,t)=>K.createElement(b,ur(lr({ref:t},e),{weights:An})));dr.displayName=`CheckCircle`;var fr=Object.defineProperty,pr=Object.defineProperties,mr=Object.getOwnPropertyDescriptors,hr=Object.getOwnPropertySymbols,gr=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,vr=(e,t,n)=>t in e?fr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yr=(e,t)=>{for(var n in t||={})gr.call(t,n)&&vr(e,n,t[n]);if(hr)for(var n of hr(t))_r.call(t,n)&&vr(e,n,t[n]);return e},br=(e,t)=>pr(e,mr(t)),xr=(0,K.forwardRef)((e,t)=>K.createElement(b,br(yr({ref:t},e),{weights:jn})));xr.displayName=`Copy`;var Sr=Object.defineProperty,Cr=Object.defineProperties,wr=Object.getOwnPropertyDescriptors,Tr=Object.getOwnPropertySymbols,Er=Object.prototype.hasOwnProperty,Dr=Object.prototype.propertyIsEnumerable,Or=(e,t,n)=>t in e?Sr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kr=(e,t)=>{for(var n in t||={})Er.call(t,n)&&Or(e,n,t[n]);if(Tr)for(var n of Tr(t))Dr.call(t,n)&&Or(e,n,t[n]);return e},Ar=(e,t)=>Cr(e,wr(t)),jr=(0,K.forwardRef)((e,t)=>K.createElement(b,Ar(kr({ref:t},e),{weights:Mn})));jr.displayName=`Info`;var Mr=Object.defineProperty,Nr=Object.defineProperties,Pr=Object.getOwnPropertyDescriptors,Fr=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable,Rr=(e,t,n)=>t in e?Mr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zr=(e,t)=>{for(var n in t||={})Ir.call(t,n)&&Rr(e,n,t[n]);if(Fr)for(var n of Fr(t))Lr.call(t,n)&&Rr(e,n,t[n]);return e},Br=(e,t)=>Nr(e,Pr(t)),Vr=(0,K.forwardRef)((e,t)=>K.createElement(b,Br(zr({ref:t},e),{weights:Nn})));Vr.displayName=`Warning`;var Hr=Object.defineProperty,Ur=Object.defineProperties,Wr=Object.getOwnPropertyDescriptors,Gr=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable,Jr=(e,t,n)=>t in e?Hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yr=(e,t)=>{for(var n in t||={})Kr.call(t,n)&&Jr(e,n,t[n]);if(Gr)for(var n of Gr(t))qr.call(t,n)&&Jr(e,n,t[n]);return e},Xr=(e,t)=>Ur(e,Wr(t)),Zr=(0,K.forwardRef)((e,t)=>K.createElement(b,Xr(Yr({ref:t},e),{weights:Pn})));Zr.displayName=`WarningCircle`;var Qr=Object.defineProperty,$r=Object.defineProperties,ei=Object.getOwnPropertyDescriptors,ti=Object.getOwnPropertySymbols,ni=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable,ii=(e,t,n)=>t in e?Qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ai=(e,t)=>{for(var n in t||={})ni.call(t,n)&&ii(e,n,t[n]);if(ti)for(var n of ti(t))ri.call(t,n)&&ii(e,n,t[n]);return e},oi=(e,t)=>$r(e,ei(t)),si=(0,K.forwardRef)((e,t)=>K.createElement(b,oi(ai({ref:t},e),{weights:Fn})));si.displayName=`X`;var q=O(),ci=K.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new D,currentIdRef:{current:null},currentContextRef:{current:null}});function li(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=K.useRef(n),a=K.useRef(n),o=K.useRef(null),s=K.useRef(null),c=ye();return(0,q.jsx)(ci.Provider,{value:K.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function ui(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=K.useContext(ci),[f,p]=K.useState(!1);return z(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),z(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:R(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,we(ae))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),z(()=>()=>{l.current=null},[l]),K.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function di(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function fi(e){return e!=null&&e.clientX!=null}function pi(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=K.useRef(!1),u=K.useRef(null),[d,f]=K.useState(),[p,m]=K.useState([]),h=V(e=>{i.set(`positionReference`,e)}),g=V((e,t,n)=>{l.current||c.current.openEvent&&!fi(c.current.openEvent)||i.set(`positionReference`,di(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=V(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=at(d)?o:a;K.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=Me(o);function r(t){let n=de(t);ee(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||fi(c.current.openEvent)?u.current=I(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),K.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),K.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),K.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=K.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return K.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}var J=l(),mi=e(ot());function hi(e){let[t,n]=K.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function gi(e){let t=et(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ke(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(he(n)!==a||he(r)!==o)&&(n=a,r=o),{width:n,height:r}}var _i=()=>!0;function vi(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=_i,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=T(t,!0,!1),d=N(),p=K.useRef(null),m=K.useRef(null),h=K.useRef(!0),g=K.useRef(f),_=V(o),v=V(s),y=K.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:se},[c,l]);z(()=>{if(!i||!a()||typeof ResizeObserver!=`function`){g.current=f,h.current=!0,p.current=null,m.current=null;return}if(!t||!n)return;g.current=bi(t,y);let e=new ResizeObserver(e=>{let t=e[0];t&&(m.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});e.observe(t),xi(t,`auto`);let r=yi(t,`position`,`static`),o=yi(t,`transform`,`none`),s=yi(t,`scale`,`1`),c=bi(n,{"--available-width":`max-content`,"--available-height":`max-content`});function l(){r(),o(),c()}function b(){l(),s()}if(_?.(),h.current||p.current===null){Si(n,`max-content`);let r=gi(t);return p.current=r,Si(n,r),b(),v?.(null,r),h.current=!1,()=>{e.disconnect(),g.current(),g.current=f}}xi(t,`auto`),Si(n,`max-content`);let x=p.current??m.current,S=gi(t);if(p.current=S,!x)return Si(n,S),b(),v?.(null,S),()=>{e.disconnect(),d.cancel(),g.current(),g.current=f};xi(t,x),b(),v?.(x,S),Si(n,S);let C=new AbortController;return d.request(()=>{xi(t,S),u(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},C.signal)}),()=>{e.disconnect(),C.abort(),d.cancel(),g.current(),g.current=f}},[r,t,n,u,d,a,i,_,v,y])}function yi(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function bi(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(yi(e,r,i));return n.length?()=>{n.forEach(e=>e())}:f}function xi(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function Si(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}function Ci(e){let{store:t,side:n,cssVars:r,children:i}=e,a=Be(),o=t.useState(`activeTriggerElement`),s=t.useState(`activeTriggerId`),c=t.useState(`open`),l=t.useState(`payload`),u=t.useState(`mounted`),d=t.useState(`popupElement`),f=t.useState(`positionerElement`),p=hi(c?o:null),m=Di(s,l),h=K.useRef(null),[g,_]=K.useState(null),[v,y]=K.useState(null),b=K.useRef(null),x=K.useRef(null),S=T(b,!0,!1),C=N(),[w,E]=K.useState(null),[D,O]=K.useState(!1);z(()=>(t.set(`hasViewport`,!0),()=>{t.set(`hasViewport`,!1)}),[t]);let k=V(()=>{b.current?.style.setProperty(`animation`,`none`),b.current?.style.setProperty(`transition`,`none`),x.current?.style.setProperty(`display`,`none`)}),A=V(e=>{b.current?.style.removeProperty(`animation`),b.current?.style.removeProperty(`transition`),x.current?.style.removeProperty(`display`),e&&E(e)}),j=K.useRef(null);z(()=>{if(o&&p&&o!==p&&j.current!==o&&h.current){_(h.current),O(!0);let e=Ei(p,o);y(e),C.request(()=>{mi.flushSync(()=>{O(!1)}),S(()=>{_(null),E(null),h.current=null})}),j.current=o}},[o,p,g,S,C]),z(()=>{let e=b.current;if(!e)return;let t=B(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));h.current=t});let M=g!=null,P;P=M?(0,q.jsxs)(K.Fragment,{children:[(0,q.jsx)(`div`,{"data-previous":!0,inert:nt(!0),ref:x,style:{...w?{[r.popupWidth]:`${w.width}px`,[r.popupHeight]:`${w.height}px`}:null,position:`absolute`},"data-ending-style":D?void 0:``},`previous`),(0,q.jsx)(`div`,{"data-current":!0,ref:b,"data-starting-style":D?``:void 0,children:i},m)]}):(0,q.jsx)(`div`,{"data-current":!0,ref:b,children:i},m),z(()=>{let e=x.current;!e||!g||e.replaceChildren(...Array.from(g.childNodes))},[g]),vi({popupElement:d,positionerElement:f,mounted:u,content:l,onMeasureLayout:k,onMeasureLayoutComplete:A,side:n,direction:a});let F={activationDirection:wi(v),transitioning:M};return{children:P,state:F}}function wi(e){if(e)return`${Ti(e.horizontal,5,`right`,`left`)} ${Ti(e.vertical,5,`down`,`up`)}`}function Ti(e,t,n,r){return e>t?n:e<-t?r:``}function Ei(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function Di(e,t){let[n,r]=K.useState(0),i=K.useRef(e),a=K.useRef(t),o=K.useRef(!1);return z(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}var Oi=yt(At),ki=ut(At),Ai=vt(ki.stateAtom);Mt({catalogValueAtom:Gt.catalogValueAtom,shellStateValueAtom:ki.stateValueAtom});var ji=U(e=>{let t=Wt(e(Gt.catalogAtom));if(d(t))return!1;for(let i of t.value.entries.keys()){if(n(e(ki.stateValueAtom(i)).snapshot))continue;let t=r(Wt(e(Gt.stateAtom(i))),()=>Ht);if(Dt(t)!==`disconnected`||t.phase===`backoff`&&t.desired&&t.attempt<=2)return!1}return!0}).pipe(W(`web-all-environment-shells-bootstrapped`));function Mi(e){return/^[a-zA-Z]:([/\\]|$)/.test(e)}function Ni(e){return e.startsWith(`\\\\`)}function Pi(e){return Ni(e)||Mi(e)}function Fi(e){return e===`.`||e===`..`||e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`.\\`)||e.startsWith(`..\\`)}function Ii(e){return e===`/`||e===`\\`||/^[a-zA-Z]:[/\\]$/.test(e)}function Li(e){if(e.length===0||Ii(e))return e;let t=e.startsWith(`/`)?e.replace(/\/+$/g,``):e.replace(/[\\/]+$/g,``);return t.length===0?e:/^[a-zA-Z]:$/.test(t)?`${t}\\`:t}function Ri(e){return Li(e.trim())}function zi(e){let t=Ri(e);return Mi(t)||Ni(t)?t.replaceAll(`/`,`\\`).toLowerCase():t}function Bi(e){return JSON.stringify([e.environmentId,e.cwd,e.relativePath])}function Vi(e){let t=wt(),n=wt(),r=mt(e=>U(null).pipe(W(`environment-data:projects:optimistic-file:${e}`))),a={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.projectId])};return{searchEntries:It(e,{label:`environment-data:projects:search-entries`,tag:i.projectsSearchEntries,staleTimeMs:15e3}),listEntries:It(e,{label:`environment-data:projects:list-entries`,tag:i.projectsListEntries,staleTimeMs:3e4,idleTtlMs:5*6e4}),readFile:It(e,{label:`environment-data:projects:read-file`,tag:i.projectsReadFile,staleTimeMs:3e4,idleTtlMs:5*6e4}),readFileMeta:It(e,{label:`environment-data:projects:read-file-meta`,tag:i.projectsReadFileMeta,staleTimeMs:2e3,refreshIntervalMs:2e3,idleTtlMs:5*6e4}),optimisticFile:e=>r(Bi(e)),create:ht(e,{label:`environment-data:commands:project:create`,execute:e=>Et(e),scheduler:t,concurrency:a}),update:ht(e,{label:`environment-data:commands:project:update`,execute:e=>Rt(e),scheduler:t,concurrency:a}),delete:ht(e,{label:`environment-data:commands:project:delete`,execute:e=>Pt(e),scheduler:t,concurrency:a}),writeFile:_t(e,{label:`environment-data:projects:write-file`,tag:i.projectsWriteFile,scheduler:n,concurrency:{mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd,t.relativePath])}})}}var Hi=Object.freeze([]),Ui=new Map;function Wi(e){let t=mt(t=>U(n=>n(e.snapshotAtom(t))?.projects??Hi).pipe(W(`environment-projects:${t}`))),n=mt(e=>U(n=>{let r=n(t(e));return r.length===0?Ui:new Map(r.map(e=>[e.id,e]))}).pipe(W(`environment-project-index:${e}`))),r=mt(e=>{let n=[];return U(r=>{let i=r(t(e)).map(t=>({environmentId:e,projectId:t.id}));return Ct(n,i)?n:(n=i,i)}).pipe(W(`environment-project-refs:${e}`))}),i=mt(e=>{let t=Ot(e),r=null,i=null;return U(e=>{let a=e(n(t.environmentId)).get(t.projectId)??null;return a===r?i:(r=a,i=a===null?null:xt(t.environmentId,a),i)}).pipe(W(`environment-project:${e}`))}),a=[],o=U(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys())n.push(...t(r(i)));return Ct(a,n)?a:(a=n,n)}).pipe(W(`environment-project-refs`)),s=[];return{environmentProjectsAtom:t,environmentProjectIndexAtom:n,environmentProjectRefsAtom:r,projectRefsAtom:o,projectsAtom:U(e=>{let t=e(o).flatMap(t=>{let n=e(i(Vt(t)));return n===null?[]:[n]});return Bt(s,t)||(s=t),s}).pipe(W(`environment-project-list`)),projectAtom:e=>i(Vt(e))}}var Gi=e=>/^win(dows)?/i.test(e);function Ki(e){return Mi(e)||Ni(e)?`windows`:e.startsWith(`/`)?`unix`:null}function qi(e){let t=Ki(e);return t===`windows`?`\\`:t===`unix`?`/`:e.includes(`\\`)?`\\`:`/`}function Ji(e){return(Ki(e)===`unix`?/\/$/:/[\\/]$/).test(e)}function Yi(e,t){return e.split(t===`/`?/\/+/:/[\\/]+/).filter(Boolean)}function Xi(e){return Ki(e)===`unix`?e.lastIndexOf(`/`):Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`))}function Zi(e){if(Mi(e)){let t=`${e.slice(0,2)}\\`;return{root:t,separator:`\\`,segments:Yi(e.slice(t.length),`\\`)}}if(Ni(e)){let[t,n,...r]=Yi(e,`\\`);return!t||!n?null:{root:`\\\\${t}\\${n}\\`,separator:`\\`,segments:r}}return e.startsWith(`/`)?{root:`/`,separator:`/`,segments:Yi(e.slice(1),`/`)}:null}function Qi(e,t=``){let n=Gi(t);return e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`.\\`)||e.startsWith(`..\\`)||e.startsWith(`/`)||e.startsWith(`~/`)||n&&Pi(e)}function $i(e,t){return Pi(e)&&!Gi(t)}function ea(e,t){let n=e.trim();if(!Fi(n)||!t)return Ri(n);let r=Zi(Ri(t));if(!r)return Ri(n);let i=[...r.segments];for(let e of n.split(/[\\/]+/))if(!(e.length===0||e===`.`)){if(e===`..`){i.pop();continue}i.push(e)}let a=i.join(r.separator);return Ri(a.length===0?r.root:`${r.root}${a}`)}function ta(e,t){let n=zi(t);if(n.length!==0)return e.find(e=>{let t=e.workspaceRoot??e.cwd;return t?zi(t)===n:!1})}function na(e){let t=Ri(e),n=Zi(t);return n?n.segments.findLast(Boolean)??t:t.split(/[/\\]/).findLast(Boolean)??t}function ra(e,t){let n=qi(e);return`${aa(e)}${t}${n}`}function ia(e){let t=Xi(e);return e.slice(t+1)}function aa(e){if(Ji(e))return e;let t=Xi(e);return t<0?e:e.slice(0,t+1)}function oa(e){let t=e.trim();return t.length===0||Ji(t)?t:`${t}${qi(t)}`}function sa(e){let t=Ri(e),n=Zi(t);if(n){if(n.segments.length===0)return null;if(n.segments.length===1)return n.root;let e=n.segments.slice(0,-1).join(n.separator);return`${n.root}${e}${n.separator}`}let r=qi(e),i=Xi(t);return i<0?null:i===2&&/^[a-zA-Z]:/.test(t)?`${t.slice(0,2)}${r}`:t.slice(0,i+1)}function ca(e){return Ji(e)&&sa(e)!==null}var la=Vi(At),ua=It(At,{label:`environment-data:projects:search-contents`,tag:i.projectsSearchContents,staleTimeMs:5e3,idleTtlMs:6e4}),da=Wi({catalogValueAtom:Gt.catalogValueAtom,snapshotAtom:Ai}),fa=class extends Error{reason;status;constructor(e,t,n=0){super(t),this.name=`ApiKeysClientError`,this.reason=e,this.status=n}},pa=e=>typeof e==`object`&&!!e&&!Array.isArray(e),ma=e=>typeof e==`string`&&e.length>0,ha=/^https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?(?:\/[A-Za-z0-9._~/-]*)?$/u,ga=e=>typeof e==`string`&&ha.test(e),_a=e=>pa(e)&&Number.isSafeInteger(e.id)&&Number(e.id)>0&&ma(e.name)&&ma(e.email),va=e=>pa(e)&&_a(e.user)&&ma(e.prefix)&&e.status===`active`&&ma(e.created_at)&&!Number.isNaN(Date.parse(e.created_at))&&typeof e.is_current_user==`boolean`,ya=e=>pa(e)&&ga(e.anthropic_base_url)&&ga(e.openai_base_url),ba=e=>{if(!pa(e)||!pa(e.organization))return!1;let t=e.organization;return Number.isSafeInteger(t.customer_id)&&Number(t.customer_id)>0&&(t.realm===`production`||t.realm===`staging`)&&typeof t.name==`string`&&Number.isSafeInteger(t.key_count)&&Number(t.key_count)>=0&&_a(e.current_user)&&Array.isArray(e.keys)&&e.keys.every(va)&&ya(e.gateway)},xa=e=>pa(e)&&va(e.key)&&ma(e.secret),Sa=e=>pa(e)&&va(e.key)&&!(`secret`in e),Ca=e=>xa(e)||Sa(e),wa=e=>/^\d+$/u.test(e)&&Number(e)>0;function Ta(e){return e===401?`authentication`:e===400||e===403||e===404?`forbidden`:e===429?`rateLimited`:`unavailable`}var Ea={authentication:`Sign in to Search Atlas again to manage API keys.`,forbidden:`This Search Atlas account cannot manage AI gateway API keys.`,rateLimited:`Too many API key requests. Try again shortly.`,malformedResponse:`Borg Cloud returned an API key response this version cannot read.`,transport:`Borg Cloud could not be reached.`,unavailable:`API key management is temporarily unavailable.`};async function Da(e){let t=Ta(e.status),n=``;try{let t=await e.json();n=pa(t)&&ma(t.detail)?t.detail:``}catch{n=``}return new fa(t,n||Ea[t],e.status)}function Oa(e){let t=e.fetch??globalThis.fetch,n=e.apiUrl.trim().replace(/\/+$/u,``),r=URL.canParse(n)&&wa(e.customerId),i=`${n}/api/v1/customers/${e.customerId}/gateway-api-keys/`;async function a(n,i,a){if(!r)throw new fa(`unavailable`,`API key management is not configured.`);let o={...await e.getCredentialHeaders(),accept:`application/json`,...i===`POST`?{"content-type":`application/json`}:{}},s;try{s=await t(n,{method:i,headers:o,cache:`no-store`,...i===`POST`?{body:`{}`}:{}})}catch{throw new fa(`transport`,Ea.transport)}if(!s.ok)throw await Da(s);if(s.status===204)return;let c;try{c=await s.json()}catch{c=void 0}if(!a(c))throw new fa(`malformedResponse`,Ea.malformedResponse,s.status);return c}let o=e=>!1;return{list:()=>a(i,`GET`,ba),create:()=>a(i,`POST`,Ca),rotate:()=>a(`${i}rotate/`,`POST`,xa),revoke:()=>a(i,`DELETE`,o).then(()=>void 0)}}async function ka(e){if(e.status!==429)return null;try{let t=await e.clone().json(),n=Number(t?.retry_after);if(t?.retry_after!=null&&Number.isFinite(n)&&n>=0)return Math.ceil(n*1e3)}catch{}let t=e.headers.get(`retry-after`)?.trim();if(!t)return null;let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n*1e3);let r=Date.parse(t);return Number.isNaN(r)?null:Math.max(0,r-Date.now())}function Y(e){if(typeof e==`number`)return Number.isSafeInteger(e)&&e!==0;if(typeof e!=`string`)return!1;let t=e.trim();if(!/^-?[0-9]+$/u.test(t))return!1;let n=Number(t);return Number.isSafeInteger(n)&&n!==0}var Aa=new Set([`pending`,`starting`,`dispatched`,`running`,`waiting_for_approval`,`waiting_for_input`]);function ja(e){return Aa.has(e)}function Ma(e){return e.threadId!==``&&e.startedAt!==null}function Na(e){return e.cancelled?`cancelled`:e.run.status===`cancelled`?`already_cancelled`:`already_finished`}var Pa=class extends Error{status;retryAfterMs;detail;constructor(e,t=null,n=null){super(n??`Borg loops request failed (${e}).`),this.name=`BorgLoopsClientError`,this.status=e,this.retryAfterMs=t,this.detail=n}};async function Fa(e){try{let t=await e.clone().json();return typeof t?.detail==`string`&&t.detail.trim()?t.detail.trim():null}catch{return null}}function Ia(e){return{kind:e?.kind??`daily`,time:e?.time??``,timezone:e?.timezone||`UTC`,days:e?.days??[],interval:e?.interval??null,custom:e?.custom??null}}function La(e){return{id:String(e.id??``),loopId:String(e.loopId??``),scheduledFor:e.scheduledFor??``,status:e.status??`pending`,environmentId:e.environmentId??``,threadId:e.threadId??``,summary:e.summary??``,startedAt:e.startedAt??null,finishedAt:e.finishedAt??null,createdAt:e.createdAt??``}}function Ra(e){return{id:String(e.id??``),borgId:String(e.borgId??``),title:e.title??``,prompt:e.prompt??``,schedule:Ia(e.schedule),status:e.status??`active`,projectId:e.projectId??null,nextRunAt:e.nextRunAt??null,lastRun:e.lastRun?La(e.lastRun):null,activeRun:e.activeRun?La(e.activeRun):null,isOwner:e.isOwner??!1,archivedAt:e.archivedAt??null,createdAt:e.createdAt??``,updatedAt:e.updatedAt??e.createdAt??``}}function za(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function Ba(e){if(!Y(e.customerId))throw new Pa(400);let t=e.fetch??globalThis.fetch,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}`,r=`${n}/loops`,i=`${n}/borgs`,a=()=>e.getCredentialHeaders(),o=async()=>({...await a(),"content-type":`application/json`}),s=async(e,n)=>{let r=await t(e,n);if(!r.ok)throw new Pa(r.status,await ka(r),await Fa(r));return r},c=async(e,t)=>await(await s(e,t)).json();return{list:async(e={})=>{let t=new URLSearchParams;e.borgId&&t.set(`borgId`,e.borgId),e.includeArchived&&t.set(`includeArchived`,`1`);let n=t.toString();return((await c(`${r}/${n?`?${n}`:``}`,{method:`GET`,headers:await a()})).loops??[]).map(Ra)},read:async e=>Ra(await c(`${r}/${encodeURIComponent(e)}/`,{method:`GET`,headers:await a()})),create:async(e,t)=>Ra(await c(`${r}/`,{method:`POST`,headers:await o(),body:JSON.stringify(za(e)),...t?{signal:t}:{}})),update:async(e,t)=>Ra(await c(`${r}/${encodeURIComponent(e)}/`,{method:`PATCH`,headers:await o(),body:JSON.stringify(za(t))})),setArchived:async(e,t)=>Ra(await c(`${r}/${encodeURIComponent(e)}/${t?`archive`:`restore`}/`,{method:`POST`,headers:await a()})),runNow:async e=>{let t=await s(`${r}/${encodeURIComponent(e)}/run-now/`,{method:`POST`,headers:await a()}),n=await t.json();return{run:La(n.run??{}),created:n.created??t.status===201}},listRuns:async(e,t={})=>{let n=t.limit?`?limit=${t.limit}`:``;return((await c(`${r}/${encodeURIComponent(e)}/runs/${n}`,{method:`GET`,headers:await a()})).runs??[]).map(La)},cancelRun:async(e,t)=>{let n=await c(`${i}/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/cancel/`,{method:`POST`,headers:await a()});return{run:La(n.run??{}),cancelled:n.cancelled===!0}}}}var Va=class extends Error{status;retryAfterMs;rejectedFields;constructor(e,t=null,n=[]){super(`Borg profiles request failed (${e}).`),this.name=`BorgProfilesClientError`,this.status=e,this.retryAfterMs=t,this.rejectedFields=n}};async function Ha(e){if(e.status!==400)return[];try{let t=await e.clone().json();return typeof t!=`object`||!t||Array.isArray(t)?[]:Object.keys(t).filter(e=>e!==`detail`&&e!==`non_field_errors`)}catch{return[]}}var Ua={shape:`pebble`,tone:`plum`,face:`light`};function Wa(e){return{id:e.id,tier:e.tier??`user`,isOwner:e.isOwner??!1,ownerName:e.ownerName??``,name:e.name,role:e.role??``,description:e.description??``,instructions:e.instructions??``,avatar:e.avatar??Ua,model:e.model??``,projectId:e.projectId??null,canMakeChanges:e.canMakeChanges??!1,memoryEnabled:e.memoryEnabled??!0,skillIds:e.skillIds??[],archivedAt:e.archivedAt??null,createdAt:e.createdAt??``,updatedAt:e.updatedAt??e.createdAt??``}}function Ga(e){return{id:e.id,borgId:e.borgId??null,threadId:e.threadId??null,environmentId:e.environmentId??null,sessionId:e.sessionId??null,createdAt:e.createdAt??``,updatedAt:e.updatedAt??e.createdAt??``}}function Ka(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function qa(e){if(!Y(e.customerId))throw new Va(400);let t=e.fetch??globalThis.fetch,n=e.apiUrl.replace(/\/$/,``),r=`${n}/api/v1/customers/${e.customerId}/borgs`,i=`${n}/api/v1/customers/${e.customerId}/borg-homes/`,a=()=>e.getCredentialHeaders(),o=async(e,n)=>{let r=await t(e,n);if(!r.ok)throw new Va(r.status,await ka(r),await Ha(r));return Wa(await r.json())};return{list:async(e={})=>{let n=e.includeArchived?`?includeArchived=1`:``,i=await t(`${r}/${n}`,{method:`GET`,headers:await a()});if(!i.ok)throw new Va(i.status,await ka(i));return((await i.json()).borgs??[]).map(Wa)},read:async(e,t)=>o(`${r}/${encodeURIComponent(e)}/`,{method:`GET`,headers:await a(),...t?{signal:t}:{}}),create:async(e,t)=>o(`${r}/`,{method:`POST`,headers:{...await a(),"content-type":`application/json`},body:JSON.stringify(Ka(e)),...t?{signal:t}:{}}),update:async(e,t,n)=>o(`${r}/${encodeURIComponent(e)}/`,{method:`PATCH`,headers:{...await a(),"content-type":`application/json`},body:JSON.stringify(Ka(t)),...n?{signal:n}:{}}),attachedSkills:async(e,n)=>{let i=await t(`${r}/${encodeURIComponent(e)}/skills/`,{method:`GET`,headers:await a(),...n?{signal:n}:{}});if(!i.ok)throw new Va(i.status,await ka(i));return(await i.json()).skills??[]},setArchived:async(e,t)=>o(`${r}/${encodeURIComponent(e)}/${t?`archive`:`restore`}/`,{method:`POST`,headers:await a()}),homes:async e=>{let n=await t(i,{method:`GET`,headers:await a(),...e?{signal:e}:{}});if(!n.ok)throw new Va(n.status,await ka(n));return((await n.json()).homes??[]).map(Ga)},claimHome:async(e,n)=>{let r=await t(i,{method:`POST`,headers:{...await a(),"content-type":`application/json`},body:JSON.stringify({borgId:e.borgId,threadId:e.threadId,environmentId:e.environmentId}),...n?{signal:n}:{}});if(!r.ok)throw new Va(r.status,await ka(r));return{home:Ga(await r.json()),created:r.status===201}}}}var Ja=class extends Error{status;code;constructor(e,t=null,n){super(n??`Shared chat request failed (${e}).`),this.name=`ConversationSharesClientError`,this.status=e,this.code=t}};async function Ya(e){let t=await e.json().catch(()=>null);return new Ja(e.status,typeof t?.code==`string`?t.code:null,typeof t?.detail==`string`?t.detail:void 0)}function Xa(e){return e.snapshotAt===void 0?{...e,snapshotAt:e.createdAt}:e}function Za(e){let t=Xa(e);return t.myFork===void 0?{...t,myFork:null}:t}function Qa(e){let t=e.fetch??globalThis.fetch,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1`,r=e=>`${n}/conversation-shares/${encodeURIComponent(e)}`,i=()=>{if(e.customerId===void 0||!Y(e.customerId))throw new Ja(400);return`${n}/customers/${e.customerId}/conversation-shares/`},a=async(n,r={})=>{let i=await t(n,{...r,headers:{...await e.getCredentialHeaders(),...r.headers}});if(!i.ok)throw await Ya(i);return await i.json()},o=(e,t)=>({method:e,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),s=(e,t,n)=>{let r={...t,artifacts:n.map(({kind:e,ref:t})=>({kind:e,ref:t}))};if(!n.some(e=>e.content!==void 0))return a(e,o(`POST`,r)).then(Za);let i=new FormData;return i.append(`share`,new Blob([JSON.stringify(r)],{type:`application/json`}),`share.json`),n.forEach((e,t)=>{e.content!==void 0&&i.append(`artifact-${t}`,e.content)}),a(e,{method:`POST`,body:i}).then(Za)};return{create:async e=>s(i(),{threadId:e.threadId,...e.title===void 0?{}:{title:e.title},...e.latestMessageId===void 0?{}:{latestMessageId:e.latestMessageId},...e.recipients===void 0?{}:{recipients:e.recipients}},e.artifacts??[]),refresh:async(e,t={})=>s(`${r(e)}/refresh/`,{},t.artifacts??[]),listMine:async e=>{let t=e?`?threadId=${encodeURIComponent(e)}`:``;return(await a(`${i()}${t}`)).shares.map(Xa)},received:async()=>(await a(`${n}/conversation-shares/received/`)).shares.map(Xa),read:async e=>Za(await a(`${r(e)}/`)),readOwnThreadSnapshot:t=>{if(e.customerId===void 0||!Y(e.customerId))throw new Ja(400);return a(`${n}/customers/${e.customerId}/threads/${encodeURIComponent(t)}/snapshot/`)},downloadArtifact:async(n,i)=>{let a=await t(`${r(n)}/artifacts/${encodeURIComponent(i)}/`,{headers:await e.getCredentialHeaders()});if(!a.ok)throw await Ya(a);return new Uint8Array(await a.arrayBuffer())},continue:async(e,t)=>{let n=await a(`${r(e)}/forks/`,o(`POST`,{threadId:t}));return{...n,share:Za(n.share)}},addRecipients:async(e,t)=>Xa(await a(`${r(e)}/recipients/`,o(`POST`,t))),removeRecipient:async(e,t)=>Xa(await a(`${r(e)}/recipients/${encodeURIComponent(t)}/`,{method:`DELETE`})),revoke:async e=>Xa(await a(`${r(e)}/revoke/`,{method:`POST`}))}}var $a=(e,t)=>{let n=e.agent===`code`?t.permissions?.mcpTools??[]:t.mcpTools;return[...new Set(n.filter(e=>e.trim().length>0))]},eo=e=>{let t=e.split(`:`);if(t.length!==3)return null;let[n,r,i]=t;return n!==`mcp`&&n!==`connector`||!r||!i?null:{kind:n,owner:r,operation:i}},to=(e,t={})=>{let n=eo(e);if(!n)return e;let{kind:r,owner:i,operation:a}=n;if(r===`mcp`){let n=t.mcpServers?.get(i),r=t.mcpOperations?.get(`${i}:${a}`);return!n&&!r?e:`${n??i} · ${r??a}`}let o=t.connectorApps?.get(i);return o?`${o} · ${a}`:e},no=(e,t,n={})=>$a(e,t).map(e=>({identity:e,label:to(e,n)})),ro=`Runs use these tools on their own, without asking you first.`,io=e=>e.length===0?``:`It will use ${e.length===1?`this tool`:`these ${e.length} tools`} without asking you first: ${e.map(e=>e.label).join(`, `)}.`,ao=`Runs may use the tools its playbook declares without asking you first.`,oo=(e,t,n={})=>t?io(no(e,t,n)):ao,so=new Set([`pending`,`starting`,`dispatched`,`running`,`waiting_for_approval`,`waiting_for_input`]),co=e=>so.has(e),lo=e=>{switch(e){case`no_report`:return`The agent did not report on the success criteria. Review the session before confirming.`;case`criteria_not_met`:return`The agent reported that a success criterion was not met.`;case`history_unavailable`:return`The run's history did not reach Borg Cloud.`;case`owner_unavailable`:return`The task's owner can no longer run work in this account.`;case`undeclared_tool_in_steps`:return`The playbook names a tool the task does not declare, so the run did not start. Ask Borg to fix the playbook; each run fails this way until it is fixed.`;default:return e}},uo=e=>{let t=Array.isArray(e)?e:typeof e==`object`&&e&&`deliveries`in e&&Array.isArray(e.deliveries)?e.deliveries:void 0;if(!t)throw new fo(502,`The delivery list is malformed.`);return t},fo=class extends Error{status;constructor(e,t){super(t&&e===400?t:t?`Scheduled tasks request failed (${e}): ${t}`:`Scheduled tasks request failed (${e}).`),this.name=`ScheduledTasksClientError`,this.status=e}},po=e=>typeof e==`string`?[e]:Array.isArray(e)?e.flatMap(po):typeof e==`object`&&e?Object.values(e).flatMap(po):[],mo=async e=>{if(e.status<400||e.status>=500)return;let t=po(await e.json().catch(()=>void 0)).join(` `).trim();return t?t.slice(0,1e3):void 0};function ho(e){if(!Y(e.customerId))throw new fo(400);let t=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}/scheduled-tasks`,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}/scheduled-task-runs`,r=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}/scheduled-task-deliveries`,i=e.fetch??globalThis.fetch,a=async(n,r=`GET`,a,o)=>{let s=await i(`${t}${n}`,{method:r,headers:{...await e.getCredentialHeaders(),...a===void 0?{}:{"content-type":`application/json`},...o?{"x-borg-runtime-device":o}:{}},...a===void 0?{}:{body:JSON.stringify(a)}});if(!s.ok)throw new fo(s.status,await mo(s));return s.json()},o=async(t,n,r=`GET`,a)=>{let o=await i(t,{method:r,headers:{...await e.getCredentialHeaders(),...a===void 0?{}:{"content-type":`application/json`},"x-borg-runtime-device":n},...a===void 0?{}:{body:JSON.stringify(a)}});if(!o.ok)throw new fo(o.status);return o.json()};return{list:async(e={})=>{let t=new URLSearchParams;return e.originThreadId&&t.set(`originThreadId`,e.originThreadId),e.borgId&&t.set(`borgId`,e.borgId),e.includeArchived&&t.set(`includeArchived`,`1`),a(`/${t.size?`?${t}`:``}`)},read:e=>a(`/${encodeURIComponent(e)}/`),create:(e,t)=>a(`/`,`POST`,e,t),update:(e,t)=>a(`/${encodeURIComponent(e)}/`,`PATCH`,t),setArchived:(e,t)=>a(`/${encodeURIComponent(e)}/${t?`archive`:`restore`}/`,`POST`),runNow:e=>a(`/${encodeURIComponent(e)}/run-now/`,`POST`),listRuns:e=>a(`/${encodeURIComponent(e)}/runs/`),listRevisions:e=>a(`/${encodeURIComponent(e)}/revisions/`),restoreRevision:(e,t)=>a(`/${encodeURIComponent(e)}/revisions/${t}/restore/`,`POST`),rejectRun:(e,t)=>a(`/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/reject/`,`POST`),cancelRun:(e,t)=>a(`/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/cancel/`,`POST`),confirmRunSuccess:(e,t)=>a(`/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/confirm-success/`,`POST`),listPendingDeliveries:async e=>uo(await o(`${r}/pending/`,e)),ackDelivery:(e,t,n)=>o(`${r}/${encodeURIComponent(e)}/ack/`,n,`POST`,{result:t}).then(()=>void 0),listLocalClaims:e=>o(`${n}/claimable/`,e),claimLocalRun:(e,t)=>o(`${n}/${encodeURIComponent(e)}/claim/`,t,`POST`)}}var go=class extends Error{reason;status;code;constructor(e,t,n=0,r=``){super(t),this.name=`SecretsClientError`,this.reason=e,this.status=n,this.code=r}},_o=e=>typeof e==`object`&&!!e&&!Array.isArray(e),vo=e=>typeof e==`string`&&!Number.isNaN(Date.parse(e)),yo=e=>_o(e)&&typeof e.name==`string`&&e.name.length>0&&vo(e.createdAt)&&vo(e.updatedAt),bo=e=>_o(e)&&typeof e.available==`boolean`&&Number.isSafeInteger(e.limit)&&Array.isArray(e.secrets)&&e.secrets.every(yo),xo=e=>/^\d+$/u.test(e)&&Number(e)>0;function So(e){return e===401||e===403?`authentication`:e===400?`invalid`:e===404?`notFound`:e===429?`rateLimited`:`unavailable`}var Co={authentication:`Sign in to Search Atlas again to manage your secrets.`,invalid:`Borg Cloud could not save that secret.`,notFound:`That secret no longer exists.`,unavailable:`Secrets are temporarily unavailable.`,rateLimited:`Too many requests. Try again shortly.`,malformedResponse:`Borg Cloud returned a response this version cannot read.`,transport:`Borg Cloud could not be reached.`};async function wo(e){let t=So(e.status),n=``,r=``;try{let t=await e.json();_o(t)&&(n=typeof t.detail==`string`?t.detail:``,r=typeof t.code==`string`?t.code:``)}catch{}return new go(t,n||Co[t],e.status,r)}function To(e){let t=e.fetch??globalThis.fetch,n=e.apiUrl.trim().replace(/\/+$/u,``),r=URL.canParse(n)&&xo(e.customerId),i=`${n}/api/v1/customers/${e.customerId}/secrets/`;async function a(n,i,a){if(!r)throw new go(`unavailable`,Co.unavailable);let o={...await e.getCredentialHeaders(),accept:`application/json`,...i.body===void 0?{}:{"content-type":`application/json`}},s;try{s=await t(n,{...i,headers:o,cache:`no-store`})}catch{throw new go(`transport`,Co.transport)}if(!s.ok)throw await wo(s);if(s.status===204)return;let c;try{c=await s.json()}catch{c=void 0}if(!a(c))throw new go(`malformedResponse`,Co.malformedResponse,s.status);return c}let o=e=>!1,s=e=>`${i}${encodeURIComponent(e)}/`;return{list:()=>a(i,{method:`GET`},bo),set:(e,t)=>a(s(e),{method:`PUT`,body:JSON.stringify({value:t})},yo),remove:e=>a(s(e),{method:`DELETE`},o).then(()=>void 0)}}var Eo=200,Do=class extends Error{status;retryAfterMs;constructor(e,t=null){super(`Import request failed (${e}).`),this.name=`ImportJobsClientError`,this.status=e,this.retryAfterMs=t}};function Oo(e){return{id:e.id,status:e.status??``,apps:e.apps??[],selection:e.selection??{},deviceId:e.deviceId??``,deviceName:e.deviceName??``,memoryStatus:e.memoryStatus??``,memoryProgress:e.memoryProgress??{sorted:0,total:0},hooksStatus:e.hooksStatus??``,hooksProgress:e.hooksProgress??{done:0,total:0},counts:e.counts??{},createdAt:e.createdAt??``,updatedAt:e.updatedAt??e.createdAt??``,finishedAt:e.finishedAt??null}}function ko(e){return{id:e.id,jobId:e.jobId??``,category:e.category??``,sourceApp:e.sourceApp??``,sourceKey:e.sourceKey??``,contentHash:e.contentHash??``,status:e.status??``,reason:e.reason??``,title:e.title??``,targetRef:e.targetRef??``,createdAt:e.createdAt??``,updatedAt:e.updatedAt??e.createdAt??``}}function Ao(e){return e===null?null:{endpoint:String(e.endpoint),bucket:String(e.bucket),blobPrefix:String(e.blob_prefix),manifestPrefix:String(e.manifest_prefix),token:String(e.token),expiresAt:String(e.expires_at),emulated:e.emulated===!0}}function jo(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function Mo(e){if(!Y(e.customerId))throw new Do(400);let t=e.fetch??globalThis.fetch,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}/imports`,r=()=>e.getCredentialHeaders(),i=async(e,n)=>{let r=await t(e,n);if(!r.ok)throw new Do(r.status,await ka(r));return await r.json()},a=async(e,t,n)=>i(e,{method:t,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify(n)}),o=e=>`${n}/${encodeURIComponent(e)}/`;return{listJobs:async(e={})=>{let t=new URLSearchParams;e.status&&e.status.length>0&&t.set(`status`,e.status.join(`,`)),e.deviceId&&t.set(`deviceId`,e.deviceId);let a=t.size>0?`?${t.toString()}`:``;return((await i(`${n}/${a}`,{method:`GET`,headers:await r()})).jobs??[]).map(Oo)},createJob:async e=>Oo(await a(`${n}/`,`POST`,jo(e))),getJob:async e=>{let t=await i(o(e),{method:`GET`,headers:await r()});return{job:Oo(t.job),items:(t.items??[]).map(ko)}},updateJob:async(e,t)=>Oo(await a(o(e),`PATCH`,jo(t))),recordItems:async(e,t)=>{let n=[],r=0,i=0,s=0;for(let c=0;c<t.length;c+=Eo){let l=t.slice(c,c+Eo).map(jo),u=await a(`${o(e)}items/`,`POST`,{items:l});n.push(...(u.items??[]).map(ko)),r+=u.created??0,i+=u.existing??0,s+=u.updated??0}return{items:n,created:r,existing:i,updated:s}},stageSkill:async(e,t)=>{let n=await a(`${o(e)}skills/`,`POST`,t);return{grant:Ao(n.grant),uploads:n.uploads??[]}},commitSkill:async(e,t)=>({skillId:(await a(`${o(e)}skills/commit/`,`POST`,t)).skillId}),stageMemory:async(e,t)=>{let n=await a(`${o(e)}memory/stage/`,`POST`,{files:t});return{grant:Ao(n.grant),uploads:n.uploads??[]}},stageHooks:async(e,t)=>{let n=await a(`${o(e)}hooks/stage/`,`POST`,{files:t});return{grant:Ao(n.grant),uploads:n.uploads??[]}},hookDrafts:async e=>{let t=await i(`${o(e)}hooks/`,{method:`GET`,headers:await r()});return{hooksStatus:t.hooksStatus??``,progress:t.progress??{done:0,total:0},hooks:t.hooks??[]}},saveHookDraft:async(e,t)=>(await a(`${o(e)}hooks/${encodeURIComponent(t)}/save/`,`POST`,{})).hook,discardHookDraft:async(e,t)=>(await a(`${o(e)}hooks/${encodeURIComponent(t)}/discard/`,`POST`,{})).hook,memoryNotes:async e=>{let t=await i(`${o(e)}memory/`,{method:`GET`,headers:await r()});return{memoryStatus:t.memoryStatus??``,progress:t.progress??{sorted:0,total:0},notes:t.notes??[]}},moveMemoryNote:async(e,t,n)=>(await a(`${o(e)}memory/${encodeURIComponent(t)}/move/`,`POST`,{to:n})).note,connectorMappings:async()=>(await i(`${n}/connector-mappings/`,{method:`GET`,headers:await r()})).mappings??[],lastImportPerApp:async()=>{let e=await i(`${n}/apps/`,{method:`GET`,headers:await r()});return{claude:e.apps?.claude??null,codex:e.apps?.codex??null,antigravity:e.apps?.antigravity??null}}}}function No(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function Po(e,...t){if(!No(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function Fo(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Io(e,t){Po(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function Lo(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ro(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function zo(e,t){return e<<32-t|e>>>t}function Bo(e,t){return e<<t|e>>>32-t>>>0}var Vo=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Ho=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Uo(e){if(Po(e),Vo)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Ho[e[n]];return t}function Wo(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function Go(e){return typeof e==`string`&&(e=Wo(e)),Po(e),e}function Ko(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];Po(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}var qo=class{};function Jo(e){let t=t=>e().update(Go(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Yo(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function Xo(e,t,n){return e&t^~e&n}function Zo(e,t,n){return e&t^e&n^t&n}var Qo=class extends qo{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=Ro(this.buffer)}update(e){Fo(this),e=Go(e),Po(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=Ro(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Fo(this),Io(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,Lo(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Yo(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Ro(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},$o=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),es=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),ts=new Uint32Array(80),ns=class extends Qo{constructor(){super(64,20,8,!1),this.A=es[0]|0,this.B=es[1]|0,this.C=es[2]|0,this.D=es[3]|0,this.E=es[4]|0}get(){let{A:e,B:t,C:n,D:r,E:i}=this;return[e,t,n,r,i]}set(e,t,n,r,i){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0}process(e,t){for(let n=0;n<16;n++,t+=4)ts[n]=e.getUint32(t,!1);for(let e=16;e<80;e++)ts[e]=Bo(ts[e-3]^ts[e-8]^ts[e-14]^ts[e-16],1);let{A:n,B:r,C:i,D:a,E:o}=this;for(let e=0;e<80;e++){let t,s;e<20?(t=Xo(r,i,a),s=1518500249):e<40?(t=r^i^a,s=1859775393):e<60?(t=Zo(r,i,a),s=2400959708):(t=r^i^a,s=3395469782);let c=Bo(n,5)+t+o+s+ts[e]|0;o=a,a=i,i=Bo(r,30),r=n,n=c}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,this.set(n,r,i,a,o)}roundClean(){Lo(ts)}destroy(){this.set(0,0,0,0,0),Lo(this.buffer)}},rs=Jo(()=>new ns),is=new Uint8Array([159,184,118,104,235,93,76,228,152,124,197,11,162,33,181,47]);function as(e){let t=rs(Ko(is,Wo(e))).slice(0,16);t[6]=t[6]&15|80,t[8]=t[8]&63|128;let n=Uo(t);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var os=class extends Error{status;permanent;constructor(e){super(`Borg Cloud memory request failed (${e}).`),this.name=`MemoryClientError`,this.status=e,this.permanent=e>=400&&e<500&&e!==408&&e!==429}},ss={session:`session`,user:`user`,borg:`borg`,project:`project`,workspace:`project`,team:`team`,customer:`team`};function cs(e){let t=e.scope??`workspace`,n=ss[String(e.layer??``)]??ss[t]??`project`;return{id:String(e.id??``),scope:t,kind:e.kind??`fact`,layer:n,projectId:e.project_id==null?null:String(e.project_id),borgId:e.borg_id==null?null:String(e.borg_id),sessionId:e.session_id==null?null:String(e.session_id),content:String(e.content??``),tags:Array.isArray(e.tags)?e.tags:[],status:e.status||`active`,...e.origin?{origin:String(e.origin)}:{},score:Number(e.score??0),version:Number(e.version??0),workspaceId:e.workspace_id==null?null:String(e.workspace_id),createdAt:String(e.created_at??``),updatedAt:String(e.updated_at??``)}}function ls(e){if(!Y(e.customerId))throw new os(400);let t=e.fetch??globalThis.fetch,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}`,r=()=>e.getCredentialHeaders(),i=async(e,r)=>{let i=await t(`${n}${e}`,r);if(!i.ok)throw new os(i.status);return i},a=async e=>{let t=await e.json();return t.enabled===!1?[]:(t.results??[]).map(cs)};return{recall:async e=>{let t=new URLSearchParams({q:e.query});e.workspaceId&&t.set(`workspace_id`,e.workspaceId),e.borgId&&t.set(`borg_id`,e.borgId),e.limit&&t.set(`limit`,String(e.limit)),e.sessionId&&t.set(`session_id`,e.sessionId),e.projectId&&t.set(`project_id`,e.projectId),e.layer&&t.append(`layers`,e.layer);for(let n of e.kinds??[])t.append(`kinds`,n);let n=await i(`/memories/recall/?${t.toString()}`,{method:`GET`,headers:await r(),...e.signal?{signal:e.signal}:{}});return a(n)},reportInjected:async e=>{await i(`/memories/injected/`,{method:`POST`,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify({memory_ids:e.memoryIds,...e.sessionId?{session_id:e.sessionId}:{}}),...e.signal?{signal:e.signal}:{}})},list:async(e={})=>{let t=new URLSearchParams;e.workspaceId&&t.set(`workspace_id`,e.workspaceId),e.borgId&&t.set(`borg_id`,e.borgId),e.limit&&t.set(`limit`,String(e.limit));let n=t.toString(),o=await i(`/memories/${n?`?${n}`:``}`,{method:`GET`,headers:await r()});return a(o)},save:async e=>{let t=await(await i(`/memories/`,{method:`POST`,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify({client_ref:e.clientRef,content:e.content,scope:e.scope,kind:e.kind,...e.workspaceId?{workspace_id:e.workspaceId}:{},...e.tags?{tags:e.tags}:{},...e.sessionId?{session_id:e.sessionId}:{},...e.borgId?{borg_id:e.borgId}:{},...e.projectId?{project_id:e.projectId}:{},...e.layer?{layer:e.layer}:{},...e.confirmed===void 0?{}:{confirmed:e.confirmed},...e.replaces&&e.replaces.length>0?{replaces:e.replaces}:{}})})).json();if(t.enabled!==!1)return cs(t)},update:async(e,t)=>cs(await(await i(`/memories/${e}/`,{method:`PATCH`,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify({content:t})})).json()),forget:async e=>{try{await i(`/memories/${e}/`,{method:`DELETE`,headers:await r()})}catch(e){if(e instanceof os&&e.status===404)return;throw e}},setStatus:async(e,t)=>{await i(`/memories/${e}/`,{method:`PATCH`,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify({status:t})})},workspaceIdForProject:t=>as(`organization:${e.customerId}:project:${t}`)}}var us=class extends Error{status;constructor(e){super(`Borg Cloud project request failed (${e}).`),this.name=`CloudProjectClientError`,this.status=e}};function ds(e){if(!Y(e.customerId))throw new us(400);let t=e.fetch??globalThis.fetch,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}/projects`,r=async(e,r)=>{let i=await t(`${n}${e}`,r);if(!i.ok)throw new us(i.status);return i},i=async(e,t)=>(await r(e,t)).json(),a=async()=>e.getCredentialHeaders();return{list:async()=>(await r(`/`,{method:`GET`,headers:await a()})).json(),resolve:async e=>i(`/resolve/`,{method:`POST`,headers:{...await a(),"content-type":`application/json`},body:JSON.stringify({name:e.name,canonical_key:e.canonicalKey,canonical_url:e.canonicalUrl??``})}),get:async e=>i(`/${e}/`,{method:`GET`,headers:await a()}),archive:async e=>i(`/${e}/archive/`,{method:`POST`,headers:await a()})}}var fs=e=>e.kind===`jwt`?{authorization:`Bearer ${e.token}`}:{"x-api-key":e.key},ps=class extends Error{status;permanent;detail;timedOut;constructor(e,t=``,n={}){super(t||`Borg Cloud MCP request failed (${e}).`),this.name=`McpServerClientError`,this.status=e,this.detail=t,this.timedOut=n.timedOut===!0,this.permanent=e>=400&&e<500&&e!==408&&e!==429}},ms=6e4,hs=e=>e instanceof DOMException&&e.name===`TimeoutError`;function X(e){return{id:String(e.id??``),displayName:String(e.display_name??``),serverUrl:String(e.server_url??``),connectionId:String(e.connection_id??``),enabled:e.enabled!==!1,health:e.health??`pending`,toolsCount:Number(e.tools_count??0),isFirstParty:e.is_first_party===!0,scope:e.scope===`personal`?`personal`:`organization`,ownerName:String(e.owner_name??``)}}function gs(e){return{name:String(e.name??``),label:String(e.label??``),required:e.required!==!1,secret:e.secret===!0,helpText:String(e.help_text??``)}}function _s(e,t){return{id:``,displayName:e,serverUrl:t,connectionId:``,enabled:!0,health:`pending`,toolsCount:0,isFirstParty:!1,scope:`personal`,ownerName:``}}var vs=e=>e===`connected`||e===`attention`||e===`disconnected`;function ys(e){return{slug:String(e.slug??``),name:String(e.name??``),category:String(e.category??``),description:String(e.description??``),logo:String(e.logo??``),icon:String(e.icon??``),mono:String(e.mono??``),background:String(e.background??``),status:vs(e.status)?e.status:`disconnected`,note:String(e.note??``),accountId:String(e.account_id??e.accountId??``),...xs(e),accounts:bs(e)}}function bs(e){return(Array.isArray(e.connections)?e.connections:[]).flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,n=String(t.account_id??t.accountId??``);return n.length===0?[]:[{id:n,label:String(t.label??``),scope:t.scope===`personal`?`personal`:`organization`,ownerEmail:String(t.owner_email??t.ownerEmail??``),mine:t.mine===!0,status:t.status===`connected`?`connected`:`attention`,note:String(t.note??``),isDefault:(t.is_default??t.isDefault)===!0,enabled:t.enabled!==!1}]})}function xs(e){let t=Array.isArray(e.connections)?e.connections:[];for(let n of t){if(typeof n!=`object`||!n)continue;let t=n;if(String(t.account_id??t.accountId??``)===String(e.account_id??e.accountId??``))return{scope:t.scope===`personal`?`personal`:`organization`,ownerEmail:String(t.owner_email??t.ownerEmail??``)}}return{scope:`organization`,ownerEmail:``}}function Ss(e){if(!Y(e.customerId))throw new ps(400);let t=e.fetch??globalThis.fetch,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}`,r=()=>e.getCredentialHeaders(),i=async(e,r,i)=>{let a;try{a=await t(`${n}${e}`,{...r,...i===null?{}:{signal:AbortSignal.timeout(i)}})}catch(e){throw new ps(hs(e)?504:502,hs(e)?`Borg Cloud did not respond within ${i}ms.`:`Borg Cloud could not be reached.`,{timedOut:hs(e)})}if(!a.ok){let e=``;try{let t=await a.json();e=typeof t?.detail==`string`?t.detail:``}catch{e=``}throw new ps(a.status,e)}return a.status===204?{}:a.json()},a=async(e,t,n)=>i(e,{method:t,headers:{...await r(),"content-type":`application/json`},...n===void 0?{}:{body:JSON.stringify(n)}},null),o=async e=>i(e,{headers:await r()},ms),s=async(e,t,n,r)=>{await a(`/mcp-servers/${e}/tools/${encodeURIComponent(t)}/`,`PUT`,{permission:n,scope:r})};return{list:async()=>((await o(`/mcp-servers/`)).servers??[]).map(X),recordToolApproval:async e=>{let t=await a(`/tool-approvals/`,`POST`,{...e.serverId?{serverId:e.serverId}:{app:e.app},operationId:e.operationId}),n=typeof t.approvalId==`string`?t.approvalId:``;return n?(await a(`/tool-approvals/${encodeURIComponent(n)}/resolve/`,`POST`,{decision:`once`}),n):``},runTool:async e=>{let t=await a(`/tools/run/`,`POST`,{...e.serverId?{serverId:e.serverId}:{app:e.app},operationId:e.operationId,args:e.args,...e.connectionId?{connectionId:e.connectionId}:{},...e.account?{account:e.account}:{},...e.toolCallId?{toolCallId:e.toolCallId}:{},...e.runId?{runId:e.runId}:{},...e.turnId?{turnId:e.turnId}:{},...e.approvalId?{approvalId:e.approvalId}:{}});return t?.requires_confirmation===!0?{status:`needs_approval`,card:t.hitl}:{status:`ok`,result:t}},recordConnection:async e=>X(await a(`/mcp-servers/`,`POST`,{connection_id:e.connectionId,server_url:e.serverUrl,...e.displayName?{display_name:e.displayName}:{},...e.toolsCount===void 0?{}:{tools_count:e.toolsCount},...e.isFirstParty===void 0?{}:{is_first_party:e.isFirstParty}})),register:async e=>{let t=await a(`/mcp-servers/`,`POST`,{server_url:e.serverUrl,...e.displayName?{display_name:e.displayName}:{},...e.oauthClientId?{oauth_client_id:e.oauthClientId}:{},...e.oauthClientSecret?{oauth_client_secret:e.oauthClientSecret}:{}}),n=X(t.server??{}),r=String(t.note??``),i=String(t.status??``),o=(t.fields??[]).map(gs);return i===`needs_oauth`?{status:`needs_oauth`,server:n,authorizeUrl:String(t.authorize_url??``),note:r}:i===`owner_client_required`?{status:`owner_client_required`,server:n,connectToken:String(t.connect_token??``),fields:o,note:r}:i===`needs_credential`?{status:`needs_credential`,server:n,connectToken:String(t.connect_token??``),fields:o,note:r}:{status:`connected`,server:n}},submitCredential:async(e,t,n)=>X((await a(`/mcp-servers/${e}/credential/`,`POST`,{connect_token:t,fields:n})).server??{}),connect:async e=>{let t=await a(`/mcp-servers/connect/`,`POST`,{server_url:e.serverUrl,...e.displayName?{display_name:e.displayName}:{},...e.headers?.length?{headers:e.headers}:{},...e.oauthClientId?{oauth_client_id:e.oauthClientId}:{},...e.oauthClientSecret?{oauth_client_secret:e.oauthClientSecret}:{}}),n=String(t.status??``),r=String(t.server_url??e.serverUrl),i=String(t.display_name??e.displayName??r),o=String(t.connect_token??``),s=String(t.note??``),c=(t.fields??[]).map(gs);return n===`needs_oauth`?{status:`needs_oauth`,server:_s(i,r),authorizeUrl:String(t.authorize_url??``),note:s}:n===`owner_client_required`?{status:`owner_client_required`,server:_s(i,r),connectToken:o,fields:c,note:s}:n===`needs_credential`?{status:`needs_credential`,server:_s(i,r),connectToken:o,fields:c,note:s}:{status:`connected`,server:X(t.server??{})}},connectCredential:async e=>X((await a(`/mcp-servers/connect/credential/`,`POST`,{connect_token:e.connectToken,fields:e.fields,...e.displayName?{display_name:e.displayName}:{},...e.serverUrl?{server_url:e.serverUrl}:{}})).server??{}),completeConnect:async e=>X((await a(`/mcp-servers/connect/complete/`,`POST`,{server_url:e.serverUrl,...e.displayName?{display_name:e.displayName}:{}})).server??{}),update:async(e,t)=>X(await a(`/mcp-servers/${e}/`,`PATCH`,{...t.enabled===void 0?{}:{enabled:t.enabled},...t.displayName===void 0?{}:{display_name:t.displayName}})),remove:async e=>{await a(`/mcp-servers/${e}/`,`DELETE`)},setScope:async(e,t)=>X(await a(`/mcp-servers/${e}/scope/`,`POST`,{scope:t})),permissions:async e=>{let t=await o(`/mcp-servers/${e}/tool-policies/`);return{enabled:t.enabled!==!1,permissions:t.policies??{}}},connectorPermissions:async e=>(await o(`/connectors/${encodeURIComponent(e)}/tool-policies/`)).policies??{},setConnectorToolPermission:async(e,t,n,r=`customer`)=>{await a(`/connectors/${encodeURIComponent(e)}/tools/${encodeURIComponent(t)}/`,`PUT`,{permission:n,scope:r})},setToolPermission:async(e,t,n,r=`customer`)=>s(e,t,n,r),setToolPermissions:async(e,t,n,r=`customer`)=>{try{await a(`/mcp-servers/${e}/tools/`,`PUT`,{operation_ids:t,permission:n,scope:r})}catch(i){if(!(i instanceof ps&&(i.status===404||i.status===405)))throw i;let a=[...t],o=async()=>{let t=a.shift();t!==void 0&&(await s(e,t,n,r),await o())};await Promise.all(Array.from({length:Math.min(6,a.length)},o))}},liveTools:async e=>((await o(`/mcp-servers/${e}/live-tools/`)).tools??[]).map(e=>({operationId:String(e.operationId??``),name:String(e.name??``),description:String(e.description??``),group:e.group===`write`?`write`:`read`,defaultLevel:String(e.defaultLevel??`allow`),currentLevel:String(e.currentLevel??`allow`),pinned:e.pinned===!0})),listConnectors:async()=>((await o(`/connectors/`)).connectors??[]).map(ys),beginConnectorConnect:async(e,t={})=>{let n=await a(`/connectors/connect/`,`POST`,{app:e,...t.accountId?{account_id:t.accountId}:{},...t.newAccount?{new_account:!0}:{}});return{alreadyConnected:n.already_connected===!0,reauth:n.reauth===!0,connectLinkUrl:String(n.connect_link_url??``),connectionId:String(n.connection_id??``)}},disconnectConnector:async e=>{await a(`/connectors/${encodeURIComponent(e)}/`,`DELETE`)},setConnectorAccountEnabled:async(e,t)=>{await a(`/connectors/${encodeURIComponent(e)}/`,`PATCH`,{enabled:t})},setDefaultConnectorAccount:async e=>{await a(`/connectors/${encodeURIComponent(e)}/default/`,`POST`)},listDisabledConnectorAccounts:async()=>{let e=await o(`/connectors/account-settings/`);return(Array.isArray(e.disabled)?e.disabled:[]).flatMap(e=>{let t=String(e?.account_id??``);return t?[{accountId:t,app:String(e.app??``)}]:[]})},setConnectorScope:async(e,t)=>{await a(`/connectors/${encodeURIComponent(e)}/scope/`,`POST`,{scope:t})}}}var Cs=class extends Error{reason;code;status;constructor(e,t,n=0,r=``){super(t),this.name=`ProviderAccountsClientError`,this.reason=e,this.code=r,this.status=n}},ws=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ts=e=>typeof e==`string`&&e.length>0,Es=e=>Ts(e)&&!Number.isNaN(Date.parse(e)),Ds=e=>typeof e==`string`&&/^[0-9A-Fa-f-]{8,64}$/u.test(e),Os=e=>Number.isSafeInteger(e)&&Number(e)>=1,ks=e=>typeof e==`string`&&URL.canParse(e)?new URL(e):null,As=e=>ks(e)?.protocol===`https:`,js=e=>{let t=ks(e);return t===null?!1:t.protocol===`https:`?!0:t.protocol===`http:`&&t.hostname===`localhost`&&t.port!==``&&t.username===``&&t.password===``&&typeof e==`string`&&e.startsWith(`http://localhost:${t.port}/`)},Ms=e=>ws(e)&&Ds(e.id)&&Ts(e.vendor)&&typeof e.label==`string`&&typeof e.category==`string`&&typeof e.connected==`boolean`&&Ts(e.status)&&typeof e.provider_state==`string`&&Es(e.created_at)&&(e.last_used_at===null||Es(e.last_used_at)),Ns=e=>ws(e)&&Array.isArray(e.accounts)&&e.accounts.every(Ms)&&Array.isArray(e.vendors)&&e.vendors.every(Ts)&&typeof e.terms_version==`string`,Ps=e=>{if(!ws(e)||!Ts(e.state)||!Os(e.expires_in))return!1;switch(e.mode){case`pkce`:return As(e.authorize_url)&&js(e.redirect_uri)&&(e.submit===`callback_url`||e.submit===`code`);case`device_code`:return e.submit===`poll`&&Ts(e.user_code)&&As(e.verification_uri)&&As(e.verification_uri_complete)&&Os(e.poll_interval);case`api_key`:return e.submit===`api_key`&&(e.console_url===``||As(e.console_url))&&Ts(e.input_label);default:return!1}},Fs=e=>ws(e)&&Ms(e.account)&&Ps(e.authorization),Is=e=>ws(e)&&Ms(e.account),Ls=e=>{if(!ws(e))return!1;switch(e.status){case`pending`:case`slow_down`:return Os(e.retry_after);case`complete`:return Ms(e.account);case`denied`:case`expired`:return!0;default:return!1}},Rs=e=>/^\d+$/u.test(e)&&Number(e)>0;function zs(e){return e===400?`invalid`:e===401?`authentication`:e===403?`forbidden`:e===404?`notFound`:e===409?`conflict`:e===410?`expired`:e===429?`rateLimited`:`unavailable`}var Bs={authentication:`Sign in to Search Atlas again to manage your subscriptions.`,forbidden:`This Search Atlas account cannot link provider subscriptions.`,notFound:`That subscription is no longer linked.`,conflict:`That subscription changed while linking it. Start again.`,expired:`That sign-in took too long. Start again.`,invalid:`The provider did not accept that. Check it and try again.`,rateLimited:`Too many subscription requests. Try again shortly.`,unavailable:`Subscription linking is temporarily unavailable.`,malformedResponse:`Borg Cloud returned a subscription response this version cannot read.`,transport:`Borg Cloud could not be reached.`};async function Vs(e){let t=zs(e.status),n=``,r=``;try{let t=await e.json();ws(t)&&(n=Ts(t.detail)?t.detail:``,r=Ts(t.code)?t.code:``)}catch{n=``}return new Cs(t,n||Bs[t],e.status,r)}function Hs(e,t){return`callbackUrl`in t?{state:e,callback_url:t.callbackUrl}:`code`in t?{state:e,code:t.code}:{state:e,api_key:t.apiKey}}function Us(e){let t=e.fetch??globalThis.fetch,n=e.apiUrl.trim().replace(/\/+$/u,``),r=URL.canParse(n)&&Rs(e.customerId),i=`${n}/api/v1/customers/${e.customerId}/provider-accounts/`;async function a(n,i,a,o){if(!r)throw new Cs(`unavailable`,`Subscription linking is not configured.`);let s={...await e.getCredentialHeaders(),accept:`application/json`,...o===void 0?{}:{"content-type":`application/json`}},c;try{c=await t(n,{method:i,headers:s,cache:`no-store`,...o===void 0?{}:{body:JSON.stringify(o)}})}catch{throw new Cs(`transport`,Bs.transport)}if(!c.ok)throw await Vs(c);if(c.status===204)return;let l;try{l=await c.json()}catch{l=void 0}if(!a(l))throw new Cs(`malformedResponse`,Bs.malformedResponse,c.status);return l}let o=(e,t=``)=>{if(!Ds(e))throw new Cs(`invalid`,`That subscription id is not valid.`);return`${i}${e}/${t}`},s=e=>!1;return{list:()=>a(i,`GET`,Ns),start:e=>a(i,`POST`,Fs,{vendor:e.vendor,...e.acceptedTermsVersion===void 0?{}:{accepted_terms_version:e.acceptedTermsVersion},...e.accountId===void 0?{}:{account_id:e.accountId}}),complete:async(e,t,n)=>a(o(e,`complete/`),`POST`,Is,Hs(t,n)),poll:async(e,t)=>a(o(e,`poll/`),`POST`,Ls,{state:t}),disconnect:async e=>a(o(e),`DELETE`,s).then(()=>void 0)}}var Z=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`CloudSourceControlError`}};function Ws(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return typeof t.id!=`string`||typeof t.nameWithOwner!=`string`||typeof t.url!=`string`||typeof t.cloneUrl!=`string`?[]:[{id:t.id,provider:t.provider===`gitlab`?`gitlab`:`github`,nameWithOwner:t.nameWithOwner,url:t.url,cloneUrl:t.cloneUrl,updatedAt:typeof t.updatedAt==`string`?t.updatedAt:null}]}):[]}function Gs(e){if(!Y(e.customerId))throw new Z(400,`A customer is required.`);let t=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}/source-control`,n=e.fetch??globalThis.fetch,r=async(r,i,a)=>{let o=await e.getCredentialHeaders();if(!(`authorization`in o))throw new Z(401,`Sign in with Search Atlas to manage code hosts.`);let s;try{s=await n(`${t}${r}`,{method:i,headers:{...o,...a===void 0?{}:{"content-type":`application/json`}},...a===void 0?{}:{body:JSON.stringify(a)},...i===`GET`&&typeof AbortSignal<`u`&&typeof AbortSignal.timeout==`function`?{signal:AbortSignal.timeout(15e3)}:{}})}catch{throw new Z(503,`Code hosts could not be reached. Try again.`)}if(!s.ok){let e=await s.json().catch(()=>({})),t=typeof e.detail==`string`?e.detail:`Code hosts could not be loaded. Try again.`;throw new Z(s.status,t)}return s.status===204?{}:await s.json()};return{listAccounts:async()=>{let e=await r(`/accounts/`,`GET`);if(!Array.isArray(e.accounts))throw new Z(502,`Code-host accounts are unreadable.`);return e.accounts.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e,n=t.provider,r=t.accountId,i=t.connectionId;return n!==`github`&&n!==`gitlab`||typeof r!=`string`||!r||typeof i!=`string`||!i?[]:[{accountId:r,connectionId:i,provider:n,host:typeof t.host==`string`?t.host:``,login:typeof t.login==`string`?t.login:``,...t.status===`connected`||t.status===`pending`||t.status===`error`?{status:t.status}:{}}]})},connect:async e=>{if(e.connectionId&&!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(e.connectionId))throw new Z(400,`Choose an account to reauthorize.`);if(e.connectionId&&e.newAccount)throw new Z(400,`Choose either an account to reauthorize or another account.`);let t=await r(`/connect/`,`POST`,e);if(typeof t.authorizeUrl!=`string`)throw new Z(502,`The sign-in link was unavailable.`);try{let e=new URL(t.authorizeUrl);if(e.protocol===`https:`&&!e.username&&!e.password)return e.toString()}catch{}throw new Z(502,`The sign-in link was invalid.`)},listRepositories:async(e,t=``)=>{let n=new URLSearchParams;t.trim()&&n.set(`q`,t.trim());let i=await r(`/accounts/${encodeURIComponent(e.connectionId)}/repositories/?${n.toString()}`,`GET`);return{repositories:Ws(i.repositories),nextCursor:typeof i.nextCursor==`string`?i.nextCursor:null,cachedAt:typeof i.cachedAt==`string`?i.cachedAt:null}},refreshRepositories:async(e,t=``,n)=>{let i=await r(`/accounts/${encodeURIComponent(e.connectionId)}/repositories/refresh/`,`POST`,{provider:e.provider,query:t.trim(),...n?{cursor:n}:{}});return{repositories:Ws(i.repositories),nextCursor:typeof i.nextCursor==`string`?i.nextCursor:null,cachedAt:typeof i.cachedAt==`string`?i.cachedAt:null}},disconnect:async e=>{if(!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(e))throw new Z(400,`Choose an account to disconnect.`);await r(`/accounts/${encodeURIComponent(e)}/`,`DELETE`)}}}var Ks=class extends Error{status;detail;constructor(e,t){super(`Borg resolved-skills request failed (${e}).`),this.name=`ResolvedSkillsClientError`,this.status=e,this.detail=t}};function qs(e,t){if(typeof e==`string`)return t?`${t}: ${e}`:e;if(Array.isArray(e)){let n=e.flatMap(e=>qs(e,t)??[]);return n.length>0?n.join(` `):void 0}if(typeof e==`object`&&e){let n=Object.entries(e).flatMap(([e,n])=>qs(n,e===`detail`||/^\d+$/u.test(e)?t:e)??[]);return n.length>0?n.join(` `):void 0}}async function Js(e){let t=await e.json().catch(()=>void 0);return new Ks(e.status,qs(t))}function Ys(e){return{...e,customerDecision:e.customerDecision??null}}function Xs(e){if(!Y(e.customerId))throw new Ks(400);let t=e.fetch??globalThis.fetch,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}`,r=()=>e.getCredentialHeaders();return{fetchResolved:async(e,i)=>{let a={...await r()};e&&(a[`if-none-match`]=`"${e}"`);let o=await t(`${n}/skills/resolved/`,{method:`GET`,headers:a,...i?{signal:i}:{}});if(o.status===304)return null;if(!o.ok)throw new Ks(o.status);return await o.json()},listCatalog:async e=>{let i=e&&e!==`skill`?`?kind=${e}`:``,a=await t(`${n}/skills/${i}`,{method:`GET`,headers:await r()});if(!a.ok)throw new Ks(a.status);let o=await a.json(),s=(o.skills??[]).map(Ys);return{skills:i?s.filter(t=>t.kind===e):s,bundles:(o.bundles??[]).flatMap(e=>e.slug?[{slug:e.slug,name:e.name||e.slug,description:e.description??``,skillIds:e.skillIds??[]}]:[]),canAdminister:o.canAdminister??!1}},setSkillEnabled:async(e,i)=>{let a=await t(`${n}/skills/${e}/policy/`,{method:`PUT`,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify({enabled:i})});if(!a.ok)throw new Ks(a.status);return Ys(await a.json())},readSkill:async(e,i)=>{let a=i===void 0?``:`?version=${i}`,o=await t(`${n}/skills/${e}/${a}`,{method:`GET`,headers:await r()});if(!o.ok)throw await Js(o);return await o.json()},createSkill:async e=>{let i=await t(`${n}/skills/`,{method:`POST`,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify(e)});if(!i.ok)throw await Js(i);let a=await i.json();if(e.kind&&e.kind!==`skill`&&a.kind!==e.kind)throw await t(`${n}/skills/${a.id}/`,{method:`DELETE`,headers:await r()}),new Ks(501);return a},readResource:async(e,i)=>{let a=i.split(`/`).map(encodeURIComponent).join(`/`),o=await t(`${n}/skills/${e}/resources/${a}`,{method:`GET`,headers:await r()});if(!o.ok)throw new Ks(o.status);return new Uint8Array(await o.arrayBuffer())},updateSkill:async(e,i)=>{let a=await t(`${n}/skills/${e}/`,{method:`PATCH`,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify(i)});if(!a.ok)throw await Js(a);return await a.json()},archiveSkill:async e=>{let i=await t(`${n}/skills/${e}/`,{method:`DELETE`,headers:await r()});if(!i.ok)throw await Js(i)},setCustomerSkillPolicy:async(e,i)=>{let a=await t(`${n}/skills/${e}/customer-policy/`,{method:`PUT`,headers:{...await r(),"content-type":`application/json`},body:JSON.stringify({decision:i})});if(!a.ok)throw new Ks(a.status);return a.status===204?null:Ys(await a.json())}}}var Zs=e=>e.sessions_status??(e.sessions===null?`unavailable`:`complete`);function Qs(e){return{requests:e.requests,totalTokens:e.total_tokens,costUsd:e.cost_usd,costStatus:e.cost_status,sessions:e.sessions,sessionsStatus:Zs(e)}}var $s=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{tasks:t.tasks,totalTokens:t.total_tokens}])),ec=e=>({completedTasks:e.completed_tasks,mergedPullRequests:e.merged_pull_requests,byKind:$s(e.by_kind)}),tc=e=>({endUserId:e.member.end_user_id,name:e.member.name,email:e.member.email,isCurrentUser:e.member.is_current_user,totals:Qs(e.totals),activePeriods:e.active_periods,periods:e.periods.map(e=>({requests:e.requests,totalTokens:e.total_tokens,costUsd:e.cost_usd,sessions:e.sessions})),outcomes:e.outcomes===null?null:{...ec(e.outcomes),periods:[...e.outcomes.periods]}});function nc(e){let[t]=e;return{readAt:t.read_at,since:t.since,until:t.until,resolution:t.resolution,timeZone:t.time_zone,cacheSeconds:t.limits?.cache_seconds??900,periods:t.periods.map(e=>({start:e.period_start,end:e.period_end})),totals:Qs(t.totals),unattributed:Qs(t.unattributed),members:e.flatMap(e=>e.members.data.map(tc)),outcomes:{status:t.outcomes.status,reportingSince:t.outcomes.reporting_since,totals:t.outcomes.totals===null?null:ec(t.outcomes.totals)}}}function rc(e){switch(e){case`anthropic`:return`claude`;case`openai_codex`:case`openai`:return`codex`;case`xai`:return`grok`;case`fusion`:return`fusion`;default:return`other`}}var ic=e=>({uncachedInputTokens:e.input_tokens,cachedInputTokens:e.cache_read_input_tokens,cacheCreationTokens:e.cache_creation_input_tokens,outputTokens:e.output_tokens,reasoningTokens:0}),ac=e=>e.cost_usd===null||e.cost_status===`unavailable`?`unpriced`:`modelPriced`,oc=(e,t,n)=>{let r=Date.parse(e);if(Number.isNaN(r))return n;try{let e=new Intl.DateTimeFormat(`en-CA`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(r);return/^\d{4}-\d{2}-\d{2}$/.test(e)?e:n}catch{let t=e.slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(t)?t:n}},sc=e=>{let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()},cc=(e,t)=>e.buckets.flatMap(n=>n.models.map(r=>({day:oc(n.period_start,e.time_zone,t.sinceDay),...e.resolution===`hour`?{hourStart:sc(n.period_start)}:{},provider:rc(r.provider),model:r.model,totals:ic(r),costUsd:r.cost_usd??0,cacheSavingsUsd:r.cache_savings_usd??0,cacheSavingsKnown:r.cache_savings_usd!==null,costSource:ac(r),records:r.requests,unpricedRecords:r.unpriced_requests,sessions:r.sessions??0}))),lc=e=>{let t=e?.bank;if(typeof t!=`object`||!t||t.provisioned!==!0||t.unavailable!==!1)return null;let{allowance:n,consumed:r,remaining:i}=t;return typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||n<=0?null:{allowanceUsd:n,consumedUsd:r,remainingUsd:i}};function uc(e,t){return{contractVersion:8,readAt:e.read_at,timeZone:e.time_zone,sinceDay:t.sinceDay,untilDay:t.untilDay,buckets:cc(e,t),pricing:{status:e.pricing.status,source:e.pricing.source,fetchedAt:e.pricing.calculated_at,knownModels:e.pricing.priced_requests},limits:e.user_limits?{monthly:{capUsd:e.user_limits.monthly.cap,spentUsd:e.user_limits.monthly.spent,resetsAt:e.user_limits.monthly.resets_at},weekly:{capUsd:e.user_limits.weekly.cap,spentUsd:e.user_limits.weekly.spent,resetsAt:e.user_limits.weekly.resets_at},session:{capUsd:e.user_limits.session.cap,spentUsd:e.user_limits.session.spent,resetsAt:e.user_limits.session.resets_at},...e.user_limits.topup?{topUp:{totalUsd:e.user_limits.topup.total,spentUsd:e.user_limits.topup.spent,remainingUsd:e.user_limits.topup.remaining}}:{}}:null,organizationCredit:lc(e.organization),cloudSessions:e.cloud_sessions??null,sessions:e.totals.sessions??0}}var dc=class extends Error{status;detail;permanent;code;constructor(e,t=``,n=null){super(t||`Borg Cloud usage request failed (${e}).`),this.name=`UsageClientError`,this.status=e,this.detail=t,this.code=n,this.permanent=e>=400&&e<500&&e!==408&&e!==429}};function fc(e){return new URLSearchParams({since:e.sinceTime??e.sinceDay,until:e.untilTime??e.untilDay,resolution:e.resolution===`hour`?`hour`:`day`,time_zone:e.timeZone})}async function pc(e){let t=``,n=null;try{let r=await e.json();t=typeof r?.detail==`string`?r.detail:``,n=typeof r?.code==`string`?r.code:null}catch{t=``}return new dc(e.status,t,n)}function mc(e){if(!bt(e.customerId))throw new dc(400);let t=e.fetch??globalThis.fetch,n=`${e.apiUrl.replace(/\/$/,``)}/api/v1/customers/${e.customerId}`;return{read:async r=>{let i=await t(`${n}/usage/?${fc(r).toString()}`,{headers:await e.getAuthorizationHeaders()});if(!i.ok)throw await pc(i);return uc(await i.json(),r)},readTeam:async r=>{let i=await t(`${n}/usage/team/?${fc(r).toString()}`,{headers:await e.getAuthorizationHeaders()});if(!i.ok)throw await pc(i);let[a,...o]=(await i.json()).pages??[];if(a===void 0)throw new dc(502,`Team usage came back empty.`);return nc([a,...o])}}}function hc(e){return mc({apiUrl:e.apiUrl,customerId:e.customerId,getAuthorizationHeaders:async()=>e.getCredentialHeaders(),...e.fetch?{fetch:e.fetch}:{}})}var Q=class extends Error{status;retryAfterMs;constructor(e,t){super(`Borg Cloud session request failed (${e}).`),this.name=`SessionRecallClientError`,this.status=e,this.retryAfterMs=t}},gc=864e5;function _c(e){let t=e.headers.get(`retry-after`)?.trim()??``;if(!/^[0-9]{1,9}$/u.test(t))return;let n=Number(t)*1e3;return n>0?Math.min(n,gc):void 0}function vc(e){return new Q(e.status,e.status===429?_c(e):void 0)}function yc(e){return new Q(e.status)}function bc(e){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e))throw new Q(400);return e}function xc(e){if(!Array.isArray(e))throw new Q(502);return e}function Sc(e){let t=e.fetch??globalThis.fetch,n=e.apiUrl.replace(/\/$/,``);if(!bt(e.customerId))throw new Q(400);let r=String(e.customerId),i=e.deviceId===null?null:bc(e.deviceId),a=async()=>{if(e.getCredentialHeaders)return e.getCredentialHeaders();let t=await e.getAccessToken?.();if(!t)throw new Q(401);return{authorization:`Bearer ${t}`}},o=async e=>{let r=await t(`${n}${e}`,{headers:await a()});if(!r.ok)throw new Q(r.status);return xc(await r.json())},s=e=>i===null?new Set:new Set(e.filter(e=>e.device===i).map(e=>e.workspace));return{threadStates:async()=>{let e=[],i=`0`;for(let o=0;o<1e3;o+=1){let o=await t(`${n}/api/v1/customers/${r}/thread-state/?after=${i}&limit=200`,{headers:await a()});if(!o.ok)throw vc(o);let s=await o.json();if(typeof s!=`object`||!s)throw new Q(502);let c=s;if(!Array.isArray(c.threads)||c.threads.length>200)throw new Q(502);for(let t of c.threads){if(typeof t!=`object`||!t)throw new Q(502);let n=t;if(typeof n.threadId!=`string`||!/^[A-Za-z0-9._:/-]{1,200}$/u.test(n.threadId)||typeof n.workspaceId!=`string`||!/^[0-9a-f-]{36}$/iu.test(n.workspaceId)||typeof n.projectRef!=`string`||n.projectRef.length>200||n.kind!==void 0&&n.kind!==`cloud`&&n.kind!==`host`||n.executionSessionId!==void 0&&n.executionSessionId!==null&&(typeof n.executionSessionId!=`string`||!/^[0-9a-f-]{36}$/iu.test(n.executionSessionId))||n.hostDeviceId!==void 0&&n.hostDeviceId!==null&&(typeof n.hostDeviceId!=`string`||!/^[0-9a-f-]{36}$/iu.test(n.hostDeviceId))||typeof n.version!=`number`||!Number.isSafeInteger(n.version)||n.version<1||typeof n.metadata!=`object`||n.metadata===null||Array.isArray(n.metadata)||n.deletedAt!==null&&(typeof n.deletedAt!=`string`||!Number.isFinite(Date.parse(n.deletedAt))))throw new Q(502);e.push(n)}if(c.nextCursor===null)return e;if(typeof c.nextCursor!=`string`||!/^[0-9]{1,19}$/u.test(c.nextCursor)||BigInt(c.nextCursor)<=BigInt(i))throw new Q(502);i=c.nextCursor}throw new Q(502)},pendingCloudThreadActions:async()=>{let e=[],i=`0`;for(let o=0;o<1e3;o+=1){let o=await t(`${n}/api/v1/customers/${r}/thread-actions/?after=${i}&limit=100`,{headers:await a()});if(!o.ok)throw new Q(o.status);let s=await o.json();if(typeof s!=`object`||!s)throw new Q(502);let c=s;if(!Array.isArray(c.actions)||c.actions.length>100)throw new Q(502);for(let t of c.actions){if(typeof t!=`object`||!t)throw new Q(502);let n=t;if(typeof n.id!=`string`||!/^[0-9]{1,19}$/u.test(n.id)||typeof n.commandId!=`string`||typeof n.threadId!=`string`||typeof n.type!=`string`||typeof n.payload!=`object`||n.payload===null||![`pending`,`rejected`].includes(String(n.status))||typeof n.createdAt!=`string`||typeof n.rejectedReason!=`string`)throw new Q(502);e.push(n)}if(c.nextCursor===null)return e;if(typeof c.nextCursor!=`string`||!/^[0-9]{1,19}$/u.test(c.nextCursor)||BigInt(c.nextCursor)<=BigInt(i))throw new Q(502);i=c.nextCursor}throw new Q(502)},submitCloudThreadAction:async e=>{if(!/^[A-Za-z0-9._:/-]{1,200}$/u.test(e.threadId)||!/^[A-Za-z0-9._:-]{1,200}$/u.test(e.commandId))throw new Q(400);let i=await t(`${n}/api/v1/customers/${r}/thread-actions/`,{method:`POST`,headers:{...await a(),"content-type":`application/json`},body:JSON.stringify(e)});if(i.status!==202)throw yc(i);let o=await i.json();if(typeof o!=`object`||!o)throw new Q(502);let s=o;if(typeof s.id!=`string`||!/^[0-9]{1,19}$/u.test(s.id)||s.commandId!==e.commandId||![`pending`,`applied`,`rejected`].includes(String(s.status)))throw new Q(502);return s},deletedCloudThreads:async()=>{let e=[],i=`0`;for(let o=0;o<1e3;o+=1){let o=await t(`${n}/api/v1/customers/${r}/thread-deletions/?after=${i}&limit=200`,{headers:await a()});if(!o.ok)throw new Q(o.status);let s=await o.json();if(typeof s!=`object`||!s)throw new Q(502);let c=s;if(!Array.isArray(c.threadIds)||c.threadIds.length>200||!c.threadIds.every(e=>typeof e==`string`&&e.length>0&&e.length<=200))throw new Q(502);if(e.push(...c.threadIds),c.nextCursor===null)return e;if(typeof c.nextCursor!=`string`||!/^[0-9]{1,19}$/u.test(c.nextCursor)||BigInt(c.nextCursor)<=BigInt(i))throw new Q(502);i=c.nextCursor}throw new Q(502)},deleteCloudThread:async e=>{if(!/^[A-Za-z0-9._:/-]{1,200}$/u.test(e))throw new Q(400);let i=await t(`${n}/api/v1/customers/${r}/thread-deletions/`,{method:`POST`,headers:{...await a(),"content-type":`application/json`},body:JSON.stringify({threadId:e})});if(i.status!==202)throw yc(i)},list:async()=>{let[e,t]=await Promise.all([o(`/api/v1/customers/${r}/sessions/`),o(`/api/v1/customers/${r}/workspace-bindings/`)]),n=s(t);return e.map(e=>({...e,isActionable:e.executor_kind===`cloud`||n.has(e.workspace)}))},events:(e,t=-1,n=200)=>{let r=bc(e);return o(`/api/v1/sessions/${r}/events/?since=${Number.isSafeInteger(t)&&t>=-1?t:-1}&limit=${Number.isSafeInteger(n)?Math.min(Math.max(n,1),500):200}`)},threads:async(e=100)=>{let t=Number.isSafeInteger(e)?Math.min(Math.max(e,1),500):100,[n,i]=await Promise.all([o(`/api/v1/customers/${r}/threads/?limit=${t}`),o(`/api/v1/customers/${r}/workspace-bindings/`)]),a=s(i);return n.map(e=>({...e,isActionable:e.executorKind===`cloud`||a.has(e.workspaceId)}))},threadEvents:(e,t=-1,n=200)=>o(`/api/v1/customers/${r}/threads/${encodeURIComponent(e)}/events/?since=${Number.isSafeInteger(t)&&t>=-1?t:-1}&limit=${Number.isSafeInteger(n)?Math.min(Math.max(n,1),500):200}`)}}var Cc=e=>/^\d+$/u.test(e)&&Number(e)>0;async function wc(e){try{let t=e.getSearchAtlasAccessToken?await e.getSearchAtlasAccessToken():(await e.getSearchAtlasTunnelCredentials?.())?.accessToken??null;return t&&t.trim().length>0?{kind:`jwt`,token:t}:null}catch{return null}}async function Tc(){let e=typeof window>`u`?void 0:window.desktopBridge;if(e)return wc(e);let t=lt();try{let e=await t?.getAccessToken();if(e&&e.trim().length>0)return{kind:`jwt`,token:e}}catch{}let n=Lt();return n.key&&Cc(n.customerId)?{kind:`apiKey`,key:n.key,customerId:n.customerId}:null}function Ec(e){return e.kind===`apiKey`?Cc(e.customerId)?e.customerId:null:s(e.token)?.customerId??null}async function Dc(){let e=gt()??``;if(!e)return null;let t=await Tc();if(!t)return null;let n=Ec(t);if(!n)return null;let r=async()=>{let e=await Tc();if(!e)throw Error(`Sign in to Search Atlas to load this page.`);return fs(e)};return{customerId:n,principalKey:`${e}|${n}|${t.kind===`jwt`?s(t.token)?.userId??``:`api-key`}`,borgs:qa({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),borgLoops:Ba({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),scheduledTasks:ho({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),conversationShares:Qa({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),importJobs:Mo({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),memory:ls({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),secrets:To({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),projects:ds({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),skills:Xs({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),sourceControl:Gs({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),mcp:Ss({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),usage:hc({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),apiKeys:Oa({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),providerAccounts:Us({apiUrl:e,customerId:n,getCredentialHeaders:r,fetch:G}),sessions:Sc({apiUrl:e,customerId:n,deviceId:null,fetch:G,getCredentialHeaders:r})}}var Oc=`borg-cloud-hidden-threads-v1`;function kc(e){return Array.isArray(e)?new Set(e.slice(-1e3).filter(Ut)):new Set}function Ac(){if(typeof window>`u`)return new Set;try{let e=window.localStorage.getItem(Oc);return e?kc(JSON.parse(e)):new Set}catch{return new Set}}var jc=U(Ac()).pipe(pt,W(`web-hidden-cloud-threads`)),Mc=U(new Set).pipe(pt,W(`web-server-deleted-cloud-threads`));function Nc(e){Ft.set(Mc,new Set(e))}function Pc(e){let t=kc([...Ft.get(jc),ft(e)]);if(Ft.set(jc,t),!(typeof window>`u`))try{window.localStorage.setItem(Oc,JSON.stringify([...t]))}catch{}}var Fc=U({actions:[]}).pipe(pt,W(`web-pending-cloud-thread-actions`)),Ic=U(e=>e(Fc).actions),Lc=zt;function Rc(e){Ft.set(Fc,{actions:e})}function zc(e){let t=Ft.get(Fc).actions;Ft.set(Fc,{actions:Lc(t,e)})}var Bc=U([]).pipe(pt,W(`web-canonical-thread-states`));function Vc(e){Ft.set(Bc,e)}async function Hc(){let e=await Dc();if(!e)throw Vc([]),Error(`Sign in to Search Atlas to load archived threads.`);let t=await e.sessions.threadStates();(await Dc())?.principalKey===e.principalKey&&Vc(t)}var Uc=jt(At),Wc=Tt(At),Gc=ct(Wc.stateAtom),Kc=Nt({catalogValueAtom:Gt.catalogValueAtom,snapshotAtom:Ai,hiddenThreadKeysAtom:jc,deletedThreadIdsAtom:Mc,pendingCloudActionsAtom:Ic,canonicalThreadStatesAtom:Bc}),qc=U(St(kt)).pipe(W(`web-environment-thread:empty`));function Jc(e,t){let n=(0,J.c)(5),i;n[0]!==e||n[1]!==t?(i=e!==null&&t!==null?Wc.stateAtom(e,t):qc,n[0]=e,n[1]=t,n[2]=i):i=n[2];let a=dt(i),o;return n[3]===a?o=n[4]:(o=r(Wt(a),Yc),n[3]=a,n[4]=o),o}function Yc(){return kt}function Xc(e){return e.bootstrapComplete?e.serverThreadDetailExists||e.draftThreadExists?`ready`:e.serverThreadDetailDeleted?`missing`:e.serverThreadShellExists?`loading`:`missing`:`loading`}function Zc(e){return{environmentId:e.environmentId,threadId:e.threadId}}function Qc(e){return{draftId:e}}function $c(e){return!e.environmentId||!e.threadId?null:ke(e.environmentId,e.threadId)}function el(e){return e.environmentId&&e.threadId?{kind:`server`,threadRef:ke(e.environmentId,e.threadId)}:e.draftId?{kind:`draft`,draftId:e.draftId}:null}function tl(e,t){return e?.kind===`server`?e.threadRef:e?.kind!==`draft`||!t?.promotedTo?null:t.promotedTo}var nl=class extends o()(`ClipboardApiUnavailableError`,{target:a}){get message(){return`Clipboard API is unavailable while copying ${this.target}.`}},rl=class extends o()(`ClipboardWriteError`,{target:a,cause:c()}){get message(){return`Failed to copy ${this.target} to the clipboard.`}},il=class extends o()(`ClipboardReadUnavailableError`,{target:a}){get message(){return`Clipboard API is unavailable while reading ${this.target}.`}},al=class extends o()(`ClipboardReadError`,{target:a,cause:c()}){get message(){return`Failed to read ${this.target} from the clipboard.`}};function ol(e){if(typeof document>`u`||typeof document.execCommand!=`function`)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.setAttribute(`aria-hidden`,`true`),t.style.position=`fixed`,t.style.top=`0`,t.style.left=`0`,t.style.opacity=`0`,t.style.fontSize=`16px`;let n=document.activeElement;document.body.appendChild(t);try{return t.focus({preventScroll:!0}),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{t.remove();let e=n?.focus;typeof e==`function`&&e.call(n)}}async function sl(e,t=`text`){if(typeof window>`u`)throw new nl({target:t});if(!e)return!1;if(typeof navigator>`u`||!navigator.clipboard?.writeText){if(ol(e))return!0;throw new nl({target:t})}try{return await navigator.clipboard.writeText(e),!0}catch(e){throw new rl({target:t,cause:e})}}async function cl(e=`text`){if(typeof window>`u`||typeof navigator>`u`||!navigator.clipboard?.readText)throw new il({target:e});try{return await navigator.clipboard.readText()}catch(t){throw new al({target:e,cause:t})}}function ll({timeout:e=2e3,target:t=`text`,onCopy:n,onError:r}={}){let[i,a]=K.useState(!1),o=K.useRef(null),s=K.useRef(n),c=K.useRef(r),l=K.useRef(t),u=K.useRef(e);s.current=n,c.current=r,l.current=t,u.current=e;let d=K.useCallback((e,t)=>{sl(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 K.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{copyToClipboard:d,isCopied:i}}var ul=K.createContext(void 0);function dl(){let e=K.useContext(ul);if(!e)throw Error(We(73));return e}var fl=0;function pl(e){return fl+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${fl}`}function ml(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 hl(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 gl=e=>e.toastMetadata,$={toasts:m(e=>e.toasts),isEmpty:m(e=>e.toasts.length===0),toast:m(gl,(e,t)=>e.get(t)?.value),toastIndex:m(gl,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:m(gl,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:m(gl,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:m(e=>e.hovering),focused:m(e=>e.focused),expanded:m(e=>e.hovering||e.focused),expandedOrOutOfFocus:m(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:m(e=>e.prevFocusElement)},_l=class extends P{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:hl(e.toasts)},{},$)}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=$.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||pl(`toast`);if(e.id){let t=$.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)),$.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=$.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)),$.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=$.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:hl(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=ml(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=ml(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=ml(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??=D.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=de(e);ee(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!$.expandedOrOutOfFocus(this.state),a=i?D.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:hl(e)};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=A(B(this.state.viewport));if(!this.state.viewport||!ee(this.state.viewport,t)||!S(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=$.toasts(this.state),r=$.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()}},vl=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=$e(()=>new _l({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Ee(a.disposeEffect),K.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,q.jsx)(ul.Provider,{value:a,children:t})},yl=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),bl=K.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=dl(),c=ye(),l=K.useRef(!1),u=K.useRef(!1),d=K.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,b=K.useMemo(()=>p.some(e=>e.transitionStatus===`ending`),[p]),x=K.useMemo(()=>p.filter(e=>e.priority===`high`),[p]);K.useEffect(()=>{let e=s.state.viewport;if(!e)return;function t(t){f||t.key===`F6`&&de(t)!==e&&(t.preventDefault(),s.setPrevFocusElement(A(B(e))),e?.focus({preventScroll:!0}),s.pauseTimers(),s.setFocused(!0))}return I(Me(e),`keydown`,t)},[s,f]),K.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=Me(e);function n(e){de(e)===t&&(s.setIsWindowFocused(!1),s.pauseTimers())}function r(n){if(n.relatedTarget)return;let r=de(n),i=A(B(e));(r===t||!ee(e,r)||!S(i))&&s.resumeTimers(),c.start(0,()=>s.setIsWindowFocused(!0))}return Le(I(t,`blur`,n,!0),I(t,`focus`,r,!0))},[s,c,f]),K.useEffect(()=>{let e=s.state.viewport;if(!(!e||f))return I(B(e),`pointerdown`,s.handleDocumentPointerDown,!0)},[f,s]);function C(e){let t=s.state.viewport;t&&(l.current=!0,e.relatedTarget===t?p[0]?.ref?.current?.focus():s.restoreFocusToPrevElement())}function w(e){e.key===`Tab`&&e.shiftKey&&de(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement(),s.resumeTimers())}function T(){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)}K.useEffect(T,[b,s]);function E(){s.pauseTimers(),s.setHovering(!0),u.current=!1}function D(){b||d.current?u.current=!0:(s.resumeTimers(),s.setHovering(!1))}function O(e){e.pointerType===`touch`&&(d.current=!0)}function k(e){e.pointerType===`touch`&&(d.current=!1,T())}function j(){if(l.current){l.current=!1;return}m||S(A(B(s.state.viewport)))&&(s.setFocused(!0),s.pauseTimers())}function N(e){!m||ee(s.state.viewport,e.relatedTarget)||(s.setFocused(!1),s.resumeTimers())}let P={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:E,onMouseMove:E,onMouseLeave:D,onFocus:j,onBlur:N,onKeyDown:w,onClick:j,onPointerDown:O,onPointerUp:k,onPointerCancel:k},F={expanded:h},te=M(`div`,e,{ref:[t,s.setViewport],state:F,props:[P,{style:{[yl.frontmostHeight]:_?`${_}px`:void 0}},o,{children:(0,q.jsxs)(K.Fragment,{children:[!f&&g&&(0,q.jsx)(y,{onFocus:C}),a,!f&&g&&(0,q.jsx)(y,{onFocus:C})]})}]});return(0,q.jsxs)(K.Fragment,{children:[!f&&g&&(0,q.jsx)(y,{onFocus:C}),te,!m&&x.length>0&&(0,q.jsx)(`div`,{style:v,children:x.map(e=>(0,q.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,q.jsx)(`div`,{children:e.title}),(0,q.jsx)(`div`,{children:e.description})]},e.id))})]})}),xl=K.createContext(void 0);function Sl(){let e=K.useContext(xl);if(!e)throw Error(We(66));return e}var Cl=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 wl(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Tl(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 El(e){let t=Me(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 Dl={...Ye,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Ol=40,kl=10,Al=.5,jl=1,Ml=`${tt},${qe}`,Nl=K.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,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,d=dl(),[f,p]=K.useState(void 0),[m,h]=K.useState(!1),[g,_]=K.useState(!1),[v,y]=K.useState(!1),[b,x]=K.useState({x:0,y:0}),[S,C]=K.useState({x:0,y:0,scale:1}),[w,T]=K.useState(),[E,D]=K.useState(),[O,k]=K.useState(null),j=K.useRef(null),N=K.useRef({x:0,y:0}),P=K.useRef({x:0,y:0,scale:1}),F=K.useRef(void 0),te=K.useRef(0),L=K.useRef(!1),R=K.useRef({x:0,y:0}),ne=K.useRef(!1),re=K.useRef({x:0,y:0}),ie=K.useRef(null),ae=K.useRef(null),oe=d.useState(`toastIndex`,n.id),se=d.useState(`toastVisibleIndex`,n.id),ce=d.useState(`toastOffsetY`,n.id),le=d.useState(`focused`),ue=d.useState(`expanded`);Se({open:n.transitionStatus!==`ending`,ref:j,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let fe=V((e=!1)=>{let t=j.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:j,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?mi.flushSync(a):a()});z(fe,[fe]);function pe(e){re.current=e,x(e)}z(()=>()=>{ae.current?.abort()},[]);function me(e,t){let n=e,r=t;return!l.includes(`left`)&&!l.includes(`right`)?n=e>0?e**Al:-(Math.abs(e)**Al):(!l.includes(`right`)&&e>0&&(n=e**Al),!l.includes(`left`)&&e<0&&(n=-(Math.abs(e)**Al))),!l.includes(`up`)&&!l.includes(`down`)?r=t>0?t**Al:-(Math.abs(t)**Al):(!l.includes(`down`)&&t>0&&(r=t**Al),!l.includes(`up`)&&t<0&&(r=-(Math.abs(t)**Al))),{x:n,y:r}}let he=V(e=>{if(e.pointerId!==ie.current)return;ie.current=null,ae.current?.abort(),ae.current=null,h(!1),_(!1),k(null);let t=P.current;if(e.type===`pointercancel`||L.current){pe({x:t.x,y:t.y}),p(void 0);return}let r=!1,i=re.current,a=i.x-t.x,o=i.y-t.y,s;for(let e of l){switch(e){case`right`:a>Ol&&(r=!0,s=`right`);break;case`left`:a<-40&&(r=!0,s=`left`);break;case`down`:o>Ol&&(r=!0,s=`down`);break;case`up`:o<-40&&(r=!0,s=`up`);break;default:break}if(r)break}r?(p(s),y(!0),d.closeToast(n.id)):(pe({x:t.x,y:t.y}),p(void 0))});function ge(e){if(e.button!==0)return;e.pointerType===`touch`&&d.pauseTimers();let t=de(e.nativeEvent);if(t&&t.closest(`button,a,input,textarea,[role="button"],${Ml}`))return;if(L.current=!1,F.current=void 0,te.current=0,ie.current=e.pointerId,N.current={x:e.clientX,y:e.clientY},R.current=N.current,j.current){let e=El(j.current);P.current=e,C(e),pe({x:e.x,y:e.y})}d.setHovering(!0),h(!0),_(!1),k(null),ne.current=!0;let n=j.current;if(n){ae.current?.abort();let t=new AbortController;ae.current=t;let r=B(n);r.addEventListener(`pointerup`,he,{signal:t.signal}),r.addEventListener(`pointercancel`,he,{signal:t.signal}),n.setPointerCapture?.(e.pointerId)}}function _e(e){if(e.pointerId!==ie.current)return;e.preventDefault(),ne.current&&=(N.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>R.current.y||i>0&&t<R.current.y)&&(R.current={x:R.current.x,y:t}),(r<0&&n>R.current.x||r>0&&n<R.current.x)&&(R.current={x:n,y:R.current.y});let a=n-N.current.x,o=t-N.current.y,s=t-R.current.y,c=n-R.current.x;if(!g&&Math.sqrt(a*a+o*o)>=jl&&(_(!0),O===null)){let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&k(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let u;if(!F.current)O===`vertical`?o>0?u=`down`:o<0&&(u=`up`):O===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&l.includes(u)&&(F.current=u,te.current=Tl(u,a,o),p(u));else{let e=F.current,t=Tl(e,c,s);t>Ol?(L.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&te.current-t>=kl&&(L.current=!0)}let d=me(a,o),f=P.current.x,m=P.current.y;O===`horizontal`?(l.includes(`left`)||l.includes(`right`))&&(f+=d.x):(O===`vertical`||(l.includes(`left`)||l.includes(`right`))&&(f+=d.x),(l.includes(`up`)||l.includes(`down`))&&(m+=d.y)),pe({x:f,y:m})}function ve(e){if(e.key===`Escape`){if(!j.current||!ee(j.current,A(B(j.current))))return;d.closeToast(n.id)}}K.useEffect(()=>{if(!u)return;let e=j.current;if(!e)return;function t(t){ee(e,de(t))&&t.preventDefault()}return I(e,`touchmove`,t,{passive:!1})},[u]);function ye(){if(!m&&b.x===S.x&&b.y===S.y&&!v)return{[Cl.swipeMovementX]:`0px`,[Cl.swipeMovementY]:`0px`};let e=b.x-S.x,t=b.y-S.y;return{transition:m?`none`:void 0,transform:m?`translateX(${b.x}px) translateY(${b.y}px) scale(${S.scale})`:void 0,[Cl.swipeMovementX]:`${e}px`,[Cl.swipeMovementY]:`${t}px`}}let be=n.priority===`high`,xe={role:be?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":E,"aria-hidden":be&&!le?!0:void 0,onPointerDown:u?ge:void 0,onPointerMove:u?_e:void 0,onPointerUp:u?he:void 0,onPointerCancel:u?he:void 0,onKeyDown:ve,inert:nt(n.limited),style:{...ye(),[Cl.index]:n.transitionStatus===`ending`?oe:se,[Cl.offsetY]:`${ce}px`,[Cl.height]:n.height?`${n.height}px`:void 0}},Ce=K.useMemo(()=>({rootRef:j,toast:n,titleId:w,setTitleId:T,descriptionId:E,setDescriptionId:D,swiping:m,swipeDirection:f,recalculateHeight:fe,index:oe,visibleIndex:se,expanded:ue}),[n,w,E,m,f,fe,oe,se,ue]),we={transitionStatus:n.transitionStatus,expanded:ue,limited:n.limited||!1,type:n.type,swiping:Ce.swiping,swipeDirection:Ce.swipeDirection},Te=M(`div`,e,{ref:[t,Ce.rootRef],state:we,stateAttributesMapping:Dl,props:[xe,s]});return(0,q.jsx)(xl.Provider,{value:Ce,children:Te})}),Pl=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=Sl(),l=K.useRef(null);return z(()=>{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]),M(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})}),Fl=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setDescriptionId:l}=Sl(),u=o??c.description,d=!!u,f=p(a);z(()=>{if(d)return l(f),()=>{l(void 0)}},[d,f,l]);let m=M(`p`,e,{ref:t,state:{type:c.type},props:{...s,id:f,children:u}});return d?m:null}),Il=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setTitleId:l}=Sl(),u=o??c.title,d=!!u,f=p(a);z(()=>{if(d)return l(f),()=>{l(void 0)}},[d,f,l]);let m=M(`h2`,e,{ref:t,state:{type:c.type},props:{...s,id:f,children:u}});return d?m:null}),Ll=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=dl(),{toast:l}=Sl(),u=c.useState(`expanded`),[d,f]=K.useState(!1),{getButtonProps:p,buttonRef:m}=Ge({disabled:a,native:o}),h={type:l.type};return M(`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]})}),Rl=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=Sl(),l=c.actionProps?.children??s.children,u=!!l,{getButtonProps:d,buttonRef:f}=Ge({disabled:a,native:o}),p={type:c.type},m=M(`button`,e,{ref:[t,f],state:p,props:[s,c.actionProps,d,{children:l}]});return u?m:null}),zl=K.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=ze({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,q.jsxs)(K.Fragment,{children:[l,c&&mi.createPortal(n,c)]})}),Bl=zl,Vl=K.createContext(void 0);function Hl(){let e=K.useContext(Vl);if(e===void 0)throw Error(We(84));return e}var Ul=K.forwardRef(function(e,t){let{toast:n,...r}=e,i=dl(),a=n.positionerProps??se,{render:o,className:s,anchor:c=a.anchor,positionMethod:l=a.positionMethod??`absolute`,side:u=a.side??`top`,align:d=a.align??`center`,sideOffset:p=a.sideOffset??0,alignOffset:m=a.alignOffset??0,collisionBoundary:h=a.collisionBoundary??`clipping-ancestors`,collisionPadding:g=a.collisionPadding??5,arrowPadding:_=a.arrowPadding??5,sticky:v=a.sticky??!1,disableAnchorTracking:y=a.disableAnchorTracking??!1,collisionAvoidance:b=a.collisionAvoidance??He,style:x,...S}=r,[w,T]=K.useState(null),E=i.useState(`toastIndex`,n.id),D=i.useState(`toastVisibleIndex`,n.id),O=Fe(c)?c:null,k=Ze({anchor:O,positionMethod:l,floatingRootContext:C({open:!0,onOpenChange:f,elements:{floating:w,reference:O}}),mounted:!0,side:u,sideOffset:p,align:d,alignOffset:m,collisionBoundary:h,collisionPadding:g,sticky:v,arrowPadding:_,disableAnchorTracking:y,keepMounted:!0,collisionAvoidance:b}),A=Ie(e,K.useMemo(()=>({side:k.side,align:k.align,anchorHidden:k.anchorHidden}),[k.side,k.align,k.anchorHidden]),{styles:{...k.positionerStyles,[Cl.index]:n.transitionStatus===`ending`?E:D},transitionStatus:n.transitionStatus,props:S,refs:[t,T]});return(0,q.jsx)(Vl.Provider,{value:k,children:A})}),Wl=K.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{arrowRef:o,side:s,align:c,arrowUncentered:l,arrowStyles:u}=Hl();return M(`div`,e,{state:{side:s,align:c,uncentered:l},ref:[t,o],props:[{style:u,"aria-hidden":!0},a]})});function Gl(){let e=K.useContext(ul);if(!e)throw Error(We(73));let t=e.useState(`toasts`);return K.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Kl(){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||pl(`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 ql=t({Action:()=>Rl,Arrow:()=>Wl,Close:()=>Ll,Content:()=>Pl,Description:()=>Fl,Portal:()=>Bl,Positioner:()=>Ul,Provider:()=>vl,Root:()=>Nl,Title:()=>Il,Viewport:()=>bl,createToastManager:()=>Kl,useToastManager:()=>Gl});function Jl(e){if(typeof e!=`object`||!e||!(`children`in e))return!1;let t=e.children;return t!=null&&t!==!1&&t!==``}function Yl(e,t){return t<=1?!1:e>0}function Xl(e){let t=0,n=0,r=0,i=0,a=e.map(e=>{let a=Zl(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:Zl(e.find(e=>e.transitionStatus!==`ending`)?.height),items:a}}function Zl(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function Ql(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}var $l=K.createContext(void 0);function eu(e){let t=K.useContext($l);if(t===void 0&&!e)throw Error(We(72));return t}var tu={...fe,disabled:m(e=>e.disabled),instantType:m(e=>e.instantType),isInstantPhase:m(e=>e.isInstantPhase),trackCursorAxis:m(e=>e.trackCursorAxis),disableHoverablePopup:m(e=>e.disableHoverablePopup),lastOpenChangeReason:m(e=>e.openChangeReason),closeOnClick:m(e=>e.closeOnClick),closeDelay:m(e=>e.closeDelay),hasViewport:m(e=>e.hasViewport)},nu=class e extends P{constructor(e,t,n=!1){let r=new st,i={...ru(),...e};i.floatingRootContext=te(r,t,n),super(i,{popupRef:K.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:r},tu)}setOpen=(e,t)=>{let n=t.reason,r=n===ue,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0),xe(r,e,t.trigger),this.update(r)};r?mi.flushSync(o):o()};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,we(it,e))}static useStore(t,n){return F(t,(t,r)=>new e(n,t,r)).store}};function ru(){return{...j(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var iu=De(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=nu.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});Pe(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),p.useSyncedValue(`disabled`,t),k(p);let{forceUnmount:y,transitionStatus:b}=be(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=K.useRef(null);z(()=>{m&&t&&p.setOpen(!1,we(rt))},[m,t,p]),z(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),z(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let T=K.useCallback(()=>{p.setOpen(!1,we(pe))},[p]);K.useImperativeHandle(o,()=>({unmount:y,close:T}),[y,T]);let E=h||_||!t&&a!==`none`;return(0,q.jsxs)($l.Provider,{value:p,children:[E&&(0,q.jsx)(au,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function au({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Qe(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=pi(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n});return Ce(e,{activeTriggerProps:K.useMemo(()=>Te(a.reference,i.reference),[a.reference,i.reference]),inactiveTriggerProps:K.useMemo(()=>Te(a.trigger,i.trigger),[a.trigger,i.trigger]),popupProps:K.useMemo(()=>Te(_,a.floating,i.floating),[a.floating,i.floating])}),null}var ou=K.createContext(void 0);function su(){return K.useContext(ou)}var cu=function(e){return e[e.popupOpen=E.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),lu=`data-base-ui-tooltip-trigger`;function uu(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(Fe(n))return n}}let t=e.target;return Fe(t)?t:null}function du(e){let t=e;for(;t;){if(t.hasAttribute(lu))return t;let e=t.parentElement;if(e){t=e;continue}let n=t.getRootNode();t=`host`in n&&Fe(n.host)?n.host:null}return null}var fu=le(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=eu(!0),m=a?.store??p;if(!m)throw Error(We(82));let g=ce(d),_=m.useState(`isTriggerActive`,g),v=m.useState(`isOpenedByTrigger`,g),y=m.useState(`floatingRootContext`),b=K.useRef(null),x=c??600,S=u??0,{registerTrigger:C,isMountedByThisTrigger:T}=Xe(g,b,m,{payload:o,closeOnClick:l,closeDelay:S}),E=su(),{delayRef:D,isInstantPhase:O,hasProvider:k}=ui(y,{open:v}),A=ne(y);m.useSyncedValue(`isInstantPhase`,O);let j=m.useState(`disabled`),N=s??j,P=h(N),F=m.useState(`trackCursorAxis`),te=m.useState(`disableHoverablePopup`),I=K.useRef(!1),L=ye(),R=K.useRef(void 0);function re(){let e=E?.delay,t=typeof D.current==`object`?D.current.open:void 0,n=x;return k&&(n=t===0?0:c??e??x),n}function ae(e){let t=b.current;if(!t||!e)return!1;let n=du(e);return n!==null&&n!==t&&ee(t,n)}function se(e){let t=ae(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let le=Re(y,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!te&&F!==`both`?ie():null,restMs:re,delay(){let e=typeof D.current==`object`?D.current.close:void 0,t=S;return u==null&&k&&(t=e),{close:t}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),de=oe(y,{enabled:!N}).reference,fe=e=>{let t=I.current,n=uu(e),r=se(n),i=b.current,a=i&&n&&ee(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,we(ue,e));return}if(t&&!r&&a&&!P.current&&!m.select(`open`)&&i&&at(R.current)){let t=()=>{!I.current&&!P.current&&!m.select(`open`)&&m.setOpen(!0,we(ue,e,i))},n=re();n===0?(L.clear(),t()):L.start(n,t)}},pe=m.useState(`triggerProps`,T);return M(`button`,e,{state:{open:v},ref:[t,C,b],props:[le,de,T||F!==`none`?pe:void 0,{onMouseOver(e){fe(e.nativeEvent)},onFocus(e){ae(uu(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:g,[cu.triggerDisabled]:N?``:void 0,[lu]:N?void 0:``},f],stateAttributesMapping:w})}),pu=K.createContext(void 0);function mu(){let e=K.useContext(pu);if(e===void 0)throw Error(We(70));return e}var hu=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return eu().useState(`mounted`)||n?(0,q.jsx)(pu.Provider,{value:n,children:(0,q.jsx)(zl,{ref:t,...r})}):null}),gu=K.createContext(void 0);function _u(){let e=K.useContext(gu);if(e===void 0)throw Error(We(71));return e}var vu=K.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=He,style:g,..._}=e,v=eu(),y=mu(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=Ze({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`hasViewport`)?je:void 0}),O=Ie(e,K.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,q.jsx)(gu.Provider,{value:D,children:O})}),yu={...ve,...Ye},bu=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=eu(),{side:s,align:c}=_u(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Se({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),L(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return M(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[f,Ne(d),a],stateAttributesMapping:yu})}),xu=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=K.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=K.useMemo(()=>({open:t,close:n}),[t,n]);return(0,q.jsx)(ou.Provider,{value:i,children:(0,q.jsx)(li,{delay:a,timeoutMs:r,children:e.children})})},Su=function(e){return e.popupWidth=`--popup-width`,e.popupHeight=`--popup-height`,e}({}),Cu={activationDirection:e=>e?{"data-activation-direction":e}:null},wu=K.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=eu(),c=_u(),l=s.useState(`instantType`),{children:u,state:d}=Ci({store:s,side:c.side,cssVars:Su,children:a});return M(`div`,e,{state:{activationDirection:d.activationDirection,transitioning:d.transitioning,instant:l},ref:t,props:[o,{children:u}],stateAttributesMapping:Cu})}),Tu=xu,Eu=iu;function Du(e){let t=(0,J.c)(2),n;return t[0]===e?n=t[1]:(n=(0,q.jsx)(fu,{"data-slot":`tooltip-trigger`,...e}),t[0]=e,t[1]=n),n}function Ou(e){let t=(0,J.c)(24),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({className:i,align:o,sideOffset:s,side:c,variant:l,anchor:n,children:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=o===void 0?`center`:o,d=s===void 0?4:s,f=c===void 0?`top`:c,p=(l===void 0?`default`:l)===`glass`?`dropdown-glass text-popover-foreground shadow-popover`:`bg-foreground text-background shadow-card`,m;t[9]!==i||t[10]!==p?(m=H(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) text-balance rounded-small text-[11px] transition-[width,height,scale,opacity] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 data-instant:duration-0`,p,i),t[9]=i,t[10]=p,t[11]=m):m=t[11];let h;t[12]===r?h=t[13]:(h=(0,q.jsx)(wu,{className:`relative size-full overflow-clip px-(--viewport-inline-padding) py-1 [--viewport-inline-padding:--spacing(2)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:truncate **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,"data-slot":`tooltip-viewport`,children:r}),t[12]=r,t[13]=h);let g;t[14]!==a||t[15]!==m||t[16]!==h?(g=(0,q.jsx)(bu,{className:m,"data-slot":`tooltip-popup`,...a,children:h}),t[14]=a,t[15]=m,t[16]=h,t[17]=g):g=t[17];let _;return t[18]!==u||t[19]!==n||t[20]!==f||t[21]!==d||t[22]!==g?(_=(0,q.jsx)(hu,{children:(0,q.jsx)(vu,{align:u,anchor:n,className:`pointer-events-none z-[140] h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,"data-slot":`tooltip-positioner`,side:f,sideOffset:d,children:g})}),t[18]=u,t[19]=n,t[20]=f,t[21]=d,t[22]=g,t[23]=_):_=t[23],_}var ku={children:null};function Au(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 ju=Kl(),Mu=Kl(),Nu=new Map,Pu={error:Zr,info:jr,loading:Kt,success:dr,warning:Vr},Fu=180;function Iu(e,t){if(!(e!==`error`||typeof t!=`string`)&&!(t.length<Fu))return`line-clamp-4`}var Lu=`absolute z-20 -top-1.5 -right-1.5`,Ru=H(`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 zu(e,t,n){n?.(),e.close(t)}function Bu(e){let t=(0,J.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}=ll(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,q.jsx)(Je,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":o,className:`[--control-icon-color:currentColor] rounded-md text-muted-foreground/80 hover:bg-transparent hover:text-muted-foreground`,onClick:s}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;t[7]===a?l=t[8]:(l=a?(0,q.jsx)(tr,{className:`size-3 text-success`}):(0,q.jsx)(xr,{className:`size-3`}),t[7]=a,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,q.jsx)(Du,{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,q.jsx)(Ou,{side:`top`,children:o}),t[12]=o,t[13]=d);let f;return t[14]!==u||t[15]!==d?(f=(0,q.jsxs)(Eu,{children:[u,d]}),t[14]=u,t[15]=d,t[16]=f):f=t[16],f}var Vu=`mt-2 max-h-40 min-h-0 overflow-y-auto overscroll-contain pr-0.5 select-text`;function Hu(e){let t=(0,J.c)(13),{children:n,labels:r}=e,[i,a]=(0,K.useState)(!1),o=r.expand??`Show details`,s=r.collapse??`Hide details`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(Uu),t[0]=c):c=t[0];let l;t[1]===i?l=t[2]:(l=i?(0,q.jsx)(Gn,{className:`size-3.5 shrink-0 opacity-80`,weight:`bold`}):(0,q.jsx)(_e,{className:`size-3.5 shrink-0 opacity-80`,weight:`bold`}),t[1]=i,t[2]=l);let u=i?s:o,d;t[3]!==i||t[4]!==l||t[5]!==u?(d=(0,q.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,q.jsx)(`div`,{className:Vu,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,q.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function Uu(e){return!e}function Wu(e){let t=(0,J.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=H(`min-w-0 select-text wrap-break-word text-muted-foreground`,Iu(i,r)),t[2]=r,t[3]=i,t[4]=l):l=t[4];let u=l,[d,f]=(0,K.useState)(!1);if(!a){let e;return t[5]===u?e=t[6]:(e=(0,q.jsx)(Fl,{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,q.jsx)(Fl,{className:u,"data-slot":`toast-description`}),t[7]=u,t[8]=e);let n;t[9]!==a||t[10]!==s?(n=(0,q.jsx)(Hu,{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,q.jsxs)(q.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`,h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>f(Gu),t[15]=h):h=t[15];let g=h,_;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g())},t[16]=_):_=t[16];let v=_,y=d?m:p,b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=H(`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]=b):b=t[17];let x;t[18]!==d||t[19]!==y?(x=(0,q.jsx)(`div`,{"aria-label":y,"aria-expanded":d,className:b,onClick:g,onKeyDown:v,role:`button`,tabIndex:0}),t[18]=d,t[19]=y,t[20]=x):x=t[20];let S;t[21]!==r||t[22]!==i?(S=H(`min-w-0 select-none wrap-break-word text-muted-foreground`,Iu(i,r),`underline-offset-2 decoration-muted-foreground/60 group-hover:underline`),t[21]=r,t[22]=i,t[23]=S):S=t[23];let C;t[24]===S?C=t[25]:(C=(0,q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,q.jsx)(Fl,{className:S,"data-slot":`toast-description`})}),t[24]=S,t[25]=C);let w;t[26]===d?w=t[27]:(w=d?(0,q.jsx)(Gn,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,weight:`bold`}):(0,q.jsx)(_e,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,weight:`bold`}),t[26]=d,t[27]=w);let T;t[28]!==w||t[29]!==x||t[30]!==C?(T=(0,q.jsxs)(Du,{render:x,children:[C,w]}),t[28]=w,t[29]=x,t[30]=C,t[31]=T):T=t[31];let E=d?m:p,D;t[32]===E?D=t[33]:(D=(0,q.jsx)(Ou,{side:`top`,children:E}),t[32]=E,t[33]=D);let O;t[34]!==T||t[35]!==D?(O=(0,q.jsxs)(Eu,{children:[T,D]}),t[34]=T,t[35]=D,t[36]=O):O=t[36];let k;t[37]!==a||t[38]!==d?(k=d?(0,q.jsx)(`div`,{className:Vu,children:a}):null,t[37]=a,t[38]=d,t[39]=k):k=t[39];let A;return t[40]!==O||t[41]!==k?(A=(0,q.jsxs)(q.Fragment,{children:[O,k]}),t[40]=O,t[41]=k,t[42]=A):A=t[42],A}function Gu(e){return!e}function Ku(e){let t=e.type?Pu[e.type]:null,n=Jl(e.actionProps)&&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||Jl(e.actionProps)||o||s;return{Icon:t,stackedActionLayout:n,actionVariant:r,secondaryActionVariant:i,copyErrorText:a,hasTrailingControls:c,inlineContentEndPad:c?`pr-6`:`pr-10`}}function qu(e){let t=(0,J.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=H(`flex min-w-0 gap-2`,y),t[7]=y,t[8]=b);let x;t[9]!==r||t[10]!==h?(x=h?(0,q.jsx)(`div`,{className:`flex h-lh w-4 shrink-0 items-center justify-center`,"data-slot":`toast-icon`,children:h}):r?(0,q.jsx)(`div`,{className:`[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,"data-slot":`toast-icon`,children:(0,q.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=H(`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,q.jsx)(Il,{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,q.jsx)(Wu,{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,q.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,q.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,q.jsxs)(`div`,{className:H(`flex items-center gap-1.5`,n?`w-full justify-end`:`shrink-0`),children:[i===null?null:(0,q.jsx)(Bu,{text:i}),p.map(e=>{let{id:t,props:n}=e,{className:r,...i}=n;return(0,K.createElement)(Je,{...i,className:r,key:t,size:`xs`,type:`button`,variant:s})}),m?(0,q.jsx)(Je,{...v,className:_,size:`xs`,type:`button`,variant:s}):null,Jl(a)?(0,q.jsx)(Rl,{className:H(Ue({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,q.jsxs)(q.Fragment,{children:[D,O]}),t[37]=D,t[38]=O,t[39]=k):k=t[39],k}function Ju(){let e=(0,J.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1,select:Yu},e[0]=t):t=e[0];let n=Dn(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=x(r),a;bb0:{if(n?.kind===`server`){a=n.threadRef;break bb0}if(n?.kind===`draft`&&i?.environmentId){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 Yu(e){return el(e)}function Xu(e){let t=(0,J.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=Nu.get(n)??r,t=null,i=null,a=!1,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{a||(a=!0,Nu.delete(n),ju.close(n))},c=()=>{t!==null&&(e=Math.max(0,e-(Date.now()-t)),t=null,o(),Nu.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,K.useEffect)(i,a),null}function Zu(e){let t=(0,J.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,q.jsx)(Qu,{position:a}),t[4]=a,t[5]=o);let s;return t[6]!==n||t[7]!==r||t[8]!==o?(s=(0,q.jsxs)(vl,{toastManager:ju,...r,children:[n,o]}),t[6]=n,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function Qu(e){let t=(0,J.c)(19),{position:n}=e,{toasts:r}=Gl(),i=Ju(),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=>Ql(e.data,i),t[2]=i,t[3]=s);let c=Xl(r.filter(s)),l,u;t[4]===r?(l=t[5],u=t[6]):(l=()=>{let e=new Set(r.map($u));for(let t of Nu.keys())e.has(t)||Nu.delete(t)},u=[r],t[4]=r,t[5]=l,t[6]=u),(0,K.useEffect)(l,u);let d=ql,f=ql,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=H(`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=Yl(r,c.items.length),s=Ku(t),{stackedActionLayout:l,inlineContentEndPad:u}=s;return(0,q.jsxs)(Nl,{className:H(`dropdown-glass absolute z-[calc(9999-var(--toast-index))] w-full overflow-visible select-none rounded-control text-popover-foreground [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,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,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,q.jsx)(Xu,{dismissAfterVisibleMs:t.data?.dismissAfterVisibleMs,toastId:t.id}),(0,q.jsx)(`div`,{className:Lu,children:(0,q.jsx)(`button`,{"aria-label":`Dismiss notification`,className:Ru,"data-slot":`toast-close`,onClick:()=>zu(ju,t.id,t.data?.onClose),type:`button`,children:(0,q.jsx)(si,{className:`size-3`,weight:`bold`})})}),(0,q.jsx)(Pl,{className:H(`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`:H(`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,q.jsx)(qu,{...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,q.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,q.jsx)(d.Portal,{"data-slot":`toast-portal`,children:v}),t[16]=v,t[17]=d.Portal,t[18]=y):y=t[18],y}function $u(e){return e.id}function ed(e){let t=(0,J.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,q.jsx)(td,{}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,q.jsxs)(vl,{toastManager:Mu,...r,children:[n,i]}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function td(){let e=(0,J.c)(7),{toasts:t}=Gl(),n=Ju(),r;if(e[0]!==n||e[1]!==t){let i;e[3]===n?i=e[4]:(i=e=>Ql(e.data,n),e[3]=n,e[4]=i),r=t.filter(i).map(nd),e[0]=n,e[1]=t,e[2]=r}else r=e[2];let i;return e[5]===r?i=e[6]:(i=(0,q.jsx)(Bl,{"data-slot":`toast-portal-anchored`,children:(0,q.jsx)(bl,{className:`outline-none`,"data-slot":`toast-viewport-anchored`,children:r})}),e[5]=r,e[6]=i),i}function nd(e){let t=e.data?.tooltipStyle??!1,n=e.positionerProps,r=Ku(e),{stackedActionLayout:i,inlineContentEndPad:a}=r;return n?.anchor?(0,q.jsx)(Ul,{className:`z-100 max-w-[min(--spacing(64),var(--available-width))]`,"data-slot":`toast-positioner`,sideOffset:n.sideOffset??4,toast:e,children:(0,q.jsx)(Nl,{className:H(`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-small`:`rounded-control`),"data-slot":`toast-popup`,toast:e,children:t?(0,q.jsx)(Pl,{className:`pointer-events-auto px-2 py-1`,children:(0,q.jsx)(Il,{"data-slot":`toast-title`})}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:Lu,children:(0,q.jsx)(`button`,{"aria-label":`Dismiss notification`,className:Ru,"data-slot":`toast-close`,onClick:()=>zu(Mu,e.id,e.data?.onClose),type:`button`,children:(0,q.jsx)(si,{className:`size-3`,weight:`bold`})})}),(0,q.jsx)(Pl,{className:H(`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`:H(`py-3`,`flex items-center justify-between gap-1.5`,a)),children:(0,q.jsx)(qu,{...r,actionProps:e.actionProps,toastData:e.data,toastDescription:e.description,toastType:e.type})})]})})},e.id):null}var rd=K.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=ge(),C=h||s,w=m??a,T={...p,disabled:C},{labelId:E}=Ae(),D=Oe({id:i});z(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let O=K.useRef(null);z(()=>{u&&O.current===A(B(O.current))&&y(!0)},[u,y]);let[k]=Ve({controlled:o,default:l,name:`FieldControl`,state:`value`}),j=o!==void 0,N=j?k:void 0,P=V(()=>S.inputRef.current?.value);return me(S.inputRef,D,N,P),M(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...j?{value:N}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,we(ae,e.nativeEvent)),_(t!==v.initialValue),b(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),f],stateAttributesMapping:re})});function id(e){let t=(0,J.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,unstyled:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a===void 0?!1:a,c;t[5]!==n||t[6]!==s?(c=H(!s&&`relative inline-flex w-full rounded-control border border-input bg-canvas-quiet text-base text-foreground transition-[border-color,box-shadow] has-aria-invalid:border-destructive/50 has-focus-visible:border-ring has-focus-visible:ring-2 has-focus-visible:ring-selection has-disabled:opacity-64 sm:text-sm`,n)||void 0,t[5]=n,t[6]=s,t[7]=c):c=t[7];let l;t[8]!==r||t[9]!==o?(l=(0,q.jsx)(rd,{render:e=>(0,q.jsx)(`textarea`,{className:H(`field-sizing-content min-h-17.5 w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none max-sm:min-h-20.5`,o===`sm`&&`min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5`,o===`lg`&&`min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5`),"data-slot":`textarea`,...Te(e,r)})}),t[8]=r,t[9]=o,t[10]=l):l=t[10];let u;return t[11]!==o||t[12]!==c||t[13]!==l?(u=(0,q.jsx)(`span`,{className:c,"data-size":o,"data-slot":`textarea-control`,children:l}),t[11]=o,t[12]=c,t[13]=l,t[14]=u):u=t[14],u}export{Ja as $,ln as $t,zc as A,Zr as At,Xo as B,bn as Bt,Bc as C,ki as Ct,Vc as D,gi as Dt,Hc as E,Ci as Et,Nc as F,tr as Ft,Jo as G,gn as Gt,Zo as H,vn as Ht,Dc as I,Gn as It,lo as J,sn as Jt,zo as K,cn as Kt,Q as L,Dn as Lt,Mc as M,jr as Mt,jc as N,xr as Nt,Uc as O,hi as Ot,Pc as P,dr as Pt,no as Q,pn as Qt,dc as R,En as Rt,el as S,ji as St,Kc as T,Oi as Tt,$o as U,_n as Ut,Qo as V,yn as Vt,Lo as W,fn as Wt,oo as X,Yt as Xt,ro as Y,hn as Yt,$a as Z,Qt as Zt,Qc as _,$i as _t,Mu as a,ua as at,$c as b,Pi as bt,Au as c,ca as ct,Tu as d,aa as dt,qt as en,Va as et,Du as f,ia as ft,sl as g,Qi as gt,ll as h,na as ht,Zu as i,da as it,Rc as j,Vr as jt,Jc as k,si as kt,Eu as l,oa as lt,cl as m,Ji as mt,rd as n,tn as nn,Ma as nt,ju as o,la as ot,wl as p,sa as pt,co as q,mn as qt,ed as r,ja as rt,ku as s,ra as st,id as t,en as tn,Na as tt,Ou as u,ta as ut,Zc as v,ea as vt,Gc as w,Ai as wt,Xc as x,zi as xt,tl as y,Fi as yt,Cs as z,wn as zt};
2
- //# sourceMappingURL=textarea-xndIoUCV.js.map