@kabmo-labs/kabmo 0.56.0 → 0.57.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/dist/client/index.html +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/static/js/{Body-jfy4bhk2.js → Body-p6zwk0nx.js} +1 -1
- package/dist/client/static/js/{CsvGrid-4c5t668z.js → CsvGrid-563qmmmr.js} +1 -1
- package/dist/client/static/js/{DocxView-3x7whtvq.js → DocxView-5j69q3s0.js} +1 -1
- package/dist/client/static/js/{DrawioView-tbkc5dfz.js → DrawioView-gd6k3hvn.js} +1 -1
- package/dist/client/static/js/{HtmlPreview-egxkayya.js → HtmlPreview-6gnktzzp.js} +1 -1
- package/dist/client/static/js/{ImageView-swhzvw2p.js → ImageView-fkfq3fwv.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-sangsrt5.js → LayoutWrapper-mdb1qm26.js} +1 -1
- package/dist/client/static/js/MergeDiffView-7kpjxcg9.js +1 -0
- package/dist/client/static/js/{Modal-1fj8kvme.js → Modal-0p9cr2tn.js} +12 -12
- package/dist/client/static/js/{PdfView-0k2egsbz.js → PdfView-n1zq27td.js} +1 -1
- package/dist/client/static/js/{SessionsView-t547rqeb.js → SessionsView-gptt0rq8.js} +1 -1
- package/dist/client/static/js/{SheetView-anb3gavm.js → SheetView-nes7j86v.js} +1 -1
- package/dist/client/static/js/{SvgPreview-e2wrj2hj.js → SvgPreview-vv0qzkt7.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-0rs86b68.js → abnfDiagram-O67JEVCF-02g96sn6.js} +1 -1
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-0k3zzxz1.js → architectureDiagram-NJMV4G6O-7qj2fpwt.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-t1n1fx96.js → blockDiagram-BEXU5L5S-grdr1j2h.js} +3 -3
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-93b7eds9.js → c4Diagram-YGBWAQC7-7y980xpx.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-bnf85z0f.js → classDiagram-v2-NBCMYWYE-29ag4js1.js} +1 -1
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-e290161f.js → cose-bilkent-JH36ORCC-e5dvgehd.js} +1 -1
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-s13ra9ag.js → cynefinDiagram-VND7K2PF-eq6fmx0b.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-83wshh5e.js → dagre-6A5THRUB-xfhwp8ha.js} +1 -1
- package/dist/client/static/js/{diagram-22UHCM2B-ywh4wqna.js → diagram-22UHCM2B-1bw6x6zt.js} +1 -1
- package/dist/client/static/js/{diagram-3UASUU5V-cb53z698.js → diagram-3UASUU5V-076ej5n5.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-btf55c44.js → diagram-ATOU4E4O-cvf9fhdq.js} +1 -1
- package/dist/client/static/js/{diagram-CDSNMT55-p6tbbm1n.js → diagram-CDSNMT55-hn1wdx54.js} +3 -3
- package/dist/client/static/js/{diagram-MLGK6HIB-6kzssf4y.js → diagram-MLGK6HIB-76gk27b5.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-4v0yncvv.js → diagram-MPIPVDR6-0cbajhpx.js} +1 -1
- package/dist/client/static/js/{dockerfile-r422htmd.js → dockerfile-7atfjhnf.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-mw1gh30z.js → ebnfDiagram-ZINNZB2B-n0g3b9m2.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-1pe786ap.js → elk-276RUBZZ-f6wrjcv9.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-x7rk70q6.js → erDiagram-OPXOYQCR-jz622yrg.js} +1 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-5bvd5k2t.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-j3m5km4p.js → ganttDiagram-FUAMR5RP-2ex4nxyg.js} +2 -2
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-fd1kebdy.js → gitGraphDiagram-X574FWY7-38eyay6g.js} +1 -1
- package/dist/client/static/js/{index-zkef5q39.js → index-1q934wfk.js} +1 -1
- package/dist/client/static/js/{index-5fxm2tpg.js → index-28wv94gz.js} +1 -1
- package/dist/client/static/js/{index-4jg10xtp.js → index-3wgjtp2k.js} +1 -1
- package/dist/client/static/js/{index-29b1ysz6.js → index-4cff0zg2.js} +1 -1
- package/dist/client/static/js/{index-8e66p2a7.js → index-55v3qv04.js} +1 -1
- package/dist/client/static/js/{index-s4v3vcsn.js → index-63mk2qk6.js} +1 -1
- package/dist/client/static/js/{index-4dzvjfkd.js → index-6z30g3ha.js} +1 -1
- package/dist/client/static/js/{index-473wm10a.js → index-7trfm17d.js} +1 -1
- package/dist/client/static/js/{index-drsy400d.js → index-8444mec5.js} +1 -1
- package/dist/client/static/js/{index-j1prebvy.js → index-9gfn1a3h.js} +1 -1
- package/dist/client/static/js/{index-qdabc51h.js → index-ays8t3t3.js} +2 -2
- package/dist/client/static/js/{index-q4t5j3x7.js → index-cxe75e06.js} +1 -1
- package/dist/client/static/js/{index-22frp78d.js → index-db7vsjkd.js} +1 -1
- package/dist/client/static/js/{index-7tsdw8wt.js → index-dmb1pykr.js} +1 -1
- package/dist/client/static/js/{index-tcp5cp53.js → index-ep99arz1.js} +1 -1
- package/dist/client/static/js/{index-0mhxw0a1.js → index-ewst55j2.js} +1 -1
- package/dist/client/static/js/{index-hgsjynb0.js → index-fqc1snjw.js} +1 -1
- package/dist/client/static/js/{index-rm5b3kn8.js → index-g2e0m757.js} +3 -3
- package/dist/client/static/js/{index-3k45gspr.js → index-jaxhfk9x.js} +1 -1
- package/dist/client/static/js/{index-satnfvaz.js → index-jsn2kedv.js} +1 -1
- package/dist/client/static/js/{index-bxhszdcz.js → index-n1xmkf2g.js} +1 -1
- package/dist/client/static/js/{index-004x0a3p.js → index-pe4d9wht.js} +1 -1
- package/dist/client/static/js/{index-cbbwq25c.js → index-pjf5wak8.js} +1 -1
- package/dist/client/static/js/{index-8n4qwd64.js → index-sm8gpk3g.js} +2 -2
- package/dist/client/static/js/{index-qrwjxqdh.js → index-st6a8q5z.js} +176 -176
- package/dist/client/static/js/{index-dfha2z56.js → index-stmwbavz.js} +1 -1
- package/dist/client/static/js/index-swaveqxg.css +1 -0
- package/dist/client/static/js/{index-3hrvhyym.js → index-t82q5t6m.js} +1 -1
- package/dist/client/static/js/{index-s6nv35dv.js → index-t9zjfxvc.js} +1 -1
- package/dist/client/static/js/{index-jbaceghb.js → index-tdbcp70z.js} +1 -1
- package/dist/client/static/js/{index-kbk0vmex.js → index-tdryzzy9.js} +1 -1
- package/dist/client/static/js/{index-jtyzeynv.js → index-tksrpqkh.js} +1 -1
- package/dist/client/static/js/{index-g84dwmvr.js → index-v38j2zxn.js} +1 -1
- package/dist/client/static/js/{index-4nyajpeg.js → index-x17y7xdr.js} +1 -1
- package/dist/client/static/js/{index-4fpyzg5e.js → index-xfnjwhan.js} +20 -20
- package/dist/client/static/js/{index-72v57e07.js → index-xrb4kjr3.js} +1 -1
- package/dist/client/static/js/{index-4acka5fn.js → index-zv8wrvha.js} +1 -1
- package/dist/client/static/js/{index-q178zgxp.js → index-zynbvm7x.js} +1 -1
- package/dist/client/static/js/{index-bnamrpm6.js → index-zzggk17b.js} +1 -1
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-1m0br602.js → infoDiagram-VRGFBTTK-c55t0tvd.js} +2 -2
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-zryzhpq6.js → ishikawaDiagram-OU5B5YK6-r9kg5kg5.js} +2 -2
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-6apqr7h4.js → journeyDiagram-ZHPQQLJL-zmmst4v8.js} +2 -2
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-am385c1e.js → kanban-definition-PNTS6WVX-3tt6sc9a.js} +1 -1
- package/dist/client/static/js/{mermaid.core-k937exrm.js → mermaid.core-pkrs8zp5.js} +2 -2
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-hx8qq866.js → mindmap-definition-NLK3R4M7-b4c6gxg4.js} +1 -1
- package/dist/client/static/js/one-dark-pro-sstqnzcf.js +1 -0
- package/dist/client/static/js/one-light-6fpxxq2j.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-1hasj2h7.js → pegDiagram-GJSIUBJH-9jkat1mz.js} +1 -1
- package/dist/client/static/js/{pieDiagram-5QR66LMP-x5nwff8r.js → pieDiagram-5QR66LMP-6pbchjh7.js} +2 -2
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-gmrcr5jb.js → quadrantDiagram-O4NWA36T-p9brea19.js} +2 -2
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-rdznfhfb.js → railroadDiagram-XR7U4H2S-3cep8css.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-v9wb3ppf.js → requirementDiagram-PLB6GJNP-x1yjgsrr.js} +1 -1
- package/dist/client/static/js/{rust-9cgnbbcs.js → rust-yy8gekx8.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-3p4ddd2h.js → sankeyDiagram-IPEJSGJF-23wzf4aj.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-wfcqxjfq.js → sequenceDiagram-PO4LG4MO-w4wr3zzr.js} +4 -4
- package/dist/client/static/js/{sizeCapture-INFHLROL-g02k0k8x.js → sizeCapture-INFHLROL-aabfesnr.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-7k449yvg.js → stateDiagram-v2-GCMORJYK-t0n288xw.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-zkf2bgm8.js → swimlanes-2SLR337P-1nnm0p7h.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-yex8g4fx.js → swimlanesDiagram-TC7HE7FX-cx3f29mq.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-qsfpjr1c.js → timeline-definition-EJHVYXUP-8pyssn0q.js} +1 -1
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-b2vprhsr.js → usecaseDiagram-POWQR4AR-vveepvt6.js} +1 -1
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-x0ffeg2t.js → vennDiagram-UO4OBE2U-tqyvmqxc.js} +4 -4
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-hsnhaf4f.js → wardleyDiagram-VNRHLVJA-p8rs34em.js} +2 -2
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-90f9aadp.js → xychartDiagram-PMCCYNJV-pgnvxtps.js} +3 -3
- package/package.json +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.tsx +25 -62
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.test.tsx +40 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +41 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionList.tsx +117 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/SwipeDeck.tsx +220 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +10 -8
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/toggle-label.test.ts +37 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/toggle-label.ts +17 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +18 -15
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +7 -8
- package/src/client/data/settings/omp-schema.json +59 -7
- package/src/client/hooks/chat/timeline/ask-frames-form.test.ts +29 -0
- package/src/server/lib/dictation/capability.server.test.ts +9 -6
- package/src/server/lib/dictation/worker-process.ts +9 -2
- package/src/shared/lib/chat/ask-form/data.ts +25 -6
- package/src/shared/lib/chat/ask-form/deck.ts +80 -0
- package/src/shared/lib/chat/ask-form/fields.ts +26 -1
- package/src/shared/lib/chat/ask-form/index.ts +18 -310
- package/src/shared/lib/chat/ask-form/types.ts +14 -2
- package/src/shared/lib/chat/ask-form/walker.ts +350 -0
- package/src/shared/lib/chat/ask-form.test.ts +41 -0
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +47 -0
- package/src/shared/lib/omp/config/schema-releases.test.ts +4 -2
- package/dist/client/static/js/MergeDiffView-bv00y63x.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-kfwaac44.js +0 -1
- package/dist/client/static/js/index-gedsa0z7.css +0 -1
- package/dist/client/static/js/one-dark-pro-phxqe9mx.js +0 -1
- package/dist/client/static/js/one-light-vhwh499y.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n,o,K,i,a,ze,Me,Se,ie,e,s,p,I,E,Xe,bi,ir,h,sr,He,we,T,tt,wi,he,X,mt,Oo,Uo,N0,H0,Of,Jo,Ni,eg,hA}from"./index-qrwjxqdh.js";import"./index-0mhxw0a1.js";import{Li}from"./index-473wm10a.js";import"./index-e4yj4kbe.js";import{wA,xu,Fs,wu,Cu,Eu,Bu,Iu,_u,Su,Tu,Du}from"./index-j1prebvy.js";var vt={name:"panel-right-close",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]},be=s(vt);var z=new Set,ae=new Set,ge=new Set;function ve(){ge=new Set(z);for(let t of[...ae])t()}function xe(t){let r=new Set(t);if(r.size===z.size){let l=!0;for(let d of r)if(!z.has(d)){l=!1;break}if(l)return}z.clear();for(let l of r)z.add(l);ve()}function ye(t){let r=new Set(t),l=!1;for(let d of[...z])if(!r.has(d))z.delete(d),l=!0;if(l)ve()}function Ce(t){return z.has(t)}function ke(){return z.size>0}function ht(t){return ae.add(t),()=>{ae.delete(t)}}var xt=ht;function Ee(){return ze(xt,()=>ge)}function Te({x:t,y:r,rows:l,onAction:d,onClose:u}){let x=i(null),[m,c]=n({left:t,top:r});return K(()=>{let b=x.current;if(!b)return;let{width:k,height:g}=b.getBoundingClientRect();c({left:Math.min(t,Math.max(0,window.innerWidth-k-8)),top:Math.min(r,Math.max(0,window.innerHeight-g-8))})},[t,r,l.length]),ie(e("div",{className:"fixed inset-0 z-[70]",onClick:u,onContextMenu:(b)=>{b.preventDefault(),u()},children:e("div",{ref:x,role:"menu","aria-label":"Tab actions",className:"glass-popover absolute w-52 bg-paper border border-ink/15 rounded-md shadow-xl py-1 text-xs text-ink",style:{left:`${m.left}px`,top:`${m.top}px`},onClick:(b)=>b.stopPropagation(),children:l.map((b)=>e("button",{type:"button",role:"menuitem",onClick:()=>{d(b.action),u()},className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 transition-colors cursor-pointer",children:b.label},b.action))})}),document.body)}var ee={rightFileId:null,fraction:0.5};function ne(t,r,l){if(t===null)return!1;if(t===r)return!1;return l.includes(t)}function Ne(t,r){for(let l=r.length-1;l>=0;l-=1){let d=r[l];if(d!==t)return d}return null}function Pe(t,r){if(t.rightFileId===null)return t;if(t.rightFileId!==r)return t;return{...t,rightFileId:null}}function Y(t){if(!Number.isFinite(t))return ee.fraction;return Math.max(0.2,Math.min(0.8,t))}function De(t,r){if(typeof t!=="object"||t===null)return ee;let l=t,d=typeof l.fraction==="number"?Y(l.fraction):ee.fraction,u=typeof l.rightFileId==="string"||typeof l.rightFileId==="number"?l.rightFileId:null;if(u===null||!r.includes(u))return{rightFileId:null,fraction:d};return{rightFileId:u,fraction:d}}function Re({tab:t,openedFiles:r,dirtyIds:l,reopenable:d,activeFileId:u,splitRightFileId:x}){let m=r.filter((g)=>g.id!==t.id),c=r.filter((g)=>!l.has(g.id)),b=r.map((g)=>g.id);return[{action:"split-right",label:"Split right",enabled:ne(t.id,u,b)},{action:"unsplit",label:"Unsplit",enabled:x!==null},{action:"close",label:"Close",enabled:!0},{action:"close-others",label:"Close others",enabled:m.length>0},{action:"close-all",label:"Close all",enabled:r.length>0},{action:"close-saved",label:"Close saved",enabled:c.some((g)=>g.id!==t.id)},{action:"copy-path",label:"Copy path",enabled:Boolean(t.path)},{action:"reveal-in-files",label:"Reveal in Files",enabled:Boolean(t.path)&&!t.isDiff},{action:"reopen-closed",label:"Reopen closed tab",enabled:d>0}].filter((g)=>g.enabled)}function Z({onHide:t}){let r=Jo("toggleEditorPanel","Hide Editor Panel");return e("button",{type:"button",onClick:t,className:"p-1.5 mx-1 rounded transition-colors cursor-pointer text-ink/60 hover:bg-ink/10 hover:text-ink flex-shrink-0",title:r,"aria-label":r,children:e(be,{size:14})})}function Ie({openedFiles:t,activeFileId:r,onSelectFile:l,onCloseFile:d,missingIds:u,onCopyPath:x,onRevealInFiles:m,onReopenClosed:c,reopenableCount:b,onSplitTo:k,onUnsplit:g,splitRightFileId:y=null,onHide:R}){let M=Ee(),P=i(null),L=i(null),[D,O]=n(5),[A,F]=n(!1),[f,Q]=n(null);he(L,()=>F(!1)),o(()=>{let v=new ResizeObserver((w)=>{for(let S of w){let q=S.contentRect.width,H=Math.max(1,Math.floor((q-60)/150));O(H)}});if(P.current)v.observe(P.current);return()=>v.disconnect()},[]);let U=Ne(r,t.map((v)=>v.id)),j=[],G=[];if(t.length<=D)j=t;else{let v=t.findIndex((S)=>S.id===r),w=new Set;if(v!==-1&&r!==null)w.add(r);for(let S=t.length-1;S>=0;S--){if(w.size>=D)break;w.add(t[S].id)}j=t.filter((S)=>w.has(S.id)),G=t.filter((S)=>!w.has(S.id))}return e("div",{className:`${wi.desktop} flex bg-ink/10 w-full relative border-b border-ink/10`,ref:P,children:[e("div",{className:"flex overflow-hidden",children:j.map((v)=>{let w=v.id===r,S=Boolean(v.isDiff),q=S?sr(v.diffStatus||"M",v.diffStaged):null,H=Boolean(u?.has(v.id));return e("div",{onClick:()=>l(v.id),onContextMenu:(_)=>{_.preventDefault(),Q({tab:v,x:_.clientX,y:_.clientY})},className:`flex items-center space-x-1.5 px-3 py-1.5 cursor-pointer border-r border-ink/10 min-w-[120px] max-w-[210px] group ${w?"bg-paper border-t-2 border-t-ink text-ink":"bg-transparent border-t-2 border-t-transparent text-ink/60 hover:bg-paper/50"}`,title:H?`${v.path} — file no longer exists`:v.path,children:[S?e(bi,{size:14,className:w?"text-info flex-shrink-0":"text-info/70 flex-shrink-0"}):e(mt,{name:v.name,size:14,className:`flex-shrink-0${w||H?"":" opacity-60"}${H?" text-error":""}`}),e("span",{className:`text-xs font-mono truncate flex-1${H?" text-error line-through":""}`,children:v.name}),q&&e("span",{className:`px-1 text-[10px] font-mono font-bold rounded ${q.badgeBgClass}`,children:q.charStatus}),e(Oe,{dirty:M.has(v.id),active:w,label:`Close ${v.name}`,onClose:()=>d(v.id)})]},v.id)})}),f?e(Te,{x:f.x,y:f.y,rows:Re({tab:f.tab,openedFiles:t,dirtyIds:M,reopenable:b?.()??0,activeFileId:r,splitRightFileId:y}),onAction:(v)=>{let w=f.tab;switch(v){case"close":d(w.id);return;case"close-others":for(let S of[...t].reverse())if(S.id!==w.id)d(S.id);l(w.id);return;case"close-all":for(let S of[...t].reverse())d(S.id);return;case"close-saved":for(let S of[...t].reverse())if(!M.has(S.id))d(S.id);return;case"copy-path":x?.(w);return;case"reveal-in-files":m?.(w);return;case"reopen-closed":c?.();return;case"split-right":k?.(w.id);return;case"unsplit":g?.();return}},onClose:()=>Q(null)}):null,e("div",{className:"ml-auto flex items-center",children:[e("button",{type:"button",onClick:()=>y!==null?g?.():k?.(U),disabled:y===null&&U===null,"aria-pressed":y!==null,"aria-label":"Split editor",title:y!==null?"Close the split pane (the tab stays open)":U===null?"Open another file to split the editor":"Split the editor and show the newest other file",className:`p-1.5 mx-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default ${y!==null?"bg-ink/10 text-ink":"text-ink/60 hover:bg-ink/10"}`,children:e(ir,{size:14})}),R&&e(Z,{onHide:R})]}),G.length>0&&e("div",{className:"relative flex items-center bg-ink/10",ref:L,children:[e("button",{className:`p-1.5 mx-1 rounded hover:bg-ink/10 text-ink/60 ${A?"bg-ink/10 text-ink":""}`,onClick:()=>F(!A),title:"More open files",children:e(E,{size:14})}),A&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-52 bg-paper border border-ink/10 rounded shadow-lg z-50 py-1",children:[e("div",{className:"px-3 py-1 text-[10px] uppercase font-mono text-ink/40 border-b border-ink/10 mb-1",children:"Older Tabs"}),G.map((v)=>{let w=Boolean(u?.has(v.id));return e("div",{onClick:()=>{l(v.id),F(!1)},className:"flex items-center space-x-2 px-3 py-1.5 hover:bg-ink/5 cursor-pointer group",children:[v.isDiff?e(bi,{size:14,className:"text-info/80"}):e(mt,{name:v.name,size:14,className:w?"text-error":"opacity-60"}),e("span",{className:`text-xs font-mono truncate flex-1 ${w?"text-error line-through":"text-ink/80"}`,children:v.name}),e(Oe,{dirty:M.has(v.id),active:!1,label:`Close ${v.name}`,onClose:()=>{if(d(v.id),G.length===1)F(!1)}})]},v.id)})]})]})]})}function Oe({dirty:t,active:r,label:l,onClose:d}){return e("div",{role:"button",tabIndex:-1,"aria-label":l,title:t?`${l} — unsaved changes`:l,className:`p-0.5 rounded hover:bg-ink/10 touch-visible ${r||t?"opacity-100":"opacity-0 group-hover:opacity-100"}`,onClick:(u)=>{u.stopPropagation(),d()},children:t?e("span",{className:"block w-2 h-2 rounded-full bg-current mx-0.5","data-tab-dirty":"","aria-hidden":"true"}):e(h,{size:12})})}function Ae({pluginId:t,Component:r,sessionId:l,className:d="",onHide:u}){return e("div",{className:`flex flex-col h-full bg-canvas ${d}`,children:[u&&e("div",{className:"flex justify-end flex-shrink-0 border-b border-ink/10",children:e(Z,{onHide:u})}),e(tt,{pluginId:t,children:e(r,{sessionId:l,workspacePath:null})})]})}function Fe({className:t="",onHide:r}){return e("div",{className:`relative flex flex-col h-full bg-canvas items-center justify-center text-muted ${t}`,children:[r&&e("div",{className:"absolute top-0 right-0 flex items-center",children:e(Z,{onHide:r})}),e(mt,{name:"placeholder.txt",size:48,className:"mb-4 opacity-20"}),e("p",{className:"font-mono text-sm",children:"Select a file to open"})]})}function Le({searchReveal:t,revealMatch:r}){let l=i(r);l.current=r;let d=i(null);o(()=>{if(!t||d.current===t.request)return;d.current=t.request,l.current({query:t.request.query,options:t.request.options,line:t.request.line})},[t])}function Be({openedFiles:t,dirtyKeys:r,activeFile:l,previewReady:d,setPreviewMode:u,sessionId:x}){o(()=>{let m=new Set(t.filter((c)=>!c.isDiff&&c.content===void 0).map((c)=>c.id));xe([...r].filter((c)=>m.has(c)))},[r,t]),o(()=>{if(!d)return;let m=l?.id;if(!l||m===void 0||m===null)return;if(!xu(Fs(l.name)))return;let c=we(x,"editor.previewMode");if(c&&c[m]!==void 0)return;u((b)=>b[m]===void 0?{...b,[m]:!0}:b)},[d,l])}function Ke({activeFile:t,externalChange:r,conflict:l,onReload:d,onKeepMine:u}){if(!t)return null;if(l)return e(Su,{diskMtimeMs:l.diskMtimeMs,fileName:t.name,onReload:d,onKeepMine:u});if(r)return e(_u,{fileName:t.name,onReload:d,onKeepMine:u});return null}async function $e(t){let r=t.name.trim();if(!r)return{status:"failed",reason:"Enter a file name."};let l=new FormData;if(l.append("actionType","saveAs"),l.append("path",t.parent),l.append("name",r),l.append("content",t.content),l.append("eol",t.eol),t.root)l.append("root",t.root);if(t.repo&&t.repo!==".")l.append("repo",t.repo);try{let d=await fetch("/api/fs/action",{method:"POST",body:l}),u=await d.json().catch(()=>null),x=typeof u?.error==="string"?u.error:null;if(d.status===409)return{status:"exists",reason:x??`${r} already exists.`};if(d.ok&&u?.success&&typeof u.path==="string")return{status:"written",path:u.path};return{status:"failed",reason:x??"The file could not be written."}}catch{return{status:"failed",reason:"The file could not be written."}}}function Ue(t){let r=t.lastIndexOf(".");if(r<=0)return`${t} copy`;return`${t.slice(0,r)} copy${t.slice(r)}`}function Ge(t){let r=t.trim();if(!r)return!1;if(r==="."||r==="..")return!1;return!r.includes("/")&&!r.includes("\\")}function yt(t){let r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function qe({fileName:t,filePath:r,content:l,eol:d,root:u,repo:x,onSaved:m,onClose:c}){let[b,k]=n(()=>yt(r)),[g,y]=n(()=>Ue(t)),[R,M]=n(!1),[P,L]=n(null),D=i(null);o(()=>{D.current?.focus(),D.current?.select()},[]);let O=Ge(g),A=async()=>{if(!O||R)return;M(!0),L(null);let f=await $e({parent:b,name:g,content:l,eol:d,root:u,repo:x});if(M(!1),f.status==="written"){m({path:f.path});return}L(f.reason)},F=(f)=>{if(f.key==="Enter"){f.preventDefault(),A();return}if(f.key==="Escape")f.preventDefault(),c()};return e(X,{onClose:c,maxWidthClass:"max-w-md",header:e("span",{className:"text-sm font-semibold text-ink",children:"Save as"}),footer:e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:c,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),e("button",{type:"button",onClick:()=>void A(),disabled:!O||R,className:"flex items-center gap-1.5 px-3 py-1.5 rounded bg-ink text-paper disabled:opacity-40 disabled:cursor-default cursor-pointer",children:[R?e(p,{size:12,className:"animate-spin"}):e(Xe,{size:12}),"Save"]})]}),children:e("div",{className:"px-4 py-3 space-y-2 text-xs",children:[e("label",{className:"block",children:[e("span",{className:"block text-[10px] uppercase tracking-wide text-ink/50 mb-1",children:"Folder"}),e("input",{value:b,onInput:(f)=>k(f.target.value),onKeyDown:F,placeholder:"(workspace root)","aria-label":"Destination folder",className:"w-full bg-paper border border-ink/20 rounded px-2 py-1 font-mono text-ink outline-none focus:border-ink/40"})]}),e("label",{className:"block",children:[e("span",{className:"block text-[10px] uppercase tracking-wide text-ink/50 mb-1",children:"Name"}),e("input",{ref:D,value:g,onInput:(f)=>y(f.target.value),onKeyDown:F,"aria-label":"File name","aria-invalid":!O,className:`w-full bg-paper border rounded px-2 py-1 font-mono text-ink outline-none ${O?"border-ink/20 focus:border-ink/40":"border-error text-error"}`})]}),!O?e("div",{className:"text-[10px] text-error font-mono",children:"Enter a file name without a path separator"}):null,P?e("div",{className:"text-[10px] text-error font-mono",children:P}):null,e("div",{className:"text-[10px] text-ink/40",children:"The original file stays where it is, and its tab stays open."})]})})}function _e(){o(()=>{let t=(r)=>{if(!ke())return;r.preventDefault(),r.returnValue=""};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[])}function We({fileName:t,onAnswer:r}){return e(X,{onClose:()=>r("cancel"),header:e("div",{className:"flex items-center gap-2",children:[e(I,{size:15,className:"text-warning"}),e("span",{className:"text-sm font-semibold text-ink",children:"Unsaved changes"})]}),footer:e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:()=>r("cancel"),className:"px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),e("button",{type:"button",onClick:()=>r("discard"),className:"px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer",children:"Discard"}),e("button",{type:"button",onClick:()=>r("save"),className:"px-3 py-1.5 rounded bg-ink text-paper hover:bg-ink/90 transition-colors cursor-pointer",children:"Save & close"})]}),children:e("div",{className:"px-4 py-3 text-xs text-ink/80",children:[e("span",{className:"font-mono text-ink",children:t})," has changes that are not on disk.",e("div",{className:"mt-1 text-ink/50",children:"Discarding them cannot be undone."})]})})}function Ve({closeGuard:t,activeFile:r,saveMissingConfirm:l,onCancelSaveMissing:d,onConfirmSaveMissing:u}){if(t.pending)return e(We,{fileName:t.pending.name,onAnswer:t.answer});if(l&&r)return e(Tu,{fileName:r.name,filePath:r.path,onClose:d,onConfirm:u});return null}function Je({className:t="",isMaximized:r,onKeyDownCapture:l,onFocusCapture:d,asSplitPane:u,tabs:x,activeFile:m,editor:c,externalChange:b,conflict:k,onReload:g,onKeepMine:y,body:R,saveAsOpen:M,onSaveAsClose:P,onSavedAs:L,closeGuard:D}){let O=r?"fixed inset-0 z-50 flex flex-col bg-canvas":`flex flex-col h-full bg-canvas ${t}`;return e("div",{className:O,onKeyDownCapture:l,onFocusCapture:d,children:[u?null:x,e(Ke,{activeFile:m,externalChange:b,conflict:k,onReload:g,onKeepMine:y}),R,M&&m?e(qe,{fileName:m.name,filePath:m.path,content:c.content,eol:c.eol,root:m.root,repo:m.repo,onSaved:({path:A})=>L(A),onClose:P}):null,e(Ve,{closeGuard:D,activeFile:m,saveMissingConfirm:c.saveMissingConfirm,onCancelSaveMissing:c.cancelSaveMissing,onConfirmSaveMissing:c.confirmSaveMissing})]})}function Ye({fileName:t,onClose:r,children:l}){return e("div",{className:"flex flex-col h-full min-w-0","data-split-pane":"",children:[e("div",{className:"flex items-center justify-between gap-2 px-3 py-1 border-b border-ink/10 bg-canvas flex-shrink-0",children:[e("span",{className:"text-[11px] font-mono text-ink/60 truncate",title:t,children:t}),e("button",{type:"button",onClick:r,className:"p-0.5 rounded hover:bg-ink/10 text-ink/50 hover:text-ink transition-colors cursor-pointer flex-shrink-0",title:"Close this pane (the tab stays open)","aria-label":"Close split pane",children:e(h,{size:12})})]}),e("div",{className:"flex-1 min-h-0",children:l})]})}function Ze({fraction:t,onFraction:r,rightPaneName:l,onClosePane:d,rightPane:u,children:x}){let m=i(null),c=i(null),b=Of(c),k=(g)=>{let y=g.currentTarget,R=m.current;if(!y||!R)return;y.setPointerCapture(g.pointerId);let M=(L)=>{let D=R.getBoundingClientRect();if(D.width===0)return;r(Y((L.clientX-D.left)/D.width))},P=()=>{y.releasePointerCapture(g.pointerId),y.removeEventListener("pointermove",M),y.removeEventListener("pointerup",P)};y.addEventListener("pointermove",M),y.addEventListener("pointerup",P)};return e("div",{ref:m,className:"flex w-full h-full","data-split-column":"",children:[e("div",{className:"flex flex-col min-w-0 h-full",style:{width:`${Math.round(Y(t)*100)}%`},children:x}),e("div",{ref:c,className:`w-[3px] flex-shrink-0 cursor-col-resize transition-colors active:bg-ink/40 ${b?"bg-ink/40":"bg-ink/10"}`,role:"separator","aria-orientation":"vertical","aria-label":"Resize split panes",onPointerDown:k}),e("div",{className:"flex-1 min-w-0 h-full",children:e(Ye,{fileName:l,onClose:d,children:u})})]})}function Qe({openedFiles:t,activeFileId:r,enabled:l}){let[d,u]=T("editor.split",ee),x=t.map((y)=>y.id),m=Pe(De(d,x),r),c=l&&m.rightFileId!==null?t.find((y)=>y.id===m.rightFileId)??null:null,b=a((y)=>{if(y!==null&&!ne(y,r,x))return;u({...m,rightFileId:y})},[m,u,r,x]),k=a(()=>u({...m,rightFileId:null}),[m,u]),g=a((y)=>u({...m,fraction:Y(y)}),[m,u]);return{rightFile:c,fraction:m.fraction,splitTo:b,close:k,setFraction:g}}function je({find:t,runCommand:r,reopenClosed:l}){let d=i(t);d.current=t;let u=i(r);u.current=r;let x=i(l);return x.current=l,{onKeyDownCapture:a((c)=>{let b=d.current;if(c.key==="Escape"){if(!b.open)return;c.preventDefault(),c.stopPropagation(),b.close();return}if((c.metaKey||c.ctrlKey)&&c.shiftKey&&c.code==="KeyT"){if(x.current?.())c.preventDefault(),c.stopPropagation();return}let k=N0(Ni,c);if(!k||!eg(k))return;c.preventDefault(),c.stopPropagation(),u.current(k)},[])}}function et(t){let r=i(t);r.current=t;let l=i(null);if(!l.current)l.current={saveNow:()=>r.current.saveNow(),runCommand:(u)=>r.current.runCommand(u)};return o(()=>{let u=l.current;if(!u)return;return hA(u)},[]),{onFocusCapture:a(()=>{if(l.current)hA(l.current)},[])}}function nt({openedFiles:t,activeFileId:r,onSelectFile:l,onCloseFile:d,saveNow:u}){let[x,m]=n(null);_e();let c=a((k)=>{let g=t.find((y)=>y.id===k);if(g&&Ce(k)){m(g);return}d(k)},[t,d]),b=a((k)=>{let g=x;if(!g)return;if(k==="cancel"){m(null);return}if(k==="save"){if(g.id!==r)l(g.id);u()}m(null),d(g.id)},[x,r,l,u,d]);return{requestClose:c,pending:x,answer:b}}function ot(){let[t,r]=n(0),[l,d]=n(!1),u=a(()=>r((x)=>x+1),[]);return{goToLineRequest:t,openGoToLine:u,saveAsOpen:l,setSaveAsOpen:d}}var Ct=Se(()=>import("./Body-jfy4bhk2.js").then((t)=>({default:t.EditorBody})));function rt(t){return e(Me,{fallback:e("div",{className:"h-full w-full"}),children:e(Ct,{...t})})}function kt({className:t="",openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:u,onConvertDiffToEditor:x,refreshKey:m=0,onFileSaved:c,onOpenPath:b,onReopenClosed:k,reopenableCount:g,onCopyPath:y,onRevealInFiles:R,rootPath:M=null,repoPath:P=null,activeEditorPanelKey:L=null,forcedActiveFileId:D=null,asSplitPane:O=!1,onHidePanel:A}){let F=O?D:l,f=r.find((C)=>C.id===F),[Q,U,j]=T("editor.previewMode",{}),G=Du(String(F??"")),[v,w]=T("editor.zoomLevel",Oo),[S,q]=n(!1),[H,_]=T("editor.wordWrap",!0),J=ot(),{sessionId:le}=He(),B=Qe({openedFiles:r,activeFileId:F,enabled:!O}),W=i(null),it=Uo(),st=Li(),de=wu(r,m),ue=Boolean(f&&de.has(f.id)),N=Cu(f??null,{reportSaveError:!0,onFileSaved:c,missing:ue}),at=wA({path:f?.path??"",content:N.content,language:N.language}),lt=N.diskChange,pe=nt({openedFiles:r,activeFileId:F,onSelectFile:d,onCloseFile:u,saveNow:N.saveNow}),te=Eu({text:N.content,documentKey:`${f?.id??""}\x00${N.language}`,readSelection:()=>W.current?.getSelection()??null,select:(C,V,se=!0)=>W.current?.select(C,V,se),reveal:(C)=>W.current?.revealOffset(C),applyDocument:(C,V,se)=>W.current?.applyDocument(C,V,se),toggleWordWrap:()=>_((C)=>!C)}),ce=Bu(f?.path??null,N.content,N.loaded&&!N.loadError);Le({searchReveal:ce,revealMatch:te.revealMatch}),Iu({file:f,editor:N,surfaceRef:W,isPreview:f?Q[f.id]===!0:!1,exitPreview:()=>{let C=f?.id;if(C===void 0||C===null)return;U((V)=>({...V,[C]:!1}))}}),o(()=>{if(m>0)N.reset()},[m]),o(()=>{N.retain(r.map((C)=>C.id)),ye(r.map((C)=>C.id))},[r]),Be({openedFiles:r,dirtyKeys:N.dirtyKeys,activeFile:f,previewReady:j,setPreviewMode:U,sessionId:le});let dt=()=>{if(!f)return;U((C)=>({...C,[f.id]:!C[f.id]}))},oe=(C)=>{if(eg(C)){te.runCommand(C);return}if(C==="toggleWordWrap"){_((V)=>!V);return}if(C==="goToLine"){J.openGoToLine();return}W.current?.runCommand(C)},ut=je({find:te,runCommand:oe,reopenClosed:k}),pt=et({saveNow:N.saveNow,runCommand:oe}),re=H0(L);if(re)return e(Ae,{pluginId:re.pluginId,Component:re.Component,sessionId:le,className:t,onHide:A});if(r.length===0)return e(Fe,{className:t,onHide:A});let ct=N.viewerKind,me=f?Q[f.id]:!1,ft={activeFile:f,editor:N,find:te,surfaceRef:W,pluginFileView:at,wordWrap:H,setWordWrap:_,viewerKind:ct,isPreview:Boolean(me),isReviewing:Boolean(me)&&G.active,onToggleReview:G.toggle,isMaximized:S,setIsMaximized:q,zoomLevel:v,setZoomLevel:w,goToLineRequest:J.goToLineRequest,onSaveAs:()=>J.setSaveAsOpen(!0),onOpenPath:b,rootPath:M,repoPath:P,runCommand:oe,editorFontFamily:it,editorTheme:st,togglePreview:dt,revealActive:Boolean(ce),missing:ue,onConvertDiffToEditor:x,onFileSaved:c},bt=(C)=>({openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:u,onConvertDiffToEditor:x,refreshKey:m,onFileSaved:c,onOpenPath:b,rootPath:M,repoPath:P,forcedActiveFileId:C,asSplitPane:!0}),gt=e(Ie,{openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:pe.requestClose,missingIds:de,onCopyPath:y,onRevealInFiles:R,onReopenClosed:k,reopenableCount:g,onSplitTo:B.splitTo,onUnsplit:B.close,splitRightFileId:B.rightFile?.id??null,onHide:A}),fe=e(Je,{className:t,isMaximized:S,onKeyDownCapture:ut.onKeyDownCapture,onFocusCapture:pt.onFocusCapture,asSplitPane:O,tabs:gt,activeFile:f,editor:N,externalChange:lt,conflict:N.conflict,onReload:N.resolveConflictByReload,onKeepMine:N.keepMineAgainstDisk,body:e(rt,{...ft}),saveAsOpen:J.saveAsOpen,onSaveAsClose:()=>J.setSaveAsOpen(!1),onSavedAs:(C)=>{J.setSaveAsOpen(!1),b?.(C)},closeGuard:pe});if(!B.rightFile)return fe;return e(Ze,{fraction:B.fraction,onFraction:B.setFraction,rightPaneName:B.rightFile.name,onClosePane:B.close,rightPane:e(kt,{...bt(B.rightFile.id)}),children:fe})}export{kt as Editor};
|
|
1
|
+
import{n,o,K,i,a,ze,Me,Se,ie,e,s,p,I,E,Xe,bi,ir,h,sr,He,we,T,tt,wi,he,X,mt,Oo,Uo,N0,H0,Of,Jo,Ni,eg,hA}from"./index-st6a8q5z.js";import"./index-ewst55j2.js";import{Li}from"./index-7trfm17d.js";import"./index-e4yj4kbe.js";import{wA,xu,Fs,wu,Cu,Eu,Bu,Iu,_u,Su,Tu,Du}from"./index-9gfn1a3h.js";var vt={name:"panel-right-close",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]},be=s(vt);var z=new Set,ae=new Set,ge=new Set;function ve(){ge=new Set(z);for(let t of[...ae])t()}function xe(t){let r=new Set(t);if(r.size===z.size){let l=!0;for(let d of r)if(!z.has(d)){l=!1;break}if(l)return}z.clear();for(let l of r)z.add(l);ve()}function ye(t){let r=new Set(t),l=!1;for(let d of[...z])if(!r.has(d))z.delete(d),l=!0;if(l)ve()}function Ce(t){return z.has(t)}function ke(){return z.size>0}function ht(t){return ae.add(t),()=>{ae.delete(t)}}var xt=ht;function Ee(){return ze(xt,()=>ge)}function Te({x:t,y:r,rows:l,onAction:d,onClose:u}){let x=i(null),[m,c]=n({left:t,top:r});return K(()=>{let b=x.current;if(!b)return;let{width:k,height:g}=b.getBoundingClientRect();c({left:Math.min(t,Math.max(0,window.innerWidth-k-8)),top:Math.min(r,Math.max(0,window.innerHeight-g-8))})},[t,r,l.length]),ie(e("div",{className:"fixed inset-0 z-[70]",onClick:u,onContextMenu:(b)=>{b.preventDefault(),u()},children:e("div",{ref:x,role:"menu","aria-label":"Tab actions",className:"glass-popover absolute w-52 bg-paper border border-ink/15 rounded-md shadow-xl py-1 text-xs text-ink",style:{left:`${m.left}px`,top:`${m.top}px`},onClick:(b)=>b.stopPropagation(),children:l.map((b)=>e("button",{type:"button",role:"menuitem",onClick:()=>{d(b.action),u()},className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 transition-colors cursor-pointer",children:b.label},b.action))})}),document.body)}var ee={rightFileId:null,fraction:0.5};function ne(t,r,l){if(t===null)return!1;if(t===r)return!1;return l.includes(t)}function Ne(t,r){for(let l=r.length-1;l>=0;l-=1){let d=r[l];if(d!==t)return d}return null}function Pe(t,r){if(t.rightFileId===null)return t;if(t.rightFileId!==r)return t;return{...t,rightFileId:null}}function Y(t){if(!Number.isFinite(t))return ee.fraction;return Math.max(0.2,Math.min(0.8,t))}function De(t,r){if(typeof t!=="object"||t===null)return ee;let l=t,d=typeof l.fraction==="number"?Y(l.fraction):ee.fraction,u=typeof l.rightFileId==="string"||typeof l.rightFileId==="number"?l.rightFileId:null;if(u===null||!r.includes(u))return{rightFileId:null,fraction:d};return{rightFileId:u,fraction:d}}function Re({tab:t,openedFiles:r,dirtyIds:l,reopenable:d,activeFileId:u,splitRightFileId:x}){let m=r.filter((g)=>g.id!==t.id),c=r.filter((g)=>!l.has(g.id)),b=r.map((g)=>g.id);return[{action:"split-right",label:"Split right",enabled:ne(t.id,u,b)},{action:"unsplit",label:"Unsplit",enabled:x!==null},{action:"close",label:"Close",enabled:!0},{action:"close-others",label:"Close others",enabled:m.length>0},{action:"close-all",label:"Close all",enabled:r.length>0},{action:"close-saved",label:"Close saved",enabled:c.some((g)=>g.id!==t.id)},{action:"copy-path",label:"Copy path",enabled:Boolean(t.path)},{action:"reveal-in-files",label:"Reveal in Files",enabled:Boolean(t.path)&&!t.isDiff},{action:"reopen-closed",label:"Reopen closed tab",enabled:d>0}].filter((g)=>g.enabled)}function Z({onHide:t}){let r=Jo("toggleEditorPanel","Hide Editor Panel");return e("button",{type:"button",onClick:t,className:"p-1.5 mx-1 rounded transition-colors cursor-pointer text-ink/60 hover:bg-ink/10 hover:text-ink flex-shrink-0",title:r,"aria-label":r,children:e(be,{size:14})})}function Ie({openedFiles:t,activeFileId:r,onSelectFile:l,onCloseFile:d,missingIds:u,onCopyPath:x,onRevealInFiles:m,onReopenClosed:c,reopenableCount:b,onSplitTo:k,onUnsplit:g,splitRightFileId:y=null,onHide:R}){let M=Ee(),P=i(null),L=i(null),[D,O]=n(5),[A,F]=n(!1),[f,Q]=n(null);he(L,()=>F(!1)),o(()=>{let v=new ResizeObserver((w)=>{for(let S of w){let q=S.contentRect.width,H=Math.max(1,Math.floor((q-60)/150));O(H)}});if(P.current)v.observe(P.current);return()=>v.disconnect()},[]);let U=Ne(r,t.map((v)=>v.id)),j=[],G=[];if(t.length<=D)j=t;else{let v=t.findIndex((S)=>S.id===r),w=new Set;if(v!==-1&&r!==null)w.add(r);for(let S=t.length-1;S>=0;S--){if(w.size>=D)break;w.add(t[S].id)}j=t.filter((S)=>w.has(S.id)),G=t.filter((S)=>!w.has(S.id))}return e("div",{className:`${wi.desktop} flex bg-ink/10 w-full relative border-b border-ink/10`,ref:P,children:[e("div",{className:"flex overflow-hidden",children:j.map((v)=>{let w=v.id===r,S=Boolean(v.isDiff),q=S?sr(v.diffStatus||"M",v.diffStaged):null,H=Boolean(u?.has(v.id));return e("div",{onClick:()=>l(v.id),onContextMenu:(_)=>{_.preventDefault(),Q({tab:v,x:_.clientX,y:_.clientY})},className:`flex items-center space-x-1.5 px-3 py-1.5 cursor-pointer border-r border-ink/10 min-w-[120px] max-w-[210px] group ${w?"bg-paper border-t-2 border-t-ink text-ink":"bg-transparent border-t-2 border-t-transparent text-ink/60 hover:bg-paper/50"}`,title:H?`${v.path} — file no longer exists`:v.path,children:[S?e(bi,{size:14,className:w?"text-info flex-shrink-0":"text-info/70 flex-shrink-0"}):e(mt,{name:v.name,size:14,className:`flex-shrink-0${w||H?"":" opacity-60"}${H?" text-error":""}`}),e("span",{className:`text-xs font-mono truncate flex-1${H?" text-error line-through":""}`,children:v.name}),q&&e("span",{className:`px-1 text-[10px] font-mono font-bold rounded ${q.badgeBgClass}`,children:q.charStatus}),e(Oe,{dirty:M.has(v.id),active:w,label:`Close ${v.name}`,onClose:()=>d(v.id)})]},v.id)})}),f?e(Te,{x:f.x,y:f.y,rows:Re({tab:f.tab,openedFiles:t,dirtyIds:M,reopenable:b?.()??0,activeFileId:r,splitRightFileId:y}),onAction:(v)=>{let w=f.tab;switch(v){case"close":d(w.id);return;case"close-others":for(let S of[...t].reverse())if(S.id!==w.id)d(S.id);l(w.id);return;case"close-all":for(let S of[...t].reverse())d(S.id);return;case"close-saved":for(let S of[...t].reverse())if(!M.has(S.id))d(S.id);return;case"copy-path":x?.(w);return;case"reveal-in-files":m?.(w);return;case"reopen-closed":c?.();return;case"split-right":k?.(w.id);return;case"unsplit":g?.();return}},onClose:()=>Q(null)}):null,e("div",{className:"ml-auto flex items-center",children:[e("button",{type:"button",onClick:()=>y!==null?g?.():k?.(U),disabled:y===null&&U===null,"aria-pressed":y!==null,"aria-label":"Split editor",title:y!==null?"Close the split pane (the tab stays open)":U===null?"Open another file to split the editor":"Split the editor and show the newest other file",className:`p-1.5 mx-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default ${y!==null?"bg-ink/10 text-ink":"text-ink/60 hover:bg-ink/10"}`,children:e(ir,{size:14})}),R&&e(Z,{onHide:R})]}),G.length>0&&e("div",{className:"relative flex items-center bg-ink/10",ref:L,children:[e("button",{className:`p-1.5 mx-1 rounded hover:bg-ink/10 text-ink/60 ${A?"bg-ink/10 text-ink":""}`,onClick:()=>F(!A),title:"More open files",children:e(E,{size:14})}),A&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-52 bg-paper border border-ink/10 rounded shadow-lg z-50 py-1",children:[e("div",{className:"px-3 py-1 text-[10px] uppercase font-mono text-ink/40 border-b border-ink/10 mb-1",children:"Older Tabs"}),G.map((v)=>{let w=Boolean(u?.has(v.id));return e("div",{onClick:()=>{l(v.id),F(!1)},className:"flex items-center space-x-2 px-3 py-1.5 hover:bg-ink/5 cursor-pointer group",children:[v.isDiff?e(bi,{size:14,className:"text-info/80"}):e(mt,{name:v.name,size:14,className:w?"text-error":"opacity-60"}),e("span",{className:`text-xs font-mono truncate flex-1 ${w?"text-error line-through":"text-ink/80"}`,children:v.name}),e(Oe,{dirty:M.has(v.id),active:!1,label:`Close ${v.name}`,onClose:()=>{if(d(v.id),G.length===1)F(!1)}})]},v.id)})]})]})]})}function Oe({dirty:t,active:r,label:l,onClose:d}){return e("div",{role:"button",tabIndex:-1,"aria-label":l,title:t?`${l} — unsaved changes`:l,className:`p-0.5 rounded hover:bg-ink/10 touch-visible ${r||t?"opacity-100":"opacity-0 group-hover:opacity-100"}`,onClick:(u)=>{u.stopPropagation(),d()},children:t?e("span",{className:"block w-2 h-2 rounded-full bg-current mx-0.5","data-tab-dirty":"","aria-hidden":"true"}):e(h,{size:12})})}function Ae({pluginId:t,Component:r,sessionId:l,className:d="",onHide:u}){return e("div",{className:`flex flex-col h-full bg-canvas ${d}`,children:[u&&e("div",{className:"flex justify-end flex-shrink-0 border-b border-ink/10",children:e(Z,{onHide:u})}),e(tt,{pluginId:t,children:e(r,{sessionId:l,workspacePath:null})})]})}function Fe({className:t="",onHide:r}){return e("div",{className:`relative flex flex-col h-full bg-canvas items-center justify-center text-muted ${t}`,children:[r&&e("div",{className:"absolute top-0 right-0 flex items-center",children:e(Z,{onHide:r})}),e(mt,{name:"placeholder.txt",size:48,className:"mb-4 opacity-20"}),e("p",{className:"font-mono text-sm",children:"Select a file to open"})]})}function Le({searchReveal:t,revealMatch:r}){let l=i(r);l.current=r;let d=i(null);o(()=>{if(!t||d.current===t.request)return;d.current=t.request,l.current({query:t.request.query,options:t.request.options,line:t.request.line})},[t])}function Be({openedFiles:t,dirtyKeys:r,activeFile:l,previewReady:d,setPreviewMode:u,sessionId:x}){o(()=>{let m=new Set(t.filter((c)=>!c.isDiff&&c.content===void 0).map((c)=>c.id));xe([...r].filter((c)=>m.has(c)))},[r,t]),o(()=>{if(!d)return;let m=l?.id;if(!l||m===void 0||m===null)return;if(!xu(Fs(l.name)))return;let c=we(x,"editor.previewMode");if(c&&c[m]!==void 0)return;u((b)=>b[m]===void 0?{...b,[m]:!0}:b)},[d,l])}function Ke({activeFile:t,externalChange:r,conflict:l,onReload:d,onKeepMine:u}){if(!t)return null;if(l)return e(Su,{diskMtimeMs:l.diskMtimeMs,fileName:t.name,onReload:d,onKeepMine:u});if(r)return e(_u,{fileName:t.name,onReload:d,onKeepMine:u});return null}async function $e(t){let r=t.name.trim();if(!r)return{status:"failed",reason:"Enter a file name."};let l=new FormData;if(l.append("actionType","saveAs"),l.append("path",t.parent),l.append("name",r),l.append("content",t.content),l.append("eol",t.eol),t.root)l.append("root",t.root);if(t.repo&&t.repo!==".")l.append("repo",t.repo);try{let d=await fetch("/api/fs/action",{method:"POST",body:l}),u=await d.json().catch(()=>null),x=typeof u?.error==="string"?u.error:null;if(d.status===409)return{status:"exists",reason:x??`${r} already exists.`};if(d.ok&&u?.success&&typeof u.path==="string")return{status:"written",path:u.path};return{status:"failed",reason:x??"The file could not be written."}}catch{return{status:"failed",reason:"The file could not be written."}}}function Ue(t){let r=t.lastIndexOf(".");if(r<=0)return`${t} copy`;return`${t.slice(0,r)} copy${t.slice(r)}`}function Ge(t){let r=t.trim();if(!r)return!1;if(r==="."||r==="..")return!1;return!r.includes("/")&&!r.includes("\\")}function yt(t){let r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function qe({fileName:t,filePath:r,content:l,eol:d,root:u,repo:x,onSaved:m,onClose:c}){let[b,k]=n(()=>yt(r)),[g,y]=n(()=>Ue(t)),[R,M]=n(!1),[P,L]=n(null),D=i(null);o(()=>{D.current?.focus(),D.current?.select()},[]);let O=Ge(g),A=async()=>{if(!O||R)return;M(!0),L(null);let f=await $e({parent:b,name:g,content:l,eol:d,root:u,repo:x});if(M(!1),f.status==="written"){m({path:f.path});return}L(f.reason)},F=(f)=>{if(f.key==="Enter"){f.preventDefault(),A();return}if(f.key==="Escape")f.preventDefault(),c()};return e(X,{onClose:c,maxWidthClass:"max-w-md",header:e("span",{className:"text-sm font-semibold text-ink",children:"Save as"}),footer:e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:c,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),e("button",{type:"button",onClick:()=>void A(),disabled:!O||R,className:"flex items-center gap-1.5 px-3 py-1.5 rounded bg-ink text-paper disabled:opacity-40 disabled:cursor-default cursor-pointer",children:[R?e(p,{size:12,className:"animate-spin"}):e(Xe,{size:12}),"Save"]})]}),children:e("div",{className:"px-4 py-3 space-y-2 text-xs",children:[e("label",{className:"block",children:[e("span",{className:"block text-[10px] uppercase tracking-wide text-ink/50 mb-1",children:"Folder"}),e("input",{value:b,onInput:(f)=>k(f.target.value),onKeyDown:F,placeholder:"(workspace root)","aria-label":"Destination folder",className:"w-full bg-paper border border-ink/20 rounded px-2 py-1 font-mono text-ink outline-none focus:border-ink/40"})]}),e("label",{className:"block",children:[e("span",{className:"block text-[10px] uppercase tracking-wide text-ink/50 mb-1",children:"Name"}),e("input",{ref:D,value:g,onInput:(f)=>y(f.target.value),onKeyDown:F,"aria-label":"File name","aria-invalid":!O,className:`w-full bg-paper border rounded px-2 py-1 font-mono text-ink outline-none ${O?"border-ink/20 focus:border-ink/40":"border-error text-error"}`})]}),!O?e("div",{className:"text-[10px] text-error font-mono",children:"Enter a file name without a path separator"}):null,P?e("div",{className:"text-[10px] text-error font-mono",children:P}):null,e("div",{className:"text-[10px] text-ink/40",children:"The original file stays where it is, and its tab stays open."})]})})}function _e(){o(()=>{let t=(r)=>{if(!ke())return;r.preventDefault(),r.returnValue=""};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[])}function We({fileName:t,onAnswer:r}){return e(X,{onClose:()=>r("cancel"),header:e("div",{className:"flex items-center gap-2",children:[e(I,{size:15,className:"text-warning"}),e("span",{className:"text-sm font-semibold text-ink",children:"Unsaved changes"})]}),footer:e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:()=>r("cancel"),className:"px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),e("button",{type:"button",onClick:()=>r("discard"),className:"px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer",children:"Discard"}),e("button",{type:"button",onClick:()=>r("save"),className:"px-3 py-1.5 rounded bg-ink text-paper hover:bg-ink/90 transition-colors cursor-pointer",children:"Save & close"})]}),children:e("div",{className:"px-4 py-3 text-xs text-ink/80",children:[e("span",{className:"font-mono text-ink",children:t})," has changes that are not on disk.",e("div",{className:"mt-1 text-ink/50",children:"Discarding them cannot be undone."})]})})}function Ve({closeGuard:t,activeFile:r,saveMissingConfirm:l,onCancelSaveMissing:d,onConfirmSaveMissing:u}){if(t.pending)return e(We,{fileName:t.pending.name,onAnswer:t.answer});if(l&&r)return e(Tu,{fileName:r.name,filePath:r.path,onClose:d,onConfirm:u});return null}function Je({className:t="",isMaximized:r,onKeyDownCapture:l,onFocusCapture:d,asSplitPane:u,tabs:x,activeFile:m,editor:c,externalChange:b,conflict:k,onReload:g,onKeepMine:y,body:R,saveAsOpen:M,onSaveAsClose:P,onSavedAs:L,closeGuard:D}){let O=r?"fixed inset-0 z-50 flex flex-col bg-canvas":`flex flex-col h-full bg-canvas ${t}`;return e("div",{className:O,onKeyDownCapture:l,onFocusCapture:d,children:[u?null:x,e(Ke,{activeFile:m,externalChange:b,conflict:k,onReload:g,onKeepMine:y}),R,M&&m?e(qe,{fileName:m.name,filePath:m.path,content:c.content,eol:c.eol,root:m.root,repo:m.repo,onSaved:({path:A})=>L(A),onClose:P}):null,e(Ve,{closeGuard:D,activeFile:m,saveMissingConfirm:c.saveMissingConfirm,onCancelSaveMissing:c.cancelSaveMissing,onConfirmSaveMissing:c.confirmSaveMissing})]})}function Ye({fileName:t,onClose:r,children:l}){return e("div",{className:"flex flex-col h-full min-w-0","data-split-pane":"",children:[e("div",{className:"flex items-center justify-between gap-2 px-3 py-1 border-b border-ink/10 bg-canvas flex-shrink-0",children:[e("span",{className:"text-[11px] font-mono text-ink/60 truncate",title:t,children:t}),e("button",{type:"button",onClick:r,className:"p-0.5 rounded hover:bg-ink/10 text-ink/50 hover:text-ink transition-colors cursor-pointer flex-shrink-0",title:"Close this pane (the tab stays open)","aria-label":"Close split pane",children:e(h,{size:12})})]}),e("div",{className:"flex-1 min-h-0",children:l})]})}function Ze({fraction:t,onFraction:r,rightPaneName:l,onClosePane:d,rightPane:u,children:x}){let m=i(null),c=i(null),b=Of(c),k=(g)=>{let y=g.currentTarget,R=m.current;if(!y||!R)return;y.setPointerCapture(g.pointerId);let M=(L)=>{let D=R.getBoundingClientRect();if(D.width===0)return;r(Y((L.clientX-D.left)/D.width))},P=()=>{y.releasePointerCapture(g.pointerId),y.removeEventListener("pointermove",M),y.removeEventListener("pointerup",P)};y.addEventListener("pointermove",M),y.addEventListener("pointerup",P)};return e("div",{ref:m,className:"flex w-full h-full","data-split-column":"",children:[e("div",{className:"flex flex-col min-w-0 h-full",style:{width:`${Math.round(Y(t)*100)}%`},children:x}),e("div",{ref:c,className:`w-[3px] flex-shrink-0 cursor-col-resize transition-colors active:bg-ink/40 ${b?"bg-ink/40":"bg-ink/10"}`,role:"separator","aria-orientation":"vertical","aria-label":"Resize split panes",onPointerDown:k}),e("div",{className:"flex-1 min-w-0 h-full",children:e(Ye,{fileName:l,onClose:d,children:u})})]})}function Qe({openedFiles:t,activeFileId:r,enabled:l}){let[d,u]=T("editor.split",ee),x=t.map((y)=>y.id),m=Pe(De(d,x),r),c=l&&m.rightFileId!==null?t.find((y)=>y.id===m.rightFileId)??null:null,b=a((y)=>{if(y!==null&&!ne(y,r,x))return;u({...m,rightFileId:y})},[m,u,r,x]),k=a(()=>u({...m,rightFileId:null}),[m,u]),g=a((y)=>u({...m,fraction:Y(y)}),[m,u]);return{rightFile:c,fraction:m.fraction,splitTo:b,close:k,setFraction:g}}function je({find:t,runCommand:r,reopenClosed:l}){let d=i(t);d.current=t;let u=i(r);u.current=r;let x=i(l);return x.current=l,{onKeyDownCapture:a((c)=>{let b=d.current;if(c.key==="Escape"){if(!b.open)return;c.preventDefault(),c.stopPropagation(),b.close();return}if((c.metaKey||c.ctrlKey)&&c.shiftKey&&c.code==="KeyT"){if(x.current?.())c.preventDefault(),c.stopPropagation();return}let k=N0(Ni,c);if(!k||!eg(k))return;c.preventDefault(),c.stopPropagation(),u.current(k)},[])}}function et(t){let r=i(t);r.current=t;let l=i(null);if(!l.current)l.current={saveNow:()=>r.current.saveNow(),runCommand:(u)=>r.current.runCommand(u)};return o(()=>{let u=l.current;if(!u)return;return hA(u)},[]),{onFocusCapture:a(()=>{if(l.current)hA(l.current)},[])}}function nt({openedFiles:t,activeFileId:r,onSelectFile:l,onCloseFile:d,saveNow:u}){let[x,m]=n(null);_e();let c=a((k)=>{let g=t.find((y)=>y.id===k);if(g&&Ce(k)){m(g);return}d(k)},[t,d]),b=a((k)=>{let g=x;if(!g)return;if(k==="cancel"){m(null);return}if(k==="save"){if(g.id!==r)l(g.id);u()}m(null),d(g.id)},[x,r,l,u,d]);return{requestClose:c,pending:x,answer:b}}function ot(){let[t,r]=n(0),[l,d]=n(!1),u=a(()=>r((x)=>x+1),[]);return{goToLineRequest:t,openGoToLine:u,saveAsOpen:l,setSaveAsOpen:d}}var Ct=Se(()=>import("./Body-p6zwk0nx.js").then((t)=>({default:t.EditorBody})));function rt(t){return e(Me,{fallback:e("div",{className:"h-full w-full"}),children:e(Ct,{...t})})}function kt({className:t="",openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:u,onConvertDiffToEditor:x,refreshKey:m=0,onFileSaved:c,onOpenPath:b,onReopenClosed:k,reopenableCount:g,onCopyPath:y,onRevealInFiles:R,rootPath:M=null,repoPath:P=null,activeEditorPanelKey:L=null,forcedActiveFileId:D=null,asSplitPane:O=!1,onHidePanel:A}){let F=O?D:l,f=r.find((C)=>C.id===F),[Q,U,j]=T("editor.previewMode",{}),G=Du(String(F??"")),[v,w]=T("editor.zoomLevel",Oo),[S,q]=n(!1),[H,_]=T("editor.wordWrap",!0),J=ot(),{sessionId:le}=He(),B=Qe({openedFiles:r,activeFileId:F,enabled:!O}),W=i(null),it=Uo(),st=Li(),de=wu(r,m),ue=Boolean(f&&de.has(f.id)),N=Cu(f??null,{reportSaveError:!0,onFileSaved:c,missing:ue}),at=wA({path:f?.path??"",content:N.content,language:N.language}),lt=N.diskChange,pe=nt({openedFiles:r,activeFileId:F,onSelectFile:d,onCloseFile:u,saveNow:N.saveNow}),te=Eu({text:N.content,documentKey:`${f?.id??""}\x00${N.language}`,readSelection:()=>W.current?.getSelection()??null,select:(C,V,se=!0)=>W.current?.select(C,V,se),reveal:(C)=>W.current?.revealOffset(C),applyDocument:(C,V,se)=>W.current?.applyDocument(C,V,se),toggleWordWrap:()=>_((C)=>!C)}),ce=Bu(f?.path??null,N.content,N.loaded&&!N.loadError);Le({searchReveal:ce,revealMatch:te.revealMatch}),Iu({file:f,editor:N,surfaceRef:W,isPreview:f?Q[f.id]===!0:!1,exitPreview:()=>{let C=f?.id;if(C===void 0||C===null)return;U((V)=>({...V,[C]:!1}))}}),o(()=>{if(m>0)N.reset()},[m]),o(()=>{N.retain(r.map((C)=>C.id)),ye(r.map((C)=>C.id))},[r]),Be({openedFiles:r,dirtyKeys:N.dirtyKeys,activeFile:f,previewReady:j,setPreviewMode:U,sessionId:le});let dt=()=>{if(!f)return;U((C)=>({...C,[f.id]:!C[f.id]}))},oe=(C)=>{if(eg(C)){te.runCommand(C);return}if(C==="toggleWordWrap"){_((V)=>!V);return}if(C==="goToLine"){J.openGoToLine();return}W.current?.runCommand(C)},ut=je({find:te,runCommand:oe,reopenClosed:k}),pt=et({saveNow:N.saveNow,runCommand:oe}),re=H0(L);if(re)return e(Ae,{pluginId:re.pluginId,Component:re.Component,sessionId:le,className:t,onHide:A});if(r.length===0)return e(Fe,{className:t,onHide:A});let ct=N.viewerKind,me=f?Q[f.id]:!1,ft={activeFile:f,editor:N,find:te,surfaceRef:W,pluginFileView:at,wordWrap:H,setWordWrap:_,viewerKind:ct,isPreview:Boolean(me),isReviewing:Boolean(me)&&G.active,onToggleReview:G.toggle,isMaximized:S,setIsMaximized:q,zoomLevel:v,setZoomLevel:w,goToLineRequest:J.goToLineRequest,onSaveAs:()=>J.setSaveAsOpen(!0),onOpenPath:b,rootPath:M,repoPath:P,runCommand:oe,editorFontFamily:it,editorTheme:st,togglePreview:dt,revealActive:Boolean(ce),missing:ue,onConvertDiffToEditor:x,onFileSaved:c},bt=(C)=>({openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:u,onConvertDiffToEditor:x,refreshKey:m,onFileSaved:c,onOpenPath:b,rootPath:M,repoPath:P,forcedActiveFileId:C,asSplitPane:!0}),gt=e(Ie,{openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:pe.requestClose,missingIds:de,onCopyPath:y,onRevealInFiles:R,onReopenClosed:k,reopenableCount:g,onSplitTo:B.splitTo,onUnsplit:B.close,splitRightFileId:B.rightFile?.id??null,onHide:A}),fe=e(Je,{className:t,isMaximized:S,onKeyDownCapture:ut.onKeyDownCapture,onFocusCapture:pt.onFocusCapture,asSplitPane:O,tabs:gt,activeFile:f,editor:N,externalChange:lt,conflict:N.conflict,onReload:N.resolveConflictByReload,onKeepMine:N.keepMineAgainstDisk,body:e(rt,{...ft}),saveAsOpen:J.saveAsOpen,onSaveAsClose:()=>J.setSaveAsOpen(!1),onSavedAs:(C)=>{J.setSaveAsOpen(!1),b?.(C)},closeGuard:pe});if(!B.rightFile)return fe;return e(Ze,{fraction:B.fraction,onFraction:B.setFraction,rightPaneName:B.rightFile.name,onClosePane:B.close,rightPane:e(kt,{...bt(B.rightFile.id)}),children:fe})}export{kt as Editor};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n,o,i,u,a,e,s,Nr,Rr,oo,oa,la}from"./index-qrwjxqdh.js";import{to,wd,Cd,pl}from"./index-4dzvjfkd.js";var Le={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]},M=s(Le);var Ee={name:"blocks",size:24,node:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]},I=s(Ee);var ze={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]},D=s(ze);var Ze={name:"component",size:24,node:[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]]},T=s(Ze);var Oe={name:"heading",size:24,node:[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]},N=s(Oe);var ve={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]},C=s(ve);var Ue={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]},q=s(Ue);var Me={name:"variable",size:24,node:[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]},P=s(Me);var Ie=450,K=8,De=700;function yd({enabled:c,onLongPress:l}){let r=i(null),p=i(null),t=i(0),m=i(l);m.current=l;let d=a(()=>{if(r.current!==null)clearTimeout(r.current),r.current=null;p.current=null},[]);return o(()=>d,[d]),{onTouchStart:(h)=>{if(!c)return;let k=h.touches[0];if(!k)return;d(),p.current={x:k.clientX,y:k.clientY},r.current=setTimeout(()=>{r.current=null;let f=p.current;if(p.current=null,!f)return;t.current=Date.now(),m.current(f.x,f.y)},Ie)},onTouchMove:(h)=>{let k=p.current,f=h.touches[0];if(!k||!f)return;if(Math.abs(f.clientX-k.x)>K||Math.abs(f.clientY-k.y)>K)d()},onTouchEnd:d,onTouchCancel:d,consume:()=>{if(t.current===0)return!1;let h=Date.now()-t.current<De;return t.current=0,h}}}var H={class:{Icon:Rr,label:"Class"},interface:{Icon:pl,label:"Interface"},type:{Icon:la,label:"Type"},enum:{Icon:oa,label:"Enum"},function:{Icon:M,label:"Function"},method:{Icon:T,label:"Method"},constant:{Icon:oo,label:"Constant"},variable:{Icon:P,label:"Variable"},struct:{Icon:D,label:"Struct"},trait:{Icon:Cd,label:"Trait"},impl:{Icon:I,label:"Impl"},module:{Icon:wd,label:"Module"},heading:{Icon:N,label:"Heading"},selector:{Icon:C,label:"Selector"},key:{Icon:to,label:"Key"},tag:{Icon:q,label:"Tag"},macro:{Icon:Nr,label:"Macro"}};function vd({kind:c,size:l=12}){let{Icon:r}=H[c];return e(r,{size:l,className:"flex-shrink-0 text-ink/45",strokeWidth:1.8})}function di(c){return H[c].label}var Te={c:{line:["//"],block:["/*","*/"],quotes:["'",'"'],template:!0},css:{line:[],block:["/*","*/"],quotes:["'",'"']},python:{line:["#"],quotes:["'",'"'],triple:!0},hash:{line:["#"],quotes:["'",'"']},dash:{line:["--"],quotes:["'",'"']},lua:{line:["--"],block:["--[[","]]"],quotes:["'",'"']},sql:{line:["--"],block:["/*","*/"],quotes:["'",'"']},ml:{line:[],block:["(*","*)"],quotes:['"']},hcl:{line:["#","//"],block:["/*","*/"],quotes:[]},percent:{line:["%"],quotes:["'",'"']},lisp:{line:[";"],block:["#|","|#"],quotes:['"']},none:{line:[],quotes:['"',"'"]},raw:{line:[],quotes:[]}};function A(c,l){let r=Te[l],[p,t]=r.block??["",""],m=[],d="code",h="";for(let k of c){let f="";for(let b=0;b<k.length;b+=1){let y=k[b],g=k[b+1];if(d==="line"){f+=" ";continue}if(d==="block"){if(t&&y===t[0]&&k.startsWith(t,b)){d="code",f+=" ".repeat(t.length),b+=t.length-1;continue}f+=" ";continue}if(d==="quoted"||d==="template"||d==="triple"){if(y==="\\"){f+=" ",b+=1;continue}if(d==="triple"){if(y===h&&k.startsWith(h.repeat(3),b)){d="code",f+=" ",b+=2;continue}f+=" ";continue}if(f+=" ",y===h)d="code";continue}let S=r.line.find((Ae)=>k.startsWith(Ae,b));if(S){d="line",f+=" ".repeat(S.length),b+=S.length-1;continue}if(p&&k.startsWith(p,b)){d="block",f+=" ".repeat(p.length),b+=p.length-1;continue}if(r.triple&&y===(g??"")&&y===k[b+2]&&(y==="'"||y==='"')){d="triple",h=y,f+=" ",b+=2;continue}if(r.template&&y==="`"){d="template",h="`",f+=" ";continue}if(r.quotes?.includes(y)){d="quoted",h=y,f+=" ";continue}f+=y}if(d==="line"||d==="quoted")d="code";m.push(f)}return m}function Z(c){let l=0;for(let r of c)if(r==="{")l+=1;else if(r==="}")l-=1;return l}var L=[{kind:"class",re:/^(?:export\s+)?(?:default\s+)?(?:abstract\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:export\s+)?(?:declare\s+)?(?:const\s+)?enum\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d},{kind:"constant",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*[:=]/d}],$e=/^(?:(?:public|private|protected|static|async|readonly|override|abstract|declare|get|set)\s+)*(?:\*|#)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d,Ne=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d,Ce=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d,E=[{kind:"method",re:$e},{kind:"method",re:Ne},{kind:"variable",re:Ce}];function B(c,l){let r=A(c,l.mask),p=[],t=0,m=[];for(let d=0;d<r.length;d+=1){let h=r[d].trim(),k=m.length>0&&t===m[m.length-1].depth?m[m.length-1]:null;if(h&&(t===0||k)){let f=r[d].length-r[d].trimStart().length,b=k&&l.members?Ke(l.memberRules??[],h):null;if(b)p.push({name:b.name,kind:b.kind,line:d+1,column:f+b.column+1,depth:1});else{let y=k!==null&&qe.has(k.kind),g=O(l.rules,h,y);if(g){if(p.push({name:g.name,kind:y&&g.kind==="function"?"method":g.kind,line:d+1,column:f+g.column+1,depth:k?1:0}),!y&&(l.scopes??[]).includes(g.kind))m.push({depth:t+1,kind:g.kind})}}}if(t+=Z(r[d]),t<=0)t=0,m.length=0;else while(m.length>0&&t<m[m.length-1].depth)m.pop()}return p}var qe=new Set(["class","interface","struct","trait","impl","enum"]);function O(c,l,r){for(let p of c){if(r&&Pe.has(p.kind))continue;let t=p.re.exec(l),m=t?.[1]?.trim();if(!t||!m)continue;return{name:m,kind:p.kind,column:t.indices?.[1]?.[0]??0}}return null}var Pe=new Set(["class","interface","enum","type","struct","trait","impl","module"]);function Ke(c,l){for(let r of c){let p=r.re.exec(l),t=p?.[1]?.trim();if(!p||!t||He.has(t))continue;return{name:t,kind:r.kind,column:p.indices?.[1]?.[0]??0}}return null}var He=new Set(["if","for","while","switch","catch","return","throw","new","typeof","await","yield","super","this","delete","void","function","constructor","else","do","try","with"]);function j(c,l){let r=A(c,l.mask),p=[],t=[];for(let m=0;m<r.length;m+=1){let d=r[m],h=d.trim();if(!h)continue;let k=d.length-d.trimStart().length;while(t.length>0&&k<=t[t.length-1])t.pop();let f=O(l.rules,h,!1);if(!f)continue;if(t.length>1){t.push(k);continue}let b=t.length===1;p.push({name:f.name,kind:b&&f.kind==="function"?"method":f.kind,line:m+1,column:k+f.column+1,depth:b?1:0}),t.push(k)}return p}function F(c,l){let r=A(c,l.mask),p=[];for(let t=0;t<r.length;t+=1){let m=r[t],d=m.trim();if(!d)continue;let h=O(l.rules,d,!1);if(!h)continue;let k=p[p.length-1];if(l.dedupe&&k&&k.name===h.name&&k.kind===h.kind)continue;p.push({name:h.name,kind:h.kind,line:t+1,column:m.length-m.trimStart().length+h.column+1,depth:0})}return p}function W(c){let l=[],r=null;for(let p=0;p<c.length;p+=1){let t=c[p],m=/^\s*(```+|~~~+)/.exec(t);if(m){if(r===null)r=m[1][0];else if(m[1][0]===r)r=null;continue}if(r!==null)continue;let d=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(t);if(!d)continue;l.push({name:d[2],kind:"heading",line:p+1,column:d[1].length+2,depth:Math.min(d[1].length-1,2)})}return l}function Y(c){let l=A(c,"raw"),r=[],p=0;for(let t=0;t<l.length;t+=1){let m=l[t].trim();if(p===1){let d=/^"([^"]+)"\s*:/.exec(m);if(d)r.push({name:d[1],kind:"key",line:t+1,column:l[t].length-l[t].trimStart().length+1,depth:0})}if(p+=Z(l[t]),p<0)p=0}return r}var w=[{kind:"class",re:/^(?:(?:public|private|protected|internal|static|final|abstract|sealed|open|data|partial|export|declare)\s+)*(?:class|record|object)\s+([A-Za-z_$][\w$]*)/d},{kind:"struct",re:/^(?:(?:public|private|protected|internal|export|packed)\s+)*(?:struct|union)\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:(?:public|private|protected|internal|static|abstract|sealed)\s+)*interface\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:(?:public|private|protected|internal|static)\s+)*(?:enum|@interface)\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:(?:public|private|protected|internal|export)\s+)*(?:typedef|using)\b[^;=]*?\b([A-Za-z_]\w*)\s*(?:=|;|\{)/d},{kind:"trait",re:/^(?:(?:public|private|protected)\s+)*trait\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:(?:public|internal|export)\s+)*(?:namespace|package)\s+([A-Za-z_$][\w$.]*)/d},{kind:"function",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|export)\s+)*(?:fun|func|function|def|void|int|long|float|double|boolean|bool|char|byte|short|string|String|object|dynamic|var|auto|val|[A-Z][\w$<>[\],.? ]*)\s+([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d},{kind:"macro",re:/^#\s*(?:define|import)\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:static\s+)?(?:const|constexpr|let|var|val)\s+([A-Za-z_$][\w$]*)/d}],X=[{kind:"method",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|readonly)\s+)*(?:<[^>]*>\s*)?([A-Za-z_$][\w$]*)\s*\(/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|override|volatile|transient|val|var|let|const)\s+)*([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|volatile|transient)\s+)*[A-Za-z_$][\w$<>[\],.?]*\s+([A-Za-z_$][\w$]*)\s*(?:=|;)/d}],G=[{kind:"function",re:/^func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)/d},{kind:"struct",re:/^type\s+([A-Za-z_]\w*)\s+struct\b/d},{kind:"interface",re:/^type\s+([A-Za-z_]\w*)\s+interface\b/d},{kind:"type",re:/^type\s+([A-Za-z_]\w*)\s+/d},{kind:"constant",re:/^(?:var|const)\s+([A-Za-z_]\w*)/d}],V=[{kind:"function",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^(?:pub(?:\([^)]*\))?\s+)?enum\s+([A-Za-z_]\w*)/d},{kind:"trait",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:unsafe\s+)?trait\s+([A-Za-z_]\w*)/d},{kind:"module",re:/^(?:pub(?:\([^)]*\))?\s+)?mod\s+([A-Za-z_]\w*)/d},{kind:"impl",re:/^(?:pub\s+)?impl(?:<[^>]*>)?\s+(?:[A-Za-z_][\w:<>]*\s+for\s+)?([A-Za-z_]\w*)/d},{kind:"macro",re:/^(?:pub\s+)?macro_rules!\s*([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:const|static)\s+([A-Za-z_]\w*)/d}],J=[{kind:"class",re:/^class\s+([A-Z][\w:]*)/d},{kind:"module",re:/^module\s+([A-Z][\w:]*)/d},{kind:"function",re:/^def\s+(?:self\.)?([A-Za-z_]\w*[?!=]?)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*=/d}],Q=[{kind:"class",re:/^(?:(?:final|abstract|readonly)\s+)*(?:class|enum|trait)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:(?:public|private|protected|static|final|abstract)\s+)*function\s+&?([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:const|define\s*\(\s*['"])([A-Za-z_]\w*)/d}],ee=[{kind:"function",re:/^(?:local\s+)?function\s+([A-Za-z_][\w.:]*)/d},{kind:"variable",re:/^local\s+([A-Za-z_]\w*)\s*=/d}],ne=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:async\s+)?def\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*(?::[^=]+)?=/d}],te=[{kind:"function",re:/^(?:function\s+)?([A-Za-z_][\w-]*)\s*\(\s*\)/d},{kind:"function",re:/^function\s+([A-Za-z_][\w-]*)/d},{kind:"variable",re:/^(?:export\s+|declare\s+(?:-\w+\s+)*|readonly\s+)?([A-Za-z_]\w*)=/d}],re=[{kind:"module",re:/^defmodule\s+([A-Z][\w.]*)/d},{kind:"function",re:/^defp?\s+([a-z_]\w*[?!]?)/d},{kind:"macro",re:/^defmacro\s+([a-z_]\w*[?!]?)/d},{kind:"variable",re:/^@([a-z_]\w*)/d}],se=[{kind:"module",re:/^-module\(([a-z_]\w*)\)/d},{kind:"function",re:/^([a-z_]\w*)\s*\([^)]*\)\s*(?:when\s+.*)?->/d},{kind:"macro",re:/^-define\(([A-Za-z_]\w*)/d}],oe=[{kind:"module",re:/^module\s+([A-Z][\w.]*)/d},{kind:"type",re:/^(?:data|newtype|type|type alias)\s+([A-Z][\w]*)/d},{kind:"class",re:/^class\s+(?:\([^)]*\)\s*=>\s*)?([A-Z][\w]*)/d},{kind:"function",re:/^([a-z_][\w']*)\s*(?:::|[^=]*=)/d}],ie=[{kind:"module",re:/^module\s+(?:type\s+)?([A-Z][\w]*)/d},{kind:"type",re:/^type\s+(?:'[\w]+\s+)*([a-z_]\w*)/d},{kind:"class",re:/^class\s+(?:virtual\s+)?([a-z_]\w*)/d},{kind:"function",re:/^(?:let\s+rec\s+|let\s+|and\s+)([a-z_]\w*)/d}],z=[{kind:"function",re:/^\(defn-?\s+([^\s()]+)/d},{kind:"macro",re:/^\(defmacro\s+([^\s()]+)/d},{kind:"variable",re:/^\(def\s+([^\s()]+)/d},{kind:"module",re:/^\((?:ns|module|define-module|library)\s+\(?([^\s()]+)/d},{kind:"function",re:/^\(define\s+\(([^\s()]+)/d},{kind:"type",re:/^\(defrecord\s+([^\s()]+)/d},{kind:"class",re:/^\(defclass\s+([^\s()]+)/d}],ae=[{kind:"function",re:/^(?:pub\s+)?(?:export\s+)?(?:inline\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:extern\s+)?(?:packed\s+)?struct/d},{kind:"enum",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:packed\s+)?enum/d},{kind:"constant",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:pub\s+)?var\s+([A-Za-z_]\w*)/d}],le=[{kind:"module",re:/^(?:baremodule|module)\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:mutable\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^abstract\s+type\s+([A-Za-z_]\w*)/d},{kind:"macro",re:/^macro\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^function\s+([A-Za-z_]\w*[!?]?)/d},{kind:"function",re:/^([A-Za-z_]\w*[!?]?)\s*\([^)]*\)\s*(?:::[^=]+)?=/d},{kind:"constant",re:/^const\s+([A-Za-z_]\w*)/d}],ce=[{kind:"function",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)\s*function/d},{kind:"variable",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)/d}],ue=[{kind:"class",re:/^create\s+(?:or\s+replace\s+)?(?:table|view)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"function",re:/^create\s+(?:or\s+replace\s+)?(?:function|procedure)\s+["`]?([\w.]+)/id},{kind:"type",re:/^create\s+(?:or\s+replace\s+)?(?:type|domain|index)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"constant",re:/^create\s+(?:or\s+replace\s+)?(?:sequence|schema)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id}],v=[{kind:"class",re:/^(?:message|type|input|object)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^(?:interface|service|union|scalar)\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:query|mutation|subscription)\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:rpc\s+)?([A-Za-z_]\w*)\s*\([^)]*\)\s*(?::|returns|;)/d}],de=[{kind:"module",re:/^(?:resource|data|module|provider|variable|output|locals|terraform)\s+"([^"]+)"/d},{kind:"function",re:/^([A-Za-z_]\w*)\s*=\s*\{/d}],pe=[{kind:"function",re:/^([A-Za-z0-9_./-]+)\s*:(?!=)/d},{kind:"variable",re:/^(?:export\s+)?([A-Za-z_]\w*)\s*[:?+]?=/d}],me=[{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?\S+\s+[Aa][Ss]\s+(\S+)/d},{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?(\S+)/id},{kind:"variable",re:/^(?:ARG|ENV)\s+([A-Za-z_]\w*)/d}],fe=[{kind:"function",re:/^([A-Za-z_][\w'-]*)\s*=\s*(?:pkgs\.)?(?:lib\.)?(?:callPackage|\{)/d},{kind:"variable",re:/^([A-Za-z_][\w'-]*)\s*=/d}],x=[{kind:"macro",re:/^(@(?:mixin|function|keyframes)\s+[\w-]+)/d},{kind:"selector",re:/^(@(?:media|supports|layer|container)\s+[^{]+)/d},{kind:"selector",re:/^([.#&:][^{};]*(?:\s*,\s*[^{};]+)*)\s*\{/d},{kind:"variable",re:/^(--[\w-]+|@[\w-]+|\$[\w-]+)\s*:/d}],ke=[{kind:"module",re:/^package\s+([\w:]+)/d},{kind:"function",re:/^sub\s+([A-Za-z_]\w*)/d}],he=[{kind:"class",re:/^(?:abstract\s+)?(?:contract|library)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|modifier|constructor|fallback|receive)\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:event|error)\s+([A-Za-z_]\w*)/d}],be=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|filter|workflow)\s+([A-Za-z_][\w-]*)/d}],R=[{kind:"tag",re:/^\s*<([A-Z][\w.]*)/d},{kind:"tag",re:/^\s*<[a-z][\w-]*\b[^>]*\bid=["']([^"']+)["']/d}];var _={mask:"c",nesting:"braces",scopes:["class","module","interface","struct","trait","enum"],members:!0,memberRules:X},ye={typescript:{..._,rules:L,memberRules:E,scopes:["class"]},tsx:{..._,rules:L,memberRules:E,scopes:["class"]},javascript:{..._,rules:L,memberRules:E,scopes:["class"]},jsx:{..._,rules:L,memberRules:E,scopes:["class"]},java:{..._,rules:w},c:{..._,rules:w},cpp:{..._,rules:w},csharp:{..._,rules:w},"objective-c":{..._,rules:w},kotlin:{..._,rules:w},swift:{..._,rules:w},scala:{..._,rules:w},dart:{..._,rules:w},groovy:{..._,rules:w},solidity:{..._,rules:he},php:{mask:"c",nesting:"braces",rules:Q,scopes:["class","interface","trait"],members:!0},go:{mask:"c",nesting:"braces",rules:G},rust:{mask:"c",nesting:"braces",rules:V,scopes:["impl","trait"],members:!0},zig:{mask:"c",nesting:"braces",rules:ae,scopes:["struct","enum"],members:!0},hcl:{mask:"hcl",nesting:"braces",rules:de},protobuf:{mask:"c",nesting:"braces",rules:v,scopes:["class","interface"],members:!0},graphql:{mask:"hash",nesting:"braces",rules:v,scopes:["class","interface"],members:!0},css:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},less:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},scss:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},sass:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},stylus:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},ruby:{mask:"hash",nesting:"flat",rules:J},lua:{mask:"lua",nesting:"flat",rules:ee},elixir:{mask:"hash",nesting:"flat",rules:re},erlang:{mask:"percent",nesting:"flat",rules:se},haskell:{mask:"hash",nesting:"flat",rules:oe,dedupe:!0},ocaml:{mask:"ml",nesting:"flat",rules:ie},julia:{mask:"hash",nesting:"flat",rules:le},r:{mask:"hash",nesting:"flat",rules:ce},clojure:{mask:"lisp",nesting:"flat",rules:z},scheme:{mask:"lisp",nesting:"flat",rules:z},racket:{mask:"lisp",nesting:"flat",rules:z},perl:{mask:"hash",nesting:"flat",rules:ke},powershell:{mask:"hash",nesting:"flat",rules:be},bash:{mask:"hash",nesting:"flat",rules:te},sql:{mask:"sql",nesting:"flat",rules:ue},makefile:{mask:"hash",nesting:"flat",rules:pe},dockerfile:{mask:"hash",nesting:"flat",rules:me},nix:{mask:"hash",nesting:"flat",rules:fe},python:{mask:"python",nesting:"indent",rules:ne},yaml:{mask:"hash",nesting:"indent",rules:[{kind:"key",re:/^([A-Za-z_$][\w$.-]*)\s*:/d}]},toml:{mask:"hash",nesting:"flat",rules:[{kind:"module",re:/^\[\[?([^\]]+)\]\]?/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*=/d}]},ini:{mask:"none",nesting:"flat",rules:[{kind:"module",re:/^\[([^\]]+)\]/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},properties:{mask:"none",nesting:"flat",rules:[{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},json:{mask:"raw",nesting:"json",rules:[]},json5:{mask:"raw",nesting:"json",rules:[]},html:{mask:"raw",nesting:"flat",rules:R},xml:{mask:"raw",nesting:"flat",rules:R},svg:{mask:"raw",nesting:"flat",rules:R},vue:{mask:"raw",nesting:"flat",rules:R},svelte:{mask:"raw",nesting:"flat",rules:R},astro:{mask:"raw",nesting:"flat",rules:R},markdown:{mask:"none",nesting:"markdown",rules:[]},diff:{mask:"none",nesting:"flat",rules:[]}};function U(c,l){let r=ye[l];if(!c||!r)return[];let p=c.split(`
|
|
1
|
+
import{n,o,i,u,a,e,s,Nr,Rr,oo,oa,la}from"./index-st6a8q5z.js";import{to,wd,Cd,pl}from"./index-6z30g3ha.js";var Le={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]},M=s(Le);var Ee={name:"blocks",size:24,node:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]},I=s(Ee);var ze={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]},D=s(ze);var Ze={name:"component",size:24,node:[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]]},T=s(Ze);var Oe={name:"heading",size:24,node:[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]},N=s(Oe);var ve={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]},C=s(ve);var Ue={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]},q=s(Ue);var Me={name:"variable",size:24,node:[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]},P=s(Me);var Ie=450,K=8,De=700;function yd({enabled:c,onLongPress:l}){let r=i(null),p=i(null),t=i(0),m=i(l);m.current=l;let d=a(()=>{if(r.current!==null)clearTimeout(r.current),r.current=null;p.current=null},[]);return o(()=>d,[d]),{onTouchStart:(h)=>{if(!c)return;let k=h.touches[0];if(!k)return;d(),p.current={x:k.clientX,y:k.clientY},r.current=setTimeout(()=>{r.current=null;let f=p.current;if(p.current=null,!f)return;t.current=Date.now(),m.current(f.x,f.y)},Ie)},onTouchMove:(h)=>{let k=p.current,f=h.touches[0];if(!k||!f)return;if(Math.abs(f.clientX-k.x)>K||Math.abs(f.clientY-k.y)>K)d()},onTouchEnd:d,onTouchCancel:d,consume:()=>{if(t.current===0)return!1;let h=Date.now()-t.current<De;return t.current=0,h}}}var H={class:{Icon:Rr,label:"Class"},interface:{Icon:pl,label:"Interface"},type:{Icon:la,label:"Type"},enum:{Icon:oa,label:"Enum"},function:{Icon:M,label:"Function"},method:{Icon:T,label:"Method"},constant:{Icon:oo,label:"Constant"},variable:{Icon:P,label:"Variable"},struct:{Icon:D,label:"Struct"},trait:{Icon:Cd,label:"Trait"},impl:{Icon:I,label:"Impl"},module:{Icon:wd,label:"Module"},heading:{Icon:N,label:"Heading"},selector:{Icon:C,label:"Selector"},key:{Icon:to,label:"Key"},tag:{Icon:q,label:"Tag"},macro:{Icon:Nr,label:"Macro"}};function vd({kind:c,size:l=12}){let{Icon:r}=H[c];return e(r,{size:l,className:"flex-shrink-0 text-ink/45",strokeWidth:1.8})}function di(c){return H[c].label}var Te={c:{line:["//"],block:["/*","*/"],quotes:["'",'"'],template:!0},css:{line:[],block:["/*","*/"],quotes:["'",'"']},python:{line:["#"],quotes:["'",'"'],triple:!0},hash:{line:["#"],quotes:["'",'"']},dash:{line:["--"],quotes:["'",'"']},lua:{line:["--"],block:["--[[","]]"],quotes:["'",'"']},sql:{line:["--"],block:["/*","*/"],quotes:["'",'"']},ml:{line:[],block:["(*","*)"],quotes:['"']},hcl:{line:["#","//"],block:["/*","*/"],quotes:[]},percent:{line:["%"],quotes:["'",'"']},lisp:{line:[";"],block:["#|","|#"],quotes:['"']},none:{line:[],quotes:['"',"'"]},raw:{line:[],quotes:[]}};function A(c,l){let r=Te[l],[p,t]=r.block??["",""],m=[],d="code",h="";for(let k of c){let f="";for(let b=0;b<k.length;b+=1){let y=k[b],g=k[b+1];if(d==="line"){f+=" ";continue}if(d==="block"){if(t&&y===t[0]&&k.startsWith(t,b)){d="code",f+=" ".repeat(t.length),b+=t.length-1;continue}f+=" ";continue}if(d==="quoted"||d==="template"||d==="triple"){if(y==="\\"){f+=" ",b+=1;continue}if(d==="triple"){if(y===h&&k.startsWith(h.repeat(3),b)){d="code",f+=" ",b+=2;continue}f+=" ";continue}if(f+=" ",y===h)d="code";continue}let S=r.line.find((Ae)=>k.startsWith(Ae,b));if(S){d="line",f+=" ".repeat(S.length),b+=S.length-1;continue}if(p&&k.startsWith(p,b)){d="block",f+=" ".repeat(p.length),b+=p.length-1;continue}if(r.triple&&y===(g??"")&&y===k[b+2]&&(y==="'"||y==='"')){d="triple",h=y,f+=" ",b+=2;continue}if(r.template&&y==="`"){d="template",h="`",f+=" ";continue}if(r.quotes?.includes(y)){d="quoted",h=y,f+=" ";continue}f+=y}if(d==="line"||d==="quoted")d="code";m.push(f)}return m}function Z(c){let l=0;for(let r of c)if(r==="{")l+=1;else if(r==="}")l-=1;return l}var L=[{kind:"class",re:/^(?:export\s+)?(?:default\s+)?(?:abstract\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:export\s+)?(?:declare\s+)?(?:const\s+)?enum\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d},{kind:"constant",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*[:=]/d}],$e=/^(?:(?:public|private|protected|static|async|readonly|override|abstract|declare|get|set)\s+)*(?:\*|#)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d,Ne=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d,Ce=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d,E=[{kind:"method",re:$e},{kind:"method",re:Ne},{kind:"variable",re:Ce}];function B(c,l){let r=A(c,l.mask),p=[],t=0,m=[];for(let d=0;d<r.length;d+=1){let h=r[d].trim(),k=m.length>0&&t===m[m.length-1].depth?m[m.length-1]:null;if(h&&(t===0||k)){let f=r[d].length-r[d].trimStart().length,b=k&&l.members?Ke(l.memberRules??[],h):null;if(b)p.push({name:b.name,kind:b.kind,line:d+1,column:f+b.column+1,depth:1});else{let y=k!==null&&qe.has(k.kind),g=O(l.rules,h,y);if(g){if(p.push({name:g.name,kind:y&&g.kind==="function"?"method":g.kind,line:d+1,column:f+g.column+1,depth:k?1:0}),!y&&(l.scopes??[]).includes(g.kind))m.push({depth:t+1,kind:g.kind})}}}if(t+=Z(r[d]),t<=0)t=0,m.length=0;else while(m.length>0&&t<m[m.length-1].depth)m.pop()}return p}var qe=new Set(["class","interface","struct","trait","impl","enum"]);function O(c,l,r){for(let p of c){if(r&&Pe.has(p.kind))continue;let t=p.re.exec(l),m=t?.[1]?.trim();if(!t||!m)continue;return{name:m,kind:p.kind,column:t.indices?.[1]?.[0]??0}}return null}var Pe=new Set(["class","interface","enum","type","struct","trait","impl","module"]);function Ke(c,l){for(let r of c){let p=r.re.exec(l),t=p?.[1]?.trim();if(!p||!t||He.has(t))continue;return{name:t,kind:r.kind,column:p.indices?.[1]?.[0]??0}}return null}var He=new Set(["if","for","while","switch","catch","return","throw","new","typeof","await","yield","super","this","delete","void","function","constructor","else","do","try","with"]);function j(c,l){let r=A(c,l.mask),p=[],t=[];for(let m=0;m<r.length;m+=1){let d=r[m],h=d.trim();if(!h)continue;let k=d.length-d.trimStart().length;while(t.length>0&&k<=t[t.length-1])t.pop();let f=O(l.rules,h,!1);if(!f)continue;if(t.length>1){t.push(k);continue}let b=t.length===1;p.push({name:f.name,kind:b&&f.kind==="function"?"method":f.kind,line:m+1,column:k+f.column+1,depth:b?1:0}),t.push(k)}return p}function F(c,l){let r=A(c,l.mask),p=[];for(let t=0;t<r.length;t+=1){let m=r[t],d=m.trim();if(!d)continue;let h=O(l.rules,d,!1);if(!h)continue;let k=p[p.length-1];if(l.dedupe&&k&&k.name===h.name&&k.kind===h.kind)continue;p.push({name:h.name,kind:h.kind,line:t+1,column:m.length-m.trimStart().length+h.column+1,depth:0})}return p}function W(c){let l=[],r=null;for(let p=0;p<c.length;p+=1){let t=c[p],m=/^\s*(```+|~~~+)/.exec(t);if(m){if(r===null)r=m[1][0];else if(m[1][0]===r)r=null;continue}if(r!==null)continue;let d=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(t);if(!d)continue;l.push({name:d[2],kind:"heading",line:p+1,column:d[1].length+2,depth:Math.min(d[1].length-1,2)})}return l}function Y(c){let l=A(c,"raw"),r=[],p=0;for(let t=0;t<l.length;t+=1){let m=l[t].trim();if(p===1){let d=/^"([^"]+)"\s*:/.exec(m);if(d)r.push({name:d[1],kind:"key",line:t+1,column:l[t].length-l[t].trimStart().length+1,depth:0})}if(p+=Z(l[t]),p<0)p=0}return r}var w=[{kind:"class",re:/^(?:(?:public|private|protected|internal|static|final|abstract|sealed|open|data|partial|export|declare)\s+)*(?:class|record|object)\s+([A-Za-z_$][\w$]*)/d},{kind:"struct",re:/^(?:(?:public|private|protected|internal|export|packed)\s+)*(?:struct|union)\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:(?:public|private|protected|internal|static|abstract|sealed)\s+)*interface\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:(?:public|private|protected|internal|static)\s+)*(?:enum|@interface)\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:(?:public|private|protected|internal|export)\s+)*(?:typedef|using)\b[^;=]*?\b([A-Za-z_]\w*)\s*(?:=|;|\{)/d},{kind:"trait",re:/^(?:(?:public|private|protected)\s+)*trait\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:(?:public|internal|export)\s+)*(?:namespace|package)\s+([A-Za-z_$][\w$.]*)/d},{kind:"function",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|export)\s+)*(?:fun|func|function|def|void|int|long|float|double|boolean|bool|char|byte|short|string|String|object|dynamic|var|auto|val|[A-Z][\w$<>[\],.? ]*)\s+([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d},{kind:"macro",re:/^#\s*(?:define|import)\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:static\s+)?(?:const|constexpr|let|var|val)\s+([A-Za-z_$][\w$]*)/d}],X=[{kind:"method",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|readonly)\s+)*(?:<[^>]*>\s*)?([A-Za-z_$][\w$]*)\s*\(/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|override|volatile|transient|val|var|let|const)\s+)*([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|volatile|transient)\s+)*[A-Za-z_$][\w$<>[\],.?]*\s+([A-Za-z_$][\w$]*)\s*(?:=|;)/d}],G=[{kind:"function",re:/^func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)/d},{kind:"struct",re:/^type\s+([A-Za-z_]\w*)\s+struct\b/d},{kind:"interface",re:/^type\s+([A-Za-z_]\w*)\s+interface\b/d},{kind:"type",re:/^type\s+([A-Za-z_]\w*)\s+/d},{kind:"constant",re:/^(?:var|const)\s+([A-Za-z_]\w*)/d}],V=[{kind:"function",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^(?:pub(?:\([^)]*\))?\s+)?enum\s+([A-Za-z_]\w*)/d},{kind:"trait",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:unsafe\s+)?trait\s+([A-Za-z_]\w*)/d},{kind:"module",re:/^(?:pub(?:\([^)]*\))?\s+)?mod\s+([A-Za-z_]\w*)/d},{kind:"impl",re:/^(?:pub\s+)?impl(?:<[^>]*>)?\s+(?:[A-Za-z_][\w:<>]*\s+for\s+)?([A-Za-z_]\w*)/d},{kind:"macro",re:/^(?:pub\s+)?macro_rules!\s*([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:const|static)\s+([A-Za-z_]\w*)/d}],J=[{kind:"class",re:/^class\s+([A-Z][\w:]*)/d},{kind:"module",re:/^module\s+([A-Z][\w:]*)/d},{kind:"function",re:/^def\s+(?:self\.)?([A-Za-z_]\w*[?!=]?)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*=/d}],Q=[{kind:"class",re:/^(?:(?:final|abstract|readonly)\s+)*(?:class|enum|trait)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:(?:public|private|protected|static|final|abstract)\s+)*function\s+&?([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:const|define\s*\(\s*['"])([A-Za-z_]\w*)/d}],ee=[{kind:"function",re:/^(?:local\s+)?function\s+([A-Za-z_][\w.:]*)/d},{kind:"variable",re:/^local\s+([A-Za-z_]\w*)\s*=/d}],ne=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:async\s+)?def\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*(?::[^=]+)?=/d}],te=[{kind:"function",re:/^(?:function\s+)?([A-Za-z_][\w-]*)\s*\(\s*\)/d},{kind:"function",re:/^function\s+([A-Za-z_][\w-]*)/d},{kind:"variable",re:/^(?:export\s+|declare\s+(?:-\w+\s+)*|readonly\s+)?([A-Za-z_]\w*)=/d}],re=[{kind:"module",re:/^defmodule\s+([A-Z][\w.]*)/d},{kind:"function",re:/^defp?\s+([a-z_]\w*[?!]?)/d},{kind:"macro",re:/^defmacro\s+([a-z_]\w*[?!]?)/d},{kind:"variable",re:/^@([a-z_]\w*)/d}],se=[{kind:"module",re:/^-module\(([a-z_]\w*)\)/d},{kind:"function",re:/^([a-z_]\w*)\s*\([^)]*\)\s*(?:when\s+.*)?->/d},{kind:"macro",re:/^-define\(([A-Za-z_]\w*)/d}],oe=[{kind:"module",re:/^module\s+([A-Z][\w.]*)/d},{kind:"type",re:/^(?:data|newtype|type|type alias)\s+([A-Z][\w]*)/d},{kind:"class",re:/^class\s+(?:\([^)]*\)\s*=>\s*)?([A-Z][\w]*)/d},{kind:"function",re:/^([a-z_][\w']*)\s*(?:::|[^=]*=)/d}],ie=[{kind:"module",re:/^module\s+(?:type\s+)?([A-Z][\w]*)/d},{kind:"type",re:/^type\s+(?:'[\w]+\s+)*([a-z_]\w*)/d},{kind:"class",re:/^class\s+(?:virtual\s+)?([a-z_]\w*)/d},{kind:"function",re:/^(?:let\s+rec\s+|let\s+|and\s+)([a-z_]\w*)/d}],z=[{kind:"function",re:/^\(defn-?\s+([^\s()]+)/d},{kind:"macro",re:/^\(defmacro\s+([^\s()]+)/d},{kind:"variable",re:/^\(def\s+([^\s()]+)/d},{kind:"module",re:/^\((?:ns|module|define-module|library)\s+\(?([^\s()]+)/d},{kind:"function",re:/^\(define\s+\(([^\s()]+)/d},{kind:"type",re:/^\(defrecord\s+([^\s()]+)/d},{kind:"class",re:/^\(defclass\s+([^\s()]+)/d}],ae=[{kind:"function",re:/^(?:pub\s+)?(?:export\s+)?(?:inline\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:extern\s+)?(?:packed\s+)?struct/d},{kind:"enum",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:packed\s+)?enum/d},{kind:"constant",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:pub\s+)?var\s+([A-Za-z_]\w*)/d}],le=[{kind:"module",re:/^(?:baremodule|module)\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:mutable\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^abstract\s+type\s+([A-Za-z_]\w*)/d},{kind:"macro",re:/^macro\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^function\s+([A-Za-z_]\w*[!?]?)/d},{kind:"function",re:/^([A-Za-z_]\w*[!?]?)\s*\([^)]*\)\s*(?:::[^=]+)?=/d},{kind:"constant",re:/^const\s+([A-Za-z_]\w*)/d}],ce=[{kind:"function",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)\s*function/d},{kind:"variable",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)/d}],ue=[{kind:"class",re:/^create\s+(?:or\s+replace\s+)?(?:table|view)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"function",re:/^create\s+(?:or\s+replace\s+)?(?:function|procedure)\s+["`]?([\w.]+)/id},{kind:"type",re:/^create\s+(?:or\s+replace\s+)?(?:type|domain|index)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"constant",re:/^create\s+(?:or\s+replace\s+)?(?:sequence|schema)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id}],v=[{kind:"class",re:/^(?:message|type|input|object)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^(?:interface|service|union|scalar)\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:query|mutation|subscription)\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:rpc\s+)?([A-Za-z_]\w*)\s*\([^)]*\)\s*(?::|returns|;)/d}],de=[{kind:"module",re:/^(?:resource|data|module|provider|variable|output|locals|terraform)\s+"([^"]+)"/d},{kind:"function",re:/^([A-Za-z_]\w*)\s*=\s*\{/d}],pe=[{kind:"function",re:/^([A-Za-z0-9_./-]+)\s*:(?!=)/d},{kind:"variable",re:/^(?:export\s+)?([A-Za-z_]\w*)\s*[:?+]?=/d}],me=[{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?\S+\s+[Aa][Ss]\s+(\S+)/d},{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?(\S+)/id},{kind:"variable",re:/^(?:ARG|ENV)\s+([A-Za-z_]\w*)/d}],fe=[{kind:"function",re:/^([A-Za-z_][\w'-]*)\s*=\s*(?:pkgs\.)?(?:lib\.)?(?:callPackage|\{)/d},{kind:"variable",re:/^([A-Za-z_][\w'-]*)\s*=/d}],x=[{kind:"macro",re:/^(@(?:mixin|function|keyframes)\s+[\w-]+)/d},{kind:"selector",re:/^(@(?:media|supports|layer|container)\s+[^{]+)/d},{kind:"selector",re:/^([.#&:][^{};]*(?:\s*,\s*[^{};]+)*)\s*\{/d},{kind:"variable",re:/^(--[\w-]+|@[\w-]+|\$[\w-]+)\s*:/d}],ke=[{kind:"module",re:/^package\s+([\w:]+)/d},{kind:"function",re:/^sub\s+([A-Za-z_]\w*)/d}],he=[{kind:"class",re:/^(?:abstract\s+)?(?:contract|library)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|modifier|constructor|fallback|receive)\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:event|error)\s+([A-Za-z_]\w*)/d}],be=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|filter|workflow)\s+([A-Za-z_][\w-]*)/d}],R=[{kind:"tag",re:/^\s*<([A-Z][\w.]*)/d},{kind:"tag",re:/^\s*<[a-z][\w-]*\b[^>]*\bid=["']([^"']+)["']/d}];var _={mask:"c",nesting:"braces",scopes:["class","module","interface","struct","trait","enum"],members:!0,memberRules:X},ye={typescript:{..._,rules:L,memberRules:E,scopes:["class"]},tsx:{..._,rules:L,memberRules:E,scopes:["class"]},javascript:{..._,rules:L,memberRules:E,scopes:["class"]},jsx:{..._,rules:L,memberRules:E,scopes:["class"]},java:{..._,rules:w},c:{..._,rules:w},cpp:{..._,rules:w},csharp:{..._,rules:w},"objective-c":{..._,rules:w},kotlin:{..._,rules:w},swift:{..._,rules:w},scala:{..._,rules:w},dart:{..._,rules:w},groovy:{..._,rules:w},solidity:{..._,rules:he},php:{mask:"c",nesting:"braces",rules:Q,scopes:["class","interface","trait"],members:!0},go:{mask:"c",nesting:"braces",rules:G},rust:{mask:"c",nesting:"braces",rules:V,scopes:["impl","trait"],members:!0},zig:{mask:"c",nesting:"braces",rules:ae,scopes:["struct","enum"],members:!0},hcl:{mask:"hcl",nesting:"braces",rules:de},protobuf:{mask:"c",nesting:"braces",rules:v,scopes:["class","interface"],members:!0},graphql:{mask:"hash",nesting:"braces",rules:v,scopes:["class","interface"],members:!0},css:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},less:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},scss:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},sass:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},stylus:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},ruby:{mask:"hash",nesting:"flat",rules:J},lua:{mask:"lua",nesting:"flat",rules:ee},elixir:{mask:"hash",nesting:"flat",rules:re},erlang:{mask:"percent",nesting:"flat",rules:se},haskell:{mask:"hash",nesting:"flat",rules:oe,dedupe:!0},ocaml:{mask:"ml",nesting:"flat",rules:ie},julia:{mask:"hash",nesting:"flat",rules:le},r:{mask:"hash",nesting:"flat",rules:ce},clojure:{mask:"lisp",nesting:"flat",rules:z},scheme:{mask:"lisp",nesting:"flat",rules:z},racket:{mask:"lisp",nesting:"flat",rules:z},perl:{mask:"hash",nesting:"flat",rules:ke},powershell:{mask:"hash",nesting:"flat",rules:be},bash:{mask:"hash",nesting:"flat",rules:te},sql:{mask:"sql",nesting:"flat",rules:ue},makefile:{mask:"hash",nesting:"flat",rules:pe},dockerfile:{mask:"hash",nesting:"flat",rules:me},nix:{mask:"hash",nesting:"flat",rules:fe},python:{mask:"python",nesting:"indent",rules:ne},yaml:{mask:"hash",nesting:"indent",rules:[{kind:"key",re:/^([A-Za-z_$][\w$.-]*)\s*:/d}]},toml:{mask:"hash",nesting:"flat",rules:[{kind:"module",re:/^\[\[?([^\]]+)\]\]?/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*=/d}]},ini:{mask:"none",nesting:"flat",rules:[{kind:"module",re:/^\[([^\]]+)\]/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},properties:{mask:"none",nesting:"flat",rules:[{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},json:{mask:"raw",nesting:"json",rules:[]},json5:{mask:"raw",nesting:"json",rules:[]},html:{mask:"raw",nesting:"flat",rules:R},xml:{mask:"raw",nesting:"flat",rules:R},svg:{mask:"raw",nesting:"flat",rules:R},vue:{mask:"raw",nesting:"flat",rules:R},svelte:{mask:"raw",nesting:"flat",rules:R},astro:{mask:"raw",nesting:"flat",rules:R},markdown:{mask:"none",nesting:"markdown",rules:[]},diff:{mask:"none",nesting:"flat",rules:[]}};function U(c,l){let r=ye[l];if(!c||!r)return[];let p=c.split(`
|
|
2
2
|
`);if(r.nesting==="markdown")return W(p);if(r.nesting==="json")return Y(p);if(r.nesting==="indent")return j(p,r);if(r.nesting==="flat")return F(p,r);return B(p,r)}function _e(c,l){return U(c,l)}var Be={idle:"No file open in the editor.",loading:"Reading the file…",error:"Could not read this file.","not-a-document":"This tab has no outline.",diff:"Diff tabs have no outline.",ready:"No symbols found."};function ge(c,l){return l??Be[c]}var Se=8388608;function we(c){let l=c.length;if(l<=500)return{rows:c,total:l,truncated:!1};return{rows:c.slice(0,500),total:l,truncated:!0}}function kd(c){return`Showing the first ${500 .toLocaleString()} of ${c.toLocaleString()} symbols.`}function Re(c){if(c<=8388608)return null;return`This file is ${(c/1048576).toFixed(1)} MB — too large to outline.`}var je=300;function xe(c){return c.length>Se}function xd({content:c,language:l,state:r,note:p,path:t}){let[m,d]=n({content:c,language:l,path:t}),h=i(t);o(()=>{let y=t!==h.current;if(h.current=t,y||xe(c)){d((S)=>S.content===c&&S.language===l?S:{content:c,language:l,path:t});return}let g=window.setTimeout(()=>{d((S)=>S.content===c&&S.language===l?S:{content:c,language:l,path:t})},je);return()=>window.clearTimeout(g)},[t,c,l]);let k=u(()=>{if(r!=="ready"||xe(m.content))return[];return _e(m.content,m.language)},[r,m]),f=u(()=>we(k),[k]),b=r==="ready"?Re(c.length):null;return{symbols:f.rows,total:f.total,truncated:f.truncated,notice:b??ge(r,p)}}
|
|
3
3
|
export{yd,vd,di,kd,xd};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t,ol,b,ll}from"./index-
|
|
1
|
+
import{t,ol,b,ll}from"./index-xfnjwhan.js";import{xn}from"./index-8pqx5n2p.js";var o=xn(ll(),1);var ii=t((s,e)=>{let r=s.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name)r.attr("name",e.name);if(e.rx)r.attr("rx",e.rx);if(e.ry)r.attr("ry",e.ry);if(e.attrs!==void 0)for(let a in e.attrs)r.attr(a,e.attrs[a]);if(e.class)r.attr("class",e.class);return r},"drawRect"),ld=t((s,e)=>{let r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};ii(s,r).lower()},"drawBackgroundRect"),YA=t((s,e)=>{let r=e.text.replace(ol," "),a=s.append("text");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("class","legend"),a.style("text-anchor",e.anchor),e.class)a.attr("class",e.class);let i=a.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),a},"drawText"),Gp=t((s,e,r,a)=>{let i=s.append("image");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",n)},"drawImage"),jp=t((s,e,r,a)=>{let i=s.append("use");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),gr=t(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Hp=t(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Za=t(()=>{let s=b(".mermaidTooltip");if(s.empty())s=b("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100");return s},"createTooltip");
|
|
2
2
|
export{ii,ld,YA,Gp,jp,gr,Hp,Za};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n,o,i,a,e,s,
|
|
1
|
+
import{n,o,i,a,e,s,ne,Cn,p,I,yr,Xe,Ue,Ke,Fr,er,la,ls,h,He,T,Rc}from"./index-st6a8q5z.js";import{rd}from"./index-tdbcp70z.js";import"./index-8444mec5.js";var te={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]},U=s(te);var re={name:"move-vertical",size:24,node:[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]},D=s(re);var oe={live:"Live","agent-offline":"Agent offline","browser-offline":"Browser offline","no-tab":"Tanpa tab"};function j({url:t,status:r,zoomLevel:d=100,onIncludeInChat:c,onReconnect:l,onOpenExternal:u,onZoomIn:m,onZoomOut:b,onResetZoom:k}){return e(rd,{url:t??"",statusDotClass:r==="live"?"bg-success animate-pulse":"bg-ink/25",statusLabel:oe[r],zoomLevel:d,onZoomIn:m,onZoomOut:b,onResetZoom:k,onIncludeInChat:c,onOpenExternal:u,onReconnect:l,openExternalLabel:"Buka di jendela baru",openExternalTitle:t?"Open in new window":"No URL loaded",children:e("div",{className:"flex-1 min-w-0 flex items-center bg-canvas border border-ink/15 rounded-md px-2 py-0.5",children:[e(Ue,{size:12,className:"text-ink/40 mr-1.5 flex-shrink-0"}),e("span",{className:"w-full truncate text-ink/80 font-mono text-[11px]",title:t??"",children:t||"No page open yet"})]})})}var se=[["RAM","~93 MB → ~259 MB untuk satu tab"],["Disk","~346 MB untuk Chrome for Testing bila belum terpasang"],["Idle","Tab Chromium terus melukis; omp membekukannya saat turn selesai"],["Deteksi","Halaman bisa melihat otomasi (navigator.webdriver, CDP)"]];function Z({saving:t,onUseChromium:r}){return e("button",{type:"button",onClick:r,disabled:t,className:"inline-flex items-center gap-1.5 rounded-md border border-ink/15 bg-ink/5 px-2.5 py-1 text-[11px] font-medium text-ink transition-colors hover:bg-ink/10 disabled:cursor-not-allowed disabled:opacity-60",children:[t&&e(p,{size:11,className:"animate-spin"}),t?"Mengaktifkan…":"Pakai Chromium"]})}function _({saving:t,error:r,onUseChromium:d,variant:c}){if(c==="strip")return e("div",{className:"flex items-center justify-between gap-2 border-b border-ink/10 bg-ink/[0.03] px-2.5 py-1.5 flex-shrink-0",children:[e("span",{className:"min-w-0 truncate text-[11px] text-ink/70",children:"Agen memakai WebKit — tab baru tidak akan muncul di panel ini."}),e(Z,{saving:t,onUseChromium:d})]});return e("div",{className:"flex-1 flex flex-col items-center justify-center overflow-y-auto p-6 text-center select-none my-auto",children:[e("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:e(I,{size:24})}),e("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Agen memakai WebKit — panel ini tidak bisa memantulkannya"}),e("p",{className:"text-xs text-ink/60 max-w-sm",children:"WebKit milik omp tidak punya CDP dan tidak mengekspos aliran frame, jadi tab yang dijalankannya tidak bisa ditampilkan di sini. Panel ini hanya bisa memantulkan Chromium."}),e("div",{className:"mt-4 w-full max-w-sm rounded-lg border border-ink/10 bg-paper text-left",children:[e("div",{className:"border-b border-ink/10 px-3 py-1.5 text-[10px] uppercase tracking-wider text-ink/50",children:"Biaya pindah ke Chromium"}),e("dl",{className:"divide-y divide-ink/5",children:se.map(([l,u])=>e("div",{className:"flex gap-2 px-3 py-1.5",children:[e("dt",{className:"w-14 flex-shrink-0 text-[11px] font-medium text-ink/70",children:l}),e("dd",{className:"text-[11px] text-ink/60",children:u})]},l))})]}),e("div",{className:"mt-3 flex flex-col items-center gap-1.5",children:[e(Z,{saving:t,onUseChromium:d}),e("p",{className:"text-[10.5px] text-ink/45 max-w-sm",children:"Berlaku untuk tab yang dibuka berikutnya; sesi tidak perlu di-restart. Tab WebKit yang sudah terbuka tetap tidak terlihat."}),r&&e("p",{role:"alert",className:"text-[11px] text-error max-w-sm",children:r})]})]})}var ae={open:Ue,navigate:Ue,loaded:ne,click:U,type:la,press:Xe,submit:er,wait:Ke,screenshot:yr,scroll:D,upload:ls,close:Cn,error:Cn};function F({actions:t}){if(t.length===0)return null;return e("div",{className:"absolute bottom-3 left-3 z-20 flex flex-col gap-1.5 pointer-events-none max-w-[320px]",children:t.map((r)=>{let d=ae[r.kind],c=r.kind==="error";return e("div",{className:`flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur-sm ${c?"border-error/30 bg-error/10 text-error":"border-ink/15 bg-paper/95 text-ink"}`,children:[e(d,{size:12,className:`flex-shrink-0 ${c?"text-error":"text-ink/60"}`}),e("span",{className:"truncate",children:r.label})]},r.id)})})}function ie(t){return t.title||t.url||t.targetId}function H({tabs:t,targetId:r,closing:d,onSelectTarget:c,onCloseTarget:l}){let u=i(null);return o(()=>{u.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[r,t.length]),e("div",{className:"px-2 py-1 border-b border-ink/10 bg-paper flex items-center gap-1 overflow-x-auto flex-shrink-0",children:t.map((m)=>{let b=m.targetId===r,k=ie(m);return e("div",{ref:b?u:void 0,className:`group flex items-center rounded border transition-colors flex-shrink-0 ${b?"bg-ink text-canvas border-ink":"bg-paper text-ink/70 border-ink/15 hover:border-ink/35 hover:text-ink"}`,children:[e("button",{type:"button",onClick:()=>c(b?"":m.targetId),className:"pl-2 pr-1 py-0.5 text-[11px] font-mono max-w-[220px] truncate cursor-pointer",title:`${k}
|
|
2
2
|
${m.url}`,"aria-pressed":b,children:k}),e("button",{type:"button",onClick:()=>l(m.targetId),disabled:d===m.targetId,className:`mr-0.5 p-1 rounded hover:bg-error hover:text-paper transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${b?"text-on-ink-muted":"text-ink/40 opacity-0 group-hover:opacity-100 focus-visible:opacity-100"}`,"aria-label":`Tutup tab ${k}`,title:`Tutup tab ${k}`,children:e(h,{size:11})})]},m.targetId)})})}function le(t){let r=atob(t),d=new Uint8Array(r.length);for(let c=0;c<r.length;c++)d[c]=r.charCodeAt(c);return d}function ce(t,r){return new Blob([le(t)],{type:r})}async function K(t,r,d){let c=t.getContext("2d");if(!c)return!1;if(typeof createImageBitmap!=="function")return!1;let l;try{l=await createImageBitmap(ce(r,d))}catch{return!1}try{if(t.width!==l.width||t.height!==l.height)t.width=l.width,t.height=l.height;return c.drawImage(l,0,0),!0}finally{l.close()}}var ue={"agent-offline":{title:"The agent is not running",body:"Start this session so the agent can drive the browser."},"browser-offline":{title:"No browser is open",body:"Ask the agent to open a page; the live view appears here."},"no-tab":{title:"Browser is open, with no tab yet",body:"This session has not opened a tab in the shared browser."}};function J({status:t,url:r,tabs:d,targetId:c,frame:l,actions:u,onSelectTarget:m,onCloseTarget:b,closingTarget:k,zoomLevel:N}){let B=t==="live",R=B?null:ue[t],g=i(null),[f,w]=n(!1);return o(()=>{let A=g.current;if(!A||!l)return;let y=!1;return K(A,l.data,l.mimeType).then((S)=>{if(S&&!y)w(!0)}),()=>{y=!0}},[l]),o(()=>{if(!B)w(!1)},[B]),e("div",{className:"flex-1 flex flex-col min-h-0 bg-canvas/60 relative overflow-hidden",children:[e(F,{actions:u}),B&&d.length>0&&e(H,{tabs:d,targetId:c,closing:k,onSelectTarget:m,onCloseTarget:b}),e("div",{className:"flex-1 flex items-center justify-center p-2 min-h-0 overflow-auto",children:B?e("div",{className:"relative flex flex-col bg-paper w-full h-full transition-all duration-200",style:{zoom:N!==100?`${N}%`:void 0,transformOrigin:"top center"},children:[e("canvas",{ref:g,"aria-label":r||"Live browser view",className:`w-full h-full object-contain bg-paper ${f?"":"hidden"}`}),!f&&e("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center p-6 select-none",children:[e(p,{size:20,className:"animate-spin text-ink/40 mb-2"}),e("p",{className:"text-xs text-ink/60",children:"Menunggu frame pertama dari browser…"})]})]}):e("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none my-auto",children:[e("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:t==="agent-offline"?e(Fr,{size:24}):e(Ue,{size:24})}),e("h3",{className:"text-sm font-semibold text-ink mb-1",children:R?.title}),e("p",{className:"text-xs text-ink/60 max-w-sm",children:R?.body})]})})]})}function W(t){if(typeof t!=="object"||t===null||!("error"in t))return null;return typeof t.error==="string"?t.error:null}function X(){let[t,r]=n(null),[d,c]=n(!0),[l,u]=n(!1),[m,b]=n(null),[k,N]=n(0);o(()=>{let g=!1;return c(!0),fetch("/api/browser/engine").then((f)=>f.json()).then((f)=>{if(g)return;let w=W(f);if(w){b(w);return}r(f),b(null)}).catch((f)=>{if(!g)b(f instanceof Error?f.message:String(f))}).finally(()=>{if(!g)c(!1)}),()=>{g=!0}},[k]);let B=a(()=>N((g)=>g+1),[]),R=a(async()=>{u(!0),b(null);try{let g=await fetch("/api/browser/engine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({webkit:!1})}),f=await g.json().catch(()=>null),w=W(f)??(g.ok?null:`The write answered ${g.status}`);if(w)return b(w),!1;return r(f),!0}catch(g){return b(g instanceof Error?g.message:String(g)),!1}finally{u(!1)}},[]);return{state:t,loading:d,saving:l,error:m,refresh:B,useChromium:R}}var G={status:"agent-offline",tabs:[]},Y=5000,de=4000,me=500,pe=3,q=16;function Q(t=!0){let{sessionId:r,ready:d}=He(),[c,l]=n(G),[u,m]=n(null),[b,k]=n([]),[N,B]=n(""),[R,g]=n(0),f=i(null),w=i(null),A=i(void 0),y=i(0),S=i([]),O=a((E)=>{B(E.trim())},[]),V=a(()=>{g((E)=>E+1)},[]);return o(()=>{let E=setInterval(()=>{k((L)=>{let M=Date.now(),P=L.filter((x)=>x.expiresAt>M),C=S.current.shift();if(!C)return P.length===L.length?L:P;return[...P.slice(-(pe-1)),{...C,expiresAt:M+de}]})},me);return()=>clearInterval(E)},[]),o(()=>{l(G),m(null),B(""),S.current=[],k([])},[r]),o(()=>{if(!d||!r||!t)return;let E=!1,L=()=>{if(E)return;let P=N?`?target=${encodeURIComponent(N)}`:"",C=new EventSource(`/api/browser/${encodeURIComponent(r)}/stream${P}`);f.current=C,C.addEventListener("open",()=>{y.current=0}),C.addEventListener("state",(x)=>{try{let v=JSON.parse(x.data);if(A.current=v.targetId,l(v),v.status!=="live")m(null)}catch{}}),C.addEventListener("frame",(x)=>{try{let v=JSON.parse(x.data),z=A.current;if(z&&v.targetId&&v.targetId!==z)return;if(!z&&v.targetId)A.current=v.targetId;m({data:v.data,mimeType:v.mimeType})}catch{}}),C.addEventListener("action",(x)=>{try{let v=JSON.parse(x.data);if(typeof v?.label!=="string"||!v.label)return;if(S.current.push(v),S.current.length>q)S.current.splice(0,S.current.length-q)}catch{}}),C.addEventListener("error",()=>{if(C.readyState===EventSource.CLOSED)M()})},M=()=>{if(E||w.current)return;let P=Math.min(y.current+1,Y/1000);y.current=P,w.current=setTimeout(()=>{w.current=null,f.current?.close(),f.current=null,L()},Math.min(P*1000,Y))};return L(),()=>{if(E=!0,w.current)clearTimeout(w.current),w.current=null;f.current?.close(),f.current=null}},[d,r,N,R,t]),{status:c.status,url:c.url,title:c.title,tabs:c.tabs,targetId:c.targetId,frame:u,actions:b,sessionId:r,selectTarget:O,reconnect:V}}function fe(t){return typeof t==="string"&&t?t:null}function ee(t){let[r,d]=n(null);return{closeTab:a(async(l)=>{if(!t||!l)return{ok:!1,next:null,error:"No tab to close"};d(l);try{let u=await fetch(`/api/browser/${encodeURIComponent(t)}/tabs/close`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({targetId:l})}),m=await u.json().catch(()=>({}));if(!u.ok)return{ok:!1,next:null,error:typeof m.error==="string"&&m.error?m.error:`Close failed (${u.status})`};return{ok:!0,next:fe(m.next)}}catch(u){return{ok:!1,next:null,error:u instanceof Error?u.message:String(u)}}finally{d(null)}},[t]),closing:r}}function it({className:t="",active:r=!0}){let[d,c]=T("browser.zoomLevel",100),{status:l,url:u,title:m,tabs:b,targetId:k,frame:N,actions:B,sessionId:R,selectTarget:g,reconnect:f}=Q(r),{closeTab:w,closing:A}=ee(R),y=X(),[S,O]=n(null),V=y.state?.effective==="webkit"&&!y.state.mock,E=V&&(l==="browser-offline"||l==="no-tab"),L=a(()=>{y.useChromium().then((x)=>{if(x)f()})},[y.useChromium,f]),M=()=>{if(!u)return;let x=u.startsWith("/")&&typeof window<"u"?`${window.location.origin}${u}`:u;window.open(x,"_blank","noopener,noreferrer")},P=a(()=>{if(!u)return;Rc({url:u,title:m})},[u,m]),C=a((x)=>{if(A===x)return;w(x).then((v)=>{if(!v.ok){O(v.error??"The tab could not be closed");return}O(null),g(v.next??"")})},[w,A,g]);return e("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden select-none ${t}`,children:[e(j,{url:u,status:l,zoomLevel:d,onIncludeInChat:P,onReconnect:f,onOpenExternal:M,onZoomIn:()=>c((x)=>Math.min(200,x+10)),onZoomOut:()=>c((x)=>Math.max(50,x-10)),onResetZoom:()=>c(100)}),S&&e("div",{role:"alert",className:"px-2.5 py-1 border-b border-error/30 bg-error/5 text-[11px] text-error flex items-center justify-between gap-2 flex-shrink-0",children:[e("span",{className:"truncate",title:S,children:S}),e("button",{type:"button",onClick:()=>O(null),className:"text-[10px] uppercase tracking-wide text-error/80 hover:text-error cursor-pointer flex-shrink-0",children:"Tutup"})]}),V&&l==="live"&&y.state&&e(_,{saving:y.saving,error:y.error,onUseChromium:L,variant:"strip"}),E&&y.state?e(_,{saving:y.saving,error:y.error,onUseChromium:L,variant:"body"}):e(J,{status:l,url:u,tabs:b,targetId:k,frame:N,actions:B,onSelectTarget:g,onCloseTarget:C,closingTarget:A,zoomLevel:d})]})}export{it as BrowserPanel};
|
package/dist/client/static/js/{infoDiagram-VRGFBTTK-1m0br602.js → infoDiagram-VRGFBTTK-c55t0tvd.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t,l,
|
|
2
|
-
`+r);let a=Ae(e);
|
|
1
|
+
import{t,l,re,Ae}from"./index-xfnjwhan.js";import{$e}from"./index-cwwg7k5f.js";var n={parse:t(async(r)=>{let e=await $e("info",r);l.debug(e)},"parse")},i={version:"12.0.0"},s=t(()=>i.version,"getVersion"),p={getVersion:s},g=t((r,e,o)=>{l.debug(`rendering info diagram
|
|
2
|
+
`+r);let a=Ae(e);re(a,100,400,!0),a.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),m={draw:g},y={parser:n,db:p,renderer:m};export{y as diagram};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{t,w,
|
|
1
|
+
import{t,w,re,M,O,G,z,j,q,H,m,Ae,jn,y}from"./index-xfnjwhan.js";var ct=function(){var e=t(function(C,i,n,s){for(n=n||{},s=C.length;s--;n[C[s]]=i);return n},"o"),d=[1,4],r=[1,14],l=[1,12],o=[1,13],f=[6,7,8],g=[1,20],u=[1,18],x=[1,19],c=[6,7,11],_=[1,6,13,14],b=[1,23],S=[1,24],E=[1,6,7,11,13,14],W={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:t(function(i,n,s,h,p,a,A){var v=a.length-1;switch(p){case 6:case 7:return h;case 15:h.addNode(a[v-1].length,a[v].trim());break;case 16:h.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:r,7:[1,10],9:9,12:11,13:l,14:o},e(f,[2,3]),{1:[2,2]},e(f,[2,4]),e(f,[2,5]),{1:[2,6],6:r,12:15,13:l,14:o},{6:r,9:16,12:11,13:l,14:o},{6:g,7:u,10:17,11:x},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:g,7:u,10:22,11:x},{1:[2,7],6:r,12:15,13:l,14:o},e(_,[2,14],{7:b,11:S}),e(E,[2,8]),e(E,[2,9]),e(E,[2,10]),e(c,[2,15]),e(_,[2,13],{7:b,11:S}),e(E,[2,11]),e(E,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:t(function(i){var n=this,s=[0],h=[],p=[null],a=[],A=this.table,v="",B=0,I=0,P=0,N=2,U=1,nt=a.slice.call(arguments,1),k=Object.create(this.lexer),L={yy:{}};for(var X in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,X))L.yy[X]=this.yy[X];if(k.setInput(i,L.yy),L.yy.lexer=k,L.yy.parser=this,typeof k.yylloc>"u")k.yylloc={};var Y=k.yylloc;a.push(Y);var at=k.options&&k.options.ranges;if(typeof L.yy.parseError==="function")this.parseError=L.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function bt(R){s.length=s.length-2*R,p.length=p.length-R,a.length=a.length-R}t(bt,"popStack");function ut(){var R=h.pop()||k.lex()||U;if(typeof R!=="number"){if(R instanceof Array)h=R,R=h.pop();R=n.symbols_[R]||R}return R}t(ut,"lex");var D,rt,K,V,Ot,lt,Q={},et,Z,dt,it;while(!0){if(K=s[s.length-1],this.defaultActions[K])V=this.defaultActions[K];else{if(D===null||typeof D>"u")D=ut();V=A[K]&&A[K][D]}if(typeof V>"u"||!V.length||!V[0]){var ot="";it=[];for(et in A[K])if(this.terminals_[et]&&et>N)it.push("'"+this.terminals_[et]+"'");if(k.showPosition)ot="Parse error on line "+(B+1)+`:
|
|
2
2
|
`+k.showPosition()+`
|
|
3
3
|
Expecting `+it.join(", ")+", got '"+(this.terminals_[D]||D)+"'";else ot="Parse error on line "+(B+1)+": Unexpected "+(D==U?"end of input":"'"+(this.terminals_[D]||D)+"'");this.parseError(ot,{text:k.match,token:this.terminals_[D]||D,line:k.yylineno,loc:Y,expected:it})}if(V[0]instanceof Array&&V.length>1)throw Error("Parse Error: multiple actions possible at state: "+K+", token: "+D);switch(V[0]){case 1:if(s.push(D),p.push(k.yytext),a.push(k.yylloc),s.push(V[1]),D=null,!rt){if(I=k.yyleng,v=k.yytext,B=k.yylineno,Y=k.yylloc,P>0)P--}else D=rt,rt=null;break;case 2:if(Z=this.productions_[V[1]][1],Q.$=p[p.length-Z],Q._$={first_line:a[a.length-(Z||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(Z||1)].first_column,last_column:a[a.length-1].last_column},at)Q._$.range=[a[a.length-(Z||1)].range[0],a[a.length-1].range[1]];if(lt=this.performAction.apply(Q,[v,I,B,L.yy,V[1],p,a].concat(nt)),typeof lt<"u")return lt;if(Z)s=s.slice(0,-1*Z*2),p=p.slice(0,-1*Z),a=a.slice(0,-1*Z);s.push(this.productions_[V[1]][0]),p.push(Q.$),a.push(Q._$),dt=A[s[s.length-2]][s[s.length-1]],s.push(dt);break;case 3:return!0}}return!0},"parse")},F=function(){var C={EOF:1,parseError:t(function(n,s){if(this.yy.parser)this.yy.parser.parseError(n,s);else throw Error(n)},"parseError"),setInput:t(function(i,n){if(this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);if(n)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:t(function(i){var n=i.length,s=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var h=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1)this.yylineno-=s.length-1;var p=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===h.length?this.yylloc.first_column:0)+h[h.length-s.length].length-s[0].length:this.yylloc.first_column-n},this.options.ranges)this.yylloc.range=[p[0],p[0]+this.yyleng-n];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(i){this.unput(this.match.slice(i))},"less"),pastInput:t(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var i=this.pastInput(),n=Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
5
|
`+n+"^"},"showPosition"),test_match:t(function(i,n){var s,h,p;if(this.options.backtrack_lexer){if(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)p.yylloc.range=this.yylloc.range.slice(0)}if(h=i[0].match(/(?:\r\n?|\n).*/g),h)this.yylineno+=h.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],s=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(s)return s;else if(this._backtrack){for(var a in p)this[a]=p[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var i,n,s,h;if(!this._more)this.yytext="",this.match="";var p=this._currentRules();for(var a=0;a<p.length;a++)if(s=this._input.match(this.rules[p[a]]),s&&(!n||s[0].length>n[0].length)){if(n=s,h=a,this.options.backtrack_lexer)if(i=this.test_match(s,p[a]),i!==!1)return i;else if(this._backtrack){n=!1;continue}else return!1;else if(!this.options.flex)break}if(n){if(i=this.test_match(n,p[h]),i!==!1)return i;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:t(function(n){this.conditionStack.push(n)},"begin"),popState:t(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:t(function(n){this.begin(n)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(n,s,h,p){var a=p;switch(h){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return C}();W.lexer=F;function T(){this.yy={}}return t(T,"Parser"),T.prototype=W,W.Parser=T,new T}();ct.parser=ct;var _t=ct,xt=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{t(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,M()}getRoot(){return this.root}addNode(e,d){let r=w.sanitizeText(d,m());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],q(r);return}this.baseLevel??=e;let l=e-this.baseLevel+1;if(l<=0)l=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=l)this.stack.pop();let o=this.stack[this.stack.length-1].node,f={text:r,children:[]};o.children.push(f),this.stack.push({level:l,node:f})}getAccTitle(){return G()}setAccTitle(e){O(e)}getAccDescription(){return j()}setAccDescription(e){z(e)}getDiagramTitle(){return H()}setDiagramTitle(e){q(e)}},vt=14,J=250,St=30,Et=60,$t=5,mt=82*Math.PI/180,yt=Math.cos(mt),ft=Math.sin(mt),pt=t((e,d,r)=>{let l=e.node().getBBox(),o=l.width+d*2,f=l.height+d*2;
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:t(function(n){this.conditionStack.push(n)},"begin"),popState:t(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:t(function(n){this.begin(n)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(n,s,h,p){var a=p;switch(h){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return C}();W.lexer=F;function T(){this.yy={}}return t(T,"Parser"),T.prototype=W,W.Parser=T,new T}();ct.parser=ct;var _t=ct,xt=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{t(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,M()}getRoot(){return this.root}addNode(e,d){let r=w.sanitizeText(d,m());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],q(r);return}this.baseLevel??=e;let l=e-this.baseLevel+1;if(l<=0)l=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=l)this.stack.pop();let o=this.stack[this.stack.length-1].node,f={text:r,children:[]};o.children.push(f),this.stack.push({level:l,node:f})}getAccTitle(){return G()}setAccTitle(e){O(e)}getAccDescription(){return j()}setAccDescription(e){z(e)}getDiagramTitle(){return H()}setDiagramTitle(e){q(e)}},vt=14,J=250,St=30,Et=60,$t=5,mt=82*Math.PI/180,yt=Math.cos(mt),ft=Math.sin(mt),pt=t((e,d,r)=>{let l=e.node().getBBox(),o=l.width+d*2,f=l.height+d*2;re(e,f,o,r),e.attr("viewBox",`${l.x-d} ${l.y-d} ${o} ${f}`)},"applyPaddedViewBox"),At=t((e,d,r,l)=>{let f=l.db.getRoot();if(!f)return;let g=m(),{look:u,handDrawnSeed:x,themeVariables:c}=g,_=jn(g.fontSize)[0]??vt,b=u==="handDrawn",S=f.children??[],E=g.ishikawa?.diagramPadding??20,W=g.ishikawa?.useMaxWidth??!1,F=Ae(d),T=F.append("g").attr("class","ishikawa"),C=b?y.svg(F.node()):void 0,i=C?{roughSvg:C,seed:x??0,lineColor:c?.lineColor??"#333",fillColor:c?.mainBkg??"#fff"}:void 0,n=`ishikawa-arrow-${d}`;if(!b)T.append("defs").append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let s=0,h=J,p=b?void 0:tt(T,s,h,s,h,"ishikawa-spine");if(It(T,s,h,f.text,_,i),!S.length){if(b)tt(T,s,h,s,h,"ishikawa-spine",i);pt(F,E,W);return}s-=20;let a=S.filter((k,L)=>L%2===0),A=S.filter((k,L)=>L%2===1),v=gt(a),B=gt(A),I=v.total+B.total,P=J,N=J;if(I>0){let k=J*2,L=J*0.3;P=Math.max(L,k*(v.total/I)),N=Math.max(L,k*(B.total/I))}let U=_*2;if(P=Math.max(P,v.max*U),N=Math.max(N,B.max*U),h=Math.max(P,J),p)p.attr("y1",h).attr("y2",h);T.select(".ishikawa-head-group").attr("transform",`translate(0,${h})`);let nt=Math.ceil(S.length/2);for(let k=0;k<nt;k++){let L=T.append("g").attr("class","ishikawa-pair");for(let[X,Y,at]of[[S[k*2],-1,P],[S[k*2+1],1,N]])if(X)Mt(L,X,s,h,Y,at,_,i);s=L.selectAll("text").nodes().reduce((X,Y)=>Math.min(X,Y.getBBox().x),1/0)}if(b)tt(T,s,h,0,h,"ishikawa-spine",i);else{p.attr("x1",s);let k=`url(#${n})`;T.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",k)}pt(F,E,W)},"draw"),gt=t((e)=>{let d=t((r)=>r.children.reduce((l,o)=>l+1+d(o),0),"countDescendants");return e.reduce((r,l)=>{let o=d(l);return r.total+=o,r.max=Math.max(r.max,o),r},{total:0,max:0})},"sideStats"),It=t((e,d,r,l,o,f)=>{let g=Math.max(6,Math.floor(110/(o*0.6))),u=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${d},${r})`),x=st(u,wt(l,g),0,0,"ishikawa-head-label","start",o),c=x.node().getBBox(),_=Math.max(60,c.width+6),b=Math.max(40,c.height*2+40),S=`M 0 ${-b/2} L 0 ${b/2} Q ${_*2.4} 0 0 ${-b/2} Z`;if(f){let E=f.roughSvg.path(S,{roughness:1.5,seed:f.seed,fill:f.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:f.lineColor,strokeWidth:2});u.insert(()=>E,":first-child").attr("class","ishikawa-head")}else u.insert("path",":first-child").attr("class","ishikawa-head").attr("d",S);x.attr("transform",`translate(${(_-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),Lt=t((e,d)=>{let r=[],l=[],o=t((f,g,u)=>{let x=d===-1?[...f].reverse():f;for(let c of x){let _=r.length,b=c.children??[];if(r.push({depth:u,text:wt(c.text,15),parentIndex:g,childCount:b.length}),u%2===0){if(l.push(_),b.length)o(b,_,u+1)}else{if(b.length)o(b,_,u+1);l.push(_)}}},"walk");return o(e,-1,2),{entries:r,yOrder:l}},"flattenTree"),Tt=t((e,d,r,l,o,f,g)=>{let u=e.append("g").attr("class","ishikawa-label-group"),c=st(u,d,r,l+11*o,"ishikawa-label cause","middle",f).node().getBBox();if(g){let _=g.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:g.seed,fill:g.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:g.lineColor,strokeWidth:2});u.insert(()=>_,":first-child").attr("class","ishikawa-label-box")}else u.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",c.x-20).attr("y",c.y-2).attr("width",c.width+40).attr("height",c.height+4)},"drawCauseLabel"),ht=t((e,d,r,l,o,f)=>{let g=Math.sqrt(l*l+o*o);if(g===0)return;let u=l/g,x=o/g,c=6,_=-x*c,b=u*c,S=d,E=r,W=`M ${S} ${E} L ${S-u*c*2+_} ${E-x*c*2+b} L ${S-u*c*2-_} ${E-x*c*2-b} Z`,F=f.roughSvg.path(W,{roughness:1,seed:f.seed,fill:f.lineColor,fillStyle:"solid",stroke:f.lineColor,strokeWidth:1});e.append(()=>F)},"drawArrowMarker"),Mt=t((e,d,r,l,o,f,g,u)=>{let x=d.children??[],c=f*(x.length?1:0.2),_=-yt*c,b=ft*c*o,S=r+_,E=l+b;if(tt(e,r,l,S,E,"ishikawa-branch",u),u)ht(e,r,l,r-S,l-E,u);if(Tt(e,d.text,S,E,o,g,u),!x.length)return;let{entries:W,yOrder:F}=Lt(x,o),T=W.length,C=Array(T);for(let[p,a]of F.entries())C[a]=l+b*((p+1)/(T+1));let i=new Map;i.set(-1,{x0:r,y0:l,x1:S,y1:E,childCount:x.length,childrenDrawn:0});let n=-yt,s=ft*o,h=o<0?"ishikawa-label up":"ishikawa-label down";for(let[p,a]of W.entries()){let A=C[p],v=i.get(a.parentIndex),B=e.append("g").attr("class","ishikawa-sub-group"),I=0,P=0,N=0;if(a.depth%2===0){let U=v.y1-v.y0;if(I=kt(v.x0,v.x1,U?(A-v.y0)/U:0.5),P=A,N=I-(a.childCount>0?Et+a.childCount*$t:St),tt(B,I,A,N,A,"ishikawa-sub-branch",u),u)ht(B,I,A,1,0,u);st(B,a.text,N,A,"ishikawa-label align","end",g)}else{let U=v.childrenDrawn++;if(I=kt(v.x0,v.x1,(v.childCount-U)/(v.childCount+1)),P=v.y0,N=I+n*((A-P)/s),tt(B,I,P,N,A,"ishikawa-sub-branch",u),u)ht(B,I,P,I-N,P-A,u);st(B,a.text,N,A,h,"end",g)}if(a.childCount>0)i.set(p,{x0:I,y0:P,x1:N,y1:A,childCount:a.childCount,childrenDrawn:0})}},"drawBranch"),Pt=t((e)=>e.split(/<br\s*\/?>|\n/),"splitLines"),wt=t((e,d)=>{if(e.length<=d)return e;let r=[];for(let l of e.split(/\s+/)){let o=r.length-1;if(o>=0&&r[o].length+1+l.length<=d)r[o]+=" "+l;else r.push(l)}return r.join(`
|
|
7
7
|
`)},"wrapText"),st=t((e,d,r,l,o,f,g)=>{let u=Pt(d),x=g*1.05,c=e.append("text").attr("class",o).attr("text-anchor",f).attr("x",r).attr("y",l-(u.length-1)*x/2);for(let[_,b]of u.entries())c.append("tspan").attr("x",r).attr("dy",_===0?0:x).text(b);return c},"drawMultilineText"),kt=t((e,d,r)=>e+(d-e)*r,"lerp"),tt=t((e,d,r,l,o,f,g)=>{if(g){let u=g.roughSvg.line(d,r,l,o,{roughness:1.5,seed:g.seed,stroke:g.lineColor,strokeWidth:2});e.append(()=>u).attr("class",f);return}return e.append("line").attr("class",f).attr("x1",d).attr("y1",r).attr("x2",l).attr("y2",o)},"drawLine"),Bt={draw:At},Nt=t((e)=>`
|
|
8
8
|
.ishikawa .ishikawa-spine,
|
|
9
9
|
.ishikawa .ishikawa-branch,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t,
|
|
1
|
+
import{t,re,M,O,G,z,j,q,H,m,b,ea,Hn}from"./index-xfnjwhan.js";import{ii,ld,YA,gr}from"./index-zynbvm7x.js";var it=function(){var e=t(function(h,n,s,l){for(s=s||{},l=h.length;l--;s[h[l]]=n);return s},"o"),r=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:t(function(n,s,l,y,d,c,w){var _=c.length-1;switch(d){case 1:return c[_-1];case 2:this.$=[];break;case 3:c[_-1].push(c[_]),this.$=c[_-1];break;case 4:case 5:this.$=c[_];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[_].substr(6)),this.$=c[_].substr(6);break;case 9:this.$=c[_].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[_].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[_].substr(8)),this.$=c[_].substr(8);break;case 13:y.addTask(c[_-1],c[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},e(r,[2,7],{1:[2,1]}),e(r,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},e(r,[2,5]),e(r,[2,6]),e(r,[2,8]),{13:[1,16]},{15:[1,17]},e(r,[2,11]),e(r,[2,12]),{19:[1,18]},e(r,[2,4]),e(r,[2,9]),e(r,[2,10]),e(r,[2,13])],defaultActions:{},parseError:t(function(n,s){if(s.recoverable)this.trace(n);else{var l=Error(n);throw l.hash=s,l}},"parseError"),parse:t(function(n){var s=this,l=[0],y=[],d=[null],c=[],w=this.table,_="",F=0,lt=0,ot=0,bt=2,ct=1,_t=c.slice.call(arguments,1),v=Object.create(this.lexer),R={yy:{}};for(var K in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,K))R.yy[K]=this.yy[K];if(v.setInput(n,R.yy),R.yy.lexer=v,R.yy.parser=this,typeof v.yylloc>"u")v.yylloc={};var Q=v.yylloc;c.push(Q);var vt=v.options&&v.options.ranges;if(typeof R.yy.parseError==="function")this.parseError=R.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function wt(E){l.length=l.length-2*E,d.length=d.length-E,c.length=c.length-E}t(wt,"popStack");function ht(){var E=y.pop()||v.lex()||ct;if(typeof E!=="number"){if(E instanceof Array)y=E,E=y.pop();E=s.symbols_[E]||E}return E}t(ht,"lex");var T,D,L,S,qt,tt,B={},U,I,ut,Z;while(!0){if(L=l[l.length-1],this.defaultActions[L])S=this.defaultActions[L];else{if(T===null||typeof T>"u")T=ht();S=w[L]&&w[L][T]}if(typeof S>"u"||!S.length||!S[0]){var et="";Z=[];for(U in w[L])if(this.terminals_[U]&&U>bt)Z.push("'"+this.terminals_[U]+"'");if(v.showPosition)et="Parse error on line "+(F+1)+`:
|
|
2
2
|
`+v.showPosition()+`
|
|
3
3
|
Expecting `+Z.join(", ")+", got '"+(this.terminals_[T]||T)+"'";else et="Parse error on line "+(F+1)+": Unexpected "+(T==ct?"end of input":"'"+(this.terminals_[T]||T)+"'");this.parseError(et,{text:v.match,token:this.terminals_[T]||T,line:v.yylineno,loc:Q,expected:Z})}if(S[0]instanceof Array&&S.length>1)throw Error("Parse Error: multiple actions possible at state: "+L+", token: "+T);switch(S[0]){case 1:if(l.push(T),d.push(v.yytext),c.push(v.yylloc),l.push(S[1]),T=null,!D){if(lt=v.yyleng,_=v.yytext,F=v.yylineno,Q=v.yylloc,ot>0)ot--}else T=D,D=null;break;case 2:if(I=this.productions_[S[1]][1],B.$=d[d.length-I],B._$={first_line:c[c.length-(I||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(I||1)].first_column,last_column:c[c.length-1].last_column},vt)B._$.range=[c[c.length-(I||1)].range[0],c[c.length-1].range[1]];if(tt=this.performAction.apply(B,[_,lt,F,R.yy,S[1],d,c].concat(_t)),typeof tt<"u")return tt;if(I)l=l.slice(0,-1*I*2),d=d.slice(0,-1*I),c=c.slice(0,-1*I);l.push(this.productions_[S[1]][0]),d.push(B.$),c.push(B._$),ut=w[l[l.length-2]][l[l.length-1]],l.push(ut);break;case 3:return!0}}return!0},"parse")},x=function(){var h={EOF:1,parseError:t(function(s,l){if(this.yy.parser)this.yy.parser.parseError(s,l);else throw Error(s)},"parseError"),setInput:t(function(n,s){if(this.yy=s||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var s=n.match(/(?:\r\n?|\n).*/g);if(s)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),n},"input"),unput:t(function(n){var s=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var y=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1)this.yylineno-=l.length-1;var d=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-s},this.options.ranges)this.yylloc.range=[d[0],d[0]+this.yyleng-s];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(n){this.unput(this.match.slice(n))},"less"),pastInput:t(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var n=this.match;if(n.length<20)n+=this._input.substr(0,20-n.length);return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var n=this.pastInput(),s=Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
@@ -136,4 +136,4 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[T]||T)+"'";else et="Parse er
|
|
|
136
136
|
${e.actor5?`fill: ${e.actor5}`:""};
|
|
137
137
|
}
|
|
138
138
|
${Hn()}
|
|
139
|
-
`,"getStyles"),Vt=Ft,at=t(function(e,r){return ii(e,r)},"drawRect"),Rt=t(function(e,r){let f=e.append("circle").attr("cx",r.cx).attr("cy",r.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=e.append("g");i.append("circle").attr("cx",r.cx-5).attr("cy",r.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",r.cx+5).attr("cy",r.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function u(g){let x=ea().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",x).attr("transform","translate("+r.cx+","+(r.cy+2)+")")}t(u,"smile");function p(g){let x=ea().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",x).attr("transform","translate("+r.cx+","+(r.cy+7)+")")}t(p,"sad");function o(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",r.cx-5).attr("y1",r.cy+7).attr("x2",r.cx+5).attr("y2",r.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}if(t(o,"ambivalent"),r.score>3)u(i);else if(r.score<3)p(i);else o(i);return f},"drawFace"),gt=t(function(e,r){let a=e.append("circle");if(a.attr("cx",r.cx),a.attr("cy",r.cy),a.attr("class","actor-"+r.pos),a.attr("fill",r.fill),a.attr("stroke",r.stroke),a.attr("r",r.r),a.class!==void 0)a.attr("class",a.class);if(r.title!==void 0)a.append("title").text(r.title);return a},"drawCircle"),mt=t(function(e,r){return YA(e,r)},"drawText"),Lt=t(function(e,r){function a(i,u,p,o,g){return i+","+u+" "+(i+p)+","+u+" "+(i+p)+","+(u+o-g)+" "+(i+p-g*1.2)+","+(u+o)+" "+i+","+(u+o)}t(a,"genPoints");let f=e.append("polygon");f.attr("points",a(r.x,r.y,50,20,7)),f.attr("class","labelBox"),r.y=r.y+r.labelMargin,r.x=r.x+0.5*r.labelMargin,mt(e,r)},"drawLabel"),Bt=t(function(e,r,a){let f=e.append("g"),i=gr();i.x=r.x,i.y=r.y,i.fill=r.fill,i.width=a.width*r.taskCount+a.diagramMarginX*(r.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+r.num,i.rx=3,i.ry=3,at(f,i),xt(a)(r.text,f,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+r.num},a,r.colour)},"drawSection"),nt=-1,jt=t(function(e,r,a,f){let i=r.x+a.width/2,u=e.append("g");nt++;let p=450;u.append("line").attr("id",f+"-task"+nt).attr("x1",i).attr("y1",r.y).attr("x2",i).attr("y2",p).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Rt(u,{cx:i,cy:300+(5-r.score)*30,score:r.score});let o=gr();o.x=r.x,o.y=r.y,o.fill=r.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+r.num,o.rx=3,o.ry=3,at(u,o);let g=r.x+14;r.people.forEach((x)=>{let k=r.actors[x].color,h={cx:g,cy:r.y,r:7,fill:k,stroke:"#000",title:x,pos:r.actors[x].position};gt(u,h),g+=10}),xt(a)(r.task,u,o.x,o.y,o.width,o.height,{class:"task"},a,r.colour)},"drawTask"),Nt=t(function(e,r){ld(e,r)},"drawBackgroundRect"),xt=function(){function e(i,u,p,o,g,x,k,h){let n=u.append("text").attr("x",p+g/2).attr("y",o+x/2+5).style("font-color",h).style("text-anchor","middle").text(i);f(n,k)}t(e,"byText");function r(i,u,p,o,g,x,k,h,n){let{taskFontSize:s,taskFontFamily:l}=h,y=i.split(/<br\s*\/?>/gi);for(let d=0;d<y.length;d++){let c=d*s-s*(y.length-1)/2,w=u.append("text").attr("x",p+g/2).attr("y",o).attr("fill",n).style("text-anchor","middle").style("font-size",s).style("font-family",l);w.append("tspan").attr("x",p+g/2).attr("dy",c).text(y[d]),w.attr("y",o+x/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),f(w,k)}}t(r,"byTspan");function a(i,u,p,o,g,x,k,h){let n=u.append("switch"),l=n.append("foreignObject").attr("x",p).attr("y",o).attr("width",g).attr("height",x).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),r(i,n,p,o,g,x,k,h),f(l,k)}t(a,"byFo");function f(i,u){for(let p in u)if(p in u)i.attr(p,u[p])}return t(f,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?e:r}}(),zt=t(function(e,r){nt=-1,e.append("defs").append("marker").attr("id",r+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics"),X={drawRect:at,drawCircle:gt,drawSection:Bt,drawText:mt,drawLabel:Lt,drawTask:jt,drawBackgroundRect:Nt,initGraphics:zt},Wt=t(function(e){Object.keys(e).forEach(function(a){P[a]=e[a]})},"setConf"),A={},J=0;function kt(e){let r=m().journey,a=r.maxLabelWidth;J=0;let f=60;Object.keys(A).forEach((i)=>{let u=A[i].color,p={cx:20,cy:f,r:7,fill:u,stroke:"#000",pos:A[i].position};X.drawCircle(e,p);let o=e.append("text").attr("visibility","hidden").text(i),g=o.node().getBoundingClientRect().width;o.remove();let x=[];if(g<=a)x=[i];else{let k=i.split(" "),h="";if(o=e.append("text").attr("visibility","hidden"),k.forEach((n)=>{let s=h?`${h} ${n}`:n;if(o.text(s),o.node().getBoundingClientRect().width>a){if(h)x.push(h);if(h=n,o.text(n),o.node().getBoundingClientRect().width>a){let y="";for(let d of n)if(y+=d,o.text(y+"-"),o.node().getBoundingClientRect().width>a)x.push(y.slice(0,-1)+"-"),y=d;h=y}}else h=s}),h)x.push(h);o.remove()}x.forEach((k,h)=>{let n={x:40,y:f+7+h*20,fill:"#666",text:k,textMargin:r.boxTextMargin??5},l=X.drawText(e,n).node().getBoundingClientRect().width;if(l>J&&l>r.leftMargin-l)J=l}),f+=Math.max(20,x.length*20)})}t(kt,"drawActorLegend");var P=m().journey,V=0,Ot=t(function(e,r,a,f){let i=m(),u=i.journey.titleColor,p=i.journey.titleFontSize,o=i.journey.titleFontFamily,g=i.securityLevel,x;if(g==="sandbox")x=b("#i"+r);let k=g==="sandbox"?b(x.nodes()[0].contentDocument.body):b("body");C.init();let h=k.select("#"+r);X.initGraphics(h,r);let n=f.db.getTasks(),s=f.db.getDiagramTitle(),l=f.db.getActors();for(let F in A)delete A[F];let y=0;l.forEach((F)=>{A[F]={color:P.actorColours[y%P.actorColours.length],position:y},y++}),kt(h),V=P.leftMargin+J,C.insert(0,0,V,Object.keys(A).length*50),Yt(h,n,0,r);let d=C.getBounds();if(s)h.append("text").text(s).attr("x",V).attr("font-size",p).attr("font-weight","bold").attr("y",25).attr("fill",u).attr("font-family",o);let c=d.stopy-d.starty+2*P.diagramMarginY,w=V+d.stopx+2*P.diagramMarginX;
|
|
139
|
+
`,"getStyles"),Vt=Ft,at=t(function(e,r){return ii(e,r)},"drawRect"),Rt=t(function(e,r){let f=e.append("circle").attr("cx",r.cx).attr("cy",r.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=e.append("g");i.append("circle").attr("cx",r.cx-5).attr("cy",r.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",r.cx+5).attr("cy",r.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function u(g){let x=ea().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",x).attr("transform","translate("+r.cx+","+(r.cy+2)+")")}t(u,"smile");function p(g){let x=ea().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",x).attr("transform","translate("+r.cx+","+(r.cy+7)+")")}t(p,"sad");function o(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",r.cx-5).attr("y1",r.cy+7).attr("x2",r.cx+5).attr("y2",r.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}if(t(o,"ambivalent"),r.score>3)u(i);else if(r.score<3)p(i);else o(i);return f},"drawFace"),gt=t(function(e,r){let a=e.append("circle");if(a.attr("cx",r.cx),a.attr("cy",r.cy),a.attr("class","actor-"+r.pos),a.attr("fill",r.fill),a.attr("stroke",r.stroke),a.attr("r",r.r),a.class!==void 0)a.attr("class",a.class);if(r.title!==void 0)a.append("title").text(r.title);return a},"drawCircle"),mt=t(function(e,r){return YA(e,r)},"drawText"),Lt=t(function(e,r){function a(i,u,p,o,g){return i+","+u+" "+(i+p)+","+u+" "+(i+p)+","+(u+o-g)+" "+(i+p-g*1.2)+","+(u+o)+" "+i+","+(u+o)}t(a,"genPoints");let f=e.append("polygon");f.attr("points",a(r.x,r.y,50,20,7)),f.attr("class","labelBox"),r.y=r.y+r.labelMargin,r.x=r.x+0.5*r.labelMargin,mt(e,r)},"drawLabel"),Bt=t(function(e,r,a){let f=e.append("g"),i=gr();i.x=r.x,i.y=r.y,i.fill=r.fill,i.width=a.width*r.taskCount+a.diagramMarginX*(r.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+r.num,i.rx=3,i.ry=3,at(f,i),xt(a)(r.text,f,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+r.num},a,r.colour)},"drawSection"),nt=-1,jt=t(function(e,r,a,f){let i=r.x+a.width/2,u=e.append("g");nt++;let p=450;u.append("line").attr("id",f+"-task"+nt).attr("x1",i).attr("y1",r.y).attr("x2",i).attr("y2",p).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Rt(u,{cx:i,cy:300+(5-r.score)*30,score:r.score});let o=gr();o.x=r.x,o.y=r.y,o.fill=r.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+r.num,o.rx=3,o.ry=3,at(u,o);let g=r.x+14;r.people.forEach((x)=>{let k=r.actors[x].color,h={cx:g,cy:r.y,r:7,fill:k,stroke:"#000",title:x,pos:r.actors[x].position};gt(u,h),g+=10}),xt(a)(r.task,u,o.x,o.y,o.width,o.height,{class:"task"},a,r.colour)},"drawTask"),Nt=t(function(e,r){ld(e,r)},"drawBackgroundRect"),xt=function(){function e(i,u,p,o,g,x,k,h){let n=u.append("text").attr("x",p+g/2).attr("y",o+x/2+5).style("font-color",h).style("text-anchor","middle").text(i);f(n,k)}t(e,"byText");function r(i,u,p,o,g,x,k,h,n){let{taskFontSize:s,taskFontFamily:l}=h,y=i.split(/<br\s*\/?>/gi);for(let d=0;d<y.length;d++){let c=d*s-s*(y.length-1)/2,w=u.append("text").attr("x",p+g/2).attr("y",o).attr("fill",n).style("text-anchor","middle").style("font-size",s).style("font-family",l);w.append("tspan").attr("x",p+g/2).attr("dy",c).text(y[d]),w.attr("y",o+x/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),f(w,k)}}t(r,"byTspan");function a(i,u,p,o,g,x,k,h){let n=u.append("switch"),l=n.append("foreignObject").attr("x",p).attr("y",o).attr("width",g).attr("height",x).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),r(i,n,p,o,g,x,k,h),f(l,k)}t(a,"byFo");function f(i,u){for(let p in u)if(p in u)i.attr(p,u[p])}return t(f,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?e:r}}(),zt=t(function(e,r){nt=-1,e.append("defs").append("marker").attr("id",r+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics"),X={drawRect:at,drawCircle:gt,drawSection:Bt,drawText:mt,drawLabel:Lt,drawTask:jt,drawBackgroundRect:Nt,initGraphics:zt},Wt=t(function(e){Object.keys(e).forEach(function(a){P[a]=e[a]})},"setConf"),A={},J=0;function kt(e){let r=m().journey,a=r.maxLabelWidth;J=0;let f=60;Object.keys(A).forEach((i)=>{let u=A[i].color,p={cx:20,cy:f,r:7,fill:u,stroke:"#000",pos:A[i].position};X.drawCircle(e,p);let o=e.append("text").attr("visibility","hidden").text(i),g=o.node().getBoundingClientRect().width;o.remove();let x=[];if(g<=a)x=[i];else{let k=i.split(" "),h="";if(o=e.append("text").attr("visibility","hidden"),k.forEach((n)=>{let s=h?`${h} ${n}`:n;if(o.text(s),o.node().getBoundingClientRect().width>a){if(h)x.push(h);if(h=n,o.text(n),o.node().getBoundingClientRect().width>a){let y="";for(let d of n)if(y+=d,o.text(y+"-"),o.node().getBoundingClientRect().width>a)x.push(y.slice(0,-1)+"-"),y=d;h=y}}else h=s}),h)x.push(h);o.remove()}x.forEach((k,h)=>{let n={x:40,y:f+7+h*20,fill:"#666",text:k,textMargin:r.boxTextMargin??5},l=X.drawText(e,n).node().getBoundingClientRect().width;if(l>J&&l>r.leftMargin-l)J=l}),f+=Math.max(20,x.length*20)})}t(kt,"drawActorLegend");var P=m().journey,V=0,Ot=t(function(e,r,a,f){let i=m(),u=i.journey.titleColor,p=i.journey.titleFontSize,o=i.journey.titleFontFamily,g=i.securityLevel,x;if(g==="sandbox")x=b("#i"+r);let k=g==="sandbox"?b(x.nodes()[0].contentDocument.body):b("body");C.init();let h=k.select("#"+r);X.initGraphics(h,r);let n=f.db.getTasks(),s=f.db.getDiagramTitle(),l=f.db.getActors();for(let F in A)delete A[F];let y=0;l.forEach((F)=>{A[F]={color:P.actorColours[y%P.actorColours.length],position:y},y++}),kt(h),V=P.leftMargin+J,C.insert(0,0,V,Object.keys(A).length*50),Yt(h,n,0,r);let d=C.getBounds();if(s)h.append("text").text(s).attr("x",V).attr("font-size",p).attr("font-weight","bold").attr("y",25).attr("fill",u).attr("font-family",o);let c=d.stopy-d.starty+2*P.diagramMarginY,w=V+d.stopx+2*P.diagramMarginX;re(h,c,w,P.useMaxWidth),h.append("line").attr("x1",V).attr("y1",P.height*4).attr("x2",w-V-4).attr("y2",P.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+r+"-arrowhead)");let _=s?70:0;h.attr("viewBox",`${d.startx} -25 ${w} ${c+_}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",c+_+25)},"draw"),C={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:t(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:t(function(e,r,a,f){if(e[r]===void 0)e[r]=a;else e[r]=f(a,e[r])},"updateVal"),updateBounds:t(function(e,r,a,f){let i=m().journey,u=this,p=0;function o(g){return t(function(k){p++;let h=u.sequenceItems.length-p+1;if(u.updateVal(k,"starty",r-h*i.boxMargin,Math.min),u.updateVal(k,"stopy",f+h*i.boxMargin,Math.max),u.updateVal(C.data,"startx",e-h*i.boxMargin,Math.min),u.updateVal(C.data,"stopx",a+h*i.boxMargin,Math.max),g!=="activation")u.updateVal(k,"startx",e-h*i.boxMargin,Math.min),u.updateVal(k,"stopx",a+h*i.boxMargin,Math.max),u.updateVal(C.data,"starty",r-h*i.boxMargin,Math.min),u.updateVal(C.data,"stopy",f+h*i.boxMargin,Math.max)},"updateItemBounds")}t(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:t(function(e,r,a,f){let i=Math.min(e,a),u=Math.max(e,a),p=Math.min(r,f),o=Math.max(r,f);this.updateVal(C.data,"startx",i,Math.min),this.updateVal(C.data,"starty",p,Math.min),this.updateVal(C.data,"stopx",u,Math.max),this.updateVal(C.data,"stopy",o,Math.max),this.updateBounds(i,p,u,o)},"insert"),bumpVerticalPos:t(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:t(function(){return this.verticalPos},"getVerticalPos"),getBounds:t(function(){return this.data},"getBounds")},{sectionFills:rt,sectionColours:ft}=P,Yt=t(function(e,r,a,f){let i=m().journey,u="",p=i.height*2+i.diagramMarginY,o=a+p,g=0,x="#CCC",k="black",h=0;for(let[n,s]of r.entries()){if(u!==s.section){x=rt[g%rt.length],h=g%rt.length,k=ft[g%ft.length];let y=0,d=s.section;for(let w=n;w<r.length;w++)if(r[w].section==d)y=y+1;else break;let c={x:n*i.taskMargin+n*i.width+V,y:50,text:s.section,fill:x,num:h,colour:k,taskCount:y};X.drawSection(e,c,i),u=s.section,g++}let l=s.people.reduce((y,d)=>{if(A[d])y[d]=A[d];return y},{});s.x=n*i.taskMargin+n*i.width+V,s.y=o,s.width=i.diagramMarginX,s.height=i.diagramMarginY,s.colour=k,s.fill=x,s.num=h,s.actors=l,X.drawTask(e,s,i,f),C.insert(s.x,s.y,s.x+s.width+i.taskMargin,450)}},"drawTasks"),pt={setConf:Wt,draw:Ot},Qt={parser:Tt,db:dt,renderer:pt,styles:Vt,init:t((e)=>{pt.setConf(e.journey),dt.clear()},"init")};export{Qt as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t,l,De,g,A,Y,te,Xr,m,Ae,Ar,hr,wa,na,So,Hn}from"./index-
|
|
1
|
+
import{t,l,De,g,A,Y,te,Xr,m,Ae,Ar,hr,wa,na,So,Hn}from"./index-xfnjwhan.js";var re=function(){var e=t(function(w,r,i,a){for(i=i||{},a=w.length;a--;i[w[a]]=r);return i},"o"),d=[1,4],b=[1,13],s=[1,12],f=[1,15],S=[1,16],_=[1,20],h=[1,19],I=[6,7,8],T=[1,26],p=[1,24],P=[1,25],N=[6,7,11],W=[1,31],v=[6,7,11,24],M=[1,6,13,16,17,20,23],y=[1,35],V=[1,36],C=[1,6,7,11,13,16,17,20,23],z=[1,38],B={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(r,i,a,o,u,n,j){var c=n.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",n[c-1].id),o.addNode(n[c-2].length,n[c-1].id,n[c-1].descr,n[c-1].type,n[c]);break;case 16:o.getLogger().info("Node: ",n[c].id),o.addNode(n[c-1].length,n[c].id,n[c].descr,n[c].type);break;case 17:o.getLogger().trace("Icon: ",n[c]),o.decorateNode({icon:n[c]});break;case 18:case 23:o.decorateNode({class:n[c]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",n[c-1].id),o.addNode(0,n[c-1].id,n[c-1].descr,n[c-1].type,n[c]);break;case 21:o.getLogger().trace("Node: ",n[c].id),o.addNode(0,n[c].id,n[c].descr,n[c].type);break;case 22:o.decorateNode({icon:n[c]});break;case 27:o.getLogger().trace("node found ..",n[c-2]),this.$={id:n[c-1],descr:n[c-1],type:o.getType(n[c-2],n[c])};break;case 28:this.$={id:n[c],descr:n[c],type:0};break;case 29:o.getLogger().trace("node found ..",n[c-3]),this.$={id:n[c-3],descr:n[c-1],type:o.getType(n[c-2],n[c])};break;case 30:this.$=n[c-1]+n[c];break;case 31:this.$=n[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:b,7:[1,10],9:9,12:11,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},e(I,[2,3]),{1:[2,2]},e(I,[2,4]),e(I,[2,5]),{1:[2,6],6:b,12:21,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},{6:b,9:22,12:11,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},{6:T,7:p,10:23,11:P},e(N,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:_,23:h}),e(N,[2,19]),e(N,[2,21],{15:30,24:W}),e(N,[2,22]),e(N,[2,23]),e(v,[2,25]),e(v,[2,26]),e(v,[2,28],{20:[1,32]}),{21:[1,33]},{6:T,7:p,10:34,11:P},{1:[2,7],6:b,12:21,13:s,14:14,16:f,17:S,18:17,19:18,20:_,23:h},e(M,[2,14],{7:y,11:V}),e(C,[2,8]),e(C,[2,9]),e(C,[2,10]),e(N,[2,16],{15:37,24:W}),e(N,[2,17]),e(N,[2,18]),e(N,[2,20],{24:z}),e(v,[2,31]),{21:[1,39]},{22:[1,40]},e(M,[2,13],{7:y,11:V}),e(C,[2,11]),e(C,[2,12]),e(N,[2,15],{24:z}),e(v,[2,30]),{22:[1,41]},e(v,[2,27]),e(v,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(r,i){if(i.recoverable)this.trace(r);else{var a=Error(r);throw a.hash=i,a}},"parseError"),parse:t(function(r){var i=this,a=[0],o=[],u=[null],n=[],j=this.table,c="",X=0,ce=0,le=0,pe=2,he=1,fe=n.slice.call(arguments,1),E=Object.create(this.lexer),F={yy:{}};for(var Q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Q))F.yy[Q]=this.yy[Q];if(E.setInput(r,F.yy),F.yy.lexer=E,F.yy.parser=this,typeof E.yylloc>"u")E.yylloc={};var Z=E.yylloc;n.push(Z);var be=E.options&&E.options.ranges;if(typeof F.yy.parseError==="function")this.parseError=F.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ye(L){a.length=a.length-2*L,u.length=u.length-L,n.length=n.length-L}t(ye,"popStack");function ue(){var L=o.pop()||E.lex()||he;if(typeof L!=="number"){if(L instanceof Array)o=L,L=o.pop();L=i.symbols_[L]||L}return L}t(ue,"lex");var x,ee,G,D,je,ne,H={},K,R,ge,J;while(!0){if(G=a[a.length-1],this.defaultActions[G])D=this.defaultActions[G];else{if(x===null||typeof x>"u")x=ue();D=j[G]&&j[G][x]}if(typeof D>"u"||!D.length||!D[0]){var ie="";J=[];for(K in j[G])if(this.terminals_[K]&&K>pe)J.push("'"+this.terminals_[K]+"'");if(E.showPosition)ie="Parse error on line "+(X+1)+`:
|
|
2
2
|
`+E.showPosition()+`
|
|
3
3
|
Expecting `+J.join(", ")+", got '"+(this.terminals_[x]||x)+"'";else ie="Parse error on line "+(X+1)+": Unexpected "+(x==he?"end of input":"'"+(this.terminals_[x]||x)+"'");this.parseError(ie,{text:E.match,token:this.terminals_[x]||x,line:E.yylineno,loc:Z,expected:J})}if(D[0]instanceof Array&&D.length>1)throw Error("Parse Error: multiple actions possible at state: "+G+", token: "+x);switch(D[0]){case 1:if(a.push(x),u.push(E.yytext),n.push(E.yylloc),a.push(D[1]),x=null,!ee){if(ce=E.yyleng,c=E.yytext,X=E.yylineno,Z=E.yylloc,le>0)le--}else x=ee,ee=null;break;case 2:if(R=this.productions_[D[1]][1],H.$=u[u.length-R],H._$={first_line:n[n.length-(R||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(R||1)].first_column,last_column:n[n.length-1].last_column},be)H._$.range=[n[n.length-(R||1)].range[0],n[n.length-1].range[1]];if(ne=this.performAction.apply(H,[c,ce,X,F.yy,D[1],u,n].concat(fe)),typeof ne<"u")return ne;if(R)a=a.slice(0,-1*R*2),u=u.slice(0,-1*R),n=n.slice(0,-1*R);a.push(this.productions_[D[1]][0]),u.push(H.$),n.push(H._$),ge=j[a[a.length-2]][a[a.length-1]],a.push(ge);break;case 3:return!0}}return!0},"parse")},q=function(){var w={EOF:1,parseError:t(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw Error(i)},"parseError"),setInput:t(function(r,i){if(this.yy=i||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var i=r.match(/(?:\r\n?|\n).*/g);if(i)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),r},"input"),unput:t(function(r){var i=r.length,a=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var o=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1)this.yylineno-=a.length-1;var u=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-i},this.options.ranges)this.yylloc.range=[u[0],u[0]+this.yyleng-i];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),i=Array(r.length+1).join("-");return r+this.upcomingInput()+`
|