graview 0.1.58 → 0.1.59

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 (173) hide show
  1. package/dist/preview/{chunk.27CW6SCT.js → chunk.2FOIJ5ID.js} +1 -1
  2. package/dist/preview/{chunk.JB7TTJXQ.js → chunk.2FP4KEEG.js} +1 -1
  3. package/dist/preview/{chunk.PBCNOFQH.js → chunk.2MFXP3FB.js} +1 -1
  4. package/dist/preview/{chunk.XU34T2H4.js → chunk.2NJDT47T.js} +1 -1
  5. package/dist/preview/{chunk.EPPXZZPK.js → chunk.2QESVWUW.js} +1 -1
  6. package/dist/preview/{chunk.IDJPBWL2.js → chunk.2XTCDFWU.js} +1 -1
  7. package/dist/preview/{chunk.WXIEQZLY.js → chunk.3UTRR5YM.js} +1 -1
  8. package/dist/preview/{chunk.INZQ6WZM.js → chunk.3XIIJHQ6.js} +1 -1
  9. package/dist/preview/chunk.3XLOFZRM.js +1 -0
  10. package/dist/preview/{chunk.POBMGM3X.js → chunk.4OMOP77U.js} +1 -1
  11. package/dist/preview/{chunk.WNQFHMNR.js → chunk.4QWTSI7V.js} +1 -1
  12. package/dist/preview/{chunk.4HSH2UIK.js → chunk.4T5QIZKB.js} +2 -2
  13. package/dist/preview/chunk.6BLNFVB4.js +1 -0
  14. package/dist/preview/{chunk.ACYDJQRC.js → chunk.6E36I2GC.js} +1 -1
  15. package/dist/preview/{chunk.YD3TKV6P.js → chunk.6IUEGPCZ.js} +2 -2
  16. package/dist/preview/{chunk.M34CS7DI.js → chunk.6N7LNTB6.js} +1 -1
  17. package/dist/preview/chunk.6O3YPUW3.js +1 -0
  18. package/dist/preview/{chunk.GEB2DFBU.js → chunk.6VNKGTLF.js} +1 -1
  19. package/dist/preview/{chunk.JGKA5QBX.js → chunk.7AMBLGVB.js} +1 -1
  20. package/dist/preview/{chunk.NFX24NUI.js → chunk.7JOG6XFC.js} +1 -1
  21. package/dist/preview/chunk.7XSDXX5Z.js +1 -0
  22. package/dist/preview/{chunk.HZB5F476.js → chunk.ATSKKTUO.js} +1 -1
  23. package/dist/preview/{chunk.HXRV3WVJ.js → chunk.ATVPAYS6.js} +1 -1
  24. package/dist/preview/{chunk.KKNDX4JT.js → chunk.AXXYJCSW.js} +1 -1
  25. package/dist/preview/{chunk.O4CVKTPJ.js → chunk.B5HLA45D.js} +1 -1
  26. package/dist/preview/{chunk.LRUNFSHP.js → chunk.BDBLGGFJ.js} +1 -1
  27. package/dist/preview/{chunk.A6C4AGJJ.js → chunk.BFN6B4C4.js} +1 -1
  28. package/dist/preview/{chunk.TJ647W6J.js → chunk.BPC4XQFZ.js} +2 -2
  29. package/dist/preview/{chunk.7V23SXGJ.js → chunk.CIB65YO6.js} +1 -1
  30. package/dist/preview/chunk.CJUIJ6TL.js +1 -0
  31. package/dist/preview/{chunk.KJHPDL4N.js → chunk.CLR6KAA3.js} +1 -1
  32. package/dist/preview/{chunk.4KC35UNR.js → chunk.CUJX3IVA.js} +4 -2
  33. package/dist/preview/{chunk.ILRCNTGT.js → chunk.CYUMQPMH.js} +1 -1
  34. package/dist/preview/{chunk.7SQAKSJD.js → chunk.CZH27V2R.js} +1 -1
  35. package/dist/preview/chunk.D3AISGQH.js +1 -0
  36. package/dist/preview/{chunk.KJ264E6K.js → chunk.DGM3Y2FB.js} +1 -1
  37. package/dist/preview/{chunk.HMFJT4KO.js → chunk.DO45KXLM.js} +1 -1
  38. package/dist/preview/{chunk.IULQRCEE.js → chunk.DWHPZBPZ.js} +1 -1
  39. package/dist/preview/{chunk.NKC3JILT.js → chunk.E22DDEQI.js} +1 -1
  40. package/dist/preview/chunk.E2REVMAG.js +6 -0
  41. package/dist/preview/{chunk.E34OQVSR.js → chunk.E4SYOBGB.js} +1 -1
  42. package/dist/preview/{chunk.TJOXNEFU.js → chunk.EGJUFZD5.js} +1 -1
  43. package/dist/preview/chunk.EZ3CRUBU.js +21 -0
  44. package/dist/preview/{chunk.LMN4TSAP.js → chunk.F6P3WSMW.js} +1 -1
  45. package/dist/preview/{chunk.4Y2JTY6Q.js → chunk.FJTVY6AE.js} +1 -1
  46. package/dist/preview/chunk.G2TCFWYX.js +1 -0
  47. package/dist/preview/{chunk.TWKXSLYY.js → chunk.G7HIAUEA.js} +1 -1
  48. package/dist/preview/{chunk.64R3K2OE.js → chunk.GDUM2UOM.js} +1 -1
  49. package/dist/preview/chunk.GQHFLOTZ.js +5 -0
  50. package/dist/preview/{chunk.DBZHRYBK.js → chunk.GR2B7SKI.js} +1 -1
  51. package/dist/preview/{chunk.GCBZ3WE2.js → chunk.HF5SNUTK.js} +1 -1
  52. package/dist/preview/{chunk.VUPLFUUS.js → chunk.HJOVOA52.js} +1 -1
  53. package/dist/preview/{chunk.QGV7H7RQ.js → chunk.HKINU7VO.js} +1 -1
  54. package/dist/preview/{chunk.GZB6A6KF.js → chunk.HVUUJQRE.js} +1 -1
  55. package/dist/preview/{chunk.34TW32TB.js → chunk.IIESMHXY.js} +2 -2
  56. package/dist/preview/{chunk.GQBJVCSM.js → chunk.IPPZEGBX.js} +1 -1
  57. package/dist/preview/{chunk.WNSC3RWD.js → chunk.IZ2ZTNEV.js} +1 -1
  58. package/dist/preview/{chunk.OHQ3JH65.js → chunk.J4HTSXUA.js} +1 -1
  59. package/dist/preview/{chunk.B3WZHPM3.js → chunk.JPNBQFJ3.js} +1 -1
  60. package/dist/preview/{chunk.ELAMMS2V.js → chunk.KE6ZRUMP.js} +1 -1
  61. package/dist/preview/{chunk.ELERUERU.js → chunk.KHZA5F7A.js} +1 -1
  62. package/dist/preview/{chunk.TF5I4VHX.js → chunk.KKQXGN5U.js} +1 -1
  63. package/dist/preview/{chunk.U6O3MMQR.js → chunk.KOGUYWHG.js} +1 -1
  64. package/dist/preview/{chunk.YHTE34RN.js → chunk.KSVJHSRH.js} +1 -1
  65. package/dist/preview/{chunk.JES77WXG.js → chunk.L3K25NCS.js} +1 -1
  66. package/dist/preview/chunk.LDLTQNJ2.js +1 -0
  67. package/dist/preview/{chunk.LL2MLSPH.js → chunk.LDYOQCY7.js} +1 -1
  68. package/dist/preview/{chunk.F7SF6EP2.js → chunk.LHJWII6C.js} +1 -1
  69. package/dist/preview/{chunk.E5MSFXL6.js → chunk.LKE2FBXL.js} +1 -1
  70. package/dist/preview/{chunk.RRKYJYZJ.js → chunk.M3JIIF32.js} +1 -1
  71. package/dist/preview/{chunk.BB33TI4S.js → chunk.MHILFBK6.js} +1 -1
  72. package/dist/preview/chunk.MMWLLWFS.js +1 -0
  73. package/dist/preview/{chunk.2VYNNWW5.js → chunk.MOAUE3N2.js} +3 -3
  74. package/dist/preview/{chunk.LCPGZK7G.js → chunk.MRYN42EQ.js} +1 -1
  75. package/dist/preview/{chunk.JUNMJYH5.js → chunk.MZJ3KTEU.js} +1 -1
  76. package/dist/preview/{chunk.GKSUTAIX.js → chunk.N4LOI3YA.js} +1 -1
  77. package/dist/preview/{chunk.LY3YOWKV.js → chunk.NIFQDN6R.js} +1 -1
  78. package/dist/preview/chunk.NOLGJFA4.js +2 -0
  79. package/dist/preview/{chunk.3YZHZGTM.js → chunk.NSGQXCH6.js} +1 -1
  80. package/dist/preview/{chunk.HEWVPXRE.js → chunk.OLW44AP5.js} +1 -1
  81. package/dist/preview/{chunk.PZG3B7F4.js → chunk.OVSZXILB.js} +1 -1
  82. package/dist/preview/{chunk.ZOHMWSHD.js → chunk.P3CUCDHO.js} +1 -1
  83. package/dist/preview/{chunk.UAP5M3CD.js → chunk.P52UTBNO.js} +2 -2
  84. package/dist/preview/{chunk.XN2RVXOI.js → chunk.P6CHNBRR.js} +1 -1
  85. package/dist/preview/chunk.PCVPH5KM.js +1 -0
  86. package/dist/preview/{chunk.ETBFD76E.js → chunk.PS5SEND3.js} +1 -1
  87. package/dist/preview/chunk.Q355UPFG.js +1 -0
  88. package/dist/preview/{chunk.QPXXY2DL.js → chunk.Q3Y5EV5A.js} +3 -3
  89. package/dist/preview/{chunk.LDAYDCUO.js → chunk.Q6LLURRM.js} +1 -1
  90. package/dist/preview/{chunk.YS6GVLIP.js → chunk.QC4YXFF7.js} +1 -1
  91. package/dist/preview/chunk.QDZAITMN.js +1 -0
  92. package/dist/preview/chunk.QHU3KUZZ.js +1 -0
  93. package/dist/preview/{chunk.SDLUWRGI.js → chunk.QL555VQ2.js} +1 -1
  94. package/dist/preview/{chunk.CCWPF5PK.js → chunk.QLTHHWBA.js} +1 -1
  95. package/dist/preview/{chunk.4AFFPYOK.js → chunk.QT6UV7HN.js} +1 -1
  96. package/dist/preview/{chunk.4444RPWW.js → chunk.QXMQUIQZ.js} +1 -1
  97. package/dist/preview/{chunk.KWJWAIQJ.js → chunk.R4YDAJRL.js} +1 -1
  98. package/dist/preview/{chunk.5ICIMQE6.js → chunk.RKZ4J3H2.js} +1 -1
  99. package/dist/preview/{chunk.RE7DELSR.js → chunk.ROHSF4WM.js} +1 -1
  100. package/dist/preview/{chunk.S2H7B6RG.js → chunk.S6VON4LU.js} +1 -1
  101. package/dist/preview/{chunk.GDOTG7YA.js → chunk.S7ZLGODY.js} +1 -1
  102. package/dist/preview/{chunk.ZN5HTWSI.js → chunk.SU6WKQ73.js} +1 -1
  103. package/dist/preview/{chunk.EQTSV7BK.js → chunk.SZG6HJWH.js} +1 -1
  104. package/dist/preview/{chunk.SPXRLO5K.js → chunk.T227XQIO.js} +1 -1
  105. package/dist/preview/{chunk.D5KTGX7F.js → chunk.TCPTVTFU.js} +1 -1
  106. package/dist/preview/chunk.U37WZMUO.js +1 -0
  107. package/dist/preview/chunk.U5JFW2YM.js +1 -0
  108. package/dist/preview/{chunk.GP7F3PEF.js → chunk.U5PX2ECA.js} +1 -1
  109. package/dist/preview/{chunk.VHSWBFXB.js → chunk.U7G56KXT.js} +1 -1
  110. package/dist/preview/{chunk.H3BFHI3G.js → chunk.UFTAGUTU.js} +1 -1
  111. package/dist/preview/{chunk.LO3U3P55.js → chunk.UHUBQ4EX.js} +1 -1
  112. package/dist/preview/{chunk.KXPRILAO.js → chunk.UITZ74YJ.js} +1 -1
  113. package/dist/preview/{chunk.KFQSYCY3.js → chunk.UM5H2VVR.js} +1 -1
  114. package/dist/preview/chunk.V5MOMBZG.js +1 -0
  115. package/dist/preview/{chunk.B2GVJD6H.js → chunk.V6EEDYYW.js} +1 -1
  116. package/dist/preview/{chunk.TBW7CU4G.js → chunk.VDGMFX5C.js} +1 -1
  117. package/dist/preview/{chunk.EB4NVTJL.js → chunk.VFRURRNI.js} +1 -1
  118. package/dist/preview/{chunk.6W7O5YLL.js → chunk.VGHZQEHS.js} +1 -1
  119. package/dist/preview/{chunk.MQ5HBUBL.js → chunk.VNBEAF62.js} +1 -1
  120. package/dist/preview/chunk.VNJKGSGZ.js +25 -0
  121. package/dist/preview/{chunk.TUUVVO5U.js → chunk.VS25R6R2.js} +1 -1
  122. package/dist/preview/chunk.VUSJ7HPC.js +1 -0
  123. package/dist/preview/chunk.VXRECLX6.js +1 -0
  124. package/dist/preview/{chunk.7MSFDD7J.js → chunk.W2VOD6SD.js} +1 -1
  125. package/dist/preview/{chunk.WJFQIE3Y.js → chunk.W66VMALY.js} +1 -1
  126. package/dist/preview/{chunk.WQOI6BLM.js → chunk.WEGPDJTB.js} +1 -1
  127. package/dist/preview/{chunk.3OYGXYQY.js → chunk.WGTBQHHE.js} +1 -1
  128. package/dist/preview/chunk.WGVIJDV5.js +1 -0
  129. package/dist/preview/{chunk.SDVPJYVF.js → chunk.WTUB7W2D.js} +1 -1
  130. package/dist/preview/{chunk.VG7OWV2H.js → chunk.X2G4ZRB2.js} +1 -1
  131. package/dist/preview/chunk.X3MMJ3QC.js +5 -0
  132. package/dist/preview/chunk.X5YRNNHU.js +1 -0
  133. package/dist/preview/{chunk.BTVBZ6KE.js → chunk.XOTES3PI.js} +2 -2
  134. package/dist/preview/{chunk.YIA2EDVF.js → chunk.YGZCESXY.js} +1 -1
  135. package/dist/preview/chunk.YMC2T2HN.js +1 -0
  136. package/dist/preview/{chunk.HS3GHAUR.js → chunk.YMRVKG6W.js} +1 -1
  137. package/dist/preview/chunk.YN6BXZHO.js +1 -0
  138. package/dist/preview/{chunk.YP2F5UGY.js → chunk.Z4CJJ4QP.js} +1 -1
  139. package/dist/preview/{chunk.2EDC63RI.js → chunk.ZFH4SCCF.js} +1 -1
  140. package/dist/preview/{chunk.NOFWGDOT.js → chunk.ZLMI2NHC.js} +1 -1
  141. package/dist/preview/{chunk.YZZONE4M.js → chunk.ZT3NEAFI.js} +1 -1
  142. package/dist/preview/{chunk.I3WWCPQ2.js → chunk.ZUKYMU6C.js} +1 -1
  143. package/dist/preview/index.html +51 -51
  144. package/dist/preview/page.js +2 -2
  145. package/package.json +6 -6
  146. package/dist/preview/chunk.32FMOHZK.js +0 -1
  147. package/dist/preview/chunk.3FCOFEGW.js +0 -1
  148. package/dist/preview/chunk.43OKZU73.js +0 -1
  149. package/dist/preview/chunk.47JQPYXL.js +0 -2
  150. package/dist/preview/chunk.4GGPPCMM.js +0 -1
  151. package/dist/preview/chunk.6K7EN2YI.js +0 -1
  152. package/dist/preview/chunk.6VC6AGYV.js +0 -5
  153. package/dist/preview/chunk.7BBGRTXM.js +0 -5
  154. package/dist/preview/chunk.7ECBGIUK.js +0 -1
  155. package/dist/preview/chunk.ARWBIBSI.js +0 -6
  156. package/dist/preview/chunk.BKVBX2YB.js +0 -1
  157. package/dist/preview/chunk.DM767F2Q.js +0 -21
  158. package/dist/preview/chunk.GUEHKCWN.js +0 -1
  159. package/dist/preview/chunk.HT2BEOEV.js +0 -25
  160. package/dist/preview/chunk.JOAN54PN.js +0 -1
  161. package/dist/preview/chunk.L7V24JPO.js +0 -1
  162. package/dist/preview/chunk.LA4CPZ2N.js +0 -1
  163. package/dist/preview/chunk.MV3AJ7JH.js +0 -1
  164. package/dist/preview/chunk.MYNQWWCL.js +0 -1
  165. package/dist/preview/chunk.OASYYMG5.js +0 -1
  166. package/dist/preview/chunk.PM3SYXKB.js +0 -1
  167. package/dist/preview/chunk.QB25SMP6.js +0 -1
  168. package/dist/preview/chunk.R7LFO7KI.js +0 -1
  169. package/dist/preview/chunk.S5MGE2U5.js +0 -1
  170. package/dist/preview/chunk.TXGNPW76.js +0 -1
  171. package/dist/preview/chunk.UGFDSE37.js +0 -1
  172. package/dist/preview/chunk.UKMVJV6Q.js +0 -1
  173. package/dist/preview/chunk.UUG3BYVN.js +0 -1
@@ -1,2 +1,2 @@
1
- import{G as w,Na as c,aa as f,ba as h,da as g}from"./chunk.HT2BEOEV.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(w(),1);function j(){let e=c();return(0,d.useMemo)(()=>[...new Set(e.flatMap(n=>n.nodeIds))],[e])}function x(){let e=I(),n=f();return(0,d.useMemo)(()=>{if(!n)return e;let t=n.matched;return t.length===0&&e.length===0?[k]:[...new Set([...e,...t])]},[n,e])}function I(){let{store:e,selection:n}=h(),t=g(),r=c();return(0,d.useMemo)(()=>{if(n.length===0)return v;let u=n.join(`
1
+ import{G as w,Na as c,aa as f,ba as h,da as g}from"./chunk.VNJKGSGZ.js";import{b as m}from"./chunk.AJZBJBMO.js";var d=m(w(),1);function j(){let e=c();return(0,d.useMemo)(()=>[...new Set(e.flatMap(n=>n.nodeIds))],[e])}function x(){let e=I(),n=f();return(0,d.useMemo)(()=>{if(!n)return e;let t=n.matched;return t.length===0&&e.length===0?[k]:[...new Set([...e,...t])]},[n,e])}function I(){let{store:e,selection:n}=h(),t=g(),r=c();return(0,d.useMemo)(()=>{if(n.length===0)return v;let u=n.join(`
2
2
  `),s=y.get(e);if(s&&s.violations===r&&s.key===u)return s.reached;let a=new Set(n),i=new Set(a);for(let o of e.graph.allEdges())a.has(o.from)&&i.add(o.to),a.has(o.to)&&i.add(o.from);for(let o of r)if(o.subjectId!==void 0&&a.has(o.subjectId))for(let p of o.nodeIds)i.add(p);let l=[...i];return y.set(e,{violations:r,key:u,reached:l}),l},[e,n,t,r])}var v=[],y=new WeakMap,k="search:nothing";export{j as a,x as b,I as c};
@@ -1,4 +1,4 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as G,b as J}from"./chunk.WNQFHMNR.js";import"./chunk.7SQAKSJD.js";import{a as K}from"./chunk.PZG3B7F4.js";import"./chunk.LRUNFSHP.js";import"./chunk.S5MGE2U5.js";import"./chunk.EB4NVTJL.js";import"./chunk.VG7OWV2H.js";import"./chunk.KXPRILAO.js";import"./chunk.BB33TI4S.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{D as H,E as V,G as ee,Ga as _,Sa as x,T as D,ca as F}from"./chunk.HT2BEOEV.js";import{a as j}from"./chunk.SDO3U72B.js";import{Vc as B,ia as q}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(ee(),1);var a=b(D(),1);function ae(n){let r=[];return n.applied.length>0&&n.intent&&r.push(`${n.intent}.`),n.unchanged.length>0&&r.push(`${n.unchanged.length} already so.`),n.allOrNothing&&r.push("None of it was kept."),r.join(" ")}var re=_(j(()=>(__graviewPreload(import.meta.url,["./chunk.47JQPYXL.js","./chunk.BJUUSIQY.js","./chunk.VG7OWV2H.js","./chunk.KXPRILAO.js","./chunk.XU34T2H4.js","./chunk.XOZU4OFA.js","./chunk.BB33TI4S.js","./chunk.CCWPF5PK.js","./chunk.KKNDX4JT.js","./chunk.3YZHZGTM.js","./chunk.EQTSV7BK.js","./chunk.27CW6SCT.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TJOXNEFU.js")))),te=re.part((n,r)=>(0,a.jsx)(n.SeveralAi,{...r}),{quiet:!0});function ne(n){let r=F()?.ai;return!H(r)||!V(r)?null:(0,a.jsx)(t.Suspense,{fallback:null,children:(0,a.jsx)(te,{...n})})}function ge({store:n,chosen:r,principal:d,context:v,via:k,anchor:A,of:g,onChooseAll:E,onClear:m,onActed:Q}){let[U,X]=(0,t.useState)(0);(0,t.useEffect)(()=>n.subscribe(()=>X(e=>e+1)),[n]);let f=r.join(`
1
+ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as G,b as J}from"./chunk.4QWTSI7V.js";import"./chunk.CZH27V2R.js";import{a as K}from"./chunk.OVSZXILB.js";import"./chunk.BDBLGGFJ.js";import"./chunk.CJUIJ6TL.js";import"./chunk.VFRURRNI.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.MHILFBK6.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{D as H,E as V,G as ee,Ga as _,Sa as x,T as D,ca as F}from"./chunk.VNJKGSGZ.js";import{a as j}from"./chunk.SDO3U72B.js";import{Wc as B,ia as q}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(ee(),1);var a=b(D(),1);function ae(n){let r=[];return n.applied.length>0&&n.intent&&r.push(`${n.intent}.`),n.unchanged.length>0&&r.push(`${n.unchanged.length} already so.`),n.allOrNothing&&r.push("None of it was kept."),r.join(" ")}var re=_(j(()=>(__graviewPreload(import.meta.url,["./chunk.NOLGJFA4.js","./chunk.BJUUSIQY.js","./chunk.X2G4ZRB2.js","./chunk.UITZ74YJ.js","./chunk.2NJDT47T.js","./chunk.XOZU4OFA.js","./chunk.MHILFBK6.js","./chunk.QLTHHWBA.js","./chunk.AXXYJCSW.js","./chunk.NSGQXCH6.js","./chunk.SZG6HJWH.js","./chunk.2FOIJ5ID.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.EGJUFZD5.js")))),te=re.part((n,r)=>(0,a.jsx)(n.SeveralAi,{...r}),{quiet:!0});function ne(n){let r=F()?.ai;return!H(r)||!V(r)?null:(0,a.jsx)(t.Suspense,{fallback:null,children:(0,a.jsx)(te,{...n})})}function ge({store:n,chosen:r,principal:d,context:v,via:k,anchor:A,of:g,onChooseAll:E,onClear:m,onActed:Q}){let[U,X]=(0,t.useState)(0);(0,t.useEffect)(()=>n.subscribe(()=>X(e=>e+1)),[n]);let f=r.join(`
2
2
  `),{acts:c,withheld:N}=(0,t.useMemo)(()=>G(n,r,{...d?{principal:d}:{},...v?{context:v}:{}}),[n,f,d,v,U]),[O,p]=(0,t.useState)(!1),[l,u]=(0,t.useState)(null),[s,P]=(0,t.useState)(null),h=(0,t.useRef)(null),L=(0,t.useId)(),w=(0,t.useMemo)(()=>[...new Set(r.map(e=>n.graph.getNode(e)?.kind))],[n,f]),Y=w.length===1&&w[0]?`${q(n.schema,w[0],r.length)} chosen`:`${r.length} chosen`,M=typeof matchMedia=="function"&&matchMedia("(pointer: coarse), (max-width: 599px)").matches?2:3,C=c.filter(e=>!e.more),Z=C.slice(0,M),R=[...C.slice(M),...c.filter(e=>e.more)];(0,t.useEffect)(()=>{u(null),p(!1)},[f]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!x(e))try{e.showPopover()}catch{}let i=()=>{W(e,A?.()??null),dispatchEvent(new Event(S))};i(),addEventListener("resize",i),addEventListener("scroll",i,!0);let o=typeof ResizeObserver=="function"?new ResizeObserver(i):null;return o?.observe(e),()=>{if(o?.disconnect(),removeEventListener("resize",i),removeEventListener("scroll",i,!0),e.isConnected&&x(e))try{e.hidePopover()}catch{}dispatchEvent(new Event(S))}},[A]);let y=(0,t.useRef)({asking:l,onClear:m});y.current={asking:l,onClear:m},(0,t.useEffect)(()=>{let e=i=>{if(i.key!=="Escape"||i.defaultPrevented)return;let o=document.activeElement;if(!(!(h.current?.contains(o)??!1)&&(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement&&o.type!=="checkbox"||o instanceof HTMLSelectElement))){if(i.preventDefault(),i.stopPropagation(),y.current.asking){u(null);return}y.current.onClear()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let T=(e,i={})=>{let o=J(n,{mutation:e.mutation,subject:e.subject,args:{...e.args,...i},label:e.label},r,{...d?{author:d}:{},...k?{via:k}:{},...v?{context:v}:{}});u(null),p(!1),P(o.refused.length>0||o.applied.length===0?o:null),Q(o.refused.map(I=>I.id))},$=e=>{P(null),p(!1),e.open.length>0?u(e):T(e)},z=e=>(0,a.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-act","data-act":e.id,"data-mutation":e.mutation,...e.destructive?{"data-tone":"warn"}:{},"aria-pressed":l?.id===e.id?!0:void 0,onClick:()=>$(e),children:[e.label,e.open.length>0?"\u2026":""]},e.id);return(0,a.jsxs)("div",{ref:h,popover:"manual",role:"region","aria-label":"The chosen records",className:"graview-several-bar","data-testid":"several-bar","data-graview-foot":"","data-graview-overlay":"","data-graview-popover":"","data-graview-offstage":"",style:ie,children:[(0,a.jsx)("style",{children:oe}),(0,a.jsxs)("div",{className:"graview-several-line",children:[(0,a.jsx)("span",{role:"status","aria-live":"polite",className:"graview-several-count","data-testid":"several-count",children:Y}),(0,a.jsxs)("div",{role:"group","aria-label":`What to do with the ${r.length} chosen`,className:"graview-several-acts",children:[Z.map(z),R.length>0?(0,a.jsx)("button",{type:"button",className:"graview-several-act","data-testid":"several-more","aria-expanded":O,"aria-controls":L,onClick:()=>p(e=>!e),children:"More"}):null,E&&g!==void 0&&g>r.length?(0,a.jsxs)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-all",onClick:E,children:["Choose all ",g]}):null,(0,a.jsx)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-clear","aria-keyshortcuts":"Escape",title:"Put the choice down \u2014 Escape",onClick:m,children:"Clear"})]})]}),c.length>0&&r.length>1?(0,a.jsx)(ne,{chosen:r,acts:c,onAct:$}):null,O?(0,a.jsx)("div",{id:L,role:"group","aria-label":"More",className:"graview-several-acts","data-testid":"several-more-acts",children:R.map(z)}):null,c.length===0?(0,a.jsx)("p",{className:"graview-several-said","data-testid":"several-none",children:N.length>0?`Nothing here can be done to all of them by you: ${N[0].message}`:"Nothing can be done to all of these at once."}):null,l?(0,a.jsx)("div",{className:"graview-several-ask",role:"group","aria-label":`${l.label}, for all ${r.length}`,"data-testid":"several-ask",children:(0,a.jsx)(K,{store:n,affordance:l.affordance,onApply:e=>T(l,e),onCancel:()=>u(null)})}):null,s?(0,a.jsxs)("div",{role:"alert",className:"graview-several-said","data-testid":"several-outcome",children:[ae(s),s.refused.length>0?(0,a.jsxs)(a.Fragment,{children:[" ",s.refused.length===1?"One was not changed, and is still chosen:":`${s.refused.length} were not changed, and are still chosen:`,(0,a.jsx)("ul",{"data-testid":"several-refused",children:s.refused.map(e=>(0,a.jsxs)("li",{"data-record":e.id,children:["\u201C",e.label,"\u201D \u2014 ",e.message]},e.id))})]}):null]}):null]})}var ie={position:"fixed",inset:"auto",margin:0,zIndex:B("toast"),boxSizing:"border-box",width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,overflow:"visible"},oe=`
3
3
  .graview-several-bar{display:grid;gap:8px;padding:8px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-float);color:var(--graview-ink);box-shadow:var(--graview-lift-high);font-size:.875rem;line-height:1.4;max-height:70vh;overflow:auto}
4
4
  .graview-several-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;min-width:0}
@@ -0,0 +1 @@
1
+ import{h as z,j as D}from"./chunk.FQLNBIQ5.js";var b=globalThis[Symbol.for("@graview/core:publishing")]??={},F=()=>b.kit,O="publish",N=e=>e?.mode==="on-publish",X=Symbol.for("@graview/core:seat"),$=(e,n)=>{let o=Reflect.get(e,n,e);return typeof o=="function"?o.bind(e):o},ee,ne=()=>ee??={name:O,title:"Publish",description:"Publish what collaborators have changed, so readers see it.",input:b.input(),apply(){}};function A(e,n,o){let r=e.all(),i=[],s;for(let t=r.length-1;t>=0&&i.length<o;t--){let a=r[t];a.seq>=n||a.publishedThrough===void 0||(s??=e.undoneIds()).has(a.id)||i.push(a.publishedThrough)}if(i.length<o){let t=[...e.epochs()].reverse().find(a=>a.horizon)?.publishedThrough;t!==void 0&&i.push(t)}return i}var R=new WeakMap;function K(e){let n=e.all(),o=n.at(-1)?.id,r=e.epochs(),i=R.get(e);if(i&&i.length===n.length&&i.last===o&&i.from===r)return i.seq;let s=A(e,Number.POSITIVE_INFINITY,1)[0];return R.set(e,{length:n.length,last:o,from:r,seq:s}),s}function te(e,n){if(!N(e))return{mutation:O,message:"this app is live: every edit reaches its readers as it is made, so there is nothing to publish.",wouldNeed:[]};let o=e.publishers??e.working;if(F().reads({mode:"on-publish",working:o},n))return{mutation:O,message:`only ${o.join(", ")||"nobody"} may publish.`,wouldNeed:[...o]}}var oe=(e,n,o,r,i,s)=>{let{log:t}=e,a=t.length,d=o.args.through;if(d!==void 0&&(!Number.isInteger(d)||d<t.horizon||d>a))throw new RangeError(`Cannot publish through seq ${String(d)}: this store holds seqs ${t.horizon} to ${a}.`);let u=d??a+1,l=K(t)??t.horizon,p=t.batches().filter(S=>!S.undone&&S.ops.some(m=>m.seq>=l&&m.seq<u&&m.publishedThrough===void 0)).length,g={id:n.id,seq:a,batch:r,author:i,intent:u<l?"Take back what was published":`Publish ${p===1?"1 change":`${p} changes`}`,...s.intent!==void 0?{batchIntent:s.intent}:{},mutation:o,primitives:[],reads:[],writes:[],at:n.at,...s.via!==void 0?{via:s.via}:{},publishedThrough:u};return t.append(g),g},se=new Set(["graph","log","snapshot","batches","violations","findings","canUndo","servedSeq","checkpoint"]);function re(e,n){let{seatView:o,viewsOf:r,viewKey:i,diff:s}=F(),t=r(e),a=i(n,"published"),d=t.get(a);if(d)return d;let u=o(e,n),l,p=()=>{let f=Math.max(e.publishedSeq??e.log.horizon,e.log.horizon);if(f>=e.log.length)return u;let h=e.log.all()[f-1-e.log.horizon]?.id;return(l?.seq!==f||l.id!==h)&&(l={seq:f,id:h,view:o(I(e,f),n)}),l.view},g=f=>f.servedSeq,S=f=>{let h=g(p()),v=p().graph.snapshot();return e.subscribe(()=>{let y=p(),k=g(y);if(k===h)return;let q=y.graph.snapshot(),M=k>h?y.log.all().filter(w=>w.seq>=h):[],c=s(v,q);[h,v]=[k,q],f(c,M)})},m=new Proxy(u,{get(f,h){switch(h){case X:return{store:e,principal:n};case"subscribe":return S;case"seenBy":return(v,y)=>e.seenBy(v,y);case"seenFor":return n;default:return se.has(h)?$(p(),h):$(f,h)}}});return t.set(a,m),m}b.served=re;b.act=(e,n)=>N(e.publishing)&&!e.past&&!n.has(O)?ne():void 0;b.verdict=(e,n)=>{let o=te(e.publishing,n);return o?{ok:!1,refusal:o}:{ok:!0}};b.seq=(e,n)=>{let{publishing:o,log:r}=e;if(N(o))return n===void 0?K(r):A(r,n,1)[0]};b.previous=e=>{let{publishing:n,log:o}=e;return N(n)?A(o,Number.POSITIVE_INFINITY,2).slice(1).filter(r=>r>=o.horizon):[]};b.op=oe;b.undo=(e,n,o)=>{if(o.seq===0)return;let r=new Set(n.map(t=>t.id)),i=A(e,Number.POSITIVE_INFINITY,1)[0],s=A({all:()=>e.all().filter(t=>!r.has(t.id)),undoneIds:()=>e.undoneIds(),epochs:()=>e.epochs()},Number.POSITIVE_INFINITY,1)[0];if(!(s===i||s!==void 0&&s>=o.seq))return`Cannot undo this publish: what was published before it is behind the undo horizon at op ${o.seq}, so readers could not be served it again. Publish through an earlier change instead.`};function L(e,n){let o;for(let r of[...e??[]].sort((i,s)=>i.seq-s.seq)){if(r.seq>n)break;r.declaration&&(o=r.declaration)}return o}var V=new WeakMap;function ie(e,n){let o=L(e?.declarations,n),r=e?.declarationAt,i=[...e?.declarations??[]].filter(a=>a.seq<=n).sort((a,d)=>a.seq-d.seq).at(-1);if(!r||!i||i.declaration)return{declaration:o};let s=V.get(r);s||V.set(r,s=new Map);let t=s.get(i.seq);if(!t){let a={settled:!0,declaration:void 0,waiting:Promise.resolve()};try{let d=r(i.seq);d instanceof Promise?(a.settled=!1,a.waiting=d.then(u=>void Object.assign(a,{settled:!0,declaration:u}),()=>void(a.settled=!0))):a.declaration=d}catch{}s.set(i.seq,t=a)}return t.settled?{declaration:t.declaration??o}:{waiting:t.waiting}}var U=e=>e,B=new WeakMap,C=new WeakMap;function H(e,n){let o=typeof n=="string"?Date.parse(n):n.getTime();if(Number.isNaN(o))throw new RangeError(`\u201C${String(n)}\u201D is not a time`);let i=e.log.all().findIndex(s=>Date.parse(s.at)>o);return i===-1?e.log.length:e.log.horizon+i}function I(e,n,o={}){let r=D(e);if(r){let c=typeof n=="number"?n:H(e,n);if(c>e.servedSeq)throw new RangeError(`No moment at seq ${c}: this seat is served through seq ${e.servedSeq}`);return I(r.store,c,o).seenBy(r.principal)}let i=e.log,s=i.horizon,t=typeof n=="number"?n:H(e,n);if(!Number.isInteger(t)||t<s||t>i.length)throw new RangeError(`No moment at seq ${t}: this store holds seqs ${s} to ${i.length}${s>0?"; what is before its horizon is in the archive":""}`);let a=i.all(),d=o.declaration,u=d?.schema??e.schema,l=i.epochs().filter(c=>c.seq<=t),p=l.at(-1),g=p?.seq??s,S=c=>c>s?a[c-1-s]?.id:void 0,m=(B.get(e)??[]).filter(c=>c.seq<=i.length&&S(c.seq)===c.id);B.set(e,m);let f=[...m].reverse().find(c=>c.seq>=g&&c.seq<=t),h=f?.seq??g,v=f?.base??p?.base??de(e),y=Y(e,u,v),k=e.pastEvery,q=(c,w)=>{m.some(x=>x.seq===c)||(m.push({seq:c,id:w,base:y.snapshot()}),m.sort((x,Q)=>x.seq-Q.seq))};for(let c=h;c<t;c++){let w=a[c-s];try{J(y,w)}catch{}(c+1)%k===0&&c+1<t&&q(c+1,w.id)}t-h>=k&&q(t,S(t));let M=a[t-1-s]?.at??p?.at;return W(e,d,{graph:y,log:a.slice(0,t-s),epochs:l,...s>0&&!l.some(c=>c.horizon)?{horizon:s}:{},seq:t,at:M,from:h})}var P=(e,n)=>n===void 0?{}:{[e]:n};function W(e,n,o){let r=U(e),i=e.constructor;return new i({schema:n?.schema??e.schema,invariants:n?.invariants??r.invariants,invariantOptions:r.invariantOptions,...P("policy",n?n.policy:e.policy),...P("modules",n?.modules??r.declaredModules),...P("enabledModules",r.startingModules),...P("timeZone",e.timeZone),intelligence:e.intelligence,principal:r.by,log:[...o.log],epochs:[...o.epochs],...P("horizon",o.horizon),snapshot:o.graph.snapshot(),validate:!1,now:r.now,past:{seq:o.seq,...P("at",o.at),foldedFrom:o.from,folded:o.seq-o.from}})}function Y(e,n,o){let r=e.graph.constructor;try{return r.from(n,o,{validate:U(e).validate})}catch{return r.from(n,o,{validate:!1})}}var E=256,_=new WeakMap;function j(e){let n=_.get(e);return n||_.set(e,n={ops:new Map,epochs:new Map,chunks:new Map,marks:new Map,keptFrom:0}),n}function G(e,n,o){let r=o?.kept?Date.parse(o.kept.since):Number.NaN;if(Number.isNaN(r))return-1;let i=u=>u!==void 0&&Date.parse(u)<=r,s=-1;for(let[u,l]of n.ops)u+1>s&&i(l.at)&&(s=u+1);let t=e.log.horizon,a=e.log.epochs().find(u=>u.seq===t);i(a?.at)&&(s=Math.max(s,t));let d=e.log.all();for(let u=0;u<d.length&&i(d[u].at);u++)s=Math.max(s,t+u+1);return s}function T(e,n,o,r=-1){let i=-1,s;for(let[u,l]of e.epochs)u<=n&&u>i&&([i,s]=[u,l.base]);for(let[u,l]of e.marks)u<=n&&u>i&&([i,s]=[u,l]);let t=-1;for(let u=n-1;u>=Math.max(i,0);u--)if(!e.ops.has(u)){t=u;break}if(t<0&&s)return{from:i,base:s};if(Math.max(t,0)<e.keptFrom)return{behindKept:!0};let a=t<0?0:t-t%E,d=e.chunks.get(a);return!d&&Math.min(a+E,o)<=r?{behindKept:!0}:!d||d.settled&&!d.refused&&t>=d.to?{ask:a}:d.settled?d.refused?{refused:d.refused}:t<0?{from:0,base:{nodes:[],edges:[]}}:{refused:`The archive is missing a change this moment needs (seq ${t})`}:{waiting:d.waiting}}function ae(e,n,o,r){let i=Math.min(o+E,r),s={to:i,settled:!1,waiting:Promise.resolve()};s.waiting=Promise.resolve().then(()=>n(o,i)).then(t=>{let a=Array.isArray(t)?{ops:t}:t;if(!Array.isArray(a?.ops))throw new Error("its answer held no ops");for(let d of a.ops)Number.isInteger(d?.seq)&&d.seq<r&&!e.ops.has(d.seq)&&e.ops.set(d.seq,d);for(let d of a.epochs??[])Number.isInteger(d?.seq)&&d.seq<r&&d.base&&e.epochs.set(d.seq,d);Number.isInteger(a.keptFrom)&&a.keptFrom>e.keptFrom&&(e.keptFrom=Math.min(a.keptFrom,r))}).then(()=>void(s.settled=!0),t=>void Object.assign(s,{settled:!0,refused:`Could not read the older changes from the archive: ${t instanceof Error?t.message:String(t)}`})),e.chunks.set(o,s)}function fe(e,n,o){let r=o?.archived,i=e.log.horizon;if(!r||n>=i)return;let s=j(r),t=G(e,s,o),a=T(s,n,i,t);return"ask"in a&&(ae(s,r,a.ask,i),a=T(s,n,i,t)),"base"in a||"ask"in a?void 0:{seq:n,...a}}function me(e,n){let o=n?.archived,r=e.log.horizon;if(!o||r===0)return;let i=j(o),s=G(e,i,n),t=Math.min(Math.max(i.keptFrom,s),r);return{stops:[...[...i.epochs.keys()].filter(d=>d<t).sort((d,u)=>d-u),...Array.from({length:r-t},(d,u)=>t+u)],from:t,through:s}}function Z(e,n,o,r){let i=D(e);if(i)return Z(i.store,n,o,r).seenBy(i.principal);if(!Number.isInteger(n)||n<0)throw new RangeError(`No moment at seq ${n}`);let s=j(o.archived),t=T(s,n,e.log.horizon,G(e,s,o));if(!("base"in t))throw new RangeError("refused"in t?t.refused:"behindKept"in t?`The moment at seq ${n} is before what the archive keeps`:`The changes before seq ${n} are still being read from the archive`);let a=Y(e,r?.schema??e.schema,t.base),d=[],u=e.pastEvery;for(let p=t.from;p<n;p++){let g=s.ops.get(p);d.push(g);try{J(a,g)}catch{}(p+1)%u===0&&p+1<n&&!s.marks.has(p+1)&&s.marks.set(p+1,a.snapshot())}n-t.from>=u&&s.marks.set(n,a.snapshot());let l=s.epochs.get(t.from);return W(e,r,{graph:a,log:d,epochs:l?[l]:[],...t.from>0?{horizon:t.from}:{},seq:n,at:d.at(-1)?.at??l?.at,from:t.from})}function de(e){let n=e.log.all(),o=e.log.horizon,r=n[0]?.id,i=C.get(e);if(i&&i.firstId===r)return i.base;let s=e.log.epochs().find(d=>d.seq>o),t=e.graph.constructor.from(e.schema,s?.base??e.graph.snapshot(),{validate:!1});for(let d=(s?.seq??e.log.length)-1;d>=o;d--)try{t.applyPrimitives(z(n[d-o]),{restoring:!0})}catch{}let a=t.snapshot();return C.set(e,{firstId:r,base:a}),a}function ge(e,n,o={}){let r=typeof n=="number"?n:H(e,n),i=ie(o,r),s="declaration"in i?i.declaration:L(o.declarations,r);return o.archived&&r<e.log.horizon?Z(e,r,o,s):I(e,r,{declaration:s})}function J(e,n){if(n.undoes!==void 0){e.applyPrimitives(n.primitives,{restoring:!0});return}try{e.applyPrimitives(n.primitives)}catch{e.applyPrimitives(n.primitives,{restoring:!0})}}export{L as a,ie as b,H as c,I as d,fe as e,me as f,ge as g};
@@ -1 +1 @@
1
- import{Rb as w,cc as S}from"./chunk.7BBGRTXM.js";function v(s){return[...s.mutations??[],...S(s.schema,s.mutations??[])]}function B(s){let i=[...s.schema.kinds],a=v(s),d=new Map,c=new Map;for(let e of a){c.set(e.name,e.creates??[]);let n=w(e.input).filter(t=>!t.optional&&!t.kinds.includes("*")).flatMap(t=>t.kinds);d.set(e.name,[...new Set(n)])}let g=new Map;for(let e of i)g.set(e,[]);for(let e of a)for(let n of c.get(e.name)??[])g.get(n)?.push(e.name);let p=new Map,l=new Set;for(let e=0;;e+=1){let n=[];for(let t of a)if((d.get(t.name)??[]).every(o=>l.has(o)))for(let o of c.get(t.name)??[])l.has(o)||n.push(o);if(n.length===0)break;for(let t of n)l.add(t),p.set(t,e)}let h=e=>{let n=g.get(e)??[];if(n.length===0)return[];let t=n.map(r=>d.get(r)??[]).sort((r,o)=>r.length-o.length)[0];return[...new Set(t)].filter(r=>r!==e)},y=new Map,u=e=>{let n=y.get(e);if(n)return n;let t=new Set;y.set(e,t);for(let r of h(e)){t.add(r);for(let o of u(r))t.add(o)}return t.delete(e),t},f=new Map(i.map(e=>[e,0]));for(let e of i)for(let n of u(e))f.set(n,(f.get(n)??0)+1);let m=i.map(e=>({kind:e,madeBy:[...g.get(e)??[]].sort(),needs:[...h(e)].sort(),depth:p.get(e)??null})).sort((e,n)=>(e.depth??Number.MAX_SAFE_INTEGER)-(n.depth??Number.MAX_SAFE_INTEGER)||(f.get(n.kind)??0)-(f.get(e.kind)??0)||e.kind.localeCompare(n.kind)),k=m.filter(e=>e.depth===0).map(e=>e.kind),A=[...new Set(a.filter(e=>(d.get(e.name)??[]).length===0).filter(e=>(c.get(e.name)??[]).length>0).map(e=>e.name))].sort(),M=m.filter(e=>e.depth===null).map(e=>({kind:e.kind,why:e.madeBy.length===0?"no act declares that it creates this kind":`every act that makes it needs ${e.needs.map(n=>`"${n}"`).join(", ")}, which nothing can make first`}));return{order:m,roots:k,doors:A,unreachable:M}}export{B as a};
1
+ import{Rb as w,cc as S}from"./chunk.X3MMJ3QC.js";function v(s){return[...s.mutations??[],...S(s.schema,s.mutations??[])]}function B(s){let i=[...s.schema.kinds],a=v(s),d=new Map,c=new Map;for(let e of a){c.set(e.name,e.creates??[]);let n=w(e.input).filter(t=>!t.optional&&!t.kinds.includes("*")).flatMap(t=>t.kinds);d.set(e.name,[...new Set(n)])}let g=new Map;for(let e of i)g.set(e,[]);for(let e of a)for(let n of c.get(e.name)??[])g.get(n)?.push(e.name);let p=new Map,l=new Set;for(let e=0;;e+=1){let n=[];for(let t of a)if((d.get(t.name)??[]).every(o=>l.has(o)))for(let o of c.get(t.name)??[])l.has(o)||n.push(o);if(n.length===0)break;for(let t of n)l.add(t),p.set(t,e)}let h=e=>{let n=g.get(e)??[];if(n.length===0)return[];let t=n.map(r=>d.get(r)??[]).sort((r,o)=>r.length-o.length)[0];return[...new Set(t)].filter(r=>r!==e)},y=new Map,u=e=>{let n=y.get(e);if(n)return n;let t=new Set;y.set(e,t);for(let r of h(e)){t.add(r);for(let o of u(r))t.add(o)}return t.delete(e),t},f=new Map(i.map(e=>[e,0]));for(let e of i)for(let n of u(e))f.set(n,(f.get(n)??0)+1);let m=i.map(e=>({kind:e,madeBy:[...g.get(e)??[]].sort(),needs:[...h(e)].sort(),depth:p.get(e)??null})).sort((e,n)=>(e.depth??Number.MAX_SAFE_INTEGER)-(n.depth??Number.MAX_SAFE_INTEGER)||(f.get(n.kind)??0)-(f.get(e.kind)??0)||e.kind.localeCompare(n.kind)),k=m.filter(e=>e.depth===0).map(e=>e.kind),A=[...new Set(a.filter(e=>(d.get(e.name)??[]).length===0).filter(e=>(c.get(e.name)??[]).length>0).map(e=>e.name))].sort(),M=m.filter(e=>e.depth===null).map(e=>({kind:e.kind,why:e.madeBy.length===0?"no act declares that it creates this kind":`every act that makes it needs ${e.needs.map(n=>`"${n}"`).join(", ")}, which nothing can make first`}));return{order:m,roots:k,doors:A,unreachable:M}}export{B as a};
@@ -1 +1 @@
1
- import{a as N,b as T}from"./chunk.25VJPUDH.js";import{e as D,f as E,g as R}from"./chunk.ZOHMWSHD.js";import{b as I}from"./chunk.PZG3B7F4.js";import"./chunk.LRUNFSHP.js";import{d as z}from"./chunk.WNSC3RWD.js";import"./chunk.S5MGE2U5.js";import{a as C}from"./chunk.KXPRILAO.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import{j as f}from"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as M,Ra as W,T as k,Va as A,ba as b,da as H}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{_a as x}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var n=v(M(),1);var e=v(k(),1);function O(t,o){let r=[t>0?`${t===1?"one suggestion":`${t} suggestions`} waiting`:"",o>0?`tidied ${o===1?"one thing":`${o} things`} while you were away`:""].filter(Boolean);return r.length>0?r.join(" \xB7 ").replace(/^./,s=>s.toUpperCase()):void 0}function F(){let{store:t,principal:o,dismissals:r,whileAway:s,app:u}=b(),h=H(),l=(0,n.useMemo)(()=>T(r,u?.name??"app",o),[r,u?.name,o]),[m,y]=(0,n.useReducer)(g=>g+1,0);(0,n.useEffect)(()=>l.onChange?.(y),[l]);let a=(0,n.useMemo)(()=>D(t,o,{dismissed:l.list()}),[t,o,h,l,m]),[w,p]=(0,n.useState)(""),i=A("suggested"),d=s?.tidied??0,c=s?O(a.length,d):void 0;if(a.length===0&&d===0)return null;let L=g=>{if(p(g),a.length>1){requestAnimationFrame(()=>document.querySelector('[data-testid="suggested"] [data-testid="suggestion-accept"]')?.focus());return}i.setOpen(!1),(document.querySelector('[data-testid="activity-button"]')??document.querySelector('[data-graview-app-bar] button:not([data-testid="suggested-button"])'))?.focus()};return(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"suggested-button",...i.trigger,onClick:i.toggle,title:c??"What tidying suggests, waiting for you",...c?{"aria-label":`Suggested: ${c}`}:{},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:[a.length>0?a.length:`Tidied ${d}`,(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("path",{d:"M3 4.5 H13 M3 8 H10 M3 11.5 H8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),(0,e.jsx)("circle",{cx:"12.25",cy:"11.5",r:"1.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})]}),a.length>0?(0,e.jsx)("span",{className:"graview-activity-word",children:" Suggested"}):null]}),i.open?(0,e.jsxs)("section",{...i.pane,"aria-label":"Suggested","data-testid":"suggested","data-graview-offstage":"",style:{...W,width:"min(320px, calc(100vw - 16px))",maxHeight:"min(52cqh, 460px)",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...f,margin:0},children:"Suggested"}),c?(0,e.jsxs)("p",{"data-testid":"while-away",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[c,"."]}):null,(0,e.jsx)("p",{style:{margin:0,fontSize:"0.75rem",lineHeight:1.45,color:"var(--graview-ink-faint)"},children:a.length>0?"Not made yet: each waits for you.":"What it did is in Activity."}),(0,e.jsx)("ol",{"data-testid":"suggestions",style:{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:10,fontSize:"0.8125rem",minWidth:0},children:a.map(g=>(0,e.jsx)(q,{suggestion:g,notNow:l,settled:L},g.id))}),(0,e.jsx)("span",{role:"status","data-testid":"suggestion-heard",style:f,children:w})]}):null]})}var S={minWidth:0,overflowWrap:"anywhere"},$={accept:"Accepted.",decline:"Declined: it will not be suggested again.",later:"Hidden from you until tomorrow."};function q({suggestion:t,notNow:o,settled:r}){let{store:s,principal:u,seats:h,people:l}=b(),[m,y]=(0,n.useState)(null),a=(0,n.useId)(),w=x(t.author,{graph:s.graph,schema:s.schema,seats:h,people:l}),p=async i=>{y(null);try{i==="accept"?E(s,t.id,{author:u}):i==="decline"?R(s,t.id,{author:u}):await o.dismiss({suggestion:t.id,at:new Date().toISOString(),until:N()}),r($[i])}catch(d){y(d instanceof Error?d.message:String(d))}};return(0,e.jsxs)("li",{"data-testid":"suggestion","data-suggestion":t.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:5,lineHeight:1.45,minWidth:0},children:[(0,e.jsxs)("span",{"data-graview-suggestion-words":"",style:S,children:[(0,e.jsx)("strong",{style:{fontWeight:600},children:w})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:"suggests"})," ",t.intent]}),t.lineage?(0,e.jsx)("span",{"data-graview-lineage":"",style:{...S,color:"var(--graview-ink-faint)"},children:C(t.lineage)}):null,t.about.length>0?(0,e.jsx)("div",{"data-graview-suggestion-records":"",style:{display:"flex",flexWrap:"wrap",gap:4,minWidth:0},children:t.about.slice(0,4).map(i=>(0,e.jsx)(z,{label:I(s,i),pickId:i},i))}):null,(0,e.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,minWidth:0},children:[(0,e.jsx)("button",{type:"button","data-testid":"suggestion-accept",onClick:()=>void p("accept"),style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},children:"Accept"}),(0,e.jsx)("button",{type:"button","data-testid":"suggestion-decline",onClick:()=>void p("decline"),style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},children:"Decline"}),(0,e.jsx)("button",{type:"button","data-testid":"suggestion-not-now",onClick:()=>void p("later"),title:"Hide it from you until tomorrow. It still waits for everyone else.","aria-describedby":a,style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem",marginInlineStart:"auto",border:"1px solid transparent",background:"transparent",boxShadow:"none",color:"var(--graview-ink-muted)"},children:"Not now"}),(0,e.jsx)("span",{id:a,style:f,children:"Hides it from you until tomorrow; it still waits for everyone else."})]}),m?(0,e.jsx)("span",{"data-testid":"suggestion-refused",role:"alert",style:{...S,fontSize:"0.75rem",color:"var(--graview-warn)"},children:m}):null]})}export{F as SuggestedTray,O as awayWords};
1
+ import{a as N,b as T}from"./chunk.25VJPUDH.js";import{e as D,f as E,g as R}from"./chunk.P3CUCDHO.js";import{b as I}from"./chunk.OVSZXILB.js";import"./chunk.BDBLGGFJ.js";import{d as z}from"./chunk.IZ2ZTNEV.js";import"./chunk.CJUIJ6TL.js";import{a as C}from"./chunk.UITZ74YJ.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import{j as f}from"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as M,Ra as W,T as k,Va as A,ba as b,da as H}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{_a as x}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var n=v(M(),1);var e=v(k(),1);function O(t,o){let r=[t>0?`${t===1?"one suggestion":`${t} suggestions`} waiting`:"",o>0?`tidied ${o===1?"one thing":`${o} things`} while you were away`:""].filter(Boolean);return r.length>0?r.join(" \xB7 ").replace(/^./,s=>s.toUpperCase()):void 0}function F(){let{store:t,principal:o,dismissals:r,whileAway:s,app:u}=b(),h=H(),l=(0,n.useMemo)(()=>T(r,u?.name??"app",o),[r,u?.name,o]),[m,y]=(0,n.useReducer)(g=>g+1,0);(0,n.useEffect)(()=>l.onChange?.(y),[l]);let a=(0,n.useMemo)(()=>D(t,o,{dismissed:l.list()}),[t,o,h,l,m]),[w,p]=(0,n.useState)(""),i=A("suggested"),d=s?.tidied??0,c=s?O(a.length,d):void 0;if(a.length===0&&d===0)return null;let L=g=>{if(p(g),a.length>1){requestAnimationFrame(()=>document.querySelector('[data-testid="suggested"] [data-testid="suggestion-accept"]')?.focus());return}i.setOpen(!1),(document.querySelector('[data-testid="activity-button"]')??document.querySelector('[data-graview-app-bar] button:not([data-testid="suggested-button"])'))?.focus()};return(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"suggested-button",...i.trigger,onClick:i.toggle,title:c??"What tidying suggests, waiting for you",...c?{"aria-label":`Suggested: ${c}`}:{},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:[a.length>0?a.length:`Tidied ${d}`,(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("path",{d:"M3 4.5 H13 M3 8 H10 M3 11.5 H8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),(0,e.jsx)("circle",{cx:"12.25",cy:"11.5",r:"1.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})]}),a.length>0?(0,e.jsx)("span",{className:"graview-activity-word",children:" Suggested"}):null]}),i.open?(0,e.jsxs)("section",{...i.pane,"aria-label":"Suggested","data-testid":"suggested","data-graview-offstage":"",style:{...W,width:"min(320px, calc(100vw - 16px))",maxHeight:"min(52cqh, 460px)",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...f,margin:0},children:"Suggested"}),c?(0,e.jsxs)("p",{"data-testid":"while-away",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[c,"."]}):null,(0,e.jsx)("p",{style:{margin:0,fontSize:"0.75rem",lineHeight:1.45,color:"var(--graview-ink-faint)"},children:a.length>0?"Not made yet: each waits for you.":"What it did is in Activity."}),(0,e.jsx)("ol",{"data-testid":"suggestions",style:{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:10,fontSize:"0.8125rem",minWidth:0},children:a.map(g=>(0,e.jsx)(q,{suggestion:g,notNow:l,settled:L},g.id))}),(0,e.jsx)("span",{role:"status","data-testid":"suggestion-heard",style:f,children:w})]}):null]})}var S={minWidth:0,overflowWrap:"anywhere"},$={accept:"Accepted.",decline:"Declined: it will not be suggested again.",later:"Hidden from you until tomorrow."};function q({suggestion:t,notNow:o,settled:r}){let{store:s,principal:u,seats:h,people:l}=b(),[m,y]=(0,n.useState)(null),a=(0,n.useId)(),w=x(t.author,{graph:s.graph,schema:s.schema,seats:h,people:l}),p=async i=>{y(null);try{i==="accept"?E(s,t.id,{author:u}):i==="decline"?R(s,t.id,{author:u}):await o.dismiss({suggestion:t.id,at:new Date().toISOString(),until:N()}),r($[i])}catch(d){y(d instanceof Error?d.message:String(d))}};return(0,e.jsxs)("li",{"data-testid":"suggestion","data-suggestion":t.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:5,lineHeight:1.45,minWidth:0},children:[(0,e.jsxs)("span",{"data-graview-suggestion-words":"",style:S,children:[(0,e.jsx)("strong",{style:{fontWeight:600},children:w})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:"suggests"})," ",t.intent]}),t.lineage?(0,e.jsx)("span",{"data-graview-lineage":"",style:{...S,color:"var(--graview-ink-faint)"},children:C(t.lineage)}):null,t.about.length>0?(0,e.jsx)("div",{"data-graview-suggestion-records":"",style:{display:"flex",flexWrap:"wrap",gap:4,minWidth:0},children:t.about.slice(0,4).map(i=>(0,e.jsx)(z,{label:I(s,i),pickId:i},i))}):null,(0,e.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,minWidth:0},children:[(0,e.jsx)("button",{type:"button","data-testid":"suggestion-accept",onClick:()=>void p("accept"),style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},children:"Accept"}),(0,e.jsx)("button",{type:"button","data-testid":"suggestion-decline",onClick:()=>void p("decline"),style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem"},children:"Decline"}),(0,e.jsx)("button",{type:"button","data-testid":"suggestion-not-now",onClick:()=>void p("later"),title:"Hide it from you until tomorrow. It still waits for everyone else.","aria-describedby":a,style:{minHeight:24,padding:"1px 10px",fontSize:"0.75rem",marginInlineStart:"auto",border:"1px solid transparent",background:"transparent",boxShadow:"none",color:"var(--graview-ink-muted)"},children:"Not now"}),(0,e.jsx)("span",{id:a,style:f,children:"Hides it from you until tomorrow; it still waits for everyone else."})]}),m?(0,e.jsx)("span",{"data-testid":"suggestion-refused",role:"alert",style:{...S,fontSize:"0.75rem",color:"var(--graview-warn)"},children:m}):null]})}export{F as SuggestedTray,O as awayWords};
@@ -1 +1 @@
1
- import{a as U,b as Y,c as G,d as D}from"./chunk.HZB5F476.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as ae,O as L,P as F,T as V,ca as _}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{T as H,Vc as M,Za as K,_a as B}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as R}from"./chunk.AJZBJBMO.js";function O(n,t){let r=K(n);return r==="agent"?"agent":r!=="human"&&r!=="visitor"?"app":n.onBehalfOf!==void 0?"person":n.id===void 0||t?.id===void 0||n.id===t.id?"you":"person"}var re=n=>n.ops.filter(t=>t.withheld!==!0);function X(n,t={}){let r=[];for(let e of n.batches()){let s=e.ops[0],d=e.ops.at(-1),l=re(e).length===0,h=l?void 0:Y(e.ops),c=r.at(-1);if(h&&c?.typed&&c.author&&U(c.author,e.author)&&c.typed.node===h.node&&c.typed.field===h.field){let S=G(c.typed,h);r[r.length-1]={...c,seq:d.seq+1,at:d.at,batch:e.id,batches:[...c.batches??[],e.id],typed:S,said:D(S,n.schema,n.graph,!1)};continue}r.push({seq:d.seq+1,from:s.seq,at:d.at,batch:e.id,maker:l?"person":O(e.author,t.me),author:l?void 0:e.author,said:h?D(h,n.schema,n.graph,!1):e.intent,declaration:!1,withheld:l,...h?{batches:[e.id],typed:h}:{}})}let i=[...n.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...t.declarations??[]];for(let e of i){if(e.seq<n.log.horizon||e.seq>n.log.length)continue;let s=r.findIndex(d=>d.seq===e.seq);if(s>=0&&!r[s].withheld){r[s]={...r[s],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?O(e.author,t.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,s)=>e.seq-s.seq||+(e.batch!==void 0)-+(s.batch!==void 0))}function J(n,t){let r=n.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return n.batches().filter(e=>!e.undone&&e.ops[0].seq>=t).filter(e=>!e.ops.every(s=>s.undoes!==void 0&&(i.get(s.undoes)??-1)>=t)).map(e=>e.id)}function Q(n,t){return n.withheld?"Someone":n.maker==="you"?"you":n.author?B(n.author,t):"the app"}var p=R(ae(),1);var o=R(V(),1),oe={kind:"human"},ie=[1,2,4,8],se=900,E={you:"You",person:"A person",agent:"An agent",app:"The app"},Z={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function de(n,t,r){return[...new Set([...r,t,...n.map(i=>i.seq)])].sort((i,e)=>i-e)}function le(n,t){let r=n.withheld===!0;return{seq:n.seq+1,from:n.seq,at:n.at,batch:n.batch,maker:r?"person":O(n.author,t),author:r?void 0:n.author,said:n.batchIntent??n.intent,declaration:!1,withheld:r}}function ce(n,t){let r=0;for(let i=0;i<n.length;i++)n[i]<=t&&(r=i);return r}function pe(n,t,r){let i=J(n,t);if(i.length===0)return null;let e=n.canUndo(i);if(!e.ok)return null;let s=new Set(n.permittedMutations(r).map(d=>d.name));return e.ops.every(d=>d.mutation!==null&&s.has(d.mutation.name))?i:null}function we({face:n}){let t=L(),r=_(),i=r?.principal??oe,e=F(t.live,i),s=e.log.length,d=(0,p.useMemo)(()=>X(e,{me:i,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[e,i,t.host,s]),l=e.log.horizon,h=l>0&&t.host?.archived!==void 0,c=t.kept,S=(0,p.useMemo)(()=>h?c?.stops??Array.from({length:l},(a,g)=>g):[],[h,c,l]),m=(0,p.useMemo)(()=>de(d,l,S),[d,l,S]),f=t.archive,y=f?.seq??t.past?.seq??s,x=t.host?.kept&&(f?.behindKept||c!==void 0&&(y<=c.through||c.from>0&&y<=c.from))?t.host.kept:void 0,w=ce(m,y),b=m.length-1,j=y<l&&t.past?.seq===y?t.past.store.log.all().at(-1):void 0,q=j?le(j,i):y<l?void 0:[...d].reverse().find(a=>a.seq<=y&&a.seq>(m[w-1]??-1))??[...d].reverse().find(a=>a.seq<=y),[k,A]=(0,p.useState)(!1),[T,ee]=(0,p.useState)(1),[C,W]=(0,p.useState)(null);(0,p.useEffect)(()=>{if(!k)return;if(w>=b){A(!1);return}let a=setTimeout(()=>t.show(m[w+1]),se/T);return()=>clearTimeout(a)},[k,w,b,T,m,t]);let z=(0,p.useMemo)(()=>t.past&&!f&&y>=l?pe(e,y,i):null,[t.past,f,e,y,l,i,s]),N=a=>Q(a,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),v=t.past?t.past.at?H(t.past.at,r?.locale):"the start":null,$=f?f.refused?"The archive could not be read":f.behindKept?"Nothing this far back is kept":"Reading the older changes from the archive\u2026":q?`${N(q)==="you"?"You":N(q)}: ${q.said}`:"Nothing had happened yet",I=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let a=I.current,g=a?.parentElement;if(n!=="scene"||!a||!g)return;let u=()=>g.style.setProperty("--graview-sheet",`${Math.ceil(a.getBoundingClientRect().height)+24}px`);u();let P=typeof ResizeObserver>"u"?null:new ResizeObserver(u);return P?.observe(a),()=>{P?.disconnect(),g.style.removeProperty("--graview-sheet")}},[n]);let te=n==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:M("rail")}:{position:"sticky",top:0,zIndex:M("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{ref:I,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...te,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,o.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:f?"Archived changes":v?`As of ${v}`:"Now"}),(0,o.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:$}),v?(0,o.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,o.jsxs)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:[h?(0,o.jsx)("span",{"data-testid":"timeline-archived",title:"Changes read from the archive as you scrub back",style:{position:"absolute",left:0,bottom:0,height:6,width:`${b===0?0:m.indexOf(l)/b*100}%`,borderRadius:2,background:"var(--graview-edge)"}}):null,m.slice(1).map((a,g)=>{let u=[...d].reverse().find(ne=>ne.seq===a);if(!u)return null;let P=b===0?0:(g+1)/b*100;return(0,o.jsx)("span",{"data-graview-tick":a,"data-maker":u.maker,...u.declaration?{"data-declaration":""}:{},title:`${E[u.maker]}: ${u.said}`,style:{position:"absolute",left:`calc(${P}% - 1px)`,bottom:0,width:u.declaration?4:2,height:u.declaration?22:12,borderRadius:2,background:u.declaration?"var(--graview-ink)":Z[u.maker],opacity:a<=y?1:.45}},`${a}:${u.batch??"declaration"}`)})]}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:b,step:1,value:w,"aria-valuetext":v?`As of ${v}. ${$}`:`Now. ${$}`,onChange:a=>{A(!1),t.show(m[Number(a.currentTarget.value)]??s)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,o.jsx)("button",{type:"button","data-testid":"play","aria-pressed":k,onClick:()=>{!k&&w>=b&&t.show(m[0]),A(!k)},style:{minHeight:28,minWidth:64},children:k?"Pause":"Play"}),(0,o.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,o.jsx)("select",{"data-testid":"speed",value:T,onChange:a=>ee(Number(a.currentTarget.value)),style:{minHeight:28},children:ie.map(a=>(0,o.jsxs)("option",{value:a,children:[a,"\xD7"]},a))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(E).filter(a=>d.some(g=>g.maker===a)).map(a=>(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:Z[a]}}),E[a]]},a))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[z?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{W(null);try{e.undo([...z],{author:i,intent:v?`Restore to ${v}`:"Restore"}),t.show(null)}catch(a){W(a instanceof Error?a.message:String(a))}},style:{minHeight:28},children:"Restore to here"}):null,(0,o.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),C?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:C}):null,f?.refused?(0,o.jsx)("span",{role:"alert","data-testid":"archive-refused",style:{color:"var(--graview-warn)"},children:f.refused}):null,x?(0,o.jsxs)("span",{"data-testid":"timeline-kept",style:{color:"var(--graview-ink-faint)"},children:[x.sentence,x.action?(0,o.jsxs)(o.Fragment,{children:[" ",(0,o.jsx)("a",{"data-testid":"timeline-kept-action",href:x.action.href,style:{color:"var(--graview-ink-muted)"},children:x.action.label})]}):null]}):null,l>0&&!h?(0,o.jsx)("span",{"data-testid":"timeline-horizon",style:{color:"var(--graview-ink-faint)"},children:"The changes before the timeline's start were archived."}):null]})}export{we as Timeline};
1
+ import{a as U,b as Y,c as G,d as D}from"./chunk.ATSKKTUO.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as ae,O as L,P as F,T as V,ca as _}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{T as H,Wc as M,Za as K,_a as B}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as R}from"./chunk.AJZBJBMO.js";function O(n,t){let r=K(n);return r==="agent"?"agent":r!=="human"&&r!=="visitor"?"app":n.onBehalfOf!==void 0?"person":n.id===void 0||t?.id===void 0||n.id===t.id?"you":"person"}var re=n=>n.ops.filter(t=>t.withheld!==!0);function X(n,t={}){let r=[];for(let e of n.batches()){let s=e.ops[0],d=e.ops.at(-1),l=re(e).length===0,h=l?void 0:Y(e.ops),c=r.at(-1);if(h&&c?.typed&&c.author&&U(c.author,e.author)&&c.typed.node===h.node&&c.typed.field===h.field){let S=G(c.typed,h);r[r.length-1]={...c,seq:d.seq+1,at:d.at,batch:e.id,batches:[...c.batches??[],e.id],typed:S,said:D(S,n.schema,n.graph,!1)};continue}r.push({seq:d.seq+1,from:s.seq,at:d.at,batch:e.id,maker:l?"person":O(e.author,t.me),author:l?void 0:e.author,said:h?D(h,n.schema,n.graph,!1):e.intent,declaration:!1,withheld:l,...h?{batches:[e.id],typed:h}:{}})}let i=[...n.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...t.declarations??[]];for(let e of i){if(e.seq<n.log.horizon||e.seq>n.log.length)continue;let s=r.findIndex(d=>d.seq===e.seq);if(s>=0&&!r[s].withheld){r[s]={...r[s],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?O(e.author,t.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,s)=>e.seq-s.seq||+(e.batch!==void 0)-+(s.batch!==void 0))}function J(n,t){let r=n.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return n.batches().filter(e=>!e.undone&&e.ops[0].seq>=t).filter(e=>!e.ops.every(s=>s.undoes!==void 0&&(i.get(s.undoes)??-1)>=t)).map(e=>e.id)}function Q(n,t){return n.withheld?"Someone":n.maker==="you"?"you":n.author?B(n.author,t):"the app"}var p=R(ae(),1);var o=R(V(),1),oe={kind:"human"},ie=[1,2,4,8],se=900,E={you:"You",person:"A person",agent:"An agent",app:"The app"},Z={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function de(n,t,r){return[...new Set([...r,t,...n.map(i=>i.seq)])].sort((i,e)=>i-e)}function le(n,t){let r=n.withheld===!0;return{seq:n.seq+1,from:n.seq,at:n.at,batch:n.batch,maker:r?"person":O(n.author,t),author:r?void 0:n.author,said:n.batchIntent??n.intent,declaration:!1,withheld:r}}function ce(n,t){let r=0;for(let i=0;i<n.length;i++)n[i]<=t&&(r=i);return r}function pe(n,t,r){let i=J(n,t);if(i.length===0)return null;let e=n.canUndo(i);if(!e.ok)return null;let s=new Set(n.permittedMutations(r).map(d=>d.name));return e.ops.every(d=>d.mutation!==null&&s.has(d.mutation.name))?i:null}function we({face:n}){let t=L(),r=_(),i=r?.principal??oe,e=F(t.live,i),s=e.log.length,d=(0,p.useMemo)(()=>X(e,{me:i,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[e,i,t.host,s]),l=e.log.horizon,h=l>0&&t.host?.archived!==void 0,c=t.kept,S=(0,p.useMemo)(()=>h?c?.stops??Array.from({length:l},(a,g)=>g):[],[h,c,l]),m=(0,p.useMemo)(()=>de(d,l,S),[d,l,S]),f=t.archive,y=f?.seq??t.past?.seq??s,x=t.host?.kept&&(f?.behindKept||c!==void 0&&(y<=c.through||c.from>0&&y<=c.from))?t.host.kept:void 0,w=ce(m,y),b=m.length-1,j=y<l&&t.past?.seq===y?t.past.store.log.all().at(-1):void 0,q=j?le(j,i):y<l?void 0:[...d].reverse().find(a=>a.seq<=y&&a.seq>(m[w-1]??-1))??[...d].reverse().find(a=>a.seq<=y),[k,A]=(0,p.useState)(!1),[T,ee]=(0,p.useState)(1),[C,W]=(0,p.useState)(null);(0,p.useEffect)(()=>{if(!k)return;if(w>=b){A(!1);return}let a=setTimeout(()=>t.show(m[w+1]),se/T);return()=>clearTimeout(a)},[k,w,b,T,m,t]);let z=(0,p.useMemo)(()=>t.past&&!f&&y>=l?pe(e,y,i):null,[t.past,f,e,y,l,i,s]),N=a=>Q(a,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),v=t.past?t.past.at?H(t.past.at,r?.locale):"the start":null,$=f?f.refused?"The archive could not be read":f.behindKept?"Nothing this far back is kept":"Reading the older changes from the archive\u2026":q?`${N(q)==="you"?"You":N(q)}: ${q.said}`:"Nothing had happened yet",I=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let a=I.current,g=a?.parentElement;if(n!=="scene"||!a||!g)return;let u=()=>g.style.setProperty("--graview-sheet",`${Math.ceil(a.getBoundingClientRect().height)+24}px`);u();let P=typeof ResizeObserver>"u"?null:new ResizeObserver(u);return P?.observe(a),()=>{P?.disconnect(),g.style.removeProperty("--graview-sheet")}},[n]);let te=n==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:M("rail")}:{position:"sticky",top:0,zIndex:M("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{ref:I,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...te,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,o.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:f?"Archived changes":v?`As of ${v}`:"Now"}),(0,o.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:$}),v?(0,o.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,o.jsxs)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:[h?(0,o.jsx)("span",{"data-testid":"timeline-archived",title:"Changes read from the archive as you scrub back",style:{position:"absolute",left:0,bottom:0,height:6,width:`${b===0?0:m.indexOf(l)/b*100}%`,borderRadius:2,background:"var(--graview-edge)"}}):null,m.slice(1).map((a,g)=>{let u=[...d].reverse().find(ne=>ne.seq===a);if(!u)return null;let P=b===0?0:(g+1)/b*100;return(0,o.jsx)("span",{"data-graview-tick":a,"data-maker":u.maker,...u.declaration?{"data-declaration":""}:{},title:`${E[u.maker]}: ${u.said}`,style:{position:"absolute",left:`calc(${P}% - 1px)`,bottom:0,width:u.declaration?4:2,height:u.declaration?22:12,borderRadius:2,background:u.declaration?"var(--graview-ink)":Z[u.maker],opacity:a<=y?1:.45}},`${a}:${u.batch??"declaration"}`)})]}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:b,step:1,value:w,"aria-valuetext":v?`As of ${v}. ${$}`:`Now. ${$}`,onChange:a=>{A(!1),t.show(m[Number(a.currentTarget.value)]??s)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,o.jsx)("button",{type:"button","data-testid":"play","aria-pressed":k,onClick:()=>{!k&&w>=b&&t.show(m[0]),A(!k)},style:{minHeight:28,minWidth:64},children:k?"Pause":"Play"}),(0,o.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,o.jsx)("select",{"data-testid":"speed",value:T,onChange:a=>ee(Number(a.currentTarget.value)),style:{minHeight:28},children:ie.map(a=>(0,o.jsxs)("option",{value:a,children:[a,"\xD7"]},a))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(E).filter(a=>d.some(g=>g.maker===a)).map(a=>(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:Z[a]}}),E[a]]},a))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[z?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{W(null);try{e.undo([...z],{author:i,intent:v?`Restore to ${v}`:"Restore"}),t.show(null)}catch(a){W(a instanceof Error?a.message:String(a))}},style:{minHeight:28},children:"Restore to here"}):null,(0,o.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),C?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:C}):null,f?.refused?(0,o.jsx)("span",{role:"alert","data-testid":"archive-refused",style:{color:"var(--graview-warn)"},children:f.refused}):null,x?(0,o.jsxs)("span",{"data-testid":"timeline-kept",style:{color:"var(--graview-ink-faint)"},children:[x.sentence,x.action?(0,o.jsxs)(o.Fragment,{children:[" ",(0,o.jsx)("a",{"data-testid":"timeline-kept-action",href:x.action.href,style:{color:"var(--graview-ink-muted)"},children:x.action.label})]}):null]}):null,l>0&&!h?(0,o.jsx)("span",{"data-testid":"timeline-horizon",style:{color:"var(--graview-ink-faint)"},children:"The changes before the timeline's start were archived."}):null]})}export{we as Timeline};
@@ -1 +1 @@
1
- import{G as h}from"./chunk.HT2BEOEV.js";import{Hc as m,qd as u,vc as a}from"./chunk.7BBGRTXM.js";import{b as l}from"./chunk.AJZBJBMO.js";function f(e){let t=[e?.typography?.body,e?.typography?.display,e?.typography?.mono],o=[];for(let i of t){let n=i?.split(",")[0]?.trim().replace(/^["']|["']$/g,"");!n||m(n)||n.toLowerCase()!==a.toLowerCase()&&(o.includes(n)||o.push(n))}return o}function g(e){let t=f(e);return t.length===0?null:`https://fonts.googleapis.com/css2?${t.map(i=>`family=${encodeURIComponent(i).replace(/%20/g,"+")}:wght@400;500;600;700`).join("&")}&display=swap`}var r=l(h(),1);function k(e,t){return new u({schema:e.schema,mutations:e.mutations??[],invariants:e.invariants??[],...t?{snapshot:t}:{},...e.policy?{policy:e.policy}:{},...e.publishing?{publishing:e.publishing}:{},...e.intelligence?{intelligence:e.intelligence}:{},...e.brand?.timeZone?{timeZone:e.brand.timeZone}:{}})}function d(e){if(typeof document>"u")return e==="dark"?"dark":"light";let t=document.documentElement.dataset.theme;return t==="dark"||t==="light"?t:e==="dark"||e==="light"?e:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function v(e,t){let[o,i]=(0,r.useState)(()=>d(t));return(0,r.useEffect)(()=>{if(!e||typeof document>"u")return;let n=()=>i(d(t));n();let s=new MutationObserver(n);s.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let c=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;return c?.addEventListener?.("change",n),()=>{s.disconnect(),c?.removeEventListener?.("change",n)}},[e,t]),o}export{g as a,k as b,v as c};
1
+ import{G as h}from"./chunk.VNJKGSGZ.js";import{Hc as m,sd as u,vc as a}from"./chunk.X3MMJ3QC.js";import{b as l}from"./chunk.AJZBJBMO.js";function f(e){let t=[e?.typography?.body,e?.typography?.display,e?.typography?.mono],o=[];for(let i of t){let n=i?.split(",")[0]?.trim().replace(/^["']|["']$/g,"");!n||m(n)||n.toLowerCase()!==a.toLowerCase()&&(o.includes(n)||o.push(n))}return o}function g(e){let t=f(e);return t.length===0?null:`https://fonts.googleapis.com/css2?${t.map(i=>`family=${encodeURIComponent(i).replace(/%20/g,"+")}:wght@400;500;600;700`).join("&")}&display=swap`}var r=l(h(),1);function k(e,t){return new u({schema:e.schema,mutations:e.mutations??[],invariants:e.invariants??[],...t?{snapshot:t}:{},...e.policy?{policy:e.policy}:{},...e.publishing?{publishing:e.publishing}:{},...e.intelligence?{intelligence:e.intelligence}:{},...e.brand?.timeZone?{timeZone:e.brand.timeZone}:{}})}function d(e){if(typeof document>"u")return e==="dark"?"dark":"light";let t=document.documentElement.dataset.theme;return t==="dark"||t==="light"?t:e==="dark"||e==="light"?e:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function v(e,t){let[o,i]=(0,r.useState)(()=>d(t));return(0,r.useEffect)(()=>{if(!e||typeof document>"u")return;let n=()=>i(d(t));n();let s=new MutationObserver(n);s.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let c=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;return c?.addEventListener?.("change",n),()=>{s.disconnect(),c?.removeEventListener?.("change",n)}},[e,t]),o}export{g as a,k as b,v as c};
@@ -1 +1 @@
1
- import{h,i as E}from"./chunk.EQTSV7BK.js";import{a as M,f as z}from"./chunk.27CW6SCT.js";import{$b as q,Aa as j,C as y,Ha as O,Qb as N,Sa as P,Ta as D,Xc as K,Yc as k,Zb as T,_b as Z,ac as v,da as S,db as L,tb as V,ub as I,vb as g,xa as R}from"./chunk.7BBGRTXM.js";var J=n=>n.safeParse?.(void 0).success??!1,C=n=>h(n).shape,A=n=>{let r=h(n);if(y(r)?.type!=="literal")return;let o=y(r)?.values;return o&&o.length===1&&typeof o[0]=="string"?o[0]:void 0};function F(n,r){let o=J(r),e=h(r),t=y(e)?.type,c=N(r);if(c)return{control:"node",name:n,optional:o,kinds:c};let m=O(r);if(m)return{control:"linked",name:n,optional:o,relation:m};if(D(r)){let d=P(n);return{control:"repeat",name:n,optional:o,...d?{of:d}:{}}}if(t==="boolean")return{control:"boolean",name:n,optional:o};let f=R(e);if(f)return{control:"file",name:n,optional:o,...f==="image"?{image:!0}:f==="video"?{video:!0}:{}};if(t==="object"){let d=e.shape??{};return{control:"group",name:n,optional:o,fields:Object.entries(d).map(([a,l])=>F(a,l))}}if(t==="union"){let d=y(e)?.options??[],a=d.map(s=>C(s));if(a.every(s=>s!==void 0)){let s=Object.keys(a[0]??{}).find(u=>a.every(p=>A(p?.[u])!==void 0));if(s)return{control:"variant",name:n,optional:o,tag:s,options:d.map((u,p)=>({value:A(a[p]?.[s])??"",fields:Object.entries(a[p]??{}).filter(([w])=>w!==s).map(([w,B])=>F(w,B))}))}}let l=d.map(s=>A(s));return l.every(s=>s!==void 0)?{control:"choice",name:n,optional:o,options:l}:{control:"opaque",name:n,optional:o}}if(t==="array"){let d=y(e)?.element;return d!==void 0?{control:"list",name:n,optional:o,item:F(n,d)}:{control:"opaque",name:n,optional:o}}let i=E(r);return i.type==="text"?{control:"text",name:n,optional:o,...i.long?{long:!0}:{},...j(e)?{app:!0}:{},...M(e)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:o,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:o,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{},...i.partial?{partial:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:o,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:o,options:i.options}:{control:"opaque",name:n,optional:o}}function H(n){let r=n.shape;return r?Object.entries(r).map(([o,e])=>F(o,e)):[]}function W(n,r){let o={...r};for(let e of n){let t=r[e.name];t===void 0&&!e.optional&&(e.control==="list"||e.control==="boolean")&&(o[e.name]=e.control==="list"?[]:!1),e.control==="text"&&e.holds&&typeof t=="string"&&(o[e.name]=t.trim()===""?void 0:e.holds==="duration"?z(t)??t:t.trim()),e.control==="group"&&t!==void 0&&typeof t=="object"&&t!==null&&(o[e.name]=W(e.fields,t))}return o}function G(n,r){return Z(H(r.input),T(n,r))}var x="visitor";function gn(n,r,o,e){let t=K.keptFrom?.(n,r),c=new Set;if(!t)return c;let m=Object.keys(o.input.shape??{});for(let a of o.creates??[]){let l=t({id:"\0new",kind:a});for(let s of m)l?.(s)&&c.add(s)}let f=e===void 0?void 0:n.graph.getNode(e),i=f&&n.schema.tryDefinition(f.kind),d=f&&t(f);if(i&&d)for(let a of v(o,i))d(a)&&m.includes(a)&&c.add(a);return c}function _(n,r,o,e){let t=new Set,c=r?.sees??[];if(I(o)||!c.some(k))return t;let m=V(o),f=(l,s)=>{let u=c.filter(p=>p.kinds.includes(l)&&g(p,m));return u.some(k)?L.has(s)||u.some(p=>!k(p)||(p.fields===void 0||p.fields.includes(s))&&!p.hide?.includes(s)):!0},i=Object.keys(e.input.shape??{}),d=new Map,a=(l,s)=>d.set(l,d.get(l)===!0||s);for(let l of e.creates??[]){let s=Object.keys(n.tryDefinition(l)?.fields.shape??{});for(let u of i)s.includes(u)&&a(u,f(l,u))}for(let l of q(n,e)){let s=n.tryDefinition(l);if(s)for(let u of v(e,s))i.includes(u)&&a(u,f(l,u))}for(let[l,s]of d)s||t.add(l);return t}var $=(n,r)=>r.title??S(n);function Q(n,r,o){let e=n?.sees;return!e||e.length===0?!0:e.some(t=>t.kinds.includes(o)&&g(t,r)&&!t.own&&!t.via)}function b(n){switch(n.control){case"node":return[n];case"group":return n.fields.flatMap(b);case"variant":return n.options.flatMap(r=>r.fields.flatMap(b));case"list":return b(n.item);default:return[]}}function U(n,r,o,e){return e.has(o.name)?!1:b(o).every(t=>t.kinds.some(c=>c!=="*"&&Q(n,r,c)))}var X=n=>({kind:"human",id:"form:",roles:[n]});function vn(n,r,o=n.mutations??[]){let e=n.forms?.[r];if(!e)return;let t=o.find(a=>a.name===e.act);if(!t)return;let c=e.role??x,m=X(c),f=_(n.schema,n.policy,m,t),i=G(n.schema,t),d=e.fields?e.fields.flatMap(a=>i.find(l=>l.name===a)??[]):i.filter(a=>U(n.policy,m,a,f));return{name:r,title:$(r,e),...e.intro?{intro:e.intro}:{},...e.say?{say:e.say}:{},submit:e.submit??t.title??S(t.name),role:c,act:t,fields:d}}function An(n,r,o){let e=n.forms?.[r];if(!e)throw new Error(`There is no form called "${r}"${n.forms?`: the forms are ${Object.keys(n.forms).join(", ")}`:": the app declares none"}.`);return{kind:"visitor",id:o,name:`a visitor via the ${$(r,e)} form`,roles:[e.role??x]}}function xn(n){return{said:"Received \u2014 thank you.",...n.say?{next:n.say}:{}}}export{H as a,W as b,G as c,gn as d,_ as e,vn as f,An as g,xn as h};
1
+ import{h,i as E}from"./chunk.SZG6HJWH.js";import{a as M,f as z}from"./chunk.2FOIJ5ID.js";import{$b as q,Aa as j,C as y,Ha as O,Qb as N,Sa as P,Ta as D,Yc as K,Zb as T,Zc as k,_b as Z,ac as v,da as S,db as L,rb as V,sb as I,tb as g,xa as R}from"./chunk.X3MMJ3QC.js";var J=n=>n.safeParse?.(void 0).success??!1,C=n=>h(n).shape,A=n=>{let r=h(n);if(y(r)?.type!=="literal")return;let o=y(r)?.values;return o&&o.length===1&&typeof o[0]=="string"?o[0]:void 0};function F(n,r){let o=J(r),e=h(r),t=y(e)?.type,c=N(r);if(c)return{control:"node",name:n,optional:o,kinds:c};let m=O(r);if(m)return{control:"linked",name:n,optional:o,relation:m};if(D(r)){let d=P(n);return{control:"repeat",name:n,optional:o,...d?{of:d}:{}}}if(t==="boolean")return{control:"boolean",name:n,optional:o};let f=R(e);if(f)return{control:"file",name:n,optional:o,...f==="image"?{image:!0}:f==="video"?{video:!0}:{}};if(t==="object"){let d=e.shape??{};return{control:"group",name:n,optional:o,fields:Object.entries(d).map(([a,l])=>F(a,l))}}if(t==="union"){let d=y(e)?.options??[],a=d.map(s=>C(s));if(a.every(s=>s!==void 0)){let s=Object.keys(a[0]??{}).find(u=>a.every(p=>A(p?.[u])!==void 0));if(s)return{control:"variant",name:n,optional:o,tag:s,options:d.map((u,p)=>({value:A(a[p]?.[s])??"",fields:Object.entries(a[p]??{}).filter(([w])=>w!==s).map(([w,B])=>F(w,B))}))}}let l=d.map(s=>A(s));return l.every(s=>s!==void 0)?{control:"choice",name:n,optional:o,options:l}:{control:"opaque",name:n,optional:o}}if(t==="array"){let d=y(e)?.element;return d!==void 0?{control:"list",name:n,optional:o,item:F(n,d)}:{control:"opaque",name:n,optional:o}}let i=E(r);return i.type==="text"?{control:"text",name:n,optional:o,...i.long?{long:!0}:{},...j(e)?{app:!0}:{},...M(e)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:o,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:o,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{},...i.partial?{partial:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:o,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:o,options:i.options}:{control:"opaque",name:n,optional:o}}function H(n){let r=n.shape;return r?Object.entries(r).map(([o,e])=>F(o,e)):[]}function W(n,r){let o={...r};for(let e of n){let t=r[e.name];t===void 0&&!e.optional&&(e.control==="list"||e.control==="boolean")&&(o[e.name]=e.control==="list"?[]:!1),e.control==="text"&&e.holds&&typeof t=="string"&&(o[e.name]=t.trim()===""?void 0:e.holds==="duration"?z(t)??t:t.trim()),e.control==="group"&&t!==void 0&&typeof t=="object"&&t!==null&&(o[e.name]=W(e.fields,t))}return o}function G(n,r){return Z(H(r.input),T(n,r))}var x="visitor";function gn(n,r,o,e){let t=K.keptFrom?.(n,r),c=new Set;if(!t)return c;let m=Object.keys(o.input.shape??{});for(let a of o.creates??[]){let l=t({id:"\0new",kind:a});for(let s of m)l?.(s)&&c.add(s)}let f=e===void 0?void 0:n.graph.getNode(e),i=f&&n.schema.tryDefinition(f.kind),d=f&&t(f);if(i&&d)for(let a of v(o,i))d(a)&&m.includes(a)&&c.add(a);return c}function _(n,r,o,e){let t=new Set,c=r?.sees??[];if(I(o)||!c.some(k))return t;let m=V(o),f=(l,s)=>{let u=c.filter(p=>p.kinds.includes(l)&&g(p,m));return u.some(k)?L.has(s)||u.some(p=>!k(p)||(p.fields===void 0||p.fields.includes(s))&&!p.hide?.includes(s)):!0},i=Object.keys(e.input.shape??{}),d=new Map,a=(l,s)=>d.set(l,d.get(l)===!0||s);for(let l of e.creates??[]){let s=Object.keys(n.tryDefinition(l)?.fields.shape??{});for(let u of i)s.includes(u)&&a(u,f(l,u))}for(let l of q(n,e)){let s=n.tryDefinition(l);if(s)for(let u of v(e,s))i.includes(u)&&a(u,f(l,u))}for(let[l,s]of d)s||t.add(l);return t}var $=(n,r)=>r.title??S(n);function Q(n,r,o){let e=n?.sees;return!e||e.length===0?!0:e.some(t=>t.kinds.includes(o)&&g(t,r)&&!t.own&&!t.via)}function b(n){switch(n.control){case"node":return[n];case"group":return n.fields.flatMap(b);case"variant":return n.options.flatMap(r=>r.fields.flatMap(b));case"list":return b(n.item);default:return[]}}function U(n,r,o,e){return e.has(o.name)?!1:b(o).every(t=>t.kinds.some(c=>c!=="*"&&Q(n,r,c)))}var X=n=>({kind:"human",id:"form:",roles:[n]});function vn(n,r,o=n.mutations??[]){let e=n.forms?.[r];if(!e)return;let t=o.find(a=>a.name===e.act);if(!t)return;let c=e.role??x,m=X(c),f=_(n.schema,n.policy,m,t),i=G(n.schema,t),d=e.fields?e.fields.flatMap(a=>i.find(l=>l.name===a)??[]):i.filter(a=>U(n.policy,m,a,f));return{name:r,title:$(r,e),...e.intro?{intro:e.intro}:{},...e.say?{say:e.say}:{},submit:e.submit??t.title??S(t.name),role:c,act:t,fields:d}}function An(n,r,o){let e=n.forms?.[r];if(!e)throw new Error(`There is no form called "${r}"${n.forms?`: the forms are ${Object.keys(n.forms).join(", ")}`:": the app declares none"}.`);return{kind:"visitor",id:o,name:`a visitor via the ${$(r,e)} form`,roles:[e.role??x]}}function xn(n){return{said:"Received \u2014 thank you.",...n.say?{next:n.say}:{}}}export{H as a,W as b,G as c,gn as d,_ as e,vn as f,An as g,xn as h};
@@ -0,0 +1 @@
1
+ import{b as f}from"./chunk.MOAUE3N2.js";import"./chunk.KKQXGN5U.js";import"./chunk.G7HIAUEA.js";import"./chunk.GQHFLOTZ.js";import{l as g}from"./chunk.2XTCDFWU.js";import"./chunk.Q355UPFG.js";import"./chunk.PXQVXBNG.js";import"./chunk.XOTES3PI.js";import"./chunk.WGTBQHHE.js";import"./chunk.HF5SNUTK.js";import"./chunk.S7ZLGODY.js";import"./chunk.2QESVWUW.js";import"./chunk.UM5H2VVR.js";import"./chunk.WEGPDJTB.js";import"./chunk.MRYN42EQ.js";import"./chunk.E22DDEQI.js";import"./chunk.OLW44AP5.js";import"./chunk.F6P3WSMW.js";import"./chunk.YMRVKG6W.js";import"./chunk.BDBLGGFJ.js";import"./chunk.D3AISGQH.js";import"./chunk.IZ2ZTNEV.js";import"./chunk.6E36I2GC.js";import"./chunk.CJUIJ6TL.js";import"./chunk.IIESMHXY.js";import"./chunk.BJUUSIQY.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.XOZU4OFA.js";import"./chunk.MHILFBK6.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.Q6LLURRM.js";import"./chunk.AXXYJCSW.js";import"./chunk.N4LOI3YA.js";import"./chunk.RKZ4J3H2.js";import"./chunk.HKINU7VO.js";import"./chunk.YGZCESXY.js";import"./chunk.GZHZLJBF.js";import"./chunk.KHZA5F7A.js";import"./chunk.OJGHDWI6.js";import"./chunk.KSVJHSRH.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as b,T as h}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{Xd as n}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var m=t(b(),1),a=t(h(),1);function P({store:c,auto:y,brand:i,views:u,presence:s,steering:r,overview:o,scope:d,titleLevel:w=2,quickAsk:l,props:e}){let v=(0,m.useMemo)(()=>g({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:y?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:v}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(f,{context:{store:c,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...o?{overview:o}:{},titleLevel:w,views:u,settings:e.app.settings??[],app:e.app,...s?{presence:s}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.timeZone?{timeZone:e.timeZone}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},dismissals:e.dismissals,whileAway:e.whileAway,...e.signIn?{signIn:e.signIn}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...r?{steering:r}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.hrefOf?{hrefOf:e.hrefOf}:e.routing==="address"?{}:{hrefOf:!1},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{P as PagesContent};