graview 0.1.35 → 0.1.37

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 (168) hide show
  1. package/dist/preview/{chunk.5FZQI2US.js → chunk.24E4R4ZH.js} +1 -1
  2. package/dist/preview/{chunk.OEDCAHII.js → chunk.2JF254FO.js} +1 -1
  3. package/dist/preview/chunk.2TDB4D6Y.js +1 -0
  4. package/dist/preview/{chunk.5MCC54VM.js → chunk.3IVVXVG7.js} +1 -1
  5. package/dist/preview/{chunk.TWWFWHK3.js → chunk.3KJQXYCA.js} +1 -1
  6. package/dist/preview/chunk.3V2M3S4U.js +1 -0
  7. package/dist/preview/{chunk.IX6RNGAT.js → chunk.4NCXMVPY.js} +1 -1
  8. package/dist/preview/chunk.57XTDW57.js +1 -0
  9. package/dist/preview/chunk.5CLFTXP3.js +1 -0
  10. package/dist/preview/chunk.5EXYDBAL.js +88 -0
  11. package/dist/preview/chunk.5JPRRV47.js +1 -0
  12. package/dist/preview/{chunk.DLT3EE4D.js → chunk.67PVRVAC.js} +1 -1
  13. package/dist/preview/{chunk.OZ5KJLA2.js → chunk.6DYZBDWT.js} +1 -1
  14. package/dist/preview/chunk.6SK2K72G.js +1 -0
  15. package/dist/preview/{chunk.RTB4MMF6.js → chunk.74DXEKUV.js} +1 -1
  16. package/dist/preview/chunk.76QUEWYD.js +1 -0
  17. package/dist/preview/{chunk.KWCML3BF.js → chunk.7MMNMZLF.js} +1 -1
  18. package/dist/preview/chunk.7OLVQ2FZ.js +1 -0
  19. package/dist/preview/{chunk.BGW7XTMH.js → chunk.7UQOXYJX.js} +1 -1
  20. package/dist/preview/{chunk.ZHXX22AT.js → chunk.AHC4EXLW.js} +2 -2
  21. package/dist/preview/{chunk.DUUARGPE.js → chunk.AWRS6TUN.js} +1 -1
  22. package/dist/preview/{chunk.EAM4NAQH.js → chunk.AZ333RB3.js} +1 -1
  23. package/dist/preview/{chunk.PJ2DF6C7.js → chunk.BA3REPV5.js} +1 -1
  24. package/dist/preview/{chunk.LRRVBM4F.js → chunk.BRBY5WJT.js} +2 -2
  25. package/dist/preview/{chunk.VMGWYCXU.js → chunk.BXWO6ILK.js} +1 -1
  26. package/dist/preview/chunk.CGQLE7JW.js +1 -0
  27. package/dist/preview/chunk.CV4CBHFT.js +1 -0
  28. package/dist/preview/chunk.CYPTJNES.js +1 -0
  29. package/dist/preview/{chunk.TIBZZ2WY.js → chunk.D2ILIAND.js} +1 -1
  30. package/dist/preview/chunk.DLCFCMKX.js +1 -0
  31. package/dist/preview/chunk.DMUUYZ37.js +1 -0
  32. package/dist/preview/chunk.DNNL7F3P.js +25 -0
  33. package/dist/preview/chunk.EHT4HBH5.js +35 -0
  34. package/dist/preview/chunk.EKUAI5YL.js +1 -0
  35. package/dist/preview/chunk.ELY2RMGE.js +19 -0
  36. package/dist/preview/{chunk.5VB7DJTL.js → chunk.ENEOGGFM.js} +1 -1
  37. package/dist/preview/chunk.ENJKCSNX.js +1 -0
  38. package/dist/preview/chunk.FEPYKPZE.js +1 -0
  39. package/dist/preview/{chunk.KYH4QIVI.js → chunk.FFW6XWHB.js} +1 -1
  40. package/dist/preview/{chunk.QU356VB2.js → chunk.FGYCYLUS.js} +1 -1
  41. package/dist/preview/{chunk.FX6GH57T.js → chunk.G7S7GLDK.js} +1 -1
  42. package/dist/preview/chunk.GMZAQGH7.js +1 -0
  43. package/dist/preview/chunk.GXPBRYSR.js +1 -0
  44. package/dist/preview/{chunk.5B7NWF7C.js → chunk.H4LFJPDV.js} +1 -1
  45. package/dist/preview/chunk.HBBVVALN.js +5 -0
  46. package/dist/preview/{chunk.GO4QBFED.js → chunk.HCK4Y6C5.js} +1 -1
  47. package/dist/preview/chunk.HSRGYZOR.js +1 -0
  48. package/dist/preview/chunk.HYAKRLPT.js +4 -0
  49. package/dist/preview/chunk.IHBIRAC4.js +2 -0
  50. package/dist/preview/chunk.IWK5QL6P.js +1 -0
  51. package/dist/preview/{chunk.WQBDTLPZ.js → chunk.J2CR4RRH.js} +1 -1
  52. package/dist/preview/chunk.J2HQEUYA.js +1 -0
  53. package/dist/preview/{chunk.GMOTRAKJ.js → chunk.JBRXGPPM.js} +1 -1
  54. package/dist/preview/chunk.JDRM6XXD.js +2 -0
  55. package/dist/preview/chunk.JFLUVZNW.js +1 -0
  56. package/dist/preview/chunk.KAWP4RNR.js +1 -0
  57. package/dist/preview/{chunk.577PGFUT.js → chunk.LJE5J3JK.js} +1 -1
  58. package/dist/preview/chunk.LPJY6V5D.js +1 -0
  59. package/dist/preview/chunk.LVLAS5GL.js +1 -0
  60. package/dist/preview/{chunk.CHJZ7LST.js → chunk.LVNAB2BW.js} +1 -1
  61. package/dist/preview/{chunk.747GGBPR.js → chunk.LYJXX6BU.js} +1 -1
  62. package/dist/preview/{chunk.2OBIO5Y6.js → chunk.MJLUAGEV.js} +1 -1
  63. package/dist/preview/chunk.MKPJKZAP.js +1 -0
  64. package/dist/preview/chunk.MMBMVHIG.js +1 -0
  65. package/dist/preview/chunk.NNNVB6RV.js +1 -0
  66. package/dist/preview/chunk.NOZEHLWG.js +2 -0
  67. package/dist/preview/{chunk.MVN6H65Q.js → chunk.NV6IZJKA.js} +1 -1
  68. package/dist/preview/{chunk.2QQAOJET.js → chunk.NWHFFOXW.js} +1 -1
  69. package/dist/preview/chunk.NZJZIYDK.js +1 -0
  70. package/dist/preview/chunk.O6KNGFWH.js +1 -0
  71. package/dist/preview/chunk.PMK73A53.js +1 -0
  72. package/dist/preview/chunk.PQPZZ7ZW.js +117 -0
  73. package/dist/preview/{chunk.XSYBNUXF.js → chunk.QJYALCIW.js} +1 -1
  74. package/dist/preview/chunk.QMZUKAPJ.js +1 -0
  75. package/dist/preview/{chunk.A3F7MFDR.js → chunk.QNGFBJWP.js} +1 -1
  76. package/dist/preview/{chunk.D4WQEBWV.js → chunk.QOXTBRKE.js} +1 -1
  77. package/dist/preview/{chunk.Y5Z4ZDTO.js → chunk.QXARGANF.js} +6 -6
  78. package/dist/preview/{chunk.PPUAPAWR.js → chunk.QYWBQ5NX.js} +1 -1
  79. package/dist/preview/{chunk.EQWOQOFJ.js → chunk.RPOYSIVQ.js} +1 -1
  80. package/dist/preview/{chunk.SECORXDP.js → chunk.SNKOPWAD.js} +1 -1
  81. package/dist/preview/{chunk.HPD5ZDZH.js → chunk.SZMWJHU2.js} +1 -1
  82. package/dist/preview/{chunk.3H4NVUWV.js → chunk.TN4GY6LW.js} +1 -1
  83. package/dist/preview/{chunk.DNDHDDM6.js → chunk.TRLVFHFT.js} +2 -2
  84. package/dist/preview/chunk.TSI4O3GH.js +1 -0
  85. package/dist/preview/chunk.TX5QIZEP.js +1 -0
  86. package/dist/preview/{chunk.JAPYJ53U.js → chunk.TXS4I326.js} +1 -1
  87. package/dist/preview/chunk.U4URQDC5.js +1 -0
  88. package/dist/preview/chunk.UCVZG7S4.js +1 -0
  89. package/dist/preview/{chunk.LAF6GTBN.js → chunk.UPBUF7KR.js} +1 -1
  90. package/dist/preview/{chunk.UHQD3NTK.js → chunk.UR5TT4JH.js} +1 -1
  91. package/dist/preview/{chunk.PKKA6JWA.js → chunk.UV2TSAB4.js} +1 -1
  92. package/dist/preview/{chunk.FSAHO3LV.js → chunk.UVLPVHID.js} +1 -1
  93. package/dist/preview/chunk.VUKHDZNI.js +1 -0
  94. package/dist/preview/{chunk.G2ZPQUXM.js → chunk.VW6WGFL6.js} +1 -1
  95. package/dist/preview/chunk.VX7MGVP5.js +1 -0
  96. package/dist/preview/{chunk.SD33BD7A.js → chunk.WLV2QYTS.js} +1 -1
  97. package/dist/preview/{chunk.3QXHII5W.js → chunk.WNKRXL3O.js} +1 -1
  98. package/dist/preview/chunk.WNMLA4YW.js +1 -0
  99. package/dist/preview/{chunk.FVPOSGNG.js → chunk.WVEKYJSI.js} +2 -2
  100. package/dist/preview/{chunk.FBY5IUGU.js → chunk.X2OLXTRL.js} +1 -1
  101. package/dist/preview/{chunk.LWSTEZIP.js → chunk.XS3SAH6U.js} +1 -1
  102. package/dist/preview/chunk.XWJ2MRQF.js +1 -0
  103. package/dist/preview/{chunk.6J7DR7XQ.js → chunk.Y44TR4WG.js} +1 -1
  104. package/dist/preview/{chunk.CDMV6L5I.js → chunk.YAXOIJVH.js} +1 -1
  105. package/dist/preview/chunk.YFW5BF6J.js +1 -0
  106. package/dist/preview/chunk.YNJOLOFG.js +1 -0
  107. package/dist/preview/{chunk.AINNENYD.js → chunk.YW2BZ2LH.js} +2 -2
  108. package/dist/preview/chunk.YX354FRV.js +1 -0
  109. package/dist/preview/{chunk.DQ5HAB3N.js → chunk.ZB7GV3IT.js} +1 -1
  110. package/dist/preview/{chunk.3P4IIXIT.js → chunk.ZOT4V66Q.js} +1 -1
  111. package/dist/preview/chunk.ZYPCE2LZ.js +1 -0
  112. package/dist/preview/index.html +42 -42
  113. package/dist/preview/page.js +5 -5
  114. package/package.json +6 -6
  115. package/dist/preview/chunk.2YGQVI6T.js +0 -1
  116. package/dist/preview/chunk.3C4RJIJU.js +0 -1
  117. package/dist/preview/chunk.4J75WRDG.js +0 -1
  118. package/dist/preview/chunk.4K5QCJFH.js +0 -2
  119. package/dist/preview/chunk.4NZBMZC7.js +0 -117
  120. package/dist/preview/chunk.52QAIGCD.js +0 -1
  121. package/dist/preview/chunk.5EAQDBBE.js +0 -1
  122. package/dist/preview/chunk.656N5BHG.js +0 -1
  123. package/dist/preview/chunk.6K2HASOH.js +0 -1
  124. package/dist/preview/chunk.6P7P2AW7.js +0 -1
  125. package/dist/preview/chunk.AEHPDVLQ.js +0 -1
  126. package/dist/preview/chunk.APNN6BKF.js +0 -1
  127. package/dist/preview/chunk.B2KITMSD.js +0 -1
  128. package/dist/preview/chunk.BL6VDLAW.js +0 -1
  129. package/dist/preview/chunk.DMNXYMLC.js +0 -1
  130. package/dist/preview/chunk.DPP7ITTU.js +0 -1
  131. package/dist/preview/chunk.DTR5I4BI.js +0 -1
  132. package/dist/preview/chunk.FHXXYWL3.js +0 -1
  133. package/dist/preview/chunk.FIVLFXFB.js +0 -35
  134. package/dist/preview/chunk.FUQVNXLB.js +0 -1
  135. package/dist/preview/chunk.GCGITEON.js +0 -1
  136. package/dist/preview/chunk.GCVO6N26.js +0 -1
  137. package/dist/preview/chunk.GF7LA4QG.js +0 -1
  138. package/dist/preview/chunk.H243UV3Z.js +0 -19
  139. package/dist/preview/chunk.IHFNLKXV.js +0 -1
  140. package/dist/preview/chunk.JLMLKDVX.js +0 -88
  141. package/dist/preview/chunk.JMQ6YLQX.js +0 -1
  142. package/dist/preview/chunk.LIIC25G6.js +0 -1
  143. package/dist/preview/chunk.M5HADQPP.js +0 -1
  144. package/dist/preview/chunk.O36ZDLWC.js +0 -1
  145. package/dist/preview/chunk.PQPTYNW2.js +0 -1
  146. package/dist/preview/chunk.PW7YH6JV.js +0 -2
  147. package/dist/preview/chunk.Q7TP4RFE.js +0 -1
  148. package/dist/preview/chunk.QRMWFEEH.js +0 -1
  149. package/dist/preview/chunk.QVKKXMNK.js +0 -1
  150. package/dist/preview/chunk.QVUL2FSI.js +0 -1
  151. package/dist/preview/chunk.RHYA742Q.js +0 -1
  152. package/dist/preview/chunk.RIW7SQH4.js +0 -2
  153. package/dist/preview/chunk.SBBNIYVB.js +0 -1
  154. package/dist/preview/chunk.TPX6AVJL.js +0 -1
  155. package/dist/preview/chunk.U2PYW5MS.js +0 -1
  156. package/dist/preview/chunk.U5EJSTST.js +0 -4
  157. package/dist/preview/chunk.UWIYKGYK.js +0 -25
  158. package/dist/preview/chunk.VWHMYPLL.js +0 -1
  159. package/dist/preview/chunk.VZHV25JE.js +0 -1
  160. package/dist/preview/chunk.X7W27IRI.js +0 -5
  161. package/dist/preview/chunk.YT2CYCVT.js +0 -1
  162. package/dist/preview/chunk.Z7ZCR4LN.js +0 -1
  163. package/dist/preview/chunk.ZE4CTZQ3.js +0 -1
  164. package/dist/preview/chunk.ZFWV4JAJ.js +0 -1
  165. package/dist/preview/chunk.ZKXK22AH.js +0 -1
  166. package/dist/preview/chunk.ZQNLC33L.js +0 -1
  167. package/dist/preview/chunk.ZSW74NVJ.js +0 -1
  168. package/dist/preview/chunk.ZZTDQKM2.js +0 -1
@@ -1 +0,0 @@
1
- import{d as ae}from"./chunk.Z7ZCR4LN.js";import{b as Ce,d as $e}from"./chunk.RIW7SQH4.js";import{e as Te}from"./chunk.FSAHO3LV.js";import{$ as we,Bc as De,Dc as We,Ec as Me,H as ke,Ib as ie,Ka as Se,Ma as H,T as R,U as xe,W as E,Wc as je,X as K,Y as Ae,Z as v,aa as Ne,hc as oe,lc as ve,mc as Oe,zc as Re}from"./chunk.X7W27IRI.js";function se(n,e){return n.display?.labels?.[e]??v(e)}function de(n){let e=ae(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Je(n,e){let t=new Map,r=n.tryDefinition(e);for(let[a,i]of Object.entries(r?.edges??{}))t.set(a,{key:a,label:i.description?R(i.description):v(a),about:"edge",far:i.to==="*"?[...n.kinds]:[...i.to]});for(let a of n.definitions)if(a.kind!==e)for(let[i,d]of Object.entries(a.edges??{}))t.has(i)||d.to!=="*"&&!d.to.includes(e)||t.set(i,{key:i,label:d.inverse?R(d.inverse):v(i),about:"edge",far:[a.kind]});return[...t.values()]}var Ze=["current","past","any","flagged","clear"];function Fe(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let r=t.retired.map(String);return e.some(a=>a.key===t.field&&r.includes(a.value))}function Be(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let r=new Set(t.display?.hide??[]),a=t.fields.shape??{},i=[{key:"label",label:"Name",about:"label",type:"text"}],d=[],f=[];for(let[g,p]of Object.entries(a)){if(g==="id"||g==="kind"||g==="label"||r.has(g))continue;let A=de(p);if(!A)continue;let O=se(t,g),w=A==="choice"?Le(p):A==="boolean"?["true","false"]:void 0,N={key:g,label:O,about:"field",type:A,...w?{options:w}:{}};i.push(N),d.push(N),(A==="boolean"||A==="choice")&&f.push(N),A==="date"&&f.push({...N,buckets:["day","week","month","year","decade"]})}for(let g of Je(n,e))i.push(g),d.push(g),f.push(g);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Ze]:["flagged","clear"]};d.push(l);let y=t.fieldRoles?.order,u=y&&(y in a||y==="label")?{by:y,direction:"asc"}:void 0;return{kind:e,sorts:i,filters:d,groups:f,...u?{natural:u}:{}}}function On(n,e){let t=[];for(let a of e.filters){let i=a.about==="edge"&&a.far?.length===1?n.tryDefinition(a.far[0]):void 0;if(!(!i||i.kind===e.kind))for(let[d,f]of Object.entries(i.fields.shape??{}))de(f)!=="choice"||i.display?.hide?.includes(d)||t.push({key:`${a.key}.${d}`,label:`${a.label} \xB7 ${se(i,d)}`,about:"via",type:"choice",options:Le(f),far:[i.kind]})}if(t.length===0)return e;let r=e.filters.filter(a=>a.about!=="is");return{...e,filters:[...r,...t,...e.filters.filter(a=>a.about==="is")]}}function Rn(n,e){let t=n.tryDefinition(e.kind),r=Object.entries(t?.computed??{});if(!t||r.length===0)return e;let a=r.filter(([i])=>!e.sorts.some(d=>d.key===i)).map(([i,d])=>({key:i,label:(typeof d=="object"?d.label:void 0)??se(t,i),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...a]}}function Le(n){let e=ae(n);return e.type==="choice"?e.options:[]}var Ie=n=>n,Pe=n=>n;function en(n,e,t){let r=new Map;for(let a of[...n.out(e,t),...n.in(e,t)])r.set(a.id,a);return[...r.values()]}function le(n,e,t){let r=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return E(r,Pe(e),n.today);case"past":return!E(r,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let a=r?.fields.shape??{};if(t.key in a){let l=Se(Ie(e),t.key,n.today??ke()),y=de(a[t.key]);if(y==="date"){let[u,g]=t.value.split(":");if(typeof l!="string"||!g)return!1;let p=l.slice(0,10);return u==="before"?p<g:u==="after"?p>g:p===g}if(y==="boolean")return String(l)===t.value;if(y==="number"){let u=t.value.lastIndexOf(":"),g=u>0?t.value.slice(0,u):"",p=Number(t.value.slice(u+1));if(g==="at-most"||g==="at-least")return typeof l!="number"||!Number.isFinite(p)?!1:g==="at-most"?l<=p:l>=p}return String(l)===t.value}let[i,d]=t.key.split("."),f=en(n.graph,e.id,i);return d?f.some(l=>String(Ie(l)[d])===t.value):t.value==="*"?f.length>0:t.value==="none"?f.length===0:f.some(l=>l.id===t.value)}var nn=5;function ze(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ce(n){return ze(n).replace(/ /g,"")}var z=new Map,tn=5e4;function _(n){let e=z.get(n);if(e===void 0){z.size>=tn&&z.clear();let t=ze(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},z.set(n,e)}return e}var D=n=>[..._(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:r}=_(n),a=e.join("");if(t.length===0)return;if(t===a)return"exact";if(e.every(d=>r.some(f=>f.startsWith(d))))return t.startsWith(a)?"prefix":e.every(d=>r.includes(d))?"word":"part"}function Q(n,e,t=48){let r=n.replace(/\s+/g," ").trim();if(r.length<=t)return r;let a=e[0],i=r.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),d=a?i.search(new RegExp(`(^|[^\\p{L}\\p{N}])${rn(a)}`,"u")):-1,f=d<0?0:d+(i[d]&&/[\p{L}\p{N}]/u.test(i[d])?0:1),l=Math.max(0,f-Math.floor(t/3));if(l>0){let u=r.lastIndexOf(" ",l);l=u<0?0:u+1}let y=Math.min(r.length,l+t);if(y<r.length){let u=r.indexOf(" ",y);y=u<0||u-y>16?y:u}return`${l>0?"\u2026":""}${r.slice(l,y).trim()}${y<r.length?"\u2026":""}`}var rn=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),on=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function an(n){let e=[],t=[];for(let r of n.trim().split(/\s+/).filter(Boolean)){let a=on.exec(r);a?t.push({key:a[1],value:a[2]}):e.push(r)}return{words:e.join(" "),conditions:t}}var Ee=new WeakMap;function q(n,e){let t=Ee.get(e);if(t&&t.definition===n)return t.texts;let r=sn(n,e);return Ee.set(e,{definition:n,texts:r}),r}function sn(n,e){let t=K(n,e),r=[{field:"label",reading:"Name",text:t}];for(let a of $e(e,n,{limit:Number.POSITIVE_INFINITY}))a.key==="label"||a.value===t||typeof e[a.key]!="boolean"&&r.push({field:a.key,reading:a.label,text:a.markdown?Te(a.value):a.value});return r}var T={exact:0,prefix:1,word:2,part:3,field:4,near:5},Ge=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ke(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function He(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let r=[],a=Array.from({length:e.length+1},(i,d)=>d);for(let i=1;i<=n.length;i++){let d=[i],f=i;for(let l=1;l<=e.length;l++){let y=Math.min(a[l]+1,d[l-1]+1,a[l-1]+(n[i-1]===e[l-1]?0:1));i>1&&l>1&&n[i-1]===e[l-2]&&n[i-2]===e[l-1]&&(y=Math.min(y,r[l-2]+1)),d[l]=y,y<f&&(f=y)}if(f>t)return t+1;r=a,a=d}return a[e.length]}var G=new Map;function dn(n,e){let t=G.get(n);t||(G.size>=64&&G.clear(),G.set(n,t=new Map));let r=t.get(e);return r===void 0&&(r=ln(n,e)??null,t.set(e,r)),r??void 0}function ln(n,e){if(/\d/.test(n))return;let t=Ke(n);if(t.length>=3&&(Ke(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let r=n.length<4?0:n.length<=7?1:2;if(r!==0){if(He(n,e,r)<=r)return"spelling";if(n.length>=5){for(let a=n.length-r;a<=n.length+r;a++)if(a<e.length&&He(n,e.slice(0,a),r)<=r)return"spelling"}}}function cn(n,e){let t=e.length>1?e.filter(a=>!Ge.has(a)):e;if(t.length===0)return;let r;for(let a of t){let i;for(let d of n){for(let f of _(d.text).tokens){if(f.startsWith(a)){i={text:d,matched:f};break}let l=i?void 0:dn(a,f);l&&(i={text:d,matched:f,by:l})}if(i&&!i.by)break}if(!i)return;i.by&&!r&&(r={text:i.text,asked:a,matched:i.matched,by:i.by})}if(r)return{field:r.text.field,reading:r.text.reading,fragment:Q(r.text.text,[r.matched]),strength:"near",asked:r.asked,matched:r.matched,by:r.by}}var fn=80;function un(n,e,t){let r=D(e).filter(d=>!Ge.has(d)).join(" ")||e,a=t===void 0?[]:D(t),i=a.length>0&&n.find(d=>a.every(f=>_(d.text).tokens.some(l=>l.startsWith(f))))||n[0];return{field:i.field,reading:i.reading,fragment:Q(i.text,a),strength:"near",asked:r,matched:(t??i.text).slice(0,fn),by:"meaning"}}function _e(n,e,t){let r=D(t);if(r.length===0)return;let a=q(n,e),[i,...d]=a,f=j(i.text,r);if(f)return{field:"label",reading:i.reading,fragment:Q(i.text,r),strength:f};let l=p=>A=>_(A.text).tokens.some(O=>O.startsWith(p));if(!r.every(p=>a.some(l(p))))return;let y=D(i.text),u=r.find(p=>!y.some(A=>A.startsWith(p)))??r[0],g=d.find(l(u));return{field:g.field,reading:g.reading,fragment:Q(g.text,[u]),strength:"field"}}var gn=512,yn=64;function hn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-gn),r=n[n.length-1].seq;for(let a of t){let i=Math.pow(.5,(r-a.seq)/yn);for(let d of a.writes)e.set(d,(e.get(d)??0)+i)}return e}var ue=(n,e)=>we({tryDefinition:()=>n},e),fe=(n,e)=>De({tryDefinition:()=>n},e);function pn(n,e,t){let r=n.tryDefinition(e),a=[{field:"plural",text:ue(r,e)},{field:"kind",text:v(e)},...r?.noun?[{field:"noun",text:r.noun}]:[]],i;for(let d of a){let f=j(d.text,t);f&&(!i||T[f]<T[i.strength])&&(i={strength:f,...d})}return i}var mn,bn=(n,e)=>(mn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),qe=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||bn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function Kn(n,e,t={}){let r=n.schema,a=an(e),i=D(a.words),d=t.principal??{kind:"human"},f=n.kindsKeptFrom(d),l=n.modules.disabledKinds,y=a.conditions.filter(o=>o.key==="kind").map(o=>o.value),u=a.conditions.filter(o=>o.key==="is").map(o=>o.value),g=u.includes("any")||u.includes("past"),p=u.includes("past")&&!u.includes("any")&&!u.includes("current"),A=u.includes("archived")?!0:t.archived??"all",O=(o,s)=>{let c=ce(s),h=r.tryDefinition(o);return ce(o)===c||ce(ue(h,o))===c},w=r.kinds.filter(o=>!f.has(o)&&!l.has(o)&&(t.kinds===void 0||t.kinds.includes(o))&&(y.length===0||y.some(s=>O(o,s)))),W=a.conditions.filter(o=>o.key!=="kind").map(o=>({...o,admittedBy:w.filter(s=>Be(r,s).filters.some(c=>c.key===o.key))})),U=W.filter(o=>o.key!=="is"),C=u.filter(o=>o==="flagged"||o==="clear"||o==="past"||o==="archived"),V={kinds:w,past:g},Qe={hits:[],words:a.words,conditions:W,searched:V,byKind:{},total:0,matched:[]};if(i.length===0&&U.length===0&&C.length===0)return Qe;let X=t.today,$=t.flagged??new Set(n.violations().flatMap(o=>o.nodeIds)),Ue=t.touched??hn(n.log.all()),Y=new Set;for(let o of t.from??[]){Y.add(o);for(let s of n.graph.neighbors(o))Y.add(s.id)}let ge=ve(n,d)?Oe(n,d):void 0,J=oe.keptFrom?.(n,d)&&n.seenBy(d).graph,Z=o=>je(o,t.basePath===void 0?{}:{basePath:t.basePath}),ye={schema:r,graph:n.graph,flagged:$,...X?{today:X}:{}},S=[],I={},P=[],F=[],B=(o,s,c,h,m,b)=>{let x=K(c,o);I[s]=(I[s]??0)+1,S.push({hit:{about:"node",id:o.id,kind:s,label:x,why:m,current:h,flagged:$.has(o.id),address:Z(`${fe(c,s)}/${encodeURIComponent(o.id)}`),...b===void 0?{}:{near:!0},...H(o)?{archived:!0}:{}},...b===void 0?{}:{nearly:2-b},tier:T[m.strength],inKind:s===t.inKind?0:1,near:Y.has(o.id)?0:1,past:h?0:1,archived:H(o)?1:0,touched:-(Ue.get(o.id)??0),flagged:$.has(o.id)?0:1,name:x,id:o.id})};for(let o of w){let s=r.tryDefinition(o),c=W.filter(m=>m.key!=="is"&&m.admittedBy.includes(o));if(i.length===0&&c.length===0&&C.length===0)continue;let h=Fe(s,c);for(let m of n.graph.nodesOfKind(o,{archived:A})){if(ge&&!ge(m.id))continue;let b=J?J.getNode(m.id):m;if(!b)continue;let x=E(s,b,X);if(!g&&!h&&!x){if(i.length>0&&u.length===0&&c.every(k=>le(ye,b,k))){let k=_e(s,b,a.words);k&&F.push({node:b,kind:o,definition:s,why:k})}continue}if(p&&x||!c.every(k=>le(ye,b,k))||u.includes("flagged")&&!$.has(b.id)||u.includes("clear")&&$.has(b.id))continue;let M=i.length>0?_e(s,b,a.words):c[0]?{field:c[0].key,reading:v(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${C[0]}`,strength:"field"};M?B(b,o,s,x,M):i.length>0&&P.push({node:b,kind:o,definition:s,current:x})}}let ee=o=>o.strength!=="field",ne=!1;if(F.length>0&&S.length===0){ne=!0;for(let o of F)B(o.node,o.kind,o.definition,!1,o.why)}else if(F.some(o=>ee(o.why))&&!S.some(o=>ee(o.hit.why))){ne=!0;for(let o of F)ee(o.why)&&B(o.node,o.kind,o.definition,!1,o.why)}let he=t.near!==!1&&i.length>0&&S.length<nn&&P.length>0,te=new Set;if(he)for(let o of P){let s=cn(q(o.definition,o.node),i);s&&(te.add(o.node.id),B(o.node,o.kind,o.definition,o.current,s,s.by==="stem"?.9:.8))}let Ve=o=>o==="exact"||o==="prefix"?-1:T[o],re=(o,s,c,h)=>({hit:o,tier:Ve(s),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(i.length>0){for(let s of w){let c=pn(r,s,i);if(!c)continue;let h=Ne(r,s),m={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};S.push(re({about:"kind",kind:s,label:h,why:m,count:I[s]??0,address:Z(fe(r.tryDefinition(s),s))},c.strength,h,`kind:${s}`))}let o=t.places??[];for(let s of Re(o.filter(c=>w.includes(c.kind)))){if(s.across&&f.has(s.across))continue;let c=j(s.title,i);if(!c)continue;let h={field:"title",reading:"Title",fragment:s.title,strength:c},m=Me(s,o)?fe(r.tryDefinition(s.kind),s.kind).slice(1):void 0,b=Z(We(s.as,m));S.push(re({about:"place",kind:s.kind,title:s.title,as:s.as,why:h,address:b},c,s.title,`place:${s.kind}:${s.as}`))}for(let s of n.allInvariants()){let c=s.scope==="graph"?void 0:s.scope.kind;if(c&&!w.includes(c))continue;let h=s.label??v(s.name),m=j(h,i),b=m?void 0:j(v(s.name),i),x=m??b;if(!x)continue;let M={field:m?"label":"name",reading:m?"Rule":"Name",fragment:m?h:s.name,strength:x};S.push(re({about:"rule",name:s.name,label:h,...c?{kind:c}:{},why:M},x,h,`rule:${s.name}`))}}let pe=()=>{S.sort(qe);let o=t.limit??50,s=S.slice(0,o).map(k=>k.hit),c=s.flatMap(k=>k.about==="node"?[(J||n.graph).getNode(k.id)]:[]).filter(Boolean),h=Ce(c,k=>r.tryDefinition(k)),m=s.map(k=>k.about==="node"&&h.has(k.id)?{...k,apart:h.get(k.id)}:k),b=Object.values(I).reduce((k,Ye)=>k+Ye,0),x=S.flatMap(k=>k.hit.about==="node"?[k.hit.id]:[]),M=t.subject&&w.includes(String(n.graph.getNode(t.subject)?.kind))?kn(n,t.subject,a.words,{principal:d}):[];return{hits:[...m,...M],words:a.words,conditions:W,searched:ne?{...V,past:!0}:V,byKind:{...I},total:b,matched:x}},L=pe(),me=t.rank;if(!he||!me)return L;let be=P.filter(o=>!te.has(o.node.id)).map(({node:o,kind:s,definition:c})=>({id:o.id,kind:s,label:K(c,o),texts:q(c,o)}));if(be.length===0)return L;let Xe=(async()=>{let o;try{o=await me(a.words,be)}catch{return L}let s=new Map(P.filter(h=>!te.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:m,matched:b}of Array.isArray(o)?o:[]){let x=s.get(h);!x||!(m>0)||(s.delete(h),c=!0,B(x.node,x.kind,x.definition,x.current,un(q(x.definition,x.node),a.words,typeof b=="string"?b:void 0),Math.min(1,m)))}return c?pe():L})();return{...L,later:Xe}}function kn(n,e,t,r={}){let a=r.principal??{kind:"human"},i=(oe.keptFrom?.(n,a)?n.seenBy(a):n).graph.getNode(e);if(!i)return[];if(n.kindsKeptFrom(a).has(i.kind))return[];let d=D(t),f=K(n.schema.tryDefinition(i.kind),i),l=[];for(let u of n.allMutations()){let g=u.subject;if(!g||g.kinds!=="*"&&!g.kinds.includes(i.kind))continue;let p=u.derived?.act;if((p==="archive"||p==="merge")&&H(i)||p==="unarchive"&&!H(i)||p==="leave-alone"&&ie(i)||p==="allow-tidying"&&!ie(i)||!n.permits({name:u.name,args:{[g.arg]:i.id}},a).ok)continue;let A=Ae(u),O=D(A),w=d.filter(U=>O.some(C=>C.startsWith(U))),N=w.length>0?j(A,w):void 0,W=N?{field:"title",reading:"Act",fragment:A,strength:N}:{field:"subject",reading:"On",fragment:f,strength:"field"};l.push({hit:{about:"act",name:u.name,title:A,subject:i.id,why:W,destructive:u.destructive===!0},tier:N?T[N]:T.field+1,inKind:0,near:0,past:u.destructive?1:0,touched:0,flagged:u.pinned?0:1,name:A,id:`act:${u.name}`})}l.sort(qe);let y=l.map(u=>u.hit);return r.limit===void 0?y:y.slice(0,r.limit)}function Hn(n,e){let t=e.kinds.map((i,d)=>{let f=ue(n.tryDefinition(i),i);return d===0?f:f.toLowerCase()}),r=xe(t)||"Nothing";return e.kinds.some(i=>n.tryDefinition(i)?.lifecycle)?e.past?`${R(r)}, past ones included.`:`${R(r)}, current ones; add is:any for past ones.`:`${R(r)}.`}export{se as a,de as b,Je as c,Fe as d,Be as e,On as f,Rn as g,Le as h,Ie as i,Pe as j,en as k,le as l,ce as m,an as n,_e as o,hn as p,Kn as q,kn as r,Hn as s};
@@ -1 +0,0 @@
1
- import{B as w,D as b,G as k,J as $,N as p,Z as N,ca as D,ja as E,kb as F,qb as S,tb as T}from"./chunk.X7W27IRI.js";function W(e,n,r){let o=[...n?.creates??[],...n?.subject&&n.subject.kinds!=="*"?n.subject.kinds:[]];for(let t of o){let i=e.tryDefinition(t),a=i?.fields?.shape??{};if(!i||!(r in a))continue;let d=i.display?.format?.[r];return{label:i.display?.labels?.[r]??D(i,r),option:u=>d?d(u):N(u)}}return{label:D(void 0,r),option:t=>N(t)}}function P(e,n,r){if(r instanceof F){let o=n.find(i=>i.name===r.mutation);return`Not yet: ${r.issues.map(i=>{let a=i.path.length>0?W(e,o,String(i.path[0])).label:void 0;return a?`${a} \u2014 ${i.message.replace(/^./,d=>d.toLowerCase())}`:i.message}).join("; ")}.`}return r instanceof Error?r.message:String(r)}var x=864e5,Z=/^(\d{4})-(\d{2})-(\d{2})/,y=e=>String(e).padStart(2,"0"),M=e=>new Date(e).toISOString().slice(0,10),m=e=>Date.UTC(+e.slice(0,4),+e.slice(5,7)-1,+e.slice(8,10)),g=(e,n)=>M(m(e)+n*x),R=e=>new Date(m(e)).getUTCDay();function l(e,n,r){if(!(n>=1&&n<=12&&r>=1&&r<=31))return;let o=`${String(e).padStart(4,"0")}-${y(n)}-${y(r)}`;return M(m(o))===o?o:void 0}function I(e=new Date){return{day:`${e.getFullYear()}-${y(e.getMonth()+1)}-${y(e.getDate())}`,minutes:e.getHours()*60+e.getMinutes()}}var j=e=>/T\d\d:\d\d(:[\d.]+)?(Z|[+-]\d\d:?\d\d)$/.test(e);function h(e){if(typeof e!="string")return;if(j(e)){let o=new Date(e);return Number.isNaN(o.getTime())?void 0:I(o)}let n=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2}))?/.exec(e);if(!n||!l(Number(n[1]),Number(n[2]),Number(n[3])))return;let r=e.slice(0,10);return n[4]===void 0?{day:r}:{day:r,minutes:Number(n[4])*60+Number(n[5])}}function O(e,n){if(!n.time)return e.day;let r=e.minutes??9*60;if(!n.instant)return`${e.day}T${y(Math.floor(r/60))}:${y(r%60)}`;let[,o,t,i]=Z.exec(e.day);return new Date(Number(o),Number(t)-1,Number(i),Math.floor(r/60),r%60).toISOString().replace(/\.\d{3}Z$/,"Z")}function H(e,n=new Date){let r=Intl.DateTimeFormat().resolvedOptions().timeZone??"UTC",o=r;try{o=new Intl.DateTimeFormat(e??b,{timeZoneName:"short"}).formatToParts(n).find(t=>t.type==="timeZoneName")?.value??r}catch{o=r}return{zone:r,short:o}}function G(e,n,r,o){let t=h(n);if(!t)return r;let i=e===void 0?void 0:h(e),a=r===void 0?void 0:h(r),d=u=>m(u.day)+(u.minutes??0)*6e4,c=(u,s)=>{let f=d(u)+s;return{day:M(f),...o.time?{minutes:Math.round(f%x/6e4)}:{}}};return i&&a?O(c(a,d(t)-d(i)),o):a&&d(a)>=d(t)?r:o.time?O(c(t,36e5),o):r}var K=/^(start|starts|startsAt|startsOn|startAt|begins|from|opens|checkIn)$/i,X=/^(end|ends|endsAt|endsOn|endAt|until|to|finish|finishes|closes|through|checkOut)$/i;function V(e,n={}){let r=(n.start&&e.includes(n.start)?n.start:void 0)??e.find(t=>K.test(t)),o=(n.end&&e.includes(n.end)?n.end:void 0)??e.find(t=>t!==r&&X.test(t));return r&&o?{start:r,end:o}:void 0}var q=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],J=["sun","mon","tue","wed","thu","fri","sat"],v="(jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|june?|july?|aug(?:ust)?|sept?(?:ember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)",C="(sun(?:day)?|mon(?:day)?|tue(?:s|sday)?|wed(?:nesday)?|thu(?:r|rs|rsday)?|fri(?:day)?|sat(?:urday)?)",Q=e=>q.indexOf(e.slice(0,3))+1,L=e=>e===void 0?void 0:e.length===2?2e3+Number(e):Number(e);function ee(e){try{let n=new Intl.DateTimeFormat(e,{month:"numeric",day:"numeric"}).formatToParts(0).map(r=>r.type);return n.indexOf("month")<n.indexOf("day")}catch{return!0}}function ne(e){let n=(t,i)=>({minutes:i,rest:`${e.slice(0,t.index)} ${e.slice(t.index+t[0].length)}`}),r=/\b(noon|midday)\b/.exec(e);if(r)return n(r,12*60);if(r=/\bmidnight\b/.exec(e),r)return n(r,0);if(r=/\b(\d{1,2})(?::(\d{2}))?\s*([ap])\.?m?\.?(?=\s|$)/.exec(e),r){let t=Number(r[1]),i=Number(r[2]??0);return t<1||t>12||i>59?{rest:e,bad:!0}:n(r,(t%12+(r[3]==="p"?12:0))*60+i)}if(r=/\b(\d{1,2}):(\d{2})\b/.exec(e),r){let t=Number(r[1]),i=Number(r[2]);return t>23||i>59?{rest:e,bad:!0}:n(r,t*60+i)}if(r=/\bat\s+(\d{1,2})\b/.exec(e),r){let t=Number(r[1]);return t>23?{rest:e,bad:!0}:n(r,(t>=1&&t<=7?t+12:t)*60)}let o=/\b(morning|afternoon|evening|tonight)\b/.exec(e);return o?{minutes:{morning:9,afternoon:15,evening:18,tonight:20}[o[1]]*60,rest:o[1]==="tonight"?`${e.slice(0,o.index)} today ${e.slice(o.index+o[0].length)}`:`${e.slice(0,o.index)} ${e.slice(o.index+o[0].length)}`}:{rest:e}}function te(e,n,r){let o=e.replace(/\b(on|at|the|of|this)\b/g," ").replace(/\s+/g," ").trim();if(o==="")return null;if(o==="today"||o==="now")return n;if(o==="tomorrow"||o==="tmrw"||o==="tmr")return g(n,1);if(o==="yesterday")return g(n,-1);if(o==="next week")return g(n,7);let t=/^in (\d{1,3}) (day|days|week|weeks)$/.exec(o);if(t)return g(n,Number(t[1])*(t[2].startsWith("week")?7:1));if(t=new RegExp(`^(next )?${C}$`).exec(o),t){let u=(J.indexOf(t[2].slice(0,3))-R(n)+7)%7;return g(n,t[1]&&u===0?7:u)}if(t=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(o),t)return l(Number(t[1]),Number(t[2]),Number(t[3]));let i=o.replace(new RegExp(`^${C} `),"");t=new RegExp(`^(\\d{1,2})(?:st|nd|rd|th)? ${v}(?: (\\d{4}))?$`).exec(i);let a=t?{date:t[1],month:t[2],year:t[3]}:void 0;t=new RegExp(`^${v} (\\d{1,2})(?:st|nd|rd|th)?(?: (\\d{4}))?$`).exec(i);let d=a??(t?{date:t[2],month:t[1],year:t[3]}:void 0);if(d)return z(n,L(d.year),Q(d.month),Number(d.date));if(t=/^(\d{1,2})[/.-](\d{1,2})(?:[/.-](\d{2}|\d{4}))?$/.exec(i),t){let[c,u]=[Number(t[1]),Number(t[2])],[s,f]=ee(r)?[c,u]:[u,c];return z(n,L(t[3]),s,f)}}function z(e,n,r,o){if(n!==void 0)return l(n,r,o);let t=Number(e.slice(0,4)),i=l(t,r,o);return i===void 0?l(t+1,r,o):m(e)-m(i)>183*x?l(t+1,r,o):i}function re(e,n){let r=e.toLowerCase().replace(/,/g," ").replace(/(\d{4}-\d{2}-\d{2})t(?=\d)/,"$1 ").replace(/\s+/g," ").trim();if(r==="")return;let o=ne(r);if(o.bad)return;let t=te(o.rest,n.today,n.locale??b);if(t===void 0||t===null&&o.minutes===void 0)return;let i=t??n.base?.day??n.today;return n.time?{day:i,minutes:o.minutes??n.base?.minutes??9*60}:{day:i}}var oe=e=>/^[A-Z]{3}$/.test(e??"");function U(e){let{format:n,unit:r,currency:o,locale:t}=e,i=oe(r),a=n==="money"||!n&&i,d=a?i?r:o:void 0;return{...a?{format:"money"}:n?{format:n}:{},...r&&!(a&&i)?{unit:r}:{},...d?{currency:d}:{},...t?{locale:t}:{}}}function $e(e){switch(e.format){case"money":return e.currency?`An amount of money in ${e.currency}: a plain number, 1250.5 for 1,250.50 ${e.currency}.`:"An amount of money, in no named currency: a plain number.";case"percent":return"A fraction said as a percent: 0.15 is 15%.";default:return e.unit?`A number of ${e.unit}.`:"A number."}}function B(e){let n=w(e)?.innerType;return n===void 0?e:B(n)}var ie={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ue=e=>(e?._zod?.def?.checks??[]).map(n=>n._zod?.def).filter(n=>n!==void 0);function _(e){let n=B(e),r=w(n),o=r?.type,t=ue(n);if(o==="enum")return{type:"choice",options:Object.keys(r?.entries??{})};let i=E(n);if(i)return i==="image"?{type:"file",image:!0}:{type:"file"};if(o==="boolean")return{type:"boolean"};if(o==="array"){let a=_(r?.element);return a.type==="unknown"?{type:"unknown"}:{type:"several",of:a}}if(o==="number"){let a,d,c;for(let u of t){u.check==="multiple_of"&&typeof u.value=="number"?c=u.value:u.check==="number_format"&&(u.format==="safeint"||u.format==="int32"||u.format==="uint32")&&(c??=1);let s=u.check==="number_format"&&u.format?ie[u.format]:void 0,f=s?s[0]:u.check==="greater_than"&&u.inclusive&&typeof u.value=="number"?u.value:void 0,A=s?s[1]:u.check==="less_than"&&u.inclusive&&typeof u.value=="number"?u.value:void 0;f!==void 0&&(a=a===void 0?f:Math.max(a,f)),A!==void 0&&(d=d===void 0?A:Math.min(d,A))}return{type:"number",...a===void 0?{}:{min:a},...d===void 0?{}:{max:d},...c===void 0?{}:{step:c},...T(n)==="duration"?{duration:!0}:{},...S(e)?{amount:U(S(e))}:{}}}if(o==="string"){if(t.some(s=>s.fn===k||s.format==="datetime")||r?.format==="datetime")return{type:"date",time:!0,instant:!0};let d=[r?.pattern,...t.map(s=>s.pattern)].filter(s=>s instanceof RegExp).map(s=>s.source);if(d.some(s=>s.includes("\\d{4}")))return d.some(s=>s.includes("\\d{2}:\\d{2}"))?{type:"date",time:!0}:{type:"date"};let c=t.some(s=>s.check==="max_length"&&typeof s.maximum=="number"&&s.maximum>500),u=T(n);return c?{type:"text",long:!0}:u==="phone"||u==="place"?{type:"text",holds:u}:{type:"text"}}return{type:"unknown"}}function ae(e,n){let r=e?.shape;return!r||!(n in r)?{type:"unknown"}:_(r[n])}function de(e){if(e===void 0||e==="web"||e.startsWith("ai:")||e.startsWith("app:"))return;if(e==="api")return"via the API";if(e==="cli")return"via the command line";let[n,...r]=e.split(":"),o=r.join(":");return(n==="mcp"||n==="view")&&o?`via ${o}`:n==="mcp"?"via an agent's tools":`via ${e}`}var Y=e=>{if(!e.currency)return{before:!0};try{let n=$(e.locale),r=new Intl.NumberFormat(n,{style:"currency",currency:e.currency}).formatToParts(1),o=r.findIndex(a=>a.type==="currency"),t=r.findIndex(a=>a.type==="integer"),i;try{i=new Intl.DisplayNames([n],{type:"currency"}).of(e.currency)}catch{}return{...o>=0?{symbol:r[o].value}:{},before:o<t,...i?{name:i}:{}}}catch{return{symbol:e.currency,before:!0}}};function se(e){let n=e.locale;if(e.format==="money"){let{symbol:r,before:o,name:t}=Y(e),i=p(1250,n,{minimumFractionDigits:2,maximumFractionDigits:2});return{...r?o?{prefix:r}:{suffix:r}:{},placeholder:i,hint:t?`in ${t}`:e.currency?`in ${e.currency}`:"an amount of money"}}return e.format==="percent"?{suffix:"%",placeholder:p(15,n),hint:"as a percent"}:{...e.unit?{suffix:e.unit}:{},placeholder:"",hint:e.unit?`in ${e.unit}`:"a number"}}function ce(e,n){return e===void 0||!Number.isFinite(e)?"":n.format==="money"?p(e,n.locale,Number.isInteger(e)?{maximumFractionDigits:0}:{minimumFractionDigits:2,maximumFractionDigits:2}):n.format==="percent"?p(e*100,n.locale,{maximumFractionDigits:4}):p(e,n.locale,{maximumFractionDigits:6})}function fe(e){try{let n=new Intl.NumberFormat($(e)).formatToParts(12345.6);return{group:n.find(r=>r.type==="group")?.value??",",decimal:n.find(r=>r.type==="decimal")?.value??"."}}catch{return{group:",",decimal:"."}}}function me(e,n){let{group:r,decimal:o}=fe(n),t=e.replace(/[\s  ']/g,"").replace(/[−–]/g,"-");if(o!=="."&&!t.includes(o)&&/^-?\d+\.\d{1,2}$/.test(t))return Number(t);if(r&&(t=t.split(r).join("")),o!=="."&&(t=t.replace(o,".")),!/^-?(\d+\.?\d*|\.\d+)$/.test(t))return;let i=Number(t);return Number.isFinite(i)?i:void 0}function le(e,n){let r=e.trim();if(r==="")return;let o=n?.format==="money"&&n.currency?Y(n).symbol:void 0,t=r;o&&(t=t.split(o).join("")),n?.currency&&(t=t.replace(new RegExp(n.currency,"gi"),"")),t=t.replace(/^[$€£¥₹]|[$€£¥₹]$/g,""),/%\s*$/.test(t)&&(t=t.replace(/%\s*$/,"")),n?.unit&&n.format!=="money"&&(t=t.replace(new RegExp(`\\s*${n.unit.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*$`),""));let a=me(t,n?.locale);if(a!==void 0)return n?.format==="percent"?a/100:a}export{U as a,$e as b,B as c,_ as d,ae as e,W as f,P as g,de as h,se as i,ce as j,le as k,I as l,j as m,h as n,O as o,H as p,G as q,V as r,re as s};
@@ -1 +0,0 @@
1
- import{c as b,d as J}from"./chunk.Z7ZCR4LN.js";import{a as O,f as q}from"./chunk.FSAHO3LV.js";import{$a as D,Ab as w,B as m,Ea as j,Fa as A,Pa as v,ab as L,bb as N,hc as Z,ic as k,ja as R,ma as x,ta as S,vb as M,zb as P}from"./chunk.X7W27IRI.js";var E=n=>n.safeParse?.(void 0).success??!1,T=n=>b(n).shape,F=n=>{let s=b(n);if(m(s)?.type!=="literal")return;let e=m(s)?.values;return e&&e.length===1&&typeof e[0]=="string"?e[0]:void 0};function g(n,s){let e=E(s),o=b(s),r=m(o)?.type,l=M(s);if(l)return{control:"node",name:n,optional:e,kinds:l};let y=S(s);if(y)return{control:"linked",name:n,optional:e,relation:y};if(A(s)){let a=j(n);return{control:"repeat",name:n,optional:e,...a?{of:a}:{}}}if(r==="boolean")return{control:"boolean",name:n,optional:e};let p=R(o);if(p)return{control:"file",name:n,optional:e,...p==="image"?{image:!0}:{}};if(r==="object"){let a=o.shape??{};return{control:"group",name:n,optional:e,fields:Object.entries(a).map(([c,d])=>g(c,d))}}if(r==="union"){let a=m(o)?.options??[],c=a.map(t=>T(t));if(c.every(t=>t!==void 0)){let t=Object.keys(c[0]??{}).find(f=>c.every(u=>F(u?.[f])!==void 0));if(t)return{control:"variant",name:n,optional:e,tag:t,options:a.map((f,u)=>({value:F(c[u]?.[t])??"",fields:Object.entries(c[u]??{}).filter(([h])=>h!==t).map(([h,z])=>g(h,z))}))}}let d=a.map(t=>F(t));return d.every(t=>t!==void 0)?{control:"choice",name:n,optional:e,options:d}:{control:"opaque",name:n,optional:e}}if(r==="array"){let a=m(o)?.element;return a!==void 0?{control:"list",name:n,optional:e,item:g(n,a)}:{control:"opaque",name:n,optional:e}}let i=J(s);return i.type==="text"?{control:"text",name:n,optional:e,...i.long?{long:!0}:{},...x(o)?{app:!0}:{},...O(o)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:e,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:e,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:e,...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:e,options:i.options}:{control:"opaque",name:n,optional:e}}function B(n){let s=n.shape;return s?Object.entries(s).map(([e,o])=>g(e,o)):[]}function K(n,s){let e={...s};for(let o of n){let r=s[o.name];r===void 0&&!o.optional&&(o.control==="list"||o.control==="boolean")&&(e[o.name]=o.control==="list"?[]:!1),o.control==="text"&&o.holds&&typeof r=="string"&&(e[o.name]=r.trim()===""?void 0:o.holds==="duration"?q(r)??r:r.trim()),o.control==="group"&&r!==void 0&&typeof r=="object"&&r!==null&&(e[o.name]=K(o.fields,r))}return e}function C(n,s,e){let o=n.derived?.act==="edit"&&n.subject?e[n.subject.arg]:void 0,r=typeof o=="string"?s.getNode(o):void 0;return r?Object.fromEntries((n.writes??[]).filter(l=>r[l]!==void 0&&r[l]!==null).map(l=>[l,r[l]])):{}}function I(n,s){return Object.fromEntries(Object.entries(n).filter(([e,o])=>!Object.hasOwn(s,e)||JSON.stringify(o)!==JSON.stringify(s[e])))}function _(n,s,e,o){let r=Z.keptFrom?.(n,s),l=new Set;if(!r)return l;let y=Object.keys(e.input.shape??{});for(let c of e.creates??[]){let d=r({id:"\0new",kind:c});for(let t of y)d?.(t)&&l.add(t)}let p=o===void 0?void 0:n.graph.getNode(o),i=p&&n.schema.tryDefinition(p.kind),a=p&&r(p);if(i&&a)for(let c of w(e,i))a(c)&&y.includes(c)&&l.add(c);return l}function dn(n,s,e,o){let r=new Set,l=s?.sees??[];if(L(e)||!l.some(k))return r;let y=D(e),p=(d,t)=>{let f=l.filter(u=>u.kinds.includes(d)&&N(u,y));return f.some(k)?v.has(t)||f.some(u=>!k(u)||(u.fields===void 0||u.fields.includes(t))&&!u.hide?.includes(t)):!0},i=Object.keys(o.input.shape??{}),a=new Map,c=(d,t)=>a.set(d,a.get(d)===!0||t);for(let d of o.creates??[]){let t=Object.keys(n.tryDefinition(d)?.fields.shape??{});for(let f of i)t.includes(f)&&c(f,p(d,f))}for(let d of P(n,o)){let t=n.tryDefinition(d);if(t)for(let f of w(o,t))i.includes(f)&&c(f,p(d,f))}for(let[d,t]of a)t||r.add(d);return r}export{B as a,K as b,C as c,I as d,_ as e,dn as f};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.VMGWYCXU.js";import"./chunk.G4JJXA63.js";import"./chunk.LAF6GTBN.js";import"./chunk.QU356VB2.js";import"./chunk.ZSW74NVJ.js";import"./chunk.ZE4CTZQ3.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.DMNXYMLC.js";import"./chunk.2YGQVI6T.js";import"./chunk.HPD5ZDZH.js";import"./chunk.WVUJXDXZ.js";import"./chunk.52QAIGCD.js";import"./chunk.PPUAPAWR.js";import"./chunk.IHFNLKXV.js";import"./chunk.577PGFUT.js";import"./chunk.FBY5IUGU.js";import"./chunk.4K5QCJFH.js";import"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.X7W27IRI.js";import"./chunk.AJZBJBMO.js";export{i as draftAnswer,h as draftFromLens,b as draftSight,l as draftView,a as isDraftFailure,c as judgeLens,d as lensEditOf,f as lensFromSpec,j as recipeDraft,g as recipeOfLens,m as refineDraft,o as runDraftTool,e as takeBackEditOf,k as templateDraft,n as withReaderLenses};
@@ -1 +0,0 @@
1
- import{j as a,k as o}from"./chunk.SBBNIYVB.js";import"./chunk.IX6RNGAT.js";import"./chunk.3H4NVUWV.js";import"./chunk.XSYBNUXF.js";import"./chunk.GCVO6N26.js";import"./chunk.LRRVBM4F.js";import"./chunk.PKKA6JWA.js";import"./chunk.5EAQDBBE.js";import"./chunk.YT2CYCVT.js";import"./chunk.2OBIO5Y6.js";import"./chunk.GF7LA4QG.js";import"./chunk.AEHPDVLQ.js";import"./chunk.WVUJXDXZ.js";import"./chunk.52QAIGCD.js";import"./chunk.PPUAPAWR.js";import"./chunk.IHFNLKXV.js";import"./chunk.577PGFUT.js";import"./chunk.FBY5IUGU.js";import"./chunk.4K5QCJFH.js";import"./chunk.GZHZLJBF.js";import"./chunk.QRMWFEEH.js";import"./chunk.MVN6H65Q.js";import"./chunk.OJGHDWI6.js";import"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.Y5Z4ZDTO.js";import{ja as n}from"./chunk.UWIYKGYK.js";import"./chunk.X7W27IRI.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{s as frameworkViews};
@@ -1 +0,0 @@
1
- import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./chunk.H243UV3Z.js";import{a,b}from"./chunk.PKKA6JWA.js";import"./chunk.5EAQDBBE.js";import"./chunk.YT2CYCVT.js";import"./chunk.Z7ZCR4LN.js";import"./chunk.RIW7SQH4.js";import"./chunk.FSAHO3LV.js";import"./chunk.Y5Z4ZDTO.js";import"./chunk.UWIYKGYK.js";import"./chunk.X7W27IRI.js";import"./chunk.AJZBJBMO.js";export{j as ARRANGE_NARROW,o as ArrangeBar,e as CHIP_FIELDS,d as MANY_AT_THE_FAR_END,c as TYPED_FROM,p as arrangementCaption,a as arrangementOf,i as chipOffers,m as directionWords,g as farCount,f as farCounts,l as inSentence,h as offeredFilters,n as preloadArrangeLists,k as sayCondition,b as withArrangement};
@@ -1 +0,0 @@
1
- import{a as f}from"./chunk.ZE4CTZQ3.js";import{X as d}from"./chunk.X7W27IRI.js";function w(n){let o=n.indexOf("{"),r=n.indexOf("["),t=r!==-1&&(o===-1||r<o)?r:o;if(t===-1)return;let e=n[t],a=e==="["?"]":"}",i=0,c=!1,l=!1;for(let s=t;s<n.length;s++){let u=n[s];if(c){l?l=!1:u==="\\"?l=!0:u==='"'&&(c=!1);continue}if(u==='"')c=!0;else if(u===e)i+=1;else if(u===a&&(i-=1,i===0))try{return JSON.parse(n.slice(t,s+1))}catch{return}}}function v(n,o){let r;try{r=n.mutation(o.mutation)}catch{return o}let t={...o.args},e=!1;for(let a of f(r.input)){if(a.control!=="node")continue;let i=t[a.name];if(typeof i!="string"||i.length===0||n.graph.getNode(i))continue;let c=i.trim().toLowerCase(),l=[...n.graph.allNodes()].filter(s=>(a.kinds.includes("*")||a.kinds.includes(s.kind))&&d(n.schema.tryDefinition(s.kind),s).trim().toLowerCase()===c);l.length===1&&(t[a.name]=l[0].id,e=!0)}return e?{...o,args:t}:o}function P(n,o,r){let t=r===void 0?null:new Set(r),e=[];for(let a of o){if(typeof a.mutation!="string")continue;let i=!0;try{n.mutation(a.mutation)}catch{i=!1}i?t&&!t.has(a.mutation)&&e.push({proposal:a,why:"not-allowed"}):e.push({proposal:a,why:"unknown"})}return e}function x(n,o,r){let t=r===void 0?null:new Set(r);return o.filter(e=>{if(typeof e.mutation!="string"||t&&!t.has(e.mutation))return!1;try{n.mutation(e.mutation)}catch{return!1}return e.args!==null&&typeof e.args=="object"})}export{w as a,v as b,P as c,x as d};
@@ -1 +0,0 @@
1
- import{H as W}from"./chunk.Y5Z4ZDTO.js";import{F as H,b as A,c as T,d as v,e as f,f as x,k as I,n as b,pa as k,w as R}from"./chunk.UWIYKGYK.js";import{Qc as s,Wc as y,Xc as r}from"./chunk.X7W27IRI.js";import{b as B}from"./chunk.AJZBJBMO.js";var u=B(H(),1),L=e=>typeof e=="object"&&e!==null&&"idx"in e;function E(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":L(window.history.state)?"pages":null}function J(e){let n=e.face??(e.stop&&v(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:E(e.basePath)??n}function K(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&E(e.basePath)===null}function Q(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?T(f(window.location.hash)):void 0}function X({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:U,places:w,opens:$}){let{view:F,go:p}=k(),g=(0,u.useRef)({shown:t,view:F,onFace:i});g.current={shown:t,view:F,onFace:i};let S=(0,u.useRef)(n??"/"),M=()=>{S.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:N,onFace:V}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",y(c??S.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){M();let m=a===void 0?N:j(v(a),w),h=Y(m)?q($):m,O=h!==m&&h.overview?"graview":o,P=_(O,h,U);p(P),window.history.pushState(null,"",`${y(s,{basePath:e})}${x(P)}`),V?.(O);return}V?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=E(e)??"pages",{shown:a,onFace:d}=g.current;if(c==="pages"){a!=="pages"&&d?.("pages");return}a==="pages"&&(p(j(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function j(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:R(i.kind)}:e}function _(e,n,t){return e==="graview"?b(n,!0):n.overview?I(b(n,!1),W(n,t)):n}function Y(e){return e.focusId===null&&e.overview!==!0}function q(e){return e??{...A,overview:!0}}export{J as a,K as b,Q as c,X as d,j as e,_ as f,Y as g,q as h};