khoj 1.35.4.dev2__py3-none-any.whl → 1.36.0__py3-none-any.whl
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.
- khoj/database/adapters/__init__.py +51 -5
- khoj/database/migrations/0081_agent_is_hidden_chatmodel_description_and_more.py +27 -0
- khoj/database/migrations/0082_merge_20250121_1842.py +13 -0
- khoj/database/migrations/0083_alter_agent_output_modes_alter_agent_personality_and_more.py +71 -0
- khoj/database/migrations/0084_alter_agent_input_tools.py +33 -0
- khoj/database/migrations/0085_alter_agent_output_modes.py +24 -0
- khoj/database/models/__init__.py +8 -6
- khoj/interface/compiled/404/index.html +1 -1
- khoj/interface/compiled/_next/static/chunks/2327-780f28ea68228e9a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/3224-34b5078830a51f42.js +1 -0
- khoj/interface/compiled/_next/static/chunks/4357-73c05a7c905ffc9f.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{4610.196691887afb7fea.js → 4610.a1e7f40a759ed2aa.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/4986-80ecd055ad138cf6.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{5427-0a9a2669cb5cde83.js → 5427-d65c69daf03cc100.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{6434.e6cd986d690f2cef.js → 6434.7afea9648e238ad5.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{6002-7e3115f142731625.js → 8155-87b4d2ea2cf725cc.js} +9 -9
- khoj/interface/compiled/_next/static/chunks/849-bf52aa2736c7f253.js +20 -0
- khoj/interface/compiled/_next/static/chunks/8580-f95d376ed2c5a2cb.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/page-5c32dfc2ab1d37c3.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/automations/{page-e1e5c04c6d1a3b82.js → page-c6dee506ac1ef75c.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/page-74b7f5b550cfb2b3.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/page-18c5514c09249e15.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/search/{page-3813b25193b1c9e3.js → page-dfbf62acab34d1f1.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/page-2a68279b34a434e3.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-6d7831aace573049.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-978928ef05d44a48.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{webpack-2c5a3f89bde64271.js → webpack-8477c6163ef026fe.js} +1 -1
- khoj/interface/compiled/_next/static/css/20ac73cc3d58b75c.css +25 -0
- khoj/interface/compiled/_next/static/css/37a73b87f02df402.css +1 -0
- khoj/interface/compiled/_next/static/css/{df4b47a2d0d85eae.css → b15666ef52060cd0.css} +1 -1
- khoj/interface/compiled/_next/static/css/f29752d6e1be7624.css +1 -0
- khoj/interface/compiled/_next/static/css/f29ee25d068f459b.css +1 -0
- khoj/interface/compiled/agents/index.html +1 -1
- khoj/interface/compiled/agents/index.txt +2 -2
- khoj/interface/compiled/automations/index.html +1 -1
- khoj/interface/compiled/automations/index.txt +3 -3
- khoj/interface/compiled/chat/index.html +1 -1
- khoj/interface/compiled/chat/index.txt +2 -2
- khoj/interface/compiled/index.html +1 -1
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +1 -1
- khoj/interface/compiled/search/index.txt +3 -3
- khoj/interface/compiled/settings/index.html +1 -1
- khoj/interface/compiled/settings/index.txt +4 -4
- khoj/interface/compiled/share/chat/index.html +1 -1
- khoj/interface/compiled/share/chat/index.txt +2 -2
- khoj/routers/api_agents.py +164 -4
- khoj/routers/api_chat.py +22 -5
- khoj/routers/api_model.py +14 -7
- khoj/routers/helpers.py +47 -5
- khoj/utils/helpers.py +14 -5
- {khoj-1.35.4.dev2.dist-info → khoj-1.36.0.dist-info}/METADATA +1 -1
- {khoj-1.35.4.dev2.dist-info → khoj-1.36.0.dist-info}/RECORD +73 -67
- khoj/interface/compiled/_next/static/chunks/182-8cd8b17d40e6e989.js +0 -20
- khoj/interface/compiled/_next/static/chunks/2327-3b7d77ac1d1c86a2.js +0 -1
- khoj/interface/compiled/_next/static/chunks/4270-28ab75d62e71521c.js +0 -1
- khoj/interface/compiled/_next/static/chunks/4986-4de8a920c7fcbbc6.js +0 -1
- khoj/interface/compiled/_next/static/chunks/9665-1ab5c8c667b74dca.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/page-7e18b67e737c7ddd.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/page-6e4297193657b39b.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/page-71b4596245f4b71d.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/page-9a2c880a5750f2d4.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-8b91b8adb4f04450.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-0276dcbd88d8d132.js +0 -1
- khoj/interface/compiled/_next/static/css/bb7ea98028b368f3.css +0 -1
- khoj/interface/compiled/_next/static/css/d6f22b1f76448451.css +0 -1
- khoj/interface/compiled/_next/static/css/d7448372b4f1e3b8.css +0 -25
- khoj/interface/compiled/_next/static/css/eff89937927ce00a.css +0 -1
- /khoj/interface/compiled/_next/static/{qiv_p9caXoUfGDmSGgKvs → 3Sk3rOaHsdqnMPNiH4jA4}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{qiv_p9caXoUfGDmSGgKvs → 3Sk3rOaHsdqnMPNiH4jA4}/_ssgManifest.js +0 -0
- /khoj/interface/compiled/_next/static/chunks/{1199-3461ffb259e6d98b.js → 1199-80c79778c44ad4ec.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{1915-605f698f2573cfd4.js → 1915-233ac8a122732d6b.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{2117-2a54a27661a71b65.js → 2117-ce1f0a4598f5e4fe.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{2509-299ad8b73ce407dd.js → 2509-79b3ce8040bc0bcf.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{5473-b1cf56dedac6577a.js → 5473-02d1709b2a3f4a4b.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{5477-3a4efd2e062e7102.js → 5477-c47515d2934cd866.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{6244-08fb644d7709f449.js → 6244-4b970139897ef46e.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{7647-5a935022fa3da0a6.js → 7647-469de84d236fc7fd.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{8667-d3e5bc726e4ff4e3.js → 8667-8136f74e9a086fca.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{9259-27d1ff42af9a43e0.js → 9259-fa40e7cf2ca28e04.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/app/_not-found/{page-a834eddae3e235df.js → page-0ec97c4970898f2d.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/app/automations/{layout-0adc73dba7a04c11.js → layout-02f95fa0a48743eb.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/app/search/{layout-acc9eb43c9962ee1.js → layout-596cdc3a5a1a8e46.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/app/settings/{layout-d09d6510a45cd4bd.js → layout-8a22f370d3eaeed3.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{fd9d1056-f14840e2376aea5a.js → fd9d1056-7454f5bbfcf5bd5b.js} +0 -0
- {khoj-1.35.4.dev2.dist-info → khoj-1.36.0.dist-info}/WHEEL +0 -0
- {khoj-1.35.4.dev2.dist-info → khoj-1.36.0.dist-info}/entry_points.txt +0 -0
- {khoj-1.35.4.dev2.dist-info → khoj-1.36.0.dist-info}/licenses/LICENSE +0 -0
khoj/interface/compiled/_next/static/chunks/{5427-0a9a2669cb5cde83.js → 5427-d65c69daf03cc100.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5427],{25427:function(e,t,s){"use strict";s.d(t,{EY:function(){return eo},ks:function(){return ec},bc:function(){return ei}});var a=s(57437),l=s(71159),r=s.n(l),n=s(2265),i=s(62869),o=s(52023),c=s(80854),d=s(27909),u=s(63329),m=s(2452),h=s(41317),x=s(86967),f=s(19841),p=s(57757),j=s(75419),g=s(96108),v=s(78299),b=s(87296),N=s(89203),y=s(38513),w=s(70602),k=s(64697),_=s(45178),C=s(2049),z=s(31229),S=s(66070),T=s(26110),I=s(33494),V=s(42225),P=s(84671),O=s(65613),R=s(15681),q=s(29501),B=s(95186),F=s(13590),W=s(76818),E=s(53647),J=s(49027),M=s(962);let A=M.fC,D=M.wy,Z=M.Fw;var X=s(94508),Y=s(23518),G=s(59199),K=s(37099),L=s(32759),$=s(57054),Q=s(97673),U=s(81103),H=s(20271);let ee=H.fC,et=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(H.aV,{ref:t,className:(0,X.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...l})});et.displayName=H.aV.displayName;let es=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(H.xz,{ref:t,className:(0,X.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...l})});es.displayName=H.xz.displayName;let ea=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(H.VY,{ref:t,className:(0,X.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...l})});ea.displayName=H.VY.displayName;var el=s(19378);async function er(e,t){let s="/login?next=/agents?agent=".concat(e);if(!t){window.location.href=s;return}let a=await fetch("/api/chat/sessions?agent_slug=".concat(encodeURIComponent(e)),{method:"POST"}),l=await a.json();200==a.status?window.location.href="/chat?conversationId=".concat(l.conversation_id):403==a.status||401==a.status?window.location.href=s:alert("Failed to start chat session")}function en(e){var t;let s=(null===(t=e.text)||void 0===t?void 0:t.replace(/^\w/,e=>e.toUpperCase()))||"";return(0,a.jsx)(U.pn,{children:(0,a.jsxs)(U.u,{children:[(0,a.jsx)(U._v,{asChild:!0,children:(0,a.jsx)("div",{className:"text-sm",children:e.hoverText||s})}),(0,a.jsx)(U.aJ,{className:"cursor-text",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2 rounded-full border-accent-500 border p-1.5",children:[(0,a.jsx)("div",{className:"text-muted-foreground",children:e.icon}),s&&s.length>0&&(0,a.jsx)("div",{className:"text-muted-foreground text-sm",children:s})]})})]})})}let ei=z.z.object({name:z.z.string({required_error:"Name is required"}).min(1,"Name is required"),persona:z.z.string({required_error:"Personality is required"}).min(1,"Personality is required"),color:z.z.string({required_error:"Color is required"}).min(1,"Color is required"),icon:z.z.string({required_error:"Icon is required"}).min(1,"Icon is required"),privacy_level:z.z.string({required_error:"Privacy level is required"}).min(1,"Privacy level is required"),chat_model:z.z.string({required_error:"Chat model is required"}).min(1,"Chat model is required"),files:z.z.array(z.z.string()).default([]).optional(),input_tools:z.z.array(z.z.string()).default([]).optional(),output_modes:z.z.array(z.z.string()).default([]).optional()});function eo(e){var t;let[s,l]=(0,n.useState)(e.agentSlug===e.data.slug),[j,g]=(0,n.useState)(!1),[v,b]=(0,n.useState)(null),N=(0,a.jsx)(o.H,{}),y="Private agents are only visible to you.";"public"===e.data.privacy_level?(N=(0,a.jsx)(c.T,{}),y="Public agents are visible to everyone."):"protected"===e.data.privacy_level&&(N=(0,a.jsx)(d.M,{}),y="Protected agents are visible to anyone with a direct link.");let w=e.userProfile,k=(0,q.cI)({resolver:(0,F.F)(ei),defaultValues:{name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.data.chat_model,files:e.data.files,input_tools:e.data.input_tools,output_modes:e.data.output_modes}});(0,n.useEffect)(()=>{k.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.data.chat_model,files:e.data.files,input_tools:e.data.input_tools,output_modes:e.data.output_modes})},[e.data]),s&&window.history.pushState({},"Khoj AI - Agent ".concat(e.data.slug),"/agents?agent=".concat(e.data.slug));let _=(0,P.oz)(e.data.color);function C(){return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[e.editCard&&(0,a.jsx)(en,{icon:N,text:e.data.privacy_level,hoverText:y}),e.data.files&&e.data.files.length>0&&(0,a.jsx)(en,{icon:(0,a.jsx)(u.f,{}),text:"knowledge",hoverText:"The agent has a custom knowledge base with ".concat(e.data.files.length," documents. It can use them to give you answers.")}),(0,a.jsx)(en,{icon:(0,a.jsx)(m.a,{}),text:e.data.chat_model,hoverText:"The agent uses the ".concat(e.data.chat_model," model to chat with you.")}),e.data.output_modes.map(t=>(0,a.jsx)(en,{icon:(0,V.vH)(t),hoverText:"".concat(t,": ").concat(e.outputModeOptions[t])},t)),e.data.input_tools.map(t=>(0,a.jsx)(en,{icon:(0,V.vH)(t),hoverText:"".concat(t,": ").concat(e.inputToolOptions[t])},t))]})}return(0,a.jsxs)(S.Zb,{className:"shadow-md rounded-xl hover:shadow-lg dark:bg-muted",children:[j&&(0,a.jsx)(I.Z,{onOpenChange:g,isMobileWidth:e.isMobileWidth}),(0,a.jsx)(S.Ol,{children:(0,a.jsx)(S.ll,{children:(0,a.jsxs)(T.Vq,{open:s,onOpenChange:()=>{l(!s),window.history.pushState({},"Khoj AI - Agents","/agents")},children:[(0,a.jsx)(T.hg,{className:"focus-visible:outline-none",children:(0,a.jsxs)("div",{className:"flex items-center relative top-2",children:[(0,V.TI)(e.data.icon,e.data.color),e.data.name]})}),(0,a.jsxs)("div",{className:"flex float-right",children:[e.editCard&&(0,a.jsx)("div",{className:"float-right",children:(0,a.jsxs)($.J2,{children:[(0,a.jsx)($.xo,{children:(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-10 h-10 p-0 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,a.jsx)(h.F,{className:"w-6 h-6 ".concat((0,P.oz)(e.data.color))})})}),(0,a.jsxs)($.yk,{className:"w-fit grid p-1",side:"bottom",align:"end",children:[(0,a.jsxs)(i.z,{className:"items-center justify-start",variant:"ghost",onClick:()=>l(!0),children:[(0,a.jsx)(x.z,{className:"w-4 h-4 mr-2"}),"Edit"]}),e.editCard&&"private"!==e.data.privacy_level&&(0,a.jsx)(Q.Z,{buttonTitle:"Share",title:"Share Agent",description:"Share a link to this agent with others. They'll be able to chat with it, and ask questions to all of its knowledge base.",buttonVariant:"ghost",includeIcon:!0,url:"".concat(window.location.origin,"/agents?agent=").concat(e.data.slug)}),e.data.creator===(null==w?void 0:w.username)&&(0,a.jsxs)(i.z,{className:"items-center justify-start",variant:"destructive",onClick:()=>{fetch("/api/agents/".concat(e.data.slug),{method:"DELETE"}).then(()=>{e.setAgentChangeTriggered(!0)})},children:[(0,a.jsx)(f.r,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})}),(null===(t=e.showChatButton)||void 0===t||t)&&(0,a.jsx)("div",{className:"float-right ml-2",children:e.userProfile?(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-10 h-10 p-0 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",onClick:()=>er(e.data.slug,w),children:(0,a.jsx)(p.g,{className:"w-6 h-6 ".concat((0,P.oz)(e.data.color))})}):(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-14 h-14 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",onClick:()=>g(!0),children:(0,a.jsx)(p.g,{className:"w-6 h-6 ".concat((0,P.oz)(e.data.color))})})})]}),e.editCard?(0,a.jsxs)(T.cZ,{className:"lg:max-w-screen-lg py-4 overflow-y-scroll h-full md:h-4/6 rounded-lg flex flex-col",children:[(0,a.jsxs)(J.$N,{children:["Edit ",(0,a.jsx)("b",{children:e.data.name})]}),(0,a.jsx)(ec,{form:k,onSubmit:t=>{let s=e.editCard?"PATCH":"POST",a=t;e.editCard&&(a={...t,slug:e.data.slug}),fetch("/api/agents",{method:s,headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(t=>{200===t.status?(k.reset(),l(!1),b(null),e.setAgentChangeTriggered(!0)):t.json().then(e=>{console.error(e),k.clearErrors(),e.error&&b(e.error)})}).catch(e=>{console.error("Error:",e),b(e),k.clearErrors()})},create:!1,errors:v,filesOptions:e.filesOptions,modelOptions:e.modelOptions,slug:e.data.slug,inputToolOptions:e.inputToolOptions,isSubscribed:e.isSubscribed,outputModeOptions:e.outputModeOptions})]}):(0,a.jsxs)(T.cZ,{className:"whitespace-pre-line max-h-[80vh] max-w-[90vw] rounded-lg",children:[(0,a.jsx)(T.fK,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,V.TI)(e.data.icon,e.data.color),(0,a.jsx)("p",{className:"font-bold text-lg",children:(0,a.jsx)(J.$N,{children:e.data.name})})]})}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-scroll text-neutral-500 dark:text-white",children:e.data.persona}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:C()}),(0,a.jsx)(T.cN,{children:(0,a.jsxs)(i.z,{className:"pt-6 pb-6 ".concat(_," bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white border-2 border-stone-100 shadow-sm rounded-xl hover:bg-stone-100 dark:hover:bg-neutral-900 dark:border-neutral-700"),onClick:()=>{er(e.data.slug,w),l(!1)},children:[(0,a.jsx)(p.g,{className:"w-6 h-6 m-2 ".concat((0,P.oz)(e.data.color))}),"Start Chatting"]})})]})]})})}),(0,a.jsx)(S.aY,{children:(0,a.jsx)("div",{className:r().agentPersonality,children:(0,a.jsx)("button",{className:"".concat(r().infoButton," text-neutral-500 dark:text-white"),onClick:()=>l(!0),children:(0,a.jsx)("p",{children:e.data.persona})})})}),(0,a.jsx)(S.eW,{children:(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:C()})})]})}function ec(e){let[t,s]=(0,n.useState)(!1),l=(0,V.BI)(),r=P.xF,o=(0,P.oz)(e.form.getValues("color")),[c,d]=(0,n.useState)(!1),[u,m]=(0,n.useState)(null),[h,x]=(0,n.useState)(null),[f,p]=(0,n.useState)(!1),[z,S]=(0,n.useState)(0),[T,I]=(0,n.useState)([]),[q,F]=(0,n.useState)([]),[J,M]=(0,n.useState)(0),[Q,U]=(0,n.useState)(!1),H=["public","private","protected"],er=[{fields:[{name:"name",label:"Name"},{name:"persona",label:"Personality"},{name:"color",label:"Color"},{name:"icon",label:"Icon"}],label:"1. Basic Settings",tabName:"basic"},{fields:[{name:"chat_model",label:"Chat Model"},{name:"privacy_level",label:"Privacy Level"}],label:"2. Model & Privacy",tabName:"customize"},{fields:[{name:"files",label:"Knowledge Base"}],label:"3. Knowledge Base",tabName:"knowledge"},{fields:[{name:"input_tools",label:"Input Tools"},{name:"output_modes",label:"Output Modes"}],label:"4. Tools",tabName:"tools"}],en=(0,n.useRef)(null);function eo(e){e.preventDefault(),d(!0)}function ec(e){e.preventDefault(),d(!1)}function ed(e){e.preventDefault(),d(!1),e.dataTransfer.files&&eu(e.dataTransfer.files)}function eu(e){(0,G.ko)(e,m,p,x,I)}function em(){en&&en.current&&en.current.click()}function eh(e){e.target.files&&eu(e.target.files)}(0,n.useEffect)(()=>{if(f||S(0),f){let e=setInterval(()=>{S(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[f]),(0,n.useEffect)(()=>{F(Array.from(new Set([...q,...e.form.getValues("files")||[],...e.filesOptions||[]])))},[]),(0,n.useEffect)(()=>{T.length>0&&(ef(T),F(e=>[...e,...T]))},[T]),(0,n.useEffect)(()=>{e.errors&&s(!1)},[e.errors]);let ex=t=>{console.log("Submitting",t),e.onSubmit(t),s(!0)},ef=t=>{for(let s of t){let t=e.form.getValues("files")||[],a=t.includes(s)?t.filter(e=>e!==s):[...t,s];e.form.setValue("files",a)}},ep=t=>{try{return ei.parse(e.form.getValues()),!0}catch(s){let e=s.errors.reduce((e,t)=>(e[t.path[0]]=t.message,e),{});for(let s of t.fields)if(e[s.name])return!1;return!0}};if(Q)return(0,a.jsx)(K.aR,{open:!0,children:(0,a.jsxs)(K._T,{children:[(0,a.jsx)(K.fY,{children:(0,a.jsx)(K.f$,{children:"Upgrade to Futurist"})}),(0,a.jsxs)(K.yT,{children:["You need to be a Futurist subscriber to create more agents."," ",(0,a.jsx)("a",{href:"/settings",children:"Upgrade now"}),"."]}),(0,a.jsxs)(K.xo,{children:[(0,a.jsx)(K.le,{onClick:()=>{U(!1)},children:"Cancel"}),(0,a.jsx)(K.OL,{onClick:()=>{window.location.href="/settings"},children:"Continue"})]})]})});let ej=t=>{switch(t){case"name":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"name",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-0 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Name"}),(0,a.jsx)(R.pf,{children:"What should this agent be called? Pick something descriptive & memorable."}),(0,a.jsx)(R.NI,{children:(0,a.jsx)(B.I,{className:"dark:bg-muted",placeholder:"Biologist",...t})}),(0,a.jsx)(R.zG,{})]})}},t);case"chat_model":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"chat_model",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"my-2 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Chat Model"}),(0,a.jsx)(R.pf,{children:e.isSubscribed?(0,a.jsx)("p",{children:"Which chat model would you like to use?"}):(0,a.jsxs)("p",{className:"text-secondary-foreground",children:["Upgrade to the ",(0,a.jsx)("a",{href:"/settings",children:"Futurist plan"})," to access all models."]})}),(0,a.jsxs)(E.Ph,{onValueChange:s.onChange,defaultValue:s.value,disabled:!e.isSubscribed,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(E.i4,{className:"text-left dark:bg-muted",children:(0,a.jsx)(E.ki,{})})}),(0,a.jsx)(E.Bw,{className:"items-start space-y-1 inline-flex flex-col",children:e.modelOptions.map(e=>(0,a.jsx)(E.Ql,{value:e.name,children:(0,a.jsx)("div",{className:"flex items-center space-x-2",children:e.name})},e.id))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"privacy_level":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"privacy_level",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"my-2 grid gap-2",children:[(0,a.jsx)(R.lX,{children:(0,a.jsx)("div",{children:"Privacy Level"})}),(0,a.jsx)(R.pf,{children:(0,a.jsxs)($.J2,{children:[(0,a.jsx)($.xo,{asChild:!0,children:(0,a.jsx)(i.z,{variant:"ghost",className:"p-0 h-fit",children:(0,a.jsxs)("span",{className:"items-center flex gap-1 text-sm",children:[(0,a.jsx)(j.k,{className:"inline"}),(0,a.jsx)("p",{className:"text-sm",children:"Learn more"})]})})}),(0,a.jsxs)($.yk,{children:[(0,a.jsx)("b",{children:"Private"}),": only visible to you.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Protected"}),": visible to anyone with a link.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Public"}),": visible to everyone.",(0,a.jsx)("br",{}),"All public agents will be reviewed by us before they are launched."]})]})}),(0,a.jsxs)(E.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(E.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(E.ki,{placeholder:"private"})})}),(0,a.jsx)(E.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:H.map(e=>(0,a.jsx)(E.Ql,{value:e,children:(0,a.jsx)("div",{className:"flex items-center space-x-2",children:e})},e))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"color":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"color",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-3 my-2",children:[(0,a.jsx)(R.lX,{children:"Color"}),(0,a.jsxs)(E.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(E.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(E.ki,{placeholder:"Color"})})}),(0,a.jsx)(E.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:r.map(e=>(0,a.jsx)(E.Ql,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(g.C,{className:"w-6 h-6 mr-2 ".concat((0,P.oz)(e)),weight:"fill"}),e]})},e))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"icon":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"icon",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"space-y-3 my-2",children:[(0,a.jsx)(R.lX,{children:"Icon"}),(0,a.jsxs)(E.Ph,{onValueChange:s.onChange,defaultValue:s.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(E.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(E.ki,{placeholder:"Icon"})})}),(0,a.jsx)(E.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:l.map(t=>(0,a.jsx)(E.Ql,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.TI)(t,e.form.getValues("color"),"w-6","h-6"),t]})},t))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"persona":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"persona",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-1 my-2 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Personality"}),(0,a.jsx)(R.pf,{children:"What is the personality, thought process, or tuning of this agent? This is where you can provide any instructions to the agent."}),(0,a.jsx)(R.NI,{children:(0,a.jsx)(W.g,{className:"dark:bg-muted focus:outline-none focus-visible:border-orange-500 focus-visible:border-2",placeholder:"You are an excellent biologist, at the top of your field in marine biology.",...t})}),(0,a.jsx)(R.zG,{})]})}},t);case"files":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"files",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"my-2 flex flex-col gap-2",children:[(0,a.jsx)(R.lX,{children:"Knowledge Base"}),(0,a.jsxs)(R.pf,{children:["Which information should be part of its digital brain?"," ",(0,a.jsx)("a",{href:"/settings",children:"Manage data"}),"."]}),(0,a.jsxs)(A,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," files selected"):"Select files"]}),(0,a.jsx)(Z,{className:"m-1",children:(0,a.jsxs)(Y.mY,{children:[(0,a.jsx)(K.aR,{open:null!==u||null!=h,children:(0,a.jsxs)(K._T,{children:[(0,a.jsx)(K.fY,{children:(0,a.jsx)(K.f$,{children:"Alert"})}),(0,a.jsx)(K.yT,{children:u||h}),(0,a.jsx)(K.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{m(null),x(null),p(!1)},children:"Close"})]})}),(0,a.jsxs)("div",{className:"flex flex-col h-full cursor-pointer",onDragOver:eo,onDragLeave:ec,onDrop:ed,onClick:em,children:[(0,a.jsx)("input",{type:"file",multiple:!0,ref:en,style:{display:"none"},onChange:eh}),(0,a.jsx)("div",{className:"flex-none p-4",children:f&&(0,a.jsx)(L.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:z})}),(0,a.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(c?"animate-pulse":""," rounded-lg"),children:(0,a.jsx)("div",{className:"flex items-center justify-center w-full h-16 border-2 border-dashed border-gray-300 rounded-lg",children:c?(0,a.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,a.jsx)(b.u,{className:"h-6 w-6 mr-2"}),(0,a.jsx)("span",{children:"Drop files to upload"})]}):(0,a.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,a.jsx)(N.v,{className:"h-6 w-6 mr-2"}),(0,a.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,a.jsx)(Y.sZ,{placeholder:"Select files..."}),(0,a.jsxs)(Y.e8,{children:[(0,a.jsx)(Y.rb,{children:"No files found."}),(0,a.jsx)(Y.fu,{children:q.map(t=>(0,a.jsxs)(Y.di,{value:t,className:"break-all",onSelect:()=>{let s=e.form.getValues("files")||[],a=s.includes(t)?s.filter(e=>e!==t):[...s,t];e.form.setValue("files",a)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(t)?"opacity-100":"opacity-0")}),t]},t))})]})]})})]})]})}},t);case"input_tools":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"input_tools",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"flex flex-col gap-2 my-2",children:[(0,a.jsx)(R.lX,{children:"Restrict Input Tools"}),(0,a.jsxs)(R.pf,{children:["Which knowledge retrieval tools should this agent be limited to?",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Default:"})," No limitations."]}),(0,a.jsxs)(A,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," tools selected"):"All tools"]}),(0,a.jsx)(Z,{children:(0,a.jsx)(Y.mY,{children:(0,a.jsx)(Y.e8,{children:(0,a.jsx)(Y.fu,{children:Object.entries(e.inputToolOptions).map(t=>{let[l,r]=t;return(0,a.jsxs)(Y.di,{value:l,onSelect:()=>{let t=e.form.getValues("input_tools")||[],s=t.includes(l)?t.filter(e=>e!==l):[...t,l];e.form.setValue("input_tools",s)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(l)?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:(0,X.cn)("flex items-center space-x-2"),children:[(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:l})}),(0,a.jsx)("p",{children:r})]})]},l)})})})})})]})]})}},t);case"output_modes":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"output_modes",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"flex flex-col gap-2 my-2",children:[(0,a.jsx)(R.lX,{children:"Restrict Output Modes"}),(0,a.jsxs)(R.pf,{children:["Which output modes should this agent be limited to?",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Default:"})," No limitations."]}),(0,a.jsxs)(A,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," modes selected"):"All modes"]}),(0,a.jsx)(Z,{children:(0,a.jsx)(Y.mY,{children:(0,a.jsx)(Y.e8,{children:(0,a.jsx)(Y.fu,{children:Object.entries(e.outputModeOptions).map(t=>{let[l,r]=t;return(0,a.jsxs)(Y.di,{value:l,onSelect:()=>{let t=e.form.getValues("output_modes")||[],s=t.includes(l)?t.filter(e=>e!==l):[...t,l];e.form.setValue("output_modes",s)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(l)?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:(0,X.cn)("flex items-center space-x-2"),children:[(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:l})}),(0,a.jsx)("p",{children:r})]})]},l)})})})})})]})]})}},t);default:return null}};return(0,a.jsxs)(R.l0,{...e.form,children:[(0,a.jsx)(el.x,{className:"h-full",children:(0,a.jsxs)("form",{onSubmit:e.form.handleSubmit(ex),className:"space-y-6 pb-4 px-4 h-full flex flex-col justify-between",children:[(0,a.jsxs)(ee,{defaultValue:"basic",value:er[J].tabName,children:[(0,a.jsx)(et,{className:"grid grid-cols-2 md:grid-cols-4 gap-2 h-fit",children:er.map(e=>(0,a.jsxs)(es,{value:e.tabName,className:"text-center ".concat(ep(e)?"":"text-red-500"),onClick:()=>M(er.findIndex(t=>t.tabName===e.tabName)),children:[e.label," ",!ep(e)&&"*"]},e.tabName))}),er.map(e=>(0,a.jsx)(ea,{value:e.tabName,children:e.fields.map(e=>ej(e.name))},e.tabName))]}),e.errors&&(0,a.jsx)(O.bZ,{className:"bg-secondary border-none my-4",children:(0,a.jsxs)(O.X,{className:"flex items-center gap-1",children:[(0,a.jsx)(w.f,{weight:"fill",className:"h-4 w-4 text-yellow-400 inline"}),(0,a.jsx)("span",{children:e.errors})]})})]})}),(0,a.jsxs)("div",{className:"flex justify-between mt-1 left-0 right-0 bg-background p-1",children:[(0,a.jsxs)(i.z,{type:"button",variant:"outline",onClick:e=>{e.preventDefault(),J>0&&M(J-1)},disabled:0===J,className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:[(0,a.jsx)(k.X,{className:"mr-2 h-4 w-4"}),"Previous"]}),J<er.length-1?(0,a.jsxs)(i.z,{type:"button",variant:"outline",onClick:e=>{e.preventDefault(),J<er.length-1&&M(J+1)},disabled:!ep(er[J]),className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:["Continue",(0,a.jsx)(_.o,{className:"ml-2 h-4 w-4"})]}):(0,a.jsxs)(i.z,{type:"submit",variant:"outline",disabled:t,onClick:e.form.handleSubmit(ex),className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:[(0,a.jsx)(C.B,{className:"h-4 w-4 mr-2"}),t?"Booting...":"Save"]})]})]})}},97673:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var a=s(57437),l=s(26110),r=s(62869),n=s(95186),i=s(26815),o=s(92457);function c(e){var t;return(0,a.jsxs)(l.Vq,{children:[(0,a.jsx)(l.hg,{asChild:!0,onClick:e.onShare,children:(0,a.jsxs)(r.z,{size:"sm",className:"".concat(e.buttonClassName||"px-3"),variant:null!==(t=e.buttonVariant)&&void 0!==t?t:"default",children:[e.includeIcon&&(0,a.jsx)(o.m,{className:"w-4 h-4 mr-2"}),e.buttonTitle]})}),(0,a.jsxs)(l.cZ,{children:[(0,a.jsxs)(l.fK,{children:[(0,a.jsx)(l.$N,{children:e.title}),(0,a.jsx)(l.Be,{children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)("div",{className:"grid flex-1 gap-2",children:[(0,a.jsx)(i._,{htmlFor:"link",className:"sr-only",children:"Link"}),(0,a.jsx)(n.I,{id:"link",defaultValue:e.url,readOnly:!0})]}),(0,a.jsx)(r.z,{type:"submit",size:"sm",className:"px-3",onClick:()=>(function(e){let t=navigator.clipboard;t&&t.writeText(e)})(e.url),children:(0,a.jsx)("span",{children:"Copy"})})]})]})]})}},65613:function(e,t,s){"use strict";s.d(t,{X:function(){return c},bZ:function(){return o}});var a=s(57437),l=s(2265),r=s(90535),n=s(94508);let i=(0,r.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),o=l.forwardRef((e,t)=>{let{className:s,variant:l,...r}=e;return(0,a.jsx)("div",{ref:t,role:"alert",className:(0,n.cn)(i({variant:l}),s),...r})});o.displayName="Alert",l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)("h5",{ref:t,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",s),...l})}).displayName="AlertTitle";let c=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",s),...l})});c.displayName="AlertDescription"},15681:function(e,t,s){"use strict";s.d(t,{NI:function(){return p},Wi:function(){return u},l0:function(){return c},lX:function(){return f},pf:function(){return j},xJ:function(){return x},zG:function(){return g}});var a=s(57437),l=s(2265),r=s(37053),n=s(29501),i=s(94508),o=s(26815);let c=n.RV,d=l.createContext({}),u=e=>{let{...t}=e;return(0,a.jsx)(d.Provider,{value:{name:t.name},children:(0,a.jsx)(n.Qr,{...t})})},m=()=>{let e=l.useContext(d),t=l.useContext(h),{getFieldState:s,formState:a}=(0,n.Gc)(),r=s(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...r}},h=l.createContext({}),x=l.forwardRef((e,t)=>{let{className:s,...r}=e,n=l.useId();return(0,a.jsx)(h.Provider,{value:{id:n},children:(0,a.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",s),...r})})});x.displayName="FormItem";let f=l.forwardRef((e,t)=>{let{className:s,...l}=e,{error:r,formItemId:n}=m();return(0,a.jsx)(o._,{ref:t,className:(0,i.cn)(r&&"text-destructive",s),htmlFor:n,...l})});f.displayName="FormLabel";let p=l.forwardRef((e,t)=>{let{...s}=e,{error:l,formItemId:n,formDescriptionId:i,formMessageId:o}=m();return(0,a.jsx)(r.g7,{ref:t,id:n,"aria-describedby":l?"".concat(i," ").concat(o):"".concat(i),"aria-invalid":!!l,...s})});p.displayName="FormControl";let j=l.forwardRef((e,t)=>{let{className:s,...l}=e,{formDescriptionId:r}=m();return(0,a.jsx)("p",{ref:t,id:r,className:(0,i.cn)("text-sm text-muted-foreground",s),...l})});j.displayName="FormDescription";let g=l.forwardRef((e,t)=>{let{className:s,children:l,...r}=e,{error:n,formMessageId:o}=m(),c=n?String(null==n?void 0:n.message):l;return c?(0,a.jsx)("p",{ref:t,id:o,className:(0,i.cn)("text-sm font-medium text-destructive",s),...r,children:c}):null});g.displayName="FormMessage"},26815:function(e,t,s){"use strict";s.d(t,{_:function(){return c}});var a=s(57437),l=s(2265),r=s(6394),n=s(90535),i=s(94508);let o=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.f,{ref:t,className:(0,i.cn)(o(),s),...l})});c.displayName=r.f.displayName},53647:function(e,t,s){"use strict";s.d(t,{Bw:function(){return f},Ph:function(){return d},Ql:function(){return p},i4:function(){return m},ki:function(){return u}});var a=s(57437),l=s(2265),r=s(28951),n=s(40875),i=s(22135),o=s(30401),c=s(94508);let d=r.fC;r.ZA;let u=r.B4,m=l.forwardRef((e,t)=>{let{className:s,children:l,...i}=e;return(0,a.jsxs)(r.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...i,children:[l,(0,a.jsx)(r.JO,{asChild:!0,children:(0,a.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=r.xz.displayName;let h=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...l,children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})});h.displayName=r.u_.displayName;let x=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...l,children:(0,a.jsx)(n.Z,{className:"h-4 w-4"})})});x.displayName=r.$G.displayName;let f=l.forwardRef((e,t)=>{let{className:s,children:l,position:n="popper",...i}=e;return(0,a.jsx)(r.h_,{children:(0,a.jsxs)(r.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...i,children:[(0,a.jsx)(h,{}),(0,a.jsx)(r.l_,{className:(0,c.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:l}),(0,a.jsx)(x,{})]})})});f.displayName=r.VY.displayName,l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...l})}).displayName=r.__.displayName;let p=l.forwardRef((e,t)=>{let{className:s,children:l,...n}=e;return(0,a.jsxs)(r.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(r.wU,{children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(r.eT,{children:l})]})});p.displayName=r.ck.displayName,l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",s),...l})}).displayName=r.Z0.displayName},71159:function(e){e.exports={agentPersonality:"agentCard_agentPersonality__MmRlN",infoButton:"agentCard_infoButton__heh_w"}}}]);
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5427],{25427:function(e,t,s){"use strict";s.d(t,{EY:function(){return eo},ks:function(){return ec},bc:function(){return ei}});var a=s(57437),l=s(71159),r=s.n(l),n=s(2265),i=s(62869),o=s(52023),c=s(80854),d=s(27909),u=s(63329),m=s(2452),h=s(41317),x=s(86967),f=s(19841),p=s(57757),j=s(75419),g=s(96108),v=s(78299),b=s(87296),N=s(89203),y=s(38513),w=s(70602),k=s(64697),_=s(45178),C=s(2049),z=s(31229),S=s(66070),T=s(26110),I=s(33494),V=s(42225),P=s(84671),O=s(65613),R=s(15681),q=s(29501),B=s(95186),F=s(13590),W=s(76818),E=s(53647),J=s(49027),M=s(962);let A=M.fC,D=M.wy,Z=M.Fw;var X=s(94508),Y=s(23518),G=s(59199),K=s(37099),L=s(32759),$=s(57054),Q=s(97673),U=s(81103),H=s(20271);let ee=H.fC,et=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(H.aV,{ref:t,className:(0,X.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...l})});et.displayName=H.aV.displayName;let es=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(H.xz,{ref:t,className:(0,X.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...l})});es.displayName=H.xz.displayName;let ea=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(H.VY,{ref:t,className:(0,X.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...l})});ea.displayName=H.VY.displayName;var el=s(19378);async function er(e,t){let s="/login?next=/agents?agent=".concat(e);if(!t){window.location.href=s;return}let a=await fetch("/api/chat/sessions?agent_slug=".concat(encodeURIComponent(e)),{method:"POST"}),l=await a.json();200==a.status?window.location.href="/chat?conversationId=".concat(l.conversation_id):403==a.status||401==a.status?window.location.href=s:alert("Failed to start chat session")}function en(e){var t;let s=(null===(t=e.text)||void 0===t?void 0:t.replace(/^\w/,e=>e.toUpperCase()))||"";return(0,a.jsx)(U.pn,{children:(0,a.jsxs)(U.u,{children:[(0,a.jsx)(U._v,{asChild:!0,children:(0,a.jsx)("div",{className:"text-sm",children:e.hoverText||s})}),(0,a.jsx)(U.aJ,{className:"cursor-text",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2 rounded-full border-accent-500 border p-1.5",children:[(0,a.jsx)("div",{className:"text-muted-foreground",children:e.icon}),s&&s.length>0&&(0,a.jsx)("div",{className:"text-muted-foreground text-sm",children:s})]})})]})})}let ei=z.z.object({name:z.z.string({required_error:"Name is required"}).min(1,"Name is required"),persona:z.z.string({required_error:"Personality is required"}).min(1,"Personality is required"),color:z.z.string({required_error:"Color is required"}).min(1,"Color is required"),icon:z.z.string({required_error:"Icon is required"}).min(1,"Icon is required"),privacy_level:z.z.string({required_error:"Privacy level is required"}).min(1,"Privacy level is required"),chat_model:z.z.string({required_error:"Chat model is required"}).min(1,"Chat model is required"),files:z.z.array(z.z.string()).default([]).optional(),input_tools:z.z.array(z.z.string()).default([]).optional(),output_modes:z.z.array(z.z.string()).default([]).optional()});function eo(e){var t;let[s,l]=(0,n.useState)(e.agentSlug===e.data.slug),[j,g]=(0,n.useState)(!1),[v,b]=(0,n.useState)(null),N=(0,a.jsx)(o.H,{}),y="Private agents are only visible to you.";"public"===e.data.privacy_level?(N=(0,a.jsx)(c.T,{}),y="Public agents are visible to everyone."):"protected"===e.data.privacy_level&&(N=(0,a.jsx)(d.M,{}),y="Protected agents are visible to anyone with a direct link.");let w=e.userProfile,k=(0,q.cI)({resolver:(0,F.F)(ei),defaultValues:{name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.data.chat_model,files:e.data.files,input_tools:e.data.input_tools,output_modes:e.data.output_modes}});(0,n.useEffect)(()=>{k.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.data.chat_model,files:e.data.files,input_tools:e.data.input_tools,output_modes:e.data.output_modes})},[e.data]),s&&window.history.pushState({},"Khoj AI - Agent ".concat(e.data.slug),"/agents?agent=".concat(e.data.slug));let _=(0,P.oz)(e.data.color);function C(){return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[e.editCard&&(0,a.jsx)(en,{icon:N,text:e.data.privacy_level,hoverText:y}),e.data.files&&e.data.files.length>0&&(0,a.jsx)(en,{icon:(0,a.jsx)(u.f,{}),text:"knowledge",hoverText:"The agent has a custom knowledge base with ".concat(e.data.files.length," documents. It can use them to give you answers.")}),(0,a.jsx)(en,{icon:(0,a.jsx)(m.a,{}),text:e.data.chat_model,hoverText:"The agent uses the ".concat(e.data.chat_model," model to chat with you.")}),e.data.output_modes.map(t=>(0,a.jsx)(en,{icon:(0,V.vH)(t),hoverText:"".concat(t,": ").concat(e.outputModeOptions[t])},t)),e.data.input_tools.map(t=>(0,a.jsx)(en,{icon:(0,V.vH)(t),hoverText:"".concat(t,": ").concat(e.inputToolOptions[t])},t))]})}return(0,a.jsxs)(S.Zb,{className:"shadow-md rounded-xl hover:shadow-lg dark:bg-muted",children:[j&&(0,a.jsx)(I.Z,{onOpenChange:g,isMobileWidth:e.isMobileWidth}),(0,a.jsx)(S.Ol,{children:(0,a.jsx)(S.ll,{children:(0,a.jsxs)(T.Vq,{open:s,onOpenChange:()=>{l(!s),window.history.pushState({},"Khoj AI - Agents","/agents")},children:[(0,a.jsx)(T.hg,{className:"focus-visible:outline-none",children:(0,a.jsxs)("div",{className:"flex items-center relative top-2",children:[(0,V.TI)(e.data.icon,e.data.color),e.data.name]})}),(0,a.jsxs)("div",{className:"flex float-right",children:[e.editCard&&(0,a.jsx)("div",{className:"float-right",children:(0,a.jsxs)($.J2,{children:[(0,a.jsx)($.xo,{children:(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-10 h-10 p-0 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,a.jsx)(h.F,{className:"w-6 h-6 ".concat((0,P.oz)(e.data.color))})})}),(0,a.jsxs)($.yk,{className:"w-fit grid p-1",side:"bottom",align:"end",children:[(0,a.jsxs)(i.z,{className:"items-center justify-start",variant:"ghost",onClick:()=>l(!0),children:[(0,a.jsx)(x.z,{className:"w-4 h-4 mr-2"}),"Edit"]}),e.editCard&&"private"!==e.data.privacy_level&&(0,a.jsx)(Q.Z,{buttonTitle:"Share",title:"Share Agent",description:"Share a link to this agent with others. They'll be able to chat with it, and ask questions to all of its knowledge base.",buttonVariant:"ghost",includeIcon:!0,url:"".concat(window.location.origin,"/agents?agent=").concat(e.data.slug)}),e.data.creator===(null==w?void 0:w.username)&&(0,a.jsxs)(i.z,{className:"items-center justify-start",variant:"destructive",onClick:()=>{fetch("/api/agents/".concat(e.data.slug),{method:"DELETE"}).then(()=>{e.setAgentChangeTriggered(!0)})},children:[(0,a.jsx)(f.r,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})}),(null===(t=e.showChatButton)||void 0===t||t)&&(0,a.jsx)("div",{className:"float-right ml-2",children:e.userProfile?(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-10 h-10 p-0 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",onClick:()=>er(e.data.slug,w),children:(0,a.jsx)(p.g,{className:"w-6 h-6 ".concat((0,P.oz)(e.data.color))})}):(0,a.jsx)(i.z,{className:"bg-[hsl(var(--background))] w-14 h-14 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",onClick:()=>g(!0),children:(0,a.jsx)(p.g,{className:"w-6 h-6 ".concat((0,P.oz)(e.data.color))})})})]}),e.editCard?(0,a.jsxs)(T.cZ,{className:"lg:max-w-screen-lg py-4 overflow-y-scroll h-full md:h-4/6 rounded-lg flex flex-col",children:[(0,a.jsxs)(J.$N,{children:["Edit ",(0,a.jsx)("b",{children:e.data.name})]}),(0,a.jsx)(ec,{form:k,onSubmit:t=>{let s=e.editCard?"PATCH":"POST",a=t;e.editCard&&(a={...t,slug:e.data.slug}),fetch("/api/agents",{method:s,headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(t=>{200===t.status?(k.reset(),l(!1),b(null),e.setAgentChangeTriggered(!0)):t.json().then(e=>{console.error(e),k.clearErrors(),e.error&&b(e.error)})}).catch(e=>{console.error("Error:",e),b(e),k.clearErrors()})},create:!1,errors:v,filesOptions:e.filesOptions,modelOptions:e.modelOptions,slug:e.data.slug,inputToolOptions:e.inputToolOptions,isSubscribed:e.isSubscribed,outputModeOptions:e.outputModeOptions})]}):(0,a.jsxs)(T.cZ,{className:"whitespace-pre-line max-h-[80vh] max-w-[90vw] rounded-lg",children:[(0,a.jsx)(T.fK,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,V.TI)(e.data.icon,e.data.color),(0,a.jsx)("p",{className:"font-bold text-lg",children:(0,a.jsx)(J.$N,{children:e.data.name})})]})}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-scroll text-neutral-500 dark:text-white",children:e.data.persona}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:C()}),(0,a.jsx)(T.cN,{children:(0,a.jsxs)(i.z,{className:"pt-6 pb-6 ".concat(_," bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white border-2 border-stone-100 shadow-sm rounded-xl hover:bg-stone-100 dark:hover:bg-neutral-900 dark:border-neutral-700"),onClick:()=>{er(e.data.slug,w),l(!1)},children:[(0,a.jsx)(p.g,{className:"w-6 h-6 m-2 ".concat((0,P.oz)(e.data.color))}),"Start Chatting"]})})]})]})})}),(0,a.jsx)(S.aY,{children:(0,a.jsx)("div",{className:r().agentPersonality,children:(0,a.jsx)("button",{className:"".concat(r().infoButton," text-neutral-500 dark:text-white"),onClick:()=>l(!0),children:(0,a.jsx)("p",{children:e.data.persona})})})}),(0,a.jsx)(S.eW,{children:(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:C()})})]})}function ec(e){let[t,s]=(0,n.useState)(!1),l=(0,V.BI)(),r=P.xF,o=(0,P.oz)(e.form.getValues("color")),[c,d]=(0,n.useState)(!1),[u,m]=(0,n.useState)(null),[h,x]=(0,n.useState)(null),[f,p]=(0,n.useState)(!1),[z,S]=(0,n.useState)(0),[T,I]=(0,n.useState)([]),[q,F]=(0,n.useState)([]),[J,M]=(0,n.useState)(0),[Q,U]=(0,n.useState)(!1),H=["public","private","protected"],er=[{fields:[{name:"name",label:"Name"},{name:"persona",label:"Personality"},{name:"color",label:"Color"},{name:"icon",label:"Icon"}],label:"1. Basic Settings",tabName:"basic"},{fields:[{name:"chat_model",label:"Chat Model"},{name:"privacy_level",label:"Privacy Level"}],label:"2. Model & Privacy",tabName:"customize"},{fields:[{name:"files",label:"Knowledge Base"}],label:"3. Knowledge Base",tabName:"knowledge"},{fields:[{name:"input_tools",label:"Input Tools"},{name:"output_modes",label:"Output Modes"}],label:"4. Tools",tabName:"tools"}],en=(0,n.useRef)(null);function eo(e){e.preventDefault(),d(!0)}function ec(e){e.preventDefault(),d(!1)}function ed(e){e.preventDefault(),d(!1),e.dataTransfer.files&&eu(e.dataTransfer.files)}function eu(e){(0,G.ko)(e,m,p,x,I)}function em(){en&&en.current&&en.current.click()}function eh(e){e.target.files&&eu(e.target.files)}(0,n.useEffect)(()=>{if(f||S(0),f){let e=setInterval(()=>{S(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[f]),(0,n.useEffect)(()=>{F(Array.from(new Set([...q,...e.form.getValues("files")||[],...e.filesOptions||[]])))},[]),(0,n.useEffect)(()=>{T.length>0&&(ef(T),F(e=>[...e,...T]))},[T]),(0,n.useEffect)(()=>{e.errors&&s(!1)},[e.errors]);let ex=t=>{console.log("Submitting",t),e.onSubmit(t),s(!0)},ef=t=>{for(let s of t){let t=e.form.getValues("files")||[],a=t.includes(s)?t.filter(e=>e!==s):[...t,s];e.form.setValue("files",a)}},ep=t=>{try{return ei.parse(e.form.getValues()),!0}catch(s){let e=s.errors.reduce((e,t)=>(e[t.path[0]]=t.message,e),{});for(let s of t.fields)if(e[s.name])return!1;return!0}};if(Q)return(0,a.jsx)(K.aR,{open:!0,children:(0,a.jsxs)(K._T,{children:[(0,a.jsx)(K.fY,{children:(0,a.jsx)(K.f$,{children:"Upgrade to Futurist"})}),(0,a.jsxs)(K.yT,{children:["You need to be a Futurist subscriber to create more agents."," ",(0,a.jsx)("a",{href:"/settings",children:"Upgrade now"}),"."]}),(0,a.jsxs)(K.xo,{children:[(0,a.jsx)(K.le,{onClick:()=>{U(!1)},children:"Cancel"}),(0,a.jsx)(K.OL,{onClick:()=>{window.location.href="/settings"},children:"Continue"})]})]})});let ej=t=>{switch(t){case"name":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"name",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-0 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Name"}),(0,a.jsx)(R.pf,{children:"What should this agent be called? Pick something descriptive & memorable."}),(0,a.jsx)(R.NI,{children:(0,a.jsx)(B.I,{className:"dark:bg-muted",placeholder:"Biologist",...t})}),(0,a.jsx)(R.zG,{})]})}},t);case"chat_model":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"chat_model",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"my-2 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Chat Model"}),(0,a.jsx)(R.pf,{children:e.isSubscribed?(0,a.jsx)("p",{children:"Which chat model would you like to use?"}):(0,a.jsxs)("p",{className:"text-secondary-foreground",children:["Upgrade to the ",(0,a.jsx)("a",{href:"/settings",children:"Futurist plan"})," to access all models."]})}),(0,a.jsxs)(E.Ph,{onValueChange:s.onChange,defaultValue:s.value,disabled:!e.isSubscribed,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(E.i4,{className:"text-left dark:bg-muted",children:(0,a.jsx)(E.ki,{})})}),(0,a.jsx)(E.Bw,{className:"items-start space-y-1 inline-flex flex-col",children:e.modelOptions.map(e=>(0,a.jsx)(E.Ql,{value:e.name,children:(0,a.jsx)("div",{className:"flex items-center space-x-2",children:e.name})},e.id))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"privacy_level":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"privacy_level",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"my-2 grid gap-2",children:[(0,a.jsx)(R.lX,{children:(0,a.jsx)("div",{children:"Privacy Level"})}),(0,a.jsx)(R.pf,{children:(0,a.jsxs)($.J2,{children:[(0,a.jsx)($.xo,{asChild:!0,children:(0,a.jsx)(i.z,{variant:"ghost",className:"p-0 h-fit",children:(0,a.jsxs)("span",{className:"items-center flex gap-1 text-sm",children:[(0,a.jsx)(j.k,{className:"inline"}),(0,a.jsx)("p",{className:"text-sm",children:"Learn more"})]})})}),(0,a.jsxs)($.yk,{children:[(0,a.jsx)("b",{children:"Private"}),": only visible to you.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Protected"}),": visible to anyone with a link.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Public"}),": visible to everyone.",(0,a.jsx)("br",{}),"All public agents will be reviewed by us before they are launched."]})]})}),(0,a.jsxs)(E.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(E.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(E.ki,{placeholder:"private"})})}),(0,a.jsx)(E.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:H.map(e=>(0,a.jsx)(E.Ql,{value:e,children:(0,a.jsx)("div",{className:"flex items-center space-x-2",children:e})},e))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"color":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"color",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-3 my-2",children:[(0,a.jsx)(R.lX,{children:"Color"}),(0,a.jsxs)(E.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(E.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(E.ki,{placeholder:"Color"})})}),(0,a.jsx)(E.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:r.map(e=>(0,a.jsx)(E.Ql,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(g.C,{className:"w-6 h-6 mr-2 ".concat((0,P.oz)(e)),weight:"fill"}),e]})},e))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"icon":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"icon",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"space-y-3 my-2",children:[(0,a.jsx)(R.lX,{children:"Icon"}),(0,a.jsxs)(E.Ph,{onValueChange:s.onChange,defaultValue:s.value,children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(E.i4,{className:"w-[200px] dark:bg-muted",children:(0,a.jsx)(E.ki,{placeholder:"Icon"})})}),(0,a.jsx)(E.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:l.map(t=>(0,a.jsx)(E.Ql,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.TI)(t,e.form.getValues("color"),"w-6","h-6"),t]})},t))})]}),(0,a.jsx)(R.zG,{})]})}},t);case"persona":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"persona",render:e=>{let{field:t}=e;return(0,a.jsxs)(R.xJ,{className:"space-y-1 my-2 grid gap-2",children:[(0,a.jsx)(R.lX,{children:"Personality"}),(0,a.jsx)(R.pf,{children:"What is the personality, thought process, or tuning of this agent? This is where you can provide any instructions to the agent."}),(0,a.jsx)(R.NI,{children:(0,a.jsx)(W.g,{className:"dark:bg-muted focus:outline-none focus-visible:border-orange-500 focus-visible:border-2",placeholder:"You are an excellent biologist, at the top of your field in marine biology.",...t})}),(0,a.jsx)(R.zG,{})]})}},t);case"files":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"files",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"my-2 flex flex-col gap-2",children:[(0,a.jsx)(R.lX,{children:"Knowledge Base"}),(0,a.jsxs)(R.pf,{children:["Which information should be part of its digital brain?"," ",(0,a.jsx)("a",{href:"/settings",children:"Manage data"}),"."]}),(0,a.jsxs)(A,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," files selected"):"Select files"]}),(0,a.jsx)(Z,{className:"m-1",children:(0,a.jsxs)(Y.mY,{children:[(0,a.jsx)(K.aR,{open:null!==u||null!=h,children:(0,a.jsxs)(K._T,{children:[(0,a.jsx)(K.fY,{children:(0,a.jsx)(K.f$,{children:"Alert"})}),(0,a.jsx)(K.yT,{children:u||h}),(0,a.jsx)(K.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{m(null),x(null),p(!1)},children:"Close"})]})}),(0,a.jsxs)("div",{className:"flex flex-col h-full cursor-pointer",onDragOver:eo,onDragLeave:ec,onDrop:ed,onClick:em,children:[(0,a.jsx)("input",{type:"file",multiple:!0,ref:en,style:{display:"none"},onChange:eh}),(0,a.jsx)("div",{className:"flex-none p-4",children:f&&(0,a.jsx)(L.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:z})}),(0,a.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(c?"animate-pulse":""," rounded-lg"),children:(0,a.jsx)("div",{className:"flex items-center justify-center w-full h-16 border-2 border-dashed border-gray-300 rounded-lg",children:c?(0,a.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,a.jsx)(b.u,{className:"h-6 w-6 mr-2"}),(0,a.jsx)("span",{children:"Drop files to upload"})]}):(0,a.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,a.jsx)(N.v,{className:"h-6 w-6 mr-2"}),(0,a.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,a.jsx)(Y.sZ,{placeholder:"Select files..."}),(0,a.jsxs)(Y.e8,{children:[(0,a.jsx)(Y.rb,{children:"No files found."}),(0,a.jsx)(Y.fu,{children:q.map(t=>(0,a.jsxs)(Y.di,{value:t,className:"break-all",onSelect:()=>{let s=e.form.getValues("files")||[],a=s.includes(t)?s.filter(e=>e!==t):[...s,t];e.form.setValue("files",a)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(t)?"opacity-100":"opacity-0")}),t]},t))})]})]})})]})]})}},t);case"input_tools":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"input_tools",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"flex flex-col gap-2 my-2",children:[(0,a.jsx)(R.lX,{children:"Restrict Input Tools"}),(0,a.jsxs)(R.pf,{children:["Which knowledge retrieval tools should this agent be limited to?",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Default:"})," No limitations."]}),(0,a.jsxs)(A,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," tools selected"):"All tools"]}),(0,a.jsx)(Z,{children:(0,a.jsx)(Y.mY,{children:(0,a.jsx)(Y.e8,{children:(0,a.jsx)(Y.fu,{children:Object.entries(e.inputToolOptions).map(t=>{let[l,r]=t;return(0,a.jsxs)(Y.di,{value:l,onSelect:()=>{let t=e.form.getValues("input_tools")||[],s=t.includes(l)?t.filter(e=>e!==l):[...t,l];e.form.setValue("input_tools",s)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(l)?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:(0,X.cn)("flex items-center space-x-2"),children:[(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:l})}),(0,a.jsx)("p",{children:r})]})]},l)})})})})})]})]})}},t);case"output_modes":return(0,a.jsx)(R.Wi,{control:e.form.control,name:"output_modes",render:t=>{let{field:s}=t;return(0,a.jsxs)(R.xJ,{className:"flex flex-col gap-2 my-2",children:[(0,a.jsx)(R.lX,{children:"Restrict Output Modes"}),(0,a.jsxs)(R.pf,{children:["Which output modes should this agent be limited to?",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Default:"})," No limitations."]}),(0,a.jsxs)(A,{children:[(0,a.jsxs)(D,{className:"flex items-center justify-between text-sm gap-2 bg-muted p-2 rounded-lg",children:[(0,a.jsx)(v.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," modes selected"):"All modes"]}),(0,a.jsx)(Z,{children:(0,a.jsx)(Y.mY,{children:(0,a.jsx)(Y.e8,{children:(0,a.jsx)(Y.fu,{children:Object.entries(e.outputModeOptions).map(t=>{let[l,r]=t;return(0,a.jsxs)(Y.di,{value:l,onSelect:()=>{let t=e.form.getValues("output_modes")||[],s=t.includes(l)?t.filter(e=>e!==l):[...t,l];e.form.setValue("output_modes",s)},children:[(0,a.jsx)(y.J,{className:(0,X.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(l)?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:(0,X.cn)("flex items-center space-x-2"),children:[(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:l})}),(0,a.jsx)("p",{children:r})]})]},l)})})})})})]})]})}},t);default:return null}};return(0,a.jsxs)(R.l0,{...e.form,children:[(0,a.jsx)(el.x,{className:"h-full",children:(0,a.jsxs)("form",{onSubmit:e.form.handleSubmit(ex),className:"space-y-6 pb-4 px-4 h-full flex flex-col justify-between",children:[(0,a.jsxs)(ee,{defaultValue:"basic",value:er[J].tabName,children:[(0,a.jsx)(et,{className:"grid grid-cols-2 md:grid-cols-4 gap-2 h-fit",children:er.map(e=>(0,a.jsxs)(es,{value:e.tabName,className:"text-center ".concat(ep(e)?"":"text-red-500"),onClick:()=>M(er.findIndex(t=>t.tabName===e.tabName)),children:[e.label," ",!ep(e)&&"*"]},e.tabName))}),er.map(e=>(0,a.jsx)(ea,{value:e.tabName,children:e.fields.map(e=>ej(e.name))},e.tabName))]}),e.errors&&(0,a.jsx)(O.bZ,{className:"bg-secondary border-none my-4",children:(0,a.jsxs)(O.X,{className:"flex items-center gap-1",children:[(0,a.jsx)(w.f,{weight:"fill",className:"h-4 w-4 text-yellow-400 inline"}),(0,a.jsx)("span",{children:e.errors})]})})]})}),(0,a.jsxs)("div",{className:"flex justify-between mt-1 left-0 right-0 bg-background p-1",children:[(0,a.jsxs)(i.z,{type:"button",variant:"outline",onClick:e=>{e.preventDefault(),J>0&&M(J-1)},disabled:0===J,className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:[(0,a.jsx)(k.X,{className:"mr-2 h-4 w-4"}),"Previous"]}),J<er.length-1?(0,a.jsxs)(i.z,{type:"button",variant:"outline",onClick:e=>{e.preventDefault(),J<er.length-1&&M(J+1)},disabled:!ep(er[J]),className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:["Continue",(0,a.jsx)(_.o,{className:"ml-2 h-4 w-4"})]}):(0,a.jsxs)(i.z,{type:"submit",variant:"outline",disabled:t,onClick:e.form.handleSubmit(ex),className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(o),children:[(0,a.jsx)(C.B,{className:"h-4 w-4 mr-2"}),t?"Booting...":"Save"]})]})]})}},97673:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var a=s(57437),l=s(26110),r=s(62869),n=s(95186),i=s(26815),o=s(92457);function c(e){var t;return(0,a.jsxs)(l.Vq,{children:[(0,a.jsx)(l.hg,{asChild:!0,onClick:e.onShare,children:(0,a.jsxs)(r.z,{size:"sm",className:"".concat(e.buttonClassName||"px-3"),variant:null!==(t=e.buttonVariant)&&void 0!==t?t:"default",children:[e.includeIcon&&(0,a.jsx)(o.m,{className:"w-4 h-4 mr-2"}),e.buttonTitle]})}),(0,a.jsxs)(l.cZ,{children:[(0,a.jsxs)(l.fK,{children:[(0,a.jsx)(l.$N,{children:e.title}),(0,a.jsx)(l.Be,{children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)("div",{className:"grid flex-1 gap-2",children:[(0,a.jsx)(i._,{htmlFor:"link",className:"sr-only",children:"Link"}),(0,a.jsx)(n.I,{id:"link",defaultValue:e.url,readOnly:!0})]}),(0,a.jsx)(r.z,{type:"submit",size:"sm",className:"px-3",onClick:()=>(function(e){let t=navigator.clipboard;t&&t.writeText(e)})(e.url),children:(0,a.jsx)("span",{children:"Copy"})})]})]})]})}},65613:function(e,t,s){"use strict";s.d(t,{X:function(){return c},bZ:function(){return o}});var a=s(57437),l=s(2265),r=s(90535),n=s(94508);let i=(0,r.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),o=l.forwardRef((e,t)=>{let{className:s,variant:l,...r}=e;return(0,a.jsx)("div",{ref:t,role:"alert",className:(0,n.cn)(i({variant:l}),s),...r})});o.displayName="Alert",l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)("h5",{ref:t,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",s),...l})}).displayName="AlertTitle";let c=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",s),...l})});c.displayName="AlertDescription"},15681:function(e,t,s){"use strict";s.d(t,{NI:function(){return p},Wi:function(){return u},l0:function(){return c},lX:function(){return f},pf:function(){return j},xJ:function(){return x},zG:function(){return g}});var a=s(57437),l=s(2265),r=s(37053),n=s(29501),i=s(94508),o=s(26815);let c=n.RV,d=l.createContext({}),u=e=>{let{...t}=e;return(0,a.jsx)(d.Provider,{value:{name:t.name},children:(0,a.jsx)(n.Qr,{...t})})},m=()=>{let e=l.useContext(d),t=l.useContext(h),{getFieldState:s,formState:a}=(0,n.Gc)(),r=s(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...r}},h=l.createContext({}),x=l.forwardRef((e,t)=>{let{className:s,...r}=e,n=l.useId();return(0,a.jsx)(h.Provider,{value:{id:n},children:(0,a.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",s),...r})})});x.displayName="FormItem";let f=l.forwardRef((e,t)=>{let{className:s,...l}=e,{error:r,formItemId:n}=m();return(0,a.jsx)(o._,{ref:t,className:(0,i.cn)(r&&"text-destructive",s),htmlFor:n,...l})});f.displayName="FormLabel";let p=l.forwardRef((e,t)=>{let{...s}=e,{error:l,formItemId:n,formDescriptionId:i,formMessageId:o}=m();return(0,a.jsx)(r.g7,{ref:t,id:n,"aria-describedby":l?"".concat(i," ").concat(o):"".concat(i),"aria-invalid":!!l,...s})});p.displayName="FormControl";let j=l.forwardRef((e,t)=>{let{className:s,...l}=e,{formDescriptionId:r}=m();return(0,a.jsx)("p",{ref:t,id:r,className:(0,i.cn)("text-sm text-muted-foreground",s),...l})});j.displayName="FormDescription";let g=l.forwardRef((e,t)=>{let{className:s,children:l,...r}=e,{error:n,formMessageId:o}=m(),c=n?String(null==n?void 0:n.message):l;return c?(0,a.jsx)("p",{ref:t,id:o,className:(0,i.cn)("text-sm font-medium text-destructive",s),...r,children:c}):null});g.displayName="FormMessage"},26815:function(e,t,s){"use strict";s.d(t,{_:function(){return c}});var a=s(57437),l=s(2265),r=s(6394),n=s(90535),i=s(94508);let o=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.f,{ref:t,className:(0,i.cn)(o(),s),...l})});c.displayName=r.f.displayName},53647:function(e,t,s){"use strict";s.d(t,{Bw:function(){return f},Ph:function(){return d},Ql:function(){return p},i4:function(){return m},ki:function(){return u}});var a=s(57437),l=s(2265),r=s(56873),n=s(40875),i=s(22135),o=s(30401),c=s(94508);let d=r.fC;r.ZA;let u=r.B4,m=l.forwardRef((e,t)=>{let{className:s,children:l,...i}=e;return(0,a.jsxs)(r.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...i,children:[l,(0,a.jsx)(r.JO,{asChild:!0,children:(0,a.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=r.xz.displayName;let h=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...l,children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})});h.displayName=r.u_.displayName;let x=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...l,children:(0,a.jsx)(n.Z,{className:"h-4 w-4"})})});x.displayName=r.$G.displayName;let f=l.forwardRef((e,t)=>{let{className:s,children:l,position:n="popper",...i}=e;return(0,a.jsx)(r.h_,{children:(0,a.jsxs)(r.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...i,children:[(0,a.jsx)(h,{}),(0,a.jsx)(r.l_,{className:(0,c.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:l}),(0,a.jsx)(x,{})]})})});f.displayName=r.VY.displayName,l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...l})}).displayName=r.__.displayName;let p=l.forwardRef((e,t)=>{let{className:s,children:l,...n}=e;return(0,a.jsxs)(r.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(r.wU,{children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(r.eT,{children:l})]})});p.displayName=r.ck.displayName,l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(r.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",s),...l})}).displayName=r.Z0.displayName},71159:function(e){e.exports={agentPersonality:"agentCard_agentPersonality__MmRlN",infoButton:"agentCard_infoButton__heh_w"}}}]);
|
khoj/interface/compiled/_next/static/chunks/{6434.e6cd986d690f2cef.js → 6434.7afea9648e238ad5.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6434],{56434:function(e,n,t){t.d(n,{bK:function(){return e4}});var r,o=t(81585),i=t(36720),u=0,a=function(e){var n=++u;return(0,i.Z)(e)+n},s=t(86620),d=t(85765),h=t(68692),c=Math.ceil,f=Math.max,l=function(e,n,t,r){for(var o=-1,i=f(c((n-e)/(t||1)),0),u=Array(i);i--;)u[r?i:++o]=e,e+=t;return u},g=t(2864),v=t(30898),p=function(e,n,t){return t&&"number"!=typeof t&&(0,g.Z)(e,n,t)&&(n=t=void 0),e=(0,v.Z)(e),void 0===n?(n=e,e=0):n=(0,v.Z)(n),t=void 0===t?e<n?1:-1:(0,v.Z)(t),l(e,n,t,void 0)},Z=t(68406);class b{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return w(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&w(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,t=n._prev;t!==n;)e.push(JSON.stringify(t,m)),t=t._prev;return"["+e.join(", ")+"]"}}function w(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function m(e,n){if("_next"!==e&&"_prev"!==e)return n}var y=s.Z(1);function _(e,n,t,r,i){var u=i?[]:void 0;return o.Z(e.inEdges(r.v),function(r){var o=e.edge(r),a=e.node(r.v);i&&u.push({v:r.v,w:r.w}),a.out-=o,E(n,t,a)}),o.Z(e.outEdges(r.v),function(r){var o=e.edge(r),i=r.w,u=e.node(i);u.in-=o,E(n,t,u)}),e.removeNode(r.v),u}function E(e,n,t){t.out?t.in?e[t.out-t.in+n].enqueue(t):e[e.length-1].enqueue(t):e[0].enqueue(t)}var k=t(15066),x=t(76834),O=t(95222),N=t(27701),P=t(16700),j=(r=function(e,n){return null==e?{}:(0,x.Z)(e,n,function(n,t){return(0,O.Z)(e,t)})},(0,P.Z)((0,N.Z)(r,void 0,d.Z),r+"")),C=t(37340),I=t(81496),L=function(e,n){return e>n},M=t(20937),R=function(e){return e&&e.length?(0,I.Z)(e,M.Z,L):void 0},T=t(1848),F=t(80101),D=t(2369),S=t(18856),G=function(e,n){var t={};return n=(0,S.Z)(n,3),(0,D.Z)(e,function(e,r,o){(0,F.Z)(t,r,n(e,r,o))}),t},V=t(87826),B=t(58271),q=t(12937),Y=t(65933),z=function(){return Y.Z.Date.now()};function A(e,n,t,r){var o;do o=a(r);while(e.hasNode(o));return t.dummy=n,e.setNode(o,t),o}function $(e){var n=new Z.k({multigraph:e.isMultigraph()}).setGraph(e.graph());return o.Z(e.nodes(),function(t){e.children(t).length||n.setNode(t,e.node(t))}),o.Z(e.edges(),function(t){n.setEdge(t,e.edge(t))}),n}function J(e,n){var t,r,o=e.x,i=e.y,u=n.x-o,a=n.y-i,s=e.width/2,d=e.height/2;if(!u&&!a)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*s>Math.abs(u)*d?(a<0&&(d=-d),t=d*u/a,r=d):(u<0&&(s=-s),t=s,r=s*a/u),{x:o+t,y:i+r}}function K(e){var n=h.Z(p(Q(e)+1),function(){return[]});return o.Z(e.nodes(),function(t){var r=e.node(t),o=r.rank;V.Z(o)||(n[o][r.order]=t)}),n}function H(e,n,t,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=r),A(e,"border",o,n)}function Q(e){return R(h.Z(e.nodes(),function(n){var t=e.node(n).rank;if(!V.Z(t))return t}))}function U(e,n){var t=z();try{return n()}finally{console.log(e+" time: "+(z()-t)+"ms")}}function W(e,n){return n()}function X(e,n,t,r,o,i){var u=o[n][i-1],a=A(e,"border",{width:0,height:0,rank:i,borderType:n},t);o[n][i]=a,e.setParent(a,r),u&&e.setEdge(u,a,{weight:1})}function ee(e){o.Z(e.nodes(),function(n){en(e.node(n))}),o.Z(e.edges(),function(n){en(e.edge(n))})}function en(e){var n=e.width;e.width=e.height,e.height=n}function et(e){e.y=-e.y}function er(e){var n=e.x;e.x=e.y,e.y=n}var eo=t(24639),ei=function(e,n){return e&&e.length?(0,I.Z)(e,(0,S.Z)(n,2),eo.Z):void 0};function eu(e){var n={};o.Z(e.sources(),function t(r){var o=e.node(r);if(Object.prototype.hasOwnProperty.call(n,r))return o.rank;n[r]=!0;var i=B.Z(h.Z(e.outEdges(r),function(n){return t(n.w)-e.edge(n).minlen}));return(i===Number.POSITIVE_INFINITY||null==i)&&(i=0),o.rank=i})}function ea(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function es(e){var n,t,r=new Z.k({directed:!1}),i=e.nodes()[0],u=e.nodeCount();for(r.setNode(i,{});o.Z(r.nodes(),function n(t){o.Z(e.nodeEdges(t),function(o){var i=o.v,u=t===i?o.w:i;r.hasNode(u)||ea(e,o)||(r.setNode(u,{}),r.setEdge(t,u,{}),n(u))})}),r.nodeCount()<u;)n=function(e,n){return ei(n.edges(),function(t){if(e.hasNode(t.v)!==e.hasNode(t.w))return ea(n,t)})}(r,e),t=r.hasNode(n.v)?ea(e,n):-ea(e,n),function(e,n,t){o.Z(e.nodes(),function(e){n.node(e).rank+=t})}(r,e,t);return r}var ed=t(23969),eh=t(52422);s.Z(1),s.Z(1);var ec=t(35400),ef=t(68748),el=t(82025),eg=t(2564),ev=(0,t(62838).Z)("length"),ep=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),eZ="\ud800-\udfff",eb="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ew="\ud83c[\udffb-\udfff]",em="[^"+eZ+"]",ey="(?:\ud83c[\udde6-\uddff]){2}",e_="[\ud800-\udbff][\udc00-\udfff]",eE="(?:"+eb+"|"+ew+")?",ek="[\\ufe0e\\ufe0f]?",ex="(?:\\u200d(?:"+[em,ey,e_].join("|")+")"+ek+eE+")*",eO=RegExp(ew+"(?="+ew+")|(?:"+[em+eb+"?",eb,ey,e_,"["+eZ+"]"].join("|")+")"+(ek+eE+ex),"g"),eN=function(e){for(var n=eO.lastIndex=0;eO.test(e);)++n;return n};Error();var eP=t(28070);function ej(e,n,t){eP.Z(n)||(n=[n]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],u={};return o.Z(n,function(n){if(!e.hasNode(n))throw Error("Graph does not have node: "+n);(function e(n,t,r,i,u,a){!Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=!0,r||a.push(t),o.Z(u(t),function(t){e(n,t,r,i,u,a)}),r&&a.push(t))})(e,n,"post"===t,u,r,i)}),i}function eC(e){n=e,t=new Z.k().setGraph(n.graph()),o.Z(n.nodes(),function(e){t.setNode(e,n.node(e))}),o.Z(n.edges(),function(e){var r=t.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);t.setEdge(e.v,e.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),eu(e=t);var n,t,r,i,u=es(e);for(eM(u),eI(u,e);r=eR(u);)i=eT(u,e,r),eF(u,e,r,i)}function eI(e,n){var t=ej(e,e.nodes(),"post");t=t.slice(0,t.length-1),o.Z(t,function(t){var r;r=e.node(t).parent,e.edge(t,r).cutvalue=eL(e,n,t)})}function eL(e,n,t){var r=e.node(t).parent,i=!0,u=n.edge(t,r),a=0;return u||(i=!1,u=n.edge(r,t)),a=u.weight,o.Z(n.nodeEdges(t),function(o){var u=o.v===t,s=u?o.w:o.v;if(s!==r){var d=u===i,h=n.edge(o).weight;if(a+=d?h:-h,e.hasEdge(t,s)){var c=e.edge(t,s).cutvalue;a+=d?-c:c}}}),a}function eM(e,n){arguments.length<2&&(n=e.nodes()[0]),function e(n,t,r,i,u){var a=r,s=n.node(i);return t[i]=!0,o.Z(n.neighbors(i),function(o){Object.prototype.hasOwnProperty.call(t,o)||(r=e(n,t,r,o,i))}),s.low=a,s.lim=r++,u?s.parent=u:delete s.parent,r}(e,{},1,n)}function eR(e){return ed.Z(e.edges(),function(n){return e.edge(n).cutvalue<0})}function eT(e,n,t){var r=t.v,o=t.w;n.hasEdge(r,o)||(r=t.w,o=t.v);var i=e.node(r),u=e.node(o),a=i,s=!1;return i.lim>u.lim&&(a=u,s=!0),ei(eh.Z(n.edges(),function(n){return s===eD(e,e.node(n.v),a)&&s!==eD(e,e.node(n.w),a)}),function(e){return ea(n,e)})}function eF(e,n,t,r){var i,u,a=t.v,s=t.w;e.removeEdge(a,s),e.setEdge(r.v,r.w,{}),eM(e),eI(e,n),i=ed.Z(e.nodes(),function(e){return!n.node(e).parent}),u=(u=ej(e,i,"pre")).slice(1),o.Z(u,function(t){var r=e.node(t).parent,o=n.edge(t,r),i=!1;o||(o=n.edge(r,t),i=!0),n.node(t).rank=n.node(r).rank+(i?o.minlen:-o.minlen)})}function eD(e,n,t){return t.low<=n.lim&&n.lim<=t.lim}t(35539),eC.initLowLimValues=eM,eC.initCutValues=eI,eC.calcCutValue=eL,eC.leaveEdge=eR,eC.enterEdge=eT,eC.exchangeEdges=eF;var eS=t(33625),eG=t(49579),eV=t(13606),eB=t(54646),eq=function(e,n,t){for(var r=-1,o=e.length,i=n.length,u={};++r<o;){var a=r<i?n[r]:void 0;t(u,e[r],a)}return u},eY=t(28491),ez=t(80659),eA=t(83613),e$=t(97064),eJ=function(e,n){var t=e.length;for(e.sort(n);t--;)e[t]=e[t].value;return e},eK=t(65832),eH=t(82245),eQ=function(e,n){if(e!==n){var t=void 0!==e,r=null===e,o=e==e,i=(0,eH.Z)(e),u=void 0!==n,a=null===n,s=n==n,d=(0,eH.Z)(n);if(!a&&!d&&!i&&e>n||i&&u&&s&&!a&&!d||r&&u&&s||!t&&s||!o)return 1;if(!r&&!i&&!d&&e<n||d&&t&&o&&!r&&!i||a&&t&&o||!u&&o||!s)return -1}return 0},eU=function(e,n,t){for(var r=-1,o=e.criteria,i=n.criteria,u=o.length,a=t.length;++r<u;){var s=eQ(o[r],i[r]);if(s){if(r>=a)return s;return s*("desc"==t[r]?-1:1)}}return e.index-n.index},eW=function(e,n,t){n=n.length?(0,ez.Z)(n,function(e){return(0,eP.Z)(e)?function(n){return(0,eA.Z)(n,1===e.length?e[0]:e)}:e}):[M.Z];var r=-1;return n=(0,ez.Z)(n,(0,eK.Z)(S.Z)),eJ((0,e$.Z)(e,function(e,t,o){return{criteria:(0,ez.Z)(n,function(n){return n(e)}),index:++r,value:e}}),function(e,n){return eU(e,n,t)})},eX=(0,t(30801).Z)(function(e,n){if(null==e)return[];var t=n.length;return t>1&&(0,g.Z)(e,n[0],n[1])?n=[]:t>2&&(0,g.Z)(n[0],n[1],n[2])&&(n=[n[0]]),eW(e,(0,eY.Z)(n,1),[])});function e0(e,n,t){for(var r;n.length&&(r=T.Z(n)).i<=t;)n.pop(),e.push(r.vs),t++;return t}function e1(e,n,t){return h.Z(n,function(n){var r,i;return r=function(e){for(var n;e.hasNode(n=a("_root")););return n}(e),i=new Z.k({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(n){return e.node(n)}),o.Z(e.nodes(),function(u){var a=e.node(u),s=e.parent(u);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(u),i.setParent(u,s||r),o.Z(e[t](u),function(n){var t=n.v===u?n.w:n.v,r=i.edge(t,u),o=V.Z(r)?0:r.weight;i.setEdge(t,u,{weight:e.edge(n).weight+o})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(u,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i})}function e2(e,n){o.Z(n,function(n){o.Z(n,function(n,t){e.node(n).order=t})})}var e8=t(45900),e3=t(19045),e6=t(49625);function e5(e,n,t){if(n>t){var r=n;n=t,t=r}var o=e[n];o||(e[n]=o={}),o[t]=!0}function e4(e,n){var t=n&&n.debugTiming?U:W;t("layout",()=>{var n=t(" buildLayoutGraph",()=>{var n,t;return n=new Z.k({multigraph:!0,compound:!0}),t=na(e.graph()),n.setGraph(k.Z({},e7,nu(t,e9),j(t,ne))),o.Z(e.nodes(),function(t){var r=na(e.node(t));n.setNode(t,C.Z(nu(r,nn),nt)),n.setParent(t,e.parent(t))}),o.Z(e.edges(),function(t){var r=na(e.edge(t));n.setEdge(t,k.Z({},no,nu(r,nr),j(r,ni)))}),n});t(" runLayout",()=>{t(" makeSpaceForEdgeLabels",()=>{var e;return e=n.graph(),void(e.ranksep/=2,o.Z(n.edges(),function(t){var r=n.edge(t);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}),t(" removeSelfEdges",()=>{o.Z(n.edges(),function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}})}),t(" acyclic",()=>{var e,t,r,i;return e="greedy"===n.graph().acyclicer?function(e,n){if(1>=e.nodeCount())return[];var t,r,i,u,a,s,c=(t=n||y,r=new Z.k,i=0,u=0,o.Z(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),o.Z(e.edges(),function(e){var n=r.edge(e.v,e.w)||0,o=t(e);r.setEdge(e.v,e.w,n+o),u=Math.max(u,r.node(e.v).out+=o),i=Math.max(i,r.node(e.w).in+=o)}),a=p(u+i+3).map(function(){return new b}),s=i+1,o.Z(r.nodes(),function(e){E(a,s,r.node(e))}),{graph:r,buckets:a,zeroIdx:s}),f=function(e,n,t){for(var r,o=[],i=n[n.length-1],u=n[0];e.nodeCount();){for(;r=u.dequeue();)_(e,n,t,r);for(;r=i.dequeue();)_(e,n,t,r);if(e.nodeCount()){for(var a=n.length-2;a>0;--a)if(r=n[a].dequeue()){o=o.concat(_(e,n,t,r,!0));break}}}return o}(c.graph,c.buckets,c.zeroIdx);return d.Z(h.Z(f,function(n){return e.outEdges(n.v,n.w)}))}(n,function(e){return n.edge(e).weight}):(t=[],r={},i={},o.Z(n.nodes(),function e(u){Object.prototype.hasOwnProperty.call(i,u)||(i[u]=!0,r[u]=!0,o.Z(n.outEdges(u),function(n){Object.prototype.hasOwnProperty.call(r,n.w)?t.push(n):e(n.w)}),delete r[u])}),t),void o.Z(e,function(e){var t=n.edge(e);n.removeEdge(e),t.forwardName=e.name,t.reversed=!0,n.setEdge(e.w,e.v,t,a("rev"))})}),t(" nestingGraph.run",()=>{var e,t,r,i,u;return e=A(n,"root",{},"_root"),u={},o.Z(n.children(),function(e){!function e(t,r){var i=n.children(t);i&&i.length&&o.Z(i,function(n){e(n,r+1)}),u[t]=r}(e,1)}),r=2*(t=R(eS.Z(u))-1)+1,n.graph().nestingRoot=e,o.Z(n.edges(),function(e){n.edge(e).minlen*=r}),i=eG.Z(n.edges(),function(e,t){return e+n.edge(t).weight},0)+1,void(o.Z(n.children(),function(a){(function e(n,t,r,i,u,a,s){var d=n.children(s);if(!d.length){s!==t&&n.setEdge(t,s,{weight:0,minlen:r});return}var h=H(n,"_bt"),c=H(n,"_bb"),f=n.node(s);n.setParent(h,s),f.borderTop=h,n.setParent(c,s),f.borderBottom=c,o.Z(d,function(o){e(n,t,r,i,u,a,o);var d=n.node(o),f=d.borderTop?d.borderTop:o,l=d.borderBottom?d.borderBottom:o,g=d.borderTop?i:2*i,v=f!==l?1:u-a[s]+1;n.setEdge(h,f,{weight:g,minlen:v,nestingEdge:!0}),n.setEdge(l,c,{weight:g,minlen:v,nestingEdge:!0})}),n.parent(s)||n.setEdge(t,h,{weight:0,minlen:u+a[s]})})(n,e,r,i,t,u,a)}),n.graph().nodeRankFactor=r)}),t(" rank",()=>(function(e){switch(e.graph().ranker){case"network-simplex":default:eC(e);break;case"tight-tree":eu(e),es(e);break;case"longest-path":eu(e)}})($(n))),t(" injectEdgeLabelProxies",()=>{o.Z(n.edges(),function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),o={rank:(n.node(e.w).rank-r.rank)/2+r.rank,e:e};A(n,"edge-proxy",o,"_ep")}})}),t(" removeEmptyRanks",()=>{var e,t,r,i;return e=B.Z(h.Z(n.nodes(),function(e){return n.node(e).rank})),t=[],o.Z(n.nodes(),function(r){var o=n.node(r).rank-e;t[o]||(t[o]=[]),t[o].push(r)}),r=0,i=n.graph().nodeRankFactor,void o.Z(t,function(e,t){V.Z(e)&&t%i!=0?--r:r&&o.Z(e,function(e){n.node(e).rank+=r})})}),t(" nestingGraph.cleanup",()=>{var e;return e=n.graph(),void(n.removeNode(e.nestingRoot),delete e.nestingRoot,o.Z(n.edges(),function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}),t(" normalizeRanks",()=>{var e;return e=B.Z(h.Z(n.nodes(),function(e){return n.node(e).rank})),void o.Z(n.nodes(),function(t){var r=n.node(t);q.Z(r,"rank")&&(r.rank-=e)})}),t(" assignRankMinMax",()=>{var e;return e=0,void(o.Z(n.nodes(),function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=R(e,r.maxRank))}),n.graph().maxRank=e)}),t(" removeEdgeLabelProxies",()=>{o.Z(n.nodes(),function(e){var t=n.node(e);"edge-proxy"===t.dummy&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))})}),t(" normalize.run",()=>{n.graph().dummyChains=[],o.Z(n.edges(),function(e){(function(e,n){var t,r,o=n.v,i=e.node(o).rank,u=n.w,a=e.node(u).rank,s=n.name,d=e.edge(n),h=d.labelRank;if(a!==i+1){e.removeEdge(n);var c=void 0;for(r=0,++i;i<a;++r,++i)d.points=[],t=A(e,"edge",c={width:0,height:0,edgeLabel:d,edgeObj:n,rank:i},"_d"),i===h&&(c.width=d.width,c.height=d.height,c.dummy="edge-label",c.labelpos=d.labelpos),e.setEdge(o,t,{weight:d.weight},s),0===r&&e.graph().dummyChains.push(t),o=t;e.setEdge(o,u,{weight:d.weight},s)}})(n,e)})}),t(" parentDummyChains",()=>{var e,t;return e={},t=0,o.Z(n.children(),function r(i){var u=t;o.Z(n.children(i),r),e[i]={low:u,lim:t++}}),void o.Z(n.graph().dummyChains,function(t){for(var r=n.node(t),o=r.edgeObj,i=function(e,n,t,r){var o,i,u=[],a=[],s=Math.min(n[t].low,n[r].low),d=Math.max(n[t].lim,n[r].lim);o=t;do u.push(o=e.parent(o));while(o&&(n[o].low>s||d>n[o].lim));for(i=o,o=r;(o=e.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,e,o.v,o.w),u=i.path,a=i.lca,s=0,d=u[0],h=!0;t!==o.w;){if(r=n.node(t),h){for(;(d=u[s])!==a&&n.node(d).maxRank<r.rank;)s++;d===a&&(h=!1)}if(!h){for(;s<u.length-1&&n.node(d=u[s+1]).minRank<=r.rank;)s++;d=u[s]}n.setParent(t,d),t=n.successors(t)[0]}})}),t(" addBorderSegments",()=>{o.Z(n.children(),function e(t){var r=n.children(t),i=n.node(t);if(r.length&&o.Z(r,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var u=i.minRank,a=i.maxRank+1;u<a;++u)X(n,"borderLeft","_bl",t,i,u),X(n,"borderRight","_br",t,i,u)}})}),t(" order",()=>(function(e){var n=Q(e),t=e1(e,p(1,n+1),"inEdges"),r=e1(e,p(n-1,-1,-1),"outEdges"),i=(u={},a=eh.Z(e.nodes(),function(n){return!e.children(n).length}),s=R(h.Z(a,function(n){return e.node(n).rank})),c=h.Z(p(s+1),function(){return[]}),f=eX(a,function(n){return e.node(n).rank}),o.Z(f,function n(t){q.Z(u,t)||(u[t]=!0,c[e.node(t).rank].push(t),o.Z(e.successors(t),n))}),c);e2(e,i);for(var u,a,s,c,f,l,g=Number.POSITIVE_INFINITY,v=0,b=0;b<4;++v,++b){(function(e,n){var t=new Z.k;o.Z(e,function(e){var r,i,u,a=e.graph().root,s=function e(n,t,r,i){var u,a,s,c,f,l,g,v,p,Z,b,w=n.children(t),m=n.node(t),y=m?m.borderLeft:void 0,_=m?m.borderRight:void 0,E={};y&&(w=eh.Z(w,function(e){return e!==y&&e!==_}));var k=(u=w,h.Z(u,function(e){var t=n.inEdges(e);if(!t.length)return{v:e};var r=eG.Z(t,function(e,t){var r=n.edge(t),o=n.node(t.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}));o.Z(k,function(t){if(n.children(t.v).length){var o=e(n,t.v,r,i);E[t.v]=o,Object.prototype.hasOwnProperty.call(o,"barycenter")&&(V.Z(t.barycenter)?(t.barycenter=o.barycenter,t.weight=o.weight):(t.barycenter=(t.barycenter*t.weight+o.barycenter*o.weight)/(t.weight+o.weight),t.weight+=o.weight))}});var x=(a={},o.Z(k,function(e,n){var t=a[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};V.Z(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)}),o.Z(r.edges(),function(e){var n=a[e.v],t=a[e.w];V.Z(n)||V.Z(t)||(t.indegree++,n.out.push(a[e.w]))}),function(e){for(var n=[];e.length;){var t=e.pop();n.push(t),o.Z(t.in.reverse(),function(e){return function(n){!n.merged&&(V.Z(n.barycenter)||V.Z(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var t=0,r=0;e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=t/r,e.weight=r,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}(t)),o.Z(t.out,function(n){return function(t){t.in.push(n),0==--t.indegree&&e.push(t)}}(t))}return h.Z(eh.Z(n,function(e){return!e.merged}),function(e){return j(e,["vs","i","barycenter","weight"])})}(eh.Z(a,function(e){return!e.indegree})));(function(e,n){o.Z(e,function(e){e.vs=d.Z(e.vs.map(function(e){return n[e]?n[e].vs:e}))})})(x,E);var O=(f=(s=function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")},c={lhs:[],rhs:[]},o.Z(x,function(e){s(e)?c.lhs.push(e):c.rhs.push(e)}),c).lhs,l=eX(c.rhs,function(e){return-e.i}),g=[],v=0,p=0,Z=0,f.sort(function(e){return function(n,t){return n.barycenter<t.barycenter?-1:n.barycenter>t.barycenter?1:e?t.i-n.i:n.i-t.i}}(!!i)),Z=e0(g,l,Z),o.Z(f,function(e){Z+=e.vs.length,g.push(e.vs),v+=e.barycenter*e.weight,p+=e.weight,Z=e0(g,l,Z)}),b={vs:d.Z(g)},p&&(b.barycenter=v/p,b.weight=p),b);if(y&&(O.vs=d.Z([y,O.vs,_]),n.predecessors(y).length)){var N=n.node(n.predecessors(y)[0]),P=n.node(n.predecessors(_)[0]);Object.prototype.hasOwnProperty.call(O,"barycenter")||(O.barycenter=0,O.weight=0),O.barycenter=(O.barycenter*O.weight+N.order+P.order)/(O.weight+2),O.weight+=2}return O}(e,a,t,n);o.Z(s.vs,function(n,t){e.node(n).order=t}),r=s.vs,u={},o.Z(r,function(n){for(var r,o,a=e.parent(n);a;){if((r=e.parent(a))?(o=u[r],u[r]=a):(o=i,i=a),o&&o!==a){t.setEdge(o,a);return}a=r}})})})(v%2?t:r,v%4>=2),i=K(e);var w,m=function(e,n){for(var t=0,r=1;r<n.length;++r)t+=function(e,n,t){for(var r=eq(t||[],h.Z(t,function(e,n){return n})||[],eB.Z),i=d.Z(h.Z(n,function(n){return eX(h.Z(e.outEdges(n),function(n){return{pos:r[n.w],weight:e.edge(n).weight}}),"pos")})),u=1;u<t.length;)u<<=1;var a=2*u-1;u-=1;var s=h.Z(Array(a),function(){return 0}),c=0;return o.Z(i.forEach(function(e){var n=e.pos+u;s[n]+=e.weight;for(var t=0;n>0;)n%2&&(t+=s[n+1]),n=n-1>>1,s[n]+=e.weight;c+=e.weight*t})),c}(e,n[r-1],n[r]);return t}(e,i);m<g&&(b=0,w=i,l=(0,eV.Z)(w,5),g=m)}e2(e,l)})(n)),t(" insertSelfEdges",()=>{var e;return e=K(n),void o.Z(e,function(e){var t=0;o.Z(e,function(e,r){var i=n.node(e);i.order=r+t,o.Z(i.selfEdges,function(e){A(n,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++t,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}),t(" adjustCoordinateSystem",()=>{var e;("lr"===(e=n.graph().rankdir.toLowerCase())||"rl"===e)&&ee(n)}),t(" position",()=>{var e,t,r,i,u,a,s,d,c,f,l,g,v,b,w,m,y,_;m=K(w=e=$(e=n)),y=w.graph().ranksep,_=0,o.Z(m,function(e){var n=R(h.Z(e,function(e){return w.node(e).height}));o.Z(e,function(e){w.node(e).y=_+n/2}),_+=n+y}),i=K(t=e),a=k.Z((u={},eG.Z(i,function(e,n){var r=0,i=0,a=e.length,s=T.Z(n);return o.Z(n,function(e,d){var h=function(e,n){if(e.node(n).dummy)return ed.Z(e.predecessors(n),function(n){return e.node(n).dummy})}(t,e),c=h?t.node(h).order:a;(h||e===s)&&(o.Z(n.slice(i,d+1),function(e){o.Z(t.predecessors(e),function(n){var o=t.node(n),i=o.order;(i<r||c<i)&&!(o.dummy&&t.node(e).dummy)&&e5(u,n,e)})}),i=d+1,r=c)}),n}),u),function(e,n){var t={};function r(n,r,i,u,a){var s;o.Z(p(r,i),function(r){s=n[r],e.node(s).dummy&&o.Z(e.predecessors(s),function(n){var r=e.node(n);r.dummy&&(r.order<u||r.order>a)&&e5(t,n,s)})})}return eG.Z(n,function(n,t){var i,u=-1,a=0;return o.Z(t,function(o,s){if("border"===e.node(o).dummy){var d=e.predecessors(o);d.length&&(i=e.node(d[0]).order,r(t,a,s,u,i),a=s,u=i)}r(t,a,t.length,i,n.length)}),t}),t}(t,i)),s={},o.Z(["u","d"],function(e){r="u"===e?i:eS.Z(i).reverse(),o.Z(["l","r"],function(n){"r"===n&&(r=h.Z(r,function(e){return eS.Z(e).reverse()}));var i,u,d,c,f=("u"===e?t.predecessors:t.successors).bind(t),l=(i=r,u={},d={},c={},o.Z(i,function(e){o.Z(e,function(e,n){u[e]=e,d[e]=e,c[e]=n})}),o.Z(i,function(e){var n=-1;o.Z(e,function(e){var t=f(e);if(t.length)for(var r=((t=eX(t,function(e){return c[e]})).length-1)/2,o=Math.floor(r),i=Math.ceil(r);o<=i;++o){var s=t[o];d[e]===e&&n<c[s]&&!function(e,n,t){if(n>t){var r=n;n=t,t=r}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],t)}(a,e,s)&&(d[s]=e,d[e]=u[e]=u[s],n=c[s])}})}),{root:u,align:d}),g=function(e,n,t,r,i){var u,a,s,d,h,c={},f=(s=new Z.k,u=(d=e.graph()).nodesep,a=d.edgesep,h=function(e,n,t){var r,o,s=e.node(n),d=e.node(t);if(r=0+s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":o=-s.width/2;break;case"r":o=s.width/2}if(o&&(r+=i?o:-o),o=0,r+=(s.dummy?a:u)/2+(d.dummy?a:u)/2+d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":o=d.width/2;break;case"r":o=-d.width/2}return o&&(r+=i?o:-o),o=0,r},o.Z(n,function(n){var r;o.Z(n,function(n){var o=t[n];if(s.setNode(o),r){var i=t[r],u=s.edge(i,o);s.setEdge(i,o,Math.max(h(e,n,r),u||0))}r=n})}),s),l=i?"borderLeft":"borderRight";function g(e,n){for(var t=f.nodes(),r=t.pop(),o={};r;)o[r]?e(r):(o[r]=!0,t.push(r),t=t.concat(n(r))),r=t.pop()}return g(function(e){c[e]=f.inEdges(e).reduce(function(e,n){return Math.max(e,c[n.v]+f.edge(n))},0)},f.predecessors.bind(f)),g(function(n){var t=f.outEdges(n).reduce(function(e,n){return Math.min(e,c[n.w]-f.edge(n))},Number.POSITIVE_INFINITY),r=e.node(n);t!==Number.POSITIVE_INFINITY&&r.borderType!==l&&(c[n]=Math.max(c[n],t))},f.successors.bind(f)),o.Z(r,function(e){c[e]=c[t[e]]}),c}(t,r,l.root,l.align,"r"===n);"r"===n&&(g=G(g,function(e){return-e})),s[e+n]=g})}),d=ei(eS.Z(s),function(e){var n,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return n=function(e,n){var i=t.node(n).width/2;r=Math.max(e+i,r),o=Math.min(e-i,o)},null==e||(0,e3.Z)(e,(0,e8.Z)(n),e6.Z),r-o}),c=eS.Z(d),f=B.Z(c),l=R(c),o.Z(["u","d"],function(e){o.Z(["l","r"],function(n){var t,r=e+n,o=s[r];if(o!==d){var i=eS.Z(o);(t="l"===n?f-B.Z(i):l-R(i))&&(s[r]=G(o,function(e){return e+t}))}})}),g=t.graph().align,v=G(s.ul,function(e,n){if(g)return s[g.toLowerCase()][n];var t=eX(h.Z(s,n));return(t[1]+t[2])/2}),b=function(n,t){e.node(t).x=n},v&&(0,D.Z)(v,(0,e8.Z)(b))}),t(" positionSelfEdges",()=>{o.Z(n.nodes(),function(e){var t=n.node(e);if("selfedge"===t.dummy){var r=n.node(t.e.v),o=r.x+r.width/2,i=r.y,u=t.x-o,a=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),t.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],t.label.x=t.x,t.label.y=t.y}})}),t(" removeBorderNodes",()=>{o.Z(n.nodes(),function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),o=n.node(t.borderBottom),i=n.node(T.Z(t.borderLeft)),u=n.node(T.Z(t.borderRight));t.width=Math.abs(u.x-i.x),t.height=Math.abs(o.y-r.y),t.x=i.x+t.width/2,t.y=r.y+t.height/2}}),o.Z(n.nodes(),function(e){"border"===n.node(e).dummy&&n.removeNode(e)})}),t(" normalize.undo",()=>{o.Z(n.graph().dummyChains,function(e){var t,r=n.node(e),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)t=n.successors(e)[0],n.removeNode(e),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),e=t,r=n.node(e)})}),t(" fixupEdgeLabelCoords",()=>{o.Z(n.edges(),function(e){var t=n.edge(e);if(Object.prototype.hasOwnProperty.call(t,"x"))switch(("l"===t.labelpos||"r"===t.labelpos)&&(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}})}),t(" undoCoordinateSystem",()=>{var e;("bt"===(e=n.graph().rankdir.toLowerCase())||"rl"===e)&&(o.Z(n.nodes(),function(e){et(n.node(e))}),o.Z(n.edges(),function(e){var t=n.edge(e);o.Z(t.points,et),Object.prototype.hasOwnProperty.call(t,"y")&&et(t)})),("lr"===e||"rl"===e)&&(o.Z(n.nodes(),function(e){er(n.node(e))}),o.Z(n.edges(),function(e){var t=n.edge(e);o.Z(t.points,er),Object.prototype.hasOwnProperty.call(t,"x")&&er(t)}),ee(n))}),t(" translateGraph",()=>(function(e){var n=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,i=0,u=e.graph(),a=u.marginx||0,s=u.marginy||0;function d(e){var o=e.x,u=e.y,a=e.width,s=e.height;n=Math.min(n,o-a/2),t=Math.max(t,o+a/2),r=Math.min(r,u-s/2),i=Math.max(i,u+s/2)}o.Z(e.nodes(),function(n){d(e.node(n))}),o.Z(e.edges(),function(n){var t=e.edge(n);Object.prototype.hasOwnProperty.call(t,"x")&&d(t)}),n-=a,r-=s,o.Z(e.nodes(),function(t){var o=e.node(t);o.x-=n,o.y-=r}),o.Z(e.edges(),function(t){var i=e.edge(t);o.Z(i.points,function(e){e.x-=n,e.y-=r}),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=n),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=r)}),u.width=t-n+a,u.height=i-r+s})(n)),t(" assignNodeIntersects",()=>{o.Z(n.edges(),function(e){var t,r,o=n.edge(e),i=n.node(e.v),u=n.node(e.w);o.points?(t=o.points[0],r=o.points[o.points.length-1]):(o.points=[],t=u,r=i),o.points.unshift(J(i,t)),o.points.push(J(u,r))})}),t(" reversePoints",()=>{o.Z(n.edges(),function(e){var t=n.edge(e);t.reversed&&t.points.reverse()})}),t(" acyclic.undo",()=>{o.Z(n.edges(),function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}})})}),t(" updateInputGraph",()=>{o.Z(e.nodes(),function(t){var r=e.node(t),o=n.node(t);r&&(r.x=o.x,r.y=o.y,n.children(t).length&&(r.width=o.width,r.height=o.height))}),o.Z(e.edges(),function(t){var r=e.edge(t),o=n.edge(t);r.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(r.x=o.x,r.y=o.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height})})}var e9=["nodesep","edgesep","ranksep","marginx","marginy"],e7={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ne=["acyclicer","ranker","rankdir","align"],nn=["width","height"],nt={width:0,height:0},nr=["minlen","weight","width","height","labeloffset"],no={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ni=["labelpos"];function nu(e,n){return G(j(e,n),Number)}function na(e){var n={};return o.Z(e,function(e,t){n[t.toLowerCase()]=e}),n}},35539:function(e,n,t){t.d(n,{k:function(){return Z}});var r=t(86620),o=t(98402),i=t(47799),u=t(52422),a=t(45130),s=t(81585),d=t(87826),h=t(28491),c=t(30801),f=t(3394),l=t(38259),g=(0,c.Z)(function(e){return(0,f.Z)((0,h.Z)(e,1,l.Z,!0))}),v=t(33625),p=t(49579);class Z{constructor(e={}){this._isDirected=!Object.prototype.hasOwnProperty.call(e,"directed")||e.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.Z(void 0),this._defaultEdgeLabelFn=r.Z(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return o.Z(e)||(e=r.Z(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return i.Z(this._nodes)}sources(){var e=this;return u.Z(this.nodes(),function(n){return a.Z(e._in[n])})}sinks(){var e=this;return u.Z(this.nodes(),function(n){return a.Z(e._out[n])})}setNodes(e,n){var t=arguments,r=this;return s.Z(e,function(e){t.length>1?r.setNode(e,n):r.setNode(e)}),this}setNode(e,n){return Object.prototype.hasOwnProperty.call(this._nodes,e)?arguments.length>1&&(this._nodes[e]=n):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var n=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],s.Z(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),s.Z(i.Z(this._in[e]),n),delete this._in[e],delete this._preds[e],s.Z(i.Z(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,n){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(d.Z(n))n="\0";else{n+="";for(var t=n;!d.Z(t);t=this.parent(t))if(t===e)throw Error("Setting "+n+" as parent of "+e+" would create a cycle");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var n=this._parent[e];if("\0"!==n)return n}}children(e){if(d.Z(e)&&(e="\0"),this._isCompound){var n=this._children[e];if(n)return i.Z(n)}else if("\0"===e)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){var n=this._preds[e];if(n)return i.Z(n)}successors(e){var n=this._sucs[e];if(n)return i.Z(n)}neighbors(e){var n=this.predecessors(e);if(n)return g(n,this.successors(e))}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var t=this;s.Z(this._nodes,function(t,r){e(r)&&n.setNode(r,t)}),s.Z(this._edgeObjs,function(e){n.hasNode(e.v)&&n.hasNode(e.w)&&n.setEdge(e,t.edge(e))});var r={};return this._isCompound&&s.Z(n.nodes(),function(e){n.setParent(e,function e(o){var i=t.parent(o);return void 0===i||n.hasNode(i)?(r[o]=i,i):i in r?r[i]:e(i)}(e))}),n}setDefaultEdgeLabel(e){return o.Z(e)||(e=r.Z(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return v.Z(this._edgeObjs)}setPath(e,n){var t=this,r=arguments;return p.Z(e,function(e,o){return r.length>1?t.setEdge(e,o,n):t.setEdge(e,o),o}),this}setEdge(){var e,n,t,r,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,n=i.w,t=i.name,2==arguments.length&&(r=arguments[1],o=!0)):(e=i,n=arguments[1],t=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),e=""+e,n=""+n,d.Z(t)||(t=""+t);var u=m(this._isDirected,e,n,t);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,u))return o&&(this._edgeLabels[u]=r),this;if(!d.Z(t)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(n),this._edgeLabels[u]=o?r:this._defaultEdgeLabelFn(e,n,t);var a=function(e,n,t,r){var o=""+n,i=""+t;if(!e&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};return r&&(a.name=r),a}(this._isDirected,e,n,t);return e=a.v,n=a.w,Object.freeze(a),this._edgeObjs[u]=a,b(this._preds[n],e),b(this._sucs[e],n),this._in[n][u]=a,this._out[e][u]=a,this._edgeCount++,this}edge(e,n,t){var r=1==arguments.length?y(this._isDirected,arguments[0]):m(this._isDirected,e,n,t);return this._edgeLabels[r]}hasEdge(e,n,t){var r=1==arguments.length?y(this._isDirected,arguments[0]):m(this._isDirected,e,n,t);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,n,t){var r=1==arguments.length?y(this._isDirected,arguments[0]):m(this._isDirected,e,n,t),o=this._edgeObjs[r];return o&&(e=o.v,n=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],w(this._preds[n],e),w(this._sucs[e],n),delete this._in[n][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,n){var t=this._in[e];if(t){var r=v.Z(t);return n?u.Z(r,function(e){return e.v===n}):r}}outEdges(e,n){var t=this._out[e];if(t){var r=v.Z(t);return n?u.Z(r,function(e){return e.w===n}):r}}nodeEdges(e,n){var t=this.inEdges(e,n);if(t)return t.concat(this.outEdges(e,n))}}function b(e,n){e[n]?e[n]++:e[n]=1}function w(e,n){--e[n]||delete e[n]}function m(e,n,t,r){var o=""+n,i=""+t;if(!e&&o>i){var u=o;o=i,i=u}return o+"\x01"+i+"\x01"+(d.Z(r)?"\0":r)}function y(e,n){return m(e,n.v,n.w,n.name)}Z.prototype._nodeCount=0,Z.prototype._edgeCount=0},68406:function(e,n,t){t.d(n,{k:function(){return r.k}});var r=t(35539)},81496:function(e,n,t){var r=t(82245);n.Z=function(e,n,t){for(var o=-1,i=e.length;++o<i;){var u=e[o],a=n(u);if(null!=a&&(void 0===s?a==a&&!(0,r.Z)(a):t(a,s)))var s=a,d=u}return d}},24639:function(e,n){n.Z=function(e,n){return e<n}},97064:function(e,n,t){var r=t(50388),o=t(82025);n.Z=function(e,n){var t=-1,i=(0,o.Z)(e)?Array(e.length):[];return(0,r.Z)(e,function(e,r,o){i[++t]=n(e,r,o)}),i}},76834:function(e,n,t){t.d(n,{Z:function(){return h}});var r=t(83613),o=t(54646),i=t(87439),u=t(65482),a=t(7632),s=t(47373),d=function(e,n,t,r){if(!(0,a.Z)(e))return e;n=(0,i.Z)(n,e);for(var d=-1,h=n.length,c=h-1,f=e;null!=f&&++d<h;){var l=(0,s.Z)(n[d]),g=t;if("__proto__"===l||"constructor"===l||"prototype"===l)break;if(d!=c){var v=f[l];void 0===(g=r?r(v,l,f):void 0)&&(g=(0,a.Z)(v)?v:(0,u.Z)(n[d+1])?[]:{})}(0,o.Z)(f,l,g),f=f[l]}return e},h=function(e,n,t){for(var o=-1,u=n.length,a={};++o<u;){var s=n[o],h=(0,r.Z)(e,s);t(h,s)&&d(a,(0,i.Z)(s,e),h)}return a}},37340:function(e,n,t){var r=t(30801),o=t(84338),i=t(2864),u=t(49625),a=Object.prototype,s=a.hasOwnProperty,d=(0,r.Z)(function(e,n){e=Object(e);var t=-1,r=n.length,d=r>2?n[2]:void 0;for(d&&(0,i.Z)(n[0],n[1],d)&&(r=1);++t<r;)for(var h=n[t],c=(0,u.Z)(h),f=-1,l=c.length;++f<l;){var g=c[f],v=e[g];(void 0===v||(0,o.Z)(v,a[g])&&!s.call(e,g))&&(e[g]=h[g])}return e});n.Z=d},23969:function(e,n,t){t.d(n,{Z:function(){return h}});var r,o=t(18856),i=t(82025),u=t(47799),a=t(41764),s=t(75300),d=Math.max,h=(r=function(e,n,t){var r=null==e?0:e.length;if(!r)return -1;var i=null==t?0:(0,s.Z)(t);return i<0&&(i=d(r+i,0)),(0,a.Z)(e,(0,o.Z)(n,3),i)},function(e,n,t){var a=Object(e);if(!(0,i.Z)(e)){var s=(0,o.Z)(n,3);e=(0,u.Z)(e),n=function(e){return s(a[e],e,a)}}var d=r(e,n,t);return d>-1?a[s?e[d]:d]:void 0})},85765:function(e,n,t){var r=t(28491);n.Z=function(e){return(null==e?0:e.length)?(0,r.Z)(e,1):[]}},12937:function(e,n,t){t.d(n,{Z:function(){return u}});var r=Object.prototype.hasOwnProperty,o=function(e,n){return null!=e&&r.call(e,n)},i=t(93025),u=function(e,n){return null!=e&&(0,i.Z)(e,n,o)}},2564:function(e,n,t){var r=t(59576),o=t(28070),i=t(82370);n.Z=function(e){return"string"==typeof e||!(0,o.Z)(e)&&(0,i.Z)(e)&&"[object String]"==(0,r.Z)(e)}},1848:function(e,n){n.Z=function(e){var n=null==e?0:e.length;return n?e[n-1]:void 0}},68692:function(e,n,t){var r=t(80659),o=t(18856),i=t(97064),u=t(28070);n.Z=function(e,n){return((0,u.Z)(e)?r.Z:i.Z)(e,(0,o.Z)(n,3))}},58271:function(e,n,t){var r=t(81496),o=t(24639),i=t(20937);n.Z=function(e){return e&&e.length?(0,r.Z)(e,i.Z,o.Z):void 0}},30898:function(e,n,t){t.d(n,{Z:function(){return v}});var r=/\s/,o=function(e){for(var n=e.length;n--&&r.test(e.charAt(n)););return n},i=/^\s+/,u=t(7632),a=t(82245),s=0/0,d=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt,l=function(e){if("number"==typeof e)return e;if((0,a.Z)(e))return s;if((0,u.Z)(e)){var n,t="function"==typeof e.valueOf?e.valueOf():e;e=(0,u.Z)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=(n=e)?n.slice(0,o(n)+1).replace(i,""):n;var r=h.test(e);return r||c.test(e)?f(e.slice(2),r?2:8):d.test(e)?s:+e},g=1/0,v=function(e){return e?(e=l(e))===g||e===-g?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},75300:function(e,n,t){var r=t(30898);n.Z=function(e){var n=(0,r.Z)(e),t=n%1;return n==n?t?n-t:n:0}}}]);
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6434],{56434:function(e,n,t){t.d(n,{bK:function(){return e4}});var r,o=t(81585),i=t(58719),u=0,a=function(e){var n=++u;return(0,i.Z)(e)+n},s=t(86620),d=t(85765),h=t(68692),c=Math.ceil,f=Math.max,l=function(e,n,t,r){for(var o=-1,i=f(c((n-e)/(t||1)),0),u=Array(i);i--;)u[r?i:++o]=e,e+=t;return u},g=t(2864),v=t(30898),p=function(e,n,t){return t&&"number"!=typeof t&&(0,g.Z)(e,n,t)&&(n=t=void 0),e=(0,v.Z)(e),void 0===n?(n=e,e=0):n=(0,v.Z)(n),t=void 0===t?e<n?1:-1:(0,v.Z)(t),l(e,n,t,void 0)},Z=t(68406);class b{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return w(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&w(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,t=n._prev;t!==n;)e.push(JSON.stringify(t,m)),t=t._prev;return"["+e.join(", ")+"]"}}function w(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function m(e,n){if("_next"!==e&&"_prev"!==e)return n}var y=s.Z(1);function _(e,n,t,r,i){var u=i?[]:void 0;return o.Z(e.inEdges(r.v),function(r){var o=e.edge(r),a=e.node(r.v);i&&u.push({v:r.v,w:r.w}),a.out-=o,E(n,t,a)}),o.Z(e.outEdges(r.v),function(r){var o=e.edge(r),i=r.w,u=e.node(i);u.in-=o,E(n,t,u)}),e.removeNode(r.v),u}function E(e,n,t){t.out?t.in?e[t.out-t.in+n].enqueue(t):e[e.length-1].enqueue(t):e[0].enqueue(t)}var k=t(15066),x=t(76834),O=t(95222),N=t(27701),P=t(16700),j=(r=function(e,n){return null==e?{}:(0,x.Z)(e,n,function(n,t){return(0,O.Z)(e,t)})},(0,P.Z)((0,N.Z)(r,void 0,d.Z),r+"")),C=t(37340),I=t(81496),L=function(e,n){return e>n},M=t(20937),R=function(e){return e&&e.length?(0,I.Z)(e,M.Z,L):void 0},T=t(1848),F=t(80101),D=t(2369),S=t(18856),G=function(e,n){var t={};return n=(0,S.Z)(n,3),(0,D.Z)(e,function(e,r,o){(0,F.Z)(t,r,n(e,r,o))}),t},V=t(87826),B=t(58271),q=t(12937),Y=t(65933),z=function(){return Y.Z.Date.now()};function A(e,n,t,r){var o;do o=a(r);while(e.hasNode(o));return t.dummy=n,e.setNode(o,t),o}function $(e){var n=new Z.k({multigraph:e.isMultigraph()}).setGraph(e.graph());return o.Z(e.nodes(),function(t){e.children(t).length||n.setNode(t,e.node(t))}),o.Z(e.edges(),function(t){n.setEdge(t,e.edge(t))}),n}function J(e,n){var t,r,o=e.x,i=e.y,u=n.x-o,a=n.y-i,s=e.width/2,d=e.height/2;if(!u&&!a)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*s>Math.abs(u)*d?(a<0&&(d=-d),t=d*u/a,r=d):(u<0&&(s=-s),t=s,r=s*a/u),{x:o+t,y:i+r}}function K(e){var n=h.Z(p(Q(e)+1),function(){return[]});return o.Z(e.nodes(),function(t){var r=e.node(t),o=r.rank;V.Z(o)||(n[o][r.order]=t)}),n}function H(e,n,t,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=r),A(e,"border",o,n)}function Q(e){return R(h.Z(e.nodes(),function(n){var t=e.node(n).rank;if(!V.Z(t))return t}))}function U(e,n){var t=z();try{return n()}finally{console.log(e+" time: "+(z()-t)+"ms")}}function W(e,n){return n()}function X(e,n,t,r,o,i){var u=o[n][i-1],a=A(e,"border",{width:0,height:0,rank:i,borderType:n},t);o[n][i]=a,e.setParent(a,r),u&&e.setEdge(u,a,{weight:1})}function ee(e){o.Z(e.nodes(),function(n){en(e.node(n))}),o.Z(e.edges(),function(n){en(e.edge(n))})}function en(e){var n=e.width;e.width=e.height,e.height=n}function et(e){e.y=-e.y}function er(e){var n=e.x;e.x=e.y,e.y=n}var eo=t(24639),ei=function(e,n){return e&&e.length?(0,I.Z)(e,(0,S.Z)(n,2),eo.Z):void 0};function eu(e){var n={};o.Z(e.sources(),function t(r){var o=e.node(r);if(Object.prototype.hasOwnProperty.call(n,r))return o.rank;n[r]=!0;var i=B.Z(h.Z(e.outEdges(r),function(n){return t(n.w)-e.edge(n).minlen}));return(i===Number.POSITIVE_INFINITY||null==i)&&(i=0),o.rank=i})}function ea(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function es(e){var n,t,r=new Z.k({directed:!1}),i=e.nodes()[0],u=e.nodeCount();for(r.setNode(i,{});o.Z(r.nodes(),function n(t){o.Z(e.nodeEdges(t),function(o){var i=o.v,u=t===i?o.w:i;r.hasNode(u)||ea(e,o)||(r.setNode(u,{}),r.setEdge(t,u,{}),n(u))})}),r.nodeCount()<u;)n=function(e,n){return ei(n.edges(),function(t){if(e.hasNode(t.v)!==e.hasNode(t.w))return ea(n,t)})}(r,e),t=r.hasNode(n.v)?ea(e,n):-ea(e,n),function(e,n,t){o.Z(e.nodes(),function(e){n.node(e).rank+=t})}(r,e,t);return r}var ed=t(23969),eh=t(52422);s.Z(1),s.Z(1);var ec=t(35400),ef=t(68748),el=t(82025),eg=t(2564),ev=(0,t(62838).Z)("length"),ep=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),eZ="\ud800-\udfff",eb="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ew="\ud83c[\udffb-\udfff]",em="[^"+eZ+"]",ey="(?:\ud83c[\udde6-\uddff]){2}",e_="[\ud800-\udbff][\udc00-\udfff]",eE="(?:"+eb+"|"+ew+")?",ek="[\\ufe0e\\ufe0f]?",ex="(?:\\u200d(?:"+[em,ey,e_].join("|")+")"+ek+eE+")*",eO=RegExp(ew+"(?="+ew+")|(?:"+[em+eb+"?",eb,ey,e_,"["+eZ+"]"].join("|")+")"+(ek+eE+ex),"g"),eN=function(e){for(var n=eO.lastIndex=0;eO.test(e);)++n;return n};Error();var eP=t(28070);function ej(e,n,t){eP.Z(n)||(n=[n]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],u={};return o.Z(n,function(n){if(!e.hasNode(n))throw Error("Graph does not have node: "+n);(function e(n,t,r,i,u,a){!Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=!0,r||a.push(t),o.Z(u(t),function(t){e(n,t,r,i,u,a)}),r&&a.push(t))})(e,n,"post"===t,u,r,i)}),i}function eC(e){n=e,t=new Z.k().setGraph(n.graph()),o.Z(n.nodes(),function(e){t.setNode(e,n.node(e))}),o.Z(n.edges(),function(e){var r=t.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);t.setEdge(e.v,e.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),eu(e=t);var n,t,r,i,u=es(e);for(eM(u),eI(u,e);r=eR(u);)i=eT(u,e,r),eF(u,e,r,i)}function eI(e,n){var t=ej(e,e.nodes(),"post");t=t.slice(0,t.length-1),o.Z(t,function(t){var r;r=e.node(t).parent,e.edge(t,r).cutvalue=eL(e,n,t)})}function eL(e,n,t){var r=e.node(t).parent,i=!0,u=n.edge(t,r),a=0;return u||(i=!1,u=n.edge(r,t)),a=u.weight,o.Z(n.nodeEdges(t),function(o){var u=o.v===t,s=u?o.w:o.v;if(s!==r){var d=u===i,h=n.edge(o).weight;if(a+=d?h:-h,e.hasEdge(t,s)){var c=e.edge(t,s).cutvalue;a+=d?-c:c}}}),a}function eM(e,n){arguments.length<2&&(n=e.nodes()[0]),function e(n,t,r,i,u){var a=r,s=n.node(i);return t[i]=!0,o.Z(n.neighbors(i),function(o){Object.prototype.hasOwnProperty.call(t,o)||(r=e(n,t,r,o,i))}),s.low=a,s.lim=r++,u?s.parent=u:delete s.parent,r}(e,{},1,n)}function eR(e){return ed.Z(e.edges(),function(n){return e.edge(n).cutvalue<0})}function eT(e,n,t){var r=t.v,o=t.w;n.hasEdge(r,o)||(r=t.w,o=t.v);var i=e.node(r),u=e.node(o),a=i,s=!1;return i.lim>u.lim&&(a=u,s=!0),ei(eh.Z(n.edges(),function(n){return s===eD(e,e.node(n.v),a)&&s!==eD(e,e.node(n.w),a)}),function(e){return ea(n,e)})}function eF(e,n,t,r){var i,u,a=t.v,s=t.w;e.removeEdge(a,s),e.setEdge(r.v,r.w,{}),eM(e),eI(e,n),i=ed.Z(e.nodes(),function(e){return!n.node(e).parent}),u=(u=ej(e,i,"pre")).slice(1),o.Z(u,function(t){var r=e.node(t).parent,o=n.edge(t,r),i=!1;o||(o=n.edge(r,t),i=!0),n.node(t).rank=n.node(r).rank+(i?o.minlen:-o.minlen)})}function eD(e,n,t){return t.low<=n.lim&&n.lim<=t.lim}t(35539),eC.initLowLimValues=eM,eC.initCutValues=eI,eC.calcCutValue=eL,eC.leaveEdge=eR,eC.enterEdge=eT,eC.exchangeEdges=eF;var eS=t(33625),eG=t(49579),eV=t(13606),eB=t(54646),eq=function(e,n,t){for(var r=-1,o=e.length,i=n.length,u={};++r<o;){var a=r<i?n[r]:void 0;t(u,e[r],a)}return u},eY=t(28491),ez=t(80659),eA=t(83613),e$=t(97064),eJ=function(e,n){var t=e.length;for(e.sort(n);t--;)e[t]=e[t].value;return e},eK=t(65832),eH=t(82245),eQ=function(e,n){if(e!==n){var t=void 0!==e,r=null===e,o=e==e,i=(0,eH.Z)(e),u=void 0!==n,a=null===n,s=n==n,d=(0,eH.Z)(n);if(!a&&!d&&!i&&e>n||i&&u&&s&&!a&&!d||r&&u&&s||!t&&s||!o)return 1;if(!r&&!i&&!d&&e<n||d&&t&&o&&!r&&!i||a&&t&&o||!u&&o||!s)return -1}return 0},eU=function(e,n,t){for(var r=-1,o=e.criteria,i=n.criteria,u=o.length,a=t.length;++r<u;){var s=eQ(o[r],i[r]);if(s){if(r>=a)return s;return s*("desc"==t[r]?-1:1)}}return e.index-n.index},eW=function(e,n,t){n=n.length?(0,ez.Z)(n,function(e){return(0,eP.Z)(e)?function(n){return(0,eA.Z)(n,1===e.length?e[0]:e)}:e}):[M.Z];var r=-1;return n=(0,ez.Z)(n,(0,eK.Z)(S.Z)),eJ((0,e$.Z)(e,function(e,t,o){return{criteria:(0,ez.Z)(n,function(n){return n(e)}),index:++r,value:e}}),function(e,n){return eU(e,n,t)})},eX=(0,t(30801).Z)(function(e,n){if(null==e)return[];var t=n.length;return t>1&&(0,g.Z)(e,n[0],n[1])?n=[]:t>2&&(0,g.Z)(n[0],n[1],n[2])&&(n=[n[0]]),eW(e,(0,eY.Z)(n,1),[])});function e0(e,n,t){for(var r;n.length&&(r=T.Z(n)).i<=t;)n.pop(),e.push(r.vs),t++;return t}function e1(e,n,t){return h.Z(n,function(n){var r,i;return r=function(e){for(var n;e.hasNode(n=a("_root")););return n}(e),i=new Z.k({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(n){return e.node(n)}),o.Z(e.nodes(),function(u){var a=e.node(u),s=e.parent(u);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(u),i.setParent(u,s||r),o.Z(e[t](u),function(n){var t=n.v===u?n.w:n.v,r=i.edge(t,u),o=V.Z(r)?0:r.weight;i.setEdge(t,u,{weight:e.edge(n).weight+o})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(u,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i})}function e2(e,n){o.Z(n,function(n){o.Z(n,function(n,t){e.node(n).order=t})})}var e8=t(45900),e3=t(19045),e6=t(49625);function e5(e,n,t){if(n>t){var r=n;n=t,t=r}var o=e[n];o||(e[n]=o={}),o[t]=!0}function e4(e,n){var t=n&&n.debugTiming?U:W;t("layout",()=>{var n=t(" buildLayoutGraph",()=>{var n,t;return n=new Z.k({multigraph:!0,compound:!0}),t=na(e.graph()),n.setGraph(k.Z({},e7,nu(t,e9),j(t,ne))),o.Z(e.nodes(),function(t){var r=na(e.node(t));n.setNode(t,C.Z(nu(r,nn),nt)),n.setParent(t,e.parent(t))}),o.Z(e.edges(),function(t){var r=na(e.edge(t));n.setEdge(t,k.Z({},no,nu(r,nr),j(r,ni)))}),n});t(" runLayout",()=>{t(" makeSpaceForEdgeLabels",()=>{var e;return e=n.graph(),void(e.ranksep/=2,o.Z(n.edges(),function(t){var r=n.edge(t);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}),t(" removeSelfEdges",()=>{o.Z(n.edges(),function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}})}),t(" acyclic",()=>{var e,t,r,i;return e="greedy"===n.graph().acyclicer?function(e,n){if(1>=e.nodeCount())return[];var t,r,i,u,a,s,c=(t=n||y,r=new Z.k,i=0,u=0,o.Z(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),o.Z(e.edges(),function(e){var n=r.edge(e.v,e.w)||0,o=t(e);r.setEdge(e.v,e.w,n+o),u=Math.max(u,r.node(e.v).out+=o),i=Math.max(i,r.node(e.w).in+=o)}),a=p(u+i+3).map(function(){return new b}),s=i+1,o.Z(r.nodes(),function(e){E(a,s,r.node(e))}),{graph:r,buckets:a,zeroIdx:s}),f=function(e,n,t){for(var r,o=[],i=n[n.length-1],u=n[0];e.nodeCount();){for(;r=u.dequeue();)_(e,n,t,r);for(;r=i.dequeue();)_(e,n,t,r);if(e.nodeCount()){for(var a=n.length-2;a>0;--a)if(r=n[a].dequeue()){o=o.concat(_(e,n,t,r,!0));break}}}return o}(c.graph,c.buckets,c.zeroIdx);return d.Z(h.Z(f,function(n){return e.outEdges(n.v,n.w)}))}(n,function(e){return n.edge(e).weight}):(t=[],r={},i={},o.Z(n.nodes(),function e(u){Object.prototype.hasOwnProperty.call(i,u)||(i[u]=!0,r[u]=!0,o.Z(n.outEdges(u),function(n){Object.prototype.hasOwnProperty.call(r,n.w)?t.push(n):e(n.w)}),delete r[u])}),t),void o.Z(e,function(e){var t=n.edge(e);n.removeEdge(e),t.forwardName=e.name,t.reversed=!0,n.setEdge(e.w,e.v,t,a("rev"))})}),t(" nestingGraph.run",()=>{var e,t,r,i,u;return e=A(n,"root",{},"_root"),u={},o.Z(n.children(),function(e){!function e(t,r){var i=n.children(t);i&&i.length&&o.Z(i,function(n){e(n,r+1)}),u[t]=r}(e,1)}),r=2*(t=R(eS.Z(u))-1)+1,n.graph().nestingRoot=e,o.Z(n.edges(),function(e){n.edge(e).minlen*=r}),i=eG.Z(n.edges(),function(e,t){return e+n.edge(t).weight},0)+1,void(o.Z(n.children(),function(a){(function e(n,t,r,i,u,a,s){var d=n.children(s);if(!d.length){s!==t&&n.setEdge(t,s,{weight:0,minlen:r});return}var h=H(n,"_bt"),c=H(n,"_bb"),f=n.node(s);n.setParent(h,s),f.borderTop=h,n.setParent(c,s),f.borderBottom=c,o.Z(d,function(o){e(n,t,r,i,u,a,o);var d=n.node(o),f=d.borderTop?d.borderTop:o,l=d.borderBottom?d.borderBottom:o,g=d.borderTop?i:2*i,v=f!==l?1:u-a[s]+1;n.setEdge(h,f,{weight:g,minlen:v,nestingEdge:!0}),n.setEdge(l,c,{weight:g,minlen:v,nestingEdge:!0})}),n.parent(s)||n.setEdge(t,h,{weight:0,minlen:u+a[s]})})(n,e,r,i,t,u,a)}),n.graph().nodeRankFactor=r)}),t(" rank",()=>(function(e){switch(e.graph().ranker){case"network-simplex":default:eC(e);break;case"tight-tree":eu(e),es(e);break;case"longest-path":eu(e)}})($(n))),t(" injectEdgeLabelProxies",()=>{o.Z(n.edges(),function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),o={rank:(n.node(e.w).rank-r.rank)/2+r.rank,e:e};A(n,"edge-proxy",o,"_ep")}})}),t(" removeEmptyRanks",()=>{var e,t,r,i;return e=B.Z(h.Z(n.nodes(),function(e){return n.node(e).rank})),t=[],o.Z(n.nodes(),function(r){var o=n.node(r).rank-e;t[o]||(t[o]=[]),t[o].push(r)}),r=0,i=n.graph().nodeRankFactor,void o.Z(t,function(e,t){V.Z(e)&&t%i!=0?--r:r&&o.Z(e,function(e){n.node(e).rank+=r})})}),t(" nestingGraph.cleanup",()=>{var e;return e=n.graph(),void(n.removeNode(e.nestingRoot),delete e.nestingRoot,o.Z(n.edges(),function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}),t(" normalizeRanks",()=>{var e;return e=B.Z(h.Z(n.nodes(),function(e){return n.node(e).rank})),void o.Z(n.nodes(),function(t){var r=n.node(t);q.Z(r,"rank")&&(r.rank-=e)})}),t(" assignRankMinMax",()=>{var e;return e=0,void(o.Z(n.nodes(),function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=R(e,r.maxRank))}),n.graph().maxRank=e)}),t(" removeEdgeLabelProxies",()=>{o.Z(n.nodes(),function(e){var t=n.node(e);"edge-proxy"===t.dummy&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))})}),t(" normalize.run",()=>{n.graph().dummyChains=[],o.Z(n.edges(),function(e){(function(e,n){var t,r,o=n.v,i=e.node(o).rank,u=n.w,a=e.node(u).rank,s=n.name,d=e.edge(n),h=d.labelRank;if(a!==i+1){e.removeEdge(n);var c=void 0;for(r=0,++i;i<a;++r,++i)d.points=[],t=A(e,"edge",c={width:0,height:0,edgeLabel:d,edgeObj:n,rank:i},"_d"),i===h&&(c.width=d.width,c.height=d.height,c.dummy="edge-label",c.labelpos=d.labelpos),e.setEdge(o,t,{weight:d.weight},s),0===r&&e.graph().dummyChains.push(t),o=t;e.setEdge(o,u,{weight:d.weight},s)}})(n,e)})}),t(" parentDummyChains",()=>{var e,t;return e={},t=0,o.Z(n.children(),function r(i){var u=t;o.Z(n.children(i),r),e[i]={low:u,lim:t++}}),void o.Z(n.graph().dummyChains,function(t){for(var r=n.node(t),o=r.edgeObj,i=function(e,n,t,r){var o,i,u=[],a=[],s=Math.min(n[t].low,n[r].low),d=Math.max(n[t].lim,n[r].lim);o=t;do u.push(o=e.parent(o));while(o&&(n[o].low>s||d>n[o].lim));for(i=o,o=r;(o=e.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,e,o.v,o.w),u=i.path,a=i.lca,s=0,d=u[0],h=!0;t!==o.w;){if(r=n.node(t),h){for(;(d=u[s])!==a&&n.node(d).maxRank<r.rank;)s++;d===a&&(h=!1)}if(!h){for(;s<u.length-1&&n.node(d=u[s+1]).minRank<=r.rank;)s++;d=u[s]}n.setParent(t,d),t=n.successors(t)[0]}})}),t(" addBorderSegments",()=>{o.Z(n.children(),function e(t){var r=n.children(t),i=n.node(t);if(r.length&&o.Z(r,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var u=i.minRank,a=i.maxRank+1;u<a;++u)X(n,"borderLeft","_bl",t,i,u),X(n,"borderRight","_br",t,i,u)}})}),t(" order",()=>(function(e){var n=Q(e),t=e1(e,p(1,n+1),"inEdges"),r=e1(e,p(n-1,-1,-1),"outEdges"),i=(u={},a=eh.Z(e.nodes(),function(n){return!e.children(n).length}),s=R(h.Z(a,function(n){return e.node(n).rank})),c=h.Z(p(s+1),function(){return[]}),f=eX(a,function(n){return e.node(n).rank}),o.Z(f,function n(t){q.Z(u,t)||(u[t]=!0,c[e.node(t).rank].push(t),o.Z(e.successors(t),n))}),c);e2(e,i);for(var u,a,s,c,f,l,g=Number.POSITIVE_INFINITY,v=0,b=0;b<4;++v,++b){(function(e,n){var t=new Z.k;o.Z(e,function(e){var r,i,u,a=e.graph().root,s=function e(n,t,r,i){var u,a,s,c,f,l,g,v,p,Z,b,w=n.children(t),m=n.node(t),y=m?m.borderLeft:void 0,_=m?m.borderRight:void 0,E={};y&&(w=eh.Z(w,function(e){return e!==y&&e!==_}));var k=(u=w,h.Z(u,function(e){var t=n.inEdges(e);if(!t.length)return{v:e};var r=eG.Z(t,function(e,t){var r=n.edge(t),o=n.node(t.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}},{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}));o.Z(k,function(t){if(n.children(t.v).length){var o=e(n,t.v,r,i);E[t.v]=o,Object.prototype.hasOwnProperty.call(o,"barycenter")&&(V.Z(t.barycenter)?(t.barycenter=o.barycenter,t.weight=o.weight):(t.barycenter=(t.barycenter*t.weight+o.barycenter*o.weight)/(t.weight+o.weight),t.weight+=o.weight))}});var x=(a={},o.Z(k,function(e,n){var t=a[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};V.Z(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)}),o.Z(r.edges(),function(e){var n=a[e.v],t=a[e.w];V.Z(n)||V.Z(t)||(t.indegree++,n.out.push(a[e.w]))}),function(e){for(var n=[];e.length;){var t=e.pop();n.push(t),o.Z(t.in.reverse(),function(e){return function(n){!n.merged&&(V.Z(n.barycenter)||V.Z(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var t=0,r=0;e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=t/r,e.weight=r,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}(t)),o.Z(t.out,function(n){return function(t){t.in.push(n),0==--t.indegree&&e.push(t)}}(t))}return h.Z(eh.Z(n,function(e){return!e.merged}),function(e){return j(e,["vs","i","barycenter","weight"])})}(eh.Z(a,function(e){return!e.indegree})));(function(e,n){o.Z(e,function(e){e.vs=d.Z(e.vs.map(function(e){return n[e]?n[e].vs:e}))})})(x,E);var O=(f=(s=function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")},c={lhs:[],rhs:[]},o.Z(x,function(e){s(e)?c.lhs.push(e):c.rhs.push(e)}),c).lhs,l=eX(c.rhs,function(e){return-e.i}),g=[],v=0,p=0,Z=0,f.sort(function(e){return function(n,t){return n.barycenter<t.barycenter?-1:n.barycenter>t.barycenter?1:e?t.i-n.i:n.i-t.i}}(!!i)),Z=e0(g,l,Z),o.Z(f,function(e){Z+=e.vs.length,g.push(e.vs),v+=e.barycenter*e.weight,p+=e.weight,Z=e0(g,l,Z)}),b={vs:d.Z(g)},p&&(b.barycenter=v/p,b.weight=p),b);if(y&&(O.vs=d.Z([y,O.vs,_]),n.predecessors(y).length)){var N=n.node(n.predecessors(y)[0]),P=n.node(n.predecessors(_)[0]);Object.prototype.hasOwnProperty.call(O,"barycenter")||(O.barycenter=0,O.weight=0),O.barycenter=(O.barycenter*O.weight+N.order+P.order)/(O.weight+2),O.weight+=2}return O}(e,a,t,n);o.Z(s.vs,function(n,t){e.node(n).order=t}),r=s.vs,u={},o.Z(r,function(n){for(var r,o,a=e.parent(n);a;){if((r=e.parent(a))?(o=u[r],u[r]=a):(o=i,i=a),o&&o!==a){t.setEdge(o,a);return}a=r}})})})(v%2?t:r,v%4>=2),i=K(e);var w,m=function(e,n){for(var t=0,r=1;r<n.length;++r)t+=function(e,n,t){for(var r=eq(t||[],h.Z(t,function(e,n){return n})||[],eB.Z),i=d.Z(h.Z(n,function(n){return eX(h.Z(e.outEdges(n),function(n){return{pos:r[n.w],weight:e.edge(n).weight}}),"pos")})),u=1;u<t.length;)u<<=1;var a=2*u-1;u-=1;var s=h.Z(Array(a),function(){return 0}),c=0;return o.Z(i.forEach(function(e){var n=e.pos+u;s[n]+=e.weight;for(var t=0;n>0;)n%2&&(t+=s[n+1]),n=n-1>>1,s[n]+=e.weight;c+=e.weight*t})),c}(e,n[r-1],n[r]);return t}(e,i);m<g&&(b=0,w=i,l=(0,eV.Z)(w,5),g=m)}e2(e,l)})(n)),t(" insertSelfEdges",()=>{var e;return e=K(n),void o.Z(e,function(e){var t=0;o.Z(e,function(e,r){var i=n.node(e);i.order=r+t,o.Z(i.selfEdges,function(e){A(n,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++t,e:e.e,label:e.label},"_se")}),delete i.selfEdges})})}),t(" adjustCoordinateSystem",()=>{var e;("lr"===(e=n.graph().rankdir.toLowerCase())||"rl"===e)&&ee(n)}),t(" position",()=>{var e,t,r,i,u,a,s,d,c,f,l,g,v,b,w,m,y,_;m=K(w=e=$(e=n)),y=w.graph().ranksep,_=0,o.Z(m,function(e){var n=R(h.Z(e,function(e){return w.node(e).height}));o.Z(e,function(e){w.node(e).y=_+n/2}),_+=n+y}),i=K(t=e),a=k.Z((u={},eG.Z(i,function(e,n){var r=0,i=0,a=e.length,s=T.Z(n);return o.Z(n,function(e,d){var h=function(e,n){if(e.node(n).dummy)return ed.Z(e.predecessors(n),function(n){return e.node(n).dummy})}(t,e),c=h?t.node(h).order:a;(h||e===s)&&(o.Z(n.slice(i,d+1),function(e){o.Z(t.predecessors(e),function(n){var o=t.node(n),i=o.order;(i<r||c<i)&&!(o.dummy&&t.node(e).dummy)&&e5(u,n,e)})}),i=d+1,r=c)}),n}),u),function(e,n){var t={};function r(n,r,i,u,a){var s;o.Z(p(r,i),function(r){s=n[r],e.node(s).dummy&&o.Z(e.predecessors(s),function(n){var r=e.node(n);r.dummy&&(r.order<u||r.order>a)&&e5(t,n,s)})})}return eG.Z(n,function(n,t){var i,u=-1,a=0;return o.Z(t,function(o,s){if("border"===e.node(o).dummy){var d=e.predecessors(o);d.length&&(i=e.node(d[0]).order,r(t,a,s,u,i),a=s,u=i)}r(t,a,t.length,i,n.length)}),t}),t}(t,i)),s={},o.Z(["u","d"],function(e){r="u"===e?i:eS.Z(i).reverse(),o.Z(["l","r"],function(n){"r"===n&&(r=h.Z(r,function(e){return eS.Z(e).reverse()}));var i,u,d,c,f=("u"===e?t.predecessors:t.successors).bind(t),l=(i=r,u={},d={},c={},o.Z(i,function(e){o.Z(e,function(e,n){u[e]=e,d[e]=e,c[e]=n})}),o.Z(i,function(e){var n=-1;o.Z(e,function(e){var t=f(e);if(t.length)for(var r=((t=eX(t,function(e){return c[e]})).length-1)/2,o=Math.floor(r),i=Math.ceil(r);o<=i;++o){var s=t[o];d[e]===e&&n<c[s]&&!function(e,n,t){if(n>t){var r=n;n=t,t=r}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],t)}(a,e,s)&&(d[s]=e,d[e]=u[e]=u[s],n=c[s])}})}),{root:u,align:d}),g=function(e,n,t,r,i){var u,a,s,d,h,c={},f=(s=new Z.k,u=(d=e.graph()).nodesep,a=d.edgesep,h=function(e,n,t){var r,o,s=e.node(n),d=e.node(t);if(r=0+s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":o=-s.width/2;break;case"r":o=s.width/2}if(o&&(r+=i?o:-o),o=0,r+=(s.dummy?a:u)/2+(d.dummy?a:u)/2+d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":o=d.width/2;break;case"r":o=-d.width/2}return o&&(r+=i?o:-o),o=0,r},o.Z(n,function(n){var r;o.Z(n,function(n){var o=t[n];if(s.setNode(o),r){var i=t[r],u=s.edge(i,o);s.setEdge(i,o,Math.max(h(e,n,r),u||0))}r=n})}),s),l=i?"borderLeft":"borderRight";function g(e,n){for(var t=f.nodes(),r=t.pop(),o={};r;)o[r]?e(r):(o[r]=!0,t.push(r),t=t.concat(n(r))),r=t.pop()}return g(function(e){c[e]=f.inEdges(e).reduce(function(e,n){return Math.max(e,c[n.v]+f.edge(n))},0)},f.predecessors.bind(f)),g(function(n){var t=f.outEdges(n).reduce(function(e,n){return Math.min(e,c[n.w]-f.edge(n))},Number.POSITIVE_INFINITY),r=e.node(n);t!==Number.POSITIVE_INFINITY&&r.borderType!==l&&(c[n]=Math.max(c[n],t))},f.successors.bind(f)),o.Z(r,function(e){c[e]=c[t[e]]}),c}(t,r,l.root,l.align,"r"===n);"r"===n&&(g=G(g,function(e){return-e})),s[e+n]=g})}),d=ei(eS.Z(s),function(e){var n,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return n=function(e,n){var i=t.node(n).width/2;r=Math.max(e+i,r),o=Math.min(e-i,o)},null==e||(0,e3.Z)(e,(0,e8.Z)(n),e6.Z),r-o}),c=eS.Z(d),f=B.Z(c),l=R(c),o.Z(["u","d"],function(e){o.Z(["l","r"],function(n){var t,r=e+n,o=s[r];if(o!==d){var i=eS.Z(o);(t="l"===n?f-B.Z(i):l-R(i))&&(s[r]=G(o,function(e){return e+t}))}})}),g=t.graph().align,v=G(s.ul,function(e,n){if(g)return s[g.toLowerCase()][n];var t=eX(h.Z(s,n));return(t[1]+t[2])/2}),b=function(n,t){e.node(t).x=n},v&&(0,D.Z)(v,(0,e8.Z)(b))}),t(" positionSelfEdges",()=>{o.Z(n.nodes(),function(e){var t=n.node(e);if("selfedge"===t.dummy){var r=n.node(t.e.v),o=r.x+r.width/2,i=r.y,u=t.x-o,a=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),t.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],t.label.x=t.x,t.label.y=t.y}})}),t(" removeBorderNodes",()=>{o.Z(n.nodes(),function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),o=n.node(t.borderBottom),i=n.node(T.Z(t.borderLeft)),u=n.node(T.Z(t.borderRight));t.width=Math.abs(u.x-i.x),t.height=Math.abs(o.y-r.y),t.x=i.x+t.width/2,t.y=r.y+t.height/2}}),o.Z(n.nodes(),function(e){"border"===n.node(e).dummy&&n.removeNode(e)})}),t(" normalize.undo",()=>{o.Z(n.graph().dummyChains,function(e){var t,r=n.node(e),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)t=n.successors(e)[0],n.removeNode(e),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),e=t,r=n.node(e)})}),t(" fixupEdgeLabelCoords",()=>{o.Z(n.edges(),function(e){var t=n.edge(e);if(Object.prototype.hasOwnProperty.call(t,"x"))switch(("l"===t.labelpos||"r"===t.labelpos)&&(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}})}),t(" undoCoordinateSystem",()=>{var e;("bt"===(e=n.graph().rankdir.toLowerCase())||"rl"===e)&&(o.Z(n.nodes(),function(e){et(n.node(e))}),o.Z(n.edges(),function(e){var t=n.edge(e);o.Z(t.points,et),Object.prototype.hasOwnProperty.call(t,"y")&&et(t)})),("lr"===e||"rl"===e)&&(o.Z(n.nodes(),function(e){er(n.node(e))}),o.Z(n.edges(),function(e){var t=n.edge(e);o.Z(t.points,er),Object.prototype.hasOwnProperty.call(t,"x")&&er(t)}),ee(n))}),t(" translateGraph",()=>(function(e){var n=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,i=0,u=e.graph(),a=u.marginx||0,s=u.marginy||0;function d(e){var o=e.x,u=e.y,a=e.width,s=e.height;n=Math.min(n,o-a/2),t=Math.max(t,o+a/2),r=Math.min(r,u-s/2),i=Math.max(i,u+s/2)}o.Z(e.nodes(),function(n){d(e.node(n))}),o.Z(e.edges(),function(n){var t=e.edge(n);Object.prototype.hasOwnProperty.call(t,"x")&&d(t)}),n-=a,r-=s,o.Z(e.nodes(),function(t){var o=e.node(t);o.x-=n,o.y-=r}),o.Z(e.edges(),function(t){var i=e.edge(t);o.Z(i.points,function(e){e.x-=n,e.y-=r}),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=n),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=r)}),u.width=t-n+a,u.height=i-r+s})(n)),t(" assignNodeIntersects",()=>{o.Z(n.edges(),function(e){var t,r,o=n.edge(e),i=n.node(e.v),u=n.node(e.w);o.points?(t=o.points[0],r=o.points[o.points.length-1]):(o.points=[],t=u,r=i),o.points.unshift(J(i,t)),o.points.push(J(u,r))})}),t(" reversePoints",()=>{o.Z(n.edges(),function(e){var t=n.edge(e);t.reversed&&t.points.reverse()})}),t(" acyclic.undo",()=>{o.Z(n.edges(),function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}})})}),t(" updateInputGraph",()=>{o.Z(e.nodes(),function(t){var r=e.node(t),o=n.node(t);r&&(r.x=o.x,r.y=o.y,n.children(t).length&&(r.width=o.width,r.height=o.height))}),o.Z(e.edges(),function(t){var r=e.edge(t),o=n.edge(t);r.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(r.x=o.x,r.y=o.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height})})}var e9=["nodesep","edgesep","ranksep","marginx","marginy"],e7={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ne=["acyclicer","ranker","rankdir","align"],nn=["width","height"],nt={width:0,height:0},nr=["minlen","weight","width","height","labeloffset"],no={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ni=["labelpos"];function nu(e,n){return G(j(e,n),Number)}function na(e){var n={};return o.Z(e,function(e,t){n[t.toLowerCase()]=e}),n}},35539:function(e,n,t){t.d(n,{k:function(){return Z}});var r=t(86620),o=t(98402),i=t(47799),u=t(52422),a=t(45130),s=t(81585),d=t(87826),h=t(28491),c=t(30801),f=t(3394),l=t(38259),g=(0,c.Z)(function(e){return(0,f.Z)((0,h.Z)(e,1,l.Z,!0))}),v=t(33625),p=t(49579);class Z{constructor(e={}){this._isDirected=!Object.prototype.hasOwnProperty.call(e,"directed")||e.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.Z(void 0),this._defaultEdgeLabelFn=r.Z(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return o.Z(e)||(e=r.Z(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return i.Z(this._nodes)}sources(){var e=this;return u.Z(this.nodes(),function(n){return a.Z(e._in[n])})}sinks(){var e=this;return u.Z(this.nodes(),function(n){return a.Z(e._out[n])})}setNodes(e,n){var t=arguments,r=this;return s.Z(e,function(e){t.length>1?r.setNode(e,n):r.setNode(e)}),this}setNode(e,n){return Object.prototype.hasOwnProperty.call(this._nodes,e)?arguments.length>1&&(this._nodes[e]=n):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var n=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],s.Z(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),s.Z(i.Z(this._in[e]),n),delete this._in[e],delete this._preds[e],s.Z(i.Z(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,n){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(d.Z(n))n="\0";else{n+="";for(var t=n;!d.Z(t);t=this.parent(t))if(t===e)throw Error("Setting "+n+" as parent of "+e+" would create a cycle");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var n=this._parent[e];if("\0"!==n)return n}}children(e){if(d.Z(e)&&(e="\0"),this._isCompound){var n=this._children[e];if(n)return i.Z(n)}else if("\0"===e)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){var n=this._preds[e];if(n)return i.Z(n)}successors(e){var n=this._sucs[e];if(n)return i.Z(n)}neighbors(e){var n=this.predecessors(e);if(n)return g(n,this.successors(e))}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var t=this;s.Z(this._nodes,function(t,r){e(r)&&n.setNode(r,t)}),s.Z(this._edgeObjs,function(e){n.hasNode(e.v)&&n.hasNode(e.w)&&n.setEdge(e,t.edge(e))});var r={};return this._isCompound&&s.Z(n.nodes(),function(e){n.setParent(e,function e(o){var i=t.parent(o);return void 0===i||n.hasNode(i)?(r[o]=i,i):i in r?r[i]:e(i)}(e))}),n}setDefaultEdgeLabel(e){return o.Z(e)||(e=r.Z(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return v.Z(this._edgeObjs)}setPath(e,n){var t=this,r=arguments;return p.Z(e,function(e,o){return r.length>1?t.setEdge(e,o,n):t.setEdge(e,o),o}),this}setEdge(){var e,n,t,r,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,n=i.w,t=i.name,2==arguments.length&&(r=arguments[1],o=!0)):(e=i,n=arguments[1],t=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),e=""+e,n=""+n,d.Z(t)||(t=""+t);var u=m(this._isDirected,e,n,t);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,u))return o&&(this._edgeLabels[u]=r),this;if(!d.Z(t)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(n),this._edgeLabels[u]=o?r:this._defaultEdgeLabelFn(e,n,t);var a=function(e,n,t,r){var o=""+n,i=""+t;if(!e&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};return r&&(a.name=r),a}(this._isDirected,e,n,t);return e=a.v,n=a.w,Object.freeze(a),this._edgeObjs[u]=a,b(this._preds[n],e),b(this._sucs[e],n),this._in[n][u]=a,this._out[e][u]=a,this._edgeCount++,this}edge(e,n,t){var r=1==arguments.length?y(this._isDirected,arguments[0]):m(this._isDirected,e,n,t);return this._edgeLabels[r]}hasEdge(e,n,t){var r=1==arguments.length?y(this._isDirected,arguments[0]):m(this._isDirected,e,n,t);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,n,t){var r=1==arguments.length?y(this._isDirected,arguments[0]):m(this._isDirected,e,n,t),o=this._edgeObjs[r];return o&&(e=o.v,n=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],w(this._preds[n],e),w(this._sucs[e],n),delete this._in[n][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,n){var t=this._in[e];if(t){var r=v.Z(t);return n?u.Z(r,function(e){return e.v===n}):r}}outEdges(e,n){var t=this._out[e];if(t){var r=v.Z(t);return n?u.Z(r,function(e){return e.w===n}):r}}nodeEdges(e,n){var t=this.inEdges(e,n);if(t)return t.concat(this.outEdges(e,n))}}function b(e,n){e[n]?e[n]++:e[n]=1}function w(e,n){--e[n]||delete e[n]}function m(e,n,t,r){var o=""+n,i=""+t;if(!e&&o>i){var u=o;o=i,i=u}return o+"\x01"+i+"\x01"+(d.Z(r)?"\0":r)}function y(e,n){return m(e,n.v,n.w,n.name)}Z.prototype._nodeCount=0,Z.prototype._edgeCount=0},68406:function(e,n,t){t.d(n,{k:function(){return r.k}});var r=t(35539)},81496:function(e,n,t){var r=t(82245);n.Z=function(e,n,t){for(var o=-1,i=e.length;++o<i;){var u=e[o],a=n(u);if(null!=a&&(void 0===s?a==a&&!(0,r.Z)(a):t(a,s)))var s=a,d=u}return d}},24639:function(e,n){n.Z=function(e,n){return e<n}},97064:function(e,n,t){var r=t(50388),o=t(82025);n.Z=function(e,n){var t=-1,i=(0,o.Z)(e)?Array(e.length):[];return(0,r.Z)(e,function(e,r,o){i[++t]=n(e,r,o)}),i}},76834:function(e,n,t){t.d(n,{Z:function(){return h}});var r=t(83613),o=t(54646),i=t(87439),u=t(65482),a=t(7632),s=t(47373),d=function(e,n,t,r){if(!(0,a.Z)(e))return e;n=(0,i.Z)(n,e);for(var d=-1,h=n.length,c=h-1,f=e;null!=f&&++d<h;){var l=(0,s.Z)(n[d]),g=t;if("__proto__"===l||"constructor"===l||"prototype"===l)break;if(d!=c){var v=f[l];void 0===(g=r?r(v,l,f):void 0)&&(g=(0,a.Z)(v)?v:(0,u.Z)(n[d+1])?[]:{})}(0,o.Z)(f,l,g),f=f[l]}return e},h=function(e,n,t){for(var o=-1,u=n.length,a={};++o<u;){var s=n[o],h=(0,r.Z)(e,s);t(h,s)&&d(a,(0,i.Z)(s,e),h)}return a}},37340:function(e,n,t){var r=t(30801),o=t(84338),i=t(2864),u=t(49625),a=Object.prototype,s=a.hasOwnProperty,d=(0,r.Z)(function(e,n){e=Object(e);var t=-1,r=n.length,d=r>2?n[2]:void 0;for(d&&(0,i.Z)(n[0],n[1],d)&&(r=1);++t<r;)for(var h=n[t],c=(0,u.Z)(h),f=-1,l=c.length;++f<l;){var g=c[f],v=e[g];(void 0===v||(0,o.Z)(v,a[g])&&!s.call(e,g))&&(e[g]=h[g])}return e});n.Z=d},23969:function(e,n,t){t.d(n,{Z:function(){return h}});var r,o=t(18856),i=t(82025),u=t(47799),a=t(41764),s=t(75300),d=Math.max,h=(r=function(e,n,t){var r=null==e?0:e.length;if(!r)return -1;var i=null==t?0:(0,s.Z)(t);return i<0&&(i=d(r+i,0)),(0,a.Z)(e,(0,o.Z)(n,3),i)},function(e,n,t){var a=Object(e);if(!(0,i.Z)(e)){var s=(0,o.Z)(n,3);e=(0,u.Z)(e),n=function(e){return s(a[e],e,a)}}var d=r(e,n,t);return d>-1?a[s?e[d]:d]:void 0})},85765:function(e,n,t){var r=t(28491);n.Z=function(e){return(null==e?0:e.length)?(0,r.Z)(e,1):[]}},12937:function(e,n,t){t.d(n,{Z:function(){return u}});var r=Object.prototype.hasOwnProperty,o=function(e,n){return null!=e&&r.call(e,n)},i=t(93025),u=function(e,n){return null!=e&&(0,i.Z)(e,n,o)}},2564:function(e,n,t){var r=t(59576),o=t(28070),i=t(82370);n.Z=function(e){return"string"==typeof e||!(0,o.Z)(e)&&(0,i.Z)(e)&&"[object String]"==(0,r.Z)(e)}},1848:function(e,n){n.Z=function(e){var n=null==e?0:e.length;return n?e[n-1]:void 0}},68692:function(e,n,t){var r=t(80659),o=t(18856),i=t(97064),u=t(28070);n.Z=function(e,n){return((0,u.Z)(e)?r.Z:i.Z)(e,(0,o.Z)(n,3))}},58271:function(e,n,t){var r=t(81496),o=t(24639),i=t(20937);n.Z=function(e){return e&&e.length?(0,r.Z)(e,i.Z,o.Z):void 0}},30898:function(e,n,t){t.d(n,{Z:function(){return v}});var r=/\s/,o=function(e){for(var n=e.length;n--&&r.test(e.charAt(n)););return n},i=/^\s+/,u=t(7632),a=t(82245),s=0/0,d=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt,l=function(e){if("number"==typeof e)return e;if((0,a.Z)(e))return s;if((0,u.Z)(e)){var n,t="function"==typeof e.valueOf?e.valueOf():e;e=(0,u.Z)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=(n=e)?n.slice(0,o(n)+1).replace(i,""):n;var r=h.test(e);return r||c.test(e)?f(e.slice(2),r?2:8):d.test(e)?s:+e},g=1/0,v=function(e){return e?(e=l(e))===g||e===-g?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},75300:function(e,n,t){var r=t(30898);n.Z=function(e){var n=(0,r.Z)(e),t=n%1;return n==n?t?n-t:n:0}}}]);
|