@hanzo/ui 5.3.38 → 5.3.40
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/bin/create-registry.js +0 -0
- package/bin/npx-registry-mcp.js +0 -0
- package/bin/registry-mcp-wrapper.sh +0 -0
- package/bin/registry-mcp.js +0 -0
- package/bin/start-mcp-server.sh +0 -0
- package/bin/test-mcp.sh +0 -0
- package/dist/navigation/hanzo-shell.js +3 -0
- package/dist/navigation/hanzo-shell.mjs +3 -0
- package/dist/navigation/index.js +2 -2
- package/dist/navigation/index.mjs +2 -2
- package/package.json +35 -24
package/bin/create-registry.js
CHANGED
|
File without changes
|
package/bin/npx-registry-mcp.js
CHANGED
|
File without changes
|
|
File without changes
|
package/bin/registry-mcp.js
CHANGED
|
File without changes
|
package/bin/start-mcp-server.sh
CHANGED
|
File without changes
|
package/bin/test-mcp.sh
CHANGED
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var he=Object.defineProperty;var s=(t,e)=>he(t,"name",{value:e,configurable:true});function ge({x:t,y:e,onClose:n}){let r=react.useRef(null);react.useEffect(()=>{let i=s(d=>{r.current&&!r.current.contains(d.target)&&n();},"handler"),h=s(d=>{d.key==="Escape"&&n();},"escape");return document.addEventListener("mousedown",i),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",h);}},[n]);let l=[{label:"Brand Guidelines",href:"https://hanzo.ai/brand"},{label:"Press Kit",href:"https://hanzo.ai/press"},{label:"Download Logo",href:"https://hanzo.ai/brand#download"},{label:"Copy SVG",action:"copy-svg"},{label:"hanzo.ai \u2192",href:"https://hanzo.ai"}],o='<svg viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="M22.21 67V44.6369H0V67H22.21Z" fill="#ffffff"/><path d="M0 44.6369L22.21 46.8285V44.6369H0Z" fill="#DDDDDD"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="#ffffff"/><path d="M22.21 0H0V22.3184H22.21V0Z" fill="#ffffff"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="#ffffff"/><path d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" fill="#DDDDDD"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="#ffffff"/></svg>';return jsxRuntime.jsxs("div",{ref:r,role:"menu",className:"fixed z-[9999] min-w-[180px] rounded-xl border border-white/[0.08] bg-[#111113] py-1.5 shadow-2xl shadow-black/60",style:{top:e,left:t},children:[jsxRuntime.jsx("div",{className:"border-b border-white/[0.06] px-3 pb-2 pt-1",children:jsxRuntime.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-white/30",children:"Hanzo Brand"})}),l.map(i=>i.action==="copy-svg"?jsxRuntime.jsx("button",{type:"button",role:"menuitem",onClick:()=>{navigator.clipboard.writeText(o).catch(()=>{}),n();},className:"flex w-full items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors text-left",children:"Copy SVG"},"copy"):jsxRuntime.jsx("a",{href:i.href,role:"menuitem",target:i.href?.startsWith("https")?"_blank":void 0,rel:"noopener noreferrer",onClick:n,className:"flex items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors",children:i.label},i.label))]})}s(ge,"BrandContextMenu");function G({size:t=22,className:e="",brandMenu:n=true,animate:r=true}){let[l,o]=react.useState(null),[i,h]=react.useState(false),d=react.useCallback(p=>{n&&(p.preventDefault(),o({x:p.clientX,y:p.clientY}));},[n]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{width:t,height:t,viewBox:"0 0 67 67",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hanzo",className:e,style:r?{transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease",transform:i?"scale(1.12) perspective(80px) rotateY(-6deg)":"scale(1) perspective(80px) rotateY(0deg)",transformOrigin:"center center"}:{},onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),onContextMenu:d,children:[jsxRuntime.jsx("path",{d:"M22.21 67V44.6369H0V67H22.21Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M0 44.6369L22.21 46.8285V44.6369H0Z",fill:"#DDDDDD"}),jsxRuntime.jsx("path",{d:"M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M22.21 0H0V22.3184H22.21V0Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M66.7198 0H44.5098V22.3184H66.7198V0Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z",fill:"#DDDDDD"}),jsxRuntime.jsx("path",{d:"M66.7198 67V44.6369H44.5098V67H66.7198Z",fill:"#ffffff"})]}),l&&jsxRuntime.jsx(ge,{x:l.x,y:l.y,onClose:()=>o(null)})]})}s(G,"HanzoMark");var U=[{id:"account",label:"Account",href:"https://hanzo.id/account",description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:"https://billing.hanzo.ai",description:"Subscriptions & usage"},{id:"console",label:"Console",href:"https://console.hanzo.ai",description:"API keys & projects"},{id:"chat",label:"Chat",href:"https://hanzo.chat",description:"AI chat & models"},{id:"platform",label:"Platform",href:"https://platform.hanzo.ai",description:"Deploy & scale services"},{id:"storage",label:"Storage",href:"https://hanzo.space",description:"S3 object storage"}],S={hanzo:{id:"hanzo",iam:"https://hanzo.id",billing:"https://billing.hanzo.ai",console:"https://console.hanzo.ai",chat:"https://hanzo.chat",platform:"https://platform.hanzo.ai",storage:"https://hanzo.space",s3:"https://s3.hanzo.ai"},lux:{id:"lux",iam:"https://lux.id",billing:"https://billing.lux.network",console:"https://console.lux.network",chat:"https://chat.lux.network",platform:"https://platform.lux.network",storage:"https://storage.lux.network",s3:"https://s3.lux.network"},zoo:{id:"zoo",iam:"https://zoo.id",billing:"https://billing.zoo.ngo",console:"https://console.zoo.ngo",chat:"https://chat.zoo.ngo",platform:"https://platform.zoo.ngo",storage:"https://storage.zoo.ngo",s3:"https://s3.zoo.ngo"},pars:{id:"pars",iam:"https://pars.id",billing:"https://billing.pars.ai",console:"https://console.pars.ai",chat:"https://chat.pars.ai",platform:"https://platform.pars.ai",storage:"https://storage.pars.ai",s3:"https://s3.pars.ai"}};function K(t){let e=S[t]||S.hanzo;return [{id:"account",label:"Account",href:`${e.iam}/account`,description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:e.billing,description:"Subscriptions & usage"},{id:"console",label:"Console",href:e.console,description:"API keys & projects"},{id:"chat",label:"Chat",href:e.chat,description:"AI chat & models"},{id:"platform",label:"Platform",href:e.platform,description:"Deploy & scale services"},{id:"storage",label:"Storage",href:e.storage,description:"S3 object storage"}]}s(K,"getAppsForOrg");function W({apps:t=U,currentAppId:e}){let[n,r]=react.useState(false),l=react.useRef(null);return react.useEffect(()=>{let o=s(i=>{l.current&&!l.current.contains(i.target)&&r(false);},"handler");return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>r(o=>!o),className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/40 hover:bg-white/[0.06] hover:text-white/70 transition-colors","aria-label":"Switch app",title:"Switch app",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"1",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"1",y:"11",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"11",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"11",width:"4",height:"4",rx:"1"})]})}),n&&jsxRuntime.jsxs("div",{className:"absolute left-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] p-2 shadow-2xl",children:[jsxRuntime.jsx("p",{className:"px-2 pb-1.5 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Hanzo Apps"}),t.filter(o=>o.id!==e).map(o=>jsxRuntime.jsxs("a",{href:o.href,className:"flex flex-col gap-0.5 rounded-lg px-3 py-2.5 hover:bg-white/[0.06] transition-colors",onClick:()=>r(false),children:[jsxRuntime.jsx("span",{className:"text-[13px] font-medium text-white/80",children:o.label}),o.description&&jsxRuntime.jsx("span",{className:"text-[11px] text-white/30",children:o.description})]},o.id))]})]})}s(W,"AppSwitcher");var ye=["#0A0310","#49007E","#FF005B","#FF7D10","#FFB238"];function ke(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return Math.abs(e)}s(ke,"hashStr");function M(t,e,n){return t%(e*(n+1))%e}s(M,"getUnit");function ze(t,e){return M(t,2,e)===0}s(ze,"getBoolean");function ie(t,e,n){return n[M(t,n.length,e)]}s(ie,"getRandomColor");function Ne(t){let e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return e*.299+n*.587+r*.114>128?"#000":"#fff"}s(Ne,"getContrast");function q({name:t,size:e=40,colors:n=ye,className:r,square:l=false}){let o=ke(t),i=ie(o,0,n),h=Ne(i),d=ze(o,2),f=M(o,3,7),p=M(o,5,8),c=M(o,10,9),u=c>6?c-10:c,g=M(o,5,10)>3?M(o,5,10)-5:M(o,5,10);return jsxRuntime.jsxs("svg",{viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:e,height:e,className:r,style:l?void 0:{borderRadius:"50%"},children:[jsxRuntime.jsx("mask",{id:`beam-${o}`,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36,children:jsxRuntime.jsx("rect",{width:36,height:36,rx:l?void 0:72,fill:"#fff"})}),jsxRuntime.jsxs("g",{mask:`url(#beam-${o})`,children:[jsxRuntime.jsx("rect",{width:36,height:36,fill:i}),jsxRuntime.jsx("rect",{x:0,y:0,width:36,height:36,transform:`translate(${u} ${g}) rotate(${c} 18 18)`,fill:ie(o,1,n),rx:6}),jsxRuntime.jsxs("g",{transform:`translate(${u} ${g}) rotate(${c} 18 18)`,children:[d?jsxRuntime.jsx("path",{d:`M15 ${19+f}c2 1 4 1 6 0`,stroke:h,fill:"none",strokeLinecap:"round"}):jsxRuntime.jsx("path",{d:`M13 ${19+f}a1 .75 0 0 0 10 0`,fill:h}),jsxRuntime.jsx("rect",{x:14-p,y:14,width:1.5,height:2,rx:1,fill:h}),jsxRuntime.jsx("rect",{x:20+p,y:14,width:1.5,height:2,rx:1,fill:h})]})]})]})}s(q,"BeamAvatar");async function Ae(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(l=>l.toString(16).padStart(2,"0")).join("")}s(Ae,"sha256");function Se(t,e){let[n,r]=react.useState(null);return react.useMemo(()=>{if(!t){r(null);return}let l=t.trim().toLowerCase();Ae(l).then(o=>{r(`https://www.gravatar.com/avatar/${o}?s=${e||80}&d=404`);});},[t,e]),n}s(Se,"useGravatarUrl");function Q({src:t,email:e,name:n,size:r=40,colors:l,className:o}){let[i,h]=react.useState(false),[d,f]=react.useState(false),p=Se(e,r*2),c=`rounded-full object-cover ${o||""}`,u={width:r,height:r};return t&&!i?jsxRuntime.jsx("img",{src:t,alt:n||e||"avatar",className:c,style:u,onError:()=>h(true)}):p&&!d?jsxRuntime.jsx("img",{src:p,alt:n||e||"avatar",className:c,style:u,onError:()=>f(true)}):jsxRuntime.jsx(q,{name:n||e||"user",size:r,colors:l,className:o})}s(Q,"UserAvatar");function ee({user:t,organizations:e=[],currentOrgId:n,onOrgSwitch:r,onSignOut:l}){let[o,i]=react.useState(false),h=react.useRef(null);if(react.useEffect(()=>{let c=s(u=>{h.current&&!h.current.contains(u.target)&&i(false);},"handler");return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),!t)return null;let d=e.find(c=>c.id===n),f=d?.slug||"hanzo",p=S[f]||S.hanzo;return jsxRuntime.jsxs("div",{ref:h,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(c=>!c),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-white/[0.06] transition-colors",children:[jsxRuntime.jsx(Q,{src:t.avatar,email:t.email,name:t.name,size:28}),jsxRuntime.jsxs("div",{className:"hidden flex-col items-start sm:flex",children:[t.name&&jsxRuntime.jsx("span",{className:"text-[12px] font-medium text-white/70 leading-none",children:t.name}),jsxRuntime.jsx("span",{className:"text-[11px] text-white/30 leading-none mt-0.5",children:t.email})]}),jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/30 hidden sm:block",children:jsxRuntime.jsx("path",{d:"M6 9l6 6 6-6"})})]}),o&&jsxRuntime.jsxs("div",{className:"absolute right-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] shadow-2xl",children:[jsxRuntime.jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[jsxRuntime.jsx("p",{className:"text-[13px] font-medium text-white/80",children:t.name||"User"}),jsxRuntime.jsx("p",{className:"text-[11px] text-white/40",children:t.email}),d&&jsxRuntime.jsx("p",{className:"mt-0.5 text-[10px] font-medium text-white/25 uppercase tracking-wider",children:d.name})]}),e.length>0&&jsxRuntime.jsxs("div",{className:"border-b border-white/[0.06] p-2",children:[jsxRuntime.jsx("p",{className:"px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Organizations"}),e.map(c=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>{r?.(c.id),i(false);},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left hover:bg-white/[0.06] transition-colors",children:[jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-[13px] text-white/70",children:c.name}),c.role&&jsxRuntime.jsx("span",{className:"text-[10px] text-white/25 capitalize",children:c.role})]}),c.id===n&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/50",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},c.id))]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("a",{href:`${p.iam}/account`,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Account settings"}),jsxRuntime.jsx("a",{href:p.billing,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Billing"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{i(false),l?.();},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/40 hover:bg-white/[0.06] hover:text-red-400/70 transition-colors",children:"Sign out"})]})]})]})}s(ee,"UserOrgDropdown");function Pe({className:t}){return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[jsxRuntime.jsx("path",{d:"M21 2v6h-6"}),jsxRuntime.jsx("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),jsxRuntime.jsx("path",{d:"M3 22v-6h6"}),jsxRuntime.jsx("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"})]})}s(Pe,"HardRefreshIcon");function Le({className:t}){return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[jsxRuntime.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}s(Le,"SettingsIcon");async function Ee(){try{if(localStorage.clear(),sessionStorage.clear(),document.cookie.split(";").forEach(t=>{let e=t.split("=")[0].trim();if(e){document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`,document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${location.hostname}`;let n=location.hostname.split(".");if(n.length>2){let r="."+n.slice(-2).join(".");document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${r}`;}}}),"caches"in window){let t=await caches.keys();await Promise.all(t.map(e=>caches.delete(e)));}if("serviceWorker"in navigator){let t=await navigator.serviceWorker.getRegistrations();await Promise.all(t.map(e=>e.unregister()));}if("indexedDB"in window&&indexedDB.databases)try{(await indexedDB.databases()).forEach(e=>{e.name&&indexedDB.deleteDatabase(e.name);});}catch{}}catch{}location.reload();}s(Ee,"hardRefresh");function Ie({currentApp:t,currentAppId:e,user:n,organizations:r,currentOrgId:l,onOrgSwitch:o,onSignOut:i,apps:h,headerRight:d,settingsHref:f,onSettingsClick:p,hideHardRefresh:c,hideSettings:u}){let[g,P]=react.useState(false),L=r?.find(k=>k.id===l)?.slug||"hanzo",m=h||K(L),H=S[L]||S.hanzo,V=react.useCallback(()=>{P(true),Ee();},[]),y=react.useCallback(()=>{p?p():window.location.href=f||`${H.iam}/account`;},[p,f,H.iam]);return jsxRuntime.jsxs("header",{className:"sticky top-0 z-50 flex h-14 w-full items-center justify-between border-b border-white/[0.07] bg-[#09090b]/90 px-4 backdrop-blur-xl",role:"banner",children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[jsxRuntime.jsx("a",{href:`${H.iam}/account`,className:"flex-shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Account",children:jsxRuntime.jsx(G,{size:22,brandMenu:true,animate:true})}),jsxRuntime.jsx("span",{className:"select-none text-white/[0.15]",children:"/"}),jsxRuntime.jsx("span",{className:"truncate text-[13px] font-medium text-white/50",children:t}),jsxRuntime.jsx(W,{apps:m,currentAppId:e})]}),jsxRuntime.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[d,!c&&jsxRuntime.jsx("button",{type:"button",onClick:V,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Hard refresh \u2014 clear all storage, cookies, cache and reload",title:"Hard refresh",children:jsxRuntime.jsx(Pe,{className:g?"animate-spin":""})}),!u&&jsxRuntime.jsx("button",{type:"button",onClick:y,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Settings",title:"Settings",children:jsxRuntime.jsx(Le,{})}),jsxRuntime.jsx(ee,{user:n,organizations:r,currentOrgId:l,onOrgSwitch:o,onSignOut:i})]})]})}s(Ie,"HanzoHeader");var ce="hanzo-auth-token",ne="hanzo-user",pe="hanzo-auth-expires",Ue="https://iam.hanzo.ai",Be={hanzo:{name:"Hanzo AI",slug:"hanzo"},lux:{name:"Lux Network",slug:"lux"},zoo:{name:"Zoo Labs",slug:"zoo"},pars:{name:"Pars",slug:"pars"}};function $e(){let[t,e]=react.useState(void 0),[n,r]=react.useState([]),[l,o]=react.useState(void 0),[i,h]=react.useState(null),[d,f]=react.useState(true),p=react.useCallback(async()=>{try{let g=localStorage.getItem(ce),P=localStorage.getItem(pe);if(!g||P&&Date.now()>Number(P)){f(!1);return}h(g);let E=localStorage.getItem(ne);if(E)try{let m=JSON.parse(E);m?.email&&e({id:m.id,name:m.displayName||m.name,email:m.email,avatar:m.avatar});}catch{}let L=await fetch(`${Ue}/api/userinfo`,{headers:{Authorization:`Bearer ${g}`}});if(L.ok){let m=await L.json(),H={id:m.sub||m.id,name:m.name||m.displayName,email:m.email,avatar:m.picture||m.avatar};e(H),localStorage.setItem(ne,JSON.stringify(m));let y=(m.groups||[]).map(k=>{let I=k.toLowerCase().replace(/^\//,""),R=Be[I];return R?{id:I,name:R.name,slug:R.slug}:null}).filter(Boolean);y.length===0&&H.email&&y.push({id:"personal",name:"Personal",slug:"personal"}),r(y),o(y[0]?.id);}}catch{}finally{f(false);}},[]);react.useEffect(()=>{p();},[p]);let c=react.useCallback(()=>{localStorage.removeItem(ce),localStorage.removeItem(ne),localStorage.removeItem(pe),window.location.href="https://hanzo.id";},[]),u=react.useCallback(g=>{o(g);},[]);return {user:t,organizations:n,currentOrgId:l,token:i,loading:d,signOut:c,switchOrg:u}}s($e,"useHanzoAuth");function Ve(t,e){return t.filter(n=>n.id!==e).map(n=>({id:`app-${n.id}`,title:n.label,description:n.description,href:n.href,category:"Hanzo Apps",external:true,keywords:[n.id,n.label.toLowerCase()]}))}s(Ve,"buildCrossAppCommands");function Te({commands:t=[],apps:e,currentAppId:n,open:r,onOpenChange:l,onNavigate:o}){var ae;let[i,h]=react.useState(false),d=r??i,f=react.useCallback(a=>{l?l(a):h(a);},[l]),[p,c]=react.useState(""),[u,g]=react.useState(0),P=react.useRef(null),E=react.useRef(null),L=Ve(e??U,n),m=[...t,...L],H=p.toLowerCase(),V=H?m.filter(a=>a.title.toLowerCase().includes(H)||a.description?.toLowerCase().includes(H)||a.keywords?.some(z=>z.includes(H))):m,y={};for(let a of V)(y[ae=a.category]??(y[ae]=[])).push(a);let k=Object.values(y).flat();react.useEffect(()=>g(0),[p]),react.useEffect(()=>{d&&(c(""),g(0),requestAnimationFrame(()=>P.current?.focus()));},[d]),react.useEffect(()=>{let a=s(z=>{(z.metaKey||z.ctrlKey)&&z.key==="k"&&(z.preventDefault(),f(!d));},"handler");return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[d,f]);let I=react.useCallback(a=>{a.action?a.action():a.href&&(o?o(a.href,a.external):a.external?window.open(a.href,"_blank"):window.location.href=a.href),f(false);},[o,f]),R=react.useCallback(a=>{a.key==="ArrowDown"?(a.preventDefault(),g(z=>(z+1)%(k.length||1))):a.key==="ArrowUp"?(a.preventDefault(),g(z=>(z-1+(k.length||1))%(k.length||1))):a.key==="Enter"&&k[u]?(a.preventDefault(),I(k[u])):a.key==="Escape"&&f(false);},[k,u,I,f]);return react.useEffect(()=>{E.current?.querySelector(`[data-idx="${u}"]`)?.scrollIntoView({block:"nearest"});},[u]),d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:()=>f(false)}),jsxRuntime.jsx("div",{className:"fixed top-[15%] left-1/2 -translate-x-1/2 w-full max-w-xl z-[101]",children:jsxRuntime.jsxs("div",{className:"bg-[#111113] border border-white/[0.08] rounded-xl shadow-2xl overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-white/[0.07]",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),jsxRuntime.jsx("input",{ref:P,type:"text",value:p,onChange:a=>c(a.target.value),onKeyDown:R,placeholder:"Search commands...",className:"flex-1 bg-transparent text-white text-[13px] placeholder-white/30 outline-none"}),jsxRuntime.jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-white/[0.06] rounded text-white/30",children:"ESC"})]}),jsxRuntime.jsx("div",{ref:E,className:"max-h-[400px] overflow-y-auto py-1",children:k.length===0?jsxRuntime.jsxs("div",{className:"px-4 py-8 text-center text-white/30 text-[13px]",children:["No results for \u201C",p,"\u201D"]}):Object.entries(y).map(([a,z])=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"px-4 py-2 text-[10px] font-semibold text-white/25 uppercase tracking-widest",children:a}),z.map(D=>{let Z=k.indexOf(D),F=Z===u;return jsxRuntime.jsxs("button",{"data-idx":Z,onClick:()=>I(D),onMouseEnter:()=>g(Z),className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${F?"bg-white/[0.06] text-white":"text-white/50 hover:bg-white/[0.03]"}`,children:[D.icon&&jsxRuntime.jsx("span",{className:`w-5 h-5 flex items-center justify-center ${F?"text-white/70":"text-white/25"}`,children:D.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:"text-[13px] font-medium truncate block",children:D.title}),D.description&&jsxRuntime.jsx("span",{className:"text-[11px] text-white/25 truncate block",children:D.description})]}),F&&jsxRuntime.jsx("span",{className:"text-white/25 text-[11px]",children:"\u21B5"})]},D.id)})]},a))}),jsxRuntime.jsxs("div",{className:"px-4 py-2 border-t border-white/[0.07] flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-white/20",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2191"}),jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2193"}),"navigate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u21B5"}),"select"]})]}),jsxRuntime.jsx("span",{className:"text-[10px] text-white/20",children:"\u2318K"})]})]})})]}):null}s(Te,"HanzoCommandPalette");
|
|
3
|
+
exports.AppSwitcher=W;exports.BeamAvatar=q;exports.DEFAULT_HANZO_APPS=U;exports.HanzoCommandPalette=Te;exports.HanzoHeader=Ie;exports.HanzoMark=G;exports.ORG_DOMAINS=S;exports.UserAvatar=Q;exports.UserOrgDropdown=ee;exports.getAppsForOrg=K;exports.useHanzoAuth=$e;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {useState,useCallback,useRef,useEffect,useMemo}from'react';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var he=Object.defineProperty;var s=(t,e)=>he(t,"name",{value:e,configurable:true});function ge({x:t,y:e,onClose:n}){let r=useRef(null);useEffect(()=>{let i=s(d=>{r.current&&!r.current.contains(d.target)&&n();},"handler"),h=s(d=>{d.key==="Escape"&&n();},"escape");return document.addEventListener("mousedown",i),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",h);}},[n]);let l=[{label:"Brand Guidelines",href:"https://hanzo.ai/brand"},{label:"Press Kit",href:"https://hanzo.ai/press"},{label:"Download Logo",href:"https://hanzo.ai/brand#download"},{label:"Copy SVG",action:"copy-svg"},{label:"hanzo.ai \u2192",href:"https://hanzo.ai"}],o='<svg viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="M22.21 67V44.6369H0V67H22.21Z" fill="#ffffff"/><path d="M0 44.6369L22.21 46.8285V44.6369H0Z" fill="#DDDDDD"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="#ffffff"/><path d="M22.21 0H0V22.3184H22.21V0Z" fill="#ffffff"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="#ffffff"/><path d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" fill="#DDDDDD"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="#ffffff"/></svg>';return jsxs("div",{ref:r,role:"menu",className:"fixed z-[9999] min-w-[180px] rounded-xl border border-white/[0.08] bg-[#111113] py-1.5 shadow-2xl shadow-black/60",style:{top:e,left:t},children:[jsx("div",{className:"border-b border-white/[0.06] px-3 pb-2 pt-1",children:jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-white/30",children:"Hanzo Brand"})}),l.map(i=>i.action==="copy-svg"?jsx("button",{type:"button",role:"menuitem",onClick:()=>{navigator.clipboard.writeText(o).catch(()=>{}),n();},className:"flex w-full items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors text-left",children:"Copy SVG"},"copy"):jsx("a",{href:i.href,role:"menuitem",target:i.href?.startsWith("https")?"_blank":void 0,rel:"noopener noreferrer",onClick:n,className:"flex items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors",children:i.label},i.label))]})}s(ge,"BrandContextMenu");function G({size:t=22,className:e="",brandMenu:n=true,animate:r=true}){let[l,o]=useState(null),[i,h]=useState(false),d=useCallback(p=>{n&&(p.preventDefault(),o({x:p.clientX,y:p.clientY}));},[n]);return jsxs(Fragment,{children:[jsxs("svg",{width:t,height:t,viewBox:"0 0 67 67",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hanzo",className:e,style:r?{transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease",transform:i?"scale(1.12) perspective(80px) rotateY(-6deg)":"scale(1) perspective(80px) rotateY(0deg)",transformOrigin:"center center"}:{},onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),onContextMenu:d,children:[jsx("path",{d:"M22.21 67V44.6369H0V67H22.21Z",fill:"#ffffff"}),jsx("path",{d:"M0 44.6369L22.21 46.8285V44.6369H0Z",fill:"#DDDDDD"}),jsx("path",{d:"M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",fill:"#ffffff"}),jsx("path",{d:"M22.21 0H0V22.3184H22.21V0Z",fill:"#ffffff"}),jsx("path",{d:"M66.7198 0H44.5098V22.3184H66.7198V0Z",fill:"#ffffff"}),jsx("path",{d:"M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z",fill:"#DDDDDD"}),jsx("path",{d:"M66.7198 67V44.6369H44.5098V67H66.7198Z",fill:"#ffffff"})]}),l&&jsx(ge,{x:l.x,y:l.y,onClose:()=>o(null)})]})}s(G,"HanzoMark");var U=[{id:"account",label:"Account",href:"https://hanzo.id/account",description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:"https://billing.hanzo.ai",description:"Subscriptions & usage"},{id:"console",label:"Console",href:"https://console.hanzo.ai",description:"API keys & projects"},{id:"chat",label:"Chat",href:"https://hanzo.chat",description:"AI chat & models"},{id:"platform",label:"Platform",href:"https://platform.hanzo.ai",description:"Deploy & scale services"},{id:"storage",label:"Storage",href:"https://hanzo.space",description:"S3 object storage"}],S={hanzo:{id:"hanzo",iam:"https://hanzo.id",billing:"https://billing.hanzo.ai",console:"https://console.hanzo.ai",chat:"https://hanzo.chat",platform:"https://platform.hanzo.ai",storage:"https://hanzo.space",s3:"https://s3.hanzo.ai"},lux:{id:"lux",iam:"https://lux.id",billing:"https://billing.lux.network",console:"https://console.lux.network",chat:"https://chat.lux.network",platform:"https://platform.lux.network",storage:"https://storage.lux.network",s3:"https://s3.lux.network"},zoo:{id:"zoo",iam:"https://zoo.id",billing:"https://billing.zoo.ngo",console:"https://console.zoo.ngo",chat:"https://chat.zoo.ngo",platform:"https://platform.zoo.ngo",storage:"https://storage.zoo.ngo",s3:"https://s3.zoo.ngo"},pars:{id:"pars",iam:"https://pars.id",billing:"https://billing.pars.ai",console:"https://console.pars.ai",chat:"https://chat.pars.ai",platform:"https://platform.pars.ai",storage:"https://storage.pars.ai",s3:"https://s3.pars.ai"}};function K(t){let e=S[t]||S.hanzo;return [{id:"account",label:"Account",href:`${e.iam}/account`,description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:e.billing,description:"Subscriptions & usage"},{id:"console",label:"Console",href:e.console,description:"API keys & projects"},{id:"chat",label:"Chat",href:e.chat,description:"AI chat & models"},{id:"platform",label:"Platform",href:e.platform,description:"Deploy & scale services"},{id:"storage",label:"Storage",href:e.storage,description:"S3 object storage"}]}s(K,"getAppsForOrg");function W({apps:t=U,currentAppId:e}){let[n,r]=useState(false),l=useRef(null);return useEffect(()=>{let o=s(i=>{l.current&&!l.current.contains(i.target)&&r(false);},"handler");return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),jsxs("div",{ref:l,className:"relative",children:[jsx("button",{type:"button",onClick:()=>r(o=>!o),className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/40 hover:bg-white/[0.06] hover:text-white/70 transition-colors","aria-label":"Switch app",title:"Switch app",children:jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"1",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"1",y:"11",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"11",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"11",width:"4",height:"4",rx:"1"})]})}),n&&jsxs("div",{className:"absolute left-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] p-2 shadow-2xl",children:[jsx("p",{className:"px-2 pb-1.5 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Hanzo Apps"}),t.filter(o=>o.id!==e).map(o=>jsxs("a",{href:o.href,className:"flex flex-col gap-0.5 rounded-lg px-3 py-2.5 hover:bg-white/[0.06] transition-colors",onClick:()=>r(false),children:[jsx("span",{className:"text-[13px] font-medium text-white/80",children:o.label}),o.description&&jsx("span",{className:"text-[11px] text-white/30",children:o.description})]},o.id))]})]})}s(W,"AppSwitcher");var ye=["#0A0310","#49007E","#FF005B","#FF7D10","#FFB238"];function ke(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return Math.abs(e)}s(ke,"hashStr");function M(t,e,n){return t%(e*(n+1))%e}s(M,"getUnit");function ze(t,e){return M(t,2,e)===0}s(ze,"getBoolean");function ie(t,e,n){return n[M(t,n.length,e)]}s(ie,"getRandomColor");function Ne(t){let e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return e*.299+n*.587+r*.114>128?"#000":"#fff"}s(Ne,"getContrast");function q({name:t,size:e=40,colors:n=ye,className:r,square:l=false}){let o=ke(t),i=ie(o,0,n),h=Ne(i),d=ze(o,2),f=M(o,3,7),p=M(o,5,8),c=M(o,10,9),u=c>6?c-10:c,g=M(o,5,10)>3?M(o,5,10)-5:M(o,5,10);return jsxs("svg",{viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:e,height:e,className:r,style:l?void 0:{borderRadius:"50%"},children:[jsx("mask",{id:`beam-${o}`,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36,children:jsx("rect",{width:36,height:36,rx:l?void 0:72,fill:"#fff"})}),jsxs("g",{mask:`url(#beam-${o})`,children:[jsx("rect",{width:36,height:36,fill:i}),jsx("rect",{x:0,y:0,width:36,height:36,transform:`translate(${u} ${g}) rotate(${c} 18 18)`,fill:ie(o,1,n),rx:6}),jsxs("g",{transform:`translate(${u} ${g}) rotate(${c} 18 18)`,children:[d?jsx("path",{d:`M15 ${19+f}c2 1 4 1 6 0`,stroke:h,fill:"none",strokeLinecap:"round"}):jsx("path",{d:`M13 ${19+f}a1 .75 0 0 0 10 0`,fill:h}),jsx("rect",{x:14-p,y:14,width:1.5,height:2,rx:1,fill:h}),jsx("rect",{x:20+p,y:14,width:1.5,height:2,rx:1,fill:h})]})]})]})}s(q,"BeamAvatar");async function Ae(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(l=>l.toString(16).padStart(2,"0")).join("")}s(Ae,"sha256");function Se(t,e){let[n,r]=useState(null);return useMemo(()=>{if(!t){r(null);return}let l=t.trim().toLowerCase();Ae(l).then(o=>{r(`https://www.gravatar.com/avatar/${o}?s=${e||80}&d=404`);});},[t,e]),n}s(Se,"useGravatarUrl");function Q({src:t,email:e,name:n,size:r=40,colors:l,className:o}){let[i,h]=useState(false),[d,f]=useState(false),p=Se(e,r*2),c=`rounded-full object-cover ${o||""}`,u={width:r,height:r};return t&&!i?jsx("img",{src:t,alt:n||e||"avatar",className:c,style:u,onError:()=>h(true)}):p&&!d?jsx("img",{src:p,alt:n||e||"avatar",className:c,style:u,onError:()=>f(true)}):jsx(q,{name:n||e||"user",size:r,colors:l,className:o})}s(Q,"UserAvatar");function ee({user:t,organizations:e=[],currentOrgId:n,onOrgSwitch:r,onSignOut:l}){let[o,i]=useState(false),h=useRef(null);if(useEffect(()=>{let c=s(u=>{h.current&&!h.current.contains(u.target)&&i(false);},"handler");return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),!t)return null;let d=e.find(c=>c.id===n),f=d?.slug||"hanzo",p=S[f]||S.hanzo;return jsxs("div",{ref:h,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>i(c=>!c),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-white/[0.06] transition-colors",children:[jsx(Q,{src:t.avatar,email:t.email,name:t.name,size:28}),jsxs("div",{className:"hidden flex-col items-start sm:flex",children:[t.name&&jsx("span",{className:"text-[12px] font-medium text-white/70 leading-none",children:t.name}),jsx("span",{className:"text-[11px] text-white/30 leading-none mt-0.5",children:t.email})]}),jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/30 hidden sm:block",children:jsx("path",{d:"M6 9l6 6 6-6"})})]}),o&&jsxs("div",{className:"absolute right-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] shadow-2xl",children:[jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[jsx("p",{className:"text-[13px] font-medium text-white/80",children:t.name||"User"}),jsx("p",{className:"text-[11px] text-white/40",children:t.email}),d&&jsx("p",{className:"mt-0.5 text-[10px] font-medium text-white/25 uppercase tracking-wider",children:d.name})]}),e.length>0&&jsxs("div",{className:"border-b border-white/[0.06] p-2",children:[jsx("p",{className:"px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Organizations"}),e.map(c=>jsxs("button",{type:"button",onClick:()=>{r?.(c.id),i(false);},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left hover:bg-white/[0.06] transition-colors",children:[jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:"text-[13px] text-white/70",children:c.name}),c.role&&jsx("span",{className:"text-[10px] text-white/25 capitalize",children:c.role})]}),c.id===n&&jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/50",children:jsx("polyline",{points:"20 6 9 17 4 12"})})]},c.id))]}),jsxs("div",{className:"p-2",children:[jsx("a",{href:`${p.iam}/account`,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Account settings"}),jsx("a",{href:p.billing,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Billing"}),jsx("button",{type:"button",onClick:()=>{i(false),l?.();},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/40 hover:bg-white/[0.06] hover:text-red-400/70 transition-colors",children:"Sign out"})]})]})]})}s(ee,"UserOrgDropdown");function Pe({className:t}){return jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[jsx("path",{d:"M21 2v6h-6"}),jsx("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),jsx("path",{d:"M3 22v-6h6"}),jsx("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"})]})}s(Pe,"HardRefreshIcon");function Le({className:t}){return jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),jsx("circle",{cx:"12",cy:"12",r:"3"})]})}s(Le,"SettingsIcon");async function Ee(){try{if(localStorage.clear(),sessionStorage.clear(),document.cookie.split(";").forEach(t=>{let e=t.split("=")[0].trim();if(e){document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`,document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${location.hostname}`;let n=location.hostname.split(".");if(n.length>2){let r="."+n.slice(-2).join(".");document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${r}`;}}}),"caches"in window){let t=await caches.keys();await Promise.all(t.map(e=>caches.delete(e)));}if("serviceWorker"in navigator){let t=await navigator.serviceWorker.getRegistrations();await Promise.all(t.map(e=>e.unregister()));}if("indexedDB"in window&&indexedDB.databases)try{(await indexedDB.databases()).forEach(e=>{e.name&&indexedDB.deleteDatabase(e.name);});}catch{}}catch{}location.reload();}s(Ee,"hardRefresh");function Ie({currentApp:t,currentAppId:e,user:n,organizations:r,currentOrgId:l,onOrgSwitch:o,onSignOut:i,apps:h,headerRight:d,settingsHref:f,onSettingsClick:p,hideHardRefresh:c,hideSettings:u}){let[g,P]=useState(false),L=r?.find(k=>k.id===l)?.slug||"hanzo",m=h||K(L),H=S[L]||S.hanzo,V=useCallback(()=>{P(true),Ee();},[]),y=useCallback(()=>{p?p():window.location.href=f||`${H.iam}/account`;},[p,f,H.iam]);return jsxs("header",{className:"sticky top-0 z-50 flex h-14 w-full items-center justify-between border-b border-white/[0.07] bg-[#09090b]/90 px-4 backdrop-blur-xl",role:"banner",children:[jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[jsx("a",{href:`${H.iam}/account`,className:"flex-shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Account",children:jsx(G,{size:22,brandMenu:true,animate:true})}),jsx("span",{className:"select-none text-white/[0.15]",children:"/"}),jsx("span",{className:"truncate text-[13px] font-medium text-white/50",children:t}),jsx(W,{apps:m,currentAppId:e})]}),jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[d,!c&&jsx("button",{type:"button",onClick:V,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Hard refresh \u2014 clear all storage, cookies, cache and reload",title:"Hard refresh",children:jsx(Pe,{className:g?"animate-spin":""})}),!u&&jsx("button",{type:"button",onClick:y,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Settings",title:"Settings",children:jsx(Le,{})}),jsx(ee,{user:n,organizations:r,currentOrgId:l,onOrgSwitch:o,onSignOut:i})]})]})}s(Ie,"HanzoHeader");var ce="hanzo-auth-token",ne="hanzo-user",pe="hanzo-auth-expires",Ue="https://iam.hanzo.ai",Be={hanzo:{name:"Hanzo AI",slug:"hanzo"},lux:{name:"Lux Network",slug:"lux"},zoo:{name:"Zoo Labs",slug:"zoo"},pars:{name:"Pars",slug:"pars"}};function $e(){let[t,e]=useState(void 0),[n,r]=useState([]),[l,o]=useState(void 0),[i,h]=useState(null),[d,f]=useState(true),p=useCallback(async()=>{try{let g=localStorage.getItem(ce),P=localStorage.getItem(pe);if(!g||P&&Date.now()>Number(P)){f(!1);return}h(g);let E=localStorage.getItem(ne);if(E)try{let m=JSON.parse(E);m?.email&&e({id:m.id,name:m.displayName||m.name,email:m.email,avatar:m.avatar});}catch{}let L=await fetch(`${Ue}/api/userinfo`,{headers:{Authorization:`Bearer ${g}`}});if(L.ok){let m=await L.json(),H={id:m.sub||m.id,name:m.name||m.displayName,email:m.email,avatar:m.picture||m.avatar};e(H),localStorage.setItem(ne,JSON.stringify(m));let y=(m.groups||[]).map(k=>{let I=k.toLowerCase().replace(/^\//,""),R=Be[I];return R?{id:I,name:R.name,slug:R.slug}:null}).filter(Boolean);y.length===0&&H.email&&y.push({id:"personal",name:"Personal",slug:"personal"}),r(y),o(y[0]?.id);}}catch{}finally{f(false);}},[]);useEffect(()=>{p();},[p]);let c=useCallback(()=>{localStorage.removeItem(ce),localStorage.removeItem(ne),localStorage.removeItem(pe),window.location.href="https://hanzo.id";},[]),u=useCallback(g=>{o(g);},[]);return {user:t,organizations:n,currentOrgId:l,token:i,loading:d,signOut:c,switchOrg:u}}s($e,"useHanzoAuth");function Ve(t,e){return t.filter(n=>n.id!==e).map(n=>({id:`app-${n.id}`,title:n.label,description:n.description,href:n.href,category:"Hanzo Apps",external:true,keywords:[n.id,n.label.toLowerCase()]}))}s(Ve,"buildCrossAppCommands");function Te({commands:t=[],apps:e,currentAppId:n,open:r,onOpenChange:l,onNavigate:o}){var ae;let[i,h]=useState(false),d=r??i,f=useCallback(a=>{l?l(a):h(a);},[l]),[p,c]=useState(""),[u,g]=useState(0),P=useRef(null),E=useRef(null),L=Ve(e??U,n),m=[...t,...L],H=p.toLowerCase(),V=H?m.filter(a=>a.title.toLowerCase().includes(H)||a.description?.toLowerCase().includes(H)||a.keywords?.some(z=>z.includes(H))):m,y={};for(let a of V)(y[ae=a.category]??(y[ae]=[])).push(a);let k=Object.values(y).flat();useEffect(()=>g(0),[p]),useEffect(()=>{d&&(c(""),g(0),requestAnimationFrame(()=>P.current?.focus()));},[d]),useEffect(()=>{let a=s(z=>{(z.metaKey||z.ctrlKey)&&z.key==="k"&&(z.preventDefault(),f(!d));},"handler");return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[d,f]);let I=useCallback(a=>{a.action?a.action():a.href&&(o?o(a.href,a.external):a.external?window.open(a.href,"_blank"):window.location.href=a.href),f(false);},[o,f]),R=useCallback(a=>{a.key==="ArrowDown"?(a.preventDefault(),g(z=>(z+1)%(k.length||1))):a.key==="ArrowUp"?(a.preventDefault(),g(z=>(z-1+(k.length||1))%(k.length||1))):a.key==="Enter"&&k[u]?(a.preventDefault(),I(k[u])):a.key==="Escape"&&f(false);},[k,u,I,f]);return useEffect(()=>{E.current?.querySelector(`[data-idx="${u}"]`)?.scrollIntoView({block:"nearest"});},[u]),d?jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:()=>f(false)}),jsx("div",{className:"fixed top-[15%] left-1/2 -translate-x-1/2 w-full max-w-xl z-[101]",children:jsxs("div",{className:"bg-[#111113] border border-white/[0.08] rounded-xl shadow-2xl overflow-hidden",children:[jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-white/[0.07]",children:[jsx("svg",{className:"w-4 h-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),jsx("input",{ref:P,type:"text",value:p,onChange:a=>c(a.target.value),onKeyDown:R,placeholder:"Search commands...",className:"flex-1 bg-transparent text-white text-[13px] placeholder-white/30 outline-none"}),jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-white/[0.06] rounded text-white/30",children:"ESC"})]}),jsx("div",{ref:E,className:"max-h-[400px] overflow-y-auto py-1",children:k.length===0?jsxs("div",{className:"px-4 py-8 text-center text-white/30 text-[13px]",children:["No results for \u201C",p,"\u201D"]}):Object.entries(y).map(([a,z])=>jsxs("div",{children:[jsx("div",{className:"px-4 py-2 text-[10px] font-semibold text-white/25 uppercase tracking-widest",children:a}),z.map(D=>{let Z=k.indexOf(D),F=Z===u;return jsxs("button",{"data-idx":Z,onClick:()=>I(D),onMouseEnter:()=>g(Z),className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${F?"bg-white/[0.06] text-white":"text-white/50 hover:bg-white/[0.03]"}`,children:[D.icon&&jsx("span",{className:`w-5 h-5 flex items-center justify-center ${F?"text-white/70":"text-white/25"}`,children:D.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("span",{className:"text-[13px] font-medium truncate block",children:D.title}),D.description&&jsx("span",{className:"text-[11px] text-white/25 truncate block",children:D.description})]}),F&&jsx("span",{className:"text-white/25 text-[11px]",children:"\u21B5"})]},D.id)})]},a))}),jsxs("div",{className:"px-4 py-2 border-t border-white/[0.07] flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-4 text-[10px] text-white/20",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2191"}),jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2193"}),"navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u21B5"}),"select"]})]}),jsx("span",{className:"text-[10px] text-white/20",children:"\u2318K"})]})]})})]}):null}s(Te,"HanzoCommandPalette");
|
|
3
|
+
export{W as AppSwitcher,q as BeamAvatar,U as DEFAULT_HANZO_APPS,Te as HanzoCommandPalette,Ie as HanzoHeader,G as HanzoMark,S as ORG_DOMAINS,Q as UserAvatar,ee as UserOrgDropdown,K as getAppsForOrg,$e as useHanzoAuth};
|
package/dist/navigation/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var Ze=Object.defineProperty;var e=(o,i)=>Ze(o,"name",{value:i,configurable:true});function je({x:o,y:i,onClose:n}){let p=react.useRef(null);react.useEffect(()=>{let r=e(d=>{p.current&&!p.current.contains(d.target)&&n();},"handler"),u=e(d=>{d.key==="Escape"&&n();},"escape");return document.addEventListener("mousedown",r),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",u);}},[n]);let l=[{label:"Brand Guidelines",href:"https://hanzo.ai/brand"},{label:"Press Kit",href:"https://hanzo.ai/press"},{label:"Download Logo",href:"https://hanzo.ai/brand#download"},{label:"Copy SVG",action:"copy-svg"},{label:"hanzo.ai \u2192",href:"https://hanzo.ai"}],a='<svg viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="M22.21 67V44.6369H0V67H22.21Z" fill="#ffffff"/><path d="M0 44.6369L22.21 46.8285V44.6369H0Z" fill="#DDDDDD"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="#ffffff"/><path d="M22.21 0H0V22.3184H22.21V0Z" fill="#ffffff"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="#ffffff"/><path d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" fill="#DDDDDD"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="#ffffff"/></svg>';return jsxRuntime.jsxs("div",{ref:p,role:"menu",className:"fixed z-[9999] min-w-[180px] rounded-xl border border-white/[0.08] bg-[#111113] py-1.5 shadow-2xl shadow-black/60",style:{top:i,left:o},children:[jsxRuntime.jsx("div",{className:"border-b border-white/[0.06] px-3 pb-2 pt-1",children:jsxRuntime.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-white/30",children:"Hanzo Brand"})}),l.map(r=>r.action==="copy-svg"?jsxRuntime.jsx("button",{type:"button",role:"menuitem",onClick:()=>{navigator.clipboard.writeText(a).catch(()=>{}),n();},className:"flex w-full items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors text-left",children:"Copy SVG"},"copy"):jsxRuntime.jsx("a",{href:r.href,role:"menuitem",target:r.href?.startsWith("https")?"_blank":void 0,rel:"noopener noreferrer",onClick:n,className:"flex items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors",children:r.label},r.label))]})}e(je,"BrandContextMenu");function J({size:o=22,className:i="",brandMenu:n=true,animate:p=true}){let[l,a]=react.useState(null),[r,u]=react.useState(false),d=react.useCallback(x=>{n&&(x.preventDefault(),a({x:x.clientX,y:x.clientY}));},[n]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{width:o,height:o,viewBox:"0 0 67 67",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hanzo",className:i,style:p?{transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease",transform:r?"scale(1.12) perspective(80px) rotateY(-6deg)":"scale(1) perspective(80px) rotateY(0deg)",transformOrigin:"center center"}:{},onMouseEnter:()=>u(true),onMouseLeave:()=>u(false),onContextMenu:d,children:[jsxRuntime.jsx("path",{d:"M22.21 67V44.6369H0V67H22.21Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M0 44.6369L22.21 46.8285V44.6369H0Z",fill:"#DDDDDD"}),jsxRuntime.jsx("path",{d:"M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M22.21 0H0V22.3184H22.21V0Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M66.7198 0H44.5098V22.3184H66.7198V0Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z",fill:"#DDDDDD"}),jsxRuntime.jsx("path",{d:"M66.7198 67V44.6369H44.5098V67H66.7198Z",fill:"#ffffff"})]}),l&&jsxRuntime.jsx(je,{x:l.x,y:l.y,onClose:()=>a(null)})]})}e(J,"HanzoMark");var C=[{id:"account",label:"Account",href:"https://hanzo.id/account",description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:"https://billing.hanzo.ai",description:"Subscriptions & usage"},{id:"console",label:"Console",href:"https://console.hanzo.ai",description:"API keys & projects"},{id:"chat",label:"Chat",href:"https://chat.hanzo.ai",description:"AI chat & models"},{id:"platform",label:"Platform",href:"https://platform.hanzo.ai",description:"Deploy & scale services"}];function U({apps:o=C,currentAppId:i}){let[n,p]=react.useState(false),l=react.useRef(null);return react.useEffect(()=>{let a=e(r=>{l.current&&!l.current.contains(r.target)&&p(false);},"handler");return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]),jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>p(a=>!a),className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/40 hover:bg-white/[0.06] hover:text-white/70 transition-colors","aria-label":"Switch app",title:"Switch app",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"1",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"1",y:"11",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"11",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"11",width:"4",height:"4",rx:"1"})]})}),n&&jsxRuntime.jsxs("div",{className:"absolute left-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] p-2 shadow-2xl",children:[jsxRuntime.jsx("p",{className:"px-2 pb-1.5 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Hanzo Apps"}),o.filter(a=>a.id!==i).map(a=>jsxRuntime.jsxs("a",{href:a.href,className:"flex flex-col gap-0.5 rounded-lg px-3 py-2.5 hover:bg-white/[0.06] transition-colors",onClick:()=>p(false),children:[jsxRuntime.jsx("span",{className:"text-[13px] font-medium text-white/80",children:a.label}),a.description&&jsxRuntime.jsx("span",{className:"text-[11px] text-white/30",children:a.description})]},a.id))]})]})}e(U,"AppSwitcher");function Xe({name:o,email:i}){let p=(o||i||"U").split(/[\s@._-]/).filter(Boolean).slice(0,2).map(l=>l[0].toUpperCase()).join("");return jsxRuntime.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-neutral-800 text-[11px] font-semibold text-white/70",children:p})}e(Xe,"Initials");function R({user:o,organizations:i=[],currentOrgId:n,onOrgSwitch:p,onSignOut:l}){let[a,r]=react.useState(false),u=react.useRef(null);if(react.useEffect(()=>{let s=e(x=>{u.current&&!u.current.contains(x.target)&&r(false);},"handler");return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),!o)return null;i.find(s=>s.id===n);return jsxRuntime.jsxs("div",{ref:u,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>r(s=>!s),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-white/[0.06] transition-colors",children:[o.avatar?jsxRuntime.jsx("img",{src:o.avatar,alt:o.name||o.email,className:"h-7 w-7 rounded-full object-cover"}):jsxRuntime.jsx(Xe,{name:o.name,email:o.email}),jsxRuntime.jsxs("div",{className:"hidden flex-col items-start sm:flex",children:[o.name&&jsxRuntime.jsx("span",{className:"text-[12px] font-medium text-white/70 leading-none",children:o.name}),jsxRuntime.jsx("span",{className:"text-[11px] text-white/30 leading-none mt-0.5",children:o.email})]}),jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/30 hidden sm:block",children:jsxRuntime.jsx("path",{d:"M6 9l6 6 6-6"})})]}),a&&jsxRuntime.jsxs("div",{className:"absolute right-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] shadow-2xl",children:[jsxRuntime.jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[jsxRuntime.jsx("p",{className:"text-[13px] font-medium text-white/80",children:o.name||"User"}),jsxRuntime.jsx("p",{className:"text-[11px] text-white/40",children:o.email})]}),i.length>0&&jsxRuntime.jsxs("div",{className:"border-b border-white/[0.06] p-2",children:[jsxRuntime.jsx("p",{className:"px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Organizations"}),i.map(s=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>{p?.(s.id),r(false);},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left hover:bg-white/[0.06] transition-colors",children:[jsxRuntime.jsx("span",{className:"text-[13px] text-white/70",children:s.name}),s.id===n&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/50",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},s.id))]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("a",{href:"https://hanzo.id/account",className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>r(false),children:"Account settings"}),jsxRuntime.jsx("a",{href:"https://billing.hanzo.ai",className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>r(false),children:"Billing"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(false),l?.();},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/40 hover:bg-white/[0.06] hover:text-red-400/70 transition-colors",children:"Sign out"})]})]})]})}e(R,"UserOrgDropdown");function X({currentApp:o,currentAppId:i,user:n,organizations:p,currentOrgId:l,onOrgSwitch:a,onSignOut:r,apps:u=C,headerRight:d}){return jsxRuntime.jsxs("header",{className:"sticky top-0 z-50 flex h-14 w-full items-center justify-between border-b border-white/[0.07] bg-[#09090b]/90 px-4 backdrop-blur-xl",role:"banner",children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[jsxRuntime.jsx("a",{href:"https://hanzo.id/account",className:"flex-shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Hanzo Account",children:jsxRuntime.jsx(J,{size:22,brandMenu:true,animate:true})}),jsxRuntime.jsx("span",{className:"select-none text-white/[0.15]",children:"/"}),jsxRuntime.jsx("span",{className:"truncate text-[13px] font-medium text-white/50",children:o}),jsxRuntime.jsx(U,{apps:u,currentAppId:i})]}),jsxRuntime.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2",children:[d,jsxRuntime.jsx(R,{user:n,organizations:p,currentOrgId:l,onOrgSwitch:a,onSignOut:r})]})]})}e(X,"HanzoHeader");var Q="hanzo-auth-token",F="hanzo-user",ee="hanzo-auth-expires",et="https://iam.hanzo.ai",tt={hanzo:{name:"Hanzo AI",slug:"hanzo"},lux:{name:"Lux Network",slug:"lux"},zoo:{name:"Zoo Labs",slug:"zoo"},pars:{name:"Pars",slug:"pars"}};function te(){let[o,i]=react.useState(void 0),[n,p]=react.useState([]),[l,a]=react.useState(void 0),[r,u]=react.useState(null),[d,s]=react.useState(true),x=react.useCallback(async()=>{try{let w=localStorage.getItem(Q),O=localStorage.getItem(ee);if(!w||O&&Date.now()>Number(O)){s(!1);return}u(w);let P=localStorage.getItem(F);if(P)try{let c=JSON.parse(P);c?.email&&i({id:c.id,name:c.displayName||c.name,email:c.email,avatar:c.avatar});}catch{}let I=await fetch(`${et}/api/userinfo`,{headers:{Authorization:`Bearer ${w}`}});if(I.ok){let c=await I.json(),A={id:c.sub||c.id,name:c.name||c.displayName,email:c.email,avatar:c.picture||c.avatar};i(A),localStorage.setItem(F,JSON.stringify(c));let N=(c.groups||[]).map(y=>{let S=y.toLowerCase().replace(/^\//,""),E=tt[S];return E?{id:S,name:E.name,slug:E.slug}:null}).filter(Boolean);N.length===0&&A.email&&N.push({id:"personal",name:"Personal",slug:"personal"}),p(N),a(N[0]?.id);}}catch{}finally{s(false);}},[]);react.useEffect(()=>{x();},[x]);let M=react.useCallback(()=>{localStorage.removeItem(Q),localStorage.removeItem(F),localStorage.removeItem(ee),window.location.href="https://hanzo.id";},[]),H=react.useCallback(w=>{a(w);},[]);return {user:o,organizations:n,currentOrgId:l,token:r,loading:d,signOut:M,switchOrg:H}}e(te,"useHanzoAuth");function ot(o,i){return o.filter(n=>n.id!==i).map(n=>({id:`app-${n.id}`,title:n.label,description:n.description,href:n.href,category:"Hanzo Apps",external:true,keywords:[n.id,n.label.toLowerCase()]}))}e(ot,"buildCrossAppCommands");function ne({commands:o=[],apps:i,currentAppId:n,open:p,onOpenChange:l,onNavigate:a}){var q;let[r,u]=react.useState(false),d=p??r,s=react.useCallback(t=>{l?l(t):u(t);},[l]),[x,M]=react.useState(""),[H,w]=react.useState(0),O=react.useRef(null),P=react.useRef(null),I=ot(i??C,n),c=[...o,...I],A=x.toLowerCase(),$=A?c.filter(t=>t.title.toLowerCase().includes(A)||t.description?.toLowerCase().includes(A)||t.keywords?.some(g=>g.includes(A))):c,N={};for(let t of $)(N[q=t.category]??(N[q]=[])).push(t);let y=Object.values(N).flat();react.useEffect(()=>w(0),[x]),react.useEffect(()=>{d&&(M(""),w(0),requestAnimationFrame(()=>O.current?.focus()));},[d]),react.useEffect(()=>{let t=e(g=>{(g.metaKey||g.ctrlKey)&&g.key==="k"&&(g.preventDefault(),s(!d));},"handler");return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[d,s]);let S=react.useCallback(t=>{t.action?t.action():t.href&&(a?a(t.href,t.external):t.external?window.open(t.href,"_blank"):window.location.href=t.href),s(false);},[a,s]),E=react.useCallback(t=>{t.key==="ArrowDown"?(t.preventDefault(),w(g=>(g+1)%(y.length||1))):t.key==="ArrowUp"?(t.preventDefault(),w(g=>(g-1+(y.length||1))%(y.length||1))):t.key==="Enter"&&y[H]?(t.preventDefault(),S(y[H])):t.key==="Escape"&&s(false);},[y,H,S,s]);return react.useEffect(()=>{P.current?.querySelector(`[data-idx="${H}"]`)?.scrollIntoView({block:"nearest"});},[H]),d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:()=>s(false)}),jsxRuntime.jsx("div",{className:"fixed top-[15%] left-1/2 -translate-x-1/2 w-full max-w-xl z-[101]",children:jsxRuntime.jsxs("div",{className:"bg-[#111113] border border-white/[0.08] rounded-xl shadow-2xl overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-white/[0.07]",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),jsxRuntime.jsx("input",{ref:O,type:"text",value:x,onChange:t=>M(t.target.value),onKeyDown:E,placeholder:"Search commands...",className:"flex-1 bg-transparent text-white text-[13px] placeholder-white/30 outline-none"}),jsxRuntime.jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-white/[0.06] rounded text-white/30",children:"ESC"})]}),jsxRuntime.jsx("div",{ref:P,className:"max-h-[400px] overflow-y-auto py-1",children:y.length===0?jsxRuntime.jsxs("div",{className:"px-4 py-8 text-center text-white/30 text-[13px]",children:["No results for \u201C",x,"\u201D"]}):Object.entries(N).map(([t,g])=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"px-4 py-2 text-[10px] font-semibold text-white/25 uppercase tracking-widest",children:t}),g.map(z=>{let Z=y.indexOf(z),_=Z===H;return jsxRuntime.jsxs("button",{"data-idx":Z,onClick:()=>S(z),onMouseEnter:()=>w(Z),className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${_?"bg-white/[0.06] text-white":"text-white/50 hover:bg-white/[0.03]"}`,children:[z.icon&&jsxRuntime.jsx("span",{className:`w-5 h-5 flex items-center justify-center ${_?"text-white/70":"text-white/25"}`,children:z.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:"text-[13px] font-medium truncate block",children:z.title}),z.description&&jsxRuntime.jsx("span",{className:"text-[11px] text-white/25 truncate block",children:z.description})]}),_&&jsxRuntime.jsx("span",{className:"text-white/25 text-[11px]",children:"\u21B5"})]},z.id)})]},t))}),jsxRuntime.jsxs("div",{className:"px-4 py-2 border-t border-white/[0.07] flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-white/20",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2191"}),jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2193"}),"navigate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u21B5"}),"select"]})]}),jsxRuntime.jsx("span",{className:"text-[10px] text-white/20",children:"\u2318K"})]})]})})]}):null}e(ne,"HanzoCommandPalette");function re(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(re,"Component");function ie(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ie,"Component");function pe(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(pe,"Component");function de(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(de,"Component");function me(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(me,"Component");function xe(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(xe,"Component");function ge(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ge,"Component");function we(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(we,"Component");function Ne(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ne,"Component");function He(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(He,"Component");function Ce(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ce,"Component");function Ae(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ae,"Component");function De(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(De,"Component");function Pe(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Pe,"Component");function Le(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Le,"Component");function Ie(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ie,"Component");function Ue(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ue,"Component");function Ve(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ve,"Component");
|
|
3
|
-
exports.AIModelSelectorNavigationBar=
|
|
2
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var Je=Object.defineProperty;var e=(o,t)=>Je(o,"name",{value:t,configurable:true});function tt({x:o,y:t,onClose:n}){let r=react.useRef(null);react.useEffect(()=>{let i=e(d=>{r.current&&!r.current.contains(d.target)&&n();},"handler"),f=e(d=>{d.key==="Escape"&&n();},"escape");return document.addEventListener("mousedown",i),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",f);}},[n]);let l=[{label:"Brand Guidelines",href:"https://hanzo.ai/brand"},{label:"Press Kit",href:"https://hanzo.ai/press"},{label:"Download Logo",href:"https://hanzo.ai/brand#download"},{label:"Copy SVG",action:"copy-svg"},{label:"hanzo.ai \u2192",href:"https://hanzo.ai"}],a='<svg viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="M22.21 67V44.6369H0V67H22.21Z" fill="#ffffff"/><path d="M0 44.6369L22.21 46.8285V44.6369H0Z" fill="#DDDDDD"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="#ffffff"/><path d="M22.21 0H0V22.3184H22.21V0Z" fill="#ffffff"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="#ffffff"/><path d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" fill="#DDDDDD"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="#ffffff"/></svg>';return jsxRuntime.jsxs("div",{ref:r,role:"menu",className:"fixed z-[9999] min-w-[180px] rounded-xl border border-white/[0.08] bg-[#111113] py-1.5 shadow-2xl shadow-black/60",style:{top:t,left:o},children:[jsxRuntime.jsx("div",{className:"border-b border-white/[0.06] px-3 pb-2 pt-1",children:jsxRuntime.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-white/30",children:"Hanzo Brand"})}),l.map(i=>i.action==="copy-svg"?jsxRuntime.jsx("button",{type:"button",role:"menuitem",onClick:()=>{navigator.clipboard.writeText(a).catch(()=>{}),n();},className:"flex w-full items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors text-left",children:"Copy SVG"},"copy"):jsxRuntime.jsx("a",{href:i.href,role:"menuitem",target:i.href?.startsWith("https")?"_blank":void 0,rel:"noopener noreferrer",onClick:n,className:"flex items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors",children:i.label},i.label))]})}e(tt,"BrandContextMenu");function ae({size:o=22,className:t="",brandMenu:n=true,animate:r=true}){let[l,a]=react.useState(null),[i,f]=react.useState(false),d=react.useCallback(p=>{n&&(p.preventDefault(),a({x:p.clientX,y:p.clientY}));},[n]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{width:o,height:o,viewBox:"0 0 67 67",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hanzo",className:t,style:r?{transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease",transform:i?"scale(1.12) perspective(80px) rotateY(-6deg)":"scale(1) perspective(80px) rotateY(0deg)",transformOrigin:"center center"}:{},onMouseEnter:()=>f(true),onMouseLeave:()=>f(false),onContextMenu:d,children:[jsxRuntime.jsx("path",{d:"M22.21 67V44.6369H0V67H22.21Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M0 44.6369L22.21 46.8285V44.6369H0Z",fill:"#DDDDDD"}),jsxRuntime.jsx("path",{d:"M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M22.21 0H0V22.3184H22.21V0Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M66.7198 0H44.5098V22.3184H66.7198V0Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z",fill:"#DDDDDD"}),jsxRuntime.jsx("path",{d:"M66.7198 67V44.6369H44.5098V67H66.7198Z",fill:"#ffffff"})]}),l&&jsxRuntime.jsx(tt,{x:l.x,y:l.y,onClose:()=>a(null)})]})}e(ae,"HanzoMark");var I=[{id:"account",label:"Account",href:"https://hanzo.id/account",description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:"https://billing.hanzo.ai",description:"Subscriptions & usage"},{id:"console",label:"Console",href:"https://console.hanzo.ai",description:"API keys & projects"},{id:"chat",label:"Chat",href:"https://hanzo.chat",description:"AI chat & models"},{id:"platform",label:"Platform",href:"https://platform.hanzo.ai",description:"Deploy & scale services"},{id:"storage",label:"Storage",href:"https://hanzo.space",description:"S3 object storage"}],A={hanzo:{id:"hanzo",iam:"https://hanzo.id",billing:"https://billing.hanzo.ai",console:"https://console.hanzo.ai",chat:"https://hanzo.chat",platform:"https://platform.hanzo.ai",storage:"https://hanzo.space",s3:"https://s3.hanzo.ai"},lux:{id:"lux",iam:"https://lux.id",billing:"https://billing.lux.network",console:"https://console.lux.network",chat:"https://chat.lux.network",platform:"https://platform.lux.network",storage:"https://storage.lux.network",s3:"https://s3.lux.network"},zoo:{id:"zoo",iam:"https://zoo.id",billing:"https://billing.zoo.ngo",console:"https://console.zoo.ngo",chat:"https://chat.zoo.ngo",platform:"https://platform.zoo.ngo",storage:"https://storage.zoo.ngo",s3:"https://s3.zoo.ngo"},pars:{id:"pars",iam:"https://pars.id",billing:"https://billing.pars.ai",console:"https://console.pars.ai",chat:"https://chat.pars.ai",platform:"https://platform.pars.ai",storage:"https://storage.pars.ai",s3:"https://s3.pars.ai"}};function W(o){let t=A[o]||A.hanzo;return [{id:"account",label:"Account",href:`${t.iam}/account`,description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:t.billing,description:"Subscriptions & usage"},{id:"console",label:"Console",href:t.console,description:"API keys & projects"},{id:"chat",label:"Chat",href:t.chat,description:"AI chat & models"},{id:"platform",label:"Platform",href:t.platform,description:"Deploy & scale services"},{id:"storage",label:"Storage",href:t.storage,description:"S3 object storage"}]}e(W,"getAppsForOrg");function _({apps:o=I,currentAppId:t}){let[n,r]=react.useState(false),l=react.useRef(null);return react.useEffect(()=>{let a=e(i=>{l.current&&!l.current.contains(i.target)&&r(false);},"handler");return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]),jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>r(a=>!a),className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/40 hover:bg-white/[0.06] hover:text-white/70 transition-colors","aria-label":"Switch app",title:"Switch app",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"1",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"1",y:"11",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"11",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"11",width:"4",height:"4",rx:"1"})]})}),n&&jsxRuntime.jsxs("div",{className:"absolute left-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] p-2 shadow-2xl",children:[jsxRuntime.jsx("p",{className:"px-2 pb-1.5 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Hanzo Apps"}),o.filter(a=>a.id!==t).map(a=>jsxRuntime.jsxs("a",{href:a.href,className:"flex flex-col gap-0.5 rounded-lg px-3 py-2.5 hover:bg-white/[0.06] transition-colors",onClick:()=>r(false),children:[jsxRuntime.jsx("span",{className:"text-[13px] font-medium text-white/80",children:a.label}),a.description&&jsxRuntime.jsx("span",{className:"text-[11px] text-white/30",children:a.description})]},a.id))]})]})}e(_,"AppSwitcher");var st=["#0A0310","#49007E","#FF005B","#FF7D10","#FFB238"];function it(o){let t=0;for(let n=0;n<o.length;n++)t=(t<<5)-t+o.charCodeAt(n)|0;return Math.abs(t)}e(it,"hashStr");function M(o,t,n){return o%(t*(n+1))%t}e(M,"getUnit");function lt(o,t){return M(o,2,t)===0}e(lt,"getBoolean");function re(o,t,n){return n[M(o,n.length,t)]}e(re,"getRandomColor");function ct(o){let t=parseInt(o.slice(1,3),16),n=parseInt(o.slice(3,5),16),r=parseInt(o.slice(5,7),16);return t*.299+n*.587+r*.114>128?"#000":"#fff"}e(ct,"getContrast");function se({name:o,size:t=40,colors:n=st,className:r,square:l=false}){let a=it(o),i=re(a,0,n),f=ct(i),d=lt(a,2),m=M(a,3,7),p=M(a,5,8),c=M(a,10,9),h=c>6?c-10:c,g=M(a,5,10)>3?M(a,5,10)-5:M(a,5,10);return jsxRuntime.jsxs("svg",{viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,className:r,style:l?void 0:{borderRadius:"50%"},children:[jsxRuntime.jsx("mask",{id:`beam-${a}`,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36,children:jsxRuntime.jsx("rect",{width:36,height:36,rx:l?void 0:72,fill:"#fff"})}),jsxRuntime.jsxs("g",{mask:`url(#beam-${a})`,children:[jsxRuntime.jsx("rect",{width:36,height:36,fill:i}),jsxRuntime.jsx("rect",{x:0,y:0,width:36,height:36,transform:`translate(${h} ${g}) rotate(${c} 18 18)`,fill:re(a,1,n),rx:6}),jsxRuntime.jsxs("g",{transform:`translate(${h} ${g}) rotate(${c} 18 18)`,children:[d?jsxRuntime.jsx("path",{d:`M15 ${19+m}c2 1 4 1 6 0`,stroke:f,fill:"none",strokeLinecap:"round"}):jsxRuntime.jsx("path",{d:`M13 ${19+m}a1 .75 0 0 0 10 0`,fill:f}),jsxRuntime.jsx("rect",{x:14-p,y:14,width:1.5,height:2,rx:1,fill:f}),jsxRuntime.jsx("rect",{x:20+p,y:14,width:1.5,height:2,rx:1,fill:f})]})]})]})}e(se,"BeamAvatar");async function dt(o){let n=new TextEncoder().encode(o),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(l=>l.toString(16).padStart(2,"0")).join("")}e(dt,"sha256");function ft(o,t){let[n,r]=react.useState(null);return react.useMemo(()=>{if(!o){r(null);return}let l=o.trim().toLowerCase();dt(l).then(a=>{r(`https://www.gravatar.com/avatar/${a}?s=${t||80}&d=404`);});},[o,t]),n}e(ft,"useGravatarUrl");function ie({src:o,email:t,name:n,size:r=40,colors:l,className:a}){let[i,f]=react.useState(false),[d,m]=react.useState(false),p=ft(t,r*2),c=`rounded-full object-cover ${a||""}`,h={width:r,height:r};return o&&!i?jsxRuntime.jsx("img",{src:o,alt:n||t||"avatar",className:c,style:h,onError:()=>f(true)}):p&&!d?jsxRuntime.jsx("img",{src:p,alt:n||t||"avatar",className:c,style:h,onError:()=>m(true)}):jsxRuntime.jsx(se,{name:n||t||"user",size:r,colors:l,className:a})}e(ie,"UserAvatar");function F({user:o,organizations:t=[],currentOrgId:n,onOrgSwitch:r,onSignOut:l}){let[a,i]=react.useState(false),f=react.useRef(null);if(react.useEffect(()=>{let c=e(h=>{f.current&&!f.current.contains(h.target)&&i(false);},"handler");return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),!o)return null;let d=t.find(c=>c.id===n),m=d?.slug||"hanzo",p=A[m]||A.hanzo;return jsxRuntime.jsxs("div",{ref:f,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(c=>!c),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-white/[0.06] transition-colors",children:[jsxRuntime.jsx(ie,{src:o.avatar,email:o.email,name:o.name,size:28}),jsxRuntime.jsxs("div",{className:"hidden flex-col items-start sm:flex",children:[o.name&&jsxRuntime.jsx("span",{className:"text-[12px] font-medium text-white/70 leading-none",children:o.name}),jsxRuntime.jsx("span",{className:"text-[11px] text-white/30 leading-none mt-0.5",children:o.email})]}),jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/30 hidden sm:block",children:jsxRuntime.jsx("path",{d:"M6 9l6 6 6-6"})})]}),a&&jsxRuntime.jsxs("div",{className:"absolute right-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] shadow-2xl",children:[jsxRuntime.jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[jsxRuntime.jsx("p",{className:"text-[13px] font-medium text-white/80",children:o.name||"User"}),jsxRuntime.jsx("p",{className:"text-[11px] text-white/40",children:o.email}),d&&jsxRuntime.jsx("p",{className:"mt-0.5 text-[10px] font-medium text-white/25 uppercase tracking-wider",children:d.name})]}),t.length>0&&jsxRuntime.jsxs("div",{className:"border-b border-white/[0.06] p-2",children:[jsxRuntime.jsx("p",{className:"px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Organizations"}),t.map(c=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>{r?.(c.id),i(false);},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left hover:bg-white/[0.06] transition-colors",children:[jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-[13px] text-white/70",children:c.name}),c.role&&jsxRuntime.jsx("span",{className:"text-[10px] text-white/25 capitalize",children:c.role})]}),c.id===n&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/50",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},c.id))]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("a",{href:`${p.iam}/account`,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Account settings"}),jsxRuntime.jsx("a",{href:p.billing,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Billing"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{i(false),l?.();},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/40 hover:bg-white/[0.06] hover:text-red-400/70 transition-colors",children:"Sign out"})]})]})]})}e(F,"UserOrgDropdown");function xt({className:o}){return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[jsxRuntime.jsx("path",{d:"M21 2v6h-6"}),jsxRuntime.jsx("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),jsxRuntime.jsx("path",{d:"M3 22v-6h6"}),jsxRuntime.jsx("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"})]})}e(xt,"HardRefreshIcon");function vt({className:o}){return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[jsxRuntime.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}e(vt,"SettingsIcon");async function wt(){try{if(localStorage.clear(),sessionStorage.clear(),document.cookie.split(";").forEach(o=>{let t=o.split("=")[0].trim();if(t){document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`,document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${location.hostname}`;let n=location.hostname.split(".");if(n.length>2){let r="."+n.slice(-2).join(".");document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${r}`;}}}),"caches"in window){let o=await caches.keys();await Promise.all(o.map(t=>caches.delete(t)));}if("serviceWorker"in navigator){let o=await navigator.serviceWorker.getRegistrations();await Promise.all(o.map(t=>t.unregister()));}if("indexedDB"in window&&indexedDB.databases)try{(await indexedDB.databases()).forEach(t=>{t.name&&indexedDB.deleteDatabase(t.name);});}catch{}}catch{}location.reload();}e(wt,"hardRefresh");function ce({currentApp:o,currentAppId:t,user:n,organizations:r,currentOrgId:l,onOrgSwitch:a,onSignOut:i,apps:f,headerRight:d,settingsHref:m,onSettingsClick:p,hideHardRefresh:c,hideSettings:h}){let[g,P]=react.useState(false),L=r?.find(N=>N.id===l)?.slug||"hanzo",u=f||W(L),H=A[L]||A.hanzo,$=react.useCallback(()=>{P(true),wt();},[]),y=react.useCallback(()=>{p?p():window.location.href=m||`${H.iam}/account`;},[p,m,H.iam]);return jsxRuntime.jsxs("header",{className:"sticky top-0 z-50 flex h-14 w-full items-center justify-between border-b border-white/[0.07] bg-[#09090b]/90 px-4 backdrop-blur-xl",role:"banner",children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[jsxRuntime.jsx("a",{href:`${H.iam}/account`,className:"flex-shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Account",children:jsxRuntime.jsx(ae,{size:22,brandMenu:true,animate:true})}),jsxRuntime.jsx("span",{className:"select-none text-white/[0.15]",children:"/"}),jsxRuntime.jsx("span",{className:"truncate text-[13px] font-medium text-white/50",children:o}),jsxRuntime.jsx(_,{apps:u,currentAppId:t})]}),jsxRuntime.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[d,!c&&jsxRuntime.jsx("button",{type:"button",onClick:$,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Hard refresh \u2014 clear all storage, cookies, cache and reload",title:"Hard refresh",children:jsxRuntime.jsx(xt,{className:g?"animate-spin":""})}),!h&&jsxRuntime.jsx("button",{type:"button",onClick:y,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Settings",title:"Settings",children:jsxRuntime.jsx(vt,{})}),jsxRuntime.jsx(F,{user:n,organizations:r,currentOrgId:l,onOrgSwitch:a,onSignOut:i})]})]})}e(ce,"HanzoHeader");var pe="hanzo-auth-token",Q="hanzo-user",de="hanzo-auth-expires",yt="https://iam.hanzo.ai",Nt={hanzo:{name:"Hanzo AI",slug:"hanzo"},lux:{name:"Lux Network",slug:"lux"},zoo:{name:"Zoo Labs",slug:"zoo"},pars:{name:"Pars",slug:"pars"}};function fe(){let[o,t]=react.useState(void 0),[n,r]=react.useState([]),[l,a]=react.useState(void 0),[i,f]=react.useState(null),[d,m]=react.useState(true),p=react.useCallback(async()=>{try{let g=localStorage.getItem(pe),P=localStorage.getItem(de);if(!g||P&&Date.now()>Number(P)){m(!1);return}f(g);let B=localStorage.getItem(Q);if(B)try{let u=JSON.parse(B);u?.email&&t({id:u.id,name:u.displayName||u.name,email:u.email,avatar:u.avatar});}catch{}let L=await fetch(`${yt}/api/userinfo`,{headers:{Authorization:`Bearer ${g}`}});if(L.ok){let u=await L.json(),H={id:u.sub||u.id,name:u.name||u.displayName,email:u.email,avatar:u.picture||u.avatar};t(H),localStorage.setItem(Q,JSON.stringify(u));let y=(u.groups||[]).map(N=>{let E=N.toLowerCase().replace(/^\//,""),R=Nt[E];return R?{id:E,name:R.name,slug:R.slug}:null}).filter(Boolean);y.length===0&&H.email&&y.push({id:"personal",name:"Personal",slug:"personal"}),r(y),a(y[0]?.id);}}catch{}finally{m(false);}},[]);react.useEffect(()=>{p();},[p]);let c=react.useCallback(()=>{localStorage.removeItem(pe),localStorage.removeItem(Q),localStorage.removeItem(de),window.location.href="https://hanzo.id";},[]),h=react.useCallback(g=>{a(g);},[]);return {user:o,organizations:n,currentOrgId:l,token:i,loading:d,signOut:c,switchOrg:h}}e(fe,"useHanzoAuth");function zt(o,t){return o.filter(n=>n.id!==t).map(n=>({id:`app-${n.id}`,title:n.label,description:n.description,href:n.href,category:"Hanzo Apps",external:true,keywords:[n.id,n.label.toLowerCase()]}))}e(zt,"buildCrossAppCommands");function ue({commands:o=[],apps:t,currentAppId:n,open:r,onOpenChange:l,onNavigate:a}){var oe;let[i,f]=react.useState(false),d=r??i,m=react.useCallback(s=>{l?l(s):f(s);},[l]),[p,c]=react.useState(""),[h,g]=react.useState(0),P=react.useRef(null),B=react.useRef(null),L=zt(t??I,n),u=[...o,...L],H=p.toLowerCase(),$=H?u.filter(s=>s.title.toLowerCase().includes(H)||s.description?.toLowerCase().includes(H)||s.keywords?.some(z=>z.includes(H))):u,y={};for(let s of $)(y[oe=s.category]??(y[oe]=[])).push(s);let N=Object.values(y).flat();react.useEffect(()=>g(0),[p]),react.useEffect(()=>{d&&(c(""),g(0),requestAnimationFrame(()=>P.current?.focus()));},[d]),react.useEffect(()=>{let s=e(z=>{(z.metaKey||z.ctrlKey)&&z.key==="k"&&(z.preventDefault(),m(!d));},"handler");return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[d,m]);let E=react.useCallback(s=>{s.action?s.action():s.href&&(a?a(s.href,s.external):s.external?window.open(s.href,"_blank"):window.location.href=s.href),m(false);},[a,m]),R=react.useCallback(s=>{s.key==="ArrowDown"?(s.preventDefault(),g(z=>(z+1)%(N.length||1))):s.key==="ArrowUp"?(s.preventDefault(),g(z=>(z-1+(N.length||1))%(N.length||1))):s.key==="Enter"&&N[h]?(s.preventDefault(),E(N[h])):s.key==="Escape"&&m(false);},[N,h,E,m]);return react.useEffect(()=>{B.current?.querySelector(`[data-idx="${h}"]`)?.scrollIntoView({block:"nearest"});},[h]),d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:()=>m(false)}),jsxRuntime.jsx("div",{className:"fixed top-[15%] left-1/2 -translate-x-1/2 w-full max-w-xl z-[101]",children:jsxRuntime.jsxs("div",{className:"bg-[#111113] border border-white/[0.08] rounded-xl shadow-2xl overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-white/[0.07]",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),jsxRuntime.jsx("input",{ref:P,type:"text",value:p,onChange:s=>c(s.target.value),onKeyDown:R,placeholder:"Search commands...",className:"flex-1 bg-transparent text-white text-[13px] placeholder-white/30 outline-none"}),jsxRuntime.jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-white/[0.06] rounded text-white/30",children:"ESC"})]}),jsxRuntime.jsx("div",{ref:B,className:"max-h-[400px] overflow-y-auto py-1",children:N.length===0?jsxRuntime.jsxs("div",{className:"px-4 py-8 text-center text-white/30 text-[13px]",children:["No results for \u201C",p,"\u201D"]}):Object.entries(y).map(([s,z])=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"px-4 py-2 text-[10px] font-semibold text-white/25 uppercase tracking-widest",children:s}),z.map(O=>{let j=N.indexOf(O),G=j===h;return jsxRuntime.jsxs("button",{"data-idx":j,onClick:()=>E(O),onMouseEnter:()=>g(j),className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${G?"bg-white/[0.06] text-white":"text-white/50 hover:bg-white/[0.03]"}`,children:[O.icon&&jsxRuntime.jsx("span",{className:`w-5 h-5 flex items-center justify-center ${G?"text-white/70":"text-white/25"}`,children:O.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:"text-[13px] font-medium truncate block",children:O.title}),O.description&&jsxRuntime.jsx("span",{className:"text-[11px] text-white/25 truncate block",children:O.description})]}),G&&jsxRuntime.jsx("span",{className:"text-white/25 text-[11px]",children:"\u21B5"})]},O.id)})]},s))}),jsxRuntime.jsxs("div",{className:"px-4 py-2 border-t border-white/[0.07] flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-white/20",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2191"}),jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2193"}),"navigate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u21B5"}),"select"]})]}),jsxRuntime.jsx("span",{className:"text-[10px] text-white/20",children:"\u2318K"})]})]})})]}):null}e(ue,"HanzoCommandPalette");function ge(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ge,"Component");function ve(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ve,"Component");function be(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(be,"Component");function Ne(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ne,"Component");function ke(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ke,"Component");function Ce(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ce,"Component");function Se(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Se,"Component");function De(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(De,"Component");function Pe(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Pe,"Component");function Be(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Be,"Component");function Ie(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ie,"Component");function Ue(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ue,"Component");function $e(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e($e,"Component");function _e(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(_e,"Component");function Ze(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ze,"Component");function Ge(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ge,"Component");function We(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(We,"Component");function qe(){return jsxRuntime.jsx("div",{className:"flex items-center justify-center p-8",children:jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(qe,"Component");
|
|
3
|
+
exports.AIModelSelectorNavigationBar=ve;exports.AdvancedNavigationBar=ge;exports.AppSwitcher=_;exports.AppSwitcherNavigationBar=be;exports.BreadcrumbAndFiltersNavigationBar=Ne;exports.BreadcrumbNavigationBar=ke;exports.CenteredLogoNavigationBar=Ce;exports.CollaborationNavigationBar=Se;exports.CommunicationNavigationBar=De;exports.ContextSwitcherNavigationBar=Pe;exports.DEFAULT_HANZO_APPS=I;exports.DashboardNavigationBar=Be;exports.ECommerceNavigationBar=Ie;exports.HanzoCommandPalette=ue;exports.HanzoHeader=ce;exports.IconNavigationBar=Ue;exports.SearchAndToggleNavigationBar=$e;exports.SimpleNavigationBar=_e;exports.StatusDashboardNavigationBar=Ze;exports.TeamSwitcherNavigationBar=Ge;exports.TwoTierNavigationBar=We;exports.UnderlineNavigationBar=qe;exports.UserOrgDropdown=F;exports.useHanzoAuth=fe;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {useState,useRef,useEffect,useCallback}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var Ze=Object.defineProperty;var e=(o,i)=>Ze(o,"name",{value:i,configurable:true});function je({x:o,y:i,onClose:n}){let p=useRef(null);useEffect(()=>{let r=e(d=>{p.current&&!p.current.contains(d.target)&&n();},"handler"),u=e(d=>{d.key==="Escape"&&n();},"escape");return document.addEventListener("mousedown",r),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",u);}},[n]);let l=[{label:"Brand Guidelines",href:"https://hanzo.ai/brand"},{label:"Press Kit",href:"https://hanzo.ai/press"},{label:"Download Logo",href:"https://hanzo.ai/brand#download"},{label:"Copy SVG",action:"copy-svg"},{label:"hanzo.ai \u2192",href:"https://hanzo.ai"}],a='<svg viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="M22.21 67V44.6369H0V67H22.21Z" fill="#ffffff"/><path d="M0 44.6369L22.21 46.8285V44.6369H0Z" fill="#DDDDDD"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="#ffffff"/><path d="M22.21 0H0V22.3184H22.21V0Z" fill="#ffffff"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="#ffffff"/><path d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" fill="#DDDDDD"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="#ffffff"/></svg>';return jsxs("div",{ref:p,role:"menu",className:"fixed z-[9999] min-w-[180px] rounded-xl border border-white/[0.08] bg-[#111113] py-1.5 shadow-2xl shadow-black/60",style:{top:i,left:o},children:[jsx("div",{className:"border-b border-white/[0.06] px-3 pb-2 pt-1",children:jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-white/30",children:"Hanzo Brand"})}),l.map(r=>r.action==="copy-svg"?jsx("button",{type:"button",role:"menuitem",onClick:()=>{navigator.clipboard.writeText(a).catch(()=>{}),n();},className:"flex w-full items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors text-left",children:"Copy SVG"},"copy"):jsx("a",{href:r.href,role:"menuitem",target:r.href?.startsWith("https")?"_blank":void 0,rel:"noopener noreferrer",onClick:n,className:"flex items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors",children:r.label},r.label))]})}e(je,"BrandContextMenu");function J({size:o=22,className:i="",brandMenu:n=true,animate:p=true}){let[l,a]=useState(null),[r,u]=useState(false),d=useCallback(x=>{n&&(x.preventDefault(),a({x:x.clientX,y:x.clientY}));},[n]);return jsxs(Fragment,{children:[jsxs("svg",{width:o,height:o,viewBox:"0 0 67 67",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hanzo",className:i,style:p?{transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease",transform:r?"scale(1.12) perspective(80px) rotateY(-6deg)":"scale(1) perspective(80px) rotateY(0deg)",transformOrigin:"center center"}:{},onMouseEnter:()=>u(true),onMouseLeave:()=>u(false),onContextMenu:d,children:[jsx("path",{d:"M22.21 67V44.6369H0V67H22.21Z",fill:"#ffffff"}),jsx("path",{d:"M0 44.6369L22.21 46.8285V44.6369H0Z",fill:"#DDDDDD"}),jsx("path",{d:"M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",fill:"#ffffff"}),jsx("path",{d:"M22.21 0H0V22.3184H22.21V0Z",fill:"#ffffff"}),jsx("path",{d:"M66.7198 0H44.5098V22.3184H66.7198V0Z",fill:"#ffffff"}),jsx("path",{d:"M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z",fill:"#DDDDDD"}),jsx("path",{d:"M66.7198 67V44.6369H44.5098V67H66.7198Z",fill:"#ffffff"})]}),l&&jsx(je,{x:l.x,y:l.y,onClose:()=>a(null)})]})}e(J,"HanzoMark");var C=[{id:"account",label:"Account",href:"https://hanzo.id/account",description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:"https://billing.hanzo.ai",description:"Subscriptions & usage"},{id:"console",label:"Console",href:"https://console.hanzo.ai",description:"API keys & projects"},{id:"chat",label:"Chat",href:"https://chat.hanzo.ai",description:"AI chat & models"},{id:"platform",label:"Platform",href:"https://platform.hanzo.ai",description:"Deploy & scale services"}];function U({apps:o=C,currentAppId:i}){let[n,p]=useState(false),l=useRef(null);return useEffect(()=>{let a=e(r=>{l.current&&!l.current.contains(r.target)&&p(false);},"handler");return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]),jsxs("div",{ref:l,className:"relative",children:[jsx("button",{type:"button",onClick:()=>p(a=>!a),className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/40 hover:bg-white/[0.06] hover:text-white/70 transition-colors","aria-label":"Switch app",title:"Switch app",children:jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"1",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"1",y:"11",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"11",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"11",width:"4",height:"4",rx:"1"})]})}),n&&jsxs("div",{className:"absolute left-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] p-2 shadow-2xl",children:[jsx("p",{className:"px-2 pb-1.5 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Hanzo Apps"}),o.filter(a=>a.id!==i).map(a=>jsxs("a",{href:a.href,className:"flex flex-col gap-0.5 rounded-lg px-3 py-2.5 hover:bg-white/[0.06] transition-colors",onClick:()=>p(false),children:[jsx("span",{className:"text-[13px] font-medium text-white/80",children:a.label}),a.description&&jsx("span",{className:"text-[11px] text-white/30",children:a.description})]},a.id))]})]})}e(U,"AppSwitcher");function Xe({name:o,email:i}){let p=(o||i||"U").split(/[\s@._-]/).filter(Boolean).slice(0,2).map(l=>l[0].toUpperCase()).join("");return jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-neutral-800 text-[11px] font-semibold text-white/70",children:p})}e(Xe,"Initials");function R({user:o,organizations:i=[],currentOrgId:n,onOrgSwitch:p,onSignOut:l}){let[a,r]=useState(false),u=useRef(null);if(useEffect(()=>{let s=e(x=>{u.current&&!u.current.contains(x.target)&&r(false);},"handler");return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),!o)return null;i.find(s=>s.id===n);return jsxs("div",{ref:u,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>r(s=>!s),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-white/[0.06] transition-colors",children:[o.avatar?jsx("img",{src:o.avatar,alt:o.name||o.email,className:"h-7 w-7 rounded-full object-cover"}):jsx(Xe,{name:o.name,email:o.email}),jsxs("div",{className:"hidden flex-col items-start sm:flex",children:[o.name&&jsx("span",{className:"text-[12px] font-medium text-white/70 leading-none",children:o.name}),jsx("span",{className:"text-[11px] text-white/30 leading-none mt-0.5",children:o.email})]}),jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/30 hidden sm:block",children:jsx("path",{d:"M6 9l6 6 6-6"})})]}),a&&jsxs("div",{className:"absolute right-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] shadow-2xl",children:[jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[jsx("p",{className:"text-[13px] font-medium text-white/80",children:o.name||"User"}),jsx("p",{className:"text-[11px] text-white/40",children:o.email})]}),i.length>0&&jsxs("div",{className:"border-b border-white/[0.06] p-2",children:[jsx("p",{className:"px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Organizations"}),i.map(s=>jsxs("button",{type:"button",onClick:()=>{p?.(s.id),r(false);},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left hover:bg-white/[0.06] transition-colors",children:[jsx("span",{className:"text-[13px] text-white/70",children:s.name}),s.id===n&&jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/50",children:jsx("polyline",{points:"20 6 9 17 4 12"})})]},s.id))]}),jsxs("div",{className:"p-2",children:[jsx("a",{href:"https://hanzo.id/account",className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>r(false),children:"Account settings"}),jsx("a",{href:"https://billing.hanzo.ai",className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>r(false),children:"Billing"}),jsx("button",{type:"button",onClick:()=>{r(false),l?.();},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/40 hover:bg-white/[0.06] hover:text-red-400/70 transition-colors",children:"Sign out"})]})]})]})}e(R,"UserOrgDropdown");function X({currentApp:o,currentAppId:i,user:n,organizations:p,currentOrgId:l,onOrgSwitch:a,onSignOut:r,apps:u=C,headerRight:d}){return jsxs("header",{className:"sticky top-0 z-50 flex h-14 w-full items-center justify-between border-b border-white/[0.07] bg-[#09090b]/90 px-4 backdrop-blur-xl",role:"banner",children:[jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[jsx("a",{href:"https://hanzo.id/account",className:"flex-shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Hanzo Account",children:jsx(J,{size:22,brandMenu:true,animate:true})}),jsx("span",{className:"select-none text-white/[0.15]",children:"/"}),jsx("span",{className:"truncate text-[13px] font-medium text-white/50",children:o}),jsx(U,{apps:u,currentAppId:i})]}),jsxs("div",{className:"flex flex-shrink-0 items-center gap-2",children:[d,jsx(R,{user:n,organizations:p,currentOrgId:l,onOrgSwitch:a,onSignOut:r})]})]})}e(X,"HanzoHeader");var Q="hanzo-auth-token",F="hanzo-user",ee="hanzo-auth-expires",et="https://iam.hanzo.ai",tt={hanzo:{name:"Hanzo AI",slug:"hanzo"},lux:{name:"Lux Network",slug:"lux"},zoo:{name:"Zoo Labs",slug:"zoo"},pars:{name:"Pars",slug:"pars"}};function te(){let[o,i]=useState(void 0),[n,p]=useState([]),[l,a]=useState(void 0),[r,u]=useState(null),[d,s]=useState(true),x=useCallback(async()=>{try{let w=localStorage.getItem(Q),O=localStorage.getItem(ee);if(!w||O&&Date.now()>Number(O)){s(!1);return}u(w);let P=localStorage.getItem(F);if(P)try{let c=JSON.parse(P);c?.email&&i({id:c.id,name:c.displayName||c.name,email:c.email,avatar:c.avatar});}catch{}let I=await fetch(`${et}/api/userinfo`,{headers:{Authorization:`Bearer ${w}`}});if(I.ok){let c=await I.json(),A={id:c.sub||c.id,name:c.name||c.displayName,email:c.email,avatar:c.picture||c.avatar};i(A),localStorage.setItem(F,JSON.stringify(c));let N=(c.groups||[]).map(y=>{let S=y.toLowerCase().replace(/^\//,""),E=tt[S];return E?{id:S,name:E.name,slug:E.slug}:null}).filter(Boolean);N.length===0&&A.email&&N.push({id:"personal",name:"Personal",slug:"personal"}),p(N),a(N[0]?.id);}}catch{}finally{s(false);}},[]);useEffect(()=>{x();},[x]);let M=useCallback(()=>{localStorage.removeItem(Q),localStorage.removeItem(F),localStorage.removeItem(ee),window.location.href="https://hanzo.id";},[]),H=useCallback(w=>{a(w);},[]);return {user:o,organizations:n,currentOrgId:l,token:r,loading:d,signOut:M,switchOrg:H}}e(te,"useHanzoAuth");function ot(o,i){return o.filter(n=>n.id!==i).map(n=>({id:`app-${n.id}`,title:n.label,description:n.description,href:n.href,category:"Hanzo Apps",external:true,keywords:[n.id,n.label.toLowerCase()]}))}e(ot,"buildCrossAppCommands");function ne({commands:o=[],apps:i,currentAppId:n,open:p,onOpenChange:l,onNavigate:a}){var q;let[r,u]=useState(false),d=p??r,s=useCallback(t=>{l?l(t):u(t);},[l]),[x,M]=useState(""),[H,w]=useState(0),O=useRef(null),P=useRef(null),I=ot(i??C,n),c=[...o,...I],A=x.toLowerCase(),$=A?c.filter(t=>t.title.toLowerCase().includes(A)||t.description?.toLowerCase().includes(A)||t.keywords?.some(g=>g.includes(A))):c,N={};for(let t of $)(N[q=t.category]??(N[q]=[])).push(t);let y=Object.values(N).flat();useEffect(()=>w(0),[x]),useEffect(()=>{d&&(M(""),w(0),requestAnimationFrame(()=>O.current?.focus()));},[d]),useEffect(()=>{let t=e(g=>{(g.metaKey||g.ctrlKey)&&g.key==="k"&&(g.preventDefault(),s(!d));},"handler");return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[d,s]);let S=useCallback(t=>{t.action?t.action():t.href&&(a?a(t.href,t.external):t.external?window.open(t.href,"_blank"):window.location.href=t.href),s(false);},[a,s]),E=useCallback(t=>{t.key==="ArrowDown"?(t.preventDefault(),w(g=>(g+1)%(y.length||1))):t.key==="ArrowUp"?(t.preventDefault(),w(g=>(g-1+(y.length||1))%(y.length||1))):t.key==="Enter"&&y[H]?(t.preventDefault(),S(y[H])):t.key==="Escape"&&s(false);},[y,H,S,s]);return useEffect(()=>{P.current?.querySelector(`[data-idx="${H}"]`)?.scrollIntoView({block:"nearest"});},[H]),d?jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:()=>s(false)}),jsx("div",{className:"fixed top-[15%] left-1/2 -translate-x-1/2 w-full max-w-xl z-[101]",children:jsxs("div",{className:"bg-[#111113] border border-white/[0.08] rounded-xl shadow-2xl overflow-hidden",children:[jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-white/[0.07]",children:[jsx("svg",{className:"w-4 h-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),jsx("input",{ref:O,type:"text",value:x,onChange:t=>M(t.target.value),onKeyDown:E,placeholder:"Search commands...",className:"flex-1 bg-transparent text-white text-[13px] placeholder-white/30 outline-none"}),jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-white/[0.06] rounded text-white/30",children:"ESC"})]}),jsx("div",{ref:P,className:"max-h-[400px] overflow-y-auto py-1",children:y.length===0?jsxs("div",{className:"px-4 py-8 text-center text-white/30 text-[13px]",children:["No results for \u201C",x,"\u201D"]}):Object.entries(N).map(([t,g])=>jsxs("div",{children:[jsx("div",{className:"px-4 py-2 text-[10px] font-semibold text-white/25 uppercase tracking-widest",children:t}),g.map(z=>{let Z=y.indexOf(z),_=Z===H;return jsxs("button",{"data-idx":Z,onClick:()=>S(z),onMouseEnter:()=>w(Z),className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${_?"bg-white/[0.06] text-white":"text-white/50 hover:bg-white/[0.03]"}`,children:[z.icon&&jsx("span",{className:`w-5 h-5 flex items-center justify-center ${_?"text-white/70":"text-white/25"}`,children:z.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("span",{className:"text-[13px] font-medium truncate block",children:z.title}),z.description&&jsx("span",{className:"text-[11px] text-white/25 truncate block",children:z.description})]}),_&&jsx("span",{className:"text-white/25 text-[11px]",children:"\u21B5"})]},z.id)})]},t))}),jsxs("div",{className:"px-4 py-2 border-t border-white/[0.07] flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-4 text-[10px] text-white/20",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2191"}),jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2193"}),"navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u21B5"}),"select"]})]}),jsx("span",{className:"text-[10px] text-white/20",children:"\u2318K"})]})]})})]}):null}e(ne,"HanzoCommandPalette");function re(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(re,"Component");function ie(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ie,"Component");function pe(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(pe,"Component");function de(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(de,"Component");function me(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(me,"Component");function xe(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(xe,"Component");function ge(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ge,"Component");function we(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(we,"Component");function Ne(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ne,"Component");function He(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(He,"Component");function Ce(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ce,"Component");function Ae(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ae,"Component");function De(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(De,"Component");function Pe(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Pe,"Component");function Le(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Le,"Component");function Ie(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ie,"Component");function Ue(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ue,"Component");function Ve(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ve,"Component");
|
|
3
|
-
export{
|
|
2
|
+
import {useState,useRef,useEffect,useCallback,useMemo}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var Je=Object.defineProperty;var e=(o,t)=>Je(o,"name",{value:t,configurable:true});function tt({x:o,y:t,onClose:n}){let r=useRef(null);useEffect(()=>{let i=e(d=>{r.current&&!r.current.contains(d.target)&&n();},"handler"),f=e(d=>{d.key==="Escape"&&n();},"escape");return document.addEventListener("mousedown",i),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",f);}},[n]);let l=[{label:"Brand Guidelines",href:"https://hanzo.ai/brand"},{label:"Press Kit",href:"https://hanzo.ai/press"},{label:"Download Logo",href:"https://hanzo.ai/brand#download"},{label:"Copy SVG",action:"copy-svg"},{label:"hanzo.ai \u2192",href:"https://hanzo.ai"}],a='<svg viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="M22.21 67V44.6369H0V67H22.21Z" fill="#ffffff"/><path d="M0 44.6369L22.21 46.8285V44.6369H0Z" fill="#DDDDDD"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="#ffffff"/><path d="M22.21 0H0V22.3184H22.21V0Z" fill="#ffffff"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="#ffffff"/><path d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" fill="#DDDDDD"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="#ffffff"/></svg>';return jsxs("div",{ref:r,role:"menu",className:"fixed z-[9999] min-w-[180px] rounded-xl border border-white/[0.08] bg-[#111113] py-1.5 shadow-2xl shadow-black/60",style:{top:t,left:o},children:[jsx("div",{className:"border-b border-white/[0.06] px-3 pb-2 pt-1",children:jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-white/30",children:"Hanzo Brand"})}),l.map(i=>i.action==="copy-svg"?jsx("button",{type:"button",role:"menuitem",onClick:()=>{navigator.clipboard.writeText(a).catch(()=>{}),n();},className:"flex w-full items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors text-left",children:"Copy SVG"},"copy"):jsx("a",{href:i.href,role:"menuitem",target:i.href?.startsWith("https")?"_blank":void 0,rel:"noopener noreferrer",onClick:n,className:"flex items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors",children:i.label},i.label))]})}e(tt,"BrandContextMenu");function ae({size:o=22,className:t="",brandMenu:n=true,animate:r=true}){let[l,a]=useState(null),[i,f]=useState(false),d=useCallback(p=>{n&&(p.preventDefault(),a({x:p.clientX,y:p.clientY}));},[n]);return jsxs(Fragment,{children:[jsxs("svg",{width:o,height:o,viewBox:"0 0 67 67",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hanzo",className:t,style:r?{transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease",transform:i?"scale(1.12) perspective(80px) rotateY(-6deg)":"scale(1) perspective(80px) rotateY(0deg)",transformOrigin:"center center"}:{},onMouseEnter:()=>f(true),onMouseLeave:()=>f(false),onContextMenu:d,children:[jsx("path",{d:"M22.21 67V44.6369H0V67H22.21Z",fill:"#ffffff"}),jsx("path",{d:"M0 44.6369L22.21 46.8285V44.6369H0Z",fill:"#DDDDDD"}),jsx("path",{d:"M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",fill:"#ffffff"}),jsx("path",{d:"M22.21 0H0V22.3184H22.21V0Z",fill:"#ffffff"}),jsx("path",{d:"M66.7198 0H44.5098V22.3184H66.7198V0Z",fill:"#ffffff"}),jsx("path",{d:"M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z",fill:"#DDDDDD"}),jsx("path",{d:"M66.7198 67V44.6369H44.5098V67H66.7198Z",fill:"#ffffff"})]}),l&&jsx(tt,{x:l.x,y:l.y,onClose:()=>a(null)})]})}e(ae,"HanzoMark");var I=[{id:"account",label:"Account",href:"https://hanzo.id/account",description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:"https://billing.hanzo.ai",description:"Subscriptions & usage"},{id:"console",label:"Console",href:"https://console.hanzo.ai",description:"API keys & projects"},{id:"chat",label:"Chat",href:"https://hanzo.chat",description:"AI chat & models"},{id:"platform",label:"Platform",href:"https://platform.hanzo.ai",description:"Deploy & scale services"},{id:"storage",label:"Storage",href:"https://hanzo.space",description:"S3 object storage"}],A={hanzo:{id:"hanzo",iam:"https://hanzo.id",billing:"https://billing.hanzo.ai",console:"https://console.hanzo.ai",chat:"https://hanzo.chat",platform:"https://platform.hanzo.ai",storage:"https://hanzo.space",s3:"https://s3.hanzo.ai"},lux:{id:"lux",iam:"https://lux.id",billing:"https://billing.lux.network",console:"https://console.lux.network",chat:"https://chat.lux.network",platform:"https://platform.lux.network",storage:"https://storage.lux.network",s3:"https://s3.lux.network"},zoo:{id:"zoo",iam:"https://zoo.id",billing:"https://billing.zoo.ngo",console:"https://console.zoo.ngo",chat:"https://chat.zoo.ngo",platform:"https://platform.zoo.ngo",storage:"https://storage.zoo.ngo",s3:"https://s3.zoo.ngo"},pars:{id:"pars",iam:"https://pars.id",billing:"https://billing.pars.ai",console:"https://console.pars.ai",chat:"https://chat.pars.ai",platform:"https://platform.pars.ai",storage:"https://storage.pars.ai",s3:"https://s3.pars.ai"}};function W(o){let t=A[o]||A.hanzo;return [{id:"account",label:"Account",href:`${t.iam}/account`,description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:t.billing,description:"Subscriptions & usage"},{id:"console",label:"Console",href:t.console,description:"API keys & projects"},{id:"chat",label:"Chat",href:t.chat,description:"AI chat & models"},{id:"platform",label:"Platform",href:t.platform,description:"Deploy & scale services"},{id:"storage",label:"Storage",href:t.storage,description:"S3 object storage"}]}e(W,"getAppsForOrg");function _({apps:o=I,currentAppId:t}){let[n,r]=useState(false),l=useRef(null);return useEffect(()=>{let a=e(i=>{l.current&&!l.current.contains(i.target)&&r(false);},"handler");return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]),jsxs("div",{ref:l,className:"relative",children:[jsx("button",{type:"button",onClick:()=>r(a=>!a),className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/40 hover:bg-white/[0.06] hover:text-white/70 transition-colors","aria-label":"Switch app",title:"Switch app",children:jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"1",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"1",y:"11",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"11",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"11",width:"4",height:"4",rx:"1"})]})}),n&&jsxs("div",{className:"absolute left-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] p-2 shadow-2xl",children:[jsx("p",{className:"px-2 pb-1.5 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Hanzo Apps"}),o.filter(a=>a.id!==t).map(a=>jsxs("a",{href:a.href,className:"flex flex-col gap-0.5 rounded-lg px-3 py-2.5 hover:bg-white/[0.06] transition-colors",onClick:()=>r(false),children:[jsx("span",{className:"text-[13px] font-medium text-white/80",children:a.label}),a.description&&jsx("span",{className:"text-[11px] text-white/30",children:a.description})]},a.id))]})]})}e(_,"AppSwitcher");var st=["#0A0310","#49007E","#FF005B","#FF7D10","#FFB238"];function it(o){let t=0;for(let n=0;n<o.length;n++)t=(t<<5)-t+o.charCodeAt(n)|0;return Math.abs(t)}e(it,"hashStr");function M(o,t,n){return o%(t*(n+1))%t}e(M,"getUnit");function lt(o,t){return M(o,2,t)===0}e(lt,"getBoolean");function re(o,t,n){return n[M(o,n.length,t)]}e(re,"getRandomColor");function ct(o){let t=parseInt(o.slice(1,3),16),n=parseInt(o.slice(3,5),16),r=parseInt(o.slice(5,7),16);return t*.299+n*.587+r*.114>128?"#000":"#fff"}e(ct,"getContrast");function se({name:o,size:t=40,colors:n=st,className:r,square:l=false}){let a=it(o),i=re(a,0,n),f=ct(i),d=lt(a,2),m=M(a,3,7),p=M(a,5,8),c=M(a,10,9),h=c>6?c-10:c,g=M(a,5,10)>3?M(a,5,10)-5:M(a,5,10);return jsxs("svg",{viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,className:r,style:l?void 0:{borderRadius:"50%"},children:[jsx("mask",{id:`beam-${a}`,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36,children:jsx("rect",{width:36,height:36,rx:l?void 0:72,fill:"#fff"})}),jsxs("g",{mask:`url(#beam-${a})`,children:[jsx("rect",{width:36,height:36,fill:i}),jsx("rect",{x:0,y:0,width:36,height:36,transform:`translate(${h} ${g}) rotate(${c} 18 18)`,fill:re(a,1,n),rx:6}),jsxs("g",{transform:`translate(${h} ${g}) rotate(${c} 18 18)`,children:[d?jsx("path",{d:`M15 ${19+m}c2 1 4 1 6 0`,stroke:f,fill:"none",strokeLinecap:"round"}):jsx("path",{d:`M13 ${19+m}a1 .75 0 0 0 10 0`,fill:f}),jsx("rect",{x:14-p,y:14,width:1.5,height:2,rx:1,fill:f}),jsx("rect",{x:20+p,y:14,width:1.5,height:2,rx:1,fill:f})]})]})]})}e(se,"BeamAvatar");async function dt(o){let n=new TextEncoder().encode(o),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(l=>l.toString(16).padStart(2,"0")).join("")}e(dt,"sha256");function ft(o,t){let[n,r]=useState(null);return useMemo(()=>{if(!o){r(null);return}let l=o.trim().toLowerCase();dt(l).then(a=>{r(`https://www.gravatar.com/avatar/${a}?s=${t||80}&d=404`);});},[o,t]),n}e(ft,"useGravatarUrl");function ie({src:o,email:t,name:n,size:r=40,colors:l,className:a}){let[i,f]=useState(false),[d,m]=useState(false),p=ft(t,r*2),c=`rounded-full object-cover ${a||""}`,h={width:r,height:r};return o&&!i?jsx("img",{src:o,alt:n||t||"avatar",className:c,style:h,onError:()=>f(true)}):p&&!d?jsx("img",{src:p,alt:n||t||"avatar",className:c,style:h,onError:()=>m(true)}):jsx(se,{name:n||t||"user",size:r,colors:l,className:a})}e(ie,"UserAvatar");function F({user:o,organizations:t=[],currentOrgId:n,onOrgSwitch:r,onSignOut:l}){let[a,i]=useState(false),f=useRef(null);if(useEffect(()=>{let c=e(h=>{f.current&&!f.current.contains(h.target)&&i(false);},"handler");return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),!o)return null;let d=t.find(c=>c.id===n),m=d?.slug||"hanzo",p=A[m]||A.hanzo;return jsxs("div",{ref:f,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>i(c=>!c),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-white/[0.06] transition-colors",children:[jsx(ie,{src:o.avatar,email:o.email,name:o.name,size:28}),jsxs("div",{className:"hidden flex-col items-start sm:flex",children:[o.name&&jsx("span",{className:"text-[12px] font-medium text-white/70 leading-none",children:o.name}),jsx("span",{className:"text-[11px] text-white/30 leading-none mt-0.5",children:o.email})]}),jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/30 hidden sm:block",children:jsx("path",{d:"M6 9l6 6 6-6"})})]}),a&&jsxs("div",{className:"absolute right-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] shadow-2xl",children:[jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[jsx("p",{className:"text-[13px] font-medium text-white/80",children:o.name||"User"}),jsx("p",{className:"text-[11px] text-white/40",children:o.email}),d&&jsx("p",{className:"mt-0.5 text-[10px] font-medium text-white/25 uppercase tracking-wider",children:d.name})]}),t.length>0&&jsxs("div",{className:"border-b border-white/[0.06] p-2",children:[jsx("p",{className:"px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Organizations"}),t.map(c=>jsxs("button",{type:"button",onClick:()=>{r?.(c.id),i(false);},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left hover:bg-white/[0.06] transition-colors",children:[jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:"text-[13px] text-white/70",children:c.name}),c.role&&jsx("span",{className:"text-[10px] text-white/25 capitalize",children:c.role})]}),c.id===n&&jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/50",children:jsx("polyline",{points:"20 6 9 17 4 12"})})]},c.id))]}),jsxs("div",{className:"p-2",children:[jsx("a",{href:`${p.iam}/account`,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Account settings"}),jsx("a",{href:p.billing,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Billing"}),jsx("button",{type:"button",onClick:()=>{i(false),l?.();},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/40 hover:bg-white/[0.06] hover:text-red-400/70 transition-colors",children:"Sign out"})]})]})]})}e(F,"UserOrgDropdown");function xt({className:o}){return jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[jsx("path",{d:"M21 2v6h-6"}),jsx("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),jsx("path",{d:"M3 22v-6h6"}),jsx("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"})]})}e(xt,"HardRefreshIcon");function vt({className:o}){return jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:[jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),jsx("circle",{cx:"12",cy:"12",r:"3"})]})}e(vt,"SettingsIcon");async function wt(){try{if(localStorage.clear(),sessionStorage.clear(),document.cookie.split(";").forEach(o=>{let t=o.split("=")[0].trim();if(t){document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`,document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${location.hostname}`;let n=location.hostname.split(".");if(n.length>2){let r="."+n.slice(-2).join(".");document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${r}`;}}}),"caches"in window){let o=await caches.keys();await Promise.all(o.map(t=>caches.delete(t)));}if("serviceWorker"in navigator){let o=await navigator.serviceWorker.getRegistrations();await Promise.all(o.map(t=>t.unregister()));}if("indexedDB"in window&&indexedDB.databases)try{(await indexedDB.databases()).forEach(t=>{t.name&&indexedDB.deleteDatabase(t.name);});}catch{}}catch{}location.reload();}e(wt,"hardRefresh");function ce({currentApp:o,currentAppId:t,user:n,organizations:r,currentOrgId:l,onOrgSwitch:a,onSignOut:i,apps:f,headerRight:d,settingsHref:m,onSettingsClick:p,hideHardRefresh:c,hideSettings:h}){let[g,P]=useState(false),L=r?.find(N=>N.id===l)?.slug||"hanzo",u=f||W(L),H=A[L]||A.hanzo,$=useCallback(()=>{P(true),wt();},[]),y=useCallback(()=>{p?p():window.location.href=m||`${H.iam}/account`;},[p,m,H.iam]);return jsxs("header",{className:"sticky top-0 z-50 flex h-14 w-full items-center justify-between border-b border-white/[0.07] bg-[#09090b]/90 px-4 backdrop-blur-xl",role:"banner",children:[jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[jsx("a",{href:`${H.iam}/account`,className:"flex-shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Account",children:jsx(ae,{size:22,brandMenu:true,animate:true})}),jsx("span",{className:"select-none text-white/[0.15]",children:"/"}),jsx("span",{className:"truncate text-[13px] font-medium text-white/50",children:o}),jsx(_,{apps:u,currentAppId:t})]}),jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[d,!c&&jsx("button",{type:"button",onClick:$,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Hard refresh \u2014 clear all storage, cookies, cache and reload",title:"Hard refresh",children:jsx(xt,{className:g?"animate-spin":""})}),!h&&jsx("button",{type:"button",onClick:y,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Settings",title:"Settings",children:jsx(vt,{})}),jsx(F,{user:n,organizations:r,currentOrgId:l,onOrgSwitch:a,onSignOut:i})]})]})}e(ce,"HanzoHeader");var pe="hanzo-auth-token",Q="hanzo-user",de="hanzo-auth-expires",yt="https://iam.hanzo.ai",Nt={hanzo:{name:"Hanzo AI",slug:"hanzo"},lux:{name:"Lux Network",slug:"lux"},zoo:{name:"Zoo Labs",slug:"zoo"},pars:{name:"Pars",slug:"pars"}};function fe(){let[o,t]=useState(void 0),[n,r]=useState([]),[l,a]=useState(void 0),[i,f]=useState(null),[d,m]=useState(true),p=useCallback(async()=>{try{let g=localStorage.getItem(pe),P=localStorage.getItem(de);if(!g||P&&Date.now()>Number(P)){m(!1);return}f(g);let B=localStorage.getItem(Q);if(B)try{let u=JSON.parse(B);u?.email&&t({id:u.id,name:u.displayName||u.name,email:u.email,avatar:u.avatar});}catch{}let L=await fetch(`${yt}/api/userinfo`,{headers:{Authorization:`Bearer ${g}`}});if(L.ok){let u=await L.json(),H={id:u.sub||u.id,name:u.name||u.displayName,email:u.email,avatar:u.picture||u.avatar};t(H),localStorage.setItem(Q,JSON.stringify(u));let y=(u.groups||[]).map(N=>{let E=N.toLowerCase().replace(/^\//,""),R=Nt[E];return R?{id:E,name:R.name,slug:R.slug}:null}).filter(Boolean);y.length===0&&H.email&&y.push({id:"personal",name:"Personal",slug:"personal"}),r(y),a(y[0]?.id);}}catch{}finally{m(false);}},[]);useEffect(()=>{p();},[p]);let c=useCallback(()=>{localStorage.removeItem(pe),localStorage.removeItem(Q),localStorage.removeItem(de),window.location.href="https://hanzo.id";},[]),h=useCallback(g=>{a(g);},[]);return {user:o,organizations:n,currentOrgId:l,token:i,loading:d,signOut:c,switchOrg:h}}e(fe,"useHanzoAuth");function zt(o,t){return o.filter(n=>n.id!==t).map(n=>({id:`app-${n.id}`,title:n.label,description:n.description,href:n.href,category:"Hanzo Apps",external:true,keywords:[n.id,n.label.toLowerCase()]}))}e(zt,"buildCrossAppCommands");function ue({commands:o=[],apps:t,currentAppId:n,open:r,onOpenChange:l,onNavigate:a}){var oe;let[i,f]=useState(false),d=r??i,m=useCallback(s=>{l?l(s):f(s);},[l]),[p,c]=useState(""),[h,g]=useState(0),P=useRef(null),B=useRef(null),L=zt(t??I,n),u=[...o,...L],H=p.toLowerCase(),$=H?u.filter(s=>s.title.toLowerCase().includes(H)||s.description?.toLowerCase().includes(H)||s.keywords?.some(z=>z.includes(H))):u,y={};for(let s of $)(y[oe=s.category]??(y[oe]=[])).push(s);let N=Object.values(y).flat();useEffect(()=>g(0),[p]),useEffect(()=>{d&&(c(""),g(0),requestAnimationFrame(()=>P.current?.focus()));},[d]),useEffect(()=>{let s=e(z=>{(z.metaKey||z.ctrlKey)&&z.key==="k"&&(z.preventDefault(),m(!d));},"handler");return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[d,m]);let E=useCallback(s=>{s.action?s.action():s.href&&(a?a(s.href,s.external):s.external?window.open(s.href,"_blank"):window.location.href=s.href),m(false);},[a,m]),R=useCallback(s=>{s.key==="ArrowDown"?(s.preventDefault(),g(z=>(z+1)%(N.length||1))):s.key==="ArrowUp"?(s.preventDefault(),g(z=>(z-1+(N.length||1))%(N.length||1))):s.key==="Enter"&&N[h]?(s.preventDefault(),E(N[h])):s.key==="Escape"&&m(false);},[N,h,E,m]);return useEffect(()=>{B.current?.querySelector(`[data-idx="${h}"]`)?.scrollIntoView({block:"nearest"});},[h]),d?jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:()=>m(false)}),jsx("div",{className:"fixed top-[15%] left-1/2 -translate-x-1/2 w-full max-w-xl z-[101]",children:jsxs("div",{className:"bg-[#111113] border border-white/[0.08] rounded-xl shadow-2xl overflow-hidden",children:[jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-white/[0.07]",children:[jsx("svg",{className:"w-4 h-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),jsx("input",{ref:P,type:"text",value:p,onChange:s=>c(s.target.value),onKeyDown:R,placeholder:"Search commands...",className:"flex-1 bg-transparent text-white text-[13px] placeholder-white/30 outline-none"}),jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-white/[0.06] rounded text-white/30",children:"ESC"})]}),jsx("div",{ref:B,className:"max-h-[400px] overflow-y-auto py-1",children:N.length===0?jsxs("div",{className:"px-4 py-8 text-center text-white/30 text-[13px]",children:["No results for \u201C",p,"\u201D"]}):Object.entries(y).map(([s,z])=>jsxs("div",{children:[jsx("div",{className:"px-4 py-2 text-[10px] font-semibold text-white/25 uppercase tracking-widest",children:s}),z.map(O=>{let j=N.indexOf(O),G=j===h;return jsxs("button",{"data-idx":j,onClick:()=>E(O),onMouseEnter:()=>g(j),className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${G?"bg-white/[0.06] text-white":"text-white/50 hover:bg-white/[0.03]"}`,children:[O.icon&&jsx("span",{className:`w-5 h-5 flex items-center justify-center ${G?"text-white/70":"text-white/25"}`,children:O.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("span",{className:"text-[13px] font-medium truncate block",children:O.title}),O.description&&jsx("span",{className:"text-[11px] text-white/25 truncate block",children:O.description})]}),G&&jsx("span",{className:"text-white/25 text-[11px]",children:"\u21B5"})]},O.id)})]},s))}),jsxs("div",{className:"px-4 py-2 border-t border-white/[0.07] flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-4 text-[10px] text-white/20",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2191"}),jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2193"}),"navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u21B5"}),"select"]})]}),jsx("span",{className:"text-[10px] text-white/20",children:"\u2318K"})]})]})})]}):null}e(ue,"HanzoCommandPalette");function ge(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ge,"Component");function ve(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ve,"Component");function be(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(be,"Component");function Ne(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ne,"Component");function ke(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(ke,"Component");function Ce(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ce,"Component");function Se(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Se,"Component");function De(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(De,"Component");function Pe(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Pe,"Component");function Be(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Be,"Component");function Ie(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ie,"Component");function Ue(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ue,"Component");function $e(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e($e,"Component");function _e(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(_e,"Component");function Ze(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ze,"Component");function Ge(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(Ge,"Component");function We(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(We,"Component");function qe(){return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("p",{className:"text-muted-foreground",children:"Component coming soon"})})}e(qe,"Component");
|
|
3
|
+
export{ve as AIModelSelectorNavigationBar,ge as AdvancedNavigationBar,_ as AppSwitcher,be as AppSwitcherNavigationBar,Ne as BreadcrumbAndFiltersNavigationBar,ke as BreadcrumbNavigationBar,Ce as CenteredLogoNavigationBar,Se as CollaborationNavigationBar,De as CommunicationNavigationBar,Pe as ContextSwitcherNavigationBar,I as DEFAULT_HANZO_APPS,Be as DashboardNavigationBar,Ie as ECommerceNavigationBar,ue as HanzoCommandPalette,ce as HanzoHeader,Ue as IconNavigationBar,$e as SearchAndToggleNavigationBar,_e as SimpleNavigationBar,Ze as StatusDashboardNavigationBar,Ge as TeamSwitcherNavigationBar,We as TwoTierNavigationBar,qe as UnderlineNavigationBar,F as UserOrgDropdown,fe as useHanzoAuth};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.40",
|
|
4
4
|
"description": "Multi-framework UI library with React, Vue, Svelte, and React Native support. Based on shadcn/ui with comprehensive framework coverage.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -45,6 +45,29 @@
|
|
|
45
45
|
"sdk",
|
|
46
46
|
"ui"
|
|
47
47
|
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"lat": "npm show @hanzo/ui version",
|
|
50
|
+
"pub": "npm publish",
|
|
51
|
+
"tc": "tsc --project tsconfig.build.json",
|
|
52
|
+
"build": "npm run clean && npm run build:minimal && npm run tc",
|
|
53
|
+
"build:minimal": "tsup --config tsup.config.minimal.ts",
|
|
54
|
+
"build:namespaces": "tsup --config tsup.config.namespaces.ts",
|
|
55
|
+
"build:full": "tsup --config tsup.config.production.ts",
|
|
56
|
+
"build:frameworks": "npm run build",
|
|
57
|
+
"build:watch": "tsup --watch",
|
|
58
|
+
"build:check": "tsc --project tsconfig.build.json --noEmit",
|
|
59
|
+
"clean": "rm -rf dist",
|
|
60
|
+
"prepublishOnly": "npm run build",
|
|
61
|
+
"update-registry": "node ./bin/update-registry.js",
|
|
62
|
+
"registry:mcp": "node ./bin/cli.js registry:mcp",
|
|
63
|
+
"registry:mcp:http": "node ./bin/cli.js registry:mcp --http",
|
|
64
|
+
"analyze:frameworks": "node analyze-frameworks.js",
|
|
65
|
+
"test": "vitest",
|
|
66
|
+
"test:ui": "vitest --ui",
|
|
67
|
+
"test:coverage": "vitest --coverage",
|
|
68
|
+
"test:jest": "jest test/multi-framework.test.js",
|
|
69
|
+
"test:frameworks": "jest test/multi-framework.test.js --verbose"
|
|
70
|
+
},
|
|
48
71
|
"bin": {
|
|
49
72
|
"hanzo-ui": "./bin/cli.js"
|
|
50
73
|
},
|
|
@@ -491,6 +514,16 @@
|
|
|
491
514
|
"import": "./dist/pattern/*.mjs",
|
|
492
515
|
"require": "./dist/pattern/*.js"
|
|
493
516
|
},
|
|
517
|
+
"./auth": {
|
|
518
|
+
"types": "./dist/auth/index.d.ts",
|
|
519
|
+
"import": "./dist/auth/index.mjs",
|
|
520
|
+
"require": "./dist/auth/index.js"
|
|
521
|
+
},
|
|
522
|
+
"./auth/*": {
|
|
523
|
+
"types": "./dist/auth/*.d.ts",
|
|
524
|
+
"import": "./dist/auth/*.mjs",
|
|
525
|
+
"require": "./dist/auth/*.js"
|
|
526
|
+
},
|
|
494
527
|
"./navigation": {
|
|
495
528
|
"types": "./dist/navigation/index.d.ts",
|
|
496
529
|
"import": "./dist/navigation/index.mjs",
|
|
@@ -820,27 +853,5 @@
|
|
|
820
853
|
"tw-animate-css": "^1.2.9",
|
|
821
854
|
"typescript": "^5.9.3",
|
|
822
855
|
"vitest": "4.0.6"
|
|
823
|
-
},
|
|
824
|
-
"scripts": {
|
|
825
|
-
"lat": "npm show @hanzo/ui version",
|
|
826
|
-
"pub": "npm publish",
|
|
827
|
-
"tc": "tsc --project tsconfig.build.json",
|
|
828
|
-
"build": "npm run clean && npm run build:minimal && npm run tc",
|
|
829
|
-
"build:minimal": "tsup --config tsup.config.minimal.ts",
|
|
830
|
-
"build:namespaces": "tsup --config tsup.config.namespaces.ts",
|
|
831
|
-
"build:full": "tsup --config tsup.config.production.ts",
|
|
832
|
-
"build:frameworks": "npm run build",
|
|
833
|
-
"build:watch": "tsup --watch",
|
|
834
|
-
"build:check": "tsc --project tsconfig.build.json --noEmit",
|
|
835
|
-
"clean": "rm -rf dist",
|
|
836
|
-
"update-registry": "node ./bin/update-registry.js",
|
|
837
|
-
"registry:mcp": "node ./bin/cli.js registry:mcp",
|
|
838
|
-
"registry:mcp:http": "node ./bin/cli.js registry:mcp --http",
|
|
839
|
-
"analyze:frameworks": "node analyze-frameworks.js",
|
|
840
|
-
"test": "vitest",
|
|
841
|
-
"test:ui": "vitest --ui",
|
|
842
|
-
"test:coverage": "vitest --coverage",
|
|
843
|
-
"test:jest": "jest test/multi-framework.test.js",
|
|
844
|
-
"test:frameworks": "jest test/multi-framework.test.js --verbose"
|
|
845
856
|
}
|
|
846
|
-
}
|
|
857
|
+
}
|