upfynai-code 2.4.1 → 2.5.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.
- package/README.md +131 -0
- package/client/dist/assets/AppContent-C0CyP3g5.js +513 -0
- package/client/dist/assets/CanvasPanel-0u9QR7U-.js +34 -0
- package/client/dist/assets/CanvasPanel-WhZulBJw.css +1 -0
- package/client/dist/assets/DashboardPanel-Dgqw1yZk.js +1 -0
- package/client/dist/assets/LoginModal-CZDEzqjK.js +19 -0
- package/client/dist/assets/Onboarding-DR6NZ4Vz.js +1 -0
- package/client/dist/assets/{SetupForm-B4p8im5O.js → SetupForm-D49gtWY4.js} +1 -1
- package/client/dist/assets/WorkflowsPanel-CqlbEJA_.js +1 -0
- package/client/dist/assets/{ar-SA-G6X2FPQ2-2gfmdvHk.js → ar-SA-G6X2FPQ2-BWqa1yBH.js} +2 -2
- package/client/dist/assets/{arc-DCZSHhoJ.js → arc-BegSKqEW.js} +1 -1
- package/client/dist/assets/az-AZ-76LH7QW2-DrVlbZDP.js +1 -0
- package/client/dist/assets/{bg-BG-XCXSNQG7-D6__XtOK.js → bg-BG-XCXSNQG7-DdunjBgT.js} +2 -2
- package/client/dist/assets/{blockDiagram-38ab4fdb-Cfbaeyp6.js → blockDiagram-38ab4fdb-BKMbwGHu.js} +2 -2
- package/client/dist/assets/{bn-BD-2XOGV67Q-DHNJw3OG.js → bn-BD-2XOGV67Q-_7DtmvwO.js} +2 -2
- package/client/dist/assets/{c4Diagram-3d4e48cf-BBCnjOTy.js → c4Diagram-3d4e48cf-hJuiHhSn.js} +2 -2
- package/client/dist/assets/{ca-ES-6MX7JW3Y-r5g4o3zQ.js → ca-ES-6MX7JW3Y-BFIrmojG.js} +3 -3
- package/client/dist/assets/channel-Bur-rRTp.js +1 -0
- package/client/dist/assets/classDiagram-70f12bd4-BjiAf9cM.js +2 -0
- package/client/dist/assets/classDiagram-v2-f2320105-pwBewejc.js +2 -0
- package/client/dist/assets/clone-BtqXeoBJ.js +1 -0
- package/client/dist/assets/{createText-2e5e7dd3-B8jCDmF_.js → createText-2e5e7dd3-Dq_acOWe.js} +1 -1
- package/client/dist/assets/{cs-CZ-2BRQDIVT-p08jRLRC.js → cs-CZ-2BRQDIVT-B-x4F6TJ.js} +2 -2
- package/client/dist/assets/{da-DK-5WZEPLOC-CnhOImFf.js → da-DK-5WZEPLOC-Btlc8Dgn.js} +2 -2
- package/client/dist/assets/{de-DE-XR44H4JA-BunSXZ-Y.js → de-DE-XR44H4JA-BVu3ZIoD.js} +2 -2
- package/client/dist/assets/{edges-e0da2a9e-CGBBhG8k.js → edges-e0da2a9e-DH0wVTXR.js} +1 -1
- package/client/dist/assets/{el-GR-BZB4AONW-D4wv1oIz.js → el-GR-BZB4AONW-h2ll8_ZC.js} +2 -2
- package/client/dist/assets/{erDiagram-9861fffd-CYaF3q1I.js → erDiagram-9861fffd-BYezLIR7.js} +2 -2
- package/client/dist/assets/{es-ES-U4NZUMDT-CGeTKXgd.js → es-ES-U4NZUMDT-Cveiulwt.js} +2 -2
- package/client/dist/assets/{eu-ES-A7QVB2H4-Cayx1TxR.js → eu-ES-A7QVB2H4-DQluL2PY.js} +2 -2
- package/client/dist/assets/{fa-IR-HGAKTJCU-CmUg8pmw.js → fa-IR-HGAKTJCU-BJtcMBSv.js} +2 -2
- package/client/dist/assets/{fi-FI-Z5N7JZ37-xvHcPhsU.js → fi-FI-Z5N7JZ37-D8NfbVXV.js} +2 -2
- package/client/dist/assets/{flowDb-956e92f1-C-_LFz70.js → flowDb-956e92f1-scnUykhM.js} +1 -1
- package/client/dist/assets/{flowDiagram-66a62f08-C1sHdSjn.js → flowDiagram-66a62f08-jVyWsfyU.js} +2 -2
- package/client/dist/assets/flowDiagram-v2-96b9c2cf-N6xgi25h.js +1 -0
- package/client/dist/assets/{flowchart-elk-definition-4a651766-CNGfpudb.js → flowchart-elk-definition-4a651766-gKGX3HqR.js} +2 -2
- package/client/dist/assets/{fr-FR-RHASNOE6-DBoHEcNj.js → fr-FR-RHASNOE6-vdj42kC6.js} +2 -2
- package/client/dist/assets/ganttDiagram-c361ad54-C2CiWFUP.js +257 -0
- package/client/dist/assets/{gitGraphDiagram-72cf32ee-DojCDvlS.js → gitGraphDiagram-72cf32ee-C59Yz2LK.js} +2 -2
- package/client/dist/assets/{gl-ES-HMX3MZ6V-p6hrn2cN.js → gl-ES-HMX3MZ6V-DQo0TzoP.js} +2 -2
- package/client/dist/assets/{graph-DXM7lcy1.js → graph-Dx_H43Kv.js} +1 -1
- package/client/dist/assets/{he-IL-6SHJWFNN-y2jEX6-0.js → he-IL-6SHJWFNN-DKXK5e33.js} +2 -2
- package/client/dist/assets/{hi-IN-IWLTKZ5I-99pNfyWr.js → hi-IN-IWLTKZ5I-C2Qgqc0R.js} +2 -2
- package/client/dist/assets/{hu-HU-A5ZG7DT2-hygceGMS.js → hu-HU-A5ZG7DT2-Ss-6vX0m.js} +2 -2
- package/client/dist/assets/{id-ID-SAP4L64H-CyIqi1hv.js → id-ID-SAP4L64H-D7Wsg1S2.js} +2 -2
- package/client/dist/assets/{index-3862675e-4idOQN2N.js → index-3862675e-u8Nv7hHC.js} +1 -1
- package/client/dist/assets/{index-BHZfFT_V.js → index-BVowJdZF.js} +4 -4
- package/client/dist/assets/{index-BGmwbRlb.js → index-ce18TYkg.js} +6 -6
- package/client/dist/assets/index-kQoJx-bc.css +1 -0
- package/client/dist/assets/{infoDiagram-f8f76790-CFLrHqtc.js → infoDiagram-f8f76790-LmoJYsxo.js} +2 -2
- package/client/dist/assets/{it-IT-JPQ66NNP-DzVvVdQI.js → it-IT-JPQ66NNP-CAPTVl7M.js} +2 -2
- package/client/dist/assets/{ja-JP-DBVTYXUO-BI4fPexV.js → ja-JP-DBVTYXUO-eNVPawR2.js} +2 -2
- package/client/dist/assets/{journeyDiagram-49397b02-C3CFDo8z.js → journeyDiagram-49397b02-BaJqehpR.js} +2 -2
- package/client/dist/assets/kaa-6HZHGXH3-tpuNkKhS.js +1 -0
- package/client/dist/assets/{kab-KAB-ZGHBKWFO-DBI_ri48.js → kab-KAB-ZGHBKWFO-Dp83kx4x.js} +2 -2
- package/client/dist/assets/kk-KZ-P5N5QNE5-B9IlC6YN.js +1 -0
- package/client/dist/assets/{km-KH-HSX4SM5Z-DOMFSres.js → km-KH-HSX4SM5Z-B_KMYaMj.js} +2 -2
- package/client/dist/assets/{ko-KR-MTYHY66A-tb08hXzd.js → ko-KR-MTYHY66A-yebnUNdb.js} +3 -3
- package/client/dist/assets/{ku-TR-6OUDTVRD-DlIQCCY4.js → ku-TR-6OUDTVRD-BR6fh6-5.js} +2 -2
- package/client/dist/assets/{layout-B_11mCXA.js → layout-DLl5Jwcl.js} +1 -1
- package/client/dist/assets/{line-B-qmK_vI.js → line-FpB7omSK.js} +1 -1
- package/client/dist/assets/{linear-Ph6uuYcX.js → linear-CkXqUFJ8.js} +1 -1
- package/client/dist/assets/{lt-LT-XHIRWOB4--qWy24_Z.js → lt-LT-XHIRWOB4-SutZSWtR.js} +2 -2
- package/client/dist/assets/{lv-LV-5QDEKY6T-Bnd_1GDb.js → lv-LV-5QDEKY6T-DuAxdcZL.js} +2 -2
- package/client/dist/assets/{mindmap-definition-fc14e90a-Do79tIc0.js → mindmap-definition-fc14e90a-DyxXOExh.js} +2 -2
- package/client/dist/assets/{mr-IN-CRQNXWMA-BsV6HaD9.js → mr-IN-CRQNXWMA-DqDUWM_8.js} +2 -2
- package/client/dist/assets/my-MM-5M5IBNSE-C40kMFMR.js +1 -0
- package/client/dist/assets/{nb-NO-T6EIAALU-Cvf9FdSF.js → nb-NO-T6EIAALU-DVij32Ju.js} +3 -3
- package/client/dist/assets/{nl-NL-IS3SIHDZ-DA1yqpXw.js → nl-NL-IS3SIHDZ-rT84mDYq.js} +2 -2
- package/client/dist/assets/{nn-NO-6E72VCQL-89lm3vku.js → nn-NO-6E72VCQL-BBZXBW8V.js} +2 -2
- package/client/dist/assets/{oc-FR-POXYY2M6-BsrjTJQh.js → oc-FR-POXYY2M6-DzjOugOf.js} +2 -2
- package/client/dist/assets/{pa-IN-N4M65BXN-CczefYaj.js → pa-IN-N4M65BXN-DD1iU8_F.js} +2 -2
- package/client/dist/assets/{percentages-BXMCSKIN-Be6p9phi.js → percentages-BXMCSKIN-WVlHS4wx.js} +7 -7
- package/client/dist/assets/{pieDiagram-8a3498a8-CfblQHdm.js → pieDiagram-8a3498a8-Dd_85qBH.js} +3 -3
- package/client/dist/assets/{pl-PL-T2D74RX3-DdhH-zcK.js → pl-PL-T2D74RX3-ukVXa48G.js} +2 -2
- package/client/dist/assets/{pt-BR-5N22H2LF-gpwlheL6.js → pt-BR-5N22H2LF-BibawarT.js} +2 -2
- package/client/dist/assets/{pt-PT-UZXXM6DQ-Cs87vICi.js → pt-PT-UZXXM6DQ-So3i9l9w.js} +2 -2
- package/client/dist/assets/{quadrantDiagram-120e2f19-CRMSamSP.js → quadrantDiagram-120e2f19-C4dFVDEx.js} +2 -2
- package/client/dist/assets/{requirementDiagram-deff3bca-D3LBN016.js → requirementDiagram-deff3bca-DrTO7yFl.js} +2 -2
- package/client/dist/assets/{ro-RO-JPDTUUEW-CWTSJ1Dt.js → ro-RO-JPDTUUEW-DY0Xq_Hd.js} +2 -2
- package/client/dist/assets/{ru-RU-B4JR7IUQ-Bq7aN2ep.js → ru-RU-B4JR7IUQ-B7u_Zvkd.js} +2 -2
- package/client/dist/assets/sankeyDiagram-04a897e0-D24gfzuS.js +8 -0
- package/client/dist/assets/{sequenceDiagram-704730f1-BRYXVDGX.js → sequenceDiagram-704730f1-Dgji2XLQ.js} +2 -2
- package/client/dist/assets/si-LK-N5RQ5JYF-OejsLzQ_.js +1 -0
- package/client/dist/assets/{sk-SK-C5VTKIMK-ByjKQzUb.js → sk-SK-C5VTKIMK-_vy2Bt-M.js} +2 -2
- package/client/dist/assets/{sl-SI-NN7IZMDC-B8WCyMBU.js → sl-SI-NN7IZMDC-DKOl_u2M.js} +2 -2
- package/client/dist/assets/stateDiagram-587899a1-CJ8eBaiU.js +1 -0
- package/client/dist/assets/stateDiagram-v2-d93cdb3a-C5K3l-Nt.js +1 -0
- package/client/dist/assets/{styles-6aaf32cf-Dr-lfIOW.js → styles-6aaf32cf-DAKE0jbx.js} +1 -1
- package/client/dist/assets/{styles-9a916d00-DS4wRpL7.js → styles-9a916d00-LFAJCgEy.js} +1 -1
- package/client/dist/assets/{styles-c10674c1-nKRF6NrH.js → styles-c10674c1-CllKO8NG.js} +1 -1
- package/client/dist/assets/{subset-shared.chunk-KT79s7KG.js → subset-shared.chunk-Uy-J87FQ.js} +3 -3
- package/client/dist/assets/subset-worker.chunk-dvgDvqt9.js +1 -0
- package/client/dist/assets/{sv-SE-XGPEYMSR-BiIPUVbv.js → sv-SE-XGPEYMSR-CDCB2ZV5.js} +2 -2
- package/client/dist/assets/{svgDrawCommon-08f97a94-C3uP9PYr.js → svgDrawCommon-08f97a94-CObOzbFQ.js} +1 -1
- package/client/dist/assets/{ta-IN-2NMHFXQM-Cidadso2.js → ta-IN-2NMHFXQM-DHUNdO69.js} +2 -2
- package/client/dist/assets/th-TH-HPSO5L25-zI2hnBq3.js +2 -0
- package/client/dist/assets/{timeline-definition-85554ec2-BSsLsIgF.js → timeline-definition-85554ec2-C2XHRmxK.js} +2 -2
- package/client/dist/assets/{tr-TR-DEFEU3FU-DaFcI-KL.js → tr-TR-DEFEU3FU-l-6Hu4-D.js} +2 -2
- package/client/dist/assets/{uk-UA-QMV73CPH-DkBW36St.js → uk-UA-QMV73CPH-CqSOwrl7.js} +3 -3
- package/client/dist/assets/vendor-codemirror-D_s0aGBu.js +35 -0
- package/client/dist/assets/{vendor-icons-Dh9m_Ydt.js → vendor-icons-Lb69KSFJ.js} +167 -117
- package/client/dist/assets/{vi-VN-M7AON7JQ-KrtfxOzl.js → vi-VN-M7AON7JQ-CUL8-mBZ.js} +2 -2
- package/client/dist/assets/{xychartDiagram-e933f94c-CgNgZ4pp.js → xychartDiagram-e933f94c-1fmf6slj.js} +2 -2
- package/client/dist/assets/{zh-CN-LNUGB5OW-BQu12RoD.js → zh-CN-LNUGB5OW-CB5y5VVU.js} +3 -3
- package/client/dist/assets/zh-HK-E62DVLB3-BHcrrEeJ.js +1 -0
- package/client/dist/assets/{zh-TW-RAJ6MFWO-ffJWgVxn.js → zh-TW-RAJ6MFWO-DoDUdkaJ.js} +2 -2
- package/client/dist/index.html +3 -3
- package/package.json +20 -8
- package/server/cli.js +44 -0
- package/server/database/auth.db +0 -0
- package/server/database/db.js +203 -1
- package/server/index.js +111 -18
- package/server/middleware/auth.js +11 -6
- package/server/projects.js +95 -202
- package/server/relay-client.js +47 -10
- package/server/routes/auth.js +6 -0
- package/server/routes/dashboard.js +52 -0
- package/server/routes/projects.js +38 -35
- package/server/routes/voice.js +198 -0
- package/server/routes/webhooks.js +166 -0
- package/server/routes/workflows.js +118 -0
- package/server/services/whisperService.js +84 -0
- package/server/services/workflowScheduler.js +186 -0
- package/client/dist/assets/AppContent-DTZ2FbvM.js +0 -513
- package/client/dist/assets/CanvasPanel-DlTW6Jh6.js +0 -6
- package/client/dist/assets/CanvasPanel-q4HEqNtV.css +0 -1
- package/client/dist/assets/LoginModal-CWoFm0au.js +0 -19
- package/client/dist/assets/Onboarding-CtIoXiTp.js +0 -1
- package/client/dist/assets/az-AZ-76LH7QW2-CDdeucRZ.js +0 -1
- package/client/dist/assets/channel-O3ovC0x9.js +0 -1
- package/client/dist/assets/classDiagram-70f12bd4-D0lhAcxU.js +0 -2
- package/client/dist/assets/classDiagram-v2-f2320105-BuwUsF3F.js +0 -2
- package/client/dist/assets/clone-BG9u7vLi.js +0 -1
- package/client/dist/assets/flowDiagram-v2-96b9c2cf-Cd0Iascd.js +0 -1
- package/client/dist/assets/ganttDiagram-c361ad54-B8HJQqjt.js +0 -257
- package/client/dist/assets/index-B8wwD_Xo.css +0 -1
- package/client/dist/assets/kaa-6HZHGXH3-fwOleoQB.js +0 -1
- package/client/dist/assets/kk-KZ-P5N5QNE5-zpl7uvyF.js +0 -1
- package/client/dist/assets/my-MM-5M5IBNSE-kZQURVIi.js +0 -1
- package/client/dist/assets/sankeyDiagram-04a897e0-CsFqOQZN.js +0 -8
- package/client/dist/assets/si-LK-N5RQ5JYF-BBjcNYQh.js +0 -1
- package/client/dist/assets/stateDiagram-587899a1-BHoy9LtD.js +0 -1
- package/client/dist/assets/stateDiagram-v2-d93cdb3a-BvMUA6bS.js +0 -1
- package/client/dist/assets/subset-worker.chunk-BMx1eyv3.js +0 -1
- package/client/dist/assets/th-TH-HPSO5L25-CFNnJwSv.js +0 -2
- package/client/dist/assets/vendor-codemirror-langs-BH1ZcKHY.js +0 -20
- package/client/dist/assets/vendor-codemirror-rix45NST.js +0 -16
- package/client/dist/assets/zh-HK-E62DVLB3-zx9CvERq.js +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/percentages-BXMCSKIN-WVlHS4wx.js","assets/vendor-syntax-DnmwQQJF.js","assets/vendor-react-9mUTKBHH.js","assets/vendor-markdown-BXEi_H3G.js","assets/AppContent-C0CyP3g5.js","assets/index-ce18TYkg.js","assets/vendor-icons-Lb69KSFJ.js","assets/vendor-i18n-DCFGyhQR.js","assets/index-kQoJx-bc.css","assets/LoginModal-CZDEzqjK.js","assets/vendor-xterm-CZq1hqo1.js","assets/vendor-xterm-qxJ8_QYu.css","assets/vendor-codemirror-D_s0aGBu.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{b as ce}from"./vendor-syntax-DnmwQQJF.js";import{r as g,j as i,v as ge}from"./vendor-react-9mUTKBHH.js";import{t as xe,i as be,u as ye,v as ke,F as we,w as ve,x as Ie}from"./vendor-icons-Lb69KSFJ.js";import"./vendor-markdown-BXEi_H3G.js";const X=240,le=120,G=32,Se=12,O={note:{bg:"#f8fafc",border:"#3b82f6",text:"#1e293b",accent:"#2563eb"},pdf:{bg:"#fef2f2",border:"#ef4444",text:"#1e293b",accent:"#dc2626"},summary:{bg:"#f0fdf4",border:"#22c55e",text:"#1e293b",accent:"#16a34a"},prompt:{bg:"#eff6ff",border:"#3b82f6",text:"#1e293b",accent:"#2563eb"},response:{bg:"#f5f3ff",border:"#8b5cf6",text:"#1e293b",accent:"#7c3aed"},research:{bg:"#f0fdfa",border:"#14b8a6",text:"#1e293b",accent:"#0d9488"},suggestion:{bg:"#fffbeb",border:"#f59e0b",text:"#1e293b",accent:"#d97706"}};function R(){return crypto.randomUUID()}function ie(n,e,t,r,a){return{id:a.id,type:"rectangle",x:n,y:e,width:t,height:r,angle:0,strokeColor:a.border,backgroundColor:a.bg,fillStyle:"solid",strokeWidth:2,roughness:0,opacity:100,groupIds:a.groupIds,roundness:{type:3,value:Se},isDeleted:!1,boundElements:null,locked:!1,customData:a.customData,version:1,versionNonce:Math.floor(Math.random()*1e9),seed:Math.floor(Math.random()*1e9)}}function H(n,e,t,r){const a=r.fontSize??14;return{id:r.id,type:"text",x:n,y:e,width:r.width??X-24,height:r.height??a+6,angle:0,strokeColor:r.color,backgroundColor:"transparent",fillStyle:"solid",strokeWidth:1,roughness:0,opacity:100,groupIds:r.groupIds,roundness:null,isDeleted:!1,boundElements:null,locked:!1,text:t,fontSize:a,fontFamily:1,textAlign:"left",verticalAlign:"top",containerId:null,originalText:t,autoResize:!1,lineHeight:1.25,customData:r.customData,version:1,versionNonce:Math.floor(Math.random()*1e9),seed:Math.floor(Math.random()*1e9)}}const Ce={note:"📝 Note",pdf:"📄 PDF",summary:"✨ Summary",prompt:"💬 Prompt",response:"🤖 Response",research:"🔍 Research",suggestion:"💡 Suggestion"};function z(n,e,t,r,a,l){const s=R(),m=R(),d=l??X,p=r.split(`
|
|
3
|
+
`),c=Math.max(le-G,p.length*18+16),f=G+c,x=O[n],D=ie(e,t,d,f,{id:m,groupIds:[s],bg:x.bg,border:x.border,customData:{blockType:n,blockId:m,content:r,...a}}),A=H(e+12,t+8,Ce[n],{id:R(),groupIds:[s],color:x.accent,fontSize:13,width:d-24}),w=H(e+12,t+G+4,r,{id:R(),groupIds:[s],color:x.text,fontSize:13,width:d-24,height:c-12});return{elements:[D,A,w],blockId:m,groupId:s,totalHeight:f}}function de(n,e,t="New note..."){return z("note",n,e,t)}function te(n,e,t){return z("prompt",n,e,t)}function je(n,e,t,r){return z("response",n,e,t,void 0,r)}function De(n,e,t,r){return z("research",n,e,t,void 0,r)}function Ee(n,e,t,r){return z("suggestion",n,e,t,void 0,r)}function ue(n,e,t,r,a,l){const s=R(),m=R(),d=t.length>28?t.slice(0,25)+"...":t,p=ie(n,e,X,le,{id:m,groupIds:[s],bg:O.pdf.bg,border:O.pdf.border,customData:{blockType:"pdf",blockId:m,fileName:t,pageCount:r,extractedText:a,thumbnail:l??null}}),c=H(n+12,e+8,`📄 ${d}`,{id:R(),groupIds:[s],color:O.pdf.accent,fontSize:13}),f=H(n+12,e+32,`${r} page${r!==1?"s":""}`,{id:R(),groupIds:[s],color:O.pdf.text,fontSize:12}),x=H(n+12,e+56,a.slice(0,80)+(a.length>80?"...":""),{id:R(),groupIds:[s],color:"#64748b",fontSize:11,height:48});return{elements:[p,c,f,x],blockId:m,groupId:s}}function me(n,e,t,r="Generating summary..."){return z("summary",n,e,r,{sourceIds:t,generatedContent:r})}function Y(n,e){const t=R();return{element:{id:t,type:"arrow",x:0,y:0,width:100,height:0,angle:0,strokeColor:"#6366f1",backgroundColor:"transparent",fillStyle:"solid",strokeWidth:2,roughness:0,opacity:80,groupIds:[],roundness:{type:2},isDeleted:!1,boundElements:null,locked:!1,points:[[0,0],[100,0]],startBinding:{elementId:n,focus:0,gap:4},endBinding:{elementId:e,focus:0,gap:4},startArrowhead:null,endArrowhead:"arrow",customData:{blockType:"context-link",sourceId:n,targetId:e},version:1,versionNonce:Math.floor(Math.random()*1e9),seed:Math.floor(Math.random()*1e9)},linkId:t}}async function Ne(n){try{const e=await ce(()=>import("./pdf-CE_K4jFx.js"),[]);e.GlobalWorkerOptions.workerSrc=new URL("/assets/pdf.worker-BA9kU3Pw.mjs",import.meta.url).toString();const t=await n.arrayBuffer(),r=await e.getDocument({data:t}).promise,a=r.numPages,l=[],s=Math.min(a,10);for(let d=1;d<=s;d++){const f=(await(await r.getPage(d)).getTextContent()).items.map(x=>x.str).join(" ");l.push(f)}let m=null;try{const d=await r.getPage(1),p=d.getViewport({scale:.5}),c=document.createElement("canvas");c.width=p.width,c.height=p.height;const f=c.getContext("2d");f&&(await d.render({canvasContext:f,viewport:p}).promise,m=c.toDataURL("image/png",.6))}catch{}return{text:l.join(`
|
|
4
|
+
|
|
5
|
+
`),pageCount:a,thumbnail:m}}catch(e){return console.error("PDF extraction failed:",e),{text:"",pageCount:0,thumbnail:null}}}function K(n){const e=n.getAppState(),t=(-e.scrollX+e.width/2)/e.zoom.value,r=(-e.scrollY+e.height/2)/e.zoom.value;return{x:Math.round(t-120),y:Math.round(r-60)}}function U(n,e){const t=n.getSceneElements();n.updateScene({elements:[...t,...e]})}function Ae({api:n,onRun:e,onStop:t,onClearAi:r,isRunning:a}){const l=g.useRef(null),[s,m]=g.useState(!1),[d,p]=g.useState(!1),c=g.useCallback(()=>{if(!n)return;const{x:o,y:b}=K(n),v=de(o,b);U(n,v.elements)},[n]),f=g.useCallback(()=>{var o;(o=l.current)==null||o.click()},[]),x=g.useCallback(async o=>{var v;const b=(v=o.target.files)==null?void 0:v[0];if(!(!b||!n)){o.target.value="",p(!0);try{const{text:k,pageCount:I,thumbnail:T}=await Ne(b),{x:P,y:M}=K(n),$=ue(P,M,b.name,I,k,T);U(n,$.elements)}finally{p(!1)}}},[n]),D=g.useCallback(()=>{if(!n)return;const o=n.getAppState(),b=Object.keys(o.selectedElementIds||{}),k=n.getSceneElements().filter(M=>{var $;return b.includes(M.id)&&(($=M.customData)==null?void 0:$.blockId)}).map(M=>M.customData.blockId),{x:I,y:T}=K(n),P=me(I+280,T,k,k.length?"Summary of selected blocks":"Select blocks to summarize");U(n,P.elements)},[n]),A=g.useCallback(()=>{if(!n)return;const o=n.getAppState(),b=Object.keys(o.selectedElementIds||{}),k=n.getSceneElements().filter(I=>{var T;return b.includes(I.id)&&((T=I.customData)==null?void 0:T.blockId)});if(k.length===2){const I=Y(k[0].id,k[1].id);U(n,[I.element]),m(!1)}else m(!s)},[n,s]),w="flex items-center justify-center w-9 h-9 rounded-lg transition-colors text-muted-foreground hover:text-foreground hover:bg-black/5";return i.jsxs("div",{className:"canvas-block-toolbar",children:[a?i.jsx("button",{onClick:t,className:`${w} text-red-500 hover:text-red-600 hover:bg-red-50`,title:"Stop AI",children:i.jsx(xe,{className:"w-4 h-4"})}):i.jsx("button",{onClick:e,className:`${w} text-primary hover:text-primary hover:bg-primary/10`,title:"Run: Analyze canvas with AI",children:i.jsx(be,{className:"w-4 h-4"})}),i.jsx("button",{onClick:r,className:w,title:"Clear AI output blocks",children:i.jsx(ye,{className:"w-4 h-4"})}),i.jsx("div",{className:"w-5 border-t border-black/10 mx-auto"}),i.jsx("button",{onClick:c,className:w,title:"Add Note",children:i.jsx(ke,{className:"w-4 h-4"})}),i.jsx("button",{onClick:f,className:w,title:"Add PDF",disabled:d,children:i.jsx(we,{className:`w-4 h-4 ${d?"animate-pulse":""}`})}),i.jsx("button",{onClick:D,className:w,title:"Add Summary",children:i.jsx(ve,{className:"w-4 h-4"})}),i.jsx("div",{className:"w-5 border-t border-black/10 mx-auto"}),i.jsx("button",{onClick:A,className:`${w} ${s?"bg-indigo-500/10 text-indigo-500":""}`,title:"Connect Blocks (select 2)",children:i.jsx(Ie,{className:"w-4 h-4"})}),i.jsx("input",{ref:l,type:"file",accept:".pdf",onChange:x,className:"hidden"}),s&&i.jsx("div",{className:"absolute left-12 top-1/2 -translate-y-1/2 bg-background/90 border border-border rounded-md px-2 py-1 text-xs text-muted-foreground whitespace-nowrap",children:"Select 2 blocks, then click Connect"})]})}function L(){return window.__excalidrawAPI??null}function F(n){const e=L();if(!e)return;const t=e.getSceneElements();e.updateScene({elements:[...t,...n]})}function ne(){const n=L();if(!n)return{x:100,y:100};const e=n.getAppState(),t=(-e.scrollX+e.width/2)/e.zoom.value,r=(-e.scrollY+e.height/2)/e.zoom.value;return{x:Math.round(t-120),y:Math.round(r-60)}}const B={addNote(n,e,t){const r=n!=null&&e!=null?{x:n,y:e}:ne(),a=de(r.x,r.y,t);return F(a.elements),{blockId:a.blockId}},addPdf(n,e,t,r,a=0,l){const s=ue(n,e,t,a,r,l);return F(s.elements),{blockId:s.blockId}},addSummary(n,e,t,r){const a=t!=null&&r!=null?{x:t,y:r}:ne(),l=me(a.x,a.y,n,e);return F(l.elements),{blockId:l.blockId}},connectBlocks(n,e){const t=Y(n,e);return F([t.element]),{linkId:t.linkId}},getBlocks(){const n=L();return n?n.getSceneElements().filter(e=>{var t;return((t=e.customData)==null?void 0:t.blockType)&&e.customData.blockType!=="context-link"}).map(e=>({id:e.id,x:e.x,y:e.y,width:e.width,height:e.height,...e.customData})):[]},getConnections(){const n=L();return n?n.getSceneElements().filter(e=>{var t;return((t=e.customData)==null?void 0:t.blockType)==="context-link"}).map(e=>({id:e.id,sourceId:e.customData.sourceId,targetId:e.customData.targetId})):[]},updateBlockContent(n,e){const t=L();if(!t)return;const r=t.getSceneElements().map(a=>{var l;if(a.id===n&&a.customData)return{...a,customData:{...a.customData,content:e,generatedContent:e}};if(a.type==="text"&&((l=a.groupIds)!=null&&l.length)){const s=t.getSceneElements().find(m=>{var d;return m.id===n&&((d=m.groupIds)==null?void 0:d.some(p=>a.groupIds.includes(p)))});if(s&&a.y>s.y+28)return{...a,text:e,originalText:e}}return a});t.updateScene({elements:r})},removeBlock(n){const e=L();if(!e)return;const t=e.getSceneElements().find(l=>l.id===n);if(!t)return;const r=t.groupIds??[],a=e.getSceneElements().map(l=>{var s,m;return l.id===n||r.length&&((s=l.groupIds)!=null&&s.some(d=>r.includes(d)))?{...l,isDeleted:!0}:((m=l.customData)==null?void 0:m.blockType)==="context-link"&&(l.customData.sourceId===n||l.customData.targetId===n)?{...l,isDeleted:!0}:l});e.updateScene({elements:a})}};function Te(){window.__canvasBlockAPI=B}function Be(){delete window.__canvasBlockAPI}function Re(n){const{action:e,params:t}=n;switch(e){case"addNote":return B.addNote(t.x,t.y,t.content);case"addPdf":return B.addPdf(t.x,t.y,t.fileName,t.text,t.pageCount,t.thumbnail);case"addSummary":return B.addSummary(t.sourceIds,t.content,t.x,t.y);case"connectBlocks":return B.connectBlocks(t.sourceId,t.targetId);case"updateBlockContent":return B.updateBlockContent(t.blockId,t.content);case"removeBlock":return B.removeBlock(t.blockId);case"getBlocks":return B.getBlocks();case"getConnections":return B.getConnections();default:console.warn("Unknown canvas block command:",e)}}function _(n,e){return n.length<=e?n:n.slice(0,e)+"..."}function V(n,e){return`(${Math.round(n)}, ${Math.round(e)})`}function oe(n){var f,x,D,A,w;const e=n.getSceneElements().filter(o=>!o.isDeleted);if(e.length===0)return"Canvas is empty.";const t=[],r=[],a=[],l=[],s=[],m=new Set,d=new Set;for(const o of e)if((f=o.customData)!=null&&f.blockType&&o.customData.blockType!=="context-link"){if(m.add(o.id),o.groupIds)for(const b of o.groupIds)d.add(b);t.push({id:o.id,type:o.customData.blockType,x:o.x,y:o.y,content:o.customData.content||o.customData.extractedText||o.customData.generatedContent||"",label:o.customData.fileName||o.customData.blockType})}const p=new Map;for(const o of t){const b=o.content?_(o.content,40):o.type;p.set(o.id,b)}for(const o of e)if(!m.has(o.id)&&!((x=o.groupIds)!=null&&x.some(b=>d.has(b))))if(((D=o.customData)==null?void 0:D.blockType)==="context-link")l.push({sourceId:o.customData.sourceId,targetId:o.customData.targetId,sourceLabel:p.get(o.customData.sourceId)||"unknown",targetLabel:p.get(o.customData.targetId)||"unknown"});else if(o.type==="arrow"&&(o.startBinding||o.endBinding)){const b=(A=o.startBinding)==null?void 0:A.elementId,v=(w=o.endBinding)==null?void 0:w.elementId;b&&v&&l.push({sourceId:b,targetId:v,sourceLabel:p.get(b)||"element",targetLabel:p.get(v)||"element"})}else o.type==="text"?r.push({text:o.text||o.originalText||"",x:o.x,y:o.y}):o.type==="rectangle"||o.type==="ellipse"||o.type==="diamond"?a.push({type:o.type,x:o.x,y:o.y,width:o.width,height:o.height}):(o.type==="freedraw"||o.type==="line")&&s.push({type:o.type,x:o.x,y:o.y});const c=[`## Canvas Context
|
|
6
|
+
`];if(t.length>0){c.push("### Blocks:");for(const o of t){const b=o.content?_(o.content,120):"(empty)";c.push(`- [${o.type} at ${V(o.x,o.y)}]: "${b}"`)}c.push("")}if(r.length>0){c.push("### Free Text:");for(const o of r)c.push(`- Text at ${V(o.x,o.y)}: "${_(o.text,100)}"`);c.push("")}if(a.length>0){c.push("### Shapes:");for(const o of a)c.push(`- ${o.type} at ${V(o.x,o.y)} (${Math.round(o.width)}x${Math.round(o.height)})`);c.push("")}if(s.length>0&&(c.push("### Drawings:"),c.push(`- ${s.length} hand-drawn element(s)`),c.push("")),l.length>0){c.push("### Connections:");for(const o of l)c.push(`- "${o.sourceLabel}" → "${o.targetLabel}"`);c.push("")}if(t.length>1){const o=[...t].sort((k,I)=>k.x-I.x||k.y-I.y),b=o[0],v=o[o.length-1];c.push("### Spatial Layout:"),c.push(`- Leftmost: ${b.type} ("${_(b.content,30)}")`),c.push(`- Rightmost: ${v.type} ("${_(v.content,30)}")`),c.push(`- Total blocks: ${t.length}`),c.push("")}return c.join(`
|
|
7
|
+
`)}function Pe(n){var m,d,p;const e=n.getAppState(),t=new Set(Object.keys(e.selectedElementIds||{}));if(t.size===0)return null;const r=n.getSceneElements().filter(c=>!c.isDeleted),a=new Set(t);for(const c of r)if(t.has(c.id)&&c.groupIds)for(const f of c.groupIds)for(const x of r)(m=x.groupIds)!=null&&m.includes(f)&&a.add(x.id);const l=r.filter(c=>a.has(c.id));if(l.length===0)return null;const s=[`## Selected Items Context
|
|
8
|
+
`];for(const c of l)if((d=c.customData)!=null&&d.blockType&&c.customData.blockType!=="context-link"){const f=c.customData.content||c.customData.extractedText||c.customData.generatedContent||"";s.push(`- [${c.customData.blockType}]: "${_(f,150)}"`)}else c.type==="text"?s.push(`- Text: "${_(c.text||"",150)}"`):c.type==="rectangle"||c.type==="ellipse"||c.type==="diamond"?s.push(`- Shape: ${c.type} (${Math.round(c.width)}x${Math.round(c.height)})`):((p=c.customData)==null?void 0:p.blockType)==="context-link"&&s.push("- Connection: linked elements");return s.join(`
|
|
9
|
+
`)}function se(n){const e=n.getSceneElements().filter(a=>!a.isDeleted);if(e.length===0){const a=n.getAppState(),l=(-a.scrollX+a.width/2)/a.zoom.value,s=(-a.scrollY+a.height/2)/a.zoom.value;return{x:Math.round(l),y:Math.round(s)}}let t=-1/0,r=1/0;for(const a of e){const l=a.x+(a.width||0);l>t&&(t=l),a.y<r&&(r=a.y)}return{x:Math.round(t+60),y:Math.round(r)}}const J=320,re=20;function Me(n){const e=[],t=n.split(`
|
|
10
|
+
`);let r="response",a="",l=[],s=!1,m=[];const d=()=>{const p=l.join(`
|
|
11
|
+
`).trim();p&&e.push({type:r,heading:a,content:p}),l=[]};for(const p of t){if(p.trim().startsWith("```mermaid")){d(),s=!0,m=[];continue}if(s){if(p.trim()==="```"){s=!1;const c=m.join(`
|
|
12
|
+
`).trim();c&&e.push({type:"mermaid",heading:"Flow Diagram",content:c})}else m.push(p);continue}if(p.startsWith("## ")||p.startsWith("### ")){d();const c=p.replace(/^#{2,3}\s+/,"").trim();a=c;const f=c.toLowerCase();f.includes("research")||f.includes("analysis")||f.includes("finding")?r="research":f.includes("suggestion")||f.includes("idea")||f.includes("recommendation")?r="suggestion":r="response";continue}if(p.startsWith("> ")){r!=="suggestion"&&(d(),r="suggestion",a=a||"Suggestion"),l.push(p.slice(2));continue}l.push(p)}return d(),e}function _e(n,e){const t=n.split(`
|
|
13
|
+
`),r=[];for(const a of t)if(a.length<=e)r.push(a);else{const l=a.split(" ");let s="";for(const m of l)s.length+m.length+1>e?(s&&r.push(s),s=m):s=s?s+" "+m:m;s&&r.push(s)}return r.join(`
|
|
14
|
+
`)}function $e(n,e,t,r){const a=Me(n),l=[],s=[];let m=t;for(const d of a){if(d.type==="mermaid"){s.push({content:d.content,x:e,y:m}),m+=200+re;continue}const p=_e(d.content,42),c=p.length>600?p.slice(0,600)+`
|
|
15
|
+
...`:p;let f;switch(d.type){case"research":f=De(e,m,c,J);break;case"suggestion":f=Ee(e,m,c,J);break;default:f=je(e,m,c,J);break}l.push({blockId:f.blockId,groupId:f.groupId,elements:f.elements,totalHeight:f.totalHeight}),m+=f.totalHeight+re}if(r&&l.length>0){const d=Y(r,l[0].blockId);l[0].elements.push(d.element)}for(let d=0;d<l.length-1;d++){const p=Y(l[d].blockId,l[d+1].blockId);l[d+1].elements.push(p.element)}return{blocks:l,mermaidSections:s}}const q="upfynai-excalidraw-scene",ae=`You are a visual AI assistant working on an infinite canvas. The user has drawn elements on the canvas and is asking you to analyze and respond.
|
|
16
|
+
|
|
17
|
+
IMPORTANT: Structure your response using markdown headings so it can be rendered as visual blocks:
|
|
18
|
+
- Use ## headings to separate major sections
|
|
19
|
+
- Use ### Research: or ### Analysis: for research/analysis sections
|
|
20
|
+
- Use ### Suggestions: or ### Ideas: for suggestion sections
|
|
21
|
+
- Use > blockquotes for key insights or recommendations
|
|
22
|
+
- Use \`\`\`mermaid code blocks for flow diagrams when appropriate
|
|
23
|
+
- Keep each section concise (2-4 sentences or bullet points)
|
|
24
|
+
- Be visual and structured — your response will appear as blocks on the canvas
|
|
25
|
+
|
|
26
|
+
Here is the current canvas context:
|
|
27
|
+
|
|
28
|
+
`;function Le({selectedProject:n,ws:e,sendMessage:t,latestMessage:r}){const[a,l]=g.useState(null),[s,m]=g.useState(null),[d,p]=g.useState(!1),[c,f]=g.useState(""),[x,D]=g.useState(!1),[A,w]=g.useState([]),[o,b]=g.useState(0),v=g.useRef(null),k=g.useRef(""),I=g.useRef(null),T=g.useRef({x:0,y:0}),P=g.useRef(null);g.useEffect(()=>{const u="upfynai-canvas-v2-migrated";localStorage.getItem(u)||(localStorage.removeItem(q),localStorage.setItem(u,"1")),ce(()=>import("./percentages-BXMCSKIN-WVlHS4wx.js").then(h=>h.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(h=>{l(()=>h.Excalidraw)})},[]);const M=g.useCallback(()=>{try{const u=localStorage.getItem(q);if(u)return{elements:JSON.parse(u).elements||[],appState:{viewModeEnabled:!1,gridModeEnabled:!0}}}catch{}return{elements:[],appState:{viewModeEnabled:!1,gridModeEnabled:!0}}},[]),$=g.useCallback((u,h)=>{try{localStorage.setItem(q,JSON.stringify({elements:u}))}catch{}const E=Object.keys((h==null?void 0:h.selectedElementIds)||{}).length;b(E)},[]);g.useEffect(()=>{if(!s)return;window.__excalidrawAPI=s,Te();const u=E=>{try{const S=JSON.parse(E.data);S.type==="canvas-update"&&S.elements&&s&&s.updateScene({elements:S.elements}),S.type==="canvas-block-command"&&S.action&&Re(S)}catch{}},h=window.__upfynWs;return h&&h.addEventListener("message",u),()=>{delete window.__excalidrawAPI,Be(),h&&h.removeEventListener("message",u)}},[s]),g.useEffect(()=>{if(!(!r||!x)){if(r.type==="claude-response"||r.type==="assistant"){const u=r.content||r.text||r.message||"";u&&(k.current+=u)}if(r.type==="claude-complete"||r.type==="message_stop"){const u=k.current.trim();u&&s&&(pe(u),w(h=>[...h,{role:"ai",text:u.slice(0,200)+(u.length>200?"...":"")}])),D(!1),k.current=""}}},[r,x,s]),g.useEffect(()=>{P.current&&(P.current.scrollTop=P.current.scrollHeight)},[A]);const pe=g.useCallback(u=>{if(!s)return;const h=T.current,E=h.x+300,S=h.y,{blocks:N,mermaidSections:y}=$e(u,E,S,I.current||void 0),C=[];for(const j of N)C.push(...j.elements);if(C.length>0){const j=s.getSceneElements();s.updateScene({elements:[...j,...C]}),s.scrollToContent(C)}for(const j of y)B.addNote(j.x,j.y,`[Flowchart]
|
|
29
|
+
${j.content}`)},[s]),Q=g.useCallback(()=>{if(!s||!t||x)return;const u=oe(s),h=se(s),S=te(h.x,h.y,"Analyzing canvas..."),N=s.getSceneElements();s.updateScene({elements:[...N,...S.elements]}),I.current=S.blockId,T.current={x:h.x,y:h.y};const y=ae+u+`
|
|
30
|
+
|
|
31
|
+
Analyze the canvas and provide a structured visual response.`;k.current="",D(!0),w(C=>[...C,{role:"user",text:"Run: Analyze canvas context"}]),t({type:"claude-command",command:y,options:{canvasMode:!0}})},[s,t,x]),Z=g.useCallback(()=>{t&&t({type:"cancel-command"}),D(!1),k.current=""},[t]),ee=g.useCallback(()=>{const u=c.trim();if(!u||!s||!t||x)return;const h=Pe(s),E=h||oe(s),S=h?"Selected items context":"Full canvas context",N=se(s),y=te(N.x,N.y,u),C=s.getSceneElements();s.updateScene({elements:[...C,...y.elements]}),I.current=y.blockId,T.current={x:N.x,y:N.y};const j=ae+`[${S}]
|
|
32
|
+
`+E+`
|
|
33
|
+
|
|
34
|
+
User message: `+u;k.current="",D(!0),w(W=>[...W,{role:"user",text:u}]),f(""),t({type:"claude-command",command:j,options:{canvasMode:!0}})},[c,s,t,x]),fe=g.useCallback(()=>{var N;if(!s)return;const u=s.getSceneElements(),h=new Set(["response","research","suggestion","prompt"]),E=new Set;for(const y of u)if((N=y.customData)!=null&&N.blockType&&h.has(y.customData.blockType)&&y.groupIds)for(const C of y.groupIds)E.add(C);const S=u.map(y=>{var C,j,W;return(C=y.customData)!=null&&C.blockType&&h.has(y.customData.blockType)?{...y,isDeleted:!0}:(j=y.groupIds)!=null&&j.some(he=>E.has(he))?{...y,isDeleted:!0}:((W=y.customData)==null?void 0:W.blockType)==="context-link"?{...y,isDeleted:!0}:y});s.updateScene({elements:S}),w([])},[s]);return a?i.jsxs("div",{className:"excalidraw-wrapper h-full w-full relative",children:[s&&i.jsx(Ae,{api:s,onRun:Q,onStop:Z,onClearAi:fe,isRunning:x}),i.jsx(a,{excalidrawAPI:u=>m(u),initialData:M(),onChange:$,UIOptions:{welcomeScreen:!1,canvasActions:{export:!1,loadScene:!1,saveToActiveFile:!1,toggleTheme:!1},tools:{image:!1}},viewModeEnabled:!1,gridModeEnabled:!0}),i.jsx("div",{className:"absolute top-4 right-4 z-20 flex items-center gap-2",children:x?i.jsxs("button",{onClick:Z,className:"flex items-center gap-2 px-4 py-2 rounded-xl bg-red-500 text-white shadow-lg hover:bg-red-600 transition-colors text-sm font-medium",children:[i.jsx("div",{className:"w-3 h-3 bg-white rounded-sm"}),"Stop"]}):i.jsxs("button",{onClick:Q,className:"flex items-center gap-2 px-4 py-2 rounded-xl bg-primary text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors text-sm font-medium canvas-run-btn",title:"Read canvas context and ask AI",children:[i.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M8 5v14l11-7z"})}),"Run"]})}),x&&i.jsx("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-20",children:i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-primary/10 border border-primary/20 rounded-full text-xs text-primary font-medium",children:[i.jsx("div",{className:"w-2 h-2 bg-primary rounded-full animate-pulse"}),"AI is analyzing canvas..."]})}),i.jsx("button",{onClick:()=>{p(!d),d||setTimeout(()=>{var u;return(u=v.current)==null?void 0:u.focus()},100)},className:"absolute bottom-4 right-4 z-20 w-10 h-10 rounded-full bg-primary text-primary-foreground shadow-lg flex items-center justify-center hover:bg-primary/90 transition-colors",title:d?"Hide chat":"Chat with canvas",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d?i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),d&&i.jsx("div",{className:"absolute bottom-16 right-4 z-20 w-80 max-h-[50vh] canvas-chat-panel",children:i.jsxs("div",{className:"bg-card/95 backdrop-blur-md border border-border/50 rounded-2xl shadow-xl flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"px-3 py-2 border-b border-border/30 flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-medium text-foreground",children:"Canvas Chat"}),i.jsx("div",{className:"flex items-center gap-1",children:i.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${o>0?"text-primary bg-primary/10":"text-muted-foreground bg-muted/50"}`,children:o>0?`${o} selected`:"full canvas"})})]}),i.jsxs("div",{ref:P,className:"flex-1 overflow-y-auto max-h-48 px-3 py-2 space-y-2",children:[A.length===0&&i.jsx("p",{className:"text-xs text-muted-foreground/60 text-center py-4",children:"Ask AI about your canvas. Context is auto-attached."}),A.map((u,h)=>i.jsxs("div",{className:`text-xs px-2 py-1.5 rounded-lg ${u.role==="user"?"bg-primary/10 text-foreground ml-6":"bg-muted/50 text-foreground mr-6"}`,children:[i.jsx("span",{className:"font-medium text-[10px] text-muted-foreground block mb-0.5",children:u.role==="user"?"You":"AI"}),u.text]},h)),x&&i.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1 px-2",children:[i.jsx("div",{className:"w-1.5 h-1.5 bg-primary rounded-full animate-pulse"}),"Thinking..."]})]}),i.jsx("div",{className:"p-2 border-t border-border/30",children:i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("textarea",{ref:v,value:c,onChange:u=>f(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),ee())},placeholder:"Ask about your canvas...",rows:1,className:"flex-1 bg-muted/30 text-foreground text-xs placeholder-muted-foreground/50 resize-none outline-none px-3 py-2 rounded-lg max-h-16 overflow-y-auto border border-border/30 focus:border-primary/30"}),i.jsx("button",{onClick:ee,disabled:!c.trim()||x,className:"shrink-0 w-8 h-8 rounded-lg bg-primary text-primary-foreground flex items-center justify-center disabled:opacity-40 hover:bg-primary/90 transition-colors",children:x?i.jsx("div",{className:"w-3 h-3 border-2 border-primary-foreground/30 border-t-primary-foreground rounded-full animate-spin"}):i.jsx("svg",{className:"w-3.5 h-3.5 rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]})})]})})]}):i.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading whiteboard..."})}const Ue=ge.memo(Le);export{Ue as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.excalidraw .main-menu-trigger,.excalidraw .welcome-screen-center,.excalidraw a[href*="excalidraw.com"],.excalidraw .encrypted-icon{display:none!important}.excalidraw .collab-button,.excalidraw .CollabButton,.excalidraw [data-testid=collab-button],.excalidraw button[title="Live collaboration"],.excalidraw .share-button,.excalidraw button.collab-button,.excalidraw [class*=collab],.excalidraw [class*=CollabButton],.excalidraw [class*=share-button],.excalidraw .layer-ui__wrapper__top-right [class*=Island]>button:last-child{display:none!important}.excalidraw .HelpButton,.excalidraw button[data-testid=help-icon]{display:none!important}.excalidraw-wrapper{width:100%;height:100%;position:relative}.excalidraw-wrapper .excalidraw{width:100%;height:100%}.excalidraw .App-toolbar-container{z-index:3}.canvas-block-toolbar{position:absolute;top:50%;left:12px;transform:translateY(-50%);z-index:10;display:flex;flex-direction:column;gap:4px;padding:6px;background:#ffffffeb;border:1px solid rgba(0,0,0,.1);border-radius:12px;backdrop-filter:blur(8px);box-shadow:0 2px 8px #00000014}.canvas-block-toolbar button{color:#555}.canvas-block-toolbar button:hover{color:#111;background:#0000000f}.canvas-block-toolbar .w-5{border-color:#0000001a}.canvas-run-btn{box-shadow:0 2px 12px rgba(var(--primary-rgb, 59 130 246) / .3);transition:all .2s}.canvas-run-btn:hover{box-shadow:0 4px 16px rgba(var(--primary-rgb, 59 130 246) / .4);transform:translateY(-1px)}.canvas-chat-panel{animation:slideUp .2s ease-out}@keyframes slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as e}from"./vendor-react-9mUTKBHH.js";import{a as f,I as x}from"./index-ce18TYkg.js";import{e as j,f as N,g as v,Z as u,R as w,T as y,d as k,B as C,E as S,A as I}from"./vendor-icons-Lb69KSFJ.js";import"./vendor-syntax-DnmwQQJF.js";import"./vendor-markdown-BXEi_H3G.js";import"./vendor-i18n-DCFGyhQR.js";function B({selectedProject:s}){const[t,o]=n.useState(null),[r,l]=n.useState(null),[a,m]=n.useState(!0),[R,p]=n.useState(null),i=n.useCallback(async()=>{m(!0),p(null);try{const c=await f("/api/dashboard/stats");if(c.ok){const b=await c.json();o(b)}}catch{}m(!1)},[]);return n.useEffect(()=>{i()},[i]),e.jsxs("div",{className:"h-full overflow-y-auto p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(j,{className:"w-5 h-5 text-blue-500"}),"Dashboard"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:s?`Project: ${s.displayName||s.name}`:"Overview"})]}),e.jsx("button",{onClick:i,disabled:a,className:"p-2 rounded-lg hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors",title:"Refresh stats",children:e.jsx(N,{className:`w-4 h-4 ${a?"animate-spin":""}`})})]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsx(g,{icon:v,label:"Sessions",value:(t==null?void 0:t.total)??"—",subtext:t!=null&&t.today?`${t.today} today`:void 0,color:"blue"}),e.jsx(g,{icon:u,label:"AI Providers",value:t!=null&&t.providers?Object.keys(t.providers).length:"—",subtext:t!=null&&t.providers?Object.keys(t.providers).join(", "):void 0,color:"purple"}),x]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3 uppercase tracking-wider",children:"Quick Actions"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:[e.jsx(h,{label:"Install CLI",description:"npm install -g upfynai-code",onClick:()=>navigator.clipboard.writeText("npm install -g upfynai-code")}),e.jsx(h,{label:"Connect Machine",description:"uc connect",onClick:()=>navigator.clipboard.writeText("uc connect")}),x]})]}),x,s&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3 uppercase tracking-wider",children:"Project Info"}),e.jsxs("div",{className:"rounded-lg bg-muted/30 border border-border/50 p-4 space-y-2",children:[e.jsx(d,{label:"Name",value:s.displayName||s.name}),e.jsx(d,{label:"Path",value:s.fullPath||s.path||"—"}),s.sessions&&e.jsx(d,{label:"Claude Sessions",value:String(s.sessions.length)}),s.cursorSessions&&e.jsx(d,{label:"Cursor Sessions",value:String(s.cursorSessions.length)}),s.codexSessions&&e.jsx(d,{label:"Codex Sessions",value:String(s.codexSessions.length)})]})]}),!s&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-3 uppercase tracking-wider flex items-center gap-2",children:[e.jsx(w,{className:"w-3.5 h-3.5"}),"Getting Started"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-lg border border-border/50 bg-card/50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(y,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"1. Install the CLI"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Install globally, then run ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"uc"})," to launch."]}),e.jsx("code",{className:"text-xs bg-muted/50 px-2 py-1 rounded block text-foreground/80",children:"npm install -g upfynai-code"})]}),e.jsxs("div",{className:"rounded-lg border border-border/50 bg-card/50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(u,{className:"w-4 h-4 text-yellow-500"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"2. Connect Your Machine"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Bridge your local dev environment to this web UI."}),e.jsx("code",{className:"text-xs bg-muted/50 px-2 py-1 rounded block text-foreground/80",children:"uc connect --key your_relay_token"})]}),e.jsxs("div",{className:"rounded-lg border border-border/50 bg-card/50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(k,{className:"w-4 h-4 text-indigo-500"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"3. Use the Canvas"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Switch to the Canvas tab to create visual workspaces with code blocks, diagrams, and notes."})]}),e.jsxs("div",{className:"rounded-lg border border-border/50 bg-card/50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(C,{className:"w-4 h-4 text-emerald-500"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"4. Chat with AI"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the Chat tab to talk to Claude, Cursor, or Codex. Bring your own API keys in Settings."})]})]})]})]})}function g({icon:s,label:t,value:o,subtext:r,color:l}){const a={blue:"text-blue-500 bg-blue-500/10",purple:"text-purple-500 bg-purple-500/10",amber:"text-amber-500 bg-amber-500/10",emerald:"text-emerald-500 bg-emerald-500/10"};return e.jsxs("div",{className:"rounded-lg border border-border/50 bg-card/50 p-3 sm:p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:`w-7 h-7 rounded-md flex items-center justify-center ${a[l]}`,children:e.jsx(s,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t})]}),e.jsx("p",{className:"text-xl font-semibold text-foreground",children:o}),r&&e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:r})]})}function h({label:s,description:t,onClick:o,href:r}){const l=r?"a":"button",a=r?{href:r,target:"_blank",rel:"noopener noreferrer"}:{onClick:o};return e.jsxs(l,{...a,className:"flex items-center justify-between p-3 rounded-lg border border-border/50 bg-card/50 hover:bg-muted/60 transition-colors text-left group",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t})]}),r?e.jsx(S,{className:"w-3.5 h-3.5 text-muted-foreground group-hover:text-foreground"}):e.jsx(I,{className:"w-3.5 h-3.5 text-muted-foreground group-hover:text-foreground"})]})}function d({label:s,value:t}){return e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),e.jsx("span",{className:"text-foreground font-mono text-xs truncate max-w-[60%] text-right",children:t})]})}export{B as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{a as ye,r as s,j as e}from"./vendor-react-9mUTKBHH.js";import{b as be,R as we,g as ve,c as Ne,d as de}from"./index-ce18TYkg.js";import{x as je,a as ke,b as Ce,c as Se}from"./vendor-xterm-CZq1hqo1.js";import{X as Le}from"./vendor-icons-Lb69KSFJ.js";const Re=(t,r,o,g)=>{var n,w,N,d;const y=[o,{code:r,...g||{}}];if((w=(n=t==null?void 0:t.services)==null?void 0:n.logger)!=null&&w.forward)return t.services.logger.forward(y,"warn","react-i18next::",!0);z(y[0])&&(y[0]=`react-i18next:: ${y[0]}`),(d=(N=t==null?void 0:t.services)==null?void 0:N.logger)!=null&&d.warn?t.services.logger.warn(...y):console!=null&&console.warn&&console.warn(...y)},se={},fe=(t,r,o,g)=>{z(o)&&se[o]||(z(o)&&(se[o]=new Date),Re(t,r,o,g))},xe=(t,r)=>()=>{if(t.isInitialized)r();else{const o=()=>{setTimeout(()=>{t.off("initialized",o)},0),r()};t.on("initialized",o)}},ee=(t,r,o)=>{t.loadNamespaces(r,xe(t,o))},ae=(t,r,o,g)=>{if(z(o)&&(o=[o]),t.options.preload&&t.options.preload.indexOf(r)>-1)return ee(t,o,g);o.forEach(y=>{t.options.ns.indexOf(y)<0&&t.options.ns.push(y)}),t.loadLanguages(r,xe(t,g))},Ee=(t,r,o={})=>!r.languages||!r.languages.length?(fe(r,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:r.languages}),!0):r.hasLoadedNamespace(t,{lng:o.lng,precheck:(g,y)=>{if(o.bindI18n&&o.bindI18n.indexOf("languageChanging")>-1&&g.services.backendConnector.backend&&g.isLanguageChangingTo&&!y(g.isLanguageChangingTo,t))return!1}}),z=t=>typeof t=="string",Te=t=>typeof t=="object"&&t!==null;var Y={exports:{}},Q={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var le;function Ie(){if(le)return Q;le=1;var t=ye();function r(c,a){return c===a&&(c!==0||1/c===1/a)||c!==c&&a!==a}var o=typeof Object.is=="function"?Object.is:r,g=t.useState,y=t.useEffect,n=t.useLayoutEffect,w=t.useDebugValue;function N(c,a){var b=a(),S=g({inst:{value:b,getSnapshot:a}}),h=S[0].inst,O=S[1];return n(function(){h.value=b,h.getSnapshot=a,d(h)&&O({inst:h})},[c,b,a]),y(function(){return d(h)&&O({inst:h}),c(function(){d(h)&&O({inst:h})})},[c]),w(b),b}function d(c){var a=c.getSnapshot;c=c.value;try{var b=a();return!o(c,b)}catch{return!0}}function j(c,a){return a()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?j:N;return Q.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Q}var oe;function Oe(){return oe||(oe=1,Y.exports=Ie()),Y.exports}var Ae=Oe();const Me=(t,r)=>z(r)?r:Te(r)&&z(r.defaultValue)?r.defaultValue:Array.isArray(t)?t[t.length-1]:t,_e={t:Me,ready:!1},Pe=()=>()=>{},Ue=(t,r={})=>{var D,i,C;const{i18n:o}=r,{i18n:g,defaultNS:y}=s.useContext(be)||{},n=o||g||Ne();n&&!n.reportNamespaces&&(n.reportNamespaces=new we),n||fe(n,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const w=s.useMemo(()=>{var l;return{...ve(),...(l=n==null?void 0:n.options)==null?void 0:l.react,...r}},[n,r]),{useSuspense:N,keyPrefix:d}=w,j=t||y||((D=n==null?void 0:n.options)==null?void 0:D.defaultNS),u=z(j)?[j]:j||["translation"],c=s.useMemo(()=>u,u);(C=(i=n==null?void 0:n.reportNamespaces)==null?void 0:i.addUsedNamespaces)==null||C.call(i,c);const a=s.useRef(0),b=s.useCallback(l=>{if(!n)return Pe;const{bindI18n:x,bindI18nStore:m}=w,p=()=>{a.current+=1,l()};return x&&n.on(x,p),m&&n.store.on(m,p),()=>{x&&x.split(" ").forEach(I=>n.off(I,p)),m&&m.split(" ").forEach(I=>n.store.off(I,p))}},[n,w]),S=s.useRef(),h=s.useCallback(()=>{if(!n)return _e;const l=!!(n.isInitialized||n.initializedStoreOnce)&&c.every(H=>Ee(H,n,w)),x=r.lng||n.language,m=a.current,p=S.current;if(p&&p.ready===l&&p.lng===x&&p.keyPrefix===d&&p.revision===m)return p;const J={t:n.getFixedT(x,w.nsMode==="fallback"?c:c[0],d),ready:l,lng:x,keyPrefix:d,revision:m};return S.current=J,J},[n,c,d,w,r.lng]),[O,_]=s.useState(0),{t:A,ready:E}=Ae.useSyncExternalStore(b,h,h);s.useEffect(()=>{if(n&&!E&&!N){const l=()=>_(x=>x+1);r.lng?ae(n,r.lng,c,l):ee(n,c,l)}},[n,r.lng,c,E,N,O]);const M=n||{},k=s.useRef(null),T=s.useRef(),B=l=>{const x=Object.getOwnPropertyDescriptors(l);x.__original&&delete x.__original;const m=Object.create(Object.getPrototypeOf(l),x);if(!Object.prototype.hasOwnProperty.call(m,"__original"))try{Object.defineProperty(m,"__original",{value:l,writable:!1,enumerable:!1,configurable:!1})}catch{}return m},P=s.useMemo(()=>{const l=M,x=l==null?void 0:l.language;let m=l;l&&(k.current&&k.current.__original===l?T.current!==x?(m=B(l),k.current=m,T.current=x):m=k.current:(m=B(l),k.current=m,T.current=x));const p=[A,m,E];return p.t=A,p.i18n=m,p.ready=E,p},[A,M,E,M.resolvedLanguage,M.language,M.languages]);if(n&&N&&!E)throw new Promise(l=>{const x=()=>l();r.lng?ae(n,r.lng,c,x):ee(n,c,x)});return P},Je=({className:t="w-5 h-5"})=>e.jsx("img",{src:"/icons/claude-ai-icon.svg",alt:"Claude",className:t}),Ke=({className:t="w-5 h-5"})=>{const{isDarkMode:r}=de();return e.jsx("img",{src:r?"/icons/cursor-white.svg":"/icons/cursor.svg",alt:"Cursor",className:t})},qe=({className:t="w-5 h-5"})=>{const{isDarkMode:r}=de();return e.jsx("img",{src:r?"/icons/codex-white.svg":"/icons/codex.svg",alt:"Codex",className:t})},We=`
|
|
10
|
+
.xterm .xterm-screen {
|
|
11
|
+
outline: none !important;
|
|
12
|
+
}
|
|
13
|
+
.xterm:focus .xterm-screen {
|
|
14
|
+
outline: none !important;
|
|
15
|
+
}
|
|
16
|
+
.xterm-screen:focus {
|
|
17
|
+
outline: none !important;
|
|
18
|
+
}
|
|
19
|
+
`;if(typeof document<"u"){const t=document.createElement("style");t.type="text/css",t.innerText=We,document.head.appendChild(t)}function ze(t){if(!t||typeof document>"u")return!1;const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="fixed",r.style.opacity="0",r.style.pointerEvents="none",document.body.appendChild(r),r.focus(),r.select();let o=!1;try{o=document.execCommand("copy")}catch{o=!1}finally{document.body.removeChild(r)}return o}const ce="https://auth.openai.com/codex/device";function ie(t){return typeof t=="string"&&/\bcodex\s+login\b/i.test(t)}function ue({selectedProject:t,selectedSession:r,initialCommand:o,isPlainShell:g=!1,onProcessComplete:y,minimal:n=!1,autoConnect:w=!1,shellType:N=null}){const{t:d}=Ue("chat"),j=s.useRef(null),u=s.useRef(null),c=s.useRef(null),a=s.useRef(null),[b,S]=s.useState(!1),[h,O]=s.useState(!1),[_,A]=s.useState(!1),[E,M]=s.useState(null),[k,T]=s.useState(!1),[B,P]=s.useState(""),[D,i]=s.useState("idle"),[C,l]=s.useState(!1),x=s.useRef(t),m=s.useRef(r),p=s.useRef(o),I=s.useRef(g),J=s.useRef(N),H=s.useRef(y),W=s.useRef("");s.useEffect(()=>{x.current=t,m.current=r,p.current=o,I.current=g,J.current=N,H.current=y});const te=s.useCallback((v=W.current)=>{if(!v)return!1;const R=window.open(v,"_blank","noopener,noreferrer");if(R){try{R.opener=null}catch{}return!0}return!1},[]),G=s.useCallback(async(v=W.current)=>{var L;if(!v)return!1;let R=!1;try{typeof navigator<"u"&&((L=navigator.clipboard)!=null&&L.writeText)&&(await navigator.clipboard.writeText(v),R=!0)}catch{R=!1}return R||(R=ze(v)),R},[]),re=s.useCallback(async()=>{if(!(k||b))try{let v;v=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/shell`,a.current=new WebSocket(v),a.current.onopen=()=>{S(!0),T(!1),W.current="",P(""),i("idle"),l(!1),setTimeout(()=>{var L,f;c.current&&u.current&&(c.current.fit(),a.current.send(JSON.stringify({type:"init",projectPath:x.current.fullPath||x.current.path,sessionId:I.current?null:(L=m.current)==null?void 0:L.id,hasSession:I.current?!1:!!m.current,provider:I.current?"plain-shell":((f=m.current)==null?void 0:f.__provider)||"claude",cols:u.current.cols,rows:u.current.rows,initialCommand:p.current,isPlainShell:I.current,shellType:J.current})))},100)},a.current.onmessage=L=>{try{const f=JSON.parse(L.data);if(f.type==="output"){let U=f.data;if(I.current&&H.current){const F=U.replace(/\x1b\[[0-9;]*m/g,"");if(F.includes("Process exited with code 0"))H.current(0);else if(F.match(/Process exited with code (\d+)/)){const K=parseInt(F.match(/Process exited with code (\d+)/)[1]);K!==0&&H.current(K)}}u.current&&u.current.write(U)}else(f.type==="auth_url"&&f.url||f.type==="url_open"&&f.url)&&(W.current=f.url,P(f.url),i("idle"),l(!1))}catch(f){console.error("[Shell] Error handling WebSocket message:",f,L.data)}},a.current.onclose=L=>{S(!1),T(!1),i("idle"),l(!1),u.current&&(u.current.clear(),u.current.write("\x1B[2J\x1B[H"))},a.current.onerror=L=>{S(!1),T(!1)}}catch{S(!1),T(!1)}},[k,b,te]),V=s.useCallback(()=>{!h||b||k||(T(!0),re())},[h,b,k,re]),X=s.useCallback(()=>{a.current&&(a.current.close(),a.current=null),u.current&&(u.current.clear(),u.current.write("\x1B[2J\x1B[H")),S(!1),T(!1),W.current="",P(""),i("idle"),l(!1)},[]),$=s.useMemo(()=>r?r.__provider==="cursor"?r.name||"Untitled Session":r.summary||"New Session":null,[r]),he=s.useMemo(()=>$?$.slice(0,30):null,[$]),me=s.useMemo(()=>$?$.slice(0,50):null,[$]),pe=()=>{A(!0),a.current&&(a.current.close(),a.current=null),u.current&&(u.current.dispose(),u.current=null,c.current=null),S(!1),O(!1),W.current="",P(""),i("idle"),l(!1),setTimeout(()=>{A(!1)},200)};if(s.useEffect(()=>{const v=(r==null?void 0:r.id)||null;E!==null&&E!==v&&h&&X(),M(v)},[r==null?void 0:r.id,h,X]),s.useEffect(()=>{if(!j.current||!t||_||u.current)return;u.current=new je.Terminal({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',allowProposedApi:!0,allowTransparency:!1,convertEol:!0,scrollback:1e4,tabStopWidth:4,windowsMode:!1,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#1e1e1e",selection:"#264f78",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff",extendedAnsi:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"]}}),c.current=new ke.FitAddon;const v=new Ce.WebglAddon,R=new Se.WebLinksAddon;u.current.loadAddon(c.current),n||u.current.loadAddon(R);try{u.current.loadAddon(v)}catch{console.warn("[Shell] WebGL renderer unavailable, using Canvas fallback")}u.current.open(j.current),u.current.attachCustomKeyEventHandler(f=>{var F,K,ne;const U=ie(p.current)?ce:W.current;return f.type==="keydown"&&n&&I.current&&U&&!f.ctrlKey&&!f.metaKey&&!f.altKey&&((F=f.key)==null?void 0:F.toLowerCase())==="c"&&G(U).catch(()=>{}),f.type==="keydown"&&(f.ctrlKey||f.metaKey)&&((K=f.key)==null?void 0:K.toLowerCase())==="c"&&u.current.hasSelection()?(f.preventDefault(),f.stopPropagation(),document.execCommand("copy"),!1):f.type==="keydown"&&(f.ctrlKey||f.metaKey)&&((ne=f.key)==null?void 0:ne.toLowerCase())==="v"?(f.preventDefault(),f.stopPropagation(),navigator.clipboard.readText().then(ge=>{a.current&&a.current.readyState===WebSocket.OPEN&&a.current.send(JSON.stringify({type:"input",data:ge}))}).catch(()=>{}),!1):!0}),setTimeout(()=>{c.current&&(c.current.fit(),u.current&&a.current&&a.current.readyState===WebSocket.OPEN&&a.current.send(JSON.stringify({type:"resize",cols:u.current.cols,rows:u.current.rows})))},100),O(!0),u.current.onData(f=>{a.current&&a.current.readyState===WebSocket.OPEN&&a.current.send(JSON.stringify({type:"input",data:f}))});const L=new ResizeObserver(()=>{c.current&&u.current&&setTimeout(()=>{c.current.fit(),a.current&&a.current.readyState===WebSocket.OPEN&&a.current.send(JSON.stringify({type:"resize",cols:u.current.cols,rows:u.current.rows}))},50)});return j.current&&L.observe(j.current),()=>{L.disconnect(),a.current&&(a.current.readyState===WebSocket.OPEN||a.current.readyState===WebSocket.CONNECTING)&&a.current.close(),a.current=null,u.current&&(u.current.dispose(),u.current=null)}},[(t==null?void 0:t.path)||(t==null?void 0:t.fullPath),_,n,G]),s.useEffect(()=>{!w||!h||k||b||V()},[w,h,k,b,V]),!t)return e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:d("shell.selectProject.title")}),e.jsx("p",{children:d("shell.selectProject.description")})]})});if(n){const v=ie(o)?ce:B,R=!!v,L=R&&!C,f=R&&C;return e.jsxs("div",{className:"h-full w-full bg-gray-900 relative",children:[e.jsx("div",{ref:j,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),L&&e.jsx("div",{className:"absolute inset-x-0 bottom-14 z-20 border-t border-gray-700/80 bg-gray-900/95 p-3 backdrop-blur-sm md:hidden",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-gray-300",children:"Open or copy the login URL:"}),e.jsx("button",{type:"button",onClick:()=>l(!0),className:"rounded bg-gray-700 px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-gray-100 hover:bg-gray-600",children:"Hide"})]}),e.jsx("input",{type:"text",value:v,readOnly:!0,onClick:U=>U.currentTarget.select(),className:"w-full rounded border border-gray-600 bg-gray-800 px-2 py-1 text-xs text-gray-100 focus:outline-none focus:ring-1 focus:ring-blue-500","aria-label":"Authentication URL"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{te(v)},className:"flex-1 rounded bg-blue-600 px-3 py-2 text-xs font-medium text-white hover:bg-blue-700",children:"Open URL"}),e.jsx("button",{type:"button",onClick:async()=>{const U=await G(v);i(U?"copied":"failed")},className:"flex-1 rounded bg-gray-700 px-3 py-2 text-xs font-medium text-white hover:bg-gray-600",children:D==="copied"?"Copied":"Copy URL"})]})]})}),f&&e.jsx("div",{className:"absolute bottom-14 right-3 z-20 md:hidden",children:e.jsx("button",{type:"button",onClick:()=>l(!1),className:"rounded bg-gray-800/95 px-3 py-2 text-xs font-medium text-gray-100 shadow-lg backdrop-blur-sm hover:bg-gray-700",children:"Show login URL"})})]})}return e.jsxs("div",{className:"h-full flex flex-col bg-gray-900 w-full",children:[e.jsx("div",{className:"flex-shrink-0 bg-gray-800 border-b border-gray-700 px-4 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${b?"bg-green-500":"bg-red-500"}`}),r&&e.jsxs("span",{className:"text-xs text-blue-300",children:["(",he,"...)"]}),!r&&e.jsx("span",{className:"text-xs text-gray-400",children:d("shell.status.newSession")}),!h&&e.jsx("span",{className:"text-xs text-yellow-400",children:d("shell.status.initializing")}),_&&e.jsx("span",{className:"text-xs text-blue-400",children:d("shell.status.restarting")})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[b&&e.jsxs("button",{onClick:X,className:"px-3 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-700 flex items-center space-x-1",title:d("shell.actions.disconnectTitle"),children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),e.jsx("span",{children:d("shell.actions.disconnect")})]}),e.jsxs("button",{onClick:pe,disabled:_||b,className:"text-xs text-gray-400 hover:text-white disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-1",title:d("shell.actions.restartTitle"),children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),e.jsx("span",{children:d("shell.actions.restart")})]})]})]})}),e.jsxs("div",{className:"flex-1 p-2 overflow-hidden relative",children:[e.jsx("div",{ref:j,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),!h&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90",children:e.jsx("div",{className:"text-white",children:d("shell.loading")})}),h&&!b&&!k&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:e.jsxs("div",{className:"text-center max-w-sm w-full",children:[e.jsxs("button",{onClick:V,className:"px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors flex items-center justify-center space-x-2 text-base font-medium w-full sm:w-auto",title:d("shell.actions.connectTitle"),children:[e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),e.jsx("span",{children:d("shell.actions.connect")})]}),e.jsx("p",{className:"text-gray-400 text-sm mt-3 px-2",children:g?d("shell.runCommand",{command:o||d("shell.defaultCommand"),projectName:t.displayName}):r?d("shell.resumeSession",{displayName:me}):d("shell.startSession")})]})}),k&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:e.jsxs("div",{className:"text-center max-w-sm w-full",children:[e.jsxs("div",{className:"flex items-center justify-center space-x-3 text-yellow-400",children:[e.jsx("div",{className:"w-6 h-6 animate-spin rounded-full border-2 border-yellow-400 border-t-transparent"}),e.jsx("span",{className:"text-base font-medium",children:d("shell.connecting")})]}),e.jsx("p",{className:"text-gray-400 text-sm mt-3 px-2",children:g?d("shell.runCommand",{command:o||d("shell.defaultCommand"),projectName:t.displayName}):d("shell.startCli",{projectName:t.displayName})})]})})]})]})}let Z=0;const q=[{value:"powershell",label:"PowerShell",icon:"PS"},{value:"cmd",label:"CMD",icon:">"},{value:"bash",label:"Bash",icon:"$"}];function Be({project:t,session:r=null,command:o=null,isPlainShell:g=null,autoConnect:y=!0,onComplete:n=null,onClose:w=null,title:N=null,className:d="",showHeader:j=!0,compact:u=!1,minimal:c=!1,multiTab:a=!1}){const[b,S]=s.useState(!1),[h,O]=s.useState(()=>[{id:++Z,shellType:"powershell",label:"PowerShell"}]),[_,A]=s.useState(()=>{var i;return(i=h[0])==null?void 0:i.id}),[E,M]=s.useState(!1),k=s.useRef(null),T=g!==null?g:o!==null,B=s.useCallback(i=>{S(!0),n&&n(i)},[n]),P=s.useCallback(i=>{const C=q.find(x=>x.value===i)||q[0],l=++Z;O(x=>[...x,{id:l,shellType:C.value,label:C.label}]),A(l),M(!1)},[]),D=s.useCallback(i=>{O(C=>{const l=C.filter(x=>x.id!==i);return l.length===0?[{id:++Z,shellType:"powershell",label:"PowerShell"}]:l}),A(C=>{if(C===i){const l=h.findIndex(p=>p.id===i),x=h.filter(p=>p.id!==i);if(x.length===0)return null;const m=Math.min(l,x.length-1);return x[m].id}return C})},[h]);return t?a&&!c&&!r&&!o?e.jsxs("div",{className:`h-full w-full flex flex-col ${d}`,children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center bg-[#1e1e1e] border-b border-gray-700 px-1 min-h-[36px]",children:[e.jsx("div",{className:"flex items-center gap-0.5 overflow-x-auto flex-1 min-w-0",children:h.map(i=>{var C;return e.jsxs("button",{onClick:()=>A(i.id),className:`group flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-t transition-colors shrink-0 ${_===i.id?"bg-gray-800 text-gray-100 border-t-2 border-t-blue-500":"text-gray-400 hover:text-gray-200 hover:bg-gray-800/50"}`,children:[e.jsx("span",{className:"text-[10px] font-mono opacity-60",children:((C=q.find(l=>l.value===i.shellType))==null?void 0:C.icon)||">"}),e.jsx("span",{children:i.label}),h.length>1&&e.jsx("span",{onClick:l=>{l.stopPropagation(),D(i.id)},className:"ml-1 opacity-0 group-hover:opacity-100 hover:text-red-400 transition-opacity cursor-pointer",title:"Close tab",children:"×"})]},i.id)})}),e.jsxs("div",{className:"relative ml-1 shrink-0",children:[e.jsx("button",{ref:k,onClick:()=>M(!E),className:"flex items-center justify-center w-7 h-7 text-gray-400 hover:text-gray-100 hover:bg-gray-700 rounded transition-colors text-lg",title:"New terminal",children:"+"}),E&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 bg-gray-800 border border-gray-600 rounded-lg shadow-xl py-1 min-w-[140px]",children:q.map(i=>e.jsxs("button",{onClick:()=>P(i.value),className:"w-full text-left px-3 py-1.5 text-xs text-gray-200 hover:bg-gray-700 flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[10px] opacity-60 w-4",children:i.icon}),i.label]},i.value))})]})]}),e.jsx("div",{className:"flex-1 w-full min-h-0 relative",children:h.map(i=>e.jsx("div",{className:"absolute inset-0",style:{display:_===i.id?"block":"none"},children:e.jsx(ue,{selectedProject:t,isPlainShell:!0,shellType:i.shellType,autoConnect:!0,minimal:!1})},i.id))})]}):e.jsxs("div",{className:`h-full w-full flex flex-col ${d}`,children:[!c&&j&&N&&e.jsx("div",{className:"flex-shrink-0 bg-gray-800 border-b border-gray-700 px-4 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-200",children:N}),b&&e.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),w&&e.jsx("button",{onClick:w,className:"text-gray-400 hover:text-white",title:"Close",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),e.jsx("div",{className:"flex-1 w-full min-h-0",children:e.jsx(ue,{selectedProject:t,selectedSession:r,initialCommand:o,isPlainShell:T,onProcessComplete:B,minimal:c,autoConnect:c?!0:y})})]}):e.jsx("div",{className:`h-full flex items-center justify-center ${d}`,children:e.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 002 2z"})})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No Project Selected"}),e.jsx("p",{children:"A project is required to open a shell"})]})})}function Ge({isOpen:t,onClose:r,provider:o="claude",project:g,onComplete:y,customCommand:n,isAuthenticated:w=!1,isOnboarding:N=!1}){if(!t)return null;const d=()=>{if(n)return n;switch(o){case"claude":return w?"claude setup-token --dangerously-skip-permissions":N?"claude /exit --dangerously-skip-permissions":"claude /login --dangerously-skip-permissions";case"cursor":return"cursor-agent login";case"codex":return"codex login";default:return w?"claude setup-token --dangerously-skip-permissions":N?"claude /exit --dangerously-skip-permissions":"claude /login --dangerously-skip-permissions"}},j=()=>{switch(o){case"claude":return"Claude CLI Login";case"cursor":return"Cursor CLI Login";case"codex":return"Codex CLI Login";default:return"CLI Login"}},u=c=>{y&&y(c)};return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[9999] max-md:items-stretch max-md:justify-stretch",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-4xl h-3/4 flex flex-col md:max-w-4xl md:h-3/4 md:rounded-lg md:m-4 max-md:max-w-none max-md:h-full max-md:rounded-none max-md:m-0",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:j()}),e.jsx("button",{onClick:r,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors","aria-label":"Close login modal",children:e.jsx(Le,{className:"w-6 h-6"})})]}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(Be,{project:g,command:d(),onComplete:u,minimal:!0})})]})})}export{Je as C,Ge as L,ue as S,Ke as a,qe as b,Be as c,Oe as r,Ue as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,j as e,v as W}from"./vendor-react-9mUTKBHH.js";import{L as Z,C as _,a as D,b as H}from"./LoginModal-CZDEzqjK.js";import{u as K,a as m}from"./index-ce18TYkg.js";import{R as P,G,L as Q,C as x,a as X,b as R,c as ee,U as te,M as se,T as re,d as ae,Z as ne}from"./vendor-icons-Lb69KSFJ.js";import"./vendor-xterm-CZq1hqo1.js";import"./vendor-syntax-DnmwQQJF.js";import"./vendor-markdown-BXEi_H3G.js";import"./vendor-i18n-DCFGyhQR.js";const ge=({onComplete:y})=>{const[r,g]=a.useState(0),[h,C]=a.useState(""),[u,k]=a.useState(""),[i,f]=a.useState(!1),[S,o]=a.useState(""),[n,b]=a.useState(null),[q]=a.useState({name:"default",fullPath:""}),[l,j]=a.useState({authenticated:!1,email:null,loading:!0,error:null}),[d,N]=a.useState({authenticated:!1,email:null,loading:!0,error:null}),[c,v]=a.useState({authenticated:!1,email:null,loading:!0,error:null}),{user:p}=K(),A=a.useRef(void 0);a.useEffect(()=>{$()},[]);const $=async()=>{try{const t=await m("/api/user/git-config");if(t.ok){const s=await t.json();s.gitName&&C(s.gitName),s.gitEmail&&k(s.gitEmail)}}catch(t){console.error("Error loading git config:",t)}};a.useEffect(()=>{const t=A.current;A.current=n,(t===void 0||t!==null&&n===null)&&(L(),E(),F())},[n]);const L=async()=>{try{const t=await m("/api/cli/claude/status");if(t.ok){const s=await t.json();j({authenticated:s.authenticated,email:s.email,loading:!1,error:s.error||null})}else j({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(t){console.error("Error checking Claude auth status:",t),j({authenticated:!1,email:null,loading:!1,error:t.message})}},E=async()=>{try{const t=await m("/api/cli/cursor/status");if(t.ok){const s=await t.json();N({authenticated:s.authenticated,email:s.email,loading:!1,error:s.error||null})}else N({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(t){console.error("Error checking Cursor auth status:",t),N({authenticated:!1,email:null,loading:!1,error:t.message})}},F=async()=>{try{const t=await m("/api/cli/codex/status");if(t.ok){const s=await t.json();v({authenticated:s.authenticated,email:s.email,loading:!1,error:s.error||null})}else v({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(t){console.error("Error checking Codex auth status:",t),v({authenticated:!1,email:null,loading:!1,error:t.message})}},M=()=>b("claude"),T=()=>b("cursor"),O=()=>b("codex"),U=t=>{t===0&&(n==="claude"?L():n==="cursor"?E():n==="codex"&&F())},B=async()=>{if(o(""),r===0){g(1);return}if(r===1){if(!h.trim()||!u.trim()){o("Both git name and email are required");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u)){o("Please enter a valid email address");return}f(!0);try{const s=await m("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:h,gitEmail:u})});if(!s.ok){const I=await s.json();throw new Error(I.error||"Failed to save git configuration")}g(2)}catch(s){o(s.message)}finally{f(!1)}return}g(r+1)},Y=()=>{o(""),g(r-1)},z=async()=>{f(!0),o("");try{const t=await m("/api/user/complete-onboarding",{method:"POST"});if(!t.ok){const s=await t.json();throw new Error(s.error||"Failed to complete onboarding")}y&&y()}catch(t){o(t.message)}finally{f(!1)}},w=[{title:"Welcome",description:"Get to know Upfyn-Code",icon:P,required:!1},{title:"Git Configuration",description:"Set up your git identity for commits",icon:G,required:!0},{title:"Connect Agents",description:"Connect your AI coding assistants",icon:Q,required:!1}],J=()=>{switch(r){case 0:return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-2xl flex items-center justify-center mx-auto mb-5 shadow-lg shadow-blue-500/20",children:e.jsx(P,{className:"w-10 h-10 text-white"})}),e.jsxs("h2",{className:"text-2xl font-bold text-foreground mb-2",children:["Welcome to Upfyn-Code",p!=null&&p.first_name?`, ${p.first_name}`:"","!"]}),e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Your visual AI coding interface. Let's get you set up in under a minute."})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"border border-border rounded-lg p-4 text-center bg-card",children:[e.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center mx-auto mb-2",children:e.jsx(re,{className:"w-5 h-5 text-blue-500"})}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:"AI Agents"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Claude, Cursor, Codex — all in one place"})]}),e.jsxs("div",{className:"border border-border rounded-lg p-4 text-center bg-card",children:[e.jsx("div",{className:"w-10 h-10 bg-indigo-100 dark:bg-indigo-900/30 rounded-lg flex items-center justify-center mx-auto mb-2",children:e.jsx(ae,{className:"w-5 h-5 text-indigo-500"})}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Canvas"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Visual workspace with code, diagrams & notes"})]}),e.jsxs("div",{className:"border border-border rounded-lg p-4 text-center bg-card",children:[e.jsx("div",{className:"w-10 h-10 bg-yellow-100 dark:bg-yellow-900/30 rounded-lg flex items-center justify-center mx-auto mb-2",children:e.jsx(ne,{className:"w-5 h-5 text-yellow-500"})}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Relay"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Bridge your local machine to the web UI"})]})]}),e.jsx("div",{className:"text-center pt-2",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"Two quick steps ahead: git identity + optional agent connections"})})]});case 1:return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(G,{className:"w-8 h-8 text-blue-600 dark:text-blue-400"})}),e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Git Configuration"}),e.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for your commits"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"gitName",className:"flex items-center gap-2 text-sm font-medium text-foreground mb-2",children:[e.jsx(te,{className:"w-4 h-4"}),"Git Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"gitName",value:h,onChange:t=>C(t.target.value),className:"w-full px-4 py-3 border border-border rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"John Doe",required:!0,disabled:i}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"This will be used as: git config --global user.name"})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"gitEmail",className:"flex items-center gap-2 text-sm font-medium text-foreground mb-2",children:[e.jsx(se,{className:"w-4 h-4"}),"Git Email ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"email",id:"gitEmail",value:u,onChange:t=>k(t.target.value),className:"w-full px-4 py-3 border border-border rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"john@example.com",required:!0,disabled:i}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"This will be used as: git config --global user.email"})]})]})]});case 2:return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Connect Your AI Agents"}),e.jsx("p",{className:"text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:`border rounded-lg p-4 transition-colors ${l.authenticated?"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800":"border-border bg-card"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center",children:e.jsx(_,{size:20})}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["Claude Code",l.authenticated&&e.jsx(x,{className:"w-4 h-4 text-green-500"})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:l.loading?"Checking...":l.authenticated?l.email||"Connected":"Not connected"})]})]}),!l.authenticated&&!l.loading&&e.jsx("button",{onClick:M,className:"bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})}),e.jsx("div",{className:`border rounded-lg p-4 transition-colors ${d.authenticated?"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800":"border-border bg-card"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-purple-100 dark:bg-purple-900/30 rounded-full flex items-center justify-center",children:e.jsx(D,{size:20})}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["Cursor",d.authenticated&&e.jsx(x,{className:"w-4 h-4 text-green-500"})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:d.loading?"Checking...":d.authenticated?d.email||"Connected":"Not connected"})]})]}),!d.authenticated&&!d.loading&&e.jsx("button",{onClick:T,className:"bg-purple-600 hover:bg-purple-700 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})}),e.jsx("div",{className:`border rounded-lg p-4 transition-colors ${c.authenticated?"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600":"border-border bg-card"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:e.jsx(H,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["OpenAI Codex",c.authenticated&&e.jsx(x,{className:"w-4 h-4 text-green-500"})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:c.loading?"Checking...":c.authenticated?c.email||"Connected":"Not connected"})]})]}),!c.authenticated&&!c.loading&&e.jsx("button",{onClick:O,className:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})})]}),e.jsx("div",{className:"text-center text-sm text-muted-foreground pt-2",children:e.jsx("p",{children:"You can configure these later in Settings."})})]});default:return null}},V=()=>{switch(r){case 0:return!0;case 1:return h.trim()&&u.trim()&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u);case 2:return!0;default:return!1}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-2xl",children:[e.jsx("div",{className:"mb-8",children:e.jsx("div",{className:"flex items-center justify-between",children:w.map((t,s)=>e.jsxs(W.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center flex-1",children:[e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center border-2 transition-colors duration-200 ${s<r?"bg-green-500 border-green-500 text-white":s===r?"bg-blue-600 border-blue-600 text-white":"bg-background border-border text-muted-foreground"}`,children:s<r?e.jsx(x,{className:"w-6 h-6"}):typeof t.icon=="function"?e.jsx(t.icon,{}):e.jsx(t.icon,{className:"w-6 h-6"})}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("p",{className:`text-sm font-medium ${s===r?"text-foreground":"text-muted-foreground"}`,children:t.title}),t.required&&e.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),s<w.length-1&&e.jsx("div",{className:`flex-1 h-0.5 mx-2 transition-colors duration-200 ${s<r?"bg-green-500":"bg-border"}`})]},s))})}),e.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8",children:[J(),S&&e.jsx("div",{className:"mt-6 p-4 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-lg",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:S})}),e.jsxs("div",{className:"flex items-center justify-between mt-8 pt-6 border-t border-border",children:[e.jsxs("button",{onClick:Y,disabled:r===0||i,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:[e.jsx(X,{className:"w-4 h-4"}),"Previous"]}),e.jsx("div",{className:"flex items-center gap-3",children:r<w.length-1?e.jsx("button",{onClick:B,disabled:!V()||i,className:"flex items-center gap-2 px-6 py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:cursor-not-allowed text-white font-medium rounded-lg transition-colors duration-200",children:i?e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:["Next",e.jsx(ee,{className:"w-4 h-4"})]})}):e.jsx("button",{onClick:z,disabled:i,className:"flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:cursor-not-allowed text-white font-medium rounded-lg transition-colors duration-200",children:i?e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"w-4 h-4 animate-spin"}),"Completing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(x,{className:"w-4 h-4"}),"Complete Setup"]})})})]})]})]})}),n&&e.jsx(Z,{isOpen:!!n,onClose:()=>b(null),provider:n,project:q,onComplete:U,isOnboarding:!0})]})};export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as e}from"./vendor-react-9mUTKBHH.js";import{u as y}from"./index-
|
|
1
|
+
import{r as t,j as e}from"./vendor-react-9mUTKBHH.js";import{u as y}from"./index-ce18TYkg.js";import"./vendor-syntax-DnmwQQJF.js";import"./vendor-markdown-BXEi_H3G.js";import"./vendor-icons-Lb69KSFJ.js";import"./vendor-i18n-DCFGyhQR.js";const q=()=>{const[a,f]=t.useState(""),[d,p]=t.useState(""),[l,x]=t.useState(""),[n,g]=t.useState(""),[u,h]=t.useState(""),[s,i]=t.useState(!1),[c,o]=t.useState(""),{register:j}=y(),N=async r=>{if(r.preventDefault(),o(""),n!==u){o("Passwords do not match");return}if(!a.trim()||a.trim().length<2){o("Name must be at least 2 characters");return}if(!d.trim()||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d)){o("Please enter a valid email address");return}if(n.length<6){o("Password must be at least 6 characters");return}i(!0);const m=a.trim().split(" "),w=m[0]||a.trim(),v=m.slice(1).join(" ")||"",b=await j(w,v,n,d.trim(),l.trim()||null);b.success||o(b.error),i(!1)};return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("img",{src:"/logo.svg",alt:"Upfyn-Code",className:"w-16 h-16",onError:r=>{r.target.style.display="none"}})}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Create Your Account"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"Sign up to start using Upfyn-Code"})]}),e.jsxs("form",{onSubmit:N,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground mb-1",children:"Full Name"}),e.jsx("input",{type:"text",id:"name",value:a,onChange:r=>f(r.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Your full name",required:!0,disabled:s})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-foreground mb-1",children:"Email"}),e.jsx("input",{type:"email",id:"email",value:d,onChange:r=>p(r.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"you@example.com",required:!0,disabled:s})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium text-foreground mb-1",children:"Mobile Number"}),e.jsx("input",{type:"tel",id:"phone",value:l,onChange:r=>x(r.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"+91 9876543210",disabled:s})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),e.jsx("input",{type:"password",id:"password",value:n,onChange:r=>g(r.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"At least 6 characters",required:!0,disabled:s})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-foreground mb-1",children:"Confirm Password"}),e.jsx("input",{type:"password",id:"confirmPassword",value:u,onChange:r=>h(r.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Confirm your password",required:!0,disabled:s})]}),c&&e.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:c})}),e.jsx("button",{type:"submit",disabled:s,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:s?"Creating account...":"Create Account"})]})]})})})};export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as e,v as ee}from"./vendor-react-9mUTKBHH.js";import{a as C}from"./index-ce18TYkg.js";import{P as A,Z as M,h as te,b as Z,i as V,H as K,j as X,k as G,l as z,m as J,n as B,g as se,G as re,o as oe,S as ae,p as ne,q as le,r as Y,X as de,C as ce,s as ie}from"./vendor-icons-Lb69KSFJ.js";import"./vendor-syntax-DnmwQQJF.js";import"./vendor-markdown-BXEi_H3G.js";import"./vendor-i18n-DCFGyhQR.js";function ue({onEdit:a,onCreate:E,refreshKey:y}){const[f,T]=s.useState([]),[k,j]=s.useState(!0),[x,b]=s.useState(null),[m,N]=s.useState(null),[d,S]=s.useState(null),[p,L]=s.useState([]),[D,W]=s.useState(!1),w=s.useCallback(async()=>{try{const o=await C("/api/workflows");if(o.ok){const r=await o.json();T(r.workflows||[])}}catch{}j(!1)},[]);s.useEffect(()=>{w()},[w,y]);const P=async o=>{if(d===o){S(null);return}S(o),W(!0);try{const r=await C(`/api/workflows/${o}/runs`);if(r.ok){const g=await r.json();L(g.runs||[])}}catch{L([])}W(!1)},$=async o=>{try{await C(`/api/workflows/${o}`,{method:"DELETE"}),w()}catch{}},v=async o=>{var r;b(o),N(null);try{const u=await(await C(`/api/workflows/${o}/run`,{method:"POST"})).json();N({id:o,success:u.success,message:u.success?`Completed ${((r=u.results)==null?void 0:r.length)||0} steps`:u.error||"Failed",results:u.results}),w()}catch{N({id:o,success:!1,message:"Network error"})}b(null)};return k?e.jsx("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:"Loading workflows..."}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Workflows"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Natural language automation with webhook integrations"})]}),e.jsxs("button",{onClick:E,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:[e.jsx(A,{className:"w-3.5 h-3.5"}),"New Workflow"]})]}),f.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"w-14 h-14 mx-auto mb-4 bg-muted/50 rounded-full flex items-center justify-center",children:e.jsx(M,{className:"w-7 h-7 text-muted-foreground/40"})}),e.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"No workflows yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/60 max-w-xs mx-auto",children:"Create a workflow to automate tasks. Chain AI prompts, webhook calls, and conditions together."}),e.jsxs("button",{onClick:E,className:"mt-4 flex items-center gap-1.5 px-4 py-2 text-xs font-medium bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors mx-auto",children:[e.jsx(A,{className:"w-3.5 h-3.5"}),"Create Your First Workflow"]})]}):e.jsx("div",{className:"space-y-2",children:f.map(o=>e.jsxs("div",{className:"bg-muted/20 border border-border/30 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:o.name}),o.description&&e.jsx("p",{className:"text-xs text-muted-foreground/70 mt-0.5",children:o.description}),e.jsxs("div",{className:"flex items-center gap-1 mt-2 flex-wrap",children:[o.steps.map((r,g)=>e.jsxs(ee.Fragment,{children:[e.jsx("span",{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded ${r.type==="ai-prompt"?"bg-blue-500/10 text-blue-400":r.type==="webhook"?"bg-yellow-500/10 text-yellow-400":r.type==="delay"?"bg-purple-500/10 text-purple-400":"bg-green-500/10 text-green-400"}`,children:r.label}),g<o.steps.length-1&&e.jsx("span",{className:"text-[10px] text-muted-foreground/30",children:"→"})]},r.id||g)),o.steps.length===0&&e.jsx("span",{className:"text-[10px] text-muted-foreground/40",children:"No steps"})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-2 text-[10px] text-muted-foreground/40 flex-wrap",children:[e.jsxs("span",{children:[o.steps.length," step",o.steps.length!==1?"s":""]}),o.schedule&&o.schedule_enabled?e.jsxs("span",{className:"flex items-center gap-1 text-primary/70",children:[e.jsx(te,{className:"w-2.5 h-2.5"}),o.schedule]}):null,o.last_run&&e.jsxs("span",{children:["Last run: ",new Date(o.last_run).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsxs("button",{onClick:()=>v(o.id),disabled:x===o.id||o.steps.length===0,className:"flex items-center gap-1 px-2.5 py-1.5 text-xs font-medium bg-green-500/10 text-green-400 hover:bg-green-500/20 rounded-lg transition-colors disabled:opacity-40",title:"Run workflow",children:[x===o.id?e.jsx(Z,{className:"w-3 h-3 animate-spin"}):e.jsx(V,{className:"w-3 h-3"}),"Run"]}),e.jsx("button",{onClick:()=>P(o.id),className:`p-1.5 transition-colors ${d===o.id?"text-primary":"text-muted-foreground hover:text-foreground"}`,title:"Execution history",children:e.jsx(K,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>a(o),className:"p-1.5 text-muted-foreground hover:text-foreground transition-colors",title:"Edit",children:e.jsx(X,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>$(o.id),className:"p-1.5 text-muted-foreground hover:text-red-400 transition-colors",title:"Delete",children:e.jsx(G,{className:"w-3.5 h-3.5"})})]})]}),(m==null?void 0:m.id)===o.id&&e.jsxs("div",{className:`mt-3 p-2.5 rounded-lg text-xs ${m.success?"bg-green-500/5 border border-green-500/20":"bg-red-500/5 border border-red-500/20"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[m.success?e.jsx(z,{className:"w-3.5 h-3.5 text-green-400"}):e.jsx(J,{className:"w-3.5 h-3.5 text-red-400"}),e.jsx("span",{className:m.success?"text-green-400":"text-red-400",children:m.message})]}),m.results&&e.jsx("div",{className:"space-y-1 mt-2",children:m.results.map((r,g)=>{var u;return e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[r.success?e.jsx(z,{className:"w-2.5 h-2.5 text-green-400/60"}):e.jsx(J,{className:"w-2.5 h-2.5 text-red-400/60"}),e.jsx("span",{className:"text-muted-foreground",children:r.label}),((u=r.result)==null?void 0:u.status)&&e.jsxs("span",{className:"text-muted-foreground/40",children:["(",r.result.status,")"]}),r.error&&e.jsx("span",{className:"text-red-400/60",children:r.error})]},g)})})]}),d===o.id&&e.jsxs("div",{className:"mt-3 border-t border-border/20 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(K,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-[11px] font-medium text-foreground",children:"Execution History"})]}),D?e.jsx("div",{className:"text-[10px] text-muted-foreground/50 py-2",children:"Loading..."}):p.length===0?e.jsx("div",{className:"text-[10px] text-muted-foreground/40 py-2",children:"No runs yet"}):e.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:p.map(r=>e.jsxs("div",{className:"flex items-start gap-2 text-[10px] bg-muted/10 rounded-lg p-2",children:[e.jsx("div",{className:"shrink-0 mt-0.5",children:r.status==="completed"?e.jsx(z,{className:"w-3 h-3 text-green-400"}):r.status==="failed"?e.jsx(J,{className:"w-3 h-3 text-red-400"}):r.status==="running"?e.jsx(Z,{className:"w-3 h-3 text-yellow-400 animate-spin"}):e.jsx(B,{className:"w-3 h-3 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`font-medium ${r.status==="completed"?"text-green-400":r.status==="failed"?"text-red-400":"text-muted-foreground"}`,children:r.status==="completed"?"Success":r.status==="failed"?"Failed":r.status}),e.jsxs("span",{className:"text-muted-foreground/30",children:[r.steps_completed,"/",r.total_steps," steps"]}),e.jsx("span",{className:"text-muted-foreground/30",children:new Date(r.started_at).toLocaleString()})]}),r.error&&e.jsx("p",{className:"text-red-400/70 mt-0.5 truncate",children:r.error}),r.completed_at&&e.jsxs("span",{className:"text-muted-foreground/20",children:["Duration: ",Math.round((new Date(r.completed_at).getTime()-new Date(r.started_at).getTime())/1e3),"s"]})]})]},r.id))})]})]},o.id))})]})}const q=[{value:"ai-prompt",label:"AI Prompt",icon:se,color:"text-blue-400 bg-blue-500/10"},{value:"webhook",label:"Webhook",icon:M,color:"text-yellow-400 bg-yellow-500/10"},{value:"delay",label:"Delay",icon:B,color:"text-purple-400 bg-purple-500/10"},{value:"condition",label:"Condition",icon:re,color:"text-green-400 bg-green-500/10"}];let xe=0;const me=()=>`step_${Date.now()}_${++xe}`,he=[{label:"Every minute",cron:"* * * * *"},{label:"Every 5 minutes",cron:"*/5 * * * *"},{label:"Every 15 minutes",cron:"*/15 * * * *"},{label:"Every hour",cron:"0 * * * *"},{label:"Every 6 hours",cron:"0 */6 * * *"},{label:"Daily at midnight",cron:"0 0 * * *"},{label:"Daily at 9 AM",cron:"0 9 * * *"},{label:"Weekly (Monday)",cron:"0 9 * * 1"},{label:"Monthly (1st)",cron:"0 0 1 * *"}];function pe({workflow:a,onSave:E,onCancel:y}){const[f,T]=s.useState((a==null?void 0:a.name)||""),[k,j]=s.useState((a==null?void 0:a.description)||""),[x,b]=s.useState((a==null?void 0:a.steps)||[]),[m,N]=s.useState((a==null?void 0:a.schedule)||""),[d,S]=s.useState(!!(a!=null&&a.schedule_enabled)),[p,L]=s.useState((a==null?void 0:a.schedule_timezone)||Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"),[D,W]=s.useState([]),[w,P]=s.useState(!1),[$,v]=s.useState(""),[o,r]=s.useState(null),[g,u]=s.useState(!1);s.useEffect(()=>{C("/api/webhooks").then(t=>t.json()).then(t=>{W(t.webhooks||[])}).catch(()=>{})},[]);const F=s.useCallback(t=>{const i=q.find(c=>c.value===t),n={id:me(),type:t,label:(i==null?void 0:i.label)||t,config:t==="delay"?{seconds:5}:{},order:x.length};b(c=>[...c,n]),r(n.id),u(!1)},[x.length]),_=s.useCallback(t=>{b(i=>i.filter(n=>n.id!==t).map((n,c)=>({...n,order:c}))),o===t&&r(null)},[o]),O=s.useCallback((t,i)=>{b(n=>{const c=n.findIndex(H=>H.id===t);if(c<0)return n;const h=i==="up"?c-1:c+1;if(h<0||h>=n.length)return n;const l=[...n];return[l[c],l[h]]=[l[h],l[c]],l.map((H,Q)=>({...H,order:Q}))})},[]),I=s.useCallback((t,i,n)=>{b(c=>c.map(h=>h.id===t?{...h,config:{...h.config,[i]:n}}:h))},[]),R=s.useCallback((t,i)=>{b(n=>n.map(c=>c.id===t?{...c,label:i}:c))},[]),U=async()=>{if(v(""),!f.trim()){v("Workflow name is required");return}if(x.length===0){v("Add at least one step");return}P(!0);try{const t={name:f,description:k,steps:x,schedule:m||null,schedule_enabled:d,schedule_timezone:p},i=a!=null&&a.id?`/api/workflows/${a.id}`:"/api/workflows",n=a!=null&&a.id?"PUT":"POST",c=await C(i,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!c.ok){const h=await c.json();v(h.error||"Failed to save"),P(!1);return}E()}catch{v("Network error")}P(!1)};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/30",children:[e.jsx("button",{onClick:y,className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(oe,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm font-semibold text-foreground",children:a!=null&&a.id?"Edit Workflow":"New Workflow"}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{onClick:U,disabled:w,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors disabled:opacity-50",children:[e.jsx(ae,{className:"w-3.5 h-3.5"}),w?"Saving...":"Save"]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Workflow Name"}),e.jsx("input",{value:f,onChange:t=>T(t.target.value),placeholder:"My Workflow",className:"w-full px-3 py-2 text-sm bg-background border border-border/50 rounded-lg text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Description"}),e.jsx("textarea",{value:k,onChange:t=>j(t.target.value),placeholder:"What does this workflow do?",rows:2,className:"w-full px-3 py-2 text-xs bg-background border border-border/50 rounded-lg text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50 resize-none"})]})]}),e.jsxs("div",{className:"bg-muted/20 border border-border/30 rounded-xl p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-semibold text-foreground flex items-center gap-1.5",children:[e.jsx(B,{className:"w-3.5 h-3.5"}),"Schedule (Cron Job)"]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:d?"Enabled":"Disabled"}),e.jsx("div",{onClick:()=>S(!d),className:`relative w-8 h-4 rounded-full transition-colors cursor-pointer ${d?"bg-primary":"bg-muted"}`,children:e.jsx("div",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-white transition-transform ${d?"translate-x-4":"translate-x-0.5"}`})})]})]}),d&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Cron Expression"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{value:m,onChange:t=>N(t.target.value),placeholder:"*/15 * * * *",className:"flex-1 px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50 font-mono"}),e.jsxs("select",{value:m,onChange:t=>N(t.target.value),className:"px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground focus:outline-none focus:border-primary/50",children:[e.jsx("option",{value:"",children:"Presets..."}),he.map(t=>e.jsx("option",{value:t.cron,children:t.label},t.cron))]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Timezone"}),e.jsx("input",{value:p,onChange:t=>L(t.target.value),placeholder:"UTC",className:"w-48 px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground/50",children:'Runs automatically when the server is online. Missed runs while offline appear as "missed" in execution history.'})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("span",{className:"text-xs font-semibold text-foreground",children:["Steps (",x.length,")"]})}),x.length===0?e.jsx("div",{className:"text-center py-8 border border-dashed border-border/40 rounded-xl",children:e.jsx("p",{className:"text-xs text-muted-foreground/60",children:"No steps yet. Add your first step below."})}):e.jsx("div",{className:"space-y-2",children:x.map((t,i)=>{const n=q.find(l=>l.value===t.type),c=(n==null?void 0:n.icon)||M,h=o===t.id;return e.jsxs("div",{className:"bg-muted/20 border border-border/30 rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-muted/30 transition-colors",onClick:()=>r(h?null:t.id),children:[e.jsx("span",{className:"text-xs text-muted-foreground/50 w-5 text-center font-mono",children:i+1}),e.jsx("div",{className:`p-1 rounded ${(n==null?void 0:n.color)||"bg-muted text-muted-foreground"}`,children:e.jsx(c,{className:"w-3 h-3"})}),e.jsx("span",{className:"text-xs font-medium text-foreground flex-1 min-w-0 truncate",children:t.label}),e.jsx("span",{className:"text-[10px] text-muted-foreground/50",children:n==null?void 0:n.label}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:l=>{l.stopPropagation(),O(t.id,"up")},disabled:i===0,className:"p-0.5 text-muted-foreground/40 hover:text-foreground disabled:opacity-20",children:e.jsx(ne,{className:"w-3 h-3"})}),e.jsx("button",{onClick:l=>{l.stopPropagation(),O(t.id,"down")},disabled:i===x.length-1,className:"p-0.5 text-muted-foreground/40 hover:text-foreground disabled:opacity-20",children:e.jsx(le,{className:"w-3 h-3"})}),e.jsx("button",{onClick:l=>{l.stopPropagation(),_(t.id)},className:"p-0.5 text-muted-foreground/40 hover:text-red-400",children:e.jsx(G,{className:"w-3 h-3"})})]})]}),h&&e.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-border/20 space-y-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Step Label"}),e.jsx("input",{value:t.label,onChange:l=>R(t.id,l.target.value),className:"w-full px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground focus:outline-none focus:border-primary/50"})]}),t.type==="ai-prompt"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Prompt"}),e.jsx("textarea",{value:t.config.prompt||"",onChange:l=>I(t.id,"prompt",l.target.value),placeholder:"Describe what the AI should do...",rows:3,className:"w-full px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50 resize-none"})]}),t.type==="webhook"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Webhook"}),e.jsxs("select",{value:t.config.webhookId||"",onChange:l=>I(t.id,"webhookId",l.target.value),className:"w-full px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground focus:outline-none focus:border-primary/50",children:[e.jsx("option",{value:"",children:"Select a webhook..."}),D.map(l=>e.jsxs("option",{value:l.id,children:[l.name," (",l.method," ",l.url,")"]},l.id))]}),D.length===0&&e.jsx("p",{className:"text-[10px] text-muted-foreground/50 mt-1",children:"No webhooks created yet. Go to the Webhooks tab to create one."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Payload Template (JSON, optional)"}),e.jsx("textarea",{value:t.config.payloadTemplate||"",onChange:l=>I(t.id,"payloadTemplate",l.target.value),placeholder:'{"key": "value"}',rows:2,className:"w-full px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50 resize-none font-mono"})]})]}),t.type==="delay"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Delay (seconds, max 30)"}),e.jsx("input",{type:"number",min:1,max:30,value:t.config.seconds||5,onChange:l=>I(t.id,"seconds",Math.min(30,Math.max(1,parseInt(l.target.value)||1))),className:"w-24 px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground focus:outline-none focus:border-primary/50"})]}),t.type==="condition"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Condition Expression"}),e.jsx("input",{value:t.config.expression||"",onChange:l=>I(t.id,"expression",l.target.value),placeholder:"e.g. response.status === 200",className:"w-full px-2 py-1 text-xs bg-background border border-border/50 rounded text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50 font-mono"}),e.jsx("p",{className:"text-[10px] text-muted-foreground/40 mt-0.5",children:"Condition evaluation coming soon"})]})]})]},t.id)})}),e.jsxs("div",{className:"relative mt-3",children:[e.jsxs("button",{onClick:()=>u(!g),className:"w-full flex items-center justify-center gap-1.5 py-2 text-xs text-muted-foreground hover:text-foreground border border-dashed border-border/40 hover:border-border/60 rounded-xl transition-colors",children:[e.jsx(A,{className:"w-3.5 h-3.5"}),"Add Step"]}),g&&e.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 bottom-full mb-1 z-10 bg-card border border-border/50 rounded-xl shadow-xl p-1.5 min-w-[180px]",children:q.map(t=>{const i=t.icon;return e.jsxs("button",{onClick:()=>F(t.value),className:"w-full text-left px-3 py-1.5 text-xs text-foreground hover:bg-muted/50 rounded-lg flex items-center gap-2",children:[e.jsx("div",{className:`p-1 rounded ${t.color}`,children:e.jsx(i,{className:"w-3 h-3"})}),t.label]},t.value)})})]})]}),$&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[e.jsx(Y,{className:"w-3.5 h-3.5"}),$]})]})]})}const be=["GET","POST","PUT","PATCH","DELETE"];function ge({onWebhooksChange:a}){const[E,y]=s.useState([]),[f,T]=s.useState(!0),[k,j]=s.useState(!1),[x,b]=s.useState(null),[m,N]=s.useState(null),[d,S]=s.useState(null),[p,L]=s.useState(""),[D,W]=s.useState(""),[w,P]=s.useState("POST"),[$,v]=s.useState("{}"),[o,r]=s.useState(""),[g,u]=s.useState(""),F=s.useCallback(async()=>{try{const t=await C("/api/webhooks");if(t.ok){const i=await t.json();y(i.webhooks||[])}}catch{}T(!1)},[]);s.useEffect(()=>{F()},[F]);const _=()=>{L(""),W(""),P("POST"),v("{}"),r(""),u(""),b(null),j(!1)},O=t=>{L(t.name),W(t.url),P(t.method),v(t.headers||"{}"),r(t.description||""),b(t.id),j(!0),u("")},I=async()=>{if(u(""),!p.trim()){u("Name is required");return}if(!D.trim()){u("URL is required");return}try{new URL(D)}catch{u("Invalid URL");return}try{JSON.parse($)}catch{u("Headers must be valid JSON");return}try{const t={name:p,url:D,method:w,headers:$,description:o},i=x?`/api/webhooks/${x}`:"/api/webhooks",c=await C(i,{method:x?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!c.ok){const h=await c.json();u(h.error||"Failed to save");return}_(),F(),a==null||a()}catch{u("Network error")}},R=async t=>{try{await C(`/api/webhooks/${t}`,{method:"DELETE"}),F(),a==null||a()}catch{}},U=async t=>{N(t),S(null);try{const n=await(await C(`/api/webhooks/${t}/test`,{method:"POST"})).json();S({id:t,result:n.result,success:n.success})}catch{S({id:t,result:{error:"Network error"},success:!1})}N(null)};return f?e.jsx("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:"Loading webhooks..."}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Webhooks"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Endpoints that workflows can call during execution"})]}),!k&&e.jsxs("button",{onClick:()=>{_(),j(!0)},className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:[e.jsx(A,{className:"w-3.5 h-3.5"}),"Add Webhook"]})]}),k&&e.jsxs("div",{className:"bg-muted/30 border border-border/50 rounded-xl p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-foreground",children:x?"Edit Webhook":"New Webhook"}),e.jsx("button",{onClick:_,className:"text-muted-foreground hover:text-foreground",children:e.jsx(de,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Name"}),e.jsx("input",{value:p,onChange:t=>L(t.target.value),placeholder:"My Webhook",className:"w-full px-3 py-1.5 text-xs bg-background border border-border/50 rounded-lg text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Method"}),e.jsx("select",{value:w,onChange:t=>P(t.target.value),className:"w-full px-3 py-1.5 text-xs bg-background border border-border/50 rounded-lg text-foreground focus:outline-none focus:border-primary/50",children:be.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"URL"}),e.jsx("input",{value:D,onChange:t=>W(t.target.value),placeholder:"https://example.com/webhook",className:"w-full px-3 py-1.5 text-xs bg-background border border-border/50 rounded-lg text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Headers (JSON)"}),e.jsx("textarea",{value:$,onChange:t=>v(t.target.value),placeholder:'{"Authorization": "Bearer ..."}',rows:2,className:"w-full px-3 py-1.5 text-xs bg-background border border-border/50 rounded-lg text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50 font-mono resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Description"}),e.jsx("input",{value:o,onChange:t=>r(t.target.value),placeholder:"Optional description...",className:"w-full px-3 py-1.5 text-xs bg-background border border-border/50 rounded-lg text-foreground placeholder-muted-foreground/50 focus:outline-none focus:border-primary/50"})]}),g&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[e.jsx(Y,{className:"w-3.5 h-3.5"}),g]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:_,className:"px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"}),e.jsxs("button",{onClick:I,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:[e.jsx(ce,{className:"w-3.5 h-3.5"}),x?"Update":"Create"]})]})]}),E.length===0&&!k?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-muted/50 rounded-full flex items-center justify-center",children:e.jsx(M,{className:"w-6 h-6 text-muted-foreground/50"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No webhooks yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Create a webhook to use in your workflows"})]}):e.jsx("div",{className:"space-y-2",children:E.map(t=>e.jsxs("div",{className:"bg-muted/20 border border-border/30 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-semibold text-foreground",children:t.name}),e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-mono ${t.method==="GET"?"bg-green-500/10 text-green-400":t.method==="POST"?"bg-blue-500/10 text-blue-400":t.method==="PUT"?"bg-yellow-500/10 text-yellow-400":t.method==="DELETE"?"bg-red-500/10 text-red-400":"bg-muted text-muted-foreground"}`,children:t.method})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground font-mono mt-0.5 truncate",children:t.url}),t.description&&e.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:t.description}),t.last_triggered&&e.jsxs("p",{className:"text-[10px] text-muted-foreground/40 mt-1",children:["Last triggered: ",new Date(t.last_triggered).toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{onClick:()=>U(t.id),disabled:m===t.id,className:"p-1.5 text-muted-foreground hover:text-green-400 transition-colors disabled:opacity-50",title:"Test webhook",children:m===t.id?e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"}):e.jsx(V,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>O(t),className:"p-1.5 text-muted-foreground hover:text-foreground transition-colors",title:"Edit",children:e.jsx(X,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>R(t.id),className:"p-1.5 text-muted-foreground hover:text-red-400 transition-colors",title:"Delete",children:e.jsx(G,{className:"w-3.5 h-3.5"})})]})]}),(d==null?void 0:d.id)===t.id&&e.jsx("div",{className:`mt-2 p-2 rounded-lg text-xs ${d.success?"bg-green-500/5 border border-green-500/20":"bg-red-500/5 border border-red-500/20"}`,children:d.result.error?e.jsx("span",{className:"text-red-400",children:d.result.error}):e.jsxs("div",{children:[e.jsxs("span",{className:d.result.status&&d.result.status<400?"text-green-400":"text-red-400",children:[d.result.status," ",d.result.statusText]}),d.result.body&&e.jsx("pre",{className:"mt-1 text-[10px] text-muted-foreground font-mono overflow-x-auto max-h-24 overflow-y-auto",children:typeof d.result.body=="string"?d.result.body:JSON.stringify(d.result.body,null,2)})]})})]},t.id))})]})}function Se({selectedProject:a}){const[E,y]=s.useState("list"),[f,T]=s.useState("workflows"),[k,j]=s.useState(null),[x,b]=s.useState(0),m=s.useCallback(p=>{j(p),y("editor")},[]),N=s.useCallback(()=>{j(null),y("editor")},[]),d=s.useCallback(()=>{y("list"),T("workflows"),j(null),b(p=>p+1)},[]),S=s.useCallback(()=>{y("list"),j(null)},[]);return E==="editor"?e.jsx("div",{className:"h-full",children:e.jsx(pe,{workflow:k,onSave:d,onCancel:S})}):e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx("div",{className:"flex-shrink-0 px-4 pt-3 pb-0",children:e.jsxs("div",{className:"inline-flex items-center bg-muted/40 rounded-lg p-[3px] gap-[2px]",children:[e.jsxs("button",{onClick:()=>T("workflows"),className:`flex items-center gap-1.5 px-3 py-[5px] text-xs font-medium rounded-md transition-all duration-150 ${f==="workflows"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(M,{className:"w-3 h-3"}),"Workflows"]}),e.jsxs("button",{onClick:()=>T("webhooks"),className:`flex items-center gap-1.5 px-3 py-[5px] text-xs font-medium rounded-md transition-all duration-150 ${f==="webhooks"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx(ie,{className:"w-3 h-3"}),"Webhooks"]})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:f==="workflows"?e.jsx(ue,{onEdit:m,onCreate:N,refreshKey:x}):e.jsx(ge,{onWebhooksChange:()=>b(p=>p+1)})})]})}export{Se as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./percentages-BXMCSKIN-
|
|
1
|
+
import"./percentages-BXMCSKIN-WVlHS4wx.js";import"./vendor-syntax-DnmwQQJF.js";import"./vendor-react-9mUTKBHH.js";import"./vendor-markdown-BXEi_H3G.js";import"./AppContent-C0CyP3g5.js";import"./index-ce18TYkg.js";import"./vendor-icons-Lb69KSFJ.js";import"./vendor-i18n-DCFGyhQR.js";import"./LoginModal-CZDEzqjK.js";import"./vendor-xterm-CZq1hqo1.js";import"./vendor-codemirror-D_s0aGBu.js";var u={paste:"لصق",pasteAsPlaintext:"اللصق كنص عادي",pasteCharts:"لصق الرسوم البيانية",selectAll:"تحديد الكل",multiSelect:"إضافة عنصر للتحديد",moveCanvas:"نقل لوح الرسم",cut:"قص",copy:"نسخ",copyAsPng:"نسخ إلى الحافظة بصيغة PNG",copyAsSvg:"نسخ إلى الحافظة بصيغة SVG",copyText:"نسخ إلى الحافظة كنص",copySource:"",convertToCode:"",bringForward:"جلب للأمام",sendToBack:"أرسل للخلف",bringToFront:"أحضر للأمام",sendBackward:"أرسل للخلف",delete:"حذف",copyStyles:"نسخ الأنماط",pasteStyles:"لصق الأنماط",stroke:"الخط",background:"الخلفية",fill:"التعبئة",strokeWidth:"سُمك الخط",strokeStyle:"نمط الخط",strokeStyle_solid:"متصل",strokeStyle_dashed:"متقطع",strokeStyle_dotted:"منقط",sloppiness:"الإمالة",opacity:"الشفافية",textAlign:"محاذاة النص",edges:"الحواف",sharp:"حادة",round:"دائرية",arrowheads:"رؤوس الأسهم",arrowhead_none:"لا شيء",arrowhead_arrow:"سهم",arrowhead_bar:"شريط",arrowhead_circle:"",arrowhead_circle_outline:"",arrowhead_triangle:"مثلث",arrowhead_triangle_outline:"",arrowhead_diamond:"",arrowhead_diamond_outline:"",fontSize:"حجم الخط",fontFamily:"نوع الخط",addWatermark:'إضافة "مصنوعة بواسطة Excalidraw"',handDrawn:"رسم باليد",normal:"عادي",code:"رمز",small:"صغير",medium:"متوسط",large:"كبير",veryLarge:"كبير جدا",solid:"كامل",hachure:"خطوط",zigzag:"متعرج",crossHatch:"خطوط متقطعة",thin:"نحيف",bold:"داكن",left:"الـيسار",center:"وسط",right:"يمين",extraBold:"عريض",architect:"معماري",artist:"رسام",cartoonist:"كرتوني",fileTitle:"إسم الملف",colorPicker:"منتقي اللون",canvasColors:"تستخدم على القماش",canvasBackground:"خلفية اللوحة",drawingCanvas:"لوحة الرسم",layers:"الطبقات",actions:"الإجراءات",language:"اللغة",liveCollaboration:"التعاون المباشر...",duplicateSelection:"تكرار",untitled:"غير معنون",name:"الاسم",yourName:"اسمك",madeWithExcalidraw:"مصنوعة بواسطة Excalidraw",group:"تحديد مجموعة",ungroup:"إلغاء تحديد مجموعة",collaborators:"المتعاونون",showGrid:"إظهار الشبكة",addToLibrary:"أضف إلى المكتبة",removeFromLibrary:"حذف من المكتبة",libraryLoadingMessage:"جارٍ تحميل المكتبة…",libraries:"تصفح المكتبات",loadingScene:"جاري تحميل المشهد…",align:"محاذاة",alignTop:"محاذاة إلى اﻷعلى",alignBottom:"محاذاة إلى اﻷسفل",alignLeft:"محاذاة إلى اليسار",alignRight:"محاذاة إلى اليمين",centerVertically:"توسيط عمودي",centerHorizontally:"توسيط أفقي",distributeHorizontally:"التوزيع الأفقي",distributeVertically:"التوزيع عمودياً",flipHorizontal:"قلب عامودي",flipVertical:"قلب أفقي",viewMode:"نمط العرض",share:"مشاركة",showStroke:"إظهار منتقي لون الخط",showBackground:"إظهار منتقي لون الخلفية",toggleTheme:"غير النمط",personalLib:"المكتبة الشخصية",excalidrawLib:"مكتبتنا",decreaseFontSize:"تصغير حجم الخط",increaseFontSize:"تكبير حجم الخط",unbindText:"فك ربط النص",bindText:"ربط النص بالحاوية",createContainerFromText:"نص مغلف في حاوية",link:{edit:"تعديل الرابط",editEmbed:"تحرير الرابط وإدراجه",create:"إنشاء رابط",createEmbed:"إنشاء رابط و إدراجه",label:"رابط",labelEmbed:"رابط و إدراج",empty:"لم يتم تعيين رابط"},lineEditor:{edit:"تحرير السطر",exit:"الخروج من المُحرر"},elementLock:{lock:"قفل",unlock:"فتح",lockAll:"قفل الكل",unlockAll:"فتح الكل"},statusPublished:"نُشر",sidebarLock:"إبقاء الشريط الجانبي مفتوح",selectAllElementsInFrame:"تحديد جميع العناصر في الإطار",removeAllElementsFromFrame:"إزالة جميع العناصر من الإطار",eyeDropper:"اختيار اللون من القماش",textToDiagram:"",prompt:""},A={noItems:"لا توجد عناصر أضيفت بعد...",hint_emptyLibrary:"حدد عنصر على القماش لإضافته هنا، أو تثبيت مكتبة من المستودع العام أدناه.",hint_emptyPrivateLibrary:"حدد عنصر على القماش لإضافته هنا."},e={clearReset:"إعادة تعيين اللوحة",exportJSON:"صدر الملف",exportImage:"تصدير الصورة...",export:"حفظ إلى...",copyToClipboard:"نسخ إلى الحافظة",save:"احفظ للملف الحالي",saveAs:"حفظ كـ",load:"فتح",getShareableLink:"احصل على رابط المشاركة",close:"غلق",selectLanguage:"اختر اللغة",scrollBackToContent:"الرجوع إلى المحتوى",zoomIn:"تكبير",zoomOut:"تصغير",resetZoom:"إعادة تعيين الشاشة",menu:"القائمة",done:"تم",edit:"تعديل",undo:"تراجع",redo:"إعادة تنفيذ",resetLibrary:"إعادة ضبط المكتبة",createNewRoom:"إنشاء غرفة جديدة",fullScreen:"شاشة كاملة",darkMode:"الوضع المظلم",lightMode:"الوضع المضيء",zenMode:"وضع التأمل",objectsSnapMode:"التقط إلى العناصر",exitZenMode:"إلغاء الوضع الليلى",cancel:"إلغاء",clear:"مسح",remove:"إزالة",embed:"تبديل الإدراج",publishLibrary:"انشر",submit:"أرسل",confirm:"تأكيد",embeddableInteractionButton:"اضغط للتفاعل"},r={clearReset:"هذا سيُزيل كامل اللوحة. هل أنت متأكد؟",couldNotCreateShareableLink:"تعذر إنشاء رابطة المشاركة.",couldNotCreateShareableLinkTooBig:"تعذر إنشاء رابط قابل للمشاركة: المشهد كبير جدًا",couldNotLoadInvalidFile:"تعذر التحميل، الملف غير صالح",importBackendFailed:"فشل الاستيراد من الخادوم.",cannotExportEmptyCanvas:"لا يمكن تصدير لوحة فارغة.",couldNotCopyToClipboard:"تعذر النسخ إلى الحافظة.",decryptFailed:"تعذر فك تشفير البيانات.",uploadedSecurly:"تم تأمين التحميل بتشفير النهاية إلى النهاية، مما يعني أن خادوم Excalidraw والأطراف الثالثة لا يمكنها قراءة المحتوى.",loadSceneOverridePrompt:"تحميل الرسم الخارجي سيحل محل المحتوى الموجود لديك. هل ترغب في المتابعة؟",collabStopOverridePrompt:`إيقاف الجلسة سيؤدي إلى الكتابة فوق رسومك السابقة المخزنة داخليا. هل أنت متأكد؟
|
|
2
2
|
|
|
3
3
|
(إذا كنت ترغب في الاحتفاظ برسمك المخزن داخليا، ببساطة أغلق علامة تبويب المتصفح بدلاً من ذلك.)`,errorAddingToLibrary:"تعذر إضافة العنصر للمكتبة",errorRemovingFromLibrary:"تعذر إزالة العنصر من المكتبة",confirmAddLibrary:"هذا سيضيف {{numShapes}} شكل إلى مكتبتك. هل أنت متأكد؟",imageDoesNotContainScene:"يبدو أن هذه الصورة لا تحتوي على أي بيانات مشهد. هل قمت بتمكين تضمين المشهد أثناء التصدير؟",cannotRestoreFromImage:"تعذر استعادة المشهد من ملف الصورة",invalidSceneUrl:"تعذر استيراد المشهد من عنوان URL المتوفر. إما أنها مشوهة، أو لا تحتوي على بيانات Excalidraw JSON صالحة.",resetLibrary:"هذا سوف يمسح مكتبتك. هل أنت متأكد؟",removeItemsFromsLibrary:"حذف {{count}} عنصر (عناصر) من المكتبة؟",invalidEncryptionKey:"مفتاح التشفير يجب أن يكون من 22 حرفاً. التعاون المباشر معطل.",collabOfflineWarning:`لا يوجد اتصال بالانترنت.
|
|
4
4
|
لن يتم حفظ التغييرات التي قمت بها!`},a={unsupportedFileType:"نوع الملف غير مدعوم.",imageInsertError:"تعذر إدراج الصورة. حاول مرة أخرى لاحقاً...",fileTooBig:"الملف كبير جداً. الحد الأقصى المسموح به للحجم هو {{maxSize}}.",svgImageInsertError:"تعذر إدراج صورة SVG. يبدو أن ترميز SVG غير صحيح.",failedToFetchImage:"",invalidSVGString:"SVG غير صالح.",cannotResolveCollabServer:"تعذر الاتصال بخادم التعاون. الرجاء إعادة تحميل الصفحة والمحاولة مرة أخرى.",importLibraryError:"تعذر تحميل المكتبة",collabSaveFailed:"تعذر الحفظ في قاعدة البيانات. إذا استمرت المشاكل، يفضل أن تحفظ ملفك محليا كي لا تفقد عملك.",collabSaveFailed_sizeExceeded:"تعذر الحفظ في قاعدة البيانات، يبدو أن القماش كبير للغاية، يفضّل حفظ الملف محليا كي لا تفقد عملك.",imageToolNotSupported:"",brave_measure_text_error:{line1:"يبدو أنك تستخدم متصفح Brave مع إعداد <bold>حظر صارم لتتبع البصمة</bold>.",line2:"قد يؤدي هذا إلى كسر <bold>عناصر النص</bold> في الرسومات الخاصة بك.",line3:"من المستحسن إلغاء تفعيل هذا الإعداد. يمكنك اتباع <link>هذه الخطوات</link> لفعل ذلك.",line4:"إذا لم يصلح تعطيل هذا الإعداد طريقة عرض النصوص، الرجاء كتابة <issueLink>بلاغ</issueLink> على حسابنا في GitHub، أو راسلنا على <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"لا يمكن إضافة العناصر القابلة للتضمين في المكتبة.",iframe:"",image:"سوف يتم دعم إضافة صور إلى المكتبة قريباً!"},asyncPasteFailedOnRead:"",asyncPasteFailedOnParse:"",copyToSystemClipboardFailed:""},o={selection:"تحديد",image:"إدراج صورة",rectangle:"مستطيل",diamond:"مضلع",ellipse:"دائرة",arrow:"سهم",line:"خط",freedraw:"رسم",text:"نص",library:"مكتبة",lock:"الحفاظ على أداة التحديد نشطة بعد الرسم",penMode:"وضع القلم - امنع اللمس",link:"إضافة/تحديث الرابط للشكل المحدد",eraser:"ممحاة",frame:"أداة الإطار",magicframe:"",embeddable:"تضمين ويب",laser:"مؤشر ليزر",hand:"يد (أداة الإزاحة)",extraTools:"المزيد من أﻷدوات",mermaidToExcalidraw:"",magicSettings:""},t={canvasActions:"إجراءات اللوحة",selectedShapeActions:"إجراءات الشكل المحدد",shapes:"الأشكال"},i={canvasPanning:"لتحريك القماش، اضغط على عجلة الفأرة أو مفتاح المسافة أثناء السحب، أو استخدم أداة اليد",linearElement:"انقر لبدء نقاط متعددة، اسحب لخط واحد",freeDraw:"انقر واسحب، افرج عند الانتهاء",text:"نصيحة: يمكنك أيضًا إضافة نص بالنقر المزدوج في أي مكان بأداة الاختيار",embeddable:"اضغط مع السحب لإنشاء موقع ويب مضمّن",text_selected:"انقر نقراً مزدوجاً أو اضغط ادخال لتعديل النص",text_editing:"اضغط على Esc أو (Ctrl أو Cmd) + Enter لإنهاء التعديل",linearElementMulti:"انقر فوق النقطة الأخيرة أو اضغط على Esc أو Enter للإنهاء",lockAngle:"يمكنك تقييد الزاوية بالضغط على SHIFT",resize:`يمكنك تقييد النسب بالضغط على SHIFT أثناء تغيير الحجم،
|
|
@@ -7,4 +7,4 @@ import"./percentages-BXMCSKIN-Be6p9phi.js";import"./vendor-syntax-DnmwQQJF.js";i
|
|
|
7
7
|
أو اضغط على ALT و انقر بالفأرة لإضافة نِقَاط جديدة`,placeImage:"انقر لوضع الصورة، أو انقر واسحب لتعيين حجمها يدوياً",publishLibrary:"نشر مكتبتك",bindTextToElement:"اضغط على إدخال لإضافة نص",deepBoxSelect:"اضغط على Ctrl\\Cmd للاختيار العميق، ولمنع السحب",eraserRevert:"اضغط على Alt لاستعادة العناصر المعلَّمة للحذف",firefox_clipboard_write:'يمكن على الأرجح تمكين هذه الميزة عن طريق تعيين علم "dom.events.asyncClipboard.clipboardItem" إلى "true". لتغيير أعلام المتصفح في Firefox، قم بزيارة صفحة "about:config".',disableSnapping:"اضغط على Ctrl أو Cmd لتعطيل الالتقاط"},l={cannotShowPreview:"تعذر عرض المعاينة",canvasTooBig:"قد تكون اللوحة كبيرة جداً.",canvasTooBigTip:"نصيحة: حاول تحريك العناصر البعيدة بشكل أقرب قليلاً."},F={headingMain:"حدث خطأ. حاول <button>تحديث الصفحة</button>.",clearCanvasMessage:"إذا لم تعمل إعادة التحميل، حاول مرة أخرى ",clearCanvasCaveat:" هذا سيؤدي إلى فقدان العمل ",trackedToSentry:"تم تتبع الخطأ في المعرف {{eventId}} على نظامنا.",openIssueMessage:"حرصنا على عدم إضافة معلومات المشهد في بلاغ الخطأ. في حال كون مشهدك لا يحمل أي معلومات خاصة نرجو المتابعة على <button>نظام تتبع الأخطاء</button>. نرجو إضافة المعلومات أدناه بنسخها ولصقها في محتوى البلاغ على GitHub.",sceneContent:"محتوى المشهد:"},n={desc_intro:"يمكنك دعوة الآخرين لمشاركتك نفس الجلسة التي تعمل عليها.",desc_privacy:"لا تقلق، الجلسة تستخدم التشفير من النهاية إلى النهاية، لذلك فإن أي شيء ترسمه سيبقى خاصاً. لن يتمكن حتى الخادوم الخاص بنا من رؤية ما توصلت إليه.",button_startSession:"بدء الجلسة",button_stopSession:"إيقاف الجلسة",desc_inProgressIntro:"تجري الآن المشاركة الحية.",desc_shareLink:"شارك هذا الرابط مع أي شخص تريده أن يشاركك الجلسة:",desc_exitSession:"إيقاف الجلسة سيؤدي إلى قطع الاتصال الخاص بك من الغرفة، ولكن ستتمكن من مواصلة العمل مع المشهد، محليا. لاحظ أن هذا لن يؤثر على الأشخاص الآخرين، و سيظلون قادرين على التعاون في إصدارهم.",shareTitle:"الانضمام إلى جلسة تعاون حية على Excalidraw"},s={title:"خطأ"},D={disk_title:"حفظ الملف للجهاز",disk_details:"تصدير بيانات المشهد إلى ملف يمكنك الاستيراد منه لاحقاً.",disk_button:"إحفظ لملف",link_title:"رابط قابل للمشاركة",link_details:"صدر الملف للمشاهدة فقط.",link_button:"التصدير كرابط",excalidrawplus_description:"حفظ المشهد إلى مساحة العمل +Excalidraw الخاصة بك.",excalidrawplus_button:"تصدير",excalidrawplus_exportError:"تعذر التصدير إلى +Excalidraw في الوقت الحالي..."},d={blog:"اقرأ مدونتنا",click:"انقر",deepSelect:"تحديد عميق",deepBoxSelect:"تحديد عميق داخل المربع، ومنع السحب",curvedArrow:"سهم مائل",curvedLine:"خط مائل",documentation:"دليل الاستخدام",doubleClick:"انقر مرتين",drag:"اسحب",editor:"المحرر",editLineArrowPoints:"تحرير سطر/نقاط سهم",editText:"تعديل النص / إضافة تسمية",github:"عثرت على مشكلة؟ إرسال",howto:"اتبع التعليمات",or:"أو",preventBinding:"منع ارتبط السهم",tools:"الأدوات",shortcuts:"اختصارات لوحة المفاتيح",textFinish:"إنهاء التعديل (محرر النص)",textNewLine:"أضف سطر جديد (محرر نص)",title:"المساعدة",view:"عرض",zoomToFit:"تكبير للملائمة",zoomToSelection:"تكبير للعنصر المحدد",toggleElementLock:"إغلاق/فتح المحدد",movePageUpDown:"نقل الصفحة أعلى/أسفل",movePageLeftRight:"نقل الصفحة يسار/يمين"},c={title:"مسح اللوحة"},C={title:"نشر المكتبة",itemName:"إسم العنصر",authorName:"إسم المؤلف",githubUsername:"اسم المستخدم في جيت هب",twitterUsername:"اسم المستخدم في تويتر",libraryName:"اسم المكتبة",libraryDesc:"وصف المكتبة",website:"الموقع",placeholder:{authorName:"اسمك أو اسم المستخدم",libraryName:"اسم مكتبتك",libraryDesc:"وصف مكتبتك لمساعدة الناس على فهم استخدامها",githubHandle:"معالج GitHub (اختياري)، حتى تتمكن من تحرير المكتبة عند إرسالها للمراجعة",twitterHandle:"اسم مستخدم تويتر (اختياري)، حتى نعرف من الذي سيتم الإشارة إليه عند الترويج عبر تويتر",website:"رابط إلى موقعك الشخصي أو في مكان آخر (اختياري)"},errors:{required:"مطلوب",website:"أدخل عنوان URL صالح"},noteDescription:"تقديم مكتبتك لتضمينها في مستودع المكتبة العامة <link></link> لأشخاص آخرين لاستخدامها في رسومهم.",noteGuidelines:"تحتاج المكتبة إلى الموافقة أولا. يرجى قراءة <link>المعايير</link> قبل تقديمها. سوف تحتاج إلى حساب GitHub للتواصل وإجراء التغييرات عند الطلب، ولكن ليس مطلوبا بشكل صارم.",noteLicense:"تقديمك يعني موافقتك على نشر المكتبة المقدمة تحت <link>MIT ترخيص</link>، ما يعني أن لأي أحد الحق في استخدامها دون قيود.",noteItems:"يجب أن يكون لكل عنصر مكتبة اسمه الخاص حتى يكون قابلاً للتصفية. سيتم تضمين عناصر المكتبة التالية:",atleastOneLibItem:"يرجى تحديد عنصر مكتبة واحد على الأقل للبدء",republishWarning:"ملاحظة: بعض العناصر المحددة معينة على أنه نشرها أو تقديمها من قبل. يجب عليك فقط إعادة إرسال العناصر عند تحديث مكتبة موجودة أو إرسالها."},E={title:"تم إرسال المكتبة",content:"شكرا لك {{authorName}}. لقد تم إرسال مكتبتك للمراجعة. يمكنك تتبع الحالة"},m={resetLibrary:"إعادة ضبط المكتبة",removeItemsFromLib:"إزالة العناصر المحددة من المكتبة"},p={header:"تصدير الصورة",label:{withBackground:"الخلفية",onlySelected:"المحدد فقط",darkMode:"الوضع الداكن",embedScene:"تضمين المشهد",scale:"الحجم",padding:"الهوامش"},tooltip:{embedScene:`سيتم حفظ بيانات المشهد في ملف PNG/SVG المصدّر بحيث يمكن استعادة المشهد منه.
|
|
8
8
|
سيزيد حجم الملف المصدر.`},title:{exportToPng:"تصدير بصيغة PNG",exportToSvg:"تصدير بصيغة SVG",copyPngToClipboard:"نسخ الـ PNG إلى الحافظة"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"نسخ إلى الحافظة"}},b={tooltip:"رسوماتك مشفرة من النهاية إلى النهاية حتى أن خوادم Excalidraw لن تراها أبدا.",link:"مشاركة المدونة في التشفير من النهاية إلى النهاية في Excalidraw"},g={angle:"الزاوية",element:"عنصر",elements:"العناصر",height:"الارتفاع",scene:"المشهد",selected:"المحدد",storage:"التخزين",title:"إحصائيات للمهووسين",total:"المجموع",version:"الإصدار",versionCopy:"انقر للنسخ",versionNotAvailable:"الإصدار غير متوفر",width:"العرض"},h={addedToLibrary:"تمت الاضافة الى المكتبة!",copyStyles:"نسخت الانماط.",copyToClipboard:"نسخ إلى الحافظة.",copyToClipboardAsPng:`تم نسخ {{exportSelection}} إلى الحافظة بصيغة PNG
|
|
9
9
|
({{exportColorScheme}})`,fileSaved:"تم حفظ الملف.",fileSavedToFilename:"حفظ باسم {filename}",canvas:"لوحة الرسم",selection:"العنصر المحدد",pasteAsSingleElement:`استخدم {{shortcut}} للصق كعنصر واحد،
|
|
10
|
-
أو لصق في محرر نص موجود`,unableToEmbed:"تضمين هذا الرابط غير مسموح حاليًا. افتح بلاغاً على GitHub لطلب عنوان Url القائمة البيضاء",unrecognizedLinkFormat:"الرابط الذي ضمنته لا يتطابق مع التنسيق المتوقع. الرجاء محاولة لصق النص 'المضمن' المُزوَد من موقع المصدر"},S={transparent:"شفاف",black:"أسود",white:"أبيض",red:"أحمر",pink:"وردي",grape:"عنبي",violet:"بنفسجي",gray:"رمادي",blue:"أزرق",cyan:"سماوي",teal:"أزرق مخضر",green:"أخضر",yellow:"أصفر",orange:"برتقالي",bronze:"برونزي"},y={app:{center_heading:"جميع بياناتك محفوظة محليا في المتصفح الخاص بك.",center_heading_plus:"هل تريد الذهاب إلى Excalidraw+ بدلاً من ذلك؟",menuHint:"التصدير والتفضيلات واللغات ..."},defaults:{menuHint:"التصدير والتفضيلات وغيرها...",center_heading:"الرسم البياني التصويري. بشكل مبسط.",toolbarHint:"اختر أداة و ابدأ الرسم!",helpHint:"الاختصارات و المساعدة"}},v={mostUsedCustomColors:"الألوان المخصصة الأكثر استخداما",colors:"الألوان",shades:"الدرجات",hexCode:"رمز Hex",noShades:"لا تتوفر درجات لهذا اللون"},x={action:{exportToImage:{title:"تصدير كصورة",button:"تصدير كصورة",description:"تصدير بيانات المشهد إلى ملف يمكنك الاستيراد منه لاحقاً."},saveToDisk:{title:"حفظ الملف للجهاز",button:"حفظ الملف للجهاز",description:"تصدير بيانات المشهد إلى ملف يمكنك الاستيراد منه لاحقاً."},excalidrawPlus:{title:"Excalidraw+",button:"تصدير إلى Excalidraw+",description:"حفظ المشهد إلى مساحة العمل +Excalidraw الخاصة بك."}},modal:{loadFromFile:{title:"تحميل من ملف",button:"تحميل من ملف",description:"سيتم التحميل من الملف <bold>استبدال المحتوى الموجود</bold>.<br></br>يمكنك النسخ الاحتياطي لرسمك أولاً باستخدام أحد الخيارات أدناه."},shareableLink:{title:"تحميل من رابط",button:"استبدال محتواي",description:"سيتسبب تحميل رسمة خارجية <bold>باستبدال محتواك الموجود حالياً</bold>.<br></br>بإمكانك إجراء النسخ الاحتياطي لرسمتك الحالية باستخدام أحد الخيارات أدناه."}}},w={title:"",button:"",description:"",syntax:"",preview:""},
|
|
10
|
+
أو لصق في محرر نص موجود`,unableToEmbed:"تضمين هذا الرابط غير مسموح حاليًا. افتح بلاغاً على GitHub لطلب عنوان Url القائمة البيضاء",unrecognizedLinkFormat:"الرابط الذي ضمنته لا يتطابق مع التنسيق المتوقع. الرجاء محاولة لصق النص 'المضمن' المُزوَد من موقع المصدر"},S={transparent:"شفاف",black:"أسود",white:"أبيض",red:"أحمر",pink:"وردي",grape:"عنبي",violet:"بنفسجي",gray:"رمادي",blue:"أزرق",cyan:"سماوي",teal:"أزرق مخضر",green:"أخضر",yellow:"أصفر",orange:"برتقالي",bronze:"برونزي"},y={app:{center_heading:"جميع بياناتك محفوظة محليا في المتصفح الخاص بك.",center_heading_plus:"هل تريد الذهاب إلى Excalidraw+ بدلاً من ذلك؟",menuHint:"التصدير والتفضيلات واللغات ..."},defaults:{menuHint:"التصدير والتفضيلات وغيرها...",center_heading:"الرسم البياني التصويري. بشكل مبسط.",toolbarHint:"اختر أداة و ابدأ الرسم!",helpHint:"الاختصارات و المساعدة"}},v={mostUsedCustomColors:"الألوان المخصصة الأكثر استخداما",colors:"الألوان",shades:"الدرجات",hexCode:"رمز Hex",noShades:"لا تتوفر درجات لهذا اللون"},x={action:{exportToImage:{title:"تصدير كصورة",button:"تصدير كصورة",description:"تصدير بيانات المشهد إلى ملف يمكنك الاستيراد منه لاحقاً."},saveToDisk:{title:"حفظ الملف للجهاز",button:"حفظ الملف للجهاز",description:"تصدير بيانات المشهد إلى ملف يمكنك الاستيراد منه لاحقاً."},excalidrawPlus:{title:"Excalidraw+",button:"تصدير إلى Excalidraw+",description:"حفظ المشهد إلى مساحة العمل +Excalidraw الخاصة بك."}},modal:{loadFromFile:{title:"تحميل من ملف",button:"تحميل من ملف",description:"سيتم التحميل من الملف <bold>استبدال المحتوى الموجود</bold>.<br></br>يمكنك النسخ الاحتياطي لرسمك أولاً باستخدام أحد الخيارات أدناه."},shareableLink:{title:"تحميل من رابط",button:"استبدال محتواي",description:"سيتسبب تحميل رسمة خارجية <bold>باستبدال محتواك الموجود حالياً</bold>.<br></br>بإمكانك إجراء النسخ الاحتياطي لرسمتك الحالية باستخدام أحد الخيارات أدناه."}}},w={title:"",button:"",description:"",syntax:"",preview:""},z={labels:u,library:A,buttons:e,alerts:r,errors:a,toolBar:o,headings:t,hints:i,canvasError:l,errorSplash:F,roomDialog:n,errorDialog:s,exportDialog:D,helpDialog:d,clearCanvasDialog:c,publishDialog:C,publishSuccessDialog:E,confirmDialog:m,imageExportDialog:p,encrypted:b,stats:g,toast:h,colors:S,welcomeScreen:y,colorPicker:v,overwriteConfirm:x,mermaid:w};export{r as alerts,e as buttons,l as canvasError,c as clearCanvasDialog,v as colorPicker,S as colors,m as confirmDialog,z as default,b as encrypted,s as errorDialog,F as errorSplash,a as errors,D as exportDialog,t as headings,d as helpDialog,i as hints,p as imageExportDialog,u as labels,A as library,w as mermaid,x as overwriteConfirm,C as publishDialog,E as publishSuccessDialog,n as roomDialog,g as stats,h as toast,o as toolBar,y as welcomeScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as ln,c as J}from"./path-CbwjOpE9.js";import{D as rn,E as N,F as D,G as an,H as y,I as on,J as z,K as _,L as un,M as t,N as tn,O as sn,P as fn}from"./index-
|
|
1
|
+
import{w as ln,c as J}from"./path-CbwjOpE9.js";import{D as rn,E as N,F as D,G as an,H as y,I as on,J as z,K as _,L as un,M as t,N as tn,O as sn,P as fn}from"./index-BVowJdZF.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function dn(l,h,O,E,v,A,K,r){var q=O-l,i=E-h,n=K-v,m=r-A,a=m*q-n*i;if(!(a*a<y))return a=(n*(h-A)-m*(l-v))/a,[l+a*q,h+a*i]}function W(l,h,O,E,v,A,K){var r=l-O,q=h-E,i=(K?A:-A)/z(r*r+q*q),n=i*q,m=-i*r,a=l+n,s=h+m,f=O+n,c=E+m,L=(a+f)/2,o=(s+c)/2,p=f-a,g=c-s,R=p*p+g*g,T=v-A,P=a*c-f*s,F=(g<0?-1:1)*z(tn(0,T*T*R-P*P)),G=(P*g-p*F)/R,H=(-P*p-g*F)/R,w=(P*g+p*F)/R,d=(-P*p+g*F)/R,x=G-L,e=H-o,u=w-L,M=d-o;return x*x+e*e>u*u+M*M&&(G=w,H=d),{cx:G,cy:H,x01:-n,y01:-m,x11:G*(v/T-1),y11:H*(v/T-1)}}function vn(){var l=cn,h=yn,O=J(0),E=null,v=gn,A=mn,K=pn,r=null,q=ln(i);function i(){var n,m,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,L=un(c-f),o=c>f;if(r||(r=n=q()),s<a&&(m=s,s=a,a=m),!(s>y))r.moveTo(0,0);else if(L>on-y)r.moveTo(s*N(f),s*D(f)),r.arc(0,0,s,f,c,!o),a>y&&(r.moveTo(a*N(c),a*D(c)),r.arc(0,0,a,c,f,o));else{var p=f,g=c,R=f,T=c,P=L,F=L,G=K.apply(this,arguments)/2,H=G>y&&(E?+E.apply(this,arguments):z(a*a+s*s)),w=_(un(s-a)/2,+O.apply(this,arguments)),d=w,x=w,e,u;if(H>y){var M=sn(H/a*D(G)),B=sn(H/s*D(G));(P-=M*2)>y?(M*=o?1:-1,R+=M,T-=M):(P=0,R=T=(f+c)/2),(F-=B*2)>y?(B*=o?1:-1,p+=B,g-=B):(F=0,p=g=(f+c)/2)}var S=s*N(p),j=s*D(p),C=a*N(T),Q=a*D(T);if(w>y){var U=s*N(g),V=s*D(g),X=a*N(R),Y=a*D(R),I;if(L<rn)if(I=dn(S,j,X,Y,U,V,C,Q)){var Z=S-I[0],$=j-I[1],k=U-I[0],b=V-I[1],nn=1/D(fn((Z*k+$*b)/(z(Z*Z+$*$)*z(k*k+b*b)))/2),en=z(I[0]*I[0]+I[1]*I[1]);d=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else d=x=0}F>y?x>y?(e=W(X,Y,S,j,s,x,o),u=W(U,V,C,Q,s,x,o),r.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?r.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(r.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),r.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),r.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(r.moveTo(S,j),r.arc(0,0,s,p,g,!o)):r.moveTo(S,j),!(a>y)||!(P>y)?r.lineTo(C,Q):d>y?(e=W(C,Q,U,V,a,-d,o),u=W(S,j,X,Y,a,-d,o),r.lineTo(e.cx+e.x01,e.cy+e.y01),d<w?r.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(r.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),r.arc(0,0,a,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),r.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):r.arc(0,0,a,T,R,o)}if(r.closePath(),n)return r=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[N(m)*n,D(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(O=typeof n=="function"?n:J(+n),i):O},i.padRadius=function(n){return arguments.length?(E=n==null?null:typeof n=="function"?n:J(+n),i):E},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:J(+n),i):A},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(r=n??null,i):r},i}export{vn as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./percentages-BXMCSKIN-WVlHS4wx.js";import"./vendor-syntax-DnmwQQJF.js";import"./vendor-react-9mUTKBHH.js";import"./vendor-markdown-BXEi_H3G.js";import"./AppContent-C0CyP3g5.js";import"./index-ce18TYkg.js";import"./vendor-icons-Lb69KSFJ.js";import"./vendor-i18n-DCFGyhQR.js";import"./LoginModal-CZDEzqjK.js";import"./vendor-xterm-CZq1hqo1.js";import"./vendor-codemirror-D_s0aGBu.js";var e={paste:"Yapışdır",pasteAsPlaintext:"Düz mətn kimi yapışdırın",pasteCharts:"Diaqramları yapışdırın",selectAll:"Hamısını seç",multiSelect:"Seçimə element əlavə edin",moveCanvas:"Kanvası köçürün",cut:"Kəs",copy:"Kopyala",copyAsPng:"PNG olaraq panoya kopyala",copyAsSvg:"SVG olaraq panoya kopyala",copyText:"Mətn olaraq panoya kopyala",copySource:"",convertToCode:"",bringForward:"Önə daşı",sendToBack:"Geriyə göndərin",bringToFront:"Önə gətirin",sendBackward:"Geriyə göndərin",delete:"Sil",copyStyles:"Stilləri kopyalayın",pasteStyles:"Stilləri yapışdırın",stroke:"Strok rəngi",background:"Arxa fon",fill:"Doldur",strokeWidth:"Strok eni",strokeStyle:"Strok stili",strokeStyle_solid:"Solid",strokeStyle_dashed:"Kəsik",strokeStyle_dotted:"Nöqtəli",sloppiness:"Səliqəsizlik",opacity:"Şəffaflıq",textAlign:"Mətni uyğunlaşdır",edges:"Kənarlar",sharp:"Kəskin",round:"Dəyirmi",arrowheads:"Ox ucları",arrowhead_none:"Heç biri",arrowhead_arrow:"Ox",arrowhead_bar:"Çubuq",arrowhead_circle:"",arrowhead_circle_outline:"",arrowhead_triangle:"Üçbucaq",arrowhead_triangle_outline:"",arrowhead_diamond:"",arrowhead_diamond_outline:"",fontSize:"Şrift ölçüsü",fontFamily:"Şrift qrupu",addWatermark:'"Made with Excalidraw" əlavə et',handDrawn:"Əllə çəkilmiş",normal:"Normal",code:"Kod",small:"Kiçik",medium:"Orta",large:"Böyük",veryLarge:"Çox böyük",solid:"Solid",hachure:"Ştrix",zigzag:"Ziqzaq",crossHatch:"Çarpaz dəlik",thin:"İncə",bold:"Qalın",left:"Sol",center:"Mərkəz",right:"Sağ",extraBold:"Ekstra qalın",architect:"Memar",artist:"Rəssam",cartoonist:"Karikaturaçı",fileTitle:"Fayl adı",colorPicker:"Rəng seçən",canvasColors:"Kanvas üzərində istifadə olunur",canvasBackground:"Kanvas arxa fonu",drawingCanvas:"Kanvas çəkmək",layers:"Qatlar",actions:"Hərəkətlər",language:"Dil",liveCollaboration:"Canlı əməkdaşlıq...",duplicateSelection:"Dublikat",untitled:"Başlıqsız",name:"Ad",yourName:"Adınız",madeWithExcalidraw:"Excalidraw ilə hazırlanmışdır",group:"Qrup şəklində seçim",ungroup:"Qrupsuz seçim",collaborators:"",showGrid:"",addToLibrary:"",removeFromLibrary:"",libraryLoadingMessage:"",libraries:"",loadingScene:"",align:"",alignTop:"",alignBottom:"",alignLeft:"",alignRight:"",centerVertically:"",centerHorizontally:"",distributeHorizontally:"",distributeVertically:"",flipHorizontal:"",flipVertical:"",viewMode:"",share:"",showStroke:"",showBackground:"",toggleTheme:"",personalLib:"",excalidrawLib:"",decreaseFontSize:"",increaseFontSize:"",unbindText:"",bindText:"",createContainerFromText:"",link:{edit:"",editEmbed:"",create:"",createEmbed:"",label:"",labelEmbed:"",empty:""},lineEditor:{edit:"",exit:""},elementLock:{lock:"",unlock:"",lockAll:"",unlockAll:""},statusPublished:"",sidebarLock:"",selectAllElementsInFrame:"",removeAllElementsFromFrame:"",eyeDropper:"",textToDiagram:"",prompt:""},a={noItems:"",hint_emptyLibrary:"",hint_emptyPrivateLibrary:""},r={clearReset:"",exportJSON:"",exportImage:"",export:"",copyToClipboard:"",save:"",saveAs:"",load:"",getShareableLink:"",close:"",selectLanguage:"",scrollBackToContent:"",zoomIn:"",zoomOut:"",resetZoom:"",menu:"",done:"",edit:"",undo:"",redo:"",resetLibrary:"",createNewRoom:"",fullScreen:"",darkMode:"",lightMode:"",zenMode:"",objectsSnapMode:"",exitZenMode:"",cancel:"",clear:"",remove:"",embed:"",publishLibrary:"",submit:"",confirm:"",embeddableInteractionButton:""},o={clearReset:"",couldNotCreateShareableLink:"",couldNotCreateShareableLinkTooBig:"",couldNotLoadInvalidFile:"",importBackendFailed:"",cannotExportEmptyCanvas:"",couldNotCopyToClipboard:"",decryptFailed:"",uploadedSecurly:"",loadSceneOverridePrompt:"",collabStopOverridePrompt:"",errorAddingToLibrary:"",errorRemovingFromLibrary:"",confirmAddLibrary:"",imageDoesNotContainScene:"",cannotRestoreFromImage:"",invalidSceneUrl:"",resetLibrary:"",removeItemsFromsLibrary:"",invalidEncryptionKey:"",collabOfflineWarning:""},t={unsupportedFileType:"",imageInsertError:"",fileTooBig:"",svgImageInsertError:"",failedToFetchImage:"",invalidSVGString:"",cannotResolveCollabServer:"",importLibraryError:"",collabSaveFailed:"",collabSaveFailed_sizeExceeded:"",imageToolNotSupported:"",brave_measure_text_error:{line1:"",line2:"",line3:"",line4:""},libraryElementTypeError:{embeddable:"",iframe:"",image:""},asyncPasteFailedOnRead:"",asyncPasteFailedOnParse:"",copyToSystemClipboardFailed:""},i={selection:"",image:"",rectangle:"",diamond:"",ellipse:"",arrow:"",line:"",freedraw:"",text:"",library:"",lock:"",penMode:"",link:"",eraser:"",frame:"",magicframe:"",embeddable:"",laser:"",hand:"",extraTools:"",mermaidToExcalidraw:"",magicSettings:""},l={canvasActions:"",selectedShapeActions:"",shapes:""},n={canvasPanning:"",linearElement:"",freeDraw:"",text:"",embeddable:"",text_selected:"",text_editing:"",linearElementMulti:"",lockAngle:"",resize:"",resizeImage:"",rotate:"",lineEditor_info:"",lineEditor_pointSelected:"",lineEditor_nothingSelected:"",placeImage:"",publishLibrary:"",bindTextToElement:"",deepBoxSelect:"",eraserRevert:"",firefox_clipboard_write:"",disableSnapping:""},s={cannotShowPreview:"",canvasTooBig:"",canvasTooBigTip:""},d={headingMain:"",clearCanvasMessage:"",clearCanvasCaveat:"",trackedToSentry:"",openIssueMessage:"",sceneContent:""},u={desc_intro:"",desc_privacy:"",button_startSession:"",button_stopSession:"",desc_inProgressIntro:"",desc_shareLink:"",desc_exitSession:"",shareTitle:""},c={title:""},m={disk_title:"",disk_details:"",disk_button:"",link_title:"",link_details:"",link_button:"",excalidrawplus_description:"",excalidrawplus_button:"",excalidrawplus_exportError:""},p={blog:"",click:"",deepSelect:"",deepBoxSelect:"",curvedArrow:"",curvedLine:"",documentation:"",doubleClick:"",drag:"",editor:"",editLineArrowPoints:"",editText:"",github:"",howto:"",or:"",preventBinding:"",tools:"",shortcuts:"",textFinish:"",textNewLine:"",title:"",view:"",zoomToFit:"",zoomToSelection:"",toggleElementLock:"",movePageUpDown:"",movePageLeftRight:""},g={title:""},b={title:"",itemName:"",authorName:"",githubUsername:"",twitterUsername:"",libraryName:"",libraryDesc:"",website:"",placeholder:{authorName:"",libraryName:"",libraryDesc:"",githubHandle:"",twitterHandle:"",website:""},errors:{required:"",website:""},noteDescription:"",noteGuidelines:"",noteLicense:"",noteItems:"",atleastOneLibItem:"",republishWarning:""},y={title:"",content:""},x={resetLibrary:"",removeItemsFromLib:""},h={header:"",label:{withBackground:"",onlySelected:"",darkMode:"",embedScene:"",scale:"",padding:""},tooltip:{embedScene:""},title:{exportToPng:"",exportToSvg:"",copyPngToClipboard:""},button:{exportToPng:"",exportToSvg:"",copyPngToClipboard:""}},k={tooltip:"",link:""},S={angle:"",element:"",elements:"",height:"",scene:"",selected:"",storage:"",title:"",total:"",version:"",versionCopy:"",versionNotAvailable:"",width:""},v={addedToLibrary:"",copyStyles:"",copyToClipboard:"",copyToClipboardAsPng:"",fileSaved:"",fileSavedToFilename:"",canvas:"",selection:"",pasteAsSingleElement:"",unableToEmbed:"",unrecognizedLinkFormat:""},F={transparent:"",black:"",white:"",red:"",pink:"",grape:"",violet:"",gray:"",blue:"",cyan:"",teal:"",green:"",yellow:"",orange:"",bronze:""},w={app:{center_heading:"",center_heading_plus:"",menuHint:""},defaults:{menuHint:"",center_heading:"",toolbarHint:"",helpHint:""}},E={mostUsedCustomColors:"",colors:"",shades:"",hexCode:"",noShades:""},T={action:{exportToImage:{title:"",button:"",description:""},saveToDisk:{title:"",button:"",description:""},excalidrawPlus:{title:"",button:"",description:""}},modal:{loadFromFile:{title:"",button:"",description:""},shareableLink:{title:"",button:"",description:""}}},_={title:"",button:"",description:"",syntax:"",preview:""},q={labels:e,library:a,buttons:r,alerts:o,errors:t,toolBar:i,headings:l,hints:n,canvasError:s,errorSplash:d,roomDialog:u,errorDialog:c,exportDialog:m,helpDialog:p,clearCanvasDialog:g,publishDialog:b,publishSuccessDialog:y,confirmDialog:x,imageExportDialog:h,encrypted:k,stats:S,toast:v,colors:F,welcomeScreen:w,colorPicker:E,overwriteConfirm:T,mermaid:_};export{o as alerts,r as buttons,s as canvasError,g as clearCanvasDialog,E as colorPicker,F as colors,x as confirmDialog,q as default,k as encrypted,c as errorDialog,d as errorSplash,t as errors,m as exportDialog,l as headings,p as helpDialog,n as hints,h as imageExportDialog,e as labels,a as library,_ as mermaid,T as overwriteConfirm,b as publishDialog,y as publishSuccessDialog,u as roomDialog,S as stats,v as toast,i as toolBar,w as welcomeScreen};
|