@krantho/studio 1.1.4 → 1.1.5

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 (96) hide show
  1. package/dist/assets/{AssistantPanel-DpYeurU-.js → AssistantPanel-CeOJfSzu.js} +2 -2
  2. package/dist/assets/GraphBrowser-BNto7hgk.js +2 -0
  3. package/dist/assets/GraphCanvas-Wo0XaRUG.js +1 -0
  4. package/dist/assets/{action-button-DIrhqMRc.js → action-button-DPLZn2gk.js} +1 -1
  5. package/dist/assets/api-seo-CL5Gq_tK.js +1 -0
  6. package/dist/assets/{arduino-DKR9_xyJ.js → arduino-LsGX0_fs.js} +1 -1
  7. package/dist/assets/{arrow-down-B5kfR2lG.js → arrow-down-EM8VW6wf.js} +1 -1
  8. package/dist/assets/{arrow-left-7opbl8fu.js → arrow-left-DDRnAcp0.js} +1 -1
  9. package/dist/assets/{auth-CIpilSKF.js → auth-Dw_S0y7Q.js} +1 -1
  10. package/dist/assets/{c-CEM0h_nK.js → c-8MGCQYww.js} +1 -1
  11. package/dist/assets/{circle-check-big-DQjpuxcC.js → circle-check-big-BoM2gsTK.js} +1 -1
  12. package/dist/assets/{circle-dashed-cuYrILNo.js → circle-dashed-BrW3fkOb.js} +1 -1
  13. package/dist/assets/{circle-x-peGpq98w.js → circle-x-BFRqOpao.js} +1 -1
  14. package/dist/assets/{clike-BlGBRct5.js → clike-DDEFrJkJ.js} +1 -1
  15. package/dist/assets/{clock-DoBIVjZO.js → clock-D6yo3SXy.js} +1 -1
  16. package/dist/assets/{collection-view-Bbr6ff-2.js → collection-view-m8EZ-LL6.js} +1 -1
  17. package/dist/assets/{copy-V85khWct.js → copy-DLNaHdGn.js} +1 -1
  18. package/dist/assets/{corner-down-right-BpwOGRFR.js → corner-down-right-DjKESJQq.js} +1 -1
  19. package/dist/assets/{cpp-C0nea612.js → cpp-CCXrbquo.js} +1 -1
  20. package/dist/assets/createLucideIcon-Bepm3pPy.js +1 -0
  21. package/dist/assets/{csharp-C430X67Y.js → csharp-C9B8MEOG.js} +1 -1
  22. package/dist/assets/{data-table-B1kqxrEw.js → data-table-CkVtHoRX.js} +1 -1
  23. package/dist/assets/{editor-page-ydSt1TIL.js → editor-page-DygzC7e2.js} +4 -4
  24. package/dist/assets/{empty-state-CeUZocHx.js → empty-state-CFOGJxEy.js} +1 -1
  25. package/dist/assets/{export-helpers-C_HVpJN9.js → export-helpers-88w7CxCC.js} +1 -1
  26. package/dist/assets/{external-link-Dh7p8Ii6.js → external-link-WjUzPJ5r.js} +1 -1
  27. package/dist/assets/fill-job-B7N4431e.js +1 -0
  28. package/dist/assets/{fill-run-view-ChrOLoV4.js → fill-run-view-CwWAvqg1.js} +1 -1
  29. package/dist/assets/{findability-BrhtZ2yD.js → findability-CMuvomGn.js} +1 -1
  30. package/dist/assets/{format-C3ZX9yGM.js → format-Bm7d76kc.js} +1 -1
  31. package/dist/assets/{go-2ldyX7zA.js → go-C0xZKYRK.js} +1 -1
  32. package/dist/assets/graph-config-CkeJgPns.js +1 -0
  33. package/dist/assets/{image-editor-CAZbOhRZ.js → image-editor-DUnZn-si.js} +1 -1
  34. package/dist/assets/index-CZQJBss1.js +2 -0
  35. package/dist/assets/{info-Cxkabti5.js → info-C_gFhCsx.js} +1 -1
  36. package/dist/assets/{java-BaDy4FT-.js → java-DQEBLEMZ.js} +1 -1
  37. package/dist/assets/{javascript-DoKZVVG7.js → javascript-fLcGJpXd.js} +1 -1
  38. package/dist/assets/{kotlin-aNSUnDDr.js → kotlin-BhmBVS_0.js} +1 -1
  39. package/dist/assets/{layers-0VWe0rKm.js → layers-BzWhM_T4.js} +1 -1
  40. package/dist/assets/{list-checks-BCEhMMVY.js → list-checks-BycWtY9-.js} +1 -1
  41. package/dist/assets/live-markdown-editor-ColMfnPc.js +54 -0
  42. package/dist/assets/{markdown-ChIsYjIt.js → markdown-Cxg2MxWr.js} +1 -1
  43. package/dist/assets/{markup-C09yLKTH.js → markup-CaYP0gdG.js} +1 -1
  44. package/dist/assets/{markup-templating-DNhq-UOv.js → markup-templating-DwmVPbHS.js} +1 -1
  45. package/dist/assets/{media-model-D4F1Farw.js → media-model-s8-mD6gc.js} +1 -1
  46. package/dist/assets/media-page-BIWNwixX.js +1 -0
  47. package/dist/assets/{meter-ZOLJ0WhG.js → meter-ZmQjbS6d.js} +1 -1
  48. package/dist/assets/{objectivec-s2I4Tn1D.js → objectivec-CHvtiGZJ.js} +1 -1
  49. package/dist/assets/{pen-line-B524Nue8.js → pen-line-tXXn2ou2.js} +1 -1
  50. package/dist/assets/{pencil-xdGZtrO4.js → pencil-CGbkYPXO.js} +1 -1
  51. package/dist/assets/{php-B_6N-5RT.js → php-SxIHzpF9.js} +1 -1
  52. package/dist/assets/{pulse-page-zRYAQJh6.js → pulse-page-rQssy-k-.js} +1 -1
  53. package/dist/assets/rolldown-runtime-9C0vUP4u.js +1 -0
  54. package/dist/assets/{rotate-ccw-BgARBEK3.js → rotate-ccw-IHHFmrqQ.js} +1 -1
  55. package/dist/assets/{ruby-C8GJZDTg.js → ruby--MTbGwza.js} +1 -1
  56. package/dist/assets/{save-ClSXW9cb.js → save-DWhrs5es.js} +1 -1
  57. package/dist/assets/{send-kYpW5JED.js → send-Bf0SGwsO.js} +1 -1
  58. package/dist/assets/setup-page-C2UVL4hj.js +1 -0
  59. package/dist/assets/site-CI7ReWwB.js +1 -0
  60. package/dist/assets/site-model-DwdSKSWR.js +1 -0
  61. package/dist/assets/{site-overview-B0Dnsj2N.js → site-overview-BnmQMy6p.js} +1 -1
  62. package/dist/assets/{structure-page-DpM1G-M9.js → structure-page-Cjqo5mS4.js} +2 -2
  63. package/dist/assets/{trash-DzRCm500.js → trash-DFKejXb4.js} +1 -1
  64. package/dist/assets/{triangle-exclamation-point-ttN5lZI0.js → triangle-exclamation-point-CxTYPLt1.js} +1 -1
  65. package/dist/assets/{typescript-s_P45ayF.js → typescript-DuydAHsI.js} +1 -1
  66. package/dist/assets/{upload-CaqQJaUr.js → upload-9M4suN_I.js} +1 -1
  67. package/dist/assets/{use-drawer-actions-BeAi2hJS.js → use-drawer-actions-CXYpJuv5.js} +1 -1
  68. package/dist/assets/use-loaded-DJHzW9zx.js +1 -0
  69. package/dist/assets/{use-locale-versions-CcJ_us1I.js → use-locale-versions-DXUTVGkz.js} +1 -1
  70. package/dist/assets/{vendor-diff-DGCTJYJ4.js → vendor-diff-B5uXPOYl.js} +40 -40
  71. package/dist/assets/vendor-markdown-BXQo8zdD.js +79 -0
  72. package/dist/assets/{vendor-media-DXSmPN_d.js → vendor-media-BVfbikEZ.js} +1 -1
  73. package/dist/assets/vendor-react-Njf47Pb1.js +15 -0
  74. package/dist/assets/{vendor-react-DLioOiRN.css → vendor-react-bSyOAvy0.css} +1 -1
  75. package/dist/assets/vendor-reactflow-D7sfycOJ.js +1 -0
  76. package/dist/assets/vendor-router-Cwn5_0Pw.js +1 -0
  77. package/dist/index.html +9 -9
  78. package/package.json +23 -23
  79. package/dist/assets/GraphBrowser-Cm5q82MJ.js +0 -2
  80. package/dist/assets/GraphCanvas-CZJNUa_J.js +0 -1
  81. package/dist/assets/api-seo-DeG5gsh6.js +0 -1
  82. package/dist/assets/createLucideIcon-BklFHeMd.js +0 -1
  83. package/dist/assets/fill-job-CKtHKXwV.js +0 -1
  84. package/dist/assets/graph-config-CgXhm7XP.js +0 -1
  85. package/dist/assets/index-d5j-az5g.js +0 -2
  86. package/dist/assets/live-markdown-editor-DSsCNBWR.js +0 -54
  87. package/dist/assets/media-page-DuSUjFO1.js +0 -1
  88. package/dist/assets/rolldown-runtime-COiEfhsA.js +0 -1
  89. package/dist/assets/setup-page-CshRkFJ-.js +0 -1
  90. package/dist/assets/site-CGs9-oiw.js +0 -1
  91. package/dist/assets/site-model-BXHOxNij.js +0 -1
  92. package/dist/assets/use-loaded-BNCu0C-c.js +0 -1
  93. package/dist/assets/vendor-markdown-BeOOOWTF.js +0 -74
  94. package/dist/assets/vendor-react-CXaWJ_ii.js +0 -15
  95. package/dist/assets/vendor-reactflow-CMKi7AEX.js +0 -1
  96. package/dist/assets/vendor-router-B4czwg8X.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krantho/studio",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Studio, the krantho dashboard for editors: a prebuilt React single-page app that every krantho server serves at /studio.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://krantho.com",
@@ -22,38 +22,38 @@
22
22
  "devDependencies": {
23
23
  "@fontsource-variable/bricolage-grotesque": "^5.3.0",
24
24
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
25
- "@krantho/ai": "1.1.4",
26
- "@krantho/core": "1.1.4",
27
- "@krantho/seo-shared": "1.1.4",
28
- "@milkdown/core": "7.23.0",
29
- "@milkdown/plugin-history": "7.23.0",
30
- "@milkdown/preset-commonmark": "7.23.0",
31
- "@milkdown/preset-gfm": "7.23.0",
32
- "@milkdown/prose": "7.23.0",
33
- "@milkdown/utils": "7.23.0",
34
- "@testing-library/jest-dom": "^7.0.1",
25
+ "@krantho/ai": "1.1.5",
26
+ "@krantho/core": "1.1.5",
27
+ "@krantho/seo-shared": "1.1.5",
28
+ "@milkdown/core": "7.23.1",
29
+ "@milkdown/plugin-history": "7.23.1",
30
+ "@milkdown/preset-commonmark": "7.23.1",
31
+ "@milkdown/preset-gfm": "7.23.1",
32
+ "@milkdown/prose": "7.23.1",
33
+ "@milkdown/utils": "7.23.1",
34
+ "@testing-library/jest-dom": "^8.0.0",
35
35
  "@testing-library/react": "^16.3.3",
36
- "@testing-library/user-event": "^14.6.10",
36
+ "@testing-library/user-event": "^14.6.14",
37
37
  "@types/dagre": "^0.7.54",
38
- "@types/node": "^26.6.6",
39
- "@types/react": "^19.3.0",
38
+ "@types/node": "^26.6.11",
39
+ "@types/react": "^19.3.3",
40
40
  "@types/react-dom": "^19.3.0",
41
- "@vitejs/plugin-react": "^6.3.0",
42
- "@xyflow/react": "^12.12.1",
41
+ "@vitejs/plugin-react": "^6.3.1",
42
+ "@xyflow/react": "^13.0.3",
43
43
  "dagre": "^0.8.5",
44
44
  "diff": "^9.0.0",
45
- "dompurify": "^3.4.18",
46
- "jsdom": "^31.0.0",
47
- "lucide-react": "^1.72.0",
48
- "marked": "^18.2.0",
45
+ "dompurify": "^3.5.1",
46
+ "jsdom": "^31.0.1",
47
+ "lucide-react": "^1.86.0",
48
+ "marked": "^18.4.0",
49
49
  "react": "^19.3.1",
50
50
  "react-diff-viewer-continued": "^4.4.0",
51
51
  "react-dom": "^19.3.1",
52
52
  "react-image-crop": "^11.1.2",
53
- "react-router": "^8.5.1",
53
+ "react-router": "^8.5.3",
54
54
  "typescript": "^7.0.2",
55
- "vite": "^8.3.8",
56
- "vitest": "^5.1.0"
55
+ "vite": "^8.4.1",
56
+ "vitest": "^5.1.2"
57
57
  },
58
58
  "scripts": {
59
59
  "dev": "vite",
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphCanvas-CZJNUa_J.js","assets/rolldown-runtime-COiEfhsA.js","assets/vendor-react-CXaWJ_ii.js","assets/vendor-diff-DGCTJYJ4.js","assets/vendor-react-DLioOiRN.css","assets/vendor-reactflow-CMKi7AEX.js","assets/graph-config-CgXhm7XP.js","assets/createLucideIcon-BklFHeMd.js","assets/createLucideIcon-DO6kYgVn.css","assets/use-loaded-BNCu0C-c.js","assets/index-d5j-az5g.js","assets/vendor-router-B4czwg8X.js","assets/auth-CIpilSKF.js","assets/format-C3ZX9yGM.js","assets/api-client-BRi_ki2Y.js","assets/index-Buq8auz3.css","assets/copy-V85khWct.js","assets/corner-down-right-BpwOGRFR.js","assets/findability-BrhtZ2yD.js","assets/layers-0VWe0rKm.js","assets/guards-BFEDbduR.js","assets/graph-config-mZyX0Lqo.css","assets/GraphCanvas-C_Wsk21g.css"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{t}from"./save-ClSXW9cb.js";import{t as n}from"./createLucideIcon-BklFHeMd.js";import{t as r}from"./upload-CaqQJaUr.js";import{a as i,o as a,s as o}from"./vendor-diff-DGCTJYJ4.js";import{C as s,S as c,T as l,_ as u,b as d,d as f,f as p,g as m,h,m as g,p as _,v,x as y,y as b}from"./graph-config-CgXhm7XP.js";import{$ as x,ft as S,mt as C,ot as w,st as T,tt as E}from"./index-d5j-az5g.js";import{n as D}from"./catalog-offer-CeRRk2Zo.js";import{t as O}from"./circle-check-big-DQjpuxcC.js";import{t as k}from"./circle-x-peGpq98w.js";import{t as A}from"./trash-DzRCm500.js";import{a as j,i as M,n as N,r as ee,t as P}from"./export-helpers-C_HVpJN9.js";import{t as F}from"./triangle-exclamation-point-ttN5lZI0.js";import{n as I}from"./use-loaded-BNCu0C-c.js";import{t as te}from"./external-link-Dh7p8Ii6.js";var L={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};L.node;var R=n(L),z={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};z.node;var B=n(z),V={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};V.node;var H=n(V),U={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};U.node;var ne=n(U),W=e(o(),1);function G(){return{overrides:new Map,removed:new Map,added:new Map,deleted:new Set}}function re(e){return e.overrides.size>0||e.removed.size>0||e.added.size>0||e.deleted.size>0}function ie(e,t,n,r){let i=e.overrides.get(t)??{},a=new Map(e.overrides);a.set(t,{...i,[n]:r});let o=e.removed.get(t);if(o?.has(n)){let r=new Map(e.removed),i=new Set(o);return i.delete(n),i.size===0?r.delete(t):r.set(t,i),{...e,overrides:a,removed:r}}return{...e,overrides:a}}function ae(e,t,n){let r=e.removed.get(t),i=new Map(e.removed);i.set(t,new Set([...r??[],n]));let a=e.overrides.get(t);if(a&&n in a){let r=new Map(e.overrides),{[n]:o,...s}=a;return Object.keys(s).length===0?r.delete(t):r.set(t,s),{...e,overrides:r,removed:i}}return{...e,removed:i}}function oe(e,t){let n=ue(t),r=new Map(e.added);if(r.set(n,t),e.deleted.has(n)){let t=new Set(e.deleted);return t.delete(n),{...e,added:r,deleted:t}}return{...e,added:r}}function se(e,t){if(e.added.has(t)){let n=new Map(e.added);return n.delete(t),{...e,added:n}}let n=new Set(e.deleted);n.add(t);let r=new Map(e.overrides);r.delete(t);let i=new Map(e.removed);return i.delete(t),{...e,overrides:r,removed:i,deleted:n}}function ce(e,t){if(!re(t))return e;let n=[];for(let r of e.nodes){let e=J(r);if(t.deleted.has(e))continue;let i=t.overrides.get(e),a=t.removed.get(e);if(!i&&!a){n.push(r);continue}let o={};for(let[e,t]of Object.entries(r))a?.has(e)||(o[e]=t);if(i){let e=i[`@type`];typeof e==`string`&&(o[`@type`]=e);for(let[e,t]of Object.entries(i))e!==`@type`&&(o[e]=t)}n.push(o)}let r=0;for(let e of t.added.values()){let t={"@type":e[`@type`],...e.properties,_ek:`added:${r++}`};e[`@id`]&&(t[`@id`]=e[`@id`]),n.push(t)}let i=_(n),a=new Map;for(let e of n){let t=e[`@id`];typeof t==`string`&&a.set(t,e)}return{nodes:n,byEk:i,byId:a,referencedBy:h(n),primary:e.primary?a.get(e.primary[`@id`]??``)??null:null}}function le(e,t,n){let r=new Map;for(let[e,t]of n)r.set(t,e);let i=[];for(let n=0;n<t.entities.length;n++){let a=t.entities[n],o=r.get(n);if(o&&e.deleted.has(o))continue;let s=o?e.overrides.get(o):void 0,c=o?e.removed.get(o):void 0;if(!s&&!c){i.push({...a,properties:K(a.properties)});continue}let l={};for(let[e,t]of Object.entries(a.properties))c?.has(e)||(l[e]=t);if(s)for(let[e,t]of Object.entries(s))e!==`@type`&&(l[e]=t);let u=s?.[`@type`];i.push({"@type":typeof u==`string`?u:a[`@type`],...a[`@id`]?{"@id":a[`@id`]}:{},...a.role?{role:a.role}:{},properties:K(l)})}for(let t of e.added.values())i.push({...t,properties:K(t.properties)});return{...t,entities:i}}function K(e){let t={};for(let[n,r]of Object.entries(e))t[n]=q(r);return t}function q(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(q);let t=e;if(`@type`in t){let e={};for(let[n,r]of Object.entries(t))n!==`@id`&&(e[n]=q(r));return e}return e}function ue(e){return e[`@id`]?e[`@id`]:e.role?`${e[`@type`]}:${e.role}`:e[`@type`]}function J(e){let t=e._ek;if(typeof t==`string`)return t;let n=typeof e[`@type`]==`string`?e[`@type`]:Array.isArray(e[`@type`])?e[`@type`][0]:null;return typeof n==`string`?n:`unknown`}var Y=a();function de({catalogTypes:e,onAdd:t}){let[n,r]=(0,W.useState)(!1),[i,a]=(0,W.useState)(``),o=(0,W.useCallback)(e=>{e?.focus()},[]);if(!n)return(0,Y.jsxs)(`button`,{type:`button`,className:`graph-add-entity-btn`,onClick:()=>r(!0),children:[(0,Y.jsx)(w,{size:14}),` Add entity`]});let s=fe(e,i);return(0,Y.jsxs)(`div`,{className:`graph-add-entity-picker`,children:[(0,Y.jsxs)(`div`,{className:`graph-add-entity-header`,children:[(0,Y.jsx)(`input`,{type:`text`,className:`graph-input graph-input--text graph-add-entity-search`,value:i,onChange:e=>a(e.target.value),placeholder:`Search types…`,ref:o}),(0,Y.jsx)(`button`,{type:`button`,className:`graph-add-entity-close`,onClick:()=>{r(!1),a(``)},"aria-label":`Close picker`,children:(0,Y.jsx)(E,{size:16})})]}),(0,Y.jsxs)(`div`,{className:`graph-add-entity-list`,children:[s.length===0&&(0,Y.jsx)(`p`,{className:`graph-add-entity-empty`,children:`No matching types.`}),s.map(e=>(0,Y.jsxs)(`div`,{className:`graph-add-entity-group`,children:[(0,Y.jsx)(`div`,{className:`graph-add-entity-category`,children:e.label}),e.types.map(e=>(0,Y.jsxs)(`button`,{type:`button`,className:`graph-add-entity-type`,onClick:()=>{t(e.type),r(!1),a(``)},children:[(0,Y.jsx)(`span`,{className:`graph-add-entity-type-name`,children:e.type}),(0,Y.jsx)(`span`,{className:`graph-add-entity-type-desc`,children:e.label}),e.richResult&&(0,Y.jsx)(`span`,{className:`graph-add-entity-rich-badge`,children:`Rich result`}),e.lifecycle?.status===`pending`&&(0,Y.jsx)(`span`,{className:`graph-add-entity-rich-badge`,children:`pending`})]},e.type))]},e.category))]})]})}function fe(e,t){let n=e.filter(e=>D(e,!1)),r=t?n.filter(e=>e.type.toLowerCase().includes(t.toLowerCase())||e.label.toLowerCase().includes(t.toLowerCase())):n,i=new Map;for(let e of[`business`,`content`,`commerce`,`people`,`navigation`,`reviews`])i.set(e,{category:e,label:p[e],types:[]});for(let e of r){let t=e.category,n=i.get(t);n&&n.types.push(e)}return[...i.values()].filter(e=>e.types.length>0)}function X({category:e}){return e===null?null:(0,Y.jsx)(`span`,{className:`graph-category-badge graph-category-${e}`,children:p[e]})}function Z({node:e,category:t,classifications:n,selected:r,focused:i,onSelect:a,onToggleExpanded:o,expanded:c}){let l=s(e[`@type`])??`Unknown`,u=e[`@id`],d=Q(e),{requiredSet:f,requiredTotal:p}=v(n);return(0,Y.jsxs)(`div`,{className:[`graph-entity-header`,r?`graph-entity-header--selected`:``,i?`graph-focused`:``].filter(Boolean).join(` `),children:[(0,Y.jsx)(`button`,{type:`button`,className:`graph-entity-expand-button`,onClick:e=>{e.stopPropagation(),o()},"aria-expanded":c,"aria-label":c?`Collapse entity`:`Expand entity`,children:(0,Y.jsx)(`span`,{className:`graph-entity-chevron ${c?`graph-entity-chevron--open`:``}`,children:`▸`})}),(0,Y.jsxs)(`button`,{type:`button`,className:`graph-entity-header-main`,onClick:a,children:[(0,Y.jsxs)(`div`,{className:`graph-entity-header-row`,children:[(0,Y.jsx)(`span`,{className:`graph-entity-type`,children:l}),d&&(0,Y.jsx)(`span`,{className:`graph-entity-name`,children:d}),(0,Y.jsx)(X,{category:t})]}),(0,Y.jsxs)(`div`,{className:`graph-entity-header-meta`,children:[u&&(0,Y.jsx)(`span`,{className:`graph-entity-id`,children:u}),p>0&&(0,Y.jsxs)(`span`,{className:`graph-entity-eligibility ${f===p?`graph-entity-eligibility--complete`:`graph-entity-eligibility--incomplete`}`,title:`${f} of ${p} required properties set`,children:[f,`/`,p,` required`]})]})]})]})}function Q(e){for(let t of[`name`,`headline`,`title`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function pe({value:e,onChange:t,label:n,placeholder:r}){let i=[...e],a=()=>{t([...i,``])},o=(e,n)=>{let r=[...i];r[e]=n,t(r)},s=e=>{t(i.filter((t,n)=>n!==e))};return(0,Y.jsxs)(`div`,{className:`graph-input graph-input--array`,role:`group`,"aria-label":n,children:[i.map((e,t)=>(0,Y.jsxs)(`div`,{className:`graph-input-array-item`,children:[(0,Y.jsx)(`input`,{type:`text`,className:`graph-input graph-input--text`,value:e,onChange:e=>o(t,e.target.value),placeholder:r}),(0,Y.jsx)(`button`,{type:`button`,className:`graph-input-array-remove`,onClick:()=>s(t),"aria-label":`Remove item`,children:(0,Y.jsx)(E,{size:14})})]},t)),(0,Y.jsxs)(`button`,{type:`button`,className:`graph-input-array-add`,onClick:a,children:[(0,Y.jsx)(w,{size:14}),` Add item`]})]})}function me({value:e,onChange:t,label:n}){return(0,Y.jsx)(`input`,{type:`date`,className:`graph-input graph-input--date`,value:e,onChange:e=>t(e.target.value),"aria-label":n})}function he({value:e,onChange:t,label:n,min:r,max:i}){return(0,Y.jsx)(`input`,{type:`number`,className:`graph-input graph-input--number`,value:e,onChange:e=>{let n=e.target.value;t(n===``?``:Number(n))},"aria-label":n,min:r,max:i})}function ge({value:e,onChange:t,label:n}){let r=(0,W.useId)(),i=(n,r,i)=>{t(e.map((e,t)=>t===n?{...e,[r]:i}:e))},a=n=>{t(e.filter((e,t)=>t!==n))},o=()=>{let n={},r=e[0];if(r)for(let[t,i]of Object.entries(r))t===`@type`?n[`@type`]=i:n[t]=typeof i==`number`?Math.max(...e.map(e=>Number(e[t])||0))+1:``;t([...e,n])},s=new Set;for(let t of e)for(let e of Object.keys(t))e!==`@type`&&s.add(e);let c=[...s];return(0,Y.jsxs)(`div`,{className:`graph-input graph-input--object-array`,role:`group`,"aria-label":n,children:[e.map((e,t)=>(0,Y.jsxs)(`div`,{className:`graph-object-array-item`,children:[(0,Y.jsxs)(`span`,{className:`graph-object-array-item-index`,children:[t+1,`.`]}),(0,Y.jsx)(`div`,{className:`graph-object-array-item-fields`,children:c.map(n=>{let a=e[n],o=`${r}-${t}-${n}`;return(0,Y.jsxs)(`div`,{className:`graph-object-array-field`,children:[(0,Y.jsx)(`label`,{htmlFor:o,className:`graph-object-array-field-label`,children:n}),typeof a==`string`||typeof a==`number`||a===void 0?(0,Y.jsx)(`input`,{id:o,type:`text`,className:`graph-input graph-input--text`,value:a===void 0?``:String(a),onChange:e=>{let r=typeof a==`number`&&Number(e.target.value)||e.target.value;i(t,n,r)},placeholder:n}):(0,Y.jsx)(`span`,{id:o,className:`graph-property-value-object`,children:JSON.stringify(a).slice(0,60)})]},n)})}),(0,Y.jsx)(`button`,{type:`button`,className:`graph-object-array-item-remove`,onClick:()=>a(t),"aria-label":`Remove item ${t+1}`,children:(0,Y.jsx)(A,{size:12})})]},t)),(0,Y.jsxs)(`button`,{type:`button`,className:`graph-input-array-add`,onClick:o,children:[(0,Y.jsx)(w,{size:14}),` Add item`]})]})}function _e({value:e,onChange:t,options:n,label:r}){return(0,Y.jsxs)(`select`,{className:`graph-input graph-input--select`,value:e,onChange:e=>t(e.target.value),"aria-label":r,children:[(0,Y.jsx)(`option`,{value:``,children:`Select…`}),n.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))]})}function ve({value:e,onChange:t,placeholder:n,label:r}){return(0,Y.jsx)(`textarea`,{className:`graph-input graph-input--textarea`,value:e,onChange:e=>t(e.target.value),placeholder:n,"aria-label":r,rows:3})}function ye({value:e,onChange:t,placeholder:n,label:r}){return(0,Y.jsx)(`input`,{type:`text`,className:`graph-input graph-input--text`,value:e,onChange:e=>t(e.target.value),placeholder:n,"aria-label":r})}function be({value:e,onChange:t,placeholder:n,label:r}){let[i,a]=(0,W.useState)(!1),o=e===``||xe(e);return(0,Y.jsx)(`input`,{type:`url`,className:`graph-input graph-input--url ${i&&!o?`graph-input--invalid`:``}`,value:e,onChange:e=>t(e.target.value),onBlur:()=>a(!0),placeholder:n??`https://`,"aria-label":r,"aria-invalid":i&&!o})}function xe(e){try{return new URL(e),!0}catch{return!1}}function Se({classification:e,onFollowReference:t,onValueChange:n,onRemove:r}){let{property:i,value:a,importance:o,state:s,isReference:u,referenceId:d,def:f}=e,p=f?.label??i,m=we(o,s),h=n!==void 0;return(0,Y.jsxs)(`div`,{className:`graph-property-row ${m}`,children:[(0,Y.jsxs)(`div`,{className:`graph-property-label-col`,children:[(0,Y.jsx)(Te,{importance:o,state:s}),(0,Y.jsx)(`span`,{className:`graph-property-label`,children:p})]}),(0,Y.jsx)(`div`,{className:`graph-property-value`,children:u&&d!==void 0?(0,Y.jsxs)(`button`,{type:`button`,className:`graph-reference-link`,onClick:()=>t?.(d),"aria-label":`Follow reference to ${d}`,children:[(0,Y.jsx)(l,{size:12}),(0,Y.jsx)(`span`,{className:`graph-reference-link-id`,children:c(d)})]}):h?(0,Y.jsxs)(`div`,{className:`graph-property-input-row`,children:[(0,Y.jsx)(Ce,{property:i,value:a,fieldType:f?.fieldType,hint:f?.hint,onChange:e=>n(i,e)}),r&&(0,Y.jsx)(`button`,{type:`button`,className:`graph-property-remove`,onClick:()=>r(i),"aria-label":`Remove ${p}`,children:(0,Y.jsx)(E,{size:14})})]}):(0,Y.jsx)(Ee,{value:a})})]})}function Ce({property:e,value:t,fieldType:n,hint:r,onChange:i}){if(n!==`array`&&typeof t==`object`&&t){if(Array.isArray(t))return(0,Y.jsxs)(`span`,{className:`graph-property-value-array`,children:[`Array (`,t.length,` item`,t.length===1?``:`s`,`)`]});let e=t,n=typeof e[`@type`]==`string`?e[`@type`]:null;return(0,Y.jsx)(`span`,{className:`graph-property-value-object`,children:n?`{${n}}`:JSON.stringify(t).slice(0,80)})}let a=typeof t==`string`?t:t==null?``:String(t);switch(n){case`textarea`:return(0,Y.jsx)(ve,{value:a,onChange:i,label:e});case`url`:return(0,Y.jsx)(be,{value:a,onChange:i,label:e});case`date`:return(0,Y.jsx)(me,{value:a,onChange:i,label:e});case`number`:return(0,Y.jsx)(he,{value:typeof t==`number`?t:a,onChange:i,label:e});case`select`:{let t=r?r.split(`|`).map(e=>e.trim()).filter(Boolean):[];return(0,Y.jsx)(_e,{value:a,onChange:i,options:t,label:e})}case`array`:return Array.isArray(t)?t.some(e=>typeof e==`object`&&!!e)?(0,Y.jsx)(ge,{value:t,onChange:i,label:e}):(0,Y.jsx)(pe,{value:t.map(e=>typeof e==`string`?e:String(e)),onChange:i,label:e}):(0,Y.jsx)(ye,{value:``,onChange:i,label:e});case`email`:return(0,Y.jsx)(`input`,{type:`email`,className:`graph-input graph-input--email`,value:a,onChange:e=>i(e.target.value),"aria-label":e});case`tel`:return(0,Y.jsx)(`input`,{type:`tel`,className:`graph-input graph-input--tel`,value:a,onChange:e=>i(e.target.value),"aria-label":e});default:return(0,Y.jsx)(ye,{value:a,onChange:i,label:e})}}function we(e,t){return e===`required`&&t===`missing`?`graph-property-row--required-missing`:e===`recommended`&&t===`missing`?`graph-property-row--recommended-missing`:t===`set`&&e===`required`?`graph-property-row--required-set`:``}function Te({importance:e,state:t}){return e===`required`&&t===`missing`?(0,Y.jsx)(k,{size:14,className:`graph-property-badge graph-property-badge--required-missing`,"aria-label":`Missing required`}):e===`recommended`&&t===`missing`?(0,Y.jsx)(S,{size:14,className:`graph-property-badge graph-property-badge--recommended-missing`,"aria-label":`Missing recommended`}):t===`set`&&e===`required`?(0,Y.jsx)(O,{size:14,className:`graph-property-badge graph-property-badge--set`,"aria-label":`Set`}):(0,Y.jsx)(`span`,{className:`graph-property-badge graph-property-badge--placeholder`,"aria-hidden":!0})}function Ee({value:e}){if(e==null||e===``)return(0,Y.jsx)(`span`,{className:`graph-property-value-empty`,children:`—`});if(typeof e==`string`)return(0,Y.jsx)(`span`,{className:`graph-property-value-string`,children:De(e,120)});if(typeof e==`number`||typeof e==`boolean`)return(0,Y.jsx)(`span`,{className:`graph-property-value-primitive`,children:String(e)});if(Array.isArray(e))return(0,Y.jsxs)(`span`,{className:`graph-property-value-array`,children:[`Array (`,e.length,` item`,e.length===1?``:`s`,`)`]});if(typeof e==`object`){let t=e,n=typeof t[`@type`]==`string`?t[`@type`]:`object`;return(0,Y.jsx)(`span`,{className:`graph-property-value-object`,children:`{${n}}`})}return(0,Y.jsx)(`span`,{className:`graph-property-value-unknown`,children:String(e)})}function De(e,t){return e.length<=t?e:`${e.slice(0,t-1)}…`}function Oe({node:e,catalogTypes:t,catalogDetail:n,selected:r,focused:i,onSelect:a,onFollowReference:o,initiallyExpanded:s=!1}){let[c,l]=(0,W.useState)(s),f=b(e,t),p=u(e,n),m=d(p),h=p.some(e=>e.importance===`required`&&e.state===`missing`);return(0,Y.jsxs)(`div`,{className:`graph-entity-card ${r?`graph-entity-card--selected`:``} ${h?`graph-entity-card--missing-required`:``}`,"data-entity-id":e[`@id`]??``,role:`treeitem`,tabIndex:r?0:-1,"aria-selected":r,"aria-expanded":c,children:[(0,Y.jsx)(Z,{node:e,category:f,classifications:p,selected:r,focused:i,onSelect:()=>a(e),onToggleExpanded:()=>l(e=>!e),expanded:c}),c&&(0,Y.jsx)(`div`,{className:`graph-entity-body`,children:m.length===0?(0,Y.jsx)(`p`,{className:`graph-entity-empty`,children:`No properties.`}):(0,Y.jsx)(`div`,{className:`graph-property-list`,children:m.map(e=>(0,Y.jsx)(Se,{classification:e,onFollowReference:o},e.property))})})]})}function ke({data:e,collection:t,slug:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),s=(0,W.useRef)(null),c=(0,W.useRef)(null);return(0,W.useEffect)(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]),(0,W.useEffect)(()=>{if(!r)return;let e=e=>{s.current&&!s.current.contains(e.target)&&i(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r]),(0,Y.jsxs)(`div`,{className:`graph-export-dropdown`,ref:s,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`graph-export-btn`,onClick:()=>i(e=>!e),"aria-expanded":r,"aria-haspopup":`true`,children:[(0,Y.jsx)(j,{size:14}),` Export`]}),r&&(0,Y.jsxs)(`div`,{className:`graph-export-menu`,role:`menu`,children:[(0,Y.jsx)(`button`,{type:`button`,className:`graph-export-menu-item`,role:`menuitem`,onClick:()=>{let r=N(e),a=M(t,n);P(r,a,`application/ld+json`),i(!1)},children:`Download .jsonld`}),(0,Y.jsx)(`button`,{type:`button`,className:`graph-export-menu-item`,role:`menuitem`,onClick:()=>{let t=ee(e);navigator.clipboard.writeText(t).then(()=>{o(`success`),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>o(!1),2e3)}).catch(()=>{o(`error`),c.current!==null&&clearTimeout(c.current),c.current=setTimeout(()=>o(!1),2e3)}),i(!1)},children:a===`success`?`Copied!`:a===`error`?`Copy failed`:`Copy as <script> tag`})]})]})}function Ae({label:e,variant:t,children:n}){return(0,Y.jsxs)(`section`,{className:`graph-section graph-section--${t}`,children:[(0,Y.jsx)(`h3`,{className:`graph-section-label`,children:e}),(0,Y.jsx)(`div`,{className:`graph-section-content`,children:n})]})}function je({model:e,layout:t,catalogTypes:n,catalogDetails:r}){let i=Me(e,n,r),a=`${t.siteContext.length} site, ${+!!t.page} page, ${+!!t.primary} primary, ${t.linked.length} linked`;return(0,Y.jsxs)(`header`,{className:`graph-summary`,children:[(0,Y.jsxs)(`div`,{className:`graph-summary-primary`,children:[(0,Y.jsxs)(`span`,{className:`graph-summary-metric`,children:[(0,Y.jsx)(`strong`,{children:i.entityCount}),` entities`]}),(0,Y.jsxs)(`span`,{className:`graph-summary-metric`,children:[(0,Y.jsx)(`strong`,{children:i.categories.size}),` categories`]}),(0,Y.jsxs)(`span`,{className:`graph-summary-metric`,children:[(0,Y.jsx)(`strong`,{children:i.richResultCount}),` rich-result eligible`]}),(0,Y.jsxs)(`span`,{className:`graph-summary-metric ${i.requiredTotal-i.requiredSet>0?`graph-summary-metric--warning`:``}`,children:[(0,Y.jsxs)(`strong`,{children:[i.requiredSet,`/`,i.requiredTotal]}),` `,`required set`,i.requiredTotal-i.requiredSet>0&&(0,Y.jsxs)(`span`,{className:`graph-summary-missing`,children:[`(`,i.requiredTotal-i.requiredSet,` missing)`]})]})]}),(0,Y.jsx)(`div`,{className:`graph-summary-secondary`,children:a})]})}function Me(e,t,n){let r=new Set,i=0,a=0,o=0,s=new Map;for(let e of t)s.set(e.type,e);for(let c of e.nodes){let e=b(c,t);e!==null&&r.add(e);let l=typeof c[`@type`]==`string`?c[`@type`]:null;if(l!==null){s.get(l)?.richResult&&(o+=1);let e=n.get(l)??null,t=u(c,e);for(let e of t)e.importance===`required`&&(a+=1,e.state===`set`&&(i+=1))}}return{entityCount:e.nodes.length,categories:r,richResultCount:o,requiredSet:i,requiredTotal:a}}function Ne(e,t,n,r){let i;try{i=JSON.parse(e)}catch(e){return ze(e instanceof Error?`Invalid JSON: ${e.message}`:`Invalid JSON`)}let a=y(i);if(a.nodes.length===0)return ze(`No entities found in the imported JSON-LD.`);let o=[],c=0;for(let e of a.nodes){let i=s(e[`@type`]);if(!i)continue;let a=typeof e.role==`string`?e.role:void 0,l=Re(t,i,a),u=!l,d=!n.has(i),f=r.get(i),p=[];for(let[t,n]of Object.entries(e)){if(t===`@type`||t===`@id`||t===`@context`||t===`role`)continue;let e=l?.[t],r=f?!f.has(t):!1;l&&t in l?Be(e,n)||p.push({entityType:i,entityRole:a,property:t,kind:`changed`,oldValue:e,newValue:n,unknownProperty:r}):p.push({entityType:i,entityRole:a,property:t,kind:`added`,oldValue:void 0,newValue:n,unknownProperty:r})}if(l)for(let[t,n]of Object.entries(l))t!==`@type`&&t!==`@id`&&t!==`@context`&&t!==`role`&&(t in e||p.push({entityType:i,entityRole:a,property:t,kind:`removed`,oldValue:n,newValue:void 0,unknownProperty:!1}));(p.length>0||u)&&(o.push({type:i,role:a,disabled:d,disabledReason:d?`${i} is not part of this document's archetype`:void 0,changes:p}),u&&(c+=1))}let l=o.reduce((e,t)=>e+t.changes.length,0);return{entities:o,totalPropertyChanges:l,totalEntityAdditions:c,requiresConfirmation:l>=10||o.length>=3,error:void 0,importedModel:a}}function Pe(e,t){if(e==null||typeof e==`string`)return e;if(Array.isArray(e))return e.map(e=>Pe(e,t));if(typeof e==`object`){let n=e,r={};for(let[e,i]of Object.entries(n))r[e]=e===`@id`&&typeof i==`string`?t.get(i)??i:Pe(i,t);return r}return e}function Fe(e,t,n){let r=new Map;for(let i of e.nodes){let e=i[`@id`];if(typeof e!=`string`)continue;let a=s(i[`@type`]);if(!a)continue;let o=Re(t,a,typeof i.role==`string`?i.role:void 0);o&&typeof o[`@id`]==`string`?r.set(e,o[`@id`]):r.set(e,`${n.replace(/\/+$/,``)}/#${a.toLowerCase()}`)}return r}function Ie(e,t,n){let r=e;for(let e of t){let t=Le(e),i=Pe(e.value,n);r=ie(r,t,e.property,i)}return r}function Le(e){return e.entityId?e.entityId:e.entityRole?`${e.entityType}:${e.entityRole}`:e.entityType}function Re(e,t,n){return e.nodes.find(e=>s(e[`@type`])===t?!n||e.role===n:!1)}function ze(e){return{entities:[],totalPropertyChanges:0,totalEntityAdditions:0,requiresConfirmation:!1,error:e,importedModel:void 0}}function Be(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!=typeof t||typeof e!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>Be(e,t[n]));let n=e,r=t,i=Object.keys(n),a=Object.keys(r);return i.length===a.length&&i.every(e=>Be(n[e],r[e]))}function Ve({entities:e,selectedProperties:t,onToggle:n}){return e.length===0?(0,Y.jsx)(`p`,{className:`import-diff-empty`,children:`No changes detected.`}):(0,Y.jsx)(`div`,{className:`import-diff-panel`,children:e.map(e=>(0,Y.jsxs)(`div`,{className:`import-diff-entity ${e.disabled?`import-diff-entity--disabled`:``}`,children:[(0,Y.jsxs)(`div`,{className:`import-diff-entity-header`,children:[(0,Y.jsx)(`span`,{className:`import-diff-entity-type`,children:e.type}),e.role&&(0,Y.jsx)(`span`,{className:`import-diff-entity-role`,children:e.role}),e.disabled&&(0,Y.jsx)(`span`,{className:`import-diff-entity-badge import-diff-entity-badge--disabled`,children:`Disabled`}),(0,Y.jsxs)(`span`,{className:`import-diff-entity-count`,children:[e.changes.length,` change`,e.changes.length===1?``:`s`]})]}),e.disabled&&e.disabledReason&&(0,Y.jsx)(`p`,{className:`import-diff-disabled-reason`,children:e.disabledReason}),(0,Y.jsx)(`div`,{className:`import-diff-changes`,children:e.changes.map(r=>{let i=He(e,r),a=t.has(i),o=!e.disabled&&r.kind!==`removed`;return(0,Y.jsxs)(`label`,{className:`import-diff-change import-diff-change--${r.kind}`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:a,disabled:!o,onChange:()=>n(i),className:`import-diff-checkbox`}),(0,Y.jsxs)(`div`,{className:`import-diff-change-content`,children:[(0,Y.jsxs)(`div`,{className:`import-diff-change-header`,children:[(0,Y.jsx)(Ue,{kind:r.kind}),(0,Y.jsx)(`span`,{className:`import-diff-property`,children:r.property}),r.unknownProperty&&(0,Y.jsxs)(`span`,{className:`import-diff-warning`,children:[(0,Y.jsx)(F,{size:12}),` Unknown property`]})]}),(0,Y.jsxs)(`div`,{className:`import-diff-change-values`,children:[r.kind===`changed`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`import-diff-old-value`,children:$(r.oldValue)}),(0,Y.jsx)(`span`,{className:`import-diff-arrow`,children:`→`}),(0,Y.jsx)(`span`,{className:`import-diff-new-value`,children:$(r.newValue)})]}),r.kind===`added`&&(0,Y.jsx)(`span`,{className:`import-diff-new-value`,children:$(r.newValue)}),r.kind===`removed`&&(0,Y.jsx)(`span`,{className:`import-diff-removed-value`,children:$(r.oldValue)})]})]})]},i)})})]},`${e.type}-${e.role??``}`))})}function He(e,t){return`${e.type}:${e.role??``}:${t.property}`}function Ue({kind:e}){switch(e){case`added`:return(0,Y.jsx)(w,{size:14,className:`import-diff-icon import-diff-icon--added`});case`changed`:return(0,Y.jsx)(I,{size:14,className:`import-diff-icon import-diff-icon--changed`});case`removed`:return(0,Y.jsx)(H,{size:14,className:`import-diff-icon import-diff-icon--removed`});default:return(0,Y.jsx)(I,{size:14})}}function $(e){if(e==null)return`—`;if(typeof e==`string`)return e.length>80?`${e.slice(0,77)}…`:e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`object`){let t=JSON.stringify(e);return t.length>80?`${t.slice(0,77)}…`:t}return String(e)}function We({currentModel:e,currentEntityTypes:t,catalogPropertySets:n,baseUrl:i,buffer:a,onApply:o,onClose:s}){let[c,l]=(0,W.useState)(``),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(new Set),[m,h]=(0,W.useState)(!1),g=(0,W.useRef)(null),_=(0,W.useId)();x(g,!0),(0,W.useEffect)(()=>{let e=e=>{e.key===`Escape`&&s()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s]);let v=(0,W.useCallback)(()=>{let r=Ne(c,e,t,n);if(d(r),!r.error){let e=new Set;for(let t of r.entities)if(!t.disabled)for(let n of t.changes)n.kind!==`removed`&&e.add(He(t,n));p(e)}},[c,e,t,n]),y=(0,W.useCallback)(e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),b=(0,W.useCallback)(()=>{if(!u?.importedModel)return;let t=[];for(let n of u.entities){if(n.disabled)continue;let r=e.nodes.find(e=>(typeof e[`@type`]==`string`?e[`@type`]:void 0)===n.type&&(!n.role||e.role===n.role)),i=typeof r?.[`@id`]==`string`?r[`@id`]:void 0;for(let e of n.changes){let r=He(n,e);f.has(r)&&e.kind!==`removed`&&t.push({entityType:e.entityType,entityRole:e.entityRole,entityId:i,property:e.property,value:e.newValue,kind:e.kind})}}t.length===0||o(Ie(a,t,Fe(u.importedModel,e,i))),s()},[u,f,e,i,a,o,s]),S=u!==null&&!u.error&&f.size>0&&(!u.requiresConfirmation||m);return(0,Y.jsxs)(`div`,{className:`import-modal-overlay`,children:[(0,Y.jsx)(`div`,{className:`import-modal-scrim`,"aria-hidden":`true`,onClick:s}),(0,Y.jsxs)(`div`,{ref:g,className:`import-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":_,tabIndex:-1,children:[(0,Y.jsxs)(`div`,{className:`import-modal-header`,children:[(0,Y.jsxs)(`h2`,{id:_,className:`import-modal-title`,children:[(0,Y.jsx)(r,{size:18}),` Import JSON-LD`]}),(0,Y.jsx)(`button`,{type:`button`,className:`import-modal-close`,onClick:s,children:`×`})]}),(0,Y.jsx)(`div`,{className:`import-modal-body`,children:u?u.error?(0,Y.jsxs)(`div`,{className:`import-modal-error`,children:[(0,Y.jsx)(`p`,{children:u.error}),(0,Y.jsx)(`button`,{type:`button`,className:`import-modal-btn import-modal-btn--secondary`,onClick:()=>d(null),children:`Edit JSON`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`import-modal-summary`,children:[u.totalPropertyChanges,` property change`,u.totalPropertyChanges===1?``:`s`,` across `,u.entities.length,` entit`,u.entities.length===1?`y`:`ies`,u.totalEntityAdditions>0&&` (${u.totalEntityAdditions} new entit${u.totalEntityAdditions===1?`y`:`ies`})`]}),(0,Y.jsx)(Ve,{entities:u.entities,selectedProperties:f,onToggle:y}),u.requiresConfirmation&&(0,Y.jsxs)(`label`,{className:`import-modal-confirm`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),`I've reviewed these changes`]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`import-modal-hint`,children:`Paste a JSON-LD blob to import entities and properties into this document. Changes will be reviewed before applying.`}),(0,Y.jsx)(`textarea`,{className:`import-modal-textarea`,value:c,onChange:e=>l(e.target.value),placeholder:`{"@context": "https://schema.org", "@graph": [...]}`,rows:12})]})}),(0,Y.jsxs)(`div`,{className:`import-modal-footer`,children:[(0,Y.jsx)(`button`,{type:`button`,className:`import-modal-btn import-modal-btn--secondary`,onClick:s,children:`Cancel`}),u?u.error?null:(0,Y.jsxs)(`button`,{type:`button`,className:`import-modal-btn import-modal-btn--primary`,onClick:b,disabled:!S,children:[`Apply `,f.size,` change`,f.size===1?``:`s`]}):(0,Y.jsx)(`button`,{type:`button`,className:`import-modal-btn import-modal-btn--primary`,onClick:v,disabled:!c.trim(),children:`Parse`})]})]})]})}var Ge=`krantho:graphLayout`;function Ke({value:e,onChange:t}){let n=e===`tree`?`canvas`:`tree`,r=n===`canvas`?`Canvas`:`Tree`,i=n===`canvas`?T:B;return(0,Y.jsxs)(`button`,{type:`button`,className:`graph-layout-toggle-btn`,onClick:()=>t(n),title:`Switch to ${r} view`,children:[(0,Y.jsx)(i,{size:14}),` `,r]})}function qe(){let[e,t]=(0,W.useState)(()=>{try{return localStorage.getItem(Ge)===`canvas`?`canvas`:`tree`}catch{return`tree`}});return[e,e=>{t(e);try{localStorage.setItem(Ge,e)}catch{}}]}function Je({references:e,onFollow:t}){return e.length===0?(0,Y.jsx)(`p`,{className:`graph-references-empty`,children:`No inbound references.`}):(0,Y.jsx)(`ul`,{className:`graph-references-list`,children:e.map((e,n)=>{let r=e.source[`@id`],i=s(e.source[`@type`])??`Node`,a=`${r??`anon`}-${e.property}-${n}`;return(0,Y.jsx)(`li`,{className:`graph-references-item`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`graph-references-link`,onClick:()=>r&&t?.(r),disabled:r===void 0,children:[(0,Y.jsx)(R,{size:12}),(0,Y.jsx)(`span`,{className:`graph-references-source`,children:i}),(0,Y.jsxs)(`span`,{className:`graph-references-property`,children:[`.`,e.property]})]})},a)})})}function Ye({value:e,onChange:t}){let n=(0,W.useId)();return(0,Y.jsxs)(`div`,{className:`graph-scope-propagation`,children:[(0,Y.jsx)(`span`,{className:`graph-scope-propagation-label`,children:`Apply changes to:`}),(0,Y.jsxs)(`label`,{className:`graph-scope-propagation-option`,children:[(0,Y.jsx)(`input`,{type:`radio`,name:n,value:`document`,checked:e===`document`,onChange:()=>t(`document`)}),`This document`]}),(0,Y.jsxs)(`label`,{className:`graph-scope-propagation-option`,children:[(0,Y.jsx)(`input`,{type:`radio`,name:n,value:`site`,checked:e===`site`,onChange:()=>t(`site`)}),`All documents (site-level)`]})]})}function Xe({classifications:e,compact:t=!1}){let n=e.filter(e=>e.importance===`required`),r=e.filter(e=>e.importance===`recommended`),i=n.filter(e=>e.state===`set`).length,a=r.filter(e=>e.state===`set`).length;if(n.length===0&&r.length===0)return(0,Y.jsx)(`span`,{className:`graph-validation-meter graph-validation-meter--empty`});let o=i===n.length?`graph-validation-meter--eligible`:`graph-validation-meter--incomplete`;return t?(0,Y.jsx)(`span`,{className:`graph-validation-meter graph-validation-meter--compact ${o}`,children:n.length>0&&(0,Y.jsxs)(`span`,{className:`graph-validation-meter-segment`,children:[i,`/`,n.length]})}):(0,Y.jsxs)(`div`,{className:`graph-validation-meter ${o}`,children:[n.length>0&&(0,Y.jsxs)(`span`,{className:`graph-validation-meter-segment graph-validation-meter-segment--required`,children:[i,`/`,n.length,` required`]}),r.length>0&&(0,Y.jsxs)(`span`,{className:`graph-validation-meter-segment graph-validation-meter-segment--recommended`,children:[a,`/`,r.length,` recommended`]})]})}function Ze({node:e,model:t,catalogTypes:n,catalogDetails:r,onFollowReference:i,onPropertyChange:a,onPropertyRemove:o,onDeleteEntity:c,isSiteLevel:l,propagationScope:f,onPropagationChange:m}){let[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),y=a!==void 0;if((0,W.useEffect)(()=>{g(!1),v(!1)},[e]),e===null)return(0,Y.jsx)(`aside`,{className:`graph-property-panel graph-property-panel--empty`,children:(0,Y.jsx)(`p`,{className:`graph-property-panel-hint`,children:`Select an entity to see its details.`})});let x=s(e[`@type`])??`Unknown`,S=b(e,n),C=r.get(x)??null,T=u(e,C),E=d(T),D=Qe(C),O=e[`@id`]?t.referencedBy.get(e[`@id`])??[]:[],k=new Set(Object.keys(e).filter(e=>e!==`@type`&&e!==`@id`&&e!==`@context`&&e!==`_ek`)),j=C?C.properties.filter(e=>!k.has(e.property)):[],M=J(e);return(0,Y.jsxs)(`aside`,{className:`graph-property-panel`,children:[(0,Y.jsxs)(`header`,{className:`graph-property-panel-header`,children:[(0,Y.jsxs)(`div`,{className:`graph-property-panel-title-row`,children:[(0,Y.jsx)(`h3`,{className:`graph-property-panel-title`,children:x}),(0,Y.jsx)(X,{category:S}),y&&c&&!_&&(0,Y.jsxs)(`button`,{type:`button`,className:`graph-property-panel-delete`,onClick:()=>v(!0),"aria-label":`Delete ${x} entity`,children:[(0,Y.jsx)(A,{size:12}),` Delete`]}),y&&c&&_&&(0,Y.jsxs)(`span`,{className:`graph-property-panel-delete-confirm`,children:[(0,Y.jsx)(`button`,{type:`button`,className:`graph-property-panel-delete graph-property-panel-delete--confirm`,onClick:()=>{c(M),v(!1)},children:`Confirm`}),(0,Y.jsx)(`button`,{type:`button`,className:`graph-property-panel-delete-cancel`,onClick:()=>v(!1),children:`Cancel`})]})]}),S&&(0,Y.jsx)(`p`,{className:`graph-property-panel-category-label`,children:p[S]}),D.map(e=>(0,Y.jsxs)(`div`,{className:`graph-property-panel-rich-result`,children:[(0,Y.jsxs)(`span`,{className:`graph-property-panel-rich-result-label`,children:[e.reader,`:`]}),` `,(0,Y.jsx)(`strong`,{children:e.feature}),e.status!==`active`&&` (${e.status})`,(0,Y.jsxs)(`a`,{href:e.source,target:`_blank`,rel:`noopener noreferrer`,className:`graph-property-panel-docs-link`,children:[`Docs `,(0,Y.jsx)(te,{size:12})]})]},e.reader)),(0,Y.jsx)(Xe,{classifications:T}),y&&l&&f&&m&&(0,Y.jsx)(Ye,{value:f,onChange:m})]}),(0,Y.jsxs)(`section`,{className:`graph-property-panel-section`,children:[(0,Y.jsx)(`h4`,{className:`graph-property-panel-section-label`,children:`Properties`}),E.length===0?(0,Y.jsx)(`p`,{className:`graph-property-panel-empty`,children:`No catalog properties available.`}):(0,Y.jsx)(`div`,{className:`graph-property-list`,children:E.map(e=>(0,Y.jsx)(Se,{classification:e,onFollowReference:i,onValueChange:y?(e,t)=>a(M,e,t):void 0,onRemove:y&&o?e=>o(M,e):void 0},e.property))}),y&&j.length>0&&(0,Y.jsx)(`div`,{className:`graph-property-add`,children:h?(0,Y.jsxs)(`div`,{className:`graph-property-add-picker`,children:[j.map(e=>(0,Y.jsxs)(`button`,{type:`button`,className:`graph-property-add-option`,onClick:()=>{a(M,e.property,``),g(!1)},children:[(0,Y.jsx)(`span`,{className:`graph-property-add-option-name`,children:e.label}),(0,Y.jsx)(`span`,{className:`graph-property-add-option-importance graph-property-add-option-importance--${e.importance}`,children:e.importance})]},e.property)),(0,Y.jsx)(`button`,{type:`button`,className:`graph-property-add-cancel`,onClick:()=>g(!1),children:`Cancel`})]}):(0,Y.jsxs)(`button`,{type:`button`,className:`graph-property-add-btn`,onClick:()=>g(!0),children:[(0,Y.jsx)(w,{size:14}),` Add property`]})})]}),(0,Y.jsxs)(`section`,{className:`graph-property-panel-section`,children:[(0,Y.jsx)(`h4`,{className:`graph-property-panel-section-label`,children:`Referenced by`}),(0,Y.jsx)(Je,{references:O,onFollow:i})]})]})}function Qe(e){return(e?.rules??[]).flatMap(e=>e.feature?[{reader:e.readerName,feature:e.feature,status:e.status,source:e.source}]:[])}function $e({data:e}){let[t,n]=(0,W.useState)(!1);return(0,Y.jsxs)(`div`,{className:`graph-raw-toggle ${t?`graph-raw-toggle--open`:``}`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`graph-raw-toggle-button`,onClick:()=>n(e=>!e),"aria-expanded":t,children:[(0,Y.jsx)(C,{size:14,className:`graph-raw-toggle-chevron`}),t?`Hide raw JSON-LD`:`Show raw JSON-LD`]}),t&&(0,Y.jsx)(`div`,{className:`graph-raw-toggle-body`,children:(0,Y.jsx)(f,{data:e,label:`Raw JSON-LD`})})]})}var et=(0,W.lazy)(()=>i(()=>import(`./GraphCanvas-CZJNUa_J.js`).then(e=>({default:e.GraphCanvas})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])));function tt({saveLabel:e=`Save`,model:n,catalogTypes:i,catalogDetails:a,rawData:o,configData:c,onSave:l,siteLevelTypeSet:u,collection:d,slug:f}){let p=c!==void 0&&l!==void 0,[h,_]=qe(),[v,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(G),[S,C]=(0,W.useState)(!1),w=re(b),T=(0,W.useMemo)(()=>w?ce(n,b):n,[n,b,w]),E=(0,W.useMemo)(()=>{let e=new Set;for(let t of T.nodes){let n=s(t[`@type`]);n&&e.add(n)}return e},[T]),D=(0,W.useMemo)(()=>{let e=new Map;for(let[t,n]of a)e.set(t,new Set(n.properties.map(e=>e.property)));return e},[a]),O=(0,W.useMemo)(()=>{if(u)return u;let e=new Set;for(let t of i)t.siteLevel&&e.add(t.type);return e},[i,u]),k=(0,W.useMemo)(()=>m(T,O),[T,O]),A=(0,W.useMemo)(()=>{let e=[];return e.push(...k.siteContext),k.page&&e.push(k.page),k.primary&&e.push(k.primary),e.push(...k.linked),e},[k]),[j,M]=(0,W.useState)(null),[N,ee]=(0,W.useState)(null),P=(0,W.useRef)(null),F=(0,W.useRef)(null),[I,te]=(0,W.useState)(`site`);(0,W.useEffect)(()=>()=>{P.current!==null&&clearTimeout(P.current)},[]),(0,W.useEffect)(()=>{if(!w)return;let e=e=>{e.preventDefault()};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[w]);let L=(0,W.useMemo)(()=>c?g(T.nodes,c.entities):new Map,[T,c]),R=(0,W.useMemo)(()=>{if(j!==null){let e=T.byEk.get(j);if(e)return e}return k.primary??A[0]??null},[j,T,k.primary,A]),z=R?._ek??null,B=(0,W.useMemo)(()=>{if(!R)return!1;let e=s(R[`@type`]);return e!==null&&O.has(e)},[R,O]),V=(0,W.useCallback)(e=>{let t=e._ek;typeof t==`string`&&M(t)},[]),H=(0,W.useCallback)(e=>{let t=T.byId.get(e);if(!t)return;let n=t._ek;typeof n==`string`&&M(n),ee(e),F.current&&F.current.querySelector(`[data-entity-id="${nt(e)}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}),P.current!==null&&clearTimeout(P.current),P.current=setTimeout(()=>ee(null),1200)},[T]),U=(0,W.useCallback)(e=>{if(A.length===0)return;let t=A.findIndex(e=>e._ek===z);if(e.key===`ArrowDown`||e.key===`ArrowRight`){e.preventDefault();let n=A[Math.min(t+1,A.length-1)];n&&V(n)}else if(e.key===`ArrowUp`||e.key===`ArrowLeft`){e.preventDefault();let n=A[Math.max(t-1,0)];n&&V(n)}},[A,z,V]),K=(0,W.useCallback)((e,t,n)=>{x(r=>ie(r,e,t,n))},[]),q=(0,W.useCallback)((e,t)=>{x(n=>ae(n,e,t))},[]),ue=(0,W.useCallback)(e=>{x(t=>se(t,e))},[]),J=(0,W.useCallback)(e=>{x(t=>oe(t,{"@type":e,properties:{}}))},[]),fe=(0,W.useCallback)(()=>{x(G())},[]),X=(0,W.useCallback)(async()=>{if(l&&c&&w){C(!0);try{await l(le(b,c,L)),x(G())}finally{C(!1)}}},[l,c,b,w,L]);(0,W.useEffect)(()=>{if(!p)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),w&&!S&&X())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p,w,S,X]);let Z=(0,W.useCallback)((e,t,n)=>{let r=e._ek??`node-${n}`,o=s(e[`@type`]),c=o===null?null:a.get(o)??null;return(0,Y.jsx)(Oe,{node:e,catalogTypes:i,catalogDetail:c,selected:z===r,focused:N===e[`@id`],onSelect:V,onFollowReference:H,initiallyExpanded:t},r)},[a,i,N,H,V,z]);if(T.nodes.length===0&&!p)return(0,Y.jsxs)(`div`,{className:`graph-browser graph-browser--empty`,children:[(0,Y.jsx)(`p`,{className:`graph-browser-empty-message`,children:`This document has no composed JSON-LD graph yet. Configure a Schema.org archetype for the collection or document to see structured data here.`}),(0,Y.jsx)($e,{data:o})]});let Q=(0,Y.jsx)(Ze,{node:R,model:T,catalogTypes:i,catalogDetails:a,onFollowReference:H,onPropertyChange:p?K:void 0,onPropertyRemove:p?q:void 0,onDeleteEntity:p?ue:void 0,isSiteLevel:B,propagationScope:B?I:void 0,onPropagationChange:B?te:void 0});return(0,Y.jsxs)(`div`,{className:`graph-browser`,ref:F,role:`tree`,"aria-label":`JSON-LD graph browser`,tabIndex:0,onKeyDown:U,children:[(0,Y.jsxs)(`div`,{className:`graph-browser-header`,children:[(0,Y.jsx)(je,{model:T,layout:k,catalogTypes:i,catalogDetails:a}),(0,Y.jsxs)(`div`,{className:`graph-browser-header-actions`,children:[p&&(0,Y.jsxs)(`button`,{type:`button`,className:`graph-header-btn graph-header-btn--discard`,onClick:fe,disabled:!w||S,children:[(0,Y.jsx)(ne,{size:14}),` Discard`]}),(0,Y.jsx)(Ke,{value:h,onChange:_}),p&&(0,Y.jsxs)(`button`,{type:`button`,className:`graph-header-btn`,onClick:()=>y(!0),children:[(0,Y.jsx)(r,{size:14}),` Import`]}),(0,Y.jsx)(ke,{data:o,collection:d,slug:f}),p&&(0,Y.jsxs)(`button`,{type:`button`,className:`graph-header-btn graph-header-btn--save`,onClick:()=>void X(),disabled:!w||S,children:[(0,Y.jsx)(t,{size:14}),` `,S?`${e}…`:e]})]})]}),(0,Y.jsx)(`div`,{className:`graph-browser-body`,children:h===`tree`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`graph-browser-tree`,children:[k.siteContext.length>0&&(0,Y.jsxs)(Ae,{label:`Site Context`,variant:`site`,children:[k.siteContext.map((e,t)=>Z(e,!1,t)),p&&(0,Y.jsx)(de,{catalogTypes:i.filter(e=>e.siteLevel),onAdd:J})]}),k.page&&(0,Y.jsx)(Ae,{label:`Page`,variant:`page`,children:Z(k.page,!1,0)}),(k.primary||p)&&(0,Y.jsxs)(Ae,{label:`Primary Entity`,variant:`primary`,children:[k.primary&&Z(k.primary,!0,0),k.linked.map((e,t)=>Z(e,!1,t+1)),p&&(0,Y.jsx)(de,{catalogTypes:i.filter(e=>e.documentLevel),onAdd:J})]})]}),Q]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(W.Suspense,{fallback:(0,Y.jsx)(`div`,{className:`graph-canvas-loading`,children:`Loading canvas…`}),children:(0,Y.jsx)(et,{model:T,catalogTypes:i,catalogDetails:a,selectedEk:z,onSelect:V})}),Q]})}),(0,Y.jsx)($e,{data:o}),v&&(0,Y.jsx)(We,{currentModel:T,currentEntityTypes:E,catalogPropertySets:D,baseUrl:typeof window<`u`?window.location.origin:``,buffer:b,onApply:e=>x(e),onClose:()=>y(!1)})]})}function nt(e){return typeof globalThis.CSS?.escape==`function`?globalThis.CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,`\\$&`)}export{tt as GraphBrowser,X as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,c as n,d as r,f as i,i as a,l as o,n as s,o as c,r as l,s as u,t as d,u as f}from"./vendor-react-CXaWJ_ii.js";import{o as p,s as m}from"./vendor-diff-DGCTJYJ4.js";import{t as h}from"./vendor-reactflow-CMKi7AEX.js";import{C as g,S as _,_ as v,v as y,y as b}from"./graph-config-CgXhm7XP.js";import{t as x}from"./GraphBrowser-Cm5q82MJ.js";var S=e(m(),1),C=e(h(),1),w=p();function T({data:e}){let t=e.type,n=e.id,r=e.category,i=e.requiredSet,a=e.requiredTotal,o=e.selected;return(0,w.jsxs)(`div`,{className:`canvas-entity-node ${o?`canvas-entity-node--selected`:``} ${r?`canvas-entity-node--${r}`:``}`,children:[(0,w.jsx)(l,{type:`target`,position:f.Top,className:`canvas-handle`}),(0,w.jsxs)(`div`,{className:`canvas-entity-node-header`,children:[(0,w.jsx)(`span`,{className:`canvas-entity-node-type`,children:t}),(0,w.jsx)(x,{category:r})]}),n&&!n.startsWith(`__synthetic:`)&&(0,w.jsx)(`div`,{className:`canvas-entity-node-id`,children:_(n)}),a>0&&(0,w.jsxs)(`div`,{className:`canvas-entity-node-meter ${i===a?`canvas-entity-node-meter--complete`:``}`,children:[i,`/`,a,` required`]}),(0,w.jsx)(l,{type:`source`,position:f.Bottom,className:`canvas-handle`})]})}var E=220,D=100,O={entity:T};function k(e){return(0,w.jsx)(t,{children:(0,w.jsx)(A,{...e})})}function A({model:e,catalogTypes:t,catalogDetails:l,selectedEk:f,onSelect:p}){let{initialNodes:m,initialEdges:h}=(0,S.useMemo)(()=>j(e,t,l,null),[e,t,l]),[g,_,v]=n(m),[y,b,x]=u(h),{setViewport:C}=o(),T=(0,S.useRef)(null);(0,S.useEffect)(()=>{_(m),b(h)},[m,h,_,b]),(0,S.useEffect)(()=>{_(e=>e.map(e=>({...e,data:{...e.data,selected:e.id===f}})))},[f,_]),(0,S.useEffect)(()=>{if(g.length===0)return;let e=setTimeout(()=>{let e=r(g);if(!T.current)return;let{width:t,height:n}=T.current.getBoundingClientRect(),a=i(e,t,n,.2,1,.15);C({x:a.x,y:30,zoom:a.zoom},{duration:0})},100);return()=>clearTimeout(e)},[g,C]);let E=(0,S.useCallback)((t,n)=>{let r=e.byEk.get(n.id);r&&p(r)},[e,p]),D=(0,S.useCallback)(()=>{let e=M(m,h);_(e)},[m,h,_]);return(0,w.jsx)(`div`,{className:`graph-canvas-container`,children:(0,w.jsx)(`div`,{ref:T,className:`graph-canvas-flow`,children:(0,w.jsxs)(c,{nodes:g,edges:y,onNodesChange:v,onEdgesChange:x,onNodeClick:E,nodeTypes:O,minZoom:.2,maxZoom:2,children:[(0,w.jsx)(d,{}),(0,w.jsx)(s,{position:`bottom-left`,showInteractive:!1,children:(0,w.jsx)(`button`,{type:`button`,className:`react-flow__controls-button graph-canvas-reset-btn`,onClick:D,title:`Reset layout`,children:`↻`})}),(0,w.jsx)(a,{position:`bottom-right`,pannable:!0,zoomable:!0})]})})})}function j(e,t,n,r){let i=[],a=[];for(let a=0;a<e.nodes.length;a++){let o=e.nodes[a],s=g(o[`@type`])??`Unknown`,c=o._ek,l=typeof c==`string`?c:`__synthetic:${s}:${a}`,u=b(o,t),d=n.get(s)??null,f=v(o,d),{requiredSet:p,requiredTotal:m}=y(f);i.push({id:l,type:`entity`,position:{x:0,y:0},data:{type:s,id:l,category:u,requiredSet:p,requiredTotal:m,selected:l===r}})}let o=new Map;for(let t of e.nodes){let e=t[`@id`],n=t._ek;typeof e==`string`&&typeof n==`string`&&o.set(e,n)}for(let t of e.nodes){let e=t._ek;if(typeof e==`string`)for(let[n,r]of Object.entries(t)){if(n===`@type`||n===`@id`||n===`@context`||n===`_ek`)continue;let t=N(r);if(t){let r=o.get(t);r&&a.push({id:`${e}-${n}-${r}`,source:e,target:r,label:n,animated:!1,style:{stroke:`var(--color-border)`}})}}}return{initialNodes:M(i,a),initialEdges:a}}function M(e,t){let n=new C.default.graphlib.Graph;n.setGraph({rankdir:`TB`,nodesep:80,ranksep:120}),n.setDefaultEdgeLabel(()=>({}));for(let t of e)n.setNode(t.id,{width:E,height:D});for(let e of t)n.setEdge(e.source,e.target);return C.default.layout(n),e.map(e=>{let t=n.node(e.id);return{...e,position:{x:(t?.x??0)-E/2,y:(t?.y??0)-D/2}}})}function N(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;return typeof t[`@id`]==`string`?t[`@id`]:null}export{k as GraphCanvas};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-BklFHeMd.js";import{a as t,i as n,n as r,r as i,t as a}from"./api-client-BRi_ki2Y.js";import{p as o}from"./index-d5j-az5g.js";var s={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};s.node;var c=e(s);async function l(e,t,r){return n(`/seo/preview/${e}/${t}${i(r)}`)}async function u(e,t,r){return n(`/seo/resolved/${e}/${t}${i(r)}`)}async function d(e,t,r){return n(`/seo/findings/${e}/${t}${i(r)}`)}async function f(){return n(`/seo/findings`)}async function p(){return n(`/seo/sitemap.json`)}async function m(){return t(`/seo/robots.txt`)}async function h(){let e=await fetch(`${r}/seo/llms.txt`);if(!e.ok)throw new a(`Request failed: ${e.status}`,e.status,{});let t=e.headers.get(`x-krantho-llms-origin`),n=t===`snapshot`||t===`generated`?t:null;return{text:await e.text(),origin:n}}function g(e){return typeof e?.robotsTxt==`string`&&e.robotsTxt.length>0}async function _(){return(await T(`site`).catch(e=>{if(o(e))return{config:null};throw e})).config?.config??null}async function v(e){return(await D(`site`,{...await _()??{entities:[]},robotsTxt:e})).config}async function y(){let e=await _();if(!e||!g(e))return!1;let{robotsTxt:t,...n}=e;return await D(`site`,n),!0}async function b(e){return n(`/seo/enrich`,{method:`POST`,body:JSON.stringify(e)})}async function x(e){let t=e?`?jobId=${e}`:``;return n(`/seo/enrich/status${t}`)}async function S(){return n(`/seo/catalog`)}async function C(e){return n(`/seo/catalog?type=${encodeURIComponent(e)}`)}function w(e){return e.includes(`/`)?`/seo/config?id=${encodeURIComponent(e)}`:`/seo/config/${e}`}async function T(e){return n(w(e))}async function E(){return(await n(`/seo/config`)).configs}async function D(e,t){return n(`/seo/config`,{method:`PUT`,body:JSON.stringify({config:t,id:e})})}async function O(e,t){return n(`/seo/collection/${encodeURIComponent(e)}/impact?archetype=${encodeURIComponent(t)}`)}export{D as _,m as a,E as c,u as d,f,v as g,y as h,h as i,d as l,g as m,O as n,S as o,p,x as r,T as s,C as t,l as u,b as v,c as y};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{o as t,s as n}from"./vendor-diff-DGCTJYJ4.js";var r=t();function i(e=`secondary`,t=`md`,n){return[`ui-button`,`ui-button--${e}`,`ui-button--${t}`,n].filter(Boolean).join(` `)}function a({variant:e,size:t,icon:n,className:a,children:o,type:s=`button`,...c}){return(0,r.jsxs)(`button`,{type:s,className:i(e,t,a),...c,children:[n&&(0,r.jsx)(n,{className:`ui-button-icon`,"aria-hidden":`true`}),o]})}function o({icon:e,label:t,variant:n=`ghost`,size:a,className:o,type:s=`button`,...c}){return(0,r.jsx)(`button`,{type:s,className:i(n,a,[`ui-button--icon`,o].filter(Boolean).join(` `)),"aria-label":t,title:t,...c,children:(0,r.jsx)(e,{className:`ui-button-icon`,"aria-hidden":`true`})})}var s=e(n(),1),c=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function l(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:c(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var u=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},d=e=>{let t=u(e);return t.charAt(0).toUpperCase()+t.slice(1)},f=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),p={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function m(e){return e!=null}function h(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??p.width,a=e.size??e.height??p.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?f(...c):f(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??p[`stroke-width`])*Number(e.size??e.width??p.width)/Number(t.size??t.width??p.width):t.strokeWidth??p[`stroke-width`];return[`svg`,{...Object.entries(p).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&m(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&m(t.width)&&{[r(`width`)]:t.width},...`height`in t&&m(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function g(e,t={}){return h(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var _=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},v=(0,s.createContext)({}),y=()=>(0,s.useContext)(v),b=(0,s.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:c=``,children:l,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...p},m)=>{let{size:h=24,strokeWidth:v=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=y()??{},w=!!l||_(p),[T,E,D=[]]=g(d,{color:e??S,width:n??t??h,height:r??t??h,strokeWidth:i??v,absoluteStrokeWidth:a??b,nonScalingStroke:o??x,className:f(C,c),hasA11yProp:w,attributes:p});return(0,s.createElement)(T,{ref:m,...E},[...D.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(l)?l:[l]])});function x(e,t=[],n=[]){let r=typeof e==`string`?l(e,t,n):e,i=(0,s.forwardRef)(({className:e,...t},n)=>(0,s.createElement)(b,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=d(r.name)),i}export{i,a as n,o as r,x as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{s as t}from"./vendor-diff-DGCTJYJ4.js";import{t as n}from"./createLucideIcon-BklFHeMd.js";import{r,v as i}from"./api-seo-DeG5gsh6.js";import{f as a}from"./index-d5j-az5g.js";var o={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};o.node;var s=n(o),c=e(t(),1),l={"meta-descriptions":`Meta description`,archetype:`Schema.org properties`},u=500,d=e=>new Promise(t=>setTimeout(t,e));async function f(e,t,n){for(;;){let i=await r(e);if(!t())return null;if(n(i),i.status!==`running`)return i;await d(u)}}async function p(e,t,n,r=()=>void 0,a=!1){let o=await i({type:e,force:a,...t});if(!o.jobId)return{state:`empty`,message:o.message??`Nothing to enrich`};let s=await f(o.jobId,n,r);return s?{state:`finished`,status:s}:null}var m={steps:[`meta-descriptions`,`archetype`],force:!1},h={steps:[`meta-descriptions`],force:!1},g={steps:m.steps,force:!0};function _(e,t){return`step ${e.steps.indexOf(t)+1} of ${e.steps.length}`}var v={state:`idle`},y=new Set;function b(e){v=e;for(let e of y)e()}function x(e){return y.add(e),()=>{y.delete(e)}}var S=()=>v;async function C(e,t){let n=[];for(let r of t.steps){let i=e=>({state:`running`,plan:t,step:r,status:e,done:[...n]});b(i(null));let a=await p(r,e,()=>!0,e=>b(i(e)),t.force);if(!a)throw Error(`${r} stopped without an answer`);n.push(a.state===`empty`?{step:r,empty:a.message,status:null}:{step:r,empty:null,status:a.status})}return n}function w(e,t,n=m){return v.state!==`running`&&(C(e,n).then(e=>b({state:`done`,plan:n,reports:e}),e=>{let t=v.state===`running`?v.done:[];b({state:`failed`,plan:n,message:a(e,`Enrichment failed`),reports:t})}).finally(()=>t(v)),!0)}function T(){v.state!==`running`&&b({state:`idle`})}function E(){return(0,c.useSyncExternalStore)(x,S,S)}export{w as a,l as c,T as i,p as l,g as n,_ as o,h as r,E as s,m as t,s as u};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{o as t,s as n}from"./vendor-diff-DGCTJYJ4.js";import{n as r,t as i}from"./createLucideIcon-BklFHeMd.js";import{n as a}from"./use-loaded-BNCu0C-c.js";import{t as o}from"./copy-V85khWct.js";import{t as s}from"./corner-down-right-BpwOGRFR.js";import{a as c}from"./findability-BrhtZ2yD.js";import{t as l}from"./layers-0VWe0rKm.js";import{T as u,c as ee,ct as d}from"./index-d5j-az5g.js";import{t as f}from"./guards-BFEDbduR.js";var p={name:`calculator`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`line`,{x1:`8`,x2:`16`,y1:`6`,y2:`6`,key:`x4nwl0`}],[`line`,{x1:`16`,x2:`16`,y1:`14`,y2:`18`,key:`wjye3r`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]};p.node;var te=i(p),m={name:`circle-minus`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-circle`]};m.node;var ne=i(m),h={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};h.node;var g=i(h),_={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};_.node;var v=i(_),y={name:`panels-top-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]],aliases:[`layout`]};y.node;var b=i(y),x={name:`route`,size:24,node:[[`path`,{d:`M9 5h8.5a1 1 0 010 7h-11a1 1 0 000 7H15`,key:`1r1aam`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`circle`,{cx:`6`,cy:`5`,r:`3`,key:`151irh`}]]};x.node;var S=i(x),C=e(n(),1),w=t(),T={business:`Business & Organization`,content:`Content`,commerce:`Commerce & Services`,people:`People & Events`,navigation:`Navigation & Structure`,reviews:`Reviews & Ratings`},E=new Set(Object.keys(T)),D=new Set([`WebPage`,`AboutPage`,`CheckoutPage`,`CollectionPage`,`ContactPage`,`FAQPage`,`ItemPage`,`MedicalWebPage`,`ProfilePage`,`QAPage`,`RealEstateListing`,`SearchResultsPage`]);function re(e){let t=ie(e),n=[];for(let e of t)ae(e)&&n.push(e);z(n);let r=B(n),i=oe(n);return{nodes:n,byEk:r,byId:i,referencedBy:O(n),primary:se(n,i)}}function ie(e){if(e==null)return[];if(Array.isArray(e))return e;if(typeof e!=`object`)return[];let t=e,n=t[`@graph`];return Array.isArray(n)?n:`@type`in t?[t]:[]}function ae(e){return typeof e!=`object`||!e||Array.isArray(e)?!1:`@type`in e}function oe(e){let t=new Map;for(let n of e){let e=n[`@id`];typeof e==`string`&&t.set(e,n)}return t}function O(e){let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n))if(e!==`@type`&&e!==`@id`&&e!==`@context`&&e!==`_ek`)for(let i of k(r)){let r=t.get(i);r||(r=[],t.set(i,r)),r.push({source:n,property:e})}return t}function k(e){if(typeof e!=`object`||!e)return[];if(Array.isArray(e)){let t=[];for(let n of e)for(let e of k(n))t.push(e);return t}let t=e,n=t[`@id`];if(typeof n==`string`)return[n];let r=[];for(let e of Object.values(t))for(let t of k(e))r.push(t);return r}function se(e,t){let n=e.find(e=>ce(e));if(!n)return null;let r=I(n.mainEntity);return r===void 0?null:t.get(r)??null}function ce(e){let t=A(e[`@type`]);return t!==null&&D.has(t)}function A(e){return typeof e==`string`?e:Array.isArray(e)&&e.length>0&&typeof e[0]==`string`?e[0]:null}function j(e,t){let n=[],r=[],i=[];for(let a of e.nodes){let e=A(a[`@type`]);e!==null&&(D.has(e)?r.push(a):t.has(e)?n.push(a):i.push(a))}let a=r[0]??null,o=e.primary??i[0]??null;return{siteContext:n,page:a,primary:o,linked:i.filter(e=>e!==o)}}function M(e,t){let n=A(e[`@type`]);if(n===null)return null;let r=t.find(e=>e.type===n);return r&&E.has(r.category)?r.category:null}function N(e,t){let n=new Set;for(let t of Object.keys(e))t!==`@type`&&t!==`@id`&&t!==`@context`&&t!==`_ek`&&n.add(t);if(t)for(let e of t.properties)n.add(e.property);let r=new Map;if(t)for(let e of t.properties)r.set(e.property,e);let i=[];for(let t of n){let n=e[t],a=r.get(t),o=a?.importance??`unknown`,s=P(n)?`set`:`missing`,c=F(n),l=c?I(n):void 0,u={property:t,value:n,importance:o,state:s,isReference:c,...a?{def:a}:{},...l===void 0?{}:{referenceId:l}};i.push(u)}return i}function P(e){return!(e==null||e===``||Array.isArray(e)&&e.length===0)}function F(e){return typeof e!=`object`||!e||Array.isArray(e)?!1:typeof e[`@id`]==`string`}function I(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e;return typeof t[`@id`]==`string`?t[`@id`]:void 0}function L(e){let t=0,n=0;for(let r of e)r.importance===`required`&&(n+=1,r.state===`set`&&(t+=1));return{requiredSet:t,requiredTotal:n}}function R(e){let t=e.lastIndexOf(`#`);if(t!==-1)return e.slice(t);let n=e.lastIndexOf(`/`);return n!==-1&&n<e.length-1?e.slice(n):e}function z(e){for(let t=0;t<e.length;t++){let n=e[t];n._ek=String(t)}}function B(e){let t=new Map;for(let n of e){let e=n._ek;typeof e==`string`&&t.set(e,n)}return t}function V(e,t){let n=new Map,r=new Set;for(let i of e){let e=i._ek;if(typeof e!=`string`)continue;let a=A(i[`@type`]),o=typeof i[`@id`]==`string`?i[`@id`]:void 0,s=typeof i.role==`string`?i.role:void 0,c=-1;o&&(c=t.findIndex((e,t)=>!r.has(t)&&e[`@id`]===o)),c<0&&a&&(c=t.findIndex((e,t)=>!r.has(t)&&e[`@type`]===a&&(e.role??void 0)===s)),c<0&&a&&(c=t.findIndex((e,t)=>!r.has(t)&&e[`@type`]===a)),c>=0&&(n.set(e,c),r.add(c))}return n}function H(e){let t=e=>e.importance===`required`&&e.state===`missing`?0:e.importance===`recommended`&&e.state===`missing`?1:e.state===`set`?2:e.importance===`optional`?3:4;return[...e].sort((e,n)=>{let r=t(e),i=t(n);return r===i?e.property.localeCompare(n.property):r-i})}var U={idle:``,copied:`JSON-LD copied`,failed:`Could not copy. Select the text and copy it yourself.`};function W(e){let[t,n]=(0,C.useState)(`idle`),r=(0,C.useRef)(null);(0,C.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(e){n(e),r.current&&clearTimeout(r.current),e===`copied`&&(r.current=setTimeout(()=>n(`idle`),2e3))}function a(){navigator.clipboard?navigator.clipboard.writeText(e).then(()=>i(`copied`),()=>i(`failed`)):i(`failed`)}return{state:t,copy:a}}function G({data:e,label:t}){let n=JSON.stringify(e,null,2),{state:i,copy:s}=W(n),c=i===`copied`;return(0,w.jsxs)(`div`,{className:`json-ld-code`,children:[(0,w.jsxs)(`div`,{className:`json-ld-code-head`,children:[(0,w.jsx)(`span`,{className:`json-ld-code-label`,children:t}),(0,w.jsx)(r,{size:`sm`,variant:`ghost`,icon:c?a:o,onClick:s,children:c?`Copied`:`Copy`}),(0,w.jsx)(`span`,{className:i===`failed`?`json-ld-code-status`:`visually-hidden`,role:`status`,children:U[i]})]}),(0,w.jsx)(`section`,{className:`json-ld-code-source`,tabIndex:0,"aria-label":t,children:(0,w.jsx)(`pre`,{children:(0,w.jsx)(`code`,{children:n})})})]})}function le(e,t,n){let r=e?.entities.map(e=>e[`@type`])??[];if(r.length>0)return r;let i=t?.entities.map(e=>e[`@type`])??[];if(i.length>0)return i;let a=n?.entities.map(e=>e[`@type`])??[];return a.length>0?a:[]}function ue(){let[e,t]=(0,C.useState)(`loading`);return(0,C.useEffect)(()=>{let e=!0;return u().then(n=>e&&t(n.configured?`configured`:`missing`)).catch(()=>e&&t(`unknown`)),()=>{e=!1}},[]),e}var K={site:{label:`site`,meaning:`From the site entities`},collection:{label:`collection`,meaning:`From the collection archetype`},route:{label:`URL pattern`,meaning:`From a URL-pattern override`},document:{label:`document`,meaning:`Set in this document`},computed:{label:`computed`,meaning:`Computed from the page: no one typed it`},linked:{label:`linked`,meaning:`A reference to another entity, by its @id`}},de={site:{label:`site`,meaning:`A site entity: every page emits it`},page:{label:`page`,meaning:`This page's own entity, from its archetype`}};function fe(e){if(!f(e))return null;let t=e[`@id`];return typeof t==`string`?t:null}function q(e){return(Array.isArray(e)?e:[e]).map(fe).filter(e=>e!==null)}function pe(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);let t=q(e),n=Array.isArray(e)?e:[e];return t.length>0&&t.length===n.length?t.join(`, `):JSON.stringify(e)??``}function J(e){let t=e[`@type`];return typeof t==`string`?t:Array.isArray(t)&&typeof t[0]==`string`?t[0]:`Thing`}function me(e,t,n){let r=n?.properties.find(t=>t.property===e);return{key:e,text:pe(t),scope:r?.scope??`computed`,origin:r?.origin??`Added by krantho when it composes the page`,references:q(t),fixed:r?!r.editable:!1}}function he(e,t,n,r,i){return n?n.level===`site`?`site`:`page`:r.siteTypes.has(J(e))||t<i?`site`:`page`}function ge(e){let t=new Set(e.resolved.filter(e=>e.level===`document`).map(e=>e.id)),n=e.nodes.findIndex(e=>t.has(String(e[`@id`])));return n>=0?n:0}var Y={computed:0,linked:0,site:1,collection:2,route:3,document:4};function _e(e,t){return Y[e.scope]>Y[t.scope]?e:t}function ve(e){let t=new Map;for(let n of e){let e=t.get(n.id);if(!e){t.set(n.id,n);continue}let r=new Map(e.properties.map(e=>[e.property,e]));for(let e of n.properties){let t=r.get(e.property);r.set(e.property,t?_e(t,e):e)}let i=e.level===`document`||n.level===`document`?`document`:`site`;t.set(n.id,{...n,level:i,properties:[...r.values()]})}return t}function X(e){let t=ge(e),n=ve(e.resolved);return e.nodes.map((r,i)=>{let a=typeof r[`@id`]==`string`?r[`@id`]:``,o=n.get(a),s=Object.entries(r).filter(([e])=>!e.startsWith(`@`)).map(([e,t])=>me(e,t,o));return{id:a,type:J(r),scope:he(r,i,o,e,t),rows:s}})}function ye(e){let t=X(e);return[...t.filter(e=>e.scope===`page`),...t.filter(e=>e.scope===`site`)]}function be(e){let t=new Map;for(let n of e.flatMap(e=>e.rows))t.set(n.scope,(t.get(n.scope)??0)+1);return Object.keys(K).filter(e=>t.has(e)).map(e=>[e,t.get(e)??0])}var xe={site:g,collection:l,route:S,document:c,computed:te,linked:v},Se={site:g,page:b};function Z({icon:e,label:t,meaning:n,own:r}){return(0,w.jsxs)(`span`,{className:ee(r?`accent`:`neutral`,`data-scope`),title:n,children:[(0,w.jsx)(e,{className:`ui-chip-icon`,"aria-hidden":`true`}),(0,w.jsx)(`span`,{"aria-hidden":`true`,children:t}),(0,w.jsxs)(`span`,{className:`visually-hidden`,children:[t,`: `,n]})]})}function Q({scope:e}){let{label:t,meaning:n}=K[e];return(0,w.jsx)(Z,{icon:xe[e],label:t,meaning:n,own:e===`document`})}function Ce({scope:e}){let{label:t,meaning:n}=de[e];return(0,w.jsx)(Z,{icon:Se[e],label:t,meaning:n,own:e===`page`})}function we({counts:e}){return(0,w.jsx)(`ul`,{className:`data-legend`,"aria-label":`Sources`,children:e.map(([e,t])=>(0,w.jsxs)(`li`,{children:[(0,w.jsx)(Q,{scope:e}),(0,w.jsxs)(`span`,{className:`data-legend-text`,children:[K[e].meaning,` · `,t]})]},e))})}function Te({row:e,headingOf:t}){return(0,w.jsx)(`span`,{className:`data-refs`,children:e.references.map(e=>{let n=t(e);return n?(0,w.jsxs)(`button`,{type:`button`,className:`data-ref`,"aria-label":`Go to ${e}`,onClick:()=>document.getElementById(n)?.focus(),children:[(0,w.jsx)(s,{"aria-hidden":`true`}),(0,w.jsx)(`code`,{children:e})]},e):(0,w.jsx)(`code`,{children:e},e)})})}function Ee({row:e,headingOf:t}){return(0,w.jsxs)(`tr`,{children:[(0,w.jsxs)(`th`,{scope:`row`,className:`data-prop-key`,children:[(0,w.jsx)(`code`,{children:e.key}),e.fixed&&(0,w.jsxs)(`span`,{className:`data-prop-fixed`,title:`Set by the type: the SEO settings cannot change it`,children:[(0,w.jsx)(d,{"aria-hidden":`true`}),(0,w.jsx)(`span`,{className:`visually-hidden`,children:`set by the type`})]})]}),(0,w.jsx)(`td`,{className:`data-prop-value`,"data-label":`Value`,children:e.references.length>0?(0,w.jsx)(Te,{row:e,headingOf:t}):(0,w.jsx)(`code`,{title:e.text,children:e.text})}),(0,w.jsxs)(`td`,{className:`data-prop-source`,"data-label":`Source`,children:[(0,w.jsx)(Q,{scope:e.scope}),(0,w.jsx)(`span`,{className:`data-prop-origin`,children:e.origin})]})]})}function De({view:e,headingOf:t}){return(0,w.jsxs)(`table`,{className:`data-props`,children:[(0,w.jsxs)(`caption`,{className:`visually-hidden`,children:[e.type,` `,e.id,`: each property's value and where it comes from`]}),(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{children:[(0,w.jsx)(`th`,{scope:`col`,children:`Property`}),(0,w.jsx)(`th`,{scope:`col`,children:`Value`}),(0,w.jsx)(`th`,{scope:`col`,children:`Source`})]})}),(0,w.jsx)(`tbody`,{children:e.rows.map(e=>(0,w.jsx)(Ee,{row:e,headingOf:t},e.key))})]})}function $({view:e,headingId:t,headingOf:n}){return(0,w.jsxs)(`li`,{className:`data-entity`,"data-entity-id":e.id,children:[(0,w.jsxs)(`div`,{className:`data-entity-head`,children:[(0,w.jsx)(`h3`,{id:t,tabIndex:-1,className:`data-entity-type`,children:e.type}),(0,w.jsx)(Ce,{scope:e.scope}),(0,w.jsx)(`code`,{className:`data-entity-id`,children:e.id||`no @id`})]}),e.rows.length===0?(0,w.jsx)(`p`,{className:`data-note`,children:`No property has a value.`}):(0,w.jsx)(De,{view:e,headingOf:n})]})}function Oe({views:e}){let t=(0,C.useId)(),n=e=>`${t}-entity-${e}`,r=t=>{let r=t?e.findIndex(e=>e.id===t):-1;return r>=0?n(r):null};return(0,w.jsx)(`ul`,{className:`data-entities`,"aria-label":`Entities`,children:e.map((e,t)=>(0,w.jsx)($,{view:e,headingId:n(t),headingOf:r},`${t}-${e.id}`))})}function ke(e){if(!f(e))return[];let t=e[`@graph`];return Array.isArray(t)?t.filter(f):[e]}function Ae(e){return e.document?e.document:e.collection?{entities:e.collection.entities}:{entities:le(null,null,e.site).map(e=>({"@type":e,properties:{}}))}}function je(e,t,n,r){let i=e=>!t.has(e),a=r?e.findIndex((e,t)=>i(t)&&e[`@id`]===r):-1;return a>=0?a:e.findIndex((e,t)=>i(t)&&e[`@type`]===n&&!e[`@id`])}function Me(e,t){let n=Ae(t),r=new Set,i=[];for(let t of e){let e=A(t[`@type`]);if(e===null)continue;let a=typeof t[`@id`]==`string`?t[`@id`]:void 0,o=je(n.entities,r,e,a),s=n.entities[o];o>=0&&s?(r.add(o),i.push(!s[`@id`]&&a?{...s,"@id":a}:s)):i.push({"@type":e,...a?{"@id":a}:{},properties:{}})}return{...n,entities:i}}function Ne(e){let t=e.flatMap(e=>{let t=A(e[`@type`]);return t===null?[]:[t]});return[...new Set(t)]}export{A as C,ne as D,g as E,R as S,v as T,N as _,we as a,H as b,q as c,G as d,T as f,j as g,O as h,Oe as i,be as l,V as m,ke as n,ye as o,B as p,Ne as r,X as s,Me as t,ue as u,L as v,S as w,re as x,M as y};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AssistantPanel-DpYeurU-.js","assets/rolldown-runtime-COiEfhsA.js","assets/createLucideIcon-BklFHeMd.js","assets/vendor-diff-DGCTJYJ4.js","assets/createLucideIcon-DO6kYgVn.css","assets/vendor-router-B4czwg8X.js","assets/api-client-BRi_ki2Y.js","assets/auth-CIpilSKF.js","assets/send-kYpW5JED.js","assets/vendor-markdown-BeOOOWTF.js","assets/circle-check-big-DQjpuxcC.js","assets/clock-DoBIVjZO.js","assets/copy-V85khWct.js","assets/info-Cxkabti5.js","assets/triangle-exclamation-point-ttN5lZI0.js","assets/circle-x-peGpq98w.js","assets/AssistantPanel-DB6gluI1.css","assets/pulse-page-zRYAQJh6.js","assets/api-seo-DeG5gsh6.js","assets/format-C3ZX9yGM.js","assets/source-CGZGd3Xy.js","assets/empty-state-CeUZocHx.js","assets/empty-state-Bvnil5AQ.css","assets/findability-BrhtZ2yD.js","assets/meter-ZOLJ0WhG.js","assets/meter-WebPk4WX.css","assets/pen-line-B524Nue8.js","assets/pulse-page-HgFM-MfC.css","assets/site-overview-B0Dnsj2N.js","assets/data-table-B1kqxrEw.js","assets/data-table-Dm9uZXES.css","assets/site-model-BXHOxNij.js","assets/site-CGs9-oiw.js","assets/use-loaded-BNCu0C-c.js","assets/circle-dashed-cuYrILNo.js","assets/corner-down-right-BpwOGRFR.js","assets/external-link-Dh7p8Ii6.js","assets/site-lUERQFzn.css","assets/collection-view-Bbr6ff-2.js","assets/export-helpers-C_HVpJN9.js","assets/upload-CaqQJaUr.js","assets/guards-BFEDbduR.js","assets/trash-DzRCm500.js","assets/collection-view-Dllo4l_w.css","assets/editor-page-ydSt1TIL.js","assets/use-drawer-actions-BeAi2hJS.js","assets/media-model-D4F1Farw.js","assets/action-button-DIrhqMRc.js","assets/use-drawer-actions-DeFJMhBn.css","assets/rotate-ccw-BgARBEK3.js","assets/vendor-react-CXaWJ_ii.js","assets/vendor-react-DLioOiRN.css","assets/graph-config-CgXhm7XP.js","assets/layers-0VWe0rKm.js","assets/graph-config-mZyX0Lqo.css","assets/fill-job-CKtHKXwV.js","assets/arrow-left-7opbl8fu.js","assets/use-locale-versions-CcJ_us1I.js","assets/editor-page-D-qGDgmd.css","assets/structure-page-DpM1G-M9.js","assets/fill-run-view-ChrOLoV4.js","assets/fill-run-view-BhqhXo7I.css","assets/save-ClSXW9cb.js","assets/vendor-reactflow-CMKi7AEX.js","assets/catalog-offer-CeRRk2Zo.js","assets/arrow-down-B5kfR2lG.js","assets/list-checks-BCEhMMVY.js","assets/structure-page-DVSxQzgj.css","assets/media-page-DuSUjFO1.js","assets/pencil-xdGZtrO4.js","assets/media-page-DBdAvFvu.css","assets/image-editor-CAZbOhRZ.js","assets/vendor-media-DXSmPN_d.js","assets/vendor-media-DJOnVxEf.css","assets/image-editor-BTlqjPtS.css","assets/setup-page-CshRkFJ-.js","assets/setup-page-Bc799yav.css"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,o as n,s as r}from"./vendor-diff-DGCTJYJ4.js";import{m as i,p as a}from"./vendor-react-CXaWJ_ii.js";import{a as o,c as s,d as c,i as l,l as u,n as d,o as ee,p as f,t as p,u as te}from"./vendor-router-B4czwg8X.js";import{i as m,r as ne,t as re}from"./auth-CIpilSKF.js";import{c as ie,d as h,o as ae,s as oe,t as g,u as _}from"./format-C3ZX9yGM.js";import{i as v,n as y,r as b,t as x}from"./createLucideIcon-BklFHeMd.js";import{i as S,r as C,t as se}from"./api-client-BRi_ki2Y.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var w=e(r(),1),ce=a(),T=`globals`,E=encodeURIComponent;function D(e,t,n){let r=e===`globals`?`/layout/${E(t)}`:`/site/${E(e)}/${E(t)}`;return n?`${r}?locale=${E(n)}`:r}function le(e,t,n){let r=new URLSearchParams({...n?{locale:n}:{},mode:`data`});return`/site/${E(e)}/${E(t)}?${r}`}function O(e){return`/site/${E(e)}`}function k(e){return`/new/${E(e)}`}var ue=`/structure/graph?fill=1`;function de(e){return e?`/structure/scopes#scope-${e}`:`/structure/scopes`}function fe(e){return`/media/${E(e)}/edit`}var pe=`/setup/ai`,A=n();function me(e){if(typeof e!=`object`||!e)return!1;let{name:t,login_url:n}=e;return typeof t==`string`&&typeof n==`string`}function he(e){let t=e?.capabilities?.oidc_providers;return Array.isArray(t)?t.filter(me):[]}function ge(){let{login:e,authMode:t}=m(),[n,r]=(0,w.useState)(``),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),u=(0,w.useCallback)(e=>{e?.focus()},[]);(0,w.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`error`);e&&(a(e),window.history.replaceState({},``,window.location.pathname))},[]),(0,w.useEffect)(()=>{t===`oidc`&&fetch(`/api/auth/capabilities`).then(e=>e.json()).then(e=>{l(he(e))}).catch(()=>{})},[t]);async function d(t){t.preventDefault(),n.trim()&&(s(!0),a(null),await e(n.trim())||a(`Invalid access token`),s(!1))}return(0,A.jsx)(`div`,{className:`login-page`,children:(0,A.jsxs)(`div`,{className:`login-card`,children:[(0,A.jsx)(`h1`,{className:`login-title`,children:`krantho`}),(0,A.jsx)(`p`,{className:`login-subtitle`,children:t===`token`?`Enter your access token to continue`:`Sign in to continue`}),i&&(0,A.jsx)(`div`,{className:`login-error`,children:i}),t===`token`&&(0,A.jsxs)(`form`,{onSubmit:d,className:`login-form`,children:[(0,A.jsxs)(`div`,{className:`field`,children:[(0,A.jsx)(`label`,{className:`field-label`,htmlFor:`token`,children:`Access Token`}),(0,A.jsx)(`input`,{id:`token`,type:`password`,className:`field-input`,value:n,onChange:e=>r(e.target.value),placeholder:`Enter token`,ref:u})]}),(0,A.jsx)(`button`,{type:`submit`,className:v(`primary`,`md`,`login-btn`),disabled:o,children:o?`Signing in...`:`Sign In`})]}),t===`oidc`&&(0,A.jsxs)(`div`,{className:`login-oidc`,children:[c.map(e=>(0,A.jsxs)(`a`,{href:e.login_url,className:v(`primary`,`md`,`login-btn`),children:[`Sign in with `,e.name]},e.login_url)),c.length===0&&(0,A.jsx)(`p`,{className:`login-subtitle`,children:`No OIDC providers configured`})]})]})})}var _e=(0,w.createContext)(null);function ve({children:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(!1),a=(0,w.useRef)(null),o=(0,w.useCallback)(()=>{i(!0),n(e=>!e)},[]),s=(0,w.useCallback)(()=>{n(!1),a.current?.focus()},[]),c=(0,w.useMemo)(()=>({open:t,opened:r,toggle:o,close:s,launcherRef:a}),[t,r,o,s]);return(0,A.jsx)(_e,{value:c,children:e})}function j(){return(0,w.useContext)(_e)}function ye(e){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(e).matches}function be(e){let[t,n]=(0,w.useState)(()=>ye(e));return(0,w.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function xe(e){try{let t=JSON.parse(localStorage.getItem(e)??`null`);return typeof t==`object`&&t?t:{}}catch{return{}}}function Se(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function Ce(e,t,n){return typeof e==`number`&&e>=t.min&&e<=t.max?e:n}function we(e,t){let[n,r]=(0,w.useState)(t),i=(0,w.useRef)(n);return(0,w.useEffect)(()=>{n!==i.current&&(i.current=n,Se(e,n))},[e,n]),[n,r]}var Te=`krantho-studio-nav`,M={min:200,max:360,fallback:236};function Ee(){let{collapsed:e,width:t,closedGroups:n}=xe(Te);return{collapsed:e===!0,width:Ce(t,M,M.fallback),closedGroups:Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}}function De(){let[e,t]=we(Te,Ee),n=(0,w.useCallback)(e=>t(t=>({...t,collapsed:e})),[t]),r=(0,w.useCallback)(e=>t(t=>({...t,width:e})),[t]),i=(0,w.useCallback)(e=>t(t=>({...t,closedGroups:t.closedGroups.includes(e)?t.closedGroups.filter(t=>t!==e):[...t.closedGroups,e]})),[t]);return{...e,setCollapsed:n,setWidth:r,toggleGroup:i}}var Oe={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};Oe.node;var ke=x(Oe),Ae={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};Ae.node;var je=x(Ae),Me={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Me.node;var Ne=x(Me),Pe={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};Pe.node;var Fe=x(Pe),Ie={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Ie.node;var N=x(Ie),Le={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Le.node;var Re=x(Le),ze={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};ze.node;var Be=x(ze),Ve={name:`cloud-upload`,size:24,node:[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]],aliases:[`upload-cloud`]};Ve.node;var He=x(Ve),Ue={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Ue.node;var We=x(Ue),Ge={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Ge.node;var Ke=x(Ge),qe={name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]};qe.node;var Je=x(qe),Ye={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Ye.node;var Xe=x(Ye),Ze={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};Ze.node;var Qe=x(Ze),$e={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};$e.node;var et=x($e),tt={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};tt.node;var nt=x(tt),rt={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};rt.node;var it=x(rt),at={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};at.node;var ot=x(at),st={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};st.node;var ct=x(st),lt={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};lt.node;var P=x(lt),ut={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};ut.node;var dt=x(ut),ft={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};ft.node;var pt=x(ft),mt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};mt.node;var ht=x(mt),gt={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};gt.node;var _t=x(gt),vt={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};vt.node;var F=x(vt),yt={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};yt.node;var bt=x(yt),xt={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};xt.node;var St=x(xt),Ct={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Ct.node;var wt=x(Ct),Tt={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Tt.node;var Et=x(Tt),Dt={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Dt.node;var Ot=x(Dt),kt={name:`webhook`,size:24,node:[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]};kt.node;var At=x(kt),jt={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};jt.node;var I=x(jt),Mt=6e3,Nt=(0,w.createContext)(null);function Pt(){let e=(0,w.useContext)(Nt);if(!e)throw Error(`useToast needs a ToastProvider`);return e}function Ft(e,t){let[n,r]=(0,w.useState)(!1),i=(0,w.useRef)(t);return(0,w.useEffect)(()=>{i.current=t},[t]),(0,w.useEffect)(()=>{if(e!==`success`||n)return;let t=setTimeout(()=>i.current(),Mt);return()=>clearTimeout(t)},[e,n]),r}function It(e){(0,w.useLayoutEffect)(()=>{let t=e.current;return()=>{if(!t?.contains(document.activeElement))return;let e=[...document.querySelectorAll(`.ui-toast-dismiss`)].filter(e=>!t.contains(e))[0]??document.getElementById(`studio-main`);queueMicrotask(()=>(e?.isConnected?e:document.getElementById(`studio-main`))?.focus())}},[e])}var Lt={success:Re,error:Be};function Rt({entry:e,onExpire:t,onDismiss:n}){let r=Ft(e.tone,t),i=(0,w.useRef)(null);It(i);let a=Lt[e.tone];return(0,A.jsxs)(`div`,{ref:i,className:`ui-toast ui-toast--${e.tone}`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},children:[(0,A.jsx)(a,{className:`ui-toast-icon`,"aria-hidden":`true`}),(0,A.jsx)(`p`,{className:`ui-toast-text`,children:e.text}),(0,A.jsx)(`button`,{type:`button`,className:`ui-toast-dismiss`,"aria-label":`Dismiss`,onClick:n,children:(0,A.jsx)(I,{"aria-hidden":`true`})})]})}function zt({entries:e,dismiss:t}){return e.map(e=>(0,A.jsx)(Rt,{entry:e,onExpire:()=>t(e.id),onDismiss:()=>t(e.id)},e.id))}function Bt({children:e}){let[t,n]=(0,w.useState)([]),r=(0,w.useRef)(0),i=(0,w.useCallback)(({text:e,tone:t=`success`})=>{r.current+=1;let i={id:r.current,text:e,tone:t};n(e=>[...e,i].slice(-3))},[]),a=(0,w.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]);return(0,A.jsxs)(Nt.Provider,{value:i,children:[e,(0,A.jsxs)(`div`,{className:`ui-toasts`,children:[(0,A.jsx)(`div`,{className:`ui-toast-region`,role:`status`,"aria-label":`Notifications`,children:(0,A.jsx)(zt,{entries:t.filter(e=>e.tone===`success`),dismiss:a})}),(0,A.jsx)(`div`,{className:`ui-toast-region`,role:`alert`,"aria-label":`Errors`,children:(0,A.jsx)(zt,{entries:t.filter(e=>e.tone===`error`),dismiss:a})})]})]})}var Vt=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`;function L(e){return[...e.querySelectorAll(Vt)].filter(e=>!e.closest(`[hidden], [inert]`))}function Ht(e,t){if(e.key!==`Tab`)return;let n=L(t),r=n[0],i=n[n.length-1];if(!r||!i){e.preventDefault();return}let a=document.activeElement;e.shiftKey&&(a===r||!t.contains(a))?(e.preventDefault(),i.focus()):e.shiftKey||a!==i&&t.contains(a)||(e.preventDefault(),r.focus())}function R(e,t,n){(0,w.useEffect)(()=>{let r=e.current;if(!t||!r)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null;(n?.current??L(r)[0]??r).focus();let a=e=>Ht(e,r);return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a),i?.isConnected&&i.focus()}},[t,e,n])}async function z(){return(await S(`/collections`)).collections}async function Ut(e,t){let n=new URLSearchParams({view:`summary`});t?.status&&n.set(`status`,t.status),t?.sort&&n.set(`sort`,t.sort),t?.limit!==void 0&&n.set(`limit`,String(t.limit)),t?.offset!==void 0&&n.set(`offset`,String(t.offset)),t?.locale&&n.set(`locale`,t.locale);let r=n.toString();return S(`/content/${e}?${r}`)}async function Wt(e){return S(`/content-tree?locale=${encodeURIComponent(e)}`)}var Gt=500;async function Kt(e={}){let t=[];for(;;){let n=new URLSearchParams({view:e.view??`summary`});e.collections?.length&&n.set(`collections`,e.collections.join(`,`)),e.locale&&n.set(`locale`,e.locale),e.status&&n.set(`status`,e.status),n.set(`limit`,String(Gt)),n.set(`offset`,String(t.length));let r=await S(`/content?${n}`);if(t.push(...r.items),!r.hasMore||r.items.length===0)return t}}async function qt(e,t,n){return S(`/content/${e}/${t}${C(n)}`)}async function Jt(e){return S(`/schema/${e}`)}async function Yt(e,t){return S(`/content/${e}`,{method:`POST`,body:JSON.stringify(t)})}async function Xt(e,t,n){return S(`/content/${e}/${t}`,{method:`PUT`,body:JSON.stringify(n)})}async function Zt(e,t,n){return S(`/content/${e}/${t}/publish-impact${C(n)}`)}async function Qt(e,t,n){let r={method:`POST`};return n?.status&&(r.body=JSON.stringify({status:n.status})),S(`/content/${e}/${t}/publish${C(n?.locale)}`,r)}async function $t(e){return S(`/content/search?q=${encodeURIComponent(e)}`)}async function en(e,t,n){return S(`/content/${e}/bulk`,{method:`DELETE`,body:JSON.stringify(n?{slugs:t,locale:n}:{slugs:t})})}async function tn(e,t,n){return S(`/content/${e}/bulk-publish`,{method:`POST`,body:JSON.stringify(n?{slugs:t,locale:n}:{slugs:t})})}async function nn(e){return S(`/schema/${e}/runtime`)}async function rn(e,t){return S(`/schema/${e}/fields`,{method:`PUT`,body:JSON.stringify(t)})}async function an(e,t){return S(`/schema/${e}/fields/${t}`,{method:`DELETE`})}async function on(e){return S(`/schema/${e}/export`)}async function sn(e,t=`json`,n){let r=new URLSearchParams({format:t});return n&&r.set(`locale`,n),S(`/content/${e}/export?${r}`)}async function cn(e,t){return S(`/content/${e}/import`,{method:`POST`,body:JSON.stringify({items:t})})}async function ln(e){let t=new URLSearchParams;e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset)),e?.status&&t.set(`status`,e.status);let n=t.toString();return S(`/webhooks/deliveries${n?`?${n}`:``}`)}async function un(e){return S(`/webhooks/deliveries/${e}/retry`,{method:`POST`})}async function dn(){return S(`/translations/status`)}function B(e){return e.liveVersion===null?`draft`:e.liveVersion>=e.version?`live`:`ahead`}var fn={live:`Live`,ahead:`Unpublished changes`,draft:`Not published`};async function pn(){return S(`/site-config`)}async function mn(){return S(`/settings/locales`)}async function hn(e){return S(`/settings/locales`,{method:`PUT`,body:JSON.stringify({supportedLocales:e})})}async function gn(){return S(`/settings/llm`)}async function _n(e){return S(`/settings/llm`,{method:`PUT`,body:JSON.stringify(e)})}async function vn(e){return S(`/settings/llm?provider=${encodeURIComponent(e)}`,{method:`DELETE`})}async function yn(e){return S(`/settings/llm/test`,{method:`POST`,body:JSON.stringify({provider:e})})}async function V(){let{defaultLocale:e,supportedLocales:t}=await mn();return{defaultLocale:e,supportedLocales:t}}function bn(e){return e.supportedLocales.length>1}async function xn(){let[e,t]=await Promise.all([Kt({view:`meta`}),V()]),n=new Map;for(let r of e){if(!t.supportedLocales.includes(r.locale)||B(r)!==`ahead`)continue;let e=`${r.collection}\u0000${r.locale}`,i=n.get(e)??{collection:r.collection,locale:r.locale,slugs:[]};i.slugs.push(r.slug),n.set(e,i)}return[...n.values()]}function Sn(e){return e.reduce((e,t)=>e+t.slugs.length,0)}async function Cn(e){let t=0;for(let n of e){let e=await tn(n.collection,n.slugs,n.locale);t+=e.published}return t}function H({status:e,decorative:t=!1}){let n=`ui-status-dot ui-status-dot--${e}`;if(t)return(0,A.jsx)(`span`,{className:n,"aria-hidden":`true`});let r=fn[e];return(0,A.jsx)(`span`,{className:n,role:`img`,"aria-label":r,title:r})}async function wn(){let{checkpoints:e}=await S(`/checkpoints`);return e}async function Tn(e){return S(`/checkpoints`,{method:`POST`,body:JSON.stringify(e?{name:e}:{})})}async function En(e){return S(`/checkpoints/${e}/restore`,{method:`POST`})}async function Dn(e){await S(`/checkpoints/${e}`,{method:`DELETE`})}async function On(e,t,n){try{return await S(`/content/${e}/${t}/lock${C(n)}`,{method:`POST`})}catch(e){if(e instanceof se){let t=typeof e.body.lockedBy==`string`?e.body.lockedBy:null,n=typeof e.body.expiresAt==`string`?e.body.expiresAt:null;return{locked:!1,error:e.message,status:e.status,...t?{lockedBy:t}:{},...n?{expiresAt:n}:{}}}return{locked:!1,error:e instanceof Error?e.message:`Failed to acquire lock`}}}async function kn(e,t,n){try{await S(`/content/${e}/${t}/lock${C(n)}`,{method:`DELETE`})}catch{}}async function An(){return(await S(`/locks`)).locks}function jn(e){return e instanceof se&&e.status===404}function U(e,t){return e instanceof Error?e.message:t}var Mn=200,Nn=8;function Pn(e){let[t,n]=(0,w.useState)({phase:`idle`}),r=e.trim();return(0,w.useEffect)(()=>{if(r.length<2){n({phase:`idle`});return}let e=!0;n({phase:`loading`});let t=setTimeout(()=>{$t(r).then(t=>{e&&n({phase:`done`,items:t.items.slice(0,Nn)})}).catch(t=>{e&&n({phase:`failed`,message:t instanceof Error?t.message:`Search failed`})})},Mn);return()=>{e=!1,clearTimeout(t)}},[r]),t}function Fn(){let[e,t]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let e=!0;return z().then(n=>{e&&t(n.find(e=>e.pages)??null)}).catch(()=>{}),()=>{e=!1}},[]),e}function In({canEdit:e,pages:t,go:n,confirmPublishAll:r}){if(!e)return[];let i=[];return t&&i.push({id:`new-page`,label:`New page`,detail:`In ${g(t.name)}`,icon:Ke,run:n(k(t.name))}),i.push({id:`publish-all`,label:`Publish all drafts ahead of live`,detail:`Asks before publishing`,icon:He,run:r}),i}function Ln({canEdit:e,checkpoints:t,seo:n,go:r}){let i=[];return e&&t&&i.push({id:`checkpoint`,label:`Create checkpoint`,detail:`A restorable copy of the whole content store`,icon:je,run:async()=>{await Tn(),r(`/setup/checkpoints`)()}}),e&&n&&i.push({id:`enrich`,label:`Enrich missing SEO`,detail:`Opens Structure's Fill what's missing`,icon:Ot,run:r(ue)}),n&&i.push({id:`structure`,label:`Structure`,detail:`How search engines and assistants read the site`,icon:P,run:r(`/structure`)}),i}function Rn({close:e,confirmPublishAll:t}){let n=te(),r=h(),{hasRole:i}=m(),a=Fn(),o=i(`editor`),s=_(r,`checkpoints`),c=_(r,`seo`);return(0,w.useMemo)(()=>{let r={canEdit:o,checkpoints:s,seo:c,pages:a,go:t=>()=>{e(),n(t)},confirmPublishAll:t};return[...In(r),...Ln(r)]},[o,s,c,a,e,t,n])}function zn(e){return e.map(({id:e,label:t,detail:n,icon:r,run:i})=>({id:e,label:t,detail:n,icon:r,run:i}))}function Bn(e,t){return e.phase===`done`?e.items.map(({meta:e,fields:n})=>({id:`${e.collection}/${e.slug}/${e.locale}`,label:typeof n.title==`string`&&n.title?n.title:e.slug,detail:`${g(e.collection)} · ${e.slug}`,status:B(e),run:()=>t(D(e.collection,e.slug))})):[]}function Vn(e,t,n){let r=e.trim();return r===``?n===0?`No commands are available to you here.`:null:r.length<2?`Keep typing to search documents.`:t.phase===`loading`?`Searching…`:t.phase===`failed`?t.message:t.phase===`done`&&n===0?`No documents match “${r}”.`:null}function Hn(e,t){let n=te(),r=Pn(e),i=Rn({close:t.onClose,confirmPublishAll:t.confirmPublishAll});return e.trim()===``?{options:zn(i),search:r}:{options:Bn(r,e=>{t.onClose(),n(e)}),search:r}}function Un(e,t,n,r){return i=>{let a=e.length;if(i.key===`ArrowDown`||i.key===`ArrowUp`){if(i.preventDefault(),a===0)return;let e=i.key===`ArrowDown`?1:-1;n(t=>(t+e+a)%a)}else i.key===`Enter`&&(i.preventDefault(),r(e[t]))}}function Wn(e){let[t,n]=(0,w.useState)(``),[r,i]=(0,w.useState)(0),[a,o]=(0,w.useState)(null),{options:s,search:c}=Hn(t,e),l=a??Vn(t,c,s.length);(0,w.useEffect)(()=>i(0),[t,s.length]);async function u(e){if(e){o(e.id===`publish-all`?`Counting drafts ahead of live…`:null);try{await e.run()}catch(t){o(U(t,`${e.label} failed`))}}}return{query:t,setQuery:e=>{n(e),o(null)},active:r,setActive:i,options:s,status:l,run:u,handleKeyDown:Un(s,r,i,u)}}var Gn=i();function Kn({title:e,children:t,actions:n,onClose:r,initialFocus:i,busy:a=!1}){let o=(0,w.useRef)(null),s=(0,w.useId)();R(o,!0,i);function c(e){e.key===`Escape`&&(e.stopPropagation(),r())}return(0,Gn.createPortal)((0,A.jsxs)(`div`,{className:`ui-modal-layer`,children:[(0,A.jsx)(`div`,{className:`ui-modal-scrim`,"aria-hidden":`true`,onClick:r}),(0,A.jsxs)(`div`,{ref:o,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,"aria-busy":a,className:`ui-modal`,tabIndex:-1,onKeyDown:c,children:[(0,A.jsx)(`h2`,{id:s,className:`ui-modal-title`,children:e}),(0,A.jsx)(`div`,{className:`ui-modal-body`,children:t}),(0,A.jsx)(`div`,{className:`ui-modal-actions`,children:n})]})]}),document.body)}function qn(e){return e===1?`1 document`:`${e} documents`}function Jn({phase:e,count:t}){return e.name===`done`?(0,A.jsxs)(`p`,{role:`status`,children:[`Published `,qn(e.published),`. Visitors now see the saved versions.`]}):e.name===`failed`?(0,A.jsx)(`p`,{role:`alert`,children:e.message}):t===0?(0,A.jsx)(`p`,{children:`No document has unpublished changes. Every live page shows its latest saved version.`}):(0,A.jsxs)(`p`,{children:[t===1?`1 document has`:`${t} documents have`,` unpublished changes. Publishing makes each saved version what visitors see.`]})}function Yn(e,t){let[n,r]=(0,w.useState)({name:`ask`});async function i(){if(n.name!==`publishing`){r({name:`publishing`});try{let n=await Cn(e);r({name:`done`,published:n}),t()}catch(e){r({name:`failed`,message:U(e,`Publishing failed`)})}}}return{phase:n,publish:i}}function Xn({phase:e,count:t,safeRef:n,onClose:r,onPublish:i}){let a=e.name===`publishing`;return t===0||e.name===`done`||e.name===`failed`?(0,A.jsx)(y,{ref:n,onClick:r,children:`Close`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(y,{ref:n,onClick:a?void 0:r,"aria-disabled":a,children:`Cancel`}),(0,A.jsx)(y,{variant:`primary`,onClick:a?void 0:i,"aria-disabled":a,children:a?`Publishing…`:`Publish ${qn(t)}`})]})}function Zn({groups:e,onClose:t,onPublished:n}){let r=Sn(e),{phase:i,publish:a}=Yn(e,n),o=(0,w.useRef)(null),s=i.name===`publishing`;return(0,w.useEffect)(()=>{(i.name===`done`||i.name===`failed`)&&o.current?.focus()},[i.name]),(0,A.jsx)(Kn,{title:`Publish all drafts ahead of live`,onClose:s?()=>void 0:t,initialFocus:o,busy:s,actions:(0,A.jsx)(Xn,{phase:i,count:r,safeRef:o,onClose:t,onPublish:()=>void a()}),children:(0,A.jsx)(Jn,{phase:i,count:r})})}function Qn({open:e,onClose:t,onContentChanged:n}){let[r,i]=(0,w.useState)(null),a=(0,w.useCallback)(async()=>{i(await xn())},[]);return(0,w.useEffect)(()=>{e||i(null)},[e]),e?r?(0,A.jsx)(Zn,{groups:r,onClose:t,onPublished:n}):(0,A.jsx)($n,{onClose:t,confirmPublishAll:a}):null}function $n(e){let t=Wn(e),n=(0,w.useRef)(null),r=(0,w.useRef)(null),i=(0,w.useId)();return R(n,!0,r),(0,A.jsxs)(`div`,{className:`palette-layer`,children:[(0,A.jsx)(`div`,{className:`palette-scrim`,"aria-hidden":`true`,onClick:e.onClose}),(0,A.jsxs)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,className:`palette`,onKeyDown:t=>{t.key===`Escape`&&e.onClose()},children:[(0,A.jsx)(er,{inputRef:r,listId:i,state:t}),(0,A.jsx)(`p`,{className:`palette-status`,role:`status`,children:t.status}),(0,A.jsx)(tr,{listId:i,state:t}),(0,A.jsxs)(`p`,{className:`palette-hint`,"aria-hidden":`true`,children:[(0,A.jsx)(`kbd`,{children:`↑`}),(0,A.jsx)(`kbd`,{children:`↓`}),` to move `,(0,A.jsx)(`kbd`,{children:`↵`}),` to open `,(0,A.jsx)(`kbd`,{children:`Esc`}),` to close`]})]})]})}function er({inputRef:e,listId:t,state:n}){let r=n.options.length>0;return(0,A.jsxs)(`div`,{className:`palette-search`,children:[(0,A.jsx)(F,{className:`palette-search-icon`,"aria-hidden":`true`}),(0,A.jsx)(`input`,{ref:e,className:`palette-input`,role:`combobox`,"aria-expanded":r,"aria-controls":t,"aria-autocomplete":`list`,"aria-activedescendant":r?`${t}-${n.active}`:void 0,"aria-label":`Search documents or run a command`,placeholder:`Search documents or run a command…`,autoComplete:`off`,spellCheck:!1,value:n.query,onChange:e=>n.setQuery(e.target.value),onKeyDown:n.handleKeyDown}),(0,A.jsx)(`kbd`,{className:`palette-key`,children:`Esc`})]})}function tr({listId:e,state:t}){return(0,w.useEffect)(()=>{document.getElementById(`${e}-${t.active}`)?.scrollIntoView({block:`nearest`})},[e,t.active]),(0,A.jsx)(`div`,{id:e,role:`listbox`,"aria-label":t.query.trim()===``?`Commands`:`Documents`,className:`palette-list`,hidden:t.options.length===0,children:t.options.map((n,r)=>{let i=n.icon;return(0,A.jsxs)(`div`,{id:`${e}-${r}`,role:`option`,"aria-selected":r===t.active,className:`palette-option`,onMouseMove:()=>t.setActive(r),onClick:()=>void t.run(n),children:[(0,A.jsx)(`span`,{className:`palette-option-icon`,"aria-hidden":!n.status||void 0,children:n.status?(0,A.jsx)(H,{status:n.status}):i&&(0,A.jsx)(i,{})}),(0,A.jsxs)(`span`,{className:`palette-option-text`,children:[(0,A.jsx)(`span`,{className:`palette-option-label`,children:n.label}),(0,A.jsx)(`span`,{className:`palette-option-detail`,children:n.detail})]})]},n.id)})})}var nr=16;function rr(e,t,n){return Math.min(n,Math.max(t,e))}function ir(e){let{label:t,value:n,min:r,max:i,grows:a,onChange:o,onReset:s,controls:c}=e,l=a===`right`?1:-1,u=(0,w.useRef)(null);function d(e){if(e.button!==0)return;let t=e.currentTarget;typeof t.setPointerCapture==`function`&&t.setPointerCapture(e.pointerId),u.current={x:e.clientX,width:n},document.body.dataset.resizing=`true`}function ee(e){let t=u.current;t&&o(rr(t.width+l*(e.clientX-t.x),r,i))}function f(){u.current=null,delete document.body.dataset.resizing}function p(e){let t=e.shiftKey?64:nr,a={ArrowRight:t,ArrowLeft:-t};if(e.key===`Home`)o(r);else if(e.key===`End`)o(i);else if(e.key in a)o(rr(n+l*(a[e.key]??0),r,i));else return;e.preventDefault()}return(0,A.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":t,"aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":i,"aria-controls":c,tabIndex:0,className:`resize-handle`,"data-edge":a,onPointerDown:d,onPointerMove:ee,onPointerUp:f,onPointerCancel:f,onKeyDown:p,onDoubleClick:s})}var W=()=>!0,G=e=>t=>_(t,e),K=[{id:`collections`,path:`/setup/collections`,label:`Collections & schema`,icon:Fe,visible:(e,t)=>_(e,`runtimeSchema`)&&(!t.loginRequired||ne(t.roles,`admin`))},{id:`locales`,path:`/setup/locales`,label:`Locales`,icon:Qe,visible:W},{id:`ai`,path:`/setup/ai`,label:`AI provider`,icon:We,visible:W},{id:`integrations`,path:`/setup/integrations`,label:`Integrations`,icon:At,visible:G(`webhookDeliveries`)},{id:`checkpoints`,path:`/setup/checkpoints`,label:`Checkpoints`,icon:_t,visible:G(`checkpoints`)},{id:`people`,path:`/setup/people`,label:`People`,icon:Et,visible:(e,t)=>(e.authMode===`token`||e.authMode===`oidc`)&&ne(t.roles,`admin`)},{id:`environment`,path:`/setup/environment`,label:`Environment`,icon:bt,visible:W}],ar=[{id:`pulse`,path:`/`,label:`Pulse`,icon:ke,visible:W},{id:`site`,path:`/site`,label:`Site`,icon:Je,visible:W},{id:`structure`,path:`/structure`,label:`Structure`,icon:P,visible:G(`seo`)},{id:`media`,path:`/media`,label:`Media`,icon:Xe,visible:G(`media`)},{id:`setup`,path:`/setup`,label:`Setup`,icon:St,visible:(e,t)=>K.some(n=>n.visible(e,t))}],q=[{id:`graph`,path:`/structure/graph`,label:`Graph`},{id:`scopes`,path:`/structure/scopes`,label:`Scopes & archetypes`},{id:`rich-results`,path:`/structure/rich-results`,label:`Rich results`},{id:`crawlers`,path:`/structure/crawlers`,label:`Crawlers & assistants`}];function or(e,t){return ar.filter(n=>n.visible(e,t))}function sr(e,t){return K.filter(n=>n.visible(e,t))}function cr(e,t,n){return ar.some(r=>r.id===e&&r.visible(t,n))}function lr(e){if(e===`/`||e===``)return`pulse`;let t=e.split(`/`)[1]??``;return t===`site`||t===`layout`||t===`new`?`site`:t===`structure`||t===`media`||t===`setup`?t:null}function ur(e=`neutral`,t){return[`ui-chip`,`ui-chip--${e}`,t].filter(Boolean).join(` `)}function dr({tone:e=`neutral`,icon:t,children:n}){return(0,A.jsxs)(`span`,{className:ur(e),children:[t&&(0,A.jsx)(t,{className:`ui-chip-icon`,"aria-hidden":`true`}),n]})}var fr=`krantho-studio-theme`;function pr(){try{let e=localStorage.getItem(fr);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function mr(){let[e,t]=(0,w.useState)(pr),n=(0,w.useCallback)(e=>{t(e);try{localStorage.setItem(fr,e)}catch{}},[]);return(0,w.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e)},[e]),{theme:e,setTheme:n}}var J=[{value:`light`,label:`Light`,icon:wt},{value:`dark`,label:`Dark`,icon:ct},{value:`system`,label:`System`,icon:ot}],hr={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};function gr({index:e,checked:t,buttons:n,onChoose:r}){let i=J[e];if(!i)return null;let a=i.icon;function o(t){let n=hr[t.key];n!==void 0&&(t.preventDefault(),r((e+n+J.length)%J.length))}return(0,A.jsx)(`button`,{ref:t=>{n.current[e]=t},type:`button`,role:`radio`,"aria-checked":t,"aria-label":i.label,title:i.label,tabIndex:t?0:-1,className:`theme-switch-option`,onClick:()=>r(e),onKeyDown:o,children:(0,A.jsx)(a,{"aria-hidden":`true`})})}function _r({vertical:e=!1}){let{theme:t,setTheme:n}=mr(),r=(0,w.useRef)([]);function i(e){let t=J[e];t&&(n(t.value),r.current[e]?.focus())}return(0,A.jsx)(`div`,{className:`theme-switch`,role:`radiogroup`,"aria-label":`Theme`,"aria-orientation":e?`vertical`:`horizontal`,"data-vertical":e,children:J.map((e,n)=>(0,A.jsx)(gr,{index:n,checked:t===e.value,buttons:r,onChoose:i},e.value))})}function vr(){let e=j();return e?(0,A.jsxs)(`button`,{ref:e.launcherRef,type:`button`,className:`nav-item`,"aria-expanded":e.open,"aria-controls":e.opened?`assistant-panel`:void 0,onClick:e.toggle,children:[(0,A.jsx)(Ne,{className:`nav-item-icon`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`nav-item-label`,children:`Assistant`})]}):null}function yr({collapsed:e}){let t=m();if(!t.loginRequired)return null;let n=t.user?.roles[0]??`viewer`;return(0,A.jsxs)(A.Fragment,{children:[t.user&&!e&&(0,A.jsxs)(`div`,{className:`nav-user`,children:[(0,A.jsx)(`span`,{className:`nav-user-email`,title:t.user.email,children:t.user.email}),(0,A.jsx)(dr,{tone:n===`admin`?`accent`:`neutral`,children:n})]}),(0,A.jsxs)(`button`,{type:`button`,className:`nav-item`,onClick:()=>void t.logout(),children:[(0,A.jsx)(nt,{className:`nav-item-icon`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`nav-item-label`,children:`Log out`})]})]})}function br({mode:e,onToggleCollapsed:t}){let n=e===`collapsed`;return(0,A.jsxs)(`div`,{className:`nav-footer`,children:[(0,A.jsx)(vr,{}),(0,A.jsx)(yr,{collapsed:n}),(0,A.jsxs)(`div`,{className:`nav-footer-row`,children:[(0,A.jsx)(_r,{vertical:n}),e!==`drawer`&&(0,A.jsx)(b,{icon:n?pt:dt,label:n?`Expand navigation`:`Collapse navigation`,"aria-expanded":!n,"aria-controls":`studio-nav`,size:`sm`,onClick:t})]})]})}var Y=`:slug`;function xr(e){return e.path===void 0?e.name!==`globals`:e.path!==!1}function Sr(e,t){if(!xr(e))return null;let{name:n,path:r}=e;return typeof r==`string`?wr(r,t):n===`pages`?t===`home`?`/`:`/${t}`:`/${n}/${t}`}function Cr(e){if(!xr(e))return null;let{name:t,path:n}=e;return typeof n==`string`?n.replace(`/${Y}`,``)||`/`:t===`pages`?`/`:`/${t}`}function wr(e,t){if(!e.includes(Y))return e;let n=`/${Y}`;return t===`index`&&e.includes(n)?e.replace(n,``)||`/`:e.replaceAll(Y,t)}function Tr(e){return e?`${e.roles[0]??`unknown`}:${e.email}`:null}function Er(e){return e.replace(/^(admin|editor|viewer|unknown):/,``)}function Dr(e,t,n=Date.now()){let r=Tr(t);return e.filter(e=>e.lockedBy!==r&&new Date(e.expiresAt).getTime()>n)}function Or(e,t,n,r=Date.now()){let i=new Map;for(let a of Dr(e,n,r))t&&a.locale!==t||i.set(`${a.collection}/${a.slug}`,Er(a.lockedBy));return i}function kr(){let[e,t]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let e=!0;return V().then(n=>{e&&t(n)}).catch(()=>{e&&t(null)}),()=>{e=!1}},[]),e}var Ar=6e4,jr=6e5,Mr=[`pointerdown`,`pointermove`,`keydown`,`wheel`,`touchstart`],Nr={groups:[],layout:null};function Pr(e,t){let n=new Set;return e.filter(e=>!n.has(e.slug)&&!!n.add(e.slug)).map(e=>({collection:e.collection,slug:e.slug,status:B(e),lockedBy:t.get(`${e.collection}/${e.slug}`)??null})).sort((e,t)=>e.slug.localeCompare(t.slug))}async function Fr(e,t){let[n,r,{collections:i}]=await Promise.all([z(),An().catch(()=>[]),Wt(e)]),a=Or(r,e,t),o=new Map(i.map(e=>[e.name,e.documents])),s=[],c=null;for(let e of n){let t=Pr(o.get(e.name)??[],a);e.name===`globals`?c=t:s.push({collection:e,documents:t})}return{groups:s,layout:c}}function Ir(e,t){let[n,r]=(0,w.useState)(Nr),{pathname:i}=s(),a=kr()?.defaultLocale,o=(0,w.useCallback)(async()=>{if(a===void 0)return null;try{return await Fr(a,e)}catch(e){return console.warn(`[studio] Failed to load the site tree:`,e),null}},[a,e]);return(0,w.useEffect)(()=>{let e=!0,t=()=>{o().then(t=>{e&&t&&r(t)})},n=()=>document.visibilityState===`visible`,i=Date.now(),a=()=>Date.now()-i>=jr,s=()=>{n()&&!a()&&t()},c=()=>{let e=a();i=Date.now(),e&&n()&&t()},l=()=>{n()&&(i=Date.now(),t())};t();let u=setInterval(s,Ar);document.addEventListener(`visibilitychange`,l);for(let e of Mr)document.addEventListener(e,c,{passive:!0});return()=>{e=!1,clearInterval(u),document.removeEventListener(`visibilitychange`,l);for(let e of Mr)document.removeEventListener(e,c)}},[o,i,t]),n}function Lr(e){let t=e.key===`ArrowDown`?1:e.key===`ArrowUp`?-1:0;if(t===0)return;let n=L(e.currentTarget),r=n.indexOf(document.activeElement);r!==-1&&(e.preventDefault(),n[(r+t+n.length)%n.length]?.focus())}function Rr({document:e}){let{pathname:t}=s(),n=D(e.collection,e.slug),r=t===n||t.startsWith(`${n}/`);return(0,A.jsx)(`li`,{children:(0,A.jsxs)(p,{to:n,className:`tree-item`,"aria-current":r?`page`:void 0,children:[(0,A.jsx)(H,{status:e.status}),(0,A.jsx)(`span`,{className:`tree-item-label`,children:e.slug}),e.lockedBy&&(0,A.jsx)(`span`,{className:`tree-lock`,role:`img`,"aria-label":`Locked by ${e.lockedBy}`,children:(0,A.jsx)(et,{"aria-hidden":`true`})})]})})}function zr({label:e,urlPath:t,path:n}){let{pathname:r}=s();return n?(0,A.jsxs)(p,{to:n,className:`tree-group-label`,"aria-current":r===n?`page`:void 0,children:[e,t&&(0,A.jsxs)(A.Fragment,{children:[` `,(0,A.jsx)(`span`,{className:`tree-group-path`,children:t})]})]}):(0,A.jsx)(`span`,{className:`tree-group-label`,children:e})}function Br(e){let{name:t,label:n,open:r,onToggle:i,children:a}=e,o=(0,w.useId)();return(0,A.jsxs)(`div`,{className:`tree-group`,role:`group`,"aria-label":n,"data-group":t,children:[(0,A.jsxs)(`div`,{className:`tree-group-head`,children:[(0,A.jsx)(`button`,{type:`button`,className:`tree-toggle`,"aria-expanded":r,"aria-controls":o,"aria-label":`${n} documents`,onClick:i,children:(0,A.jsx)(N,{"aria-hidden":`true`})}),(0,A.jsx)(zr,{label:n,urlPath:e.urlPath,path:e.path})]}),(0,A.jsx)(`ul`,{id:o,className:`tree-list`,hidden:!r,children:a})]})}function Vr(){return(0,A.jsxs)(`ul`,{className:`tree-legend`,"aria-label":`Status legend`,children:[(0,A.jsxs)(`li`,{children:[(0,A.jsx)(H,{status:`live`,decorative:!0}),`live`]}),(0,A.jsxs)(`li`,{children:[(0,A.jsx)(H,{status:`ahead`,decorative:!0}),`draft ahead`]}),(0,A.jsxs)(`li`,{children:[(0,A.jsx)(H,{status:`draft`,decorative:!0}),`draft`]})]})}function Hr({group:e,canCreate:t,open:n,onToggle:r}){let{collection:i,documents:a}=e;return(0,A.jsxs)(Br,{name:i.name,label:g(i.name),urlPath:Cr(i),path:O(i.name),open:n,onToggle:r,children:[a.map(e=>(0,A.jsx)(Rr,{document:e},e.slug)),t&&(0,A.jsx)(`li`,{children:(0,A.jsxs)(p,{to:k(i.name),className:`tree-item tree-item--new`,children:[(0,A.jsx)(ht,{"aria-hidden":`true`}),(0,A.jsxs)(`span`,{className:`tree-item-label`,children:[`New `,ae(i.name)]})]})})]})}function Ur({revision:e,closedGroups:t,onToggleGroup:n}){let{user:r,hasRole:i}=m(),a=Ir(r,e),o=i(`editor`);return(0,A.jsxs)(`div`,{className:`site-tree`,role:`group`,"aria-label":`Site tree`,onKeyDown:Lr,children:[a.groups.map(e=>(0,A.jsx)(Hr,{group:e,canCreate:o,open:!t.includes(e.collection.name),onToggle:()=>n(e.collection.name)},e.collection.name)),a.layout&&(0,A.jsx)(Br,{name:`globals`,label:`Layout`,open:!t.includes(`globals`),onToggle:()=>n(`globals`),children:a.layout.map(e=>(0,A.jsx)(Rr,{document:e},e.slug))}),(0,A.jsx)(Vr,{})]})}function Wr(){return(0,A.jsxs)(`svg`,{className:`nav-brand-mark`,viewBox:`0 0 32 32`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`2.25`,strokeLinecap:`round`,children:[(0,A.jsx)(`path`,{d:`M9 4.5v23`}),(0,A.jsx)(`path`,{d:`M9 17.5 23 7`}),(0,A.jsx)(`path`,{d:`M14.5 13.4 23.5 27`})]}),(0,A.jsxs)(`g`,{fill:`currentColor`,children:[(0,A.jsx)(`circle`,{cx:`9`,cy:`4.5`,r:`2.6`}),(0,A.jsx)(`circle`,{cx:`9`,cy:`27.5`,r:`2.6`}),(0,A.jsx)(`circle`,{cx:`23`,cy:`7`,r:`2.6`}),(0,A.jsx)(`circle`,{cx:`23.5`,cy:`27`,r:`2.6`})]}),(0,A.jsx)(`circle`,{cx:`9`,cy:`17.5`,r:`3.6`,fill:`var(--color-accent)`})]})}function Gr(){let e=h(),{user:t,loginRequired:n}=m(),{pathname:r}=s(),i=lr(r),a={roles:t?.roles??[],loginRequired:n};return(0,A.jsx)(`ul`,{className:`nav-destinations`,"aria-label":`Destinations`,children:or(e,a).map(e=>{let t=e.icon,n=r===e.path?`page`:i===e.id?`true`:void 0;return(0,A.jsx)(`li`,{children:(0,A.jsxs)(p,{to:e.path,className:`nav-item`,"aria-current":n,children:[(0,A.jsx)(t,{className:`nav-item-icon`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`nav-item-label`,children:e.label})]})},e.id)})})}function Kr(e,t,n){R(e,t),(0,w.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,n])}function qr(e){(0,w.useEffect)(()=>{let t=e.current;if(!t)return;let n=new Set,r=e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`.nav-item`),r=e.relatedTarget;!t||r instanceof Node&&t.contains(r)||n.delete(t)&&t.removeAttribute(`data-tip-dismissed`)},i=e=>{if(e.key===`Escape`&&t.dataset.mode===`collapsed`)for(let e of t.querySelectorAll(`.nav-item:hover, .nav-item:focus`))e.setAttribute(`data-tip-dismissed`,``),n.add(e)};return document.addEventListener(`keydown`,i),t.addEventListener(`mouseout`,r),t.addEventListener(`focusout`,r),()=>{document.removeEventListener(`keydown`,i),t.removeEventListener(`mouseout`,r),t.removeEventListener(`focusout`,r)}},[e])}function Jr({onCloseDrawer:e}){return(0,A.jsxs)(`div`,{className:`nav-header`,children:[(0,A.jsxs)(p,{to:`/`,className:`nav-brand`,children:[(0,A.jsx)(Wr,{}),(0,A.jsxs)(`span`,{className:`nav-brand-word`,children:[`krantho `,(0,A.jsx)(`span`,{className:`nav-brand-studio`,children:`studio`})]})]}),e&&(0,A.jsx)(b,{icon:I,label:`Close navigation`,onClick:e})]})}function Yr(e){let{mode:t,drawerOpen:n,onCloseDrawer:r}=e,i=(0,w.useRef)(null),a=t===`drawer`,o=a&&n;return Kr(i,o,r),qr(i),(0,A.jsxs)(`div`,{ref:i,id:`studio-nav`,className:`shell-nav`,"data-mode":t,"data-open":o,inert:a&&!n,...o?{role:`dialog`,"aria-modal":!0,"aria-label":`Navigation`}:{},children:[(0,A.jsxs)(`nav`,{className:`nav`,"aria-label":`Studio`,children:[(0,A.jsx)(Jr,{onCloseDrawer:a?r:null}),(0,A.jsxs)(`div`,{className:`nav-scroll`,children:[(0,A.jsx)(Gr,{}),t!==`collapsed`&&(0,A.jsx)(Ur,{revision:e.treeRevision,closedGroups:e.closedGroups,onToggleGroup:e.onToggleGroup})]}),(0,A.jsx)(br,{mode:t,onToggleCollapsed:e.onToggleCollapsed})]}),t===`expanded`&&(0,A.jsx)(ir,{label:`Resize navigation`,value:e.width,min:M.min,max:M.max,grows:`right`,onChange:e.onResize,onReset:e.onResetWidth,controls:`studio-nav`})]})}var Xr={notFound:!0};function Zr(e){return typeof e==`object`&&!!e&&`notFound`in e}var X=(0,w.createContext)({path:null,report:()=>{}});function Qr({children:e}){let[t,n]=(0,w.useState)(null);return(0,A.jsx)(X.Provider,{value:{path:t,report:n},children:e})}function $r(e){return(0,w.useContext)(X).path===e}function Z(){let{pathname:e}=s(),{report:t}=(0,w.useContext)(X);return(0,w.useEffect)(()=>(t(e),()=>t(null)),[t,e]),(0,A.jsxs)(`section`,{className:`not-found`,"aria-labelledby":`not-found-title`,children:[(0,A.jsx)(`p`,{className:`not-found-code`,children:`404`}),(0,A.jsx)(`h1`,{id:`not-found-title`,children:`Nothing here`}),(0,A.jsx)(`p`,{children:`This screen does not exist, or it is turned off for this site or for your role.`}),(0,A.jsx)(p,{to:`/`,className:v(`primary`),children:`Go to Pulse`})]})}var Q={label:`Site`,path:`/site`},ei={label:`Structure`,path:`/structure`},ti={label:`Setup`,path:`/setup`},ni={label:`Media`,path:`/media`};function ri(e){return{label:g(e),path:O(e)}}function ii(e){return q.find(t=>t.id===e)?.label??e}function ai(e){return K.find(t=>t.id===e)?.label??e}var oi=[{pattern:`/`,trail:()=>[{label:`Pulse`}]},{pattern:`/site`,trail:()=>[{label:`Site`}]},{pattern:`/site/:collection`,trail:e=>[Q,{label:g(e.collection??``)}]},{pattern:`/site/:collection/:slug`,trail:e=>[Q,ri(e.collection??``),{label:e.slug??``}]},{pattern:`/new/:collection`,trail:e=>[Q,ri(e.collection??``),{label:`New`}]},{pattern:`/layout/:slug`,trail:e=>[Q,{label:`Layout`},{label:e.slug??``}]},{pattern:`/structure`,trail:()=>[ei,{label:ii(`graph`)}]},{pattern:`/structure/:tab`,trail:e=>[ei,{label:ii(e.tab??``)}]},{pattern:`/setup`,trail:()=>[{label:`Setup`}]},{pattern:`/setup/:tab`,trail:e=>[ti,{label:ai(e.tab??``)}]},{pattern:`/media`,trail:()=>[{label:`Media`}]},{pattern:`/media/:id/edit`,trail:()=>[ni,{label:`Edit image`}]}],si=[{label:`Not found`}];function ci(e,t=!1){if(t)return si;for(let{pattern:t,trail:n}of oi){let r=f(t,e);if(r)return n(r.params)}return si}function li(){let{pathname:e}=s(),t=u().some(e=>Zr(e.handle)),n=$r(e),r=ci(e,t||n);return(0,A.jsx)(`nav`,{className:`breadcrumbs`,"aria-label":`Breadcrumb`,children:(0,A.jsx)(`ol`,{className:`breadcrumbs-list`,children:r.map((e,t)=>{let n=t===r.length-1;return(0,A.jsxs)(`li`,{className:`breadcrumbs-item`,children:[t>0&&(0,A.jsx)(N,{className:`breadcrumbs-separator`,"aria-hidden":`true`}),n?(0,A.jsx)(`span`,{className:`breadcrumbs-current`,"aria-current":`page`,children:e.label}):e.path?(0,A.jsx)(p,{to:e.path,className:`breadcrumbs-link`,children:e.label}):(0,A.jsx)(`span`,{className:`breadcrumbs-text`,children:e.label})]},r.slice(0,t+1).map(e=>e.label).join(`/`))})})})}function ui(){let e=typeof navigator>`u`?``:navigator.platform||navigator.userAgent;return/Mac|iPhone|iPad|iPod/i.test(e)?`⌘K`:`Ctrl K`}function di({showMenuButton:e,menuOpen:t,onOpenMenu:n,onOpenPalette:r}){return(0,A.jsxs)(`header`,{className:`top-bar`,children:[e&&(0,A.jsx)(b,{icon:it,label:`Open navigation`,"aria-expanded":t,"aria-controls":`studio-nav`,onClick:n}),(0,A.jsx)(li,{}),(0,A.jsxs)(`button`,{type:`button`,className:`top-bar-command`,"aria-label":`Search or command`,"aria-keyshortcuts":`Meta+K Control+K`,"aria-haspopup":`dialog`,onClick:r,children:[(0,A.jsx)(F,{className:`top-bar-command-icon`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`top-bar-command-label`,children:`Search or command`}),(0,A.jsx)(`kbd`,{className:`top-bar-command-key`,children:ui()})]})]})}var fi=(0,w.lazy)(()=>t(()=>import(`./AssistantPanel-DpYeurU-.js`).then(e=>({default:e.AssistantPanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])));function pi(){}function mi(){return c()?.contentChanged??pi}var hi=`(max-width: 959.98px)`;function gi(){return j()?.opened?(0,A.jsx)(w.Suspense,{fallback:null,children:(0,A.jsx)(fi,{})}):null}function _i(e){(0,w.useEffect)(()=>{function t(t){(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e())}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function vi(e){let[t,n]=(0,w.useState)(!1),{pathname:r}=s();return(0,w.useEffect)(()=>n(!1),[r,e]),[t,n]}function yi(){let e=be(hi),t=De(),[n,r]=vi(e),[i,a]=(0,w.useState)(!1),[o,s]=(0,w.useState)(0),c=(0,w.useCallback)(()=>{r(!1),a(!0)},[r]);return _i((0,w.useCallback)(()=>{r(!1),a(e=>!e)},[r])),{mode:e?`drawer`:t.collapsed?`collapsed`:`expanded`,drawerOpen:n,openDrawer:(0,w.useCallback)(()=>r(!0),[r]),closeDrawer:(0,w.useCallback)(()=>r(!1),[r]),toggleCollapsed:()=>t.setCollapsed(!t.collapsed),paletteOpen:i,openPalette:c,closePalette:(0,w.useCallback)(()=>a(!1),[]),treeRevision:o,contentChanged:(0,w.useCallback)(()=>s(e=>e+1),[]),preferences:t}}function bi(){let e=yi();return(0,A.jsxs)(`div`,{className:`shell`,"data-nav":e.mode,style:{"--nav-width":`${e.preferences.width}px`},children:[(0,A.jsx)(`a`,{className:`shell-skip`,href:`#studio-main`,children:`Skip to content`}),(0,A.jsx)(Yr,{mode:e.mode,drawerOpen:e.drawerOpen,onCloseDrawer:e.closeDrawer,onToggleCollapsed:e.toggleCollapsed,width:e.preferences.width,onResize:e.preferences.setWidth,onResetWidth:()=>e.preferences.setWidth(M.fallback),treeRevision:e.treeRevision,closedGroups:e.preferences.closedGroups,onToggleGroup:e.preferences.toggleGroup}),e.mode===`drawer`&&e.drawerOpen&&(0,A.jsx)(`div`,{className:`shell-scrim`,"aria-hidden":`true`,onClick:e.closeDrawer}),(0,A.jsxs)(`div`,{className:`shell-column`,children:[(0,A.jsx)(di,{showMenuButton:e.mode===`drawer`,menuOpen:e.drawerOpen,onOpenMenu:e.openDrawer,onOpenPalette:e.openPalette}),(0,A.jsx)(`main`,{id:`studio-main`,className:`shell-page`,tabIndex:-1,children:(0,A.jsx)(w.Suspense,{fallback:(0,A.jsx)(`div`,{className:`loading`,children:`Loading…`}),children:(0,A.jsx)(o,{context:{contentChanged:e.contentChanged}})})})]}),(0,A.jsx)(Qn,{open:e.paletteOpen,onClose:e.closePalette,onContentChanged:e.contentChanged}),(0,A.jsx)(gi,{})]})}function xi(){let{isAuthenticated:e,user:t}=m(),n=h(),r=_(n,`assistant`)&&e&&t!==null,i=(0,A.jsx)(Bt,{children:(0,A.jsx)(Qr,{children:(0,A.jsx)(bi,{})})});return r?(0,A.jsx)(ve,{children:i}):i}var Si=(0,w.lazy)(()=>t(()=>import(`./pulse-page-zRYAQJh6.js`).then(e=>({default:e.PulsePage})),__vite__mapDeps([17,1,18,2,3,4,6,14,7,19,20,21,22,5,23,24,25,26,27]))),Ci=(0,w.lazy)(()=>t(()=>import(`./site-overview-B0Dnsj2N.js`).then(e=>({default:e.SiteOverview})),__vite__mapDeps([28,1,23,2,3,4,5,19,29,30,21,22,31,18,6,14,32,33,34,15,35,36,20,37]))),wi=(0,w.lazy)(()=>t(()=>import(`./collection-view-Bbr6ff-2.js`).then(e=>({default:e.CollectionPage})),__vite__mapDeps([38,1,23,2,3,4,5,7,19,29,30,21,22,39,40,41,31,18,6,14,42,32,33,34,15,35,36,20,37,43]))),$=(0,w.lazy)(()=>t(()=>import(`./editor-page-ydSt1TIL.js`).then(e=>({default:e.EditorPage})),__vite__mapDeps([44,1,3,5,19,31,2,4,23,18,6,14,21,22,33,45,40,46,47,48,11,9,49,50,51,7,24,25,52,12,35,53,41,54,15,55,36,13,26,56,57,58]))),Ti=(0,w.lazy)(()=>t(()=>import(`./structure-page-DpM1G-M9.js`).then(e=>({default:e.StructurePage})),__vite__mapDeps([59,1,18,2,3,4,6,14,5,7,21,22,60,19,55,61,36,41,33,29,30,49,62,47,20,52,12,35,23,53,54,39,26,63,34,15,64,65,13,66,67]))),Ei=(0,w.lazy)(()=>t(()=>import(`./media-page-DuSUjFO1.js`).then(e=>({default:e.MediaPage})),__vite__mapDeps([68,1,45,3,2,4,40,46,6,47,48,7,19,21,22,5,12,36,42,41,62,53,69,66,70]))),Di=(0,w.lazy)(()=>t(()=>import(`./image-editor-CAZbOhRZ.js`).then(e=>({default:e.ImageEditorPage})),__vite__mapDeps([71,1,56,2,3,4,49,62,72,73,5,47,7,46,6,74]))),Oi=(0,w.lazy)(()=>t(()=>import(`./setup-page-CshRkFJ-.js`).then(e=>({default:e.SetupPage})),__vite__mapDeps([75,1,3,60,5,19,55,2,4,18,6,61,7,33,42,47,66,29,30,21,22,41,20,69,12,11,8,57,76]))),ki=[{path:`site`,element:(0,A.jsx)(Ci,{})},{path:`site/${T}`,element:(0,A.jsx)(Z,{}),handle:Xr},{path:`site/:collection`,element:(0,A.jsx)(wi,{})},{path:`site/:collection/:slug`,element:(0,A.jsx)($,{})},{path:`new/:collection`,element:(0,A.jsx)($,{})},{path:`layout/:slug`,element:(0,A.jsx)($,{collection:T})}],Ai=[{path:`structure`,element:(0,A.jsx)(l,{replace:!0,to:q[0]?.path??`/`})},...q.map(e=>({path:e.path.slice(1),element:(0,A.jsx)(Ti,{tab:e.id})}))],ji=[{path:`media`,element:(0,A.jsx)(Ei,{})},{path:`media/:id/edit`,element:(0,A.jsx)(Di,{})}];function Mi(e){let t=e[0];return t?[{path:`setup`,element:(0,A.jsx)(l,{replace:!0,to:t.path})},...e.map(t=>({path:t.path.slice(1),element:(0,A.jsx)(Oi,{tab:t.id,tabs:e})}))]:[]}function Ni({caps:e,viewer:t}){let n=n=>cr(n,e,t),r=[{index:!0,element:(0,A.jsx)(Si,{})},...ki,...n(`structure`)?Ai:[],...n(`media`)?ji:[],...n(`setup`)?Mi(sr(e,t)):[],{path:`*`,element:(0,A.jsx)(Z,{}),handle:Xr}];return[{path:`/`,element:(0,A.jsx)(xi,{}),children:r}]}function Pi(e){return d(e,{basename:`/studio`})}function Fi(){return(0,A.jsx)(`div`,{className:`loading`,children:`Loading…`})}function Ii({children:e}){let[t,n]=(0,w.useState)(null);return(0,w.useEffect)(()=>{ie().then(n)},[]),t?(0,A.jsx)(oe.Provider,{value:t,children:e}):(0,A.jsx)(Fi,{})}function Li({makeRouter:e}){let{user:t,loginRequired:n}=m(),r=h(),i=t?.roles,a=(0,w.useMemo)(()=>e(Ni({caps:r,viewer:{roles:i??[],loginRequired:n}})),[e,r,i,n]);return(0,w.useEffect)(()=>()=>a.dispose(),[a]),(0,A.jsx)(ee,{router:a})}function Ri({makeRouter:e}){let{isLoading:t,isAuthenticated:n,loginRequired:r}=m();return t?(0,A.jsx)(Fi,{}):r&&!n?(0,A.jsx)(ge,{}):(0,A.jsx)(Li,{makeRouter:e})}function zi({makeRouter:e=Pi}){return(0,A.jsx)(re,{children:(0,A.jsx)(Ii,{children:(0,A.jsx)(Ri,{makeRouter:e})})})}var Bi=document.getElementById(`root`);if(!Bi)throw Error(`Root element not found`);(0,ce.createRoot)(Bi).render((0,A.jsx)(w.StrictMode,{children:(0,A.jsx)(zi,{})}));export{R as $,hn as A,Ut as B,V as C,O as Ct,pn as D,k as Dt,mn as E,fe as Et,Yt as F,Jt as G,qt as H,an as I,cn as J,dn as K,sn as L,B as M,en as N,yn as O,de as Ot,tn as P,Xt as Q,on as R,bn as S,T as St,gn as T,D as Tt,Zt as U,z as V,nn as W,un as X,Qt as Y,rn as Z,Tn as _,xe as _t,Cr as a,_t as at,En as b,j as bt,ur as c,et as ct,Kn as d,Ke as dt,Pt as et,U as f,Be as ft,kn as g,we as gt,An as h,je as ht,Dr as i,F as it,fn as j,_n as k,q as l,Qe as lt,On as m,N as mt,Z as n,At as nt,Sr as o,ht as ot,jn as p,Re as pt,ln as q,Er as r,bt as rt,dr as s,P as st,mi as t,I as tt,ir as u,Je as ut,Dn as v,Ce as vt,vn as w,le as wt,H as x,pe as xt,wn as y,be as yt,Kt as z};