@rizom/brain 0.2.0-alpha.843 → 0.2.0-alpha.845

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.
Files changed (27) hide show
  1. package/dist/brain.js +5 -5
  2. package/dist/chunks/{app-xwcj6nrj.js → app-9ca5jhcf.js} +2 -2
  3. package/dist/chunks/{index-p89e6rzz.js → index-5xrzkk86.js} +2 -2
  4. package/dist/chunks/{index-n3nbytk3.js → index-dwry26z1.js} +3 -3
  5. package/dist/chunks/{index-n3nbytk3.js.map → index-dwry26z1.js.map} +1 -1
  6. package/dist/chunks/{package-scqh3wsz.js → package-8hrrb634.js} +3 -3
  7. package/dist/chunks/{package-scqh3wsz.js.map → package-8hrrb634.js.map} +1 -1
  8. package/dist/model.js +4 -4
  9. package/dist/model.js.map +1 -1
  10. package/dist/testing.js +1 -1
  11. package/dist/ui/{studio-app-e1c11eddbeb196cb8afcdb54108bd5eeec2e207bb86aabb061720ac41586a76b.css → studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css} +2 -1
  12. package/dist/ui/{studio-app-mnzsgt8r.js → studio-app-njac86mm.js} +79 -79
  13. package/dist/ui/{studio-app-mnzsgt8r.js.map → studio-app-njac86mm.js.map} +5 -4
  14. package/dist/ui/studio-asset-manifest.json +13 -13
  15. package/dist/ui/studio-chunks/{account-view-5hn8fnzw.js → account-view-vd7r4j1h.js} +1 -1
  16. package/dist/ui/studio-chunks/main-172x0me8.js +4 -0
  17. package/dist/ui/studio-chunks/{main-zy0c7qnp.js.map → main-172x0me8.js.map} +4 -4
  18. package/dist/ui/studio-chunks/main-98w8qkfj.js +4 -0
  19. package/dist/ui/studio-chunks/{main-px4xemnw.js.map → main-98w8qkfj.js.map} +3 -3
  20. package/dist/ui/studio-chunks/{studio-chat-workspace-5pwyt1ja.js → studio-chat-workspace-rdge6t6n.js} +1 -1
  21. package/package.json +1 -1
  22. package/dist/ui/studio-chunks/main-px4xemnw.js +0 -4
  23. package/dist/ui/studio-chunks/main-zy0c7qnp.js +0 -4
  24. /package/dist/chunks/{app-xwcj6nrj.js.map → app-9ca5jhcf.js.map} +0 -0
  25. /package/dist/chunks/{index-p89e6rzz.js.map → index-5xrzkk86.js.map} +0 -0
  26. /package/dist/ui/studio-chunks/{account-view-5hn8fnzw.js.map → account-view-vd7r4j1h.js.map} +0 -0
  27. /package/dist/ui/studio-chunks/{studio-chat-workspace-5pwyt1ja.js.map → studio-chat-workspace-rdge6t6n.js.map} +0 -0
@@ -1,23 +1,27 @@
1
1
  {
2
2
  "version": 2,
3
3
  "entrypoints": {
4
- "script": "studio-app-mnzsgt8r.js",
5
- "stylesheet": "studio-app-e1c11eddbeb196cb8afcdb54108bd5eeec2e207bb86aabb061720ac41586a76b.css"
4
+ "script": "studio-app-njac86mm.js",
5
+ "stylesheet": "studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css"
6
6
  },
7
7
  "assets": {
8
- "studio-app-e1c11eddbeb196cb8afcdb54108bd5eeec2e207bb86aabb061720ac41586a76b.css": "studio-app-e1c11eddbeb196cb8afcdb54108bd5eeec2e207bb86aabb061720ac41586a76b.css",
9
- "studio-app-mnzsgt8r.js": "studio-app-mnzsgt8r.js",
10
- "studio-app-mnzsgt8r.js.map": "studio-app-mnzsgt8r.js.map",
11
- "studio-chunks/account-view-5hn8fnzw.js": "studio-chunks/account-view-5hn8fnzw.js",
12
- "studio-chunks/account-view-5hn8fnzw.js.map": "studio-chunks/account-view-5hn8fnzw.js.map",
8
+ "studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css": "studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css",
9
+ "studio-app-njac86mm.js": "studio-app-njac86mm.js",
10
+ "studio-app-njac86mm.js.map": "studio-app-njac86mm.js.map",
11
+ "studio-chunks/account-view-vd7r4j1h.js": "studio-chunks/account-view-vd7r4j1h.js",
12
+ "studio-chunks/account-view-vd7r4j1h.js.map": "studio-chunks/account-view-vd7r4j1h.js.map",
13
13
  "studio-chunks/chat-552ft422.js": "studio-chunks/chat-552ft422.js",
14
14
  "studio-chunks/chat-552ft422.js.map": "studio-chunks/chat-552ft422.js.map",
15
15
  "studio-chunks/highlighted-body-OFNGDK62-gd7z3cbz.js": "studio-chunks/highlighted-body-OFNGDK62-gd7z3cbz.js",
16
16
  "studio-chunks/highlighted-body-OFNGDK62-gd7z3cbz.js.map": "studio-chunks/highlighted-body-OFNGDK62-gd7z3cbz.js.map",
17
+ "studio-chunks/main-172x0me8.js": "studio-chunks/main-172x0me8.js",
18
+ "studio-chunks/main-172x0me8.js.map": "studio-chunks/main-172x0me8.js.map",
17
19
  "studio-chunks/main-1ad1b2wa.js": "studio-chunks/main-1ad1b2wa.js",
18
20
  "studio-chunks/main-1ad1b2wa.js.map": "studio-chunks/main-1ad1b2wa.js.map",
19
21
  "studio-chunks/main-3bfhgpcq.js": "studio-chunks/main-3bfhgpcq.js",
20
22
  "studio-chunks/main-3bfhgpcq.js.map": "studio-chunks/main-3bfhgpcq.js.map",
23
+ "studio-chunks/main-98w8qkfj.js": "studio-chunks/main-98w8qkfj.js",
24
+ "studio-chunks/main-98w8qkfj.js.map": "studio-chunks/main-98w8qkfj.js.map",
21
25
  "studio-chunks/main-dfmjnvb5.js": "studio-chunks/main-dfmjnvb5.js",
22
26
  "studio-chunks/main-dfmjnvb5.js.map": "studio-chunks/main-dfmjnvb5.js.map",
23
27
  "studio-chunks/main-jyhbh07e.js": "studio-chunks/main-jyhbh07e.js",
@@ -26,21 +30,17 @@
26
30
  "studio-chunks/main-nbfatnag.js.map": "studio-chunks/main-nbfatnag.js.map",
27
31
  "studio-chunks/main-pmfg03ry.js": "studio-chunks/main-pmfg03ry.js",
28
32
  "studio-chunks/main-pmfg03ry.js.map": "studio-chunks/main-pmfg03ry.js.map",
29
- "studio-chunks/main-px4xemnw.js": "studio-chunks/main-px4xemnw.js",
30
- "studio-chunks/main-px4xemnw.js.map": "studio-chunks/main-px4xemnw.js.map",
31
33
  "studio-chunks/main-qzww64vy.js": "studio-chunks/main-qzww64vy.js",
32
34
  "studio-chunks/main-qzww64vy.js.map": "studio-chunks/main-qzww64vy.js.map",
33
35
  "studio-chunks/main-wkp4g23f.js": "studio-chunks/main-wkp4g23f.js",
34
36
  "studio-chunks/main-wkp4g23f.js.map": "studio-chunks/main-wkp4g23f.js.map",
35
37
  "studio-chunks/main-wyzt8zma.js": "studio-chunks/main-wyzt8zma.js",
36
38
  "studio-chunks/main-wyzt8zma.js.map": "studio-chunks/main-wyzt8zma.js.map",
37
- "studio-chunks/main-zy0c7qnp.js": "studio-chunks/main-zy0c7qnp.js",
38
- "studio-chunks/main-zy0c7qnp.js.map": "studio-chunks/main-zy0c7qnp.js.map",
39
39
  "studio-chunks/mermaid-GHXKKRXX-72bpwfn8.js": "studio-chunks/mermaid-GHXKKRXX-72bpwfn8.js",
40
40
  "studio-chunks/mermaid-GHXKKRXX-72bpwfn8.js.map": "studio-chunks/mermaid-GHXKKRXX-72bpwfn8.js.map",
41
41
  "studio-chunks/studio-ask-panel-4anny620.js": "studio-chunks/studio-ask-panel-4anny620.js",
42
42
  "studio-chunks/studio-ask-panel-4anny620.js.map": "studio-chunks/studio-ask-panel-4anny620.js.map",
43
- "studio-chunks/studio-chat-workspace-5pwyt1ja.js": "studio-chunks/studio-chat-workspace-5pwyt1ja.js",
44
- "studio-chunks/studio-chat-workspace-5pwyt1ja.js.map": "studio-chunks/studio-chat-workspace-5pwyt1ja.js.map"
43
+ "studio-chunks/studio-chat-workspace-rdge6t6n.js": "studio-chunks/studio-chat-workspace-rdge6t6n.js",
44
+ "studio-chunks/studio-chat-workspace-rdge6t6n.js.map": "studio-chunks/studio-chat-workspace-rdge6t6n.js.map"
45
45
  }
46
46
  }
@@ -1,3 +1,3 @@
1
- import{$b as Le,Ub as c,Vb as o,Wb as d,Yb as me,Zb as $e,_b as Me,ac as ve,cc as we}from"./main-3bfhgpcq.js";import{fc as Ve,jc as ze,kc as Je}from"./main-px4xemnw.js";import{Bc as He,Dc as Ke,Ec as Ye,Ed as qe,Fc as M,Fd as ee,Gc as L,Tc as ke,Yc as X,Zc as A,_c as je,dd as H,ed as F,pc as x,rc as y,sc as J,vc as te,wd as Ce}from"./main-qzww64vy.js";import{ee as i}from"./main-dfmjnvb5.js";import{qf as ne}from"./main-nbfatnag.js";import{Yf as b}from"./main-1ad1b2wa.js";var K=b(ne(),1);var We=i.object({displayName:i.string(),role:i.enum(["admin","trusted","public"]),profileEntityId:i.string().optional(),passkeys:i.array(i.object({id:i.string(),transports:i.array(i.string()).optional(),credentialDeviceType:i.string().optional(),credentialBackedUp:i.boolean(),createdAt:i.number(),updatedAt:i.number()})),appPasswords:i.array(i.object({id:i.string(),username:i.string(),label:i.string(),access:i.enum(["read","write"]),createdAt:i.number(),expiresAt:i.number(),lastUsedAt:i.number().optional()})),connectedChannels:i.array(i.object({type:i.string(),label:i.string(),verifiedAt:i.number()})),pluginSettings:i.array(i.object({id:i.string(),title:i.string(),description:i.string().optional(),configured:i.boolean(),revision:i.number().nullable(),fields:i.array(i.object({name:i.string(),label:i.string(),control:i.enum(["text","url","number","checkbox"]),secret:i.boolean(),required:i.boolean(),value:i.union([i.string(),i.number(),i.boolean(),i.null()]).optional(),set:i.boolean().optional()}))})),sessions:i.array(i.object({id:i.string(),current:i.boolean(),createdAt:i.number(),expiresAt:i.number()}))});function Ge(e){return We.safeParse(e).success}var ge=i.custom(Ge,{message:"Invalid account response"}),ie=i.object({account:ge}),Ze=i.object({account:ge.optional(),appPassword:i.object({username:i.string(),password:i.string()}).optional(),revoked:i.object({sessions:i.number(),refreshTokens:i.number().optional()}).optional(),signedOut:i.boolean().optional()});function Qe(e){return Ze.safeParse(e).success}var Xe=i.custom(Qe,{message:"Invalid account mutation response"}),et=i.custom((e)=>{if(!X(e))return!1;return typeof e.challenge==="string"&&X(e.rp)&&X(e.user)&&Array.isArray(e.pubKeyCredParams)},{message:"Invalid passkey registration options"});class he extends Error{status;constructor(e,t){super(e);this.name="AccountApiError",this.status=t}}async function V(e,t){let n;try{n=await e.json()}catch{n={}}if(!e.ok){let a=typeof n==="object"&&n!==null&&"error"in n&&typeof n.error==="string"?n.error:"Account request failed";throw new he(a,e.status)}return t.parse(n)}function se(e){let t=e.replaceAll("-","+").replaceAll("_","/").padEnd(Math.ceil(e.length/4)*4,"=");return Uint8Array.from(atob(t),(n)=>n.charCodeAt(0)).buffer}function re(e){let t=new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return btoa(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function tt(e){return{challenge:se(e.challenge),rp:e.rp,user:{...e.user,id:se(e.user.id)},pubKeyCredParams:e.pubKeyCredParams,...e.timeout!==void 0?{timeout:e.timeout}:{},...e.excludeCredentials?{excludeCredentials:e.excludeCredentials.map((t)=>({...t,id:se(t.id)}))}:{},...e.authenticatorSelection?{authenticatorSelection:e.authenticatorSelection}:{},...e.attestation?{attestation:e.attestation}:{},...e.extensions?{extensions:e.extensions}:{}}}var nt=(e,t)=>fetch(e,t);class ce{fetchFn;constructor(e={}){this.fetchFn=e.fetch??nt}async fetchAccount(){return(await V(await this.fetchFn("/auth/account",{credentials:"same-origin",cache:"no-store"}),ie)).account}async mutatePluginSettings(e){return(await V(await this.fetchFn("/auth/account/plugin-settings",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ie)).account}async mutateAccount(e){return V(await this.fetchFn("/auth/account/mutations",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xe)}async registerPasskey(){let e=await V(await this.fetchFn("/auth/account/passkeys/options",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}"}),et),t=await navigator.credentials.create({publicKey:tt(e)});if(!(t instanceof PublicKeyCredential))throw Error("Passkey registration was cancelled");if(!(t.response instanceof AuthenticatorAttestationResponse))throw Error("Authenticator returned an invalid passkey response");let n=t.response,a={id:t.id,rawId:re(t.rawId),type:t.type,...t.authenticatorAttachment?{authenticatorAttachment:t.authenticatorAttachment}:{},clientExtensionResults:t.getClientExtensionResults(),response:{clientDataJSON:re(n.clientDataJSON),attestationObject:re(n.attestationObject),transports:typeof n.getTransports==="function"?n.getTransports():[]}};return(await V(await this.fetchFn("/auth/account/passkeys/verify",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),ie.extend({verified:i.literal(!0)}))).account}}function ye(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map((t)=>t.slice(0,1).toUpperCase()).join("")}function Ae(e,t){let n=t.indexOf("/");if(n<=0||n===t.length-1)return;let a=t.slice(0,n),s=t.slice(n+1);return`${e==="/"?"":e.replace(/\/+$/,"")}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`}function j(e,t=!1){return new Date(t?e:e*1000).toISOString()}var R=b(x(),1);function z(e){return R.jsxDEV(y,{variant:e.tone==="danger"?"danger":e.tone==="primary"?"primary":"outline",type:e.type??"button",onClick:e.onClick,disabled:e.disabled,children:e.children},void 0,!1,void 0,this)}function U(e){return R.jsxDEV("div",{className:o("account-access-item",c.access),children:[R.jsxDEV(ve,{density:"comfortable",title:e.kind,description:e.description,metadata:e.metadata??[]},void 0,!1,void 0,this),e.action]},void 0,!0,void 0,this)}function C(e){return R.jsxDEV("section",{className:o("account-detail-section",c.section),children:[R.jsxDEV("div",{className:"account-section-label",children:[R.jsxDEV("h3",{className:o("",c.heading,ee.section,e.titleHidden===!0&&c.headingHidden),children:e.title},void 0,!1,void 0,this),e.description?R.jsxDEV("p",{className:o("",c.description),children:e.description},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),R.jsxDEV("div",{className:o("people-stack",c.stack),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function be(e,t){let n=Object.fromEntries(t.entries());for(let a of e)if(a.control==="checkbox")n[a.name]=t.has(a.name);else if(a.control==="number"&&typeof n[a.name]==="string"&&n[a.name]!=="")n[a.name]=Number(n[a.name]);return n}function Se(e){if(e.secret)return"password";if(e.control==="url"||e.control==="number")return e.control;return"text"}var r=b(x(),1);function Ne(e){let{account:t,actions:n,title:a,studioPath:s}=e,g=t.role,h=t.profileEntityId?Ae(s,t.profileEntityId):void 0;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV(C,{title:"Profile",titleHidden:!0,children:[r.jsxDEV("div",{className:o("account-identity",c.identity),children:r.jsxDEV("div",{className:o("people-detail-person",c.person),children:[r.jsxDEV("span",{className:o("people-avatar people-avatar--large",c.avatar),children:ye(a)},void 0,!1,void 0,this),r.jsxDEV("span",{className:o("",c.personCopy),children:[r.jsxDEV("span",{className:o("people-detail-name",c.name,ee.secondaryDisplay),children:a},void 0,!1,void 0,this),r.jsxDEV("span",{"data-account-role":g,className:o("account-role",c.role),children:ke(g)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),t.profileEntityId?r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("account-profile-note",c.description),children:"Managed by the Anchor profile — your account name follows the published profile."},void 0,!1,void 0,this),r.jsxDEV(U,{kind:"Anchor profile",description:a,action:h?r.jsxDEV(y,{asChild:!0,variant:"link",children:r.jsxDEV("a",{href:h,children:"Edit Anchor Profile →"},void 0,!1,void 0,this)},void 0,!1,void 0,this):void 0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(O)=>{O.preventDefault(),n.saveName()},children:[r.jsxDEV("label",{className:o("",c.formLabel),htmlFor:"display-name",children:"Display name"},void 0,!1,void 0,this),r.jsxDEV(J,{id:"display-name",maxLength:200,autoComplete:"name",required:!0,value:n.displayName,onChange:(O)=>n.setDisplayName(O.target.value)},void 0,!1,void 0,this),r.jsxDEV(z,{type:"submit",disabled:n.busy,children:"Save name"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV("p",{className:o("",c.description),children:"Your role controls access to this brain. An administrator manages access in Administration."},void 0,!1,void 0,this),g==="admin"&&r.jsxDEV(y,{asChild:!0,variant:"outline",children:r.jsxDEV("a",{href:Ce(s,"admin:administration"),children:"Manage people in Administration →"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Te(e){let t=e.account.connectedChannels;return r.jsxDEV(C,{title:"Linked identities",titleHidden:!0,description:"How this brain recognizes messages from you. These are your identities, not services configured for the whole brain.",children:t.length===0?r.jsxDEV("p",{className:o("people-empty",c.empty),children:"No linked identities."},void 0,!1,void 0,this):t.map((n)=>r.jsxDEV(U,{kind:n.type,description:n.label,metadata:[`Verified: ${j(n.verifiedAt,!0)}`]},`${n.type}:${n.label}`,!1,void 0,this))},void 0,!1,void 0,this)}function Pe(e){let{account:t,actions:n}=e;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("",c.description),children:"Settings for your account only. These do not configure shared services for the brain."},void 0,!1,void 0,this),t.pluginSettings.map((a)=>r.jsxDEV(we,{label:a.title,density:"comfortable",presentation:"disclosure",children:[r.jsxDEV("p",{className:o("account-settings-description",c.description),children:a.description??"Private settings for this account."},void 0,!1,void 0,this),r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(s)=>{s.preventDefault(),n.saveSettings(a,new FormData(s.currentTarget))},children:[a.fields.map((s)=>r.jsxDEV("label",{htmlFor:`setting-${a.id}-${s.name}`,className:o("",c.field),children:[r.jsxDEV("span",{className:o("",c.formLabel),children:s.label},void 0,!1,void 0,this),s.control==="checkbox"?r.jsxDEV(te,{id:`setting-${a.id}-${s.name}`,name:s.name,defaultChecked:s.value===!0},void 0,!1,void 0,this):r.jsxDEV(J,{id:`setting-${a.id}-${s.name}`,name:s.name,type:Se(s),required:s.required&&(!a.configured||s.secret)&&!s.set,defaultValue:s.secret?"":typeof s.value==="string"||typeof s.value==="number"?s.value:"",placeholder:s.secret&&s.set?"Stored — leave blank to keep":void 0,autoComplete:"off"},void 0,!1,void 0,this)]},s.name,!0,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:[r.jsxDEV(z,{type:"submit",tone:"primary",disabled:n.busy,children:"Save settings"},void 0,!1,void 0,this),a.configured?r.jsxDEV(y,{variant:"danger",disabled:n.busy,type:"button",onClick:()=>n.removeSettings(a),children:"Remove"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},`${a.id}:${a.revision??"unset"}`,!0,void 0,this)]},a.id,!0,void 0,this))]},void 0,!0,void 0,this)}function xe(e){let{account:t,actions:n}=e,{busy:a}=n;return r.jsxDEV("div",{className:o("",c.column),children:[r.jsxDEV(C,{title:"Sign-in",description:"Passkeys used to access this account. Your final passkey is protected from revocation.",children:[t.passkeys.map((s)=>r.jsxDEV(U,{kind:s.credentialBackedUp?"Synced passkey":"Device passkey",metadata:[`Added: ${j(s.createdAt,!0)}`],action:t.passkeys.length>1?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokePasskey(s.id),children:"Revoke"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:r.jsxDEV(y,{variant:"outline",disabled:a,type:"button",onClick:n.addPasskey,children:"Add passkey"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV(C,{title:"Signed-in sessions",children:t.sessions.map((s)=>r.jsxDEV(U,{kind:s.current?"This session":"Browser session",metadata:[`Started: ${j(s.createdAt)}`,...s.current?["Current browser"]:[]],action:!s.current?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokeSession(s.id),children:"End"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this))},void 0,!1,void 0,this),r.jsxDEV("footer",{className:o("account-session-actions",c.footer),children:[r.jsxDEV("small",{children:"Access changes require an Admin."},void 0,!1,void 0,this),r.jsxDEV("div",{className:o("",c.actions),children:[r.jsxDEV(z,{disabled:a||t.sessions.every((s)=>s.current),onClick:n.revokeOtherSessions,children:"End other sessions"},void 0,!1,void 0,this),r.jsxDEV(z,{tone:"danger",disabled:a,onClick:n.revokeAllSessions,children:"Sign out everywhere"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ee=b(ne(),1);function de(e){return new URL(e).host.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function le(e){return JSON.stringify(e,null,2)}function Oe(e,t,n){return["Already have servers there? Add only the ",{code:`"${n}"`}," entry inside ",{code:`"${t}"`},` of ${e}.`]}function Re(e){let t=de(e),n="Sign in with your passkey when asked.";return[{id:"claude",group:"primary",name:"Claude",note:["Desktop app and claude.ai."],steps:[["Open Settings → Connectors → Add custom connector."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when asked."]]},{id:"chatgpt",group:"primary",name:"ChatGPT",steps:[["Open Settings → Apps & Connectors → Advanced and turn on Developer mode."],["Choose Create, name it ",{code:t},", paste your brain’s address and pick OAuth."],["Sign in with your passkey when asked."]]},{id:"claude-code",group:"developer",name:"Claude Code",lead:[["Add the server in your terminal:"]],snippet:{label:"Claude Code command",code:`claude mcp add --transport http ${t} ${e}`},after:[["Then start Claude Code, run ",{code:"/mcp"},", choose ",{code:t}," and sign in with your passkey."]]},{id:"cursor",group:"developer",name:"Cursor",steps:[["Open Cursor Settings → MCP → Add new global MCP server."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when Cursor asks."]],lead:[["Or add it to ",{code:"~/.cursor/mcp.json"},":"]],snippet:{label:"Cursor configuration",code:le({mcpServers:{[t]:{url:e}}})},after:[Oe("the file","mcpServers",t)]},{id:"vscode",group:"developer",name:"VS Code",steps:[["Open the Command Palette and run ",{code:"MCP: Add Server"},"."],["Choose HTTP, paste your brain’s address and name it ",{code:t},"."],["Choose Global, then sign in with your passkey when asked."]],lead:[["Or run ",{code:"MCP: Open User Configuration"}," and add:"]],snippet:{label:"VS Code configuration",code:le({servers:{[t]:{type:"http",url:e}}})},after:[Oe("your user configuration","servers",t)]},{id:"other",group:"developer",name:"Any other MCP client",inlineName:"any other MCP client",note:["Look for “add MCP server”, “connector” or “integration” in the tool’s settings and fill in:"],fields:[{label:"Name",value:[{code:t}]},{label:"Type",value:["Remote server, Streamable HTTP — not stdio, not SSE"]},{label:"URL",value:[{code:e}]},{label:"Authentication",value:["OAuth. Leave API key, token, client ID and secret empty; the tool registers itself."]}],lead:[["When you connect, your browser opens “Authorize <tool>?” on your brain. Approve MCP access with your passkey. The tool then has two tools: ",{code:"chat"},", to ask your brain anything as you would in chat, and ",{code:"confirm"},", to approve changes when the brain asks."],["Tool only takes local (stdio) servers, or insists on an API key? Bridge it with ",{code:"mcp-remote"},", which handles the sign-in:"]],snippet:{label:"mcp-remote bridge configuration",code:le({mcpServers:{[t]:{command:"npx",args:["-y","mcp-remote",e]}}})}}]}var u=b(x(),1);function W(e){return u.jsxDEV(u.Fragment,{children:e.text.map((t,n)=>typeof t==="string"?t:u.jsxDEV("code",{className:o("",d.code),children:t.code},n,!1,void 0,this))},void 0,!1,void 0,this)}function _(e){let[t,n]=Ee.useState("idle"),a=async()=>{try{await navigator.clipboard.writeText(e.code),n("copied")}catch{n("unavailable")}};return u.jsxDEV("div",{className:o("ai-tools-snippet",d.snippet),children:[u.jsxDEV("pre",{className:o("",d.snippetCode),"aria-label":e.label,children:e.code},void 0,!1,void 0,this),u.jsxDEV(y,{variant:"outline",size:"sm",onClick:()=>void a(),"aria-label":`Copy ${e.label}`,children:t==="copied"?"Copied":t==="unavailable"?"Select to copy":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function G(e){let{client:t}=e;return u.jsxDEV("article",{className:o("ai-tools-client",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:t.name},void 0,!1,void 0,this),t.note?u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:t.note},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,t.steps?u.jsxDEV("ol",{className:o("",d.steps),children:t.steps.map((n,a)=>u.jsxDEV("li",{children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},a,!1,void 0,this))},void 0,!1,void 0,this):null,t.fields?u.jsxDEV("dl",{className:o("",d.fields),children:t.fields.map((n)=>u.jsxDEV("div",{className:o("",d.field),children:[u.jsxDEV("dt",{className:o("",d.fieldLabel),children:n.label},void 0,!1,void 0,this),u.jsxDEV("dd",{className:o("",d.fieldValue),children:u.jsxDEV(W,{text:n.value},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},n.label,!0,void 0,this))},void 0,!1,void 0,this):null,t.lead?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`lead-${a}`,!1,void 0,this)),t.snippet?u.jsxDEV(_,{...t.snippet},void 0,!1,void 0,this):null,t.after?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`after-${a}`,!1,void 0,this))]},void 0,!0,void 0,this)}function ot(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function De(e){let t=Re(e.mcpUrl),n=t.filter((s)=>s.group==="primary"),a=t.filter((s)=>s.group==="developer");return u.jsxDEV(C,{title:"AI tools",description:"Connect AI tools you already use to this brain. A connected tool talks to the brain as you do in chat — asking, saving and updating within your access — after you sign in with your passkey.",children:[u.jsxDEV("article",{className:o("ai-tools-address",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s address"},void 0,!1,void 0,this),u.jsxDEV(_,{label:"brain address",code:e.mcpUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients),children:n.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this),u.jsxDEV("details",{className:o("ai-tools-developer",d.developer),children:[u.jsxDEV("summary",{className:o("",d.developerSummary),children:["Developer tools and other clients",u.jsxDEV("span",{className:o("",d.developerHint),children:ot(a.map((s)=>s.inlineName??s.name))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients,d.developerClients),children:a.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Z=b(ne(),1);var ue="Enter the username and password of an app password from this page.";function Ie(e){let t=new URL(e),n=`${t.protocol==="https:"?"davs":"dav"}://${t.host}${t.pathname}`,a=de(e);return[{id:"macos",group:"file-manager",name:"macOS",note:["Finder, on any Mac."],steps:[["In Finder, choose Go → Connect to Server (⌘K)."],["Paste the address below and click Connect."],["Choose Registered User. ",ue]],snippet:{label:"macOS address",code:e}},{id:"windows",group:"file-manager",name:"Windows",note:["File Explorer, on Windows 10 and 11."],steps:[["In File Explorer, open This PC and choose Map network drive."],["Paste the address below as the folder, tick Connect using different credentials, and click Finish."],[ue]],snippet:{label:"Windows address",code:e}},{id:"gnome-files",group:"file-manager",name:"GNOME Files",note:["The file manager on Ubuntu, Fedora and other GNOME desktops."],steps:[["Open Files → Other Locations (or Network)."],["Under Connect to Server, enter the address below and connect."],[ue]],snippet:{label:"GNOME Files address",code:n}},{id:"rclone",group:"command-line",name:"rclone",note:["Linux, macOS and Windows, from a terminal."],lead:[["Store the drive as a remote, with your app password’s username and password:"]],snippet:{label:"rclone remote command",code:`rclone config create ${a} webdav url=${e} vendor=other user=YOUR_USERNAME pass=YOUR_PASSWORD --obscure`},after:[["Then mount it on an empty folder: ",{code:`rclone mount ${a}: ~/Brain --vfs-cache-mode writes`},"."]]}]}var l=b(x(),1),oe="app-password-label",Ue="app-password-write";function pe(e){return j(e).slice(0,10)}function at(e,t){return[`Created: ${pe(e.createdAt)}`,`${e.expiresAt<=t?"Expired":"Expires"}: ${pe(e.expiresAt)}`,e.lastUsedAt===void 0?"Never used":`Last used: ${pe(e.lastUsedAt)}`]}function Fe(e){let{account:t,actions:n,connect:a}=e,{busy:s,createdAppPassword:g}=n,[h,O]=Z.useState(void 0),v=a!==void 0&&h!==void 0?$e(g,h,t.appPasswords,me(a)):null;Z.useEffect(()=>{if(a&&v)Me(a,v)},[a,v]);let N=Math.floor(Date.now()/1000),[T,S]=Z.useState(!1),D=Ie(e.davUrl),I=D.filter((f)=>f.group==="file-manager"),E=D.filter((f)=>f.group==="command-line");return l.jsxDEV("div",{className:o("",c.column),children:[l.jsxDEV(C,{title:"Drive",description:"Mount this brain as a network drive. It shows the notes, posts and files you can see here, as folders and files, to open and edit on your computer.",children:[a?l.jsxDEV(Le,{connect:a,created:v,busy:s||h!==void 0&&v===null,onConnect:()=>{O(g?.username??null),n.createAppPassword(me(a),"write")}},void 0,!1,void 0,this):null,l.jsxDEV("article",{className:o("drive-address",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s drive address"},void 0,!1,void 0,this),l.jsxDEV(_,{label:"drive address",code:e.davUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"App passwords",description:"A mount signs in with an app password instead of your passkey. It works only for the drive, expires after a year and can be revoked here. It can only read unless you allow saving changes.",children:[g&&g!==v?l.jsxDEV("article",{"data-app-password-reveal":!0,className:o("drive-reveal",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your new app password"},void 0,!1,void 0,this),l.jsxDEV("p",{className:o("",d.text),children:"Copy both now. The password is shown only once."},void 0,!1,void 0,this),l.jsxDEV(_,{label:"username",code:g.username},void 0,!1,void 0,this),l.jsxDEV(_,{label:"password",code:g.password},void 0,!1,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",type:"button",onClick:n.dismissCreatedAppPassword,children:"Done"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,t.appPasswords.length===0?l.jsxDEV("p",{className:o("",d.text),children:"No app passwords yet."},void 0,!1,void 0,this):t.appPasswords.map((f)=>l.jsxDEV(U,{kind:f.label,description:`${f.username} · ${f.access==="write"?"Read and write":"Read-only"}`,metadata:at(f,N),action:l.jsxDEV(y,{variant:"danger",disabled:s,type:"button",onClick:()=>n.revokeAppPassword(f.id),children:"Revoke"},void 0,!1,void 0,this)},f.id,!1,void 0,this)),l.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(f)=>{f.preventDefault();let Y=f.currentTarget,P=String(new FormData(Y).get(oe)??"");if(P.trim()==="")return;n.createAppPassword(P.trim(),T?"write":"read"),Y.reset(),S(!1)},children:[l.jsxDEV("label",{htmlFor:oe,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Name it after the computer it is for"},void 0,!1,void 0,this),l.jsxDEV(J,{id:oe,name:oe,type:"text",required:!0,maxLength:100,placeholder:"Laptop",autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("label",{htmlFor:Ue,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Allow saving changes"},void 0,!1,void 0,this),l.jsxDEV(te,{id:Ue,"aria-label":"Allow saving changes",checked:T,onCheckedChange:S},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",disabled:s,type:"submit",children:"New app password"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"Use it in Obsidian",description:"Keep an Obsidian vault on your computer in step with your brain. Obsidian stays fast and works offline; notes and images sync in the background.",children:l.jsxDEV("article",{className:o("drive-obsidian",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Rizom Brain"},void 0,!1,void 0,this),l.jsxDEV("ol",{className:o("",d.steps),children:[l.jsxDEV("li",{children:"Install the Rizom Brain plugin in Obsidian and turn it on."},void 0,!1,void 0,this),l.jsxDEV("li",{children:["In its settings, enter your brain’s address:"," ",l.jsxDEV("code",{children:new URL(e.davUrl).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("li",{children:"Choose Connect, and confirm on the page that opens here."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),l.jsxDEV(C,{title:"Connect your computer",description:"Use your computer’s own file manager. The brain then appears as a drive beside your other folders.",children:[l.jsxDEV("div",{className:o("drive-clients",d.clients),children:I.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this),l.jsxDEV("details",{className:o("drive-command-line",d.developer),children:[l.jsxDEV("summary",{className:o("",d.developerSummary),children:["Command line",l.jsxDEV("span",{className:o("",d.developerHint),children:E.map((f)=>f.name).join(", ")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("drive-command-line-clients",d.clients,d.developerClients),children:E.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var w=b(ne(),1);var ae={revokePasskey:{title:"Revoke this passkey?",message:"You will not be able to use this passkey again.",confirmLabel:"Revoke passkey",pending:"Revoking passkey…",complete:"Passkey revoked."},revokeSession:{title:"End this browser session?",message:"That browser will need a passkey to sign in again.",confirmLabel:"End session",pending:"Ending session…",complete:"Session ended."},revokeAppPassword:{title:"Revoke this app password?",message:"Anything mounted with it stops working at once. Its password cannot be recovered.",confirmLabel:"Revoke app password",pending:"Revoking app password…",complete:"App password revoked."},revokeOtherSessions:{title:"End every other browser session?",message:"Your current browser will remain signed in.",confirmLabel:"End other sessions",pending:"Ending other sessions…",complete:"Other sessions ended."}};function Be(e){return je(e,"Account request failed")}function _e(e){let{client:t,initialAccount:n}=e,[a,s]=w.useState(n),[g,h]=w.useState(n?.displayName??e.initialDisplayName),[O,v]=w.useState(""),[N,T]=w.useState(!1),[S,D]=w.useState(!1),[I,E]=w.useState(null),[f,Y]=w.useState(null);w.useEffect(()=>{if(n)return;let p=!1;return t.fetchAccount().then((k)=>{if(p)return;s(k),h(k.displayName)}).catch((k)=>{if(p)return;T(!0),v(Be(k))}),()=>{p=!0}},[t,n]);let P=w.useCallback(async(p,k,B)=>{D(!0),T(!1),v(p);try{let q=await B();if(q)s(q),h(q.displayName);v(k)}catch(q){T(!0),v(Be(q))}finally{D(!1)}},[]),fe=async(p)=>(await t.mutateAccount(p)).account,Q=(p,k)=>E({title:p.title,message:p.message,confirmLabel:p.confirmLabel,action:()=>{P(p.pending,p.complete,()=>fe(k))}});return{account:a,displayName:g,setDisplayName:h,status:O,error:N,busy:S,confirmation:I,cancelConfirmation:()=>E(null),confirm:()=>{if(!I)return;E(null),I.action()},saveName:()=>{P("Saving…","Display name updated.",()=>fe({action:A.updateDisplayName,confirmation:A.updateDisplayName,displayName:g}))},addPasskey:()=>{P("Waiting for your authenticator…","Passkey added.",()=>t.registerPasskey())},revokePasskey:(p)=>Q(ae.revokePasskey,{action:A.revokePasskey,confirmation:A.revokePasskey,credentialId:p}),revokeSession:(p)=>Q(ae.revokeSession,{action:A.revokeSession,confirmation:A.revokeSession,sessionId:p}),revokeOtherSessions:()=>Q(ae.revokeOtherSessions,{action:A.revokeOtherSessions,confirmation:A.revokeOtherSessions}),revokeAllSessions:()=>E({title:"Sign out everywhere?",message:"This ends every session, including this one. You will need your passkey to return.",confirmLabel:"Sign out everywhere",action:()=>{P("Signing out everywhere…","Signed out.",async()=>{await t.mutateAccount({action:A.revokeAllSessions,confirmation:A.revokeAllSessions}),window.location.assign(`/login?return_to=${encodeURIComponent(e.routePath)}`);return})}}),saveSettings:(p,k)=>{let B=be(p.fields,k);P(`Saving ${p.title}…`,`${p.title} updated.`,()=>t.mutatePluginSettings({action:"save",definitionId:p.id,values:B}))},createdAppPassword:f,createAppPassword:(p,k)=>{P("Creating app password…","App password created.",async()=>{let B=await t.mutateAccount({action:A.createAppPassword,confirmation:A.createAppPassword,label:p,...k==="write"?{access:k}:{}});return Y(B.appPassword??null),B.account})},dismissCreatedAppPassword:()=>Y(null),revokeAppPassword:(p)=>Q(ae.revokeAppPassword,{action:A.revokeAppPassword,confirmation:A.revokeAppPassword,appPasswordId:p}),removeSettings:(p)=>E({title:`Remove ${p.title}?`,message:"The stored settings for this integration will be removed from your account only.",confirmLabel:"Remove settings",action:()=>{P(`Removing ${p.title}…`,`${p.title} removed.`,()=>t.mutatePluginSettings({action:"delete",definitionId:p.id}))}})}}var m=b(x(),1),it=["profile","security","identities","settings",H,F];function st(e){let t=e.connect?F:it.find((n)=>n===e.initialSection);if(!t||t===H&&!e.mcpUrl||t===F&&!e.davUrl)return"profile";return t}function rt(e){let t=["your profile","sign-in security","linked identities",...e.settings?["personal settings"]:[],...e.aiTools?["AI tools"]:[],...e.drive?["your drive"]:[]];return`Your account on this brain. Manage ${`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`} here—not shared services or other people’s access.`}function cn({bootstrap:e,initialAccount:t,client:n}){let a=qe(),s=K.useMemo(()=>n??new ce({fetch:a.fetch}),[n,a]),g=_e({client:s,initialAccount:t,initialDisplayName:e.displayName,routePath:e.routePath}),{account:h,status:O,error:v,busy:N,confirmation:T}=g,[S,D]=K.useState(()=>st(e));K.useEffect(()=>{document.querySelector('.account-tabs [role="tab"][aria-selected="true"]')?.scrollIntoView({block:"nearest",inline:"nearest"})},[S]);let I=h?.displayName??e.displayName;return m.jsxDEV(m.Fragment,{children:[m.jsxDEV("div",{className:o("account-shell",c.shell,Ve.inset),children:[m.jsxDEV(Je,{model:{access:ze("public"),title:"Your account",totals:[]}},void 0,!1,void 0,this),m.jsxDEV("p",{className:o("account-scope",c.description),children:rt({settings:(h?.pluginSettings.length??0)>0,aiTools:Boolean(e.mcpUrl),drive:Boolean(e.davUrl)})},void 0,!1,void 0,this),m.jsxDEV("p",{className:o(`account-status${v?" is-error":""}`,c.feedback,v&&c.feedbackError),role:"status","aria-live":"polite",children:O},void 0,!1,void 0,this),!h?m.jsxDEV("p",{className:o("account-loading",c.loading),children:"Reading your account…"},void 0,!1,void 0,this):m.jsxDEV(Ke,{className:"account-details",value:S,onValueChange:D,children:[m.jsxDEV(Ye,{"aria-label":"Account sections",className:o("account-tabs",c.tabs),children:[m.jsxDEV(M,{value:"profile",disabled:N,children:"Profile"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"security",disabled:N,children:"Sign-in & sessions"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"identities",disabled:N,children:"Linked identities"},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(M,{value:"settings",disabled:N,children:"Personal settings"},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(M,{value:H,disabled:N,children:"AI tools"},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(M,{value:F,disabled:N,children:"Drive"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV(L,{value:"profile",forceMount:!0,hidden:S!=="profile",className:o("account-detail-sections",c.tabPanel),children:m.jsxDEV(Ne,{account:h,actions:g,title:I,studioPath:e.studioPath},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"identities",forceMount:!0,hidden:S!=="identities",className:o("",c.tabPanel),children:m.jsxDEV(Te,{account:h},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(L,{value:"settings",forceMount:!0,hidden:S!=="settings",className:o("",c.tabPanel),children:m.jsxDEV(Pe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"security",forceMount:!0,hidden:S!=="security",className:o("",c.tabPanel),children:m.jsxDEV(xe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(L,{value:H,forceMount:!0,hidden:S!==H,className:o("",c.tabPanel),children:m.jsxDEV(De,{mcpUrl:e.mcpUrl},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(L,{value:F,forceMount:!0,hidden:S!==F,className:o("",c.tabPanel),children:m.jsxDEV(Fe,{davUrl:e.davUrl,account:h,actions:g,connect:e.connect},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T&&m.jsxDEV(He,{mark:"!",title:T.title,titleId:"account-confirmation-title",cancelLabel:"Cancel",confirmLabel:T.confirmLabel,confirmVariant:"danger",pending:N,onCancel:g.cancelConfirmation,onConfirm:g.confirm,children:m.jsxDEV("p",{children:T.message},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{cn as AccountApp};
1
+ import{$b as Le,Ub as c,Vb as o,Wb as d,Yb as me,Zb as $e,_b as Me,ac as ve,cc as we}from"./main-3bfhgpcq.js";import{fc as Ve,jc as ze,kc as Je}from"./main-98w8qkfj.js";import{Bc as He,Dc as Ke,Ec as Ye,Ed as qe,Fc as M,Fd as ee,Gc as L,Tc as ke,Yc as X,Zc as A,_c as je,dd as H,ed as F,pc as x,rc as y,sc as J,vc as te,wd as Ce}from"./main-qzww64vy.js";import{ee as i}from"./main-dfmjnvb5.js";import{qf as ne}from"./main-nbfatnag.js";import{Yf as b}from"./main-1ad1b2wa.js";var K=b(ne(),1);var We=i.object({displayName:i.string(),role:i.enum(["admin","trusted","public"]),profileEntityId:i.string().optional(),passkeys:i.array(i.object({id:i.string(),transports:i.array(i.string()).optional(),credentialDeviceType:i.string().optional(),credentialBackedUp:i.boolean(),createdAt:i.number(),updatedAt:i.number()})),appPasswords:i.array(i.object({id:i.string(),username:i.string(),label:i.string(),access:i.enum(["read","write"]),createdAt:i.number(),expiresAt:i.number(),lastUsedAt:i.number().optional()})),connectedChannels:i.array(i.object({type:i.string(),label:i.string(),verifiedAt:i.number()})),pluginSettings:i.array(i.object({id:i.string(),title:i.string(),description:i.string().optional(),configured:i.boolean(),revision:i.number().nullable(),fields:i.array(i.object({name:i.string(),label:i.string(),control:i.enum(["text","url","number","checkbox"]),secret:i.boolean(),required:i.boolean(),value:i.union([i.string(),i.number(),i.boolean(),i.null()]).optional(),set:i.boolean().optional()}))})),sessions:i.array(i.object({id:i.string(),current:i.boolean(),createdAt:i.number(),expiresAt:i.number()}))});function Ge(e){return We.safeParse(e).success}var ge=i.custom(Ge,{message:"Invalid account response"}),ie=i.object({account:ge}),Ze=i.object({account:ge.optional(),appPassword:i.object({username:i.string(),password:i.string()}).optional(),revoked:i.object({sessions:i.number(),refreshTokens:i.number().optional()}).optional(),signedOut:i.boolean().optional()});function Qe(e){return Ze.safeParse(e).success}var Xe=i.custom(Qe,{message:"Invalid account mutation response"}),et=i.custom((e)=>{if(!X(e))return!1;return typeof e.challenge==="string"&&X(e.rp)&&X(e.user)&&Array.isArray(e.pubKeyCredParams)},{message:"Invalid passkey registration options"});class he extends Error{status;constructor(e,t){super(e);this.name="AccountApiError",this.status=t}}async function V(e,t){let n;try{n=await e.json()}catch{n={}}if(!e.ok){let a=typeof n==="object"&&n!==null&&"error"in n&&typeof n.error==="string"?n.error:"Account request failed";throw new he(a,e.status)}return t.parse(n)}function se(e){let t=e.replaceAll("-","+").replaceAll("_","/").padEnd(Math.ceil(e.length/4)*4,"=");return Uint8Array.from(atob(t),(n)=>n.charCodeAt(0)).buffer}function re(e){let t=new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return btoa(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function tt(e){return{challenge:se(e.challenge),rp:e.rp,user:{...e.user,id:se(e.user.id)},pubKeyCredParams:e.pubKeyCredParams,...e.timeout!==void 0?{timeout:e.timeout}:{},...e.excludeCredentials?{excludeCredentials:e.excludeCredentials.map((t)=>({...t,id:se(t.id)}))}:{},...e.authenticatorSelection?{authenticatorSelection:e.authenticatorSelection}:{},...e.attestation?{attestation:e.attestation}:{},...e.extensions?{extensions:e.extensions}:{}}}var nt=(e,t)=>fetch(e,t);class ce{fetchFn;constructor(e={}){this.fetchFn=e.fetch??nt}async fetchAccount(){return(await V(await this.fetchFn("/auth/account",{credentials:"same-origin",cache:"no-store"}),ie)).account}async mutatePluginSettings(e){return(await V(await this.fetchFn("/auth/account/plugin-settings",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ie)).account}async mutateAccount(e){return V(await this.fetchFn("/auth/account/mutations",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xe)}async registerPasskey(){let e=await V(await this.fetchFn("/auth/account/passkeys/options",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}"}),et),t=await navigator.credentials.create({publicKey:tt(e)});if(!(t instanceof PublicKeyCredential))throw Error("Passkey registration was cancelled");if(!(t.response instanceof AuthenticatorAttestationResponse))throw Error("Authenticator returned an invalid passkey response");let n=t.response,a={id:t.id,rawId:re(t.rawId),type:t.type,...t.authenticatorAttachment?{authenticatorAttachment:t.authenticatorAttachment}:{},clientExtensionResults:t.getClientExtensionResults(),response:{clientDataJSON:re(n.clientDataJSON),attestationObject:re(n.attestationObject),transports:typeof n.getTransports==="function"?n.getTransports():[]}};return(await V(await this.fetchFn("/auth/account/passkeys/verify",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),ie.extend({verified:i.literal(!0)}))).account}}function ye(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map((t)=>t.slice(0,1).toUpperCase()).join("")}function Ae(e,t){let n=t.indexOf("/");if(n<=0||n===t.length-1)return;let a=t.slice(0,n),s=t.slice(n+1);return`${e==="/"?"":e.replace(/\/+$/,"")}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`}function j(e,t=!1){return new Date(t?e:e*1000).toISOString()}var R=b(x(),1);function z(e){return R.jsxDEV(y,{variant:e.tone==="danger"?"danger":e.tone==="primary"?"primary":"outline",type:e.type??"button",onClick:e.onClick,disabled:e.disabled,children:e.children},void 0,!1,void 0,this)}function U(e){return R.jsxDEV("div",{className:o("account-access-item",c.access),children:[R.jsxDEV(ve,{density:"comfortable",title:e.kind,description:e.description,metadata:e.metadata??[]},void 0,!1,void 0,this),e.action]},void 0,!0,void 0,this)}function C(e){return R.jsxDEV("section",{className:o("account-detail-section",c.section),children:[R.jsxDEV("div",{className:"account-section-label",children:[R.jsxDEV("h3",{className:o("",c.heading,ee.section,e.titleHidden===!0&&c.headingHidden),children:e.title},void 0,!1,void 0,this),e.description?R.jsxDEV("p",{className:o("",c.description),children:e.description},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),R.jsxDEV("div",{className:o("people-stack",c.stack),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function be(e,t){let n=Object.fromEntries(t.entries());for(let a of e)if(a.control==="checkbox")n[a.name]=t.has(a.name);else if(a.control==="number"&&typeof n[a.name]==="string"&&n[a.name]!=="")n[a.name]=Number(n[a.name]);return n}function Se(e){if(e.secret)return"password";if(e.control==="url"||e.control==="number")return e.control;return"text"}var r=b(x(),1);function Ne(e){let{account:t,actions:n,title:a,studioPath:s}=e,g=t.role,h=t.profileEntityId?Ae(s,t.profileEntityId):void 0;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV(C,{title:"Profile",titleHidden:!0,children:[r.jsxDEV("div",{className:o("account-identity",c.identity),children:r.jsxDEV("div",{className:o("people-detail-person",c.person),children:[r.jsxDEV("span",{className:o("people-avatar people-avatar--large",c.avatar),children:ye(a)},void 0,!1,void 0,this),r.jsxDEV("span",{className:o("",c.personCopy),children:[r.jsxDEV("span",{className:o("people-detail-name",c.name,ee.secondaryDisplay),children:a},void 0,!1,void 0,this),r.jsxDEV("span",{"data-account-role":g,className:o("account-role",c.role),children:ke(g)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),t.profileEntityId?r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("account-profile-note",c.description),children:"Managed by the Anchor profile — your account name follows the published profile."},void 0,!1,void 0,this),r.jsxDEV(U,{kind:"Anchor profile",description:a,action:h?r.jsxDEV(y,{asChild:!0,variant:"link",children:r.jsxDEV("a",{href:h,children:"Edit Anchor Profile →"},void 0,!1,void 0,this)},void 0,!1,void 0,this):void 0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(O)=>{O.preventDefault(),n.saveName()},children:[r.jsxDEV("label",{className:o("",c.formLabel),htmlFor:"display-name",children:"Display name"},void 0,!1,void 0,this),r.jsxDEV(J,{id:"display-name",maxLength:200,autoComplete:"name",required:!0,value:n.displayName,onChange:(O)=>n.setDisplayName(O.target.value)},void 0,!1,void 0,this),r.jsxDEV(z,{type:"submit",disabled:n.busy,children:"Save name"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV("p",{className:o("",c.description),children:"Your role controls access to this brain. An administrator manages access in Administration."},void 0,!1,void 0,this),g==="admin"&&r.jsxDEV(y,{asChild:!0,variant:"outline",children:r.jsxDEV("a",{href:Ce(s,"admin:administration"),children:"Manage people in Administration →"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Te(e){let t=e.account.connectedChannels;return r.jsxDEV(C,{title:"Linked identities",titleHidden:!0,description:"How this brain recognizes messages from you. These are your identities, not services configured for the whole brain.",children:t.length===0?r.jsxDEV("p",{className:o("people-empty",c.empty),children:"No linked identities."},void 0,!1,void 0,this):t.map((n)=>r.jsxDEV(U,{kind:n.type,description:n.label,metadata:[`Verified: ${j(n.verifiedAt,!0)}`]},`${n.type}:${n.label}`,!1,void 0,this))},void 0,!1,void 0,this)}function Pe(e){let{account:t,actions:n}=e;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("",c.description),children:"Settings for your account only. These do not configure shared services for the brain."},void 0,!1,void 0,this),t.pluginSettings.map((a)=>r.jsxDEV(we,{label:a.title,density:"comfortable",presentation:"disclosure",children:[r.jsxDEV("p",{className:o("account-settings-description",c.description),children:a.description??"Private settings for this account."},void 0,!1,void 0,this),r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(s)=>{s.preventDefault(),n.saveSettings(a,new FormData(s.currentTarget))},children:[a.fields.map((s)=>r.jsxDEV("label",{htmlFor:`setting-${a.id}-${s.name}`,className:o("",c.field),children:[r.jsxDEV("span",{className:o("",c.formLabel),children:s.label},void 0,!1,void 0,this),s.control==="checkbox"?r.jsxDEV(te,{id:`setting-${a.id}-${s.name}`,name:s.name,defaultChecked:s.value===!0},void 0,!1,void 0,this):r.jsxDEV(J,{id:`setting-${a.id}-${s.name}`,name:s.name,type:Se(s),required:s.required&&(!a.configured||s.secret)&&!s.set,defaultValue:s.secret?"":typeof s.value==="string"||typeof s.value==="number"?s.value:"",placeholder:s.secret&&s.set?"Stored — leave blank to keep":void 0,autoComplete:"off"},void 0,!1,void 0,this)]},s.name,!0,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:[r.jsxDEV(z,{type:"submit",tone:"primary",disabled:n.busy,children:"Save settings"},void 0,!1,void 0,this),a.configured?r.jsxDEV(y,{variant:"danger",disabled:n.busy,type:"button",onClick:()=>n.removeSettings(a),children:"Remove"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},`${a.id}:${a.revision??"unset"}`,!0,void 0,this)]},a.id,!0,void 0,this))]},void 0,!0,void 0,this)}function xe(e){let{account:t,actions:n}=e,{busy:a}=n;return r.jsxDEV("div",{className:o("",c.column),children:[r.jsxDEV(C,{title:"Sign-in",description:"Passkeys used to access this account. Your final passkey is protected from revocation.",children:[t.passkeys.map((s)=>r.jsxDEV(U,{kind:s.credentialBackedUp?"Synced passkey":"Device passkey",metadata:[`Added: ${j(s.createdAt,!0)}`],action:t.passkeys.length>1?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokePasskey(s.id),children:"Revoke"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:r.jsxDEV(y,{variant:"outline",disabled:a,type:"button",onClick:n.addPasskey,children:"Add passkey"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV(C,{title:"Signed-in sessions",children:t.sessions.map((s)=>r.jsxDEV(U,{kind:s.current?"This session":"Browser session",metadata:[`Started: ${j(s.createdAt)}`,...s.current?["Current browser"]:[]],action:!s.current?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokeSession(s.id),children:"End"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this))},void 0,!1,void 0,this),r.jsxDEV("footer",{className:o("account-session-actions",c.footer),children:[r.jsxDEV("small",{children:"Access changes require an Admin."},void 0,!1,void 0,this),r.jsxDEV("div",{className:o("",c.actions),children:[r.jsxDEV(z,{disabled:a||t.sessions.every((s)=>s.current),onClick:n.revokeOtherSessions,children:"End other sessions"},void 0,!1,void 0,this),r.jsxDEV(z,{tone:"danger",disabled:a,onClick:n.revokeAllSessions,children:"Sign out everywhere"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ee=b(ne(),1);function de(e){return new URL(e).host.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function le(e){return JSON.stringify(e,null,2)}function Oe(e,t,n){return["Already have servers there? Add only the ",{code:`"${n}"`}," entry inside ",{code:`"${t}"`},` of ${e}.`]}function Re(e){let t=de(e),n="Sign in with your passkey when asked.";return[{id:"claude",group:"primary",name:"Claude",note:["Desktop app and claude.ai."],steps:[["Open Settings → Connectors → Add custom connector."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when asked."]]},{id:"chatgpt",group:"primary",name:"ChatGPT",steps:[["Open Settings → Apps & Connectors → Advanced and turn on Developer mode."],["Choose Create, name it ",{code:t},", paste your brain’s address and pick OAuth."],["Sign in with your passkey when asked."]]},{id:"claude-code",group:"developer",name:"Claude Code",lead:[["Add the server in your terminal:"]],snippet:{label:"Claude Code command",code:`claude mcp add --transport http ${t} ${e}`},after:[["Then start Claude Code, run ",{code:"/mcp"},", choose ",{code:t}," and sign in with your passkey."]]},{id:"cursor",group:"developer",name:"Cursor",steps:[["Open Cursor Settings → MCP → Add new global MCP server."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when Cursor asks."]],lead:[["Or add it to ",{code:"~/.cursor/mcp.json"},":"]],snippet:{label:"Cursor configuration",code:le({mcpServers:{[t]:{url:e}}})},after:[Oe("the file","mcpServers",t)]},{id:"vscode",group:"developer",name:"VS Code",steps:[["Open the Command Palette and run ",{code:"MCP: Add Server"},"."],["Choose HTTP, paste your brain’s address and name it ",{code:t},"."],["Choose Global, then sign in with your passkey when asked."]],lead:[["Or run ",{code:"MCP: Open User Configuration"}," and add:"]],snippet:{label:"VS Code configuration",code:le({servers:{[t]:{type:"http",url:e}}})},after:[Oe("your user configuration","servers",t)]},{id:"other",group:"developer",name:"Any other MCP client",inlineName:"any other MCP client",note:["Look for “add MCP server”, “connector” or “integration” in the tool’s settings and fill in:"],fields:[{label:"Name",value:[{code:t}]},{label:"Type",value:["Remote server, Streamable HTTP — not stdio, not SSE"]},{label:"URL",value:[{code:e}]},{label:"Authentication",value:["OAuth. Leave API key, token, client ID and secret empty; the tool registers itself."]}],lead:[["When you connect, your browser opens “Authorize <tool>?” on your brain. Approve MCP access with your passkey. The tool then has two tools: ",{code:"chat"},", to ask your brain anything as you would in chat, and ",{code:"confirm"},", to approve changes when the brain asks."],["Tool only takes local (stdio) servers, or insists on an API key? Bridge it with ",{code:"mcp-remote"},", which handles the sign-in:"]],snippet:{label:"mcp-remote bridge configuration",code:le({mcpServers:{[t]:{command:"npx",args:["-y","mcp-remote",e]}}})}}]}var u=b(x(),1);function W(e){return u.jsxDEV(u.Fragment,{children:e.text.map((t,n)=>typeof t==="string"?t:u.jsxDEV("code",{className:o("",d.code),children:t.code},n,!1,void 0,this))},void 0,!1,void 0,this)}function _(e){let[t,n]=Ee.useState("idle"),a=async()=>{try{await navigator.clipboard.writeText(e.code),n("copied")}catch{n("unavailable")}};return u.jsxDEV("div",{className:o("ai-tools-snippet",d.snippet),children:[u.jsxDEV("pre",{className:o("",d.snippetCode),"aria-label":e.label,children:e.code},void 0,!1,void 0,this),u.jsxDEV(y,{variant:"outline",size:"sm",onClick:()=>void a(),"aria-label":`Copy ${e.label}`,children:t==="copied"?"Copied":t==="unavailable"?"Select to copy":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function G(e){let{client:t}=e;return u.jsxDEV("article",{className:o("ai-tools-client",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:t.name},void 0,!1,void 0,this),t.note?u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:t.note},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,t.steps?u.jsxDEV("ol",{className:o("",d.steps),children:t.steps.map((n,a)=>u.jsxDEV("li",{children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},a,!1,void 0,this))},void 0,!1,void 0,this):null,t.fields?u.jsxDEV("dl",{className:o("",d.fields),children:t.fields.map((n)=>u.jsxDEV("div",{className:o("",d.field),children:[u.jsxDEV("dt",{className:o("",d.fieldLabel),children:n.label},void 0,!1,void 0,this),u.jsxDEV("dd",{className:o("",d.fieldValue),children:u.jsxDEV(W,{text:n.value},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},n.label,!0,void 0,this))},void 0,!1,void 0,this):null,t.lead?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`lead-${a}`,!1,void 0,this)),t.snippet?u.jsxDEV(_,{...t.snippet},void 0,!1,void 0,this):null,t.after?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`after-${a}`,!1,void 0,this))]},void 0,!0,void 0,this)}function ot(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function De(e){let t=Re(e.mcpUrl),n=t.filter((s)=>s.group==="primary"),a=t.filter((s)=>s.group==="developer");return u.jsxDEV(C,{title:"AI tools",description:"Connect AI tools you already use to this brain. A connected tool talks to the brain as you do in chat — asking, saving and updating within your access — after you sign in with your passkey.",children:[u.jsxDEV("article",{className:o("ai-tools-address",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s address"},void 0,!1,void 0,this),u.jsxDEV(_,{label:"brain address",code:e.mcpUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients),children:n.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this),u.jsxDEV("details",{className:o("ai-tools-developer",d.developer),children:[u.jsxDEV("summary",{className:o("",d.developerSummary),children:["Developer tools and other clients",u.jsxDEV("span",{className:o("",d.developerHint),children:ot(a.map((s)=>s.inlineName??s.name))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients,d.developerClients),children:a.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Z=b(ne(),1);var ue="Enter the username and password of an app password from this page.";function Ie(e){let t=new URL(e),n=`${t.protocol==="https:"?"davs":"dav"}://${t.host}${t.pathname}`,a=de(e);return[{id:"macos",group:"file-manager",name:"macOS",note:["Finder, on any Mac."],steps:[["In Finder, choose Go → Connect to Server (⌘K)."],["Paste the address below and click Connect."],["Choose Registered User. ",ue]],snippet:{label:"macOS address",code:e}},{id:"windows",group:"file-manager",name:"Windows",note:["File Explorer, on Windows 10 and 11."],steps:[["In File Explorer, open This PC and choose Map network drive."],["Paste the address below as the folder, tick Connect using different credentials, and click Finish."],[ue]],snippet:{label:"Windows address",code:e}},{id:"gnome-files",group:"file-manager",name:"GNOME Files",note:["The file manager on Ubuntu, Fedora and other GNOME desktops."],steps:[["Open Files → Other Locations (or Network)."],["Under Connect to Server, enter the address below and connect."],[ue]],snippet:{label:"GNOME Files address",code:n}},{id:"rclone",group:"command-line",name:"rclone",note:["Linux, macOS and Windows, from a terminal."],lead:[["Store the drive as a remote, with your app password’s username and password:"]],snippet:{label:"rclone remote command",code:`rclone config create ${a} webdav url=${e} vendor=other user=YOUR_USERNAME pass=YOUR_PASSWORD --obscure`},after:[["Then mount it on an empty folder: ",{code:`rclone mount ${a}: ~/Brain --vfs-cache-mode writes`},"."]]}]}var l=b(x(),1),oe="app-password-label",Ue="app-password-write";function pe(e){return j(e).slice(0,10)}function at(e,t){return[`Created: ${pe(e.createdAt)}`,`${e.expiresAt<=t?"Expired":"Expires"}: ${pe(e.expiresAt)}`,e.lastUsedAt===void 0?"Never used":`Last used: ${pe(e.lastUsedAt)}`]}function Fe(e){let{account:t,actions:n,connect:a}=e,{busy:s,createdAppPassword:g}=n,[h,O]=Z.useState(void 0),v=a!==void 0&&h!==void 0?$e(g,h,t.appPasswords,me(a)):null;Z.useEffect(()=>{if(a&&v)Me(a,v)},[a,v]);let N=Math.floor(Date.now()/1000),[T,S]=Z.useState(!1),D=Ie(e.davUrl),I=D.filter((f)=>f.group==="file-manager"),E=D.filter((f)=>f.group==="command-line");return l.jsxDEV("div",{className:o("",c.column),children:[l.jsxDEV(C,{title:"Drive",description:"Mount this brain as a network drive. It shows the notes, posts and files you can see here, as folders and files, to open and edit on your computer.",children:[a?l.jsxDEV(Le,{connect:a,created:v,busy:s||h!==void 0&&v===null,onConnect:()=>{O(g?.username??null),n.createAppPassword(me(a),"write")}},void 0,!1,void 0,this):null,l.jsxDEV("article",{className:o("drive-address",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s drive address"},void 0,!1,void 0,this),l.jsxDEV(_,{label:"drive address",code:e.davUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"App passwords",description:"A mount signs in with an app password instead of your passkey. It works only for the drive, expires after a year and can be revoked here. It can only read unless you allow saving changes.",children:[g&&g!==v?l.jsxDEV("article",{"data-app-password-reveal":!0,className:o("drive-reveal",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your new app password"},void 0,!1,void 0,this),l.jsxDEV("p",{className:o("",d.text),children:"Copy both now. The password is shown only once."},void 0,!1,void 0,this),l.jsxDEV(_,{label:"username",code:g.username},void 0,!1,void 0,this),l.jsxDEV(_,{label:"password",code:g.password},void 0,!1,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",type:"button",onClick:n.dismissCreatedAppPassword,children:"Done"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,t.appPasswords.length===0?l.jsxDEV("p",{className:o("",d.text),children:"No app passwords yet."},void 0,!1,void 0,this):t.appPasswords.map((f)=>l.jsxDEV(U,{kind:f.label,description:`${f.username} · ${f.access==="write"?"Read and write":"Read-only"}`,metadata:at(f,N),action:l.jsxDEV(y,{variant:"danger",disabled:s,type:"button",onClick:()=>n.revokeAppPassword(f.id),children:"Revoke"},void 0,!1,void 0,this)},f.id,!1,void 0,this)),l.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(f)=>{f.preventDefault();let Y=f.currentTarget,P=String(new FormData(Y).get(oe)??"");if(P.trim()==="")return;n.createAppPassword(P.trim(),T?"write":"read"),Y.reset(),S(!1)},children:[l.jsxDEV("label",{htmlFor:oe,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Name it after the computer it is for"},void 0,!1,void 0,this),l.jsxDEV(J,{id:oe,name:oe,type:"text",required:!0,maxLength:100,placeholder:"Laptop",autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("label",{htmlFor:Ue,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Allow saving changes"},void 0,!1,void 0,this),l.jsxDEV(te,{id:Ue,"aria-label":"Allow saving changes",checked:T,onCheckedChange:S},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",disabled:s,type:"submit",children:"New app password"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"Use it in Obsidian",description:"Keep an Obsidian vault on your computer in step with your brain. Obsidian stays fast and works offline; notes and images sync in the background.",children:l.jsxDEV("article",{className:o("drive-obsidian",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Rizom Brain"},void 0,!1,void 0,this),l.jsxDEV("ol",{className:o("",d.steps),children:[l.jsxDEV("li",{children:"Install the Rizom Brain plugin in Obsidian and turn it on."},void 0,!1,void 0,this),l.jsxDEV("li",{children:["In its settings, enter your brain’s address:"," ",l.jsxDEV("code",{children:new URL(e.davUrl).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("li",{children:"Choose Connect, and confirm on the page that opens here."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),l.jsxDEV(C,{title:"Connect your computer",description:"Use your computer’s own file manager. The brain then appears as a drive beside your other folders.",children:[l.jsxDEV("div",{className:o("drive-clients",d.clients),children:I.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this),l.jsxDEV("details",{className:o("drive-command-line",d.developer),children:[l.jsxDEV("summary",{className:o("",d.developerSummary),children:["Command line",l.jsxDEV("span",{className:o("",d.developerHint),children:E.map((f)=>f.name).join(", ")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("drive-command-line-clients",d.clients,d.developerClients),children:E.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var w=b(ne(),1);var ae={revokePasskey:{title:"Revoke this passkey?",message:"You will not be able to use this passkey again.",confirmLabel:"Revoke passkey",pending:"Revoking passkey…",complete:"Passkey revoked."},revokeSession:{title:"End this browser session?",message:"That browser will need a passkey to sign in again.",confirmLabel:"End session",pending:"Ending session…",complete:"Session ended."},revokeAppPassword:{title:"Revoke this app password?",message:"Anything mounted with it stops working at once. Its password cannot be recovered.",confirmLabel:"Revoke app password",pending:"Revoking app password…",complete:"App password revoked."},revokeOtherSessions:{title:"End every other browser session?",message:"Your current browser will remain signed in.",confirmLabel:"End other sessions",pending:"Ending other sessions…",complete:"Other sessions ended."}};function Be(e){return je(e,"Account request failed")}function _e(e){let{client:t,initialAccount:n}=e,[a,s]=w.useState(n),[g,h]=w.useState(n?.displayName??e.initialDisplayName),[O,v]=w.useState(""),[N,T]=w.useState(!1),[S,D]=w.useState(!1),[I,E]=w.useState(null),[f,Y]=w.useState(null);w.useEffect(()=>{if(n)return;let p=!1;return t.fetchAccount().then((k)=>{if(p)return;s(k),h(k.displayName)}).catch((k)=>{if(p)return;T(!0),v(Be(k))}),()=>{p=!0}},[t,n]);let P=w.useCallback(async(p,k,B)=>{D(!0),T(!1),v(p);try{let q=await B();if(q)s(q),h(q.displayName);v(k)}catch(q){T(!0),v(Be(q))}finally{D(!1)}},[]),fe=async(p)=>(await t.mutateAccount(p)).account,Q=(p,k)=>E({title:p.title,message:p.message,confirmLabel:p.confirmLabel,action:()=>{P(p.pending,p.complete,()=>fe(k))}});return{account:a,displayName:g,setDisplayName:h,status:O,error:N,busy:S,confirmation:I,cancelConfirmation:()=>E(null),confirm:()=>{if(!I)return;E(null),I.action()},saveName:()=>{P("Saving…","Display name updated.",()=>fe({action:A.updateDisplayName,confirmation:A.updateDisplayName,displayName:g}))},addPasskey:()=>{P("Waiting for your authenticator…","Passkey added.",()=>t.registerPasskey())},revokePasskey:(p)=>Q(ae.revokePasskey,{action:A.revokePasskey,confirmation:A.revokePasskey,credentialId:p}),revokeSession:(p)=>Q(ae.revokeSession,{action:A.revokeSession,confirmation:A.revokeSession,sessionId:p}),revokeOtherSessions:()=>Q(ae.revokeOtherSessions,{action:A.revokeOtherSessions,confirmation:A.revokeOtherSessions}),revokeAllSessions:()=>E({title:"Sign out everywhere?",message:"This ends every session, including this one. You will need your passkey to return.",confirmLabel:"Sign out everywhere",action:()=>{P("Signing out everywhere…","Signed out.",async()=>{await t.mutateAccount({action:A.revokeAllSessions,confirmation:A.revokeAllSessions}),window.location.assign(`/login?return_to=${encodeURIComponent(e.routePath)}`);return})}}),saveSettings:(p,k)=>{let B=be(p.fields,k);P(`Saving ${p.title}…`,`${p.title} updated.`,()=>t.mutatePluginSettings({action:"save",definitionId:p.id,values:B}))},createdAppPassword:f,createAppPassword:(p,k)=>{P("Creating app password…","App password created.",async()=>{let B=await t.mutateAccount({action:A.createAppPassword,confirmation:A.createAppPassword,label:p,...k==="write"?{access:k}:{}});return Y(B.appPassword??null),B.account})},dismissCreatedAppPassword:()=>Y(null),revokeAppPassword:(p)=>Q(ae.revokeAppPassword,{action:A.revokeAppPassword,confirmation:A.revokeAppPassword,appPasswordId:p}),removeSettings:(p)=>E({title:`Remove ${p.title}?`,message:"The stored settings for this integration will be removed from your account only.",confirmLabel:"Remove settings",action:()=>{P(`Removing ${p.title}…`,`${p.title} removed.`,()=>t.mutatePluginSettings({action:"delete",definitionId:p.id}))}})}}var m=b(x(),1),it=["profile","security","identities","settings",H,F];function st(e){let t=e.connect?F:it.find((n)=>n===e.initialSection);if(!t||t===H&&!e.mcpUrl||t===F&&!e.davUrl)return"profile";return t}function rt(e){let t=["your profile","sign-in security","linked identities",...e.settings?["personal settings"]:[],...e.aiTools?["AI tools"]:[],...e.drive?["your drive"]:[]];return`Your account on this brain. Manage ${`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`} here—not shared services or other people’s access.`}function cn({bootstrap:e,initialAccount:t,client:n}){let a=qe(),s=K.useMemo(()=>n??new ce({fetch:a.fetch}),[n,a]),g=_e({client:s,initialAccount:t,initialDisplayName:e.displayName,routePath:e.routePath}),{account:h,status:O,error:v,busy:N,confirmation:T}=g,[S,D]=K.useState(()=>st(e));K.useEffect(()=>{document.querySelector('.account-tabs [role="tab"][aria-selected="true"]')?.scrollIntoView({block:"nearest",inline:"nearest"})},[S]);let I=h?.displayName??e.displayName;return m.jsxDEV(m.Fragment,{children:[m.jsxDEV("div",{className:o("account-shell",c.shell,Ve.inset),children:[m.jsxDEV(Je,{model:{access:ze("public"),title:"Your account",totals:[]}},void 0,!1,void 0,this),m.jsxDEV("p",{className:o("account-scope",c.description),children:rt({settings:(h?.pluginSettings.length??0)>0,aiTools:Boolean(e.mcpUrl),drive:Boolean(e.davUrl)})},void 0,!1,void 0,this),m.jsxDEV("p",{className:o(`account-status${v?" is-error":""}`,c.feedback,v&&c.feedbackError),role:"status","aria-live":"polite",children:O},void 0,!1,void 0,this),!h?m.jsxDEV("p",{className:o("account-loading",c.loading),children:"Reading your account…"},void 0,!1,void 0,this):m.jsxDEV(Ke,{className:"account-details",value:S,onValueChange:D,children:[m.jsxDEV(Ye,{"aria-label":"Account sections",className:o("account-tabs",c.tabs),children:[m.jsxDEV(M,{value:"profile",disabled:N,children:"Profile"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"security",disabled:N,children:"Sign-in & sessions"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"identities",disabled:N,children:"Linked identities"},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(M,{value:"settings",disabled:N,children:"Personal settings"},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(M,{value:H,disabled:N,children:"AI tools"},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(M,{value:F,disabled:N,children:"Drive"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV(L,{value:"profile",forceMount:!0,hidden:S!=="profile",className:o("account-detail-sections",c.tabPanel),children:m.jsxDEV(Ne,{account:h,actions:g,title:I,studioPath:e.studioPath},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"identities",forceMount:!0,hidden:S!=="identities",className:o("",c.tabPanel),children:m.jsxDEV(Te,{account:h},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(L,{value:"settings",forceMount:!0,hidden:S!=="settings",className:o("",c.tabPanel),children:m.jsxDEV(Pe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"security",forceMount:!0,hidden:S!=="security",className:o("",c.tabPanel),children:m.jsxDEV(xe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(L,{value:H,forceMount:!0,hidden:S!==H,className:o("",c.tabPanel),children:m.jsxDEV(De,{mcpUrl:e.mcpUrl},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(L,{value:F,forceMount:!0,hidden:S!==F,className:o("",c.tabPanel),children:m.jsxDEV(Fe,{davUrl:e.davUrl,account:h,actions:g,connect:e.connect},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T&&m.jsxDEV(He,{mark:"!",title:T.title,titleId:"account-confirmation-title",cancelLabel:"Cancel",confirmLabel:T.confirmLabel,confirmVariant:"danger",pending:N,onCancel:g.cancelConfirmation,onConfirm:g.confirm,children:m.jsxDEV("p",{children:T.message},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{cn as AccountApp};
2
2
 
3
3
  //# debugId=0CA78380FB1DB07664756E2164756E21
@@ -0,0 +1,4 @@
1
+ import{Aa as En,Ca as Dn,Fa as hn,Ga as Wn,La as ie,Oa as qt,Sa as ae,Ta as Xe,Xa as Xn,Za as Gn,bb as Qn,hb as Fn,ib as tt,jb as vt,kb as _e,lb as In}from"./main-jyhbh07e.js";import{hc as xn,jc as St,lc as Bn}from"./main-98w8qkfj.js";import{Bd as Hn,Ed as we,Fd as Re,Ic as ln,Jc as un,Kc as cn,Lc as he,Mc as dn,Nc as Ue,Xc as O,Yc as fn,cd as ye,fd as Tt,mc as r,nc as yt,od as rt,pc as I,qd as Ae,rc as D,rd as Be,sc as te,sd as Et,tc as J,td as jt,uc as Je,ud as Nn,vc as Pn,wc as Wt,wd as kn,xc as Pt,xd as Nt,zc as Gt,zd as me}from"./main-qzww64vy.js";import{ee as oe}from"./main-dfmjnvb5.js";import{qf as R}from"./main-nbfatnag.js";import{Yf as M}from"./main-1ad1b2wa.js";var Pe={recordLink:{kMwMTN:"x1heor9g",kybGjl:"x1hl2dhg",kLWn49:"xggjnk3",$$css:!0},readable:{kMwMTN:"xqvuw85","--console-text-muted":"x1phc7po",$$css:!0},frame:{"--console-text-muted":"x1phc7po",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x98rzlu x1ba37h5 x1dkdqs9",kAzted:"x2lwn1j x19xbvgk xfc1thu",kWkggS:"x1dd94t5",$$css:!0},boot:{kmVPX3:"x1o8uwn5",$$css:!0},listing:{kzqmXN:"x14atkfc",kogj98:"x1ghz6dp",kGO01o:"xbe17z6",kgwM9Q:"xx1slpc",kXkAfU:"x1w9335",keaIxW:"x7zq708",kh9fTk:"x1m3yuwo",$$css:!0},row:{k1xSpc:"xrvj5dj",kOIVth:"xaobbuh",kGNEyG:"x1pha0wt",kzqmXN:"xh8yej3",kmVPX3:"x1ecgsid",kEafiO:"x972fbf",kWqL5O:"xgfja2r",kZ1KPB:"xyj58a3",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xna4lh4",kWkggS:"xjbqb8w xd8d5gp",k9WMMc:"xdpxx8g",kkrTdU:"x1ypdohk",k1ekBW:"x15406qy x4wkmsb",kIyJzY:"xgdialr",kAMwcw:"xwji4o3",kMv6JI:"x5ddh9m",kAzted:"x2lwn1j",kLyoy9:"x1hqb3p9",kTWfjk:"x79d85h",kRugJJ:"xj4fmvg",$$css:!0},index:{kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kMwMTN:"x1ar3pfp",$$css:!0},title:{k7Eaqz:"xeuugli",kHjlTd:"xj0a0fe",kMv6JI:"xssy22x",ka26j:"xvy63o1",k63SB2:"x11zgcw",kGuDYH:"xksbqk4",kb6lSQ:"x3rbum1",kMwMTN:"xqvuw85 xz8qu5x",kr4CYY:"xn50ssu",katwyW:"x1tvf21l",$$css:!0},covered:{kumcoG:"x4u00d1",k1JLwA:"x1yjaet2",$$css:!0},cover:{k1xSpc:"x1lliihq",kSGwAc:"x1y8v6su",kzqmXN:"xh8yej3",kOBAk4:"x1dltgaz",kVQacm:"xb3r6kr",kaIpWk:"x12oqio5",$$css:!0},compact:{kmVPX3:"x1ah2213",kTWfjk:"x1qm741w",kRugJJ:"x1h4xdqo",$$css:!0},inlineStatus:{k1xSpc:"xt0psk2",keoZOQ:"xdj266r",koQZXg:"x16ydxro",$$css:!0},members:{k1xSpc:"x1lliihq",keoZOQ:"x1gslohp",kMv6JI:"x5ddh9m",kGuDYH:"x1j6dyjg",k63SB2:"xo1l8bm",kMwMTN:"x1ar3pfp",kb6lSQ:"x12oo3zp",$$css:!0},coverPending:{k1xSpc:"x1lliihq",kzqmXN:"xh8yej3",kZKoxP:"x5yr21d",kWkggS:"x18s3upu",$$css:!0},coverImage:{k1xSpc:"x1lliihq",kzqmXN:"xh8yej3",kZKoxP:"x5yr21d",kVIFPx:"xl1xv1r",$$css:!0},excerpt:{k1xSpc:"x104kibb",kJFfOR:"x1h7i4cw",kgKLqz:"x1ua5tub",kVQacm:"xb3r6kr",keoZOQ:"x1gslohp",kMv6JI:"x5ddh9m",kGuDYH:"x2ouz8m",k63SB2:"xo1l8bm",kLWn49:"xfrs9s4",kb6lSQ:"x12oo3zp",kMwMTN:"x1ar3pfp",$$css:!0},updated:{kFhvOy:"x12fk4p8",kMwMTN:"xgi1xjn",kMv6JI:"x5ddh9m",kGuDYH:"x1ct8sxb",kb6lSQ:"x12oo3zp",kCrP1I:"x3h480r",kU6wY8:"xnoo4qv",kV7FkP:"x1re7oy7",kR4nxE:"x1y8onsm",kT6U2d:"x162edmi",kr4CYY:"x155ir8z",$$css:!0},empty:{kmVPX3:"x1easoi4",$$css:!0},pagination:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x13a6bvl",kOIVth:"x1af02g3",kmVPX3:"x1y7lb24",kMwMTN:"x1ar3pfp",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kGOSNy:"x1s9bmkn",kLyoy9:"x1otypdl",k3VDzK:"x12xhqv2",$$css:!0},pager:{k1xSpc:"x3nfvp2",kOIVth:"x17d4w8g",$$css:!0},range:{khDVqt:"xuxw1ft",$$css:!0}};var F={bar:{k1xSpc:"x1s85apg x1ur00lv",kVAEAm:"xixxii4",kkqhue:"x17y0mx6",krVfgx:"x1ey2m1c",kY2c9j:"xa9119d",kjj79g:"x1l1ennw",kGNEyG:"x1cy8zhl",kZKoxP:"xtx5lt5",kLKAdn:"x1y1aw1k",kGO01o:"x11ba12",kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xvg7k2t",kWkggS:"xbslqsl",kMv6JI:"x5ddh9m",$$css:!0},tab:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kOIVth:"x1ed6fcf",k7Eaqz:"xlsvjbk",kAzted:"x1eguyfn",kg3NbH:"x1xijbu4",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kMwMTN:"xqvuw85",kMv6JI:"x5ddh9m",kGuDYH:"x1j6dyjg",kkrTdU:"x1ypdohk",kybGjl:"x1hl2dhg",k3XXqK:"x1t137rt x9v5kkp",kMeerF:"x1de99jn",kjBf7l:"x1itw484",kInvED:"x2ssjo2",kaIpWk:"xur7f20",$$css:!0},active:{kMwMTN:"x1q7454x",k63SB2:"x1s688f",$$css:!0},icon:{k1xSpc:"x1lliihq",$$css:!0},light:{kVAEAm:"x10l6tqk",k87sOh:"x1pdr0v7",kt4wiu:"xxx7yvo",kzqmXN:"xci0xqf",kZKoxP:"x1hagigm",kaIpWk:"x16rqkct",kWkggS:"x15vqgvx",$$css:!0},space:{kGO01o:"x1rybyne",$$css:!0},sheetList:{kORKVm:"x1odjw0f",kZeWKH:"xish69e",kqGvvJ:"x10im51j",kUOVxO:"x1x57ub9",k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kB88ic:"xe8uvvx",$$css:!0},option:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x883omv",kzqmXN:"xh8yej3",kAzted:"x1eguyfn",kg3NbH:"xdqyycr",kMzoRj:"xc342km",kaIpWk:"xur7f20",kWkggS:"xjbqb8w",kMwMTN:"xqvuw85",kMv6JI:"x5ddh9m",kGuDYH:"x1jvydc1",k9WMMc:"x1yc453h",kybGjl:"x1hl2dhg",kkrTdU:"x1ypdohk",$$css:!0},optionActive:{kWkggS:"x9kxhyz",k63SB2:"x1s688f",$$css:!0},optionCount:{keTefX:"xvc5jky",kMv6JI:"xa9opjo",kGuDYH:"xfifm61",kMwMTN:"xqvuw85",$$css:!0},optionAttention:{kMwMTN:"x1q7454x",$$css:!0}};var wt=M(R(),1),at="studio.navigation.collapsed",it="studio-navigation-preference",Ge=new WeakMap;function Un(){if(typeof window>"u")return!1;let e=Ge.get(window);if(e!==void 0)return e;try{return window.localStorage.getItem(at)==="true"}catch{return Ge.get(window)??!1}}function Yn(e){let t=(n)=>{if(n.key!==at&&n.key!==null)return;Ge.delete(window),e()};return window.addEventListener(it,e),window.addEventListener("storage",t),()=>{window.removeEventListener(it,e),window.removeEventListener("storage",t)}}function Ve(e){Ge.set(window,e);try{window.localStorage.setItem(at,String(e))}catch{}window.dispatchEvent(new Event(it))}function $t(){return wt.useSyncExternalStore(Yn,Un,()=>!1)}var q={shell:{kumcoG:"x1i9x5af x6bw718 x1ukz75g",kjdo94:"xirox3h",$$css:!0},shellCollapsed:{kumcoG:"x1hxcnyl",kjdo94:"xirox3h",$$css:!0},navigationCollapsed:{kg3NbH:"x1awh872",$$css:!0},allTypes:{kmVPX3:"xyfktp2",$$css:!0},allTypesSummary:{kkrTdU:"x1ypdohk",kpqbRz:"x1cy9i3i",kMv6JI:"x5ddh9m",kGuDYH:"xfifm61",kb6lSQ:"x12oo3zp",kP9fke:"x6mezaz",$$css:!0},section:{k1xSpc:"xrvj5dj",kOIVth:"x195vfkc",$$css:!0},collapsedLabel:{k1xSpc:"x1s85apg",$$css:!0},collapsedLink:{kumcoG:"x1y6fwsi",kAPf3g:"x1o2pa38",kg3NbH:"xfn1xvj",$$css:!0},collapsedTitle:{kjj79g:"xl56j7k",kg3NbH:"xnjsko4",$$css:!0},collapseButton:{kzqmXN:"xgd8bvy",kAzted:"xe0p6wg",kmVPX3:"x1717udv",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1kogg8i",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},mobileSummary:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",kAzted:"x1eguyfn",kg3NbH:"xb1dmaa",kaIpWk:"xur7f20",kMwMTN:"xqvuw85",kkrTdU:"x1ypdohk",kB88ic:"xe8uvvx",kGqHtl:"x1i5lizr",kGzVvX:"xd8d5gp",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},mobileGroupName:{kMwMTN:"xqvuw85",$$css:!0},mobileCurrent:{koQZXg:"x8x9d4c",ks0D6T:"x73t7g",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"xo1l8bm",kb6lSQ:"x12oo3zp",kP9fke:"x6mezaz",$$css:!0},mobileDisclosure:{k1xSpc:"xrvj5dj",kgQiWS:"x1ku5rj1",kzqmXN:"xw4jnvo",kMwMTN:"x1ar3pfp",kGuDYH:"x1k6wstc",k1ekBW:"x11xpdln x4wkmsb",kIyJzY:"xgdialr",k3aq6I:"x9tu13d x53p255",$$css:!0},mobileDirect:{k1xSpc:"x1lliihq",k1K539:"x1yztbdb",kGO01o:"xsag5q8",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xpqg30t",$$css:!0},mobileDirectLink:{kZCmMZ:"xe2zdcy",$$css:!0},mobileFilter:{kUk6DE:"x12lumcd",k7Eaqz:"xeuugli",$$css:!0},mobileEmpty:{kmVPX3:"x1f7pr5y",kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"xif65rj",kLWn49:"x1jjo3f5",$$css:!0},mobileTally:{koQZXg:"x8x9d4c",kMwMTN:"x1jdz31e",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",$$css:!0},mobileAttention:{koQZXg:"x8x9d4c",kMwMTN:"x1q7454x",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",k63SB2:"x19s9jnd",$$css:!0},rail:{k7Eaqz:"xeuugli",kAzted:"x2lwn1j",kVQacm:"xb3r6kr",kmVPX3:"x1717udv",kWqL5O:"xs1s249",kSWEuD:"x32b0ac",k26BEO:"xe636ye",kWkggS:"xbslqsl",kOgw8m:"xzd29fr",$$css:!0},navigation:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1jnr06f",kzqmXN:"xh8yej3",kZKoxP:"x5yr21d",kAzted:"x2lwn1j",kmVPX3:"x7obcpk",kWqL5O:"xs1s249",kSWEuD:"x32b0ac",k26BEO:"xe636ye",kWkggS:"xbslqsl",kOgw8m:"xzd29fr",$$css:!0},areaRail:{k1xSpc:"x78zum5",k7Eaqz:"xeuugli",kXwgrk:"xdt5ytf",kOIVth:"x1jnr06f",kmVPX3:"x7obcpk",kWqL5O:"xs1s249",kSWEuD:"x32b0ac",k26BEO:"xe636ye",kWkggS:"xbslqsl",$$css:!0},areaTitle:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x13a6bvl",kOIVth:"x1jnr06f",kmVPX3:"x6uox72",kMwMTN:"x1ar3pfp",$$css:!0},areaLink:{kVAEAm:"x1n2onr6",k1xSpc:"xrvj5dj",kumcoG:"x1otrvri",kGNEyG:"x6s0dn4",kOIVth:"x17d4w8g",kAzted:"x141feeh",kmVPX3:"x1xq1gxn",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x9r1u3d",kaIpWk:"xu4hgxq",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k9WMMc:"xdpxx8g",kaVNsj:"xdn345r",kDPRdz:"x18m2ztq",kYPGJ8:"xtgyt42",kWCcOm:"xnqy2f1",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},areaActive:{kVAM5u:"x8tuc8h",kWkggS:"x18s3upu",kMwMTN:"xqvuw85",$$css:!0},ordinal:{kMwMTN:"x1ar3pfp",kMv6JI:"xa9opjo",kGuDYH:"xvwhms9",kKX8nH:"x1j61x8r",k63SB2:"x1s688f",$$css:!0},ordinalActive:{kMwMTN:"x1q7454x",$$css:!0},leaf:{k1xSpc:"xrvj5dj",k7Eaqz:"xeuugli",kogj98:"xh8a1rz",kE3dHu:"x11iknt3",kZ1KPB:"xe0pwq",k4WBpm:"x19ypqd9",kaZRDh:"xz6lizu",$$css:!0},leafHead:{kmVPX3:"xaukpwp",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xpqg30t",$$css:!0},leafTitle:{kogj98:"x91luw6",kMwMTN:"xqvuw85",$$css:!0},leafDescription:{kogj98:"x1ghz6dp",kMwMTN:"x1ar3pfp",kGuDYH:"x1k6wstc",kLWn49:"xfrs9s4",$$css:!0},leafScroll:{k1xSpc:"xrvj5dj",kfiyM8:"x10ukxgv",kOIVth:"x195vfkc",kUk6DE:"x98rzlu",kAzted:"x2lwn1j",kORKVm:"x1odjw0f",kZeWKH:"xish69e",$$css:!0},leafGroup:{kmVPX3:"xyfktp2",$$css:!0},leafLabel:{kmVPX3:"x61dodf",kMwMTN:"x1ar3pfp",$$css:!0},list:{kB88ic:"xe8uvvx",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",$$css:!0},leafLink:{k1xSpc:"x78zum5",kGNEyG:"x1pha0wt",kOIVth:"x167g77z",kzqmXN:"xh8yej3",kAzted:"x21xpn4",kmVPX3:"xk61eof",kMzoRj:"xc342km",kZ1KPB:"x19sr0n1",ksu8eU:"x1y0btm7",kVAM5u:"x9r1u3d",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kMv6JI:"x5ddh9m",kGuDYH:"xfifm61",kLWn49:"xggjnk3",k9WMMc:"xdpxx8g",kybGjl:"x1hl2dhg",kkrTdU:"x1ypdohk",kGzVvX:"xd8d5gp",kDPRdz:"x18m2ztq",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},leafActive:{kaZRDh:"x1yn89ol",kWkggS:"x18s3upu",kMwMTN:"xqvuw85",k63SB2:"x1s688f",$$css:!0},count:{koQZXg:"x8x9d4c",kMwMTN:"x1jdz31e",kMv6JI:"xa9opjo",kGuDYH:"xvwhms9",$$css:!0},singleton:{kMwMTN:"x1ar3pfp",kb6lSQ:"x12oo3zp",$$css:!0},mobileHost:{k1xSpc:"x1s85apg xnty2cc",$$css:!0},areaFoot:{k1xSpc:"xrvj5dj",keoZOQ:"xr1yuqi",$$css:!0},areaLabel:{k1xSpc:"x78zum5",k7Eaqz:"xeuugli",kGNEyG:"x6s0dn4",kOIVth:"x17d4w8g",$$css:!0},browse:{k1xSpc:"x1s85apg",kGNEyG:"x6s0dn4",kOIVth:"x1j9xkj6",kAzted:"x1gg8mnh",kmVPX3:"x1astma3",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kMwMTN:"xqvuw85",kkrTdU:"x1ypdohk",kOgw8m:"x168i3sl",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},sheetOverlay:{kVAEAm:"xixxii4",kY2c9j:"x6y9o1m",k87sOh:"xz02az6",kCIrl2:"x3m8u43",krVfgx:"x1ey2m1c",kbCHJM:"xu96u03",$$css:!0},sheet:{"--console-text-muted":"x1phc7po",kVAEAm:"xixxii4",kY2c9j:"x1aciyhk",k87sOh:"xz02az6",kCIrl2:"x3m8u43",krVfgx:"x1ey2m1c",kbCHJM:"xu96u03",k1xSpc:"xrvj5dj",k9llMU:"x5o4joa",kmVPX3:"x1717udv",kMzoRj:"xc342km",kI3sdo:"x1a2a7pz",kWkggS:"xdls3ah",k6WDB:"x1jh03n0",kMwMTN:"xqvuw85",$$css:!0},sheetList:{kAzted:"x2lwn1j",kORKVm:"x1odjw0f",kZeWKH:"xish69e",kmVPX3:"x17yoobn",$$css:!0},sheetHead:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x883omv",k1K539:"x1yztbdb",$$css:!0},sheetTitle:{kogj98:"x1ghz6dp",$$css:!0},sheetClose:{k1xSpc:"xrvj5dj",kgQiWS:"x1ku5rj1",kzqmXN:"x6uih76",kZKoxP:"x2e9ysv",kmuXW:"x2lah0s",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x16rqkct",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kGuDYH:"x1jvydc1",kDPRdz:"x18m2ztq",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",$$css:!0},mobileGroup:{k1K539:"x1yztbdb",k4rD7h:"xr2l1fr",$$css:!0},mobileLink:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",kzqmXN:"xh8yej3",kAzted:"x1eguyfn",kmVPX3:"x6jaaxu",kMzoRj:"xc342km",kaIpWk:"xur7f20",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kMv6JI:"x5ddh9m",kGuDYH:"x1j61zf2",kLWn49:"xggjnk3",k9WMMc:"xdpxx8g",kybGjl:"x1hl2dhg",kGzVvX:"xuvuc2f",kDPRdz:"x18m2ztq",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},mobileActive:{kL6WhQ:"x16stqrj",kaIpWk:"xu4hgxq",kWkggS:"x9kxhyz",kMwMTN:"xqvuw85",k63SB2:"xh88oxj",$$css:!0}};function g(e,...t){return`${e} ${r(...t).className??""}`}var Fe=M(R(),1);var ot=new Set(["profile","settings","site-info","siteInfo"]),Ee=[{label:"Structure",presentation:"form",types:["grouping-definitions"]},{label:"Identity",presentation:"form",types:["anchor-profile","brain-character","style-guide"]},{label:"Intelligence",presentation:"document",types:["prompt","prompts","skill","skills","playbook","playbooks","swot","swots"]},{label:"Network",presentation:"form",types:["agent","agents"]}];function Oe(e){if(e.classification==="system")return ot.has(e.entityType)?"Site":"System";return"Content"}function Y(e,t){if(t)return t.id===ye?null:t.section;return e?.classification==="system"?"brain":"library"}function Mt(e){if(e==="\\")return"\\\\";return`\\u${(e.codePointAt(0)??0).toString(16).padStart(4,"0")}`}function X(e){if(e==="")return"(empty)";if(e==="(empty)")return`${Mt("(")}${e.slice(1)}`;return e.replace(/\\|·|[^\S ]|\p{Cc}|\p{Cf}/gu,Mt).replace(/^ +| +$| {2,}/g,(n)=>"·".repeat(n.length))}var je=[{key:"images",label:"Images",path:Et},{key:"documents",label:"Documents",path:(e)=>jt(e)}];function Zn(e){let t=rt.safeParse(Object.fromEntries(new URLSearchParams(e)));return t.success?t.data:rt.parse({})}function Jn(e){let t=new URLSearchParams;if(e.value!==null)t.set("value",e.value);if(e.type)t.set("type",e.type);if(e.q)t.set("q",e.q);if(e.sort!=="updated-desc")t.set("sort",e.sort);if(e.offset)t.set("offset",String(e.offset));if(e.limit!==50)t.set("limit",String(e.limit));let n=t.toString();return n?`?${n}`:""}function Qi(e,t,n){if(!Tt(e))return null;let i=e.studioGroupingPath;if(typeof i!=="string"||!i.startsWith("/")||i.startsWith("//")||i.includes("\\"))return null;let o=new URL(i,"https://studio.invalid"),a=Nt(o.pathname,t);if(a.kind!=="grouping")return null;let s=n.find((b)=>b.key===a.grouping);if(!s)return null;let p=Zn(o.search);return{path:`${o.pathname}${Jn(p)}`,label:p.value===null?s.label:X(p.value),grouping:s.key}}var le={field:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kUk6DE:"x12lumcd",k7Eaqz:"xeuugli",$$css:!0},wide:{ks0D6T:"xxc7z9f",$$css:!0},glyph:{kVAEAm:"x10l6tqk",kLqNvP:"xi5uv41",kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",kMwMTN:"x1ar3pfp",kfzvcC:"x47corl",$$css:!0},input:{kzqmXN:"xh8yej3",kAzted:"x141feeh x1c4ya5t",kZCmMZ:"xhikr00",kwRFfy:"xpdmqnj",kGuDYH:"x4z9k3i xf2x79s",k9l4BL:"x1hcrkkg",$$css:!0},roomy:{kwRFfy:"xhig867",$$css:!0},clear:{kVAEAm:"x10l6tqk",kt4wiu:"xxx7yvo",k1xSpc:"xrvj5dj",kzqmXN:"xgd8bvy x199zukc",kZKoxP:"x1fgtraw xpj9cei",kAzted:"xe0p6wg x18kkpoz",kmVPX3:"x1717udv",kgQiWS:"x1ku5rj1",kMzoRj:"xc342km",kaIpWk:"x1kogg8i",kWkggS:"xjbqb8w xgvbf8n",kMwMTN:"x1ar3pfp x18m2ztq",kMv6JI:"xa9opjo",kGuDYH:"xif65rj",$$css:!0}};var ue=M(I(),1);function st(e){let t=r(le.field,e.wide===!0&&le.wide);return ue.jsxDEV("div",{className:`${e.hook??""} ${t.className??""}`.trim(),style:t.style,"data-studio-search":"",children:[ue.jsxDEV("svg",{...r(le.glyph),viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[ue.jsxDEV("circle",{cx:"6.8",cy:"6.8",r:"4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6"},void 0,!1,void 0,this),ue.jsxDEV("line",{x1:"10.2",y1:"10.2",x2:"14",y2:"14",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),ue.jsxDEV(te,{xstyle:[le.input,e.value.length>0&&le.roomy],type:"search","aria-label":e.label,placeholder:e.placeholder,maxLength:200,value:e.value,onChange:(n)=>e.onChange(n.target.value)},void 0,!1,void 0,this),e.value.length>0&&ue.jsxDEV(D,{type:"button",variant:"ghost",xstyle:le.clear,"aria-label":`Clear ${e.label.toLowerCase()}`,onClick:()=>e.onChange(""),children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Le(e,t){return e?t?.[e.id]??0:0}function qe(e){if(e.entityType==="grouping-definitions")return"Groupings";return e.isSingleton&&e.entityType!=="settings"?e.singularLabel:e.label}var ce="group:",Ne="type:",Ie="workspace:";function It(e){if(e.startsWith(ce)){let t=e.slice(ce.length);return t.length>0?{kind:"grouping",id:t}:null}if(e.startsWith(Ne)){let t=e.slice(Ne.length);return t.length>0?{kind:"type",id:t}:null}if(e.startsWith(Ie)){let t=e.slice(Ie.length);return t.length>0?{kind:"workspace",id:t}:null}return null}var lt=["library","publish","brain"];function ze(e,t){let n=e.reduce((i,o)=>i+Le(o,t),0);return n>0?n:void 0}function zt(e,t){if(t==="home")return e.homeWorkspaces.length>0;if(t==="chat")return e.chatWorkspaces.length>0;return lt.includes(t)}function Ct(e){let t=e.types.filter((h)=>h.containedIn===void 0),n=e.types.find((h)=>h.entityType===e.active)?.containedIn??e.active,i=e.workspaces??[],o=(h)=>i.filter((P)=>Y(null,P)===h),a=i.find((h)=>h.id==="studio:overview"),s=i.find((h)=>h.id===qt),p=o("chat").filter((h)=>h!==s),b=o("home").filter((h)=>h!==a),m=o("library"),w=o("publish"),T=o("brain"),k=["Content","Site","System"].map((h)=>({label:h,types:t.filter((P)=>Oe(P)===h)})).filter((h)=>h.types.length>0),y=e.recentTypes??[],j=(h)=>{let P=y.indexOf(h.entityType);return P<0?y.length:P},S=(h)=>h.count>0||h.isSingleton||h.entityType===n,x=t.filter((h)=>Oe(h)==="Content"),u=x.filter(S).map((h,P)=>({info:h,index:P})).sort((h,P)=>j(h.info)-j(P.info)||h.index-P.index).map(({info:h})=>h),v=x.filter((h)=>!S(h)),C=(h)=>h.flatMap((P)=>t.filter((We)=>We.entityType===P&&We.classification==="system")),ge=[...Ee.map((h)=>({label:h.label,types:C([...h.types])})),...k.filter((h)=>h.label==="Site"),{label:"Other",types:t.filter((h)=>Oe(h)==="System"&&!Ee.some((P)=>P.types.some((We)=>We===h.entityType)))}].filter((h)=>h.types.length>0),A=i.find((h)=>h.id===e.activeWorkspace),re=e.groupings?.active?"library":A?Y(null,A):Y(t.find((h)=>h.entityType===n)??null,null),Me=e.groupings?.active?`${ce}${e.groupings.active}`:e.activeWorkspace??n,se=e.workspaceBadges,Te=(h,P)=>P===void 0?h:{...h,badge:P},Kn=[Te({id:"home",label:"Home",available:a!==void 0||b.length>0},ze([a,...b],se)),Te({id:"library",label:"Library",available:u.length>0||v.length>0||m.length>0||(e.groupings?.items.length??0)>0},ze(m,se)),Te({id:"publish",label:"Publish",available:w.length>0},ze(w,se)),Te({id:"chat",label:"Chat",available:s!==void 0||p.length>0},ze([s,...p],se)),Te({id:"brain",label:"Brain",available:ge.length>0||T.length>0},ze(T,se))];return{types:t,active:n,overviewWorkspace:a,chatWorkspace:s,homeWorkspaces:b,chatWorkspaces:p,libraryTypes:u,emptyLibraryTypes:v,libraryWorkspaces:m,publishWorkspaces:w,brainTypeGroups:ge,brainWorkspaces:T,currentArea:re,destination:Me,sections:Kn}}var N=M(I(),1),_n={home:"M3 11l9-7 9 7 M5 10v10h14V10 M10 20v-6h4v6",library:"M12 5v16 M12 5C9 3 5 3 2 4v15c3-1 7-1 10 2 3-3 7-3 10-2V4c-3-1-7-1-10 1z",publish:"M12 3v12 M7 8l5-5 5 5 M4 15v5h16v-5",chat:"M5 4h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-5 3v-3a2 2 0 0 1-2-2V6a2 2 0 0 1 3-2z",brain:"M9 4a3 3 0 0 0-3 3 3 3 0 0 0-2 5 3 3 0 0 0 2 5 3 3 0 0 0 6 1V5a3 3 0 0 0-3-1z M15 4a3 3 0 0 1 3 3 3 3 0 0 1 2 5 3 3 0 0 1-2 5 3 3 0 0 1-6 1"};function ut({area:e}){return N.jsxDEV("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:N.jsxDEV("path",{d:_n[e]},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function Ce(e){return N.jsxDEV("li",{children:N.jsxDEV("a",{href:e.href,className:g(e.active?"studio-leaf-link active":"studio-leaf-link",q.leafLink,e.active&&q.leafActive),"aria-current":e.active?"page":void 0,onClick:(t)=>{if(!ie(t))return;t.preventDefault(),e.onSelect()},children:[e.label,e.count!==void 0&&N.jsxDEV("span",{className:g(e.attention?"count count--attention":"count",q.count),children:e.count},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function He(e){return N.jsxDEV("section",{className:g("studio-leaf-group",q.leafGroup),children:[e.label?N.jsxDEV("div",{className:g("studio-leaf-label",q.leafLabel,Re.eyebrow),children:e.label},void 0,!1,void 0,this):null,N.jsxDEV("ul",{className:g("",q.list),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function At(e){let t=$t(),n=e.focus===!0&&!e.tree.browsing,i=t||n,o=e.model,{sections:a}=o,{activeArea:s,leafOpen:p,leafId:b,selectArea:m,endBrowsing:w}=e.tree,T=()=>{if(e.focus===!0&&!t){if(e.tree.browsing)w();else if(s)m(s);return}Ve(!i)},k=ae(),y=(u)=>N.jsxDEV(He,{label:u.label,children:u.types.map((v)=>N.jsxDEV(Ce,{label:qe(v),active:v.entityType===e.active,href:Ae(k,v.entityType),onSelect:()=>e.onSelect(v.entityType),count:v.isSingleton?void 0:v.count},v.entityType,!1,void 0,this))},u.label,!1,void 0,this),j=(u)=>{let v=e.workspaceBadges?.[u.id]??0;return N.jsxDEV(Ce,{label:u.label,active:u.id===e.activeWorkspace,href:Xe(k,u.id),onSelect:()=>e.onSelectWorkspace?.(u.id),count:v>0?v:void 0,attention:!0},u.id,!1,void 0,this)},S=(u,v)=>v.length>0?N.jsxDEV(He,{label:u,children:v.map(j)},u??"pages",!1,void 0,this):null,x=(u)=>{switch(u){case"home":return S(void 0,o.homeWorkspaces);case"library":return N.jsxDEV(N.Fragment,{children:[o.libraryTypes.length>0?y({types:o.libraryTypes}):null,o.emptyLibraryTypes.length>0?N.jsxDEV("details",{className:g("",q.allTypes),children:[N.jsxDEV("summary",{className:g("",q.leafLabel,q.allTypesSummary),children:"All types"},void 0,!1,void 0,this),N.jsxDEV("ul",{className:g("",q.list),children:o.emptyLibraryTypes.map((v)=>N.jsxDEV(Ce,{label:qe(v),active:!1,href:Ae(k,v.entityType),onSelect:()=>e.onSelect(v.entityType)},v.entityType,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,(e.groupings?.items.length??0)>0?N.jsxDEV(He,{label:"Groups",children:(e.groupings?.items??[]).map((v)=>N.jsxDEV(Ce,{label:v.label,active:v.key===e.groupings?.active,href:Be(k,v.key),onSelect:()=>e.groupings?.onSelect(v.key)},v.key,!1,void 0,this))},void 0,!1,void 0,this):null,e.media?N.jsxDEV(He,{label:"Media",children:je.map((v)=>N.jsxDEV(Ce,{label:v.label,active:e.media?.active===v.key,href:v.path(k),onSelect:()=>e.media?.onSelect(v.key)},v.key,!1,void 0,this))},void 0,!1,void 0,this):null,S("Pages",o.libraryWorkspaces)]},void 0,!0,void 0,this);case"publish":return S(void 0,o.publishWorkspaces);case"brain":return N.jsxDEV(N.Fragment,{children:[o.brainTypeGroups.map(y),S("Pages",o.brainWorkspaces)]},void 0,!0,void 0,this);case"chat":return S(void 0,o.chatWorkspaces)}};return N.jsxDEV("nav",{className:g("types studio-navigation",q.navigation,i&&q.navigationCollapsed),"data-leaf-open":p,"data-collapsed":i,"aria-label":"Studio navigation",children:[N.jsxDEV("div",{className:g("studio-area-title",q.areaTitle,Re.eyebrow,i&&q.collapsedTitle),children:N.jsxDEV("button",{type:"button",className:g("studio-navigation-collapse",q.collapseButton),"aria-label":i?"Expand navigation":"Collapse navigation",title:i?"Expand navigation":"Collapse navigation","aria-expanded":!i,"aria-controls":p&&!i?b:void 0,onClick:T,children:i?"⇥":"⇤"},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.jsxDEV("div",{className:g("studio-leaf-scroll",q.leafScroll),children:a.filter((u)=>u.available).map((u)=>{let v=u.id===s,C=v&&p&&!i;return N.jsxDEV("section",{"aria-label":u.label,className:g("studio-area",q.section),children:[N.jsxDEV("button",{className:g(v?"studio-area-link active":"studio-area-link",q.areaLink,v&&q.areaActive,i&&q.collapsedLink),type:"button","aria-label":u.label,title:i?u.label:void 0,"aria-pressed":v,"aria-description":(u.badge??0)>0?`${u.badge} need attention`:void 0,"aria-controls":C?b:void 0,"aria-expanded":lt.includes(u.id)?C:void 0,onClick:()=>m(u.id),children:[N.jsxDEV("b",{className:g("",q.ordinal,v&&q.ordinalActive),children:N.jsxDEV(ut,{area:u.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.jsxDEV("span",{"data-area-label":u.label,className:g("",q.areaLabel,i&&q.collapsedLabel),children:[u.label,(u.badge??0)>0?N.jsxDEV("small",{className:g("",q.count),children:u.badge},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),C?N.jsxDEV("div",{id:b,className:g("studio-leaf-rail",q.leaf),"aria-label":`${u.label} destinations`,role:"group",children:x(u.id)},void 0,!1,void 0,this):null]},u.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Dt(e,t){return e.flatMap((n)=>{let[i]=n.options;if(!i)return[];return[{area:n.area,label:n.label,main:i,options:n.options,active:n.options.some((o)=>o.value===t),attention:n.options.reduce((o,a)=>o+(a.attention??0),0)}]})}var Qe=M(R(),1);var V=M(I(),1);function Vt(e){let[t,n]=Qe.useState(null),i=Qe.useRef(null),o=(a)=>{n(null),e.onSelect(a.value)};return V.jsxDEV(V.Fragment,{children:[V.jsxDEV("nav",{...r(F.bar),"aria-label":"Studio sections","data-studio-tab-bar":"",children:e.tabs.map((a)=>V.jsxDEV("a",{href:a.main.href,...r(F.tab,a.active&&F.active),"aria-current":a.active?"page":void 0,"aria-haspopup":a.active&&a.options.length>1?"dialog":void 0,"aria-label":a.attention>0?`${a.label}, ${a.attention} need you`:a.label,"data-studio-tab":a.area,onClick:(s)=>{if(!ie(s))return;if(s.preventDefault(),a.active&&a.options.length>1){i.current=s.currentTarget,n(a);return}o(a.main)},children:[V.jsxDEV("span",{...r(F.icon),children:V.jsxDEV(ut,{area:a.area},void 0,!1,void 0,this)},void 0,!1,void 0,this),a.label,a.attention>0&&V.jsxDEV("span",{...r(F.light),"aria-hidden":"true"},void 0,!1,void 0,this)]},a.area,!0,void 0,this))},void 0,!1,void 0,this),V.jsxDEV(Wt,{open:t!==null,onOpenChange:(a)=>{if(!a)n(null)},children:V.jsxDEV(Pt,{className:"studio-tab-sheet","aria-describedby":void 0,onCloseAutoFocus:(a)=>{a.preventDefault(),i.current?.focus()},children:[V.jsxDEV(Gt,{children:t?.label},void 0,!1,void 0,this),V.jsxDEV("ul",{...r(F.sheetList),children:t?.options.map((a)=>{let s=a.value===e.activeValue;return V.jsxDEV("li",{children:V.jsxDEV("a",{href:a.href,...r(F.option,s&&F.optionActive),"aria-current":s?"page":void 0,"aria-label":a.accessibleLabel,"data-studio-tab-option":a.value,onClick:(p)=>{if(!ie(p))return;p.preventDefault(),o(a)},children:[a.label,(a.attention??0)>0?V.jsxDEV("span",{...r(F.optionCount,F.optionAttention),children:[a.attention," need you"]},void 0,!0,void 0,this):a.tally!==void 0?V.jsxDEV("span",{...r(F.optionCount),children:a.tally},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},a.value,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var De=M(I(),1),ct="page:";function Ot(e){let{overviewWorkspace:t,chatWorkspace:n,homeWorkspaces:i,chatWorkspaces:o,libraryTypes:a,emptyLibraryTypes:s,libraryWorkspaces:p,publishWorkspaces:b,brainTypeGroups:m,brainWorkspaces:w}=e.model,T=ae(),k=(u)=>({value:`${Ne}${u.entityType}`,href:Ae(T,u.entityType),label:qe(u),...u.isSingleton?{}:{tally:u.count}}),y=(u)=>{let v=Le(u,e.workspaceBadges);return{value:`${Ie}${u.id}`,href:Xe(T,u.id),label:u.label,accessibleLabel:u.label,...v>0?{attention:v}:{}}},j=[{area:"home",label:"Home",options:[...t?[y(t)]:[],...i.map(y)]},{area:"library",label:"Library",options:[...a.map(k),...(e.groupings?.items??[]).map((u)=>({value:`${ce}${u.key}`,href:Be(T,u.key),label:u.label})),...e.media?je.map((u)=>({value:`${ct}${u.key}`,href:u.path(T),label:u.label})):[],...p.map(y),...s.map(k)]},{area:"publish",label:"Publish",options:b.map(y)},{area:"chat",label:"Chat",options:[...n?[y(n)]:[],...o.map(y)]},{area:"brain",label:"Brain",options:[...m.flatMap((u)=>u.types.map(k)),...w.map(y)]}].filter((u)=>u.options.length>0),S=e.media?.active?`${ct}${e.media.active}`:e.groupings?.active?`${ce}${e.groupings.active}`:e.active?`${Ne}${e.active}`:e.activeWorkspace?`${Ie}${e.activeWorkspace}`:"",x=(u)=>{let v=je.find((ge)=>u===`${ct}${ge.key}`);if(v){e.media?.onSelect(v.key);return}let C=It(u);if(C?.kind==="grouping"){e.groupings?.onSelect(C.id);return}if(C?.kind==="type"){e.onSelect(C.id);return}if(C?.kind==="workspace"&&C.id!==e.activeWorkspace)e.onSelectWorkspace?.(C.id)};if(e.hidden)return De.jsxDEV(De.Fragment,{},void 0,!1,void 0,this);return De.jsxDEV(Vt,{tabs:Dt(j,S),activeValue:S,onSelect:x},void 0,!1,void 0,this)}var fe=M(R(),1);function Rt(e){let{currentArea:t,destination:n,activeWorkspace:i,areaWorkspaces:o}=e,[a,s]=fe.useState(null),[p,b]=fe.useState(n);if(n!==p)b(n),s(null);let m=a??t,w=fe.useId(),T=(S)=>{let x=o.find((u)=>u&&Y(null,u)===S);if(x){if(x.id===i)s(null);else e.onSelectWorkspace?.(x.id);return}Ve(!1),s(S)},[k,y]=fe.useState(t?{[t]:!0}:{}),j=(S,x)=>{y((u)=>u[S]===x?u:{...u,[S]:x})};return{activeArea:m,leafOpen:m!==null&&e.hasList(m),browsing:a!==null,endBrowsing:()=>s(null),leafId:w,selectArea:T,openGroups:k,toggleGroup:j}}function dt(){try{let e=JSON.parse(window.localStorage.getItem("studio.recent-types")??"[]");return Array.isArray(e)?e.filter((t)=>typeof t==="string"):[]}catch{return[]}}function Lt(e){let t=[e,...dt().filter((n)=>n!==e)].slice(0,8);try{window.localStorage.setItem("studio.recent-types",JSON.stringify(t))}catch{}}var be=M(I(),1);function Ht(e,t){if(!t||ot.has(e))return"form";return Ee.find((n)=>n.types.some((i)=>i===e))?.presentation??"split"}function Bt(e){let[t]=Fe.useState(dt);Fe.useEffect(()=>{if(e.active)Lt(e.active)},[e.active]);let n=Ct({...e,recentTypes:t}),i=Rt({currentArea:n.currentArea,destination:n.destination,activeWorkspace:e.activeWorkspace,areaWorkspaces:[n.overviewWorkspace,n.chatWorkspace],hasList:(o)=>zt(n,o),onSelectWorkspace:e.onSelectWorkspace});return be.jsxDEV(be.Fragment,{children:[e.renderMode!=="desktop"?be.jsxDEV(Ot,{types:n.types,active:n.active,onSelect:e.onSelect,groupings:e.groupings,media:e.media,activeWorkspace:e.activeWorkspace,workspaceBadges:e.workspaceBadges,onSelectWorkspace:e.onSelectWorkspace,hidden:e.focus===!0,model:n,tree:i},void 0,!1,void 0,this):null,e.renderMode!=="mobile"?be.jsxDEV(At,{model:n,tree:i,focus:e.focus,active:n.active,onSelect:e.onSelect,groupings:e.groupings,media:e.media,activeWorkspace:e.activeWorkspace,workspaceBadges:e.workspaceBadges,onSelectWorkspace:e.onSelectWorkspace},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var pn=M(R(),1);var Ra="studio:open-palette";function kt(){window.dispatchEvent(new Event("studio:open-palette"))}var ei="studio:open-ask";function Xt(){window.dispatchEvent(new Event(ei))}var Qt=M(R(),1),xt=!1,pt=new Set;function Ha(e){if(e===xt)return;xt=e;for(let t of pt)t()}function ti(e){return pt.add(e),()=>pt.delete(e)}function Ft(){return Qt.useSyncExternalStore(ti,()=>xt,()=>!1)}var gt=M(R(),1),mt="console.climate";function Kt(){let e=null;try{e=window.localStorage}catch{}return{storage:e,root:document.documentElement,systemDark:()=>window.matchMedia("(prefers-color-scheme: dark)").matches}}function ni(e=Kt()){let t=null;try{t=e.storage?.getItem(mt)??null}catch{}return t==="paper"||t==="instrument"?t:"system"}function Ke(e,t=Kt()){try{if(e==="system")t.storage?.removeItem(mt);else t.storage?.setItem(mt,e)}catch{}let n=e==="system"?t.systemDark()?"instrument":"paper":e;t.root.setAttribute("data-climate",n),t.root.setAttribute("data-theme",n==="paper"?"light":"dark")}function Ut(e){let t=document.defaultView?.MutationObserver;if(!t)return()=>{};let n=new t(e);return n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-climate"]}),()=>n.disconnect()}function Yt(){return gt.useSyncExternalStore(Ut,()=>ni(),()=>"system")}function Zt(){return gt.useSyncExternalStore(Ut,()=>document.documentElement.getAttribute("data-climate")==="instrument"?"instrument":"paper",()=>"paper")}var f={skip:{kVAEAm:"xixxii4",kY2c9j:"x11uqc5h",k87sOh:"xfr5jun",kbCHJM:"x1qpfodn",kAzted:"x1gg8mnh",kmVPX3:"x1ff1495",kWkggS:"x18s3upu",kMwMTN:"xqvuw85",kMzoRj:"xdh2fpr",ksu8eU:"x1y0btm7",kVAM5u:"xawfzfr",kmkexE:"xq2gx43",k3aq6I:"x1bee3ir x1wfrlr2",$$css:!0},header:{kVAEAm:"x1n2onr6 x71uzt7",k87sOh:"x1bfa1r9",kY2c9j:"xf5e64p",k1xSpc:"xrvj5dj x1ux6vrq",kwnvtZ:"x1a02dak",kUk6DE:"x3psx0u",kumcoG:"xp2jwox x1twgeho xhr0jsp",kGNEyG:"x6s0dn4",k1C7PZ:"x18hwk67 x1u4temk",khm7nJ:"x3pnbk8",kAzted:"x1wzw5q2 xlohplz",kmVPX3:"x168p7lp x15j6q5g xux5zyz",kt9PQ7:"x1qhh985 xwd3hym",kfdmCh:"x1q0q8m5",kL6WhQ:"xpqg30t",kWkggS:"x1dd94t5",$$css:!0},brand:{k1xSpc:"x78zum5",kSGwAc:"xkh2ocl xp6pnuw",k7Eaqz:"xeuugli x17yga0g",kAzted:"x1gg8mnh",kGNEyG:"x6s0dn4",kjj79g:"x1nhvcw1 xdlhuee",kOIVth:"x883omv",kg3NbH:"x12j899k xkc6btg xn3s92p",kWqL5O:"xs1s249 x1w3mbok",kSWEuD:"x32b0ac",k26BEO:"xe636ye",kWkggS:"xbslqsl x16qhwdp",kMwMTN:"xqvuw85",kybGjl:"x1hl2dhg",khDVqt:"xuxw1ft",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},brainName:{k1xSpc:"x1lliihq x1dky1ju xzd29fr",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",kMv6JI:"xssy22x",kGuDYH:"x19d36u7 x1r5g0cu",ka26j:"x1umjory",k63SB2:"xlpn31b",kb6lSQ:"x1ixy4ik",$$css:!0},brainAccent:{kMwMTN:"x1q7454x",kKX8nH:"x1k4tb9n",ka26j:"x62unnn",k63SB2:"x184j2wm",$$css:!0},phoneGone:{k1xSpc:"xkaaz9w",$$css:!0},brandGone:{k1xSpc:"x78zum5 xkaaz9w",$$css:!0},barFromStart:{kjj79g:"xa996tt",kGNEyG:"xp7j7s0",kOIVth:"xzzyo3b",$$css:!0},back:{k1xSpc:"x1s85apg x1h5fwb6",kgQiWS:"x1ku5rj1",kmuXW:"x2lah0s",kzqmXN:"x187nhsf",kZKoxP:"xn3w4p2",keTefX:"x18xomjl",kmVPX3:"x1717udv",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kMwMTN:"x1q7454x",kGuDYH:"xneq65o",kLWn49:"xo5v014",kkrTdU:"x1ypdohk",$$css:!0},pageTitle:{k1xSpc:"x1s85apg xfsj286",k7Eaqz:"xeuugli",kogj98:"x1ghz6dp",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",kMv6JI:"xssy22x",kGuDYH:"xosj86m",ka26j:"xucjisz",k63SB2:"xmvyi9x",kMwMTN:"xqvuw85",$$css:!0},phoneAction:{k1xSpc:"x1s85apg x1ux6vrq",kayTVb:"x10tba2y",kmuXW:"x2lah0s",kGNEyG:"x6s0dn4",kOIVth:"x1jnr06f",k7Eaqz:"xeuugli",$$css:!0},mark:{k1xSpc:"xrvj5dj",kUk6DE:"x3psx0u",kzqmXN:"x1849jeq",kZKoxP:"x1gnnpzl",kgQiWS:"x1ku5rj1",kMzoRj:"xvndefy",ksu8eU:"x1y0btm7",kVAM5u:"xawfzfr",kaIpWk:"x16rqkct",kMwMTN:"x1q7454x",kMv6JI:"xssy22x",kGuDYH:"xif65rj",k63SB2:"x1s688f",$$css:!0},location:{k1xSpc:"x78zum5",kUk6DE:"x168tng7",k7Eaqz:"xeuugli",kGNEyG:"x6s0dn4",kOIVth:"xmmi0ta",kGOSNy:"x1l3568u",$$css:!0},crumbs:{k1xSpc:"x78zum5",k7Eaqz:"xeuugli",kGNEyG:"x1pha0wt",kOIVth:"x17d4w8g",kVQacm:"xb3r6kr",khDVqt:"xuxw1ft",$$css:!0},crumbsGone:{k1xSpc:"x78zum5 xkaaz9w",$$css:!0},crumbItem:{k1xSpc:"x3nfvp2",k7Eaqz:"xeuugli",kGNEyG:"x1pha0wt",kOIVth:"x17d4w8g",kmuXW:"x2lah0s x1sb3ws4",$$css:!0},crumbSeparator:{kMwMTN:"x1v3krkk",kGuDYH:"x4z9k3i",$$css:!0},crumb:{kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"xk50ysn",kHdLCk:"xkaaz9w",$$css:!0},crumbLink:{kmVPX3:"x1717udv",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kkrTdU:"x1ypdohk",kMwMTN:"x1ar3pfp x1xiaf3t",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},crumbCurrent:{k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",kMwMTN:"xqvuw85",kMv6JI:"xssy22x",kGuDYH:"xwsyq91 x1szwvsd",ka26j:"xucjisz",k63SB2:"xmvyi9x",$$css:!0},lineBreak:{k1xSpc:"x1s85apg xfsj286",kayTVb:"x14yy4lh",kCS8Yb:"x1l7klhg",kZKoxP:"xqtp20y",$$css:!0},capsule:{k1xSpc:"x78zum5",kayTVb:"x1iqbltf",kUk6DE:"x168tng7",k7Eaqz:"xeuugli",kZKoxP:"xn3w4p2",kGNEyG:"x6s0dn4",kOIVth:"x1jnr06f",kg3NbH:"x14oi46j",kaIpWk:"x1e6avla",kWkggS:"x18s3upu",kGVxlE:"x1oyyjme",$$css:!0},search:{k1xSpc:"x78zum5",kUk6DE:"x12lumcd",k7Eaqz:"xeuugli",kZKoxP:"x1vqgdyp",kGNEyG:"x6s0dn4",kOIVth:"x883omv",kg3NbH:"x1dry65w",kMzoRj:"xc342km",kaIpWk:"x1e6avla",kWkggS:"xjbqb8w",kMwMTN:"x1ar3pfp x18m2ztq",kkrTdU:"x1ypdohk",kMv6JI:"x5ddh9m",kGuDYH:"xif65rj",k9WMMc:"x1yc453h",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},searchHint:{kUk6DE:"x12lumcd",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},ask:{kUk6DE:"x3psx0u",kAzted:"x21xpn4",kmVPX3:"x1csxjeb",kMzoRj:"xc342km",kaIpWk:"x1e6avla",kWkggS:"xc788m6",kMwMTN:"xb8ja0n",kkrTdU:"x1ypdohk",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"x1s688f",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},key:{k1xSpc:"x1rg5ohu xzd29fr",kmVPX3:"x12ox6j3",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1sxf85j",kMwMTN:"xgi1xjn",kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",$$css:!0},tools:{k1xSpc:"x78zum5 xisjrt3",kGNEyG:"x6s0dn4",kjj79g:"x13a6bvl",kOIVth:"x167g77z xfb96bw",$$css:!0},climate:{k1xSpc:"x3nfvp2 xkaaz9w",kOIVth:"x195vfkc",kmVPX3:"x9ms5i6",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1e6avla",$$css:!0},climateOption:{k1xSpc:"xrvj5dj",kzqmXN:"x1691je0",kZKoxP:"x1gnnpzl",kgQiWS:"x1ku5rj1",kmVPX3:"x1717udv",kMzoRj:"xc342km",kaIpWk:"x1e6avla",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn x18m2ztq",kkrTdU:"x1ypdohk",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},climateOn:{kWkggS:"x18s3upu",kGVxlE:"xmmh7sb",kMwMTN:"xqvuw85",$$css:!0},identity:{k1xSpc:"xrvj5dj",kUk6DE:"x3psx0u",kayTVb:"x1nuf2lx",kzqmXN:"x187nhsf",kZKoxP:"xn3w4p2",kgQiWS:"x1ku5rj1",kmVPX3:"x1717udv",kMzoRj:"xc342km",kaIpWk:"x16rqkct",kWkggS:"xjbqb8w",kkrTdU:"x1ypdohk",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},identityBadge:{k1xSpc:"xrvj5dj",kzqmXN:"x1691je0 x9swi1t",kZKoxP:"x90ne7k xhty0c3",kgQiWS:"x1ku5rj1",kaIpWk:"x16rqkct",kWkggS:"x11orspz",kMwMTN:"xb8ja0n",kMv6JI:"xssy22x",kGuDYH:"xif65rj",k63SB2:"xmvyi9x",kGVxlE:"x1gnnqk1 x1dhj52s",$$css:!0},identityCurrent:{kGVxlE:"xgc96el",$$css:!0},menu:{kzqmXN:"xdzyupr x1drzd2p",ks0D6T:"x1usz39j",$$css:!0},who:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1v2ro7d",kmVPX3:"x1s8cm8o",$$css:!0},whoBadge:{k1xSpc:"xrvj5dj",kUk6DE:"x3psx0u",kzqmXN:"x187nhsf",kZKoxP:"xn3w4p2",kgQiWS:"x1ku5rj1",kaIpWk:"x16rqkct",kWkggS:"x11orspz",kMwMTN:"xb8ja0n",kMv6JI:"xssy22x",kGuDYH:"x19d36u7",k63SB2:"xmvyi9x",$$css:!0},whoText:{k1xSpc:"xrvj5dj",k7Eaqz:"xeuugli",kOIVth:"x195vfkc",$$css:!0},name:{k1xSpc:"x1lliihq",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",kMwMTN:"xqvuw85",kMv6JI:"xssy22x",kGuDYH:"x19d36u7",ka26j:"xw8howw",k63SB2:"xmvyi9x",kb6lSQ:"x12oo3zp",kP9fke:"x6mezaz",$$css:!0},role:{k1xSpc:"x1lliihq",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"xo1l8bm",kb6lSQ:"x12oo3zp",kP9fke:"x6mezaz",$$css:!0},arrow:{koQZXg:"x8x9d4c",kMwMTN:"xgi1xjn",$$css:!0},newTab:{kGuDYH:"xfifm61",$$css:!0},appearance:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",kAzted:"x1wxaq2x",kg3NbH:"x1kw6p96",kMwMTN:"xgi1xjn",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",$$css:!0},appearanceLabel:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",$$css:!0},appearanceChoices:{k1xSpc:"x3nfvp2",koQZXg:"x8x9d4c",kOIVth:"x195vfkc",kmVPX3:"x9ms5i6",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1e6avla",$$css:!0},appearanceChoice:{k1xSpc:"xrvj5dj",kAzted:"xe0p6wg x19tnhmq",kgQiWS:"x1ku5rj1",kg3NbH:"x1awh872",kaIpWk:"x1e6avla",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kGuDYH:"xfifm61",k3XXqK:"x1t137rt",kfSwDN:"x87ps6o",kWkggS:"xjbqb8w xs1gn80",$$css:!0},appearanceOn:{kWkggS:"x1dd94t5",kGVxlE:"xmmh7sb",kMwMTN:"xqvuw85",$$css:!0},icon:{kUk6DE:"x3psx0u",kzqmXN:"x1se2ifz",kZKoxP:"x1ta3ar0",kDwRjp:"xbh8q5q",kjVXCG:"x73je2i",kfJifR:"x190q0s9",kU5bRw:"x1owpc8m",kJdQPc:"x1f6yumg",$$css:!0}};function Jt(e,t){return[...e,t].map((n)=>n?.trim()??"").filter((n,i,o)=>n!==""&&n!==o[i-1]).join(" — ")}var ii=604800000,_t="studio.draft.",en=oe.object({draft:oe.record(oe.string(),oe.unknown()),body:oe.string(),baseContentHash:oe.string().optional(),savedAt:oe.number()});function Ua(e,t){return`${_t}${e}.${t}`}function Ya(e,t,n){let{secretFields:i,...o}=n,a={...o,draft:Object.fromEntries(Object.entries(o.draft).filter(([s])=>!i.includes(s)))};e.setItem(t,JSON.stringify(en.parse(a)))}function Za(e,t,n){let i=e.getItem(t);if(i===null)return null;let o=en.safeParse(ai(i));if(!o.success||n-o.data.savedAt>ii)return e.removeItem(t),null;return o.data}function Ja(e,t){e.removeItem(t)}function tn(e,t){let n=`${_t}${t}.`;Array.from({length:e.length},(i,o)=>e.key(o)).filter((i)=>i?.startsWith(n)===!0).forEach((i)=>e.removeItem(i))}function ai(e){try{return JSON.parse(e)}catch{return}}var l=M(I(),1);function oi(e){try{tn(window.localStorage,e)}catch{}}function de(e,t){if(typeof document>"u")return t;return document.querySelector("[data-studio-root]")?.getAttribute(e)??t}function nn(e){return e.trim().slice(0,1).toUpperCase()}function ri(e){return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e}function an(e){window.location.assign(e)}function on(e){window.open(e,"_blank","noopener")}var si=[{value:"paper",label:"Light"},{value:"system",label:"Auto"},{value:"instrument",label:"Dark"}];function li(e){let t=e.name.trim(),n=t.lastIndexOf(" ");if(n<=0)return l.jsxDEV(l.Fragment,{children:t},void 0,!1,void 0,this);return l.jsxDEV(l.Fragment,{children:[t.slice(0,n)," ",l.jsxDEV("em",{className:g("",f.brainAccent),children:t.slice(n+1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ke(e){return l.jsxDEV("svg",{className:g("",f.icon),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:e.children},void 0,!1,void 0,this)}var rn=()=>l.jsxDEV(ke,{children:[l.jsxDEV("circle",{cx:"11",cy:"11",r:"7"},void 0,!1,void 0,this),l.jsxDEV("path",{d:"m20 20-3.5-3.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),ui=()=>l.jsxDEV(ke,{children:[l.jsxDEV("circle",{cx:"12",cy:"12",r:"4"},void 0,!1,void 0,this),l.jsxDEV("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),sn=()=>l.jsxDEV(ke,{children:l.jsxDEV("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),ci=()=>l.jsxDEV(ke,{children:[l.jsxDEV("circle",{cx:"12",cy:"8",r:"4"},void 0,!1,void 0,this),l.jsxDEV("path",{d:"M4 21a8 8 0 0 1 16 0"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),di=()=>l.jsxDEV(ke,{children:[l.jsxDEV("circle",{cx:"12",cy:"12",r:"9"},void 0,!1,void 0,this),l.jsxDEV("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),ki=()=>l.jsxDEV(ke,{children:l.jsxDEV("path",{d:"M4 19V9M10 19V5M16 19v-7M22 19H2"},void 0,!1,void 0,this)},void 0,!1,void 0,this),xi=()=>l.jsxDEV(ke,{children:l.jsxDEV("path",{d:"M15 4h4v16h-4M10 8l-4 4 4 4M6 12h11"},void 0,!1,void 0,this)},void 0,!1,void 0,this);function go(e){let t=ae(),n=de("data-studio-brand-name","Brain"),i=de("data-studio-principal-name","Your account"),o=de("data-studio-principal-role","trusted"),a=Jt([e.pageTitle,e.contextLabel],n);pn.useEffect(()=>{document.title=a},[a]);let s=de("data-studio-principal-id",""),p=de("data-studio-session-href",`/logout?return_to=${encodeURIComponent(t)}`),b=de("data-studio-site-href",""),m=de("data-studio-dashboard-href","/dashboard"),w=kn(t,ye),T=e.navigation?Y(e.navigation.types.find((A)=>A.entityType===e.navigation?.activeEntityType)??null,e.navigation.workspaces.find((A)=>A.id===e.navigation?.activeWorkspaceId)??null):null,k=e.navigation?.activeWorkspaceId===ye,y=xn(),j=Ft(),S=e.canAsk??j,x=Zt(),u=Yt(),v=T&&e.navigation?.activeEntityType?`${T.charAt(0).toUpperCase()}${T.slice(1)}`:"",C=[v&&v!==e.contextLabel?v:null,e.contextLabel,e.pageTitle&&e.pageTitle!==e.contextLabel?e.pageTitle:null].filter((A)=>Boolean(A)),ge=C.length-1;return l.jsxDEV("header",{className:g("studio-chrome",f.header),"aria-label":"Studio",children:[e.navigation&&l.jsxDEV(D,{type:"button",xstyle:f.skip,variant:"outline",className:"studio-skip-content",onClick:()=>{let A=document.querySelector('[data-studio-shell] main, [data-studio-shell] [role="main"]');if(A)A.tabIndex=-1,A.focus()},children:"Skip to content"},void 0,!1,void 0,this),l.jsxDEV("a",{className:g("studio-chrome-brand",f.brand,y?.back!==void 0&&f.brandGone),href:t,"aria-label":`${n} Studio`,children:[l.jsxDEV("span",{className:g("studio-chrome-mark",f.mark),"aria-hidden":"true",children:n.slice(0,1).toUpperCase()},void 0,!1,void 0,this),l.jsxDEV("span",{className:g("studio-chrome-brain",f.brainName),children:l.jsxDEV(li,{name:n},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.navigation?l.jsxDEV("div",{className:g("studio-chrome-mobile-navigation",q.mobileHost),children:l.jsxDEV(Bt,{renderMode:"mobile",groupings:e.navigation.groupings,media:e.navigation.media,types:e.navigation.types,active:e.navigation.activeEntityType,onSelect:e.navigation.selectEntityType,workspaces:e.navigation.workspaces,activeWorkspace:e.navigation.activeWorkspaceId,workspaceBadges:e.navigation.workspaceBadges,onSelectWorkspace:e.navigation.selectWorkspace,focus:e.navigation.editing===!0},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,l.jsxDEV("div",{className:g("studio-chrome-location",f.location,y?.back!==void 0&&f.barFromStart),"data-studio-phone-bar":"",children:[y?.back&&l.jsxDEV("button",{type:"button",className:g("studio-chrome-back",f.back),"aria-label":`Back to ${y.back.label}`,onClick:y.back.onBack,children:l.jsxDEV("span",{"aria-hidden":"true",children:"‹"},void 0,!1,void 0,this)},void 0,!1,void 0,this),y?.title&&l.jsxDEV("h1",{className:g("studio-chrome-page",f.pageTitle),children:y.title},void 0,!1,void 0,this),l.jsxDEV("nav",{className:g("studio-chrome-location-text",f.crumbs,y?.title!==void 0&&f.crumbsGone),"aria-label":"You are here",children:C.map((A,re)=>{let Me=re===ge,se=e.onContextClick!==void 0&&A===e.contextLabel&&!Me;return l.jsxDEV("span",{className:g("",f.crumbItem),children:[re>0&&l.jsxDEV("span",{className:g("",f.crumbSeparator),"aria-hidden":"true",children:"›"},void 0,!1,void 0,this),se?l.jsxDEV("button",{type:"button",className:g("",f.crumb,f.crumbLink),"data-studio-crumb":"",onClick:e.onContextClick,children:A},void 0,!1,void 0,this):l.jsxDEV("span",{className:g("",Me?f.crumbCurrent:f.crumb),"data-studio-crumb":"","aria-current":Me?"page":void 0,children:A},void 0,!1,void 0,this)]},`${re}:${A}`,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("span",{className:g("",f.lineBreak),"aria-hidden":"true"},void 0,!1,void 0,this),l.jsxDEV("div",{className:g("studio-chrome-capsule",f.capsule),children:[l.jsxDEV("button",{className:g("command-chip studio-chrome-command",f.search),type:"button","aria-label":"Search or run a command","aria-keyshortcuts":"Control+k Meta+k","data-studio-search":"",onClick:kt,children:[l.jsxDEV(rn,{},void 0,!1,void 0,this),l.jsxDEV("span",{className:g("",f.searchHint),children:S?"Search, open, or ask":"Search or open"},void 0,!1,void 0,this),l.jsxDEV("kbd",{className:g("",f.key),children:"⌘K"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S&&l.jsxDEV("button",{type:"button",className:g("studio-chrome-ask",f.ask),"data-studio-ask":"",onClick:Xt,children:"Ask"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:g("studio-chrome-tools",f.tools),children:[y?.action&&l.jsxDEV("div",{className:g("studio-chrome-phone-action",f.phoneAction),"data-studio-phone-action":"","data-operator-action-popover":"",children:y.action},void 0,!1,void 0,this),l.jsxDEV("div",{className:g("studio-chrome-climate",f.climate),role:"group","aria-label":"Light and dark",children:[l.jsxDEV("button",{type:"button",className:g("",f.climateOption,x==="paper"&&f.climateOn),"aria-label":"Light","aria-pressed":x==="paper",title:"Light",onClick:()=>Ke("paper"),children:l.jsxDEV(ui,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),l.jsxDEV("button",{type:"button",className:g("",f.climateOption,x==="instrument"&&f.climateOn),"aria-label":"Dark","aria-pressed":x==="instrument",title:"Dark",onClick:()=>Ke("instrument"),children:l.jsxDEV(sn,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(ln,{children:[l.jsxDEV(un,{asChild:!0,children:l.jsxDEV("button",{className:g("studio-chrome-identity",f.identity),type:"button","aria-label":`${i} account menu`,"aria-current":k?"page":void 0,children:l.jsxDEV("span",{className:g("",f.identityBadge,k&&f.identityCurrent),children:nn(i)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),l.jsxDEV(cn,{className:g("studio-chrome-identity-menu",f.menu),align:"end",sideOffset:8,collisionPadding:8,children:[l.jsxDEV(dn,{className:g("studio-chrome-identity-label",f.who),children:[l.jsxDEV("span",{className:g("",f.whoBadge),"aria-hidden":"true",children:nn(i)},void 0,!1,void 0,this),l.jsxDEV("span",{className:g("",f.whoText),children:[l.jsxDEV("strong",{className:g("",f.name),children:i},void 0,!1,void 0,this),l.jsxDEV("span",{className:g("",f.role),children:[ri(o)," · ",n]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(Ue,{},void 0,!1,void 0,this),l.jsxDEV(he,{onSelect:()=>{if(e.navigation){if(!k)e.navigation.selectWorkspace(ye)}else an(w)},children:[l.jsxDEV(ci,{},void 0,!1,void 0,this),"Your account",l.jsxDEV("span",{className:g("",f.arrow),"aria-hidden":"true",children:"→"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(he,{onSelect:kt,children:[l.jsxDEV(rn,{},void 0,!1,void 0,this),"Search and commands",l.jsxDEV("kbd",{className:g("",f.arrow,f.key),children:"⌘K"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:g("",f.appearance),children:[l.jsxDEV("span",{className:g("",f.appearanceLabel),children:[l.jsxDEV(sn,{},void 0,!1,void 0,this),"Appearance"]},void 0,!0,void 0,this),l.jsxDEV(yt.RadioGroup,{className:g("",f.appearanceChoices),value:u,onValueChange:(A)=>{if(A==="paper"||A==="instrument"||A==="system")Ke(A)},"aria-label":"Appearance",children:si.map((A)=>l.jsxDEV(yt.RadioItem,{value:A.value,className:g("",f.appearanceChoice,u===A.value&&f.appearanceOn),onSelect:(re)=>re.preventDefault(),children:A.label},A.value,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(Ue,{},void 0,!1,void 0,this),b&&l.jsxDEV(he,{onSelect:()=>on(b),children:[l.jsxDEV(di,{},void 0,!1,void 0,this),"Public site",l.jsxDEV("span",{className:g("",f.arrow,f.newTab),children:"new tab ↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(he,{onSelect:()=>on(m),children:[l.jsxDEV(ki,{},void 0,!1,void 0,this),"Public dashboard",l.jsxDEV("span",{className:g("",f.arrow,f.newTab),children:"new tab ↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(Ue,{},void 0,!1,void 0,this),l.jsxDEV(he,{variant:"destructive",onSelect:()=>{if(s)oi(s);an(p)},children:[l.jsxDEV(xi,{},void 0,!1,void 0,this),"Sign out"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var c={field:{k1xSpc:"x1lliihq",kmVPX3:"xvethbn",kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xltl5i9",kGO01o:"x1l90r2v xwr7mz2",k3VDzK:"x12xhqv2",kh9fTk:"xaoxr2g xokao6x",kQ2hZB:"x1nopeu7",knQIc7:"xgxr4er",kEsNXn:"x1hzjcfh",$$css:!0},label:{k1xSpc:"x78zum5",kjj79g:"x1qughib",kGNEyG:"x1pha0wt",kGuDYH:"xfifm61",k63SB2:"xk50ysn",kb6lSQ:"x16q24ku",kMwMTN:"xgi1xjn",k1K539:"xwoyzhm",$$css:!0},required:{kMv6JI:"xa9opjo",kKX8nH:"x1j61x8r",kGuDYH:"x1k6wstc",kMwMTN:"x1q7454x",$$css:!0},kind:{kMv6JI:"xa9opjo",kKX8nH:"x1j61x8r",kGuDYH:"x1k6wstc",kMwMTN:"x1jdz31e",k63SB2:"xo1l8bm",$$css:!0},inline:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kOIVth:"x883omv",$$css:!0},inlineLabel:{k1K539:"xat24cr",$$css:!0},control:{kVAM5u:"xck444f",kGVxlE:"xxkzt7h",kr4CYY:"xf2x79s",$$css:!0},date:{kMv6JI:"xa9opjo",kQNsl9:"x19aimcq xbzer8s",$$css:!0},fact:{k7Eaqz:"xeuugli",kHjlTd:"xj0a0fe",$$css:!0},readOnly:{kMv6JI:"xa9opjo",ksu8eU:"xbsl7fq",kWkggS:"xlu1wsh",kkrTdU:"x1h6gzvc",kSiTet:"x1667htg x1gmafxx",$$css:!0},imageRef:{k1xSpc:"x78zum5",kGNEyG:"x1qjc9v5",kOIVth:"x167g77z",kogj98:"x1q6ys4k",$$css:!0},imageCode:{k1xSpc:"x78zum5",k7Eaqz:"xeuugli",kUk6DE:"x98rzlu",kGNEyG:"x6s0dn4",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kWkggS:"x18s3upu",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kmVPX3:"x1asu97y",kaIpWk:"x12oqio5",kHjlTd:"xj0a0fe",$$css:!0},clear:{kMv6JI:"x5ddh9m",kGuDYH:"xfifm61",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h xt5ozwv",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn xz2iokx",kaIpWk:"x1sxf85j",kmVPX3:"x1x7i2cb",kkrTdU:"x1ypdohk",$$css:!0},upload:{k1xSpc:"xrvj5dj",kAPf3g:"x1o2pa38",kmVPX3:"x1n79iv5",kMzoRj:"xvndefy",ksu8eU:"xbsl7fq",kVAM5u:"x1vw2y1n x8bwlc1 x5nc5hl",kaIpWk:"xhpnuu7",kWkggS:"xom8tl7 x1b36lsf x1lfl0h9",kkrTdU:"x1ypdohk",k9WMMc:"x2b8uid",k1ekBW:"xq90yva x4wkmsb",kIyJzY:"xx6bhzk",kAMwcw:"xwji4o3",$$css:!0},glyph:{kMwMTN:"x1es3s4s",kVVagm:"x1e7j1t8",ka26j:"x1gtap3s",$$css:!0},uploadTitle:{keoZOQ:"x1xmf6yo",kMwMTN:"xqvuw85",kGuDYH:"x4z9k3i",k63SB2:"xk50ysn",$$css:!0},uploadNote:{keoZOQ:"x7r5mf7",kMwMTN:"x1ar3pfp",kVVagm:"xmjulw5",$$css:!0},file:{kVAEAm:"x10l6tqk",kzqmXN:"x1i1rx1s",kZKoxP:"xjm9jq1",kVQacm:"xb3r6kr",kz4h6p:"x1hyvwdk",$$css:!0},tags:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kOIVth:"x17d4w8g",$$css:!0},tag:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1nejdyq",kAzted:"xe0p6wg",kmVPX3:"xwxl2sp",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1e6avla",kWkggS:"x18s3upu",kMwMTN:"xgi1xjn",kGuDYH:"xfifm61",k7Eaqz:"xeuugli",kHjlTd:"xj0a0fe",$$css:!0},tagButton:{k1xSpc:"xrvj5dj",kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",kAzted:"xisnujt",kgQiWS:"x1ku5rj1",kMzoRj:"xc342km",kaIpWk:"x16rqkct",kWkggS:"xjbqb8w xuvuc2f x7gom6s",kMwMTN:"x1ar3pfp xz2iokx xi7w4f5",kkrTdU:"x1ypdohk",kVVagm:"x1ae94xz",koRygp:"xzy26m8",kya2p2:"x1fkvin3",kDjvIb:"xr6d2im",kTvGMo:"x756nxt",$$css:!0},literalInput:{kzqmXN:"x1o0uqad x1boxzuo",$$css:!0},listHelp:{kMwMTN:"x1ar3pfp",kGuDYH:"xfifm61",kLWn49:"x1evy7pa",kHjlTd:"xj0a0fe",$$css:!0},tagAdd:{kE3dHu:"xyndbda",$$css:!0},tagInput:{kzqmXN:"x14atkfc",k7Eaqz:"x12tqqkd xwlmubu",k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kMwMTN:"xqvuw85",kGuDYH:"xfifm61 xf2x79s",kGVxlE:"x1gnnqk1",k8Qsv1:"x1wku8z5",$$css:!0},assist:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",kmVPX3:"xri99sx",$$css:!0},suggestion:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kGNEyG:"x6s0dn4",kOIVth:"x17d4w8g",kogj98:"xjgi5au",kmVPX3:"xskserf",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"xmt0h0j",kaIpWk:"xu4hgxq",kWkggS:"x9kxhyz",$$css:!0},suggestionCopy:{kUk6DE:"xy3jww0",kGuDYH:"xfifm61",kLWn49:"xfrs9s4",kMwMTN:"xqvuw85",$$css:!0},suggestionTags:{k1xSpc:"x78zum5",kUk6DE:"xy3jww0",kwnvtZ:"x1a02dak",kOIVth:"x1nejdyq",$$css:!0},suggestionToken:{kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",kmVPX3:"x18juh3m",kaIpWk:"x12oqio5",kWkggS:"x18s3upu",kMwMTN:"xqvuw85",$$css:!0}};var ve=M(R(),1);var Ye={checkbox:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",kmuXW:"x2lah0s",keaTxX:"x1q9s9ta",$$css:!0},marker:{k1xSpc:"x1rg5ohu",keTefX:"x13fj5qh",kmVPX3:"x1987f1p",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"xawfzfr",kMwMTN:"x1q7454x",kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",k63SB2:"xo1l8bm",khDVqt:"xuxw1ft",$$css:!0},section:{kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xltl5i9",kmVPX3:"x1t7086c",k7Eaqz:"xeuugli",$$css:!0},head:{k1xSpc:"x78zum5",kjj79g:"x1qughib",kGNEyG:"x1pha0wt",kOIVth:"xou54vl",$$css:!0},title:{kMv6JI:"xssy22x",kGuDYH:"x1i1m3gp",kogj98:"x1ghz6dp",k63SB2:"xk50ysn",$$css:!0}};var K={count:{kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",kZCmMZ:"x25sj25",$$css:!0},frame:{kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"xur7f20",kmVPX3:"xskserf",kWkggS:"xbslqsl",k7Eaqz:"xeuugli",$$css:!0},select:{kUk6DE:"x1iojvbi",kzqmXN:"x14atkfc",k7Eaqz:"x1i9suas",ks0D6T:"x193iq5w",kAzted:"x21xpn4",kGuDYH:"xfifm61 xf2x79s",$$css:!0},slot:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1jnr06f",kUk6DE:"x1en5fvg",k7Eaqz:"xeuugli",ks0D6T:"x193iq5w",$$css:!0},input:{kUk6DE:"x98rzlu",k7Eaqz:"x450l9j",kzqmXN:"xja02kk",$$css:!0},helpText:{kMwMTN:"xgi1xjn",$$css:!0},help:{k1xSpc:"x78zum5",kjj79g:"x1qughib",kGNEyG:"x1pha0wt",kwnvtZ:"x1a02dak",kOIVth:"x167g77z",$$css:!0},suggestions:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kwnvtZ:"x1a02dak",kOIVth:"x167g77z",keoZOQ:"x1k70j0n",$$css:!0}};var xe={status:{kMwMTN:"xgi1xjn",kGuDYH:"x4z9k3i",kHjlTd:"xj0a0fe",$$css:!0},error:{k1xSpc:"x78zum5",kGNEyG:"x1pha0wt",kOIVth:"x1j9xkj6",kMwMTN:"x1mel2pz",kgeoSG:"xjsvk3w",kQcDng:"x69dl0f",k7yrt4:"xcj0i9h",$$css:!0},good:{kMwMTN:"x19k5i5u",$$css:!0},saveStatus:{kMv6JI:"xa9opjo",kGuDYH:"x1qt5hsa",koQZXg:"xcmxlu1",kHdLCk:"x5dg28r",keaIxW:"xhmgfki",kEh2j3:"x703316",kOqvnJ:"xmi8g4k",kN0ZIM:"x14b9exp",kr4CYY:"x155ir8z",katwyW:"x1qp586l",$$css:!0},saveError:{kMwMTN:"xj8651r",$$css:!0},validationSummary:{k7Eaqz:"xeuugli",ks0D6T:"x193iq5w",kHjlTd:"xj0a0fe",$$css:!0},validationDetails:{kskxy:"x1js9hbl",kORKVm:"x1odjw0f",kZeWKH:"xish69e",$$css:!0},saveGood:{kMwMTN:"xic3461",$$css:!0},conflict:{kVAEAm:"x10l6tqk",kCIrl2:"xn5hqff",krVfgx:"xgcxmh",kzqmXN:"xk0hezx",ks0D6T:"x197vjsw",kUOVxO:"xrxpjvj",kmVPX3:"x1gqud3g",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x1rrq9tc",kaIpWk:"xur7f20",kWkggS:"xy32unz",kGVxlE:"x1hc8we6",kHjlTd:"xj0a0fe",$$css:!0},conflictTitle:{k1K539:"x12nagc",kMwMTN:"xqvuw85",kVVagm:"x1bcsevs",ka26j:"x1nqv8xj",$$css:!0},conflictCopy:{k1K539:"xyorhqc",kMwMTN:"xgi1xjn",kGuDYH:"xfifm61",$$css:!0},reload:{kAzted:"x1rz828m x1c4ya5t",kmVPX3:"xk61eof",kGuDYH:"x1j6dyjg",$$css:!0},wrap:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",k7Eaqz:"xeuugli",kwnvtZ:"x1a02dak",kOIVth:"x167g77z",kqGvvJ:"x1jp4ehj",$$css:!0},stations:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kwnvtZ:"x1a02dak",kOIVth:"x167g77z",$$css:!0},station:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xmmi0ta",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kb6lSQ:"x1dgsrnt",kMwMTN:"x1ar3pfp xwj15ni",khDVqt:"xuxw1ft",$$css:!0},done:{kMwMTN:"xqvuw85 x1xvnxvj",$$css:!0},active:{kMwMTN:"xqvuw85 x1xvnxvj",$$css:!0},dot:{kzqmXN:"x1wc42o8",kZKoxP:"xegnrdp",kaIpWk:"x16rqkct",kMzoRj:"xvndefy",ksu8eU:"x1y0btm7",kVAM5u:"x1vw2y1n xcdqty3",k1ekBW:"x11vqxbs x4wkmsb",kIyJzY:"x13dflua",kAMwcw:"xwji4o3",$$css:!0},doneDot:{kWkggS:"x1wztykf",kVAM5u:"x5a8oox xcdqty3",kGVxlE:"x7yya20",$$css:!0},activeDot:{kWkggS:"xnrmrls",kVAM5u:"x11qqpng xcdqty3",kKVMdj:"x1cs8pv1 x1aquc0h",k44tkh:"x1m9vv7p",kyAemX:"x4hg4is",ko0y90:"xa4qsjk",$$css:!0},noGit:{kKX8nH:"x1k4tb9n",$$css:!0},track:{kZKoxP:"xjm9jq1",kzqmXN:"x1691je0 xxydkhx",kWkggS:"x3ee1ji x10zscow",kogj98:"xmtjor9",kVAEAm:"x1n2onr6",kVQacm:"xb3r6kr",k1xSpc:"x1rg5ohu xkaaz9w",$$css:!0},flow:{kVAEAm:"x10l6tqk",kpwlN0:"x10a8y8t",kKwaWg:"x295toi",k3aq6I:"x5i6ehr",$$css:!0},flowing:{kKVMdj:"x1xftmv1 x1aquc0h",k44tkh:"xegkacw",kyAemX:"x4hg4is",ko0y90:"xa4qsjk",$$css:!0},ref:{kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kMwMTN:"x1ar3pfp xwj15ni",khDVqt:"xuxw1ft",$$css:!0},refValue:{kMwMTN:"xqvuw85 x1xvnxvj",k63SB2:"xk50ysn",$$css:!0}};var mn=M(I(),1);function Z(e){let t=e.inline?"span":"p";return mn.jsxDEV(t,{"data-studio-status":e.tone??"neutral",role:e.tone==="error"?"alert":void 0,className:O(e.className??"",xe.status,e.tone==="error"&&xe.error,e.tone==="good"&&xe.good,e.save&&xe.saveStatus,e.save&&e.tone==="error"&&xe.saveError,e.save&&e.tone==="good"&&xe.saveGood),children:e.children},void 0,!1,void 0,this)}var z=M(I(),1);function gn(e){let t=ve.useId(),n=ve.useId(),i=ve.useId(),[o,a]=ve.useState(""),{multiple:s,values:p}=e.definition,b=p!==void 0,m=e.value===void 0||Array.isArray(e.value)&&e.value.every((x)=>typeof x==="string"),w=Array.isArray(e.value)?e.value.filter((x)=>typeof x==="string"):[],T=[...new Set(e.suggestions??[])].filter((x)=>!w.includes(x)),k=!s&&w.length>0,y={"aria-invalid":e.errorId?!0:void 0,"aria-describedby":[b?void 0:n,e.errorId].filter(Boolean).join(" ")||void 0},j=(x)=>{if(e.readOnly||!m)return;if(!s)e.onChange([x]);else if(!w.includes(x))e.onChange([...w,x]);a("")},S=()=>{if(o.length>0)j(o)};return z.jsxDEV("div",{...r(c.field),"data-studio-field":"grouping-membership",children:[z.jsxDEV("div",{id:i,...r(e.purpose==="allowed-values"?c.file:c.label),children:[z.jsxDEV("span",{children:e.label},void 0,!1,void 0,this),e.purpose!=="allowed-values"&&z.jsxDEV("em",{...r(c.kind),children:s?"several":"one"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!m?z.jsxDEV(Z,{tone:"error",children:"This field is not a list of text values. Repair its source before changing memberships."},void 0,!1,void 0,this):z.jsxDEV(z.Fragment,{children:[z.jsxDEV("div",{...r(K.frame),role:"group","aria-labelledby":i,...y,children:z.jsxDEV("div",{...r(c.tags),children:[w.map((x,u)=>z.jsxDEV("span",{...r(c.tag),"data-grouping-member":"",children:[z.jsxDEV("span",{children:X(x)},void 0,!1,void 0,this),e.counts&&z.jsxDEV("span",{...r(K.count),"aria-label":e.counts.has(x)?`${e.counts.get(x)} entries`:"Usage unavailable",children:e.counts.get(x)??"—"},void 0,!1,void 0,this),p&&!p.includes(x)&&z.jsxDEV("span",{...r(Ye.marker),children:"not in list"},void 0,!1,void 0,this),!e.readOnly&&z.jsxDEV(D,{type:"button",variant:"ghost",size:"icon-xs",xstyle:c.tagButton,"aria-label":`Remove ${X(x)}`,onClick:()=>e.onChange(w.filter((v,C)=>C!==u)),children:"×"},void 0,!1,void 0,this)]},`${u}:${x}`,!0,void 0,this)),!e.readOnly&&(p?z.jsxDEV(J,{id:t,"aria-label":`${k?"Replace":"Add"} ${e.label} value`,...y,xstyle:[c.control,K.select],value:"",onChange:(x)=>{if(x.currentTarget.value==="")return;let u=p[Number(x.currentTarget.value)];if(u!==void 0)j(u)},children:[z.jsxDEV("option",{value:"",disabled:!0,children:p.every((x)=>w.includes(x))?"No other listed values":k?"Replace value…":"Choose value…"},void 0,!1,void 0,this),p.map((x,u)=>w.includes(x)?null:z.jsxDEV("option",{value:String(u),children:X(x)},x,!1,void 0,this))]},void 0,!0,void 0,this):z.jsxDEV("span",{...r(K.slot),children:[z.jsxDEV(te,{id:t,type:"text","aria-label":`${k?"Replace":"Add"} ${e.label} value`,...y,xstyle:[c.tagInput,c.literalInput,K.input],value:o,placeholder:k?"Replace value…":"Add a value…",onChange:(x)=>a(x.currentTarget.value),onKeyDown:(x)=>{if(x.nativeEvent.isComposing||x.key!=="Enter")return;x.preventDefault(),S()}},void 0,!1,void 0,this),z.jsxDEV(D,{type:"button",size:"sm",variant:"ghost","aria-label":k?"Replace value":"Add value",disabled:o.length===0,onClick:S,children:k?"Replace":"Add"},void 0,!1,void 0,this)]},void 0,!0,void 0,this))]},void 0,!0,void 0,this)},void 0,!1,void 0,this),!b&&!e.readOnly&&z.jsxDEV(z.Fragment,{children:[z.jsxDEV("div",{...r(K.help),children:[z.jsxDEV("span",{id:n,...r(c.listHelp,K.helpText),children:[s?"Enter adds one exact value.":"A new value replaces the current choice."," ","Commas and spaces are literal.",(o!==o.trim()||w.some((x)=>x!==x.trim()))&&z.jsxDEV("strong",{children:[" ","Surrounding whitespace is preserved and creates a different group."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.assist]},void 0,!0,void 0,this),T.length>0&&z.jsxDEV("div",{...r(K.suggestions),children:[z.jsxDEV("span",{...r(c.kind),children:"From your entries"},void 0,!1,void 0,this),T.map((x)=>z.jsxDEV(D,{type:"button",size:"xs",variant:"outline","aria-label":`Choose ${X(x)}`,onClick:()=>j(x),children:X(x)},x,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var ft=M(I(),1);function yn({value:e,vocabulary:t}){return ft.jsxDEV("span",{children:[X(e),t?.values&&!t.values.includes(e)&&ft.jsxDEV("span",{...r(Ye.marker),children:"not in list"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var pe={root:{k7Eaqz:"xeuugli",$$css:!0},collectionIntro:{kogj98:"x1r2gm6t",kMwMTN:"xgi1xjn",kGuDYH:"xif65rj",kLWn49:"x11m8ghp",ks0D6T:"x15g8yj6",$$css:!0},grid:{k1xSpc:"xrvj5dj",kumcoG:"xcjjqqt",kOIVth:"x1wszfx9 xqdxl5a",kjdo94:"xirox3h",$$css:!0},wide:{kBCFzs:"x1osaytk",k7Eaqz:"xeuugli",$$css:!0},onlyField:{kBCFzs:"xk8na9e",$$css:!0},link:{kMwMTN:"xqvuw85",kcSHmL:"xda060z",$$css:!0},section:{kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xltl5i9",keoZOQ:"xjv05ge",kLKAdn:"x1p5oq8j",k7Eaqz:"xeuugli",$$css:!0},heading:{kGuDYH:"xif65rj",k63SB2:"x19s9jnd",keoZOQ:"xdj266r",k1K539:"xieb3on",kMwMTN:"xqvuw85",$$css:!0},intro:{kMwMTN:"xgi1xjn",kGuDYH:"xif65rj",kLWn49:"x11m8ghp",ks0D6T:"x15g8yj6",kogj98:"x108hnsc",kKwWVI:"xbfn22o",$$css:!0},bodyHeading:{kmVPX3:"xhlzbb6",kRugJJ:"x1pmdsly",$$css:!0},description:{kMwMTN:"xgi1xjn",kGuDYH:"x4z9k3i",kLWn49:"x11m8ghp",keoZOQ:"x1xmf6yo",k1K539:"x1c436fg",ks0D6T:"x15g8yj6",$$css:!0},profile:{kogj98:"x1ghz6dp",k7Eaqz:"xeuugli",$$css:!0},row:{k1xSpc:"xrvj5dj",kumcoG:"x1yzlmg0",kOIVth:"x16stusp",k8WAf4:"xhyosrm",kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xltl5i9",k1JLwA:"x4jmfmw",$$css:!0},term:{kGuDYH:"xfifm61",k63SB2:"x19s9jnd",kMwMTN:"xgi1xjn",kHjlTd:"xj0a0fe",$$css:!0},value:{kogj98:"x1ghz6dp",k7Eaqz:"xeuugli",khDVqt:"x126k92a",kHjlTd:"xj0a0fe",kGuDYH:"xif65rj",kLWn49:"x11m8ghp",$$css:!0},list:{kogj98:"x1ghz6dp",kZCmMZ:"x106a9eq",$$css:!0}};var L=M(I(),1);function Se({value:e,fields:t,literalStrings:n,vocabulary:i}){if(n&&typeof e==="string")return L.jsxDEV(yn,{value:e,vocabulary:i},void 0,!1,void 0,this);if(e===void 0||e===null||e==="")return L.jsxDEV("span",{children:"Not set"},void 0,!1,void 0,this);if(Array.isArray(e))return e.length?L.jsxDEV("ul",{...r(pe.list),children:e.map((o,a)=>L.jsxDEV("li",{children:L.jsxDEV(Se,{value:o,fields:t,literalStrings:n,vocabulary:i},void 0,!1,void 0,this)},a,!1,void 0,this))},void 0,!1,void 0,this):L.jsxDEV("span",{children:"None"},void 0,!1,void 0,this);if(fn(e))return L.jsxDEV("dl",{...r(pe.profile),children:Object.entries(e).map(([o,a])=>L.jsxDEV("div",{...r(pe.row),children:[L.jsxDEV("dt",{...r(pe.term),children:t?.find((s)=>s.name===o)?.label??o},void 0,!1,void 0,this),L.jsxDEV("dd",{...r(pe.value),children:L.jsxDEV(Se,{value:a,fields:t?.find((s)=>s.name===o)?.fields},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},o,!0,void 0,this))},void 0,!1,void 0,this);if(typeof e==="string"&&/^https?:\/\//.test(e))return L.jsxDEV("a",{href:e,...r(pe.link),children:e},void 0,!1,void 0,this);return L.jsxDEV("span",{children:typeof e==="boolean"?e?"Yes":"No":String(e)},void 0,!1,void 0,this)}var vn=M(R(),1);var G=M(I(),1);function Sn(e){if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(typeof t!=="object"||t===null)return[];let n=Reflect.get(t,"name")??Reflect.get(t,"displayName"),i=Reflect.get(t,"id");return[{name:typeof n==="string"&&n.length>0?n:"Someone",...typeof i==="string"?{id:i}:{}}]})}function bn(e){return`user:${e.id}`}function wn(e){let t=Sn(e.value);if(t.length===0)return null;return G.jsxDEV("div",{...r(c.field),"data-studio-field":"people",children:[G.jsxDEV("div",{...r(c.label),children:G.jsxDEV("span",{children:e.label},void 0,!1,void 0,this)},void 0,!1,void 0,this),G.jsxDEV("div",{...r(c.tags),children:t.map((n,i)=>G.jsxDEV("span",{...r(c.tag),children:n.name},`${i}:${n.name}`,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function pi(e){let t=vn.useId(),n=Sn(e.value),i=new Set(n.flatMap((a)=>a.id??[])),o=e.members.filter((a)=>!i.has(bn(a)));return G.jsxDEV("div",{...r(c.field),"data-studio-field":"members",children:[G.jsxDEV("div",{id:t,...r(c.label),children:G.jsxDEV("span",{children:e.label},void 0,!1,void 0,this)},void 0,!1,void 0,this),G.jsxDEV("div",{...r(K.frame),role:"group","aria-labelledby":t,children:G.jsxDEV("div",{...r(c.tags),children:[n.map((a,s)=>G.jsxDEV("span",{...r(c.tag),children:[G.jsxDEV("span",{children:a.name},void 0,!1,void 0,this),!e.readOnly&&G.jsxDEV(D,{type:"button",variant:"ghost",size:"icon-xs",xstyle:c.tagButton,"aria-label":`Remove ${a.name}`,onClick:()=>e.onChange(n.filter((p,b)=>b!==s)),children:"×"},void 0,!1,void 0,this)]},`${s}:${a.name}`,!0,void 0,this)),!e.readOnly&&o.length>0&&G.jsxDEV(J,{"aria-label":`Add to ${e.label}`,xstyle:[c.control,K.select],value:"",onChange:(a)=>{let s=o.find(({id:p})=>p===a.currentTarget.value);if(s)e.onChange([...n,{name:s.name,id:bn(s)}])},children:[G.jsxDEV("option",{value:"",children:"Add a member"},void 0,!1,void 0,this),o.map((a)=>G.jsxDEV("option",{value:a.id,children:a.name},a.id,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function mi(){let e=we(),{data:t}=hn({queryKey:["studio","members"],queryFn:()=>e.fetchMembers(),staleTime:60000});return t??[]}function $n(e){return G.jsxDEV(pi,{...e,members:mi()},void 0,!1,void 0,this)}var $e=M(I(),1),gi=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/;function bt(e){let t=gi.exec(e);return t?`${t[1]} ${t[2]} UTC`:void 0}function yi(e,t){if(typeof t==="string"){if(t.length===0)return;let n=bt(t);if(n)return n;return e==="origin"?t.charAt(0).toUpperCase()+t.slice(1):t}if(typeof t==="number"||typeof t==="boolean")return String(t);if(typeof t==="object"&&t!==null){let n=Reflect.get(t,"entityType"),i=Reflect.get(t,"entityId");if(typeof n==="string"&&typeof i==="string")return`${n} · ${i}`;let o=Reflect.get(t,"start"),a=Reflect.get(t,"end");if(typeof o==="string"&&typeof a==="string")return`${bt(o)??o} → ${bt(a)??a}`}return}function Mn(e){let t=yi(e.name,e.value),n=t===void 0&&fi(e.value)?e.value:void 0;if(t===void 0&&n===void 0)return null;return $e.jsxDEV("div",{...r(c.field),"data-studio-field":"provenance",children:[$e.jsxDEV("div",{...r(c.label),children:$e.jsxDEV("span",{children:e.label},void 0,!1,void 0,this)},void 0,!1,void 0,this),t!==void 0?$e.jsxDEV("span",{...r(c.fact),children:t},void 0,!1,void 0,this):$e.jsxDEV(Se,{value:n},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function fi(e){if(Array.isArray(e))return e.length>0;return typeof e==="object"&&e!==null&&Object.values(e).some((t)=>t!==void 0&&t!==null)}var B=M(R(),1);function Uo(e,t){return e.runWorkspaceAction(t.workspaceId,{actionId:t.action.actionId,input:t.action.input,...t.action.invocation?.mode==="prepare"?{mode:"prepare"}:t.action.invocation?.mode==="execute"?{mode:"execute",confirmationToken:t.action.invocation.token}:{}})}function Tn(e,t){return e.uploadFile(t)}var Ze={".pdf":"application/pdf",".epub":"application/epub+zip"},Yo=[...Object.values(Ze),...Object.keys(Ze)].join(",");async function Zo(e,t){let n=Ze[t.name.slice(t.name.lastIndexOf(".")).toLowerCase()],i=t.type===""?n:t.type;if(i===void 0||!Object.values(Ze).includes(i))throw Error("Documents takes PDF and EPUB files.");return e.uploadFile(i===t.type?t:new File([t],t.name,{type:i}))}function Jo(e,t){return e.deleteEntity(t.entityType,t.id)}function _o(e,t){let n=t.body===void 0?{}:{body:t.body};if(t.kind==="create")return e.createEntity({entityType:t.entityType,...t.idPath&&{idPath:t.idPath},frontmatter:t.frontmatter,...n});return e.updateEntity({entityType:t.entityType,id:t.id,frontmatter:t.frontmatter,baseContentHash:t.baseContentHash,...n})}var H={all:()=>["studio"],navigation:()=>["studio","navigation"],destination:(e)=>["studio","destination",e],workspaceScope:(e)=>["studio","workspace",e],workspace:(e,t={})=>["studio","workspace",e,t],agentTargets:(e,t)=>["studio","agent-targets",e,t],syncStatus:()=>["studio","sync-status"],schema:(e)=>["studio","schema",e],entityLists:()=>["studio","entities"],entities:(e)=>["studio","entities",e],entityPage:(e,t)=>["studio","entities",e,t],entity:(e,t)=>["studio","entity",e,t]};function ir(e,t){return{queryKey:H.destination(t),queryFn:({signal:n})=>{if(!t)throw Error("No creation destination selected");return e.previewDestination(t,n)},enabled:t!==null,retry:!1}}function ar(e){return{queryKey:H.navigation(),queryFn:()=>e.fetchNavigation()}}function or(e,t,n={}){return{queryKey:H.workspace(t,n),queryFn:()=>e.fetchWorkspace(t,n),placeholderData:En,staleTime:15000}}async function rr(e,t){await Promise.all([e.invalidateQueries({queryKey:H.workspaceScope(t)}),e.invalidateQueries({queryKey:H.navigation()})])}async function jn(e){await Promise.all([e.invalidateQueries({queryKey:H.entities("image")}),e.invalidateQueries({queryKey:H.entities("document")}),e.invalidateQueries({queryKey:H.navigation()}),e.invalidateQueries({queryKey:H.syncStatus()})])}function sr(e,t,n){return{queryKey:H.agentTargets(t,n),queryFn:()=>e.fetchAgentTargets(t,n)}}function lr(e){return{queryKey:H.syncStatus(),queryFn:()=>e.fetchSyncStatus()}}function ur(e,t){return{queryKey:H.schema(t),queryFn:()=>e.fetchSchema(t),staleTime:Number.POSITIVE_INFINITY}}function cr(e,t,n=me.parse({})){let i=me.parse(n);return{queryKey:H.entityPage(t,i),queryFn:()=>e.fetchEntities(t,i)}}function dr(e,t,n){return{queryKey:H.entity(t,n),queryFn:()=>e.fetchEntity(t,n),staleTime:Number.POSITIVE_INFINITY}}var ne=M(R(),1);var U={details:{k1xSpc:"xrvj5dj",kumcoG:"x1mkdm3x",kOIVth:"x1af02g3",kogj98:"xjgi5au",$$css:!0},preview:{kFhvOy:"x1lqcxt8 xf9p01c",kzqmXN:"x14atkfc x1dbdljh",ks0D6T:"x193iq5w",kZKoxP:"xt7dq6l",kskxy:"xctk3hg xzp9ylj",kVIFPx:"x19kjcj4",kaIpWk:"x12oqio5",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",$$css:!0},fields:{k1xSpc:"xrvj5dj",kOIVth:"x883omv",k7Eaqz:"xeuugli",$$css:!0},label:{k1xSpc:"xrvj5dj",kOIVth:"x1jnr06f",$$css:!0},source:{kogj98:"x1ghz6dp",kGuDYH:"xfifm61",kMwMTN:"xgi1xjn",$$css:!0},uses:{k1xSpc:"xrvj5dj",kOIVth:"x17d4w8g",keoZOQ:"x1xmf6yo",$$css:!0},useList:{k1xSpc:"xrvj5dj",kOIVth:"x1jnr06f",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kB88ic:"xe8uvvx",$$css:!0},useLink:{kMwMTN:"xqvuw85",kGuDYH:"x2ouz8m",kcSHmL:"xda060z",$$css:!0}};var W=M(I(),1),bi={fallback:"Not described yet: the alt text stands in until the brain describes the image.",generated:"Written by the brain's vision model. Edit it to make it yours.",owner:"Written by you. The brain will not replace it."};function qn(e){let t=we(),[n,i]=ne.useState(null),[o,a]=ne.useState(""),[s,p]=ne.useState(""),[b,m]=ne.useState(),[w,T]=ne.useState(!1),[k,y]=ne.useState(!1);ne.useEffect(()=>{let S=!0;return i(null),y(!1),m(void 0),t.fetchImageDetails(e.imageId).then((x)=>{if(!S)return;i(x),a(x.title),p(x.alt)},()=>{if(S)y(!0)}),()=>{S=!1}},[t,e.imageId]);let j=async()=>{if(!n)return;T(!0),m(void 0);try{await t.saveImageDetails({id:n.id,title:o,alt:s,baseContentHash:n.contentHash});let S=await t.fetchImageDetails(n.id);i(S),m({tone:"good",text:"Image details saved."})}catch(S){m({tone:"error",text:_e(S)})}finally{T(!1)}};if(k)return W.jsxDEV("p",{...r(U.source),children:"This image's title and alt text are not available here."},void 0,!1,void 0,this);return W.jsxDEV("div",{...r(U.details),"data-studio-image-details":"",children:[W.jsxDEV(In,{imageId:e.imageId,alt:s,...r(U.preview)},void 0,!1,void 0,this),W.jsxDEV("div",{...r(U.fields),children:[W.jsxDEV("label",{...r(U.label),children:[W.jsxDEV("span",{...r(c.label),children:"Title"},void 0,!1,void 0,this),W.jsxDEV(te,{xstyle:c.control,type:"text",value:o,disabled:!n||w,onChange:(S)=>a(S.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.jsxDEV("label",{...r(U.label),children:[W.jsxDEV("span",{...r(c.label),children:"Alt text"},void 0,!1,void 0,this),W.jsxDEV(Je,{xstyle:c.control,rows:2,value:s,disabled:!n||w,onChange:(S)=>p(S.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n&&W.jsxDEV("p",{...r(U.source),children:bi[n.altSource]},void 0,!1,void 0,this),W.jsxDEV("div",{children:W.jsxDEV(D,{type:"button",variant:"outline",size:"sm",disabled:!n||w,onClick:()=>void j(),children:"Save image details"},void 0,!1,void 0,this)},void 0,!1,void 0,this),W.jsxDEV("div",{role:"status","aria-live":"polite",children:b&&W.jsxDEV(Z,{tone:b.tone,children:b.text},void 0,!1,void 0,this)},void 0,!1,void 0,this),n?.usedIn&&W.jsxDEV("section",{"data-studio-image-uses":"",...r(U.uses),children:[W.jsxDEV("h3",{...r(c.label),children:"Used in"},void 0,!1,void 0,this),n.usedIn.length===0?W.jsxDEV("p",{...r(U.source),children:"Not used in any entry yet."},void 0,!1,void 0,this):W.jsxDEV("ul",{...r(U.useList),children:n.usedIn.map((S)=>W.jsxDEV("li",{children:W.jsxDEV("a",{href:Nn(ae(),S.entityType,S.id),onClick:(x)=>{if(!e.onOpen||!ie(x))return;x.preventDefault(),e.onOpen(S.entityType,S.id)},...r(U.useLink),children:S.title},void 0,!1,void 0,this)},`${S.entityType}/${S.id}`,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var et=M(R(),1),An=M(I(),1),zn=et.createContext("save");function Mr(e){return An.jsxDEV(zn.Provider,{value:e.value,children:e.children},void 0,!1,void 0,this)}function Cn(){return et.useContext(zn)}var d=M(I(),1),ht=M(R(),1);function Vn(e){return e.some((t)=>t.name==="published"||t.name==="status"&&t.options?.includes("published"))}function hi(e,t){if(!e.condition)return!0;let n=e.condition.value,i=t[e.condition.field];return Array.isArray(n)?n.some((o)=>o===i):n===i}function Lr(e,t){let n=new Set(e.filter((i)=>!hi(i,t)).map((i)=>i.name));return Object.fromEntries(Object.entries(t).filter(([i])=>!n.has(i)))}function vi(e){let{descriptor:t,value:n,onChange:i}=e,o=Dn(),a=we(),s=Wn({mutationFn:(j)=>Tn(a,j),onSuccess:()=>{jn(o)}}),p=typeof n==="string"&&n.length>0?n:null,[b,m]=B.useState(null),w=B.useRef(null),T=B.useRef(!1),k=(j)=>{if(T.current)return;T.current=!0,m(j),s.mutate(j,{onSuccess:(S)=>{i(S.entityId),m(null)},onSettled:()=>{T.current=!1}})},y=d.jsxDEV("input",{ref:w,...r(c.file),tabIndex:p?-1:void 0,"aria-label":p?`Change ${t.label.toLowerCase()}`:void 0,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",disabled:s.isPending,onChange:(j)=>{let S=j.currentTarget.files?.[0];if(j.currentTarget.value="",S)k(S)}},void 0,!1,void 0,this);return d.jsxDEV("div",{...r(c.field),"data-studio-field":"image",children:[d.jsxDEV("span",{...r(c.label),children:t.label},void 0,!1,void 0,this),p?d.jsxDEV(d.Fragment,{children:[d.jsxDEV(qn,{imageId:p},void 0,!1,void 0,this),d.jsxDEV("p",{...r(c.imageRef),children:[d.jsxDEV(D,{type:"button",variant:"link",size:"xs",xstyle:c.clear,disabled:s.isPending,onClick:()=>w.current?.click(),children:"Change"},void 0,!1,void 0,this),y,d.jsxDEV(D,{type:"button",variant:"link",size:"xs",xstyle:c.clear,disabled:s.isPending,onClick:()=>{i(""),m(null),s.reset()},children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):d.jsxDEV("label",{...r(c.upload),children:[d.jsxDEV("span",{...r(c.glyph),"aria-hidden":"true",children:"↑"},void 0,!1,void 0,this),d.jsxDEV("strong",{...r(c.uploadTitle),children:"Choose an image"},void 0,!1,void 0,this),d.jsxDEV("small",{...r(c.uploadNote),children:"PNG, JPEG, GIF or WebP. Keep files below 10 MiB."},void 0,!1,void 0,this),y]},void 0,!0,void 0,this),d.jsxDEV("div",{role:"status","aria-live":"polite",children:[s.isPending&&d.jsxDEV(Z,{children:["Uploading ",b?.name,"… Wait for the upload before saving this reference."]},void 0,!0,void 0,this),s.isSuccess&&d.jsxDEV(Z,{tone:"good",children:["Uploaded ",s.variables.name,". It stays once the entry is saved."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.error&&d.jsxDEV(Z,{tone:"error",children:d.jsxDEV("span",{children:[b?.name,": ",_e(s.error)," Your previous image reference is unchanged.",d.jsxDEV("br",{},void 0,!1,void 0,this),"Choose another file, or retry. If the previous upload reached the server, retrying may create another image.",d.jsxDEV("br",{},void 0,!1,void 0,this),b&&d.jsxDEV(D,{type:"button",variant:"outline",onClick:()=>k(b),children:"Retry upload"},void 0,!1,void 0,this),d.jsxDEV(D,{type:"button",variant:"ghost",onClick:()=>{m(null),s.reset()},children:"Dismiss upload error"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Si(e){let t=e.trim().toLowerCase(),n=/series$/u.test(t)?"":/[^aeiou]ies$/u.test(t)?`${t.slice(0,-3)}y`:/(ss|x|z|ch|sh)es$/u.test(t)?t.slice(0,-2):/[^s]s$/u.test(t)?t.slice(0,-1):"";if(!n)return`an entry in ${t}`;return`${/^[aeiou]/u.test(n)?"an":"a"} ${n}`}function wi(e){let[t,n]=B.useState(""),i=B.useId(),o=B.useId(),a=e.literalList===!0,s=(e.suggestions??[]).filter((k)=>!(Array.isArray(e.value)?e.value:[]).includes(k)),p=Array.isArray(e.value)?e.value.filter((k)=>typeof k==="string"):[],b=Si(e.descriptor.label),m=a?"Add value":`Add ${b}`,w=a?`Add ${e.descriptor.label.toLowerCase()} value`:`New ${b.replace(/^an? /u,"")}`,T=()=>{let k=a?t:t.trim();if(k&&!p.includes(k))e.onChange([...p,k]);n("")};return d.jsxDEV("div",{...r(c.field),"data-studio-field":"tags",children:[d.jsxDEV("span",{...r(c.label),children:[e.descriptor.label,a&&d.jsxDEV("em",{...r(c.kind),children:"values"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d.jsxDEV("div",{...r(c.tags),children:[p.map((k)=>ht.createElement("span",{...r(c.tag),key:k},a?X(k):k,d.jsxDEV(D,{type:"button",variant:"ghost",size:"icon-xs",xstyle:c.tagButton,"aria-label":`Remove ${a?X(k):k}`,onClick:()=>e.onChange(p.filter((y)=>y!==k)),children:"×"},void 0,!1,void 0,this))),d.jsxDEV("span",{...r(c.tag,c.tagAdd),children:[d.jsxDEV(te,{xstyle:[c.tagInput,a&&c.literalInput],size:m.length+1,type:"text",value:t,list:s.length>0?o:void 0,"aria-label":w,"aria-describedby":a?i:void 0,placeholder:m,"data-studio-list-add":"",onChange:(k)=>n(k.currentTarget.value),onKeyDown:(k)=>{if(k.nativeEvent.isComposing)return;if(k.key==="Enter"||!a&&k.key===",")k.preventDefault(),T()}},void 0,!1,void 0,this),d.jsxDEV(D,{type:"button",variant:"ghost",size:"icon-xs",xstyle:c.tagButton,"aria-label":m,onClick:T,children:"+"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.length>0&&d.jsxDEV("datalist",{id:o,children:s.map((k)=>d.jsxDEV("option",{value:k},k,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a&&d.jsxDEV("span",{id:i,...r(c.listHelp),children:["Enter or + adds one value. Commas and spaces are literal.",(t!==t.trim()||p.some((k)=>k!==k.trim()))&&d.jsxDEV("strong",{children:[" ","Surrounding whitespace is preserved and creates a different group."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $i(e){if(e.widget==="text")return"summarize";if(e.widget==="list"&&e.field?.widget==="string")return"tag-suggest";return null}function Hr(e){let{descriptor:t,state:n,onRun:i,onApply:o,onDiscard:a}=e,s=$i(t);if(!s)return null;let p="field"in n&&n.field===t.name;if(p&&n.kind==="suggested")return d.jsxDEV("div",{...r(c.suggestion),children:[Array.isArray(n.suggestion)?d.jsxDEV("span",{...r(c.suggestionTags),children:n.suggestion.map((b)=>ht.createElement("code",{...r(c.suggestionToken),key:b},b))},void 0,!1,void 0,this):d.jsxDEV("span",{...r(c.suggestionCopy),children:n.suggestion},void 0,!1,void 0,this),d.jsxDEV(D,{type:"button",size:"xs",onClick:()=>o(n.field,n.suggestion),children:"Apply"},void 0,!1,void 0,this),d.jsxDEV(D,{type:"button",variant:"ghost",size:"xs",onClick:a,children:"Discard"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return d.jsxDEV("div",{...r(c.assist),children:[d.jsxDEV(D,{type:"button",variant:"outline",size:"xs",disabled:p&&n.kind==="loading",onClick:()=>i(s,t.name),children:p&&n.kind==="loading"?"Thinking…":s==="summarize"?"Write one for me":`Suggest ${t.label.toLowerCase()}`},void 0,!1,void 0,this),p&&n.kind==="error"&&d.jsxDEV(Z,{inline:!0,tone:"error",children:n.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Br(e){let t=B.useId(),n=Cn(),i=B.useRef(null),o=e.issues?.filter((a)=>a.path[0]===e.descriptor.name)??[];return B.useEffect(()=>{let a=i.current;if(!a?.hasAttribute("data-studio-invalid-field")||a!==a.closest("form")?.querySelector("[data-studio-invalid-field]"))return;let s=a.querySelector('input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [role="switch"]:not([disabled])');((s?.getAttribute("aria-describedby")?.split(" ").includes(t))?s:a).focus()},[e.issues,t]),d.jsxDEV("div",{ref:i,role:"group","aria-label":e.descriptor.label,tabIndex:-1,"aria-describedby":o.length?t:void 0,"data-studio-invalid-field":o.length?e.descriptor.name:void 0,children:[d.jsxDEV(Ti,{readOnly:e.readOnly,vocabulary:e.vocabulary,literalList:e.literalList,suggestions:e.suggestions,descriptor:e.descriptor,value:e.value,onChange:e.onChange,errorId:o.length?t:void 0},void 0,!1,void 0,this),o.length>0&&d.jsxDEV("div",{id:t,children:d.jsxDEV(Z,{tone:"error",children:[n==="save"&&"Last save: ",o.map((a)=>`${a.path.length>1?`${a.path.slice(1).join(".")}: `:""}${a.message}`).join(" · ")]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Mi(e,t){if(e.name==="published"&&e.widget==="boolean")return{label:"On the site",hint:t===!0?"Published: anyone can read it on the site.":"Draft: only you and your team see it."};if(e.name==="slug")return{label:"Web address",hint:"The last part of its address on the site. Changing it changes the address once it is published."};if(e.widget==="text"&&["excerpt","summary","description"].includes(e.name))return{label:e.label,hint:"One or two lines that show in lists and when shared."};return{label:e.label}}function Ti(e){let{descriptor:t,value:n,onChange:i,errorId:o}=e,a=Mi(t,n),s=B.useId(),p=[o,a.hint?s:void 0].filter(Boolean).join(" ")||void 0,b=a.hint?d.jsxDEV("span",{id:s,...r(c.listHelp),children:a.hint},void 0,!1,void 0,this):null,m={"aria-invalid":o?!0:void 0,"aria-describedby":p},w=t.required!==!1,T=typeof n==="string"||typeof n==="number"?String(n):"",k=d.jsxDEV("span",{...r(c.label),children:[a.label,w?d.jsxDEV("em",{...r(c.required),children:"required"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);if(t.widget==="image")return d.jsxDEV(vi,{descriptor:t,value:n,onChange:i},void 0,!1,void 0,this);if(t.widget==="boolean")return d.jsxDEV("div",{...r(c.field),"data-studio-field":"boolean",children:[d.jsxDEV("label",{...r(c.inline),children:[d.jsxDEV("span",{...r(c.label,c.inlineLabel),children:a.label},void 0,!1,void 0,this),d.jsxDEV(Pn,{...m,checked:n===!0,onCheckedChange:(y)=>i(y)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b]},void 0,!0,void 0,this);if(t.widget==="select")return d.jsxDEV("label",{...r(c.field),"data-studio-field":"select",children:[k,d.jsxDEV(J,{...m,xstyle:c.control,value:T,required:w,onChange:(y)=>i(y.currentTarget.value),children:[d.jsxDEV("option",{value:"",children:"—"},void 0,!1,void 0,this),(t.options??[]).map((y)=>d.jsxDEV("option",{value:y,children:tt(y)},y,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="text")return d.jsxDEV(d.Fragment,{children:[d.jsxDEV("label",{...r(c.field),"data-studio-field":"text",children:[k,d.jsxDEV(Je,{...m,xstyle:c.control,value:T,required:w,rows:4,onChange:(y)=>i(y.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b]},void 0,!0,void 0,this);if(t.widget==="list"&&t.field?.widget==="string"){if(e.vocabulary)return d.jsxDEV(gn,{label:t.label,definition:e.vocabulary,value:n,onChange:i,errorId:o,readOnly:e.readOnly,suggestions:e.suggestions},void 0,!1,void 0,this);return d.jsxDEV(wi,{literalList:e.literalList,suggestions:e.suggestions,descriptor:t,value:n,onChange:i},void 0,!1,void 0,this)}if(t.widget==="provenance")return d.jsxDEV(Mn,{name:t.name,label:t.label,value:n},void 0,!1,void 0,this);if(t.widget==="people")return d.jsxDEV(wn,{label:t.label,value:n},void 0,!1,void 0,this);if(t.widget==="members")return d.jsxDEV($n,{label:t.label,value:n,onChange:i,readOnly:e.readOnly},void 0,!1,void 0,this);if(t.widget==="list"||t.widget==="object")return d.jsxDEV("div",{...r(c.field),"data-studio-field":"structured",children:[d.jsxDEV("span",{...r(c.label),children:[t.label,d.jsxDEV("em",{...r(c.kind),children:"read-only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d.jsxDEV(Se,{value:n,fields:t.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return d.jsxDEV(d.Fragment,{children:[d.jsxDEV("label",{...r(c.field),"data-studio-field":t.widget,children:[k,d.jsxDEV(te,{...m,xstyle:[c.control,(t.widget==="datetime"||t.widget==="date")&&c.date],type:t.widget==="number"?"number":t.widget==="datetime"?"datetime-local":t.widget==="date"?"date":"text",value:t.widget==="datetime"?Gn(T):T,required:w,onChange:(y)=>{let j=y.currentTarget.value;if(t.widget==="date"&&j===""){i(void 0);return}i(t.widget==="datetime"&&j?new Date(j).toISOString():j)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b]},void 0,!0,void 0,this)}var On={"grouping-definitions":{title:"Groupings",intro:"Define how entries are collected, without moving or rewriting their content.",fieldsTitle:"",bodyTitle:"",bodyDescription:""},"anchor-profile":{intro:"Who this Brain represents. Profile details and the longer story belong to the same record.",fieldsTitle:"Profile details",bodyTitle:"Story",bodyDescription:"Longer background, kept as Markdown alongside the structured profile."},"brain-character":{intro:"The Brain’s name, role, purpose, and values. Everything is in this form.",fieldsTitle:"Character",bodyTitle:"Written content",bodyDescription:"Additional content supported by this record."},"style-guide":{intro:"Shared direction for writing and visual work. Detailed guidance remains part of the same record.",fieldsTitle:"Style details",bodyTitle:"Guidance",bodyDescription:"Examples, exceptions, and longer instructions. Structured direction stays above."},"site-info":{intro:"Shared site details. Update the existing settings in one place.",fieldsTitle:"Site details",bodyTitle:"Written content",bodyDescription:"Additional content supported by this record."},prompt:{intro:"Reusable instructions that guide the Brain in specific contexts.",fieldsTitle:"Properties",bodyTitle:"Instructions",bodyDescription:"Instructions, examples, and constraints for this prompt."},skill:{intro:"Capabilities advertised by the Brain and its collaborators.",fieldsTitle:"Properties",bodyTitle:"Capability notes",bodyDescription:"Additional details recorded for this capability."},playbook:{intro:"Operational instructions, kept together as a document.",fieldsTitle:"Properties",bodyTitle:"Procedure",bodyDescription:"Steps and guidance for a repeatable process."},swot:{intro:"Strengths, weaknesses, opportunities, and threats that inform your next steps.",fieldsTitle:"Properties",bodyTitle:"Analysis",bodyDescription:"Context, evidence, and implications of this assessment."},agent:{intro:"A connected agent’s identity, relationship, and capabilities.",fieldsTitle:"Agent details",bodyTitle:"Profile and capabilities",bodyDescription:"The description and capabilities recorded for this agent."}},Rn={prompts:"prompt",skills:"skill",playbooks:"playbook",swots:"swot",agents:"agent",siteInfo:"site-info",settings:"site-info",profile:"site-info"};function Ln(e){let t=(Object.hasOwn(Rn,e)?Rn[e]:void 0)??e;return Object.hasOwn(On,t)?On[t]:void 0}var Ei={entityType:"",format:"frontmatter",isSingleton:!1,hasBody:!1,fields:[]};function ji(e){return Object.fromEntries(e.flatMap((t)=>t.badge===void 0?[]:[[t.id,t.badge]]))}function Ni(e,t){return e.find((n)=>n.publishesEntityTypes===!0&&n.entityTypes.includes(t))}function Ii(e,t){let{mode:n,save:i}=e.editor,o=t?.capabilities,a=t?.hierarchy.nested===!0||(n.kind==="create"?!n.prefix:e.collectionQuery.prefix===null),s=o?.canCreate===!0&&a,p=n.kind==="create"?s:n.kind==="edit"&&o?.canUpdate===!0,b=n.kind==="create"&&n.segment!==void 0,m=e.creationDestination,w=b&&m.error instanceof Hn?m.error.issues:void 0;return{canCreate:s,canEdit:p,canDelete:o?.canDelete===!0,canPublish:o?.canPublish===!0,canAssist:p&&o?.canAssist===!0,namedCreate:b,fieldIssues:i.kind==="error"?i.issues:w,destinationBlocked:b&&(!m.data||m.pending||Boolean(m.error))}}function nt(e,t,n){return`${e} ${e===1?t:n}`}function qi(e,t){let{entityTotal:n,folders:i,collectionQuery:o}=e,{hierarchyKind:a}=t,s=Boolean(o.q)||o.visibility!=="all"||Boolean(o.status),p=o.scope==="folder"&&!o.q&&(o.prefix!==null||i.length>0),b=s?[]:p?n>0?[`${nt(n,"entry","entries")} here`]:[]:[nt(n,"entry","entries")],m=i.reduce((k,y)=>k+y.descendantCount,n),w=i.length>0?[`${nt(i.length,a,`${a}s`)} · ${nt(m,"entry","entries")} in total`]:[],T=o.prefix&&!p?[o.scope==="collection"?"Whole collection":`In this ${a}`]:[];return{collectionFiltered:s,directFolderCount:p,listingHead:{kicker:"Content library",access:St("trusted"),title:t.activeType?.label??e.entityType??"Library",metadata:[...b,...w,...T,...t.syncPending?["Sync pending"]:[]],totals:[]}}}function zi(e,t){let{entityType:n}=e,{mode:i}=e.editor,{activeType:o,entitySchema:a,systemDesign:s}=t,p=o?.label??n,b=o?.singularLabel??vt(p??"Entry"),m=o?.isSingleton?o.singularLabel:void 0,w=i.kind==="edit"?m??Xn(i.entity,i.entity.id===n?b:void 0):i.kind==="create"?m??`New ${Fn(b)}`:p,T=t.activeWorkspace?.label??s?.title??m??p??"Studio",k=t.activeWorkspace||s?vt(T):b,y=i.kind==="edit"&&Vn(a.fields)?Qn(i.entity):null,j=i.kind==="create"?"new":y??void 0;return{heading:w,collectionLabel:T,entryLabel:k,publicationState:y,editorHead:{kicker:a.isSingleton?`${Y(o??null,null)} / singleton`:T,access:St("trusted"),title:s?.title??w??"Editor",metadata:j?[`${k} · ${j}`]:[],totals:[]}}}function es(e){let{activeWorkspaceId:t,types:n,workspaces:i,declarativeWorkspaceData:o,entityType:a,entities:s,entityOffset:p,entityLimit:b,entityTotal:m,schema:w}=e,T=n.find((C)=>C.entityType===a),k=i.find((C)=>C.id===t),y=w??Ei,j=a??"",S=(e.groupings?.items??[]).filter((C)=>C.types.includes(j)),x=Ln(j),u=T?.hierarchy.kind??"folder",v=e.syncStatus?.git?.hasChanges===!0;return{activeType:T,activeWorkspace:k,entitySchema:y,presentation:Ht(y.entityType,y.hasBody),selectedEntityType:j,groupingFields:S.map((C)=>C.field),groupingVocabularies:Object.fromEntries(S.map((C)=>[C.field,C.rules??{multiple:!0}])),systemDesign:x,editing:!e.groupingView&&!t&&e.editor.mode.kind!=="browse",...Ii(e,T),hierarchyKind:u,...zi(e,{activeType:T,activeWorkspace:k,entitySchema:y,systemDesign:x}),syncPending:v,publicationWorkspace:Ni(i,j),pageEnd:Math.min(p+(s?.length??b),m),workspaceBadges:ji(i),...qi(e,{activeType:T,hierarchyKind:u,syncPending:v}),declarativeHead:k&&o?Bn(k,o.view):null}}var _=M(R(),1);var Q={scope:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1v2ro7d",kLKAdn:"xz9dl7a",kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",$$css:!0},scopeChoice:{kmVPX3:"xokocfn",kEafiO:"x972fbf",kWqL5O:"xgfja2r",kZ1KPB:"xyj58a3",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"x16stqrj",kWkggS:"xjbqb8w",kVVagm:"xln7xf2",kMwMTN:"x1heor9g",kkrTdU:"x1ypdohk",kiDhMy:"x1nx0emz",kLioUB:"xrp573z",kTWfjk:"x1c4ya5t",$$css:!0},controls:{k8WAf4:"xxlmvz2",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xpqg30t",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",kMwMTN:"x1ar3pfp",$$css:!0},row:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kwnvtZ:"x1a02dak",kOIVth:"x883omv",$$css:!0},filters:{kVAEAm:"x1uhb9sk",k1xSpc:"x1lp9gga",$$css:!0},summary:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1j9xkj6",kAzted:"x141feeh x1c4ya5t",kg3NbH:"xfoe8qy",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"xu4hgxq",kWkggS:"x18s3upu",kMwMTN:"xgi1xjn",kGuDYH:"x4z9k3i",kB88ic:"xe8uvvx",kkrTdU:"x1ypdohk",kGqHtl:"x1i5lizr",k3XXqK:"x1t137rt x9v5kkp",kMeerF:"x1de99jn",kjBf7l:"x1itw484",kInvED:"x1hl8ikr",$$css:!0},open:{kVAM5u:"xawfzfr",kMwMTN:"xqvuw85",$$css:!0},panel:{k1xSpc:"xrvj5dj",kOIVth:"x1v2ro7d",kumcoG:"x1rdfzu x4jmfmw",kVAEAm:"x10l6tqk xip7ul3",kY2c9j:"x1w0boku",k87sOh:"x1d1n87m xl7365u",kLqNvP:"x1o0tod",kzqmXN:"x3p9ev8 x1dbdljh",kCS8Yb:"xfhngxr",ks0D6T:"x193iq5w",keoZOQ:"xdj266r x7xdyrl",kmVPX3:"x1gnqi22 x1bf66pj",kMzoRj:"xmkeg23 xwddm5z",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"xhpnuu7",kWkggS:"x18s3upu x1norit2",kGVxlE:"x1mxzbga xlc8tcj",$$css:!0},state:{keTefX:"xvc5jky",kMwMTN:"x1ar3pfp",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",khDVqt:"xuxw1ft",$$css:!0}};var E=M(I(),1);function Ci(e){let t=_.useRef(null);return _.useEffect(()=>{let n=(i)=>{let o=t.current;if(i.key!=="Escape"||!o?.open||!(i.target instanceof Node)||!o.contains(i.target))return;i.preventDefault(),i.stopPropagation(),o.open=!1,o.querySelector("summary")?.focus()};return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[]),E.jsxDEV("section",{className:O("studio-collection-controls",Q.controls),"aria-label":e.label,children:E.jsxDEV("div",{className:O("",Q.row),children:[E.jsxDEV(st,{label:e.searchLabel,placeholder:e.searchLabel,value:e.search,wide:!0,onChange:e.onSearch},void 0,!1,void 0,this),E.jsxDEV("details",{ref:t,className:O("",Q.filters),onBlur:(n)=>{if(n.relatedTarget instanceof Node&&!n.currentTarget.contains(n.relatedTarget))n.currentTarget.open=!1},children:[E.jsxDEV("summary",{className:O("",Q.summary,e.filterCount>0&&Q.open),children:[e.filterLabel,e.filterCount>0?` · ${e.filterCount}`:""]},void 0,!0,void 0,this),E.jsxDEV("div",{className:O("",Q.panel),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.trailing,e.filtered&&E.jsxDEV(E.Fragment,{children:[e.matchingCount!==void 0&&E.jsxDEV("span",{className:O("",Q.state),children:[e.matchingCount," ",e.matchingCount===1?"match":"matches"]},void 0,!0,void 0,this),E.jsxDEV(D,{type:"button",variant:"ghost","aria-label":"Clear search and filters",onClick:e.onClear,children:"Clear"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function cs(e){if(e.offset===0&&!e.hasNext&&!e.loading)return null;let t=e.count>0?`${e.offset+1}–${e.offset+e.count}${e.total===void 0?"":` of ${e.total}`}`:"No results on this page";return E.jsxDEV("nav",{className:O("listing-pagination",Pe.pagination),"aria-label":e.label,"aria-busy":e.loading,children:[E.jsxDEV("span",{className:O("",Pe.range),"aria-live":"polite",children:e.loading?"Loading…":t},void 0,!1,void 0,this),E.jsxDEV("span",{className:O("",Pe.pager),children:[E.jsxDEV(D,{type:"button",variant:"ghost",disabled:e.loading||e.offset===0,onClick:e.onPrevious,children:"Previous"},void 0,!1,void 0,this),E.jsxDEV(D,{type:"button",variant:"ghost",disabled:e.loading||!e.hasNext,onClick:e.onNext,children:"Next"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ai=250;function ds(e){let[t,n]=_.useState(e.query.q);_.useEffect(()=>n(e.query.q),[e.query.q]);let i=_.useRef(e.onChange);i.current=e.onChange;let o=_.useRef(e.query);o.current=e.query,_.useEffect(()=>{if(t===o.current.q)return;let m=window.setTimeout(()=>{let w=me.safeParse({...o.current,q:t,offset:0});if(w.success)i.current(w.data)},Ai);return()=>window.clearTimeout(m)},[t]);let a=(m)=>{let w=me.safeParse({...e.query,...m,offset:0});if(w.success)e.onChange(w.data)},s=[...new Set([...e.fields.find((m)=>m.name==="status")?.options??[],e.query.status].filter(Boolean))],p=(e.query.visibility==="all"?0:1)+(e.query.status?1:0),b=Boolean(e.query.q)||p>0||e.query.sort!=="updated-desc";return E.jsxDEV(E.Fragment,{children:[E.jsxDEV(Ci,{label:"Collection search and filters",searchLabel:"Search title or content",search:t,onSearch:n,filterLabel:"Filter and sort",trailing:e.density&&e.onDensityChange&&E.jsxDEV("button",{type:"button","aria-label":"Compact rows","aria-pressed":e.density==="compact",className:O("",Q.summary,e.density==="compact"&&Q.open),onClick:()=>e.onDensityChange?.(e.density==="compact"?"comfortable":"compact"),children:"Compact"},void 0,!1,void 0,this),filterCount:p,filtered:b,matchingCount:e.total,onClear:()=>{n(""),e.onChange(me.parse({limit:e.query.limit,prefix:e.query.prefix,scope:e.query.scope}))},children:[E.jsxDEV("label",{children:["Visibility",E.jsxDEV(J,{value:e.query.visibility,onChange:(m)=>a({visibility:m.target.value}),children:[E.jsxDEV("option",{value:"all",children:"All available"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"public",children:"Public"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"shared",children:"Shared"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"restricted",children:"Restricted"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.length>0&&E.jsxDEV("label",{children:["Status",E.jsxDEV(J,{value:e.query.status,onChange:(m)=>a({status:m.target.value}),children:[E.jsxDEV("option",{value:"",children:"All statuses"},void 0,!1,void 0,this),s.map((m)=>E.jsxDEV("option",{value:m,children:tt(m)},m,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),E.jsxDEV("label",{children:["Sort",E.jsxDEV(J,{value:e.query.sort,onChange:(m)=>a({sort:m.target.value}),children:[E.jsxDEV("option",{value:"updated-desc",children:"Recently updated"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"updated-asc",children:"Least recently updated"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"created-desc",children:"Newest created"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"created-asc",children:"Oldest created"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),(e.query.prefix!==null||e.query.scope==="collection")&&E.jsxDEV("div",{role:"group","aria-label":"Search scope",className:O("",Q.scope),children:[E.jsxDEV("span",{children:"Search"},void 0,!1,void 0,this),E.jsxDEV("button",{type:"button","aria-pressed":e.query.scope==="folder",className:O("",Q.scopeChoice),onClick:()=>a({scope:"folder"}),children:["This ",e.kind??"folder"]},void 0,!0,void 0,this),E.jsxDEV("button",{type:"button","aria-pressed":e.query.scope==="collection",className:O("",Q.scopeChoice),onClick:()=>a({scope:"collection"}),children:"Whole collection"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{Ra as a,ei as b,Xt as c,Ke as d,Ha as e,Ft as f,Ua as g,Ya as h,Za as i,Ja as j,xe as k,Z as l,X as m,Ye as n,yn as o,Pe as p,Ci as q,cs as r,ds as s,je as t,Zn as u,Jn as v,Qi as w,c as x,U as y,Uo as z,Tn as A,Yo as B,Zo as C,Jo as D,_o as E,H as F,ir as G,ar as H,or as I,rr as J,jn as K,sr as L,lr as M,ur as N,cr as O,dr as P,qn as Q,F as R,$t as S,q as T,g as U,Bt as V,go as W,gn as X,pe as Y,Se as Z,Mr as _,hi as $,Lr as aa,Hr as ba,Br as ca,ji as da,Ni as ea,es as fa};
3
+
4
+ //# debugId=7C157D44E0385AAD64756E2164756E21