graview 0.1.62 → 0.1.63

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 (197) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +1 -1
  4. package/dist/preview/{chunk.THVC2BEC.js → chunk.24HNOLUS.js} +1 -1
  5. package/dist/preview/chunk.25CQCCLN.js +1 -0
  6. package/dist/preview/{chunk.YP2QSPXU.js → chunk.26H33GJC.js} +1 -1
  7. package/dist/preview/{chunk.DPEIT3TW.js → chunk.2F4AZZQR.js} +1 -1
  8. package/dist/preview/chunk.2KIWGQXC.js +2 -0
  9. package/dist/preview/{chunk.UQQKDBIH.js → chunk.2PJ6STKA.js} +1 -1
  10. package/dist/preview/{chunk.ELTV44HU.js → chunk.2RASWDMQ.js} +2 -2
  11. package/dist/preview/chunk.33XNYHI6.js +1 -0
  12. package/dist/preview/{chunk.TIALD6SC.js → chunk.34DRUCH2.js} +1 -1
  13. package/dist/preview/{chunk.MDEX6ZVE.js → chunk.36OE6RKG.js} +1 -1
  14. package/dist/preview/{chunk.A3OL2BI2.js → chunk.37FLKAVZ.js} +1 -1
  15. package/dist/preview/chunk.3JCHJLH6.js +1 -0
  16. package/dist/preview/chunk.3OQ6S6H4.js +1 -0
  17. package/dist/preview/chunk.47QEWSSE.js +1 -0
  18. package/dist/preview/{chunk.7M4HNKDR.js → chunk.4DAKQXDG.js} +1 -1
  19. package/dist/preview/{chunk.QIPASE42.js → chunk.4EXC26LI.js} +1 -1
  20. package/dist/preview/{chunk.VJBBVLGZ.js → chunk.4MEQUUG4.js} +1 -1
  21. package/dist/preview/{chunk.Y2YYH3JN.js → chunk.4TH3CGAZ.js} +1 -1
  22. package/dist/preview/{chunk.PZQNR4KZ.js → chunk.57YDGGJK.js} +1 -1
  23. package/dist/preview/{chunk.O75HWF3F.js → chunk.5GC4VAHU.js} +1 -1
  24. package/dist/preview/{chunk.WEOVK2T4.js → chunk.5QXQ7PBI.js} +1 -1
  25. package/dist/preview/chunk.6CSHRMJC.js +1 -0
  26. package/dist/preview/chunk.6HKWAHPT.js +1 -0
  27. package/dist/preview/{chunk.TM4EPUNO.js → chunk.6XHPBJ5F.js} +1 -1
  28. package/dist/preview/chunk.6YK5E7ZQ.js +4 -0
  29. package/dist/preview/{chunk.LGRLVJGS.js → chunk.6Z2GHQQH.js} +3 -3
  30. package/dist/preview/chunk.72YXFJKC.js +2 -0
  31. package/dist/preview/{chunk.T3UQ7ZQK.js → chunk.735AFUP5.js} +1 -1
  32. package/dist/preview/chunk.75GENXGP.js +1 -0
  33. package/dist/preview/{chunk.KMV6PJFL.js → chunk.A2R53GWF.js} +1 -1
  34. package/dist/preview/{chunk.OWT3VVOT.js → chunk.AHPYNDVA.js} +2 -2
  35. package/dist/preview/chunk.ATDIDPKZ.js +1 -0
  36. package/dist/preview/{chunk.F7YXLYLX.js → chunk.AW26EETU.js} +1 -1
  37. package/dist/preview/{chunk.I77ZGIFE.js → chunk.AWUO3M5D.js} +1 -1
  38. package/dist/preview/{chunk.AQRB7LDA.js → chunk.B46UZHGW.js} +1 -1
  39. package/dist/preview/{chunk.A3ZC2JBO.js → chunk.B5PJCYBU.js} +1 -1
  40. package/dist/preview/{chunk.VACKSKGJ.js → chunk.BF3EZCG3.js} +1 -1
  41. package/dist/preview/chunk.BKQICGFW.js +1 -0
  42. package/dist/preview/{chunk.DDUCIUVW.js → chunk.BN7C5ZYX.js} +1 -1
  43. package/dist/preview/chunk.BQM3YAMR.js +35 -0
  44. package/dist/preview/chunk.C65EHQ7V.js +1 -0
  45. package/dist/preview/{chunk.B23WZQXQ.js → chunk.CAXILB7K.js} +1 -1
  46. package/dist/preview/{chunk.UVA7AALY.js → chunk.CCQMDZHO.js} +1 -1
  47. package/dist/preview/{chunk.G4ULQK64.js → chunk.CGK2PY76.js} +1 -1
  48. package/dist/preview/{chunk.DEAP3H2L.js → chunk.CI4RZL4Z.js} +1 -1
  49. package/dist/preview/chunk.CYTTZOYL.js +25 -0
  50. package/dist/preview/chunk.D5LOTCBU.js +3 -0
  51. package/dist/preview/chunk.DBFJVVWF.js +1 -0
  52. package/dist/preview/{chunk.7XLS6XTY.js → chunk.DDFRFSVN.js} +1 -1
  53. package/dist/preview/{chunk.GX4G4BX3.js → chunk.DIFIHNR3.js} +1 -1
  54. package/dist/preview/{chunk.VN23AGIY.js → chunk.DWK3GXRR.js} +1 -1
  55. package/dist/preview/{chunk.ZN3PUM2I.js → chunk.DZSZUX34.js} +1 -1
  56. package/dist/preview/chunk.E3XJMO7Q.js +1 -0
  57. package/dist/preview/chunk.EJ2WE764.js +18 -0
  58. package/dist/preview/{chunk.22BZU7ME.js → chunk.EJ4MSVX2.js} +1 -1
  59. package/dist/preview/chunk.ERPILTRY.js +1 -0
  60. package/dist/preview/{chunk.DC35FJAB.js → chunk.FFXBDOKA.js} +1 -1
  61. package/dist/preview/{chunk.UXMPFPFH.js → chunk.FGDGTES4.js} +2 -2
  62. package/dist/preview/chunk.FNVGNISQ.js +3 -0
  63. package/dist/preview/{chunk.ROZTJ6IY.js → chunk.FXCQJPN4.js} +1 -1
  64. package/dist/preview/chunk.G2JAYG2Z.js +1 -0
  65. package/dist/preview/{chunk.UFDJXQQQ.js → chunk.GHN62OMG.js} +6 -6
  66. package/dist/preview/{chunk.5ODHHH35.js → chunk.H5SN46VK.js} +1 -1
  67. package/dist/preview/{chunk.W4BKYSZX.js → chunk.H7AH3IW4.js} +1 -1
  68. package/dist/preview/{chunk.6JO5HQDR.js → chunk.HMMK7LCL.js} +1 -1
  69. package/dist/preview/{chunk.SVPKUWZU.js → chunk.HOFATBGD.js} +1 -1
  70. package/dist/preview/{chunk.JT3MFPRD.js → chunk.HRNNRA2I.js} +1 -1
  71. package/dist/preview/{chunk.7KVUUEZA.js → chunk.HSMJHCR3.js} +1 -1
  72. package/dist/preview/{chunk.RPDH32XV.js → chunk.IEDCFSN5.js} +1 -1
  73. package/dist/preview/{chunk.PCDUV3WP.js → chunk.JIEDJEHK.js} +1 -1
  74. package/dist/preview/chunk.JNIDS66Z.js +1 -0
  75. package/dist/preview/{chunk.DDO3GLEJ.js → chunk.JO3BBRSR.js} +1 -1
  76. package/dist/preview/{chunk.H5S7OL2U.js → chunk.JVDPRQ7J.js} +1 -1
  77. package/dist/preview/{chunk.SEHRPTNA.js → chunk.K7TK3KRB.js} +1 -1
  78. package/dist/preview/{chunk.ELOFPE25.js → chunk.KB5BCW23.js} +1 -1
  79. package/dist/preview/{chunk.6AKW7TXM.js → chunk.KL5H7KEV.js} +1 -1
  80. package/dist/preview/{chunk.ILIIBSGA.js → chunk.KPQLM4TM.js} +1 -1
  81. package/dist/preview/{chunk.2N4Z5K5S.js → chunk.KQPKYWDM.js} +1 -1
  82. package/dist/preview/{chunk.QHY5NVYH.js → chunk.KXFNRJ46.js} +1 -1
  83. package/dist/preview/chunk.KZUMXT5J.js +74 -0
  84. package/dist/preview/chunk.MAHNJO6U.js +1 -0
  85. package/dist/preview/{chunk.AJSUHPBE.js → chunk.MBB5A6BT.js} +1 -1
  86. package/dist/preview/chunk.MENLUNM5.js +1 -0
  87. package/dist/preview/{chunk.PLTH2LW5.js → chunk.MIE3ODQ2.js} +1 -1
  88. package/dist/preview/{chunk.QDWSU47A.js → chunk.MT5DXJKN.js} +1 -1
  89. package/dist/preview/{chunk.AFNSAQEQ.js → chunk.MY5HJW2Z.js} +1 -1
  90. package/dist/preview/{chunk.5HGD6OWL.js → chunk.N3T2O6EW.js} +2 -2
  91. package/dist/preview/{chunk.66P5IDTH.js → chunk.NEPQBMFT.js} +1 -1
  92. package/dist/preview/{chunk.NOGGSLVG.js → chunk.NIAM7OTV.js} +1 -1
  93. package/dist/preview/{chunk.BZMQDEIY.js → chunk.NTC2H5ZX.js} +1 -1
  94. package/dist/preview/chunk.NWWJNNEK.js +2 -0
  95. package/dist/preview/{chunk.5J3O2FVG.js → chunk.O3YIWIVQ.js} +1 -1
  96. package/dist/preview/chunk.O67JXUVG.js +1 -0
  97. package/dist/preview/{chunk.4HEFUOLV.js → chunk.OIMGD7FR.js} +1 -1
  98. package/dist/preview/{chunk.DD2NKFDX.js → chunk.OM2NIQWA.js} +1 -1
  99. package/dist/preview/chunk.OMRQTLI5.js +1 -0
  100. package/dist/preview/{chunk.O2BHPYA4.js → chunk.OTSBF367.js} +2 -2
  101. package/dist/preview/{chunk.Y4FZKUOK.js → chunk.OXWOUE3W.js} +1 -1
  102. package/dist/preview/{chunk.2B6P4GPS.js → chunk.PDMX3GTL.js} +1 -1
  103. package/dist/preview/{chunk.75GVFX7L.js → chunk.PDS4HT46.js} +1 -1
  104. package/dist/preview/{chunk.EVBCEEQ4.js → chunk.PWAP2GJS.js} +1 -1
  105. package/dist/preview/chunk.Q2EGESEZ.js +1 -0
  106. package/dist/preview/{chunk.L3WTKQQL.js → chunk.Q4GJIJAU.js} +1 -1
  107. package/dist/preview/chunk.Q4MI53KK.js +5 -0
  108. package/dist/preview/{chunk.SWMDFXUX.js → chunk.QAMW5QDT.js} +1 -1
  109. package/dist/preview/{chunk.M4AYA2PL.js → chunk.QS32TO4N.js} +1 -1
  110. package/dist/preview/{chunk.BLUKSGI4.js → chunk.QSPLKCTX.js} +1 -1
  111. package/dist/preview/{chunk.WPXPVD33.js → chunk.R4HDKNT3.js} +1 -1
  112. package/dist/preview/chunk.REUMBCSV.js +1 -0
  113. package/dist/preview/{chunk.MAKODQO3.js → chunk.RUFYORIJ.js} +1 -1
  114. package/dist/preview/{chunk.5YAOKOGV.js → chunk.SGPXYDSG.js} +1 -1
  115. package/dist/preview/chunk.SJUXFPTI.js +1 -0
  116. package/dist/preview/{chunk.OUDATENL.js → chunk.SME4HD5I.js} +1 -1
  117. package/dist/preview/{chunk.2GEJNG2U.js → chunk.SMHP2CQH.js} +1 -1
  118. package/dist/preview/chunk.SSAETRHR.js +5 -0
  119. package/dist/preview/{chunk.MYNMBOLD.js → chunk.STDJ6XG5.js} +1 -1
  120. package/dist/preview/{chunk.IQ3PRWGO.js → chunk.T3JIZNE7.js} +2 -2
  121. package/dist/preview/chunk.T535ZLRM.js +1 -0
  122. package/dist/preview/{chunk.QGU5QTR6.js → chunk.UAVK54Z6.js} +1 -1
  123. package/dist/preview/{chunk.RD2X25XB.js → chunk.V4HVFLFQ.js} +1 -1
  124. package/dist/preview/chunk.V6IL7CIZ.js +1 -0
  125. package/dist/preview/{chunk.T6WHGKWR.js → chunk.VCTAFSZ5.js} +1 -1
  126. package/dist/preview/{chunk.OWOOKLIU.js → chunk.VZDHRY3U.js} +1 -1
  127. package/dist/preview/{chunk.X6KYRBL6.js → chunk.WBS7ND2C.js} +1 -1
  128. package/dist/preview/chunk.WNS5LEO5.js +1 -0
  129. package/dist/preview/chunk.WUVXIUA7.js +1 -0
  130. package/dist/preview/{chunk.Z2TDZSMN.js → chunk.WYPCLZL7.js} +1 -1
  131. package/dist/preview/{chunk.IQMD7DG3.js → chunk.XBYJCGPU.js} +1 -1
  132. package/dist/preview/{chunk.CHHYIMB7.js → chunk.XCEZCOX4.js} +1 -1
  133. package/dist/preview/{chunk.CY3ELWCM.js → chunk.XCWZFLIB.js} +1 -1
  134. package/dist/preview/chunk.XIW4SZHD.js +1 -0
  135. package/dist/preview/{chunk.FULEUL34.js → chunk.XUO67YMT.js} +1 -1
  136. package/dist/preview/{chunk.RYRQ66JN.js → chunk.XUXZW7DU.js} +1 -1
  137. package/dist/preview/chunk.XYGNS637.js +1 -0
  138. package/dist/preview/{chunk.H7N7WN4U.js → chunk.Y4ZM75WL.js} +1 -1
  139. package/dist/preview/{chunk.5STU3KYG.js → chunk.YOUB3J3Y.js} +1 -1
  140. package/dist/preview/{chunk.3FON2Y72.js → chunk.YXAKHXYB.js} +1 -1
  141. package/dist/preview/chunk.YZBJUAS6.js +1 -0
  142. package/dist/preview/{chunk.7V56P2A7.js → chunk.Z2ZQJ3DD.js} +1 -1
  143. package/dist/preview/{chunk.OFWNMTGB.js → chunk.ZELWW7UA.js} +2 -2
  144. package/dist/preview/{chunk.N6EJXXQK.js → chunk.ZLTHWCKL.js} +2 -2
  145. package/dist/preview/chunk.ZP7JEVVU.js +1 -0
  146. package/dist/preview/{chunk.NUWDMH47.js → chunk.ZRH5X3MR.js} +1 -1
  147. package/dist/preview/{chunk.DNVWSWL2.js → chunk.ZSGDVNVN.js} +1 -1
  148. package/dist/preview/chunk.ZVG4FXJK.js +1 -0
  149. package/dist/preview/chunk.ZY7US4Y7.js +6 -0
  150. package/dist/preview/{chunk.4TX6VCBT.js → chunk.ZZAI57VI.js} +1 -1
  151. package/dist/preview/index.html +53 -52
  152. package/dist/preview/page.js +2 -2
  153. package/dist/preview/splash.js +7 -6
  154. package/package.json +6 -6
  155. package/dist/preview/chunk.2AT3GRXM.js +0 -1
  156. package/dist/preview/chunk.4HRYB7HF.js +0 -1
  157. package/dist/preview/chunk.5MZYCELA.js +0 -6
  158. package/dist/preview/chunk.7OBIBPYH.js +0 -1
  159. package/dist/preview/chunk.7YOAW7ED.js +0 -1
  160. package/dist/preview/chunk.ACTXR2MI.js +0 -3
  161. package/dist/preview/chunk.AI34V6WV.js +0 -74
  162. package/dist/preview/chunk.CAKFNKN5.js +0 -1
  163. package/dist/preview/chunk.CGALLZ54.js +0 -1
  164. package/dist/preview/chunk.DHJ3FQTR.js +0 -1
  165. package/dist/preview/chunk.DZZL5IDD.js +0 -5
  166. package/dist/preview/chunk.H24OC6OE.js +0 -1
  167. package/dist/preview/chunk.H73ZPYUX.js +0 -1
  168. package/dist/preview/chunk.HANJZ6FA.js +0 -1
  169. package/dist/preview/chunk.HIMQ65QT.js +0 -1
  170. package/dist/preview/chunk.IQPILSV3.js +0 -18
  171. package/dist/preview/chunk.IYBEXENQ.js +0 -1
  172. package/dist/preview/chunk.J7Q2WAF4.js +0 -28
  173. package/dist/preview/chunk.JYFZCJ4N.js +0 -2
  174. package/dist/preview/chunk.KDXU5DT3.js +0 -1
  175. package/dist/preview/chunk.KL7E4YHJ.js +0 -1
  176. package/dist/preview/chunk.LAYQ5PFS.js +0 -1
  177. package/dist/preview/chunk.LTZUF5VG.js +0 -1
  178. package/dist/preview/chunk.M7RESZB6.js +0 -25
  179. package/dist/preview/chunk.MGALQLRW.js +0 -1
  180. package/dist/preview/chunk.NAD7ZXYP.js +0 -1
  181. package/dist/preview/chunk.NHTGAP3G.js +0 -3
  182. package/dist/preview/chunk.NUYA4BWI.js +0 -1
  183. package/dist/preview/chunk.OKZT2QBM.js +0 -2
  184. package/dist/preview/chunk.OUPURRDE.js +0 -1
  185. package/dist/preview/chunk.PD2DECOP.js +0 -1
  186. package/dist/preview/chunk.PKWQKFPE.js +0 -2
  187. package/dist/preview/chunk.RMR24LFJ.js +0 -4
  188. package/dist/preview/chunk.RRKI24WY.js +0 -1
  189. package/dist/preview/chunk.SGCW2XRC.js +0 -1
  190. package/dist/preview/chunk.SS7234R6.js +0 -1
  191. package/dist/preview/chunk.TKUNRFDE.js +0 -1
  192. package/dist/preview/chunk.U6ZRJKVM.js +0 -1
  193. package/dist/preview/chunk.UKQUUPKE.js +0 -1
  194. package/dist/preview/chunk.VC3V7HLL.js +0 -1
  195. package/dist/preview/chunk.VIH5AX7S.js +0 -5
  196. package/dist/preview/chunk.WKI5INH7.js +0 -1
  197. package/dist/preview/chunk.Y4S7CDRB.js +0 -1
@@ -1 +0,0 @@
1
- import{b as yn,c as hn,d as ae,e as kn,f as te,h as je,i as De,n as bn,r as se,t as wn}from"./chunk.NHTGAP3G.js";import{B as be,Ba as xe,C as ue,Ea as Qe,F as _e,H as He,Ha as Xe,Hb as _,Ja as en,K as Ue,Kc as pn,L as We,Mb as sn,Na as Re,Nb as dn,Oa as Se,Pb as cn,Ua as nn,Ub as ln,Wc as un,Xa as tn,Xc as mn,Yc as ze,Zb as fn,Zc as gn,_c as Ee,b as Fe,c as Ne,d as Ce,e as K,g as ye,ga as Oe,h as V,ha as Je,hb as rn,i as Ie,j as Ke,k as he,kb as on,l as Ve,m as Ze,o as qe,p as fe,pb as Ae,q as ve,qa as Ye,qb as an,v as Be,x as pe,z as ke}from"./chunk.DZZL5IDD.js";var vn=new WeakMap;function On(e,d){vn.set(e,d)}function In(e){return vn.get(e)}function xn(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let d=e,n=h=>typeof d[h]=="string"?d[h]:void 0,t=n("light")??n("src");if(t===void 0)return;let[a,p,A]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...a!==void 0?{dark:a}:{},...p!==void 0?{alt:p}:{},...A!==void 0?{darkFallback:A}:{}}}function Wn(e,d){let n=e.brand??{},t=n.ground,a=n.accent?Ee(n.accent,t):void 0;t&&gn(a?.ok?a.schemes:ze(t),n.accent)&&(d.push(De("brand","brand.ground","words would not read on that page background, so the app keeps Graview's","pick a lighter ground for the light scheme, a darker one for the dark")),t=void 0,a=n.accent?Ee(n.accent):void 0),a&&!a.ok&&d.push(De("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${a.why}`,"pick a color further from orange-red, or a darker one"));let p=xn(n.logo),A=n.name??e.name,h=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,w])=>typeof w=="string"&&mn(w)===null).map(([w,L])=>[w,un(L)])):void 0;return{name:A,schemes:a?.ok?a.schemes:t?ze(t):pn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...p?{logo:p.dark||p.darkFallback==="invert"?{light:p.light,...p.dark?{dark:p.dark}:{darkFallback:"invert"}}:p.light,logoAlt:p.alt??A}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...h?{typography:h}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{},...n.views&&(n.views.css||n.views.motion)?{views:{...n.views.css?{css:n.views.css}:{},...n.views.motion?{motion:n.views.motion}:{}}}:{}}}function Rn(e){let{currency:d,locale:n,timeZone:t}=e.brand??{};return{...d?{currency:d}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var Ln=Symbol.for("@graview/core:typed-field"),Sn=(e,d)=>(/^(phone|place|duration)$/.test(d)&&(ue(e)[Ln]=d),e),An=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function zn(e){let d=V().check(K(300),ke(t=>Xe(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?d:fe(d).check(K(200));return en(e.description?n.check(be(e.description)):n,e)}var Pn=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function En(e,d=Pn){if(!Z(e))return{document:e,respelled:[]};let n=[],t=e;for(let a of d)t=$e(t,a.where.split("."),a,"",n);return{document:t,respelled:n}}function $e(e,d,n,t,a){if(d.length===0){if(!Z(e)||!Object.hasOwn(e,n.was))return e;a.push(`${t}${n.was}`);let{[n.was]:J,...j}=e;return Object.hasOwn(e,n.now)?j:{...j,[n.now]:J}}if(!Z(e))return e;let[p,...A]=d,h=p.endsWith("[]"),w=h?p.slice(0,-2):p,L=e[w],re=L;if(!h)re=$e(L,A,n,`${t}${w}.`,a);else if(Array.isArray(L)){let J=L.map((j,oe)=>$e(j,A,n,`${t}${w}.${oe}.`,a));re=J.some((j,oe)=>j!==L[oe])?J:L}return re===L?e:{...e,[w]:re}}var jn="graview-compiled@1";function Gn(e,d){return e.find(([n,t])=>n!==W&&"ref"in t&&(t.ref==="*"||t.ref.includes(d)))?.[0]}var W="id",me=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function Dn(e){let d=Object.entries(e.fields),n=t=>["name","title","label"].find(a=>t.some(([p])=>p===a))??t[0]?.[0];return n(d.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(d.filter(([,t])=>t.type==="string"))}function $n(e,d,n){let t;switch(e.type){case"string":case"place":t=V().check(K(500));break;case"phone":t=V().check(K(40),ye(An,"a phone number"));break;case"text":t=V().check(K(2e4)),e.format&&(ue(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let p=e.min??(e.type==="duration"?0:void 0),A=[...e.type==="number"?[]:[Ve()],...p===void 0?[]:[Ne(p)],...e.max===void 0?[]:[Fe(e.max)],...e.step===void 0?[]:[Ce(e.step)]];t=A.length>0?he().check(...A):he();break}case"boolean":t=Ze();break;case"date":t=V().check(ye(He,"a date like 2026-10-02, or a month (2016-05) or a year (2006) alone"));break;case"datetime":t=V().check(ke(Ue,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Be(e.options),e.multiple&&(t=fe(t).check(K(e.options.length)));break;case"list":t=fe(e.of==="number"?he():e.of==="date"?V().check(ye(_e)):e.of==="image"||e.of==="video"||e.of==="file"?xe(e.of):V().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=xe(e.type);break;case"app-link":t=Qe();break;case"url":t=Ke();break;case"email":t=Ie();break}let a=e.type==="number"||e.type==="integer";return Sn(t,a&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(ue(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(be(e.description))),a&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&ln(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),d?pe(t):t}var ge=e=>{throw new _(`there is no record "${e}"`,"invalid")},Mn=(e,d)=>"field"in e?$n(e.field,e.optional,d):"ref"in e?fn(e.ref):pe(qe()),Fn=new WeakMap;var Le=(e,d)=>Z(d)&&Object.keys(e??{}).length===Object.keys(d).length&&Object.keys(e??{}).every(n=>Object.hasOwn(d,n));function vt(e,d={}){let n=Z(e)?e.format:void 0;if(n!==jn)return{ok:!1,findings:[je("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${jn}`,"compile the document instead")]};let t=e,a=En(t.document).document,p=a===t.document?t:{...t,document:a},A=Z(a)&&typeof a.name=="string"&&Z(a.kinds)&&Le(a.kinds,p.kinds)&&Le(a.acts,p.acts)&&Le(a.rules,p.rules)&&Array.isArray(p.edges)&&Array.isArray(p.findings),h={ok:!1,findings:[je("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!A)return h;try{return Nn(p,d)}catch{return h}}function Nn(e,d={}){let{document:n}=e,t=n.brand?.timeZone,a=d.today??(()=>We(t)),p={...n.brand?.locale?{locale:n.brand.locale}:{},...t?{timeZone:t}:{}},A=new Map(e.edges.map(([k,i])=>[k,i])),h=new Map;for(let[k,i]of Object.entries(n.kinds)){let R=e.kinds[k]?.computed,v=Se(i.edges);h.set(k,{fields:new Set([...Object.keys(i.fields),...v.keys()]),edges:new Map(Object.entries(Re(i.edges)).map(([T,$])=>[T,$.cardinality??"many"])),...R?{computed:new Map(R)}:{},...v.size>0?{linked:v}:{}})}e.facts&&h.set(hn,{computed:new Map(e.facts)});let w=Rn(n),L=new Map,re=Object.entries(n.kinds).map(([k,i])=>{let R={};for(let[r,o]of Object.entries(i.fields))R[r]=$n(o,!o.required,w),o.repeats&&(R[nn(r)]=pe(tn()));for(let[r,o]of Se(i.edges))R[r]=pe(zn(o));let{label:v,describe:T,durations:$}=e.kinds[k]??{},P=Object.entries(i.computed??{}).map(([r,o])=>[r,typeof o=="string"?{expr:o}:o]),Y=Object.hasOwn(i.fields,"label")&&!i.fields.label.label&&!/\{\s*label\b/.test(i.label??`{${Dn(i)??""}}`),Q=Object.fromEntries([...Y?[["label","Label"]]:[],...Object.entries(i.fields).filter(([,r])=>r.label).map(([r,o])=>[r,o.label]),...P.filter(([,r])=>r.label).map(([r,o])=>[r,o.label])]),H=Object.keys(Q).length>0,E=Object.entries(i.fields).filter(([,r])=>r.type==="enum"&&(r.optionLabels&&Object.keys(r.optionLabels).length>0||r.multiple)),l=r=>o=>typeof o=="string"&&r.optionLabels&&Object.hasOwn(r.optionLabels,o)?r.optionLabels[o]:Oe(String(o)),G=Object.fromEntries(E.map(([r,o])=>[r,o.multiple?S=>Array.isArray(S)?S.map(l(o)).join(", "):l(o)(S):l(o)])),F=E.length>0,N=Object.fromEntries(Object.entries(i.fields).filter(([,r])=>r.default!==void 0).map(([r,o])=>[r,o.default]));L.set(k,N);let q=Object.fromEntries(Object.entries(Re(i.edges)).map(([r,{renamedFrom:o,...S}])=>[r,S])),C=Object.entries(i.fields).flatMap(([r,o])=>o.aliases?[[r,o.aliases]]:[]),D=r=>i[r]?{[r]:i[r]}:{};return Je(k,{fields:ve(R),edges:q,...D("plural"),...D("noun"),...D("aliases"),...C.length>0?{fieldAliases:Object.fromEntries(C)}:{},...D("description"),...v?{label:r=>se(v,{node:r,kinds:h,today:a(),money:w})||r.id}:{},...T?{describe:r=>se(T,{node:r,kinds:h,today:a(),money:w})}:{},...D("lifecycle"),...D("figure"),...D("fieldRoles"),...D("people"),archives:i.archives,...i.tidying?{tidying:i.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([r,o])=>[r,Cn(o,$?.includes(r)??!1,w)??i.computed[r]]))}:{},...H||F||i.glance||i.page?{display:{...H?{labels:Q}:{},...F?{format:G}:{},...i.glance?{glance:[...i.glance]}:{},...i.page?{page:i.page}:{}}}:{},...Object.keys(N).length>0?{defaults:N}:{},...e.kinds[k]?.keptInStep?{keptInStep:e.kinds[k].keptInStep}:{}})}),J=rn(re,n.computed);function j(k){return J.tryDefinition(k.kind)?.label?.(k)??k.id}let oe=k=>({id:"",kind:k,...L.get(k)}),Te=[];for(let[k,i]of Object.entries(n.acts??{})){let R=e.acts[k],{title:v,effects:T,guard:$,refusal:P,destructive:Y,idempotent:Q,creates:H,connects:E,severs:l,writes:G,writesOther:F,sets:N}=R,q={};for(let c of T)"through"in c&&(q[c.through]=[...new Set([...q[c.through]??[],...Object.keys(c.set)])]);let C=new Map(R.args),D={};for(let[c,x]of C)D[c]=Mn(x,w);let r=[i.on??[]].flat(),o=new Map(R.exprs),S=T.find(c=>"create"in c),U=(c,x,f,b=null)=>{if(Z(c)&&"expr"in c)return te(o.get(c.expr),{graph:f,subject:b,kinds:h,bindings:x,today:a(),...p});let y=me(c);return y===void 0?typeof c=="string"&&c.startsWith("$$")?c.slice(1):c:y==="now"?new Date().toISOString():y==="today"?a():x[y]},de=(c,x)=>{if(!S)return"";let f=n.kinds[S.create].fields,b=oe(S.create),y=[];for(let[O,ce]of Object.entries(S.set??{})){try{b[O]=U(ce,c,x)??b[O]}catch{}let ie=me(ce);ie&&c[ie]!==void 0&&y.push(O)}let I=j(b).trim(),X=y.filter(O=>b[O]!==!1&&f[O].type!=="text"&&!(/[^]{41}/.test(b[O])||/ .*[.!?]$/.test(b[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(b[O]))&&j({...b,[O]:void 0}).trim()===I).map(O=>b[O]===!0?f[O].label??Oe(O):bn(b[O],f[O].format,a(),[],w));return I&&X.length>0?`${I} (${X.join(", ")})`:I};Te.push(cn(k,{input:ve(D),title:v,...i.description?{description:i.description}:{},...i.fromTheOtherEnd?{fromTheOtherEnd:i.fromTheOtherEnd}:{},...C.has(W)?{subject:{kinds:r.length>0?r:"*",arg:W}}:{},...Y?{destructive:!0}:{},...Q?{idempotent:!0}:{},...H.length>0?{creates:H}:{},...E.length>0?{connects:E}:{},...l.length>0?{severs:l}:{},writes:G,...Object.keys(F).length>0?{writesOther:F}:{},...Object.keys(q).length>0?{writesLinked:q}:{},...Object.keys(N).length>0?{sets:N}:{},...$?{allowedOn:(c,x)=>{let f=c.getNode(x);if(!f||r.length>0&&!r.includes(f.kind))return!1;try{return te($,{graph:c,subject:f,kinds:h,bindings:{},today:a(),...p})===!0}catch{return!1}}}:{},describe:(c,x)=>{let f=typeof c[W]=="string"?x.getNode(c[W]):void 0,b=f?j(f):de(c,x);return b?`${v}: ${b}`:v},apply(c,x){let f=c.graph,b=typeof x[W]=="string"?x[W]:void 0,y=b?f.getNode(b):void 0;if(b&&!y&&ge(b),y&&r.length>0&&!r.includes(y.kind))throw new _(`"${v}" acts on ${r.join(" or ")}, not on ${Ye(y.kind)}`,"invalid");let I={};for(let[s,u]of Object.entries(x))u!==void 0&&(I[s]=u);if($&&y){let s;try{s=te($,{graph:f,subject:y,kinds:h,bindings:I,today:a(),...p})}catch(u){throw u instanceof ae?new _(`"${v}" could not be judged: ${u.sentence}`):u}if(s!==!0)throw new _(P?se(P,{node:y,kinds:h,graph:f,bindings:I,today:a(),money:w}):`"${v}" is not allowed for ${j(y)} right now`)}let X=new Map,O=s=>f.has(s)||[...X.values()].includes(s),ce=new Set,ie=s=>{let u=on(s);ce.has(u)||(ce.add(u),c.removeEdge(s))},ee=(s,u)=>{let m=me(s);if(m==="subject")return b;if(m==="me"){let g=c.me;if(g&&n.kinds[f.getNode(g)?.kind]?.people)return g;throw new _(`"${v}" is done as you, and you have no record here`)}if(X.has(m))return X.get(m);try{return U(s,I,f,u??y??null)}catch(g){throw g instanceof ae?new _(`"${v}" could not work out a value: ${g.sentence}`):g}};for(let s of T)if("create"in s){let u=n.kinds[s.create],m=oe(s.create);for(let[B,ne]of Object.entries(s.set??{})){let Me=ee(ne,void 0);Me!==void 0&&(m[B]=Me)}let g=Dn(u),z=String((g&&m[g])??s.create),le=dn(z,s.create,m,(B,ne)=>sn(n.policy?.sees,B,ne)),M=c.freshId(le?s.create:z,s.create,m);c.addNode({...m,id:M}),s.as&&X.set(s.as,M)}else if("connect"in s||"sever"in s){let u="connect"in s?s.connect:s.sever,m=String(ee(s.from,void 0)??""),g=String(ee(s.to,void 0)??"");if(O(m)||ge(m),O(g)||ge(g),"connect"in s){if(A.get(u)?.cardinality==="one")for(let z of f.out(m,u))z.id!==g&&ie({kind:u,from:m,to:z.id});f.out(m,u).some(z=>z.id===g)||c.addEdge({kind:u,from:m,to:g})}else ie({kind:u,from:m,to:g})}else if("through"in s){if(!y)throw new _(`"${v}" carries a change to linked records, and has no record to start from`,"invalid");let m=A.get(s.through)?.from.includes(y.kind)??!0?f.out(y.id,s.through):f.in(y.id,s.through);for(let g of m){let z={};for(let[le,M]of Object.entries(s.set)){let B;if(me(M)==="to")B=g.id;else if(Z(M)&&"expr"in M)try{B=te(o.get(M.expr),{graph:f,subject:y,kinds:h,bindings:{...I,to:g},today:a(),...p})}catch(ne){throw ne instanceof ae?new _(`"${v}" could not work out a value for ${j(g)}: ${ne.sentence}`):ne}else B=ee(M,void 0);B!==void 0&&(z[le]=B)}Object.keys(z).length>0&&c.patchNode(g.id,z)}}else if("set"in s){let u=String(ee(s.target??"$subject",void 0)??""),m=f.getNode(u);!m&&!O(u)&&ge(u);let g={};for(let[z,le]of Object.entries(s.set)){let M=ee(le,m);M!==void 0&&(g[z]=M)}Object.keys(g).length>0&&c.patchNode(u,g)}else if("remove"in s){let u=String(ee(s.remove,void 0)??"");f.has(u)||ge(u),c.removeNode(u)}else if("replace"in s&&y){let u=x.to;for(let m of s.replace){let g=A.get(m)?.from.includes(y.kind)??!0;for(let z of g?f.out(y.id,m):f.in(y.id,m))m===s.keep&&z.id===u||ie(g?{kind:m,from:y.id,to:z.id}:{kind:m,from:z.id,to:y.id})}}}}))}let Pe=[];for(let[k,i]of Object.entries(n.rules??{})){let{title:R,require:v,when:T,says:$,covers:P}=e.rules[k],Y=i.repairs??[],Q=(E,l,G=a(),F)=>{let N=[],q={graph:E,subject:l,kinds:h,today:G,...p,...F?{linked:F}:{},onUnread:o=>N.push(o)},C,D=[];try{if(T&&te(T,q)!==!0)return[];if(P&&l?(D=wn(E,l,P),C=D.length===0):C=te(v,q)===!0,!C&&N.length>0)throw new ae(`it reads ${yn(N[0])}`,0)}catch(o){throw o instanceof kn?new an(o.sentence):o instanceof ae?new Error(o.sentence):o}if(C)return[];let r=Y.flatMap(o=>{let S=n.acts?.[o.act],U={},de=l&&S?.on&&S.fromTheOtherEnd&&![S.on].flat().includes(l.kind)?Gn(e.acts[o.act].args,l.kind):void 0;de?U[de]=l.id:l&&(S?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(o.act))&&(U[W]=l.id);for(let[f,b]of Object.entries(o.args??{}))U[f]=me(b)==="subject"?l?.id:b;let x=(S?e.acts[o.act].args:[]).filter(([f,b])=>b.required&&U[f]===void 0).map(([f])=>f);return[{mutation:o.act,label:o.label??(de?S.fromTheOtherEnd:S?.title)??o.act.replace(/-/g," "),args:U,...x.length>0?{missing:x}:{}}]});return P&&l?D.map(o=>({invariant:k,subjectId:l.id,label:R,message:$?se($,{node:l,kinds:h,graph:E,today:G,money:w,bindings:{[l.kind]:l,[o.kind]:o}}):`${j(l)}: ${R} \u2014 ${j(o)}`,nodeIds:[l.id,o.id],repairs:r})):[{invariant:k,...l?{subjectId:l.id}:{},label:R,message:$?se($,{node:l,kinds:h,graph:E,today:G,money:w}):l?`${j(l)}: ${R}`:R,nodeIds:l?[l.id]:[],repairs:r}]},H={label:R,shape:{over:i.over,require:v,...P?{covers:P}:{},when:T,says:$,declared:n.kinds,money:w,kinds:h,today:a},judgment:{...i.require?{require:i.require}:{},...i.covers?{covers:i.covers}:{},...i.when?{when:i.when}:{},...i.says?{says:i.says}:{}},...i.description?{description:i.description}:{},...Y.length>0?{repairs:Y.map(E=>E.act)}:{}};Pe.push(i.over==="graph"?Ae(k,{scope:"graph",...H,evaluate:({graph:E,today:l,context:G})=>Q(E,null,l,G?.linked)}):Ae(k,{scope:{kind:i.over},...H,evaluate:({graph:E,subject:l,today:G,context:F})=>Q(E,l,G,F?.linked)}))}let Ge=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},we={name:n.name,schema:J,mutations:Te,invariants:Pe,...Ge?{policy:Ge}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...n.tidying?{tidying:n.tidying}:{},...n.purpose?{purpose:n.purpose}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return On(we,n),Fn.set(we,e),{ok:!0,app:we,document:n,findings:e.findings,sights:n.policy?.sees,kinds:h}}function Cn(e,d,n){let t=d||e.format==="duration",a=e.format==="money"||e.format==="percent"||!e.format&&e.unit!==void 0;if(!(!t&&!a))return{...e,...t?{as:"duration"}:{},...a?{amount:{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}}:{}}}export{En as a,In as b,Wn as c,jn as d,W as e,me as f,Dn as g,vt as h,Nn as i};
@@ -1 +0,0 @@
1
- import{a as b,b as c,c as d,d as e,e as f}from"./chunk.CGALLZ54.js";import"./chunk.WKI5INH7.js";import"./chunk.QIPASE42.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import{Hb as a}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{a as ActRefusal,e as compileDocumentWithoutCheck,d as effectsOf,f as inDocumentWords,c as kindShapes,b as readDocument};