graview 0.1.42 → 0.1.44

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 (204) hide show
  1. package/dist/preview/{chunk.XDPIS7RS.js → chunk.27ZVVPRZ.js} +1 -1
  2. package/dist/preview/chunk.2AZTW66C.js +1 -0
  3. package/dist/preview/{chunk.CSWX7YGI.js → chunk.2CPC3HQI.js} +1 -1
  4. package/dist/preview/{chunk.HQMGTPDC.js → chunk.2EXY4AHX.js} +4 -4
  5. package/dist/preview/chunk.2O2THM2R.js +1 -0
  6. package/dist/preview/{chunk.J7ZMNAWB.js → chunk.3IUJ4GW7.js} +1 -1
  7. package/dist/preview/chunk.3L7OEBJH.js +1 -0
  8. package/dist/preview/{chunk.QHLD4TZW.js → chunk.3M4VCAA3.js} +1 -1
  9. package/dist/preview/chunk.3OKJ4GOA.js +1 -0
  10. package/dist/preview/chunk.3PNDXNX6.js +1 -0
  11. package/dist/preview/{chunk.WERBD5ZR.js → chunk.3TBH2FMZ.js} +1 -1
  12. package/dist/preview/{chunk.IWLVZGW5.js → chunk.4B4DKCS4.js} +1 -1
  13. package/dist/preview/{chunk.PCTVLNOS.js → chunk.4EPT2CQG.js} +1 -1
  14. package/dist/preview/chunk.4JWT6LIS.js +25 -0
  15. package/dist/preview/chunk.4WCQWILK.js +1 -0
  16. package/dist/preview/chunk.56DR42FA.js +1 -0
  17. package/dist/preview/chunk.5JPELFMA.js +2 -0
  18. package/dist/preview/chunk.5WEEZ7WD.js +1 -0
  19. package/dist/preview/chunk.64QDUERE.js +1 -0
  20. package/dist/preview/{chunk.I7QCXRP7.js → chunk.6BIRNR5P.js} +1 -1
  21. package/dist/preview/{chunk.7EB6SDUQ.js → chunk.6NFR2LYQ.js} +1 -1
  22. package/dist/preview/chunk.6VIZGLDK.js +1 -0
  23. package/dist/preview/{chunk.L6HKDIZB.js → chunk.7AEE3VHC.js} +1 -1
  24. package/dist/preview/chunk.7B5BZZBG.js +1 -0
  25. package/dist/preview/chunk.7HL7CFXJ.js +1 -0
  26. package/dist/preview/chunk.7JVBVB4A.js +1 -0
  27. package/dist/preview/{chunk.QXMTGLHR.js → chunk.7PUFYK3B.js} +1 -1
  28. package/dist/preview/{chunk.ARTJL3X2.js → chunk.7UV7ODXU.js} +1 -1
  29. package/dist/preview/chunk.ALFW4ZJQ.js +1 -0
  30. package/dist/preview/{chunk.HG2IO5NS.js → chunk.ATKKTPJS.js} +1 -1
  31. package/dist/preview/chunk.AW2T3KFV.js +5 -0
  32. package/dist/preview/{chunk.PACJFDDU.js → chunk.B2CIQ66N.js} +1 -1
  33. package/dist/preview/{chunk.5FHH5NR6.js → chunk.B7FZLIAO.js} +1 -1
  34. package/dist/preview/{chunk.NS3Z7QNP.js → chunk.BA4KQR5H.js} +1 -1
  35. package/dist/preview/chunk.CDFVEL2Y.js +1 -0
  36. package/dist/preview/chunk.CSQNDAEK.js +1 -0
  37. package/dist/preview/chunk.D2RK2KJD.js +35 -0
  38. package/dist/preview/chunk.DAZEFSWI.js +1 -0
  39. package/dist/preview/{chunk.KMGGP6XT.js → chunk.DGXWL4GC.js} +2 -2
  40. package/dist/preview/chunk.DLVNW4HU.js +1 -0
  41. package/dist/preview/chunk.E2AJ7U5Z.js +1 -0
  42. package/dist/preview/chunk.EJAWDI2V.js +1 -0
  43. package/dist/preview/chunk.EJOTTZWZ.js +1 -0
  44. package/dist/preview/{chunk.WVN62OMH.js → chunk.ESU2DD3J.js} +1 -1
  45. package/dist/preview/chunk.EW364363.js +9 -0
  46. package/dist/preview/chunk.EYEIDL3T.js +1 -0
  47. package/dist/preview/chunk.EZRGGPAN.js +1 -0
  48. package/dist/preview/{chunk.SUQU4AXG.js → chunk.F4DWRBO7.js} +1 -1
  49. package/dist/preview/{chunk.K63BUJBF.js → chunk.FBIK4LTM.js} +2 -2
  50. package/dist/preview/{chunk.ILPD5CZG.js → chunk.FIJNKSMQ.js} +1 -1
  51. package/dist/preview/{chunk.Y2QDZLSY.js → chunk.FNF6XQI5.js} +1 -1
  52. package/dist/preview/chunk.FNXW46U4.js +349 -0
  53. package/dist/preview/chunk.FUYMLDNJ.js +7 -0
  54. package/dist/preview/chunk.FVHECT47.js +1 -0
  55. package/dist/preview/{chunk.KZDLDXLB.js → chunk.GAN77YDU.js} +1 -1
  56. package/dist/preview/{chunk.O7VHAKSA.js → chunk.GBCWI2LF.js} +1 -1
  57. package/dist/preview/chunk.H4GHKBMH.js +1 -0
  58. package/dist/preview/chunk.HB34VQKQ.js +1 -0
  59. package/dist/preview/chunk.HKA27VJO.js +1 -0
  60. package/dist/preview/{chunk.4YBP552Z.js → chunk.HKD5SR45.js} +2 -2
  61. package/dist/preview/{chunk.6HUS5UHZ.js → chunk.HP72LB3B.js} +1 -1
  62. package/dist/preview/{chunk.B6DKKNVR.js → chunk.IBWPRK2R.js} +1 -1
  63. package/dist/preview/{chunk.V3K32XD7.js → chunk.IIB22IIP.js} +1 -1
  64. package/dist/preview/{chunk.57R4ZUMM.js → chunk.IN4PKQO5.js} +1 -1
  65. package/dist/preview/chunk.IPHWGBZE.js +6 -0
  66. package/dist/preview/{chunk.B7DCQJXV.js → chunk.IQWKEGWG.js} +1 -1
  67. package/dist/preview/chunk.JEMQ66FT.js +19 -0
  68. package/dist/preview/chunk.JGYGSNQY.js +1 -0
  69. package/dist/preview/{chunk.EC2T2UVH.js → chunk.JLOSQ5UY.js} +2 -2
  70. package/dist/preview/{chunk.X5WIS4BC.js → chunk.JQ7WY2VZ.js} +1 -1
  71. package/dist/preview/chunk.JUT2VCFW.js +1 -0
  72. package/dist/preview/{chunk.VTUMPH4Z.js → chunk.KERLVJ6I.js} +1 -1
  73. package/dist/preview/chunk.L6FWIQXS.js +1 -0
  74. package/dist/preview/{chunk.U3MQUIJL.js → chunk.LKF4BBCW.js} +1 -1
  75. package/dist/preview/chunk.LKXYZK5H.js +1 -0
  76. package/dist/preview/chunk.LULTKYE3.js +1 -0
  77. package/dist/preview/chunk.LUPBT6YM.js +1 -0
  78. package/dist/preview/{chunk.VO6DBVZR.js → chunk.LYSHLKAX.js} +1 -1
  79. package/dist/preview/chunk.LYUPJ4VV.js +1 -0
  80. package/dist/preview/{chunk.ZQCGDTQ3.js → chunk.MFLJIFZD.js} +1 -1
  81. package/dist/preview/chunk.MOF2D6DV.js +1 -0
  82. package/dist/preview/{chunk.CAZX6OPN.js → chunk.MWUP5X47.js} +1 -1
  83. package/dist/preview/{chunk.LFJH6X6O.js → chunk.MZOIPCDA.js} +1 -1
  84. package/dist/preview/{chunk.VMBIFUYX.js → chunk.N5ULWKR4.js} +1 -1
  85. package/dist/preview/{chunk.27P37343.js → chunk.NBOZPPSM.js} +1 -1
  86. package/dist/preview/chunk.NPS2WN7T.js +1 -0
  87. package/dist/preview/chunk.NTFCZYOR.js +1 -0
  88. package/dist/preview/chunk.O4VSQ2ER.js +1 -0
  89. package/dist/preview/{chunk.ROHM3ETN.js → chunk.OAWAUB4P.js} +1 -1
  90. package/dist/preview/chunk.OG6GNGTX.js +21 -0
  91. package/dist/preview/{chunk.V5VQCANB.js → chunk.OGF6UORU.js} +1 -1
  92. package/dist/preview/chunk.OK4FSBHI.js +1 -0
  93. package/dist/preview/chunk.P546VMA5.js +1 -0
  94. package/dist/preview/chunk.P5K7EYDK.js +1 -0
  95. package/dist/preview/{chunk.BZ4VZ6WQ.js → chunk.PL2P2OON.js} +1 -1
  96. package/dist/preview/chunk.PSTE3LZL.js +5 -0
  97. package/dist/preview/chunk.PX6VAZFJ.js +1 -0
  98. package/dist/preview/{chunk.P6J6VFF5.js → chunk.QJJKITXF.js} +1 -1
  99. package/dist/preview/{chunk.U6YOAS4X.js → chunk.QNJYXB3U.js} +1 -1
  100. package/dist/preview/chunk.RDGFZPKN.js +1 -0
  101. package/dist/preview/{chunk.LWAZ6ZO6.js → chunk.REEDZSCG.js} +2 -2
  102. package/dist/preview/chunk.REOYQTFP.js +1 -0
  103. package/dist/preview/{chunk.2ZGICECC.js → chunk.RLMW7DU6.js} +1 -1
  104. package/dist/preview/{chunk.VEP4EJ2N.js → chunk.RNUGQRJI.js} +1 -1
  105. package/dist/preview/{chunk.ZRIDKFTV.js → chunk.RVQYXPCM.js} +1 -1
  106. package/dist/preview/{chunk.LQGXUMUX.js → chunk.RYNCEZ6Q.js} +1 -1
  107. package/dist/preview/{chunk.WUQOSVQU.js → chunk.T6S3CEW7.js} +2 -2
  108. package/dist/preview/{chunk.PH5ITX3N.js → chunk.TDCO7LEA.js} +1 -1
  109. package/dist/preview/chunk.TJO5Y2OJ.js +1 -0
  110. package/dist/preview/chunk.TTSNHX3F.js +1 -0
  111. package/dist/preview/{chunk.QHP7AJUV.js → chunk.U3CV5CCL.js} +1 -1
  112. package/dist/preview/{chunk.VKJAGZNU.js → chunk.UG23RICT.js} +1 -1
  113. package/dist/preview/chunk.URCC626R.js +1 -0
  114. package/dist/preview/{chunk.37NF3YXZ.js → chunk.UXLJZIYX.js} +1 -1
  115. package/dist/preview/{chunk.AQTCN7KQ.js → chunk.UZSZPMRC.js} +1 -1
  116. package/dist/preview/chunk.V4DR25S4.js +1 -0
  117. package/dist/preview/chunk.VAUG5TGZ.js +1 -0
  118. package/dist/preview/{chunk.HAY22FPJ.js → chunk.WE5SA6TP.js} +1 -1
  119. package/dist/preview/chunk.WNYPP52L.js +1 -0
  120. package/dist/preview/chunk.WPLKHIO5.js +88 -0
  121. package/dist/preview/{chunk.XNW7PUAF.js → chunk.XPIDPZKS.js} +1 -1
  122. package/dist/preview/{chunk.P7ISPJAQ.js → chunk.Y2MIG2C2.js} +1 -1
  123. package/dist/preview/chunk.YE4GZVOX.js +1 -0
  124. package/dist/preview/chunk.YERDP6YF.js +1 -0
  125. package/dist/preview/{chunk.5NDYYTT4.js → chunk.YGX2AE36.js} +1 -1
  126. package/dist/preview/chunk.YTXEPWVW.js +1 -0
  127. package/dist/preview/chunk.YTZDCIX2.js +1 -0
  128. package/dist/preview/chunk.YYPK7IDM.js +1 -0
  129. package/dist/preview/chunk.ZKBSEUK4.js +1 -0
  130. package/dist/preview/chunk.ZN77U6SU.js +1 -0
  131. package/dist/preview/{chunk.HOTOH7ZB.js → chunk.ZP6PS5Z4.js} +1 -1
  132. package/dist/preview/chunk.ZZ5F5I3O.js +1 -0
  133. package/dist/preview/index.html +46 -45
  134. package/dist/preview/page.js +6 -6
  135. package/package.json +6 -6
  136. package/dist/preview/chunk.22QEYFWI.js +0 -1
  137. package/dist/preview/chunk.35FR36BQ.js +0 -1
  138. package/dist/preview/chunk.36LP3I7Z.js +0 -21
  139. package/dist/preview/chunk.3K2KBIRG.js +0 -1
  140. package/dist/preview/chunk.3SKUJWFC.js +0 -1
  141. package/dist/preview/chunk.3WABA2WQ.js +0 -1
  142. package/dist/preview/chunk.4NBB44YU.js +0 -1
  143. package/dist/preview/chunk.4QEDYRES.js +0 -349
  144. package/dist/preview/chunk.4YRCKOX2.js +0 -1
  145. package/dist/preview/chunk.6MLAJKYM.js +0 -1
  146. package/dist/preview/chunk.6NF32PAT.js +0 -1
  147. package/dist/preview/chunk.6WB24MS3.js +0 -1
  148. package/dist/preview/chunk.7HZVCW3Q.js +0 -1
  149. package/dist/preview/chunk.7MJM3OVC.js +0 -1
  150. package/dist/preview/chunk.7OSL64QH.js +0 -1
  151. package/dist/preview/chunk.7XDNCCLG.js +0 -6
  152. package/dist/preview/chunk.7Z2GTKA4.js +0 -1
  153. package/dist/preview/chunk.AOC2KUFE.js +0 -1
  154. package/dist/preview/chunk.AWSUMY3D.js +0 -1
  155. package/dist/preview/chunk.B65HPL4I.js +0 -1
  156. package/dist/preview/chunk.BJET6KOG.js +0 -1
  157. package/dist/preview/chunk.D3ELYLME.js +0 -1
  158. package/dist/preview/chunk.DNMBZONP.js +0 -1
  159. package/dist/preview/chunk.DXAUXGNN.js +0 -1
  160. package/dist/preview/chunk.EHMCRUYR.js +0 -1
  161. package/dist/preview/chunk.EQIQPY4O.js +0 -1
  162. package/dist/preview/chunk.ETWOZQWL.js +0 -1
  163. package/dist/preview/chunk.EVHXF7LZ.js +0 -19
  164. package/dist/preview/chunk.FFRWSODT.js +0 -1
  165. package/dist/preview/chunk.G4AY6NGN.js +0 -1
  166. package/dist/preview/chunk.GN2SZEFH.js +0 -1
  167. package/dist/preview/chunk.GXWOEOUY.js +0 -1
  168. package/dist/preview/chunk.IGA7OD3L.js +0 -1
  169. package/dist/preview/chunk.IXS5XBG6.js +0 -1
  170. package/dist/preview/chunk.JCTT2LAK.js +0 -1
  171. package/dist/preview/chunk.JE4QQEJE.js +0 -25
  172. package/dist/preview/chunk.JEBB3WM7.js +0 -1
  173. package/dist/preview/chunk.JPD2I4Z7.js +0 -1
  174. package/dist/preview/chunk.LKGDN25E.js +0 -1
  175. package/dist/preview/chunk.LMUFLZYT.js +0 -1
  176. package/dist/preview/chunk.LZH65VSN.js +0 -7
  177. package/dist/preview/chunk.MUBZIU6F.js +0 -1
  178. package/dist/preview/chunk.MZ6I2Q4E.js +0 -1
  179. package/dist/preview/chunk.NTJNBKWC.js +0 -1
  180. package/dist/preview/chunk.OMCXJGDI.js +0 -1
  181. package/dist/preview/chunk.OTHGZPUC.js +0 -1
  182. package/dist/preview/chunk.P6FGIYWP.js +0 -35
  183. package/dist/preview/chunk.PYFQGBU3.js +0 -1
  184. package/dist/preview/chunk.RFCTUGMU.js +0 -1
  185. package/dist/preview/chunk.RR4RZH4S.js +0 -1
  186. package/dist/preview/chunk.S5K4FLLG.js +0 -1
  187. package/dist/preview/chunk.SZKVNPEF.js +0 -1
  188. package/dist/preview/chunk.T3F6BKIO.js +0 -1
  189. package/dist/preview/chunk.UG727PEE.js +0 -5
  190. package/dist/preview/chunk.VXZFW52D.js +0 -1
  191. package/dist/preview/chunk.VYPR2MZO.js +0 -1
  192. package/dist/preview/chunk.W77OH637.js +0 -1
  193. package/dist/preview/chunk.WODEO2JF.js +0 -9
  194. package/dist/preview/chunk.WZEA2UK6.js +0 -1
  195. package/dist/preview/chunk.X2M7IOQA.js +0 -1
  196. package/dist/preview/chunk.XPML6T3P.js +0 -1
  197. package/dist/preview/chunk.YJM23BJL.js +0 -88
  198. package/dist/preview/chunk.YLGSXLXF.js +0 -1
  199. package/dist/preview/chunk.YLI6I6XP.js +0 -1
  200. package/dist/preview/chunk.YRYEWVNP.js +0 -1
  201. package/dist/preview/chunk.Z2TYCMBT.js +0 -5
  202. package/dist/preview/chunk.ZAFIZXGX.js +0 -1
  203. package/dist/preview/chunk.ZBYLAC3B.js +0 -2
  204. package/dist/preview/chunk.ZOS5APMD.js +0 -1
@@ -0,0 +1 @@
1
+ import"./chunk.WVUJXDXZ.js";import{a as k,b as q,c as pe}from"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import{n as me}from"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{G as Le,M as S,O as ue,R as ce,_ as ge,ba as he}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import{ja as oe,ma as w,oa as le,qa as E,ra as x,sa as se,ta as Y,vc as de}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as U}from"./chunk.AJZBJBMO.js";var h=U(Le(),1);async function ye(e,n){let i=await createImageBitmap(e);try{let r=Math.min(1,n/Math.max(i.width,i.height)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(i.width*r)),a.height=Math.max(1,Math.round(i.height*r));let l=a.getContext("2d");if(l===null)throw new Error("This browser will not give us a canvas to resize with.");return l.drawImage(i,0,0,a.width,a.height),a}finally{i.close()}}var t=U(ce(),1),Ve=2048,Ie=.85;function _(e){return e<1e3?`${e} bytes`:e<1e6?`${Math.round(e/1e3)} KB`:`${(e/1e6).toFixed(e<1e7?1:0)} MB`}function z(e){if(e.type==="application/pdf")return"PDF";let n=/\.([a-z0-9]{2,5})$/i.exec(e.name??"")?.[1];return n?n.toUpperCase():(e.type.split("/")[1]??e.type).replace(/^x-|^vnd\./,"").split(/[.+-]/)[0].toUpperCase()}function ke(e){let n=[...new Set(e.map(i=>i==="image/*"?"pictures":i==="video/*"?"videos":i==="*/*"||i==="*"?"any file":`${z({type:i})} files`))];return n.length<=1?n[0]??"no files":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function Fe(e,n){if(e.length===0)return!0;let i=`${n.split("/")[0]}/*`;return e.some(r=>r==="*"||r==="*/*"||r===n||r===i)}var fe=/^image\/hei[cf]$|\.hei[cf]$/i,be=e=>fe.test(e.type)||fe.test(e.name),De={mov:"video/quicktime",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",ogv:"video/ogg"},Be=e=>De[/\.([a-z0-9]{2,4})$/i.exec(e)?.[1]?.toLowerCase()??""];async function je(e,n,i){let r=e.name||(i.camera?"photo.jpg":"file"),a=e.type||(be({type:"",name:r})?"image/heic":Be(r)??"application/octet-stream"),l=be({type:a,name:r}),u=a.startsWith("image/")||l;if(i.image&&!u)return{refused:`\u201C${r}\u201D isn\u2019t a picture.`};if(i.video)return a.startsWith("video/")?K({blob:e,name:r,type:a},n):{refused:`\u201C${r}\u201D isn\u2019t a video.`};if(l||u&&/^image\/(jpeg|webp)$/.test(a)&&(i.camera||e.size>n.maxBytes||e.size>15e5))try{let c=await ye(e,Ve),b=await new Promise(p=>c.toBlob(p,"image/jpeg",Ie));if(b)return K({blob:b,name:l?r.replace(/\.hei[cf]$/i,"")+".jpg":r,type:"image/jpeg",width:c.width,height:c.height},n)}catch{if(l&&!Fe(n.kinds,a))return{refused:`\u201C${r}\u201D is a HEIC photo, which this browser can\u2019t turn into a JPEG and this host doesn\u2019t take. Save it as a JPEG and try again.`}}let y={};if(u&&!l)try{let c=await createImageBitmap(e);y={width:c.width,height:c.height},c.close()}catch{}return K({blob:e,name:r,type:a,...y},n)}function K(e,n){return Fe(n.kinds,e.type)?e.blob.size>n.maxBytes?{refused:`\u201C${e.name}\u201D is ${_(e.blob.size)}; this host takes files up to ${_(n.maxBytes)}.`}:e:{refused:`\u201C${e.name}\u201D is a ${z(e)} file; this host takes ${ke(n.kinds)}.`}}async function _e(e,n,i,r=!1){let a;try{a=await n.upload(e.blob,e.name)}catch(u){let s=u instanceof Error&&u.message.trim()?u.message.trim():"the host refused it";return{refused:`\u201C${e.name}\u201D wasn\u2019t kept: ${s}`}}return le(a)?i&&!E(a)?{refused:`\u201C${e.name}\u201D isn\u2019t a picture.`}:r&&!x(a)?{refused:`The host kept \u201C${e.name}\u201D as ${z(a)}, not as a video.`}:{...a,...a.width===void 0&&e.width?{width:e.width}:{},...a.height===void 0&&e.height?{height:e.height}:{}}:{refused:`The host\u2019s answer for \u201C${e.name}\u201D isn\u2019t a file a record can keep.`}}var F="var(--graview-radius, 8px)",P={color:"var(--graview-ink-muted)",fontSize:"0.8125rem"};function Z(e){let n=S(),i=ue()?.past!=null,[r,a]=(0,h.useState)(!1),l=n?.kept?ze(n,e.href):!0,[,u]=(0,h.useState)(0);return(0,h.useEffect)(()=>{if(typeof l!="object")return;let s=!0;return l.then(()=>s&&u(y=>y+1)),()=>void(s=!1)},[l]),[l===!1||i&&r,()=>a(!0)]}var J=new WeakMap;function ze(e,n){let i=J.get(e)?.get(n);if(i!==void 0)return i;let r;try{r=e.kept(n)}catch{return!0}if(typeof r=="boolean")return r;let a=J.get(e)??new Map;J.set(e,a);let l=Promise.resolve(r).then(u=>u!==!1,()=>!0);return a.set(n,l),l.then(u=>a.set(n,u)),l}function ee({file:e,style:n}){return(0,t.jsx)("span",{role:"img","aria-label":`${k(e)}, removed later`,"data-graview-removed-later":e.href,style:{display:"grid",placeItems:"center",textAlign:"center",padding:4,boxSizing:"border-box",fontSize:"0.6875rem",lineHeight:1.2,color:"var(--graview-ink-muted)",border:"1px dashed var(--graview-edge-bright)",borderRadius:F,...n},children:"removed later"})}function Q({file:e,size:n=56,style:i}){let r=S(),[a,l]=Z(e);return a?(0,t.jsx)(ee,{file:e,style:{width:n,height:n,flex:"none",...i}}):x(e)?(0,t.jsx)(Ae,{file:e,size:n,...i?{style:i}:{},onError:l}):(0,t.jsx)("img",{onError:l,src:w(r,e.href),alt:k(e),width:n,height:n,loading:"lazy",decoding:"async","data-graview-thumb":e.href,style:{width:n,height:n,objectFit:"cover",borderRadius:F,display:"block",flex:"none",background:"var(--graview-edge)",...i}})}function $e(e){let[n,i]=(0,h.useState)({}),r=e.duration??n.duration;return[{...r!==void 0?{duration:r}:{},width:e.width??n.width,height:e.height??n.height},u=>{let s=u.currentTarget;i({...Number.isFinite(s.duration)&&s.duration>0?{duration:s.duration}:{},...s.videoWidth>0&&s.videoHeight>0?{width:s.videoWidth,height:s.videoHeight}:{}})}]}var Ne=320,xe=(e,n)=>`${k(e)}, ${se({...n!==void 0?{duration:n}:{}})}`,Oe=(0,t.jsx)("span",{"data-graview-play-glyph":"","aria-hidden":"true",style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",width:"40%",height:"40%",style:{maxWidth:40,maxHeight:40,filter:"drop-shadow(0 1px 2px rgb(0 0 0 / 0.5))"},children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"11",fill:"rgb(0 0 0 / 0.55)"}),(0,t.jsx)("path",{d:"M9.5 7.5v9l7-4.5z",fill:"#fff"})]})});function Ae({file:e,size:n,style:i,onError:r}){let a=S(),[l,u]=$e(e),s={width:n,height:n,objectFit:"cover",display:"block",borderRadius:F,background:"var(--graview-edge)"};return(0,t.jsxs)("span",{role:"img","aria-label":xe(e,l.duration),"data-graview-thumb":e.href,"data-graview-video-thumb":"",style:{position:"relative",display:"block",width:n,height:n,flex:"none",...i},children:[e.poster?(0,t.jsx)("img",{src:w(a,e.poster),alt:"",width:n,height:n,loading:"lazy",decoding:"async",onError:r,style:s}):(0,t.jsx)("video",{src:w(a,e.href),preload:"metadata",muted:!0,playsInline:!0,"aria-hidden":"true",tabIndex:-1,width:n,height:n,onLoadedMetadata:u,onError:r,style:s}),Oe,l.duration!==void 0?(0,t.jsx)("span",{"data-graview-video-clock":"","aria-hidden":"true",style:{position:"absolute",right:3,bottom:3,padding:"0 4px",borderRadius:4,background:"rgb(0 0 0 / 0.65)",color:"#fff",fontSize:"0.6875rem",lineHeight:"16px",fontVariantNumeric:"tabular-nums"},children:q(l.duration)}):null]})}function Ge({file:e}){let n=S(),[i,r]=Z(e),[a,l]=$e(e);if(i)return(0,t.jsx)(ee,{file:e,style:{width:"100%",aspectRatio:"16 / 9"}});let u=a.width!==void 0&&a.height!==void 0;return(0,t.jsxs)("figure",{"data-graview-video-figure":e.href,style:{margin:0,display:"grid",gap:4,minWidth:0},children:[(0,t.jsx)("video",{"data-graview-video":e.href,src:w(n,e.href),...e.poster?{poster:w(n,e.poster)}:{},controls:!0,preload:"metadata",playsInline:!0,...u?{width:a.width,height:a.height}:{},"aria-label":xe(e,a.duration),onLoadedMetadata:l,onError:r,style:{display:"block",width:"100%",maxWidth:u?Math.max(a.width,Ne):"100%",height:"auto",maxHeight:"80vh",aspectRatio:u?`${a.width} / ${a.height}`:"16 / 9",borderRadius:F,background:"#000"},children:e.captions?(0,t.jsx)("track",{kind:"captions",src:w(n,e.captions),srcLang:"en",label:"Captions",default:!0}):null}),(0,t.jsx)("figcaption",{"data-graview-video-said":"",style:P,children:[e.caption??e.name,...a.duration!==void 0?[q(a.duration)]:[]].join(" \xB7 ")})]})}function Ue({file:e,onOpen:n}){let i=S(),[r,a]=Z(e);return r?(0,t.jsx)(ee,{file:e,style:{width:"100%",aspectRatio:"1"}}):(0,t.jsx)("button",{type:"button","aria-label":`Open ${k(e)} full size`,onClick:l=>n(l.currentTarget),style:{padding:0,border:0,background:"none",cursor:"zoom-in",display:"block",width:"100%",borderRadius:F},children:(0,t.jsx)("img",{src:w(i,e.href),alt:k(e),loading:"lazy",decoding:"async",onError:a,style:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:F,display:"block",background:"var(--graview-edge)"}})})}function X({files:e,label:n}){let i=S(),r=d=>w(i,d.href),a=e.filter(E),l=e.filter(x),u=e.filter(d=>!E(d)&&!x(d)),[s,y]=(0,h.useState)(null),c=(0,h.useRef)(null),b=(0,h.useRef)(null);(0,h.useEffect)(()=>{let d=c.current;s!==null&&d&&!d.open&&d.showModal?.()},[s]);let p=s===null?void 0:a[s];return(0,t.jsxs)("div",{style:{display:"grid",gap:10,minWidth:0},children:[a.length>0?(0,t.jsx)("ul",{"data-graview-gallery":"","aria-label":n,style:{listStyle:"none",margin:0,padding:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:8},children:a.map((d,T)=>(0,t.jsx)("li",{style:{minWidth:0},children:(0,t.jsx)(Ue,{file:d,onOpen:R=>{b.current=R,y(T)}})},d.href))}):null,l.length>0?(0,t.jsx)("ul",{"data-graview-videos":"","aria-label":n,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:12},children:l.map(d=>(0,t.jsx)("li",{style:{minWidth:0},children:(0,t.jsx)(Ge,{file:d})},d.href))}):null,u.length>0?(0,t.jsx)("ul",{"data-graview-documents":"",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:10},children:u.map(d=>(0,t.jsxs)("li",{"data-graview-document":d.type,style:{display:"grid",gap:6,minWidth:0},children:[d.type==="application/pdf"?(0,t.jsx)("object",{data:r(d),type:"application/pdf","aria-label":k(d),style:{width:"100%",height:420,border:"1px solid var(--graview-edge)",borderRadius:F},children:(0,t.jsxs)("p",{style:{margin:0,padding:12},children:["This browser shows no PDF here: ",(0,t.jsxs)("a",{href:r(d),download:d.name,children:["download ",d.name]}),"."]})}):null,(0,t.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",gap:"2px 10px",alignItems:"baseline",minWidth:0,overflowWrap:"anywhere"},children:[(0,t.jsx)("a",{href:r(d),download:d.name,...d.type==="application/pdf"?{target:"_blank",rel:"noopener"}:{},children:d.name}),(0,t.jsxs)("span",{style:P,children:[z(d)," \xB7 ",_(d.bytes)]})]}),d.caption?(0,t.jsx)("span",{style:P,children:d.caption}):null]},d.href))}):null,p?(0,t.jsx)("dialog",{ref:c,"data-graview-full":p.href,"aria-label":k(p),onClose:()=>{y(null),b.current?.focus()},onClick:d=>{d.target===d.currentTarget&&d.currentTarget.close()},style:{padding:0,border:0,borderRadius:F,maxWidth:"min(96vw, 1600px)",maxHeight:"94vh",background:"var(--graview-panel)",color:"var(--graview-ink)"},children:(0,t.jsxs)("figure",{style:{margin:0,display:"grid",gap:8,padding:10},children:[(0,t.jsx)("img",{src:r(p),alt:k(p),style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block",margin:"0 auto"}}),(0,t.jsxs)("figcaption",{style:{display:"flex",gap:12,alignItems:"center",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:p.caption??p.name}),(0,t.jsx)("form",{method:"dialog",style:{margin:0},children:(0,t.jsx)("button",{type:"submit",autoFocus:!0,children:"Close"})})]})]})}):null]})}function Se({value:e,onChange:n,several:i,image:r,video:a=!1,label:l,thumbs:u=!0}){let s=S(),y=(0,h.useId)(),c=(0,h.useRef)(null),b=(0,h.useRef)(null),[p,d]=(0,h.useState)(null),[T,R]=(0,h.useState)(null),[te,H]=(0,h.useState)([]),[N,O]=(0,h.useState)(!1),W=r?"image/":a?"video/":void 0,C=s?W?s.kinds.filter(o=>o.startsWith(W)||o==="*"||o==="*/*"):s.kinds:[],Pe=s?s.kinds.length===0||C.length>0:!1,Re=!a&&(s?s.kinds.length===0||(r?C:s.kinds).some(o=>o.startsWith("image/")||o.startsWith("*")):!1),ne=!!s&&s.maxBytes>0,L=ne&&(!W||Pe),V=r?"picture":a?"video":"file",ae=i?`${V}s`:`a ${V}`,ie=W?C.length>0?C.join(","):`${W}*`:s?.kinds.join(",")||void 0,We=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,A=(0,h.useRef)(e);A.current=e;let re=(0,h.useRef)(null),I=(0,h.useRef)(null);(0,h.useEffect)(()=>{let o=I.current;if(!o||o.from===e)return;I.current=null;let g=re.current?.children,f=g?.[Math.min(o.at,g.length-1)];((o.what==="move"?f?.querySelector("[data-graview-file-move]"):null)??f?.querySelector("[data-graview-file-remove]")??c.current?.parentElement?.querySelector("[data-graview-file-choose]"))?.focus()});let D=async(o,g)=>{if(!s||o.length===0)return;let f=i?o:o.slice(0,1),m=[],$=[];f.length<o.length&&$.push(`${l} holds one ${V}, so ${o.slice(1).map(v=>`\u201C${v.name||"the photo"}\u201D`).join(", ")} ${o.length>2?"were":"was"} left out.`),H([]),R(null);for(let v of f){d(`Sending ${v.name||"the photo"}\u2026`);let G=await je(v,s,{image:r,video:a,camera:g==="camera"});if("refused"in G){$.push(G.refused);continue}let M=await _e(G,s,r,a);"refused"in M?$.push(M.refused):[...i?A.current:[],...m].some(He=>He.href===M.href)?$.push(`\u201C${M.name}\u201D is already here.`):m.push(M)}if(d(null),H($),m.length!==0)try{n(i?[...A.current,...m]:m.slice(-1)),R(`Added ${m.map(v=>v.name).join(", ")}.`)}catch(v){H([...$,v instanceof Error?v.message:String(v)])}},B=(o,g,f)=>{try{I.current=f?{...f,from:e}:null,n(o),R(g)}catch(m){I.current=null,H([m instanceof Error?m.message:String(m)])}},j=o=>o?Array.from(o):[],Me=o=>{let g=j(o.clipboardData?.files);!L||g.length===0||(o.preventDefault(),D(g,"pasted"))},Te=o=>{O(!1),L&&(o.preventDefault(),D(j(o.dataTransfer?.files),"dropped"))};return(0,t.jsxs)("div",{role:"group","aria-labelledby":`${y}-label`,"data-graview-file-editor":"","data-graview-dropping":N?"":void 0,onPaste:Me,onDragOver:o=>{L&&(o.preventDefault(),O(!0))},onDragLeave:()=>O(!1),onDrop:Te,style:{display:"grid",gap:8,minWidth:0,padding:N?6:0,outline:N?"2px dashed var(--graview-accent)":"none",borderRadius:F},children:[(0,t.jsx)("span",{id:`${y}-label`,style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},children:l}),e.length>0&&(i||e.length>1)?(0,t.jsx)("ul",{ref:re,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:6},children:e.map((o,g)=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",minWidth:0},children:[u&&(E(o)||x(o))?(0,t.jsx)(Q,{file:o,size:40}):null,(0,t.jsx)("span",{style:{flex:"1 1 8rem",minWidth:0,overflowWrap:"anywhere"},children:o.name}),(0,t.jsx)(we,{file:o,onCaption:f=>B(e.map((m,$)=>$===g?ve(m,f):m),f?`${o.name} now says \u201C${f}\u201D.`:`${o.name} says its name again.`)}),i&&g>0?(0,t.jsx)("button",{type:"button","data-graview-file-move":"","aria-label":`Move ${o.name} earlier`,onClick:()=>B(e.map((f,m)=>m===g-1?o:m===g?e[g-1]:f),`Moved ${o.name} earlier.`,{at:g-1,what:"move"}),children:"\u2191"}):null,i?(0,t.jsx)("button",{type:"button","data-graview-file-remove":"","aria-label":`Remove ${o.name}`,onClick:()=>B(e.filter((f,m)=>m!==g),`Removed ${o.name}.`,{at:g,what:"remove"}),children:"Remove"}):null]},`${g}:${o.href}`))}):e.length===1?(0,t.jsx)(we,{file:e[0],onCaption:o=>B([ve(e[0],o)],o?`${e[0].name} now says \u201C${o}\u201D.`:`${e[0].name} says its name again.`)}):null,L?(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{ref:c,type:"file",hidden:!0,multiple:i,...ie?{accept:ie}:{},"data-graview-file-input":"","aria-label":`Choose ${ae}`,onChange:o=>{let g=j(o.currentTarget.files);o.currentTarget.value="",D(g,"picked")}}),(0,t.jsx)("button",{type:"button",disabled:p!==null,onClick:()=>c.current?.click(),"data-graview-file-choose":"",children:e.length>0&&!i?`Replace the ${V}`:`Choose ${ae}`}),Re?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:b,type:"file",hidden:!0,accept:"image/*",capture:"environment","data-graview-photo-input":"","aria-label":"Take a photo",onChange:o=>{let g=j(o.currentTarget.files);o.currentTarget.value="",D(g,"camera")}}),We?(0,t.jsx)("button",{type:"button",disabled:p!==null,onClick:()=>b.current?.click(),children:"Take a photo"}):null]}):null,(0,t.jsxs)("span",{style:P,"data-graview-file-takes":"",children:["or drop or paste ",i?"them":"it"," here \xB7 ",s.kinds.length>0?ke(C.length>0?C:s.kinds):"any file",", up to ",_(s.maxBytes)]})]}):(0,t.jsx)("p",{style:{...P,margin:0},"data-graview-file-none":"",children:ne?`This host doesn\u2019t take ${a?"videos":"pictures"}, so none can be added here.`:"This host doesn\u2019t take files, so none can be added here."}),(0,t.jsx)("p",{"aria-live":"polite",style:{...P,margin:0,minHeight:p||T?void 0:0},"data-graview-file-status":"",children:p??T??""}),te.length>0?(0,t.jsx)("div",{role:"alert","data-graview-file-refused":"",style:{color:"var(--graview-warn)",fontSize:"0.875rem",display:"grid",gap:2},children:te.map((o,g)=>(0,t.jsx)("p",{style:{margin:0},children:o},g))}):null]})}var ve=(e,n)=>{let{caption:i,...r}=e;return n?{...r,caption:n}:r};function we({file:e,onCaption:n}){let[i,r]=(0,h.useState)(e.caption??"");(0,h.useEffect)(()=>r(e.caption??""),[e.caption]);let a=()=>{let l=i.trim().slice(0,500);l!==(e.caption??"")&&n(l)};return(0,t.jsx)("input",{type:"text",value:i,placeholder:E(e)||x(e)?"What it shows":"What it is","aria-label":`What ${e.name} ${E(e)||x(e)?"shows":"is"}`,"data-graview-file-caption":e.href,onChange:l=>r(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a())},style:{flex:"1 1 10rem",minWidth:0,font:"inherit",fontSize:"0.875rem",minHeight:24}})}function Ee({field:e,label:n,labelStyle:i,valueStyle:r,style:a,children:l}){return(0,t.jsxs)("div",{"data-graview-files":e,style:{display:"grid",gap:6,minWidth:0,gridColumn:"1 / -1",...a},children:[(0,t.jsx)("dt",{style:i,children:n}),(0,t.jsx)("dd",{style:{margin:0,minWidth:0,display:"grid",gap:10,...r},children:l})]})}function Ce(e){let{nodeId:n,field:i,label:r,files:a}=e,{fields:l,commit:u}=me(n),s=l.find(p=>p.field===i&&p.takesValue),y=s?.shape,c=y?.type==="several"?y.of:y,b=y?.type==="several";return a.length===0&&c?.type!=="file"?null:(0,t.jsxs)(Ee,{...e,children:[(0,t.jsx)(X,{files:a,label:r}),s&&c?.type==="file"?(0,t.jsx)(Se,{value:a,thumbs:!1,several:b,image:c.image===!0,video:c.video===!0,label:r,onChange:p=>{let d=b?p:p[p.length-1];d!==void 0&&u(s,d)}}):null]})}function tt(e){switch(e.as){case"field":return e.read?e.files.length>0?(0,t.jsx)(Ee,{...e,children:(0,t.jsx)(X,{files:e.files,label:e.label})}):null:(0,t.jsx)(Ce,{...e});case"unfilled":return(0,t.jsx)(Ye,{...e});case"thumb":return(0,t.jsx)(Q,{...e});case"block":return e.files.length>0?(0,t.jsx)("span",{className:"graview-spec-image","data-graview-field":e.field,"data-graview-image":e.view,style:{display:"block",minWidth:0,...e.view==="gallery"?{position:"relative",zIndex:de.raised}:{}},children:e.view==="thumb"?(0,t.jsx)(Q,{file:e.files[0],size:72}):(0,t.jsx)(X,{files:e.files,label:e.label})}):null;case"control":{let n=(0,t.jsx)(Se,{value:Y(e.value),several:e.several,image:e.image,video:e.video===!0,label:e.label,onChange:i=>e.onChange(e.several?i:i[i.length-1])});return e.title===void 0?n:(0,t.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.several?"files":"file",children:[(0,t.jsx)("legend",{"data-graview-part":"label",children:e.title}),n]})}}}function Ye({nodeId:e,skip:n,labels:i,labelStyle:r,style:a}){let{store:l}=ge(),u=he(e),s=u?l.schema.tryDefinition(u.kind):void 0,y=pe(s).filter(c=>!n.includes(c)&&!(s?.display?.hide??[]).includes(c)&&Y(u?.[c]).length===0);return y.length===0?null:(0,t.jsx)("dl",{style:{margin:0,display:"grid",gap:14,minWidth:0},children:y.map(c=>(0,t.jsx)(Ce,{nodeId:e,field:c,label:i?.[c]??oe(s,c),files:[],...r?{labelStyle:r}:{},...a?{style:a}:{}},c))})}export{Se as FilesEditor,Ve as SEND_EDGE,tt as drawFiles,ke as kindsWords,je as prepare,_e as send,_ as sizeWords,Fe as takes,z as typeWords};
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk.GAN77YDU.js";import"./chunk.JLOSQ5UY.js";import"./chunk.FNF6XQI5.js";import"./chunk.T6S3CEW7.js";import"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.HJCQ6I3S.js";import"./chunk.B7FZLIAO.js";import"./chunk.N5ULWKR4.js";import"./chunk.GBCWI2LF.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.JEMQ66FT.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import"./chunk.OK4FSBHI.js";import"./chunk.DAZEFSWI.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import"./chunk.TDCO7LEA.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
@@ -0,0 +1 @@
1
+ import{b as pt}from"./chunk.TDCO7LEA.js";import{a as dt}from"./chunk.IN4PKQO5.js";import{f as ct}from"./chunk.3IUJ4GW7.js";import{a as C,f as q}from"./chunk.UG23RICT.js";import{Eb as ut,F as Q,G as X,I as k,Nc as ft,O as G,R as tt,T as nt,U as et,ca as _,cb as it,ea as M,fb as lt,ga as rt,ja as ot,la as at}from"./chunk.AW2T3KFV.js";import{d as st}from"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";function J(t){let e=[],n=!0;for(let r of t){if(r.text.length===0)continue;let s=r.as==="close"||r.text===","||r.text===":"||r.text.startsWith("'")||n;e.push({part:r,space:!s}),n=r.as==="open"}return e}function D(t,e){return J(t).map(({part:n,space:r})=>`${r?" ":""}${e?n.said??n.text:n.text}`).join("")}function Ot(t){return D(t,!1)}function Et(t){return D(t,!0)}function mt(t,e=!1){let n=e?t.said:t.text;return t.record!==void 0?`${t.record} \u2014 ${n}`:n}function z(t){let e=u=>J(u).map(({part:o,space:a})=>({...o,space:a})),n=e(t.parts),r=t.when&&t.when.length>0?e(t.when):void 0,s=u=>`${D(n,u)}${r?`, when ${D(r,u)}`:""}`;return{...t,parts:n,...r?{when:r}:{},text:s(!1),said:s(!0)}}function Pt(t,e=!1){return t.line?mt(t.line,e):t.message}var yt=60,O=t=>({text:t,as:"name"}),c=(t,e)=>e===void 0?{text:t,as:"word"}:{text:t,as:"word",said:e},L=(t,e)=>e===void 0||e===t?{text:t,as:"value"}:{text:t,as:"value",said:e},R=(t,e)=>({text:t,as:"op",said:e}),v={text:"(",as:"open"},w={text:")",as:"close"},N={text:"\u2014",as:"value",said:"empty"},V={">=":["\u2265","at least"],"<=":["\u2264","at most"],"<":["<","less than"],">":[">","more than"],"==":["=","is"],"!=":["\u2260","is not"]},B={">=":"<","<=":">","<":">=",">":"<=","==":"!=","!=":"=="},Lt={"+":["+","plus"],"-":["\u2212","minus"],"*":["\xD7","times"],"/":["\xF7","divided by"],"%":["mod","modulo"]},ht=t=>t.t==="binary"&&t.op in V;function I(t){return t.length>1&&t[1]===t[1].toUpperCase()&&/[A-Z]/.test(t[1])?t:t.charAt(0).toLowerCase()+t.slice(1)}function bt(t){let{schema:e}=t,n=l=>l===null?void 0:e.tryDefinition(l),r=(l,m)=>{let g=n(l)?.edges;return g&&Object.hasOwn(g,m)?g[m]:void 0},s=(l,m)=>{let g=r(l,m)?.to;return Array.isArray(g)&&g.length===1?g[0]:null},u=(l,m)=>{let g=(e.edge(m)?.from??[]).filter(W=>{let K=r(W,m)?.to;return l===null||K==="*"||Array.isArray(K)&&K.includes(l)});return g.length===1?g[0]:null},o=(l,m)=>r(l,m)?M(m).toLowerCase():I(ot(n(l),m)),a=l=>I(rt(e,l)),d=l=>I(ct(e).get(l)?.label??M(l)),x=l=>I(at(n(l),l)),i=(l,m)=>{let g=l===null?void 0:t.formatOf?.(l,m);if(g?.format)return g;let W=t.said?.get(m);return W?{...g,format:W}:g},p=l=>_(e.tryDefinition(l.kind),l),h=t.money?.locale,y=(l,m)=>{if(l==null)return N;if(l instanceof C){if(l.nodes.length===0)return N;let A=l.nodes.slice(0,3).map(p),Y=l.nodes.length-A.length;return L(Y>0?`${A.join(", ")} and ${Y} more`:A.length>1?`${A.slice(0,-1).join(", ")} and ${A[A.length-1]}`:A[0])}if(Array.isArray(l))return L(`{${l.map(A=>y(A,m).text).join(", ")}}`,l.map(A=>y(A,m).text).join(" or "));if(typeof l=="object")return L(p(l));if(typeof l=="boolean")return L(l?"yes":"no");let g=m?.format??(m?i(m.kind,m.key):void 0);if(typeof l=="number")return L(g&&g.format!=="date"?ut(l,{...t.money,...g}):et(l,h));if(Q.test(l)||g?.format==="date")return L(G(nt(l,t.money?.timeZone)??l.slice(0,10),h));if(X.test(l))return L(tt(l,h,t.money?.timeZone));let W=m&&m.kind!==null?n(m.kind)?.display?.format?.[m.key]:void 0;if(W)return L(W(l));let K=l.length>yt?`${l.slice(0,yt-1).trimEnd()}\u2026`:l;return L(/^[a-z][a-z0-9]*([-_][a-z0-9]+)*$/.test(K)?K.replace(/[-_]+/g," "):K)};return{definition:n,relation:r,farOf:s,nearOf:u,fieldName:o,plural:a,noun:x,factName:d,formatOf:i,valueWords:y,locale:h}}function P(t,e,n){if(t.t==="ident")return{kind:e,key:t.name};if(t.t==="member")return{kind:E(t.object,e,n),key:t.name};if(t.t==="call"&&(t.fn==="sum"||t.fn==="min"||t.fn==="max")&&t.args.length===2){let r=E(t.args[0],e,n),s=t.args[1];if(s.t==="ident")return{kind:r,key:s.name};if(s.t==="lit"&&typeof s.value=="string")return{kind:r,key:s.value}}if(t.t==="binary"&&(t.op==="+"||t.op==="-"))return P(t.left,e,n)??P(t.right,e,n);if(t.t==="call"&&t.fn==="if"&&t.args.length===3)return P(t.args[1],e,n)??P(t.args[2],e,n)}function E(t,e,n){switch(t.t){case"ident":return n.relation(e,t.name)?n.farOf(e,t.name):null;case"member":return n.farOf(E(t.object,e,n),t.name);case"where":return E(t.set,e,n);case"binary":return t.op==="|"||t.op==="&"||t.op==="-"?E(t.left,e,n):null;case"call":{let r=s=>{let u=t.args[s];return u?.t==="lit"&&typeof u.value=="string"?u.value:void 0};return t.fn==="all"?r(0)??null:t.fn==="out"?t.args.length===2?n.farOf(E(t.args[0],e,n),r(1)??""):n.farOf(e,r(0)??""):t.fn==="in"?t.args.length===2?n.nearOf(E(t.args[0],e,n),r(1)??""):n.nearOf(e,r(0)??""):(t.fn==="first"||t.fn==="sort")&&t.args[0]?E(t.args[0],e,n):null}default:return null}}function j(t){return t.t==="binary"?t.op==="||"?U(t)?4:1:t.op==="&&"?2:t.op in V||t.op==="in"?4:t.op==="+"||t.op==="-"?5:t.op==="*"||t.op==="/"||t.op==="%"?6:4.5:t.t==="unary"&&t.op==="!"?3:t.t==="where"?3.5:9}var $=t=>t.t==="lit",b=(t,e)=>t.t==="call"&&t.fn===e;function F(t,e){return t.t==="binary"&&t.op===e?[...F(t.left,e),...F(t.right,e)]:[t]}function U(t){if(t.t!=="binary"||t.op!=="||")return;let e=[];e.push(...F(t,"||"));let n,r=[];for(let s of e){if(s.t!=="binary"||s.op!=="=="||!$(s.right)||typeof s.right.value!="string"||n&&JSON.stringify(gt(n))!==JSON.stringify(gt(s.left)))return;n=s.left,r.push(s.right)}return n?{subject:n,values:r}:void 0}var gt=t=>JSON.parse(JSON.stringify(t,(e,n)=>e==="at"?void 0:n));function f(t,e,n,r){let s=(u,o,a=e)=>j(u)<o?[v,...f(u,a,n),w]:f(u,a,n);switch(t.t){case"lit":return[n.valueWords(t.value,r)];case"list":return[n.valueWords(t.items.map(u=>u.t==="lit"?u.value:null),r)];case"ident":return[O(n.fieldName(e,t.name))];case"member":{let u=b(t.object,"first")&&t.object.args[0]&&b(t.object.args[0],"all"),o=E(t.object,e,n);if(u&&o)return e!==null&&n.fieldName(e,t.name)===n.fieldName(o,t.name)&&n.definition(e)?.fields?.shape&&Object.prototype.hasOwnProperty.call(n.definition(e).fields.shape,t.name)?[O(`${n.noun(o)}'s ${n.fieldName(o,t.name)}`)]:[O(n.fieldName(o,t.name))];let a=f(t.object,e,n),d=a[a.length-1];return a.length===1&&d?.as==="name"?[O(`${d.text}'s ${n.fieldName(o,t.name)}`)]:[...a,c("'s"),O(n.fieldName(o,t.name))]}case"unary":return t.op==="-"?[R("\u2212","minus"),...s(t.operand,7)]:T(t.operand,e,n);case"where":{let u=E(t.set,e,n),o=f(t.filter,u,n),a=o.every(d=>d.as==="name"||d.as==="word"&&d.text==="not");return[...s(t.set,4),...a?[]:[c("with")],...j(t.filter)<=2?[v,...o,w]:o]}case"binary":return xt(t,e,n);case"call":return At(t,e,n)}}function T(t,e,n){return ht(t)?xt({...t,op:B[t.op]},e,n):b(t,"present")||b(t,"exists")?[...f(t.args[0],e,n),R("=","is"),N]:t.t==="ident"?[c("not"),O(n.fieldName(e,t.name))]:[c("not"),v,...f(t,e,n),w]}function xt(t,e,n){let r=(o,a)=>j(o)<a?[v,...f(o,e,n),w]:f(o,e,n);if(t.op==="&&"||t.op==="||"){let o=U(t);if(o){let d=P(o.subject,e,n);return[...f(o.subject,e,n),R("\u2208","is one of"),n.valueWords(o.values.map(x=>x.value),d)]}let a=t.op==="&&"?2:1;return[...r(t.left,a),c(t.op==="&&"?"and":"or"),...r(t.right,a+.5)]}if(t.op in V){if($(t.right)&&typeof t.right.value=="boolean"&&(t.op==="=="||t.op==="!="))return t.op==="=="===t.right.value?f(t.left,e,n):T(t.left,e,n);let[o,a]=V[t.op],d=P(t.left,e,n),x=P(t.right,e,n);return[...S(t.left,e,n,x),R(o,a),...S(t.right,e,n,d)]}if(t.op==="in")return[...r(t.left,5),R("\u2208","is one of"),...S(t.right,e,n,P(t.left,e,n))];let s=Lt[t.op];if(s){let o=j(t);return[...r(t.left,o),R(s[0],s[1]),...r(t.right,o+.5)]}let u={"|":"or","&":"and also","-":"except"};return[...r(t.left,5),c(u[t.op]??t.op),...r(t.right,5)]}function S(t,e,n,r){return t.t==="lit"||t.t==="list"?f(t,e,n,r):j(t)<5?[v,...f(t,e,n),w]:f(t,e,n)}function At(t,e,n){let r=o=>t.args[o],s=o=>{let a=t.args[o];return a?.t==="lit"&&typeof a.value=="string"?a.value:void 0},u=o=>{let a=r(o);return j(a)<9&&a.t!=="where"?[v,...f(a,e,n),w]:f(a,e,n)};switch(t.fn){case"out":{let o=s(t.args.length-1)??"",a=O(M(o).toLowerCase());return t.args.length===2?[a,c("of"),...u(0)]:[a]}case"in":{let o=s(t.args.length-1)??"",a=t.args.length===2?n.nearOf(E(r(0),e,n),o):n.nearOf(e,o),d=O(a?n.plural(a):M(o).toLowerCase());return t.args.length===2?[d,c("of"),...u(0)]:[d]}case"all":{let o=s(0),a=t.args[1]?.t==="lit"?t.args[1].value:void 0,d=a===!0?[c("archived")]:a==="all"?[c("archived or not")]:[];return a===!0?[...d,O(o?n.plural(o):"everything")]:[O(o?n.plural(o):"everything"),...d]}case"fact":{let o=s(0);return[O(o?n.factName(o):"fact")]}case"count":return[c("number of"),...u(0)];case"exists":return[...u(0),R("\u2260","is not"),N];case"present":return[...f(r(0),e,n),R("\u2260","is not"),N];case"some":case"every":{let o=E(r(0),e,n),a=r(1);return[...t.fn==="some"?[c("some")]:[],...u(0),c(t.fn==="some"?"with":"all with"),...j(a)<=2?[v,...f(a,o,n),w]:f(a,o,n)]}case"sum":case"min":case"max":{let o=E(r(0),e,n),a=r(1),d=a.t==="lit"&&typeof a.value=="string"?[O(n.fieldName(o,a.value))]:j(a)<9?[v,...f(a,o,n),w]:f(a,o,n);return[c(t.fn==="sum"?"total":t.fn==="min"?"least":"most"),...d,c("of"),...u(0)]}case"first":{let o=r(0);if(b(o,"all")){let a=o.args[0]?.value;if(typeof a=="string")return[O(`the ${n.noun(a)}`)]}return[c("first of"),...u(0)]}case"sort":return[...u(0),c("by"),...f(r(1),E(r(0),e,n),n)];case"len":return[c("length of"),...f(r(0),e,n)];case"lower":return f(r(0),e,n);case"contains":case"startsWith":return[...f(r(0),e,n),c(t.fn==="contains"?"contains":"starts with"),...S(r(1),e,n,P(r(0),e,n))];case"today":return[L("today")];case"now":return[L("now")];case"date":return $(r(0))&&typeof r(0).value=="string"?[L(G(String(r(0).value),n.locale))]:f(r(0),e,n);case"days":case"hours":{let o=t.fn,[a,d]=[r(0),r(1)];return b(d,"today")||b(d,"now")?[c(`${o} since`),...f(a,e,n)]:b(a,"today")||b(a,"now")?[c(`${o} until`),...f(d,e,n)]:[c(`${o} from`),...f(a,e,n),c("to"),...f(d,e,n)]}case"if":return[v,...f(r(1),e,n),c("if"),...f(r(0),e,n),c(","),c("else"),...f(r(2),e,n),w];case"either":return t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),c("else"),...f(o,e,n)]);default:return[c(t.fn),v,...t.args.flatMap((o,a)=>a===0?f(o,e,n):[c(","),...f(o,e,n)]),w]}}function Z(t,e){let n=bt(e),r=t.over==="graph"?null:t.over;return z({...r===null?{}:{kind:r},parts:f(t.require,r,n),...t.when?{when:f(t.when,r,n)}:{}})}function H(t,e,n){let r=bt(e),s=t.over==="graph"?null:t.over,u=n.subject,o=i=>{try{return q(i,{...n,budget:2e3})}catch{return}},a=(i,p)=>{let h=S(i,s,r,p);if(i.t==="lit"||i.t==="list"||b(i,"today")||b(i,"now")||b(i,"date"))return h;let y=o(i);if(y===void 0)return h;let l=P(i,s,r),m=r.valueWords(y,l?{...l,format:r.formatOf(l.kind,l.key)??(p?r.formatOf(p.kind,p.key):void 0)}:p);return y instanceof C?[...h,c(":"),m]:[...h,m]},d=i=>{if(i.t==="binary"&&i.op==="&&"){let p=[];p.push(...F(i,"&&"));let h=p.filter(y=>o(y)!==!0);return(h.length>0?h:p).flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op==="||"){let p=U(i);if(p){let y=P(p.subject,s,r);return[...a(p.subject),R("\u2209","is not one of"),r.valueWords(p.values.map(l=>l.value),y)]}let h=[];return h.push(...F(i,"||")),h.flatMap((y,l)=>[...l>0?[c("and")]:[],...j(y)<=2?[v,...d(y),w]:d(y)])}if(i.t==="binary"&&i.op in V){if($(i.right)&&typeof i.right.value=="boolean"&&(i.op==="=="||i.op==="!="))return i.op==="=="===i.right.value?T(i.left,s,r):f(i.left,s,r);let p=B[i.op],[h,y]=V[p],l=P(i.left,s,r),m=P(i.right,s,r);if($(i.right)&&i.right.value===null)return[...p==="=="?S(i.left,s,r,m):a(i.left,m),R(h,y),N];let g=p==="=="&&($(i.right)||$(i.left));return[...g?S(i.left,s,r,m):a(i.left,m),R(h,y),...g?S(i.right,s,r,l):a(i.right,l)]}if(i.t==="binary"&&i.op==="in")return[...a(i.left),R("\u2209","is not one of"),...S(i.right,s,r,P(i.left,s,r))];if(i.t==="unary"&&i.op==="!"){let p=i.operand;return ht(p)?d({...p,op:B[p.op]}):b(p,"present")||b(p,"exists")?[...a(p.args[0]),R("\u2260","is not"),N]:p.t==="ident"?f(p,s,r):[c("not"),v,...T(p,s,r),w]}if(b(i,"present")||b(i,"exists"))return[...f(i.args[0],s,r),R("=","is"),N];if(b(i,"some"))return[...f(i,s,r).slice(1),R("=","is"),N];if(b(i,"every")&&i.args.length===2){let p=o(i.args[0]);if(p instanceof C){let h=p.nodes.filter(y=>{try{return q(i.args[1],{...n,subject:y,budget:2e3})!==!0}catch{return!0}});return[...f(i,s,r),c(","),c("not"),r.valueWords(new C(h))]}}return i.t==="ident"?[c("not"),O(r.fieldName(s,i.name))]:[c("not"),v,...f(i,s,r),w]},x;try{x=d(t.require)}catch{x=[c("not"),v,...f(t.require,s,r),w]}return z({...s===null?{}:{kind:s},parts:x,...u?{record:_(e.schema.tryDefinition(u.kind),u)}:{}})}function Rt(t){let e=new Map;for(let n of t??[])n.expr?.t==="ident"&&n.format&&(n.format==="money"||n.format==="percent"||n.format==="date")&&e.set(n.expr.name,n.format);return e}function jt(t){return(e,n)=>{let r=t[e]?.fields?.[n],s=r?.format??(r?.type==="date"?"date":void 0);return s||r?.unit?{...s?{format:s}:{},...r?.unit?{unit:r.unit}:{}}:void 0}}function wt(t,e){return{schema:e,said:Rt(t.says),...t.declared?{formatOf:jt(t.declared)}:{},...t.money?{money:t.money}:{}}}function Yt(t,e){return t.shape?Z(t.shape,wt(t.shape,e)):void 0}var vt=new WeakMap;function St(t,e){let n=new Map(t.allInvariants().map(r=>[r.name,r]));return e.map(r=>{let s=Kt(r),u=n.get(s.invariant)?.shape;if(!u||s.status&&s.status!=="violated")return s;let o=s.subjectId?t.graph.getNode(s.subjectId):void 0;if(u.over!=="graph"&&!o)return s;let a=u.kinds;a||(a=vt.get(t.schema),a||vt.set(t.schema,a=dt(t.schema)));try{let d=t.today?.()??u.today?.()??k(),x=H(u,wt(u,t.schema),{graph:t.graph,subject:o??null,kinds:a,today:d});return{...s,line:x,...u.says?{}:{message:`${s.message} \u2014 ${x.text}`}}}catch{return s}})}function Nt(){lt((t,e,n,r)=>St({graph:t,schema:t.schema,allInvariants:()=>e,today:()=>r},n)),pt(Wt)}function Wt(t,e,n,r){let s=e.graph,u=it.from(t.schema,s.snapshot(),{validate:!1});for(let x of n?[...r].reverse().map(st):r)try{u.applyPrimitives([x],{restoring:!0})}catch{}let o=x=>t.violations(void 0,x),a=o(n?u:s),d=o(n?s:u);return{...ft(t.allInvariants(),a,d),violationsAfter:d}}function Kt(t){if(!t.line)return t;let{line:e,...n}=t,r=` \u2014 ${e.text}`;return n.message.endsWith(r)?{...n,message:n.message.slice(0,-r.length)}:n}Nt();export{H as brokenLineOf,Nt as judgeWithLines,Wt as judgedForASeat,Pt as problemWords,Yt as ruleLine,Z as ruleLineOf,mt as ruleLineWords,J as ruleSpacing,Et as ruleSpoken,Ot as ruleText,Kt as unlined,St as withLines};
@@ -0,0 +1 @@
1
+ import{ca as y,da as V}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import{Tc as u,Wc as m}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var c=t=>[t,...u.filter(r=>r!==t)];function w(t,r){if(r.hidden.length===0&&r.removed.length===0)return t;let f=new Set(r.removed.filter(e=>!e.lens).map(e=>e.name)),o=new Set(r.hidden),s=e=>e?.name!==void 0&&(f.has(e.name)||o.has(e.name)),a=(e,i,d)=>[...t.registrations()].reverse().find(n=>n.kind===e&&n.cardinality===i&&n.fidelity===d&&!n.beside&&!n.hidden&&!s(n)),h=(e,i)=>{for(let d of c(i.fidelity)){let n=a(e,i.cardinality,d);if(n)return n}if(i.cardinality==="one")for(let d of c(i.fidelity)){let n=a(e,"many",d);if(n)return n}},l={...t,register(e,i,d,n){return t.register(e,i,d,n),l},lookup(e,i){return t.lookup(e,i)===void 0?void 0:a(e,i.cardinality,i.fidelity)?.view},places:()=>t.places().filter(e=>!(e.name!==void 0&&f.has(e.name))).map(e=>e.name!==void 0&&o.has(e.name)&&!e.hidden?{...e,hidden:!0}:e),resolve(e,i,d){let n=t.resolve(e,i,d);return!n||!s(n)||d!==void 0&&n.name!==void 0&&!f.has(n.name)&&n.title!==void 0&&m(n.title)===d?n:h(e,i)},all:()=>t.all().filter(e=>!(e.name!==void 0&&f.has(e.name)))};return y(t)&&V(l),l}function v(t,r,f){let o,s=()=>{let a=r.current();o&&a.hidden===o.hidden&&a.removed===o.removed||(o=a,f(w(t,a)))};return s(),r.onChange?.(s)??(()=>{})}export{w as tidyViews,v as watchTidied};
@@ -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.I7QCXRP7.js";import"./chunk.O7VHAKSA.js";import{a as K}from"./chunk.P6J6VFF5.js";import"./chunk.L6HKDIZB.js";import"./chunk.OTHGZPUC.js";import"./chunk.WZEA2UK6.js";import"./chunk.V5VQCANB.js";import"./chunk.UT6642FC.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import"./chunk.WVN62OMH.js";import"./chunk.BZ4VZ6WQ.js";import"./chunk.XDPIS7RS.js";import"./chunk.57R4ZUMM.js";import"./chunk.J7ZMNAWB.js";import"./chunk.VKJAGZNU.js";import"./chunk.LFJH6X6O.js";import"./chunk.VTUMPH4Z.js";import"./chunk.PCTVLNOS.js";import"./chunk.4QEDYRES.js";import{$ as F,D as H,E as V,Ea as x,G as ee,R as D,ua as _}from"./chunk.JE4QQEJE.js";import{a as j}from"./chunk.SDO3U72B.js";import{fa as q,wc as B}from"./chunk.UG727PEE.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.LWAZ6ZO6.js","./chunk.V5VQCANB.js","./chunk.UT6642FC.js","./chunk.WERBD5ZR.js","./chunk.HAY22FPJ.js","./chunk.U6YOAS4X.js","./chunk.TI4OSTQV.js","./chunk.BZ4VZ6WQ.js","./chunk.LFJH6X6O.js","./chunk.VTUMPH4Z.js","./chunk.PCTVLNOS.js","./chunk.4QEDYRES.js","./chunk.JE4QQEJE.js","./chunk.SDO3U72B.js","./chunk.UG727PEE.js","./chunk.AJZBJBMO.js"]),import("./chunk.5NDYYTT4.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 me({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.6BIRNR5P.js";import"./chunk.GBCWI2LF.js";import{a as K}from"./chunk.QJJKITXF.js";import"./chunk.7AEE3VHC.js";import"./chunk.JUT2VCFW.js";import"./chunk.DAZEFSWI.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import{a as S,b as W}from"./chunk.MB7LKKUD.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{$ as F,D as H,E as V,Ea as x,G as ee,R as D,ua as _}from"./chunk.4JWT6LIS.js";import{a as j}from"./chunk.SDO3U72B.js";import{fa as q,wc as B}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.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.REEDZSCG.js","./chunk.OGF6UORU.js","./chunk.UT6642FC.js","./chunk.3TBH2FMZ.js","./chunk.WE5SA6TP.js","./chunk.QNJYXB3U.js","./chunk.TI4OSTQV.js","./chunk.PL2P2OON.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.YGX2AE36.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 me({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{a,b}from"./chunk.6BIRNR5P.js";import"./chunk.GBCWI2LF.js";import"./chunk.DAZEFSWI.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
@@ -5,61 +5,62 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <title>Graview preview</title>
7
7
  <link rel="preload" href="/graview/document" as="fetch" crossorigin="anonymous">
8
- <link rel="modulepreload" href="/chunk.QHLD4TZW.js">
9
- <link rel="modulepreload" href="/chunk.VO6DBVZR.js">
8
+ <link rel="modulepreload" href="/chunk.3M4VCAA3.js">
9
+ <link rel="modulepreload" href="/chunk.LYSHLKAX.js">
10
10
  <link rel="modulepreload" href="/chunk.Q5WEOX3Q.js">
11
- <link rel="modulepreload" href="/chunk.X5WIS4BC.js">
12
- <link rel="modulepreload" href="/chunk.VKJAGZNU.js">
13
- <link rel="modulepreload" href="/chunk.4QEDYRES.js">
14
- <link rel="modulepreload" href="/chunk.JE4QQEJE.js">
11
+ <link rel="modulepreload" href="/chunk.JQ7WY2VZ.js">
12
+ <link rel="modulepreload" href="/chunk.UG23RICT.js">
13
+ <link rel="modulepreload" href="/chunk.FNXW46U4.js">
14
+ <link rel="modulepreload" href="/chunk.4JWT6LIS.js">
15
15
  <link rel="modulepreload" href="/chunk.SDO3U72B.js">
16
- <link rel="modulepreload" href="/chunk.UG727PEE.js">
16
+ <link rel="modulepreload" href="/chunk.AW2T3KFV.js">
17
+ <link rel="modulepreload" href="/chunk.2AZTW66C.js">
17
18
  <link rel="modulepreload" href="/chunk.AJZBJBMO.js">
18
- <link rel="modulepreload" href="/chunk.T3F6BKIO.js">
19
- <link rel="modulepreload" href="/chunk.HQMGTPDC.js">
20
- <link rel="modulepreload" href="/chunk.ROHM3ETN.js">
21
- <link rel="modulepreload" href="/chunk.Z2TYCMBT.js">
19
+ <link rel="modulepreload" href="/chunk.L6FWIQXS.js">
20
+ <link rel="modulepreload" href="/chunk.2EXY4AHX.js">
21
+ <link rel="modulepreload" href="/chunk.OAWAUB4P.js">
22
+ <link rel="modulepreload" href="/chunk.PSTE3LZL.js">
22
23
  <link rel="modulepreload" href="/chunk.UGFDSE37.js">
23
- <link rel="modulepreload" href="/chunk.VYPR2MZO.js">
24
- <link rel="modulepreload" href="/chunk.EC2T2UVH.js">
25
- <link rel="modulepreload" href="/chunk.Y2QDZLSY.js">
26
- <link rel="modulepreload" href="/chunk.ETWOZQWL.js">
27
- <link rel="modulepreload" href="/chunk.B6DKKNVR.js">
28
- <link rel="modulepreload" href="/chunk.VEP4EJ2N.js">
29
- <link rel="modulepreload" href="/chunk.7EB6SDUQ.js">
24
+ <link rel="modulepreload" href="/chunk.JGYGSNQY.js">
25
+ <link rel="modulepreload" href="/chunk.JLOSQ5UY.js">
26
+ <link rel="modulepreload" href="/chunk.FNF6XQI5.js">
27
+ <link rel="modulepreload" href="/chunk.LUPBT6YM.js">
28
+ <link rel="modulepreload" href="/chunk.IBWPRK2R.js">
29
+ <link rel="modulepreload" href="/chunk.RNUGQRJI.js">
30
+ <link rel="modulepreload" href="/chunk.6NFR2LYQ.js">
30
31
  <link rel="modulepreload" href="/chunk.PXQVXBNG.js">
31
- <link rel="modulepreload" href="/chunk.3WABA2WQ.js">
32
- <link rel="modulepreload" href="/chunk.4YRCKOX2.js">
33
- <link rel="modulepreload" href="/chunk.L6HKDIZB.js">
34
- <link rel="modulepreload" href="/chunk.QHP7AJUV.js">
35
- <link rel="modulepreload" href="/chunk.U3MQUIJL.js">
36
- <link rel="modulepreload" href="/chunk.DNMBZONP.js">
37
- <link rel="modulepreload" href="/chunk.OTHGZPUC.js">
38
- <link rel="modulepreload" href="/chunk.4YBP552Z.js">
39
- <link rel="modulepreload" href="/chunk.EVHXF7LZ.js">
40
- <link rel="modulepreload" href="/chunk.ARTJL3X2.js">
41
- <link rel="modulepreload" href="/chunk.V3K32XD7.js">
42
- <link rel="modulepreload" href="/chunk.CAZX6OPN.js">
43
- <link rel="modulepreload" href="/chunk.V5VQCANB.js">
32
+ <link rel="modulepreload" href="/chunk.YERDP6YF.js">
33
+ <link rel="modulepreload" href="/chunk.P5K7EYDK.js">
34
+ <link rel="modulepreload" href="/chunk.7AEE3VHC.js">
35
+ <link rel="modulepreload" href="/chunk.U3CV5CCL.js">
36
+ <link rel="modulepreload" href="/chunk.LKF4BBCW.js">
37
+ <link rel="modulepreload" href="/chunk.NPS2WN7T.js">
38
+ <link rel="modulepreload" href="/chunk.JUT2VCFW.js">
39
+ <link rel="modulepreload" href="/chunk.HKD5SR45.js">
40
+ <link rel="modulepreload" href="/chunk.JEMQ66FT.js">
41
+ <link rel="modulepreload" href="/chunk.7UV7ODXU.js">
42
+ <link rel="modulepreload" href="/chunk.IIB22IIP.js">
43
+ <link rel="modulepreload" href="/chunk.MWUP5X47.js">
44
+ <link rel="modulepreload" href="/chunk.OGF6UORU.js">
44
45
  <link rel="modulepreload" href="/chunk.UT6642FC.js">
45
- <link rel="modulepreload" href="/chunk.HAY22FPJ.js">
46
+ <link rel="modulepreload" href="/chunk.WE5SA6TP.js">
46
47
  <link rel="modulepreload" href="/chunk.MB7LKKUD.js">
47
48
  <link rel="modulepreload" href="/chunk.WVUJXDXZ.js">
48
- <link rel="modulepreload" href="/chunk.WVN62OMH.js">
49
- <link rel="modulepreload" href="/chunk.BZ4VZ6WQ.js">
50
- <link rel="modulepreload" href="/chunk.XDPIS7RS.js">
51
- <link rel="modulepreload" href="/chunk.57R4ZUMM.js">
52
- <link rel="modulepreload" href="/chunk.J7ZMNAWB.js">
49
+ <link rel="modulepreload" href="/chunk.ESU2DD3J.js">
50
+ <link rel="modulepreload" href="/chunk.PL2P2OON.js">
51
+ <link rel="modulepreload" href="/chunk.27ZVVPRZ.js">
52
+ <link rel="modulepreload" href="/chunk.IN4PKQO5.js">
53
+ <link rel="modulepreload" href="/chunk.3IUJ4GW7.js">
53
54
  <link rel="modulepreload" href="/chunk.GZHZLJBF.js">
54
- <link rel="modulepreload" href="/chunk.HG2IO5NS.js">
55
+ <link rel="modulepreload" href="/chunk.ATKKTPJS.js">
55
56
  <link rel="modulepreload" href="/chunk.OJGHDWI6.js">
56
- <link rel="modulepreload" href="/chunk.AQTCN7KQ.js">
57
- <link rel="modulepreload" href="/chunk.LFJH6X6O.js">
58
- <link rel="modulepreload" href="/chunk.VTUMPH4Z.js">
59
- <link rel="modulepreload" href="/chunk.PCTVLNOS.js">
60
- <link rel="modulepreload" href="/chunk.MZ6I2Q4E.js">
61
- <link rel="modulepreload" href="/chunk.EQIQPY4O.js">
62
- <script>(()=>{const later=["/chunk.6WB24MS3.js","/chunk.KZDLDXLB.js","/chunk.WUQOSVQU.js","/chunk.HJCQ6I3S.js","/chunk.5FHH5NR6.js","/chunk.VMBIFUYX.js","/chunk.O7VHAKSA.js","/chunk.X2M7IOQA.js","/chunk.WZEA2UK6.js","/chunk.PH5ITX3N.js","/chunk.YLI6I6XP.js","/chunk.P6FGIYWP.js","/chunk.WODEO2JF.js","/chunk.LKGDN25E.js","/chunk.QXMTGLHR.js","/chunk.P6J6VFF5.js","/chunk.TI4OSTQV.js","/chunk.JCTT2LAK.js"],first=[...document.querySelectorAll('link[rel="modulepreload"]')];let left=first.length;const go=()=>{for(const href of later){const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};if(left===0)return go();const one=()=>{if(--left===0)go()};for(const link of first){link.addEventListener("load",one,{once:true});link.addEventListener("error",one,{once:true})}})()</script>
57
+ <link rel="modulepreload" href="/chunk.UZSZPMRC.js">
58
+ <link rel="modulepreload" href="/chunk.MZOIPCDA.js">
59
+ <link rel="modulepreload" href="/chunk.KERLVJ6I.js">
60
+ <link rel="modulepreload" href="/chunk.4EPT2CQG.js">
61
+ <link rel="modulepreload" href="/chunk.NTFCZYOR.js">
62
+ <link rel="modulepreload" href="/chunk.HB34VQKQ.js">
63
+ <script>(()=>{const later=["/chunk.YYPK7IDM.js","/chunk.GAN77YDU.js","/chunk.T6S3CEW7.js","/chunk.HJCQ6I3S.js","/chunk.B7FZLIAO.js","/chunk.N5ULWKR4.js","/chunk.GBCWI2LF.js","/chunk.OK4FSBHI.js","/chunk.DAZEFSWI.js","/chunk.TDCO7LEA.js","/chunk.3PNDXNX6.js","/chunk.D2RK2KJD.js","/chunk.EW364363.js","/chunk.P546VMA5.js","/chunk.7PUFYK3B.js","/chunk.QJJKITXF.js","/chunk.TI4OSTQV.js","/chunk.4WCQWILK.js"],first=[...document.querySelectorAll('link[rel="modulepreload"]')];let left=first.length;const go=()=>{for(const href of later){const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};if(left===0)return go();const one=()=>{if(--left===0)go()};for(const link of first){link.addEventListener("load",one,{once:true});link.addEventListener("error",one,{once:true})}})()</script>
63
64
  <style>html,body{margin:0;height:100%}#graview-app{min-height:100dvh}</style>
64
65
  </head>
65
66
  <body>