reflex-agent 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +97 -97
- package/.next/app-path-routes-manifest.json +9 -9
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +7 -7
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +2 -2
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +2 -2
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/audit/page.js +1 -1
- package/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +2 -2
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/page.js +3 -3
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +3 -3
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +4 -4
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -2
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +9 -9
- package/.next/server/chunks/1314.js +1 -0
- package/.next/server/chunks/285.js +5 -5
- package/.next/server/chunks/3152.js +1 -1
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/4812.js +2 -2
- package/.next/server/chunks/5276.js +3 -0
- package/.next/server/chunks/{6954.js → 5871.js} +1 -1
- package/.next/server/chunks/62.js +1 -0
- package/.next/server/chunks/6266.js +1 -0
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/9249.js +4 -0
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1000-49ad093733e70f09.js +1 -0
- package/.next/static/chunks/1226-fd290816f32913c2.js +1 -0
- package/.next/static/chunks/4108.5dbd5b779fea2993.js +1 -0
- package/.next/static/chunks/5771-202f27993722fa17.js +1 -0
- package/.next/static/chunks/7124-34b05243f6c43a12.js +1 -0
- package/.next/static/chunks/{7882-2b0a83d718b55183.js → 7529-acb1a406a593e6cf.js} +1 -1
- package/.next/static/chunks/app/layout-f72fb9bc2ee5b6a2.js +1 -0
- package/.next/static/chunks/app/onboarding/page-bbd13228685e577f.js +1 -0
- package/.next/static/chunks/app/page-a617e1a2eaabe4af.js +1 -0
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/{page-790adae334559fee.js → page-d6ef0d1004f68749.js} +1 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-abb5340574dfb7f1.js +1 -0
- package/.next/static/chunks/app/roots/[id]/page-b5d8b67b53874827.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-7ab7e51fa775b34e.js +1 -0
- package/.next/static/chunks/app/roots/new/{page-2d2e4524a5804faa.js → page-8bd0f9cdda3e8174.js} +1 -1
- package/.next/static/chunks/app/settings/page-b164636cbad34025.js +1 -0
- package/.next/static/chunks/app/share/[id]/page-958eed5784f7cc92.js +1 -0
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-4383ad50c38434ad.js +1 -0
- package/.next/static/chunks/app/utilities/page-ff028844ad2820cd.js +1 -0
- package/.next/static/chunks/{webpack-84a033e55baef334.js → webpack-18930958151e32fe.js} +1 -1
- package/.next/trace +89 -89
- package/package.json +1 -1
- package/.next/server/chunks/2559.js +0 -1
- package/.next/server/chunks/3635.js +0 -1
- package/.next/server/chunks/3868.js +0 -4
- package/.next/server/chunks/6149.js +0 -3
- package/.next/server/chunks/8142.js +0 -1
- package/.next/static/chunks/1580-740a1a70ef8ffa0d.js +0 -1
- package/.next/static/chunks/1748-53319d5ec4411b05.js +0 -1
- package/.next/static/chunks/357-75ffe19a5d55a8b8.js +0 -1
- package/.next/static/chunks/4108.86e2092ff9db450c.js +0 -1
- package/.next/static/chunks/4971-85de3cd4fda214ae.js +0 -1
- package/.next/static/chunks/app/layout-64e60b0b8e0282d7.js +0 -1
- package/.next/static/chunks/app/onboarding/page-9601fcb7f4f95bf8.js +0 -1
- package/.next/static/chunks/app/page-7666e4bab61a7c9a.js +0 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-50409258dd7f5deb.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-976f754ee926503d.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-fcc5eebbf3ebc541.js +0 -1
- package/.next/static/chunks/app/settings/page-830a2dbc2d81d341.js +0 -1
- package/.next/static/chunks/app/share/[id]/page-fc9bee69ce1ab695.js +0 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-2fc8d46da0544044.js +0 -1
- package/.next/static/chunks/app/utilities/page-14013c0eaaa83a58.js +0 -1
- /package/.next/static/{LRmct3V5fYVu_lgUdqH4x → mc0TeBBP3_H8uf7oGZRzW}/_buildManifest.js +0 -0
- /package/.next/static/{LRmct3V5fYVu_lgUdqH4x → mc0TeBBP3_H8uf7oGZRzW}/_ssgManifest.js +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=2559,exports.ids=[2559],exports.modules={6993:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(63003),e=c(9310),f=c(24576);async function g({children:a,params:b}){let{id:c}=await b;return await (0,f.Zn)(c)||(0,e.notFound)(),(0,d.jsx)("div",{className:"flex-1 flex flex-col min-h-0",children:a})}},9084:(a,b,c)=>{"use strict";c.d(b,{v:()=>N});var d=c(64173),e=c(71813),f=c(11090),g=c(17240),h=c(42557);let i=(0,h.A)("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);var j=c(65177),k=c(12619),l=c(66979);let m=(0,h.A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var n=c(97338);let o=(0,h.A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),p=(0,h.A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var q=c(62481),r=c(25436),s=c(30515),t=c(62261),u=c(20583),v=c(47071);let w=(0,h.A)("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);var x=c(1056),y=c.n(x),z=c(68669);let A=(0,h.A)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var B=c(65943);let C=(0,h.A)("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]),D=(0,h.A)("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);var E=c(28082),F=c(44052),G=c(85548);function H({service:a,size:b=18,className:c}){return(0,d.jsx)("span",{className:"inline-flex items-center justify-center rounded-[5px] font-bold leading-none text-white shrink-0 "+(c??""),style:{background:a.brand,width:b,height:b,fontSize:Math.max(8,Math.floor(.55*b)),letterSpacing:a.glyph.length>1?"-0.05em":"0"},"aria-hidden":!0,children:a.glyph})}var I=c(3265);function J({point:a,services:b,interactive:c,onRemove:f}){let g=(0,e.c)("roots");return(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[b.slice(0,4).map(b=>(0,d.jsx)("a",{href:b.urlFor(a.lat,a.lng),target:"_blank",rel:"noopener noreferrer",className:"rounded p-0.5 hover:ring-1 hover:ring-offset-1 hover:ring-violet-300",title:g("mapWidget.navigationTitle",{service:b.label}),children:(0,d.jsx)(H,{service:b,size:18})},b.id)),(0,d.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(`${a.lat}, ${a.lng}`).then(()=>F.oR.success(g("mapWidget.coordsCopied"))).catch(()=>F.oR.error(g("mapWidget.clipboardUnavailable")))},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:g("mapWidget.copyCoords"),children:(0,d.jsx)(E.A,{className:"h-3 w-3"})}),c&&(0,d.jsx)("button",{type:"button",onClick:f,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-destructive",title:g("mapWidget.removePoint"),children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})}function K({service:a,stops:b}){let c=(0,e.c)("roots"),f=a.routeUrlFor(b),g=b=>{b.preventDefault(),b.stopPropagation(),navigator.clipboard.writeText(f).then(()=>F.oR.success(c("mapWidget.linkCopied",{service:a.label}))).catch(()=>F.oR.error(c("mapWidget.clipboardUnavailable")))};return(0,d.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",onContextMenu:g,className:"inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[11px] hover:bg-accent",title:c("mapWidget.openTitle",{service:a.label}),children:[(0,d.jsx)(H,{service:a,size:16}),(0,d.jsx)("span",{className:"truncate max-w-[80px]",children:a.label}),(0,d.jsx)("button",{type:"button",onClick:g,className:"text-muted-foreground hover:text-foreground",title:c("mapWidget.copyLinkTitle"),children:(0,d.jsx)(E.A,{className:"h-2.5 w-2.5"})})]})}I.callServer,I.findSourceMapURL;var L=c(69552);let M={markdown:function({data:a}){return(0,d.jsx)("div",{className:"text-sm",children:(0,d.jsx)(f.p,{source:a.body??""})})},"news-list":function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[m,n]=(0,g.useState)(h),[o,p]=(0,g.useTransition)();(0,g.useRef)("");let q=a=>{n(a),c&&p(async()=>{try{await c({items:a})}catch{}})};return 0===m.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("newsListWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-2",children:m.map((a,c)=>(0,d.jsxs)("li",{className:`group/row relative border-l-2 pl-2.5 py-0.5 transition ${a.read?"border-muted-foreground/30 opacity-60":"border-violet-200"}`,children:[(0,d.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,d.jsx)(i,{className:`h-3 w-3 mt-1 shrink-0 ${a.read?"text-muted-foreground":"text-violet-600"}`}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 pr-12",children:[a.url?(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[a.title,(0,d.jsx)(j.A,{className:"h-3 w-3 opacity-50"})]}):(0,d.jsx)("span",{className:"text-sm font-medium",children:a.title}),a.summary&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:a.summary}),(a.source||a.date)&&(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-0.5 flex gap-1.5",children:[a.source&&(0,d.jsx)("span",{children:a.source}),a.source&&a.date&&(0,d.jsx)("span",{children:"\xb7"}),a.date&&(0,d.jsx)("span",{className:"font-mono",children:a.date})]})]})]}),!b&&(0,d.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(m.map((a,b)=>b===c?{...a,read:!a.read}:a))},disabled:o,"aria-label":a.read?f("newsListWidget.markUnreadAria"):f("newsListWidget.markReadAria"),title:a.read?f("newsListWidget.markUnreadTitle"):f("newsListWidget.markReadTitle"),className:"p-1 rounded hover:bg-emerald-100 dark:hover:bg-emerald-950/40 text-muted-foreground hover:text-emerald-600 disabled:opacity-30",children:(0,d.jsx)(k.A,{className:"h-3 w-3"})}),(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(m.filter((a,b)=>b!==c))},disabled:o,"aria-label":f("newsListWidget.dismissAria"),title:f("newsListWidget.dismissTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})]},c))})},"link-list":function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,k]=(0,g.useState)(h),[l,o]=(0,g.useTransition)();return((0,g.useRef)(""),0===i.length)?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("linkListWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-0.5",children:i.map((a,e)=>(0,d.jsxs)("li",{className:"group/row relative",children:[(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-1.5 rounded-md px-2 py-1.5 hover:bg-accent/40 transition",children:[(0,d.jsx)(m,{className:"h-3 w-3 mt-1 shrink-0 text-sky-600"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[a.title,(0,d.jsx)(j.A,{className:"h-3 w-3 opacity-50"})]}),a.hint&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:a.hint}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground truncate font-mono mt-0.5",children:a.url})]})]}),!b&&(0,d.jsx)("button",{type:"button",onClick:()=>(a=>{if(!b){var d;k(d=i.filter((b,c)=>c!==a)),c&&o(async()=>{try{await c({items:d})}catch{}})}})(e),disabled:l,"aria-label":f("linkListWidget.removeAria"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(n.A,{className:"h-3 w-3"})})]},e))})},kpi:function({data:a}){let b=(0,e.c)("roots"),c=a.items??[];if(0===c.length)return(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("kpiWidget.empty")});let f=Math.min(c.length,3);return(0,d.jsx)("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${f}, minmax(0,1fr))`},children:c.map((a,b)=>(0,d.jsxs)("div",{className:"rounded-md border bg-card px-3 py-2 flex flex-col gap-0.5",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:a.label}),(0,d.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,d.jsx)("span",{className:"text-lg font-semibold tabular-nums",children:a.value}),"up"===a.delta&&(0,d.jsx)(o,{className:"h-3.5 w-3.5 text-emerald-600"}),"down"===a.delta&&(0,d.jsx)(p,{className:"h-3.5 w-3.5 text-rose-600"}),"flat"===a.delta&&(0,d.jsx)(q.A,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),a.hint&&(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground leading-snug",children:a.hint})]},b))})},checklist:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,j]=(0,g.useState)(h),[l,m]=(0,g.useTransition)(),[o,p]=(0,g.useState)("");(0,g.useRef)("");let q=a=>{j(a),c&&m(async()=>{try{await c({items:a})}catch{}})},w=a=>{b||q(i.map((b,c)=>c===a?{...b,done:!b.done}:b))};return 0===i.length&&b?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("checklistWidget.empty")}):(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("ul",{className:"space-y-0.5",children:i.map((a,c)=>(0,d.jsxs)("li",{className:`group/row flex items-start gap-2 text-sm py-0.5 rounded hover:bg-accent/30 px-1 -mx-1 ${a.done?"text-muted-foreground":""}`,children:[(0,d.jsx)("button",{type:"button",onClick:()=>w(c),disabled:b||l,"aria-label":a.done?f("checklistWidget.uncheckAria"):f("checklistWidget.checkAria"),className:"shrink-0 mt-0.5 disabled:opacity-50",children:a.done?(0,d.jsx)(k.A,{className:"h-3.5 w-3.5 text-emerald-600"}):(0,d.jsx)(r.A,{className:"h-3.5 w-3.5 text-muted-foreground/60 hover:text-foreground"})}),(0,d.jsx)("span",{className:`flex-1 min-w-0 break-words ${a.done?"line-through":""}`,onClick:()=>w(c),style:b?{}:{cursor:"pointer"},children:a.text}),!b&&(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(i.filter((a,b)=>b!==c))},disabled:l,"aria-label":f("checklistWidget.removeAria"),className:"opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0 p-0.5 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(n.A,{className:"h-3 w-3"})})]},c))}),!b&&(0,d.jsxs)("form",{className:"flex items-center gap-1 pt-1",onSubmit:a=>{a.preventDefault(),(()=>{if(b)return;let a=o.trim();a&&(q([...i,{text:a,done:!1}]),p(""))})()},children:[(0,d.jsx)(s.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,d.jsx)(v.p,{value:o,onChange:a=>p(a.target.value),placeholder:f("checklistWidget.newItemPlaceholder"),className:"h-7 text-xs flex-1 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 px-1",disabled:l}),o.trim()&&(0,d.jsx)(u.$,{type:"submit",size:"sm",variant:"ghost",className:"h-6 text-[10px] px-1.5",disabled:l,children:l?(0,d.jsx)(t.A,{className:"h-3 w-3 animate-spin"}):f("checklistWidget.add")})]})]})},quote:function({data:a}){let b=(0,e.c)("roots");return a?.text?(0,d.jsxs)("figure",{className:"relative pl-6",children:[(0,d.jsx)(w,{className:"h-5 w-5 absolute left-0 top-0 text-violet-300"}),(0,d.jsx)("blockquote",{className:"text-sm italic leading-relaxed",children:a.text}),a.attribution&&(0,d.jsxs)("figcaption",{className:"text-xs text-muted-foreground mt-1.5",children:["— ",a.attribution]})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("quoteWidget.empty")})},"kb-pinned":function({rootId:a,data:b,readonly:c,onPatch:f}){let h=(0,e.c)("roots"),i=b.items??[],[j,k]=(0,g.useState)(i),[m,n]=(0,g.useTransition)();return((0,g.useRef)(""),0===j.length)?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:h("kbPinnedWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-1",children:j.map((b,e)=>{let g=b.rel.split("/").map(encodeURIComponent).join("/");return(0,d.jsxs)("li",{className:"group/row relative",children:[(0,d.jsxs)(y(),{href:`/roots/${a}/kb/${g}`,className:"flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent/40 transition pr-7",children:[(0,d.jsx)(z.A,{className:"h-3 w-3 mt-0.5 shrink-0 text-emerald-700"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium truncate",children:b.title??b.rel}),b.snippet&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed mt-0.5",children:b.snippet}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground font-mono mt-0.5 truncate",children:b.rel})]})]}),!c&&(0,d.jsx)("button",{type:"button",onClick:()=>(a=>{if(!c){var b;k(b=j.filter((b,c)=>c!==a)),f&&n(async()=>{try{await f({items:b})}catch{}})}})(e),disabled:m,"aria-label":h("kbPinnedWidget.unpinAria"),title:h("kbPinnedWidget.unpinTitle"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]},e)})})},progress:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,j]=(0,g.useState)(h),[k,l]=(0,g.useTransition)();(0,g.useRef)("");let m=(a,d)=>{if(!b){var e;j(e=i.map((b,c)=>c===a?{...b,current:Math.max(0,b.current+d)}:b)),c&&l(async()=>{try{await c({items:e})}catch{}})}};return 0===i.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("progressWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-2.5",children:i.map((a,c)=>{let e=a.target>0?Math.max(0,Math.min(100,a.current/a.target*100)):0;return(0,d.jsxs)("li",{className:"space-y-1 group/row",children:[(0,d.jsxs)("div",{className:"flex items-baseline justify-between gap-2 text-sm",children:[(0,d.jsx)("span",{className:"truncate flex-1 min-w-0",children:a.label}),!b&&(0,d.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:()=>m(c,-1),disabled:k||a.current<=0,"aria-label":"−1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)(A,{className:"h-3 w-3"})}),(0,d.jsx)("button",{type:"button",onClick:()=>m(c,1),disabled:k,"aria-label":"+1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)(s.A,{className:"h-3 w-3"})})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[a.current," / ",a.target,a.unit?` ${a.unit}`:""]})]}),(0,d.jsx)("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden",children:(0,d.jsx)("div",{className:"h-full bg-violet-600 transition-all",style:{width:`${e}%`}})})]},c)})})},image:function({data:a}){let b=(0,e.c)("roots");return a?.url?(0,d.jsxs)("figure",{className:"space-y-1",children:[(0,d.jsx)("img",{src:a.url,alt:a.alt??"",className:"rounded-md w-full h-auto border",loading:"lazy"}),a.caption&&(0,d.jsx)("figcaption",{className:"text-xs text-muted-foreground text-center",children:a.caption})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("imageWidget.empty")})},"stat-table":function({data:a}){let b=(0,e.c)("roots"),c=a.rows??[];return 0===c.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("statTableWidget.empty")}):(0,d.jsx)("div",{className:"overflow-x-auto -mx-1",children:(0,d.jsxs)("table",{className:"w-full text-sm",children:[a.columns&&a.columns.length>0&&(0,d.jsx)("thead",{children:(0,d.jsx)("tr",{className:"border-b",children:a.columns.map((a,b)=>(0,d.jsx)("th",{className:"text-left text-[10px] uppercase tracking-wider text-muted-foreground font-medium px-1.5 py-1.5",children:a},b))})}),(0,d.jsx)("tbody",{children:c.map((a,b)=>(0,d.jsx)("tr",{className:"border-b border-dashed last:border-b-0 hover:bg-accent/30",children:a.map((a,b)=>(0,d.jsx)("td",{className:"px-1.5 py-1.5 align-top",children:a},b))},b))})]})})},map:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=(0,g.useRef)(null),i=(0,g.useRef)(null),[j,k]=(0,g.useState)(!1),[m,o]=(0,g.useState)(G.JY),[p,q]=(0,g.useState)(""),[r,u]=(0,g.useState)(!1),[v,w]=(0,g.useState)([]),[x,y]=(0,g.useState)(!1),[z,A]=(0,g.useState)([]),E=a.points??[],H=a.route?.stops??[],I=x?z:H,L=(0,g.useMemo)(()=>I.map(a=>E[a]).filter(a=>!!a).map(a=>({lat:a.lat,lng:a.lng})),[I,E]),M=(0,g.useMemo)(()=>G.yp.filter(a=>m.includes(a.id)),[m]);(0,g.useEffect)(()=>{if(!j||!h.current)return;let b=window.L;if(!b||(i.current&&(i.current.remove(),i.current=null),0===E.length))return;let c=b.map(h.current,{scrollWheelZoom:!1,zoomControl:!0});i.current=c,b.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(c);let d=E.map((a,d)=>{let e=I.includes(d),g=function(a,b,c){let d=a=>a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),e=b.map(b=>{let c=b.urlFor(a.lat,a.lng);return`<a href="${d(c)}" target="_blank" rel="noopener noreferrer" title="${d(b.label)}" style="display:inline-flex;align-items:center;gap:4px;margin:2px 4px 2px 0;padding:2px 6px;border-radius:5px;border:1px solid #e5e7eb;text-decoration:none;font-size:11px;color:#111;background:#fff;"><span style="display:inline-block;width:14px;height:14px;border-radius:3px;background:${b.brand};color:#fff;font-size:9px;font-weight:700;line-height:14px;text-align:center;letter-spacing:${b.glyph.length>1?"-0.05em":"0"}">${d(b.glyph)}</span><span>${d(b.label)}</span></a>`}).join("");return['<div style="font-family:inherit;min-width:200px">',`<div style="font-weight:600;font-size:13px;margin-bottom:2px">${d(a.title)}</div>`,a.description?`<div style="font-size:12px;color:#666;margin-bottom:6px">${d(a.description)}</div>`:"",`<div style="font-family:monospace;font-size:10px;color:#888;margin-bottom:6px">${a.lat.toFixed(5)}, ${a.lng.toFixed(5)}</div>`,b.length>0?`<div style="font-size:10px;color:#888;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:2px">${d(c.openIn)}</div>${e}`:"",`<div style="margin-top:6px"><button type="button" data-reflex-copy="${a.lat}, ${a.lng}" style="font-size:11px;padding:2px 8px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer">📋 ${d(c.copyCoords)}</button></div>`,"</div>"].filter(Boolean).join("")}(a,M,{openIn:f("mapWidget.openIn"),copyCoords:f("mapWidget.copyCoords")}),h=b.marker([a.lat,a.lng],{opacity:x&&!e?.55:1}).addTo(c);return h.bindPopup(g,{maxWidth:280}),h.on("click",()=>{x&&A(a=>a.includes(d)?a.filter(a=>a!==d):[...a,d])}),h});L.length>=2&&b.polyline(L.map(a=>[a.lat,a.lng]),{color:a.route?.color??"#7c3aed",weight:4,opacity:.85,dashArray:x?"6,6":void 0}).addTo(c);let e=a=>{let b=a.target.closest("[data-reflex-copy]");if(b){let c=b.getAttribute("data-reflex-copy");c&&navigator.clipboard.writeText(c).then(()=>F.oR.success(f("mapWidget.copied"))).catch(()=>F.oR.error(f("mapWidget.clipboardUnavailable"))),a.preventDefault()}};if(h.current.addEventListener("click",e),a.center&&"number"==typeof a.zoom)c.setView([a.center.lat,a.center.lng],a.zoom);else if(1===E.length)c.setView([E[0].lat,E[0].lng],a.zoom??12);else{let a=b.featureGroup(d);c.fitBounds(a.getBounds().pad(.2))}return()=>{h.current?.removeEventListener("click",e),c.remove(),i.current=null}},[j,a,m.join("|"),x,z.join(",")]);let N=!b&&!!c,O=async()=>{let a=p.trim();if(a){u(!0),w([]);try{let b=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(a)}&format=json&limit=6`,c=await fetch(b,{headers:{Accept:"application/json"}});if(!c.ok)throw Error(`status ${c.status}`);let d=await c.json();w(d),0===d.length&&F.oR.message(f("mapWidget.nothingFound"))}catch(a){F.oR.error(f("mapWidget.searchFailed",{error:a instanceof Error?a.message:String(a)}))}finally{u(!1)}}},P=async b=>{if(!N)return;let d=Number(b.lat),e=Number(b.lon);if(!Number.isFinite(d)||!Number.isFinite(e))return void F.oR.error(f("mapWidget.invalidCoordinates"));let g=b.display_name.split(",")[0]?.trim()||b.display_name.slice(0,60),h={...a,points:[...E,{lat:d,lng:e,title:g,description:b.display_name}]};w([]),q(""),await c?.(h)},Q=async b=>{if(!N)return;let d=E.filter((a,c)=>c!==b),e=a.route;if(a.route?.stops?.length){let c=a.route.stops.filter(a=>a!==b).map(a=>a>b?a-1:a);e=c.length>=2?{...a.route,stops:c}:void 0}let f={...a,points:d,...e?{route:e}:{route:void 0}};await c?.(f)},R=async()=>{if(!N)return;let b={...a,route:void 0};await c?.(b),y(!1),A([])},S=async()=>{if(!N)return;if(z.length<2)return void F.oR.error(f("mapWidget.routeNeedsTwo"));let b={...a,route:{...a.route??{},stops:z}};await c?.(b),y(!1)};return 0!==E.length||N?(0,d.jsxs)("div",{className:"space-y-2",children:[N&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(B.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,d.jsx)("input",{type:"search",value:p,onChange:a=>q(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),O())},placeholder:f("mapWidget.searchPlaceholder"),className:"w-full rounded border bg-background pl-7 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>void O(),disabled:r||!p.trim(),className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",children:[r?(0,d.jsx)(t.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(B.A,{className:"h-3 w-3"}),f("mapWidget.search")]}),x?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",onClick:()=>void S(),className:"rounded px-2 py-1 text-xs bg-violet-600 text-white hover:bg-violet-700 inline-flex items-center gap-1",title:f("mapWidget.saveRouteTitle"),children:[(0,d.jsx)(C,{className:"h-3 w-3"})," ",f("mapWidget.save")]}),(0,d.jsx)("button",{type:"button",onClick:()=>{y(!1),A([])},className:"rounded border px-2 py-1 text-xs hover:bg-accent inline-flex items-center gap-1",title:f("mapWidget.cancelTitle"),children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]}):(0,d.jsxs)("button",{type:"button",onClick:()=>{A(H),y(!0)},disabled:E.length<2,className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",title:f("mapWidget.routeButtonTitle"),children:[(0,d.jsx)(C,{className:"h-3 w-3"}),f("mapWidget.route")]})]}),v.length>0&&(0,d.jsx)("ul",{className:"rounded border bg-card divide-y text-xs max-h-44 overflow-y-auto",children:v.map((a,b)=>(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>void P(a),className:"w-full text-left flex items-start gap-2 px-2 py-1.5 hover:bg-accent",children:[(0,d.jsx)(s.A,{className:"h-3 w-3 mt-0.5 text-emerald-700 shrink-0"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block font-medium truncate",children:a.display_name.split(",")[0]}),(0,d.jsx)("span",{className:"block text-[10px] text-muted-foreground truncate",children:a.display_name})]})]})},b))}),x&&(0,d.jsx)("div",{className:"rounded border border-violet-200 bg-violet-50 dark:bg-violet-950/30 dark:border-violet-900/50 px-2 py-1.5 text-[11px] text-violet-900 dark:text-violet-200",children:f.rich("mapWidget.routeModeHint",{count:z.length,strong:a=>(0,d.jsx)("strong",{children:a})})})]}),(0,d.jsx)("div",{ref:h,className:"rounded-md border overflow-hidden bg-muted/30",style:{height:280}}),!x&&L.length>=2&&M.length>0&&(0,d.jsx)("div",{className:"rounded border bg-card px-2 py-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium",children:[(0,d.jsx)(C,{className:"h-3 w-3 text-violet-600"}),f("mapWidget.routeLabel",{count:L.length})]}),M.map(a=>(0,d.jsx)(K,{service:a,stops:L},a.id)),N&&(0,d.jsxs)("button",{type:"button",onClick:()=>void R(),className:"ml-auto text-[10px] text-muted-foreground hover:text-destructive inline-flex items-center gap-0.5",title:f("mapWidget.deleteRouteTitle"),children:[(0,d.jsx)(n.A,{className:"h-3 w-3"}),f("mapWidget.delete")]})]})}),(0,d.jsx)("ul",{className:"space-y-1",children:E.map((a,b)=>{let c=I.indexOf(b);return(0,d.jsxs)("li",{className:"flex items-start gap-2 rounded-md border bg-card px-2 py-1.5 text-xs "+(x&&c>=0?"ring-1 ring-violet-400 border-violet-300":""),children:[x?(0,d.jsx)("button",{type:"button",onClick:()=>A(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b]),className:"h-5 w-5 mt-0.5 shrink-0 rounded-full border text-[10px] font-mono inline-flex items-center justify-center "+(c>=0?"bg-violet-600 text-white border-violet-600":"bg-card text-muted-foreground"),title:c>=0?f("mapWidget.removeFromRoute"):f("mapWidget.addToRoute"),children:c>=0?c+1:"+"}):(0,d.jsx)(D,{className:"h-3 w-3 mt-1 shrink-0 "+(H.includes(b)?"text-violet-600":"text-emerald-700")}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"font-medium truncate",children:a.title}),a.description&&(0,d.jsx)("p",{className:"text-muted-foreground leading-snug mt-0.5 line-clamp-2",children:a.description}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:[a.lat.toFixed(5),", ",a.lng.toFixed(5)]})]}),(0,d.jsx)(J,{point:a,services:M,interactive:N,onRemove:()=>void Q(b)})]},b)})})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("mapWidget.noPointsReadonly")})},"utility-card":function({rootId:a,data:b,readonly:c}){let f=(0,e.c)("roots"),g="project"===b.utilityScope?`/utilities/project/${b.utilityId}?rootId=${encodeURIComponent(a)}`:`/utilities/global/${b.utilityId}`;return(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,d.jsx)(L.A,{className:"h-3 w-3 text-violet-600"}),(0,d.jsx)("span",{children:f("utilityCardWidget.miniAppLabel")}),(0,d.jsx)("span",{className:"font-mono normal-case tracking-normal text-muted-foreground/80",children:b.utilityId}),(0,d.jsxs)(y(),{href:g,className:"ml-auto inline-flex items-center gap-0.5 text-[10px] text-violet-700 hover:underline normal-case tracking-normal",title:f("utilityCardWidget.openFullTitle"),children:[f("utilityCardWidget.openLabel"),(0,d.jsx)(j.A,{className:"h-2.5 w-2.5"})]})]}),b.inner.title&&(0,d.jsx)("h4",{className:"text-sm font-medium",children:b.inner.title}),b.inner.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground -mt-1",children:b.inner.description}),(0,d.jsx)("div",{children:N(a,b.inner.kind,b.inner.data,{readonly:!0})})]})}};function N(a,b,c,e){let f=M[b];return f?(0,d.jsx)(f,{rootId:a,data:c,readonly:e?.readonly??!1,onPatch:e?.onPatch}):(0,d.jsx)(O,{kind:b})}function O({kind:a}){let b=(0,e.c)("roots");return(0,d.jsx)("p",{className:"text-xs text-destructive",children:b.rich("widgetsCommon.unknownKind",{kind:a,code:a=>(0,d.jsx)("code",{className:"font-mono",children:a})})})}},11090:(a,b,c)=>{"use strict";c.d(b,{p:()=>x});var d=c(64173),e=c(17240),f=c(71813),g=c(90775),h=c(56992),i=c(39755),j=c(66979),k=c(14878),l=c(62261),m=c(69552),n=c(96705),o=c(13530),p=c(12619),q=c(73569),r=c(44052),s=c(20583),t=c(47071),u=c(3265);let v=(0,u.createServerReference)("408c0ad85dae45d66a47ce63a7e36c290ec25af47d",u.callServer,void 0,u.findSourceMapURL,"summarizeYoutubeAction");var w=c(71883);function x({source:a,onSendToChat:b,autoSummarizeYoutube:c}){let[f,j]=(0,e.useState)(null);return(0,d.jsxs)("div",{className:"prose prose-neutral dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-foreground [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_:not(pre)>code]:text-[0.9em] [&_code]:font-mono [&_table]:text-sm",children:[(0,d.jsx)(g.oz,{remarkPlugins:[h.A],rehypePlugins:[[i.A,{detect:!0,ignoreMissing:!0}]],components:{a:({href:a,children:e,...f})=>{let g=a?function(a){try{let b=new URL(a),c=b.hostname.replace(/^www\./,"");if("youtu.be"===c){let a=b.pathname.slice(1).split("/")[0];return a&&/^[A-Za-z0-9_-]{6,}$/.test(a)?a:null}if("youtube.com"===c||"m.youtube.com"===c||"youtube-nocookie.com"===c){if("/watch"===b.pathname){let a=b.searchParams.get("v");return a&&/^[A-Za-z0-9_-]{6,}$/.test(a)?a:null}let a=/^\/(shorts|embed|live|v)\/([^/?#]+)/.exec(b.pathname);if(a&&/^[A-Za-z0-9_-]{6,}$/.test(a[2]))return a[2]}}catch{}return null}(a):null;return g&&a?(0,d.jsx)(A,{url:a,videoId:g,autoSummarize:c??!1,...b?{onSendToChat:b}:{}}):(0,d.jsx)("a",{href:a,...f,children:e})},img:({src:a,alt:b,title:c})=>"string"!=typeof a||0===a.length?null:(0,d.jsx)(y,{src:a,alt:"string"==typeof b?b:"",title:"string"==typeof c?c:void 0,onZoom:a=>j(a)})},children:a}),f&&(0,d.jsx)(z,{src:f.src,alt:f.alt,onClose:()=>j(null)})]})}function y({src:a,alt:b,title:c,onZoom:e}){let g=(0,f.c)("roots");return(0,d.jsx)("img",{src:a,alt:b,title:c??b??g("markdown.openFullscreen"),onClick:()=>e({src:a,alt:b}),className:"cursor-zoom-in rounded-md border bg-muted/40 transition hover:opacity-90",loading:"lazy"})}function z({src:a,alt:b,onClose:c}){let g=(0,f.c)("roots");return(0,e.useCallback)(a=>{"Escape"===a.key&&c()},[c]),(0,d.jsxs)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center p-6 bg-background/85 backdrop-blur-sm cursor-zoom-out",onClick:c,role:"dialog","aria-label":b||g("markdown.imagePreview"),children:[(0,d.jsx)(s.$,{type:"button",size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-9 w-9 bg-card/80 hover:bg-card",onClick:a=>{a.stopPropagation(),c()},"aria-label":g("markdown.closeAria"),children:(0,d.jsx)(j.A,{className:"h-5 w-5"})}),(0,d.jsx)("img",{src:a,alt:b,className:"max-h-full max-w-full object-contain rounded-lg shadow-2xl",onClick:a=>a.stopPropagation()}),b&&(0,d.jsx)("div",{className:"absolute bottom-6 inset-x-0 mx-auto max-w-3xl px-6 text-center text-sm text-foreground/80 pointer-events-none",children:b})]})}function A({url:a,videoId:b,onSendToChat:c,autoSummarize:g}){let h=(0,f.c)("roots"),[i,u]=(0,e.useTransition)(),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1);(0,e.useRef)(!1);let F=()=>{y(null),u(async()=>{let b=await v({url:a});if(b.ok){y(b.text),A(!1);return}if(b.needsKey)return void A(!0);r.oR.error(b.error)})},G=async()=>{if(!B.trim())return void r.oR.error(h("markdown.enterKey"));E(!0);try{let a=await (0,w.A)(B.trim());if(!a.ok)return void r.oR.error(a.error);r.oR.success(h("markdown.geminiKeySaved")),C(""),A(!1),F()}finally{E(!1)}};return(0,d.jsxs)("span",{className:"not-prose my-4 block rounded-lg border bg-card overflow-hidden",children:[(0,d.jsx)("span",{className:"relative block w-full",style:{paddingTop:"56.25%"},children:(0,d.jsx)("iframe",{src:`https://www.youtube-nocookie.com/embed/${b}`,className:"absolute inset-0 h-full w-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0,title:"YouTube video"})}),(0,d.jsxs)("span",{className:"flex items-center gap-2 p-2 border-t bg-muted/30",children:[(0,d.jsx)(k.A,{className:"h-4 w-4 text-red-600 shrink-0"}),(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:underline truncate flex-1 min-w-0",children:a}),(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"outline",onClick:F,disabled:i,className:"gap-1 shrink-0 h-7",children:[i?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(m.A,{className:"h-3 w-3"}),h("markdown.summarize")]})]}),z&&(0,d.jsxs)("span",{className:"block border-t bg-amber-50/60 p-3 space-y-2",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2 text-xs text-amber-900",children:[(0,d.jsx)(n.A,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"font-medium",children:h("markdown.needsGeminiKey")})]}),(0,d.jsx)("span",{className:"block text-[11px] text-amber-900/80",children:h.rich("markdown.geminiKeyHelp",{link:()=>(0,d.jsx)("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"aistudio.google.com/apikey"}),path:()=>(0,d.jsx)("code",{className:"font-mono",children:"~/.reflex/api-keys/gemini.json"}),modelsList:()=>(0,d.jsx)("code",{className:"font-mono",children:"models.list"})})}),(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(t.p,{type:"password",value:B,onChange:a=>C(a.target.value),placeholder:"AIza…",className:"font-mono text-xs h-8 flex-1",disabled:D}),(0,d.jsxs)(s.$,{type:"button",size:"sm",onClick:()=>void G(),disabled:D||!B.trim(),className:"h-8 gap-1",children:[D?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(o.A,{className:"h-3 w-3"}),h("markdown.saveAndContinue")]}),(0,d.jsx)(s.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>A(!1),className:"h-8 w-8",children:(0,d.jsx)(j.A,{className:"h-3.5 w-3.5"})})]})]}),x&&(0,d.jsxs)("span",{className:"block border-t p-3 space-y-2",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2 text-[11px] uppercase tracking-wider text-muted-foreground",children:[(0,d.jsx)(p.A,{className:"h-3 w-3 text-emerald-600"}),"Gemini summary",(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"ghost",onClick:F,className:"ml-auto h-6 text-[10px] gap-1",disabled:i,children:[i?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(m.A,{className:"h-3 w-3"}),h("markdown.redo")]}),c&&(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"outline",onClick:()=>c(x,a),className:"h-6 text-[10px] gap-1",children:[(0,d.jsx)(q.A,{className:"h-3 w-3"}),h("markdown.toChat")]})]}),(0,d.jsx)("span",{className:"block",children:(0,d.jsx)("span",{className:"block text-sm whitespace-pre-wrap leading-relaxed",children:x})})]})]})}},30515:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},34639:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Aq:()=>o,KV:()=>u,Mh:()=>s,cl:()=>v,hL:()=>p,mm:()=>t,ru:()=>r,tT:()=>q});var e=c(73745);c(66493);var f=c(65326),g=c(53905),h=c(69509),i=c(1405),j=c(93554),k=c(51021),l=c(63781),m=a([j,k]);async function n(a,b){let c=await (0,h.listWidgets)(a),d=await (0,h.readLayout)(a),e=b(d),f=(0,h.reconcileLayout)(e,c.map(a=>a.id),i.SYSTEM_WIDGET_IDS);return await (0,h.writeLayout)(a,f),{ok:!0,layout:f}}async function o(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({...a,order:b.filter(b=>!a.hidden.includes(b))}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function p(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({order:a.order.filter(a=>a!==b),hidden:[...new Set([b,...a.hidden])]}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function q(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({order:[b,...a.order.filter(a=>a!==b)],hidden:a.hidden.filter(a=>a!==b)}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function r(a,b,c,d){try{let e=await (0,g.Zn)(a);if(!e)return{ok:!1,error:"Root not found"};let i=await (0,h.readWidget)(e.path,b);if(!i)return{ok:!1,error:"Widget not found"};if(!c||"object"!=typeof c)return{ok:!1,error:"newData must be an object"};let j={...i,data:c,updatedAt:new Date().toISOString(),...void 0!==d?{memory:d}:{}};return await (0,h.writeWidget)(e.path,j),(0,f.revalidatePath)(`/roots/${a}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function s(a,b,c){try{let d=await (0,g.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await n(d.path,a=>({...a,sizes:{...a.sizes??{},[b]:c}}));return(0,f.revalidatePath)(`/roots/${a}`),e}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function t(a,b,c){try{let d=await (0,g.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await (0,h.readWidget)(d.path,b);if(!e)return{ok:!1,error:"Widget not found"};let i={...e,refresh:c};return await (0,h.writeWidget)(d.path,i),(0,f.revalidatePath)(`/roots/${a}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function u(a,b){try{let d=await (0,g.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await (0,h.readWidget)(d.path,b);if(!e)return{ok:!1,error:"Widget not found"};if(!e.sourceTopicId)return{ok:!1,error:"Widget has no source topic — update it from any chat first."};if(j.z.isActive(e.sourceTopicId))return{ok:!1,error:"The source topic is already occupied by an agent — wait for the current turn to finish."};let f={...e,lastRefreshAt:new Date().toISOString()};await (0,h.writeWidget)(d.path,f);let{buildRefreshPromptForWidget:i}=await c.e(4553).then(c.bind(c,94553)),l=await i(d.path,f),m=await (0,k.W)({rootId:a,topicId:e.sourceTopicId,message:l,attachments:[]});if("error"in m)return{ok:!1,error:m.error};return{ok:!0,agentId:m.agentId}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function v(a,b){try{if(i.SYSTEM_WIDGET_IDS.includes(b))return{ok:!1,error:"System widget cannot be deleted — only hidden."};let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};await (0,h.uv)(c.path,b);let d=await n(c.path,a=>({order:a.order.filter(a=>a!==b),hidden:a.hidden.filter(a=>a!==b)}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}[j,k]=m.then?(await m)():m,(0,l.D)([o,p,q,r,s,t,u,v]),(0,e.A)(o,"608f028ad74cfe4b7ae15960871d695e1cfc25de7c",null),(0,e.A)(p,"60500860b41d0ab1e6c6657111ca40fdda8ce7afab",null),(0,e.A)(q,"600511d2cb84a2ceabb4b62bbf0286dfdd888078ed",null),(0,e.A)(r,"789fccf65ed6f2f7db808c6867ed11fd1129d1ce91",null),(0,e.A)(s,"7040e3dc047efa96c3c9111e517343785985b3e040",null),(0,e.A)(t,"7091c1a7bb8977e9c27d4a114dc26ea06278172c84",null),(0,e.A)(u,"60b0f08fd473c27ea347b31c7944a2c2ea795fc367",null),(0,e.A)(v,"6009e206c0d3d6b007dc4e7ce95600f9ce84d54020",null),d()}catch(a){d(a)}})},48272:(a,b,c)=>{"use strict";c.d(b,{w:()=>f});var d=c(73745);c(66493);var e=c(36017);async function f(){return{ok:!0,enabled:(await (0,e.M)()).mapServices.enabled}}(0,c(63781).D)([f]),(0,d.A)(f,"00c88ea8b4e421083e566a83707b9cc8a26fec2b9f",null)},54874:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},62481:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},71883:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(3265);let e=(0,d.createServerReference)("40b0a116af1bfb9f70336ace63436ef128cfd4c6b6",d.callServer,void 0,d.findSourceMapURL,"saveGeminiKeyAction")},80432:()=>{},85134:(a,b,c)=>{"use strict";c.d(b,{t:()=>e});var d=c(3265);let e=(0,d.createServerReference)("600511d2cb84a2ceabb4b62bbf0286dfdd888078ed",d.callServer,void 0,d.findSourceMapURL,"restoreWidgetAction")},85548:(a,b,c)=>{"use strict";function d(a){return`${a.lat},${a.lng}`}function e(a){return`${a.lng},${a.lat}`}c.d(b,{JY:()=>g,yp:()=>f});let f=[{id:"google",label:"Google Maps",description:"Global, navigation + street view. Works everywhere except where the RF blocks it.",brand:"#4285F4",glyph:"G",urlFor:(a,b)=>`https://www.google.com/maps/dir/?api=1&destination=${a},${b}`,routeUrlFor:a=>{if(a.length<2)return"";let b=d(a[0]),c=d(a[a.length-1]),e=a.slice(1,-1).map(d).join("|"),f=e?`&waypoints=${encodeURIComponent(e)}`:"";return`https://www.google.com/maps/dir/?api=1&origin=${b}&destination=${c}${f}`}},{id:"yandex",label:"Yandex Maps",description:"CIS region, best RF detail and real-time traffic.",brand:"#FFCC00",glyph:"Y",urlFor:(a,b)=>`https://yandex.ru/maps/?rtext=~${a},${b}&rtt=auto`,routeUrlFor:a=>`https://yandex.ru/maps/?rtext=${a.map(d).join("~")}&rtt=auto`},{id:"2gis",label:"2GIS",description:"CIS region, precise addresses and POI. Uniquely strong on RF cities.",brand:"#1BA049",glyph:"2",urlFor:(a,b)=>`https://2gis.ru/routeSearch/to/${b},${a}`,routeUrlFor:a=>{let b=e(a[0]),c=e(a[a.length-1]),d=a.slice(1,-1).map(a=>`/via/${e(a)}`).join("");return`https://2gis.ru/routeSearch/rsType/car/from/${b}${d}/to/${c}`}},{id:"apple",label:"Apple Maps",description:"Opens in the native app on iOS/macOS, otherwise on the website.",brand:"#1d1d1f",glyph:"A",urlFor:(a,b)=>`https://maps.apple.com/?daddr=${a},${b}`,routeUrlFor:a=>{let b=d(a[0]),c=a.slice(1).map(a=>`+to:${d(a)}`).join("");return`https://maps.apple.com/?saddr=${b}&daddr=${b}${c}`}},{id:"osm",label:"OpenStreetMap",description:"Open data, no account required. Basic navigation.",brand:"#7EB73F",glyph:"OSM",urlFor:(a,b)=>`https://www.openstreetmap.org/directions?to=${a},${b}`,routeUrlFor:a=>{let b=a.map(d).join(";");return`https://www.openstreetmap.org/directions?route=${encodeURIComponent(b)}`}},{id:"waze",label:"Waze",description:"Car navigation with crowd-sourced traffic and alerts.",brand:"#33CCFF",glyph:"W",urlFor:(a,b)=>`https://waze.com/ul?ll=${a},${b}&navigate=yes`,routeUrlFor:a=>{let b=a[a.length-1];return`https://waze.com/ul?ll=${b.lat},${b.lng}&navigate=yes`}},{id:"organic",label:"Organic Maps",description:"Offline maps with open data. Opens in the app.",brand:"#006C35",glyph:"OM",urlFor:(a,b)=>`om://map?ll=${a},${b}`,routeUrlFor:a=>{let b=a[0],c=a[a.length-1];return`om://route?sll=${b.lat},${b.lng}&saddr=&dll=${c.lat},${c.lng}&daddr=&type=vehicle`}}],g=["google","yandex","apple","osm"]},90160:()=>{}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=3635,exports.ids=[3635],exports.modules={17596:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(19963).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},24576:(a,b,c)=>{"use strict";c.d(b,{Zn:()=>p,_S:()=>q,mM:()=>l,qV:()=>o});var d=c(73024),e=c(76760),f=c.n(e),g=c(77598),h=c.n(g);let i=(0,c(29163)._)(),j=f().join(i,"registry.json"),k={version:1,entries:[]};function l(a){return h().createHash("sha1").update(f().resolve(a)).digest("hex").slice(0,16)}async function m(){try{let a=await d.promises.readFile(j,"utf8"),b=JSON.parse(a);if("object"==typeof b&&null!==b&&"entries"in b&&Array.isArray(b.entries))return b;return k}catch(a){if("object"==typeof a&&null!==a&&"code"in a&&"ENOENT"===a.code)return k;throw a}}async function n(a){await d.promises.mkdir(i,{recursive:!0}),await d.promises.writeFile(j,JSON.stringify(a,null,2)+"\n","utf8")}async function o(){return[...(await m()).entries].sort((a,b)=>Date.parse(b.addedAt)-Date.parse(a.addedAt))}async function p(a){return(await m()).entries.find(b=>b.id===a)??null}async function q(a){let b=f().resolve(a),c=l(b),d=await m(),e=d.entries.find(a=>a.id===c);if(e)return e;let g={id:c,path:b,addedAt:new Date().toISOString()};return await n({...d,entries:[...d.entries,g]}),g}},26290:(a,b,c)=>{"use strict";c.d(b,{cn:()=>f});var d=c(83243),e=c(86103);function f(...a){return(0,e.QP)((0,d.$)(a))}},29163:(a,b,c)=>{"use strict";c.d(b,{_:()=>h});var d=c(48161),e=c.n(d),f=c(76760),g=c.n(f);function h(){let a=process.env.REFLEX_HOME;return a&&a.length>0?a:g().join(e().homedir(),".reflex")}},34818:(a,b,c)=>{Promise.resolve().then(c.bind(c,60524)),Promise.resolve().then(c.bind(c,50155)),Promise.resolve().then(c.bind(c,26922)),Promise.resolve().then(c.bind(c,79008)),Promise.resolve().then(c.bind(c,68146)),Promise.resolve().then(c.bind(c,60936)),Promise.resolve().then(c.bind(c,65138)),Promise.resolve().then(c.bind(c,68902)),Promise.resolve().then(c.bind(c,69644)),Promise.resolve().then(c.bind(c,49186)),Promise.resolve().then(c.bind(c,93099)),Promise.resolve().then(c.bind(c,83594)),Promise.resolve().then(c.bind(c,24375)),Promise.resolve().then(c.bind(c,67135)),Promise.resolve().then(c.bind(c,85105)),Promise.resolve().then(c.bind(c,41886)),Promise.resolve().then(c.bind(c,33309)),Promise.resolve().then(c.bind(c,37550)),Promise.resolve().then(c.bind(c,96623)),Promise.resolve().then(c.bind(c,77372)),Promise.resolve().then(c.bind(c,65478)),Promise.resolve().then(c.bind(c,97230)),Promise.resolve().then(c.bind(c,73552)),Promise.resolve().then(c.bind(c,391)),Promise.resolve().then(c.bind(c,4235)),Promise.resolve().then(c.bind(c,41138)),Promise.resolve().then(c.bind(c,60877)),Promise.resolve().then(c.bind(c,7671)),Promise.resolve().then(c.bind(c,5637)),Promise.resolve().then(c.bind(c,36786)),Promise.resolve().then(c.t.bind(c,20594,23))},50895:(a,b,c)=>{"use strict";c.d(b,{A:()=>i});var d=c(34750),e=c(22708),f=c(1278),g=c(14851),h=(0,d.cache)(function(a,b){return function({_cache:a=(0,f.b)(),_formatters:b=(0,f.c)(a),getMessageFallback:c=g.d,messages:d,namespace:e,onError:h=g.b,...i}){return function({messages:a,namespace:b,...c},d){return a=a["!"],b=(0,g.r)(b,"!"),(0,g.a)({...c,messages:a,namespace:b})}({...i,onError:h,cache:a,formatters:b,getMessageFallback:c,messages:{"!":d},namespace:e?`!.${e}`:"!"},"!")}({...a,namespace:b})}),i=(0,d.cache)(async function(a){let b,c;return"string"==typeof a?b=a:a&&(c=a.locale,b=a.namespace),h(await (0,e.A)(c),b)})},52970:(a,b,c)=>{Promise.resolve().then(c.bind(c,68394)),Promise.resolve().then(c.bind(c,51189)),Promise.resolve().then(c.bind(c,66180)),Promise.resolve().then(c.bind(c,75266)),Promise.resolve().then(c.bind(c,14360)),Promise.resolve().then(c.bind(c,6786)),Promise.resolve().then(c.bind(c,44896)),Promise.resolve().then(c.bind(c,14848)),Promise.resolve().then(c.bind(c,53710)),Promise.resolve().then(c.bind(c,30544)),Promise.resolve().then(c.bind(c,13829)),Promise.resolve().then(c.bind(c,90044)),Promise.resolve().then(c.bind(c,57673)),Promise.resolve().then(c.bind(c,97053)),Promise.resolve().then(c.bind(c,43151)),Promise.resolve().then(c.bind(c,12156)),Promise.resolve().then(c.bind(c,71615)),Promise.resolve().then(c.bind(c,4080)),Promise.resolve().then(c.bind(c,87177)),Promise.resolve().then(c.bind(c,87634)),Promise.resolve().then(c.bind(c,6912)),Promise.resolve().then(c.bind(c,13976)),Promise.resolve().then(c.bind(c,18282)),Promise.resolve().then(c.bind(c,20633)),Promise.resolve().then(c.bind(c,61193)),Promise.resolve().then(c.bind(c,66188)),Promise.resolve().then(c.bind(c,66643)),Promise.resolve().then(c.bind(c,81669)),Promise.resolve().then(c.bind(c,39991)),Promise.resolve().then(c.bind(c,54972)),Promise.resolve().then(c.t.bind(c,1056,23))},60524:(a,b,c)=>{"use strict";c.d(b,{Separator:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call Separator() from the server but Separator is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/components/ui/separator.tsx","Separator")},67248:(a,b,c)=>{"use strict";c.d(b,{E:()=>i});var d=c(63003);c(34750);var e=c(86209),f=c(65715),g=c(26290);let h=(0,e.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function i({className:a,variant:b="default",asChild:c=!1,...e}){let i=c?f.bL:"span";return(0,d.jsx)(i,{"data-slot":"badge","data-variant":b,className:(0,g.cn)(h({variant:b}),a),...e})}},73250:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{"00b61a40fac9b21ad6f4e4a76e87038390efedf684":()=>g.i,"400b14da94f93e958c4820fd255e1dba2e675ee5f0":()=>e.nC,"402cdd8397ff9d25cf4ad96075ea3622884b135a60":()=>h.$z,"4035e97d85d70e8eaaa8557d97eb59e375c117b7ed":()=>f.z,"404831e19a27eaf506c581594c309ef4e315f8d1f4":()=>h.MU,"404d0691571f379f1db2b8d7dbf5fcdeafee79e0fc":()=>f.u,"4059b8409808eb39568df1892a8b5fd4e837e3d373":()=>e.nY,"60ac998057a449ec671cc27babf2c5ce2a9f8c3995":()=>h.Tc,"60c82dbc54ebebde5ee157e85e01721ad76126b665":()=>e.L4,"60c8f40603d8894bb9dca7e05ed01a48c9a8eaa186":()=>e.T$,"60dea53b5c3903235447bf5cd591581728eb160d4a":()=>e.OQ,"7027419a080ac59b35fddc6e37eabafe99c092b625":()=>e.h$,"78c5512a5e07397f4abcfe04dfa901cfa1b305a904":()=>e.g3});var e=c(13415),f=c(3890),g=c(50995),h=c(15754),i=a([e,h]);[e,h]=i.then?(await i)():i,d()}catch(a){d(a)}})},84913:(a,b,c)=>{"use strict";c.d(b,{$:()=>i});var d=c(63003);c(34750);var e=c(86209),f=c(65715),g=c(26290);let h=(0,e.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function i({className:a,variant:b="default",size:c="default",asChild:e=!1,...i}){let j=e?f.bL:"button";return(0,d.jsx)(j,{"data-slot":"button","data-variant":b,"data-size":c,className:(0,g.cn)(h({variant:b,size:c,className:a})),...i})}}};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=3868,exports.ids=[3868],exports.modules={14810:(a,b,c)=>{c.d(b,{N:()=>e});var d=c(3265);let e=(0,d.createServerReference)("00b0deb580b821c13cd7747b74bb8d461e8fbb8922",d.callServer,void 0,d.findSourceMapURL,"getTunnelStatusAction")},16856:(a,b,c)=>{c.d(b,{Is:()=>g,L8:()=>h,ns:()=>i});var d=c(73745);c(66493);var e=c(65326),f=c(30878);async function g(a){try{if("utility"===a.kind&&(!a.utilityId||!a.utilityScope))return{ok:!1,error:"share kind=utility requires utilityId + utilityScope"};if("kb-file"===a.kind&&(!a.rootId||!a.kbRelPath))return{ok:!1,error:"share kind=kb-file requires rootId + kbRelPath"};if(("kb-tree"===a.kind||"project"===a.kind)&&!a.rootId)return{ok:!1,error:`share kind=${a.kind} requires rootId`};let b=await (0,f.cn)(a);return(0,e.revalidatePath)("/settings"),{ok:!0,share:b}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function h(){return{shares:await (0,f.Bg)()}}async function i(a){let b=await (0,f.Ru)(a);return(0,e.revalidatePath)("/settings"),{ok:b}}(0,c(63781).D)([g,h,i]),(0,d.A)(g,"40d743a93d1471d5f57fe5f4440fb41cb460706bd1",null),(0,d.A)(h,"00ed88f596870410ad47d1256a36378907bba6411b",null),(0,d.A)(i,"40626117cb2bab0b0c8473199e2e3278a5061e6b58",null)},30878:(a,b,c)=>{c.d(b,{BE:()=>o,Bg:()=>m,Ru:()=>q,cn:()=>p,er:()=>n});var d=c(73024),e=c(76760),f=c.n(e),g=c(77598),h=c.n(g),i=c(73652);let j=f().join((0,i._)(),"shares.json");async function k(){try{let a=await d.promises.readFile(j,"utf8"),b=JSON.parse(a);if(b&&Array.isArray(b.shares))return b}catch{}return{version:1,shares:[]}}async function l(a){await d.promises.mkdir(f().dirname(j),{recursive:!0}),await d.promises.writeFile(j,JSON.stringify(a,null,2)+"\n",{mode:384})}async function m(){return(await k()).shares}async function n(a){return(await k()).shares.find(b=>b.id===a)??null}function o(a,b){if(!a.passwordHash)return!0;if(!a.passwordSalt)return!1;let c=h().createHash("sha256").update(a.passwordSalt+":"+b).digest("hex");return h().timingSafeEqual(Buffer.from(c,"hex"),Buffer.from(a.passwordHash,"hex"))}async function p(a){let b=await k(),c={id:function(){let a="abcdefghjkmnpqrstuvwxyz23456789",b="";for(let c=0;c<12;c++)b+=a[h().randomInt(0,a.length)];return b}(),kind:a.kind,createdAt:new Date().toISOString(),...a.rootId?{rootId:a.rootId}:{},...a.utilityScope?{utilityScope:a.utilityScope}:{},...a.utilityId?{utilityId:a.utilityId}:{},...a.kbRelPath?{kbRelPath:a.kbRelPath}:{},...a.expiresAt?{expiresAt:a.expiresAt}:{},...a.label?{label:a.label}:{}};if(a.password){let{salt:b,hash:d}=function(a){let b=h().randomBytes(16).toString("hex"),c=h().createHash("sha256").update(b+":"+a).digest("hex");return{salt:b,hash:c}}(a.password);c.passwordSalt=b,c.passwordHash=d}return b.shares=[c,...b.shares],await l(b),c}async function q(a){let b=await k(),c=b.shares.length;return b.shares=b.shares.filter(b=>b.id!==a),b.shares.length!==c&&(await l(b),!0)}},42382:(a,b,c)=>{c.d(b,{E:()=>i});var d=c(64173);c(17240);var e=c(20483),f=c(91520),g=c(91344);let h=(0,e.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function i({className:a,variant:b="default",asChild:c=!1,...e}){let i=c?f.bL:"span";return(0,d.jsx)(i,{"data-slot":"badge","data-variant":b,className:(0,g.cn)(h({variant:b}),a),...e})}},47071:(a,b,c)=>{c.d(b,{p:()=>f});var d=c(64173);c(17240);var e=c(91344);function f({className:a,type:b,...c}){return(0,d.jsx)("input",{type:b,"data-slot":"input",className:(0,e.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",a),...c})}},60524:(a,b,c)=>{c.d(b,{Separator:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call Separator() from the server but Separator is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/components/ui/separator.tsx","Separator")},80281:(a,b,c)=>{c.d(b,{J:()=>g});var d=c(64173);c(17240);var e=c(90044),f=c(91344);function g({className:a,...b}){return(0,d.jsx)(e.Root,{"data-slot":"label",className:(0,f.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...b})}},92814:(a,b,c)=>{c.d(b,{Ng:()=>s,bt:()=>v,Zl:()=>w,Nt:()=>t,Fm:()=>u});var d=c(73745);c(66493);var e=c(65326),f=c(36017),g=c(31421),h=c(73024),i=c(76760),j=c.n(i),k=c(73652);let l="__reflex_ngrok_tunnel__";function m(){return globalThis[l]}function n(a){globalThis[l]=a}async function o(a){let b;if(!a.authtoken)return{ok:!1,error:"ngrok authtoken is required"};let c=m();if(c&&null===c.child.exitCode)return{ok:!1,error:"Tunnel already running — stop it first."};let d=(0,k._)();await h.promises.mkdir(d,{recursive:!0});let e=j().join(d,"ngrok.yml");await h.promises.writeFile(e,`version: 3
|
|
2
|
-
agent:
|
|
3
|
-
authtoken: ${a.authtoken}
|
|
4
|
-
`,{mode:384});let f=["http",String(a.port),"--config",e,"--log","stdout","--log-format","json"];a.domain&&f.push(`--domain=${a.domain}`);try{b=(0,g.spawn)("ngrok",f,{detached:!1,stdio:["ignore","pipe","pipe"]})}catch(a){return{ok:!1,error:"Failed to spawn ngrok — is the CLI installed and on PATH? "+(a instanceof Error?a.message:String(a))}}return b.on("error",a=>{console.error("[ngrok] spawn error:",a)}),b.on("exit",(a,c)=>{console.log(`[ngrok] tunnel exited code=${a} signal=${c??"-"}`);let d=m();d?.child===b&&n(void 0)}),b.stdout?.on("data",a=>{let b=a.toString().trim();b&&console.log("[ngrok]",b)}),b.stderr?.on("data",a=>{let b=a.toString().trim();b&&console.error("[ngrok!]",b)}),n({child:b,startedAt:new Date().toISOString(),port:a.port,...a.domain?{domain:a.domain}:{}}),{ok:!0}}async function p(){let a=Date.now()+6e3;for(;Date.now()<a;){try{let a=await fetch("http://127.0.0.1:4040/api/tunnels");if(a.ok){let b=await a.json(),c=b.tunnels.find(a=>"https"===a.proto),d=b.tunnels[0],e=c?.public_url??d?.public_url;if(e){let a=m();return a&&(a.publicUrl=e,n(a)),e}}}catch{}await new Promise(a=>setTimeout(a,400))}return null}async function q(){return new Promise(a=>{try{let b=(0,g.spawn)("ngrok",["version"],{stdio:["ignore","pipe","ignore"]}),c="";b.stdout?.on("data",a=>{c+=a.toString()}),b.on("close",()=>a(c.trim()||null)),b.on("error",()=>a(null))}catch{a(null)}})}async function r(a){if(!a)return{ok:!1,error:"ngrok API key not configured"};try{let b=await fetch("https://api.ngrok.com/reserved_domains",{headers:{Authorization:`Bearer ${a}`,"Ngrok-Version":"2"}});if(!b.ok)return{ok:!1,error:`ngrok API ${b.status}: ${(await b.text()).slice(0,200)}`};let c=await b.json();return{ok:!0,domains:(c.reserved_domains??[]).map(a=>({id:a.id,domain:a.domain,region:a.region}))}}catch(a){return{ok:!1,error:"ngrok API call failed: "+(a instanceof Error?a.message:String(a))}}}async function s(){let a=function(){let a=m();return a?null!==a.child.exitCode?(n(void 0),{running:!1}):{running:!0,...a.publicUrl?{publicUrl:a.publicUrl}:{},startedAt:a.startedAt,port:a.port,...a.domain?{domain:a.domain}:{}}:{running:!1}}();return{status:a,cliVersion:await q(),publicHost:process.env.REFLEX_NGROK_HOST??null}}async function t(){let a=await (0,f.M)();if(!a.ngrok.authtoken)return{ok:!1,error:"ngrok.authtoken is empty — fill it in the settings above."};let b=await o({port:a.ngrok.port,authtoken:a.ngrok.authtoken,...a.ngrok.domain?{domain:a.ngrok.domain}:{}});if(!b.ok)return b;let c=await p();if(c)try{let a=new URL(c);process.env.REFLEX_NGROK_HOST=a.host}catch{}return(0,e.revalidatePath)("/settings"),{ok:!0,publicUrl:c}}async function u(){let a=await new Promise(a=>{let b=m();if(!b)return void a(!1);let{child:c}=b,d=!1,e=b=>{d||(d=!0,n(void 0),a(b))};if(c.once("exit",()=>e(!0)),null!==c.exitCode)return void e(!0);try{c.kill("SIGTERM")}catch(a){console.error("[ngrok] SIGTERM failed:",a)}setTimeout(()=>{if(!d){try{c.kill("SIGKILL")}catch{}e(!0)}},2500)});return delete process.env.REFLEX_NGROK_HOST,(0,e.revalidatePath)("/settings"),{ok:a}}async function v(a){try{let b=await (0,f.M)(),c={...b,ngrok:{...b.ngrok,...a}};return await (0,f.D)(c),(0,e.revalidatePath)("/settings"),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function w(){return r((await (0,f.M)()).ngrok.apiKey)}(0,c(63781).D)([s,t,u,v,w]),(0,d.A)(s,"00b0deb580b821c13cd7747b74bb8d461e8fbb8922",null),(0,d.A)(t,"00cb7bf650409cb042160f9091c01d274a508cd66e",null),(0,d.A)(u,"007940bf808154f76026b158effd8381461416bda8",null),(0,d.A)(v,"40bbbfbf70cc4f50aa1312ef994664910de49789b4",null),(0,d.A)(w,"00b1b8c26254a90b5cbca1823c1d7e78df881a2736",null)}};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=6149,exports.ids=[6149],exports.modules={7924:(a,b,c)=>{c.d(b,{h:()=>e});var d=c(3265);let e=(0,d.createServerReference)("7027419a080ac59b35fddc6e37eabafe99c092b625",d.callServer,void 0,d.findSourceMapURL,"generateTopicTitleAction")},12650:(a,b,c)=>{c.d(b,{E:()=>f});var d=c(64173),e=c(91344);function f({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"skeleton",className:(0,e.cn)("animate-pulse rounded-md bg-accent",a),...b})}},14425:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},15620:(a,b,c)=>{c.d(b,{CommandBar:()=>o});var d=c(64173),e=c(17240),f=c(87671),g=c(71813),h=c(73569),i=c(44052),j=c(41414),k=c(7924),l=c(8836),m=c(88724),n=c(70199);function o({rootId:a,focusFile:b}){let c=(0,g.c)("roots"),[,o]=(0,e.useTransition)(),p=(0,f.useRouter)();return(0,d.jsx)(l.E,{label:c("commandBar.label"),children:(0,d.jsx)(n.L,{rootId:a,placeholder:c("commandBar.placeholder"),submitLabel:c("commandBar.submit"),pendingLabel:c("commandBar.submitPending"),SubmitIcon:h.A,onSubmit:async({message:d,attachments:e})=>await new Promise(f=>{o(async()=>{let g=await (0,j.g)(a,d,e,b);if(!g.ok){i.oR.error(g.error??c("commandBar.startFailed")),f(!1);return}(0,m.$d)(m.Zi.topicsChanged(a)),d.trim()&&(0,k.h)(a,g.topicId,d).then(b=>{b.ok&&(0,m.$d)(m.Zi.topicsChanged(a))}),p.push(`/roots/${a}/chat/${g.topicId}`),f(!0)})})})})}},16551:(a,b,c)=>{c.d(b,{Xi:()=>k,av:()=>l,j7:()=>j,tU:()=>h});var d=c(64173);c(17240);var e=c(20483),f=c(61193),g=c(91344);function h({className:a,orientation:b="horizontal",...c}){return(0,d.jsx)(f.Root,{"data-slot":"tabs","data-orientation":b,orientation:b,className:(0,g.cn)("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",a),...c})}let i=(0,e.F)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function j({className:a,variant:b="default",...c}){return(0,d.jsx)(f.List,{"data-slot":"tabs-list","data-variant":b,className:(0,g.cn)(i({variant:b}),a),...c})}function k({className:a,...b}){return(0,d.jsx)(f.Trigger,{"data-slot":"tabs-trigger",className:(0,g.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",a),...b})}function l({className:a,...b}){return(0,d.jsx)(f.Content,{"data-slot":"tabs-content",className:(0,g.cn)("flex-1 outline-none",a),...b})}},16805:(a,b,c)=>{c.d(b,{ShareButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call ShareButton() from the server but ShareButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/_components/share-button.tsx","ShareButton")},21448:(a,b,c)=>{c.d(b,{ShareButton:()=>p});var d=c(64173),e=c(17240);let f=(0,c(42557).A)("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);var g=c(12619),h=c(28082),i=c(66979),j=c(42324),k=c(44052),l=c(71813),m=c(3265);let n=(0,m.createServerReference)("40d743a93d1471d5f57fe5f4440fb41cb460706bd1",m.callServer,void 0,m.findSourceMapURL,"createShareAction");var o=c(14810);function p(a){let b=(0,l.c)("app"),[c,m]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useTransition)(),[t,u]=(0,e.useState)(null);return c?t?(0,d.jsxs)("div",{className:"rounded border bg-card p-2 text-xs space-y-1.5 w-full max-w-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-700",children:[(0,d.jsx)(g.A,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"font-medium",children:b("share.button.createdTitle")})]}),(0,d.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"block font-mono text-[11px] text-violet-700 hover:underline break-all",children:t.url}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(t.url).then(()=>k.oR.success(b("share.button.copied"))),className:"inline-flex items-center gap-1 rounded border px-2 py-0.5 hover:bg-accent",children:[(0,d.jsx)(h.A,{className:"h-3 w-3"}),b("share.button.copy")]}),(0,d.jsx)("button",{type:"button",onClick:()=>{u(null),m(!1),q("")},className:"text-muted-foreground hover:text-foreground",children:b("share.button.done")})]})]}):(0,d.jsxs)("div",{className:"rounded border bg-card p-2 text-xs space-y-1.5 w-full max-w-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(f,{className:"h-3.5 w-3.5 text-violet-600"}),(0,d.jsx)("span",{className:"font-medium",children:b("share.button.newLink")}),(0,d.jsx)("button",{type:"button",onClick:()=>m(!1),className:"ml-auto text-muted-foreground hover:text-foreground",children:(0,d.jsx)(i.A,{className:"h-3 w-3"})})]}),(0,d.jsx)("label",{className:"block text-[10px] text-muted-foreground",children:b("share.button.passwordLabel")}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(j.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,d.jsx)("input",{type:"password",value:p,onChange:a=>q(a.target.value),autoFocus:!0,placeholder:b("share.button.passwordPlaceholder"),className:"w-full rounded border bg-background pl-6 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{s(async()=>{let c=await (0,o.N)(),d=await n({kind:a.kind,...a.rootId?{rootId:a.rootId}:{},...a.utilityScope?{utilityScope:a.utilityScope}:{},...a.utilityId?{utilityId:a.utilityId}:{},...a.kbRelPath?{kbRelPath:a.kbRelPath}:{},...a.label?{label:a.label}:{},...p.trim()?{password:p.trim()}:{}});if(!d.ok)return void k.oR.error(d.error);let e=c.status.publicUrl??window.location.origin,f=new URL(`/share/${d.share.id}`,e).toString();u({share:d.share,url:f}),navigator.clipboard.writeText(f).catch(()=>null),k.oR.success(c.status.running?b("share.button.created"):b("share.button.createdNoTunnel"))})},disabled:r,className:"w-full rounded bg-violet-600 text-white px-2 py-1 hover:bg-violet-700 disabled:opacity-50 inline-flex items-center justify-center gap-1",children:r?b("share.button.creating"):b("share.button.create")}),(0,d.jsx)("p",{className:"text-[10px] text-muted-foreground",children:b("share.button.footer")})]}):(0,d.jsxs)("button",{type:"button",onClick:()=>m(!0),className:a.iconOnly?"p-1 rounded hover:bg-accent text-muted-foreground hover:text-violet-700":"inline-flex items-center gap-1 rounded border px-2 py-1 text-xs hover:bg-accent",title:b("share.button.title"),children:[(0,d.jsx)(f,{className:"h-3.5 w-3.5"}),!a.iconOnly&&b("share.button.label")]})}},27129:(a,b,c)=>{c.d(b,{Cz:()=>k,IK:()=>l,hN:()=>j,uA:()=>i});var d=c(73745);c(66493);var e=c(56942),f=c(53905),g=c(84579),h=c(91388);async function i(a){try{let b,c=await (0,g.generateImage)({rootId:a.rootId,prompt:a.prompt,...a.provider?{provider:a.provider}:{},...a.aspectRatio?{aspectRatio:a.aspectRatio}:{},...a.alt?{alt:a.alt}:{}}),d=n(a.alt||a.prompt),e=``;return a.attachToKb&&(b=await m(a.rootId,{title:a.alt||a.prompt.slice(0,80),markdown:e,meta:{provider:c.provider,prompt:a.prompt,sha:c.sha,...a.aspectRatio?{aspectRatio:a.aspectRatio}:{}}})),{ok:!0,url:c.urlPath,sha:c.sha,markdown:e,...b?{kbRelPath:b}:{}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function j(a){try{let b=await (0,g.searchImages)({query:a.query,...a.provider?{provider:a.provider}:{},...a.count?{count:a.count}:{}});return{ok:!0,results:b}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function k(a){try{let b,c=await (0,g.attachRemote)({rootId:a.rootId,sourceUrl:a.sourceUrl}),d=n(a.alt||"image"),e=a.attribution?`
|
|
2
|
-
|
|
3
|
-
_Photo: [${a.attribution.name}](${a.attribution.link})_`:"",f=`${e}`;return a.attachToKb&&(b=await m(a.rootId,{title:a.alt||"Found image",markdown:f,meta:{source:"web",sourceUrl:a.sourceUrl,sha:c.sha,...a.attribution?{author:a.attribution.name,authorUrl:a.attribution.link}:{}}})),{ok:!0,url:c.urlPath,sha:c.sha,markdown:f,...b?{kbRelPath:b}:{}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function l(a){try{let b,c=Buffer.from(a.base64,"base64");if(0===c.byteLength)return{ok:!1,error:"Empty upload"};if(!a.mime.startsWith("image/"))return{ok:!1,error:`Unsupported mime: ${a.mime}`};let d=await (0,h.YN)(a.rootId,c,a.mime),e=n(a.alt||"image"),f=``;return a.attachToKb&&(b=await m(a.rootId,{title:a.alt||"Uploaded image",markdown:f,meta:{source:"upload",sha:d.sha,mime:a.mime}})),{ok:!0,url:d.urlPath,sha:d.sha,markdown:f,...b?{kbRelPath:b}:{}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function m(a,b){let c=await (0,f.Zn)(a);if(!c)throw Error(`unknown rootId: ${a}`);return(await (0,e.j)({rootPath:c.path,directive:{kind:"image",title:b.title,body:b.markdown,meta:b.meta}})).relPath}function n(a){return a.replace(/[\[\]\n]/g," ").slice(0,200)}(0,c(63781).D)([i,j,k,l]),(0,d.A)(i,"4025f7fd383d7aaeba853004f970d2f5dc51fc1572",null),(0,d.A)(j,"407e1ec647ac47828a8f71dfd10fd41930d8abd913",null),(0,d.A)(k,"4069f9843caba5ad00f780f3ac4c4aa177d3013261",null),(0,d.A)(l,"40c58744e22bd7a5e6a79e2d723da9c8c61f5a7502",null)},29130:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},41414:(a,b,c)=>{c.d(b,{g:()=>e});var d=c(3265);let e=(0,d.createServerReference)("78c5512a5e07397f4abcfe04dfa901cfa1b305a904",d.callServer,void 0,d.findSourceMapURL,"startTopicAction")},42386:(a,b,c)=>{c.d(b,{InsertImageButton:()=>C});var d=c(64173),e=c(17240),f=c(87671),g=c(29130),h=c(71813),i=c(20583),j=c(66979),k=c(69552),l=c(65943);let m=(0,c(42557).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var n=c(44052),o=c(47071),p=c(45477),q=c(80281),r=c(71155),s=c(16551),t=c(27456),u=c(12650),v=c(3265);let w=(0,v.createServerReference)("4025f7fd383d7aaeba853004f970d2f5dc51fc1572",v.callServer,void 0,v.findSourceMapURL,"generateAction"),x=(0,v.createServerReference)("407e1ec647ac47828a8f71dfd10fd41930d8abd913",v.callServer,void 0,v.findSourceMapURL,"searchAction"),y=(0,v.createServerReference)("4069f9843caba5ad00f780f3ac4c4aa177d3013261",v.callServer,void 0,v.findSourceMapURL,"attachAction"),z=(0,v.createServerReference)("40c58744e22bd7a5e6a79e2d723da9c8c61f5a7502",v.callServer,void 0,v.findSourceMapURL,"uploadAction"),A=["1:1","16:9","9:16","4:3","3:4","21:9"];function B({rootId:a,open:b,onOpenChange:c,onInsert:f}){let v=(0,h.c)("app"),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)("gemini"),[F,G]=(0,e.useState)("1:1"),[H,I]=(0,e.useState)(!0),[J,K]=(0,e.useState)(null),[L,M]=(0,e.useTransition)(),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)("unsplash"),[R,S]=(0,e.useState)([]),[T,U]=(0,e.useTransition)(),[V,W]=(0,e.useState)(null),[X,Y]=(0,e.useState)(!0),[Z,$]=(0,e.useState)(""),[_,aa]=(0,e.useState)(!0),[ab,ac]=(0,e.useTransition)();if(!b)return null;let ad=()=>{N.trim()&&(S([]),U(async()=>{let b=await x({rootId:a,query:N.trim(),provider:P,count:12});if(!b.ok)return void n.oR.error(b.error);S(b.results)}))};return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&c(!1)},children:[(0,d.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:()=>c(!1)}),(0,d.jsxs)("div",{className:"relative bg-card border rounded-lg shadow-xl w-full max-w-3xl max-h-[85vh] flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b",children:[(0,d.jsx)(g.A,{className:"h-4 w-4 text-violet-600"}),(0,d.jsx)("h2",{className:"text-sm font-medium flex-1",children:v("images.titleHeader")}),(0,d.jsx)(i.$,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>c(!1),children:(0,d.jsx)(j.A,{className:"h-4 w-4"})})]}),(0,d.jsxs)(s.tU,{defaultValue:"generate",className:"flex-1 min-h-0 flex flex-col",children:[(0,d.jsxs)(s.j7,{className:"mx-4 mt-3 self-start",children:[(0,d.jsxs)(s.Xi,{value:"generate",children:[(0,d.jsx)(k.A,{className:"mr-1 h-3.5 w-3.5"})," ",v("images.tabGenerate")]}),(0,d.jsxs)(s.Xi,{value:"search",children:[(0,d.jsx)(l.A,{className:"mr-1 h-3.5 w-3.5"})," ",v("images.tabSearch")]}),(0,d.jsxs)(s.Xi,{value:"upload",children:[(0,d.jsx)(m,{className:"mr-1 h-3.5 w-3.5"})," ",v("images.tabUpload")]})]}),(0,d.jsxs)(t.F,{className:"flex-1 min-h-0",children:[(0,d.jsxs)(s.av,{value:"generate",className:"px-4 py-4 space-y-3",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{htmlFor:"img-prompt",children:v("images.promptLabel")}),(0,d.jsx)(p.T,{id:"img-prompt",value:B,onChange:a=>C(a.target.value),placeholder:v("images.promptPlaceholder"),rows:4})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{children:v("images.providerLabel")}),(0,d.jsxs)(r.l6,{value:D,onValueChange:a=>E(a),children:[(0,d.jsx)(r.bq,{children:(0,d.jsx)(r.yv,{})}),(0,d.jsxs)(r.gC,{children:[(0,d.jsx)(r.eb,{value:"gemini",children:"Gemini Nano Banana"}),(0,d.jsx)(r.eb,{value:"codex",children:"Codex $imagegen"})]})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{children:v("images.aspectLabel")}),(0,d.jsxs)(r.l6,{value:F,onValueChange:G,children:[(0,d.jsx)(r.bq,{children:(0,d.jsx)(r.yv,{})}),(0,d.jsx)(r.gC,{children:A.map(a=>(0,d.jsx)(r.eb,{value:a,children:a},a))})]})]})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked)}),v("images.saveToKb")]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(i.$,{type:"button",size:"sm",onClick:()=>{B.trim()&&(K(null),M(async()=>{let b=await w({rootId:a,prompt:B.trim(),provider:D,aspectRatio:F,attachToKb:H});if(!b.ok)return void n.oR.error(b.error);K({url:b.url,markdown:b.markdown,...b.kbRelPath?{kbRelPath:b.kbRelPath}:{}})}))},disabled:L||!B.trim(),children:L?v("images.generating"):v("images.generate")}),L&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:v("images.takesAMinute")})]}),L?(0,d.jsx)(u.E,{className:"h-64 w-full"}):J?(0,d.jsxs)("div",{className:"space-y-2 border rounded p-3",children:[(0,d.jsx)("img",{src:J.url,alt:B,className:"max-h-80 mx-auto rounded"}),(0,d.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,d.jsx)(i.$,{type:"button",size:"sm",variant:"outline",onClick:()=>K(null),children:v("images.again")}),(0,d.jsx)(i.$,{type:"button",size:"sm",onClick:()=>{J&&(f?.(J),n.oR.success(J.kbRelPath?v("images.savedToKb",{path:J.kbRelPath}):v("images.ready")),c(!1))},children:v("images.insert")})]})]}):null]}),(0,d.jsxs)(s.av,{value:"search",className:"px-4 py-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(o.p,{value:N,onChange:a=>O(a.target.value),placeholder:v("images.searchPlaceholder"),onKeyDown:a=>{"Enter"===a.key&&ad()}}),(0,d.jsxs)(r.l6,{value:P,onValueChange:a=>Q(a),children:[(0,d.jsx)(r.bq,{className:"w-36",children:(0,d.jsx)(r.yv,{})}),(0,d.jsxs)(r.gC,{children:[(0,d.jsx)(r.eb,{value:"unsplash",children:"Unsplash"}),(0,d.jsx)(r.eb,{value:"pexels",children:"Pexels"}),(0,d.jsx)(r.eb,{value:"brave",children:v("images.braveWeb")})]})]}),(0,d.jsx)(i.$,{type:"button",size:"sm",onClick:ad,disabled:T||!N.trim(),children:v("images.find")})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)("input",{type:"checkbox",checked:X,onChange:a=>Y(a.target.checked)}),v("images.saveToKb")]}),T&&0===R.length?(0,d.jsx)("div",{className:"grid grid-cols-3 gap-2",children:Array.from({length:6}).map((a,b)=>(0,d.jsx)(u.E,{className:"h-32 w-full"},b))}):R.length>0?(0,d.jsx)("div",{className:"grid grid-cols-3 gap-2",children:R.map(b=>(0,d.jsxs)("button",{type:"button",disabled:null!==V,onClick:()=>{W(b.url),U(async()=>{let d=await y({rootId:a,sourceUrl:b.url,alt:N.trim()||"image",attribution:b.attribution,attachToKb:X});if(W(null),!d.ok)return void n.oR.error(d.error);f?.({url:d.url,markdown:d.markdown,...d.kbRelPath?{kbRelPath:d.kbRelPath}:{}}),n.oR.success(d.kbRelPath?v("images.savedToKb",{path:d.kbRelPath}):v("images.savedToProject")),c(!1)})},className:"group relative overflow-hidden rounded border hover:border-violet-500 disabled:opacity-50",title:`${b.attribution.name} \xb7 ${b.provider}`,children:[(0,d.jsx)("img",{src:b.thumb,alt:"",className:"h-32 w-full object-cover"}),(0,d.jsx)("div",{className:"absolute bottom-0 inset-x-0 px-1.5 py-0.5 text-[10px] bg-black/60 text-white truncate",children:b.attribution.name}),V===b.url&&(0,d.jsx)("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center text-xs text-white",children:v("images.saving")})]},b.url))}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:v("images.noKeys")})]}),(0,d.jsxs)(s.av,{value:"upload",className:"px-4 py-4 space-y-3",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{htmlFor:"img-alt",children:v("images.altLabel")}),(0,d.jsx)(o.p,{id:"img-alt",value:Z,onChange:a=>$(a.target.value),placeholder:v("images.altPlaceholder")})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)("input",{type:"checkbox",checked:_,onChange:a=>aa(a.target.checked)}),v("images.saveToKb")]}),(0,d.jsx)(o.p,{type:"file",accept:"image/*",disabled:ab,onChange:b=>{let d=b.target.files?.[0];d&&ac(async()=>{let b=function(a){let b=new Uint8Array(a),c="";for(let a=0;a<b.length;a+=32768){let d=b.subarray(a,a+32768);c+=String.fromCharCode.apply(null,Array.from(d))}return btoa(c)}(await d.arrayBuffer()),e=await z({rootId:a,base64:b,mime:d.type,alt:Z||d.name.replace(/\.[^.]+$/,""),attachToKb:_});if(!e.ok)return void n.oR.error(e.error);f?.({url:e.url,markdown:e.markdown,...e.kbRelPath?{kbRelPath:e.kbRelPath}:{}}),n.oR.success(e.kbRelPath?v("images.savedToKb",{path:e.kbRelPath}):v("images.uploaded")),c(!1)})}}),ab&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:v("images.uploading")})]})]})]})]})]})}function C({rootId:a,redirectToKb:b=!0}){let[c,j]=(0,e.useState)(!1),k=(0,f.useRouter)(),l=(0,h.c)("app");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>j(!0),children:[(0,d.jsx)(g.A,{className:"mr-1 h-4 w-4"})," ",l("images.button")]}),(0,d.jsx)(B,{rootId:a,open:c,onOpenChange:j,onInsert:({kbRelPath:c})=>{if(b&&c){let b=c.split("/").map(encodeURIComponent).join("/");k.push(`/roots/${a}/kb/${b}`)}}})]})}},71155:(a,b,c)=>{c.d(b,{bq:()=>l,eb:()=>n,gC:()=>m,l6:()=>j,yv:()=>k});var d=c(64173);c(17240);var e=c(58405),f=c(12619),g=c(78724),h=c(13976),i=c(91344);function j({...a}){return(0,d.jsx)(h.Root,{"data-slot":"select",...a})}function k({...a}){return(0,d.jsx)(h.Value,{"data-slot":"select-value",...a})}function l({className:a,size:b="default",children:c,...f}){return(0,d.jsxs)(h.Trigger,{"data-slot":"select-trigger","data-size":b,className:(0,i.cn)("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",a),...f,children:[c,(0,d.jsx)(h.Icon,{asChild:!0,children:(0,d.jsx)(e.A,{className:"size-4 opacity-50"})})]})}function m({className:a,children:b,position:c="item-aligned",align:e="center",...f}){return(0,d.jsx)(h.Portal,{children:(0,d.jsxs)(h.Content,{"data-slot":"select-content",className:(0,i.cn)("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","popper"===c&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:c,align:e,...f,children:[(0,d.jsx)(o,{}),(0,d.jsx)(h.Viewport,{className:(0,i.cn)("p-1","popper"===c&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:b}),(0,d.jsx)(p,{})]})})}function n({className:a,children:b,...c}){return(0,d.jsxs)(h.Item,{"data-slot":"select-item",className:(0,i.cn)("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",a),...c,children:[(0,d.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,d.jsx)(h.ItemIndicator,{children:(0,d.jsx)(f.A,{className:"size-4"})})}),(0,d.jsx)(h.ItemText,{children:b})]})}function o({className:a,...b}){return(0,d.jsx)(h.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...b,children:(0,d.jsx)(g.A,{className:"size-4"})})}function p({className:a,...b}){return(0,d.jsx)(h.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...b,children:(0,d.jsx)(e.A,{className:"size-4"})})}},78724:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},86673:(a,b,c)=>{c.d(b,{InsertImageButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call InsertImageButton() from the server but InsertImageButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/_components/kb/insert-image-button.tsx","InsertImageButton")},88842:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(19963).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=8142,exports.ids=[8142],exports.modules={58142:(a,b,c)=>{c.d(b,{UtilityIframe:()=>s});var d=c(64173),e=c(17240),f=c(53186),g=c(71813),h=c(65177),i=c(66979),j=c(69552),k=c(62261),l=c(73569),m=c(1056),n=c.n(m),o=c(44052),p=c(3265);function q({scope:a,utilityId:b,utilityName:c,rootId:m,requestSnapshot:p,onClose:q}){let s=(0,g.c)("app"),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)([]),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useTransition)(),[D,E]=(0,e.useState)(!1),F=(0,e.useRef)(null);(0,e.useRef)(null),(0,e.useRef)("");let[G,H]=(0,e.useState)(""),I=()=>{let a=x.trim();a&&m&&t&&(y(""),w(b=>[...b,{role:"user",text:a,ts:new Date().toISOString()}]),C(async()=>{let b;try{b=await Promise.race([p(),new Promise(a=>setTimeout(()=>a(void 0),600))])}catch{}let c=void 0!==b?function(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b,null,2)}catch{c=String(b)}return c.length>4e3&&(c=c.slice(0,4e3)+"\n…[truncated]"),["[Mini-app context]",c,"[/context]\n",a].join("\n")}(a,b):a;try{let a=await fetch(`/api/roots/${m}/chat/${t}/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:c})});if(!a.ok){let b=await a.json().catch(()=>({}));o.oR.error(b.error??`HTTP ${a.status}`)}}catch(a){o.oR.error(String(a))}}))};return(0,d.jsxs)("aside",{className:"flex h-full flex-col border-l bg-card",children:[(0,d.jsxs)("header",{className:"border-b px-3 py-2 flex items-center gap-2",children:[(0,d.jsx)(f.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,d.jsx)("span",{className:"text-sm font-medium",children:s("utilities.helper.title")}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:s("utilities.helper.hint")}),m&&t&&(0,d.jsx)(n(),{href:`/roots/${m}/chat/${t}`,className:"ml-auto p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:s("utilities.helper.openFull"),children:(0,d.jsx)(h.A,{className:"h-3.5 w-3.5"})}),q&&(0,d.jsx)("button",{type:"button",onClick:q,className:"p-1 rounded hover:bg-accent "+(m&&t?"":"ml-auto"),title:s("utilities.helper.hide"),children:(0,d.jsx)(i.A,{className:"h-3.5 w-3.5"})})]}),(0,d.jsxs)("div",{ref:F,className:"flex-1 overflow-y-auto px-3 py-2 space-y-2 text-sm",children:[z&&(0,d.jsx)("p",{className:"text-xs text-red-600",children:z}),!z&&0===v.length&&!G&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[(0,d.jsx)(j.A,{className:"h-3 w-3 mt-0.5 text-violet-600 shrink-0"}),(0,d.jsx)("span",{children:s("utilities.helper.welcome")})]}),v.map((a,b)=>(0,d.jsx)(r,{role:a.role,text:a.text},b)),D&&G&&(0,d.jsx)(r,{role:"assistant",text:G,streaming:!0}),B&&!D&&(0,d.jsxs)("div",{className:"mr-6 rounded-md bg-muted/40 px-2 py-1.5 text-xs text-muted-foreground inline-flex items-center gap-2",children:[(0,d.jsx)(k.A,{className:"h-3 w-3 animate-spin"}),s("utilities.helper.thinking")]})]}),(0,d.jsxs)("div",{className:"border-t px-3 py-2 flex items-end gap-1.5",children:[(0,d.jsx)("textarea",{value:x,onChange:a=>y(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),I())},rows:1,placeholder:s("utilities.helper.placeholder"),disabled:B||!!z||!t,className:"flex-1 resize-none rounded border bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400 max-h-24"}),(0,d.jsx)("button",{type:"button",onClick:I,disabled:B||!x.trim()||!!z||!t,className:"inline-flex items-center justify-center rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50",children:B?(0,d.jsx)(k.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})]})}function r({role:a,text:b,streaming:c}){let e=(0,g.c)("app"),f=b;return("user"===a&&(f=f.replace(/^\s*\[Mini-app context\][\s\S]*?\[\/context\]\s*/,"").trim()),f.trim())?(0,d.jsxs)("div",{className:"user"===a?"ml-6 rounded-md bg-violet-50 dark:bg-violet-950/30 px-2 py-1.5":"mr-6 rounded-md bg-muted/40 px-2 py-1.5 whitespace-pre-wrap",children:[(0,d.jsxs)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:[e("user"===a?"utilities.helper.you":"assistant"===a?"utilities.helper.reflex":"utilities.helper.system"),c&&(0,d.jsx)("span",{className:"ml-1 text-violet-600",children:"●"})]}),f]}):null}function s({scope:a,id:b,rootId:c,className:h,title:i,agentChat:j,utilityName:k}){let l=(0,g.c)("app"),m=(0,e.useRef)(null),n=(0,e.useRef)(null),[o,p]=(0,e.useState)(!0),r=c?`?rootId=${encodeURIComponent(c)}`:"",s=`/api/utilities/${a}/${b}/iframe${r}`,t=(0,d.jsx)("iframe",{ref:m,src:s,sandbox:"allow-scripts allow-forms allow-same-origin",className:h??"h-full w-full border-0 bg-white",title:i??`utility-${b}`});return j?(0,d.jsxs)("div",{className:"flex h-full w-full",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0 relative",children:[t,!o&&(0,d.jsxs)("button",{type:"button",onClick:()=>p(!0),className:"absolute right-3 bottom-3 inline-flex items-center gap-1 rounded-full bg-violet-600 px-3 py-1.5 text-xs text-white shadow-lg hover:bg-violet-700",title:l("utilities.iframe.openHelper"),children:[(0,d.jsx)(f.A,{className:"h-3.5 w-3.5"}),l("utilities.iframe.helper")]})]}),o&&(0,d.jsx)("div",{className:"w-80 shrink-0",children:(0,d.jsx)(q,{scope:a,utilityId:b,...k?{utilityName:k}:{},...c?{rootId:c}:{},requestSnapshot:()=>{let a=m.current?.contentWindow;return a?(n.current&&(clearTimeout(n.current.timer),n.current.resolve(void 0),n.current=null),new Promise(b=>{let c=setTimeout(()=>{n.current?.resolve===b&&(n.current=null,b(void 0))},500);n.current={resolve:b,timer:c};try{a.postMessage({type:"request-snapshot"},"*")}catch{clearTimeout(c),n.current=null,b(void 0)}})):Promise.resolve(void 0)},onClose:()=>p(!1)})})]}):t}p.callServer,p.findSourceMapURL,p.callServer,p.findSourceMapURL},65177:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},66979:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},73569:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1580],{8190:(e,t,a)=>{a.d(t,{CommandBar:()=>h});var r=a(4624),s=a(99356),n=a(69285),l=a(49411),i=a(95265),o=a(56221),c=a(79695),d=a(59617),u=a(63602),m=a(63514),x=a(95465);function h(e){let{rootId:t,focusFile:a}=e,h=(0,l.c)("roots"),[,p]=(0,s.useTransition)(),b=(0,n.useRouter)();return(0,r.jsx)(u.E,{label:h("commandBar.label"),children:(0,r.jsx)(x.L,{rootId:t,placeholder:h("commandBar.placeholder"),submitLabel:h("commandBar.submit"),pendingLabel:h("commandBar.submitPending"),SubmitIcon:i.A,onSubmit:async e=>{let{message:r,attachments:s}=e;return await new Promise(e=>{p(async()=>{let n=await (0,c.g)(t,r,s,a);if(!n.ok){var l;o.oR.error(null!=(l=n.error)?l:h("commandBar.startFailed")),e(!1);return}(0,m.$d)(m.Zi.topicsChanged(t)),r.trim()&&(0,d.h)(t,n.topicId,r).then(e=>{e.ok&&(0,m.$d)(m.Zi.topicsChanged(t))}),b.push("/roots/".concat(t,"/chat/").concat(n.topicId)),e(!0)})})}})})}},22841:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>x,gC:()=>m,l6:()=>c,yv:()=>d});var r=a(4624);a(99356);var s=a(69709),n=a(43153),l=a(59728),i=a(85314),o=a(13506);function c(e){let{...t}=e;return(0,r.jsx)(i.Root,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,r.jsx)(i.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...l}=e;return(0,r.jsxs)(i.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,o.cn)("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...l,children:[n,(0,r.jsx)(i.Icon,{asChild:!0,children:(0,r.jsx)(s.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:a,position:s="item-aligned",align:n="center",...l}=e;return(0,r.jsx)(i.Portal,{children:(0,r.jsxs)(i.Content,{"data-slot":"select-content",className:(0,o.cn)("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,align:n,...l,children:[(0,r.jsx)(h,{}),(0,r.jsx)(i.Viewport,{className:(0,o.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,r.jsx)(p,{})]})})}function x(e){let{className:t,children:a,...s}=e;return(0,r.jsxs)(i.Item,{"data-slot":"select-item",className:(0,o.cn)("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...s,children:[(0,r.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(i.ItemIndicator,{children:(0,r.jsx)(n.A,{className:"size-4"})})}),(0,r.jsx)(i.ItemText,{children:a})]})}function h(e){let{className:t,...a}=e;return(0,r.jsx)(i.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(l.A,{className:"size-4"})})}function p(e){let{className:t,...a}=e;return(0,r.jsx)(i.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(s.A,{className:"size-4"})})}},39195:(e,t,a)=>{a.d(t,{N:()=>s});var r=a(7911);let s=(0,r.createServerReference)("00b0deb580b821c13cd7747b74bb8d461e8fbb8922",r.callServer,void 0,r.findSourceMapURL,"getTunnelStatusAction")},43504:(e,t,a)=>{a.d(t,{E:()=>n});var r=a(4624),s=a(13506);function n(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"skeleton",className:(0,s.cn)("animate-pulse rounded-md bg-accent",t),...a})}},49881:(e,t,a)=>{a.d(t,{Xi:()=>d,av:()=>u,j7:()=>c,tU:()=>i});var r=a(4624);a(99356);var s=a(60621),n=a(86631),l=a(13506);function i(e){let{className:t,orientation:a="horizontal",...s}=e;return(0,r.jsx)(n.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:(0,l.cn)("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...s})}let o=(0,s.F)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function c(e){let{className:t,variant:a="default",...s}=e;return(0,r.jsx)(n.List,{"data-slot":"tabs-list","data-variant":a,className:(0,l.cn)(o({variant:a}),t),...s})}function d(e){let{className:t,...a}=e;return(0,r.jsx)(n.Trigger,{"data-slot":"tabs-trigger",className:(0,l.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function u(e){let{className:t,...a}=e;return(0,r.jsx)(n.Content,{"data-slot":"tabs-content",className:(0,l.cn)("flex-1 outline-none",t),...a})}},59617:(e,t,a)=>{a.d(t,{h:()=>s});var r=a(7911);let s=(0,r.createServerReference)("7027419a080ac59b35fddc6e37eabafe99c092b625",r.callServer,void 0,r.findSourceMapURL,"generateTopicTitleAction")},65107:(e,t,a)=>{a.d(t,{ShareButton:()=>p});var r=a(4624),s=a(99356),n=a(30441),l=a(43153),i=a(9598),o=a(13561),c=a(3024),d=a(56221),u=a(49411),m=a(7911);let x=(0,m.createServerReference)("40d743a93d1471d5f57fe5f4440fb41cb460706bd1",m.callServer,void 0,m.findSourceMapURL,"createShareAction");var h=a(39195);function p(e){let t=(0,u.c)("app"),[a,m]=(0,s.useState)(!1),[p,b]=(0,s.useState)(""),[g,f]=(0,s.useTransition)(),[v,j]=(0,s.useState)(null);return a?v?(0,r.jsxs)("div",{className:"rounded border bg-card p-2 text-xs space-y-1.5 w-full max-w-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-700",children:[(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{className:"font-medium",children:t("share.button.createdTitle")})]}),(0,r.jsx)("a",{href:v.url,target:"_blank",rel:"noopener noreferrer",className:"block font-mono text-[11px] text-violet-700 hover:underline break-all",children:v.url}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(v.url).then(()=>d.oR.success(t("share.button.copied"))),className:"inline-flex items-center gap-1 rounded border px-2 py-0.5 hover:bg-accent",children:[(0,r.jsx)(i.A,{className:"h-3 w-3"}),t("share.button.copy")]}),(0,r.jsx)("button",{type:"button",onClick:()=>{j(null),m(!1),b("")},className:"text-muted-foreground hover:text-foreground",children:t("share.button.done")})]})]}):(0,r.jsxs)("div",{className:"rounded border bg-card p-2 text-xs space-y-1.5 w-full max-w-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,r.jsx)("span",{className:"font-medium",children:t("share.button.newLink")}),(0,r.jsx)("button",{type:"button",onClick:()=>m(!1),className:"ml-auto text-muted-foreground hover:text-foreground",children:(0,r.jsx)(o.A,{className:"h-3 w-3"})})]}),(0,r.jsx)("label",{className:"block text-[10px] text-muted-foreground",children:t("share.button.passwordLabel")}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(c.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,r.jsx)("input",{type:"password",value:p,onChange:e=>b(e.target.value),autoFocus:!0,placeholder:t("share.button.passwordPlaceholder"),className:"w-full rounded border bg-background pl-6 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,r.jsx)("button",{type:"button",onClick:()=>{f(async()=>{var a;let r=await (0,h.N)(),s=await x({kind:e.kind,...e.rootId?{rootId:e.rootId}:{},...e.utilityScope?{utilityScope:e.utilityScope}:{},...e.utilityId?{utilityId:e.utilityId}:{},...e.kbRelPath?{kbRelPath:e.kbRelPath}:{},...e.label?{label:e.label}:{},...p.trim()?{password:p.trim()}:{}});if(!s.ok)return void d.oR.error(s.error);let n=null!=(a=r.status.publicUrl)?a:window.location.origin,l=new URL("/share/".concat(s.share.id),n).toString();j({share:s.share,url:l}),navigator.clipboard.writeText(l).catch(()=>null),d.oR.success(r.status.running?t("share.button.created"):t("share.button.createdNoTunnel"))})},disabled:g,className:"w-full rounded bg-violet-600 text-white px-2 py-1 hover:bg-violet-700 disabled:opacity-50 inline-flex items-center justify-center gap-1",children:g?t("share.button.creating"):t("share.button.create")}),(0,r.jsx)("p",{className:"text-[10px] text-muted-foreground",children:t("share.button.footer")})]}):(0,r.jsxs)("button",{type:"button",onClick:()=>m(!0),className:e.iconOnly?"p-1 rounded hover:bg-accent text-muted-foreground hover:text-violet-700":"inline-flex items-center gap-1 rounded border px-2 py-1 text-xs hover:bg-accent",title:t("share.button.title"),children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5"}),!e.iconOnly&&t("share.button.label")]})}},79695:(e,t,a)=>{a.d(t,{g:()=>s});var r=a(7911);let s=(0,r.createServerReference)("78c5512a5e07397f4abcfe04dfa901cfa1b305a904",r.callServer,void 0,r.findSourceMapURL,"startTopicAction")},80192:(e,t,a)=>{a.d(t,{F:()=>l});var r=a(4624);a(99356);var s=a(14884),n=a(13506);function l(e){let{className:t,children:a,...l}=e;return(0,r.jsxs)(s.Root,{"data-slot":"scroll-area",className:(0,n.cn)("relative",t),...l,children:[(0,r.jsx)(s.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:a}),(0,r.jsx)(i,{}),(0,r.jsx)(s.Corner,{})]})}function i(e){let{className:t,orientation:a="vertical",...l}=e;return(0,r.jsx)(s.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,n.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",t),...l,children:(0,r.jsx)(s.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}},90877:(e,t,a)=>{a.d(t,{InsertImageButton:()=>z});var r=a(4624),s=a(99356),n=a(69285),l=a(39160),i=a(49411),o=a(85253),c=a(13561),d=a(8096),u=a(43863),m=a(23262),x=a(56221),h=a(15523),p=a(71651),b=a(78825),g=a(22841),f=a(49881),v=a(80192),j=a(43504),y=a(7911);let w=(0,y.createServerReference)("4025f7fd383d7aaeba853004f970d2f5dc51fc1572",y.callServer,void 0,y.findSourceMapURL,"generateAction"),N=(0,y.createServerReference)("407e1ec647ac47828a8f71dfd10fd41930d8abd913",y.callServer,void 0,y.findSourceMapURL,"searchAction"),k=(0,y.createServerReference)("4069f9843caba5ad00f780f3ac4c4aa177d3013261",y.callServer,void 0,y.findSourceMapURL,"attachAction"),S=(0,y.createServerReference)("40c58744e22bd7a5e6a79e2d723da9c8c61f5a7502",y.callServer,void 0,y.findSourceMapURL,"uploadAction"),R=["1:1","16:9","9:16","4:3","3:4","21:9"];function C(e){let{rootId:t,open:a,onOpenChange:n,onInsert:y}=e,C=(0,i.c)("app"),[z,A]=(0,s.useState)(""),[T,P]=(0,s.useState)("gemini"),[L,I]=(0,s.useState)("1:1"),[U,_]=(0,s.useState)(!0),[B,E]=(0,s.useState)(null),[K,$]=(0,s.useTransition)(),[M,F]=(0,s.useState)(""),[V,q]=(0,s.useState)("unsplash"),[J,X]=(0,s.useState)([]),[O,D]=(0,s.useTransition)(),[G,Z]=(0,s.useState)(null),[H,W]=(0,s.useState)(!0),[Q,Y]=(0,s.useState)(""),[ee,et]=(0,s.useState)(!0),[ea,er]=(0,s.useTransition)();if((0,s.useEffect)(()=>{if(!a)return;let e=e=>{"Escape"===e.key&&n(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a,n]),!a)return null;let es=()=>{M.trim()&&(X([]),D(async()=>{let e=await N({rootId:t,query:M.trim(),provider:V,count:12});if(!e.ok)return void x.oR.error(e.error);X(e.results)}))};return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:e=>{e.target===e.currentTarget&&n(!1)},children:[(0,r.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:()=>n(!1)}),(0,r.jsxs)("div",{className:"relative bg-card border rounded-lg shadow-xl w-full max-w-3xl max-h-[85vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b",children:[(0,r.jsx)(l.A,{className:"h-4 w-4 text-violet-600"}),(0,r.jsx)("h2",{className:"text-sm font-medium flex-1",children:C("images.titleHeader")}),(0,r.jsx)(o.$,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>n(!1),children:(0,r.jsx)(c.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)(f.tU,{defaultValue:"generate",className:"flex-1 min-h-0 flex flex-col",children:[(0,r.jsxs)(f.j7,{className:"mx-4 mt-3 self-start",children:[(0,r.jsxs)(f.Xi,{value:"generate",children:[(0,r.jsx)(d.A,{className:"mr-1 h-3.5 w-3.5"})," ",C("images.tabGenerate")]}),(0,r.jsxs)(f.Xi,{value:"search",children:[(0,r.jsx)(u.A,{className:"mr-1 h-3.5 w-3.5"})," ",C("images.tabSearch")]}),(0,r.jsxs)(f.Xi,{value:"upload",children:[(0,r.jsx)(m.A,{className:"mr-1 h-3.5 w-3.5"})," ",C("images.tabUpload")]})]}),(0,r.jsxs)(v.F,{className:"flex-1 min-h-0",children:[(0,r.jsxs)(f.av,{value:"generate",className:"px-4 py-4 space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(b.J,{htmlFor:"img-prompt",children:C("images.promptLabel")}),(0,r.jsx)(p.T,{id:"img-prompt",value:z,onChange:e=>A(e.target.value),placeholder:C("images.promptPlaceholder"),rows:4})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(b.J,{children:C("images.providerLabel")}),(0,r.jsxs)(g.l6,{value:T,onValueChange:e=>P(e),children:[(0,r.jsx)(g.bq,{children:(0,r.jsx)(g.yv,{})}),(0,r.jsxs)(g.gC,{children:[(0,r.jsx)(g.eb,{value:"gemini",children:"Gemini Nano Banana"}),(0,r.jsx)(g.eb,{value:"codex",children:"Codex $imagegen"})]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(b.J,{children:C("images.aspectLabel")}),(0,r.jsxs)(g.l6,{value:L,onValueChange:I,children:[(0,r.jsx)(g.bq,{children:(0,r.jsx)(g.yv,{})}),(0,r.jsx)(g.gC,{children:R.map(e=>(0,r.jsx)(g.eb,{value:e,children:e},e))})]})]})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:U,onChange:e=>_(e.target.checked)}),C("images.saveToKb")]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(o.$,{type:"button",size:"sm",onClick:()=>{z.trim()&&(E(null),$(async()=>{let e=await w({rootId:t,prompt:z.trim(),provider:T,aspectRatio:L,attachToKb:U});if(!e.ok)return void x.oR.error(e.error);E({url:e.url,markdown:e.markdown,...e.kbRelPath?{kbRelPath:e.kbRelPath}:{}})}))},disabled:K||!z.trim(),children:K?C("images.generating"):C("images.generate")}),K&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:C("images.takesAMinute")})]}),K?(0,r.jsx)(j.E,{className:"h-64 w-full"}):B?(0,r.jsxs)("div",{className:"space-y-2 border rounded p-3",children:[(0,r.jsx)("img",{src:B.url,alt:z,className:"max-h-80 mx-auto rounded"}),(0,r.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,r.jsx)(o.$,{type:"button",size:"sm",variant:"outline",onClick:()=>E(null),children:C("images.again")}),(0,r.jsx)(o.$,{type:"button",size:"sm",onClick:()=>{B&&(null==y||y(B),x.oR.success(B.kbRelPath?C("images.savedToKb",{path:B.kbRelPath}):C("images.ready")),n(!1))},children:C("images.insert")})]})]}):null]}),(0,r.jsxs)(f.av,{value:"search",className:"px-4 py-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(h.p,{value:M,onChange:e=>F(e.target.value),placeholder:C("images.searchPlaceholder"),onKeyDown:e=>{"Enter"===e.key&&es()}}),(0,r.jsxs)(g.l6,{value:V,onValueChange:e=>q(e),children:[(0,r.jsx)(g.bq,{className:"w-36",children:(0,r.jsx)(g.yv,{})}),(0,r.jsxs)(g.gC,{children:[(0,r.jsx)(g.eb,{value:"unsplash",children:"Unsplash"}),(0,r.jsx)(g.eb,{value:"pexels",children:"Pexels"}),(0,r.jsx)(g.eb,{value:"brave",children:C("images.braveWeb")})]})]}),(0,r.jsx)(o.$,{type:"button",size:"sm",onClick:es,disabled:O||!M.trim(),children:C("images.find")})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:H,onChange:e=>W(e.target.checked)}),C("images.saveToKb")]}),O&&0===J.length?(0,r.jsx)("div",{className:"grid grid-cols-3 gap-2",children:Array.from({length:6}).map((e,t)=>(0,r.jsx)(j.E,{className:"h-32 w-full"},t))}):J.length>0?(0,r.jsx)("div",{className:"grid grid-cols-3 gap-2",children:J.map(e=>(0,r.jsxs)("button",{type:"button",disabled:null!==G,onClick:()=>{Z(e.url),D(async()=>{let a=await k({rootId:t,sourceUrl:e.url,alt:M.trim()||"image",attribution:e.attribution,attachToKb:H});if(Z(null),!a.ok)return void x.oR.error(a.error);null==y||y({url:a.url,markdown:a.markdown,...a.kbRelPath?{kbRelPath:a.kbRelPath}:{}}),x.oR.success(a.kbRelPath?C("images.savedToKb",{path:a.kbRelPath}):C("images.savedToProject")),n(!1)})},className:"group relative overflow-hidden rounded border hover:border-violet-500 disabled:opacity-50",title:"".concat(e.attribution.name," \xb7 ").concat(e.provider),children:[(0,r.jsx)("img",{src:e.thumb,alt:"",className:"h-32 w-full object-cover"}),(0,r.jsx)("div",{className:"absolute bottom-0 inset-x-0 px-1.5 py-0.5 text-[10px] bg-black/60 text-white truncate",children:e.attribution.name}),G===e.url&&(0,r.jsx)("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center text-xs text-white",children:C("images.saving")})]},e.url))}):(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:C("images.noKeys")})]}),(0,r.jsxs)(f.av,{value:"upload",className:"px-4 py-4 space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(b.J,{htmlFor:"img-alt",children:C("images.altLabel")}),(0,r.jsx)(h.p,{id:"img-alt",value:Q,onChange:e=>Y(e.target.value),placeholder:C("images.altPlaceholder")})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:ee,onChange:e=>et(e.target.checked)}),C("images.saveToKb")]}),(0,r.jsx)(h.p,{type:"file",accept:"image/*",disabled:ea,onChange:e=>{var a;let r=null==(a=e.target.files)?void 0:a[0];r&&er(async()=>{let e=function(e){let t=new Uint8Array(e),a="";for(let e=0;e<t.length;e+=32768){let r=t.subarray(e,e+32768);a+=String.fromCharCode.apply(null,Array.from(r))}return btoa(a)}(await r.arrayBuffer()),a=await S({rootId:t,base64:e,mime:r.type,alt:Q||r.name.replace(/\.[^.]+$/,""),attachToKb:ee});if(!a.ok)return void x.oR.error(a.error);null==y||y({url:a.url,markdown:a.markdown,...a.kbRelPath?{kbRelPath:a.kbRelPath}:{}}),x.oR.success(a.kbRelPath?C("images.savedToKb",{path:a.kbRelPath}):C("images.uploaded")),n(!1)})}}),ea&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:C("images.uploading")})]})]})]})]})]})}function z(e){let{rootId:t,redirectToKb:a=!0}=e,[c,d]=(0,s.useState)(!1),u=(0,n.useRouter)(),m=(0,i.c)("app");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(!0),children:[(0,r.jsx)(l.A,{className:"mr-1 h-4 w-4"})," ",m("images.button")]}),(0,r.jsx)(C,{rootId:t,open:c,onOpenChange:d,onInsert:e=>{let{kbRelPath:r}=e;if(a&&r){let e=r.split("/").map(encodeURIComponent).join("/");u.push("/roots/".concat(t,"/kb/").concat(e))}}})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1748],{57474:(e,t,r)=>{r.d(t,{v:()=>q});var a=r(4624),n=r(49411),s=r(15365),l=r(99356),i=r(87738),o=r(39783),c=r(43153),d=r(13561),u=r(41695),p=r(46972),m=r(84630),x=r(96447),h=r(54207),g=r(84860),f=r(41379),b=r(3239),v=r(85253),y=r(15523),j=r(64681),N=r(54400),w=r.n(N),k=r(49623),W=r(85785),C=r(43863),A=r(57308),S=r(35285),F=r(9598),R=r(56221),T=r(68682);function L(e){let{service:t,size:r=18,className:n}=e;return(0,a.jsx)("span",{className:"inline-flex items-center justify-center rounded-[5px] font-bold leading-none text-white shrink-0 "+(null!=n?n:""),style:{background:t.brand,width:r,height:r,fontSize:Math.max(8,Math.floor(.55*r)),letterSpacing:t.glyph.length>1?"-0.05em":"0"},"aria-hidden":!0,children:t.glyph})}var z=r(7911);let M=(0,z.createServerReference)("00c88ea8b4e421083e566a83707b9cc8a26fec2b9f",z.callServer,void 0,z.findSourceMapURL,"getEnabledMapServicesAction"),U="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",E="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js";function I(e){let{point:t,services:r,interactive:s,onRemove:l}=e,i=(0,n.c)("roots");return(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[r.slice(0,4).map(e=>(0,a.jsx)("a",{href:e.urlFor(t.lat,t.lng),target:"_blank",rel:"noopener noreferrer",className:"rounded p-0.5 hover:ring-1 hover:ring-offset-1 hover:ring-violet-300",title:i("mapWidget.navigationTitle",{service:e.label}),children:(0,a.jsx)(L,{service:e,size:18})},e.id)),(0,a.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText("".concat(t.lat,", ").concat(t.lng)).then(()=>R.oR.success(i("mapWidget.coordsCopied"))).catch(()=>R.oR.error(i("mapWidget.clipboardUnavailable")))},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:i("mapWidget.copyCoords"),children:(0,a.jsx)(F.A,{className:"h-3 w-3"})}),s&&(0,a.jsx)("button",{type:"button",onClick:l,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-destructive",title:i("mapWidget.removePoint"),children:(0,a.jsx)(d.A,{className:"h-3 w-3"})})]})}function O(e){let{service:t,stops:r}=e,s=(0,n.c)("roots"),l=t.routeUrlFor(r),i=e=>{e.preventDefault(),e.stopPropagation(),navigator.clipboard.writeText(l).then(()=>R.oR.success(s("mapWidget.linkCopied",{service:t.label}))).catch(()=>R.oR.error(s("mapWidget.clipboardUnavailable")))};return(0,a.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",onContextMenu:i,className:"inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[11px] hover:bg-accent",title:s("mapWidget.openTitle",{service:t.label}),children:[(0,a.jsx)(L,{service:t,size:16}),(0,a.jsx)("span",{className:"truncate max-w-[80px]",children:t.label}),(0,a.jsx)("button",{type:"button",onClick:i,className:"text-muted-foreground hover:text-foreground",title:s("mapWidget.copyLinkTitle"),children:(0,a.jsx)(F.A,{className:"h-2.5 w-2.5"})})]})}var _=r(8096);let P={markdown:function(e){var t;let{data:r}=e;return(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(s.p,{source:null!=(t=r.body)?t:""})})},"news-list":function(e){var t;let{data:r,readonly:s,onPatch:u}=e,p=(0,n.c)("roots"),m=null!=(t=r.items)?t:[],[x,h]=(0,l.useState)(m),[g,f]=(0,l.useTransition)(),b=(0,l.useRef)("");(0,l.useEffect)(()=>{let e=JSON.stringify(m);e!==b.current&&(b.current=e,h(m))},[r]);let v=e=>{h(e),u&&f(async()=>{try{await u({items:e})}catch(e){}})};return 0===x.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:p("newsListWidget.empty")}):(0,a.jsx)("ul",{className:"space-y-2",children:x.map((e,t)=>(0,a.jsxs)("li",{className:"group/row relative border-l-2 pl-2.5 py-0.5 transition ".concat(e.read?"border-muted-foreground/30 opacity-60":"border-violet-200"),children:[(0,a.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,a.jsx)(i.A,{className:"h-3 w-3 mt-1 shrink-0 ".concat(e.read?"text-muted-foreground":"text-violet-600")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 pr-12",children:[e.url?(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[e.title,(0,a.jsx)(o.A,{className:"h-3 w-3 opacity-50"})]}):(0,a.jsx)("span",{className:"text-sm font-medium",children:e.title}),e.summary&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:e.summary}),(e.source||e.date)&&(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-0.5 flex gap-1.5",children:[e.source&&(0,a.jsx)("span",{children:e.source}),e.source&&e.date&&(0,a.jsx)("span",{children:"\xb7"}),e.date&&(0,a.jsx)("span",{className:"font-mono",children:e.date})]})]})]}),!s&&(0,a.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{!s&&v(x.map((e,r)=>r===t?{...e,read:!e.read}:e))},disabled:g,"aria-label":e.read?p("newsListWidget.markUnreadAria"):p("newsListWidget.markReadAria"),title:e.read?p("newsListWidget.markUnreadTitle"):p("newsListWidget.markReadTitle"),className:"p-1 rounded hover:bg-emerald-100 dark:hover:bg-emerald-950/40 text-muted-foreground hover:text-emerald-600 disabled:opacity-30",children:(0,a.jsx)(c.A,{className:"h-3 w-3"})}),(0,a.jsx)("button",{type:"button",onClick:()=>{!s&&v(x.filter((e,r)=>r!==t))},disabled:g,"aria-label":p("newsListWidget.dismissAria"),title:p("newsListWidget.dismissTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(d.A,{className:"h-3 w-3"})})]})]},t))})},"link-list":function(e){var t;let{data:r,readonly:s,onPatch:i}=e,c=(0,n.c)("roots"),d=null!=(t=r.items)?t:[],[m,x]=(0,l.useState)(d),[h,g]=(0,l.useTransition)(),f=(0,l.useRef)("");return((0,l.useEffect)(()=>{let e=JSON.stringify(d);e!==f.current&&(f.current=e,x(d))},[r]),0===m.length)?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:c("linkListWidget.empty")}):(0,a.jsx)("ul",{className:"space-y-0.5",children:m.map((e,t)=>(0,a.jsxs)("li",{className:"group/row relative",children:[(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-1.5 rounded-md px-2 py-1.5 hover:bg-accent/40 transition",children:[(0,a.jsx)(u.A,{className:"h-3 w-3 mt-1 shrink-0 text-sky-600"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[e.title,(0,a.jsx)(o.A,{className:"h-3 w-3 opacity-50"})]}),e.hint&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:e.hint}),(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground truncate font-mono mt-0.5",children:e.url})]})]}),!s&&(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{if(!s){var t;x(t=m.filter((t,r)=>r!==e)),i&&g(async()=>{try{await i({items:t})}catch(e){}})}})(t),disabled:h,"aria-label":c("linkListWidget.removeAria"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(p.A,{className:"h-3 w-3"})})]},t))})},kpi:function(e){var t;let{data:r}=e,s=(0,n.c)("roots"),l=null!=(t=r.items)?t:[];if(0===l.length)return(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:s("kpiWidget.empty")});let i=Math.min(l.length,3);return(0,a.jsx)("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(".concat(i,", minmax(0,1fr))")},children:l.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-md border bg-card px-3 py-2 flex flex-col gap-0.5",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:e.label}),(0,a.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,a.jsx)("span",{className:"text-lg font-semibold tabular-nums",children:e.value}),"up"===e.delta&&(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-emerald-600"}),"down"===e.delta&&(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 text-rose-600"}),"flat"===e.delta&&(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.hint&&(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground leading-snug",children:e.hint})]},t))})},checklist:function(e){var t;let{data:r,readonly:s,onPatch:i}=e,o=(0,n.c)("roots"),d=null!=(t=r.items)?t:[],[u,m]=(0,l.useState)(d),[x,h]=(0,l.useTransition)(),[j,N]=(0,l.useState)(""),w=(0,l.useRef)("");(0,l.useEffect)(()=>{let e=JSON.stringify(d);e!==w.current&&(w.current=e,m(d))},[r]);let k=e=>{m(e),i&&h(async()=>{try{await i({items:e})}catch(e){}})},W=e=>{s||k(u.map((t,r)=>r===e?{...t,done:!t.done}:t))};return 0===u.length&&s?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:o("checklistWidget.empty")}):(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("ul",{className:"space-y-0.5",children:u.map((e,t)=>(0,a.jsxs)("li",{className:"group/row flex items-start gap-2 text-sm py-0.5 rounded hover:bg-accent/30 px-1 -mx-1 ".concat(e.done?"text-muted-foreground":""),children:[(0,a.jsx)("button",{type:"button",onClick:()=>W(t),disabled:s||x,"aria-label":e.done?o("checklistWidget.uncheckAria"):o("checklistWidget.checkAria"),className:"shrink-0 mt-0.5 disabled:opacity-50",children:e.done?(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 text-emerald-600"}):(0,a.jsx)(g.A,{className:"h-3.5 w-3.5 text-muted-foreground/60 hover:text-foreground"})}),(0,a.jsx)("span",{className:"flex-1 min-w-0 break-words ".concat(e.done?"line-through":""),onClick:()=>W(t),style:s?{}:{cursor:"pointer"},children:e.text}),!s&&(0,a.jsx)("button",{type:"button",onClick:()=>{!s&&k(u.filter((e,r)=>r!==t))},disabled:x,"aria-label":o("checklistWidget.removeAria"),className:"opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0 p-0.5 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(p.A,{className:"h-3 w-3"})})]},t))}),!s&&(0,a.jsxs)("form",{className:"flex items-center gap-1 pt-1",onSubmit:e=>{e.preventDefault(),(()=>{if(s)return;let e=j.trim();e&&(k([...u,{text:e,done:!1}]),N(""))})()},children:[(0,a.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)(y.p,{value:j,onChange:e=>N(e.target.value),placeholder:o("checklistWidget.newItemPlaceholder"),className:"h-7 text-xs flex-1 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 px-1",disabled:x}),j.trim()&&(0,a.jsx)(v.$,{type:"submit",size:"sm",variant:"ghost",className:"h-6 text-[10px] px-1.5",disabled:x,children:x?(0,a.jsx)(b.A,{className:"h-3 w-3 animate-spin"}):o("checklistWidget.add")})]})]})},quote:function(e){let{data:t}=e,r=(0,n.c)("roots");return(null==t?void 0:t.text)?(0,a.jsxs)("figure",{className:"relative pl-6",children:[(0,a.jsx)(j.A,{className:"h-5 w-5 absolute left-0 top-0 text-violet-300"}),(0,a.jsx)("blockquote",{className:"text-sm italic leading-relaxed",children:t.text}),t.attribution&&(0,a.jsxs)("figcaption",{className:"text-xs text-muted-foreground mt-1.5",children:["— ",t.attribution]})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:r("quoteWidget.empty")})},"kb-pinned":function(e){var t;let{rootId:r,data:s,readonly:i,onPatch:o}=e,c=(0,n.c)("roots"),u=null!=(t=s.items)?t:[],[p,m]=(0,l.useState)(u),[x,h]=(0,l.useTransition)(),g=(0,l.useRef)("");return((0,l.useEffect)(()=>{let e=JSON.stringify(u);e!==g.current&&(g.current=e,m(u))},[s]),0===p.length)?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:c("kbPinnedWidget.empty")}):(0,a.jsx)("ul",{className:"space-y-1",children:p.map((e,t)=>{var n;let s=e.rel.split("/").map(encodeURIComponent).join("/");return(0,a.jsxs)("li",{className:"group/row relative",children:[(0,a.jsxs)(w(),{href:"/roots/".concat(r,"/kb/").concat(s),className:"flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent/40 transition pr-7",children:[(0,a.jsx)(k.A,{className:"h-3 w-3 mt-0.5 shrink-0 text-emerald-700"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium truncate",children:null!=(n=e.title)?n:e.rel}),e.snippet&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed mt-0.5",children:e.snippet}),(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground font-mono mt-0.5 truncate",children:e.rel})]})]}),!i&&(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{if(!i){var t;m(t=p.filter((t,r)=>r!==e)),o&&h(async()=>{try{await o({items:t})}catch(e){}})}})(t),disabled:x,"aria-label":c("kbPinnedWidget.unpinAria"),title:c("kbPinnedWidget.unpinTitle"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(d.A,{className:"h-3 w-3"})})]},t)})})},progress:function(e){var t;let{data:r,readonly:s,onPatch:i}=e,o=(0,n.c)("roots"),c=null!=(t=r.items)?t:[],[d,u]=(0,l.useState)(c),[p,m]=(0,l.useTransition)(),x=(0,l.useRef)("");(0,l.useEffect)(()=>{let e=JSON.stringify(c);e!==x.current&&(x.current=e,u(c))},[r]);let h=(e,t)=>{if(!s){var r;u(r=d.map((r,a)=>a===e?{...r,current:Math.max(0,r.current+t)}:r)),i&&m(async()=>{try{await i({items:r})}catch(e){}})}};return 0===d.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:o("progressWidget.empty")}):(0,a.jsx)("ul",{className:"space-y-2.5",children:d.map((e,t)=>{let r=e.target>0?Math.max(0,Math.min(100,e.current/e.target*100)):0;return(0,a.jsxs)("li",{className:"space-y-1 group/row",children:[(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-2 text-sm",children:[(0,a.jsx)("span",{className:"truncate flex-1 min-w-0",children:e.label}),!s&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{type:"button",onClick:()=>h(t,-1),disabled:p||e.current<=0,"aria-label":"−1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,a.jsx)(W.A,{className:"h-3 w-3"})}),(0,a.jsx)("button",{type:"button",onClick:()=>h(t,1),disabled:p,"aria-label":"+1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,a.jsx)(f.A,{className:"h-3 w-3"})})]}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[e.current," / ",e.target,e.unit?" ".concat(e.unit):""]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-violet-600 transition-all",style:{width:"".concat(r,"%")}})})]},t)})})},image:function(e){var t;let{data:r}=e,s=(0,n.c)("roots");return(null==r?void 0:r.url)?(0,a.jsxs)("figure",{className:"space-y-1",children:[(0,a.jsx)("img",{src:r.url,alt:null!=(t=r.alt)?t:"",className:"rounded-md w-full h-auto border",loading:"lazy"}),r.caption&&(0,a.jsx)("figcaption",{className:"text-xs text-muted-foreground text-center",children:r.caption})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:s("imageWidget.empty")})},"stat-table":function(e){var t;let{data:r}=e,s=(0,n.c)("roots"),l=null!=(t=r.rows)?t:[];return 0===l.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:s("statTableWidget.empty")}):(0,a.jsx)("div",{className:"overflow-x-auto -mx-1",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[r.columns&&r.columns.length>0&&(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{className:"border-b",children:r.columns.map((e,t)=>(0,a.jsx)("th",{className:"text-left text-[10px] uppercase tracking-wider text-muted-foreground font-medium px-1.5 py-1.5",children:e},t))})}),(0,a.jsx)("tbody",{children:l.map((e,t)=>(0,a.jsx)("tr",{className:"border-b border-dashed last:border-b-0 hover:bg-accent/30",children:e.map((e,t)=>(0,a.jsx)("td",{className:"px-1.5 py-1.5 align-top",children:e},t))},t))})]})})},map:function(e){var t,r,s;let{data:i,readonly:o,onPatch:c}=e,u=(0,n.c)("roots"),m=(0,l.useRef)(null),x=(0,l.useRef)(null),[h,g]=(0,l.useState)(!1),[v,y]=(0,l.useState)(T.JY),[j,N]=(0,l.useState)(""),[w,k]=(0,l.useState)(!1),[W,F]=(0,l.useState)([]),[L,z]=(0,l.useState)(!1),[_,P]=(0,l.useState)([]),q=null!=(r=i.points)?r:[],B=null!=(s=null==(t=i.route)?void 0:t.stops)?s:[],D=L?_:B,J=(0,l.useMemo)(()=>D.map(e=>q[e]).filter(e=>!!e).map(e=>({lat:e.lat,lng:e.lng})),[D,q]),G=(0,l.useMemo)(()=>T.yp.filter(e=>v.includes(e.id)),[v]);(0,l.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await M();!e&&t.ok&&y(t.enabled)}catch(e){}})(),()=>{e=!0}},[]),(0,l.useEffect)(()=>{if(window.L)return void g(!0);if(!document.querySelector('link[href="'.concat(U,'"]'))){let e=document.createElement("link");e.rel="stylesheet",e.href=U,document.head.appendChild(e)}let e=document.querySelector('script[src="'.concat(E,'"]'));if(e){e.addEventListener("load",()=>g(!0)),window.L&&g(!0);return}let t=document.createElement("script");t.src=E,t.async=!0,t.onload=()=>g(!0),t.onerror=()=>R.oR.error(u("mapWidget.leafletLoadFailed")),document.head.appendChild(t)},[]),(0,l.useEffect)(()=>{var e,t,r;if(!h||!m.current)return;let a=window.L;if(!a||(x.current&&(x.current.remove(),x.current=null),0===q.length))return;let n=a.map(m.current,{scrollWheelZoom:!1,zoomControl:!0});x.current=n,a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(n);let s=q.map((e,t)=>{let r=D.includes(t),s=function(e,t,r){let a=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),n=t.map(t=>{let r=t.urlFor(e.lat,e.lng);return'<a href="'.concat(a(r),'" target="_blank" rel="noopener noreferrer" ')+'title="'.concat(a(t.label),'" ')+'style="display:inline-flex;align-items:center;gap:4px;margin:2px 4px 2px 0;padding:2px 6px;border-radius:5px;border:1px solid #e5e7eb;text-decoration:none;font-size:11px;color:#111;background:#fff;">'+'<span style="display:inline-block;width:14px;height:14px;border-radius:3px;background:'.concat(t.brand,";")+"color:#fff;font-size:9px;font-weight:700;line-height:14px;text-align:center;"+"letter-spacing:".concat(t.glyph.length>1?"-0.05em":"0",'">').concat(a(t.glyph),"</span>")+"<span>".concat(a(t.label),"</span>")+"</a>"}).join("");return['<div style="font-family:inherit;min-width:200px">','<div style="font-weight:600;font-size:13px;margin-bottom:2px">'.concat(a(e.title),"</div>"),e.description?'<div style="font-size:12px;color:#666;margin-bottom:6px">'.concat(a(e.description),"</div>"):"",'<div style="font-family:monospace;font-size:10px;color:#888;margin-bottom:6px">'.concat(e.lat.toFixed(5),", ").concat(e.lng.toFixed(5),"</div>"),t.length>0?'<div style="font-size:10px;color:#888;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:2px">'.concat(a(r.openIn),"</div>").concat(n):"",'<div style="margin-top:6px"><button type="button" data-reflex-copy="'.concat(e.lat,", ").concat(e.lng,'" style="font-size:11px;padding:2px 8px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer">\uD83D\uDCCB ').concat(a(r.copyCoords),"</button></div>"),"</div>"].filter(Boolean).join("")}(e,G,{openIn:u("mapWidget.openIn"),copyCoords:u("mapWidget.copyCoords")}),l=a.marker([e.lat,e.lng],{opacity:L&&!r?.55:1}).addTo(n);return l.bindPopup(s,{maxWidth:280}),l.on("click",()=>{L&&P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}),l});J.length>=2&&a.polyline(J.map(e=>[e.lat,e.lng]),{color:null!=(t=null==(e=i.route)?void 0:e.color)?t:"#7c3aed",weight:4,opacity:.85,dashArray:L?"6,6":void 0}).addTo(n);let l=e=>{let t=e.target.closest("[data-reflex-copy]");if(t){let r=t.getAttribute("data-reflex-copy");r&&navigator.clipboard.writeText(r).then(()=>R.oR.success(u("mapWidget.copied"))).catch(()=>R.oR.error(u("mapWidget.clipboardUnavailable"))),e.preventDefault()}};if(m.current.addEventListener("click",l),i.center&&"number"==typeof i.zoom)n.setView([i.center.lat,i.center.lng],i.zoom);else if(1===q.length)n.setView([q[0].lat,q[0].lng],null!=(r=i.zoom)?r:12);else{let e=a.featureGroup(s);n.fitBounds(e.getBounds().pad(.2))}return()=>{var e;null==(e=m.current)||e.removeEventListener("click",l),n.remove(),x.current=null}},[h,i,v.join("|"),L,_.join(",")]);let Y=!o&&!!c,K=async()=>{let e=j.trim();if(e){k(!0),F([]);try{let t="".concat("https://nominatim.openstreetmap.org/search","?q=").concat(encodeURIComponent(e),"&format=json&limit=6"),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw Error("status ".concat(r.status));let a=await r.json();F(a),0===a.length&&R.oR.message(u("mapWidget.nothingFound"))}catch(e){R.oR.error(u("mapWidget.searchFailed",{error:e instanceof Error?e.message:String(e)}))}finally{k(!1)}}},V=async e=>{var t;if(!Y)return;let r=Number(e.lat),a=Number(e.lon);if(!Number.isFinite(r)||!Number.isFinite(a))return void R.oR.error(u("mapWidget.invalidCoordinates"));let n=(null==(t=e.display_name.split(",")[0])?void 0:t.trim())||e.display_name.slice(0,60),s={...i,points:[...q,{lat:r,lng:a,title:n,description:e.display_name}]};F([]),N(""),await (null==c?void 0:c(s))},Z=async e=>{var t,r;if(!Y)return;let a=q.filter((t,r)=>r!==e),n=i.route;if(null==(r=i.route)||null==(t=r.stops)?void 0:t.length){let t=i.route.stops.filter(t=>t!==e).map(t=>t>e?t-1:t);n=t.length>=2?{...i.route,stops:t}:void 0}let s={...i,points:a,...n?{route:n}:{route:void 0}};await (null==c?void 0:c(s))},H=async()=>{if(!Y)return;let e={...i,route:void 0};await (null==c?void 0:c(e)),z(!1),P([])},$=async()=>{var e;if(!Y)return;if(_.length<2)return void R.oR.error(u("mapWidget.routeNeedsTwo"));let t={...i,route:{...null!=(e=i.route)?e:{},stops:_}};await (null==c?void 0:c(t)),z(!1)};return 0!==q.length||Y?(0,a.jsxs)("div",{className:"space-y-2",children:[Y&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(C.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,a.jsx)("input",{type:"search",value:j,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),K())},placeholder:u("mapWidget.searchPlaceholder"),className:"w-full rounded border bg-background pl-7 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void K(),disabled:w||!j.trim(),className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",children:[w?(0,a.jsx)(b.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(C.A,{className:"h-3 w-3"}),u("mapWidget.search")]}),L?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>void $(),className:"rounded px-2 py-1 text-xs bg-violet-600 text-white hover:bg-violet-700 inline-flex items-center gap-1",title:u("mapWidget.saveRouteTitle"),children:[(0,a.jsx)(A.A,{className:"h-3 w-3"})," ",u("mapWidget.save")]}),(0,a.jsx)("button",{type:"button",onClick:()=>{z(!1),P([])},className:"rounded border px-2 py-1 text-xs hover:bg-accent inline-flex items-center gap-1",title:u("mapWidget.cancelTitle"),children:(0,a.jsx)(d.A,{className:"h-3 w-3"})})]}):(0,a.jsxs)("button",{type:"button",onClick:()=>{P(B),z(!0)},disabled:q.length<2,className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",title:u("mapWidget.routeButtonTitle"),children:[(0,a.jsx)(A.A,{className:"h-3 w-3"}),u("mapWidget.route")]})]}),W.length>0&&(0,a.jsx)("ul",{className:"rounded border bg-card divide-y text-xs max-h-44 overflow-y-auto",children:W.map((e,t)=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>void V(e),className:"w-full text-left flex items-start gap-2 px-2 py-1.5 hover:bg-accent",children:[(0,a.jsx)(f.A,{className:"h-3 w-3 mt-0.5 text-emerald-700 shrink-0"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block font-medium truncate",children:e.display_name.split(",")[0]}),(0,a.jsx)("span",{className:"block text-[10px] text-muted-foreground truncate",children:e.display_name})]})]})},t))}),L&&(0,a.jsx)("div",{className:"rounded border border-violet-200 bg-violet-50 dark:bg-violet-950/30 dark:border-violet-900/50 px-2 py-1.5 text-[11px] text-violet-900 dark:text-violet-200",children:u.rich("mapWidget.routeModeHint",{count:_.length,strong:e=>(0,a.jsx)("strong",{children:e})})})]}),(0,a.jsx)("div",{ref:m,className:"rounded-md border overflow-hidden bg-muted/30",style:{height:280}}),!L&&J.length>=2&&G.length>0&&(0,a.jsx)("div",{className:"rounded border bg-card px-2 py-1.5",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium",children:[(0,a.jsx)(A.A,{className:"h-3 w-3 text-violet-600"}),u("mapWidget.routeLabel",{count:J.length})]}),G.map(e=>(0,a.jsx)(O,{service:e,stops:J},e.id)),Y&&(0,a.jsxs)("button",{type:"button",onClick:()=>void H(),className:"ml-auto text-[10px] text-muted-foreground hover:text-destructive inline-flex items-center gap-0.5",title:u("mapWidget.deleteRouteTitle"),children:[(0,a.jsx)(p.A,{className:"h-3 w-3"}),u("mapWidget.delete")]})]})}),(0,a.jsx)("ul",{className:"space-y-1",children:q.map((e,t)=>{let r=D.indexOf(t);return(0,a.jsxs)("li",{className:"flex items-start gap-2 rounded-md border bg-card px-2 py-1.5 text-xs "+(L&&r>=0?"ring-1 ring-violet-400 border-violet-300":""),children:[L?(0,a.jsx)("button",{type:"button",onClick:()=>P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]),className:"h-5 w-5 mt-0.5 shrink-0 rounded-full border text-[10px] font-mono inline-flex items-center justify-center "+(r>=0?"bg-violet-600 text-white border-violet-600":"bg-card text-muted-foreground"),title:r>=0?u("mapWidget.removeFromRoute"):u("mapWidget.addToRoute"),children:r>=0?r+1:"+"}):(0,a.jsx)(S.A,{className:"h-3 w-3 mt-1 shrink-0 "+(B.includes(t)?"text-violet-600":"text-emerald-700")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"font-medium truncate",children:e.title}),e.description&&(0,a.jsx)("p",{className:"text-muted-foreground leading-snug mt-0.5 line-clamp-2",children:e.description}),(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:[e.lat.toFixed(5),", ",e.lng.toFixed(5)]})]}),(0,a.jsx)(I,{point:e,services:G,interactive:Y,onRemove:()=>void Z(t)})]},t)})})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:u("mapWidget.noPointsReadonly")})},"utility-card":function(e){let{rootId:t,data:r,readonly:s}=e,l=(0,n.c)("roots"),i="project"===r.utilityScope?"/utilities/project/".concat(r.utilityId,"?rootId=").concat(encodeURIComponent(t)):"/utilities/global/".concat(r.utilityId);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,a.jsx)(_.A,{className:"h-3 w-3 text-violet-600"}),(0,a.jsx)("span",{children:l("utilityCardWidget.miniAppLabel")}),(0,a.jsx)("span",{className:"font-mono normal-case tracking-normal text-muted-foreground/80",children:r.utilityId}),(0,a.jsxs)(w(),{href:i,className:"ml-auto inline-flex items-center gap-0.5 text-[10px] text-violet-700 hover:underline normal-case tracking-normal",title:l("utilityCardWidget.openFullTitle"),children:[l("utilityCardWidget.openLabel"),(0,a.jsx)(o.A,{className:"h-2.5 w-2.5"})]})]}),r.inner.title&&(0,a.jsx)("h4",{className:"text-sm font-medium",children:r.inner.title}),r.inner.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground -mt-1",children:r.inner.description}),(0,a.jsx)("div",{children:q(t,r.inner.kind,r.inner.data,{readonly:!0})})]})}};function q(e,t,r,n){var s;let l=P[t];return l?(0,a.jsx)(l,{rootId:e,data:r,readonly:null!=(s=null==n?void 0:n.readonly)&&s,onPatch:null==n?void 0:n.onPatch}):(0,a.jsx)(B,{kind:t})}function B(e){let{kind:t}=e,r=(0,n.c)("roots");return(0,a.jsx)("p",{className:"text-xs text-destructive",children:r.rich("widgetsCommon.unknownKind",{kind:t,code:e=>(0,a.jsx)("code",{className:"font-mono",children:e})})})}},62951:(e,t,r)=>{r.d(t,{t:()=>n});var a=r(7911);let n=(0,a.createServerReference)("600511d2cb84a2ceabb4b62bbf0286dfdd888078ed",a.callServer,void 0,a.findSourceMapURL,"restoreWidgetAction")},68682:(e,t,r)=>{function a(e){return"".concat(e.lat,",").concat(e.lng)}function n(e){return"".concat(e.lng,",").concat(e.lat)}r.d(t,{JY:()=>l,yp:()=>s});let s=[{id:"google",label:"Google Maps",description:"Global, navigation + street view. Works everywhere except where the RF blocks it.",brand:"#4285F4",glyph:"G",urlFor:(e,t)=>"https://www.google.com/maps/dir/?api=1&destination=".concat(e,",").concat(t),routeUrlFor:e=>{if(e.length<2)return"";let t=a(e[0]),r=a(e[e.length-1]),n=e.slice(1,-1).map(a).join("|"),s=n?"&waypoints=".concat(encodeURIComponent(n)):"";return"https://www.google.com/maps/dir/?api=1&origin=".concat(t,"&destination=").concat(r).concat(s)}},{id:"yandex",label:"Yandex Maps",description:"CIS region, best RF detail and real-time traffic.",brand:"#FFCC00",glyph:"Y",urlFor:(e,t)=>"https://yandex.ru/maps/?rtext=~".concat(e,",").concat(t,"&rtt=auto"),routeUrlFor:e=>"https://yandex.ru/maps/?rtext=".concat(e.map(a).join("~"),"&rtt=auto")},{id:"2gis",label:"2GIS",description:"CIS region, precise addresses and POI. Uniquely strong on RF cities.",brand:"#1BA049",glyph:"2",urlFor:(e,t)=>"https://2gis.ru/routeSearch/to/".concat(t,",").concat(e),routeUrlFor:e=>{let t=n(e[0]),r=n(e[e.length-1]),a=e.slice(1,-1).map(e=>"/via/".concat(n(e))).join("");return"https://2gis.ru/routeSearch/rsType/car/from/".concat(t).concat(a,"/to/").concat(r)}},{id:"apple",label:"Apple Maps",description:"Opens in the native app on iOS/macOS, otherwise on the website.",brand:"#1d1d1f",glyph:"A",urlFor:(e,t)=>"https://maps.apple.com/?daddr=".concat(e,",").concat(t),routeUrlFor:e=>{let t=a(e[0]),r=e.slice(1).map(e=>"+to:".concat(a(e))).join("");return"https://maps.apple.com/?saddr=".concat(t,"&daddr=").concat(t).concat(r)}},{id:"osm",label:"OpenStreetMap",description:"Open data, no account required. Basic navigation.",brand:"#7EB73F",glyph:"OSM",urlFor:(e,t)=>"https://www.openstreetmap.org/directions?to=".concat(e,",").concat(t),routeUrlFor:e=>{let t=e.map(a).join(";");return"https://www.openstreetmap.org/directions?route=".concat(encodeURIComponent(t))}},{id:"waze",label:"Waze",description:"Car navigation with crowd-sourced traffic and alerts.",brand:"#33CCFF",glyph:"W",urlFor:(e,t)=>"https://waze.com/ul?ll=".concat(e,",").concat(t,"&navigate=yes"),routeUrlFor:e=>{let t=e[e.length-1];return"https://waze.com/ul?ll=".concat(t.lat,",").concat(t.lng,"&navigate=yes")}},{id:"organic",label:"Organic Maps",description:"Offline maps with open data. Opens in the app.",brand:"#006C35",glyph:"OM",urlFor:(e,t)=>"om://map?ll=".concat(e,",").concat(t),routeUrlFor:e=>{let t=e[0],r=e[e.length-1];return"om://route?sll=".concat(t.lat,",").concat(t.lng,"&saddr=&dll=").concat(r.lat,",").concat(r.lng,"&daddr=&type=vehicle")}}],l=["google","yandex","apple","osm"]}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[357],{15365:(e,r,t)=>{t.d(r,{p:()=>j});var a=t(4624),n=t(99356),s=t(49411),o=t(88365),i=t(72461),l=t(43455),c=t(13561),d=t(60532),u=t(3239),m=t(8096),p=t(94151),x=t(65714),b=t(43153),f=t(95265),h=t(56221),g=t(85253),v=t(15523),w=t(7911);let y=(0,w.createServerReference)("408c0ad85dae45d66a47ce63a7e36c290ec25af47d",w.callServer,void 0,w.findSourceMapURL,"summarizeYoutubeAction");var k=t(79426);function j(e){let{source:r,onSendToChat:t,autoSummarizeYoutube:s}=e,[c,d]=(0,n.useState)(null);return(0,a.jsxs)("div",{className:"prose prose-neutral dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-foreground [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_:not(pre)>code]:text-[0.9em] [&_code]:font-mono [&_table]:text-sm",children:[(0,a.jsx)(o.oz,{remarkPlugins:[i.A],rehypePlugins:[[l.A,{detect:!0,ignoreMissing:!0}]],components:{a:e=>{let{href:r,children:n,...o}=e,i=r?function(e){try{let r=new URL(e),t=r.hostname.replace(/^www\./,"");if("youtu.be"===t){let e=r.pathname.slice(1).split("/")[0];return e&&/^[A-Za-z0-9_-]{6,}$/.test(e)?e:null}if("youtube.com"===t||"m.youtube.com"===t||"youtube-nocookie.com"===t){if("/watch"===r.pathname){let e=r.searchParams.get("v");return e&&/^[A-Za-z0-9_-]{6,}$/.test(e)?e:null}let e=/^\/(shorts|embed|live|v)\/([^/?#]+)/.exec(r.pathname);if(e&&/^[A-Za-z0-9_-]{6,}$/.test(e[2]))return e[2]}}catch(e){}return null}(r):null;return i&&r?(0,a.jsx)(A,{url:r,videoId:i,autoSummarize:null!=s&&s,...t?{onSendToChat:t}:{}}):(0,a.jsx)("a",{href:r,...o,children:n})},img:e=>{let{src:r,alt:t,title:n}=e;return"string"!=typeof r||0===r.length?null:(0,a.jsx)(N,{src:r,alt:"string"==typeof t?t:"",title:"string"==typeof n?n:void 0,onZoom:e=>d(e)})}},children:r}),c&&(0,a.jsx)(_,{src:c.src,alt:c.alt,onClose:()=>d(null)})]})}function N(e){var r;let{src:t,alt:n,title:o,onZoom:i}=e,l=(0,s.c)("roots");return(0,a.jsx)("img",{src:t,alt:n,title:null!=(r=null!=o?o:n)?r:l("markdown.openFullscreen"),onClick:()=>i({src:t,alt:n}),className:"cursor-zoom-in rounded-md border bg-muted/40 transition hover:opacity-90",loading:"lazy"})}function _(e){let{src:r,alt:t,onClose:o}=e,i=(0,s.c)("roots"),l=(0,n.useCallback)(e=>{"Escape"===e.key&&o()},[o]);return(0,n.useEffect)(()=>{document.addEventListener("keydown",l);let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",l),document.body.style.overflow=e}},[l]),(0,a.jsxs)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center p-6 bg-background/85 backdrop-blur-sm cursor-zoom-out",onClick:o,role:"dialog","aria-label":t||i("markdown.imagePreview"),children:[(0,a.jsx)(g.$,{type:"button",size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-9 w-9 bg-card/80 hover:bg-card",onClick:e=>{e.stopPropagation(),o()},"aria-label":i("markdown.closeAria"),children:(0,a.jsx)(c.A,{className:"h-5 w-5"})}),(0,a.jsx)("img",{src:r,alt:t,className:"max-h-full max-w-full object-contain rounded-lg shadow-2xl",onClick:e=>e.stopPropagation()}),t&&(0,a.jsx)("div",{className:"absolute bottom-6 inset-x-0 mx-auto max-w-3xl px-6 text-center text-sm text-foreground/80 pointer-events-none",children:t})]})}function A(e){let{url:r,videoId:t,onSendToChat:o,autoSummarize:i}=e,l=(0,s.c)("roots"),[w,j]=(0,n.useTransition)(),[N,_]=(0,n.useState)(null),[A,z]=(0,n.useState)(!1),[C,S]=(0,n.useState)(""),[R,$]=(0,n.useState)(!1),E=(0,n.useRef)(!1),L=()=>{_(null),j(async()=>{let e=await y({url:r});if(e.ok){_(e.text),z(!1);return}if(e.needsKey)return void z(!0);h.oR.error(e.error)})};(0,n.useEffect)(()=>{i&&(E.current||(E.current=!0,L()))},[i]);let P=async()=>{if(!C.trim())return void h.oR.error(l("markdown.enterKey"));$(!0);try{let e=await (0,k.A)(C.trim());if(!e.ok)return void h.oR.error(e.error);h.oR.success(l("markdown.geminiKeySaved")),S(""),z(!1),L()}finally{$(!1)}};return(0,a.jsxs)("span",{className:"not-prose my-4 block rounded-lg border bg-card overflow-hidden",children:[(0,a.jsx)("span",{className:"relative block w-full",style:{paddingTop:"56.25%"},children:(0,a.jsx)("iframe",{src:"https://www.youtube-nocookie.com/embed/".concat(t),className:"absolute inset-0 h-full w-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0,title:"YouTube video"})}),(0,a.jsxs)("span",{className:"flex items-center gap-2 p-2 border-t bg-muted/30",children:[(0,a.jsx)(d.A,{className:"h-4 w-4 text-red-600 shrink-0"}),(0,a.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:underline truncate flex-1 min-w-0",children:r}),(0,a.jsxs)(g.$,{type:"button",size:"sm",variant:"outline",onClick:L,disabled:w,className:"gap-1 shrink-0 h-7",children:[w?(0,a.jsx)(u.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(m.A,{className:"h-3 w-3"}),l("markdown.summarize")]})]}),A&&(0,a.jsxs)("span",{className:"block border-t bg-amber-50/60 p-3 space-y-2",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2 text-xs text-amber-900",children:[(0,a.jsx)(p.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"font-medium",children:l("markdown.needsGeminiKey")})]}),(0,a.jsx)("span",{className:"block text-[11px] text-amber-900/80",children:l.rich("markdown.geminiKeyHelp",{link:()=>(0,a.jsx)("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"aistudio.google.com/apikey"}),path:()=>(0,a.jsx)("code",{className:"font-mono",children:"~/.reflex/api-keys/gemini.json"}),modelsList:()=>(0,a.jsx)("code",{className:"font-mono",children:"models.list"})})}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)(v.p,{type:"password",value:C,onChange:e=>S(e.target.value),placeholder:"AIza…",className:"font-mono text-xs h-8 flex-1",disabled:R}),(0,a.jsxs)(g.$,{type:"button",size:"sm",onClick:()=>void P(),disabled:R||!C.trim(),className:"h-8 gap-1",children:[R?(0,a.jsx)(u.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(x.A,{className:"h-3 w-3"}),l("markdown.saveAndContinue")]}),(0,a.jsx)(g.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>z(!1),className:"h-8 w-8",children:(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"})})]})]}),N&&(0,a.jsxs)("span",{className:"block border-t p-3 space-y-2",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2 text-[11px] uppercase tracking-wider text-muted-foreground",children:[(0,a.jsx)(b.A,{className:"h-3 w-3 text-emerald-600"}),"Gemini summary",(0,a.jsxs)(g.$,{type:"button",size:"sm",variant:"ghost",onClick:L,className:"ml-auto h-6 text-[10px] gap-1",disabled:w,children:[w?(0,a.jsx)(u.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(m.A,{className:"h-3 w-3"}),l("markdown.redo")]}),o&&(0,a.jsxs)(g.$,{type:"button",size:"sm",variant:"outline",onClick:()=>o(N,r),className:"h-6 text-[10px] gap-1",children:[(0,a.jsx)(f.A,{className:"h-3 w-3"}),l("markdown.toChat")]})]}),(0,a.jsx)("span",{className:"block",children:(0,a.jsx)("span",{className:"block text-sm whitespace-pre-wrap leading-relaxed",children:N})})]})]})}},15523:(e,r,t)=>{t.d(r,{p:()=>s});var a=t(4624);t(99356);var n=t(13506);function s(e){let{className:r,type:t,...s}=e;return(0,a.jsx)("input",{type:t,"data-slot":"input",className:(0,n.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",r),...s})}},28310:(e,r,t)=>{t.d(r,{E:()=>l});var a=t(4624);t(99356);var n=t(60621),s=t(50362),o=t(13506);let i=(0,n.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function l(e){let{className:r,variant:t="default",asChild:n=!1,...l}=e,c=n?s.bL:"span";return(0,a.jsx)(c,{"data-slot":"badge","data-variant":t,className:(0,o.cn)(i({variant:t}),r),...l})}},78825:(e,r,t)=>{t.d(r,{J:()=>o});var a=t(4624);t(99356);var n=t(33976),s=t(13506);function o(e){let{className:r,...t}=e;return(0,a.jsx)(n.Root,{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",r),...t})}},79426:(e,r,t)=>{t.d(r,{A:()=>n});var a=t(7911);let n=(0,a.createServerReference)("40b0a116af1bfb9f70336ace63436ef128cfd4c6b6",a.callServer,void 0,a.findSourceMapURL,"saveGeminiKeyAction")},91074:(e,r,t)=>{t.d(r,{Separator:()=>o});var a=t(4624);t(99356);var n=t(44188),s=t(13506);function o(e){let{className:r,orientation:t="horizontal",decorative:o=!0,...i}=e;return(0,a.jsx)(n.b,{"data-slot":"separator",decorative:o,orientation:t,className:(0,s.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",r),...i})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4108],{25115:(e,c,t)=>{t.d(c,{T:()=>a});var r=t(7911);let a=(0,r.createServerReference)("6091270221f4de80ebf1e48cbd5a86b1de289cc390",r.callServer,void 0,r.findSourceMapURL,"beginOAuthAction")},37807:(e,c,t)=>{t.d(c,{o:()=>a});var r=t(7911);let a=(0,r.createServerReference)("00e5c813d1d02335c804afd0df400b492aa16cd3e7",r.callServer,void 0,r.findSourceMapURL,"listOAuthStatusesAction")},73147:(e,c,t)=>{t.d(c,{J:()=>a});var r=t(7911);let a=(0,r.createServerReference)("40cf8f4d5501e919e573c73b6d14701d7cbeb2a673",r.callServer,void 0,r.findSourceMapURL,"getOAuthClientAction")},94108:(e,c,t)=>{t.d(c,{beginOAuthAction:()=>i.T,getOAuthClientAction:()=>d.J,listOAuthStatusesAction:()=>r.o,saveOAuthClientAction:()=>a.S});var r=t(37807),a=t(95587),d=t(73147),i=t(25115)},95587:(e,c,t)=>{t.d(c,{S:()=>a});var r=t(7911);let a=(0,r.createServerReference)("4006666f70b6dbbc71c944cadf7c60ce332f11107c",r.callServer,void 0,r.findSourceMapURL,"saveOAuthClientAction")}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4971],{4971:(e,t,r)=>{r.d(t,{UtilityIframe:()=>w});var s=r(4624),l=r(99356),a=r(79182),n=r(49411),i=r(39783),o=r(13561),c=r(8096),u=r(3239),d=r(95265),p=r(54400),h=r.n(p),m=r(56221),x=r(7911);let f=(0,x.createServerReference)("400b14da94f93e958c4820fd255e1dba2e675ee5f0",x.callServer,void 0,x.findSourceMapURL,"getOrCreateUtilityHelperTopicAction"),y=(0,x.createServerReference)("60c8f40603d8894bb9dca7e05ed01a48c9a8eaa186",x.callServer,void 0,x.findSourceMapURL,"loadHelperTranscriptAction");function v(e){let{scope:t,utilityId:r,utilityName:p,rootId:x,requestSnapshot:v,onClose:w}=e,b=(0,n.c)("app"),[j,k]=(0,l.useState)(null),[N,S]=(0,l.useState)([]),[A,M]=(0,l.useState)(""),[T,E]=(0,l.useState)(null),[R,C]=(0,l.useTransition)(),[H,L]=(0,l.useState)(!1),O=(0,l.useRef)(null),I=(0,l.useRef)(null),P=(0,l.useRef)(""),[q,z]=(0,l.useState)("");(0,l.useEffect)(()=>{if(!x)return void E(b("utilities.helper.projectOnly"));let e=!1;return(async()=>{let t=await f({rootId:x,utilityId:r,utilityName:null!=p?p:r});if(e)return;if(!t.ok)return E(t.error);k(t.topicId);let s=await y(x,t.topicId);!e&&s.ok&&S(s.messages)})(),()=>{e=!0}},[x,r,p]),(0,l.useEffect)(()=>{if(!x||!j)return;let e=new EventSource("/api/roots/".concat(x,"/chat/").concat(j,"/stream?since=").concat(Number.MAX_SAFE_INTEGER));return I.current=e,e.addEventListener("event",e=>{try{let t=JSON.parse(e.data);"assistant-delta"===t.type&&"string"==typeof t.text?(P.current+=t.text,z(P.current),L(!0)):"turn-end"===t.type||"agent-end"===t.type?(P.current="",z(""),L(!1),(async()=>{let e=await y(x,j);e.ok&&S(e.messages)})()):t.type}catch(e){}}),e.onerror=()=>{},()=>{e.close(),I.current=null}},[x,j]),(0,l.useEffect)(()=>{let e=O.current;e&&(e.scrollTop=e.scrollHeight)},[N,q]);let _=()=>{let e=A.trim();e&&x&&j&&(M(""),S(t=>[...t,{role:"user",text:e,ts:new Date().toISOString()}]),C(async()=>{let t;try{t=await Promise.race([v(),new Promise(e=>setTimeout(()=>e(void 0),600))])}catch(e){}let r=void 0!==t?function(e,t){let r;try{r="string"==typeof t?t:JSON.stringify(t,null,2)}catch(e){r=String(t)}return r.length>4e3&&(r=r.slice(0,4e3)+"\n…[truncated]"),["[Mini-app context]",r,"[/context]\n",e].join("\n")}(e,t):e;try{let e=await fetch("/api/roots/".concat(x,"/chat/").concat(j,"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:r})});if(!e.ok){var s;let t=await e.json().catch(()=>({}));m.oR.error(null!=(s=t.error)?s:"HTTP ".concat(e.status))}}catch(e){m.oR.error(String(e))}}))};return(0,s.jsxs)("aside",{className:"flex h-full flex-col border-l bg-card",children:[(0,s.jsxs)("header",{className:"border-b px-3 py-2 flex items-center gap-2",children:[(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:b("utilities.helper.title")}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:b("utilities.helper.hint")}),x&&j&&(0,s.jsx)(h(),{href:"/roots/".concat(x,"/chat/").concat(j),className:"ml-auto p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:b("utilities.helper.openFull"),children:(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"})}),w&&(0,s.jsx)("button",{type:"button",onClick:w,className:"p-1 rounded hover:bg-accent "+(x&&j?"":"ml-auto"),title:b("utilities.helper.hide"),children:(0,s.jsx)(o.A,{className:"h-3.5 w-3.5"})})]}),(0,s.jsxs)("div",{ref:O,className:"flex-1 overflow-y-auto px-3 py-2 space-y-2 text-sm",children:[T&&(0,s.jsx)("p",{className:"text-xs text-red-600",children:T}),!T&&0===N.length&&!q&&(0,s.jsxs)("div",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[(0,s.jsx)(c.A,{className:"h-3 w-3 mt-0.5 text-violet-600 shrink-0"}),(0,s.jsx)("span",{children:b("utilities.helper.welcome")})]}),N.map((e,t)=>(0,s.jsx)(g,{role:e.role,text:e.text},t)),H&&q&&(0,s.jsx)(g,{role:"assistant",text:q,streaming:!0}),R&&!H&&(0,s.jsxs)("div",{className:"mr-6 rounded-md bg-muted/40 px-2 py-1.5 text-xs text-muted-foreground inline-flex items-center gap-2",children:[(0,s.jsx)(u.A,{className:"h-3 w-3 animate-spin"}),b("utilities.helper.thinking")]})]}),(0,s.jsxs)("div",{className:"border-t px-3 py-2 flex items-end gap-1.5",children:[(0,s.jsx)("textarea",{value:A,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())},rows:1,placeholder:b("utilities.helper.placeholder"),disabled:R||!!T||!j,className:"flex-1 resize-none rounded border bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400 max-h-24"}),(0,s.jsx)("button",{type:"button",onClick:_,disabled:R||!A.trim()||!!T||!j,className:"inline-flex items-center justify-center rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50",children:R?(0,s.jsx)(u.A,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(d.A,{className:"h-3 w-3"})})]})]})}function g(e){let{role:t,text:r,streaming:l}=e,a=(0,n.c)("app"),i=r;return("user"===t&&(i=i.replace(/^\s*\[Mini-app context\][\s\S]*?\[\/context\]\s*/,"").trim()),i.trim())?(0,s.jsxs)("div",{className:"user"===t?"ml-6 rounded-md bg-violet-50 dark:bg-violet-950/30 px-2 py-1.5":"mr-6 rounded-md bg-muted/40 px-2 py-1.5 whitespace-pre-wrap",children:[(0,s.jsxs)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:[a("user"===t?"utilities.helper.you":"assistant"===t?"utilities.helper.reflex":"utilities.helper.system"),l&&(0,s.jsx)("span",{className:"ml-1 text-violet-600",children:"●"})]}),i]}):null}function w(e){let{scope:t,id:r,rootId:i,className:o,title:c,agentChat:u,utilityName:d}=e,p=(0,n.c)("app"),h=(0,l.useRef)(null),m=(0,l.useRef)(null),[x,f]=(0,l.useState)(!0),y=i?"?rootId=".concat(encodeURIComponent(i)):"",g="/api/utilities/".concat(t,"/").concat(r,"/iframe").concat(y),w="/api/utilities/".concat(t,"/").concat(r,"/host").concat(y);(0,l.useEffect)(()=>{let e=async e=>{var t,r,s,l,a,n;let i=e.data;if(!i||e.source!==(null==(t=h.current)?void 0:t.contentWindow))return;if("snapshot-payload"===i.type){let e=m.current;e&&(clearTimeout(e.timer),m.current=null,e.resolve(i.snapshot));return}if("host-rpc"!==i.type)return;let o=i.id;try{let e=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:i.method,args:i.args})}),t=await e.json();null==(s=h.current)||null==(r=s.contentWindow)||r.postMessage(t.ok?{type:"host-rpc-result",id:o,ok:!0,result:t.result}:{type:"host-rpc-result",id:o,ok:!1,error:null!=(l=t.error)?l:"HTTP ".concat(e.status)},"*")}catch(e){null==(n=h.current)||null==(a=n.contentWindow)||a.postMessage({type:"host-rpc-result",id:o,ok:!1,error:e instanceof Error?e.message:String(e)},"*")}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[w]);let b=(0,s.jsx)("iframe",{ref:h,src:g,sandbox:"allow-scripts allow-forms allow-same-origin",className:null!=o?o:"h-full w-full border-0 bg-white",title:null!=c?c:"utility-".concat(r)});return u?(0,s.jsxs)("div",{className:"flex h-full w-full",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0 relative",children:[b,!x&&(0,s.jsxs)("button",{type:"button",onClick:()=>f(!0),className:"absolute right-3 bottom-3 inline-flex items-center gap-1 rounded-full bg-violet-600 px-3 py-1.5 text-xs text-white shadow-lg hover:bg-violet-700",title:p("utilities.iframe.openHelper"),children:[(0,s.jsx)(a.A,{className:"h-3.5 w-3.5"}),p("utilities.iframe.helper")]})]}),x&&(0,s.jsx)("div",{className:"w-80 shrink-0",children:(0,s.jsx)(v,{scope:t,utilityId:r,...d?{utilityName:d}:{},...i?{rootId:i}:{},requestSnapshot:()=>{var e;let t=null==(e=h.current)?void 0:e.contentWindow;return t?(m.current&&(clearTimeout(m.current.timer),m.current.resolve(void 0),m.current=null),new Promise(e=>{let r=setTimeout(()=>{var t;(null==(t=m.current)?void 0:t.resolve)===e&&(m.current=null,e(void 0))},500);m.current={resolve:e,timer:r};try{t.postMessage({type:"request-snapshot"},"*")}catch(t){clearTimeout(r),m.current=null,e(void 0)}})):Promise.resolve(void 0)},onClose:()=>f(!1)})})]}):b}},8096:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},13561:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},39783:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},79182:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},95265:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(45804).A)("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{13506:(e,t,s)=>{"use strict";s.d(t,{cn:()=>n});var a=s(47989),r=s(55701);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.QP)((0,a.$)(t))}},17848:(e,t,s)=>{Promise.resolve().then(s.bind(s,68992)),Promise.resolve().then(s.t.bind(s,60290,23)),Promise.resolve().then(s.bind(s,43450)),Promise.resolve().then(s.bind(s,52713))},43450:(e,t,s)=>{"use strict";s.d(t,{Toaster:()=>u});var a=s(4624),r=s(58726),n=s(42795),l=s(85924),i=s(69259),c=s(3239),o=s(41085),d=s(56221);let u=e=>{let{...t}=e,{theme:s="system"}=(0,o.D)();return(0,a.jsx)(d.l$,{theme:s,className:"toaster group",icons:{success:(0,a.jsx)(r.A,{className:"size-4"}),info:(0,a.jsx)(n.A,{className:"size-4"}),warning:(0,a.jsx)(l.A,{className:"size-4"}),error:(0,a.jsx)(i.A,{className:"size-4"}),loading:(0,a.jsx)(c.A,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})}},60290:()=>{},63514:(e,t,s)=>{"use strict";s.d(t,{$d:()=>n,S9:()=>l,Zi:()=>r});var a=s(99356);let r={rootsChanged:"reflex:roots-changed",topicsChanged:e=>"reflex:topics-changed:".concat(e),kbChanged:e=>"reflex:kb-changed:".concat(e)};function n(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function l(e,t){(0,a.useEffect)(()=>{let s=e=>t(e.detail);return window.addEventListener(e,s),()=>window.removeEventListener(e,s)},[e,t])}},68992:(e,t,s)=>{"use strict";s.d(t,{AppSidebar:()=>T});var a=s(4624),r=s(99356),n=s(54400),l=s.n(n),i=s(69285),c=s(56221),o=s(49411),d=s(8096),u=s(72754),x=s(70762),h=s(69709),m=s(69205),p=s(9923),f=s(49623),g=s(3239),v=s(79182),b=s(42146),j=s(46972),N=s(83777),w=s(63514),y=s(80192),k=s(91074),A=s(85253),S=s(7911);let z=(0,S.createServerReference)("404d0691571f379f1db2b8d7dbf5fcdeafee79e0fc",S.callServer,void 0,S.findSourceMapURL,"loadKbSectionsAction"),C=(0,S.createServerReference)("4035e97d85d70e8eaaa8557d97eb59e375c117b7ed",S.callServer,void 0,S.findSourceMapURL,"loadTopicsAction"),R=(0,S.createServerReference)("00b61a40fac9b21ad6f4e4a76e87038390efedf684",S.callServer,void 0,S.findSourceMapURL,"listRootsAction"),E=(0,S.createServerReference)("402cdd8397ff9d25cf4ad96075ea3622884b135a60",S.callServer,void 0,S.findSourceMapURL,"listAgentsAction");var I=s(39624),L=s(53296),_=s(50988),P=s(63622);function T(e){let{initialRoots:t}=e,s=(0,i.usePathname)(),n=(0,o.c)("app"),[c,h]=(0,r.useState)(t),m=(0,r.useCallback)(async()=>{let e=await R();e.ok&&h(e.entries)},[]);return((0,w.S9)(w.Zi.rootsChanged,m),(null==s?void 0:s.startsWith("/share/"))||"/share"===s)?null:(0,a.jsxs)("aside",{className:"w-72 shrink-0 border-r bg-muted/30 flex flex-col",children:[(0,a.jsxs)("div",{className:"px-4 py-4 flex items-center gap-2 border-b",children:[(0,a.jsx)("span",{className:"reflex-gradient inline-flex h-7 w-7 items-center justify-center rounded-lg text-white shadow-sm",children:(0,a.jsx)(d.A,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"leading-tight",children:[(0,a.jsx)(l(),{href:"/",className:"text-sm font-semibold tracking-tight hover:underline",children:"Reflex"}),(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"knowledge base"})]})]}),(0,a.jsx)(y.F,{className:"flex-1",children:(0,a.jsxs)("nav",{className:"px-2 pt-3 pb-6",children:[(0,a.jsx)("div",{className:"px-2 mb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:n("sidebar.spaces")}),0===c.length?(0,a.jsx)("div",{className:"px-2 py-3 text-xs text-muted-foreground",children:n("sidebar.empty")}):(0,a.jsx)("ul",{className:"space-y-0.5",children:c.map(e=>{var t;return(0,a.jsx)($,{root:e,active:null!=(t=null==s?void 0:s.startsWith("/roots/".concat(e.id)))&&t},e.id)})}),(0,a.jsx)("div",{className:"mt-2 px-2",children:(0,a.jsx)(A.$,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 w-full justify-start text-xs",children:(0,a.jsxs)(l(),{href:"/roots/new",children:[(0,a.jsx)(u.A,{className:"mr-1 h-3.5 w-3.5"})," ",n("sidebar.addSpace")]})})})]})}),(0,a.jsx)(k.Separator,{}),(0,a.jsxs)("div",{className:"px-2 py-2 space-y-0.5",children:[(0,a.jsx)(A.$,{asChild:!0,variant:"/utilities"===s||(null==s?void 0:s.startsWith("/utilities/"))?"secondary":"ghost",size:"sm",className:"w-full justify-start",children:(0,a.jsxs)(l(),{href:"/utilities",children:[(0,a.jsx)(I.A,{className:"mr-2 h-4 w-4"})," ",n("sidebar.utilities")]})}),(0,a.jsx)(A.$,{asChild:!0,variant:"/audit"===s?"secondary":"ghost",size:"sm",className:"w-full justify-start",children:(0,a.jsxs)(l(),{href:"/audit",children:[(0,a.jsx)(L.A,{className:"mr-2 h-4 w-4"})," ",n("sidebar.audit")]})}),(0,a.jsx)(A.$,{asChild:!0,variant:"/settings"===s?"secondary":"ghost",size:"sm",className:"w-full justify-start",children:(0,a.jsxs)(l(),{href:"/settings",children:[(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4"})," Settings"]})})]})]})}function $(e){let{root:t,active:s}=e,n=(0,o.c)("app"),[c,d]=(0,r.useState)(s),[u,x]=(0,r.useState)(!1),[b,j]=(0,r.useState)(!1),[N,y]=(0,r.useState)(!1),[k,A]=(0,r.useState)(null),[S,R]=(0,r.useState)(null),[I,L]=(0,r.useState)(null),[P,T]=(0,r.useState)(!1),[$,U]=(0,r.useState)(!1),[Z,W]=(0,r.useState)(!1),O=(0,i.usePathname)();(0,r.useEffect)(()=>{s&&d(!0)},[s]);let V=(0,r.useCallback)(async()=>{T(!0);let e=await z(t.id);T(!1),e.ok?A(e.sections):A([])},[t.id]),K=(0,r.useCallback)(async()=>{U(!0);let e=await C(t.id);U(!1),e.ok?R(e.topics):R([])},[t.id]),Q=(0,r.useCallback)(async()=>{W(!0);let e=await E({rootId:t.id});W(!1),e.ok?L(e.agents):L([])},[t.id]);(0,w.S9)(w.Zi.kbChanged(t.id),()=>{u?V():A(null)}),(0,w.S9)(w.Zi.topicsChanged(t.id),()=>{b?K():R(null),N?Q():L(null)}),(0,r.useEffect)(()=>{if(!N)return;let e=setInterval(()=>{Q()},3e3);return()=>clearInterval(e)},[N,Q]);let q=async()=>{let e=!u;x(e),e&&null===k&&!P&&await V()},G=async()=>{let e=!b;j(e),e&&null===S&&!$&&await K()},H=async()=>{let e=!N;y(e),e&&null===I&&!Z&&await Q()},J=function(e){var t;let s=e.split("/").filter(Boolean);return null!=(t=s[s.length-1])?t:e}(t.path);return(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"flex items-center group",children:[(0,a.jsx)("button",{type:"button",onClick:()=>d(e=>!e),className:"h-6 w-6 flex items-center justify-center text-muted-foreground hover:text-foreground shrink-0","aria-label":n(c?"sidebar.collapse":"sidebar.expand"),children:c?(0,a.jsx)(h.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})}),(0,a.jsxs)(l(),{href:"/roots/".concat(t.id),className:"flex-1 min-w-0 flex items-center gap-2 px-2 py-1 rounded-md text-sm hover:bg-accent ".concat(s?"bg-accent":""),children:[(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:J})]})]}),c&&(0,a.jsxs)("ul",{className:"ml-5 mt-0.5 space-y-0.5 border-l pl-1",children:[(0,a.jsxs)("li",{children:[(0,a.jsxs)("button",{type:"button",onClick:q,className:"w-full flex items-center gap-1 px-2 py-1 rounded-md text-xs text-muted-foreground hover:bg-accent hover:text-foreground",children:[u?(0,a.jsx)(h.A,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(m.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)(f.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:n("sidebar.kb")}),P&&(0,a.jsx)(g.A,{className:"ml-auto h-3 w-3 animate-spin shrink-0"})]}),u&&null!==k&&(0,a.jsx)(F,{rootId:t.id,sections:k,pathname:O})]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("button",{type:"button",onClick:G,className:"w-full flex items-center gap-1 px-2 py-1 rounded-md text-xs text-muted-foreground hover:bg-accent hover:text-foreground",children:[b?(0,a.jsx)(h.A,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(m.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)(v.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:n("sidebar.topics")}),$&&(0,a.jsx)(g.A,{className:"ml-auto h-3 w-3 animate-spin shrink-0"}),null!==S&&(0,a.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:S.length})]}),b&&null!==S&&(0,a.jsx)(B,{rootId:t.id,topics:S,pathname:O})]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("button",{type:"button",onClick:H,className:"w-full flex items-center gap-1 px-2 py-1 rounded-md text-xs text-muted-foreground hover:bg-accent hover:text-foreground",children:[N?(0,a.jsx)(h.A,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(m.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)(_.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:n("sidebar.agents")}),Z&&(0,a.jsx)(g.A,{className:"ml-auto h-3 w-3 animate-spin shrink-0"}),null!==I&&!Z&&(0,a.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:[I.filter(e=>D(e.status)).length,"/",I.length]})]}),N&&null!==I&&(0,a.jsx)(M,{agents:I,pathname:O})]})]})]})}function M(e){var t,s;let{agents:r,pathname:n}=e;if(0===r.length)return(0,a.jsx)(U,{});let l=new Map;for(let e of r){let s=e.parentId,a=null!=(t=l.get(s))?t:[];a.push(e),l.set(s,a)}let i=null!=(s=l.get(void 0))?s:[];return(0,a.jsx)("ul",{className:"ml-4 mt-0.5 space-y-0.5 border-l pl-1",children:i.map(e=>(0,a.jsx)(Z,{agent:e,byParent:l,pathname:n,depth:0},e.id))})}function U(){let e=(0,o.c)("app");return(0,a.jsx)("div",{className:"ml-4 px-3 py-1 text-[11px] italic text-muted-foreground",children:e("sidebar.noAgents")})}function Z(e){var t;let{agent:s,byParent:r,pathname:n,depth:i}=e,c=null!=(t=r.get(s.id))?t:[],o="/agents/".concat(s.id),d=n===o;return(0,a.jsxs)("li",{children:[(0,a.jsxs)(l(),{href:o,className:"flex items-center gap-1 px-2 py-1 text-[12px] rounded hover:bg-accent ".concat(d?"bg-accent":""),style:{paddingLeft:8*i+4},children:[D(s.status)?(0,a.jsx)(P.A,{className:"h-3 w-3 text-emerald-600 shrink-0 animate-pulse"}):(0,a.jsx)(_.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate flex-1",children:s.label}),(0,a.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground shrink-0",title:"".concat(s.harness," \xb7 ").concat(s.model),children:"claude-code"===s.harness?"claude":"ollama"===s.harness?"ollama":"codex"})]}),c.length>0&&(0,a.jsx)("ul",{className:"space-y-0.5",children:c.map(e=>(0,a.jsx)(Z,{agent:e,byParent:r,pathname:n,depth:i+1},e.id))})]})}function D(e){return"starting"===e||"running"===e}function F(e){let{rootId:t,sections:s,pathname:r}=e;return 0===s.length?(0,a.jsx)(W,{}):(0,a.jsx)("ul",{className:"ml-4 mt-0.5 space-y-0.5 border-l pl-1",children:s.map(e=>e.isDir?(0,a.jsx)(O,{rootId:t,section:e,pathname:r},e.rel):(0,a.jsx)("li",{children:(0,a.jsx)(V,{rootId:t,section:e,pathname:r})},e.rel))})}function W(){let e=(0,o.c)("app");return(0,a.jsx)("div",{className:"px-3 py-1 text-[11px] italic text-muted-foreground",children:e("sidebar.kbEmpty")})}function O(e){let{rootId:t,section:s,pathname:n}=e,[l,i]=(0,r.useState)(!1);return(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("button",{type:"button",onClick:()=>i(e=>!e),className:"h-5 w-5 flex items-center justify-center text-muted-foreground hover:text-foreground shrink-0",children:l?(0,a.jsx)(h.A,{className:"h-3 w-3"}):(0,a.jsx)(m.A,{className:"h-3 w-3"})}),(0,a.jsx)(b.A,{className:"h-3 w-3 text-muted-foreground shrink-0 mr-1"}),(0,a.jsx)("span",{className:"text-[12px] flex-1 truncate",children:s.label})]}),l&&s.children&&(0,a.jsx)("ul",{className:"ml-4 space-y-0.5 border-l pl-1",children:s.children.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)(V,{rootId:t,section:e,pathname:n})},e.rel))})]})}function V(e){let{rootId:t,section:s,pathname:r}=e;if(!s.fileRel)return null;let n=s.fileRel.split("/").map(encodeURIComponent).join("/"),i="/roots/".concat(t,"/kb/").concat(n),c=r===i;return(0,a.jsxs)(l(),{href:i,className:"flex items-center gap-1 px-2 py-1 text-[12px] rounded hover:bg-accent ".concat(c?"bg-accent":""),children:[(0,a.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:s.label})]})}function B(e){let{rootId:t,topics:s,pathname:r}=e;return 0===s.length?(0,a.jsx)(K,{}):(0,a.jsx)("ul",{className:"ml-4 mt-0.5 space-y-0.5 border-l pl-1",children:s.map(e=>(0,a.jsx)(Q,{rootId:t,topic:e,pathname:r},e.id))})}function K(){let e=(0,o.c)("app");return(0,a.jsx)("div",{className:"ml-4 px-3 py-1 text-[11px] italic text-muted-foreground",children:e("sidebar.noTopics")})}function Q(e){let{rootId:t,topic:s,pathname:n}=e,d=(0,o.c)("app"),u="/roots/".concat(t,"/chat/").concat(s.id),x=n===u,[h,m]=(0,r.useTransition)(),p=(0,i.useRouter)();return(0,a.jsx)("li",{className:"group/topic",children:(0,a.jsxs)(l(),{href:u,className:"flex items-center gap-1 px-2 py-1 text-[12px] rounded hover:bg-accent ".concat(x?"bg-accent":""),children:[(0,a.jsx)(v.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate flex-1 min-w-0",children:s.title}),(0,a.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),confirm(d("sidebar.deleteTopicConfirm",{title:s.title}))&&m(async()=>{let e=await (0,N.L)(t,s.id);if(!e.ok){var a;c.oR.error(null!=(a=e.error)?a:d("sidebar.deleteFailed"));return}c.oR.success(d("sidebar.topicDeleted")),(0,w.$d)(w.Zi.topicsChanged(t)),x&&p.push("/roots/".concat(t))})},disabled:h,"aria-label":d("sidebar.deleteTopic"),title:d("sidebar.deleteTopic"),className:"opacity-0 group-hover/topic:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive shrink-0",children:h?(0,a.jsx)(g.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(j.A,{className:"h-3 w-3"})})]})})}},80192:(e,t,s)=>{"use strict";s.d(t,{F:()=>l});var a=s(4624);s(99356);var r=s(14884),n=s(13506);function l(e){let{className:t,children:s,...l}=e;return(0,a.jsxs)(r.Root,{"data-slot":"scroll-area",className:(0,n.cn)("relative",t),...l,children:[(0,a.jsx)(r.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:s}),(0,a.jsx)(i,{}),(0,a.jsx)(r.Corner,{})]})}function i(e){let{className:t,orientation:s="vertical",...l}=e;return(0,a.jsx)(r.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:s,className:(0,n.cn)("flex touch-none p-px transition-colors select-none","vertical"===s&&"h-full w-2.5 border-l border-l-transparent","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent",t),...l,children:(0,a.jsx)(r.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}},83777:(e,t,s)=>{"use strict";s.d(t,{L:()=>r});var a=s(7911);let r=(0,a.createServerReference)("60c82dbc54ebebde5ee157e85e01721ad76126b665",a.callServer,void 0,a.findSourceMapURL,"deleteTopicAction")},85253:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var a=s(4624);s(99356);var r=s(60621),n=s(50362),l=s(13506);let i=(0,r.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function c(e){let{className:t,variant:s="default",size:r="default",asChild:c=!1,...o}=e,d=c?n.bL:"button";return(0,a.jsx)(d,{"data-slot":"button","data-variant":s,"data-size":r,className:(0,l.cn)(i({variant:s,size:r,className:t})),...o})}},91074:(e,t,s)=>{"use strict";s.d(t,{Separator:()=>l});var a=s(4624);s(99356);var r=s(44188),n=s(13506);function l(e){let{className:t,orientation:s="horizontal",decorative:l=!0,...i}=e;return(0,a.jsx)(r.b,{"data-slot":"separator",decorative:l,orientation:s,className:(0,n.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...i})}}},e=>{e.O(0,[497,4400,1217,9411,5097,6445,4933,146,7358],()=>e(e.s=17848)),_N_E=e.O()}]);
|