graview 0.1.53 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/preview/chunk.25P5SDNR.js +1 -0
  2. package/dist/preview/chunk.27O4LIDU.js +1 -0
  3. package/dist/preview/{chunk.J6OT74RM.js → chunk.2DFWOLL2.js} +1 -1
  4. package/dist/preview/{chunk.H6EMDQP5.js → chunk.2LMB5E6N.js} +1 -1
  5. package/dist/preview/{chunk.E52UTLQ2.js → chunk.2WSRJGW2.js} +1 -1
  6. package/dist/preview/{chunk.3377DLPA.js → chunk.33YC5RCB.js} +1 -1
  7. package/dist/preview/chunk.3G5DEGFA.js +1 -0
  8. package/dist/preview/{chunk.MDIAWTNK.js → chunk.3IEJQAK7.js} +1 -1
  9. package/dist/preview/{chunk.W54NXXC5.js → chunk.3JMZHCB4.js} +1 -1
  10. package/dist/preview/chunk.3MZIWKNG.js +5 -0
  11. package/dist/preview/{chunk.KAKJYAHM.js → chunk.3SOJJAMY.js} +1 -1
  12. package/dist/preview/{chunk.VTCPA4V4.js → chunk.3V2WXZU3.js} +1 -1
  13. package/dist/preview/{chunk.RUTZEEBR.js → chunk.3ZONBC6L.js} +1 -1
  14. package/dist/preview/{chunk.CSA6SWTI.js → chunk.45HTFSWD.js} +1 -1
  15. package/dist/preview/{chunk.MKWVNW4Q.js → chunk.463PGKOL.js} +3 -3
  16. package/dist/preview/chunk.4BX3KLAA.js +1 -0
  17. package/dist/preview/{chunk.XBNASVTY.js → chunk.4F5M5XZG.js} +1 -1
  18. package/dist/preview/{chunk.UVMLX4US.js → chunk.4GHXAWIE.js} +1 -1
  19. package/dist/preview/{chunk.ULTYDYTS.js → chunk.4KTHJY5N.js} +2 -2
  20. package/dist/preview/{chunk.65F3DF5Q.js → chunk.4TGQ6Z6E.js} +1 -1
  21. package/dist/preview/{chunk.HDXDYS4C.js → chunk.4V64RBCK.js} +1 -1
  22. package/dist/preview/{chunk.P7FN3SFB.js → chunk.4WH4N4V7.js} +1 -1
  23. package/dist/preview/{chunk.BB5XKTVC.js → chunk.562IVJHX.js} +1 -1
  24. package/dist/preview/{chunk.OP3ZUI4W.js → chunk.57VTD3CU.js} +1 -1
  25. package/dist/preview/{chunk.LCG3VLCB.js → chunk.5C43AM3X.js} +1 -1
  26. package/dist/preview/chunk.5M62CMLA.js +1 -0
  27. package/dist/preview/{chunk.G226CUJQ.js → chunk.5RH6FO3K.js} +1 -1
  28. package/dist/preview/{chunk.KCM2VOC7.js → chunk.5VF2RT4H.js} +1 -1
  29. package/dist/preview/{chunk.5H3VCAPN.js → chunk.5XAIP3BS.js} +1 -1
  30. package/dist/preview/{chunk.MT45H2T5.js → chunk.5ZWE72VJ.js} +1 -1
  31. package/dist/preview/{chunk.S6TN3MLY.js → chunk.644FUGSX.js} +1 -1
  32. package/dist/preview/{chunk.I6W3IQ4W.js → chunk.6BBB7SJL.js} +1 -1
  33. package/dist/preview/chunk.6SPORDJC.js +1 -0
  34. package/dist/preview/{chunk.5XFRWXYQ.js → chunk.6TILXTP6.js} +1 -1
  35. package/dist/preview/{chunk.BPPDBPTL.js → chunk.7JCUSYS5.js} +1 -1
  36. package/dist/preview/{chunk.GZBODS7Z.js → chunk.7SCENHVG.js} +1 -1
  37. package/dist/preview/{chunk.NCTTPW7A.js → chunk.7TMWMW4W.js} +1 -1
  38. package/dist/preview/{chunk.FGJM4LJO.js → chunk.7UD2JR6J.js} +1 -1
  39. package/dist/preview/{chunk.IYVBJDR7.js → chunk.AG7CUSSV.js} +1 -1
  40. package/dist/preview/{chunk.PEA4D66Y.js → chunk.AKLVSZ5A.js} +1 -1
  41. package/dist/preview/{chunk.5K5D4IMM.js → chunk.AN5QCSVK.js} +1 -1
  42. package/dist/preview/{chunk.UQ4CASST.js → chunk.ARRLAAG6.js} +1 -1
  43. package/dist/preview/{chunk.Y4VOCJ7R.js → chunk.AZGXBTOQ.js} +1 -1
  44. package/dist/preview/{chunk.T56SOSIR.js → chunk.B2X6DA2Q.js} +1 -1
  45. package/dist/preview/{chunk.4SVAHPJA.js → chunk.B6PKKEY3.js} +1 -1
  46. package/dist/preview/{chunk.MSPRCR3Q.js → chunk.BOMYLOCX.js} +1 -1
  47. package/dist/preview/{chunk.QATG5HNV.js → chunk.BPWSQVEN.js} +1 -1
  48. package/dist/preview/{chunk.K7WME4P4.js → chunk.BUDEUNBN.js} +1 -1
  49. package/dist/preview/{chunk.CIUQWCU4.js → chunk.C3AHDHX7.js} +1 -1
  50. package/dist/preview/{chunk.TXEWSZGO.js → chunk.C6HBYRGJ.js} +1 -1
  51. package/dist/preview/{chunk.56UFDIX5.js → chunk.C6HI3LRB.js} +1 -1
  52. package/dist/preview/{chunk.ASCTAUFD.js → chunk.CB5DGKR5.js} +1 -1
  53. package/dist/preview/{chunk.VOHDRH3P.js → chunk.CB7IUKY7.js} +2 -2
  54. package/dist/preview/{chunk.JCJ7NTW4.js → chunk.COWJTVZV.js} +1 -1
  55. package/dist/preview/{chunk.CYP5KXIQ.js → chunk.D2PJG5N7.js} +1 -1
  56. package/dist/preview/chunk.D6ACCKYJ.js +1 -0
  57. package/dist/preview/{chunk.DQPEVPKQ.js → chunk.DF7IPT7V.js} +2 -2
  58. package/dist/preview/{chunk.VRJ4TULC.js → chunk.DTJ4FIHM.js} +1 -1
  59. package/dist/preview/chunk.DVG47BK3.js +1 -0
  60. package/dist/preview/{chunk.GANAZIRD.js → chunk.E5JX5LWY.js} +1 -1
  61. package/dist/preview/{chunk.EG2N5F6L.js → chunk.EC7I33WI.js} +1 -1
  62. package/dist/preview/{chunk.UYCPQ6IW.js → chunk.FCZ7UFJI.js} +1 -1
  63. package/dist/preview/{chunk.A2RQFAZ6.js → chunk.FMP6NDRZ.js} +1 -1
  64. package/dist/preview/{chunk.FJN4OGAS.js → chunk.FRZQSSGE.js} +2 -2
  65. package/dist/preview/{chunk.FBRARPGR.js → chunk.FWKNR7XF.js} +2 -2
  66. package/dist/preview/{chunk.G6DISMVT.js → chunk.FWZF7X6A.js} +2 -2
  67. package/dist/preview/{chunk.HBVURYWY.js → chunk.GHPCSNM6.js} +2 -2
  68. package/dist/preview/{chunk.CWPRQSED.js → chunk.GKLDSHHH.js} +1 -1
  69. package/dist/preview/{chunk.7NFCI4LH.js → chunk.GVUJCOKD.js} +2 -2
  70. package/dist/preview/chunk.HLDMTKUP.js +1 -0
  71. package/dist/preview/{chunk.OZYZBRWO.js → chunk.IDYPQ45A.js} +1 -1
  72. package/dist/preview/{chunk.LAOZEYYQ.js → chunk.IMHUKSPM.js} +2 -2
  73. package/dist/preview/{chunk.U4T4Y2MT.js → chunk.IYYP6QUH.js} +1 -1
  74. package/dist/preview/chunk.J2Z6WLCH.js +88 -0
  75. package/dist/preview/chunk.J3OX474P.js +1 -0
  76. package/dist/preview/chunk.JCFYZEMY.js +1 -0
  77. package/dist/preview/{chunk.7BXOQEUP.js → chunk.JLB4QP6Q.js} +1 -1
  78. package/dist/preview/{chunk.DUZS52WX.js → chunk.JTOAZ2IR.js} +1 -1
  79. package/dist/preview/chunk.JXGDVJ4N.js +1 -0
  80. package/dist/preview/{chunk.YI7WHBAD.js → chunk.K2J26XMB.js} +1 -1
  81. package/dist/preview/{chunk.OPKXCL5R.js → chunk.KI6M3EWZ.js} +1 -1
  82. package/dist/preview/{chunk.3FRVG6JW.js → chunk.KJGNLWU3.js} +2 -2
  83. package/dist/preview/chunk.KLJDBYAZ.js +1 -0
  84. package/dist/preview/{chunk.3FUFVVR4.js → chunk.KRVEAIKW.js} +1 -1
  85. package/dist/preview/{chunk.AQJD23AN.js → chunk.L7MFTL5S.js} +1 -1
  86. package/dist/preview/{chunk.VTRI2MT2.js → chunk.LNOWO3IY.js} +2 -2
  87. package/dist/preview/{chunk.NAEEPUWJ.js → chunk.LOUICR7K.js} +1 -1
  88. package/dist/preview/{chunk.WDEMPWS4.js → chunk.LU3B3SZH.js} +1 -1
  89. package/dist/preview/{chunk.6S3B4XC4.js → chunk.LVOL2LEC.js} +1 -1
  90. package/dist/preview/chunk.LYFEGG6E.js +1 -0
  91. package/dist/preview/{chunk.USAGE5C6.js → chunk.MAWP27FD.js} +1 -1
  92. package/dist/preview/chunk.MDWCX3YU.js +1 -0
  93. package/dist/preview/{chunk.HAIHXBVX.js → chunk.MNW2ZBQ6.js} +1 -1
  94. package/dist/preview/{chunk.GYO57LKD.js → chunk.MPMROUZA.js} +1 -1
  95. package/dist/preview/{chunk.CANTHIRO.js → chunk.MVRNEC3Y.js} +1 -1
  96. package/dist/preview/{chunk.JQTO52Q7.js → chunk.NDI5OWIB.js} +1 -1
  97. package/dist/preview/{chunk.ICYJ7QJG.js → chunk.NEJSKMJV.js} +1 -1
  98. package/dist/preview/{chunk.XFIZLWYA.js → chunk.NGWHV4G6.js} +1 -1
  99. package/dist/preview/{chunk.EZXGVTT2.js → chunk.OCV46AFN.js} +1 -1
  100. package/dist/preview/{chunk.ZYYM52N5.js → chunk.OLKFEHWB.js} +1 -1
  101. package/dist/preview/{chunk.TLQTDKOL.js → chunk.OZ4EJ5M6.js} +2 -2
  102. package/dist/preview/chunk.PCNEM3WE.js +1 -0
  103. package/dist/preview/{chunk.HIFLBWQJ.js → chunk.PR2TSHE7.js} +2 -2
  104. package/dist/preview/{chunk.2LQ37DC2.js → chunk.PZ4G5QA5.js} +1 -1
  105. package/dist/preview/{chunk.TTFYXKLI.js → chunk.PZWJUQAO.js} +1 -1
  106. package/dist/preview/{chunk.4DCPB67O.js → chunk.Q6RUTFU3.js} +1 -1
  107. package/dist/preview/{chunk.JRU5BT7K.js → chunk.QB7RYJ67.js} +2 -2
  108. package/dist/preview/{chunk.JKCLYLT4.js → chunk.R7RDUW37.js} +1 -1
  109. package/dist/preview/{chunk.RIS3OKAI.js → chunk.RBYRT2I2.js} +1 -1
  110. package/dist/preview/{chunk.Z4YSCHZT.js → chunk.RCFAHV5N.js} +1 -1
  111. package/dist/preview/{chunk.S2ATSY6P.js → chunk.RLO3RDYH.js} +1 -1
  112. package/dist/preview/chunk.RYMSHMLM.js +1 -0
  113. package/dist/preview/chunk.SDO3DD77.js +6 -0
  114. package/dist/preview/chunk.SF4BYBH6.js +25 -0
  115. package/dist/preview/chunk.SG7YVKH4.js +1 -0
  116. package/dist/preview/chunk.T42H5RXN.js +1 -0
  117. package/dist/preview/{chunk.72Q4R7N6.js → chunk.TUNHUTQ5.js} +1 -1
  118. package/dist/preview/{chunk.GPYZR6HE.js → chunk.U7GN6UPR.js} +1 -1
  119. package/dist/preview/{chunk.6CVW53WA.js → chunk.ULSN3ASK.js} +1 -1
  120. package/dist/preview/{chunk.BQHRZJ5Z.js → chunk.VFMC45E7.js} +1 -1
  121. package/dist/preview/{chunk.36XV4ZMC.js → chunk.VGOWGOGD.js} +2 -2
  122. package/dist/preview/{chunk.YA7ZMGOL.js → chunk.VTO6UWUP.js} +1 -1
  123. package/dist/preview/chunk.VW6X53E7.js +1 -0
  124. package/dist/preview/{chunk.HIDLE6BN.js → chunk.VWQ57LTT.js} +3 -3
  125. package/dist/preview/{chunk.6ESAZJBN.js → chunk.VYKEIKY5.js} +1 -1
  126. package/dist/preview/{chunk.XDEKL6TJ.js → chunk.W6NCLU5Y.js} +1 -1
  127. package/dist/preview/{chunk.GBIVIHGD.js → chunk.WHGEDJB2.js} +2 -2
  128. package/dist/preview/{chunk.FCAKLO5U.js → chunk.WICMCZ27.js} +1 -1
  129. package/dist/preview/{chunk.E647LWH5.js → chunk.WVWXNW74.js} +2 -2
  130. package/dist/preview/{chunk.5E4UGVAD.js → chunk.XBDFXFWM.js} +1 -1
  131. package/dist/preview/{chunk.KWMBRB6O.js → chunk.XTT6ERI3.js} +1 -1
  132. package/dist/preview/{chunk.R3DWF35R.js → chunk.XZJ6XX5I.js} +1 -1
  133. package/dist/preview/{chunk.OCWZJNZF.js → chunk.Y2DFDMT6.js} +1 -1
  134. package/dist/preview/{chunk.UXNZPPWR.js → chunk.Y36MLVMT.js} +1 -1
  135. package/dist/preview/{chunk.UQENE3VE.js → chunk.Y36WSKL5.js} +1 -1
  136. package/dist/preview/chunk.YXRKZMS5.js +1 -0
  137. package/dist/preview/{chunk.34Q7OKK3.js → chunk.Z6O7RUSR.js} +1 -1
  138. package/dist/preview/chunk.ZAGP3OKY.js +1 -0
  139. package/dist/preview/{chunk.N6A3DIOY.js → chunk.ZBHFCSKO.js} +1 -1
  140. package/dist/preview/{chunk.BG2SC77J.js → chunk.ZDDWXRPK.js} +1 -1
  141. package/dist/preview/{chunk.TRPPN2GD.js → chunk.ZUBC3UFG.js} +1 -1
  142. package/dist/preview/{chunk.LDLWYAHK.js → chunk.ZYW7Q5EN.js} +1 -1
  143. package/dist/preview/index.html +50 -51
  144. package/dist/preview/page.js +2 -2
  145. package/package.json +6 -6
  146. package/dist/preview/chunk.2IKVO743.js +0 -1
  147. package/dist/preview/chunk.3Y7BDRP3.js +0 -1
  148. package/dist/preview/chunk.4DFO43VM.js +0 -1
  149. package/dist/preview/chunk.4QVZXCV5.js +0 -1
  150. package/dist/preview/chunk.52Y37IAD.js +0 -1
  151. package/dist/preview/chunk.6W2DUW5S.js +0 -5
  152. package/dist/preview/chunk.7R6GXJS4.js +0 -6
  153. package/dist/preview/chunk.B3T4N2XM.js +0 -25
  154. package/dist/preview/chunk.D3A24PQ6.js +0 -1
  155. package/dist/preview/chunk.FXNUR5JI.js +0 -88
  156. package/dist/preview/chunk.GGHZEAAT.js +0 -1
  157. package/dist/preview/chunk.GZWC72HS.js +0 -1
  158. package/dist/preview/chunk.H2B3SEI7.js +0 -1
  159. package/dist/preview/chunk.HE545Z6I.js +0 -1
  160. package/dist/preview/chunk.I62MCBQM.js +0 -1
  161. package/dist/preview/chunk.I6SUHXJF.js +0 -1
  162. package/dist/preview/chunk.LEKML4S4.js +0 -1
  163. package/dist/preview/chunk.MXTDQXVW.js +0 -1
  164. package/dist/preview/chunk.OXLYDXQV.js +0 -1
  165. package/dist/preview/chunk.P2W727C7.js +0 -1
  166. package/dist/preview/chunk.PFXGWY3P.js +0 -1
  167. package/dist/preview/chunk.Q5JVKSEN.js +0 -1
  168. package/dist/preview/chunk.Q5WEOX3Q.js +0 -1
  169. package/dist/preview/chunk.SHNYYBNW.js +0 -1
  170. package/dist/preview/chunk.THL67D77.js +0 -1
  171. package/dist/preview/chunk.XXCT6DLX.js +0 -1
  172. package/dist/preview/chunk.ZJXUWOG3.js +0 -1
  173. package/dist/preview/chunk.ZQWKS6K5.js +0 -1
@@ -1 +1 @@
1
- import{a as h}from"./chunk.TI4OSTQV.js";import{I as k,M as I,P as M,T as w,W as R,dc as T,eb as j,fb as y,gc as N,ka as P,mc as K,ob as B,pc as b}from"./chunk.6W2DUW5S.js";var O=(e,i)=>e.expiresAt!==void 0&&Date.parse(e.expiresAt)<=Date.parse(i),L=(e,i,n)=>(e??[]).some(t=>t.suggestion===i&&(t.until===void 0||Date.parse(t.until)>Date.parse(n)));function $(e,i=()=>!0,n={}){let t=T(e),o=new Set(e.map(r=>r.lineage?.suggestion)),s=n.now??new Date().toISOString();return e.filter(r=>r.suggests&&!r.withheld&&!t.has(r.id)&&!o.has(r.id)&&!O(r,s)&&!L(n.dismissed,r.id,s)).map(({id:r,batch:g,suggests:p,intent:c,author:a,lineage:d,at:l,expiresAt:f})=>{let u=new Set;return JSON.stringify(p.map(D=>D.args),(D,x)=>(typeof x=="string"&&i(x)&&u.add(x),x)),{id:r,batch:g,calls:p,intent:c,author:a,...d?{lineage:d}:{},at:l,expiresAt:f,about:[...u]}})}function W(e,i){return e.ops.length>0&&e.ops.every(n=>n.suggests!==void 0||n.undoes!==void 0&&i(n.undoes)?.suggests!==void 0)}var v=e=>[...e].length;function F(e){let i,n=0,t=0;for(let o of e.ops){let s=o.mutation?.name===B&&o.withheld!==!0&&o.undoes===void 0?o.mutation.args:void 0;if(typeof s?.node!="string"||typeof s.field!="string"||i&&(i.node!==s.node||i.field!==s.field))return;i={node:s.node,field:s.field};for(let r of o.primitives)r.op==="splice-text"?(n+=v(r.inserted),t+=v(r.removed)):r.op==="patch-node"&&typeof r.after[s.field]=="string"&&(n+=v(r.after[s.field]))}return i&&{...i,inserted:n,removed:t}}function V(e,i,n){let t=n.getNode(e.node)?.kind,o=[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]];return`Wrote in ${P(t?i.tryDefinition(t):void 0,e.field)} (${o.join(" ")})`}var m=e=>JSON.stringify([e.kind,e.id??"",e.name??""]),_=e=>e.ops.find(i=>i.lineage?.run!==void 0)?.lineage?.run;function J(e,i=()=>{}){let n=[];for(let t of e){if(W(t,i))continue;if(!K(t.author)){let a=F(t),d=n.at(-1),l=a&&d&&"batch"in d&&m(d.batch.author)===m(t.author)&&d.typed?.node===a.node&&d.typed.field===a.field?d.typed:void 0;l?n[n.length-1]={batch:t,typed:{...l,batches:[...l.batches,t],inserted:l.inserted+a.inserted,removed:l.removed+a.removed}}:n.push(a?{batch:t,typed:{batches:[t],...a}}:{batch:t});continue}let o=_(t),s=m(t.author),r=o!==void 0?n.findIndex(a=>"digest"in a&&a.digest.run===o&&m(a.digest.author)===s):n.length-1,g=n[r],p=g!==void 0&&"digest"in g&&m(g.digest.author)===s&&g.digest.run===o?g.digest:void 0,c=[...p?.batches??[],t];p&&n.splice(r,1),n.push({digest:{author:t.author,batches:c,things:Y(c),at:t.at,...o!==void 0?{run:o}:{}}})}return n}var Y=e=>e.reduce((i,n)=>i+(n.undone?0:n.ops.length),0),q=e=>{let i=Date.parse(e);if(Number.isNaN(i))return!1;let{minutes:n}=M(i,I());return n<6*60||n>=21*60};function z(e,i=w(new Date().toISOString())??k()){let n=w(e.at)??e.at.slice(0,10),o=e.run!==void 0&&n===i&&[e.at,...(e.batches??[]).map(s=>s.at)].every(q)?"overnight":n===i?"today":`on ${R(n)}`;return`Tidied ${e.things===1?"one thing":`${e.things} things`} ${o}`}var S=e=>e,A=(e,i)=>i===void 0?{}:{[e]:i};function de(e,i,n){let t=h(e)?.store??e,o=S(t),s=N(n.lineage);if(s===void 0)throw new y("A suggestion says what it is based on: { basis, confidence? }");let r=n.author??o.by;if(n.expiresAt!==void 0&&Number.isNaN(Date.parse(n.expiresAt)))throw new y(`A suggestion expires at a time: "${n.expiresAt}" is not one (an ISO time, like 2026-10-23T06:00:00Z).`);let g=o.actMeanings(),p=b(i,g),c=C(t).find(u=>b(u.calls,g)===p);if(c)return t.log.get(c.id);o.refuseDeclined(i,r);let a=o.rehearsal();a.suggesting=!0;let d=a.applying(i,{author:r,lineage:s,...A("via",n.via)});if(d.ops.length===0)return;let l=[...new Set(d.ops.flatMap(u=>u.described??[]))],f={id:o.nextId(),seq:t.log.length,batch:o.mintBatch("batch"),author:r,intent:d.ops.map(u=>u.intent).join("; "),...A("batchIntent",n.intent),mutation:null,primitives:[],reads:[],writes:[],...l.length>0?{described:l}:{},at:o.now(),...A("via",n.via),lineage:s,suggests:i,...A("expiresAt",n.expiresAt)};return t.log.append(f),t.notify(j,[f]),f}function C(e,i,n={}){let t=h(e),o=t?.store??e,s=i??t?.principal,r=(s!==void 0?o.seenBy(s):o).log.all();return $(r,g=>o.graph.has(g),{now:S(o).now(),dismissed:n.dismissed})}function E(e,i,n){let t=C(e,n).find(s=>s.id===i),o=t?void 0:e.log.get(i);if(o?.suggests&&O(o,S(e).now()))throw new y(`That suggestion expired on ${o.expiresAt.slice(0,10)}.`);if(!t)throw new y("That suggestion is no longer waiting: it was accepted or declined, or it is not one you can see.");return t}function ge(e,i,n={}){let t=h(e)?.store??e,o=n.author??S(t).by,s=E(t,i,o);return t.applyAll(s.calls,{...n,author:o,lineage:{...s.lineage,suggestion:i}})}function le(e,i,n={}){let t=h(e)?.store??e,o=n.author??S(t).by,s=E(t,i,o);return t.undo(s.batch,{...n,author:o})}export{V as a,J as b,z as c,de as d,C as e,ge as f,le as g};
1
+ import{a as h}from"./chunk.TI4OSTQV.js";import{I as k,M as I,P as M,T as w,W as R,dc as T,eb as j,fb as y,gc as N,ka as P,mc as K,ob as B,pc as b}from"./chunk.3MZIWKNG.js";var O=(e,i)=>e.expiresAt!==void 0&&Date.parse(e.expiresAt)<=Date.parse(i),L=(e,i,n)=>(e??[]).some(t=>t.suggestion===i&&(t.until===void 0||Date.parse(t.until)>Date.parse(n)));function $(e,i=()=>!0,n={}){let t=T(e),o=new Set(e.map(r=>r.lineage?.suggestion)),s=n.now??new Date().toISOString();return e.filter(r=>r.suggests&&!r.withheld&&!t.has(r.id)&&!o.has(r.id)&&!O(r,s)&&!L(n.dismissed,r.id,s)).map(({id:r,batch:g,suggests:p,intent:c,author:a,lineage:d,at:l,expiresAt:f})=>{let u=new Set;return JSON.stringify(p.map(D=>D.args),(D,x)=>(typeof x=="string"&&i(x)&&u.add(x),x)),{id:r,batch:g,calls:p,intent:c,author:a,...d?{lineage:d}:{},at:l,expiresAt:f,about:[...u]}})}function W(e,i){return e.ops.length>0&&e.ops.every(n=>n.suggests!==void 0||n.undoes!==void 0&&i(n.undoes)?.suggests!==void 0)}var v=e=>[...e].length;function F(e){let i,n=0,t=0;for(let o of e.ops){let s=o.mutation?.name===B&&o.withheld!==!0&&o.undoes===void 0?o.mutation.args:void 0;if(typeof s?.node!="string"||typeof s.field!="string"||i&&(i.node!==s.node||i.field!==s.field))return;i={node:s.node,field:s.field};for(let r of o.primitives)r.op==="splice-text"?(n+=v(r.inserted),t+=v(r.removed)):r.op==="patch-node"&&typeof r.after[s.field]=="string"&&(n+=v(r.after[s.field]))}return i&&{...i,inserted:n,removed:t}}function V(e,i,n){let t=n.getNode(e.node)?.kind,o=[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]];return`Wrote in ${P(t?i.tryDefinition(t):void 0,e.field)} (${o.join(" ")})`}var m=e=>JSON.stringify([e.kind,e.id??"",e.name??""]),_=e=>e.ops.find(i=>i.lineage?.run!==void 0)?.lineage?.run;function J(e,i=()=>{}){let n=[];for(let t of e){if(W(t,i))continue;if(!K(t.author)){let a=F(t),d=n.at(-1),l=a&&d&&"batch"in d&&m(d.batch.author)===m(t.author)&&d.typed?.node===a.node&&d.typed.field===a.field?d.typed:void 0;l?n[n.length-1]={batch:t,typed:{...l,batches:[...l.batches,t],inserted:l.inserted+a.inserted,removed:l.removed+a.removed}}:n.push(a?{batch:t,typed:{batches:[t],...a}}:{batch:t});continue}let o=_(t),s=m(t.author),r=o!==void 0?n.findIndex(a=>"digest"in a&&a.digest.run===o&&m(a.digest.author)===s):n.length-1,g=n[r],p=g!==void 0&&"digest"in g&&m(g.digest.author)===s&&g.digest.run===o?g.digest:void 0,c=[...p?.batches??[],t];p&&n.splice(r,1),n.push({digest:{author:t.author,batches:c,things:Y(c),at:t.at,...o!==void 0?{run:o}:{}}})}return n}var Y=e=>e.reduce((i,n)=>i+(n.undone?0:n.ops.length),0),q=e=>{let i=Date.parse(e);if(Number.isNaN(i))return!1;let{minutes:n}=M(i,I());return n<6*60||n>=21*60};function z(e,i=w(new Date().toISOString())??k()){let n=w(e.at)??e.at.slice(0,10),o=e.run!==void 0&&n===i&&[e.at,...(e.batches??[]).map(s=>s.at)].every(q)?"overnight":n===i?"today":`on ${R(n)}`;return`Tidied ${e.things===1?"one thing":`${e.things} things`} ${o}`}var S=e=>e,A=(e,i)=>i===void 0?{}:{[e]:i};function de(e,i,n){let t=h(e)?.store??e,o=S(t),s=N(n.lineage);if(s===void 0)throw new y("A suggestion says what it is based on: { basis, confidence? }");let r=n.author??o.by;if(n.expiresAt!==void 0&&Number.isNaN(Date.parse(n.expiresAt)))throw new y(`A suggestion expires at a time: "${n.expiresAt}" is not one (an ISO time, like 2026-10-23T06:00:00Z).`);let g=o.actMeanings(),p=b(i,g),c=C(t).find(u=>b(u.calls,g)===p);if(c)return t.log.get(c.id);o.refuseDeclined(i,r);let a=o.rehearsal();a.suggesting=!0;let d=a.applying(i,{author:r,lineage:s,...A("via",n.via)});if(d.ops.length===0)return;let l=[...new Set(d.ops.flatMap(u=>u.described??[]))],f={id:o.nextId(),seq:t.log.length,batch:o.mintBatch("batch"),author:r,intent:d.ops.map(u=>u.intent).join("; "),...A("batchIntent",n.intent),mutation:null,primitives:[],reads:[],writes:[],...l.length>0?{described:l}:{},at:o.now(),...A("via",n.via),lineage:s,suggests:i,...A("expiresAt",n.expiresAt)};return t.log.append(f),t.notify(j,[f]),f}function C(e,i,n={}){let t=h(e),o=t?.store??e,s=i??t?.principal,r=(s!==void 0?o.seenBy(s):o).log.all();return $(r,g=>o.graph.has(g),{now:S(o).now(),dismissed:n.dismissed})}function E(e,i,n){let t=C(e,n).find(s=>s.id===i),o=t?void 0:e.log.get(i);if(o?.suggests&&O(o,S(e).now()))throw new y(`That suggestion expired on ${o.expiresAt.slice(0,10)}.`);if(!t)throw new y("That suggestion is no longer waiting: it was accepted or declined, or it is not one you can see.");return t}function ge(e,i,n={}){let t=h(e)?.store??e,o=n.author??S(t).by,s=E(t,i,o);return t.applyAll(s.calls,{...n,author:o,lineage:{...s.lineage,suggestion:i}})}function le(e,i,n={}){let t=h(e)?.store??e,o=n.author??S(t).by,s=E(t,i,o);return t.undo(s.batch,{...n,author:o})}export{V as a,J as b,z as c,de as d,C as e,ge as f,le as g};
@@ -1,2 +1,2 @@
1
- import{Da as Q,F,G as B,I as L,Jb as I,La as X,O,Qb as en,R as j,S as J,T as U,U as K,Wa as v,Za as nn,_ as P,aa as Z,la as z}from"./chunk.6W2DUW5S.js";var un=1e4,g=class{constructor(s){this.nodes=s}},rn=Symbol.for("@graview/core:far-record"),fn=e=>typeof e=="object"&&e!==null&&e[rn]===!0;function cn(e){let s={...e.fields,id:`@${e.address}/${e.kind}:${e.id}`,kind:`@${e.address}/${e.kind}`,label:e.label};return Object.defineProperty(s,rn,{value:!0}),s}function Nn(e){let s=`the linked record in ${e.ref.address}`;return e.reason==="denied"?`${s} is not one this viewer may open`:`${s} has not been read`}var pn="",f=class extends Error{constructor(c,l){super(c);this.sentence=c;this.at=l}},W=class extends f{},V=e=>e!==null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof g)&&typeof e.id=="string",tn=e=>{let s=new Set;return new g(e.filter(c=>!s.has(c.id)&&s.add(c.id)))},w=e=>e===null?"nothing":e instanceof g?"a set of records":Array.isArray(e)?"a list":V(e)?"a record":typeof e=="string"?"a word":typeof e;function on(e,s){let c=s.budget??un,l=(n,a)=>{if(c-=n,c<0)throw new W("this rule looks at too much of the graph to judge in one go",a)},u=s.today??L(),b=s.now??new Date().toISOString(),k=new Map,N=new Set,A=s.bindings,H=(n,a,t,o)=>{let d=`${n?.id}\0${a}`;if(k.has(d))return k.get(d);if(N.has(d))throw new f(`"${a}"${n?` of ${z(n.kind)}`:""} depends on itself`,o);N.add(d);let r=A;A=void 0;try{let i=$(t,n);return k.set(d,i),i}finally{A=r,N.delete(d)}},E=(n,a,t)=>{l(1,t);let o=s.kinds.get(n.kind),d=o?.computed?.get(a);if(d)return H(n,a,d,t);let r=o?.linked?.get(a);if(r){let y=Q(Object.hasOwn(n,a)?n[a]:void 0,r);l(y.length,t);let m=s.linked??X(s.graph),h=y.flatMap(x=>{let C=m?m(x):{unread:!0};return"record"in C?[cn(C.record)]:(s.onUnread?.({relation:a,ref:x,reason:"denied"in C?"denied":"unread"}),[])});return r.cardinality==="one"?h[0]??null:new g(h)}let i=Object.hasOwn(n,a);if(o?.fields.has(a)||i){let y=i?v(n,a,u):void 0;return y===void 0?null:y}let p=o?.edges.get(a);if(p){let y=s.graph.out(n.id,a);return l(y.length,t),p==="one"?y[0]??null:new g(y)}if(a==="id")return n.id;if(fn(n))return null;throw new f(`${z(n.kind)} has no field or relation called "${a}"`,t)},S=(n,a,t)=>{if(n instanceof g)return n;if(n===null)return new g([]);if(V(n))return new g([n]);throw new f(`${t}(\u2026) needs a set of records, and was given ${w(n)}`,a)},G=(n,a,t)=>{if(n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);throw new f(`${t}(\u2026) needs a word, and was given ${w(n)}`,a)},_=(n,a,t)=>{let o=G(n,a,t);if(o===null)return null;let d=Date.parse(o.length===10?`${o}T00:00:00Z`:o);if(Number.isNaN(d))throw new f(`${t}(\u2026) needs a date, and "${o}" is not one`,a);return d},M=(n,a)=>V(n)&&V(a)?n.id===a.id:V(n)&&typeof a=="string"?n.id===a:typeof n=="string"&&V(a)?n===a.id:Array.isArray(n)&&Array.isArray(a)?n.length===a.length&&n.every((t,o)=>M(t,a[o])):n===a,R=(n,a,t)=>{if(n===null)return!1;if(typeof n=="boolean")return n;throw new f(`${t} must be true or false, and was ${w(n)}`,a)},T=(n,a)=>$(a,n);function $(n,a){switch(l(1,n.at),n.t){case"lit":return n.value;case"list":return n.items.map(t=>$(t,a));case"ident":{let t=A&&Object.hasOwn(A,n.name)?A[n.name]:void 0;if(t!==void 0)return t;if(a)return E(a,n.name,n.at);throw new f(`"${n.name}" means nothing in a rule over the whole graph`,n.at)}case"member":{let t=$(n.object,a);if(t===null)return null;if(V(t))return E(t,n.name,n.at);throw new f(`".${n.name}" needs a record before it, and was given ${w(t)}`,n.at)}case"unary":{let t=$(n.operand,a);if(n.op==="!")return!R(t,n.at,"what follows not");if(t===null)return null;if(typeof t!="number")throw new f(`"-" needs a number, and was given ${w(t)}`,n.at);return-t}case"where":{let t=S($(n.set,a),n.at,"where");return l(t.nodes.length,n.at),new g(t.nodes.filter(o=>R(T(o,n.filter),n.at,"a where condition")))}case"binary":return dn(n,a);case"call":return ln(n,a)}}function dn(n,a){if(n.op==="&&")return R($(n.left,a),n.at,"each side of and")&&R($(n.right,a),n.at,"each side of and");if(n.op==="||")return R($(n.left,a),n.at,"each side of or")||R($(n.right,a),n.at,"each side of or");let t=$(n.left,a),o=$(n.right,a);if(n.op==="&"||n.op==="|"||n.op==="-"&&(t instanceof g||o instanceof g)){let d=S(t,n.at,n.op).nodes,r=S(o,n.at,n.op).nodes;l(d.length+r.length,n.at);let i=new Set(r.map(p=>p.id));return tn(n.op==="|"?[...d,...r]:d.filter(p=>i.has(p.id)===(n.op==="&")))}switch(n.op){case"==":return M(t,o);case"!=":return!M(t,o);case"in":{if(o===null)return!1;if(o instanceof g)return o.nodes.some(d=>M(t,d));if(Array.isArray(o))return o.some(d=>M(t,d));if(typeof o=="string"&&typeof t=="string")return o.includes(t);throw new f(`"in" needs a list or a set on its right, and was given ${w(o)}`,n.at)}case"<":case"<=":case">":case">=":{if(t===null||o===null)return!1;if(!(typeof t=="number"&&typeof o=="number"||typeof t=="string"&&typeof o=="string"))throw new f(`cannot compare ${w(t)} with ${w(o)}`,n.at);return n.op==="<"?t<o:n.op==="<="?t<=o:n.op===">"?t>o:t>=o}default:{if(t===null||o===null)return null;if(n.op==="+"&&(typeof t=="string"||typeof o=="string")){let d=`${G(t,n.at,"+")}${G(o,n.at,"+")}`;if(d.length>1e4)throw new f("that makes a word too long",n.at);return d}if(typeof t!="number"||typeof o!="number")throw new f(`"${n.op}" needs numbers, and was given ${w(t)} and ${w(o)}`,n.at);return(n.op==="/"||n.op==="%")&&o===0?null:n.op==="+"?t+o:n.op==="-"?t-o:n.op==="*"?t*o:n.op==="/"?t/o:t%o}}}function ln(n,a){let t=(r,i=r)=>{if(n.args.length<r||n.args.length>i)throw new f(`${n.fn}(\u2026) takes ${r===i?r:`${r} to ${i}`} argument${i===1?"":"s"}`,n.at)},o=r=>$(n.args[r],a),d=r=>{let i=o(r);if(typeof i!="string")throw new f(`${n.fn}(\u2026) needs a quoted name, like ${n.fn}('name')`,n.at);return i};switch(n.fn){case"out":case"in":{t(1,2);let r=(y,m)=>n.fn==="out"?s.graph.out(y,m):s.graph.in(y,m);if(n.args.length===2){let y=S(o(0),n.at,n.fn).nodes,m=d(1);return tn(y.flatMap(h=>{let x=r(h.id,m);return l(x.length+1,n.at),x}))}let i=d(0);if(!a)throw new f(`${n.fn}('${i}') needs a record to start from`,n.at);let p=r(a.id,i);return l(p.length,n.at),new g(p)}case"all":{t(1,2);let r=s.graph.nodesOfKind(d(0),{archived:n.args.length===2?o(1):!1});return l(r.length,n.at),new g(r)}case"archived":return t(0,1),nn(n.args.length===1?o(0):a);case"count":return t(1),S(o(0),n.at,"count").nodes.length;case"exists":return t(1),S(o(0),n.at,"exists").nodes.length>0;case"every":case"some":{t(2);let r=S(o(0),n.at,n.fn);l(r.nodes.length,n.at);let i=p=>R(T(p,n.args[1]),n.at,`the condition in ${n.fn}(\u2026)`);return n.fn==="every"?r.nodes.every(i):r.nodes.some(i)}case"sum":case"min":case"max":{t(2);let r=S(o(0),n.at,n.fn);l(r.nodes.length,n.at);let i=n.args[1],p=i.t==="lit"&&typeof i.value=="string"?i.value:void 0,y=i.t==="ident"?`'${i.name}'`:p!==void 0?`'${p}'`:"\u2026",m=r.nodes.map(h=>i.t==="ident"?E(h,i.name,n.at):p!==void 0?E(h,p,n.at):T(h,i)).filter(h=>{if(h===null)return!1;if(typeof h!="number")throw new f(`${n.fn}(\u2026, ${y}) needs a number for each member, and found ${w(h)}`,n.at);return!0});return n.fn==="sum"?m.reduce((h,x)=>h+x,0):m.length===0?null:n.fn==="min"?Math.min(...m):Math.max(...m)}case"fact":{t(1);let r=d(0),i=s.kinds.get(pn)?.computed?.get(r);if(!i)throw new f(`no fact is called "${r}"`,n.at);return H(null,r,i,n.at)}case"first":return t(1),S(o(0),n.at,"first").nodes[0]??null;case"sort":{t(2,3);let r=S(o(0),n.at,"sort"),i=n.args.length===3?o(2):"asc";if(i!=="asc"&&i!=="desc")throw new f("sort(\u2026) goes 'asc' or 'desc'",n.at);let p=r.nodes.length;l(p+p*Math.ceil(Math.log2(p+1)),n.at);let y=r.nodes.map((h,x)=>({node:h,i:x,key:T(h,n.args[1])})),m=i==="desc"?-1:1;return y.sort((h,x)=>Y(h.key,x.key,m,n.at)||h.i-x.i),new g(y.map(h=>h.node))}case"either":{if(n.args.length<1)throw new f("either(\u2026) takes at least one argument",n.at);for(let r=0;r<n.args.length;r++){let i=o(r);if(i!==null&&!(i instanceof g&&i.nodes.length===0))return i}return null}case"present":{t(1);let r=o(0);return r===null||r===""?!1:Array.isArray(r)?r.length>0:r instanceof g?r.nodes.length>0:!0}case"len":{t(1);let r=o(0);if(r===null)return 0;if(typeof r=="string"||Array.isArray(r))return r.length;if(r instanceof g)return r.nodes.length;throw new f(`len(\u2026) needs a word or a list, and was given ${w(r)}`,n.at)}case"contains":case"startsWith":{t(2);let r=o(0),i=o(1);if(r===null||i===null)return!1;if(n.fn==="contains"&&Array.isArray(r))return r.some(m=>M(m,i));let p=G(r,n.at,n.fn),y=G(i,n.at,n.fn);return n.fn==="contains"?p.toLowerCase().includes(y.toLowerCase()):p.startsWith(y)}case"lower":{t(1);let r=G(o(0),n.at,"lower");return r===null?null:r.toLowerCase()}case"today":return t(0),u;case"now":return t(0),b;case"date":{t(1);let r=_(o(0),n.at,"date");return r===null?null:new Date(r).toISOString().slice(0,10)}case"days":case"hours":{t(2);let r=_(o(0),n.at,n.fn),i=_(o(1),n.at,n.fn);if(r===null||i===null)return null;let p=(i-r)/(n.fn==="days"?864e5:36e5);return n.fn==="days"?Math.round(p):p}case"if":return t(3),R(o(0),n.at,"the condition in if(\u2026)")?o(1):o(2);default:throw new f(`"${n.fn}" is not a function the rule language knows`,n.at)}}function Y(n,a,t,o){if(n===null||a===null)return n===a?0:n===null?1:-1;if(Array.isArray(n)&&Array.isArray(a)){for(let r=0;r<Math.max(n.length,a.length);r++){let i=Y(n[r]??null,a[r]??null,t,o);if(i!==0)return i}return 0}let d=r=>typeof r=="number"||typeof r=="string"||typeof r=="boolean"?typeof r:w(r);if(d(n)!==d(a)||typeof n=="object"||typeof a=="object")throw new f(`sort(\u2026) cannot put ${w(n)} and ${w(a)} in order`,o);return typeof n=="string"?t*(n<a?-1:n>a?1:0):t*(Number(n)-Number(a))}return $(e,s.subject)}var Rn=["out","in","all","count","exists","every","some","sum","min","max","present","len","contains","startsWith","lower","today","now","date","days","hours","if","first","sort","either","fact","archived"];var Gn=(e,s,c,l)=>({severity:"error",code:e,path:s,message:c,...l?{fix:l}:{}}),Mn=(e,s,c,l)=>({severity:"warning",code:e,path:s,message:c,...l?{fix:l}:{}}),On=e=>e.some(s=>s.severity==="error");function En(e){return e.map(s=>`${s.severity==="error"?"\u2717":s.severity==="warning"?"!":"\xB7"} ${s.path||"(document)"}: ${s.message}${s.fix?` \u2014 ${s.fix}`:""}`).join(`
1
+ import{Da as Q,F,G as B,I as L,Jb as I,La as X,O,Qb as en,R as j,S as J,T as U,U as K,Wa as v,Za as nn,_ as P,aa as Z,la as z}from"./chunk.3MZIWKNG.js";var un=1e4,g=class{constructor(s){this.nodes=s}},rn=Symbol.for("@graview/core:far-record"),fn=e=>typeof e=="object"&&e!==null&&e[rn]===!0;function cn(e){let s={...e.fields,id:`@${e.address}/${e.kind}:${e.id}`,kind:`@${e.address}/${e.kind}`,label:e.label};return Object.defineProperty(s,rn,{value:!0}),s}function Nn(e){let s=`the linked record in ${e.ref.address}`;return e.reason==="denied"?`${s} is not one this viewer may open`:`${s} has not been read`}var pn="",f=class extends Error{constructor(c,l){super(c);this.sentence=c;this.at=l}},W=class extends f{},V=e=>e!==null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof g)&&typeof e.id=="string",tn=e=>{let s=new Set;return new g(e.filter(c=>!s.has(c.id)&&s.add(c.id)))},w=e=>e===null?"nothing":e instanceof g?"a set of records":Array.isArray(e)?"a list":V(e)?"a record":typeof e=="string"?"a word":typeof e;function on(e,s){let c=s.budget??un,l=(n,a)=>{if(c-=n,c<0)throw new W("this rule looks at too much of the graph to judge in one go",a)},u=s.today??L(),b=s.now??new Date().toISOString(),k=new Map,N=new Set,A=s.bindings,H=(n,a,t,o)=>{let d=`${n?.id}\0${a}`;if(k.has(d))return k.get(d);if(N.has(d))throw new f(`"${a}"${n?` of ${z(n.kind)}`:""} depends on itself`,o);N.add(d);let r=A;A=void 0;try{let i=$(t,n);return k.set(d,i),i}finally{A=r,N.delete(d)}},E=(n,a,t)=>{l(1,t);let o=s.kinds.get(n.kind),d=o?.computed?.get(a);if(d)return H(n,a,d,t);let r=o?.linked?.get(a);if(r){let y=Q(Object.hasOwn(n,a)?n[a]:void 0,r);l(y.length,t);let m=s.linked??X(s.graph),h=y.flatMap(x=>{let C=m?m(x):{unread:!0};return"record"in C?[cn(C.record)]:(s.onUnread?.({relation:a,ref:x,reason:"denied"in C?"denied":"unread"}),[])});return r.cardinality==="one"?h[0]??null:new g(h)}let i=Object.hasOwn(n,a);if(o?.fields.has(a)||i){let y=i?v(n,a,u):void 0;return y===void 0?null:y}let p=o?.edges.get(a);if(p){let y=s.graph.out(n.id,a);return l(y.length,t),p==="one"?y[0]??null:new g(y)}if(a==="id")return n.id;if(fn(n))return null;throw new f(`${z(n.kind)} has no field or relation called "${a}"`,t)},S=(n,a,t)=>{if(n instanceof g)return n;if(n===null)return new g([]);if(V(n))return new g([n]);throw new f(`${t}(\u2026) needs a set of records, and was given ${w(n)}`,a)},G=(n,a,t)=>{if(n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);throw new f(`${t}(\u2026) needs a word, and was given ${w(n)}`,a)},_=(n,a,t)=>{let o=G(n,a,t);if(o===null)return null;let d=Date.parse(o.length===10?`${o}T00:00:00Z`:o);if(Number.isNaN(d))throw new f(`${t}(\u2026) needs a date, and "${o}" is not one`,a);return d},M=(n,a)=>V(n)&&V(a)?n.id===a.id:V(n)&&typeof a=="string"?n.id===a:typeof n=="string"&&V(a)?n===a.id:Array.isArray(n)&&Array.isArray(a)?n.length===a.length&&n.every((t,o)=>M(t,a[o])):n===a,R=(n,a,t)=>{if(n===null)return!1;if(typeof n=="boolean")return n;throw new f(`${t} must be true or false, and was ${w(n)}`,a)},T=(n,a)=>$(a,n);function $(n,a){switch(l(1,n.at),n.t){case"lit":return n.value;case"list":return n.items.map(t=>$(t,a));case"ident":{let t=A&&Object.hasOwn(A,n.name)?A[n.name]:void 0;if(t!==void 0)return t;if(a)return E(a,n.name,n.at);throw new f(`"${n.name}" means nothing in a rule over the whole graph`,n.at)}case"member":{let t=$(n.object,a);if(t===null)return null;if(V(t))return E(t,n.name,n.at);throw new f(`".${n.name}" needs a record before it, and was given ${w(t)}`,n.at)}case"unary":{let t=$(n.operand,a);if(n.op==="!")return!R(t,n.at,"what follows not");if(t===null)return null;if(typeof t!="number")throw new f(`"-" needs a number, and was given ${w(t)}`,n.at);return-t}case"where":{let t=S($(n.set,a),n.at,"where");return l(t.nodes.length,n.at),new g(t.nodes.filter(o=>R(T(o,n.filter),n.at,"a where condition")))}case"binary":return dn(n,a);case"call":return ln(n,a)}}function dn(n,a){if(n.op==="&&")return R($(n.left,a),n.at,"each side of and")&&R($(n.right,a),n.at,"each side of and");if(n.op==="||")return R($(n.left,a),n.at,"each side of or")||R($(n.right,a),n.at,"each side of or");let t=$(n.left,a),o=$(n.right,a);if(n.op==="&"||n.op==="|"||n.op==="-"&&(t instanceof g||o instanceof g)){let d=S(t,n.at,n.op).nodes,r=S(o,n.at,n.op).nodes;l(d.length+r.length,n.at);let i=new Set(r.map(p=>p.id));return tn(n.op==="|"?[...d,...r]:d.filter(p=>i.has(p.id)===(n.op==="&")))}switch(n.op){case"==":return M(t,o);case"!=":return!M(t,o);case"in":{if(o===null)return!1;if(o instanceof g)return o.nodes.some(d=>M(t,d));if(Array.isArray(o))return o.some(d=>M(t,d));if(typeof o=="string"&&typeof t=="string")return o.includes(t);throw new f(`"in" needs a list or a set on its right, and was given ${w(o)}`,n.at)}case"<":case"<=":case">":case">=":{if(t===null||o===null)return!1;if(!(typeof t=="number"&&typeof o=="number"||typeof t=="string"&&typeof o=="string"))throw new f(`cannot compare ${w(t)} with ${w(o)}`,n.at);return n.op==="<"?t<o:n.op==="<="?t<=o:n.op===">"?t>o:t>=o}default:{if(t===null||o===null)return null;if(n.op==="+"&&(typeof t=="string"||typeof o=="string")){let d=`${G(t,n.at,"+")}${G(o,n.at,"+")}`;if(d.length>1e4)throw new f("that makes a word too long",n.at);return d}if(typeof t!="number"||typeof o!="number")throw new f(`"${n.op}" needs numbers, and was given ${w(t)} and ${w(o)}`,n.at);return(n.op==="/"||n.op==="%")&&o===0?null:n.op==="+"?t+o:n.op==="-"?t-o:n.op==="*"?t*o:n.op==="/"?t/o:t%o}}}function ln(n,a){let t=(r,i=r)=>{if(n.args.length<r||n.args.length>i)throw new f(`${n.fn}(\u2026) takes ${r===i?r:`${r} to ${i}`} argument${i===1?"":"s"}`,n.at)},o=r=>$(n.args[r],a),d=r=>{let i=o(r);if(typeof i!="string")throw new f(`${n.fn}(\u2026) needs a quoted name, like ${n.fn}('name')`,n.at);return i};switch(n.fn){case"out":case"in":{t(1,2);let r=(y,m)=>n.fn==="out"?s.graph.out(y,m):s.graph.in(y,m);if(n.args.length===2){let y=S(o(0),n.at,n.fn).nodes,m=d(1);return tn(y.flatMap(h=>{let x=r(h.id,m);return l(x.length+1,n.at),x}))}let i=d(0);if(!a)throw new f(`${n.fn}('${i}') needs a record to start from`,n.at);let p=r(a.id,i);return l(p.length,n.at),new g(p)}case"all":{t(1,2);let r=s.graph.nodesOfKind(d(0),{archived:n.args.length===2?o(1):!1});return l(r.length,n.at),new g(r)}case"archived":return t(0,1),nn(n.args.length===1?o(0):a);case"count":return t(1),S(o(0),n.at,"count").nodes.length;case"exists":return t(1),S(o(0),n.at,"exists").nodes.length>0;case"every":case"some":{t(2);let r=S(o(0),n.at,n.fn);l(r.nodes.length,n.at);let i=p=>R(T(p,n.args[1]),n.at,`the condition in ${n.fn}(\u2026)`);return n.fn==="every"?r.nodes.every(i):r.nodes.some(i)}case"sum":case"min":case"max":{t(2);let r=S(o(0),n.at,n.fn);l(r.nodes.length,n.at);let i=n.args[1],p=i.t==="lit"&&typeof i.value=="string"?i.value:void 0,y=i.t==="ident"?`'${i.name}'`:p!==void 0?`'${p}'`:"\u2026",m=r.nodes.map(h=>i.t==="ident"?E(h,i.name,n.at):p!==void 0?E(h,p,n.at):T(h,i)).filter(h=>{if(h===null)return!1;if(typeof h!="number")throw new f(`${n.fn}(\u2026, ${y}) needs a number for each member, and found ${w(h)}`,n.at);return!0});return n.fn==="sum"?m.reduce((h,x)=>h+x,0):m.length===0?null:n.fn==="min"?Math.min(...m):Math.max(...m)}case"fact":{t(1);let r=d(0),i=s.kinds.get(pn)?.computed?.get(r);if(!i)throw new f(`no fact is called "${r}"`,n.at);return H(null,r,i,n.at)}case"first":return t(1),S(o(0),n.at,"first").nodes[0]??null;case"sort":{t(2,3);let r=S(o(0),n.at,"sort"),i=n.args.length===3?o(2):"asc";if(i!=="asc"&&i!=="desc")throw new f("sort(\u2026) goes 'asc' or 'desc'",n.at);let p=r.nodes.length;l(p+p*Math.ceil(Math.log2(p+1)),n.at);let y=r.nodes.map((h,x)=>({node:h,i:x,key:T(h,n.args[1])})),m=i==="desc"?-1:1;return y.sort((h,x)=>Y(h.key,x.key,m,n.at)||h.i-x.i),new g(y.map(h=>h.node))}case"either":{if(n.args.length<1)throw new f("either(\u2026) takes at least one argument",n.at);for(let r=0;r<n.args.length;r++){let i=o(r);if(i!==null&&!(i instanceof g&&i.nodes.length===0))return i}return null}case"present":{t(1);let r=o(0);return r===null||r===""?!1:Array.isArray(r)?r.length>0:r instanceof g?r.nodes.length>0:!0}case"len":{t(1);let r=o(0);if(r===null)return 0;if(typeof r=="string"||Array.isArray(r))return r.length;if(r instanceof g)return r.nodes.length;throw new f(`len(\u2026) needs a word or a list, and was given ${w(r)}`,n.at)}case"contains":case"startsWith":{t(2);let r=o(0),i=o(1);if(r===null||i===null)return!1;if(n.fn==="contains"&&Array.isArray(r))return r.some(m=>M(m,i));let p=G(r,n.at,n.fn),y=G(i,n.at,n.fn);return n.fn==="contains"?p.toLowerCase().includes(y.toLowerCase()):p.startsWith(y)}case"lower":{t(1);let r=G(o(0),n.at,"lower");return r===null?null:r.toLowerCase()}case"today":return t(0),u;case"now":return t(0),b;case"date":{t(1);let r=_(o(0),n.at,"date");return r===null?null:new Date(r).toISOString().slice(0,10)}case"days":case"hours":{t(2);let r=_(o(0),n.at,n.fn),i=_(o(1),n.at,n.fn);if(r===null||i===null)return null;let p=(i-r)/(n.fn==="days"?864e5:36e5);return n.fn==="days"?Math.round(p):p}case"if":return t(3),R(o(0),n.at,"the condition in if(\u2026)")?o(1):o(2);default:throw new f(`"${n.fn}" is not a function the rule language knows`,n.at)}}function Y(n,a,t,o){if(n===null||a===null)return n===a?0:n===null?1:-1;if(Array.isArray(n)&&Array.isArray(a)){for(let r=0;r<Math.max(n.length,a.length);r++){let i=Y(n[r]??null,a[r]??null,t,o);if(i!==0)return i}return 0}let d=r=>typeof r=="number"||typeof r=="string"||typeof r=="boolean"?typeof r:w(r);if(d(n)!==d(a)||typeof n=="object"||typeof a=="object")throw new f(`sort(\u2026) cannot put ${w(n)} and ${w(a)} in order`,o);return typeof n=="string"?t*(n<a?-1:n>a?1:0):t*(Number(n)-Number(a))}return $(e,s.subject)}var Rn=["out","in","all","count","exists","every","some","sum","min","max","present","len","contains","startsWith","lower","today","now","date","days","hours","if","first","sort","either","fact","archived"];var Gn=(e,s,c,l)=>({severity:"error",code:e,path:s,message:c,...l?{fix:l}:{}}),Mn=(e,s,c,l)=>({severity:"warning",code:e,path:s,message:c,...l?{fix:l}:{}}),On=e=>e.some(s=>s.severity==="error");function En(e){return e.map(s=>`${s.severity==="error"?"\u2717":s.severity==="warning"?"!":"\xB7"} ${s.path||"(document)"}: ${s.message}${s.fix?` \u2014 ${s.fix}`:""}`).join(`
2
2
  `)}var jn=["money","percent","date","time","datetime","relative","upper","lower","count","words","and","plural","excerpt"],gn={getNode:()=>{},allNodes:()=>[],allEdges:()=>[],nodesOfKind:()=>[],edgesOfKind:()=>[],out:()=>[],in:()=>[],neighbors:()=>[],has:()=>!1};function Un(e,s,c,l=[],u,b=D){return q(e,s,c,l,u,b)}var yn=(e,s)=>e.capital?P(s):s,hn=new Set(["words","plural","relative"]);function Kn(e,s){let c=e[0];return!c||c.text!==void 0||!c.format||!hn.has(c.format)?s:/^[a-z][a-z'’-]*(?=\s|$|[,.;:!?])/.test(s)?P(s):s}function mn(e){return e?s=>{let c=e.tryDefinition(s.kind)?.label;return c?c(s):D(s)}:D}var an=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],sn=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function wn(e,s){return!Number.isInteger(e)||e<0||e>99?K(e,s):e<20?an[e]:e%10===0?sn[e/10]:`${sn[Math.floor(e/10)]}-${an[e%10]}`}function $n(e){return/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:`${e}s`}var D=e=>String(e.name??e.title??e.label??e.id);function q(e,s,c,l=[],u,b=D){if(s==="plural"){let k=e instanceof g?e.nodes.length:Array.isArray(e)?e.length:typeof e=="number"?e:null;return k===null||l[0]===void 0?"\u2014":k===1?l[0]:l[1]??$n(l[0])}if(e===null)return"\u2014";if(e instanceof g)return s==="count"?String(e.nodes.length):s==="and"?Z(e.nodes.map(b)):e.nodes.map(b).join(", ");if(Array.isArray(e)){if(s==="count")return String(e.length);let k=e.map(N=>q(N,void 0,c,[],u,b));return s==="and"?Z(k):k.join(", ")}if(typeof e=="object")return b(e);switch(s){case"words":return typeof e=="number"?wn(e,u?.locale):String(e);case"money":return typeof e=="number"?I(e,u):String(e);case"percent":return typeof e=="number"?K(e,u?.locale,{style:"percent",maximumFractionDigits:0}):String(e);case"upper":return String(e).toUpperCase();case"lower":return String(e).toLowerCase();case"excerpt":return en(String(e),Number(l[0])||void 0);case"date":return O(U(String(e),u?.timeZone)??String(e).slice(0,10),u?.locale);case"time":return typeof e=="string"&&F.test(e)?O(e,u?.locale):J(String(e),u?.locale,u?.timeZone);case"datetime":return typeof e=="string"&&F.test(e)?O(e,u?.locale):j(String(e),u?.locale,u?.timeZone);case"relative":{let k=U(String(e),u?.timeZone),N=k===void 0?Date.parse(String(e)):Date.parse(`${k}T00:00:00Z`);if(Number.isNaN(N))return String(e);let A=Math.round((N-Date.parse(`${c}T00:00:00Z`))/864e5);return A===0?"today":A===1?"tomorrow":A===-1?"yesterday":A>0?`in ${A} days`:`${-A} days ago`}default:return typeof e=="string"&&F.test(e)?O(e,u?.locale):typeof e=="string"&&B.test(e)?j(e,u?.locale,u?.timeZone):String(e)}}function Pn(e,s){let c=s.today??L(),l=s.name??mn(s.graph?.schema);return e.map(u=>{if(u.text!==void 0)return u.text;try{let b=on(u.expr,{graph:s.graph??gn,subject:s.node,kinds:s.kinds,today:c,budget:s.budget??500,...s.bindings?{bindings:s.bindings}:{}});return yn(u,q(b,u.format,c,u.formatArgs,s.money,l))}catch(b){if(b instanceof f)return"\u2014";throw b}}).join("")}export{g as a,Nn as b,pn as c,f as d,W as e,on as f,Rn as g,Gn as h,Mn as i,On as j,En as k,jn as l,gn as m,Un as n,yn as o,Kn as p,mn as q,Pn as r};
@@ -1 +1 @@
1
- import"./chunk.WVUJXDXZ.js";import{b as C}from"./chunk.VTCPA4V4.js";import"./chunk.FGJM4LJO.js";import"./chunk.K7WME4P4.js";import"./chunk.MDIAWTNK.js";import"./chunk.PEA4D66Y.js";import"./chunk.TRPPN2GD.js";import"./chunk.72Q4R7N6.js";import{pa as $,ra as E,sa as b,ta as k}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";function M(r,l,t){let p=r.getAttribute("data-record")??"",g=r.getAttribute("data-field")??"",e=Number(r.getAttribute("data-index")??"0"),c=[...l?.node?[l.node]:[],...l?.nodes??[]].find(a=>a.id===p);if(!p||!c)return{why:p?`names a record it was not shown ("${p.slice(0,80)}")`:"names no record (data-record)"};let s=g&&Object.hasOwn(c,g)?c[g]:void 0,o=(Array.isArray(s)?s:[s]).filter($),u=Number.isInteger(e)&&e>=0?o[e]:void 0,n=c.label?`"${c.label}"`:"a record";return g?u?(t==="video"?!b(u):!b(u)&&!E(u))?{why:`names "${u.name}" on ${n}, which is not ${t==="video"?"a video":"a picture or a video"}`}:{file:u,on:c}:{why:o.length===0?`names "${g}" on ${n}, which holds no file it was shown`:`names file ${r.getAttribute("data-index")} of "${g}" on ${n}, which holds ${o.length}`}:{why:`names no field of ${n} (data-field)`}}var A=r=>`${r.caption?.trim()||r.name}, ${k(r)}`;function T(r,l,t,p,g){let e=r.createElement("video");e.setAttribute("data-graview-video",""),e.setAttribute("controls",""),e.setAttribute("preload","metadata"),e.setAttribute("playsinline",""),e.setAttribute("aria-label",A(t));let c=t.poster?p(t.poster):void 0;c&&e.setAttribute("poster",c),t.width&&t.height?(e.setAttribute("width",String(t.width)),e.setAttribute("height",String(t.height)),e.style.aspectRatio=`${t.width} / ${t.height}`):e.style.aspectRatio="16 / 9",e.style.cssText+=";display:block;width:100%;height:auto;max-height:80vh;background:#000;border-radius:var(--graview-radius, 8px)";let s=t.captions?p(t.captions):void 0;if(s){let o=r.createElement("track");o.setAttribute("kind","captions"),o.setAttribute("src",s),o.setAttribute("srclang","en"),o.setAttribute("label","Captions"),o.setAttribute("default",""),e.appendChild(o)}return t.duration===void 0&&e.addEventListener("loadedmetadata",()=>Number.isFinite(e.duration)&&e.duration>0&&e.setAttribute("aria-label",A({...t,duration:e.duration}))),e.setAttribute("src",g),l.appendChild(e),e}function N(r,l){let t=r.document,p=new Set,g=n=>{p.has(n)||(p.add(n),l.onProblem?.(n))},e=n=>{let a=l.file?l.file(n):n;if(a!==void 0)try{let h=new r.URL(a,t.baseURI);return h.origin===r.location.origin&&/^https?:$/.test(h.protocol)?a:void 0}catch{return}},c=new WeakMap,s,o=n=>{if(typeof n.close=="function")return n.close();n.removeAttribute("open"),n.dispatchEvent(new r.Event("close"))},u=(n,a)=>g(`The ${n} in the view ${l.view} was not drawn: it ${a}.`);return{refresh(n){let a=l.shown();for(let h of Array.from(n.querySelectorAll("graview-video"))){let d=h.shadowRoot??h.attachShadow({mode:"open"});if(!l.pictures){c.delete(h),d.replaceChildren(),u("video",`asks for no pictures: a view places a record's video where its manifest says "pictures": true`);continue}let f=M(h,a,"video"),i="file"in f?JSON.stringify(f.file):"";if(c.get(h)===i&&d.childNodes.length>0)continue;if(c.set(h,i),d.replaceChildren(),"why"in f){u("video",f.why);continue}let m=e(f.file.href);if(!m){u("video",`names "${f.file.name}", which this host does not say it serves on this page`);continue}let w=t.createElement("style");w.textContent=":host { display: block; min-width: 0; }",d.appendChild(w),T(t,d,f.file,e,m)}},open(n){if(!l.pictures)return u("full-screen viewer",`asks for no pictures: a view opens a record's picture or video full screen where its manifest says "pictures": true`),!1;let a=M(n,l.shown(),"any");if("why"in a)return u("full-screen viewer",a.why),!1;let h=e(a.file.href);if(!h)return u("full-screen viewer",`names "${a.file.name}", which this host does not say it serves on this page`),!1;s&&o(s);let d=a.file,f=d.caption?.trim()||d.name,i=t.createElement("dialog");i.setAttribute("data-graview-lightbox",""),i.setAttribute("aria-label",b(d)?A(d):f),i.style.cssText="padding:0;border:0;border-radius:var(--graview-radius, 8px);max-width:min(96vw, 1600px);max-height:94vh;background:var(--graview-panel, Canvas);color:var(--graview-ink, CanvasText)";let m=t.createElement("figure");if(m.style.cssText="margin:0;display:grid;gap:8px;padding:10px",b(d))T(t,m,d,e,h);else{let v=t.createElement("img");v.setAttribute("src",h),v.setAttribute("alt",f),v.style.cssText="max-width:100%;max-height:80vh;object-fit:contain;display:block;margin:0 auto",m.appendChild(v)}let w=t.createElement("figcaption");w.style.cssText="display:flex;gap:12px;align-items:center;justify-content:space-between";let x=t.createElement("span");x.textContent=b(d)&&d.duration!==void 0?`${f} \xB7 ${C(d.duration)}`:f;let y=t.createElement("button");return y.type="button",y.textContent="Close",y.addEventListener("click",()=>o(i)),w.append(x,y),m.appendChild(w),i.appendChild(m),i.addEventListener("click",v=>v.target===i&&o(i)),i.addEventListener("close",()=>{i.remove(),s===i&&(s=void 0),n.focus?.()}),t.body.appendChild(i),s=i,typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),y.focus(),!0},dispose(){s&&o(s),s?.remove(),s=void 0}}}export{N as createGuestMedia,M as namedFile};
1
+ import"./chunk.WVUJXDXZ.js";import{b as C}from"./chunk.3V2WXZU3.js";import"./chunk.7UD2JR6J.js";import"./chunk.BUDEUNBN.js";import"./chunk.3IEJQAK7.js";import"./chunk.AKLVSZ5A.js";import"./chunk.ZUBC3UFG.js";import"./chunk.TUNHUTQ5.js";import{pa as $,ra as E,sa as b,ta as k}from"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";function M(r,l,t){let p=r.getAttribute("data-record")??"",g=r.getAttribute("data-field")??"",e=Number(r.getAttribute("data-index")??"0"),c=[...l?.node?[l.node]:[],...l?.nodes??[]].find(a=>a.id===p);if(!p||!c)return{why:p?`names a record it was not shown ("${p.slice(0,80)}")`:"names no record (data-record)"};let s=g&&Object.hasOwn(c,g)?c[g]:void 0,o=(Array.isArray(s)?s:[s]).filter($),u=Number.isInteger(e)&&e>=0?o[e]:void 0,n=c.label?`"${c.label}"`:"a record";return g?u?(t==="video"?!b(u):!b(u)&&!E(u))?{why:`names "${u.name}" on ${n}, which is not ${t==="video"?"a video":"a picture or a video"}`}:{file:u,on:c}:{why:o.length===0?`names "${g}" on ${n}, which holds no file it was shown`:`names file ${r.getAttribute("data-index")} of "${g}" on ${n}, which holds ${o.length}`}:{why:`names no field of ${n} (data-field)`}}var A=r=>`${r.caption?.trim()||r.name}, ${k(r)}`;function T(r,l,t,p,g){let e=r.createElement("video");e.setAttribute("data-graview-video",""),e.setAttribute("controls",""),e.setAttribute("preload","metadata"),e.setAttribute("playsinline",""),e.setAttribute("aria-label",A(t));let c=t.poster?p(t.poster):void 0;c&&e.setAttribute("poster",c),t.width&&t.height?(e.setAttribute("width",String(t.width)),e.setAttribute("height",String(t.height)),e.style.aspectRatio=`${t.width} / ${t.height}`):e.style.aspectRatio="16 / 9",e.style.cssText+=";display:block;width:100%;height:auto;max-height:80vh;background:#000;border-radius:var(--graview-radius, 8px)";let s=t.captions?p(t.captions):void 0;if(s){let o=r.createElement("track");o.setAttribute("kind","captions"),o.setAttribute("src",s),o.setAttribute("srclang","en"),o.setAttribute("label","Captions"),o.setAttribute("default",""),e.appendChild(o)}return t.duration===void 0&&e.addEventListener("loadedmetadata",()=>Number.isFinite(e.duration)&&e.duration>0&&e.setAttribute("aria-label",A({...t,duration:e.duration}))),e.setAttribute("src",g),l.appendChild(e),e}function N(r,l){let t=r.document,p=new Set,g=n=>{p.has(n)||(p.add(n),l.onProblem?.(n))},e=n=>{let a=l.file?l.file(n):n;if(a!==void 0)try{let h=new r.URL(a,t.baseURI);return h.origin===r.location.origin&&/^https?:$/.test(h.protocol)?a:void 0}catch{return}},c=new WeakMap,s,o=n=>{if(typeof n.close=="function")return n.close();n.removeAttribute("open"),n.dispatchEvent(new r.Event("close"))},u=(n,a)=>g(`The ${n} in the view ${l.view} was not drawn: it ${a}.`);return{refresh(n){let a=l.shown();for(let h of Array.from(n.querySelectorAll("graview-video"))){let d=h.shadowRoot??h.attachShadow({mode:"open"});if(!l.pictures){c.delete(h),d.replaceChildren(),u("video",`asks for no pictures: a view places a record's video where its manifest says "pictures": true`);continue}let f=M(h,a,"video"),i="file"in f?JSON.stringify(f.file):"";if(c.get(h)===i&&d.childNodes.length>0)continue;if(c.set(h,i),d.replaceChildren(),"why"in f){u("video",f.why);continue}let m=e(f.file.href);if(!m){u("video",`names "${f.file.name}", which this host does not say it serves on this page`);continue}let w=t.createElement("style");w.textContent=":host { display: block; min-width: 0; }",d.appendChild(w),T(t,d,f.file,e,m)}},open(n){if(!l.pictures)return u("full-screen viewer",`asks for no pictures: a view opens a record's picture or video full screen where its manifest says "pictures": true`),!1;let a=M(n,l.shown(),"any");if("why"in a)return u("full-screen viewer",a.why),!1;let h=e(a.file.href);if(!h)return u("full-screen viewer",`names "${a.file.name}", which this host does not say it serves on this page`),!1;s&&o(s);let d=a.file,f=d.caption?.trim()||d.name,i=t.createElement("dialog");i.setAttribute("data-graview-lightbox",""),i.setAttribute("aria-label",b(d)?A(d):f),i.style.cssText="padding:0;border:0;border-radius:var(--graview-radius, 8px);max-width:min(96vw, 1600px);max-height:94vh;background:var(--graview-panel, Canvas);color:var(--graview-ink, CanvasText)";let m=t.createElement("figure");if(m.style.cssText="margin:0;display:grid;gap:8px;padding:10px",b(d))T(t,m,d,e,h);else{let v=t.createElement("img");v.setAttribute("src",h),v.setAttribute("alt",f),v.style.cssText="max-width:100%;max-height:80vh;object-fit:contain;display:block;margin:0 auto",m.appendChild(v)}let w=t.createElement("figcaption");w.style.cssText="display:flex;gap:12px;align-items:center;justify-content:space-between";let x=t.createElement("span");x.textContent=b(d)&&d.duration!==void 0?`${f} \xB7 ${C(d.duration)}`:f;let y=t.createElement("button");return y.type="button",y.textContent="Close",y.addEventListener("click",()=>o(i)),w.append(x,y),m.appendChild(w),i.appendChild(m),i.addEventListener("click",v=>v.target===i&&o(i)),i.addEventListener("close",()=>{i.remove(),s===i&&(s=void 0),n.focus?.()}),t.body.appendChild(i),s=i,typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),y.focus(),!0},dispose(){s&&o(s),s?.remove(),s=void 0}}}export{N as createGuestMedia,M as namedFile};
@@ -5,67 +5,66 @@
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.N6A3DIOY.js">
9
- <link rel="modulepreload" href="/chunk.BPPDBPTL.js">
10
- <link rel="modulepreload" href="/chunk.E52UTLQ2.js">
11
- <link rel="modulepreload" href="/chunk.NCTTPW7A.js">
12
- <link rel="modulepreload" href="/chunk.Q5WEOX3Q.js">
13
- <link rel="modulepreload" href="/chunk.XXCT6DLX.js">
14
- <link rel="modulepreload" href="/chunk.TRPPN2GD.js">
15
- <link rel="modulepreload" href="/chunk.G6DISMVT.js">
16
- <link rel="modulepreload" href="/chunk.W54NXXC5.js">
17
- <link rel="modulepreload" href="/chunk.B3T4N2XM.js">
8
+ <link rel="modulepreload" href="/chunk.ZBHFCSKO.js">
9
+ <link rel="modulepreload" href="/chunk.7JCUSYS5.js">
10
+ <link rel="modulepreload" href="/chunk.2WSRJGW2.js">
11
+ <link rel="modulepreload" href="/chunk.7TMWMW4W.js">
12
+ <link rel="modulepreload" href="/chunk.JCFYZEMY.js">
13
+ <link rel="modulepreload" href="/chunk.ZUBC3UFG.js">
14
+ <link rel="modulepreload" href="/chunk.FWZF7X6A.js">
15
+ <link rel="modulepreload" href="/chunk.3JMZHCB4.js">
16
+ <link rel="modulepreload" href="/chunk.SF4BYBH6.js">
18
17
  <link rel="modulepreload" href="/chunk.SDO3U72B.js">
19
- <link rel="modulepreload" href="/chunk.6W2DUW5S.js">
18
+ <link rel="modulepreload" href="/chunk.3MZIWKNG.js">
20
19
  <link rel="modulepreload" href="/chunk.SLBWPVIY.js">
21
20
  <link rel="modulepreload" href="/chunk.AJZBJBMO.js">
22
- <link rel="modulepreload" href="/chunk.OP3ZUI4W.js">
23
- <link rel="modulepreload" href="/chunk.HIDLE6BN.js">
24
- <link rel="modulepreload" href="/chunk.YI7WHBAD.js">
25
- <link rel="modulepreload" href="/chunk.T56SOSIR.js">
26
- <link rel="modulepreload" href="/chunk.JRU5BT7K.js">
21
+ <link rel="modulepreload" href="/chunk.57VTD3CU.js">
22
+ <link rel="modulepreload" href="/chunk.VWQ57LTT.js">
23
+ <link rel="modulepreload" href="/chunk.K2J26XMB.js">
24
+ <link rel="modulepreload" href="/chunk.B2X6DA2Q.js">
25
+ <link rel="modulepreload" href="/chunk.QB7RYJ67.js">
27
26
  <link rel="modulepreload" href="/chunk.UGFDSE37.js">
28
- <link rel="modulepreload" href="/chunk.EG2N5F6L.js">
27
+ <link rel="modulepreload" href="/chunk.EC7I33WI.js">
29
28
  <link rel="modulepreload" href="/chunk.PXQVXBNG.js">
30
- <link rel="modulepreload" href="/chunk.7NFCI4LH.js">
31
- <link rel="modulepreload" href="/chunk.RUTZEEBR.js">
32
- <link rel="modulepreload" href="/chunk.GZWC72HS.js">
33
- <link rel="modulepreload" href="/chunk.ASCTAUFD.js">
34
- <link rel="modulepreload" href="/chunk.CWPRQSED.js">
35
- <link rel="modulepreload" href="/chunk.EZXGVTT2.js">
36
- <link rel="modulepreload" href="/chunk.ULTYDYTS.js">
37
- <link rel="modulepreload" href="/chunk.2LQ37DC2.js">
38
- <link rel="modulepreload" href="/chunk.UXNZPPWR.js">
39
- <link rel="modulepreload" href="/chunk.GYO57LKD.js">
40
- <link rel="modulepreload" href="/chunk.KWMBRB6O.js">
41
- <link rel="modulepreload" href="/chunk.G226CUJQ.js">
42
- <link rel="modulepreload" href="/chunk.AQJD23AN.js">
43
- <link rel="modulepreload" href="/chunk.R3DWF35R.js">
44
- <link rel="modulepreload" href="/chunk.XBNASVTY.js">
45
- <link rel="modulepreload" href="/chunk.6S3B4XC4.js">
46
- <link rel="modulepreload" href="/chunk.52Y37IAD.js">
47
- <link rel="modulepreload" href="/chunk.TLQTDKOL.js">
48
- <link rel="modulepreload" href="/chunk.4DCPB67O.js">
49
- <link rel="modulepreload" href="/chunk.Y4VOCJ7R.js">
29
+ <link rel="modulepreload" href="/chunk.GVUJCOKD.js">
30
+ <link rel="modulepreload" href="/chunk.3ZONBC6L.js">
31
+ <link rel="modulepreload" href="/chunk.MDWCX3YU.js">
32
+ <link rel="modulepreload" href="/chunk.CB5DGKR5.js">
33
+ <link rel="modulepreload" href="/chunk.GKLDSHHH.js">
34
+ <link rel="modulepreload" href="/chunk.OCV46AFN.js">
35
+ <link rel="modulepreload" href="/chunk.4KTHJY5N.js">
36
+ <link rel="modulepreload" href="/chunk.PZ4G5QA5.js">
37
+ <link rel="modulepreload" href="/chunk.Y36MLVMT.js">
38
+ <link rel="modulepreload" href="/chunk.MPMROUZA.js">
39
+ <link rel="modulepreload" href="/chunk.XTT6ERI3.js">
40
+ <link rel="modulepreload" href="/chunk.5RH6FO3K.js">
41
+ <link rel="modulepreload" href="/chunk.L7MFTL5S.js">
42
+ <link rel="modulepreload" href="/chunk.XZJ6XX5I.js">
43
+ <link rel="modulepreload" href="/chunk.4F5M5XZG.js">
44
+ <link rel="modulepreload" href="/chunk.LVOL2LEC.js">
45
+ <link rel="modulepreload" href="/chunk.3G5DEGFA.js">
46
+ <link rel="modulepreload" href="/chunk.OZ4EJ5M6.js">
47
+ <link rel="modulepreload" href="/chunk.Q6RUTFU3.js">
48
+ <link rel="modulepreload" href="/chunk.AZGXBTOQ.js">
50
49
  <link rel="modulepreload" href="/chunk.XOZU4OFA.js">
51
- <link rel="modulepreload" href="/chunk.IYVBJDR7.js">
50
+ <link rel="modulepreload" href="/chunk.AG7CUSSV.js">
52
51
  <link rel="modulepreload" href="/chunk.MB7LKKUD.js">
53
52
  <link rel="modulepreload" href="/chunk.WVUJXDXZ.js">
54
- <link rel="modulepreload" href="/chunk.VTCPA4V4.js">
55
- <link rel="modulepreload" href="/chunk.FGJM4LJO.js">
56
- <link rel="modulepreload" href="/chunk.K7WME4P4.js">
57
- <link rel="modulepreload" href="/chunk.MDIAWTNK.js">
58
- <link rel="modulepreload" href="/chunk.PEA4D66Y.js">
53
+ <link rel="modulepreload" href="/chunk.3V2WXZU3.js">
54
+ <link rel="modulepreload" href="/chunk.7UD2JR6J.js">
55
+ <link rel="modulepreload" href="/chunk.BUDEUNBN.js">
56
+ <link rel="modulepreload" href="/chunk.3IEJQAK7.js">
57
+ <link rel="modulepreload" href="/chunk.AKLVSZ5A.js">
59
58
  <link rel="modulepreload" href="/chunk.GZHZLJBF.js">
60
- <link rel="modulepreload" href="/chunk.TTFYXKLI.js">
59
+ <link rel="modulepreload" href="/chunk.PZWJUQAO.js">
61
60
  <link rel="modulepreload" href="/chunk.OJGHDWI6.js">
62
- <link rel="modulepreload" href="/chunk.ICYJ7QJG.js">
63
- <link rel="modulepreload" href="/chunk.MT45H2T5.js">
64
- <link rel="modulepreload" href="/chunk.S2ATSY6P.js">
65
- <link rel="modulepreload" href="/chunk.72Q4R7N6.js">
66
- <link rel="modulepreload" href="/chunk.Q5JVKSEN.js">
67
- <link rel="modulepreload" href="/chunk.UYCPQ6IW.js">
68
- <script>(()=>{const later=["/chunk.OXLYDXQV.js","/chunk.3FRVG6JW.js","/chunk.FBRARPGR.js","/chunk.HJCQ6I3S.js","/chunk.LCG3VLCB.js","/chunk.P7FN3SFB.js","/chunk.CANTHIRO.js","/chunk.MSPRCR3Q.js","/chunk.CSA6SWTI.js","/chunk.TXEWSZGO.js","/chunk.4DFO43VM.js","/chunk.MKWVNW4Q.js","/chunk.HIFLBWQJ.js","/chunk.KCM2VOC7.js","/chunk.BG2SC77J.js","/chunk.NAEEPUWJ.js","/chunk.TI4OSTQV.js","/chunk.7BXOQEUP.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>
61
+ <link rel="modulepreload" href="/chunk.NEJSKMJV.js">
62
+ <link rel="modulepreload" href="/chunk.5ZWE72VJ.js">
63
+ <link rel="modulepreload" href="/chunk.RLO3RDYH.js">
64
+ <link rel="modulepreload" href="/chunk.TUNHUTQ5.js">
65
+ <link rel="modulepreload" href="/chunk.LYFEGG6E.js">
66
+ <link rel="modulepreload" href="/chunk.FCZ7UFJI.js">
67
+ <script>(()=>{const later=["/chunk.SG7YVKH4.js","/chunk.KJGNLWU3.js","/chunk.FWKNR7XF.js","/chunk.HJCQ6I3S.js","/chunk.5C43AM3X.js","/chunk.4WH4N4V7.js","/chunk.MVRNEC3Y.js","/chunk.BOMYLOCX.js","/chunk.45HTFSWD.js","/chunk.C6HBYRGJ.js","/chunk.JXGDVJ4N.js","/chunk.463PGKOL.js","/chunk.PR2TSHE7.js","/chunk.5VF2RT4H.js","/chunk.ZDDWXRPK.js","/chunk.LOUICR7K.js","/chunk.TI4OSTQV.js","/chunk.JLB4QP6Q.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>
69
68
  <style>html,body{margin:0;height:100%}#graview-app{min-height:100dvh}</style>
70
69
  </head>
71
70
  <body>
@@ -1,2 +1,2 @@
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 Zr}from"./chunk.N6A3DIOY.js";import{a as Dt,b as Xn,c as er,d as tr,e as nr,f as Bt,g as rr,h as Wt}from"./chunk.BPPDBPTL.js";import{a as $t,b as ar,c as ir,d as sr,e as Nt,f as dr,g as cr,h as lr,i as ur,j as fr,k as pr,l as mr,m as hr,n as je}from"./chunk.E52UTLQ2.js";import{b as or}from"./chunk.NCTTPW7A.js";import{a as Rt}from"./chunk.Q5WEOX3Q.js";import{a as Tt,g as Tn}from"./chunk.XXCT6DLX.js";import{k as rt}from"./chunk.TRPPN2GD.js";import{E as Yn,I as Qn,J as Zn,h as zn,k as st,l as Gn,n as Un,r as Kn,w as dt,z as Jn}from"./chunk.G6DISMVT.js";import{c as Qr}from"./chunk.W54NXXC5.js";import{Aa as $n,Ca as Nn,Da as In,Fa as _n,G as Ht,Ga as Vt,Ka as jn,La as qn,Oa as it,T as Fn,Z as Cn,a as xn,b as ot,c as at,ga as Ln,ha as Mn,j as On,m as Mt,va as Hn,wa as Vn,xa as Dn,ya as Bn,za as Wn}from"./chunk.B3T4N2XM.js";import{a as Ee}from"./chunk.SDO3U72B.js";import{Bb as wn,Fd as ke,Gd as En,Hd as An,Md as Ot,Nd as Ft,Od as Ct,Qc as bn,Rd as Rn,Sd as Lt,cb as _e,dd as Sn,ec as xt,fc as vn,fd as Pn,gd as kn,id as nt,nb as tt,ob as gn}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as Le}from"./chunk.AJZBJBMO.js";async function ct(e,n={}){let a=e.compiled===void 0||!eo(e.compiled,e.document)?void 0:Tn(e.compiled,n);if(a?.ok)return a;let{compileDocumentWithoutCheck:s}=await Xr();return s(e.document,n)}var yr,Xr=()=>yr??=(__graviewPreload(import.meta.url,["./chunk.P2W727C7.js","./chunk.XXCT6DLX.js","./chunk.K7WME4P4.js","./chunk.PEA4D66Y.js","./chunk.TRPPN2GD.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.D3A24PQ6.js")).catch(e=>{throw yr=void 0,e});function eo(e,n){let a=typeof e=="object"&&e!==null?e.document:void 0,s=n;if(typeof s=="string")try{s=JSON.parse(s)}catch{return!1}return a!==void 0&&Rt(Tt(a).document)===Rt(Tt(s).document)}var c=Le(Ht(),1);var ut=Le(Ht(),1),It="data-graview-drawn",to=200,gr=50,no=1e4,lt=()=>typeof performance<"u"?performance.now():Date.now();function ro(e){let n=[...e.querySelectorAll("img")];for(let a of e.querySelectorAll("[data-worker-view]"))a.shadowRoot&&n.push(...a.shadowRoot.querySelectorAll("img"));return n}function oo(e,n){if(e.ownerDocument.fonts?.status==="loading"||Vn()>0||$n(n)>0||e.querySelector('[aria-busy="true"]')||ro(e).some(s=>!s.complete&&s.loading!=="lazy"))return!1;for(let s of e.querySelectorAll("[data-worker-view-place]"))if(!s.querySelector("[data-worker-view][data-worker-view-drawn], [data-worker-view][data-worker-view-failed]"))return!1;return!0}function wr(e){let n=e.querySelector("[data-embed-content]"),a=[...e.querySelectorAll("[data-worker-view]")].map(s=>`${s.offsetWidth}x${s.offsetHeight}`);return`${e.scrollWidth}x${e.scrollHeight}|${n?`${n.scrollWidth}x${n.scrollHeight}`:""}|${a.join(",")}`}function ao(e,n,a,s){e.removeAttribute(It);let d=e.ownerDocument.defaultView;if(!d)return()=>{};let l=lt(),S=l,p=wr(e),w=!1,R,O=typeof MutationObserver>"u"?void 0:new MutationObserver(v=>{v.some(j=>!(j.target===e&&j.attributeName===It))&&(S=lt())});O?.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let P=()=>{w=!0,O?.disconnect(),R!==void 0&&clearTimeout(R)},k=v=>{let j=!1,se=()=>{j||(j=!0,v())};typeof d.requestAnimationFrame=="function"&&d.requestAnimationFrame(()=>setTimeout(se,0)),setTimeout(se,100)},C=()=>{if(w)return;let v=wr(e);v!==p&&(p=v,S=lt());let j=lt();if(oo(e,s)&&j-S>=to||j-l>=no){k(()=>{w||(P(),e.setAttribute(It,n),In(),a())});return}R=setTimeout(C,gr)};return R=setTimeout(C,gr),P}function vr(e,n,a,s,d){Nn();let l=(0,ut.useRef)({place:a,onDrawn:s});l.current={place:a,onDrawn:s},(0,ut.useLayoutEffect)(()=>{d&&Wn(d);let S=R=>ao(R,l.current.place.path,()=>l.current.onDrawn?.(l.current.place),d);if(e.current)return S(e.current);let p,w=!1;return queueMicrotask(()=>{!w&&e.current&&(p=S(e.current))}),()=>{w=!0,p?.()}},[n,e,d])}var ye=Le(Ht(),1),qe,io=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.KY7QD22S.js","./chunk.FCAKLO5U.js","./chunk.J6OT74RM.js","./chunk.WDEMPWS4.js","./chunk.H2B3SEI7.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.56UFDIX5.js"))),br=()=>io().then(e=>void(qe=e),()=>new Promise(e=>setTimeout(e,2e3)).then(br)),_t=Hn(br),Sr=e=>!!e&&qe===void 0;function jt({onReady:e,fetch:n}){return(0,ye.useLayoutEffect)(()=>void n().then(e),[e,n]),null}var so=0;function Pr(e){let[n,a]=(0,ye.useState)(()=>qe);(0,ye.useEffect)(()=>{if(!e||n)return;let l=!1;return _t().then(()=>{l||a(qe)}),()=>{l=!0}},[e,n]);let s=(0,ye.useMemo)(()=>so+=1,[e]);return{over:(0,ye.useMemo)(()=>{let l=n??qe;if(!e||!l)return;let{source:S,worker:p,...w}=e,R={...w,worker:p??{source:S},draft:!0};return{name:e.manifest.name,home:e.manifest.attach==="home",register:O=>l.registerWorkerView(O,R)}},[e,n]),n:s}}var Ar=Le(Zr(),1),G=Le(Qr(),1);var h=Le(Fn(),1);function ft(e,n={}){let a=Vt(e);return{Face:a.part((d,l)=>(0,c.createElement)(d,l),n),fetch:()=>a.load().then(()=>{}),here:()=>a.current!==void 0||a.failed}}var Gt=e=>Promise.all([e,Qn()]).then(([n])=>n),Rr=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.EG2N5F6L.js","./chunk.RUTZEEBR.js","./chunk.FBRARPGR.js","./chunk.CWPRQSED.js","./chunk.EZXGVTT2.js","./chunk.UXNZPPWR.js","./chunk.GYO57LKD.js","./chunk.HJCQ6I3S.js","./chunk.LCG3VLCB.js","./chunk.P7FN3SFB.js","./chunk.KCM2VOC7.js","./chunk.G226CUJQ.js","./chunk.BG2SC77J.js","./chunk.NAEEPUWJ.js","./chunk.AQJD23AN.js","./chunk.XBNASVTY.js","./chunk.52Y37IAD.js","./chunk.MSPRCR3Q.js","./chunk.CSA6SWTI.js","./chunk.4DCPB67O.js","./chunk.Y4VOCJ7R.js","./chunk.E52UTLQ2.js","./chunk.NCTTPW7A.js","./chunk.TI4OSTQV.js","./chunk.TXEWSZGO.js","./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.GBIVIHGD.js"))),co=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.HIDLE6BN.js","./chunk.YI7WHBAD.js","./chunk.T56SOSIR.js","./chunk.JRU5BT7K.js","./chunk.UGFDSE37.js","./chunk.EG2N5F6L.js","./chunk.PXQVXBNG.js","./chunk.7NFCI4LH.js","./chunk.RUTZEEBR.js","./chunk.GZWC72HS.js","./chunk.ASCTAUFD.js","./chunk.CWPRQSED.js","./chunk.EZXGVTT2.js","./chunk.ULTYDYTS.js","./chunk.2LQ37DC2.js","./chunk.UXNZPPWR.js","./chunk.GYO57LKD.js","./chunk.KWMBRB6O.js","./chunk.G226CUJQ.js","./chunk.AQJD23AN.js","./chunk.R3DWF35R.js","./chunk.XBNASVTY.js","./chunk.6S3B4XC4.js","./chunk.52Y37IAD.js","./chunk.TLQTDKOL.js","./chunk.4DCPB67O.js","./chunk.Y4VOCJ7R.js","./chunk.XOZU4OFA.js","./chunk.IYVBJDR7.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.VTCPA4V4.js","./chunk.FGJM4LJO.js","./chunk.K7WME4P4.js","./chunk.MDIAWTNK.js","./chunk.PEA4D66Y.js","./chunk.TRPPN2GD.js","./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.OP3ZUI4W.js"))),lo=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.HIDLE6BN.js","./chunk.YI7WHBAD.js","./chunk.T56SOSIR.js","./chunk.JRU5BT7K.js","./chunk.UGFDSE37.js","./chunk.EG2N5F6L.js","./chunk.PXQVXBNG.js","./chunk.7NFCI4LH.js","./chunk.RUTZEEBR.js","./chunk.GZWC72HS.js","./chunk.ASCTAUFD.js","./chunk.CWPRQSED.js","./chunk.EZXGVTT2.js","./chunk.ULTYDYTS.js","./chunk.2LQ37DC2.js","./chunk.UXNZPPWR.js","./chunk.GYO57LKD.js","./chunk.KWMBRB6O.js","./chunk.G226CUJQ.js","./chunk.AQJD23AN.js","./chunk.R3DWF35R.js","./chunk.XBNASVTY.js","./chunk.6S3B4XC4.js","./chunk.52Y37IAD.js","./chunk.TLQTDKOL.js","./chunk.4DCPB67O.js","./chunk.Y4VOCJ7R.js","./chunk.XOZU4OFA.js","./chunk.IYVBJDR7.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.VTCPA4V4.js","./chunk.FGJM4LJO.js","./chunk.K7WME4P4.js","./chunk.MDIAWTNK.js","./chunk.PEA4D66Y.js","./chunk.TRPPN2GD.js","./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.3Y7BDRP3.js"))),Tr=ft(()=>Gt(Rr().then(e=>e.SceneFace)),{what:"This view"}),xr=ft(()=>Rr().then(e=>e.SceneKeeping),{quiet:!0}),Or=ft(()=>Gt(co().then(e=>e.PagesContent)),{what:"This page"}),Fr=ft(()=>Gt(lo().then(e=>e.PictureFace)),{what:"This picture"}),uo=Tr.Face,fo=xr.Face,po=Or.Face,mo=Fr.Face;function Me(...e){let n=e.length>0?e:["scene","pages","picture"],a=new Set(n.flatMap(Cr));return Promise.all([...[...a].map(s=>s.fetch()),Un()]).then(()=>{},()=>{})}var Cr=e=>e==="pages"?[Or]:e==="picture"?[Fr]:[Tr,xr],Lr=e=>Cr(e).every(n=>n.here()),ho=150,qt=0;function kr(e,n){if(Lr(e))return n();let a=++qt,s=()=>{a===qt&&(qt+=1,n())};Me(e).then(s),setTimeout(s,ho)}var yo=768;function go(e,n){let a=n!==null&&n>=yo;(0,c.useEffect)(()=>{if(!a||e==="picture")return;let s=e==="pages"?"scene":"pages";if(Lr(s))return;let d=globalThis,l=()=>void Me(s),S=()=>{},p=_n(()=>{if(d.requestIdleCallback&&d.cancelIdleCallback){let w=d.requestIdleCallback(l,{timeout:4e3});S=()=>d.cancelIdleCallback?.(w)}else{let w=setTimeout(l,1500);S=()=>clearTimeout(w)}});return()=>(p(),S())},[e,a])}function wo({asked:e,shown:n,onDrawn:a}){return(0,c.useLayoutEffect)(()=>a(e,n),[e,n,a]),null}function vo({auto:e,scene:n}){return(0,h.jsx)("div",{"data-embed-content":"","aria-busy":"true",style:{flex:e?n?`0 0 ${Nt}px`:"0 0 auto":"1 1 auto",minHeight:0,background:"var(--graview-ground)"}})}var bo=Vt(Ee(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.5JNXQHN4.js")))).part((e,n)=>(0,h.jsx)(e.StudioPlace,{...n}),{quiet:!0});function Mr(e,n,a,s,d){return Bt(e,nr(n?at(n):d??xn,s),a)}function Ut(e){return e&&at(e).overview?"graview":"scene"}function Er(e,n){if(n.homeView?.()===void 0)return!1;let a=e.pages?.first?.trim();return a===void 0||a===""||a==="/"||a.toLowerCase()==="home"}function Hr(e){let[,n]=(0,c.useState)(!1),a=(0,c.useCallback)(()=>n(!0),[]),s=(0,c.useRef)(!1);return e.at&&!pt?(0,h.jsx)(jt,{onReady:a,fetch:Kt}):!s.current&&Sr(e.draftView)?(0,h.jsx)(jt,{onReady:a,fetch:_t}):(s.current=!0,(0,h.jsx)(So,{...e}))}function So(e){let{app:n,stop:a,bar:s=!0,standing:d="Everything is in order",principal:l,heading:S=2}=e,{rootRef:p,scope:w,css:R,scheme:O,store:P,presence:k,brand:C,auto:v,height:j}=dr(e),se=Pr(e.draftView),D=ir(e,Zn,se.over),[ee]=(0,c.useState)(Bn),f=e.basePath===void 0?{}:{basePath:e.basePath},[B]=(0,c.useState)(st),U=e.notices??B,Y=y=>Ot(y,f),F={...e.routing?{routing:e.routing}:{},...f},[le]=(0,c.useState)(()=>{let y=e.at?.face;if(y)return y;let H=a===void 0&&Er(n,D)?"pages":Ut(a),V=Dt({...F,face:H});return e.face===void 0&&e.onOpening?.(V),V}),[W,x]=(0,c.useState)(()=>e.face!==void 0&&e.face!=="pages"&&!e.at&&a===void 0&&Xn(F)&&Er(n,D)),Re=(0,c.useRef)(e.onFace);Re.current=e.onFace,(0,c.useLayoutEffect)(()=>{W&&(Re.current?.("pages"),x(!1))},[W]);let E=W?"pages":e.face??le,oe=n.schema.kinds,T=e.routing==="address",Q=(0,c.useMemo)(()=>e.at?pt.settleAt(e,P.seenBy(l??{kind:"human"}),D.places()):void 0,[]),$=(0,c.useMemo)(()=>Mn(D,n.schema),[D,n.schema]),ue=(0,c.useMemo)(()=>{let y=Q?.stop??(T?er(e.basePath):void 0)??a;return E==="scene"&&y===void 0&&$===void 0&&(e.path===void 0||zt(e.path))?Wt(void 0):Mr(E,y,oe,D.places(),$)},[]),[ve]=(0,c.useState)(E);(0,c.useEffect)(()=>{ve!=="pages"&&Ln(D)},[ve,D]);let N=(0,c.useRef)(void 0),q=y=>y===void 0||zt(y)?"/":y;N.current??={path:q(Q?.path??(T?E==="pages"?(Ft(window.location.pathname,e.basePath)??"/")+window.location.search:"/":e.path)),asked:e.path},e.path!==N.current.asked&&(N.current={path:q(e.path),asked:e.path});let I=(0,c.useRef)(e.onNavigate);I.current=e.onNavigate;let ae=(0,c.useCallback)((y,H)=>{N.current.path=y,I.current?.(y,H)},[]),{at:M,setAt:Te,steering:K,steer:te}=pr(N.current.path),L=(0,c.useContext)(Vr);L&&(L.pages=()=>N.current.path);let fe=(0,c.useRef)(void 0),pe=(0,c.useCallback)(y=>void(N.current.path=y),[]),de=zn(p),[Z,Ge]=(0,c.useState)(!1),xe=e.pagesBelow!==void 0&&de!==null&&de<e.pagesBelow&&(E==="scene"||E==="graview")&&!Z,A=xe?"pages":E,$e=(0,c.useRef)(!1);$e.current=Z&&e.pagesBelow!==void 0&&de!==null&&de<e.pagesBelow&&(E==="scene"||E==="graview"),L&&(L.shown=A);let ne=(0,c.useRef)(E==="graview"?"graview":"scene");(A==="scene"||A==="graview")&&(ne.current=A),(0,c.useState)(()=>{if(!T||typeof window>"u"||A==="pages"||A==="picture")return;let{pathname:y,search:H,hash:V}=window.location;Ft(y,e.basePath)==="/"&&window.history.replaceState(window.history.state,"",`${Y(ke)}${H}${V}`)}),sr(p,A,e.onIntrinsicHeight),go(A,de);let ce=mr(e.onError,A),be=hr(e.onReady,A),Ne=(0,c.useRef)(e.onFaceDrawn);Ne.current=e.onFaceDrawn;let He=(0,c.useCallback)((y,H)=>{be(H),Ne.current?.(y)},[be]),[gt,wt]=(0,c.useState)(null),Ue=D.places(),_=(0,c.useRef)({shown:A,onFace:e.onFace});_.current={shown:A,onFace:e.onFace};let re=(0,c.useCallback)((y,H,V)=>{if(T){fe.current?.(y,H,V);return}_.current.onFace?.(y),I.current?.(y==="pages"?H??N.current.path:ke,"push")},[T]),[X,Oe]=(0,c.useState)(void 0);(0,c.useEffect)(()=>{A==="pages"&&Oe(void 0)},[A]);let Se=(0,c.useRef)(a);(0,c.useEffect)(()=>{Se.current!==a&&(Se.current=a,Oe(void 0))},[a]);let Ke=(0,c.useCallback)(y=>{if(_.current.shown==="pages"){if(Ge(!0),Oe(y),E==="scene"||E==="graview"){kr(E,()=>{T?window.history.pushState(null,"",`${Y(ke)}${y??""}`):I.current?.(ke,"push")});return}kr(ne.current,()=>re(ne.current,void 0,y))}},[T,E,e.basePath,re]),Pe=(0,c.useCallback)(y=>{if(_.current.shown==="pages"){K.go.current||(N.current.path=y),te(y);return}if(N.current.path=y,Te(y),$e.current){Ge(!1),T?window.history.pushState(null,"",Y(y)):I.current?.(y,"push");return}re("pages",y)},[K,te,Te,re,T,e.basePath]),Fe=D.arrangement?.(),me=A==="pages",Ve=e.hrefOf,z=Ve??(T?Y:void 0),Ce=(0,c.useMemo)(()=>({open:Pe,...Ve?{href:Ve}:T?{href:y=>Ot(y,e.basePath===void 0?{}:{basePath:e.basePath})}:{}}),[Pe,T,e.basePath,Ve]);return(0,h.jsxs)("section",{ref:p,className:w,"aria-label":e.label??n.name,"data-graview-embed":A,"data-graview-scheme":O,...xe?{"data-graview-embed-narrow":""}:{},style:{position:"relative",isolation:"isolate",height:j,minHeight:v?0:320,display:"flex",flexDirection:"column",overflow:"hidden",borderRadius:"var(--graview-radius, 12px)"},children:[(0,h.jsx)("style",{children:R}),(0,h.jsxs)(qn.Provider,{value:ce,children:[(0,h.jsx)(cr,{rootRef:p,board:U}),(0,h.jsx)(ar,{rootRef:p,firstLook:e.firstLook,app:Jn(C??{name:n.name},n.schema)}),(0,h.jsx)(je,{module:"@graview/react",report:ce,content:!0,children:(0,h.jsx)(Dn.Provider,{value:ee,children:(0,h.jsx)(Cn,{store:P,views:D,initialView:ue,scheme:O,...lr(e,k,C),...e.onSeat?{onSeat:e.onSeat}:{},children:(0,h.jsxs)(Gn.Provider,{value:U,children:[(0,h.jsx)(Ao,{face:A,stop:X??a,kinds:oe,places:Ue,opens:$}),L?(0,h.jsx)(Po,{into:L}):null,(0,h.jsx)(ko,{rootRef:p,face:E,shown:A,path:M,stop:a,draft:se.n,onDrawn:e.onDrawn,parts:ee}),T?(0,h.jsx)(tr,{pagesWere:Q?.path,basePath:e.basePath,shown:A,onFace:e.onFace,toggle:fe,kinds:oe,places:Ue,opens:$,landed:pe}):null,s&&A!=="picture"?(0,h.jsx)(je,{module:"@graview/embed",report:ce,children:(0,h.jsx)(ur,{name:C?.name??n.name,heading:S,named:$t(s).name!==!1,faces:$t(s).faces===!1?void 0:{scene:{label:En(Fe),current:!me,go:()=>Ke(),reach:()=>void Me(ne.current)},pages:{label:An(Fe),current:me,go:()=>Pe(N.current.path),reach:()=>void Me("pages")}},at:me?M:null,without:e.pages?.without(),home:{...z?.("/")!==void 0?{href:z("/")}:{},go:()=>Pe("/"),current:me&&M.split("?")[0]==="/"},reach:{...z?{href:z}:{},go:y=>Pe(y.path)},standing:d,hostActions:e.hostActions,keeping:me?void 0:(0,h.jsx)(Ro,{app:n,studio:e.studio,report:ce}),onFind:wt,switch:e.switch})}):null,(0,h.jsx)(Kn.Provider,{value:gt,children:(0,h.jsx)(je,{module:A==="pages"||A==="picture"?"@graview/pages":"@graview/react",report:ce,content:!0,children:(0,h.jsxs)(c.Suspense,{fallback:(0,h.jsx)(vo,{auto:v,scene:A!=="pages"&&A!=="picture"}),children:[A==="picture"?(0,h.jsx)(mo,{scope:w,store:P,views:D,as:(a?at(a).within?.view:void 0)??""}):A==="pages"?(0,h.jsx)(po,{store:P,views:D,presence:k,auto:v,brand:C,steering:K,overview:Ke,scope:w,titleLevel:fr(S),quickAsk:dt(e.quickAsk),props:{...e,onNavigate:ae,...T?{}:{path:N.current.path}}}):(0,h.jsx)(jn.Provider,{value:Ce,children:(0,h.jsx)(uo,{address:T,auto:v,scheme:O,scope:w,quickAsk:dt(e.quickAsk)})}),(0,h.jsx)(wo,{asked:E,shown:A,onDrawn:He})]})},A)})]})})})})]})]})}var zt=e=>e.split(/[?#]/)[0]===ke,Vr=(0,c.createContext)(null);function Po({into:e}){return e.view=it().view,null}function ko({rootRef:e,face:n,shown:a,path:s,stop:d,draft:l,onDrawn:S,parts:p}){let{view:w}=it(),R=a==="scene"||a==="graview",O=ot(w),{pan:P,...k}=w,C=w.pan?ot(k):O,v={face:n,path:R?ke:a==="picture"?d??"#":s,stop:O};return vr(e,`${a} ${R?C:v.path} ${l}`,v,S,p),null}var pt,Eo=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.BPPDBPTL.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.UQENE3VE.js"))),Kt=()=>Eo().then(e=>void(pt=e),()=>new Promise(e=>{let n=()=>{window.removeEventListener("online",n),clearTimeout(a),e()},a=setTimeout(n,1e4);window.addEventListener("online",n)}).then(Kt));function Ao({face:e,stop:n,kinds:a,places:s,opens:d}){let{view:l,go:S}=it(),p=(0,c.useRef)({face:e,stop:n});return(0,c.useLayoutEffect)(()=>{let w=p.current.stop!==n,R=p.current.face!==e,O=p.current.face==="pages";if(p.current={face:e,stop:n},!w&&!R||e==="pages"||e==="picture")return;let P=(w||O)&&n!==void 0?Mr(e,n,a,s):O&&rr(l)?Bt(e,Wt(d),a):e==="graview"?Mt(l,!0):l.overview?On(Mt(l,!1),Yn(l,a)):l;S(P)},[e,n,a,l,S,d]),null}function Ro({app:e,studio:n,report:a}){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c.Suspense,{fallback:null,children:(0,h.jsx)(fo,{})}),n!==!1?(0,h.jsx)(je,{module:"@graview/studio",report:a,children:(0,h.jsx)(To,{app:e,studio:n})}):null]})}function To({app:e,studio:n}){let a={app:e,within:"box",...n?{onApply:n.onApply}:{},...n?.landmark?{landmark:n.landmark}:{},...n?.offered!==void 0?{offered:n.offered}:{}},s=n?.place;return s?(0,h.jsx)(s,{...a}):(0,h.jsx)(c.Suspense,{fallback:null,children:(0,h.jsx)(bo,{...a})})}function xo({path:e,stop:n,...a},s){return{...a,app:s.app,at:s.at,remote:s.remote,...s.remote.presence?{presence:s.remote.presence}:{}}}function Jt(e,n){let a=n.store??n.remote?.store??or(n.app,n.seed),s=n.notices??st(),d=null,l={},S=0,p=n.label,w=n.app,R=Promise.resolve(),O=n.at?.face??n.face,P=O===void 0?void 0:Dt({...n,face:O}),k=P??Ut(n.stop),C=null,v=[],j=f=>{if(C=f,f!==k)return;let B=v;v=[];for(let U of B)U()};function se(){let[f,B]=(0,c.useState)(P),[U,Y]=(0,c.useState)(n.stop),[F,le]=(0,c.useState)(n.path),[W,x]=(0,c.useState)(n.scheme??"auto"),[Re,E]=(0,c.useState)(n.principal),[oe,T]=(0,c.useState)(n.seats),[Q,$]=(0,c.useState)(n.quickAsk),[ue,ve]=(0,c.useState)(n.people),[N,q]=(0,c.useState)(n.hostContext),[I,ae]=(0,c.useState)(n.brand),[M,Te]=(0,c.useState)(n.label),[K,te]=(0,c.useState)(n.hostActions),[L,fe]=(0,c.useState)(void 0),[pe,de]=(0,c.useState)(n.draftView);return d={app:Z=>{fe(Z),le(void 0),Y(void 0)},face:B,stop:Y,path:le,scheme:x,seat:E,seats:T,quickAsk:$,people:ve,hostContext:q,brand:ae,label:Te,hostActions:te,draft:de},(0,h.jsx)(Vr.Provider,{value:l,children:(0,h.jsx)(Hr,{...L?xo(n,L):n,store:a,notices:s,...f!==void 0?{face:f}:{},onOpening:Z=>{k=Z},...U!==void 0?{stop:U}:{},...F!==void 0?{path:F}:{},...Re?{principal:Re}:{},...oe?{seats:oe}:{},...Q!==void 0?{quickAsk:Q}:{},...ue?{people:ue}:{},...N?{hostContext:N}:{},...I?{brand:I}:{},label:M,hostActions:K,draftView:pe,scheme:W,onFace:Z=>{k=Z,B(Z)},onSeat:E,onFaceDrawn:j},L?.n??0)})}let D=()=>{let f=l.view?.focusId,B=f?a.graph.getNode(f)?.kind:void 0,U=(l.shown??k)==="scene"||(l.shown??k)==="graview";return{face:k,path:U?ke:l.pages?.()??n.path??"/",stop:l.view?ot(l.view):n.stop??"#",...B?{kind:B}:{}}},ee=(0,Ar.createRoot)(e);return(0,G.flushSync)(()=>ee.render((0,h.jsx)(se,{}))),{get store(){return a},where:D,setApp:(f,B,U)=>{let Y="graph"in B?{store:B}:B,F=()=>{let le=D();a=Y.store,p=U?.label??(p===w.name?f.name:p),w=f,(0,G.flushSync)(()=>{d?.label(p),d?.app({app:f,remote:Y,at:le,n:++S})})};pt?F():R=R.then(Kt).then(F)},setFace:f=>{k=f,(0,G.flushSync)(()=>d?.face(f))},setStop:f=>(0,G.flushSync)(()=>d?.stop(f)),setPath:f=>(0,G.flushSync)(()=>{if(zt(f)){(k==="pages"||k==="picture")&&(k="scene",d?.face("scene"));return}d?.path(f),k!=="pages"&&(k="pages",d?.face("pages"))}),setScheme:f=>(0,G.flushSync)(()=>d?.scheme(f)),setSeat:f=>(0,G.flushSync)(()=>d?.seat(f)),setSeats:f=>(0,G.flushSync)(()=>d?.seats(f)),setQuickAsk:f=>(0,G.flushSync)(()=>d?.quickAsk(f)),setPeople:f=>(0,G.flushSync)(()=>d?.people(f)),setHostContext:f=>(0,G.flushSync)(()=>d?.hostContext(f)),setBrand:f=>(0,G.flushSync)(()=>d?.brand(f)),setDraftView:f=>(0,G.flushSync)(()=>d?.draft(f)),setLabel:f=>{p=f,(0,G.flushSync)(()=>d?.label(f))},setHostActions:f=>(0,G.flushSync)(()=>d?.hostActions(f)),drawn:()=>R.then(()=>C===k?void 0:new Promise(f=>v.push(f))),notify:f=>{let B;return(0,G.flushSync)(()=>{B=s.notify(f)}),B},unmount:()=>ee.unmount()}}var mt=e=>`s${(e+1).toString(36)}`;var Dr="/graview/live",Yt="graview.ship",Qt=`${Yt}.${tt}`;var ge={seat:"x-graview-seat",roles:"x-graview-roles",kind:"x-graview-kind",name:"x-graview-name",for:"x-graview-for",forRoles:"x-graview-for-roles",forName:"x-graview-for-name",via:"x-graview-via"};var Be=class extends Error{constructor(n){super(n),this.name="Superseded"}},Ae=e=>e?.lineage?{lineage:e.lineage}:{},Oo=(e,n)=>`${e.calls.map(a=>a.name.replace(/-/g," ")).join(", ")} (${n instanceof Error?n.message.split(`
2
- `)[0]??"":String(n)})`;function Fo(e){if(!e)return[];try{let n=e.storage.getItem(e.key);if(n===null)return[];e.storage.removeItem(e.key);let a=JSON.parse(n);return Array.isArray(a)?a.filter(s=>!!s&&Array.isArray(s.calls)):[]}catch{return[]}}var We=class extends Error{constructor(a){super(a.sentence);this.refusal=a;this.name="RemoteRefusedError"}},Co={401:"forbidden",403:"forbidden",404:"missing",413:"limit"},we=class extends Error{constructor(a,s){super(a);this.conflicts=s;this.name="StaleWrite"}},ze=class extends Error{constructor(n){super(n),this.name="Unreached"}},Lo=new Set([502,503,504]);async function Mo(e){try{return(await e.clone().json()).reason==="unavailable"}catch{return!1}}function Ho(){let e=Math.random().toString(36).slice(2,8),n=0;return()=>`local-${e}-${++n}`}var Vo=1,Do=()=>({refusals:new Set,conflicts:new Set,statuses:new Set,helds:new Set,builds:new Set,who:new Set,declarations:new Set,tally:{reconnects:0,rebases:0,conflicts:0,resyncs:0}});async function ht(e){return(await Br(e,Fo(e.carry),"This app was updated while your changes were on the way.",Do())).remote}async function Br(e,n,a,s){let d=e.fetch??fetch,l={"content-type":"application/json",...e.headers??{}},S={...yt(e.principal),[ge.via]:e.via??"web"};Object.assign(l,S);let p=e.live===!0,w=e.presenceEveryMs,R=e.visible??$o,O="connecting",P=s.statuses,k=s.tally,C=[],v,j=[],se=()=>O==="online"&&v!==void 0?"held":O,D=()=>{let t=se();if(s.told!==t){s.told=t;for(let r of[...P])r(t)}},ee=t=>{if(!(t===O||ie)&&(O==="offline"&&t==="online"&&k.reconnects++,O=t,D(),t==="online"))for(let r of C.splice(0))r.again()},f=t=>{if(ie)return;let r=typeof t=="string"&&t.length>0?t:void 0,i=r!==v;if(v=r,B(),!!i&&(D(),r===void 0)){for(let o of j.splice(0))o();V&&clearTimeout(V),nn()}},B=()=>{if(s.toldHeld!==v){s.toldHeld=v;for(let t of[...s.helds])t(v??null)}},U=async(t,r)=>{let i;try{i=await d(t,r)}catch(o){throw z()||ee("offline"),new ze(o instanceof Error?o.message:String(o))}if(i.status===503&&await Mo(i))return ee("online"),i;if(Lo.has(i.status))throw z()||ee("offline"),new ze(`The server is away (${i.status})`);return ee("online"),i},Y=async(t=!1)=>{let r=`${e.url}/graview/state?opFormat=${_e.op}`,i=t?await d(r,{headers:l}):await U(r,{headers:l});if(!i.ok)throw new Error((await i.json().catch(()=>({}))).error??`The server refused (${i.status})`);return await i.json()},F=e.state??await Y(!0);p||(O="online"),v=typeof F.held=="string"&&F.held.length>0?F.held:void 0,B();let le=F.enabledModules??e.enabledModules,W=e.localApp?e.localApp(e.app):e.app,x=new kn({schema:W.schema,mutations:W.mutations??[],invariants:W.invariants??[],...W.policy?{policy:W.policy}:{},...W.publishing?{publishing:W.publishing}:{},...W.modules?{modules:W.modules}:{},...le?{enabledModules:le}:{},...W.intelligence?{intelligence:W.intelligence}:{},...W.brand?.timeZone?{timeZone:W.brand.timeZone}:{},snapshot:F.snapshot,log:F.log,...F.horizon!==void 0?{horizon:F.horizon}:{},ids:Ho(),...e.storeOptions??{}});bn.served.add(x);let Re=Sn(x),E=F.log.at(-1)?.seq??(F.horizon??0)-1,oe=xt.of(F.log,{horizon:F.horizon??0}),T=null,Q,$=new Map,ue=s.who,ve=!1,N=t=>{if(ie)return;ve=!0;let r=Rn(new Map,t,Date.now(),Ct,T?.participant);Q!==void 0&&r.delete(Q);let i=r.size!==$.size;if(!i)for(let[o,u]of r)Lt(u,$.get(o))||(i=!0);if($=r,!!i)for(let o of[...ue])o([...$.values()])},q=[],I=new Set,ae=t=>{let r=q.indexOf(t);r>=0&&q.splice(r,1)},M=new Map,Te=(t,r)=>{let i=M.get(t);i&&(M.delete(t),i.resolve({ops:r.filter(o=>o.batch===t),batch:t}))},K,te=[],L=(t,r=[])=>{if(t.length===0&&r.length===0)return[];if(K)return te.push({ops:t,drop:r}),[];let i=Math.min(...t.filter(g=>g.seq>E).map(g=>g.seq));if(Number.isFinite(i)&&i>E+1)return te.push({ops:t,drop:r}),fe(),[];let o=q.filter(g=>t.some(J=>J.batch===g)),u=[...new Set([...r,...o])].filter(g=>I.has(g)),m,b=q.filter(g=>!o.includes(g));try{m=x.rebase({confirmed:t,pending:b,drop:u}).confirmed}catch(g){if(!(g instanceof Pn))throw g;return te.push({ops:t,drop:r}),fe(),[]}for(let g of o)ae(g);t.some(g=>g.seq>E)&&b.some(g=>!u.includes(g))&&k.rebases++,t.length>0&&(E=Math.max(E,...t.map(g=>g.seq)),oe.note(t));for(let g of u)I.delete(g);for(let g of o)Te(g,t);return m},fe=()=>{K||(K=be(Y().then(t=>{if(pe(t)){te=[];return}let r=new Set(t.log.map(u=>u.batch)),i=q.filter(u=>r.has(u));for(let u of i)ae(u);let o=x.adopt({snapshot:t.snapshot,log:t.log,...t.horizon!==void 0?{horizon:t.horizon}:{},pending:[...q],drop:[...I].filter(u=>!q.includes(u))});I.clear();for(let u of o.pending)I.add(u.batch);E=t.log.at(-1)?.seq??(t.horizon??0)-1,oe=xt.of(t.log,{horizon:t.horizon??0}),k.resyncs++;for(let u of i)Te(u,t.log)}).then(()=>{K=void 0;let t=te;te=[];for(let{ops:r,drop:i}of t)L(r,i)},()=>{K=void 0,te=[]})))},pe=t=>(typeof t.build=="string"&&on(t.build),typeof t.version=="number"&&f(t.held),typeof t.version!="number"||t.version===F.version?!1:(St(t.version),!0)),de=async t=>{let i=await(await U(`${e.url}/graview/since?seq=${mt(t)}&opFormat=${_e.op}`,{headers:l})).json();return pe(i)?[]:i.reset===!0?(fe(),[]):i.ops??[]},Z=async()=>{let t=await Ge();return K&&await K,t},Ge=async()=>{if(T&&!z()&&R()){let r=await(await U(`${e.url}/graview/here`,{method:"POST",headers:l,body:JSON.stringify({presence:T,seq:mt(E)})})).json();return pe(r)?[]:(typeof r.participant=="string"&&(Q=r.participant),N(r.who??[]),L(r.ops??[]))}return L(await de(E))},xe=new Map,A=new Map,$e=new Set,ne=new Map,ce=new Set,be=t=>(ce.add(t),t.finally(()=>ce.delete(t)).catch(()=>{}),t),Ne=Promise.resolve(),He=0,gt=(t,r)=>{let i=Ne.then(()=>Ue(t,r));return Ne=i.catch(()=>{}),i},wt=()=>new Promise((t,r)=>C.push({again:t,give:r})),Ue=async(t,r)=>{let i,o;for(;;){try{i=await U(`${e.url}/graview/ops`,{method:"POST",headers:l,body:JSON.stringify({...t,opFormat:_e.op})})}catch(g){if(!(g instanceof ze)||X)throw g;if(await wt(),z())return Je(t,r);continue}if(o=await i.json().catch(()=>({})),i.status===503&&o.reason==="unavailable"&&typeof o.held=="string"&&!X){if(typeof o.version=="number"?pe(o):(f(o.held),!1))break;if(v!==void 0&&(At>0||p)){if(await new Promise(g=>j.push(g)),X)throw new Be("The client closed.");if(z())return Je(t,r);continue}}let b;if(i.status===503&&o.reason==="unavailable"&&!X)b=Zt(e.backoff,He++);else{if(He=0,i.status!==429||X)break;b=Bo(i.headers.get("retry-after"),o.retryAfter)}if(await new Promise(g=>setTimeout(g,b)),z())return Je(t,r)}if(ie||pe(o))throw new Be("The app was changed.");if(!i.ok){let b=o.error??`The server refused (${i.status})`;throw o.conflict?new we(b,o.conflicts??[]):new We({reason:o.reason??Co[i.status]??"invalid",sentence:b,...o.wouldNeed?.length?{wouldNeed:o.wouldNeed}:{}})}let u=o.ops??[],m=u[0]?.seq;return m!==void 0&&m>E+1&&(u=await de(E)),r!==void 0&&(o.batch&&xe.set(r,o.batch),ae(r)),L(u,r!==void 0?[r]:[]),{ops:o.ops??[],...o.batch?{batch:o.batch}:{}}},_,re=!1,X=!1,Oe=0,Se,Ke=0,Pe=0,Fe=null,me=()=>{},Ve=new Promise(t=>{me=t}),z=()=>p&&re&&_?.readyState===Vo,Ce=t=>{if(!z())return!1;try{return _.send(JSON.stringify(t)),!0}catch{return!1}},y=(t=!1)=>{!T||!z()||!R()||!t&&Fe&&Lt(T,Fe)&&(w===void 0||Date.now()-Pe<w)||Ce({t:"here",presence:T})&&(Fe=T,Pe=Date.now())},H=new Set,V,nn=()=>{if(V=void 0,v!==void 0)return;let t=[...M.entries()].filter(([r])=>H.has(r));H.clear();for(let[,r]of t)Ce(r.message)},rn=(t,r)=>{M.has(t)&&(H.add(t),V&&clearTimeout(V),V=setTimeout(nn,Math.max(0,r)))},Nr=t=>{M.has(t)&&H.add(t)},Je=(t,r)=>new Promise((i,o)=>{let u=r??`send-${++Ke}`,m=t.undo?{t:"undo",cid:u,batches:t.undo,...t.intent?{intent:t.intent}:{},...t.batch?{batch:t.batch}:{},...t.via?{via:t.via}:{},...Ae(t)}:{t:"call",cid:u,calls:t.calls??[],...t.intent?{intent:t.intent}:{},...t.batch?{batch:t.batch}:{},...t.base?.length?{base:t.base}:{},...t.via?{via:t.via}:{},...Ae(t)};if(M.set(u,{message:m,...r!==void 0?{mine:r}:{},resolve:i,reject:o}),H.size>0||v!==void 0){H.add(u);return}Ce(m)}),Ye=(t,r)=>z()?Je(t,r):gt(t,r),Ir=t=>{switch(t.t){case"welcome":{if(on(t.build),typeof t.version=="number"&&t.version!==F.version){St(t.version);return}if(re=!0,Oe=0,typeof t.participant=="string"&&(Q=t.participant),f(t.held),t.state?fe():L(t.ops??[]),H.clear(),V&&clearTimeout(V),V=void 0,v!==void 0)for(let r of M.keys())H.add(r);else for(let r of M.values())Ce(r.message);y(!0),ee("online"),me();return}case"ops":L(t.ops??[]);return;case"ack":{let r=M.get(t.cid);if(!r){L(t.ops??[]);return}M.delete(t.cid),He=0,r.mine!==void 0&&(xe.set(r.mine,t.batch),ae(r.mine)),L(t.ops??[],r.mine!==void 0?[r.mine]:[]),r.resolve({ops:t.ops??[],batch:t.batch});return}case"refused":case"conflict":{let r=M.get(t.cid);if(!r)return;if(t.t==="refused"&&t.reason==="unavailable"){v!==void 0?Nr(t.cid):rn(t.cid,Zt(e.backoff,He++));return}M.delete(t.cid),r.reject(t.t==="conflict"?new we(t.sentence,t.conflicts??[]):new We({reason:t.reason??"invalid",sentence:t.sentence,...t.wouldNeed?.length?{wouldNeed:[...t.wouldNeed]}:{}}));return}case"busy":typeof t.cid=="string"&&rn(t.cid,typeof t.retryAfter=="number"?t.retryAfter:1e3);return;case"presence":N(t.who??[]);return;case"held":f(t.sentence);return;case"declaration":typeof t.version=="number"&&t.version!==F.version&&St(t.version);return;case"reload":cn(typeof t.reason=="string"?t.reason:"This app was updated.");return;case"error":if(t.reopen===!0&&_){let r=_;un(r);try{r.close(1e3,"Opening again.")}catch{}}return;default:return}},ie=!1,vt=s.declarations,bt=s.builds,on=t=>{if(!(ie||s.otherBuild!==void 0||!e.build||typeof t!="string"||t.length===0||t===e.build)){s.otherBuild=t;for(let r of[...bt])r(t)}},an=()=>{let t=[],r=0;for(let i of q){let o=ne.get(i);o?t.push({calls:o.calls,...o.intent?{intent:o.intent}:{},...o.via?{via:o.via}:{},...Ae(o),batch:i}):r++}return{carried:t,undos:r}},sn=(t,r)=>`${r} while ${t===1?"an undo of yours was":"undos of yours were"} on the way; ${t===1?"it was":"they were"} not made.`,dn=t=>{ie=!0,T=null;let r=new Be(t);for(let o of M.values())o.reject(r);M.clear(),Xe&&clearInterval(Xe),X=!0,Se&&clearTimeout(Se),V&&clearTimeout(V),he&&clearTimeout(he);for(let o of C.splice(0))o.give(r);for(let o of j.splice(0))o();let i=_;_=void 0,re=!1;try{i?.close(1e3,t)}catch{}me()};async function St(t){if(ie)return;if(!e.resolveApp){cn(`This app was changed on its server (version ${t}); reload the page to carry on.`);return}let{carried:r,undos:i}=an(),o=e.resolveApp,u=T;dn("The app was changed.");try{let m=await o(t),{state:b,...g}=e,J=await Br({...g,app:m},r,"The app was changed while your changes were on the way.",s);u&&J.remote.presence.here(u);for(let et of[...vt])et(J.remote,t);let Jr=[...i>0?[Qe(sn(i,"The app was changed"))]:[],...J.unheard()];for(let et of Jr)for(let Yr of De)Yr(et.sentence,et)}catch(m){let b=`The app was changed, but the new version could not be opened: ${m instanceof Error?m.message:String(m)}`;for(let g of De)g(b,Qe(b))}}function cn(t){if(ie)return;let{carried:r,undos:i}=an();dn(t);let o=!1;if(e.carry&&r.length>0)try{e.carry.storage.setItem(e.carry.key,JSON.stringify(r)),o=!0}catch{}let u=[];!o&&r.length>0&&u.push(`${t} ${r.length===1?"A change of yours was":`${r.length} changes of yours were`} not sent; make ${r.length===1?"it":"them"} again after the page reloads.`),i>0&&u.push(sn(i,"This app was updated"));for(let m of u)for(let b of De)b(m,Qe(m));(e.reloadPage??Wo)()}let ln=()=>{if(X||!p)return;let t=`${e.url.replace(/^http/,"ws").replace(/\/$/,"")}${Dr}`,{"content-type":r,...i}=l,o;try{o=e.socket?e.socket(t,i,[Qt]):Kr(t,i)}catch{return fn()}_=o,re=!1,o.onopen=()=>{_===o&&o.send(JSON.stringify({t:"hello",seq:mt(E),protocol:tt,wire:Yt,opFormat:_e.op,...e.build?{build:e.build.slice(0,64)}:{},...e.hostProtocol!==void 0?{hostProtocol:e.hostProtocol}:{}}))},o.onmessage=u=>{if(_!==o)return;let m;try{m=JSON.parse(String(u.data))}catch{return}Ir(m)},o.onclose=()=>un(o),o.onerror=()=>{}},he,_r=()=>{ve=!1,he&&clearTimeout(he),he=setTimeout(()=>{if(he=void 0,ve||X)return;let t=new Map([...$].filter(([,r])=>r.held!=="socket"));if(t.size!==$.size){$=t;for(let r of ue)r([...$.values()])}},Ct),he.unref?.()};function un(t){if(_!==t)return;let r=re;_=void 0,re=!1,Fe=null,r&&(ee("offline"),_r()),fn()}let fn=()=>{if(X)return;let t=Zt(e.backoff,Oe);Oe++,Se=setTimeout(ln,t)},pn=x.applyAll.bind(x),jr=x.undo.bind(x),qr=x.previewAll.bind(x);x.previewAll=(t,r)=>qr(t,{...e.principal?{author:e.principal}:{},...r});let De=s.refusals,Ie=[],Qe=t=>({reason:"invalid",sentence:t}),Ze=s.conflicts,Pt=!1,mn,kt=async(t,r)=>{if(r instanceof Be||ie)return;let i=r instanceof We?r.refusal:wn(r),o=i.sentence,u=r instanceof we?mn?.yoursOf(x,ne.get(t)?.calls??[]):void 0;ae(t);try{L([],[t])}catch{}let m=ne.get(t);if(ne.delete(t),r instanceof we&&k.conflicts++,r instanceof we&&!z()&&await Z().catch(()=>[]),r instanceof we&&K&&await K,r instanceof we&&Ze.size>0){let b=!1,g={sentence:o,conflicts:u?r.conflicts.map(J=>J.node===u.node&&J.field===u.field?{...J,yours:u.yours}:J):r.conflicts,keepTheirs(){b=!0},useMine(){if(!(b||!m)){b=!0,Pt=!0;try{x.applyAll(u?[u.over(E)]:m.calls,{...m.intent?{intent:m.intent}:{},...m.via?{via:m.via}:{},...Ae(m)})}finally{Pt=!1}}}};for(let J of Ze)J(g);return}for(let b of De)b(o,i)},zr=(t,r)=>t.flatMap(i=>i.mutation?.name===gn?[]:i.primitives.flatMap(o=>o.op==="splice-text"&&!r.has(o.id)&&!r.has(`${o.id}\0${o.field}`)?[{node:o.id,field:o.field,rev:E}]:[]));x.applyAll=(t,r)=>{let i=vn(x.log.all().filter(b=>I.has(b.batch))),o=pn(t,{...e.principal?{author:e.principal}:{},...r}),u=t.map((b,g)=>{let J=o.minted?.[g];return J===void 0||b.args?.id!==void 0?b:{...b,mintedHint:J}});q.push(o.batch),I.add(o.batch),ne.set(o.batch,{calls:u,...r?.intent?{intent:r.intent}:{},...r?.via?{via:r.via}:{},...Ae(r)});let m=Pt?[]:[...oe.baseFor(o.ops,i,(b,g)=>x.collaborative(b,g)),...zr(o.ops,i)];return A.set(o.batch,be(Ye({calls:u,...r?.intent?{intent:r.intent}:{},batch:o.batch,...m.length>0?{base:m}:{},...r?.via?{via:r.via}:{},...Ae(r)},o.batch).catch(b=>kt(o.batch,b)))),o},x.apply=(t,r)=>x.applyAll([t],r),x.undo=(t,r)=>{let i=typeof t=="string"?[t]:t,o=jr(i.map(m=>xe.get(m)??m),{...e.principal?{author:e.principal}:{},...r});q.push(o.batch),I.add(o.batch);let u=Promise.allSettled(i.map(m=>A.get(m)));return A.set(o.batch,be(u.then(()=>{let m=i.filter(b=>!$e.has(b));if(m.length===0){ae(o.batch),ne.delete(o.batch),L([],[o.batch]);return}return Ye({undo:m.map(b=>xe.get(b)??b),...r?.intent?{intent:r.intent}:{},batch:o.batch,...r?.via?{via:r.via}:{},...Ae(r)},o.batch)}).catch(m=>kt(o.batch,m)))),o};let Gr=async(t,r={})=>{Et++;try{return(await be(Ye({calls:t,...r}))).ops}finally{Et--}},Et=0,hn={here(t){T=t,y()},onWho(t){return ue.add(t),$.size>0&&t([...$.values()]),()=>{ue.delete(t)}},leave(){if(!T)return;let t=JSON.stringify({participant:Q??T.participant});if(T=null,Ce({t:"bye"}))return;let r=globalThis.navigator?.sendBeacon;r?r.call(globalThis.navigator,`${e.url}/graview/leave`,t):d(`${e.url}/graview/leave`,{method:"POST",headers:l,body:t}).catch(()=>{})}},At=e.pollMs??800,Xe=At>0&&typeof setInterval=="function"?setInterval(()=>{z()||Z().catch(()=>{})},At):null;if(p){ln();let t;await Promise.race([Ve,new Promise(r=>t=setTimeout(r,e.openTimeoutMs??3e3))]),clearTimeout(t)}if(n.length>0&&!ie){let t=[],r=new Set(x.log.all().map(i=>i.batch));for(let i of n)if(!(i.batch!==void 0&&r.has(i.batch)))try{x.applyAll(i.calls,{...i.intent?{intent:i.intent}:{},...i.batch?{batch:i.batch}:{},...i.via?{via:i.via}:{},...Ae(i)})}catch(o){t.push(Oo(i,o))}t.length>0&&Ie.push(Qe(`${a} ${t.length===1?"One no longer fits and was not made":`${t.length} no longer fit and were not made`}: ${t.join("; ")}.`))}let yn=new Map,Ur=()=>({store:x,author:e.principal,appliedAll:pn,pending:q,provisional:I,asked:ne,answers:A,letGo:$e,sent:(t,r)=>be(Ye({calls:r,batch:t},t).catch(i=>kt(t,i))),settle:ae,land:L,seen:()=>E,gone:()=>X||ie});return{remote:{store:x,typing(t,r){let i=`${t}\0${r}`,o=yn.get(i);return o||(o=(__graviewPreload(import.meta.url,["./chunk.DUZS52WX.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.5XFRWXYQ.js")).then(u=>(mn=u,u.typingOf(t,r,u.wireOf(Ur())))),yn.set(i,o)),o},version:F.version,migrated:F.migrated??[],send:Gr,pull:Z,onRefusal(t){De.add(t);let r=Ie;Ie=[];for(let i of r)t(i.sentence,i);return()=>De.delete(t)},onDeclaration(t){return vt.add(t),()=>vt.delete(t)},onBuild(t){return bt.add(t),s.otherBuild!==void 0&&t(s.otherBuild),()=>bt.delete(t)},onConflict(t){return Ze.add(t),()=>Ze.delete(t)},revision:(t,r)=>oe.of(t,r),seq:()=>E,participant:()=>Q,transport:()=>z()?"socket":"poll",status:se,onStatus(t){return P.add(t),()=>P.delete(t)},held:()=>v,onHeld(t){return s.helds.add(t),v!==void 0&&t(v),()=>s.helds.delete(t)},counters:()=>({...k}),who:()=>[...$.values()],pending:()=>q.length+Et,async settled(){for(;ce.size>0;)await Promise.allSettled([...ce])},presence:hn,close(){Xe&&clearInterval(Xe),Re(),hn.leave(),X=!0,Se&&clearTimeout(Se),V&&clearTimeout(V),he&&clearTimeout(he);for(let r of C.splice(0))r.give(new Error("The client closed before the server could be reached."));for(let r of j.splice(0))r();let t=_;_=void 0,re=!1;try{t?.close(1e3,"Closed.")}catch{}}},unheard(){let t=Ie;return Ie=[],t}};function Kr(t,r){let i=globalThis.WebSocket;if(!i)throw new Error("This runtime has no WebSocket; the client polls instead.");let o=typeof globalThis.document<"u",u=e.subprotocol?[Qt]:[];if(!o)try{return new i(t,{headers:r,...u.length>0?{protocols:u}:{}})}catch{}let m=new URL(t);for(let[b,g]of Object.entries(S))m.searchParams.set(b,g);return u.length>0?new i(m.toString(),u):new i(m.toString())}}function Bo(e,n,a=Date.now()){let s,d=e?.trim();if(d)if(/^\d+(\.\d+)?$/.test(d))s=Number(d)*1e3;else{let p=Date.parse(d);Number.isFinite(p)&&(s=Math.max(0,p-a))}let l=typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0,S=l!==void 0&&l<50&&s!==void 0&&Math.abs(l*1e3-s)<1e3;return l!==void 0&&!S?l:s??1e3}function Wo(){globalThis.location?.reload?.()}function $o(){return globalThis.document?.visibilityState!=="hidden"}function Zt(e,n){if(typeof e=="function")return Math.max(0,e(n));let{min:a=250,max:s=1e4,factor:d=2}=e??{};return Math.min(s,a*d**n)*(.75+Math.random()*.5)}function yt(e){let n={};if(!e)return n;e.id&&(n[ge.seat]=e.id),e.roles?.length&&(n[ge.roles]=e.roles.join(",")),e.kind!=="human"&&(n[ge.kind]=e.kind),e.name&&(n[ge.name]=encodeURIComponent(e.name));let a=e.onBehalfOf;return a?.id&&(n[ge.for]=a.id),a?.roles?.length&&(n[ge.forRoles]=a.roles.join(",")),a?.name&&(n[ge.forName]=encodeURIComponent(a.name)),n}var Wr="/graview/views";function Xt(e){let n=e.fetch??fetch,a=e.url.replace(/\/$/,""),s={"content-type":"application/json",...e.principal?yt(e.principal):{},...e.headers??{}},d=e.state?{hidden:e.state.hidden??[],removed:e.state.removed??[],may:e.state.may??nt.may}:nt,l=new Set,S=P=>{if(JSON.stringify(P)!==JSON.stringify(d)){d=P;for(let k of l)k()}},p=async(P,k)=>{let C=await n(`${a}${e.path??Wr}`,{method:P,headers:s,...k!==void 0?{body:JSON.stringify(k)}:{}}),v=await C.json();if(!C.ok)throw new Error(v.error??`The store answered ${C.status}.`);S({hidden:v.hidden??[],removed:v.removed??[],may:v.may??nt.may})},w=()=>p("GET"),R=e.state?Promise.resolve():w().catch(()=>{}),O=e.pollMs?setInterval(()=>void w().catch(()=>{}),e.pollMs):void 0;return{ready:R,refresh:w,close:()=>clearInterval(O),current:()=>d,onChange(P){return l.add(P),()=>void l.delete(P)},hide:P=>p("POST",{hide:P}),show:P=>p("POST",{show:P}),remove:(P,k)=>p("POST",{remove:P,...k?{about:k}:{}}),async restore(P){let k=d.removed.find(C=>C.name===P)?.lens;await p("POST",{restore:P}),k&&await e.onDeclaration?.()},async lens(P){await p("POST",{lens:P}),await e.onDeclaration?.()}}}var tn=document.getElementById("graview-app"),en=/^\/forms\/([^/]+)\/?$/.exec(location.pathname),$r=en?(__graviewPreload(import.meta.url,["./chunk.YI7WHBAD.js","./chunk.52Y37IAD.js","./chunk.XOZU4OFA.js","./chunk.IYVBJDR7.js","./chunk.N6A3DIOY.js","./chunk.NCTTPW7A.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.KAKJYAHM.js")):Me("pages");try{en?await No(decodeURIComponent(en[1])):await Io()}catch(e){let n=document.createElement("pre");n.setAttribute("role","alert"),n.style.cssText="margin:2rem;font:14px/1.5 ui-monospace,monospace;white-space:pre-wrap",n.textContent=e instanceof Error?e.message:String(e),tn.replaceChildren(n),window.__graviewFailed=n.textContent}async function No(e){let n=await fetch(`/graview/document?form=${encodeURIComponent(e)}`),a=await n.json();if(!n.ok)throw new Error(a.error??`The preview server did not hand over the form (${n.status}).`);let s=await ct(a);if(!s.ok)throw new Error(rt(s.findings));let d=s.app,l=a.principal,S=await ht({app:d,url:location.origin,principal:l,...a.state?{state:a.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=d.forms?.[e]?.title??d.name;let{mount:p}=await $r;window.__graview=p(tn,{app:d,form:e,principal:l,remote:S,height:"100dvh",onSubmitted:()=>window.__graviewSubmitted=!0}),window.__graviewReady=!0}async function Io(){let e=await fetch("/graview/document");if(!e.ok)throw new Error(`The preview server did not hand over the document (${e.status}).`);let n=await e.json(),s=await(async w=>{if(typeof w.module=="string")return(await import(w.module)).app;let R=await ct(w);if(!R.ok)throw new Error(rt(R.findings));return R.app})(n);if(!s||typeof s!="object"||!("schema"in s))throw new Error("The app module the preview server handed does not export an app.");let d=n.principal,l=await ht({app:s,url:location.origin,principal:d,live:!0,subprotocol:!0,pollMs:1200,...n.state?{state:n.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=s.name;let S,p=Xt({url:location.origin,principal:d,...n.views?{state:n.views}:{},onDeclaration:async()=>{let w=await(await fetch("/graview/document")).json();if(typeof w.module=="string")return;let R=await ct(w);R.ok&&S?.setApp(R.app,l)}});await Promise.all([$r,p.ready]),S=Jt(tn,{app:s,remote:l,principal:d,studio:!1,face:"pages",routing:"address",bar:!0,height:"100dvh",label:s.name,heading:1,keptViews:p,...n.draftView?{draftView:n.draftView}:{}}),window.__graview=S,S.drawn().then(()=>{window.__graviewReady=!0})}
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 Xr}from"./chunk.ZBHFCSKO.js";import{a as Dt,b as er,c as tr,d as nr,e as rr,f as Vt,g as or,h as Bt}from"./chunk.7JCUSYS5.js";import{a as Wt,b as ir,c as sr,d as dr,e as $t,f as cr,g as lr,h as ur,i as fr,j as pr,k as mr,l as hr,m as yr,n as qe}from"./chunk.2WSRJGW2.js";import{b as ar}from"./chunk.7TMWMW4W.js";import{a as At,g as xn}from"./chunk.JCFYZEMY.js";import{k as rt}from"./chunk.ZUBC3UFG.js";import{E as Qn,I as Zn,J as Xn,h as Gn,k as Mt,l as Un,n as Kn,r as Jn,w as Ht,z as Yn}from"./chunk.FWZF7X6A.js";import{c as Zr}from"./chunk.3JMZHCB4.js";import{Aa as Nn,Ca as In,Da as _n,Fa as jn,G as Ct,Ga as Lt,Ka as qn,La as zn,Oa as it,T as Cn,Z as Ln,a as On,b as ot,c as at,ga as Mn,ha as Hn,j as Fn,m as Ft,va as Dn,wa as Vn,xa as Bn,ya as Wn,za as $n}from"./chunk.SF4BYBH6.js";import{a as Ee}from"./chunk.SDO3U72B.js";import{Bb as vn,Hd as Ae,Id as En,Jd as Rn,Od as Rt,Pd as Tt,Qd as xt,Sc as Sn,Td as Tn,Ud as Ot,cb as We,ec as Et,fc as bn,fd as Pn,hd as kn,id as An,kd as nt,nb as tt,ob as wn}from"./chunk.3MZIWKNG.js";import"./chunk.SLBWPVIY.js";import{b as Le}from"./chunk.AJZBJBMO.js";function Nt(e){if(Array.isArray(e))return e.map(Nt);if(e&&typeof e=="object"){let n={};for(let o of Object.keys(e).sort()){let i=e[o];i!==void 0&&(n[o]=Nt(i))}return n}return e}function It(e){return JSON.stringify(Nt(e))??"undefined"}async function st(e,n={}){let o=e.compiled===void 0||!to(e.compiled,e.document)?void 0:xn(e.compiled,n);if(o?.ok)return o;let{compileDocumentWithoutCheck:i}=await eo();return i(e.document,n)}var gr,eo=()=>gr??=(__graviewPreload(import.meta.url,["./chunk.JCFYZEMY.js","./chunk.BUDEUNBN.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.T42H5RXN.js")).catch(e=>{throw gr=void 0,e});function to(e,n){let o=typeof e=="object"&&e!==null?e.document:void 0,i=n;if(typeof i=="string")try{i=JSON.parse(i)}catch{return!1}return o!==void 0&&It(At(o).document)===It(At(i).document)}var c=Le(Ct(),1);var ct=Le(Ct(),1),_t="data-graview-drawn",no=200,wr=50,ro=1e4,dt=()=>typeof performance<"u"?performance.now():Date.now();function oo(e){let n=[...e.querySelectorAll("img")];for(let o of e.querySelectorAll("[data-worker-view]"))o.shadowRoot&&n.push(...o.shadowRoot.querySelectorAll("img"));return n}function ao(e,n){if(e.ownerDocument.fonts?.status==="loading"||Vn()>0||Nn(n)>0||e.querySelector('[aria-busy="true"]')||oo(e).some(i=>!i.complete&&i.loading!=="lazy"))return!1;for(let i of e.querySelectorAll("[data-worker-view-place]"))if(!i.querySelector("[data-worker-view][data-worker-view-drawn], [data-worker-view][data-worker-view-failed]"))return!1;return!0}function vr(e){let n=e.querySelector("[data-embed-content]"),o=[...e.querySelectorAll("[data-worker-view]")].map(i=>`${i.offsetWidth}x${i.offsetHeight}`);return`${e.scrollWidth}x${e.scrollHeight}|${n?`${n.scrollWidth}x${n.scrollHeight}`:""}|${o.join(",")}`}function io(e,n,o,i){e.removeAttribute(_t);let d=e.ownerDocument.defaultView;if(!d)return()=>{};let l=dt(),S=l,p=vr(e),w=!1,R,O=typeof MutationObserver>"u"?void 0:new MutationObserver(v=>{v.some(q=>!(q.target===e&&q.attributeName===_t))&&(S=dt())});O?.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let P=()=>{w=!0,O?.disconnect(),R!==void 0&&clearTimeout(R)},k=v=>{let q=!1,de=()=>{q||(q=!0,v())};typeof d.requestAnimationFrame=="function"&&d.requestAnimationFrame(()=>setTimeout(de,0)),setTimeout(de,100)},C=()=>{if(w)return;let v=vr(e);v!==p&&(p=v,S=dt());let q=dt();if(ao(e,i)&&q-S>=no||q-l>=ro){k(()=>{w||(P(),e.setAttribute(_t,n),_n(),o())});return}R=setTimeout(C,wr)};return R=setTimeout(C,wr),P}function br(e,n,o,i,d){In();let l=(0,ct.useRef)({place:o,onDrawn:i});l.current={place:o,onDrawn:i},(0,ct.useLayoutEffect)(()=>{d&&$n(d);let S=R=>io(R,l.current.place.path,()=>l.current.onDrawn?.(l.current.place),d);if(e.current)return S(e.current);let p,w=!1;return queueMicrotask(()=>{!w&&e.current&&(p=S(e.current))}),()=>{w=!0,p?.()}},[n,e,d])}var ye=Le(Ct(),1),ze,so=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.KY7QD22S.js","./chunk.WICMCZ27.js","./chunk.2DFWOLL2.js","./chunk.LU3B3SZH.js","./chunk.HLDMTKUP.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.C6HI3LRB.js"))),Sr=()=>so().then(e=>void(ze=e),()=>new Promise(e=>setTimeout(e,2e3)).then(Sr)),jt=Dn(Sr),Pr=e=>!!e&&ze===void 0;function qt({onReady:e,fetch:n}){return(0,ye.useLayoutEffect)(()=>void n().then(e),[e,n]),null}var co=0;function kr(e){let[n,o]=(0,ye.useState)(()=>ze);(0,ye.useEffect)(()=>{if(!e||n)return;let l=!1;return jt().then(()=>{l||o(ze)}),()=>{l=!0}},[e,n]);let i=(0,ye.useMemo)(()=>co+=1,[e]);return{over:(0,ye.useMemo)(()=>{let l=n??ze;if(!e||!l)return;let{source:S,worker:p,...w}=e,R={...w,worker:p??{source:S},draft:!0};return{name:e.manifest.name,home:e.manifest.attach==="home",register:O=>l.registerWorkerView(O,R)}},[e,n]),n:i}}var Rr=Le(Xr(),1),j=Le(Zr(),1);var h=Le(Cn(),1);function lt(e,n={}){let o=Lt(e);return{Face:o.part((d,l)=>(0,c.createElement)(d,l),n),fetch:()=>o.load().then(()=>{}),here:()=>o.current!==void 0||o.failed}}var Ut=e=>Promise.all([e,Zn()]).then(([n])=>n),Tr=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.EC7I33WI.js","./chunk.3ZONBC6L.js","./chunk.FWKNR7XF.js","./chunk.GKLDSHHH.js","./chunk.OCV46AFN.js","./chunk.Y36MLVMT.js","./chunk.MPMROUZA.js","./chunk.HJCQ6I3S.js","./chunk.5C43AM3X.js","./chunk.4WH4N4V7.js","./chunk.5VF2RT4H.js","./chunk.5RH6FO3K.js","./chunk.ZDDWXRPK.js","./chunk.LOUICR7K.js","./chunk.L7MFTL5S.js","./chunk.4F5M5XZG.js","./chunk.3G5DEGFA.js","./chunk.BOMYLOCX.js","./chunk.45HTFSWD.js","./chunk.Q6RUTFU3.js","./chunk.AZGXBTOQ.js","./chunk.2WSRJGW2.js","./chunk.7TMWMW4W.js","./chunk.TI4OSTQV.js","./chunk.C6HBYRGJ.js","./chunk.GZHZLJBF.js","./chunk.PZWJUQAO.js","./chunk.OJGHDWI6.js","./chunk.NEJSKMJV.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.WHGEDJB2.js"))),lo=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.VWQ57LTT.js","./chunk.K2J26XMB.js","./chunk.B2X6DA2Q.js","./chunk.QB7RYJ67.js","./chunk.UGFDSE37.js","./chunk.EC7I33WI.js","./chunk.PXQVXBNG.js","./chunk.GVUJCOKD.js","./chunk.3ZONBC6L.js","./chunk.MDWCX3YU.js","./chunk.CB5DGKR5.js","./chunk.GKLDSHHH.js","./chunk.OCV46AFN.js","./chunk.4KTHJY5N.js","./chunk.PZ4G5QA5.js","./chunk.Y36MLVMT.js","./chunk.MPMROUZA.js","./chunk.XTT6ERI3.js","./chunk.5RH6FO3K.js","./chunk.L7MFTL5S.js","./chunk.XZJ6XX5I.js","./chunk.4F5M5XZG.js","./chunk.LVOL2LEC.js","./chunk.3G5DEGFA.js","./chunk.OZ4EJ5M6.js","./chunk.Q6RUTFU3.js","./chunk.AZGXBTOQ.js","./chunk.XOZU4OFA.js","./chunk.AG7CUSSV.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.GZHZLJBF.js","./chunk.PZWJUQAO.js","./chunk.OJGHDWI6.js","./chunk.NEJSKMJV.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.57VTD3CU.js"))),uo=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.VWQ57LTT.js","./chunk.K2J26XMB.js","./chunk.B2X6DA2Q.js","./chunk.QB7RYJ67.js","./chunk.UGFDSE37.js","./chunk.EC7I33WI.js","./chunk.PXQVXBNG.js","./chunk.GVUJCOKD.js","./chunk.3ZONBC6L.js","./chunk.MDWCX3YU.js","./chunk.CB5DGKR5.js","./chunk.GKLDSHHH.js","./chunk.OCV46AFN.js","./chunk.4KTHJY5N.js","./chunk.PZ4G5QA5.js","./chunk.Y36MLVMT.js","./chunk.MPMROUZA.js","./chunk.XTT6ERI3.js","./chunk.5RH6FO3K.js","./chunk.L7MFTL5S.js","./chunk.XZJ6XX5I.js","./chunk.4F5M5XZG.js","./chunk.LVOL2LEC.js","./chunk.3G5DEGFA.js","./chunk.OZ4EJ5M6.js","./chunk.Q6RUTFU3.js","./chunk.AZGXBTOQ.js","./chunk.XOZU4OFA.js","./chunk.AG7CUSSV.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.3V2WXZU3.js","./chunk.7UD2JR6J.js","./chunk.BUDEUNBN.js","./chunk.3IEJQAK7.js","./chunk.AKLVSZ5A.js","./chunk.ZUBC3UFG.js","./chunk.GZHZLJBF.js","./chunk.PZWJUQAO.js","./chunk.OJGHDWI6.js","./chunk.NEJSKMJV.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.KLJDBYAZ.js"))),xr=lt(()=>Ut(Tr().then(e=>e.SceneFace)),{what:"This view"}),Or=lt(()=>Tr().then(e=>e.SceneKeeping),{quiet:!0}),Fr=lt(()=>Ut(lo().then(e=>e.PagesContent)),{what:"This page"}),Cr=lt(()=>Ut(uo().then(e=>e.PictureFace)),{what:"This picture"}),fo=xr.Face,po=Or.Face,mo=Fr.Face,ho=Cr.Face;function Me(...e){let n=e.length>0?e:["scene","pages","picture"],o=new Set(n.flatMap(Lr));return Promise.all([...[...o].map(i=>i.fetch()),Kn()]).then(()=>{},()=>{})}var Lr=e=>e==="pages"?[Fr]:e==="picture"?[Cr]:[xr,Or],Mr=e=>Lr(e).every(n=>n.here()),yo=150,zt=0;function Ar(e,n){if(Mr(e))return n();let o=++zt,i=()=>{o===zt&&(zt+=1,n())};Me(e).then(i),setTimeout(i,yo)}var go=768;function wo(e,n){let o=n!==null&&n>=go;(0,c.useEffect)(()=>{if(!o||e==="picture")return;let i=e==="pages"?"scene":"pages";if(Mr(i))return;let d=globalThis,l=()=>void Me(i),S=()=>{},p=jn(()=>{if(d.requestIdleCallback&&d.cancelIdleCallback){let w=d.requestIdleCallback(l,{timeout:4e3});S=()=>d.cancelIdleCallback?.(w)}else{let w=setTimeout(l,1500);S=()=>clearTimeout(w)}});return()=>(p(),S())},[e,o])}function vo({asked:e,shown:n,onDrawn:o}){return(0,c.useLayoutEffect)(()=>o(e,n),[e,n,o]),null}function bo({auto:e,scene:n}){return(0,h.jsx)("div",{"data-embed-content":"","aria-busy":"true",style:{flex:e?n?`0 0 ${$t}px`:"0 0 auto":"1 1 auto",minHeight:0,background:"var(--graview-ground)"}})}var So=Lt(Ee(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.5JNXQHN4.js")))).part((e,n)=>(0,h.jsx)(e.StudioPlace,{...n}),{quiet:!0});function Hr(e,n,o,i,d){return Vt(e,rr(n?at(n):d??On,i),o)}function Kt(e){return e&&at(e).overview?"graview":"scene"}function Er(e,n){if(n.homeView?.()===void 0)return!1;let o=e.pages?.first?.trim();return o===void 0||o===""||o==="/"||o.toLowerCase()==="home"}function Dr(e){let[,n]=(0,c.useState)(!1),o=(0,c.useCallback)(()=>n(!0),[]),i=(0,c.useRef)(!1);return e.at&&!ut?(0,h.jsx)(qt,{onReady:o,fetch:Jt}):!i.current&&Pr(e.draftView)?(0,h.jsx)(qt,{onReady:o,fetch:jt}):(i.current=!0,(0,h.jsx)(Po,{...e}))}function Po(e){let{app:n,stop:o,bar:i=!0,standing:d="Everything is in order",principal:l,heading:S=2}=e,{rootRef:p,scope:w,css:R,scheme:O,store:P,presence:k,brand:C,auto:v,height:q}=cr(e),de=kr(e.draftView),V=sr(e,Xn,de.over),[ee]=(0,c.useState)(Wn),f=e.basePath===void 0?{}:{basePath:e.basePath},[B]=(0,c.useState)(Mt),U=e.notices??B,Q=y=>Rt(y,f),F={...e.routing?{routing:e.routing}:{},...f},[ue]=(0,c.useState)(()=>{let y=e.at?.face;if(y)return y;let H=o===void 0&&Er(n,V)?"pages":Kt(o),D=Dt({...F,face:H});return e.face===void 0&&e.onOpening?.(D),D}),[W,x]=(0,c.useState)(()=>e.face!==void 0&&e.face!=="pages"&&!e.at&&o===void 0&&er(F)&&Er(n,V)),Te=(0,c.useRef)(e.onFace);Te.current=e.onFace,(0,c.useLayoutEffect)(()=>{W&&(Te.current?.("pages"),x(!1))},[W]);let A=W?"pages":e.face??ue,oe=n.schema.kinds,T=e.routing==="address",Z=(0,c.useMemo)(()=>e.at?ut.settleAt(e,P.seenBy(l??{kind:"human"}),V.places()):void 0,[]),$=(0,c.useMemo)(()=>Hn(V,n.schema),[V,n.schema]),fe=(0,c.useMemo)(()=>{let y=Z?.stop??(T?tr(e.basePath):void 0)??o;return A==="scene"&&y===void 0&&$===void 0&&(e.path===void 0||Gt(e.path))?Bt(void 0):Hr(A,y,oe,V.places(),$)},[]),[ve]=(0,c.useState)(A);(0,c.useEffect)(()=>{ve!=="pages"&&Mn(V)},[ve,V]);let N=(0,c.useRef)(void 0),z=y=>y===void 0||Gt(y)?"/":y;N.current??={path:z(Z?.path??(T?A==="pages"?(Tt(window.location.pathname,e.basePath)??"/")+window.location.search:"/":e.path)),asked:e.path},e.path!==N.current.asked&&(N.current={path:z(e.path),asked:e.path});let I=(0,c.useRef)(e.onNavigate);I.current=e.onNavigate;let ae=(0,c.useCallback)((y,H)=>{N.current.path=y,I.current?.(y,H)},[]),{at:L,setAt:xe,steering:K,steer:te}=mr(N.current.path),M=(0,c.useContext)(Vr);M&&(M.pages=()=>N.current.path);let pe=(0,c.useRef)(void 0),ie=(0,c.useCallback)(y=>void(N.current.path=y),[]),ce=Gn(p),[be,He]=(0,c.useState)(!1),Y=e.pagesBelow!==void 0&&ce!==null&&ce<e.pagesBelow&&(A==="scene"||A==="graview")&&!be,E=Y?"pages":A,Ie=(0,c.useRef)(!1);Ie.current=be&&e.pagesBelow!==void 0&&ce!==null&&ce<e.pagesBelow&&(A==="scene"||A==="graview"),M&&(M.shown=E);let ne=(0,c.useRef)(A==="graview"?"graview":"scene");(E==="scene"||E==="graview")&&(ne.current=E),(0,c.useState)(()=>{if(!T||typeof window>"u"||E==="pages"||E==="picture")return;let{pathname:y,search:H,hash:D}=window.location;Tt(y,e.basePath)==="/"&&window.history.replaceState(window.history.state,"",`${Q(Ae)}${H}${D}`)}),dr(p,E,e.onIntrinsicHeight),wo(E,ce);let le=hr(e.onError,E),Se=yr(e.onReady,E),_e=(0,c.useRef)(e.onFaceDrawn);_e.current=e.onFaceDrawn;let De=(0,c.useCallback)((y,H)=>{Se(H),_e.current?.(y)},[Se]),[ht,yt]=(0,c.useState)(null),Ue=V.places(),_=(0,c.useRef)({shown:E,onFace:e.onFace});_.current={shown:E,onFace:e.onFace};let re=(0,c.useCallback)((y,H,D)=>{if(T){pe.current?.(y,H,D);return}_.current.onFace?.(y),I.current?.(y==="pages"?H??N.current.path:Ae,"push")},[T]),[X,Oe]=(0,c.useState)(void 0);(0,c.useEffect)(()=>{E==="pages"&&Oe(void 0)},[E]);let Pe=(0,c.useRef)(o);(0,c.useEffect)(()=>{Pe.current!==o&&(Pe.current=o,Oe(void 0))},[o]);let Ke=(0,c.useCallback)(y=>{if(_.current.shown==="pages"){if(He(!0),Oe(y),A==="scene"||A==="graview"){Ar(A,()=>{T?window.history.pushState(null,"",`${Q(Ae)}${y??""}`):I.current?.(Ae,"push")});return}Ar(ne.current,()=>re(ne.current,void 0,y))}},[T,A,e.basePath,re]),ke=(0,c.useCallback)(y=>{if(_.current.shown==="pages"){K.go.current||(N.current.path=y),te(y);return}if(N.current.path=y,xe(y),Ie.current){He(!1),T?window.history.pushState(null,"",Q(y)):I.current?.(y,"push");return}re("pages",y)},[K,te,xe,re,T,e.basePath]),Fe=V.arrangement?.(),me=E==="pages",Ve=e.hrefOf,G=Ve??(T?Q:void 0),Ce=(0,c.useMemo)(()=>({open:ke,...Ve?{href:Ve}:T?{href:y=>Rt(y,e.basePath===void 0?{}:{basePath:e.basePath})}:{}}),[ke,T,e.basePath,Ve]);return(0,h.jsxs)("section",{ref:p,className:w,"aria-label":e.label??n.name,"data-graview-embed":E,"data-graview-scheme":O,...Y?{"data-graview-embed-narrow":""}:{},style:{position:"relative",isolation:"isolate",height:q,minHeight:v?0:320,display:"flex",flexDirection:"column",overflow:"hidden",borderRadius:"var(--graview-radius, 12px)"},children:[(0,h.jsx)("style",{children:R}),(0,h.jsxs)(zn.Provider,{value:le,children:[(0,h.jsx)(lr,{rootRef:p,board:U}),(0,h.jsx)(ir,{rootRef:p,firstLook:e.firstLook,app:Yn(C??{name:n.name},n.schema)}),(0,h.jsx)(qe,{module:"@graview/react",report:le,content:!0,children:(0,h.jsx)(Bn.Provider,{value:ee,children:(0,h.jsx)(Ln,{store:P,views:V,initialView:fe,scheme:O,...ur(e,k,C),...e.onSeat?{onSeat:e.onSeat}:{},children:(0,h.jsxs)(Un.Provider,{value:U,children:[(0,h.jsx)(Ro,{face:E,stop:X??o,kinds:oe,places:Ue,opens:$}),M?(0,h.jsx)(ko,{into:M}):null,(0,h.jsx)(Ao,{rootRef:p,face:A,shown:E,path:L,stop:o,draft:de.n,onDrawn:e.onDrawn,parts:ee}),T?(0,h.jsx)(nr,{pagesWere:Z?.path,basePath:e.basePath,shown:E,onFace:e.onFace,toggle:pe,kinds:oe,places:Ue,opens:$,landed:ie}):null,i&&E!=="picture"?(0,h.jsx)(qe,{module:"@graview/embed",report:le,children:(0,h.jsx)(fr,{name:C?.name??n.name,heading:S,named:Wt(i).name!==!1,faces:Wt(i).faces===!1?void 0:{scene:{label:En(Fe),current:!me,go:()=>Ke(),reach:()=>void Me(ne.current)},pages:{label:Rn(Fe),current:me,go:()=>ke(N.current.path),reach:()=>void Me("pages")}},at:me?L:null,without:e.pages?.without(),home:{...G?.("/")!==void 0?{href:G("/")}:{},go:()=>ke("/"),current:me&&L.split("?")[0]==="/"},reach:{...G?{href:G}:{},go:y=>ke(y.path)},standing:d,hostActions:e.hostActions,keeping:me?void 0:(0,h.jsx)(To,{app:n,studio:e.studio,report:le}),onFind:yt,switch:e.switch})}):null,(0,h.jsx)(Jn.Provider,{value:ht,children:(0,h.jsx)(qe,{module:E==="pages"||E==="picture"?"@graview/pages":"@graview/react",report:le,content:!0,children:(0,h.jsxs)(c.Suspense,{fallback:(0,h.jsx)(bo,{auto:v,scene:E!=="pages"&&E!=="picture"}),children:[E==="picture"?(0,h.jsx)(ho,{scope:w,store:P,views:V,as:(o?at(o).within?.view:void 0)??""}):E==="pages"?(0,h.jsx)(mo,{store:P,views:V,presence:k,auto:v,brand:C,steering:K,overview:Ke,scope:w,titleLevel:pr(S),quickAsk:Ht(e.quickAsk),props:{...e,onNavigate:ae,...T?{}:{path:N.current.path}}}):(0,h.jsx)(qn.Provider,{value:Ce,children:(0,h.jsx)(fo,{address:T,auto:v,scheme:O,scope:w,quickAsk:Ht(e.quickAsk)})}),(0,h.jsx)(vo,{asked:A,shown:E,onDrawn:De})]})},E)})]})})})})]})]})}var Gt=e=>e.split(/[?#]/)[0]===Ae,Vr=(0,c.createContext)(null);function ko({into:e}){return e.view=it().view,null}function Ao({rootRef:e,face:n,shown:o,path:i,stop:d,draft:l,onDrawn:S,parts:p}){let{view:w}=it(),R=o==="scene"||o==="graview",O=ot(w),{pan:P,...k}=w,C=w.pan?ot(k):O,v={face:n,path:R?Ae:o==="picture"?d??"#":i,stop:O};return br(e,`${o} ${R?C:v.path} ${l}`,v,S,p),null}var ut,Eo=Ee(()=>(__graviewPreload(import.meta.url,["./chunk.7JCUSYS5.js","./chunk.FWZF7X6A.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.Y36WSKL5.js"))),Jt=()=>Eo().then(e=>void(ut=e),()=>new Promise(e=>{let n=()=>{window.removeEventListener("online",n),clearTimeout(o),e()},o=setTimeout(n,1e4);window.addEventListener("online",n)}).then(Jt));function Ro({face:e,stop:n,kinds:o,places:i,opens:d}){let{view:l,go:S}=it(),p=(0,c.useRef)({face:e,stop:n});return(0,c.useLayoutEffect)(()=>{let w=p.current.stop!==n,R=p.current.face!==e,O=p.current.face==="pages";if(p.current={face:e,stop:n},!w&&!R||e==="pages"||e==="picture")return;let P=(w||O)&&n!==void 0?Hr(e,n,o,i):O&&or(l)?Vt(e,Bt(d),o):e==="graview"?Ft(l,!0):l.overview?Fn(Ft(l,!1),Qn(l,o)):l;S(P)},[e,n,o,l,S,d]),null}function To({app:e,studio:n,report:o}){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c.Suspense,{fallback:null,children:(0,h.jsx)(po,{})}),n!==!1?(0,h.jsx)(qe,{module:"@graview/studio",report:o,children:(0,h.jsx)(xo,{app:e,studio:n})}):null]})}function xo({app:e,studio:n}){let o={app:e,within:"box",...n?{onApply:n.onApply}:{},...n?.landmark?{landmark:n.landmark}:{},...n?.offered!==void 0?{offered:n.offered}:{}},i=n?.place;return i?(0,h.jsx)(i,{...o}):(0,h.jsx)(c.Suspense,{fallback:null,children:(0,h.jsx)(So,{...o})})}function Oo({path:e,stop:n,...o},i){return{...o,app:i.app,at:i.at,remote:i.remote,...i.remote.presence?{presence:i.remote.presence}:{}}}function Yt(e,n){let o=n.store??n.remote?.store??ar(n.app,n.seed),i=n.notices??Mt(),d=null,l={},S=0,p=n.label,w=n.app,R=Promise.resolve(),O=n.at?.face??n.face,P=O===void 0?void 0:Dt({...n,face:O}),k=P??Kt(n.stop),C=null,v=[],q=f=>{if(C=f,f!==k)return;let B=v;v=[];for(let U of B)U()};function de(){let[f,B]=(0,c.useState)(P),[U,Q]=(0,c.useState)(n.stop),[F,ue]=(0,c.useState)(n.path),[W,x]=(0,c.useState)(n.scheme??"auto"),[Te,A]=(0,c.useState)(n.principal),[oe,T]=(0,c.useState)(n.seats),[Z,$]=(0,c.useState)(n.quickAsk),[fe,ve]=(0,c.useState)(n.people),[N,z]=(0,c.useState)(n.hostContext),[I,ae]=(0,c.useState)(n.brand),[L,xe]=(0,c.useState)(n.whileAway),[K,te]=(0,c.useState)(n.label),[M,pe]=(0,c.useState)(n.hostActions),[ie,ce]=(0,c.useState)(void 0),[be,He]=(0,c.useState)(n.draftView);return d={app:Y=>{ce(Y),ue(void 0),Q(void 0)},face:B,stop:Q,path:ue,scheme:x,seat:A,seats:T,quickAsk:$,people:ve,hostContext:z,brand:ae,whileAway:xe,label:te,hostActions:pe,draft:He},(0,h.jsx)(Vr.Provider,{value:l,children:(0,h.jsx)(Dr,{...ie?Oo(n,ie):n,store:o,notices:i,...f!==void 0?{face:f}:{},onOpening:Y=>{k=Y},...U!==void 0?{stop:U}:{},...F!==void 0?{path:F}:{},...Te?{principal:Te}:{},...oe?{seats:oe}:{},...Z!==void 0?{quickAsk:Z}:{},...fe?{people:fe}:{},...N?{hostContext:N}:{},...I?{brand:I}:{},whileAway:L,label:K,hostActions:M,draftView:be,scheme:W,onFace:Y=>{k=Y,B(Y)},onSeat:A,onFaceDrawn:q},ie?.n??0)})}let V=()=>{let f=l.view?.focusId,B=f?o.graph.getNode(f)?.kind:void 0,U=(l.shown??k)==="scene"||(l.shown??k)==="graview";return{face:k,path:U?Ae:l.pages?.()??n.path??"/",stop:l.view?ot(l.view):n.stop??"#",...B?{kind:B}:{}}},ee=(0,Rr.createRoot)(e);return(0,j.flushSync)(()=>ee.render((0,h.jsx)(de,{}))),{get store(){return o},where:V,setApp:(f,B,U)=>{let Q="graph"in B?{store:B}:B,F=()=>{let ue=V();o=Q.store,p=U?.label??(p===w.name?f.name:p),w=f,(0,j.flushSync)(()=>{d?.label(p),d?.app({app:f,remote:Q,at:ue,n:++S})})};ut?F():R=R.then(Jt).then(F)},setFace:f=>{k=f,(0,j.flushSync)(()=>d?.face(f))},setStop:f=>(0,j.flushSync)(()=>d?.stop(f)),setPath:f=>(0,j.flushSync)(()=>{if(Gt(f)){(k==="pages"||k==="picture")&&(k="scene",d?.face("scene"));return}d?.path(f),k!=="pages"&&(k="pages",d?.face("pages"))}),setScheme:f=>(0,j.flushSync)(()=>d?.scheme(f)),setSeat:f=>(0,j.flushSync)(()=>d?.seat(f)),setSeats:f=>(0,j.flushSync)(()=>d?.seats(f)),setQuickAsk:f=>(0,j.flushSync)(()=>d?.quickAsk(f)),setPeople:f=>(0,j.flushSync)(()=>d?.people(f)),setHostContext:f=>(0,j.flushSync)(()=>d?.hostContext(f)),setBrand:f=>(0,j.flushSync)(()=>d?.brand(f)),setWhileAway:f=>(0,j.flushSync)(()=>d?.whileAway(f)),setDraftView:f=>(0,j.flushSync)(()=>d?.draft(f)),setLabel:f=>{p=f,(0,j.flushSync)(()=>d?.label(f))},setHostActions:f=>(0,j.flushSync)(()=>d?.hostActions(f)),drawn:()=>R.then(()=>C===k?void 0:new Promise(f=>v.push(f))),notify:f=>{let B;return(0,j.flushSync)(()=>{B=i.notify(f)}),B},unmount:()=>ee.unmount()}}var ft=e=>`s${(e+1).toString(36)}`;var Br="/graview/live",Qt="graview.ship",Zt=`${Qt}.${tt}`;var ge={seat:"x-graview-seat",roles:"x-graview-roles",kind:"x-graview-kind",name:"x-graview-name",for:"x-graview-for",forRoles:"x-graview-for-roles",forName:"x-graview-for-name",via:"x-graview-via"};var $e=class extends Error{constructor(n){super(n),this.name="Superseded"}},Re=e=>e?.lineage?{lineage:e.lineage}:{},Fo=(e,n)=>`${e.calls.map(o=>o.name.replace(/-/g," ")).join(", ")} (${n instanceof Error?n.message.split(`
2
+ `)[0]??"":String(n)})`;function Co(e){if(!e)return[];try{let n=e.storage.getItem(e.key);if(n===null)return[];e.storage.removeItem(e.key);let o=JSON.parse(n);return Array.isArray(o)?o.filter(i=>!!i&&Array.isArray(i.calls)):[]}catch{return[]}}var Ne=class extends Error{constructor(o){super(o.sentence);this.refusal=o;this.name="RemoteRefusedError"}},Lo={401:"forbidden",403:"forbidden",404:"missing",413:"limit"},we=class extends Error{constructor(o,i){super(o);this.conflicts=i;this.name="StaleWrite"}},Ge=class extends Error{constructor(n){super(n),this.name="Unreached"}},Mo=new Set([502,503,504]);async function Ho(e){try{return(await e.clone().json()).reason==="unavailable"}catch{return!1}}function Do(){let e=Math.random().toString(36).slice(2,8),n=0;return()=>`local-${e}-${++n}`}var Vo=1,Bo=()=>({refusals:new Set,conflicts:new Set,statuses:new Set,helds:new Set,builds:new Set,who:new Set,declarations:new Set,tally:{reconnects:0,rebases:0,conflicts:0,resyncs:0}});async function pt(e){return(await Wr(e,Co(e.carry),"This app was updated while your changes were on the way.",Bo())).remote}async function Wr(e,n,o,i){let d=e.fetch??fetch,l={"content-type":"application/json",...e.headers??{}},S={...mt(e.principal),[ge.via]:e.via??"web"};Object.assign(l,S);let p=e.live===!0,w=e.presenceEveryMs,R=e.visible??No,O="connecting",P=i.statuses,k=i.tally,C=[],v,q=[],de=()=>O==="online"&&v!==void 0?"held":O,V=()=>{let t=de();if(i.told!==t){i.told=t;for(let r of[...P])r(t)}},ee=t=>{if(!(t===O||se)&&(O==="offline"&&t==="online"&&k.reconnects++,O=t,V(),t==="online"))for(let r of C.splice(0))r.again()},f=t=>{if(se)return;let r=typeof t=="string"&&t.length>0?t:void 0,s=r!==v;if(v=r,B(),!!s&&(V(),r===void 0)){for(let a of q.splice(0))a();D&&clearTimeout(D),rn()}},B=()=>{if(i.toldHeld!==v){i.toldHeld=v;for(let t of[...i.helds])t(v??null)}},U=async(t,r)=>{let s;try{s=await d(t,r)}catch(a){throw G()||ee("offline"),new Ge(a instanceof Error?a.message:String(a))}if(s.status===503&&await Ho(s))return ee("online"),s;if(Mo.has(s.status))throw G()||ee("offline"),new Ge(`The server is away (${s.status})`);return ee("online"),s},Q=async(t=!1)=>{let r=`${e.url}/graview/state?opFormat=${We.op}`,s=t?await d(r,{headers:l}):await U(r,{headers:l});if(!s.ok)throw new Error((await s.json().catch(()=>({}))).error??`The server refused (${s.status})`);return await s.json()},F=e.state??await Q(!0);p||(O="online"),v=typeof F.held=="string"&&F.held.length>0?F.held:void 0,B();let ue=F.enabledModules??e.enabledModules,W=e.localApp?e.localApp(e.app):e.app,x=new An({schema:W.schema,mutations:W.mutations??[],invariants:W.invariants??[],...W.policy?{policy:W.policy}:{},...W.publishing?{publishing:W.publishing}:{},...W.modules?{modules:W.modules}:{},...ue?{enabledModules:ue}:{},...W.intelligence?{intelligence:W.intelligence}:{},...W.brand?.timeZone?{timeZone:W.brand.timeZone}:{},snapshot:F.snapshot,log:F.log,...F.horizon!==void 0?{horizon:F.horizon}:{},ids:Do(),...e.storeOptions??{}});Sn.served.add(x);let Te=Pn(x),A=F.log.at(-1)?.seq??(F.horizon??0)-1,oe=Et.of(F.log,{horizon:F.horizon??0}),T=null,Z,$=new Map,fe=i.who,ve=!1,N=t=>{if(se)return;ve=!0;let r=Tn(new Map,t,Date.now(),xt,T?.participant);Z!==void 0&&r.delete(Z);let s=r.size!==$.size;if(!s)for(let[a,u]of r)Ot(u,$.get(a))||(s=!0);if($=r,!!s)for(let a of[...fe])a([...$.values()])},z=[],I=new Set,ae=t=>{let r=z.indexOf(t);r>=0&&z.splice(r,1)},L=new Map,xe=(t,r)=>{let s=L.get(t);s&&(L.delete(t),s.resolve({ops:r.filter(a=>a.batch===t),batch:t}))},K,te=[],M=(t,r=[])=>{if(t.length===0&&r.length===0)return[];if(K)return te.push({ops:t,drop:r}),[];let s=Math.min(...t.filter(g=>g.seq>A).map(g=>g.seq));if(Number.isFinite(s)&&s>A+1)return te.push({ops:t,drop:r}),pe(),[];let a=z.filter(g=>t.some(J=>J.batch===g)),u=[...new Set([...r,...a])].filter(g=>I.has(g)),m,b=z.filter(g=>!a.includes(g));try{m=x.rebase({confirmed:t,pending:b,drop:u}).confirmed}catch(g){if(!(g instanceof kn))throw g;return te.push({ops:t,drop:r}),pe(),[]}for(let g of a)ae(g);t.some(g=>g.seq>A)&&b.some(g=>!u.includes(g))&&k.rebases++,t.length>0&&(A=Math.max(A,...t.map(g=>g.seq)),oe.note(t));for(let g of u)I.delete(g);for(let g of a)xe(g,t);return m},pe=()=>{K||(K=Se(Q().then(t=>{if(ie(t)){te=[];return}let r=new Set(t.log.map(u=>u.batch)),s=z.filter(u=>r.has(u));for(let u of s)ae(u);let a=x.adopt({snapshot:t.snapshot,log:t.log,...t.horizon!==void 0?{horizon:t.horizon}:{},pending:[...z],drop:[...I].filter(u=>!z.includes(u))});I.clear();for(let u of a.pending)I.add(u.batch);A=t.log.at(-1)?.seq??(t.horizon??0)-1,oe=Et.of(t.log,{horizon:t.horizon??0}),k.resyncs++;for(let u of s)xe(u,t.log)}).then(()=>{K=void 0;let t=te;te=[];for(let{ops:r,drop:s}of t)M(r,s)},()=>{K=void 0,te=[]})))},ie=t=>(typeof t.build=="string"&&an(t.build),typeof t.version=="number"&&f(t.held),typeof t.version!="number"||t.version===F.version?!1:(vt(t.version),!0)),ce=async t=>{let s=await(await U(`${e.url}/graview/since?seq=${ft(t)}&opFormat=${We.op}`,{headers:l})).json();return ie(s)?[]:s.reset===!0?(pe(),[]):s.ops??[]},be=async()=>{let t=await He();return K&&await K,t},He=async()=>{if(T&&!G()&&R()){let r=await(await U(`${e.url}/graview/here?opFormat=${We.op}`,{method:"POST",headers:l,body:JSON.stringify({presence:T,seq:ft(A)})})).json();return ie(r)?[]:(typeof r.participant=="string"&&(Z=r.participant),N(r.who??[]),M(r.ops??[]))}return M(await ce(A))},Y=new Map,E=new Map,Ie=new Set,ne=new Map,le=new Set,Se=t=>(le.add(t),t.finally(()=>le.delete(t)).catch(()=>{}),t),_e=Promise.resolve(),De=0,ht=(t,r)=>{let s=_e.then(()=>Ue(t,r));return _e=s.catch(()=>{}),s},yt=()=>new Promise((t,r)=>C.push({again:t,give:r})),Ue=async(t,r)=>{let s,a;for(;;){try{s=await U(`${e.url}/graview/ops`,{method:"POST",headers:l,body:JSON.stringify({...t,opFormat:We.op})})}catch(g){if(!(g instanceof Ge)||X)throw g;if(await yt(),G())return Je(t,r);continue}if(a=await s.json().catch(()=>({})),s.status===503&&a.reason==="unavailable"&&typeof a.held=="string"&&!X){if(typeof a.version=="number"?ie(a):(f(a.held),!1))break;if(v!==void 0&&(kt>0||p)){if(await new Promise(g=>q.push(g)),X)throw new $e("The client closed.");if(G())return Je(t,r);continue}}let b;if(s.status===503&&a.reason==="unavailable"&&!X)b=Xt(e.backoff,De++);else{if(De=0,s.status!==429||X)break;b=Wo(s.headers.get("retry-after"),a.retryAfter)}if(await new Promise(g=>setTimeout(g,b)),G())return Je(t,r)}if(se||ie(a))throw new $e("The app was changed.");if(!s.ok){let b=a.error??`The server refused (${s.status})`;throw a.conflict?new we(b,a.conflicts??[]):new Ne({reason:a.reason??Lo[s.status]??"invalid",sentence:b,...a.wouldNeed?.length?{wouldNeed:a.wouldNeed}:{}})}let u=a.ops??[],m=u[0]?.seq;return m!==void 0&&m>A+1&&(u=await ce(A)),r!==void 0&&(a.batch&&Y.set(r,a.batch),ae(r)),M(u,r!==void 0?[r]:[]),{ops:a.ops??[],...a.batch?{batch:a.batch}:{}}},_,re=!1,X=!1,Oe=0,Pe,Ke=0,ke=0,Fe=null,me=()=>{},Ve=new Promise(t=>{me=t}),G=()=>p&&re&&_?.readyState===Vo,Ce=t=>{if(!G())return!1;try{return _.send(JSON.stringify(t)),!0}catch{return!1}},y=(t=!1)=>{!T||!G()||!R()||!t&&Fe&&Ot(T,Fe)&&(w===void 0||Date.now()-ke<w)||Ce({t:"here",presence:T})&&(Fe=T,ke=Date.now())},H=new Set,D,rn=()=>{if(D=void 0,v!==void 0)return;let t=[...L.entries()].filter(([r])=>H.has(r));H.clear();for(let[,r]of t)Ce(r.message)},on=(t,r)=>{L.has(t)&&(H.add(t),D&&clearTimeout(D),D=setTimeout(rn,Math.max(0,r)))},Ir=t=>{L.has(t)&&H.add(t)},Je=(t,r)=>new Promise((s,a)=>{let u=r??`send-${++Ke}`,m=t.undo?{t:"undo",cid:u,batches:t.undo,...t.intent?{intent:t.intent}:{},...t.batch?{batch:t.batch}:{},...t.via?{via:t.via}:{},...Re(t)}:{t:"call",cid:u,calls:t.calls??[],...t.intent?{intent:t.intent}:{},...t.batch?{batch:t.batch}:{},...t.base?.length?{base:t.base}:{},...t.via?{via:t.via}:{},...Re(t)};if(L.set(u,{message:m,...r!==void 0?{mine:r}:{},resolve:s,reject:a}),H.size>0||v!==void 0){H.add(u);return}Ce(m)}),Ye=(t,r)=>G()?Je(t,r):ht(t,r),_r=t=>{switch(t.t){case"welcome":{if(an(t.build),typeof t.version=="number"&&t.version!==F.version){vt(t.version);return}if(re=!0,Oe=0,typeof t.participant=="string"&&(Z=t.participant),f(t.held),t.state?pe():M(t.ops??[]),H.clear(),D&&clearTimeout(D),D=void 0,v!==void 0)for(let r of L.keys())H.add(r);else for(let r of L.values())Ce(r.message);y(!0),ee("online"),me();return}case"ops":M(t.ops??[]);return;case"ack":{let r=L.get(t.cid);if(!r){M(t.ops??[]);return}L.delete(t.cid),De=0,r.mine!==void 0&&(Y.set(r.mine,t.batch),ae(r.mine)),M(t.ops??[],r.mine!==void 0?[r.mine]:[]),r.resolve({ops:t.ops??[],batch:t.batch});return}case"refused":case"conflict":{let r=L.get(t.cid);if(!r)return;if(t.t==="refused"&&t.reason==="unavailable"){v!==void 0?Ir(t.cid):on(t.cid,Xt(e.backoff,De++));return}L.delete(t.cid),r.reject(t.t==="conflict"?new we(t.sentence,t.conflicts??[]):new Ne({reason:t.reason??"invalid",sentence:t.sentence,...t.wouldNeed?.length?{wouldNeed:[...t.wouldNeed]}:{}}));return}case"busy":typeof t.cid=="string"&&on(t.cid,typeof t.retryAfter=="number"?t.retryAfter:1e3);return;case"presence":N(t.who??[]);return;case"held":f(t.sentence);return;case"declaration":typeof t.version=="number"&&t.version!==F.version&&vt(t.version);return;case"reload":ln(typeof t.reason=="string"?t.reason:"This app was updated.");return;case"error":if(t.reopen===!0&&_){let r=_;fn(r);try{r.close(1e3,"Opening again.")}catch{}}return;default:return}},se=!1,gt=i.declarations,wt=i.builds,an=t=>{if(!(se||i.otherBuild!==void 0||!e.build||typeof t!="string"||t.length===0||t===e.build)){i.otherBuild=t;for(let r of[...wt])r(t)}},sn=()=>{let t=[],r=0;for(let s of z){let a=ne.get(s);a?t.push({calls:a.calls,...a.intent?{intent:a.intent}:{},...a.via?{via:a.via}:{},...Re(a),batch:s}):r++}return{carried:t,undos:r}},dn=(t,r)=>`${r} while ${t===1?"an undo of yours was":"undos of yours were"} on the way; ${t===1?"it was":"they were"} not made.`,cn=t=>{se=!0,T=null;let r=new $e(t);for(let a of L.values())a.reject(r);L.clear(),Xe&&clearInterval(Xe),X=!0,Pe&&clearTimeout(Pe),D&&clearTimeout(D),he&&clearTimeout(he);for(let a of C.splice(0))a.give(r);for(let a of q.splice(0))a();let s=_;_=void 0,re=!1;try{s?.close(1e3,t)}catch{}me()};async function vt(t){if(se)return;if(!e.resolveApp){ln(`This app was changed on its server (version ${t}); reload the page to carry on.`);return}let{carried:r,undos:s}=sn(),a=e.resolveApp,u=T;cn("The app was changed.");try{let m=await a(t),{state:b,...g}=e,J=await Wr({...g,app:m},r,"The app was changed while your changes were on the way.",i);u&&J.remote.presence.here(u);for(let et of[...gt])et(J.remote,t);let Yr=[...s>0?[Qe(dn(s,"The app was changed"))]:[],...J.unheard()];for(let et of Yr)for(let Qr of Be)Qr(et.sentence,et)}catch(m){let b=`The app was changed, but the new version could not be opened: ${m instanceof Error?m.message:String(m)}`;for(let g of Be)g(b,Qe(b))}}function ln(t){if(se)return;let{carried:r,undos:s}=sn();cn(t);let a=!1;if(e.carry&&r.length>0)try{e.carry.storage.setItem(e.carry.key,JSON.stringify(r)),a=!0}catch{}let u=[];!a&&r.length>0&&u.push(`${t} ${r.length===1?"A change of yours was":`${r.length} changes of yours were`} not sent; make ${r.length===1?"it":"them"} again after the page reloads.`),s>0&&u.push(dn(s,"This app was updated"));for(let m of u)for(let b of Be)b(m,Qe(m));(e.reloadPage??$o)()}let un=()=>{if(X||!p)return;let t=`${e.url.replace(/^http/,"ws").replace(/\/$/,"")}${Br}`,{"content-type":r,...s}=l,a;try{a=e.socket?e.socket(t,s,[Zt]):Jr(t,s)}catch{return pn()}_=a,re=!1,a.onopen=()=>{_===a&&a.send(JSON.stringify({t:"hello",seq:ft(A),protocol:tt,wire:Qt,opFormat:We.op,...e.build?{build:e.build.slice(0,64)}:{},...e.hostProtocol!==void 0?{hostProtocol:e.hostProtocol}:{}}))},a.onmessage=u=>{if(_!==a)return;let m;try{m=JSON.parse(String(u.data))}catch{return}_r(m)},a.onclose=()=>fn(a),a.onerror=()=>{}},he,jr=()=>{ve=!1,he&&clearTimeout(he),he=setTimeout(()=>{if(he=void 0,ve||X)return;let t=new Map([...$].filter(([,r])=>r.held!=="socket"));if(t.size!==$.size){$=t;for(let r of fe)r([...$.values()])}},xt),he.unref?.()};function fn(t){if(_!==t)return;let r=re;_=void 0,re=!1,Fe=null,r&&(ee("offline"),jr()),pn()}let pn=()=>{if(X)return;let t=Xt(e.backoff,Oe);Oe++,Pe=setTimeout(un,t)},mn=x.applyAll.bind(x),qr=x.undo.bind(x),zr=x.previewAll.bind(x);x.previewAll=(t,r)=>zr(t,{...e.principal?{author:e.principal}:{},...r});let Be=i.refusals,je=[],Qe=t=>({reason:"invalid",sentence:t}),Ze=i.conflicts,bt=!1,hn,St=async(t,r)=>{if(r instanceof $e||se)return;let s=r instanceof Ne?r.refusal:vn(r),a=s.sentence,u=r instanceof we?hn?.yoursOf(x,ne.get(t)?.calls??[]):void 0;ae(t);try{M([],[t])}catch{}let m=ne.get(t);if(ne.delete(t),r instanceof we&&k.conflicts++,r instanceof we&&!G()&&await be().catch(()=>[]),r instanceof we&&K&&await K,r instanceof we&&Ze.size>0){let b=!1,g={sentence:a,conflicts:u?r.conflicts.map(J=>J.node===u.node&&J.field===u.field?{...J,yours:u.yours}:J):r.conflicts,keepTheirs(){b=!0},useMine(){if(!(b||!m)){b=!0,bt=!0;try{x.applyAll(u?[u.over(A)]:m.calls,{...m.intent?{intent:m.intent}:{},...m.via?{via:m.via}:{},...Re(m)})}finally{bt=!1}}}};for(let J of Ze)J(g);return}for(let b of Be)b(a,s)},Gr=(t,r)=>t.flatMap(s=>s.mutation?.name===wn?[]:s.primitives.flatMap(a=>a.op==="splice-text"&&!r.has(a.id)&&!r.has(`${a.id}\0${a.field}`)?[{node:a.id,field:a.field,rev:A}]:[]));x.applyAll=(t,r)=>{let s=bn(x.log.all().filter(b=>I.has(b.batch))),a=mn(t,{...e.principal?{author:e.principal}:{},...r}),u=t.map((b,g)=>{let J=a.minted?.[g];return J===void 0||b.args?.id!==void 0?b:{...b,mintedHint:J}});z.push(a.batch),I.add(a.batch),ne.set(a.batch,{calls:u,...r?.intent?{intent:r.intent}:{},...r?.via?{via:r.via}:{},...Re(r)});let m=bt?[]:[...oe.baseFor(a.ops,s,(b,g)=>x.collaborative(b,g)),...Gr(a.ops,s)];return E.set(a.batch,Se(Ye({calls:u,...r?.intent?{intent:r.intent}:{},batch:a.batch,...m.length>0?{base:m}:{},...r?.via?{via:r.via}:{},...Re(r)},a.batch).catch(b=>St(a.batch,b)))),a},x.apply=(t,r)=>x.applyAll([t],r),x.undo=(t,r)=>{let s=typeof t=="string"?[t]:t,a=qr(s.map(m=>Y.get(m)??m),{...e.principal?{author:e.principal}:{},...r});z.push(a.batch),I.add(a.batch);let u=Promise.allSettled(s.map(m=>E.get(m)));return E.set(a.batch,Se(u.then(()=>{let m=s.filter(b=>!Ie.has(b));if(m.length===0){ae(a.batch),ne.delete(a.batch),M([],[a.batch]);return}return Ye({undo:m.map(b=>Y.get(b)??b),...r?.intent?{intent:r.intent}:{},batch:a.batch,...r?.via?{via:r.via}:{},...Re(r)},a.batch)}).catch(m=>St(a.batch,m)))),a};let Ur=async(t,r={})=>{Pt++;try{return(await Se(Ye({calls:t,...r}))).ops}finally{Pt--}},Pt=0,yn={here(t){T=t,y()},onWho(t){return fe.add(t),$.size>0&&t([...$.values()]),()=>{fe.delete(t)}},leave(){if(!T)return;let t=JSON.stringify({participant:Z??T.participant});if(T=null,Ce({t:"bye"}))return;let r=globalThis.navigator?.sendBeacon;r?r.call(globalThis.navigator,`${e.url}/graview/leave`,t):d(`${e.url}/graview/leave`,{method:"POST",headers:l,body:t}).catch(()=>{})}},kt=e.pollMs??800,Xe=kt>0&&typeof setInterval=="function"?setInterval(()=>{G()||be().catch(()=>{})},kt):null;if(p){un();let t;await Promise.race([Ve,new Promise(r=>t=setTimeout(r,e.openTimeoutMs??3e3))]),clearTimeout(t)}if(n.length>0&&!se){let t=[],r=new Set(x.log.all().map(s=>s.batch));for(let s of n)if(!(s.batch!==void 0&&r.has(s.batch)))try{x.applyAll(s.calls,{...s.intent?{intent:s.intent}:{},...s.batch?{batch:s.batch}:{},...s.via?{via:s.via}:{},...Re(s)})}catch(a){t.push(Fo(s,a))}t.length>0&&je.push(Qe(`${o} ${t.length===1?"One no longer fits and was not made":`${t.length} no longer fit and were not made`}: ${t.join("; ")}.`))}let gn=new Map,Kr=()=>({store:x,author:e.principal,appliedAll:mn,pending:z,provisional:I,asked:ne,answers:E,letGo:Ie,sent:(t,r)=>Se(Ye({calls:r,batch:t},t).catch(s=>St(t,s))),settle:ae,land:M,seen:()=>A,gone:()=>X||se});return{remote:{store:x,typing(t,r){let s=`${t}\0${r}`,a=gn.get(s);return a||(a=(__graviewPreload(import.meta.url,["./chunk.JTOAZ2IR.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.6TILXTP6.js")).then(u=>(hn=u,u.typingOf(t,r,u.wireOf(Kr())))),gn.set(s,a)),a},version:F.version,migrated:F.migrated??[],send:Ur,pull:be,onRefusal(t){Be.add(t);let r=je;je=[];for(let s of r)t(s.sentence,s);return()=>Be.delete(t)},onDeclaration(t){return gt.add(t),()=>gt.delete(t)},onBuild(t){return wt.add(t),i.otherBuild!==void 0&&t(i.otherBuild),()=>wt.delete(t)},onConflict(t){return Ze.add(t),()=>Ze.delete(t)},revision:(t,r)=>oe.of(t,r),seq:()=>A,participant:()=>Z,transport:()=>G()?"socket":"poll",status:de,onStatus(t){return P.add(t),()=>P.delete(t)},held:()=>v,onHeld(t){return i.helds.add(t),v!==void 0&&t(v),()=>i.helds.delete(t)},counters:()=>({...k}),who:()=>[...$.values()],pending:()=>z.length+Pt,async settled(){for(;le.size>0;)await Promise.allSettled([...le])},presence:yn,close(){Xe&&clearInterval(Xe),Te(),yn.leave(),X=!0,Pe&&clearTimeout(Pe),D&&clearTimeout(D),he&&clearTimeout(he);for(let r of C.splice(0))r.give(new Error("The client closed before the server could be reached."));for(let r of q.splice(0))r();let t=_;_=void 0,re=!1;try{t?.close(1e3,"Closed.")}catch{}}},unheard(){let t=je;return je=[],t}};function Jr(t,r){let s=globalThis.WebSocket;if(!s)throw new Error("This runtime has no WebSocket; the client polls instead.");let a=typeof globalThis.document<"u",u=e.subprotocol?[Zt]:[];if(!a)try{return new s(t,{headers:r,...u.length>0?{protocols:u}:{}})}catch{}let m=new URL(t);for(let[b,g]of Object.entries(S))m.searchParams.set(b,g);return u.length>0?new s(m.toString(),u):new s(m.toString())}}function Wo(e,n,o=Date.now()){let i,d=e?.trim();if(d)if(/^\d+(\.\d+)?$/.test(d))i=Number(d)*1e3;else{let p=Date.parse(d);Number.isFinite(p)&&(i=Math.max(0,p-o))}let l=typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0,S=l!==void 0&&l<50&&i!==void 0&&Math.abs(l*1e3-i)<1e3;return l!==void 0&&!S?l:i??1e3}function $o(){globalThis.location?.reload?.()}function No(){return globalThis.document?.visibilityState!=="hidden"}function Xt(e,n){if(typeof e=="function")return Math.max(0,e(n));let{min:o=250,max:i=1e4,factor:d=2}=e??{};return Math.min(i,o*d**n)*(.75+Math.random()*.5)}function mt(e){let n={};if(!e)return n;e.id&&(n[ge.seat]=e.id),e.roles?.length&&(n[ge.roles]=e.roles.join(",")),e.kind!=="human"&&(n[ge.kind]=e.kind),e.name&&(n[ge.name]=encodeURIComponent(e.name));let o=e.onBehalfOf;return o?.id&&(n[ge.for]=o.id),o?.roles?.length&&(n[ge.forRoles]=o.roles.join(",")),o?.name&&(n[ge.forName]=encodeURIComponent(o.name)),n}var $r="/graview/views";function en(e){let n=e.fetch??fetch,o=e.url.replace(/\/$/,""),i={"content-type":"application/json",...e.principal?mt(e.principal):{},...e.headers??{}},d=e.state?{hidden:e.state.hidden??[],removed:e.state.removed??[],may:e.state.may??nt.may}:nt,l=new Set,S=P=>{if(JSON.stringify(P)!==JSON.stringify(d)){d=P;for(let k of l)k()}},p=async(P,k)=>{let C=await n(`${o}${e.path??$r}`,{method:P,headers:i,...k!==void 0?{body:JSON.stringify(k)}:{}}),v=await C.json();if(!C.ok)throw new Error(v.error??`The store answered ${C.status}.`);S({hidden:v.hidden??[],removed:v.removed??[],may:v.may??nt.may})},w=()=>p("GET"),R=e.state?Promise.resolve():w().catch(()=>{}),O=e.pollMs?setInterval(()=>void w().catch(()=>{}),e.pollMs):void 0;return{ready:R,refresh:w,close:()=>clearInterval(O),current:()=>d,onChange(P){return l.add(P),()=>void l.delete(P)},hide:P=>p("POST",{hide:P}),show:P=>p("POST",{show:P}),remove:(P,k)=>p("POST",{remove:P,...k?{about:k}:{}}),async restore(P){let k=d.removed.find(C=>C.name===P)?.lens;await p("POST",{restore:P}),k&&await e.onDeclaration?.()},async lens(P){await p("POST",{lens:P}),await e.onDeclaration?.()}}}var nn=document.getElementById("graview-app"),tn=/^\/forms\/([^/]+)\/?$/.exec(location.pathname),Nr=tn?(__graviewPreload(import.meta.url,["./chunk.K2J26XMB.js","./chunk.3G5DEGFA.js","./chunk.XOZU4OFA.js","./chunk.AG7CUSSV.js","./chunk.ZBHFCSKO.js","./chunk.7TMWMW4W.js","./chunk.5ZWE72VJ.js","./chunk.RLO3RDYH.js","./chunk.TUNHUTQ5.js","./chunk.3JMZHCB4.js","./chunk.SF4BYBH6.js","./chunk.SDO3U72B.js","./chunk.3MZIWKNG.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.3SOJJAMY.js")):Me("pages");try{tn?await Io(decodeURIComponent(tn[1])):await _o()}catch(e){let n=document.createElement("pre");n.setAttribute("role","alert"),n.style.cssText="margin:2rem;font:14px/1.5 ui-monospace,monospace;white-space:pre-wrap",n.textContent=e instanceof Error?e.message:String(e),nn.replaceChildren(n),window.__graviewFailed=n.textContent}async function Io(e){let n=await fetch(`/graview/document?form=${encodeURIComponent(e)}`),o=await n.json();if(!n.ok)throw new Error(o.error??`The preview server did not hand over the form (${n.status}).`);let i=await st(o);if(!i.ok)throw new Error(rt(i.findings));let d=i.app,l=o.principal,S=await pt({app:d,url:location.origin,principal:l,...o.state?{state:o.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=d.forms?.[e]?.title??d.name;let{mount:p}=await Nr;window.__graview=p(nn,{app:d,form:e,principal:l,remote:S,height:"100dvh",onSubmitted:()=>window.__graviewSubmitted=!0}),window.__graviewReady=!0}async function _o(){let e=await fetch("/graview/document");if(!e.ok)throw new Error(`The preview server did not hand over the document (${e.status}).`);let n=await e.json(),i=await(async w=>{if(typeof w.module=="string")return(await import(w.module)).app;let R=await st(w);if(!R.ok)throw new Error(rt(R.findings));return R.app})(n);if(!i||typeof i!="object"||!("schema"in i))throw new Error("The app module the preview server handed does not export an app.");let d=n.principal,l=await pt({app:i,url:location.origin,principal:d,live:!0,subprotocol:!0,pollMs:1200,...n.state?{state:n.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=i.name;let S,p=en({url:location.origin,principal:d,...n.views?{state:n.views}:{},onDeclaration:async()=>{let w=await(await fetch("/graview/document")).json();if(typeof w.module=="string")return;let R=await st(w);R.ok&&S?.setApp(R.app,l)}});await Promise.all([Nr,p.ready]),S=Yt(nn,{app:i,remote:l,principal:d,studio:!1,face:"pages",routing:"address",bar:!0,height:"100dvh",label:i.name,heading:1,keptViews:p,...n.draftView?{draftView:n.draftView}:{}}),window.__graview=S,S.drawn().then(()=>{window.__graviewReady=!0})}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graview",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
4
4
  "type": "module",
5
5
  "description": "The Graview command line: start a product, check its declaration, write its agent docs, serve its store, preview a document with no product and photograph its places, say whether a product is on one release, host it for an agent over MCP, apply an act to it, sync its seed, install the authoring skills. The tool; @graview/* is the framework.",
6
6
  "keywords": [
@@ -29,11 +29,11 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@graview/guest": "0.1.53",
33
- "@graview/ship": "0.1.53",
34
- "@graview/skills": "0.1.53",
35
- "@graview/core": "0.1.53",
36
- "@graview/tools": "0.1.53"
32
+ "@graview/core": "0.1.54",
33
+ "@graview/guest": "0.1.54",
34
+ "@graview/skills": "0.1.54",
35
+ "@graview/tools": "0.1.54",
36
+ "@graview/ship": "0.1.54"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=22"
@@ -1 +0,0 @@
1
- import{a}from"./chunk.KCM2VOC7.js";import"./chunk.G226CUJQ.js";import"./chunk.BG2SC77J.js";import"./chunk.NAEEPUWJ.js";import"./chunk.AQJD23AN.js";import"./chunk.XBNASVTY.js";import"./chunk.52Y37IAD.js";import"./chunk.Y4VOCJ7R.js";import{b as n}from"./chunk.6ESAZJBN.js";import"./chunk.OZYZBRWO.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.TTFYXKLI.js";import"./chunk.OJGHDWI6.js";import"./chunk.ICYJ7QJG.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{T as i}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function g({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{g as RecordInteractions};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk.HIDLE6BN.js";import"./chunk.YI7WHBAD.js";import"./chunk.T56SOSIR.js";import"./chunk.JRU5BT7K.js";import"./chunk.UGFDSE37.js";import{l as s}from"./chunk.EG2N5F6L.js";import"./chunk.PXQVXBNG.js";import"./chunk.7NFCI4LH.js";import"./chunk.RUTZEEBR.js";import"./chunk.GZWC72HS.js";import"./chunk.ASCTAUFD.js";import"./chunk.CWPRQSED.js";import"./chunk.EZXGVTT2.js";import"./chunk.ULTYDYTS.js";import"./chunk.2LQ37DC2.js";import"./chunk.UXNZPPWR.js";import"./chunk.GYO57LKD.js";import"./chunk.KWMBRB6O.js";import"./chunk.G226CUJQ.js";import"./chunk.AQJD23AN.js";import"./chunk.R3DWF35R.js";import"./chunk.XBNASVTY.js";import"./chunk.6S3B4XC4.js";import"./chunk.52Y37IAD.js";import"./chunk.TLQTDKOL.js";import"./chunk.4DCPB67O.js";import"./chunk.Y4VOCJ7R.js";import"./chunk.XOZU4OFA.js";import"./chunk.IYVBJDR7.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VTCPA4V4.js";import"./chunk.FGJM4LJO.js";import"./chunk.K7WME4P4.js";import"./chunk.MDIAWTNK.js";import"./chunk.PEA4D66Y.js";import"./chunk.TRPPN2GD.js";import"./chunk.GZHZLJBF.js";import"./chunk.TTFYXKLI.js";import"./chunk.OJGHDWI6.js";import"./chunk.ICYJ7QJG.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{G as y,T as i}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
@@ -1 +0,0 @@
1
- import{i as n}from"./chunk.GZWC72HS.js";import"./chunk.ASCTAUFD.js";import"./chunk.CWPRQSED.js";import"./chunk.EZXGVTT2.js";import"./chunk.2LQ37DC2.js";import"./chunk.UXNZPPWR.js";import"./chunk.GYO57LKD.js";import"./chunk.R3DWF35R.js";import"./chunk.XBNASVTY.js";import"./chunk.6S3B4XC4.js";import"./chunk.52Y37IAD.js";import"./chunk.TLQTDKOL.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.VTCPA4V4.js";import"./chunk.FGJM4LJO.js";import"./chunk.K7WME4P4.js";import"./chunk.MDIAWTNK.js";import"./chunk.PEA4D66Y.js";import"./chunk.TRPPN2GD.js";import"./chunk.GZHZLJBF.js";import"./chunk.TTFYXKLI.js";import"./chunk.OJGHDWI6.js";import"./chunk.ICYJ7QJG.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{T as m}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function s(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{s as homeView};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.7R6GXJS4.js";import"./chunk.G4JJXA63.js";import"./chunk.MSPRCR3Q.js";import"./chunk.CSA6SWTI.js";import"./chunk.3FUFVVR4.js";import"./chunk.XOZU4OFA.js";import"./chunk.IYVBJDR7.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.P2W727C7.js";import"./chunk.XXCT6DLX.js";import"./chunk.TXEWSZGO.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VTCPA4V4.js";import"./chunk.FGJM4LJO.js";import"./chunk.K7WME4P4.js";import"./chunk.MDIAWTNK.js";import"./chunk.PEA4D66Y.js";import"./chunk.TRPPN2GD.js";import"./chunk.MT45H2T5.js";import"./chunk.S2ATSY6P.js";import"./chunk.72Q4R7N6.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.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
- 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{G as k,Ga as o,T as n}from"./chunk.B3T4N2XM.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.VTCPA4V4.js","./chunk.FGJM4LJO.js","./chunk.K7WME4P4.js","./chunk.MDIAWTNK.js","./chunk.PEA4D66Y.js","./chunk.TRPPN2GD.js","./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.5E4UGVAD.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.5K5D4IMM.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.TTFYXKLI.js","./chunk.OJGHDWI6.js","./chunk.ICYJ7QJG.js","./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.UQ4CASST.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MT45H2T5.js","./chunk.S2ATSY6P.js","./chunk.72Q4R7N6.js","./chunk.G6DISMVT.js","./chunk.W54NXXC5.js","./chunk.B3T4N2XM.js","./chunk.SDO3U72B.js","./chunk.6W2DUW5S.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.7BXOQEUP.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,E as d,W as e,M as f,N as g};