upfynai-code 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -42
- package/bin/cli.js +1 -1
- package/dist/client/assets/AppContent-M14Au3SB.js +542 -0
- package/dist/client/assets/{BrowserPanel-CSvD4jOX.js → BrowserPanel-TFKm2NDJ.js} +2 -2
- package/dist/client/assets/DashboardPanel-C88HjsCh.js +1 -0
- package/dist/client/assets/FileTree-DvO1xnDE.js +1 -0
- package/dist/client/assets/{GitPanel-DdeJ0bp5.js → GitPanel-D-slVlyy.js} +2 -2
- package/dist/client/assets/LoginModal-Chi4SYcr.js +21 -0
- package/dist/client/assets/{MarkdownPreview-CESjI261.js → MarkdownPreview-CuIix2u9.js} +1 -1
- package/dist/client/assets/MermaidBlock-Dq9uFv82.js +2 -0
- package/dist/client/assets/Onboarding-QYXx24dX.js +1 -0
- package/dist/client/assets/{PreviewPanel-CqCa92Tf.js → PreviewPanel-Dd8q-jo0.js} +1 -1
- package/dist/client/assets/{SetupForm-Be7-WBe-.js → SetupForm-CrspaUva.js} +1 -1
- package/dist/client/assets/{WorkflowsPanel-CusLbVJ6.js → WorkflowsPanel-DIlYAdhB.js} +1 -1
- package/dist/client/assets/index-CnNNzw9A.css +1 -0
- package/dist/client/assets/{index-BQy15irW.js → index-rUkK9FDP.js} +18 -18
- package/dist/client/assets/{vendor-codemirror-D2ALgpaX.js → vendor-codemirror-jc6nyJQg.js} +1 -1
- package/dist/client/assets/{vendor-diff-DNQpbhrT.js → vendor-diff-THJmAcEI.js} +1 -1
- package/dist/client/assets/{vendor-icons-kix3Gb31.js → vendor-icons-CfjIpdrD.js} +145 -155
- package/dist/client/assets/{vendor-markdown-CimbIo6Y.js → vendor-markdown-Cdm6NEGf.js} +1 -1
- package/dist/client/assets/{vendor-mermaid-CS3J4_Bz.js → vendor-mermaid-DTPaBx-U.js} +337 -337
- package/dist/client/assets/{vendor-react-96lCPsRK.js → vendor-react-wFkb6mSf.js} +1 -1
- package/dist/client/assets/{vendor-syntax-LS_Nt30I.js → vendor-syntax-C_UZR7tc.js} +1 -1
- package/dist/client/favicon.png +0 -0
- package/dist/client/favicon.svg +2 -12
- package/dist/client/icons/icon-128x128.png +0 -0
- package/dist/client/icons/icon-144x144.png +0 -0
- package/dist/client/icons/icon-152x152.png +0 -0
- package/dist/client/icons/icon-192x192.png +0 -0
- package/dist/client/icons/icon-384x384.png +0 -0
- package/dist/client/icons/icon-512x512.png +0 -0
- package/dist/client/icons/icon-72x72.png +0 -0
- package/dist/client/icons/icon-96x96.png +0 -0
- package/dist/client/index.html +37 -36
- package/dist/client/logo-128.png +0 -0
- package/dist/client/logo-256.png +0 -0
- package/dist/client/logo-32.png +0 -0
- package/dist/client/logo-512.png +0 -0
- package/dist/client/logo-64.png +0 -0
- package/dist/client/logo.png +0 -0
- package/dist/client/mcp-docs.html +1 -1
- package/dist/client/sw.js +2 -2
- package/package.json +9 -9
- package/dist/client/assets/AppContent-BofJquUs.js +0 -545
- package/dist/client/assets/CanvasFullScreen-onRfarpc.js +0 -1
- package/dist/client/assets/CanvasWorkspace-DvGKdL-k.js +0 -259
- package/dist/client/assets/DashboardPanel-DqAHbXDO.js +0 -1
- package/dist/client/assets/FileTree-BE0h-9M9.js +0 -1
- package/dist/client/assets/LoginModal-BP0pCTrH.js +0 -13
- package/dist/client/assets/MermaidBlock-D0rfEhrT.js +0 -2
- package/dist/client/assets/Onboarding-B2zQy-_6.js +0 -1
- package/dist/client/assets/index-CS0fDqEC.js +0 -1
- package/dist/client/assets/index-DYLSCCCp.css +0 -1
- package/dist/client/assets/pdf-CE_K4jFx.js +0 -12
- package/dist/client/assets/vendor-canvas-BZV40eAE.css +0 -1
- package/dist/client/assets/vendor-canvas-QWTduIvM.js +0 -23
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as x,j as e,R as Ee}from"./vendor-react-96lCPsRK.js";import{B as V,I as Ie,S as Fe,c as h}from"./AppContent-BofJquUs.js";import{d as Te,b as Le}from"./index-BQy15irW.js";import{X as ye,a9 as Me,E as ze,ay as Ae,e as xe,n as me,q as De,m as Re,az as y,aA as U,a2 as I,aB as J,aC as Y,aD as ee,S as a,aE as $,aF as F,aG as oe,aH as T,t as j,aI as te,y as w,aJ as G,aK as je,aL as C,aM as S,aN as A,aO as D,aP as E,aQ as Be,aR as b,aS as pe,aT as Oe,aU as ue,aV as R,aW as B,A as ge,aX as Ve,aY as Ue,aZ as O,a_ as fe,a$ as $e,b0 as Ge,ai as Z}from"./vendor-icons-kix3Gb31.js";import{u as qe}from"./LoginModal-BP0pCTrH.js";import"./vendor-syntax-LS_Nt30I.js";import"./vendor-markdown-CimbIo6Y.js";import"./vendor-codemirror-D2ALgpaX.js";import"./vendor-i18n-DCFGyhQR.js";import"./vendor-xterm-CZq1hqo1.js";import"./vendor-canvas-QWTduIvM.js";function _e({file:i,onClose:u}){const d=`/api/projects/${i.projectName}/files/content?path=${encodeURIComponent(i.path)}`,[s,p]=x.useState(null),[L,q]=x.useState(null),[N,g]=x.useState(!0);return x.useEffect(()=>{let f;const M=new AbortController;return(async()=>{try{g(!0),q(null),p(null);const m=await Te(d,{signal:M.signal});if(!m.ok)throw new Error(`Request failed with status ${m.status}`);const _=await m.blob();f=URL.createObjectURL(_),p(f)}catch(m){if(m.name==="AbortError")return;console.error("Error loading image:",m),q("Unable to load image")}finally{g(!1)}})(),()=>{M.abort(),f&&URL.revokeObjectURL(f)}},[d]),e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl max-h-[90vh] w-full mx-4 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:i.name}),e.jsx(V,{variant:"ghost",size:"sm",onClick:u,className:"h-8 w-8 p-0",children:e.jsx(ye,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"p-4 flex justify-center items-center bg-gray-50 dark:bg-gray-900 min-h-[400px]",children:[N&&e.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400",children:e.jsx("p",{children:"Loading image…"})}),!N&&s&&e.jsx("img",{src:s,alt:i.name,className:"max-w-full max-h-[70vh] object-contain rounded-lg shadow-md"}),!N&&!s&&e.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[e.jsx("p",{children:L||"Unable to load image"}),e.jsx("p",{className:"text-sm mt-2 break-all",children:i.path})]})]}),e.jsx("div",{className:"p-4 border-t bg-gray-50 dark:bg-gray-800",children:e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:i.path})})]})})}const He="w-4 h-4 flex-shrink-0",he={js:{icon:R,color:"text-yellow-500"},jsx:{icon:R,color:"text-yellow-500"},mjs:{icon:R,color:"text-yellow-500"},cjs:{icon:R,color:"text-yellow-500"},ts:{icon:B,color:"text-blue-500"},tsx:{icon:B,color:"text-blue-500"},mts:{icon:B,color:"text-blue-500"},py:{icon:Z,color:"text-emerald-500"},pyw:{icon:Z,color:"text-emerald-500"},pyi:{icon:Z,color:"text-emerald-400"},ipynb:{icon:Ge,color:"text-orange-500"},rs:{icon:$,color:"text-orange-600"},toml:{icon:a,color:"text-gray-500"},go:{icon:U,color:"text-cyan-500"},rb:{icon:te,color:"text-red-500"},erb:{icon:te,color:"text-red-400"},php:{icon:$e,color:"text-violet-500"},java:{icon:fe,color:"text-red-600"},jar:{icon:fe,color:"text-red-500"},kt:{icon:U,color:"text-violet-500"},kts:{icon:U,color:"text-violet-400"},c:{icon:O,color:"text-blue-600"},h:{icon:O,color:"text-blue-400"},cpp:{icon:O,color:"text-blue-700"},hpp:{icon:O,color:"text-blue-500"},cc:{icon:O,color:"text-blue-700"},cs:{icon:U,color:"text-purple-600"},swift:{icon:oe,color:"text-orange-500"},lua:{icon:Ue,color:"text-blue-500"},r:{icon:Ve,color:"text-blue-600"},html:{icon:ge,color:"text-orange-600"},htm:{icon:ge,color:"text-orange-600"},css:{icon:F,color:"text-blue-500"},scss:{icon:F,color:"text-pink-500"},sass:{icon:F,color:"text-pink-400"},less:{icon:F,color:"text-indigo-500"},vue:{icon:B,color:"text-emerald-500"},svelte:{icon:B,color:"text-orange-500"},json:{icon:T,color:"text-yellow-600"},jsonc:{icon:T,color:"text-yellow-500"},json5:{icon:T,color:"text-yellow-500"},yaml:{icon:a,color:"text-purple-400"},yml:{icon:a,color:"text-purple-400"},xml:{icon:R,color:"text-orange-500"},csv:{icon:ue,color:"text-green-600"},tsv:{icon:ue,color:"text-green-500"},sql:{icon:Oe,color:"text-blue-500"},graphql:{icon:pe,color:"text-pink-500"},gql:{icon:pe,color:"text-pink-500"},proto:{icon:G,color:"text-green-500"},env:{icon:w,color:"text-yellow-600"},md:{icon:ee,color:"text-blue-500"},mdx:{icon:ee,color:"text-blue-400"},txt:{icon:I,color:"text-gray-500"},doc:{icon:I,color:"text-blue-600"},docx:{icon:I,color:"text-blue-600"},pdf:{icon:Y,color:"text-red-600"},rtf:{icon:I,color:"text-gray-500"},tex:{icon:J,color:"text-teal-600"},rst:{icon:I,color:"text-gray-400"},sh:{icon:j,color:"text-green-500"},bash:{icon:j,color:"text-green-500"},zsh:{icon:j,color:"text-green-400"},fish:{icon:j,color:"text-green-400"},ps1:{icon:j,color:"text-blue-400"},bat:{icon:j,color:"text-gray-500"},cmd:{icon:j,color:"text-gray-500"},png:{icon:b,color:"text-purple-500"},jpg:{icon:b,color:"text-purple-500"},jpeg:{icon:b,color:"text-purple-500"},gif:{icon:b,color:"text-purple-400"},webp:{icon:b,color:"text-purple-400"},ico:{icon:b,color:"text-purple-400"},bmp:{icon:b,color:"text-purple-400"},tiff:{icon:b,color:"text-purple-400"},svg:{icon:Be,color:"text-amber-500"},mp3:{icon:E,color:"text-pink-500"},wav:{icon:E,color:"text-pink-500"},ogg:{icon:E,color:"text-pink-400"},flac:{icon:E,color:"text-pink-400"},aac:{icon:E,color:"text-pink-400"},m4a:{icon:E,color:"text-pink-400"},mp4:{icon:D,color:"text-rose-500"},mov:{icon:D,color:"text-rose-500"},avi:{icon:D,color:"text-rose-500"},webm:{icon:D,color:"text-rose-400"},mkv:{icon:D,color:"text-rose-400"},ttf:{icon:A,color:"text-red-500"},otf:{icon:A,color:"text-red-500"},woff:{icon:A,color:"text-red-400"},woff2:{icon:A,color:"text-red-400"},eot:{icon:A,color:"text-red-400"},zip:{icon:S,color:"text-amber-600"},tar:{icon:S,color:"text-amber-600"},gz:{icon:S,color:"text-amber-600"},bz2:{icon:S,color:"text-amber-600"},rar:{icon:S,color:"text-amber-500"},"7z":{icon:S,color:"text-amber-500"},lock:{icon:y,color:"text-gray-500"},exe:{icon:C,color:"text-gray-500"},bin:{icon:C,color:"text-gray-500"},dll:{icon:C,color:"text-gray-400"},so:{icon:C,color:"text-gray-400"},dylib:{icon:C,color:"text-gray-400"},wasm:{icon:C,color:"text-purple-500"},ini:{icon:a,color:"text-gray-500"},cfg:{icon:a,color:"text-gray-500"},conf:{icon:a,color:"text-gray-500"},log:{icon:J,color:"text-gray-400"},map:{icon:je,color:"text-gray-400"}},be={Dockerfile:{icon:G,color:"text-blue-500"},"docker-compose.yml":{icon:G,color:"text-blue-500"},"docker-compose.yaml":{icon:G,color:"text-blue-500"},".dockerignore":{icon:G,color:"text-gray-500"},".gitignore":{icon:a,color:"text-gray-500"},".gitmodules":{icon:a,color:"text-gray-500"},".gitattributes":{icon:a,color:"text-gray-500"},".editorconfig":{icon:a,color:"text-gray-500"},".prettierrc":{icon:a,color:"text-pink-400"},".prettierignore":{icon:a,color:"text-gray-500"},".eslintrc":{icon:a,color:"text-violet-500"},".eslintrc.js":{icon:a,color:"text-violet-500"},".eslintrc.json":{icon:a,color:"text-violet-500"},".eslintrc.cjs":{icon:a,color:"text-violet-500"},"eslint.config.js":{icon:a,color:"text-violet-500"},"eslint.config.mjs":{icon:a,color:"text-violet-500"},".env":{icon:w,color:"text-yellow-600"},".env.local":{icon:w,color:"text-yellow-600"},".env.development":{icon:w,color:"text-yellow-500"},".env.production":{icon:w,color:"text-yellow-600"},".env.example":{icon:w,color:"text-yellow-400"},"package.json":{icon:T,color:"text-green-500"},"package-lock.json":{icon:y,color:"text-gray-500"},"yarn.lock":{icon:y,color:"text-blue-400"},"pnpm-lock.yaml":{icon:y,color:"text-orange-400"},"bun.lockb":{icon:y,color:"text-gray-400"},"Cargo.toml":{icon:$,color:"text-orange-600"},"Cargo.lock":{icon:y,color:"text-orange-400"},Gemfile:{icon:te,color:"text-red-500"},"Gemfile.lock":{icon:y,color:"text-red-400"},Makefile:{icon:j,color:"text-gray-500"},"CMakeLists.txt":{icon:$,color:"text-blue-500"},"tsconfig.json":{icon:T,color:"text-blue-500"},"jsconfig.json":{icon:T,color:"text-yellow-500"},"vite.config.ts":{icon:oe,color:"text-purple-500"},"vite.config.js":{icon:oe,color:"text-purple-500"},"webpack.config.js":{icon:$,color:"text-blue-500"},"tailwind.config.js":{icon:F,color:"text-cyan-500"},"tailwind.config.ts":{icon:F,color:"text-cyan-500"},"postcss.config.js":{icon:$,color:"text-red-400"},"babel.config.js":{icon:a,color:"text-yellow-500"},".babelrc":{icon:a,color:"text-yellow-500"},"README.md":{icon:ee,color:"text-blue-500"},LICENSE:{icon:Y,color:"text-gray-500"},"LICENSE.md":{icon:Y,color:"text-gray-500"},"CHANGELOG.md":{icon:J,color:"text-blue-400"},"requirements.txt":{icon:I,color:"text-emerald-400"},"go.mod":{icon:U,color:"text-cyan-500"},"go.sum":{icon:y,color:"text-cyan-400"}};function We(i){var d;if(be[i])return be[i];if(i.startsWith(".env"))return{icon:w,color:"text-yellow-600"};const u=(d=i.split(".").pop())==null?void 0:d.toLowerCase();return u&&he[u]?he[u]:{icon:je,color:"text-muted-foreground"}}function co({selectedProject:i,onFileOpen:u,activeFilePath:d=null}){const{t:s}=qe(),[p,L]=x.useState([]),[q,N]=x.useState(!1),[g,f]=x.useState(new Set),[M,W]=x.useState(null),[m,_]=x.useState("detailed"),[v,re]=x.useState(""),[z,ce]=x.useState([]),H=Ee.useRef(null);x.useEffect(()=>{i&&we()},[i]),x.useEffect(()=>{const t=localStorage.getItem("file-tree-view-mode");t&&["simple","detailed","compact"].includes(t)&&_(t)},[]),x.useEffect(()=>{if(!d||p.length===0)return;const t=d.replace(/\\/g,"/"),c=(r,l,n=[])=>{for(const k of r){const ie=(k.path||"").replace(/\\/g,"/");if(k.type==="directory"&&k.children){const Se=[...n,k.path];if(t.startsWith(ie+"/")){const de=c(k.children,l,Se);if(de)return de}}if(k.type!=="directory"&&ie===t)return n}return null},o=c(p,t);o&&o.length>0&&f(r=>{const l=new Set(r);return o.forEach(n=>l.add(n)),l}),requestAnimationFrame(()=>{var r;(r=H.current)==null||r.scrollIntoView({block:"nearest",behavior:"smooth"})})},[d,p]),x.useEffect(()=>{if(!v.trim())ce(p);else{const t=ne(p,v.toLowerCase());ce(t);const c=o=>{o.forEach(r=>{r.type==="directory"&&r.children&&r.children.length>0&&(f(l=>new Set(l.add(r.path))),c(r.children))})};c(t)}},[p,v]);const ne=(t,c)=>t.reduce((o,r)=>{const l=r.name.toLowerCase().includes(c);let n=[];return r.type==="directory"&&r.children&&(n=ne(r.children,c)),(l||n.length>0)&&o.push({...r,children:n}),o},[]),we=async()=>{N(!0);try{const t=await Le.getFiles(i.name);if(!t.ok){const o=await t.text();console.error("❌ File fetch failed:",t.status,o),L([]);return}const c=await t.json();L(c)}catch(t){console.error("❌ Error fetching files:",t),L([])}finally{N(!1)}},Ne=t=>{const c=new Set(g);c.has(t)?c.delete(t):c.add(t),f(c)},P=t=>{_(t),localStorage.setItem("file-tree-view-mode",t)},Q=t=>{if(!t||t===0)return"0 B";const c=1024,o=["B","KB","MB","GB"],r=Math.floor(Math.log(t)/Math.log(c));return parseFloat((t/Math.pow(c,r)).toFixed(1))+" "+o[r]},ve=t=>{if(!t)return"-";const c=new Date,o=new Date(t),r=Math.floor((c-o)/1e3);return r<60?s("fileTree.justNow"):r<3600?s("fileTree.minAgo",{count:Math.floor(r/60)}):r<86400?s("fileTree.hoursAgo",{count:Math.floor(r/3600)}):r<2592e3?s("fileTree.daysAgo",{count:Math.floor(r/86400)}):o.toLocaleDateString()},ke=t=>{var r;const c=(r=t.split(".").pop())==null?void 0:r.toLowerCase();return["png","jpg","jpeg","gif","svg","webp","ico","bmp"].includes(c)},Ce=t=>{const{icon:c,color:o}=We(t);return e.jsx(c,{className:h(He,o)})},X=t=>{t.type==="directory"?Ne(t.path):ke(t.name)?W({name:t.name,path:t.path,projectPath:i.path,projectName:i.name}):u&&u(t.path)},K=t=>{const c=t.type==="directory",o=g.has(t.path);return c?e.jsxs("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:[e.jsx(De,{className:h("w-3.5 h-3.5 text-muted-foreground/70 transition-transform duration-150",o&&"rotate-90")}),o?e.jsx(Re,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):e.jsx(me,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"})]}):e.jsx("span",{className:"flex items-center flex-shrink-0 ml-[18px]",children:Ce(t.name)})},se=(t,c=0)=>t.map(o=>{const r=o.type==="directory",l=r&&g.has(o.path),n=!r&&d&&(o.path||"").replace(/\\/g,"/")===d.replace(/\\/g,"/");return e.jsxs("div",{className:"select-none",children:[e.jsxs("div",{ref:n?H:void 0,className:h("group flex items-center gap-1.5 py-[3px] pr-2 cursor-pointer rounded-sm","hover:bg-accent/60 transition-colors duration-100",n&&"bg-primary/10 border-l-2 !border-primary font-medium",!n&&r&&l&&"border-l-2 border-primary/30",!n&&r&&!l&&"border-l-2 border-transparent",!n&&!r&&"border-l-2 border-transparent"),style:{paddingLeft:`${c*16+4}px`},onClick:()=>X(o),children:[K(o),e.jsx("span",{className:h("text-[13px] leading-tight truncate",n?"font-medium text-primary":r?"font-medium text-foreground":"text-foreground/90"),children:o.name})]}),r&&l&&o.children&&o.children.length>0&&e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute top-0 bottom-0 border-l border-border/40",style:{left:`${c*16+14}px`},"aria-hidden":"true"}),se(o.children,c+1)]})]},o.path)}),le=(t,c=0)=>t.map(o=>{const r=o.type==="directory",l=r&&g.has(o.path),n=!r&&d&&(o.path||"").replace(/\\/g,"/")===d.replace(/\\/g,"/");return e.jsxs("div",{className:"select-none",children:[e.jsxs("div",{ref:n?H:void 0,className:h("group grid grid-cols-1 sm:grid-cols-12 gap-0 sm:gap-2 py-[3px] pr-2 hover:bg-accent/60 cursor-pointer items-center rounded-sm transition-colors duration-100",n&&"bg-primary/10 border-l-2 !border-primary font-medium",!n&&r&&l&&"border-l-2 border-primary/30",!n&&r&&!l&&"border-l-2 border-transparent",!n&&!r&&"border-l-2 border-transparent"),style:{paddingLeft:`${c*16+4}px`},onClick:()=>X(o),children:[e.jsxs("div",{className:"sm:col-span-5 flex items-center gap-1.5 min-w-0",children:[K(o),e.jsx("span",{className:h("text-[13px] leading-tight truncate",n?"font-medium text-primary":r?"font-medium text-foreground":"text-foreground/90"),children:o.name}),o.type==="file"&&o.size!=null&&e.jsx("span",{className:"sm:hidden text-[10px] text-muted-foreground/60 ml-auto flex-shrink-0",children:Q(o.size)})]}),e.jsx("div",{className:"hidden sm:block sm:col-span-2 text-sm text-muted-foreground tabular-nums",children:o.type==="file"?Q(o.size):""}),e.jsx("div",{className:"hidden sm:block sm:col-span-3 text-sm text-muted-foreground",children:ve(o.modified)}),e.jsx("div",{className:"hidden sm:block sm:col-span-2 text-sm text-muted-foreground font-mono",children:o.permissionsRwx||""})]}),r&&l&&o.children&&e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute top-0 bottom-0 border-l border-border/40",style:{left:`${c*16+14}px`},"aria-hidden":"true"}),le(o.children,c+1)]})]},o.path)}),ae=(t,c=0)=>t.map(o=>{const r=o.type==="directory",l=r&&g.has(o.path),n=!r&&d&&(o.path||"").replace(/\\/g,"/")===d.replace(/\\/g,"/");return e.jsxs("div",{className:"select-none",children:[e.jsxs("div",{ref:n?H:void 0,className:h("group flex items-center justify-between py-[3px] pr-2 hover:bg-accent/60 cursor-pointer rounded-sm transition-colors duration-100",n&&"bg-primary/10 border-l-2 !border-primary font-medium",!n&&r&&l&&"border-l-2 border-primary/30",!n&&r&&!l&&"border-l-2 border-transparent",!n&&!r&&"border-l-2 border-transparent"),style:{paddingLeft:`${c*16+4}px`},onClick:()=>X(o),children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[K(o),e.jsx("span",{className:h("text-[13px] leading-tight truncate",n?"font-medium text-primary":r?"font-medium text-foreground":"text-foreground/90"),children:o.name})]}),e.jsx("div",{className:"flex items-center gap-3 text-sm text-muted-foreground flex-shrink-0 ml-2",children:o.type==="file"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"tabular-nums",children:Q(o.size)}),e.jsx("span",{className:"font-mono",children:o.permissionsRwx})]})})]}),r&&l&&o.children&&e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute top-0 bottom-0 border-l border-border/40",style:{left:`${c*16+14}px`},"aria-hidden":"true"}),ae(o.children,c+1)]})]},o.path)});return q?e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsx("div",{className:"text-muted-foreground text-sm",children:s("fileTree.loading")})}):e.jsxs("div",{className:"h-full flex flex-col bg-background",children:[e.jsxs("div",{className:"px-3 pt-3 pb-2 border-b border-border space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:s("fileTree.files")}),e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx(V,{variant:m==="simple"?"default":"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>P("simple"),title:s("fileTree.simpleView"),children:e.jsx(Me,{className:"w-3.5 h-3.5"})}),e.jsx(V,{variant:m==="compact"?"default":"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>P("compact"),title:s("fileTree.compactView"),children:e.jsx(ze,{className:"w-3.5 h-3.5"})}),e.jsx(V,{variant:m==="detailed"?"default":"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>P("detailed"),title:s("fileTree.detailedView"),children:e.jsx(Ae,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(xe,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground"}),e.jsx(Ie,{type:"text",placeholder:s("fileTree.searchPlaceholder"),value:v,onChange:t=>re(t.target.value),className:"pl-8 pr-8 h-8 text-sm"}),v&&e.jsx(V,{variant:"ghost",size:"sm",className:"absolute right-0.5 top-1/2 transform -translate-y-1/2 h-5 w-5 p-0 hover:bg-accent",onClick:()=>re(""),title:s("fileTree.clearSearch"),children:e.jsx(ye,{className:"w-3 h-3"})})]})]}),m==="detailed"&&z.length>0&&e.jsx("div",{className:"px-3 pt-1.5 pb-1 border-b border-border",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-12 gap-2 px-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:[e.jsx("div",{className:"sm:col-span-5",children:s("fileTree.name")}),e.jsx("div",{className:"hidden sm:block sm:col-span-2",children:s("fileTree.size")}),e.jsx("div",{className:"hidden sm:block sm:col-span-3",children:s("fileTree.modified")}),e.jsx("div",{className:"hidden sm:block sm:col-span-2",children:s("fileTree.permissions")})]})}),e.jsx(Fe,{className:"flex-1 px-2 py-1",children:p.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto mb-3",children:e.jsx(me,{className:"w-6 h-6 text-muted-foreground"})}),e.jsx("h4",{className:"font-medium text-foreground mb-1",children:s("fileTree.noFilesFound")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("fileTree.checkProjectPath")})]}):z.length===0&&v?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto mb-3",children:e.jsx(xe,{className:"w-6 h-6 text-muted-foreground"})}),e.jsx("h4",{className:"font-medium text-foreground mb-1",children:s("fileTree.noMatchesFound")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("fileTree.tryDifferentSearch")})]}):e.jsxs("div",{children:[m==="simple"&&se(z),m==="compact"&&ae(z),m==="detailed"&&le(z)]})}),M&&e.jsx(_e,{file:M,onClose:()=>W(null)})]})}export{co as default};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{r as n,j as e}from"./vendor-react-96lCPsRK.js";import{j as ye,R as be,k as we,m as Ne,f as ue,W as se,I as je}from"./index-BQy15irW.js";import{x as ve,a as Ce,b as ke,c as Se}from"./vendor-xterm-CZq1hqo1.js";import{r as Le}from"./vendor-canvas-QWTduIvM.js";import{X as Te}from"./vendor-icons-kix3Gb31.js";const Re=(t,r,a,p)=>{var s,N,C,d;const g=[a,{code:r,...p||{}}];if((N=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&N.forward)return t.services.logger.forward(g,"warn","react-i18next::",!0);$(g[0])&&(g[0]=`react-i18next:: ${g[0]}`),(d=(C=t==null?void 0:t.services)==null?void 0:C.logger)!=null&&d.warn?t.services.logger.warn(...g):console!=null&&console.warn&&console.warn(...g)},le={},de=(t,r,a,p)=>{$(a)&&le[a]||($(a)&&(le[a]=new Date),Re(t,r,a,p))},fe=(t,r)=>()=>{if(t.isInitialized)r();else{const a=()=>{setTimeout(()=>{t.off("initialized",a)},0),r()};t.on("initialized",a)}},Z=(t,r,a)=>{t.loadNamespaces(r,fe(t,a))},ae=(t,r,a,p)=>{if($(a)&&(a=[a]),t.options.preload&&t.options.preload.indexOf(r)>-1)return Z(t,a,p);a.forEach(g=>{t.options.ns.indexOf(g)<0&&t.options.ns.push(g)}),t.loadLanguages(r,fe(t,p))},Ee=(t,r,a={})=>!r.languages||!r.languages.length?(de(r,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:r.languages}),!0):r.hasLoadedNamespace(t,{lng:a.lng,precheck:(p,g)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&p.services.backendConnector.backend&&p.isLanguageChangingTo&&!g(p.isLanguageChangingTo,t))return!1}}),$=t=>typeof t=="string",Oe=t=>typeof t=="object"&&t!==null;var Ie=Le();const Ae=(t,r)=>$(r)?r:Oe(r)&&$(r.defaultValue)?r.defaultValue:Array.isArray(t)?t[t.length-1]:t,Me={t:Ae,ready:!1},_e=()=>()=>{},Pe=(t,r={})=>{var F,i,S;const{i18n:a}=r,{i18n:p,defaultNS:g}=n.useContext(ye)||{},s=a||p||Ne();s&&!s.reportNamespaces&&(s.reportNamespaces=new be),s||de(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const N=n.useMemo(()=>{var l;return{...we(),...(l=s==null?void 0:s.options)==null?void 0:l.react,...r}},[s,r]),{useSuspense:C,keyPrefix:d}=N,L=t||g||((F=s==null?void 0:s.options)==null?void 0:F.defaultNS),c=$(L)?[L]:L||["translation"],h=n.useMemo(()=>c,c);(S=(i=s==null?void 0:s.reportNamespaces)==null?void 0:i.addUsedNamespaces)==null||S.call(i,h);const u=n.useRef(0),k=n.useCallback(l=>{if(!s)return _e;const{bindI18n:f,bindI18nStore:x}=N,m=()=>{u.current+=1,l()};return f&&s.on(f,m),x&&s.store.on(x,m),()=>{f&&f.split(" ").forEach(_=>s.off(_,m)),x&&x.split(" ").forEach(_=>s.store.off(_,m))}},[s,N]),O=n.useRef(),b=n.useCallback(()=>{if(!s)return Me;const l=!!(s.isInitialized||s.initializedStoreOnce)&&h.every(P=>Ee(P,s,N)),f=r.lng||s.language,x=u.current,m=O.current;if(m&&m.ready===l&&m.lng===f&&m.keyPrefix===d&&m.revision===x)return m;const H={t:s.getFixedT(f,N.nsMode==="fallback"?h:h[0],d),ready:l,lng:f,keyPrefix:d,revision:x};return O.current=H,H},[s,h,d,N,r.lng]),[B,M]=n.useState(0),{t:I,ready:E}=Ie.useSyncExternalStore(k,b,b);n.useEffect(()=>{if(s&&!E&&!C){const l=()=>M(f=>f+1);r.lng?ae(s,r.lng,h,l):Z(s,h,l)}},[s,r.lng,h,E,C,B]);const A=s||{},v=n.useRef(null),R=n.useRef(),U=l=>{const f=Object.getOwnPropertyDescriptors(l);f.__original&&delete f.__original;const x=Object.create(Object.getPrototypeOf(l),f);if(!Object.prototype.hasOwnProperty.call(x,"__original"))try{Object.defineProperty(x,"__original",{value:l,writable:!1,enumerable:!1,configurable:!1})}catch{}return x},T=n.useMemo(()=>{const l=A,f=l==null?void 0:l.language;let x=l;l&&(v.current&&v.current.__original===l?R.current!==f?(x=U(l),v.current=x,R.current=f):x=v.current:(x=U(l),v.current=x,R.current=f));const m=[I,x,E];return m.t=I,m.i18n=x,m.ready=E,m},[I,A,E,A.resolvedLanguage,A.language,A.languages]);if(s&&C&&!E)throw new Promise(l=>{const f=()=>l();r.lng?ae(s,r.lng,h,f):Z(s,h,f)});return T},De=({className:t="w-5 h-5"})=>e.jsx("img",{src:"/app/icons/claude-ai-icon.svg",alt:"Claude",className:t}),Ke=({className:t="w-5 h-5"})=>{const{isDarkMode:r}=ue();return e.jsx("img",{src:r?"/app/icons/cursor-white.svg":"/app/icons/cursor.svg",alt:"Cursor",className:t})},Je=({className:t="w-5 h-5"})=>{const{isDarkMode:r}=ue();return e.jsx("img",{src:r?"/app/icons/codex-white.svg":"/app/icons/codex.svg",alt:"Codex",className:t})},We=`
|
|
2
|
-
.xterm .xterm-screen {
|
|
3
|
-
outline: none !important;
|
|
4
|
-
}
|
|
5
|
-
.xterm:focus .xterm-screen {
|
|
6
|
-
outline: none !important;
|
|
7
|
-
}
|
|
8
|
-
.xterm-screen:focus {
|
|
9
|
-
outline: none !important;
|
|
10
|
-
}
|
|
11
|
-
`;if(typeof document<"u"){const t=document.createElement("style");t.type="text/css",t.innerText=We,document.head.appendChild(t)}function Ue(t){if(!t||typeof document>"u")return!1;const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="fixed",r.style.opacity="0",r.style.pointerEvents="none",document.body.appendChild(r),r.focus(),r.select();let a=!1;try{a=document.execCommand("copy")}catch{a=!1}finally{document.body.removeChild(r)}return a}const oe="https://auth.openai.com/codex/device";function ce(t){return typeof t=="string"&&/\bcodex\s+login\b/i.test(t)}function ie({selectedProject:t,selectedSession:r,initialCommand:a,isPlainShell:p=!1,onProcessComplete:g,minimal:s=!1,autoConnect:N=!1,shellType:C=null}){const{t:d}=Pe("chat"),L=n.useRef(null),c=n.useRef(null),h=n.useRef(null),u=n.useRef(null),[k,O]=n.useState(!1),[b,B]=n.useState(!1),[M,I]=n.useState(!1),[E,A]=n.useState(null),[v,R]=n.useState(!1),[U,T]=n.useState(null),[F,i]=n.useState(""),[S,l]=n.useState("idle"),[f,x]=n.useState(!1),m=n.useRef(t),_=n.useRef(r),H=n.useRef(a),P=n.useRef(p),ee=n.useRef(C),G=n.useRef(g),z=n.useRef("");n.useEffect(()=>{m.current=t,_.current=r,H.current=a,P.current=p,ee.current=C,G.current=g});const te=n.useCallback((y=z.current)=>{if(!y)return!1;const j=window.open(y,"_blank","noopener,noreferrer");if(j){try{j.opener=null}catch{}return!0}return!1},[]),X=n.useCallback(async(y=z.current)=>{var w;if(!y)return!1;let j=!1;try{typeof navigator<"u"&&((w=navigator.clipboard)!=null&&w.writeText)&&(await navigator.clipboard.writeText(y),j=!0)}catch{j=!1}return j||(j=Ue(y)),j},[]),re=n.useCallback(async()=>{if(!(v||k)){T(null);try{let y;se?y=`${se.replace(/^http/,"ws")}/shell`:y=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/shell`,u.current=new WebSocket(y);const j=setTimeout(()=>{u.current&&u.current.readyState!==WebSocket.OPEN&&(u.current.close(),R(!1),T("Connection timed out. Check your relay connection (uc connect)."))},15e3);u.current.onopen=()=>{clearTimeout(j),O(!0),R(!1),T(null),z.current="",i(""),l("idle"),x(!1),setTimeout(()=>{var w,o;h.current&&c.current&&(h.current.fit(),u.current.send(JSON.stringify({type:"init",projectPath:m.current.fullPath||m.current.path,sessionId:P.current?null:(w=_.current)==null?void 0:w.id,hasSession:P.current?!1:!!_.current,provider:P.current?"plain-shell":((o=_.current)==null?void 0:o.__provider)||"claude",cols:c.current.cols,rows:c.current.rows,initialCommand:H.current,isPlainShell:P.current,shellType:ee.current})))},100)},u.current.onmessage=w=>{try{const o=JSON.parse(w.data);if(o.type==="output"){let W=o.data;if(P.current&&G.current){const K=W.replace(/\x1b\[[0-9;]*m/g,"");if(K.includes("Process exited with code 0"))G.current(0);else if(K.match(/Process exited with code (\d+)/)){const J=parseInt(K.match(/Process exited with code (\d+)/)[1]);J!==0&&G.current(J)}}c.current&&c.current.write(W)}else o.type==="error"?(T(o.message||"Connection error"),c.current&&c.current.write(`\r
|
|
12
|
-
\x1B[31m${o.message||"Connection error"}\x1B[0m\r
|
|
13
|
-
`)):(o.type==="auth_url"&&o.url||o.type==="url_open"&&o.url)&&(z.current=o.url,i(o.url),l("idle"),x(!1))}catch{}},u.current.onclose=w=>{clearTimeout(j);const o=k;O(!1),R(!1),l("idle"),x(!1),w.code===1006||w.code===4001?T("Connection lost. Your local machine may be offline."):(w.code===4003||w.code===1008)&&T("Authentication failed. Please log in again."),c.current&&(c.current.clear(),c.current.write("\x1B[2J\x1B[H"))},u.current.onerror=()=>{clearTimeout(j),O(!1),R(!1),T("Failed to connect. Check that your relay is running (uc connect).")}}catch{O(!1),R(!1),T("Failed to establish connection.")}}},[v,k,te]),q=n.useCallback(()=>{!b||k||v||(R(!0),T(null),re())},[b,k,v,re]),V=n.useCallback(()=>{u.current&&(u.current.close(),u.current=null),c.current&&(c.current.clear(),c.current.write("\x1B[2J\x1B[H")),O(!1),R(!1),T(null),z.current="",i(""),l("idle"),x(!1)},[]),D=n.useMemo(()=>r?r.__provider==="cursor"?r.name||"Untitled Session":r.summary||"New Session":null,[r]),he=n.useMemo(()=>D?D.slice(0,30):null,[D]),me=n.useMemo(()=>D?D.slice(0,50):null,[D]),pe=()=>{I(!0),u.current&&(u.current.close(),u.current=null),c.current&&(c.current.dispose(),c.current=null,h.current=null),O(!1),B(!1),z.current="",i(""),l("idle"),x(!1),setTimeout(()=>{I(!1)},200)};if(n.useEffect(()=>{const y=(r==null?void 0:r.id)||null;E!==null&&E!==y&&b&&V(),A(y)},[r==null?void 0:r.id,b,V]),n.useEffect(()=>{if(!L.current||!t||M||c.current)return;c.current=new ve.Terminal({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',allowProposedApi:!0,allowTransparency:!1,convertEol:!0,scrollback:1e4,tabStopWidth:4,windowsMode:!1,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#1e1e1e",selection:"#264f78",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff",extendedAnsi:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"]}}),h.current=new Ce.FitAddon;const y=new ke.WebglAddon,j=new Se.WebLinksAddon;c.current.loadAddon(h.current),s||c.current.loadAddon(j);try{c.current.loadAddon(y)}catch{console.warn("[Shell] WebGL renderer unavailable, using Canvas fallback")}c.current.open(L.current),c.current.attachCustomKeyEventHandler(o=>{var K,J,ne;const W=ce(H.current)?oe:z.current;return o.type==="keydown"&&s&&P.current&&W&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&((K=o.key)==null?void 0:K.toLowerCase())==="c"&&X(W).catch(()=>{}),o.type==="keydown"&&(o.ctrlKey||o.metaKey)&&((J=o.key)==null?void 0:J.toLowerCase())==="c"&&c.current.hasSelection()?(o.preventDefault(),o.stopPropagation(),document.execCommand("copy"),!1):o.type==="keydown"&&(o.ctrlKey||o.metaKey)&&((ne=o.key)==null?void 0:ne.toLowerCase())==="v"?(o.preventDefault(),o.stopPropagation(),navigator.clipboard.readText().then(ge=>{u.current&&u.current.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"input",data:ge}))}).catch(()=>{}),!1):!0}),setTimeout(()=>{h.current&&(h.current.fit(),c.current&&u.current&&u.current.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"resize",cols:c.current.cols,rows:c.current.rows})))},100),B(!0),c.current.onData(o=>{u.current&&u.current.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"input",data:o}))});const w=new ResizeObserver(()=>{h.current&&c.current&&setTimeout(()=>{h.current.fit(),u.current&&u.current.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"resize",cols:c.current.cols,rows:c.current.rows}))},50)});return L.current&&w.observe(L.current),()=>{w.disconnect(),u.current&&(u.current.readyState===WebSocket.OPEN||u.current.readyState===WebSocket.CONNECTING)&&u.current.close(),u.current=null,c.current&&(c.current.dispose(),c.current=null)}},[(t==null?void 0:t.path)||(t==null?void 0:t.fullPath),M,s,X]),n.useEffect(()=>{!N||!b||v||k||q()},[N,b,v,k,q]),!t)return e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:d("shell.selectProject.title")}),e.jsx("p",{children:d("shell.selectProject.description")})]})});if(s){const y=ce(a)?oe:F,j=!!y,w=j&&!f,o=j&&f;return e.jsxs("div",{className:"h-full w-full bg-gray-900 relative",children:[e.jsx("div",{ref:L,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),w&&e.jsx("div",{className:"absolute inset-x-0 bottom-14 z-20 border-t border-gray-700/80 bg-gray-900/95 p-3 backdrop-blur-sm md:hidden",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-gray-300",children:"Open or copy the login URL:"}),e.jsx("button",{type:"button",onClick:()=>x(!0),className:"rounded bg-gray-700 px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-gray-100 hover:bg-gray-600",children:"Hide"})]}),e.jsx("input",{type:"text",value:y,readOnly:!0,onClick:W=>W.currentTarget.select(),className:"w-full rounded border border-gray-600 bg-gray-800 px-2 py-1 text-xs text-gray-100 focus:outline-none focus:ring-1 focus:ring-blue-500","aria-label":"Authentication URL"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{te(y)},className:"flex-1 rounded bg-blue-600 px-3 py-2 text-xs font-medium text-white hover:bg-blue-700",children:"Open URL"}),e.jsx("button",{type:"button",onClick:async()=>{const W=await X(y);l(W?"copied":"failed")},className:"flex-1 rounded bg-gray-700 px-3 py-2 text-xs font-medium text-white hover:bg-gray-600",children:S==="copied"?"Copied":"Copy URL"})]})]})}),o&&e.jsx("div",{className:"absolute bottom-14 right-3 z-20 md:hidden",children:e.jsx("button",{type:"button",onClick:()=>x(!1),className:"rounded bg-gray-800/95 px-3 py-2 text-xs font-medium text-gray-100 shadow-lg backdrop-blur-sm hover:bg-gray-700",children:"Show login URL"})})]})}return e.jsxs("div",{className:"h-full flex flex-col bg-gray-900 w-full",children:[e.jsx("div",{className:"flex-shrink-0 bg-gray-800 border-b border-gray-700 px-4 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${k?"bg-green-500":"bg-red-500"}`}),r&&e.jsxs("span",{className:"text-xs text-blue-300",children:["(",he,"...)"]}),!r&&e.jsx("span",{className:"text-xs text-gray-400",children:d("shell.status.newSession")}),!b&&e.jsx("span",{className:"text-xs text-yellow-400",children:d("shell.status.initializing")}),M&&e.jsx("span",{className:"text-xs text-blue-400",children:d("shell.status.restarting")})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[k&&e.jsxs("button",{onClick:V,className:"px-3 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-700 flex items-center space-x-1",title:d("shell.actions.disconnectTitle"),children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),e.jsx("span",{children:d("shell.actions.disconnect")})]}),e.jsxs("button",{onClick:pe,disabled:M||k,className:"text-xs text-gray-400 hover:text-white disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-1",title:d("shell.actions.restartTitle"),children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),e.jsx("span",{children:d("shell.actions.restart")})]})]})]})}),e.jsxs("div",{className:"flex-1 p-2 overflow-hidden relative",children:[e.jsx("div",{ref:L,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),!b&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90",children:e.jsx("div",{className:"text-white",children:d("shell.loading")})}),b&&!k&&!v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:e.jsxs("div",{className:"text-center max-w-sm w-full",children:[U&&e.jsx("div",{className:"mb-4 px-4 py-2 bg-red-900/40 border border-red-500/30 rounded-lg",children:e.jsx("p",{className:"text-red-400 text-xs",children:U})}),e.jsxs("button",{onClick:q,className:"px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors flex items-center justify-center space-x-2 text-base font-medium w-full sm:w-auto",title:d("shell.actions.connectTitle"),children:[e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),e.jsx("span",{children:U?d("shell.actions.retry","Retry"):d("shell.actions.connect")})]}),e.jsx("p",{className:"text-gray-400 text-sm mt-3 px-2",children:p?d("shell.runCommand",{command:a||d("shell.defaultCommand"),projectName:t.displayName}):r?d("shell.resumeSession",{displayName:me}):d("shell.startSession")})]})}),v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:e.jsxs("div",{className:"text-center max-w-sm w-full",children:[e.jsxs("div",{className:"flex items-center justify-center space-x-3 text-yellow-400",children:[e.jsx("div",{className:"w-6 h-6 animate-spin rounded-full border-2 border-yellow-400 border-t-transparent"}),e.jsx("span",{className:"text-base font-medium",children:d("shell.connecting")})]}),e.jsx("p",{className:"text-gray-400 text-sm mt-3 px-2",children:p?d("shell.runCommand",{command:a||d("shell.defaultCommand"),projectName:t.displayName}):d("shell.startCli",{projectName:t.displayName})})]})})]})]})}let Q=0;const Y=[{value:"powershell",label:"PowerShell",icon:"PS"},{value:"cmd",label:"CMD",icon:">"},{value:"bash",label:"Bash",icon:"$"}];function xe({project:t,session:r=null,command:a=null,isPlainShell:p=null,autoConnect:g=!0,onComplete:s=null,onClose:N=null,title:C=null,className:d="",showHeader:L=!0,compact:c=!1,minimal:h=!1,multiTab:u=!1}){const[k,O]=n.useState(!1),[b,B]=n.useState(()=>[{id:++Q,shellType:"powershell",label:"PowerShell"}]),[M,I]=n.useState(()=>{var i;return(i=b[0])==null?void 0:i.id}),[E,A]=n.useState(!1),v=n.useRef(null),R=p!==null?p:a!==null,U=n.useCallback(i=>{O(!0),s&&s(i)},[s]),T=n.useCallback(i=>{const S=Y.find(f=>f.value===i)||Y[0],l=++Q;B(f=>[...f,{id:l,shellType:S.value,label:S.label}]),I(l),A(!1)},[]),F=n.useCallback(i=>{B(S=>{const l=S.filter(f=>f.id!==i);return l.length===0?[{id:++Q,shellType:"powershell",label:"PowerShell"}]:l}),I(S=>{if(S===i){const l=b.findIndex(m=>m.id===i),f=b.filter(m=>m.id!==i);if(f.length===0)return null;const x=Math.min(l,f.length-1);return f[x].id}return S})},[b]);return t?u&&!h&&!r&&!a?e.jsxs("div",{className:`h-full w-full flex flex-col ${d}`,children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center bg-[#1e1e1e] border-b border-gray-700 px-1 min-h-[36px]",children:[e.jsx("div",{className:"flex items-center gap-0.5 overflow-x-auto flex-1 min-w-0",children:b.map(i=>{var S;return e.jsxs("button",{onClick:()=>I(i.id),className:`group flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-t transition-colors shrink-0 ${M===i.id?"bg-gray-800 text-gray-100 border-t-2 border-t-blue-500":"text-gray-400 hover:text-gray-200 hover:bg-gray-800/50"}`,children:[e.jsx("span",{className:"text-[10px] font-mono opacity-60",children:((S=Y.find(l=>l.value===i.shellType))==null?void 0:S.icon)||">"}),e.jsx("span",{children:i.label}),b.length>1&&e.jsx("span",{onClick:l=>{l.stopPropagation(),F(i.id)},className:"ml-1 opacity-0 group-hover:opacity-100 hover:text-red-400 transition-opacity cursor-pointer",title:"Close tab",children:"×"})]},i.id)})}),e.jsxs("div",{className:"relative ml-1 shrink-0",children:[e.jsx("button",{ref:v,onClick:()=>A(!E),className:"flex items-center justify-center w-7 h-7 text-gray-400 hover:text-gray-100 hover:bg-gray-700 rounded transition-colors text-lg",title:"New terminal",children:"+"}),E&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 bg-gray-800 border border-gray-600 rounded-lg shadow-xl py-1 min-w-[140px]",children:Y.map(i=>e.jsxs("button",{onClick:()=>T(i.value),className:"w-full text-left px-3 py-1.5 text-xs text-gray-200 hover:bg-gray-700 flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[10px] opacity-60 w-4",children:i.icon}),i.label]},i.value))})]})]}),e.jsx("div",{className:"flex-1 w-full min-h-0 relative",children:b.map(i=>e.jsx("div",{className:"absolute inset-0",style:{display:M===i.id?"block":"none"},children:e.jsx(ie,{selectedProject:t,isPlainShell:!0,shellType:i.shellType,autoConnect:!0,minimal:!1})},i.id))})]}):e.jsxs("div",{className:`h-full w-full flex flex-col ${d}`,children:[!h&&L&&C&&e.jsx("div",{className:"flex-shrink-0 bg-gray-800 border-b border-gray-700 px-4 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-200",children:C}),k&&e.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),N&&e.jsx("button",{onClick:N,className:"text-gray-400 hover:text-white",title:"Close",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),e.jsx("div",{className:"flex-1 w-full min-h-0",children:e.jsx(ie,{selectedProject:t,selectedSession:r,initialCommand:a,isPlainShell:R,onProcessComplete:U,minimal:h,autoConnect:h?!0:g})})]}):e.jsx("div",{className:`h-full flex items-center justify-center ${d}`,children:e.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 002 2z"})})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No Project Selected"}),e.jsx("p",{children:"A project is required to open a shell"})]})})}const Ge=Object.freeze(Object.defineProperty({__proto__:null,default:xe},Symbol.toStringTag,{value:"Module"}));function Ye({isOpen:t,onClose:r,provider:a="claude",project:p,onComplete:g,customCommand:s,isAuthenticated:N=!1,isOnboarding:C=!1}){if(!t)return null;const d=()=>{if(s)return s;switch(a){case"claude":return N?"claude setup-token --dangerously-skip-permissions":C?"claude /exit --dangerously-skip-permissions":"claude /login --dangerously-skip-permissions";case"cursor":return"cursor-agent login";case"codex":return je?"codex login --device-auth":"codex login";default:return N?"claude setup-token --dangerously-skip-permissions":C?"claude /exit --dangerously-skip-permissions":"claude /login --dangerously-skip-permissions"}},L=()=>{switch(a){case"claude":return"Claude CLI Login";case"cursor":return"Cursor CLI Login";case"codex":return"Codex CLI Login";default:return"CLI Login"}},c=h=>{g&&g(h)};return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[9999] max-md:items-stretch max-md:justify-stretch",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-4xl h-3/4 flex flex-col md:max-w-4xl md:h-3/4 md:rounded-lg md:m-4 max-md:max-w-none max-md:h-full max-md:rounded-none max-md:m-0",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:L()}),e.jsx("button",{onClick:r,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors","aria-label":"Close login modal",children:e.jsx(Te,{className:"w-6 h-6"})})]}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(xe,{project:p,command:d(),onComplete:c,minimal:!0})})]})})}export{Ke as C,Ye as L,ie as S,Je as a,De as b,Ge as c,Pe as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-mermaid-CS3J4_Bz.js","assets/vendor-canvas-QWTduIvM.js","assets/vendor-react-96lCPsRK.js","assets/vendor-canvas-BZV40eAE.css","assets/vendor-syntax-LS_Nt30I.js","assets/vendor-markdown-CimbIo6Y.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{b}from"./vendor-syntax-LS_Nt30I.js";import{r as t,j as e}from"./vendor-react-96lCPsRK.js";import"./vendor-markdown-CimbIo6Y.js";let c=!1;async function h(){const r=await b(()=>import("./vendor-mermaid-CS3J4_Bz.js"),__vite__mapDeps([0,1,2,3,4,5]));return c||(r.default.initialize({startOnLoad:!1,theme:"dark",themeVariables:{darkMode:!0,background:"#1e293b",primaryColor:"#3b82f6",primaryTextColor:"#e2e8f0",primaryBorderColor:"#475569",lineColor:"#64748b",secondaryColor:"#1e40af",tertiaryColor:"#0f172a",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:"14px"},flowchart:{htmlLabels:!0,curve:"basis"},sequence:{mirrorActors:!1}}),c=!0),r.default}function w({code:r}){const m=t.useRef(null),l=t.useId().replace(/:/g,"-"),[s,o]=t.useState(null),[u,n]=t.useState(null),[f,d]=t.useState(!1);t.useEffect(()=>{let i=!1;return(async()=>{try{const a=await h(),{svg:x}=await a.render(`mermaid${l}`,r.trim());i||(o(x),n(null))}catch(a){i||(n((a==null?void 0:a.message)||"Failed to render diagram"),o(null))}})(),()=>{i=!0}},[r,l]);const p=()=>{navigator.clipboard.writeText(r).then(()=>{d(!0),setTimeout(()=>d(!1),1500)}).catch(()=>{})};return u?e.jsxs("div",{className:"my-2 rounded-lg border border-red-500/30 bg-red-950/20 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("svg",{className:"w-4 h-4 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),e.jsx("span",{className:"text-xs font-medium text-red-400",children:"Mermaid diagram error"})]}),e.jsx("pre",{className:"text-xs text-red-300/70 whitespace-pre-wrap font-mono",children:r})]}):e.jsxs("div",{className:"relative group my-2 rounded-lg border border-slate-700 bg-slate-900/50 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-slate-700/50 bg-slate-800/30",children:[e.jsx("span",{className:"text-xs text-slate-400 font-medium uppercase",children:"mermaid"}),e.jsx("button",{type:"button",onClick:p,className:"opacity-0 group-hover:opacity-100 transition-opacity text-xs px-2 py-0.5 rounded bg-slate-700/80 hover:bg-slate-700 text-slate-300 border border-slate-600",children:f?"Copied":"Copy source"})]}),e.jsx("div",{ref:m,className:"flex items-center justify-center p-4 min-h-[80px] overflow-x-auto [&_svg]:max-w-full",dangerouslySetInnerHTML:s?{__html:s}:void 0,children:!s&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[e.jsx("div",{className:"w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"}),"Rendering diagram..."]})})]})}export{w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as e}from"./vendor-react-96lCPsRK.js";import{L as We,b as ze,C as He,a as Ve}from"./LoginModal-BP0pCTrH.js";import{I as Ze,i as Qe,c as Xe,d as p,b as ue,h as L}from"./index-BQy15irW.js";import{b as Ke,t as et,av as tt,Z as st,G as rt,aw as at,ax as ot,F as me,w as xe,n as he,X as ge,r as pe,L as G,P as nt,j as it,a7 as fe,q as lt}from"./vendor-icons-kix3Gb31.js";import"./vendor-xterm-CZq1hqo1.js";import"./vendor-canvas-QWTduIvM.js";import"./vendor-syntax-LS_Nt30I.js";import"./vendor-markdown-CimbIo6Y.js";import"./vendor-i18n-DCFGyhQR.js";const bt=({onComplete:R})=>{const[o,be]=r.useState(0),[y,O]=r.useState(""),[f,q]=r.useState(""),[c,N]=r.useState(!1),[U,n]=r.useState(""),[je,_]=r.useState(!1),[ye,Ne]=r.useState("right"),[l,v]=r.useState(null),[ve]=r.useState({name:"default",fullPath:Ze?"/workspace":""}),[u,E]=r.useState([]),[M,I]=r.useState(!1),[m,we]=r.useState(""),[D,Y]=r.useState([]),[J,ke]=r.useState([]),[W,z]=r.useState(!1),[x,H]=r.useState(""),[V,Ce]=r.useState([]),[w,Z]=r.useState(""),[b,k]=r.useState(!1),[Q,C]=r.useState(""),[X,T]=r.useState({authenticated:!1,email:null,loading:!0,error:null}),[K,$]=r.useState({authenticated:!1,email:null,loading:!0,error:null}),[ee,B]=r.useState({authenticated:!1,email:null,loading:!0,error:null}),{user:S}=Qe(),{isRelayConnected:te,relayCwd:A,relayPlatform:se}=Xe(),re=r.useRef(void 0);r.useEffect(()=>{Se()},[]);const Se=async()=>{try{const t=await p("/api/user/git-config");if(t.ok){const s=await t.json();s.gitName&&O(s.gitName),s.gitEmail&&q(s.gitEmail)}}catch{}},h=r.useCallback(async t=>{z(!0);try{const a=await(await ue.browseFilesystem(t||null)).json();we(a.path||t||""),Y(a.suggestions||[]),a.drives&&ke(a.drives)}catch{Y([])}finally{z(!1)}},[]),Ae=r.useCallback(async()=>{I(!0),await h(A||"~")},[A,h]),ae=r.useCallback(async t=>{await h(t)},[h]),Fe=r.useCallback(async()=>{if(!m)return;const t=se==="win32"?"\\":"/",s=m.lastIndexOf(t);if(s<=0&&t==="/")await h("/");else if(s>=0){const a=m.substring(0,s)||(t==="/"?"/":"");await h(a)}},[m,se,h]),Pe=r.useCallback(async t=>{if(!u.some(s=>s.path===t)){k(!0);try{const s=await ue.createWorkspace({workspaceType:"existing",path:t});if(s.ok){const a=await s.json(),i=t.split(/[/\\]/).filter(Boolean).pop()||"project";E(P=>{var d;return[...P,{path:t,name:((d=a.project)==null?void 0:d.displayName)||i,type:"local"}]}),I(!1)}else{const a=await s.json();n(a.error||"Failed to add project")}}catch(s){n(s.message||"Failed to add project")}finally{k(!1)}}},[u]),Le=r.useCallback(async()=>{if(!x.trim())return;k(!0),C("Starting clone..."),n("");const t=x.trim().replace(/\.git$/,"").split("/").pop()||"repo",s=L?"":`/workspace/${t}`;try{const a=new URLSearchParams({path:s,githubUrl:x.trim()});w&&a.set("githubTokenId",w),await new Promise((i,P)=>{const d=new EventSource(`/api/projects/clone-progress?${a}`);d.onmessage=Ye=>{const g=JSON.parse(Ye.data);g.type==="progress"?C(g.message):g.type==="complete"?(d.close(),E(Je=>{var de,ce;return[...Je,{path:((de=g.project)==null?void 0:de.originalPath)||s,name:((ce=g.project)==null?void 0:ce.displayName)||t,type:"github",url:x.trim()}]}),H(""),C(""),i()):g.type==="error"&&(d.close(),P(new Error(g.message)))},d.onerror=()=>{d.close(),P(new Error("Connection lost during clone"))}})}catch(a){n(a.message||"Failed to clone repository"),C("")}finally{k(!1)}},[x,w]),Ge=r.useCallback(t=>{E(s=>s.filter((a,i)=>i!==t))},[]),Ee=r.useCallback(async()=>{try{const t=await p("/api/settings/credentials?type=github_token");if(t.ok){const s=await t.json();Ce(s.credentials||[]);const a=(s.credentials||[]).find(i=>i.is_active);a&&Z(a.id)}}catch{}},[]);r.useEffect(()=>{const t=re.current;re.current=l,(t===void 0||t!==null&&l===null)&&(oe(),ne(),ie())},[l]);const oe=async()=>{try{const t=await p("/api/cli/claude/status");if(t.ok){const s=await t.json();T({authenticated:s.authenticated,email:s.email,loading:!1,error:s.error||null})}else T({authenticated:!1,email:null,loading:!1,error:"Failed to check status"})}catch(t){T({authenticated:!1,email:null,loading:!1,error:t.message})}},ne=async()=>{try{const t=await p("/api/cli/cursor/status");if(t.ok){const s=await t.json();$({authenticated:s.authenticated,email:s.email,loading:!1,error:s.error||null})}else $({authenticated:!1,email:null,loading:!1,error:"Failed to check status"})}catch(t){$({authenticated:!1,email:null,loading:!1,error:t.message})}},ie=async()=>{try{const t=await p("/api/cli/codex/status");if(t.ok){const s=await t.json();B({authenticated:s.authenticated,email:s.email,loading:!1,error:s.error||null})}else B({authenticated:!1,email:null,loading:!1,error:"Failed to check status"})}catch(t){B({authenticated:!1,email:null,loading:!1,error:t.message})}},Ie=()=>v("claude"),Te=()=>v("cursor"),$e=()=>v("codex"),Be=t=>{t===0&&(l==="claude"?oe():l==="cursor"?ne():l==="codex"&&ie())},j=(t,s="right")=>{Ne(s),_(!0),setTimeout(()=>{be(t),_(!1)},200)},Re=async()=>{if(n(""),o===0){j(1,"right");return}if(o===1){if(!y.trim()||!f.trim()){n("Both git name and email are required");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f)){n("Please enter a valid email address");return}N(!0);try{const s=await p("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:y,gitEmail:f})});if(!s.ok){const a=await s.json();throw new Error(a.error||"Failed to save git configuration")}Ee(),j(2,"right")}catch(s){n(s.message)}finally{N(!1)}return}if(o===2){j(3,"right");return}j(o+1,"right")},Oe=()=>{n(""),j(o-1,"left")},qe=async()=>{N(!0),n("");try{const t=await p("/api/user/complete-onboarding",{method:"POST"});if(!t.ok){const s=await t.json();throw new Error(s.error||"Failed to complete onboarding")}R&&R()}catch(t){n(t.message)}finally{N(!1)}},F=[{title:"Welcome",required:!1},{title:"Git Identity",required:!0},{title:"Projects",required:!1},{title:"Agents",required:!1}],Ue=()=>o===0?!0:o===1?y.trim()&&f.trim()&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f):!0,le=[X,K,ee].filter(t=>t.authenticated).length,_e=[{icon:et,title:"AI Agents",desc:"Claude, Cursor & Codex — unified in one interface",gradient:"from-blue-500/10 to-blue-600/5",iconColor:"text-blue-500"},{icon:tt,title:"Canvas",desc:"Visual workspace with code blocks, diagrams & notes",gradient:"from-violet-500/10 to-violet-600/5",iconColor:"text-violet-500"},{icon:st,title:"Relay",desc:"Bridge your local machine to the web UI seamlessly",gradient:"from-amber-500/10 to-amber-600/5",iconColor:"text-amber-500"}],Me=[{name:"Claude Code",status:X,onLogin:Ie,logo:e.jsx(ze,{size:22}),accent:"blue"},{name:"Cursor",status:K,onLogin:Te,logo:e.jsx(He,{size:22}),accent:"violet"},{name:"OpenAI Codex",status:ee,onLogin:$e,logo:e.jsx(Ve,{className:"w-5 h-5"}),accent:"neutral"}],De=je?`opacity-0 ${ye==="right"?"translate-x-4":"-translate-x-4"}`:"opacity-100 translate-x-0";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4 sm:p-8",children:e.jsxs("div",{className:"w-full max-w-xl",children:[e.jsxs("div",{className:"mb-10",children:[e.jsx("div",{className:"flex items-center justify-between mb-3 px-1",children:F.map((t,s)=>e.jsxs("button",{onClick:()=>{s<o&&j(s,"left")},disabled:s>o,className:`text-xs font-medium tracking-wide uppercase transition-colors duration-300 ${s===o?"text-foreground":s<o?"text-primary cursor-pointer hover:text-primary/80":"text-muted-foreground/50"}`,children:[t.title,t.required&&s===o&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]},s))}),e.jsx("div",{className:"h-1 bg-muted/60 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full transition-all duration-500 ease-out",style:{width:`${o/(F.length-1)*100}%`}})})]}),e.jsxs("div",{className:"bg-card rounded-2xl border border-border/60 shadow-xl shadow-black/[0.04] dark:shadow-black/[0.2] overflow-hidden",children:[e.jsxs("div",{className:`p-8 sm:p-10 transition-all duration-200 ease-out ${De}`,children:[o===0&&e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 text-primary text-xs font-medium mb-6",children:[e.jsx(Ke,{className:"w-3.5 h-3.5"}),"Quick setup — under a minute"]}),e.jsxs("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground tracking-tight leading-tight",children:["Welcome to Upfyn",S!=null&&S.first_name?e.jsxs("span",{className:"text-primary",children:[", ",S.first_name]}):null]}),e.jsx("p",{className:"text-muted-foreground mt-3 text-base max-w-md mx-auto leading-relaxed",children:"Your visual AI coding interface. Connect your favorite agents, manage projects, and build faster."})]}),e.jsx("div",{className:"grid gap-3",children:_e.map((t,s)=>e.jsxs("div",{className:`group flex items-start gap-4 p-4 rounded-xl bg-gradient-to-r ${t.gradient} border border-border/40 hover:border-border/80 transition-all duration-200`,children:[e.jsx("div",{className:`mt-0.5 p-2 rounded-lg bg-background/80 ${t.iconColor} flex-shrink-0`,children:e.jsx(t.icon,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm",children:t.title}),e.jsx("p",{className:"text-muted-foreground text-sm mt-0.5",children:t.desc})]})]},s))})]}),o===1&&e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-5",children:e.jsx(rt,{className:"w-7 h-7 text-primary"})}),e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-foreground tracking-tight",children:"Git Identity"}),e.jsx("p",{className:"text-muted-foreground mt-2 text-sm max-w-sm mx-auto",children:"Set your name and email for commit attribution"})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"gitName",className:"flex items-center gap-2 text-sm font-medium text-foreground mb-2",children:[e.jsx(at,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Name"]}),e.jsx("input",{type:"text",id:"gitName",value:y,onChange:t=>O(t.target.value),className:"w-full px-4 py-3 border border-border/60 rounded-xl bg-background text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/40 transition-all duration-200",placeholder:"John Doe",required:!0,disabled:c})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"gitEmail",className:"flex items-center gap-2 text-sm font-medium text-foreground mb-2",children:[e.jsx(ot,{className:"w-3.5 h-3.5 text-muted-foreground"}),"Email"]}),e.jsx("input",{type:"email",id:"gitEmail",value:f,onChange:t=>q(t.target.value),className:"w-full px-4 py-3 border border-border/60 rounded-xl bg-background text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/40 transition-all duration-200",placeholder:"john@example.com",required:!0,disabled:c})]}),e.jsxs("p",{className:"text-xs text-muted-foreground/70 text-center",children:["Applied as ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-muted/60 text-xs",children:"git config --global"})," on your machine"]})]})]}),o===2&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-5",children:e.jsx(me,{className:"w-7 h-7 text-primary"})}),e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-foreground tracking-tight",children:"Add Projects"}),e.jsx("p",{className:"text-muted-foreground mt-2 text-sm max-w-sm mx-auto",children:L?"Select folders from your machine to work with":"Add GitHub repos or local folders as projects"})]}),u.length>0&&e.jsx("div",{className:"space-y-2",children:u.map((t,s)=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-primary/5 border border-primary/20",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:t.type==="github"?e.jsx(xe,{className:"w-4 h-4 text-primary"}):e.jsx(he,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.url||t.path})]})]}),e.jsx("button",{onClick:()=>Ge(s),className:"p-1.5 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded-lg transition-colors flex-shrink-0",children:e.jsx(ge,{className:"w-3.5 h-3.5"})})]},s))}),e.jsxs("div",{className:"space-y-3",children:[(L||te)&&!M&&e.jsxs("button",{onClick:Ae,disabled:b,className:"w-full flex items-center gap-3 p-4 rounded-xl border border-dashed border-border/60 hover:border-primary/40 hover:bg-primary/5 transition-all duration-200 text-left group",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-muted/60 group-hover:bg-primary/10 flex items-center justify-center flex-shrink-0 transition-colors",children:e.jsx(me,{className:"w-5 h-5 text-muted-foreground group-hover:text-primary transition-colors"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Add Local Folder"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:A?`Current: ${A}`:"Browse your filesystem"})]})]}),M&&e.jsxs("div",{className:"rounded-xl border border-border/60 bg-background overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-muted/30 border-b border-border/40",children:[e.jsx("button",{onClick:Fe,disabled:W,className:"p-1 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors",title:"Go up",children:e.jsx(pe,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate flex-1",children:m}),e.jsx("button",{onClick:()=>Pe(m),disabled:b||!m,className:"px-2.5 py-1 text-xs font-medium bg-primary text-primary-foreground rounded-lg hover:opacity-90 disabled:opacity-50 transition-opacity",children:b?"Adding...":"Select This"}),e.jsx("button",{onClick:()=>I(!1),className:"p-1 rounded hover:bg-muted/60 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(ge,{className:"w-3.5 h-3.5"})})]}),J.length>0&&e.jsx("div",{className:"flex gap-1 px-3 py-1.5 border-b border-border/30 bg-muted/10",children:J.map(t=>e.jsx("button",{onClick:()=>ae(t+"\\"),className:"px-2 py-0.5 text-[11px] font-mono rounded bg-muted/40 hover:bg-muted/70 text-muted-foreground hover:text-foreground transition-colors",children:t},t))}),e.jsx("div",{className:"max-h-48 overflow-y-auto",children:W?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(G,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):D.length===0?e.jsx("p",{className:"text-center text-xs text-muted-foreground py-6",children:"No folders found"}):D.map((t,s)=>e.jsxs("button",{onClick:()=>ae(t.path),className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-muted/30 transition-colors text-left",children:[e.jsx(he,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-foreground truncate",children:t.name})]},s))})]}),!L&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-xl border border-border/60 bg-card",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-muted/60 flex items-center justify-center flex-shrink-0",children:e.jsx(xe,{className:"w-5 h-5 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-2",children:"Clone GitHub Repo"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:x,onChange:t=>H(t.target.value),placeholder:"https://github.com/user/repo",className:"flex-1 px-3 py-1.5 text-sm border border-border/60 rounded-lg bg-background text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/30",disabled:b}),e.jsx("button",{onClick:Le,disabled:b||!x.trim(),className:"px-3 py-1.5 text-sm font-medium bg-foreground text-background rounded-lg hover:opacity-90 disabled:opacity-50 transition-opacity flex-shrink-0",children:b?e.jsx(G,{className:"w-4 h-4 animate-spin"}):e.jsx(nt,{className:"w-4 h-4"})})]}),V.length>0&&e.jsxs("select",{value:w,onChange:t=>Z(t.target.value),className:"mt-2 w-full px-2 py-1 text-xs border border-border/40 rounded-lg bg-background text-muted-foreground",children:[e.jsx("option",{value:"",children:"No token (public repos only)"}),V.map(t=>e.jsx("option",{value:t.id,children:t.credential_name},t.id))]}),Q&&e.jsx("p",{className:"mt-2 text-xs text-primary animate-pulse",children:Q})]})]}),!te&&e.jsxs("p",{className:"text-xs text-muted-foreground/60 text-center",children:["Connect your machine with ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-muted/60 text-[11px]",children:"uc web connect"})," to add local folders"]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground/60 text-center",children:u.length===0?"You can skip this and add projects later.":`${u.length} project${u.length>1?"s":""} added`})]}),o===3&&e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-foreground tracking-tight",children:"Connect Your Agents"}),e.jsxs("p",{className:"text-muted-foreground mt-2 text-sm max-w-sm mx-auto",children:["Optional — login to one or more AI assistants.",le>0&&e.jsxs("span",{className:"text-primary font-medium",children:[" ",le," connected"]})]})]}),e.jsx("div",{className:"space-y-3",children:Me.map((t,s)=>{const a=t.status.authenticated,i=t.status.loading;return e.jsxs("div",{className:`group flex items-center justify-between p-4 rounded-xl border transition-all duration-200 ${a?"bg-primary/5 border-primary/20":"bg-card border-border/50 hover:border-border"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${a?"bg-primary/10":"bg-muted/60"}`,children:t.logo}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium text-sm text-foreground flex items-center gap-2",children:[t.name,a&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md bg-green-500/10 text-green-600 dark:text-green-400 text-[10px] font-semibold uppercase tracking-wider",children:[e.jsx(it,{className:"w-3 h-3"}),"Connected"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i?"Checking...":a?t.status.email||"Ready to use":"Not connected"})]})]}),!a&&!i&&e.jsx("button",{onClick:t.onLogin,className:"px-4 py-2 text-sm font-medium rounded-lg bg-foreground text-background hover:opacity-90 transition-opacity flex-shrink-0",children:"Connect"})]},s)})}),e.jsx("p",{className:"text-xs text-muted-foreground/60 text-center",children:"You can always add or change these in Settings later."})]})]}),U&&e.jsx("div",{className:"mx-8 sm:mx-10 mb-2 p-3 rounded-xl bg-destructive/10 border border-destructive/20",children:e.jsx("p",{className:"text-sm text-destructive",children:U})}),e.jsxs("div",{className:"flex items-center justify-between px-8 sm:px-10 py-5 border-t border-border/40 bg-muted/20",children:[e.jsxs("button",{onClick:Oe,disabled:o===0||c,className:"flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground disabled:opacity-0 disabled:pointer-events-none transition-all duration-200",children:[e.jsx(pe,{className:"w-4 h-4"}),"Back"]}),o<F.length-1?e.jsx("button",{onClick:Re,disabled:!Ue()||c,className:"flex items-center gap-2 px-6 py-2.5 bg-primary text-primary-foreground font-medium text-sm rounded-xl hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 shadow-sm",children:c?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):o===0?e.jsxs(e.Fragment,{children:["Get Started",e.jsx(fe,{className:"w-4 h-4"})]}):e.jsxs(e.Fragment,{children:["Continue",e.jsx(lt,{className:"w-4 h-4"})]})}):e.jsx("button",{onClick:qe,disabled:c,className:"flex items-center gap-2 px-6 py-2.5 bg-primary text-primary-foreground font-medium text-sm rounded-xl hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 shadow-sm",children:c?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 animate-spin"}),"Finishing..."]}):e.jsxs(e.Fragment,{children:["Start Building",e.jsx(fe,{className:"w-4 h-4"})]})})]})]}),e.jsxs("p",{className:"text-center text-xs text-muted-foreground/50 mt-6",children:["Step ",o+1," of ",F.length]})]})}),l&&e.jsx(We,{isOpen:!!l,onClose:()=>v(null),provider:l,project:ve,onComplete:Be,isOnboarding:!0})]})};export{bt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Nr,g as lv}from"./vendor-react-96lCPsRK.js";function pv(r,a){for(var t=0;t<a.length;t++){const n=a[t];if(typeof n!="string"&&!Array.isArray(n)){for(const e in n)if(e!=="default"&&!(e in r)){const i=Object.getOwnPropertyDescriptor(n,e);i&&Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function qu(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var te,Ku;function _v(){if(Ku)return te;Ku=1;function r(){this.__data__=[],this.size=0}return te=r,te}var ae,Vu;function _r(){if(Vu)return ae;Vu=1;function r(a,t){return a===t||a!==a&&t!==t}return ae=r,ae}var ie,Hu;function Fr(){if(Hu)return ie;Hu=1;var r=_r();function a(t,n){for(var e=t.length;e--;)if(r(t[e][0],n))return e;return-1}return ie=a,ie}var ue,zu;function gv(){if(zu)return ue;zu=1;var r=Fr(),a=Array.prototype,t=a.splice;function n(e){var i=this.__data__,s=r(i,e);if(s<0)return!1;var u=i.length-1;return s==u?i.pop():t.call(i,s,1),--this.size,!0}return ue=n,ue}var se,Wu;function bv(){if(Wu)return se;Wu=1;var r=Fr();function a(t){var n=this.__data__,e=r(n,t);return e<0?void 0:n[e][1]}return se=a,se}var oe,Yu;function yv(){if(Yu)return oe;Yu=1;var r=Fr();function a(t){return r(this.__data__,t)>-1}return oe=a,oe}var fe,$u;function mv(){if($u)return fe;$u=1;var r=Fr();function a(t,n){var e=this.__data__,i=r(e,t);return i<0?(++this.size,e.push([t,n])):e[i][1]=n,this}return fe=a,fe}var ce,Xu;function jr(){if(Xu)return ce;Xu=1;var r=_v(),a=gv(),t=bv(),n=yv(),e=mv();function i(s){var u=-1,o=s==null?0:s.length;for(this.clear();++u<o;){var c=s[u];this.set(c[0],c[1])}}return i.prototype.clear=r,i.prototype.delete=a,i.prototype.get=t,i.prototype.has=n,i.prototype.set=e,ce=i,ce}var de,Zu;function qv(){if(Zu)return de;Zu=1;var r=jr();function a(){this.__data__=new r,this.size=0}return de=a,de}var he,Ju;function Rv(){if(Ju)return he;Ju=1;function r(a){var t=this.__data__,n=t.delete(a);return this.size=t.size,n}return he=r,he}var ve,Qu;function wv(){if(Qu)return ve;Qu=1;function r(a){return this.__data__.get(a)}return ve=r,ve}var le,rs;function Ev(){if(rs)return le;rs=1;function r(a){return this.__data__.has(a)}return le=r,le}var pe,es;function dh(){if(es)return pe;es=1;var r=typeof Nr=="object"&&Nr&&Nr.Object===Object&&Nr;return pe=r,pe}var _e,ns;function J(){if(ns)return _e;ns=1;var r=dh(),a=typeof self=="object"&&self&&self.Object===Object&&self,t=r||a||Function("return this")();return _e=t,_e}var ge,ts;function gr(){if(ts)return ge;ts=1;var r=J(),a=r.Symbol;return ge=a,ge}var be,as;function Iv(){if(as)return be;as=1;var r=gr(),a=Object.prototype,t=a.hasOwnProperty,n=a.toString,e=r?r.toStringTag:void 0;function i(s){var u=t.call(s,e),o=s[e];try{s[e]=void 0;var c=!0}catch{}var f=n.call(s);return c&&(u?s[e]=o:delete s[e]),f}return be=i,be}var ye,is;function Av(){if(is)return ye;is=1;var r=Object.prototype,a=r.toString;function t(n){return a.call(n)}return ye=t,ye}var me,us;function or(){if(us)return me;us=1;var r=gr(),a=Iv(),t=Av(),n="[object Null]",e="[object Undefined]",i=r?r.toStringTag:void 0;function s(u){return u==null?u===void 0?e:n:i&&i in Object(u)?a(u):t(u)}return me=s,me}var qe,ss;function $(){if(ss)return qe;ss=1;function r(a){var t=typeof a;return a!=null&&(t=="object"||t=="function")}return qe=r,qe}var Re,os;function Ar(){if(os)return Re;os=1;var r=or(),a=$(),t="[object AsyncFunction]",n="[object Function]",e="[object GeneratorFunction]",i="[object Proxy]";function s(u){if(!a(u))return!1;var o=r(u);return o==n||o==e||o==t||o==i}return Re=s,Re}var we,fs;function Sv(){if(fs)return we;fs=1;var r=J(),a=r["__core-js_shared__"];return we=a,we}var Ee,cs;function Cv(){if(cs)return Ee;cs=1;var r=Sv(),a=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!a&&a in n}return Ee=t,Ee}var Ie,ds;function hh(){if(ds)return Ie;ds=1;var r=Function.prototype,a=r.toString;function t(n){if(n!=null){try{return a.call(n)}catch{}try{return n+""}catch{}}return""}return Ie=t,Ie}var Ae,hs;function Tv(){if(hs)return Ae;hs=1;var r=Ar(),a=Cv(),t=$(),n=hh(),e=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,o=s.toString,c=u.hasOwnProperty,f=RegExp("^"+o.call(c).replace(e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||a(h))return!1;var v=r(h)?f:i;return v.test(n(h))}return Ae=d,Ae}var Se,vs;function Ov(){if(vs)return Se;vs=1;function r(a,t){return a==null?void 0:a[t]}return Se=r,Se}var Ce,ls;function fr(){if(ls)return Ce;ls=1;var r=Tv(),a=Ov();function t(n,e){var i=a(n,e);return r(i)?i:void 0}return Ce=t,Ce}var Te,ps;function Ru(){if(ps)return Te;ps=1;var r=fr(),a=J(),t=r(a,"Map");return Te=t,Te}var Oe,_s;function Gr(){if(_s)return Oe;_s=1;var r=fr(),a=r(Object,"create");return Oe=a,Oe}var xe,gs;function xv(){if(gs)return xe;gs=1;var r=Gr();function a(){this.__data__=r?r(null):{},this.size=0}return xe=a,xe}var Pe,bs;function Pv(){if(bs)return Pe;bs=1;function r(a){var t=this.has(a)&&delete this.__data__[a];return this.size-=t?1:0,t}return Pe=r,Pe}var Me,ys;function Mv(){if(ys)return Me;ys=1;var r=Gr(),a="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function e(i){var s=this.__data__;if(r){var u=s[i];return u===a?void 0:u}return n.call(s,i)?s[i]:void 0}return Me=e,Me}var Le,ms;function Lv(){if(ms)return Le;ms=1;var r=Gr(),a=Object.prototype,t=a.hasOwnProperty;function n(e){var i=this.__data__;return r?i[e]!==void 0:t.call(i,e)}return Le=n,Le}var Ne,qs;function Nv(){if(qs)return Ne;qs=1;var r=Gr(),a="__lodash_hash_undefined__";function t(n,e){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&e===void 0?a:e,this}return Ne=t,Ne}var ke,Rs;function kv(){if(Rs)return ke;Rs=1;var r=xv(),a=Pv(),t=Mv(),n=Lv(),e=Nv();function i(s){var u=-1,o=s==null?0:s.length;for(this.clear();++u<o;){var c=s[u];this.set(c[0],c[1])}}return i.prototype.clear=r,i.prototype.delete=a,i.prototype.get=t,i.prototype.has=n,i.prototype.set=e,ke=i,ke}var Fe,ws;function Fv(){if(ws)return Fe;ws=1;var r=kv(),a=jr(),t=Ru();function n(){this.size=0,this.__data__={hash:new r,map:new(t||a),string:new r}}return Fe=n,Fe}var je,Es;function jv(){if(Es)return je;Es=1;function r(a){var t=typeof a;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?a!=="__proto__":a===null}return je=r,je}var Ge,Is;function Dr(){if(Is)return Ge;Is=1;var r=jv();function a(t,n){var e=t.__data__;return r(n)?e[typeof n=="string"?"string":"hash"]:e.map}return Ge=a,Ge}var De,As;function Gv(){if(As)return De;As=1;var r=Dr();function a(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return De=a,De}var Be,Ss;function Dv(){if(Ss)return Be;Ss=1;var r=Dr();function a(t){return r(this,t).get(t)}return Be=a,Be}var Ue,Cs;function Bv(){if(Cs)return Ue;Cs=1;var r=Dr();function a(t){return r(this,t).has(t)}return Ue=a,Ue}var Ke,Ts;function Uv(){if(Ts)return Ke;Ts=1;var r=Dr();function a(t,n){var e=r(this,t),i=e.size;return e.set(t,n),this.size+=e.size==i?0:1,this}return Ke=a,Ke}var Ve,Os;function wu(){if(Os)return Ve;Os=1;var r=Fv(),a=Gv(),t=Dv(),n=Bv(),e=Uv();function i(s){var u=-1,o=s==null?0:s.length;for(this.clear();++u<o;){var c=s[u];this.set(c[0],c[1])}}return i.prototype.clear=r,i.prototype.delete=a,i.prototype.get=t,i.prototype.has=n,i.prototype.set=e,Ve=i,Ve}var He,xs;function Kv(){if(xs)return He;xs=1;var r=jr(),a=Ru(),t=wu(),n=200;function e(i,s){var u=this.__data__;if(u instanceof r){var o=u.__data__;if(!a||o.length<n-1)return o.push([i,s]),this.size=++u.size,this;u=this.__data__=new t(o)}return u.set(i,s),this.size=u.size,this}return He=e,He}var ze,Ps;function Br(){if(Ps)return ze;Ps=1;var r=jr(),a=qv(),t=Rv(),n=wv(),e=Ev(),i=Kv();function s(u){var o=this.__data__=new r(u);this.size=o.size}return s.prototype.clear=a,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=e,s.prototype.set=i,ze=s,ze}var We,Ms;function Eu(){if(Ms)return We;Ms=1;function r(a,t){for(var n=-1,e=a==null?0:a.length;++n<e&&t(a[n],n,a)!==!1;);return a}return We=r,We}var Ye,Ls;function vh(){if(Ls)return Ye;Ls=1;var r=fr(),a=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Ye=a,Ye}var $e,Ns;function Ur(){if(Ns)return $e;Ns=1;var r=vh();function a(t,n,e){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}return $e=a,$e}var Xe,ks;function Kr(){if(ks)return Xe;ks=1;var r=Ur(),a=_r(),t=Object.prototype,n=t.hasOwnProperty;function e(i,s,u){var o=i[s];(!(n.call(i,s)&&a(o,u))||u===void 0&&!(s in i))&&r(i,s,u)}return Xe=e,Xe}var Ze,Fs;function Sr(){if(Fs)return Ze;Fs=1;var r=Kr(),a=Ur();function t(n,e,i,s){var u=!i;i||(i={});for(var o=-1,c=e.length;++o<c;){var f=e[o],d=s?s(i[f],n[f],f,i,n):void 0;d===void 0&&(d=n[f]),u?a(i,f,d):r(i,f,d)}return i}return Ze=t,Ze}var Je,js;function Vv(){if(js)return Je;js=1;function r(a,t){for(var n=-1,e=Array(a);++n<a;)e[n]=t(n);return e}return Je=r,Je}var Qe,Gs;function Q(){if(Gs)return Qe;Gs=1;function r(a){return a!=null&&typeof a=="object"}return Qe=r,Qe}var rn,Ds;function Hv(){if(Ds)return rn;Ds=1;var r=or(),a=Q(),t="[object Arguments]";function n(e){return a(e)&&r(e)==t}return rn=n,rn}var en,Bs;function Cr(){if(Bs)return en;Bs=1;var r=Hv(),a=Q(),t=Object.prototype,n=t.hasOwnProperty,e=t.propertyIsEnumerable,i=r((function(){return arguments})())?r:function(s){return a(s)&&n.call(s,"callee")&&!e.call(s,"callee")};return en=i,en}var nn,Us;function U(){if(Us)return nn;Us=1;var r=Array.isArray;return nn=r,nn}var wr={exports:{}},tn,Ks;function zv(){if(Ks)return tn;Ks=1;function r(){return!1}return tn=r,tn}wr.exports;var Vs;function br(){return Vs||(Vs=1,(function(r,a){var t=J(),n=zv(),e=a&&!a.nodeType&&a,i=e&&!0&&r&&!r.nodeType&&r,s=i&&i.exports===e,u=s?t.Buffer:void 0,o=u?u.isBuffer:void 0,c=o||n;r.exports=c})(wr,wr.exports)),wr.exports}var an,Hs;function Vr(){if(Hs)return an;Hs=1;var r=9007199254740991,a=/^(?:0|[1-9]\d*)$/;function t(n,e){var i=typeof n;return e=e??r,!!e&&(i=="number"||i!="symbol"&&a.test(n))&&n>-1&&n%1==0&&n<e}return an=t,an}var un,zs;function Iu(){if(zs)return un;zs=1;var r=9007199254740991;function a(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return un=a,un}var sn,Ws;function Wv(){if(Ws)return sn;Ws=1;var r=or(),a=Iu(),t=Q(),n="[object Arguments]",e="[object Array]",i="[object Boolean]",s="[object Date]",u="[object Error]",o="[object Function]",c="[object Map]",f="[object Number]",d="[object Object]",h="[object RegExp]",v="[object Set]",m="[object String]",_="[object WeakMap]",l="[object ArrayBuffer]",g="[object DataView]",p="[object Float32Array]",b="[object Float64Array]",y="[object Int8Array]",q="[object Int16Array]",R="[object Int32Array]",w="[object Uint8Array]",C="[object Uint8ClampedArray]",A="[object Uint16Array]",S="[object Uint32Array]",O={};O[p]=O[b]=O[y]=O[q]=O[R]=O[w]=O[C]=O[A]=O[S]=!0,O[n]=O[e]=O[l]=O[i]=O[g]=O[s]=O[u]=O[o]=O[c]=O[f]=O[d]=O[h]=O[v]=O[m]=O[_]=!1;function P(M){return t(M)&&a(M.length)&&!!O[r(M)]}return sn=P,sn}var on,Ys;function Hr(){if(Ys)return on;Ys=1;function r(a){return function(t){return a(t)}}return on=r,on}var Er={exports:{}};Er.exports;var $s;function Au(){return $s||($s=1,(function(r,a){var t=dh(),n=a&&!a.nodeType&&a,e=n&&!0&&r&&!r.nodeType&&r,i=e&&e.exports===n,s=i&&t.process,u=(function(){try{var o=e&&e.require&&e.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}})();r.exports=u})(Er,Er.exports)),Er.exports}var fn,Xs;function Tr(){if(Xs)return fn;Xs=1;var r=Wv(),a=Hr(),t=Au(),n=t&&t.isTypedArray,e=n?a(n):r;return fn=e,fn}var cn,Zs;function lh(){if(Zs)return cn;Zs=1;var r=Vv(),a=Cr(),t=U(),n=br(),e=Vr(),i=Tr(),s=Object.prototype,u=s.hasOwnProperty;function o(c,f){var d=t(c),h=!d&&a(c),v=!d&&!h&&n(c),m=!d&&!h&&!v&&i(c),_=d||h||v||m,l=_?r(c.length,String):[],g=l.length;for(var p in c)(f||u.call(c,p))&&!(_&&(p=="length"||v&&(p=="offset"||p=="parent")||m&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||e(p,g)))&&l.push(p);return l}return cn=o,cn}var dn,Js;function zr(){if(Js)return dn;Js=1;var r=Object.prototype;function a(t){var n=t&&t.constructor,e=typeof n=="function"&&n.prototype||r;return t===e}return dn=a,dn}var hn,Qs;function ph(){if(Qs)return hn;Qs=1;function r(a,t){return function(n){return a(t(n))}}return hn=r,hn}var vn,ro;function Yv(){if(ro)return vn;ro=1;var r=ph(),a=r(Object.keys,Object);return vn=a,vn}var ln,eo;function Su(){if(eo)return ln;eo=1;var r=zr(),a=Yv(),t=Object.prototype,n=t.hasOwnProperty;function e(i){if(!r(i))return a(i);var s=[];for(var u in Object(i))n.call(i,u)&&u!="constructor"&&s.push(u);return s}return ln=e,ln}var pn,no;function rr(){if(no)return pn;no=1;var r=Ar(),a=Iu();function t(n){return n!=null&&a(n.length)&&!r(n)}return pn=t,pn}var _n,to;function ar(){if(to)return _n;to=1;var r=lh(),a=Su(),t=rr();function n(e){return t(e)?r(e):a(e)}return _n=n,_n}var gn,ao;function $v(){if(ao)return gn;ao=1;var r=Sr(),a=ar();function t(n,e){return n&&r(e,a(e),n)}return gn=t,gn}var bn,io;function Xv(){if(io)return bn;io=1;function r(a){var t=[];if(a!=null)for(var n in Object(a))t.push(n);return t}return bn=r,bn}var yn,uo;function Zv(){if(uo)return yn;uo=1;var r=$(),a=zr(),t=Xv(),n=Object.prototype,e=n.hasOwnProperty;function i(s){if(!r(s))return t(s);var u=a(s),o=[];for(var c in s)c=="constructor"&&(u||!e.call(s,c))||o.push(c);return o}return yn=i,yn}var mn,so;function cr(){if(so)return mn;so=1;var r=lh(),a=Zv(),t=rr();function n(e){return t(e)?r(e,!0):a(e)}return mn=n,mn}var qn,oo;function Jv(){if(oo)return qn;oo=1;var r=Sr(),a=cr();function t(n,e){return n&&r(e,a(e),n)}return qn=t,qn}var Ir={exports:{}};Ir.exports;var fo;function _h(){return fo||(fo=1,(function(r,a){var t=J(),n=a&&!a.nodeType&&a,e=n&&!0&&r&&!r.nodeType&&r,i=e&&e.exports===n,s=i?t.Buffer:void 0,u=s?s.allocUnsafe:void 0;function o(c,f){if(f)return c.slice();var d=c.length,h=u?u(d):new c.constructor(d);return c.copy(h),h}r.exports=o})(Ir,Ir.exports)),Ir.exports}var Rn,co;function gh(){if(co)return Rn;co=1;function r(a,t){var n=-1,e=a.length;for(t||(t=Array(e));++n<e;)t[n]=a[n];return t}return Rn=r,Rn}var wn,ho;function bh(){if(ho)return wn;ho=1;function r(a,t){for(var n=-1,e=a==null?0:a.length,i=0,s=[];++n<e;){var u=a[n];t(u,n,a)&&(s[i++]=u)}return s}return wn=r,wn}var En,vo;function yh(){if(vo)return En;vo=1;function r(){return[]}return En=r,En}var In,lo;function Cu(){if(lo)return In;lo=1;var r=bh(),a=yh(),t=Object.prototype,n=t.propertyIsEnumerable,e=Object.getOwnPropertySymbols,i=e?function(s){return s==null?[]:(s=Object(s),r(e(s),function(u){return n.call(s,u)}))}:a;return In=i,In}var An,po;function Qv(){if(po)return An;po=1;var r=Sr(),a=Cu();function t(n,e){return r(n,a(n),e)}return An=t,An}var Sn,_o;function Tu(){if(_o)return Sn;_o=1;function r(a,t){for(var n=-1,e=t.length,i=a.length;++n<e;)a[i+n]=t[n];return a}return Sn=r,Sn}var Cn,go;function Wr(){if(go)return Cn;go=1;var r=ph(),a=r(Object.getPrototypeOf,Object);return Cn=a,Cn}var Tn,bo;function mh(){if(bo)return Tn;bo=1;var r=Tu(),a=Wr(),t=Cu(),n=yh(),e=Object.getOwnPropertySymbols,i=e?function(s){for(var u=[];s;)r(u,t(s)),s=a(s);return u}:n;return Tn=i,Tn}var On,yo;function rl(){if(yo)return On;yo=1;var r=Sr(),a=mh();function t(n,e){return r(n,a(n),e)}return On=t,On}var xn,mo;function qh(){if(mo)return xn;mo=1;var r=Tu(),a=U();function t(n,e,i){var s=e(n);return a(n)?s:r(s,i(n))}return xn=t,xn}var Pn,qo;function Rh(){if(qo)return Pn;qo=1;var r=qh(),a=Cu(),t=ar();function n(e){return r(e,t,a)}return Pn=n,Pn}var Mn,Ro;function el(){if(Ro)return Mn;Ro=1;var r=qh(),a=mh(),t=cr();function n(e){return r(e,t,a)}return Mn=n,Mn}var Ln,wo;function nl(){if(wo)return Ln;wo=1;var r=fr(),a=J(),t=r(a,"DataView");return Ln=t,Ln}var Nn,Eo;function tl(){if(Eo)return Nn;Eo=1;var r=fr(),a=J(),t=r(a,"Promise");return Nn=t,Nn}var kn,Io;function wh(){if(Io)return kn;Io=1;var r=fr(),a=J(),t=r(a,"Set");return kn=t,kn}var Fn,Ao;function al(){if(Ao)return Fn;Ao=1;var r=fr(),a=J(),t=r(a,"WeakMap");return Fn=t,Fn}var jn,So;function yr(){if(So)return jn;So=1;var r=nl(),a=Ru(),t=tl(),n=wh(),e=al(),i=or(),s=hh(),u="[object Map]",o="[object Object]",c="[object Promise]",f="[object Set]",d="[object WeakMap]",h="[object DataView]",v=s(r),m=s(a),_=s(t),l=s(n),g=s(e),p=i;return(r&&p(new r(new ArrayBuffer(1)))!=h||a&&p(new a)!=u||t&&p(t.resolve())!=c||n&&p(new n)!=f||e&&p(new e)!=d)&&(p=function(b){var y=i(b),q=y==o?b.constructor:void 0,R=q?s(q):"";if(R)switch(R){case v:return h;case m:return u;case _:return c;case l:return f;case g:return d}return y}),jn=p,jn}var Gn,Co;function il(){if(Co)return Gn;Co=1;var r=Object.prototype,a=r.hasOwnProperty;function t(n){var e=n.length,i=new n.constructor(e);return e&&typeof n[0]=="string"&&a.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return Gn=t,Gn}var Dn,To;function Eh(){if(To)return Dn;To=1;var r=J(),a=r.Uint8Array;return Dn=a,Dn}var Bn,Oo;function Ou(){if(Oo)return Bn;Oo=1;var r=Eh();function a(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return Bn=a,Bn}var Un,xo;function ul(){if(xo)return Un;xo=1;var r=Ou();function a(t,n){var e=n?r(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}return Un=a,Un}var Kn,Po;function sl(){if(Po)return Kn;Po=1;var r=/\w*$/;function a(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Kn=a,Kn}var Vn,Mo;function ol(){if(Mo)return Vn;Mo=1;var r=gr(),a=r?r.prototype:void 0,t=a?a.valueOf:void 0;function n(e){return t?Object(t.call(e)):{}}return Vn=n,Vn}var Hn,Lo;function Ih(){if(Lo)return Hn;Lo=1;var r=Ou();function a(t,n){var e=n?r(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}return Hn=a,Hn}var zn,No;function fl(){if(No)return zn;No=1;var r=Ou(),a=ul(),t=sl(),n=ol(),e=Ih(),i="[object Boolean]",s="[object Date]",u="[object Map]",o="[object Number]",c="[object RegExp]",f="[object Set]",d="[object String]",h="[object Symbol]",v="[object ArrayBuffer]",m="[object DataView]",_="[object Float32Array]",l="[object Float64Array]",g="[object Int8Array]",p="[object Int16Array]",b="[object Int32Array]",y="[object Uint8Array]",q="[object Uint8ClampedArray]",R="[object Uint16Array]",w="[object Uint32Array]";function C(A,S,O){var P=A.constructor;switch(S){case v:return r(A);case i:case s:return new P(+A);case m:return a(A,O);case _:case l:case g:case p:case b:case y:case q:case R:case w:return e(A,O);case u:return new P;case o:case d:return new P(A);case c:return t(A);case f:return new P;case h:return n(A)}}return zn=C,zn}var Wn,ko;function Ah(){if(ko)return Wn;ko=1;var r=$(),a=Object.create,t=(function(){function n(){}return function(e){if(!r(e))return{};if(a)return a(e);n.prototype=e;var i=new n;return n.prototype=void 0,i}})();return Wn=t,Wn}var Yn,Fo;function Sh(){if(Fo)return Yn;Fo=1;var r=Ah(),a=Wr(),t=zr();function n(e){return typeof e.constructor=="function"&&!t(e)?r(a(e)):{}}return Yn=n,Yn}var $n,jo;function cl(){if(jo)return $n;jo=1;var r=yr(),a=Q(),t="[object Map]";function n(e){return a(e)&&r(e)==t}return $n=n,$n}var Xn,Go;function dl(){if(Go)return Xn;Go=1;var r=cl(),a=Hr(),t=Au(),n=t&&t.isMap,e=n?a(n):r;return Xn=e,Xn}var Zn,Do;function hl(){if(Do)return Zn;Do=1;var r=yr(),a=Q(),t="[object Set]";function n(e){return a(e)&&r(e)==t}return Zn=n,Zn}var Jn,Bo;function vl(){if(Bo)return Jn;Bo=1;var r=hl(),a=Hr(),t=Au(),n=t&&t.isSet,e=n?a(n):r;return Jn=e,Jn}var Qn,Uo;function Ch(){if(Uo)return Qn;Uo=1;var r=Br(),a=Eu(),t=Kr(),n=$v(),e=Jv(),i=_h(),s=gh(),u=Qv(),o=rl(),c=Rh(),f=el(),d=yr(),h=il(),v=fl(),m=Sh(),_=U(),l=br(),g=dl(),p=$(),b=vl(),y=ar(),q=cr(),R=1,w=2,C=4,A="[object Arguments]",S="[object Array]",O="[object Boolean]",P="[object Date]",M="[object Error]",N="[object Function]",j="[object GeneratorFunction]",K="[object Map]",hr="[object Number]",ir="[object Object]",re="[object RegExp]",ee="[object Set]",ne="[object String]",qr="[object Symbol]",Rr="[object WeakMap]",E="[object ArrayBuffer]",I="[object DataView]",T="[object Float32Array]",x="[object Float64Array]",L="[object Int8Array]",G="[object Int16Array]",B="[object Int32Array]",H="[object Uint8Array]",xr="[object Uint8ClampedArray]",z="[object Uint16Array]",V="[object Uint32Array]",k={};k[A]=k[S]=k[E]=k[I]=k[O]=k[P]=k[T]=k[x]=k[L]=k[G]=k[B]=k[K]=k[hr]=k[ir]=k[re]=k[ee]=k[ne]=k[qr]=k[H]=k[xr]=k[z]=k[V]=!0,k[M]=k[N]=k[Rr]=!1;function ur(F,vr,lr,dv,Pr,nr){var W,Mr=vr&R,Lr=vr&w,hv=vr&C;if(lr&&(W=Pr?lr(F,dv,Pr,nr):lr(F)),W!==void 0)return W;if(!p(F))return F;var Gu=_(F);if(Gu){if(W=h(F),!Mr)return s(F,W)}else{var pr=d(F),Du=pr==N||pr==j;if(l(F))return i(F,Mr);if(pr==ir||pr==A||Du&&!Pr){if(W=Lr||Du?{}:m(F),!Mr)return Lr?o(F,e(W,F)):u(F,n(W,F))}else{if(!k[pr])return Pr?F:{};W=v(F,pr,Mr)}}nr||(nr=new r);var Bu=nr.get(F);if(Bu)return Bu;nr.set(F,W),b(F)?F.forEach(function(tr){W.add(ur(tr,vr,lr,tr,F,nr))}):g(F)&&F.forEach(function(tr,sr){W.set(sr,ur(tr,vr,lr,sr,F,nr))});var vv=hv?Lr?f:c:Lr?q:y,Uu=Gu?void 0:vv(F);return a(Uu||F,function(tr,sr){Uu&&(sr=tr,tr=F[sr]),t(W,sr,ur(tr,vr,lr,sr,F,nr))}),W}return Qn=ur,Qn}var rt,Ko;function ll(){if(Ko)return rt;Ko=1;var r=Ch(),a=4;function t(n){return r(n,a)}return rt=t,rt}var et,Vo;function xu(){if(Vo)return et;Vo=1;function r(a){return function(){return a}}return et=r,et}var nt,Ho;function pl(){if(Ho)return nt;Ho=1;function r(a){return function(t,n,e){for(var i=-1,s=Object(t),u=e(t),o=u.length;o--;){var c=u[a?o:++i];if(n(s[c],c,s)===!1)break}return t}}return nt=r,nt}var tt,zo;function Pu(){if(zo)return tt;zo=1;var r=pl(),a=r();return tt=a,tt}var at,Wo;function Mu(){if(Wo)return at;Wo=1;var r=Pu(),a=ar();function t(n,e){return n&&r(n,e,a)}return at=t,at}var it,Yo;function _l(){if(Yo)return it;Yo=1;var r=rr();function a(t,n){return function(e,i){if(e==null)return e;if(!r(e))return t(e,i);for(var s=e.length,u=n?s:-1,o=Object(e);(n?u--:++u<s)&&i(o[u],u,o)!==!1;);return e}}return it=a,it}var ut,$o;function Yr(){if($o)return ut;$o=1;var r=Mu(),a=_l(),t=a(r);return ut=t,ut}var st,Xo;function dr(){if(Xo)return st;Xo=1;function r(a){return a}return st=r,st}var ot,Zo;function Th(){if(Zo)return ot;Zo=1;var r=dr();function a(t){return typeof t=="function"?t:r}return ot=a,ot}var ft,Jo;function Oh(){if(Jo)return ft;Jo=1;var r=Eu(),a=Yr(),t=Th(),n=U();function e(i,s){var u=n(i)?r:a;return u(i,t(s))}return ft=e,ft}var ct,Qo;function xh(){return Qo||(Qo=1,ct=Oh()),ct}var dt,rf;function gl(){if(rf)return dt;rf=1;var r=Yr();function a(t,n){var e=[];return r(t,function(i,s,u){n(i,s,u)&&e.push(i)}),e}return dt=a,dt}var ht,ef;function bl(){if(ef)return ht;ef=1;var r="__lodash_hash_undefined__";function a(t){return this.__data__.set(t,r),this}return ht=a,ht}var vt,nf;function yl(){if(nf)return vt;nf=1;function r(a){return this.__data__.has(a)}return vt=r,vt}var lt,tf;function Ph(){if(tf)return lt;tf=1;var r=wu(),a=bl(),t=yl();function n(e){var i=-1,s=e==null?0:e.length;for(this.__data__=new r;++i<s;)this.add(e[i])}return n.prototype.add=n.prototype.push=a,n.prototype.has=t,lt=n,lt}var pt,af;function ml(){if(af)return pt;af=1;function r(a,t){for(var n=-1,e=a==null?0:a.length;++n<e;)if(t(a[n],n,a))return!0;return!1}return pt=r,pt}var _t,uf;function Mh(){if(uf)return _t;uf=1;function r(a,t){return a.has(t)}return _t=r,_t}var gt,sf;function Lh(){if(sf)return gt;sf=1;var r=Ph(),a=ml(),t=Mh(),n=1,e=2;function i(s,u,o,c,f,d){var h=o&n,v=s.length,m=u.length;if(v!=m&&!(h&&m>v))return!1;var _=d.get(s),l=d.get(u);if(_&&l)return _==u&&l==s;var g=-1,p=!0,b=o&e?new r:void 0;for(d.set(s,u),d.set(u,s);++g<v;){var y=s[g],q=u[g];if(c)var R=h?c(q,y,g,u,s,d):c(y,q,g,s,u,d);if(R!==void 0){if(R)continue;p=!1;break}if(b){if(!a(u,function(w,C){if(!t(b,C)&&(y===w||f(y,w,o,c,d)))return b.push(C)})){p=!1;break}}else if(!(y===q||f(y,q,o,c,d))){p=!1;break}}return d.delete(s),d.delete(u),p}return gt=i,gt}var bt,of;function ql(){if(of)return bt;of=1;function r(a){var t=-1,n=Array(a.size);return a.forEach(function(e,i){n[++t]=[i,e]}),n}return bt=r,bt}var yt,ff;function Lu(){if(ff)return yt;ff=1;function r(a){var t=-1,n=Array(a.size);return a.forEach(function(e){n[++t]=e}),n}return yt=r,yt}var mt,cf;function Rl(){if(cf)return mt;cf=1;var r=gr(),a=Eh(),t=_r(),n=Lh(),e=ql(),i=Lu(),s=1,u=2,o="[object Boolean]",c="[object Date]",f="[object Error]",d="[object Map]",h="[object Number]",v="[object RegExp]",m="[object Set]",_="[object String]",l="[object Symbol]",g="[object ArrayBuffer]",p="[object DataView]",b=r?r.prototype:void 0,y=b?b.valueOf:void 0;function q(R,w,C,A,S,O,P){switch(C){case p:if(R.byteLength!=w.byteLength||R.byteOffset!=w.byteOffset)return!1;R=R.buffer,w=w.buffer;case g:return!(R.byteLength!=w.byteLength||!O(new a(R),new a(w)));case o:case c:case h:return t(+R,+w);case f:return R.name==w.name&&R.message==w.message;case v:case _:return R==w+"";case d:var M=e;case m:var N=A&s;if(M||(M=i),R.size!=w.size&&!N)return!1;var j=P.get(R);if(j)return j==w;A|=u,P.set(R,w);var K=n(M(R),M(w),A,S,O,P);return P.delete(R),K;case l:if(y)return y.call(R)==y.call(w)}return!1}return mt=q,mt}var qt,df;function wl(){if(df)return qt;df=1;var r=Rh(),a=1,t=Object.prototype,n=t.hasOwnProperty;function e(i,s,u,o,c,f){var d=u&a,h=r(i),v=h.length,m=r(s),_=m.length;if(v!=_&&!d)return!1;for(var l=v;l--;){var g=h[l];if(!(d?g in s:n.call(s,g)))return!1}var p=f.get(i),b=f.get(s);if(p&&b)return p==s&&b==i;var y=!0;f.set(i,s),f.set(s,i);for(var q=d;++l<v;){g=h[l];var R=i[g],w=s[g];if(o)var C=d?o(w,R,g,s,i,f):o(R,w,g,i,s,f);if(!(C===void 0?R===w||c(R,w,u,o,f):C)){y=!1;break}q||(q=g=="constructor")}if(y&&!q){var A=i.constructor,S=s.constructor;A!=S&&"constructor"in i&&"constructor"in s&&!(typeof A=="function"&&A instanceof A&&typeof S=="function"&&S instanceof S)&&(y=!1)}return f.delete(i),f.delete(s),y}return qt=e,qt}var Rt,hf;function El(){if(hf)return Rt;hf=1;var r=Br(),a=Lh(),t=Rl(),n=wl(),e=yr(),i=U(),s=br(),u=Tr(),o=1,c="[object Arguments]",f="[object Array]",d="[object Object]",h=Object.prototype,v=h.hasOwnProperty;function m(_,l,g,p,b,y){var q=i(_),R=i(l),w=q?f:e(_),C=R?f:e(l);w=w==c?d:w,C=C==c?d:C;var A=w==d,S=C==d,O=w==C;if(O&&s(_)){if(!s(l))return!1;q=!0,A=!1}if(O&&!A)return y||(y=new r),q||u(_)?a(_,l,g,p,b,y):t(_,l,w,g,p,b,y);if(!(g&o)){var P=A&&v.call(_,"__wrapped__"),M=S&&v.call(l,"__wrapped__");if(P||M){var N=P?_.value():_,j=M?l.value():l;return y||(y=new r),b(N,j,g,p,y)}}return O?(y||(y=new r),n(_,l,g,p,b,y)):!1}return Rt=m,Rt}var wt,vf;function Nh(){if(vf)return wt;vf=1;var r=El(),a=Q();function t(n,e,i,s,u){return n===e?!0:n==null||e==null||!a(n)&&!a(e)?n!==n&&e!==e:r(n,e,i,s,t,u)}return wt=t,wt}var Et,lf;function Il(){if(lf)return Et;lf=1;var r=Br(),a=Nh(),t=1,n=2;function e(i,s,u,o){var c=u.length,f=c,d=!o;if(i==null)return!f;for(i=Object(i);c--;){var h=u[c];if(d&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++c<f;){h=u[c];var v=h[0],m=i[v],_=h[1];if(d&&h[2]){if(m===void 0&&!(v in i))return!1}else{var l=new r;if(o)var g=o(m,_,v,i,s,l);if(!(g===void 0?a(_,m,t|n,o,l):g))return!1}}return!0}return Et=e,Et}var It,pf;function kh(){if(pf)return It;pf=1;var r=$();function a(t){return t===t&&!r(t)}return It=a,It}var At,_f;function Al(){if(_f)return At;_f=1;var r=kh(),a=ar();function t(n){for(var e=a(n),i=e.length;i--;){var s=e[i],u=n[s];e[i]=[s,u,r(u)]}return e}return At=t,At}var St,gf;function Fh(){if(gf)return St;gf=1;function r(a,t){return function(n){return n==null?!1:n[a]===t&&(t!==void 0||a in Object(n))}}return St=r,St}var Ct,bf;function Sl(){if(bf)return Ct;bf=1;var r=Il(),a=Al(),t=Fh();function n(e){var i=a(e);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(s){return s===e||r(s,e,i)}}return Ct=n,Ct}var Tt,yf;function mr(){if(yf)return Tt;yf=1;var r=or(),a=Q(),t="[object Symbol]";function n(e){return typeof e=="symbol"||a(e)&&r(e)==t}return Tt=n,Tt}var Ot,mf;function Nu(){if(mf)return Ot;mf=1;var r=U(),a=mr(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function e(i,s){if(r(i))return!1;var u=typeof i;return u=="number"||u=="symbol"||u=="boolean"||i==null||a(i)?!0:n.test(i)||!t.test(i)||s!=null&&i in Object(s)}return Ot=e,Ot}var xt,qf;function Cl(){if(qf)return xt;qf=1;var r=wu(),a="Expected a function";function t(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(a);var i=function(){var s=arguments,u=e?e.apply(this,s):s[0],o=i.cache;if(o.has(u))return o.get(u);var c=n.apply(this,s);return i.cache=o.set(u,c)||o,c};return i.cache=new(t.Cache||r),i}return t.Cache=r,xt=t,xt}var Pt,Rf;function Tl(){if(Rf)return Pt;Rf=1;var r=Cl(),a=500;function t(n){var e=r(n,function(s){return i.size===a&&i.clear(),s}),i=e.cache;return e}return Pt=t,Pt}var Mt,wf;function Ol(){if(wf)return Mt;wf=1;var r=Tl(),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(e){var i=[];return e.charCodeAt(0)===46&&i.push(""),e.replace(a,function(s,u,o,c){i.push(o?c.replace(t,"$1"):u||s)}),i});return Mt=n,Mt}var Lt,Ef;function $r(){if(Ef)return Lt;Ef=1;function r(a,t){for(var n=-1,e=a==null?0:a.length,i=Array(e);++n<e;)i[n]=t(a[n],n,a);return i}return Lt=r,Lt}var Nt,If;function xl(){if(If)return Nt;If=1;var r=gr(),a=$r(),t=U(),n=mr(),e=r?r.prototype:void 0,i=e?e.toString:void 0;function s(u){if(typeof u=="string")return u;if(t(u))return a(u,s)+"";if(n(u))return i?i.call(u):"";var o=u+"";return o=="0"&&1/u==-1/0?"-0":o}return Nt=s,Nt}var kt,Af;function jh(){if(Af)return kt;Af=1;var r=xl();function a(t){return t==null?"":r(t)}return kt=a,kt}var Ft,Sf;function Xr(){if(Sf)return Ft;Sf=1;var r=U(),a=Nu(),t=Ol(),n=jh();function e(i,s){return r(i)?i:a(i,s)?[i]:t(n(i))}return Ft=e,Ft}var jt,Cf;function Or(){if(Cf)return jt;Cf=1;var r=mr();function a(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return jt=a,jt}var Gt,Tf;function Zr(){if(Tf)return Gt;Tf=1;var r=Xr(),a=Or();function t(n,e){e=r(e,n);for(var i=0,s=e.length;n!=null&&i<s;)n=n[a(e[i++])];return i&&i==s?n:void 0}return Gt=t,Gt}var Dt,Of;function Pl(){if(Of)return Dt;Of=1;var r=Zr();function a(t,n,e){var i=t==null?void 0:r(t,n);return i===void 0?e:i}return Dt=a,Dt}var Bt,xf;function Ml(){if(xf)return Bt;xf=1;function r(a,t){return a!=null&&t in Object(a)}return Bt=r,Bt}var Ut,Pf;function Gh(){if(Pf)return Ut;Pf=1;var r=Xr(),a=Cr(),t=U(),n=Vr(),e=Iu(),i=Or();function s(u,o,c){o=r(o,u);for(var f=-1,d=o.length,h=!1;++f<d;){var v=i(o[f]);if(!(h=u!=null&&c(u,v)))break;u=u[v]}return h||++f!=d?h:(d=u==null?0:u.length,!!d&&e(d)&&n(v,d)&&(t(u)||a(u)))}return Ut=s,Ut}var Kt,Mf;function Dh(){if(Mf)return Kt;Mf=1;var r=Ml(),a=Gh();function t(n,e){return n!=null&&a(n,e,r)}return Kt=t,Kt}var Vt,Lf;function Ll(){if(Lf)return Vt;Lf=1;var r=Nh(),a=Pl(),t=Dh(),n=Nu(),e=kh(),i=Fh(),s=Or(),u=1,o=2;function c(f,d){return n(f)&&e(d)?i(s(f),d):function(h){var v=a(h,f);return v===void 0&&v===d?t(h,f):r(d,v,u|o)}}return Vt=c,Vt}var Ht,Nf;function Bh(){if(Nf)return Ht;Nf=1;function r(a){return function(t){return t==null?void 0:t[a]}}return Ht=r,Ht}var zt,kf;function Nl(){if(kf)return zt;kf=1;var r=Zr();function a(t){return function(n){return r(n,t)}}return zt=a,zt}var Wt,Ff;function kl(){if(Ff)return Wt;Ff=1;var r=Bh(),a=Nl(),t=Nu(),n=Or();function e(i){return t(i)?r(n(i)):a(i)}return Wt=e,Wt}var Yt,jf;function er(){if(jf)return Yt;jf=1;var r=Sl(),a=Ll(),t=dr(),n=U(),e=kl();function i(s){return typeof s=="function"?s:s==null?t:typeof s=="object"?n(s)?a(s[0],s[1]):r(s):e(s)}return Yt=i,Yt}var $t,Gf;function Uh(){if(Gf)return $t;Gf=1;var r=bh(),a=gl(),t=er(),n=U();function e(i,s){var u=n(i)?r:a;return u(i,t(s,3))}return $t=e,$t}var Xt,Df;function Fl(){if(Df)return Xt;Df=1;var r=Object.prototype,a=r.hasOwnProperty;function t(n,e){return n!=null&&a.call(n,e)}return Xt=t,Xt}var Zt,Bf;function Kh(){if(Bf)return Zt;Bf=1;var r=Fl(),a=Gh();function t(n,e){return n!=null&&a(n,e,r)}return Zt=t,Zt}var Jt,Uf;function jl(){if(Uf)return Jt;Uf=1;var r=Su(),a=yr(),t=Cr(),n=U(),e=rr(),i=br(),s=zr(),u=Tr(),o="[object Map]",c="[object Set]",f=Object.prototype,d=f.hasOwnProperty;function h(v){if(v==null)return!0;if(e(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||i(v)||u(v)||t(v)))return!v.length;var m=a(v);if(m==o||m==c)return!v.size;if(s(v))return!r(v).length;for(var _ in v)if(d.call(v,_))return!1;return!0}return Jt=h,Jt}var Qt,Kf;function Vh(){if(Kf)return Qt;Kf=1;function r(a){return a===void 0}return Qt=r,Qt}var ra,Vf;function Hh(){if(Vf)return ra;Vf=1;var r=Yr(),a=rr();function t(n,e){var i=-1,s=a(n)?Array(n.length):[];return r(n,function(u,o,c){s[++i]=e(u,o,c)}),s}return ra=t,ra}var ea,Hf;function zh(){if(Hf)return ea;Hf=1;var r=$r(),a=er(),t=Hh(),n=U();function e(i,s){var u=n(i)?r:t;return u(i,a(s,3))}return ea=e,ea}var na,zf;function Gl(){if(zf)return na;zf=1;function r(a,t,n,e){var i=-1,s=a==null?0:a.length;for(e&&s&&(n=a[++i]);++i<s;)n=t(n,a[i],i,a);return n}return na=r,na}var ta,Wf;function Dl(){if(Wf)return ta;Wf=1;function r(a,t,n,e,i){return i(a,function(s,u,o){n=e?(e=!1,s):t(n,s,u,o)}),n}return ta=r,ta}var aa,Yf;function Wh(){if(Yf)return aa;Yf=1;var r=Gl(),a=Yr(),t=er(),n=Dl(),e=U();function i(s,u,o){var c=e(s)?r:n,f=arguments.length<3;return c(s,t(u,4),o,f,a)}return aa=i,aa}var ia,$f;function Bl(){if($f)return ia;$f=1;var r=or(),a=U(),t=Q(),n="[object String]";function e(i){return typeof i=="string"||!a(i)&&t(i)&&r(i)==n}return ia=e,ia}var ua,Xf;function Ul(){if(Xf)return ua;Xf=1;var r=Bh(),a=r("length");return ua=a,ua}var sa,Zf;function Kl(){if(Zf)return sa;Zf=1;var r="\\ud800-\\udfff",a="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",e=a+t+n,i="\\ufe0e\\ufe0f",s="\\u200d",u=RegExp("["+s+r+e+i+"]");function o(c){return u.test(c)}return sa=o,sa}var oa,Jf;function Vl(){if(Jf)return oa;Jf=1;var r="\\ud800-\\udfff",a="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",e=a+t+n,i="\\ufe0e\\ufe0f",s="["+r+"]",u="["+e+"]",o="\\ud83c[\\udffb-\\udfff]",c="(?:"+u+"|"+o+")",f="[^"+r+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",m=c+"?",_="["+i+"]?",l="(?:"+v+"(?:"+[f,d,h].join("|")+")"+_+m+")*",g=_+m+l,p="(?:"+[f+u+"?",u,d,h,s].join("|")+")",b=RegExp(o+"(?="+o+")|"+p+g,"g");function y(q){for(var R=b.lastIndex=0;b.test(q);)++R;return R}return oa=y,oa}var fa,Qf;function Hl(){if(Qf)return fa;Qf=1;var r=Ul(),a=Kl(),t=Vl();function n(e){return a(e)?t(e):r(e)}return fa=n,fa}var ca,rc;function zl(){if(rc)return ca;rc=1;var r=Su(),a=yr(),t=rr(),n=Bl(),e=Hl(),i="[object Map]",s="[object Set]";function u(o){if(o==null)return 0;if(t(o))return n(o)?e(o):o.length;var c=a(o);return c==i||c==s?o.size:r(o).length}return ca=u,ca}var da,ec;function Wl(){if(ec)return da;ec=1;var r=Eu(),a=Ah(),t=Mu(),n=er(),e=Wr(),i=U(),s=br(),u=Ar(),o=$(),c=Tr();function f(d,h,v){var m=i(d),_=m||s(d)||c(d);if(h=n(h,4),v==null){var l=d&&d.constructor;_?v=m?new l:[]:o(d)?v=u(l)?a(e(d)):{}:v={}}return(_?r:t)(d,function(g,p,b){return h(v,g,p,b)}),v}return da=f,da}var ha,nc;function Yl(){if(nc)return ha;nc=1;var r=gr(),a=Cr(),t=U(),n=r?r.isConcatSpreadable:void 0;function e(i){return t(i)||a(i)||!!(n&&i&&i[n])}return ha=e,ha}var va,tc;function ku(){if(tc)return va;tc=1;var r=Tu(),a=Yl();function t(n,e,i,s,u){var o=-1,c=n.length;for(i||(i=a),u||(u=[]);++o<c;){var f=n[o];e>0&&i(f)?e>1?t(f,e-1,i,s,u):r(u,f):s||(u[u.length]=f)}return u}return va=t,va}var la,ac;function $l(){if(ac)return la;ac=1;function r(a,t,n){switch(n.length){case 0:return a.call(t);case 1:return a.call(t,n[0]);case 2:return a.call(t,n[0],n[1]);case 3:return a.call(t,n[0],n[1],n[2])}return a.apply(t,n)}return la=r,la}var pa,ic;function Yh(){if(ic)return pa;ic=1;var r=$l(),a=Math.max;function t(n,e,i){return e=a(e===void 0?n.length-1:e,0),function(){for(var s=arguments,u=-1,o=a(s.length-e,0),c=Array(o);++u<o;)c[u]=s[e+u];u=-1;for(var f=Array(e+1);++u<e;)f[u]=s[u];return f[e]=i(c),r(n,this,f)}}return pa=t,pa}var _a,uc;function Xl(){if(uc)return _a;uc=1;var r=xu(),a=vh(),t=dr(),n=a?function(e,i){return a(e,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return _a=n,_a}var ga,sc;function Zl(){if(sc)return ga;sc=1;var r=800,a=16,t=Date.now;function n(e){var i=0,s=0;return function(){var u=t(),o=a-(u-s);if(s=u,o>0){if(++i>=r)return arguments[0]}else i=0;return e.apply(void 0,arguments)}}return ga=n,ga}var ba,oc;function $h(){if(oc)return ba;oc=1;var r=Xl(),a=Zl(),t=a(r);return ba=t,ba}var ya,fc;function Jr(){if(fc)return ya;fc=1;var r=dr(),a=Yh(),t=$h();function n(e,i){return t(a(e,i,r),e+"")}return ya=n,ya}var ma,cc;function Xh(){if(cc)return ma;cc=1;function r(a,t,n,e){for(var i=a.length,s=n+(e?1:-1);e?s--:++s<i;)if(t(a[s],s,a))return s;return-1}return ma=r,ma}var qa,dc;function Jl(){if(dc)return qa;dc=1;function r(a){return a!==a}return qa=r,qa}var Ra,hc;function Ql(){if(hc)return Ra;hc=1;function r(a,t,n){for(var e=n-1,i=a.length;++e<i;)if(a[e]===t)return e;return-1}return Ra=r,Ra}var wa,vc;function rp(){if(vc)return wa;vc=1;var r=Xh(),a=Jl(),t=Ql();function n(e,i,s){return i===i?t(e,i,s):r(e,a,s)}return wa=n,wa}var Ea,lc;function ep(){if(lc)return Ea;lc=1;var r=rp();function a(t,n){var e=t==null?0:t.length;return!!e&&r(t,n,0)>-1}return Ea=a,Ea}var Ia,pc;function np(){if(pc)return Ia;pc=1;function r(a,t,n){for(var e=-1,i=a==null?0:a.length;++e<i;)if(n(t,a[e]))return!0;return!1}return Ia=r,Ia}var Aa,_c;function tp(){if(_c)return Aa;_c=1;function r(){}return Aa=r,Aa}var Sa,gc;function ap(){if(gc)return Sa;gc=1;var r=wh(),a=tp(),t=Lu(),n=1/0,e=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:a;return Sa=e,Sa}var Ca,bc;function ip(){if(bc)return Ca;bc=1;var r=Ph(),a=ep(),t=np(),n=Mh(),e=ap(),i=Lu(),s=200;function u(o,c,f){var d=-1,h=a,v=o.length,m=!0,_=[],l=_;if(f)m=!1,h=t;else if(v>=s){var g=c?null:e(o);if(g)return i(g);m=!1,h=n,l=new r}else l=c?[]:_;r:for(;++d<v;){var p=o[d],b=c?c(p):p;if(p=f||p!==0?p:0,m&&b===b){for(var y=l.length;y--;)if(l[y]===b)continue r;c&&l.push(b),_.push(p)}else h(l,b,f)||(l!==_&&l.push(b),_.push(p))}return _}return Ca=u,Ca}var Ta,yc;function Zh(){if(yc)return Ta;yc=1;var r=rr(),a=Q();function t(n){return a(n)&&r(n)}return Ta=t,Ta}var Oa,mc;function up(){if(mc)return Oa;mc=1;var r=ku(),a=Jr(),t=ip(),n=Zh(),e=a(function(i){return t(r(i,1,n,!0))});return Oa=e,Oa}var xa,qc;function sp(){if(qc)return xa;qc=1;var r=$r();function a(t,n){return r(n,function(e){return t[e]})}return xa=a,xa}var Pa,Rc;function Jh(){if(Rc)return Pa;Rc=1;var r=sp(),a=ar();function t(n){return n==null?[]:r(n,a(n))}return Pa=t,Pa}var Ma,wc;function X(){if(wc)return Ma;wc=1;var r;if(typeof qu=="function")try{r={clone:ll(),constant:xu(),each:xh(),filter:Uh(),has:Kh(),isArray:U(),isEmpty:jl(),isFunction:Ar(),isUndefined:Vh(),keys:ar(),map:zh(),reduce:Wh(),size:zl(),transform:Wl(),union:up(),values:Jh()}}catch{}return r||(r=window._),Ma=r,Ma}var La,Ec;function Fu(){if(Ec)return La;Ec=1;var r=X();La=e;var a="\0",t="\0",n="";function e(f){this._isDirected=r.has(f,"directed")?f.directed:!0,this._isMultigraph=r.has(f,"multigraph")?f.multigraph:!1,this._isCompound=r.has(f,"compound")?f.compound:!1,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}e.prototype._nodeCount=0,e.prototype._edgeCount=0,e.prototype.isDirected=function(){return this._isDirected},e.prototype.isMultigraph=function(){return this._isMultigraph},e.prototype.isCompound=function(){return this._isCompound},e.prototype.setGraph=function(f){return this._label=f,this},e.prototype.graph=function(){return this._label},e.prototype.setDefaultNodeLabel=function(f){return r.isFunction(f)||(f=r.constant(f)),this._defaultNodeLabelFn=f,this},e.prototype.nodeCount=function(){return this._nodeCount},e.prototype.nodes=function(){return r.keys(this._nodes)},e.prototype.sources=function(){var f=this;return r.filter(this.nodes(),function(d){return r.isEmpty(f._in[d])})},e.prototype.sinks=function(){var f=this;return r.filter(this.nodes(),function(d){return r.isEmpty(f._out[d])})},e.prototype.setNodes=function(f,d){var h=arguments,v=this;return r.each(f,function(m){h.length>1?v.setNode(m,d):v.setNode(m)}),this},e.prototype.setNode=function(f,d){return r.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=d),this):(this._nodes[f]=arguments.length>1?d:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=t,this._children[f]={},this._children[t][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},e.prototype.node=function(f){return this._nodes[f]},e.prototype.hasNode=function(f){return r.has(this._nodes,f)},e.prototype.removeNode=function(f){var d=this;if(r.has(this._nodes,f)){var h=function(v){d.removeEdge(d._edgeObjs[v])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],r.each(this.children(f),function(v){d.setParent(v)}),delete this._children[f]),r.each(r.keys(this._in[f]),h),delete this._in[f],delete this._preds[f],r.each(r.keys(this._out[f]),h),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},e.prototype.setParent=function(f,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(d))d=t;else{d+="";for(var h=d;!r.isUndefined(h);h=this.parent(h))if(h===f)throw new Error("Setting "+d+" as parent of "+f+" would create a cycle");this.setNode(d)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=d,this._children[d][f]=!0,this},e.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},e.prototype.parent=function(f){if(this._isCompound){var d=this._parent[f];if(d!==t)return d}},e.prototype.children=function(f){if(r.isUndefined(f)&&(f=t),this._isCompound){var d=this._children[f];if(d)return r.keys(d)}else{if(f===t)return this.nodes();if(this.hasNode(f))return[]}},e.prototype.predecessors=function(f){var d=this._preds[f];if(d)return r.keys(d)},e.prototype.successors=function(f){var d=this._sucs[f];if(d)return r.keys(d)},e.prototype.neighbors=function(f){var d=this.predecessors(f);if(d)return r.union(d,this.successors(f))},e.prototype.isLeaf=function(f){var d;return this.isDirected()?d=this.successors(f):d=this.neighbors(f),d.length===0},e.prototype.filterNodes=function(f){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;r.each(this._nodes,function(_,l){f(l)&&d.setNode(l,_)}),r.each(this._edgeObjs,function(_){d.hasNode(_.v)&&d.hasNode(_.w)&&d.setEdge(_,h.edge(_))});var v={};function m(_){var l=h.parent(_);return l===void 0||d.hasNode(l)?(v[_]=l,l):l in v?v[l]:m(l)}return this._isCompound&&r.each(d.nodes(),function(_){d.setParent(_,m(_))}),d},e.prototype.setDefaultEdgeLabel=function(f){return r.isFunction(f)||(f=r.constant(f)),this._defaultEdgeLabelFn=f,this},e.prototype.edgeCount=function(){return this._edgeCount},e.prototype.edges=function(){return r.values(this._edgeObjs)},e.prototype.setPath=function(f,d){var h=this,v=arguments;return r.reduce(f,function(m,_){return v.length>1?h.setEdge(m,_,d):h.setEdge(m,_),_}),this},e.prototype.setEdge=function(){var f,d,h,v,m=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(f=_.v,d=_.w,h=_.name,arguments.length===2&&(v=arguments[1],m=!0)):(f=_,d=arguments[1],h=arguments[3],arguments.length>2&&(v=arguments[2],m=!0)),f=""+f,d=""+d,r.isUndefined(h)||(h=""+h);var l=u(this._isDirected,f,d,h);if(r.has(this._edgeLabels,l))return m&&(this._edgeLabels[l]=v),this;if(!r.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(d),this._edgeLabels[l]=m?v:this._defaultEdgeLabelFn(f,d,h);var g=o(this._isDirected,f,d,h);return f=g.v,d=g.w,Object.freeze(g),this._edgeObjs[l]=g,i(this._preds[d],f),i(this._sucs[f],d),this._in[d][l]=g,this._out[f][l]=g,this._edgeCount++,this},e.prototype.edge=function(f,d,h){var v=arguments.length===1?c(this._isDirected,arguments[0]):u(this._isDirected,f,d,h);return this._edgeLabels[v]},e.prototype.hasEdge=function(f,d,h){var v=arguments.length===1?c(this._isDirected,arguments[0]):u(this._isDirected,f,d,h);return r.has(this._edgeLabels,v)},e.prototype.removeEdge=function(f,d,h){var v=arguments.length===1?c(this._isDirected,arguments[0]):u(this._isDirected,f,d,h),m=this._edgeObjs[v];return m&&(f=m.v,d=m.w,delete this._edgeLabels[v],delete this._edgeObjs[v],s(this._preds[d],f),s(this._sucs[f],d),delete this._in[d][v],delete this._out[f][v],this._edgeCount--),this},e.prototype.inEdges=function(f,d){var h=this._in[f];if(h){var v=r.values(h);return d?r.filter(v,function(m){return m.v===d}):v}},e.prototype.outEdges=function(f,d){var h=this._out[f];if(h){var v=r.values(h);return d?r.filter(v,function(m){return m.w===d}):v}},e.prototype.nodeEdges=function(f,d){var h=this.inEdges(f,d);if(h)return h.concat(this.outEdges(f,d))};function i(f,d){f[d]?f[d]++:f[d]=1}function s(f,d){--f[d]||delete f[d]}function u(f,d,h,v){var m=""+d,_=""+h;if(!f&&m>_){var l=m;m=_,_=l}return m+n+_+n+(r.isUndefined(v)?a:v)}function o(f,d,h,v){var m=""+d,_=""+h;if(!f&&m>_){var l=m;m=_,_=l}var g={v:m,w:_};return v&&(g.name=v),g}function c(f,d){return u(f,d.v,d.w,d.name)}return La}var Na,Ic;function op(){return Ic||(Ic=1,Na="2.1.8"),Na}var ka,Ac;function fp(){return Ac||(Ac=1,ka={Graph:Fu(),version:op()}),ka}var Fa,Sc;function cp(){if(Sc)return Fa;Sc=1;var r=X(),a=Fu();Fa={write:t,read:i};function t(s){var u={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:e(s)};return r.isUndefined(s.graph())||(u.value=r.clone(s.graph())),u}function n(s){return r.map(s.nodes(),function(u){var o=s.node(u),c=s.parent(u),f={v:u};return r.isUndefined(o)||(f.value=o),r.isUndefined(c)||(f.parent=c),f})}function e(s){return r.map(s.edges(),function(u){var o=s.edge(u),c={v:u.v,w:u.w};return r.isUndefined(u.name)||(c.name=u.name),r.isUndefined(o)||(c.value=o),c})}function i(s){var u=new a(s.options).setGraph(s.value);return r.each(s.nodes,function(o){u.setNode(o.v,o.value),o.parent&&u.setParent(o.v,o.parent)}),r.each(s.edges,function(o){u.setEdge({v:o.v,w:o.w,name:o.name},o.value)}),u}return Fa}var ja,Cc;function dp(){if(Cc)return ja;Cc=1;var r=X();ja=a;function a(t){var n={},e=[],i;function s(u){r.has(n,u)||(n[u]=!0,i.push(u),r.each(t.successors(u),s),r.each(t.predecessors(u),s))}return r.each(t.nodes(),function(u){i=[],s(u),i.length&&e.push(i)}),e}return ja}var Ga,Tc;function Qh(){if(Tc)return Ga;Tc=1;var r=X();Ga=a;function a(){this._arr=[],this._keyIndices={}}return a.prototype.size=function(){return this._arr.length},a.prototype.keys=function(){return this._arr.map(function(t){return t.key})},a.prototype.has=function(t){return r.has(this._keyIndices,t)},a.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},a.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},a.prototype.add=function(t,n){var e=this._keyIndices;if(t=String(t),!r.has(e,t)){var i=this._arr,s=i.length;return e[t]=s,i.push({key:t,priority:n}),this._decrease(s),!0}return!1},a.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},a.prototype.decrease=function(t,n){var e=this._keyIndices[t];if(n>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[e].priority+" New: "+n);this._arr[e].priority=n,this._decrease(e)},a.prototype._heapify=function(t){var n=this._arr,e=2*t,i=e+1,s=t;e<n.length&&(s=n[e].priority<n[s].priority?e:s,i<n.length&&(s=n[i].priority<n[s].priority?i:s),s!==t&&(this._swap(t,s),this._heapify(s)))},a.prototype._decrease=function(t){for(var n=this._arr,e=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<e));)this._swap(t,i),t=i},a.prototype._swap=function(t,n){var e=this._arr,i=this._keyIndices,s=e[t],u=e[n];e[t]=u,e[n]=s,i[u.key]=t,i[s.key]=n},Ga}var Da,Oc;function rv(){if(Oc)return Da;Oc=1;var r=X(),a=Qh();Da=n;var t=r.constant(1);function n(i,s,u,o){return e(i,String(s),u||t,o||function(c){return i.outEdges(c)})}function e(i,s,u,o){var c={},f=new a,d,h,v=function(m){var _=m.v!==d?m.v:m.w,l=c[_],g=u(m),p=h.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+g);p<l.distance&&(l.distance=p,l.predecessor=d,f.decrease(_,p))};for(i.nodes().forEach(function(m){var _=m===s?0:Number.POSITIVE_INFINITY;c[m]={distance:_},f.add(m,_)});f.size()>0&&(d=f.removeMin(),h=c[d],h.distance!==Number.POSITIVE_INFINITY);)o(d).forEach(v);return c}return Da}var Ba,xc;function hp(){if(xc)return Ba;xc=1;var r=rv(),a=X();Ba=t;function t(n,e,i){return a.transform(n.nodes(),function(s,u){s[u]=r(n,u,e,i)},{})}return Ba}var Ua,Pc;function ev(){if(Pc)return Ua;Pc=1;var r=X();Ua=a;function a(t){var n=0,e=[],i={},s=[];function u(o){var c=i[o]={onStack:!0,lowlink:n,index:n++};if(e.push(o),t.successors(o).forEach(function(h){r.has(i,h)?i[h].onStack&&(c.lowlink=Math.min(c.lowlink,i[h].index)):(u(h),c.lowlink=Math.min(c.lowlink,i[h].lowlink))}),c.lowlink===c.index){var f=[],d;do d=e.pop(),i[d].onStack=!1,f.push(d);while(o!==d);s.push(f)}}return t.nodes().forEach(function(o){r.has(i,o)||u(o)}),s}return Ua}var Ka,Mc;function vp(){if(Mc)return Ka;Mc=1;var r=X(),a=ev();Ka=t;function t(n){return r.filter(a(n),function(e){return e.length>1||e.length===1&&n.hasEdge(e[0],e[0])})}return Ka}var Va,Lc;function lp(){if(Lc)return Va;Lc=1;var r=X();Va=t;var a=r.constant(1);function t(e,i,s){return n(e,i||a,s||function(u){return e.outEdges(u)})}function n(e,i,s){var u={},o=e.nodes();return o.forEach(function(c){u[c]={},u[c][c]={distance:0},o.forEach(function(f){c!==f&&(u[c][f]={distance:Number.POSITIVE_INFINITY})}),s(c).forEach(function(f){var d=f.v===c?f.w:f.v,h=i(f);u[c][d]={distance:h,predecessor:c}})}),o.forEach(function(c){var f=u[c];o.forEach(function(d){var h=u[d];o.forEach(function(v){var m=h[c],_=f[v],l=h[v],g=m.distance+_.distance;g<l.distance&&(l.distance=g,l.predecessor=_.predecessor)})})}),u}return Va}var Ha,Nc;function nv(){if(Nc)return Ha;Nc=1;var r=X();Ha=a,a.CycleException=t;function a(n){var e={},i={},s=[];function u(o){if(r.has(i,o))throw new t;r.has(e,o)||(i[o]=!0,e[o]=!0,r.each(n.predecessors(o),u),delete i[o],s.push(o))}if(r.each(n.sinks(),u),r.size(e)!==n.nodeCount())throw new t;return s}function t(){}return t.prototype=new Error,Ha}var za,kc;function pp(){if(kc)return za;kc=1;var r=nv();za=a;function a(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return za}var Wa,Fc;function tv(){if(Fc)return Wa;Fc=1;var r=X();Wa=a;function a(n,e,i){r.isArray(e)||(e=[e]);var s=(n.isDirected()?n.successors:n.neighbors).bind(n),u=[],o={};return r.each(e,function(c){if(!n.hasNode(c))throw new Error("Graph does not have node: "+c);t(n,c,i==="post",o,s,u)}),u}function t(n,e,i,s,u,o){r.has(s,e)||(s[e]=!0,i||o.push(e),r.each(u(e),function(c){t(n,c,i,s,u,o)}),i&&o.push(e))}return Wa}var Ya,jc;function _p(){if(jc)return Ya;jc=1;var r=tv();Ya=a;function a(t,n){return r(t,n,"post")}return Ya}var $a,Gc;function gp(){if(Gc)return $a;Gc=1;var r=tv();$a=a;function a(t,n){return r(t,n,"pre")}return $a}var Xa,Dc;function bp(){if(Dc)return Xa;Dc=1;var r=X(),a=Fu(),t=Qh();Xa=n;function n(e,i){var s=new a,u={},o=new t,c;function f(h){var v=h.v===c?h.w:h.v,m=o.priority(v);if(m!==void 0){var _=i(h);_<m&&(u[v]=c,o.decrease(v,_))}}if(e.nodeCount()===0)return s;r.each(e.nodes(),function(h){o.add(h,Number.POSITIVE_INFINITY),s.setNode(h)}),o.decrease(e.nodes()[0],0);for(var d=!1;o.size()>0;){if(c=o.removeMin(),r.has(u,c))s.setEdge(c,u[c]);else{if(d)throw new Error("Input graph is not connected: "+e);d=!0}e.nodeEdges(c).forEach(f)}return s}return Xa}var Za,Bc;function yp(){return Bc||(Bc=1,Za={components:dp(),dijkstra:rv(),dijkstraAll:hp(),findCycles:vp(),floydWarshall:lp(),isAcyclic:pp(),postorder:_p(),preorder:gp(),prim:bp(),tarjan:ev(),topsort:nv()}),Za}var Ja,Uc;function mp(){if(Uc)return Ja;Uc=1;var r=fp();return Ja={Graph:r.Graph,json:cp(),alg:yp(),version:r.version},Ja}var Qa,Kc;function Z(){if(Kc)return Qa;Kc=1;var r;if(typeof qu=="function")try{r=mp()}catch{}return r||(r=window.graphlib),Qa=r,Qa}var ri,Vc;function qp(){if(Vc)return ri;Vc=1;var r=Ch(),a=1,t=4;function n(e){return r(e,a|t)}return ri=n,ri}var ei,Hc;function Qr(){if(Hc)return ei;Hc=1;var r=_r(),a=rr(),t=Vr(),n=$();function e(i,s,u){if(!n(u))return!1;var o=typeof s;return(o=="number"?a(u)&&t(s,u.length):o=="string"&&s in u)?r(u[s],i):!1}return ei=e,ei}var ni,zc;function Rp(){if(zc)return ni;zc=1;var r=Jr(),a=_r(),t=Qr(),n=cr(),e=Object.prototype,i=e.hasOwnProperty,s=r(function(u,o){u=Object(u);var c=-1,f=o.length,d=f>2?o[2]:void 0;for(d&&t(o[0],o[1],d)&&(f=1);++c<f;)for(var h=o[c],v=n(h),m=-1,_=v.length;++m<_;){var l=v[m],g=u[l];(g===void 0||a(g,e[l])&&!i.call(u,l))&&(u[l]=h[l])}return u});return ni=s,ni}var ti,Wc;function wp(){if(Wc)return ti;Wc=1;var r=er(),a=rr(),t=ar();function n(e){return function(i,s,u){var o=Object(i);if(!a(i)){var c=r(s,3);i=t(i),s=function(d){return c(o[d],d,o)}}var f=e(i,s,u);return f>-1?o[c?i[f]:f]:void 0}}return ti=n,ti}var ai,Yc;function Ep(){if(Yc)return ai;Yc=1;var r=/\s/;function a(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return ai=a,ai}var ii,$c;function Ip(){if($c)return ii;$c=1;var r=Ep(),a=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(a,"")}return ii=t,ii}var ui,Xc;function Ap(){if(Xc)return ui;Xc=1;var r=Ip(),a=$(),t=mr(),n=NaN,e=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function o(c){if(typeof c=="number")return c;if(t(c))return n;if(a(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=a(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=r(c);var d=i.test(c);return d||s.test(c)?u(c.slice(2),d?2:8):e.test(c)?n:+c}return ui=o,ui}var si,Zc;function av(){if(Zc)return si;Zc=1;var r=Ap(),a=1/0,t=17976931348623157e292;function n(e){if(!e)return e===0?e:0;if(e=r(e),e===a||e===-a){var i=e<0?-1:1;return i*t}return e===e?e:0}return si=n,si}var oi,Jc;function Sp(){if(Jc)return oi;Jc=1;var r=av();function a(t){var n=r(t),e=n%1;return n===n?e?n-e:n:0}return oi=a,oi}var fi,Qc;function Cp(){if(Qc)return fi;Qc=1;var r=Xh(),a=er(),t=Sp(),n=Math.max;function e(i,s,u){var o=i==null?0:i.length;if(!o)return-1;var c=u==null?0:t(u);return c<0&&(c=n(o+c,0)),r(i,a(s,3),c)}return fi=e,fi}var ci,rd;function Tp(){if(rd)return ci;rd=1;var r=wp(),a=Cp(),t=r(a);return ci=t,ci}var di,ed;function iv(){if(ed)return di;ed=1;var r=ku();function a(t){var n=t==null?0:t.length;return n?r(t,1):[]}return di=a,di}var hi,nd;function Op(){if(nd)return hi;nd=1;var r=Pu(),a=Th(),t=cr();function n(e,i){return e==null?e:r(e,a(i),t)}return hi=n,hi}var vi,td;function xp(){if(td)return vi;td=1;function r(a){var t=a==null?0:a.length;return t?a[t-1]:void 0}return vi=r,vi}var li,ad;function Pp(){if(ad)return li;ad=1;var r=Ur(),a=Mu(),t=er();function n(e,i){var s={};return i=t(i,3),a(e,function(u,o,c){r(s,o,i(u,o,c))}),s}return li=n,li}var pi,id;function ju(){if(id)return pi;id=1;var r=mr();function a(t,n,e){for(var i=-1,s=t.length;++i<s;){var u=t[i],o=n(u);if(o!=null&&(c===void 0?o===o&&!r(o):e(o,c)))var c=o,f=u}return f}return pi=a,pi}var _i,ud;function Mp(){if(ud)return _i;ud=1;function r(a,t){return a>t}return _i=r,_i}var gi,sd;function Lp(){if(sd)return gi;sd=1;var r=ju(),a=Mp(),t=dr();function n(e){return e&&e.length?r(e,t,a):void 0}return gi=n,gi}var bi,od;function uv(){if(od)return bi;od=1;var r=Ur(),a=_r();function t(n,e,i){(i!==void 0&&!a(n[e],i)||i===void 0&&!(e in n))&&r(n,e,i)}return bi=t,bi}var yi,fd;function Np(){if(fd)return yi;fd=1;var r=or(),a=Wr(),t=Q(),n="[object Object]",e=Function.prototype,i=Object.prototype,s=e.toString,u=i.hasOwnProperty,o=s.call(Object);function c(f){if(!t(f)||r(f)!=n)return!1;var d=a(f);if(d===null)return!0;var h=u.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&s.call(h)==o}return yi=c,yi}var mi,cd;function sv(){if(cd)return mi;cd=1;function r(a,t){if(!(t==="constructor"&&typeof a[t]=="function")&&t!="__proto__")return a[t]}return mi=r,mi}var qi,dd;function kp(){if(dd)return qi;dd=1;var r=Sr(),a=cr();function t(n){return r(n,a(n))}return qi=t,qi}var Ri,hd;function Fp(){if(hd)return Ri;hd=1;var r=uv(),a=_h(),t=Ih(),n=gh(),e=Sh(),i=Cr(),s=U(),u=Zh(),o=br(),c=Ar(),f=$(),d=Np(),h=Tr(),v=sv(),m=kp();function _(l,g,p,b,y,q,R){var w=v(l,p),C=v(g,p),A=R.get(C);if(A){r(l,p,A);return}var S=q?q(w,C,p+"",l,g,R):void 0,O=S===void 0;if(O){var P=s(C),M=!P&&o(C),N=!P&&!M&&h(C);S=C,P||M||N?s(w)?S=w:u(w)?S=n(w):M?(O=!1,S=a(C,!0)):N?(O=!1,S=t(C,!0)):S=[]:d(C)||i(C)?(S=w,i(w)?S=m(w):(!f(w)||c(w))&&(S=e(C))):O=!1}O&&(R.set(C,S),y(S,C,b,q,R),R.delete(C)),r(l,p,S)}return Ri=_,Ri}var wi,vd;function jp(){if(vd)return wi;vd=1;var r=Br(),a=uv(),t=Pu(),n=Fp(),e=$(),i=cr(),s=sv();function u(o,c,f,d,h){o!==c&&t(c,function(v,m){if(h||(h=new r),e(v))n(o,c,m,f,u,d,h);else{var _=d?d(s(o,m),v,m+"",o,c,h):void 0;_===void 0&&(_=v),a(o,m,_)}},i)}return wi=u,wi}var Ei,ld;function Gp(){if(ld)return Ei;ld=1;var r=Jr(),a=Qr();function t(n){return r(function(e,i){var s=-1,u=i.length,o=u>1?i[u-1]:void 0,c=u>2?i[2]:void 0;for(o=n.length>3&&typeof o=="function"?(u--,o):void 0,c&&a(i[0],i[1],c)&&(o=u<3?void 0:o,u=1),e=Object(e);++s<u;){var f=i[s];f&&n(e,f,s,o)}return e})}return Ei=t,Ei}var Ii,pd;function Dp(){if(pd)return Ii;pd=1;var r=jp(),a=Gp(),t=a(function(n,e,i){r(n,e,i)});return Ii=t,Ii}var Ai,_d;function ov(){if(_d)return Ai;_d=1;function r(a,t){return a<t}return Ai=r,Ai}var Si,gd;function Bp(){if(gd)return Si;gd=1;var r=ju(),a=ov(),t=dr();function n(e){return e&&e.length?r(e,t,a):void 0}return Si=n,Si}var Ci,bd;function Up(){if(bd)return Ci;bd=1;var r=ju(),a=er(),t=ov();function n(e,i){return e&&e.length?r(e,a(i,2),t):void 0}return Ci=n,Ci}var Ti,yd;function Kp(){if(yd)return Ti;yd=1;var r=J(),a=function(){return r.Date.now()};return Ti=a,Ti}var Oi,md;function Vp(){if(md)return Oi;md=1;var r=Kr(),a=Xr(),t=Vr(),n=$(),e=Or();function i(s,u,o,c){if(!n(s))return s;u=a(u,s);for(var f=-1,d=u.length,h=d-1,v=s;v!=null&&++f<d;){var m=e(u[f]),_=o;if(m==="__proto__"||m==="constructor"||m==="prototype")return s;if(f!=h){var l=v[m];_=c?c(l,m,v):void 0,_===void 0&&(_=n(l)?l:t(u[f+1])?[]:{})}r(v,m,_),v=v[m]}return s}return Oi=i,Oi}var xi,qd;function Hp(){if(qd)return xi;qd=1;var r=Zr(),a=Vp(),t=Xr();function n(e,i,s){for(var u=-1,o=i.length,c={};++u<o;){var f=i[u],d=r(e,f);s(d,f)&&a(c,t(f,e),d)}return c}return xi=n,xi}var Pi,Rd;function zp(){if(Rd)return Pi;Rd=1;var r=Hp(),a=Dh();function t(n,e){return r(n,e,function(i,s){return a(n,s)})}return Pi=t,Pi}var Mi,wd;function Wp(){if(wd)return Mi;wd=1;var r=iv(),a=Yh(),t=$h();function n(e){return t(a(e,void 0,r),e+"")}return Mi=n,Mi}var Li,Ed;function Yp(){if(Ed)return Li;Ed=1;var r=zp(),a=Wp(),t=a(function(n,e){return n==null?{}:r(n,e)});return Li=t,Li}var Ni,Id;function $p(){if(Id)return Ni;Id=1;var r=Math.ceil,a=Math.max;function t(n,e,i,s){for(var u=-1,o=a(r((e-n)/(i||1)),0),c=Array(o);o--;)c[s?o:++u]=n,n+=i;return c}return Ni=t,Ni}var ki,Ad;function Xp(){if(Ad)return ki;Ad=1;var r=$p(),a=Qr(),t=av();function n(e){return function(i,s,u){return u&&typeof u!="number"&&a(i,s,u)&&(s=u=void 0),i=t(i),s===void 0?(s=i,i=0):s=t(s),u=u===void 0?i<s?1:-1:t(u),r(i,s,u,e)}}return ki=n,ki}var Fi,Sd;function Zp(){if(Sd)return Fi;Sd=1;var r=Xp(),a=r();return Fi=a,Fi}var ji,Cd;function Jp(){if(Cd)return ji;Cd=1;function r(a,t){var n=a.length;for(a.sort(t);n--;)a[n]=a[n].value;return a}return ji=r,ji}var Gi,Td;function Qp(){if(Td)return Gi;Td=1;var r=mr();function a(t,n){if(t!==n){var e=t!==void 0,i=t===null,s=t===t,u=r(t),o=n!==void 0,c=n===null,f=n===n,d=r(n);if(!c&&!d&&!u&&t>n||u&&o&&f&&!c&&!d||i&&o&&f||!e&&f||!s)return 1;if(!i&&!u&&!d&&t<n||d&&e&&s&&!i&&!u||c&&e&&s||!o&&s||!f)return-1}return 0}return Gi=a,Gi}var Di,Od;function r_(){if(Od)return Di;Od=1;var r=Qp();function a(t,n,e){for(var i=-1,s=t.criteria,u=n.criteria,o=s.length,c=e.length;++i<o;){var f=r(s[i],u[i]);if(f){if(i>=c)return f;var d=e[i];return f*(d=="desc"?-1:1)}}return t.index-n.index}return Di=a,Di}var Bi,xd;function e_(){if(xd)return Bi;xd=1;var r=$r(),a=Zr(),t=er(),n=Hh(),e=Jp(),i=Hr(),s=r_(),u=dr(),o=U();function c(f,d,h){d.length?d=r(d,function(_){return o(_)?function(l){return a(l,_.length===1?_[0]:_)}:_}):d=[u];var v=-1;d=r(d,i(t));var m=n(f,function(_,l,g){var p=r(d,function(b){return b(_)});return{criteria:p,index:++v,value:_}});return e(m,function(_,l){return s(_,l,h)})}return Bi=c,Bi}var Ui,Pd;function n_(){if(Pd)return Ui;Pd=1;var r=ku(),a=e_(),t=Jr(),n=Qr(),e=t(function(i,s){if(i==null)return[];var u=s.length;return u>1&&n(i,s[0],s[1])?s=[]:u>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),a(i,r(s,1),[])});return Ui=e,Ui}var Ki,Md;function t_(){if(Md)return Ki;Md=1;var r=jh(),a=0;function t(n){var e=++a;return r(n)+e}return Ki=t,Ki}var Vi,Ld;function a_(){if(Ld)return Vi;Ld=1;function r(a,t,n){for(var e=-1,i=a.length,s=t.length,u={};++e<i;){var o=e<s?t[e]:void 0;n(u,a[e],o)}return u}return Vi=r,Vi}var Hi,Nd;function i_(){if(Nd)return Hi;Nd=1;var r=Kr(),a=a_();function t(n,e){return a(n||[],e||[],r)}return Hi=t,Hi}var zi,kd;function D(){if(kd)return zi;kd=1;var r;if(typeof qu=="function")try{r={cloneDeep:qp(),constant:xu(),defaults:Rp(),each:xh(),filter:Uh(),find:Tp(),flatten:iv(),forEach:Oh(),forIn:Op(),has:Kh(),isUndefined:Vh(),last:xp(),map:zh(),mapValues:Pp(),max:Lp(),merge:Dp(),min:Bp(),minBy:Up(),now:Kp(),pick:Yp(),range:Zp(),reduce:Wh(),sortBy:n_(),uniqueId:t_(),values:Jh(),zipObject:i_()}}catch{}return r||(r=window._),zi=r,zi}var Wi,Fd;function u_(){if(Fd)return Wi;Fd=1,Wi=r;function r(){var n={};n._next=n._prev=n,this._sentinel=n}r.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return a(e),e},r.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&a(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},r.prototype.toString=function(){for(var n=[],e=this._sentinel,i=e._prev;i!==e;)n.push(JSON.stringify(i,t)),i=i._prev;return"["+n.join(", ")+"]"};function a(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,e){if(n!=="_next"&&n!=="_prev")return e}return Wi}var Yi,jd;function s_(){if(jd)return Yi;jd=1;var r=D(),a=Z().Graph,t=u_();Yi=e;var n=r.constant(1);function e(c,f){if(c.nodeCount()<=1)return[];var d=u(c,f||n),h=i(d.graph,d.buckets,d.zeroIdx);return r.flatten(r.map(h,function(v){return c.outEdges(v.v,v.w)}),!0)}function i(c,f,d){for(var h=[],v=f[f.length-1],m=f[0],_;c.nodeCount();){for(;_=m.dequeue();)s(c,f,d,_);for(;_=v.dequeue();)s(c,f,d,_);if(c.nodeCount()){for(var l=f.length-2;l>0;--l)if(_=f[l].dequeue(),_){h=h.concat(s(c,f,d,_,!0));break}}}return h}function s(c,f,d,h,v){var m=v?[]:void 0;return r.forEach(c.inEdges(h.v),function(_){var l=c.edge(_),g=c.node(_.v);v&&m.push({v:_.v,w:_.w}),g.out-=l,o(f,d,g)}),r.forEach(c.outEdges(h.v),function(_){var l=c.edge(_),g=_.w,p=c.node(g);p.in-=l,o(f,d,p)}),c.removeNode(h.v),m}function u(c,f){var d=new a,h=0,v=0;r.forEach(c.nodes(),function(l){d.setNode(l,{v:l,in:0,out:0})}),r.forEach(c.edges(),function(l){var g=d.edge(l.v,l.w)||0,p=f(l),b=g+p;d.setEdge(l.v,l.w,b),v=Math.max(v,d.node(l.v).out+=p),h=Math.max(h,d.node(l.w).in+=p)});var m=r.range(v+h+3).map(function(){return new t}),_=h+1;return r.forEach(d.nodes(),function(l){o(m,_,d.node(l))}),{graph:d,buckets:m,zeroIdx:_}}function o(c,f,d){d.out?d.in?c[d.out-d.in+f].enqueue(d):c[c.length-1].enqueue(d):c[0].enqueue(d)}return Yi}var $i,Gd;function o_(){if(Gd)return $i;Gd=1;var r=D(),a=s_();$i={run:t,undo:e};function t(i){var s=i.graph().acyclicer==="greedy"?a(i,u(i)):n(i);r.forEach(s,function(o){var c=i.edge(o);i.removeEdge(o),c.forwardName=o.name,c.reversed=!0,i.setEdge(o.w,o.v,c,r.uniqueId("rev"))});function u(o){return function(c){return o.edge(c).weight}}}function n(i){var s=[],u={},o={};function c(f){r.has(o,f)||(o[f]=!0,u[f]=!0,r.forEach(i.outEdges(f),function(d){r.has(u,d.w)?s.push(d):c(d.w)}),delete u[f])}return r.forEach(i.nodes(),c),s}function e(i){r.forEach(i.edges(),function(s){var u=i.edge(s);if(u.reversed){i.removeEdge(s);var o=u.forwardName;delete u.reversed,delete u.forwardName,i.setEdge(s.w,s.v,u,o)}})}return $i}var Xi,Dd;function Y(){if(Dd)return Xi;Dd=1;var r=D(),a=Z().Graph;Xi={addDummyNode:t,simplify:n,asNonCompoundGraph:e,successorWeights:i,predecessorWeights:s,intersectRect:u,buildLayerMatrix:o,normalizeRanks:c,removeEmptyRanks:f,addBorderNode:d,maxRank:h,partition:v,time:m,notime:_};function t(l,g,p,b){var y;do y=r.uniqueId(b);while(l.hasNode(y));return p.dummy=g,l.setNode(y,p),y}function n(l){var g=new a().setGraph(l.graph());return r.forEach(l.nodes(),function(p){g.setNode(p,l.node(p))}),r.forEach(l.edges(),function(p){var b=g.edge(p.v,p.w)||{weight:0,minlen:1},y=l.edge(p);g.setEdge(p.v,p.w,{weight:b.weight+y.weight,minlen:Math.max(b.minlen,y.minlen)})}),g}function e(l){var g=new a({multigraph:l.isMultigraph()}).setGraph(l.graph());return r.forEach(l.nodes(),function(p){l.children(p).length||g.setNode(p,l.node(p))}),r.forEach(l.edges(),function(p){g.setEdge(p,l.edge(p))}),g}function i(l){var g=r.map(l.nodes(),function(p){var b={};return r.forEach(l.outEdges(p),function(y){b[y.w]=(b[y.w]||0)+l.edge(y).weight}),b});return r.zipObject(l.nodes(),g)}function s(l){var g=r.map(l.nodes(),function(p){var b={};return r.forEach(l.inEdges(p),function(y){b[y.v]=(b[y.v]||0)+l.edge(y).weight}),b});return r.zipObject(l.nodes(),g)}function u(l,g){var p=l.x,b=l.y,y=g.x-p,q=g.y-b,R=l.width/2,w=l.height/2;if(!y&&!q)throw new Error("Not possible to find intersection inside of the rectangle");var C,A;return Math.abs(q)*R>Math.abs(y)*w?(q<0&&(w=-w),C=w*y/q,A=w):(y<0&&(R=-R),C=R,A=R*q/y),{x:p+C,y:b+A}}function o(l){var g=r.map(r.range(h(l)+1),function(){return[]});return r.forEach(l.nodes(),function(p){var b=l.node(p),y=b.rank;r.isUndefined(y)||(g[y][b.order]=p)}),g}function c(l){var g=r.min(r.map(l.nodes(),function(p){return l.node(p).rank}));r.forEach(l.nodes(),function(p){var b=l.node(p);r.has(b,"rank")&&(b.rank-=g)})}function f(l){var g=r.min(r.map(l.nodes(),function(q){return l.node(q).rank})),p=[];r.forEach(l.nodes(),function(q){var R=l.node(q).rank-g;p[R]||(p[R]=[]),p[R].push(q)});var b=0,y=l.graph().nodeRankFactor;r.forEach(p,function(q,R){r.isUndefined(q)&&R%y!==0?--b:b&&r.forEach(q,function(w){l.node(w).rank+=b})})}function d(l,g,p,b){var y={width:0,height:0};return arguments.length>=4&&(y.rank=p,y.order=b),t(l,"border",y,g)}function h(l){return r.max(r.map(l.nodes(),function(g){var p=l.node(g).rank;if(!r.isUndefined(p))return p}))}function v(l,g){var p={lhs:[],rhs:[]};return r.forEach(l,function(b){g(b)?p.lhs.push(b):p.rhs.push(b)}),p}function m(l,g){var p=r.now();try{return g()}finally{console.log(l+" time: "+(r.now()-p)+"ms")}}function _(l,g){return g()}return Xi}var Zi,Bd;function f_(){if(Bd)return Zi;Bd=1;var r=D(),a=Y();Zi={run:t,undo:e};function t(i){i.graph().dummyChains=[],r.forEach(i.edges(),function(s){n(i,s)})}function n(i,s){var u=s.v,o=i.node(u).rank,c=s.w,f=i.node(c).rank,d=s.name,h=i.edge(s),v=h.labelRank;if(f!==o+1){i.removeEdge(s);var m,_,l;for(l=0,++o;o<f;++l,++o)h.points=[],_={width:0,height:0,edgeLabel:h,edgeObj:s,rank:o},m=a.addDummyNode(i,"edge",_,"_d"),o===v&&(_.width=h.width,_.height=h.height,_.dummy="edge-label",_.labelpos=h.labelpos),i.setEdge(u,m,{weight:h.weight},d),l===0&&i.graph().dummyChains.push(m),u=m;i.setEdge(u,c,{weight:h.weight},d)}}function e(i){r.forEach(i.graph().dummyChains,function(s){var u=i.node(s),o=u.edgeLabel,c;for(i.setEdge(u.edgeObj,o);u.dummy;)c=i.successors(s)[0],i.removeNode(s),o.points.push({x:u.x,y:u.y}),u.dummy==="edge-label"&&(o.x=u.x,o.y=u.y,o.width=u.width,o.height=u.height),s=c,u=i.node(s)})}return Zi}var Ji,Ud;function kr(){if(Ud)return Ji;Ud=1;var r=D();Ji={longestPath:a,slack:t};function a(n){var e={};function i(s){var u=n.node(s);if(r.has(e,s))return u.rank;e[s]=!0;var o=r.min(r.map(n.outEdges(s),function(c){return i(c.w)-n.edge(c).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),u.rank=o}r.forEach(n.sources(),i)}function t(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}return Ji}var Qi,Kd;function fv(){if(Kd)return Qi;Kd=1;var r=D(),a=Z().Graph,t=kr().slack;Qi=n;function n(u){var o=new a({directed:!1}),c=u.nodes()[0],f=u.nodeCount();o.setNode(c,{});for(var d,h;e(o,u)<f;)d=i(o,u),h=o.hasNode(d.v)?t(u,d):-t(u,d),s(o,u,h);return o}function e(u,o){function c(f){r.forEach(o.nodeEdges(f),function(d){var h=d.v,v=f===h?d.w:h;!u.hasNode(v)&&!t(o,d)&&(u.setNode(v,{}),u.setEdge(f,v,{}),c(v))})}return r.forEach(u.nodes(),c),u.nodeCount()}function i(u,o){return r.minBy(o.edges(),function(c){if(u.hasNode(c.v)!==u.hasNode(c.w))return t(o,c)})}function s(u,o,c){r.forEach(u.nodes(),function(f){o.node(f).rank+=c})}return Qi}var ru,Vd;function c_(){if(Vd)return ru;Vd=1;var r=D(),a=fv(),t=kr().slack,n=kr().longestPath,e=Z().alg.preorder,i=Z().alg.postorder,s=Y().simplify;ru=u,u.initLowLimValues=d,u.initCutValues=o,u.calcCutValue=f,u.leaveEdge=v,u.enterEdge=m,u.exchangeEdges=_;function u(b){b=s(b),n(b);var y=a(b);d(y),o(y,b);for(var q,R;q=v(y);)R=m(y,b,q),_(y,b,q,R)}function o(b,y){var q=i(b,b.nodes());q=q.slice(0,q.length-1),r.forEach(q,function(R){c(b,y,R)})}function c(b,y,q){var R=b.node(q),w=R.parent;b.edge(q,w).cutvalue=f(b,y,q)}function f(b,y,q){var R=b.node(q),w=R.parent,C=!0,A=y.edge(q,w),S=0;return A||(C=!1,A=y.edge(w,q)),S=A.weight,r.forEach(y.nodeEdges(q),function(O){var P=O.v===q,M=P?O.w:O.v;if(M!==w){var N=P===C,j=y.edge(O).weight;if(S+=N?j:-j,g(b,q,M)){var K=b.edge(q,M).cutvalue;S+=N?-K:K}}}),S}function d(b,y){arguments.length<2&&(y=b.nodes()[0]),h(b,{},1,y)}function h(b,y,q,R,w){var C=q,A=b.node(R);return y[R]=!0,r.forEach(b.neighbors(R),function(S){r.has(y,S)||(q=h(b,y,q,S,R))}),A.low=C,A.lim=q++,w?A.parent=w:delete A.parent,q}function v(b){return r.find(b.edges(),function(y){return b.edge(y).cutvalue<0})}function m(b,y,q){var R=q.v,w=q.w;y.hasEdge(R,w)||(R=q.w,w=q.v);var C=b.node(R),A=b.node(w),S=C,O=!1;C.lim>A.lim&&(S=A,O=!0);var P=r.filter(y.edges(),function(M){return O===p(b,b.node(M.v),S)&&O!==p(b,b.node(M.w),S)});return r.minBy(P,function(M){return t(y,M)})}function _(b,y,q,R){var w=q.v,C=q.w;b.removeEdge(w,C),b.setEdge(R.v,R.w,{}),d(b),o(b,y),l(b,y)}function l(b,y){var q=r.find(b.nodes(),function(w){return!y.node(w).parent}),R=e(b,q);R=R.slice(1),r.forEach(R,function(w){var C=b.node(w).parent,A=y.edge(w,C),S=!1;A||(A=y.edge(C,w),S=!0),y.node(w).rank=y.node(C).rank+(S?A.minlen:-A.minlen)})}function g(b,y,q){return b.hasEdge(y,q)}function p(b,y,q){return q.low<=y.lim&&y.lim<=q.lim}return ru}var eu,Hd;function d_(){if(Hd)return eu;Hd=1;var r=kr(),a=r.longestPath,t=fv(),n=c_();eu=e;function e(o){switch(o.graph().ranker){case"network-simplex":u(o);break;case"tight-tree":s(o);break;case"longest-path":i(o);break;default:u(o)}}var i=a;function s(o){a(o),t(o)}function u(o){n(o)}return eu}var nu,zd;function h_(){if(zd)return nu;zd=1;var r=D();nu=a;function a(e){var i=n(e);r.forEach(e.graph().dummyChains,function(s){for(var u=e.node(s),o=u.edgeObj,c=t(e,i,o.v,o.w),f=c.path,d=c.lca,h=0,v=f[h],m=!0;s!==o.w;){if(u=e.node(s),m){for(;(v=f[h])!==d&&e.node(v).maxRank<u.rank;)h++;v===d&&(m=!1)}if(!m){for(;h<f.length-1&&e.node(v=f[h+1]).minRank<=u.rank;)h++;v=f[h]}e.setParent(s,v),s=e.successors(s)[0]}})}function t(e,i,s,u){var o=[],c=[],f=Math.min(i[s].low,i[u].low),d=Math.max(i[s].lim,i[u].lim),h,v;h=s;do h=e.parent(h),o.push(h);while(h&&(i[h].low>f||d>i[h].lim));for(v=h,h=u;(h=e.parent(h))!==v;)c.push(h);return{path:o.concat(c.reverse()),lca:v}}function n(e){var i={},s=0;function u(o){var c=s;r.forEach(e.children(o),u),i[o]={low:c,lim:s++}}return r.forEach(e.children(),u),i}return nu}var tu,Wd;function v_(){if(Wd)return tu;Wd=1;var r=D(),a=Y();tu={run:t,cleanup:s};function t(u){var o=a.addDummyNode(u,"root",{},"_root"),c=e(u),f=r.max(r.values(c))-1,d=2*f+1;u.graph().nestingRoot=o,r.forEach(u.edges(),function(v){u.edge(v).minlen*=d});var h=i(u)+1;r.forEach(u.children(),function(v){n(u,o,d,h,f,c,v)}),u.graph().nodeRankFactor=d}function n(u,o,c,f,d,h,v){var m=u.children(v);if(!m.length){v!==o&&u.setEdge(o,v,{weight:0,minlen:c});return}var _=a.addBorderNode(u,"_bt"),l=a.addBorderNode(u,"_bb"),g=u.node(v);u.setParent(_,v),g.borderTop=_,u.setParent(l,v),g.borderBottom=l,r.forEach(m,function(p){n(u,o,c,f,d,h,p);var b=u.node(p),y=b.borderTop?b.borderTop:p,q=b.borderBottom?b.borderBottom:p,R=b.borderTop?f:2*f,w=y!==q?1:d-h[v]+1;u.setEdge(_,y,{weight:R,minlen:w,nestingEdge:!0}),u.setEdge(q,l,{weight:R,minlen:w,nestingEdge:!0})}),u.parent(v)||u.setEdge(o,_,{weight:0,minlen:d+h[v]})}function e(u){var o={};function c(f,d){var h=u.children(f);h&&h.length&&r.forEach(h,function(v){c(v,d+1)}),o[f]=d}return r.forEach(u.children(),function(f){c(f,1)}),o}function i(u){return r.reduce(u.edges(),function(o,c){return o+u.edge(c).weight},0)}function s(u){var o=u.graph();u.removeNode(o.nestingRoot),delete o.nestingRoot,r.forEach(u.edges(),function(c){var f=u.edge(c);f.nestingEdge&&u.removeEdge(c)})}return tu}var au,Yd;function l_(){if(Yd)return au;Yd=1;var r=D(),a=Y();au=t;function t(e){function i(s){var u=e.children(s),o=e.node(s);if(u.length&&r.forEach(u,i),r.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var c=o.minRank,f=o.maxRank+1;c<f;++c)n(e,"borderLeft","_bl",s,o,c),n(e,"borderRight","_br",s,o,c)}}r.forEach(e.children(),i)}function n(e,i,s,u,o,c){var f={width:0,height:0,rank:c,borderType:i},d=o[i][c-1],h=a.addDummyNode(e,"border",f,s);o[i][c]=h,e.setParent(h,u),d&&e.setEdge(d,h,{weight:1})}return au}var iu,$d;function p_(){if($d)return iu;$d=1;var r=D();iu={adjust:a,undo:t};function a(c){var f=c.graph().rankdir.toLowerCase();(f==="lr"||f==="rl")&&n(c)}function t(c){var f=c.graph().rankdir.toLowerCase();(f==="bt"||f==="rl")&&i(c),(f==="lr"||f==="rl")&&(u(c),n(c))}function n(c){r.forEach(c.nodes(),function(f){e(c.node(f))}),r.forEach(c.edges(),function(f){e(c.edge(f))})}function e(c){var f=c.width;c.width=c.height,c.height=f}function i(c){r.forEach(c.nodes(),function(f){s(c.node(f))}),r.forEach(c.edges(),function(f){var d=c.edge(f);r.forEach(d.points,s),r.has(d,"y")&&s(d)})}function s(c){c.y=-c.y}function u(c){r.forEach(c.nodes(),function(f){o(c.node(f))}),r.forEach(c.edges(),function(f){var d=c.edge(f);r.forEach(d.points,o),r.has(d,"x")&&o(d)})}function o(c){var f=c.x;c.x=c.y,c.y=f}return iu}var uu,Xd;function __(){if(Xd)return uu;Xd=1;var r=D();uu=a;function a(t){var n={},e=r.filter(t.nodes(),function(c){return!t.children(c).length}),i=r.max(r.map(e,function(c){return t.node(c).rank})),s=r.map(r.range(i+1),function(){return[]});function u(c){if(!r.has(n,c)){n[c]=!0;var f=t.node(c);s[f.rank].push(c),r.forEach(t.successors(c),u)}}var o=r.sortBy(e,function(c){return t.node(c).rank});return r.forEach(o,u),s}return uu}var su,Zd;function g_(){if(Zd)return su;Zd=1;var r=D();su=a;function a(n,e){for(var i=0,s=1;s<e.length;++s)i+=t(n,e[s-1],e[s]);return i}function t(n,e,i){for(var s=r.zipObject(i,r.map(i,function(h,v){return v})),u=r.flatten(r.map(e,function(h){return r.sortBy(r.map(n.outEdges(h),function(v){return{pos:s[v.w],weight:n.edge(v).weight}}),"pos")}),!0),o=1;o<i.length;)o<<=1;var c=2*o-1;o-=1;var f=r.map(new Array(c),function(){return 0}),d=0;return r.forEach(u.forEach(function(h){var v=h.pos+o;f[v]+=h.weight;for(var m=0;v>0;)v%2&&(m+=f[v+1]),v=v-1>>1,f[v]+=h.weight;d+=h.weight*m})),d}return su}var ou,Jd;function b_(){if(Jd)return ou;Jd=1;var r=D();ou=a;function a(t,n){return r.map(n,function(e){var i=t.inEdges(e);if(i.length){var s=r.reduce(i,function(u,o){var c=t.edge(o),f=t.node(o.v);return{sum:u.sum+c.weight*f.order,weight:u.weight+c.weight}},{sum:0,weight:0});return{v:e,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:e}})}return ou}var fu,Qd;function y_(){if(Qd)return fu;Qd=1;var r=D();fu=a;function a(e,i){var s={};r.forEach(e,function(o,c){var f=s[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:c};r.isUndefined(o.barycenter)||(f.barycenter=o.barycenter,f.weight=o.weight)}),r.forEach(i.edges(),function(o){var c=s[o.v],f=s[o.w];!r.isUndefined(c)&&!r.isUndefined(f)&&(f.indegree++,c.out.push(s[o.w]))});var u=r.filter(s,function(o){return!o.indegree});return t(u)}function t(e){var i=[];function s(c){return function(f){f.merged||(r.isUndefined(f.barycenter)||r.isUndefined(c.barycenter)||f.barycenter>=c.barycenter)&&n(c,f)}}function u(c){return function(f){f.in.push(c),--f.indegree===0&&e.push(f)}}for(;e.length;){var o=e.pop();i.push(o),r.forEach(o.in.reverse(),s(o)),r.forEach(o.out,u(o))}return r.map(r.filter(i,function(c){return!c.merged}),function(c){return r.pick(c,["vs","i","barycenter","weight"])})}function n(e,i){var s=0,u=0;e.weight&&(s+=e.barycenter*e.weight,u+=e.weight),i.weight&&(s+=i.barycenter*i.weight,u+=i.weight),e.vs=i.vs.concat(e.vs),e.barycenter=s/u,e.weight=u,e.i=Math.min(i.i,e.i),i.merged=!0}return fu}var cu,rh;function m_(){if(rh)return cu;rh=1;var r=D(),a=Y();cu=t;function t(i,s){var u=a.partition(i,function(_){return r.has(_,"barycenter")}),o=u.lhs,c=r.sortBy(u.rhs,function(_){return-_.i}),f=[],d=0,h=0,v=0;o.sort(e(!!s)),v=n(f,c,v),r.forEach(o,function(_){v+=_.vs.length,f.push(_.vs),d+=_.barycenter*_.weight,h+=_.weight,v=n(f,c,v)});var m={vs:r.flatten(f,!0)};return h&&(m.barycenter=d/h,m.weight=h),m}function n(i,s,u){for(var o;s.length&&(o=r.last(s)).i<=u;)s.pop(),i.push(o.vs),u++;return u}function e(i){return function(s,u){return s.barycenter<u.barycenter?-1:s.barycenter>u.barycenter?1:i?u.i-s.i:s.i-u.i}}return cu}var du,eh;function q_(){if(eh)return du;eh=1;var r=D(),a=b_(),t=y_(),n=m_();du=e;function e(u,o,c,f){var d=u.children(o),h=u.node(o),v=h?h.borderLeft:void 0,m=h?h.borderRight:void 0,_={};v&&(d=r.filter(d,function(q){return q!==v&&q!==m}));var l=a(u,d);r.forEach(l,function(q){if(u.children(q.v).length){var R=e(u,q.v,c,f);_[q.v]=R,r.has(R,"barycenter")&&s(q,R)}});var g=t(l,c);i(g,_);var p=n(g,f);if(v&&(p.vs=r.flatten([v,p.vs,m],!0),u.predecessors(v).length)){var b=u.node(u.predecessors(v)[0]),y=u.node(u.predecessors(m)[0]);r.has(p,"barycenter")||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+b.order+y.order)/(p.weight+2),p.weight+=2}return p}function i(u,o){r.forEach(u,function(c){c.vs=r.flatten(c.vs.map(function(f){return o[f]?o[f].vs:f}),!0)})}function s(u,o){r.isUndefined(u.barycenter)?(u.barycenter=o.barycenter,u.weight=o.weight):(u.barycenter=(u.barycenter*u.weight+o.barycenter*o.weight)/(u.weight+o.weight),u.weight+=o.weight)}return du}var hu,nh;function R_(){if(nh)return hu;nh=1;var r=D(),a=Z().Graph;hu=t;function t(e,i,s){var u=n(e),o=new a({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(c){return e.node(c)});return r.forEach(e.nodes(),function(c){var f=e.node(c),d=e.parent(c);(f.rank===i||f.minRank<=i&&i<=f.maxRank)&&(o.setNode(c),o.setParent(c,d||u),r.forEach(e[s](c),function(h){var v=h.v===c?h.w:h.v,m=o.edge(v,c),_=r.isUndefined(m)?0:m.weight;o.setEdge(v,c,{weight:e.edge(h).weight+_})}),r.has(f,"minRank")&&o.setNode(c,{borderLeft:f.borderLeft[i],borderRight:f.borderRight[i]}))}),o}function n(e){for(var i;e.hasNode(i=r.uniqueId("_root")););return i}return hu}var vu,th;function w_(){if(th)return vu;th=1;var r=D();vu=a;function a(t,n,e){var i={},s;r.forEach(e,function(u){for(var o=t.parent(u),c,f;o;){if(c=t.parent(o),c?(f=i[c],i[c]=o):(f=s,s=o),f&&f!==o){n.setEdge(f,o);return}o=c}})}return vu}var lu,ah;function E_(){if(ah)return lu;ah=1;var r=D(),a=__(),t=g_(),n=q_(),e=R_(),i=w_(),s=Z().Graph,u=Y();lu=o;function o(h){var v=u.maxRank(h),m=c(h,r.range(1,v+1),"inEdges"),_=c(h,r.range(v-1,-1,-1),"outEdges"),l=a(h);d(h,l);for(var g=Number.POSITIVE_INFINITY,p,b=0,y=0;y<4;++b,++y){f(b%2?m:_,b%4>=2),l=u.buildLayerMatrix(h);var q=t(h,l);q<g&&(y=0,p=r.cloneDeep(l),g=q)}d(h,p)}function c(h,v,m){return r.map(v,function(_){return e(h,_,m)})}function f(h,v){var m=new s;r.forEach(h,function(_){var l=_.graph().root,g=n(_,l,m,v);r.forEach(g.vs,function(p,b){_.node(p).order=b}),i(_,m,g.vs)})}function d(h,v){r.forEach(v,function(m){r.forEach(m,function(_,l){h.node(_).order=l})})}return lu}var pu,ih;function I_(){if(ih)return pu;ih=1;var r=D(),a=Z().Graph,t=Y();pu={positionX:m,findType1Conflicts:n,findType2Conflicts:e,addConflict:s,hasConflict:u,verticalAlignment:o,horizontalCompaction:c,alignCoordinates:h,findSmallestWidthAlignment:d,balance:v};function n(g,p){var b={};function y(q,R){var w=0,C=0,A=q.length,S=r.last(R);return r.forEach(R,function(O,P){var M=i(g,O),N=M?g.node(M).order:A;(M||O===S)&&(r.forEach(R.slice(C,P+1),function(j){r.forEach(g.predecessors(j),function(K){var hr=g.node(K),ir=hr.order;(ir<w||N<ir)&&!(hr.dummy&&g.node(j).dummy)&&s(b,K,j)})}),C=P+1,w=N)}),R}return r.reduce(p,y),b}function e(g,p){var b={};function y(R,w,C,A,S){var O;r.forEach(r.range(w,C),function(P){O=R[P],g.node(O).dummy&&r.forEach(g.predecessors(O),function(M){var N=g.node(M);N.dummy&&(N.order<A||N.order>S)&&s(b,M,O)})})}function q(R,w){var C=-1,A,S=0;return r.forEach(w,function(O,P){if(g.node(O).dummy==="border"){var M=g.predecessors(O);M.length&&(A=g.node(M[0]).order,y(w,S,P,C,A),S=P,C=A)}y(w,S,w.length,A,R.length)}),w}return r.reduce(p,q),b}function i(g,p){if(g.node(p).dummy)return r.find(g.predecessors(p),function(b){return g.node(b).dummy})}function s(g,p,b){if(p>b){var y=p;p=b,b=y}var q=g[p];q||(g[p]=q={}),q[b]=!0}function u(g,p,b){if(p>b){var y=p;p=b,b=y}return r.has(g[p],b)}function o(g,p,b,y){var q={},R={},w={};return r.forEach(p,function(C){r.forEach(C,function(A,S){q[A]=A,R[A]=A,w[A]=S})}),r.forEach(p,function(C){var A=-1;r.forEach(C,function(S){var O=y(S);if(O.length){O=r.sortBy(O,function(K){return w[K]});for(var P=(O.length-1)/2,M=Math.floor(P),N=Math.ceil(P);M<=N;++M){var j=O[M];R[S]===S&&A<w[j]&&!u(b,S,j)&&(R[j]=S,R[S]=q[S]=q[j],A=w[j])}}})}),{root:q,align:R}}function c(g,p,b,y,q){var R={},w=f(g,p,b,q),C=q?"borderLeft":"borderRight";function A(P,M){for(var N=w.nodes(),j=N.pop(),K={};j;)K[j]?P(j):(K[j]=!0,N.push(j),N=N.concat(M(j))),j=N.pop()}function S(P){R[P]=w.inEdges(P).reduce(function(M,N){return Math.max(M,R[N.v]+w.edge(N))},0)}function O(P){var M=w.outEdges(P).reduce(function(j,K){return Math.min(j,R[K.w]-w.edge(K))},Number.POSITIVE_INFINITY),N=g.node(P);M!==Number.POSITIVE_INFINITY&&N.borderType!==C&&(R[P]=Math.max(R[P],M))}return A(S,w.predecessors.bind(w)),A(O,w.successors.bind(w)),r.forEach(y,function(P){R[P]=R[b[P]]}),R}function f(g,p,b,y){var q=new a,R=g.graph(),w=_(R.nodesep,R.edgesep,y);return r.forEach(p,function(C){var A;r.forEach(C,function(S){var O=b[S];if(q.setNode(O),A){var P=b[A],M=q.edge(P,O);q.setEdge(P,O,Math.max(w(g,S,A),M||0))}A=S})}),q}function d(g,p){return r.minBy(r.values(p),function(b){var y=Number.NEGATIVE_INFINITY,q=Number.POSITIVE_INFINITY;return r.forIn(b,function(R,w){var C=l(g,w)/2;y=Math.max(R+C,y),q=Math.min(R-C,q)}),y-q})}function h(g,p){var b=r.values(p),y=r.min(b),q=r.max(b);r.forEach(["u","d"],function(R){r.forEach(["l","r"],function(w){var C=R+w,A=g[C],S;if(A!==p){var O=r.values(A);S=w==="l"?y-r.min(O):q-r.max(O),S&&(g[C]=r.mapValues(A,function(P){return P+S}))}})})}function v(g,p){return r.mapValues(g.ul,function(b,y){if(p)return g[p.toLowerCase()][y];var q=r.sortBy(r.map(g,y));return(q[1]+q[2])/2})}function m(g){var p=t.buildLayerMatrix(g),b=r.merge(n(g,p),e(g,p)),y={},q;r.forEach(["u","d"],function(w){q=w==="u"?p:r.values(p).reverse(),r.forEach(["l","r"],function(C){C==="r"&&(q=r.map(q,function(P){return r.values(P).reverse()}));var A=(w==="u"?g.predecessors:g.successors).bind(g),S=o(g,q,b,A),O=c(g,q,S.root,S.align,C==="r");C==="r"&&(O=r.mapValues(O,function(P){return-P})),y[w+C]=O})});var R=d(g,y);return h(y,R),v(y,g.graph().align)}function _(g,p,b){return function(y,q,R){var w=y.node(q),C=y.node(R),A=0,S;if(A+=w.width/2,r.has(w,"labelpos"))switch(w.labelpos.toLowerCase()){case"l":S=-w.width/2;break;case"r":S=w.width/2;break}if(S&&(A+=b?S:-S),S=0,A+=(w.dummy?p:g)/2,A+=(C.dummy?p:g)/2,A+=C.width/2,r.has(C,"labelpos"))switch(C.labelpos.toLowerCase()){case"l":S=C.width/2;break;case"r":S=-C.width/2;break}return S&&(A+=b?S:-S),S=0,A}}function l(g,p){return g.node(p).width}return pu}var _u,uh;function A_(){if(uh)return _u;uh=1;var r=D(),a=Y(),t=I_().positionX;_u=n;function n(i){i=a.asNonCompoundGraph(i),e(i),r.forEach(t(i),function(s,u){i.node(u).x=s})}function e(i){var s=a.buildLayerMatrix(i),u=i.graph().ranksep,o=0;r.forEach(s,function(c){var f=r.max(r.map(c,function(d){return i.node(d).height}));r.forEach(c,function(d){i.node(d).y=o+f/2}),o+=f+u})}return _u}var gu,sh;function S_(){if(sh)return gu;sh=1;var r=D(),a=o_(),t=f_(),n=d_(),e=Y().normalizeRanks,i=h_(),s=Y().removeEmptyRanks,u=v_(),o=l_(),c=p_(),f=E_(),d=A_(),h=Y(),v=Z().Graph;gu=m;function m(E,I){var T=I&&I.debugTiming?h.time:h.notime;T("layout",function(){var x=T(" buildLayoutGraph",function(){return A(E)});T(" runLayout",function(){_(x,T)}),T(" updateInputGraph",function(){l(E,x)})})}function _(E,I){I(" makeSpaceForEdgeLabels",function(){S(E)}),I(" removeSelfEdges",function(){re(E)}),I(" acyclic",function(){a.run(E)}),I(" nestingGraph.run",function(){u.run(E)}),I(" rank",function(){n(h.asNonCompoundGraph(E))}),I(" injectEdgeLabelProxies",function(){O(E)}),I(" removeEmptyRanks",function(){s(E)}),I(" nestingGraph.cleanup",function(){u.cleanup(E)}),I(" normalizeRanks",function(){e(E)}),I(" assignRankMinMax",function(){P(E)}),I(" removeEdgeLabelProxies",function(){M(E)}),I(" normalize.run",function(){t.run(E)}),I(" parentDummyChains",function(){i(E)}),I(" addBorderSegments",function(){o(E)}),I(" order",function(){f(E)}),I(" insertSelfEdges",function(){ee(E)}),I(" adjustCoordinateSystem",function(){c.adjust(E)}),I(" position",function(){d(E)}),I(" positionSelfEdges",function(){ne(E)}),I(" removeBorderNodes",function(){ir(E)}),I(" normalize.undo",function(){t.undo(E)}),I(" fixupEdgeLabelCoords",function(){K(E)}),I(" undoCoordinateSystem",function(){c.undo(E)}),I(" translateGraph",function(){N(E)}),I(" assignNodeIntersects",function(){j(E)}),I(" reversePoints",function(){hr(E)}),I(" acyclic.undo",function(){a.undo(E)})}function l(E,I){r.forEach(E.nodes(),function(T){var x=E.node(T),L=I.node(T);x&&(x.x=L.x,x.y=L.y,I.children(T).length&&(x.width=L.width,x.height=L.height))}),r.forEach(E.edges(),function(T){var x=E.edge(T),L=I.edge(T);x.points=L.points,r.has(L,"x")&&(x.x=L.x,x.y=L.y)}),E.graph().width=I.graph().width,E.graph().height=I.graph().height}var g=["nodesep","edgesep","ranksep","marginx","marginy"],p={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],y=["width","height"],q={width:0,height:0},R=["minlen","weight","width","height","labeloffset"],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function A(E){var I=new v({multigraph:!0,compound:!0}),T=Rr(E.graph());return I.setGraph(r.merge({},p,qr(T,g),r.pick(T,b))),r.forEach(E.nodes(),function(x){var L=Rr(E.node(x));I.setNode(x,r.defaults(qr(L,y),q)),I.setParent(x,E.parent(x))}),r.forEach(E.edges(),function(x){var L=Rr(E.edge(x));I.setEdge(x,r.merge({},w,qr(L,R),r.pick(L,C)))}),I}function S(E){var I=E.graph();I.ranksep/=2,r.forEach(E.edges(),function(T){var x=E.edge(T);x.minlen*=2,x.labelpos.toLowerCase()!=="c"&&(I.rankdir==="TB"||I.rankdir==="BT"?x.width+=x.labeloffset:x.height+=x.labeloffset)})}function O(E){r.forEach(E.edges(),function(I){var T=E.edge(I);if(T.width&&T.height){var x=E.node(I.v),L=E.node(I.w),G={rank:(L.rank-x.rank)/2+x.rank,e:I};h.addDummyNode(E,"edge-proxy",G,"_ep")}})}function P(E){var I=0;r.forEach(E.nodes(),function(T){var x=E.node(T);x.borderTop&&(x.minRank=E.node(x.borderTop).rank,x.maxRank=E.node(x.borderBottom).rank,I=r.max(I,x.maxRank))}),E.graph().maxRank=I}function M(E){r.forEach(E.nodes(),function(I){var T=E.node(I);T.dummy==="edge-proxy"&&(E.edge(T.e).labelRank=T.rank,E.removeNode(I))})}function N(E){var I=Number.POSITIVE_INFINITY,T=0,x=Number.POSITIVE_INFINITY,L=0,G=E.graph(),B=G.marginx||0,H=G.marginy||0;function xr(z){var V=z.x,k=z.y,ur=z.width,F=z.height;I=Math.min(I,V-ur/2),T=Math.max(T,V+ur/2),x=Math.min(x,k-F/2),L=Math.max(L,k+F/2)}r.forEach(E.nodes(),function(z){xr(E.node(z))}),r.forEach(E.edges(),function(z){var V=E.edge(z);r.has(V,"x")&&xr(V)}),I-=B,x-=H,r.forEach(E.nodes(),function(z){var V=E.node(z);V.x-=I,V.y-=x}),r.forEach(E.edges(),function(z){var V=E.edge(z);r.forEach(V.points,function(k){k.x-=I,k.y-=x}),r.has(V,"x")&&(V.x-=I),r.has(V,"y")&&(V.y-=x)}),G.width=T-I+B,G.height=L-x+H}function j(E){r.forEach(E.edges(),function(I){var T=E.edge(I),x=E.node(I.v),L=E.node(I.w),G,B;T.points?(G=T.points[0],B=T.points[T.points.length-1]):(T.points=[],G=L,B=x),T.points.unshift(h.intersectRect(x,G)),T.points.push(h.intersectRect(L,B))})}function K(E){r.forEach(E.edges(),function(I){var T=E.edge(I);if(r.has(T,"x"))switch((T.labelpos==="l"||T.labelpos==="r")&&(T.width-=T.labeloffset),T.labelpos){case"l":T.x-=T.width/2+T.labeloffset;break;case"r":T.x+=T.width/2+T.labeloffset;break}})}function hr(E){r.forEach(E.edges(),function(I){var T=E.edge(I);T.reversed&&T.points.reverse()})}function ir(E){r.forEach(E.nodes(),function(I){if(E.children(I).length){var T=E.node(I),x=E.node(T.borderTop),L=E.node(T.borderBottom),G=E.node(r.last(T.borderLeft)),B=E.node(r.last(T.borderRight));T.width=Math.abs(B.x-G.x),T.height=Math.abs(L.y-x.y),T.x=G.x+T.width/2,T.y=x.y+T.height/2}}),r.forEach(E.nodes(),function(I){E.node(I).dummy==="border"&&E.removeNode(I)})}function re(E){r.forEach(E.edges(),function(I){if(I.v===I.w){var T=E.node(I.v);T.selfEdges||(T.selfEdges=[]),T.selfEdges.push({e:I,label:E.edge(I)}),E.removeEdge(I)}})}function ee(E){var I=h.buildLayerMatrix(E);r.forEach(I,function(T){var x=0;r.forEach(T,function(L,G){var B=E.node(L);B.order=G+x,r.forEach(B.selfEdges,function(H){h.addDummyNode(E,"selfedge",{width:H.label.width,height:H.label.height,rank:B.rank,order:G+ ++x,e:H.e,label:H.label},"_se")}),delete B.selfEdges})})}function ne(E){r.forEach(E.nodes(),function(I){var T=E.node(I);if(T.dummy==="selfedge"){var x=E.node(T.e.v),L=x.x+x.width/2,G=x.y,B=T.x-L,H=x.height/2;E.setEdge(T.e,T.label),E.removeNode(I),T.label.points=[{x:L+2*B/3,y:G-H},{x:L+5*B/6,y:G-H},{x:L+B,y:G},{x:L+5*B/6,y:G+H},{x:L+2*B/3,y:G+H}],T.label.x=T.x,T.label.y=T.y}})}function qr(E,I){return r.mapValues(r.pick(E,I),Number)}function Rr(E){var I={};return r.forEach(E,function(T,x){I[x.toLowerCase()]=T}),I}return gu}var bu,oh;function C_(){if(oh)return bu;oh=1;var r=D(),a=Y(),t=Z().Graph;bu={debugOrdering:n};function n(e){var i=a.buildLayerMatrix(e),s=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),function(u){s.setNode(u,{label:u}),s.setParent(u,"layer"+e.node(u).rank)}),r.forEach(e.edges(),function(u){s.setEdge(u.v,u.w,{},u.name)}),r.forEach(i,function(u,o){var c="layer"+o;s.setNode(c,{rank:"same"}),r.reduce(u,function(f,d){return s.setEdge(f,d,{style:"invis"}),d})}),s}return bu}var yu,fh;function T_(){return fh||(fh=1,yu="0.8.5"),yu}var mu,ch;function O_(){return ch||(ch=1,mu={graphlib:Z(),layout:S_(),debug:C_(),util:{time:Y().time,notime:Y().notime},version:T_()}),mu}var cv=O_();const x_=lv(cv),M_=pv({__proto__:null,default:x_},[cv]);export{M_ as i};
|