@svenroth-ai/shipwright 0.29.0 → 0.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/client/dist/assets/{EmbeddedTerminal-IkAS1bic.js → EmbeddedTerminal-BXosRYLy.js} +1 -1
  2. package/client/dist/assets/{abnfDiagram-VCTEODGH-CclAL-Ri.js → abnfDiagram-VCTEODGH-BGxuVEiU.js} +1 -1
  3. package/client/dist/assets/{arc-C8vUxwav.js → arc-o82bcJs8.js} +1 -1
  4. package/client/dist/assets/{architectureDiagram-5GKGNRK7-DdrrZJx7.js → architectureDiagram-5GKGNRK7-CaeUIM7e.js} +1 -1
  5. package/client/dist/assets/{blockDiagram-I7D4REHJ-CMhbhsVq.js → blockDiagram-I7D4REHJ-DtWpTjgT.js} +1 -1
  6. package/client/dist/assets/{c4Diagram-7LVT6UL2-OvlH6BiV.js → c4Diagram-7LVT6UL2-sJULbaUv.js} +1 -1
  7. package/client/dist/assets/channel-CLBQbfQb.js +1 -0
  8. package/client/dist/assets/{chunk-2Q5K7J3B-BxUk85j7.js → chunk-2Q5K7J3B-CPeH4xHb.js} +1 -1
  9. package/client/dist/assets/{chunk-5VM5RSS4-DoTSs3Kn.js → chunk-5VM5RSS4-DxiKB3qZ.js} +1 -1
  10. package/client/dist/assets/{chunk-F27PBJKO-DquVu1wX.js → chunk-F27PBJKO-B8V1zhCX.js} +1 -1
  11. package/client/dist/assets/{chunk-IMKFNOWR-8l4wPLQK.js → chunk-IMKFNOWR-BtXet829.js} +1 -1
  12. package/client/dist/assets/{chunk-JWPE2WC7-CTAa0a4O.js → chunk-JWPE2WC7-BaQYKssR.js} +1 -1
  13. package/client/dist/assets/{chunk-POPQ4Y6H-BZ6zpqEF.js → chunk-POPQ4Y6H-I1x_vfH3.js} +1 -1
  14. package/client/dist/assets/{chunk-SVP7TREG-Dx7pMiq4.js → chunk-SVP7TREG-Bvt8jrSp.js} +1 -1
  15. package/client/dist/assets/{chunk-TICWLB2K-BtDKT858.js → chunk-TICWLB2K--9ywNq1F.js} +1 -1
  16. package/client/dist/assets/{chunk-XXDRQBXY-BbrrrzuM.js → chunk-XXDRQBXY-DrIyrBs1.js} +1 -1
  17. package/client/dist/assets/classDiagram-ZZMXUADV-D8z-o3xu.js +1 -0
  18. package/client/dist/assets/classDiagram-v2-VYDZK3BY-D8z-o3xu.js +1 -0
  19. package/client/dist/assets/{cose-bilkent-JH36ORCC-Bhem6unn.js → cose-bilkent-JH36ORCC-DISm8_p0.js} +1 -1
  20. package/client/dist/assets/{cynefin-OW5HDTMX-hukx0bAt.js → cynefin-OW5HDTMX-wyDjqucU.js} +1 -1
  21. package/client/dist/assets/{cynefinDiagram-5FMLGOSQ-CGogKYMK.js → cynefinDiagram-5FMLGOSQ-CN-IKDQ6.js} +1 -1
  22. package/client/dist/assets/{dagre-GXQ25YYZ-BiLo3XBj.js → dagre-GXQ25YYZ-QY0m5eSL.js} +1 -1
  23. package/client/dist/assets/{diagram-S7CK7UJ4-DBfdjdN6.js → diagram-S7CK7UJ4-DhjaAe2g.js} +1 -1
  24. package/client/dist/assets/{diagram-UQ7AKVKN-3CvmyZYO.js → diagram-UQ7AKVKN-D-3R3axg.js} +1 -1
  25. package/client/dist/assets/{diagram-VSXAHHWV-COG9399I.js → diagram-VSXAHHWV-BxXEtjRu.js} +1 -1
  26. package/client/dist/assets/{diagram-VX7I27RA-Dftpj84a.js → diagram-VX7I27RA-DkbXkJpd.js} +1 -1
  27. package/client/dist/assets/{diagram-Z3DM3KII-Dw9_CGLA.js → diagram-Z3DM3KII-DQGRD9gQ.js} +1 -1
  28. package/client/dist/assets/{ebnfDiagram-PWID7BFC-CJirhPah.js → ebnfDiagram-PWID7BFC-C_XxskCm.js} +1 -1
  29. package/client/dist/assets/{erDiagram-RLTQ6QDP-B11aYoo6.js → erDiagram-RLTQ6QDP-BhBsYQ7c.js} +1 -1
  30. package/client/dist/assets/{flowDiagram-HODETNUW-CPC6X9E5.js → flowDiagram-HODETNUW-D7fXEPrM.js} +1 -1
  31. package/client/dist/assets/{ganttDiagram-EL5Y4UJY-DDSk2AAg.js → ganttDiagram-EL5Y4UJY-Bwf8EtWr.js} +1 -1
  32. package/client/dist/assets/{gitGraphDiagram-WWUBYQGX-D_2UGciq.js → gitGraphDiagram-WWUBYQGX-C3_ixsOl.js} +1 -1
  33. package/client/dist/assets/{index-DDSwQXcp.js → index-DwRlIUrK.js} +231 -231
  34. package/client/dist/assets/{infoDiagram-27XIBGKW-BuUv5Wms.js → infoDiagram-27XIBGKW-BpcHmgOL.js} +1 -1
  35. package/client/dist/assets/{ishikawaDiagram-5VMMS53U-DpnAnJ0q.js → ishikawaDiagram-5VMMS53U-DzSGmhT5.js} +1 -1
  36. package/client/dist/assets/{journeyDiagram-3NMN7TZE-CFUsXz2q.js → journeyDiagram-3NMN7TZE-CT1CrVQO.js} +1 -1
  37. package/client/dist/assets/{kanban-definition-UXKFOSKX-BAq4Kujj.js → kanban-definition-UXKFOSKX-N1CNMAOm.js} +1 -1
  38. package/client/dist/assets/{layout-CccpfEe3.js → layout-CR8gdfo4.js} +1 -1
  39. package/client/dist/assets/{linear-BIeIr2tp.js → linear-CfLRjQgX.js} +1 -1
  40. package/client/dist/assets/{mermaid.core-B-Ezy6Me.js → mermaid.core-Bnqt31Q7.js} +5 -5
  41. package/client/dist/assets/{mindmap-definition-YA3MSWOX-CMPZ0Ggp.js → mindmap-definition-YA3MSWOX-Brc-v1M4.js} +1 -1
  42. package/client/dist/assets/{pegDiagram-XKGWAZYB-B0_2KQ6f.js → pegDiagram-XKGWAZYB-D8jUV01U.js} +1 -1
  43. package/client/dist/assets/{pieDiagram-E7YTZNPT-1-nOk5pZ.js → pieDiagram-E7YTZNPT-BiSkIsrz.js} +1 -1
  44. package/client/dist/assets/{quadrantDiagram-AXDQQJYC-C_RdmOuq.js → quadrantDiagram-AXDQQJYC-CJetqQxd.js} +1 -1
  45. package/client/dist/assets/{railroadDiagram-O6MQD6OU-o73KM0oq.js → railroadDiagram-O6MQD6OU-DTTtZpGO.js} +1 -1
  46. package/client/dist/assets/{requirementDiagram-BXWQKSXE-DnhCWJHv.js → requirementDiagram-BXWQKSXE-meFCoLtR.js} +1 -1
  47. package/client/dist/assets/{sankeyDiagram-P5KCCOFB-CVkYgfTV.js → sankeyDiagram-P5KCCOFB-BR9eN4Do.js} +1 -1
  48. package/client/dist/assets/{sequenceDiagram-WJ2MYXX4-BYLed29R.js → sequenceDiagram-WJ2MYXX4-BdVzFsCC.js} +1 -1
  49. package/client/dist/assets/{sizeCapture-INFHLROL-CYb4HDaH.js → sizeCapture-INFHLROL-CZoZ7r-1.js} +1 -1
  50. package/client/dist/assets/{stateDiagram-D77RDMKH-CNKFRye_.js → stateDiagram-D77RDMKH-Cmc-iYtm.js} +1 -1
  51. package/client/dist/assets/stateDiagram-v2-MP3YSRHH-Cj-hQ4qB.js +1 -0
  52. package/client/dist/assets/{swimlanes-42K2YHIH-BhsYrplp.js → swimlanes-42K2YHIH-DN4MssUX.js} +1 -1
  53. package/client/dist/assets/swimlanesDiagram-VR7AAH4N-DFxrYFKF.js +8 -0
  54. package/client/dist/assets/{timeline-definition-24CTP7MA-DiUXzB2p.js → timeline-definition-24CTP7MA-pxxqlxwt.js} +1 -1
  55. package/client/dist/assets/{vennDiagram-4TSXK5OY-aE4j6W86.js → vennDiagram-4TSXK5OY-DiItNcze.js} +1 -1
  56. package/client/dist/assets/{wardleyDiagram-VM6X3IG4-BxJXq0mU.js → wardleyDiagram-VM6X3IG4-Dfvub75z.js} +1 -1
  57. package/client/dist/assets/{xychartDiagram-S5SC5T6Z-4vHeL9zc.js → xychartDiagram-S5SC5T6Z-Bx83X515.js} +1 -1
  58. package/client/dist/index.html +1 -1
  59. package/package.json +1 -1
  60. package/server/package.json +1 -1
  61. package/client/dist/assets/channel-BtkABUIE.js +0 -1
  62. package/client/dist/assets/classDiagram-ZZMXUADV-2gEcH3cX.js +0 -1
  63. package/client/dist/assets/classDiagram-v2-VYDZK3BY-2gEcH3cX.js +0 -1
  64. package/client/dist/assets/stateDiagram-v2-MP3YSRHH-NpMhMQ36.js +0 -1
  65. package/client/dist/assets/swimlanesDiagram-VR7AAH4N-B4frkWBG.js +0 -8
@@ -1,4 +1,4 @@
1
- var cl=Object.defineProperty;var dl=(t,e,i)=>e in t?cl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var bs=(t,e,i)=>dl(t,typeof e!="symbol"?e+"":e,i);import{r as x,a as ul,h as _l,T as rn,b as fl,c as gl,d as pl,s as vl,j as J,p as nn,e as zo,f as ml,i as on,C as Sl,k as wl,u as bl,l as yl,m as Cl}from"./index-DDSwQXcp.js";const xl=5e3,kl=2,Ll=4e3,El=8e3,Rl=5e3,Ml=5e3,Ho=12,Bl=3e4,Tl=1e4;function Al(t=kl){let e=0;return{notePong(){e=0},tick(){return e>=t?"terminate":(e+=1,"ping")}}}function Dl(t){const e=Al(t.maxMissed),i=t.intervalMs??xl,s=t.setIntervalFn??setInterval,r=t.clearIntervalFn??clearInterval;let n=null,o=!1;const l=()=>{o||(o=!0,n!==null&&(r(n),n=null))};return n=s(()=>{if(!o){if(!t.isOpen()){l();return}if(e.tick()==="terminate"){t.onDead(),l();return}t.sendPing()}},i),{notePong:()=>e.notePong(),stop:l}}const Pl=2e3,Il=8e3;function Ol(t){const e=t.now??(()=>Date.now()),i=t.intervalMs??Pl,s=t.gapMs??Il,r=t.setIntervalFn??setInterval,n=t.clearIntervalFn??clearInterval;let o=e(),l=!1;const h=r(()=>{if(l)return;const a=e(),c=a-o;o=a,c>s&&t.onWake()},i);return{stop(){l||(l=!0,n(h))}}}function Fl(t){let e=!1,i=null;return{isAwaiting:()=>e,arm:()=>{var l;const n=t.getSocket();if(!n)return;t.sendPing(),e=!0,(l=t.onProbing)==null||l.call(t,!0);const o=n;i!==null&&t.clearTimeoutFn(i),i=t.setTimeoutFn(()=>{if(i=null,t.isCancelled()||!e)return;const h=t.getSocket();if(h===o&&h.readyState===t.openState)try{h.close()}catch{}},t.refocusProbeMs)},clear:()=>{var n;e&&((n=t.onProbing)==null||n.call(t,!1)),e=!1,i!==null&&(t.clearTimeoutFn(i),i=null)}}}function $l(t){const e=t.refocusProbeMs??Ll,i=t.setTimeoutFn??setTimeout,s=t.clearTimeoutFn??clearTimeout,r=t.nowFn??(()=>Date.now());let n=null,o=r(),l=0;const h=()=>{const g=t.getSocket();if(g)try{g.send(JSON.stringify({type:"ping"}))}catch{}},a=Fl({getSocket:t.getSocket,openState:t.openState,sendPing:h,isCancelled:t.isCancelled,onProbing:t.onProbing,refocusProbeMs:e,setTimeoutFn:i,clearTimeoutFn:s}),c=()=>{a.clear(),o=r(),n==null||n.stop(),n=Dl({isOpen:()=>{var g;return((g=t.getSocket())==null?void 0:g.readyState)===t.openState},sendPing:h,onDead:()=>{const g=t.getSocket();if(g)try{g.close()}catch{}},intervalMs:t.intervalMs,maxMissed:t.maxMissed,setIntervalFn:t.setIntervalFn,clearIntervalFn:t.clearIntervalFn})},d=()=>{n==null||n.stop(),n=null},u=()=>{o=r(),n==null||n.notePong(),a.clear()},_=()=>{if(t.isReplayOnly())return;t.rearmBudget();const g=t.getSocket();if(!g){t.reconnect();return}g.readyState===t.openState&&a.arm()},f=()=>{t.isCancelled()||typeof document<"u"&&document.hidden||_()},p=()=>{t.isCancelled()||_()},w=()=>{if(t.isCancelled())return;const g=r();g-o<=El||g-l<Rl||(l=g,_())},C=Ol({onWake:()=>{t.isCancelled()||_()},now:t.nowFn,intervalMs:t.wakeIntervalMs,gapMs:t.wakeGapMs,setIntervalFn:t.setIntervalFn,clearIntervalFn:t.clearIntervalFn}),k=typeof window<"u",L=typeof document<"u";return k&&(window.addEventListener("focus",f),window.addEventListener("pageshow",f),window.addEventListener("online",p)),L&&(document.addEventListener("visibilitychange",f),document.addEventListener("keydown",w,{capture:!0,passive:!0}),document.addEventListener("pointerdown",w,{capture:!0,passive:!0})),{onConnected:c,onDisconnected:d,noteInbound:u,dispose(){d(),a.clear(),C.stop(),k&&(window.removeEventListener("focus",f),window.removeEventListener("pageshow",f),window.removeEventListener("online",p)),L&&(document.removeEventListener("visibilitychange",f),document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}))}}}const Ai=[200,400,800,1600,3200];function Nl(t){return t<Ai.length?Ai[t]:t<Ai.length+Ho?Ml:Bl}function Wl(t){return t>=Ai.length+Ho}function zl(t){const e=t.timeoutMs??Tl,i=t.setTimeoutFn??setTimeout,s=t.clearTimeoutFn??clearTimeout;let r=null;const n=()=>{r!==null&&(s(r),r=null)};return{clear:n,arm(o){n(),r=i(()=>{if(r=null,!t.isCancelled()&&t.isCurrent(o)&&o.readyState===t.connectingState)try{o.close()}catch{}},e)}}}function Hl(t){const e=t.role==="writer"||t.role==="reader"?t.role:void 0,i=t.shellKind==="pwsh"||t.shellKind==="cmd"||t.shellKind==="posix"?t.shellKind:void 0;return{role:e,shellKind:i,replayOnly:typeof t.replayOnly=="boolean"?t.replayOnly:!1,scrollbackBytes:typeof t.scrollbackBytes=="number"&&t.scrollbackBytes>=0?t.scrollbackBytes:null,retentionDays:typeof t.retentionDays=="number"&&t.retentionDays>0?t.retentionDays:null,scrollbackDir:typeof t.scrollbackDir=="string"&&t.scrollbackDir.length>0?t.scrollbackDir:null,terminalReset:typeof t.terminalReset=="boolean"?t.terminalReset:!1,ptyReused:typeof t.ptyReused=="boolean"?t.ptyReused:!1}}function Ul(t){return typeof window>"u"?"":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/terminal/${encodeURIComponent(t)}/ws`}function Kl(t){const{taskId:e,urlOverride:i,enabled:s=!0,sessionEnded:r,onData:n,onBackpressure:o,onReadOnly:l,onReplaySnapshot:h}=t,a=x.useRef(n),c=x.useRef(o),d=x.useRef(l),u=x.useRef(h);x.useEffect(()=>{a.current=n},[n]),x.useEffect(()=>{c.current=o},[o]),x.useEffect(()=>{d.current=l},[l]),x.useEffect(()=>{u.current=h},[h]);const[_,f]=x.useState(!1),[p,w]=x.useState(null),[C,k]=x.useState(null),[L,g]=x.useState(null),[E,T]=x.useState(null),[O,$]=x.useState(null),[G,X]=x.useState(null),[N,m]=x.useState(null),[v,S]=x.useState(null),[y,b]=x.useState(!1),[R,A]=x.useState(null),[M,D]=x.useState(0),[H,Z]=x.useState(!1),[U,ue]=x.useState(!1),K=x.useRef(null),z=x.useRef(null),F=x.useRef(0),q=x.useRef(null),Q=x.useRef(!1),Ce=x.useRef(()=>{}),Ve=x.useRef(r);x.useEffect(()=>{Ve.current=r},[r]);const Se=x.useRef(r),ge=x.useCallback(()=>{f(!1),w(null),k(null),g(null),T(null),$(null),X(null),m(null),S(null),b(!1),Z(!1),ue(!1)},[]),j=x.useCallback(_e=>{const lt=K.current;if(!(!lt||lt.readyState!==WebSocket.OPEN))try{lt.send(JSON.stringify(_e))}catch{}},[]);return x.useEffect(()=>{if(!s||!e){ge(),q.current=null,Q.current=!1,Se.current=r;return}q.current=null,Q.current=!1,Se.current=r;let _e=!1;const lt=zl({connectingState:WebSocket.CONNECTING,isCancelled:()=>_e,isCurrent:We=>K.current===We}),mt=()=>{if(_e)return;q.current=null;const We=i??Ul(e);let Ge;try{Ge=new WebSocket(We)}catch(Mt){A(String(Mt)),_i();return}K.current=Ge,lt.arm(Ge),Ge.addEventListener("open",()=>{_e||K.current!==Ge||(lt.clear(),b(!0),F.current=0,D(0),Z(!1),ue(!1),A(null),Rt.onConnected())}),Ge.addEventListener("message",Mt=>{var Jr,Qr,en,tn;if(_e||K.current!==Ge)return;let Zt;try{Zt=JSON.parse(typeof Mt.data=="string"?Mt.data:"")}catch{return}if(!Zt||typeof Zt!="object")return;const ee=Zt;if(Rt.noteInbound(),ee.type==="ready"){const De=Hl(ee);De.role&&w(De.role),De.shellKind&&k(De.shellKind),g(De.replayOnly),q.current=De.replayOnly,De.replayOnly&&(Q.current=!0,Rt.onDisconnected(),Z(!1),ue(!1)),T(De.scrollbackBytes),$(De.retentionDays),X(De.scrollbackDir),m(De.terminalReset),S(De.ptyReused),f(!0);return}if(ee.type==="data"&&typeof ee.payload=="string"){(Jr=a.current)==null||Jr.call(a,ee.payload);return}if(ee.type==="backpressure"){const De=sn=>typeof sn=="number"?sn:0;(Qr=c.current)==null||Qr.call(c,{droppedBytes:De(ee.droppedBytes),droppedChunks:De(ee.droppedChunks),totalDroppedBytes:De(ee.totalDroppedBytes),episode:De(ee.episode),episodeEnded:ee.episodeEnded===!0});return}if(ee.type==="read_only"){(en=d.current)==null||en.call(d);return}if(ee.type==="scrollback-meta"){typeof ee.scrollbackBytes=="number"&&ee.scrollbackBytes>=0&&T(ee.scrollbackBytes);return}if(ee.type==="writer-promoted"){w("writer");return}if(ee.type==="replay_snapshot"&&typeof ee.data=="string"&&typeof ee.cols=="number"&&typeof ee.rows=="number"&&typeof ee.terminalVersion=="string"){(tn=u.current)==null||tn.call(u,{data:ee.data,cols:ee.cols,rows:ee.rows,terminalVersion:ee.terminalVersion});return}}),Ge.addEventListener("close",Mt=>{if(_e||K.current!==Ge)return;lt.clear(),b(!1),f(!1),K.current=null,Rt.onDisconnected();const Zt=Mt==null?void 0:Mt.code,ee=q.current===!0&&Zt===1e3;if(q.current=null,ee){if(Ve.current===!1){Q.current=!1,ge(),mt();return}return}_i()}),Ge.addEventListener("error",()=>{_e||K.current!==Ge||A("websocket error")})},_i=()=>{if(_e||Q.current)return;const We=F.current,Ge=Nl(We);F.current=We+1,We<Ai.length&&D(F.current),Z(!0),Wl(We)&&ue(!0),z.current=setTimeout(()=>{_e||mt()},Ge)},Rt=$l({getSocket:()=>K.current,openState:WebSocket.OPEN,isReplayOnly:()=>Q.current,isCancelled:()=>_e,rearmBudget:()=>{F.current=0,D(0)},reconnect:()=>{z.current&&(clearTimeout(z.current),z.current=null),mt()},onProbing:We=>Z(We)});return Ce.current=()=>{_e||(z.current&&(clearTimeout(z.current),z.current=null),Q.current=!1,q.current=null,F.current=0,D(0),ge(),mt())},mt(),()=>{_e=!0,Rt.dispose(),lt.clear(),z.current&&(clearTimeout(z.current),z.current=null);const We=K.current;if(K.current=null,We)try{We.close(1e3,"unmount")}catch{}ge(),q.current=null}},[s,e,i,ge]),x.useEffect(()=>{const _e=Se.current;Se.current=r,_e===!0&&r===!1&&Q.current&&Ce.current()},[r]),{ready:_,role:p,shellKind:C,replayOnly:L,scrollbackBytes:E,retentionDays:O,scrollbackDir:G,terminalReset:N,ptyReused:v,lastError:R,reconnectAttempts:M,reconnecting:H,reconnectStalled:U,send:j,open:y}}function ql(t){if(t.type!=="keydown"||t.metaKey)return"passthrough";if(t.altKey)return t.key.toLowerCase()==="v"&&!t.ctrlKey&&!t.shiftKey?"paste-image":"passthrough";const e=t.key.toLowerCase(),i=t.key==="Insert";return t.ctrlKey&&!t.shiftKey&&e==="v"||t.shiftKey&&!t.ctrlKey&&i?"paste":"passthrough"}async function Uo(){if(typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.read!="function")return null;try{return await navigator.clipboard.read()}catch{return null}}async function Ko(t){for(const e of t){const i=e.types.find(s=>s.startsWith("image/"));if(i)try{return await e.getType(i)}catch{}}return null}async function Vl(){const t=await Uo();return t?Ko(t):null}async function qo(){if(typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.readText!="function")return{ok:!1,reason:"unavailable"};const t=await Uo();if(t){const e=await Ko(t);if(e)return{ok:!0,image:e};for(const i of t)if(i.types.includes("text/plain"))try{return{ok:!0,text:await(await i.getType("text/plain")).text()}}catch{}}try{return{ok:!0,text:await navigator.clipboard.readText()}}catch{return{ok:!1,reason:"denied"}}}function Yl(t){const{term:e,isDisposed:i,notify:s,readClipboard:r,readImage:n,uploadImage:o}=t;return l=>{const h=ql(l);return h==="passthrough"?!0:h==="paste-image"?(l.preventDefault(),l.stopPropagation(),l.repeat||n().then(a=>{i()||(a?o(a):e.input("\x1Bv",!0))}),!1):(l.preventDefault(),l.stopPropagation(),l.repeat||r().then(a=>{if(!i())if(a.ok){if(a.image){o(a.image);return}a.text&&e.paste(a.text)}else a.reason==="unavailable"?s("paste-hint"):s("paste-failed")}),!1)}}async function jl(t){if(!t.writer||!t.term)return;const e=await qo();if(!t.isDisposed()){if(!e.ok)return t.notify(e.reason==="unavailable"?"paste-hint":"paste-failed");try{e.image?t.uploadImage(e.image):e.text&&t.term.paste(e.text)}catch{t.notify("paste-failed")}}}const an=1e6;function Gl(t){if(typeof atob!="function")return null;try{const e=atob(t.trim());try{return decodeURIComponent(Array.from(e).map(i=>"%"+i.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return e}}catch{return null}}function Xl(t){const e=t.indexOf(";"),i=e>=0?t.slice(e+1):t;if(i==="?")return{kind:"read"};if(i.length>Math.ceil(an*4/3)+4)return{kind:"invalid"};const s=Gl(i);return s===null?{kind:"invalid"}:s.length>an?{kind:"invalid"}:{kind:"write",text:s}}function Zl(t){const{copy:e,isDisposed:i,onError:s}=t;return r=>{const n=Xl(r);return n.kind==="write"&&n.text&&e(n.text).catch(()=>{i!=null&&i()||s==null||s()}),!0}}const Jl="\x1B",Vo=new RegExp("^"+Jl+"\\[<(\\d+);\\d+;\\d+[Mm]$");function Ql(t){const e=Vo.exec(t);if(!e)return!1;const i=Number(e[1]);return i<64&&(i&3)===2}function eh(t){return Vo.test(t)}function th(t){return Ql(t)?null:{type:eh(t)?"mouse":"data",payload:t}}const ih=0;function sh(){return{active:!1,identifier:null,lastY:0,pixelAccumulator:0}}function rh(t,e,i){if(i<=0)return 0;t.pixelAccumulator+=e;const s=Math.trunc(t.pixelAccumulator/i);return s!==0&&(t.pixelAccumulator-=s*i),s}function nh(t,e,i={}){const s=sh(),r=i.getPixelsPerLine??lh,n=e.style.getPropertyValue("touch-action");e.style.setProperty("touch-action","none");const o=a=>{if(a.touches.length!==1){s.active=!1,s.identifier=null;return}const c=a.touches[0];s.active=!0,s.identifier=c.identifier,s.lastY=c.clientY,s.pixelAccumulator=0},l=a=>{if(!s.active||s.identifier===null)return;let c=null;for(let _=0;_<a.touches.length;_++)if(a.touches[_].identifier===s.identifier){c=a.touches[_];break}if(!c)return;const d=s.lastY-c.clientY;s.lastY=c.clientY;const u=r(t,e);oh(t,s,d,u,c.clientX,c.clientY),a.cancelable&&a.preventDefault()},h=()=>{s.active=!1,s.identifier=null,s.pixelAccumulator=0};return e.addEventListener("touchstart",o,{passive:!0}),e.addEventListener("touchmove",l,{passive:!1}),e.addEventListener("touchend",h,{passive:!0}),e.addEventListener("touchcancel",h,{passive:!0}),()=>{e.removeEventListener("touchstart",o),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",h),e.removeEventListener("touchcancel",h),n?e.style.setProperty("touch-action",n):e.style.removeProperty("touch-action")}}function oh(t,e,i,s,r,n){const o=t.element??null,l=t.buffer.active.type==="alternate";if(o&&l){i!==0&&ah(o,i,r,n);return}const h=rh(e,i,s);h!==0&&t.scrollLines(h)}function ah(t,e,i,s){t.dispatchEvent(new WheelEvent("wheel",{deltaY:e,deltaMode:ih,clientX:i,clientY:s,bubbles:!0,cancelable:!0}))}function lh(t,e){const i=e.querySelector(".xterm-rows");if(i&&i.children.length>0){const r=i.children[0].getBoundingClientRect().height;if(r>0)return r}if(t.rows>0){const s=e.clientHeight/t.rows;if(s>0)return s}return 18}const hh=150;function ch(t,e,i,s={}){const r=s.requestFrame??(_=>requestAnimationFrame(_)),n=s.cancelFrame??(_=>cancelAnimationFrame(_)),o=s.setTimer??((_,f)=>setTimeout(_,f)),l=s.clearTimer??(_=>clearTimeout(_));let h=null,a=null;const c=()=>{if(!i())try{t.refresh(0,t.rows-1)}catch{}},d=()=>{i()||(h===null&&(h=r(()=>{h=null,c()})),a!==null&&l(a),a=o(()=>{var _,f;if(a=null,c(),!i())try{(f=(_=s.getHealAtlas)==null?void 0:_.call(s))==null||f()}catch{}},hh))},u=t.onScroll(d);return e.addEventListener("wheel",d,{passive:!0}),()=>{h!==null&&(n(h),h=null),a!==null&&(l(a),a=null);try{u.dispose()}catch{}e.removeEventListener("wheel",d)}}const dh=450,uh=3e3;function _h(t,e,i={}){const s=i.requestFrame??(L=>requestAnimationFrame(L)),r=i.cancelFrame??(L=>cancelAnimationFrame(L)),n=i.setTimer??((L,g)=>setTimeout(L,g)),o=i.clearTimer??(L=>clearTimeout(L));let l=!1,h=null,a=null,c=null;const d=()=>{if(!e())try{t.refresh(0,t.rows-1)}catch{}},u=()=>{h===null&&(h=s(()=>{h=null,d()}))},_=()=>{a!==null&&(o(a),a=null)},f=()=>{l=!1,_(),c!==null&&(o(c),c=null),h!==null&&(r(h),h=null)},p=()=>{e()||(l=!0,_(),c!==null&&o(c),c=n(f,uh))},w=()=>{!l||e()||(u(),_(),a=n(f,dh))},C=t.onWriteParsed(w),k=t.onResize(p);return{arm:p,dispose(){f();try{C.dispose()}catch{}try{k.dispose()}catch{}}}}/**
1
+ var cl=Object.defineProperty;var dl=(t,e,i)=>e in t?cl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var bs=(t,e,i)=>dl(t,typeof e!="symbol"?e+"":e,i);import{r as x,a as ul,h as _l,T as rn,b as fl,c as gl,d as pl,s as vl,j as J,p as nn,e as zo,f as ml,i as on,C as Sl,k as wl,u as bl,l as yl,m as Cl}from"./index-DwRlIUrK.js";const xl=5e3,kl=2,Ll=4e3,El=8e3,Rl=5e3,Ml=5e3,Ho=12,Bl=3e4,Tl=1e4;function Al(t=kl){let e=0;return{notePong(){e=0},tick(){return e>=t?"terminate":(e+=1,"ping")}}}function Dl(t){const e=Al(t.maxMissed),i=t.intervalMs??xl,s=t.setIntervalFn??setInterval,r=t.clearIntervalFn??clearInterval;let n=null,o=!1;const l=()=>{o||(o=!0,n!==null&&(r(n),n=null))};return n=s(()=>{if(!o){if(!t.isOpen()){l();return}if(e.tick()==="terminate"){t.onDead(),l();return}t.sendPing()}},i),{notePong:()=>e.notePong(),stop:l}}const Pl=2e3,Il=8e3;function Ol(t){const e=t.now??(()=>Date.now()),i=t.intervalMs??Pl,s=t.gapMs??Il,r=t.setIntervalFn??setInterval,n=t.clearIntervalFn??clearInterval;let o=e(),l=!1;const h=r(()=>{if(l)return;const a=e(),c=a-o;o=a,c>s&&t.onWake()},i);return{stop(){l||(l=!0,n(h))}}}function Fl(t){let e=!1,i=null;return{isAwaiting:()=>e,arm:()=>{var l;const n=t.getSocket();if(!n)return;t.sendPing(),e=!0,(l=t.onProbing)==null||l.call(t,!0);const o=n;i!==null&&t.clearTimeoutFn(i),i=t.setTimeoutFn(()=>{if(i=null,t.isCancelled()||!e)return;const h=t.getSocket();if(h===o&&h.readyState===t.openState)try{h.close()}catch{}},t.refocusProbeMs)},clear:()=>{var n;e&&((n=t.onProbing)==null||n.call(t,!1)),e=!1,i!==null&&(t.clearTimeoutFn(i),i=null)}}}function $l(t){const e=t.refocusProbeMs??Ll,i=t.setTimeoutFn??setTimeout,s=t.clearTimeoutFn??clearTimeout,r=t.nowFn??(()=>Date.now());let n=null,o=r(),l=0;const h=()=>{const g=t.getSocket();if(g)try{g.send(JSON.stringify({type:"ping"}))}catch{}},a=Fl({getSocket:t.getSocket,openState:t.openState,sendPing:h,isCancelled:t.isCancelled,onProbing:t.onProbing,refocusProbeMs:e,setTimeoutFn:i,clearTimeoutFn:s}),c=()=>{a.clear(),o=r(),n==null||n.stop(),n=Dl({isOpen:()=>{var g;return((g=t.getSocket())==null?void 0:g.readyState)===t.openState},sendPing:h,onDead:()=>{const g=t.getSocket();if(g)try{g.close()}catch{}},intervalMs:t.intervalMs,maxMissed:t.maxMissed,setIntervalFn:t.setIntervalFn,clearIntervalFn:t.clearIntervalFn})},d=()=>{n==null||n.stop(),n=null},u=()=>{o=r(),n==null||n.notePong(),a.clear()},_=()=>{if(t.isReplayOnly())return;t.rearmBudget();const g=t.getSocket();if(!g){t.reconnect();return}g.readyState===t.openState&&a.arm()},f=()=>{t.isCancelled()||typeof document<"u"&&document.hidden||_()},p=()=>{t.isCancelled()||_()},w=()=>{if(t.isCancelled())return;const g=r();g-o<=El||g-l<Rl||(l=g,_())},C=Ol({onWake:()=>{t.isCancelled()||_()},now:t.nowFn,intervalMs:t.wakeIntervalMs,gapMs:t.wakeGapMs,setIntervalFn:t.setIntervalFn,clearIntervalFn:t.clearIntervalFn}),k=typeof window<"u",L=typeof document<"u";return k&&(window.addEventListener("focus",f),window.addEventListener("pageshow",f),window.addEventListener("online",p)),L&&(document.addEventListener("visibilitychange",f),document.addEventListener("keydown",w,{capture:!0,passive:!0}),document.addEventListener("pointerdown",w,{capture:!0,passive:!0})),{onConnected:c,onDisconnected:d,noteInbound:u,dispose(){d(),a.clear(),C.stop(),k&&(window.removeEventListener("focus",f),window.removeEventListener("pageshow",f),window.removeEventListener("online",p)),L&&(document.removeEventListener("visibilitychange",f),document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}))}}}const Ai=[200,400,800,1600,3200];function Nl(t){return t<Ai.length?Ai[t]:t<Ai.length+Ho?Ml:Bl}function Wl(t){return t>=Ai.length+Ho}function zl(t){const e=t.timeoutMs??Tl,i=t.setTimeoutFn??setTimeout,s=t.clearTimeoutFn??clearTimeout;let r=null;const n=()=>{r!==null&&(s(r),r=null)};return{clear:n,arm(o){n(),r=i(()=>{if(r=null,!t.isCancelled()&&t.isCurrent(o)&&o.readyState===t.connectingState)try{o.close()}catch{}},e)}}}function Hl(t){const e=t.role==="writer"||t.role==="reader"?t.role:void 0,i=t.shellKind==="pwsh"||t.shellKind==="cmd"||t.shellKind==="posix"?t.shellKind:void 0;return{role:e,shellKind:i,replayOnly:typeof t.replayOnly=="boolean"?t.replayOnly:!1,scrollbackBytes:typeof t.scrollbackBytes=="number"&&t.scrollbackBytes>=0?t.scrollbackBytes:null,retentionDays:typeof t.retentionDays=="number"&&t.retentionDays>0?t.retentionDays:null,scrollbackDir:typeof t.scrollbackDir=="string"&&t.scrollbackDir.length>0?t.scrollbackDir:null,terminalReset:typeof t.terminalReset=="boolean"?t.terminalReset:!1,ptyReused:typeof t.ptyReused=="boolean"?t.ptyReused:!1}}function Ul(t){return typeof window>"u"?"":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/terminal/${encodeURIComponent(t)}/ws`}function Kl(t){const{taskId:e,urlOverride:i,enabled:s=!0,sessionEnded:r,onData:n,onBackpressure:o,onReadOnly:l,onReplaySnapshot:h}=t,a=x.useRef(n),c=x.useRef(o),d=x.useRef(l),u=x.useRef(h);x.useEffect(()=>{a.current=n},[n]),x.useEffect(()=>{c.current=o},[o]),x.useEffect(()=>{d.current=l},[l]),x.useEffect(()=>{u.current=h},[h]);const[_,f]=x.useState(!1),[p,w]=x.useState(null),[C,k]=x.useState(null),[L,g]=x.useState(null),[E,T]=x.useState(null),[O,$]=x.useState(null),[G,X]=x.useState(null),[N,m]=x.useState(null),[v,S]=x.useState(null),[y,b]=x.useState(!1),[R,A]=x.useState(null),[M,D]=x.useState(0),[H,Z]=x.useState(!1),[U,ue]=x.useState(!1),K=x.useRef(null),z=x.useRef(null),F=x.useRef(0),q=x.useRef(null),Q=x.useRef(!1),Ce=x.useRef(()=>{}),Ve=x.useRef(r);x.useEffect(()=>{Ve.current=r},[r]);const Se=x.useRef(r),ge=x.useCallback(()=>{f(!1),w(null),k(null),g(null),T(null),$(null),X(null),m(null),S(null),b(!1),Z(!1),ue(!1)},[]),j=x.useCallback(_e=>{const lt=K.current;if(!(!lt||lt.readyState!==WebSocket.OPEN))try{lt.send(JSON.stringify(_e))}catch{}},[]);return x.useEffect(()=>{if(!s||!e){ge(),q.current=null,Q.current=!1,Se.current=r;return}q.current=null,Q.current=!1,Se.current=r;let _e=!1;const lt=zl({connectingState:WebSocket.CONNECTING,isCancelled:()=>_e,isCurrent:We=>K.current===We}),mt=()=>{if(_e)return;q.current=null;const We=i??Ul(e);let Ge;try{Ge=new WebSocket(We)}catch(Mt){A(String(Mt)),_i();return}K.current=Ge,lt.arm(Ge),Ge.addEventListener("open",()=>{_e||K.current!==Ge||(lt.clear(),b(!0),F.current=0,D(0),Z(!1),ue(!1),A(null),Rt.onConnected())}),Ge.addEventListener("message",Mt=>{var Jr,Qr,en,tn;if(_e||K.current!==Ge)return;let Zt;try{Zt=JSON.parse(typeof Mt.data=="string"?Mt.data:"")}catch{return}if(!Zt||typeof Zt!="object")return;const ee=Zt;if(Rt.noteInbound(),ee.type==="ready"){const De=Hl(ee);De.role&&w(De.role),De.shellKind&&k(De.shellKind),g(De.replayOnly),q.current=De.replayOnly,De.replayOnly&&(Q.current=!0,Rt.onDisconnected(),Z(!1),ue(!1)),T(De.scrollbackBytes),$(De.retentionDays),X(De.scrollbackDir),m(De.terminalReset),S(De.ptyReused),f(!0);return}if(ee.type==="data"&&typeof ee.payload=="string"){(Jr=a.current)==null||Jr.call(a,ee.payload);return}if(ee.type==="backpressure"){const De=sn=>typeof sn=="number"?sn:0;(Qr=c.current)==null||Qr.call(c,{droppedBytes:De(ee.droppedBytes),droppedChunks:De(ee.droppedChunks),totalDroppedBytes:De(ee.totalDroppedBytes),episode:De(ee.episode),episodeEnded:ee.episodeEnded===!0});return}if(ee.type==="read_only"){(en=d.current)==null||en.call(d);return}if(ee.type==="scrollback-meta"){typeof ee.scrollbackBytes=="number"&&ee.scrollbackBytes>=0&&T(ee.scrollbackBytes);return}if(ee.type==="writer-promoted"){w("writer");return}if(ee.type==="replay_snapshot"&&typeof ee.data=="string"&&typeof ee.cols=="number"&&typeof ee.rows=="number"&&typeof ee.terminalVersion=="string"){(tn=u.current)==null||tn.call(u,{data:ee.data,cols:ee.cols,rows:ee.rows,terminalVersion:ee.terminalVersion});return}}),Ge.addEventListener("close",Mt=>{if(_e||K.current!==Ge)return;lt.clear(),b(!1),f(!1),K.current=null,Rt.onDisconnected();const Zt=Mt==null?void 0:Mt.code,ee=q.current===!0&&Zt===1e3;if(q.current=null,ee){if(Ve.current===!1){Q.current=!1,ge(),mt();return}return}_i()}),Ge.addEventListener("error",()=>{_e||K.current!==Ge||A("websocket error")})},_i=()=>{if(_e||Q.current)return;const We=F.current,Ge=Nl(We);F.current=We+1,We<Ai.length&&D(F.current),Z(!0),Wl(We)&&ue(!0),z.current=setTimeout(()=>{_e||mt()},Ge)},Rt=$l({getSocket:()=>K.current,openState:WebSocket.OPEN,isReplayOnly:()=>Q.current,isCancelled:()=>_e,rearmBudget:()=>{F.current=0,D(0)},reconnect:()=>{z.current&&(clearTimeout(z.current),z.current=null),mt()},onProbing:We=>Z(We)});return Ce.current=()=>{_e||(z.current&&(clearTimeout(z.current),z.current=null),Q.current=!1,q.current=null,F.current=0,D(0),ge(),mt())},mt(),()=>{_e=!0,Rt.dispose(),lt.clear(),z.current&&(clearTimeout(z.current),z.current=null);const We=K.current;if(K.current=null,We)try{We.close(1e3,"unmount")}catch{}ge(),q.current=null}},[s,e,i,ge]),x.useEffect(()=>{const _e=Se.current;Se.current=r,_e===!0&&r===!1&&Q.current&&Ce.current()},[r]),{ready:_,role:p,shellKind:C,replayOnly:L,scrollbackBytes:E,retentionDays:O,scrollbackDir:G,terminalReset:N,ptyReused:v,lastError:R,reconnectAttempts:M,reconnecting:H,reconnectStalled:U,send:j,open:y}}function ql(t){if(t.type!=="keydown"||t.metaKey)return"passthrough";if(t.altKey)return t.key.toLowerCase()==="v"&&!t.ctrlKey&&!t.shiftKey?"paste-image":"passthrough";const e=t.key.toLowerCase(),i=t.key==="Insert";return t.ctrlKey&&!t.shiftKey&&e==="v"||t.shiftKey&&!t.ctrlKey&&i?"paste":"passthrough"}async function Uo(){if(typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.read!="function")return null;try{return await navigator.clipboard.read()}catch{return null}}async function Ko(t){for(const e of t){const i=e.types.find(s=>s.startsWith("image/"));if(i)try{return await e.getType(i)}catch{}}return null}async function Vl(){const t=await Uo();return t?Ko(t):null}async function qo(){if(typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.readText!="function")return{ok:!1,reason:"unavailable"};const t=await Uo();if(t){const e=await Ko(t);if(e)return{ok:!0,image:e};for(const i of t)if(i.types.includes("text/plain"))try{return{ok:!0,text:await(await i.getType("text/plain")).text()}}catch{}}try{return{ok:!0,text:await navigator.clipboard.readText()}}catch{return{ok:!1,reason:"denied"}}}function Yl(t){const{term:e,isDisposed:i,notify:s,readClipboard:r,readImage:n,uploadImage:o}=t;return l=>{const h=ql(l);return h==="passthrough"?!0:h==="paste-image"?(l.preventDefault(),l.stopPropagation(),l.repeat||n().then(a=>{i()||(a?o(a):e.input("\x1Bv",!0))}),!1):(l.preventDefault(),l.stopPropagation(),l.repeat||r().then(a=>{if(!i())if(a.ok){if(a.image){o(a.image);return}a.text&&e.paste(a.text)}else a.reason==="unavailable"?s("paste-hint"):s("paste-failed")}),!1)}}async function jl(t){if(!t.writer||!t.term)return;const e=await qo();if(!t.isDisposed()){if(!e.ok)return t.notify(e.reason==="unavailable"?"paste-hint":"paste-failed");try{e.image?t.uploadImage(e.image):e.text&&t.term.paste(e.text)}catch{t.notify("paste-failed")}}}const an=1e6;function Gl(t){if(typeof atob!="function")return null;try{const e=atob(t.trim());try{return decodeURIComponent(Array.from(e).map(i=>"%"+i.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return e}}catch{return null}}function Xl(t){const e=t.indexOf(";"),i=e>=0?t.slice(e+1):t;if(i==="?")return{kind:"read"};if(i.length>Math.ceil(an*4/3)+4)return{kind:"invalid"};const s=Gl(i);return s===null?{kind:"invalid"}:s.length>an?{kind:"invalid"}:{kind:"write",text:s}}function Zl(t){const{copy:e,isDisposed:i,onError:s}=t;return r=>{const n=Xl(r);return n.kind==="write"&&n.text&&e(n.text).catch(()=>{i!=null&&i()||s==null||s()}),!0}}const Jl="\x1B",Vo=new RegExp("^"+Jl+"\\[<(\\d+);\\d+;\\d+[Mm]$");function Ql(t){const e=Vo.exec(t);if(!e)return!1;const i=Number(e[1]);return i<64&&(i&3)===2}function eh(t){return Vo.test(t)}function th(t){return Ql(t)?null:{type:eh(t)?"mouse":"data",payload:t}}const ih=0;function sh(){return{active:!1,identifier:null,lastY:0,pixelAccumulator:0}}function rh(t,e,i){if(i<=0)return 0;t.pixelAccumulator+=e;const s=Math.trunc(t.pixelAccumulator/i);return s!==0&&(t.pixelAccumulator-=s*i),s}function nh(t,e,i={}){const s=sh(),r=i.getPixelsPerLine??lh,n=e.style.getPropertyValue("touch-action");e.style.setProperty("touch-action","none");const o=a=>{if(a.touches.length!==1){s.active=!1,s.identifier=null;return}const c=a.touches[0];s.active=!0,s.identifier=c.identifier,s.lastY=c.clientY,s.pixelAccumulator=0},l=a=>{if(!s.active||s.identifier===null)return;let c=null;for(let _=0;_<a.touches.length;_++)if(a.touches[_].identifier===s.identifier){c=a.touches[_];break}if(!c)return;const d=s.lastY-c.clientY;s.lastY=c.clientY;const u=r(t,e);oh(t,s,d,u,c.clientX,c.clientY),a.cancelable&&a.preventDefault()},h=()=>{s.active=!1,s.identifier=null,s.pixelAccumulator=0};return e.addEventListener("touchstart",o,{passive:!0}),e.addEventListener("touchmove",l,{passive:!1}),e.addEventListener("touchend",h,{passive:!0}),e.addEventListener("touchcancel",h,{passive:!0}),()=>{e.removeEventListener("touchstart",o),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",h),e.removeEventListener("touchcancel",h),n?e.style.setProperty("touch-action",n):e.style.removeProperty("touch-action")}}function oh(t,e,i,s,r,n){const o=t.element??null,l=t.buffer.active.type==="alternate";if(o&&l){i!==0&&ah(o,i,r,n);return}const h=rh(e,i,s);h!==0&&t.scrollLines(h)}function ah(t,e,i,s){t.dispatchEvent(new WheelEvent("wheel",{deltaY:e,deltaMode:ih,clientX:i,clientY:s,bubbles:!0,cancelable:!0}))}function lh(t,e){const i=e.querySelector(".xterm-rows");if(i&&i.children.length>0){const r=i.children[0].getBoundingClientRect().height;if(r>0)return r}if(t.rows>0){const s=e.clientHeight/t.rows;if(s>0)return s}return 18}const hh=150;function ch(t,e,i,s={}){const r=s.requestFrame??(_=>requestAnimationFrame(_)),n=s.cancelFrame??(_=>cancelAnimationFrame(_)),o=s.setTimer??((_,f)=>setTimeout(_,f)),l=s.clearTimer??(_=>clearTimeout(_));let h=null,a=null;const c=()=>{if(!i())try{t.refresh(0,t.rows-1)}catch{}},d=()=>{i()||(h===null&&(h=r(()=>{h=null,c()})),a!==null&&l(a),a=o(()=>{var _,f;if(a=null,c(),!i())try{(f=(_=s.getHealAtlas)==null?void 0:_.call(s))==null||f()}catch{}},hh))},u=t.onScroll(d);return e.addEventListener("wheel",d,{passive:!0}),()=>{h!==null&&(n(h),h=null),a!==null&&(l(a),a=null);try{u.dispose()}catch{}e.removeEventListener("wheel",d)}}const dh=450,uh=3e3;function _h(t,e,i={}){const s=i.requestFrame??(L=>requestAnimationFrame(L)),r=i.cancelFrame??(L=>cancelAnimationFrame(L)),n=i.setTimer??((L,g)=>setTimeout(L,g)),o=i.clearTimer??(L=>clearTimeout(L));let l=!1,h=null,a=null,c=null;const d=()=>{if(!e())try{t.refresh(0,t.rows-1)}catch{}},u=()=>{h===null&&(h=s(()=>{h=null,d()}))},_=()=>{a!==null&&(o(a),a=null)},f=()=>{l=!1,_(),c!==null&&(o(c),c=null),h!==null&&(r(h),h=null)},p=()=>{e()||(l=!0,_(),c!==null&&o(c),c=n(f,uh))},w=()=>{!l||e()||(u(),_(),a=n(f,dh))},C=t.onWriteParsed(w),k=t.onResize(p);return{arm:p,dispose(){f();try{C.dispose()}catch{}try{k.dispose()}catch{}}}}/**
2
2
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
3
  * @license MIT
4
4
  *
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-SVP7TREG-Dx7pMiq4.js";import{p as f}from"./chunk-JWPE2WC7-CTAa0a4O.js";import{_ as n,l as o}from"./mermaid.core-B-Ezy6Me.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-hukx0bAt.js";import"./index-DDSwQXcp.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-SVP7TREG-Bvt8jrSp.js";import{p as f}from"./chunk-JWPE2WC7-BaQYKssR.js";import{_ as n,l as o}from"./mermaid.core-Bnqt31Q7.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-wyDjqucU.js";import"./index-DwRlIUrK.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
@@ -1 +1 @@
1
- import{a0 as ln,a1 as an,a2 as y,a3 as tn,a4 as H,a5 as q,a6 as _,a7 as un,a8 as rn,a9 as L,aa as o,ab as B,ac as sn,ad as on,ae as fn}from"./mermaid.core-B-Ezy6Me.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(fn(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,F=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<rn)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(on((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{a0 as ln,a1 as an,a2 as y,a3 as tn,a4 as H,a5 as q,a6 as _,a7 as un,a8 as rn,a9 as L,aa as o,ab as B,ac as sn,ad as on,ae as fn}from"./mermaid.core-Bnqt31Q7.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(fn(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,F=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<rn)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(on((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};