graview 0.1.52 → 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.
- package/dist/preview/chunk.25P5SDNR.js +1 -0
- package/dist/preview/chunk.27O4LIDU.js +1 -0
- package/dist/preview/{chunk.RWCWRJJC.js → chunk.2DFWOLL2.js} +1 -1
- package/dist/preview/{chunk.R6FHEEJ7.js → chunk.2LMB5E6N.js} +1 -1
- package/dist/preview/chunk.2WSRJGW2.js +1 -0
- package/dist/preview/{chunk.IVI3HRSF.js → chunk.33YC5RCB.js} +1 -1
- package/dist/preview/chunk.3G5DEGFA.js +1 -0
- package/dist/preview/{chunk.73EKJ4JN.js → chunk.3IEJQAK7.js} +1 -1
- package/dist/preview/chunk.3JMZHCB4.js +293 -0
- package/dist/preview/chunk.3MZIWKNG.js +5 -0
- package/dist/preview/{chunk.FLNYLE6S.js → chunk.3SOJJAMY.js} +1 -1
- package/dist/preview/{chunk.QRCTTDDQ.js → chunk.3V2WXZU3.js} +1 -1
- package/dist/preview/{chunk.R77TACXU.js → chunk.3ZONBC6L.js} +1 -1
- package/dist/preview/{chunk.SZCZD2GM.js → chunk.45HTFSWD.js} +1 -1
- package/dist/preview/chunk.463PGKOL.js +35 -0
- package/dist/preview/chunk.4BX3KLAA.js +1 -0
- package/dist/preview/chunk.4F5M5XZG.js +1 -0
- package/dist/preview/{chunk.ZK42LPF5.js → chunk.4GHXAWIE.js} +1 -1
- package/dist/preview/chunk.4KTHJY5N.js +19 -0
- package/dist/preview/{chunk.ULAMIQ52.js → chunk.4TGQ6Z6E.js} +1 -1
- package/dist/preview/{chunk.VKOCD5CL.js → chunk.4V64RBCK.js} +1 -1
- package/dist/preview/{chunk.I2W7HSBU.js → chunk.4WH4N4V7.js} +1 -1
- package/dist/preview/{chunk.NAPTE3S6.js → chunk.562IVJHX.js} +1 -1
- package/dist/preview/chunk.57VTD3CU.js +1 -0
- package/dist/preview/{chunk.JQBP6QWQ.js → chunk.5C43AM3X.js} +1 -1
- package/dist/preview/chunk.5M62CMLA.js +1 -0
- package/dist/preview/chunk.5RH6FO3K.js +1 -0
- package/dist/preview/chunk.5VF2RT4H.js +1 -0
- package/dist/preview/chunk.5XAIP3BS.js +1 -0
- package/dist/preview/{chunk.CV4QA4ZF.js → chunk.5ZWE72VJ.js} +1 -1
- package/dist/preview/{chunk.NB6WN4DO.js → chunk.644FUGSX.js} +1 -1
- package/dist/preview/chunk.6BBB7SJL.js +1 -0
- package/dist/preview/chunk.6SPORDJC.js +1 -0
- package/dist/preview/{chunk.C4UNAJWC.js → chunk.6TILXTP6.js} +1 -1
- package/dist/preview/{chunk.7UXDIEPK.js → chunk.7JCUSYS5.js} +1 -1
- package/dist/preview/{chunk.NHIPVAGR.js → chunk.7SCENHVG.js} +1 -1
- package/dist/preview/{chunk.HSGUXMAO.js → chunk.7TMWMW4W.js} +1 -1
- package/dist/preview/{chunk.3TME4BG3.js → chunk.7UD2JR6J.js} +1 -1
- package/dist/preview/{chunk.C7EEYSAM.js → chunk.AG7CUSSV.js} +1 -1
- package/dist/preview/{chunk.INL4OZI7.js → chunk.AKLVSZ5A.js} +1 -1
- package/dist/preview/chunk.AN5QCSVK.js +1 -0
- package/dist/preview/chunk.ARRLAAG6.js +1 -0
- package/dist/preview/{chunk.7354O67H.js → chunk.AZGXBTOQ.js} +1 -1
- package/dist/preview/{chunk.FJC6PMOG.js → chunk.B2X6DA2Q.js} +4 -4
- package/dist/preview/chunk.B3WVCSW5.js +1 -0
- package/dist/preview/chunk.B6PKKEY3.js +1 -0
- package/dist/preview/{chunk.VGTEEANA.js → chunk.BOMYLOCX.js} +1 -1
- package/dist/preview/chunk.BPWSQVEN.js +1 -0
- package/dist/preview/{chunk.I43ONAEL.js → chunk.BUDEUNBN.js} +1 -1
- package/dist/preview/chunk.C3AHDHX7.js +1 -0
- package/dist/preview/{chunk.FEBCIEI3.js → chunk.C6HBYRGJ.js} +1 -1
- package/dist/preview/chunk.C6HI3LRB.js +1 -0
- package/dist/preview/{chunk.7XJ3XQZD.js → chunk.CB5DGKR5.js} +1 -1
- package/dist/preview/{chunk.2K3YQJW3.js → chunk.CB7IUKY7.js} +2 -2
- package/dist/preview/{chunk.GZHEGKPF.js → chunk.COWJTVZV.js} +1 -1
- package/dist/preview/{chunk.5DDHFNZM.js → chunk.D2PJG5N7.js} +1 -1
- package/dist/preview/chunk.D6ACCKYJ.js +1 -0
- package/dist/preview/{chunk.CBGKWYGI.js → chunk.DF7IPT7V.js} +2 -2
- package/dist/preview/{chunk.R7CRV2FE.js → chunk.DTJ4FIHM.js} +1 -1
- package/dist/preview/chunk.DVG47BK3.js +1 -0
- package/dist/preview/{chunk.LTJYKQJG.js → chunk.E5JX5LWY.js} +1 -1
- package/dist/preview/chunk.EC7I33WI.js +1 -0
- package/dist/preview/chunk.F5RN6YXG.js +4 -0
- package/dist/preview/chunk.FCZ7UFJI.js +1 -0
- package/dist/preview/chunk.FMP6NDRZ.js +1 -0
- package/dist/preview/{chunk.OS3WZV6C.js → chunk.FRZQSSGE.js} +2 -2
- package/dist/preview/chunk.FWKNR7XF.js +4 -0
- package/dist/preview/chunk.FWZF7X6A.js +67 -0
- package/dist/preview/{chunk.BHPZK4WJ.js → chunk.GHPCSNM6.js} +2 -2
- package/dist/preview/{chunk.52J42KR5.js → chunk.GKLDSHHH.js} +1 -1
- package/dist/preview/{chunk.7UJZP3YK.js → chunk.GVUJCOKD.js} +2 -2
- package/dist/preview/chunk.HLDMTKUP.js +1 -0
- package/dist/preview/{chunk.DGWNVDZB.js → chunk.IDYPQ45A.js} +1 -1
- package/dist/preview/{chunk.RBWYXVUW.js → chunk.IMHUKSPM.js} +2 -2
- package/dist/preview/chunk.IYYP6QUH.js +1 -0
- package/dist/preview/chunk.J2Z6WLCH.js +88 -0
- package/dist/preview/chunk.J3OX474P.js +1 -0
- package/dist/preview/chunk.JCFYZEMY.js +1 -0
- package/dist/preview/chunk.JLB4QP6Q.js +1 -0
- package/dist/preview/{chunk.R7ZZJOJW.js → chunk.JTOAZ2IR.js} +1 -1
- package/dist/preview/chunk.JXGDVJ4N.js +1 -0
- package/dist/preview/{chunk.D62V3TBW.js → chunk.K2J26XMB.js} +2 -2
- package/dist/preview/{chunk.J6IB2HUZ.js → chunk.KI6M3EWZ.js} +1 -1
- package/dist/preview/{chunk.LESRQN3Y.js → chunk.KJGNLWU3.js} +2 -2
- package/dist/preview/chunk.KLJDBYAZ.js +1 -0
- package/dist/preview/{chunk.XLM4ONUB.js → chunk.KRVEAIKW.js} +1 -1
- package/dist/preview/{chunk.KVEDMKUN.js → chunk.KY7QD22S.js} +1 -1
- package/dist/preview/{chunk.J2R55TM7.js → chunk.L7MFTL5S.js} +1 -1
- package/dist/preview/chunk.LNOWO3IY.js +2 -0
- package/dist/preview/{chunk.DXZ5VYCQ.js → chunk.LOUICR7K.js} +1 -1
- package/dist/preview/{chunk.NVNQSZ43.js → chunk.LU3B3SZH.js} +1 -1
- package/dist/preview/chunk.LVOL2LEC.js +1 -0
- package/dist/preview/chunk.LYFEGG6E.js +1 -0
- package/dist/preview/chunk.MAWP27FD.js +28 -0
- package/dist/preview/chunk.MDWCX3YU.js +1 -0
- package/dist/preview/chunk.MNW2ZBQ6.js +1 -0
- package/dist/preview/{chunk.7KZ44FEU.js → chunk.MPMROUZA.js} +1 -1
- package/dist/preview/{chunk.BJL6EL6B.js → chunk.MVRNEC3Y.js} +1 -1
- package/dist/preview/chunk.NDI5OWIB.js +1 -0
- package/dist/preview/chunk.NEJSKMJV.js +2 -0
- package/dist/preview/{chunk.N7D5LKBI.js → chunk.NGWHV4G6.js} +1 -1
- package/dist/preview/{chunk.T2Q3AAQI.js → chunk.OCV46AFN.js} +1 -1
- package/dist/preview/{chunk.7IOC6U3C.js → chunk.OLKFEHWB.js} +1 -1
- package/dist/preview/{chunk.GL3YVGAP.js → chunk.OZ4EJ5M6.js} +2 -2
- package/dist/preview/chunk.PCNEM3WE.js +1 -0
- package/dist/preview/chunk.PR2TSHE7.js +9 -0
- package/dist/preview/{chunk.C4EPMV7O.js → chunk.PZ4G5QA5.js} +1 -1
- package/dist/preview/{chunk.YKACMLLU.js → chunk.PZWJUQAO.js} +1 -1
- package/dist/preview/{chunk.7FZY5E2U.js → chunk.Q6RUTFU3.js} +1 -1
- package/dist/preview/chunk.QB7RYJ67.js +5 -0
- package/dist/preview/{chunk.P5PXWOHI.js → chunk.R7RDUW37.js} +1 -1
- package/dist/preview/{chunk.XZLKTOJE.js → chunk.RBYRT2I2.js} +1 -1
- package/dist/preview/{chunk.6CY3EA6U.js → chunk.RCFAHV5N.js} +1 -1
- package/dist/preview/{chunk.OYRZ2DEI.js → chunk.RLO3RDYH.js} +1 -1
- package/dist/preview/chunk.RYMSHMLM.js +1 -0
- package/dist/preview/chunk.SDO3DD77.js +6 -0
- package/dist/preview/chunk.SF4BYBH6.js +25 -0
- package/dist/preview/chunk.SG7YVKH4.js +1 -0
- package/dist/preview/chunk.T42H5RXN.js +1 -0
- package/dist/preview/{chunk.7EA7THSM.js → chunk.TUNHUTQ5.js} +1 -1
- package/dist/preview/chunk.U7GN6UPR.js +1 -0
- package/dist/preview/{chunk.QWQBPJ4U.js → chunk.ULSN3ASK.js} +1 -1
- package/dist/preview/chunk.V6X3U3JF.js +1 -0
- package/dist/preview/chunk.VFMC45E7.js +1 -0
- package/dist/preview/{chunk.3FKP32RG.js → chunk.VGOWGOGD.js} +2 -2
- package/dist/preview/chunk.VTO6UWUP.js +1 -0
- package/dist/preview/chunk.VW6X53E7.js +1 -0
- package/dist/preview/chunk.VWQ57LTT.js +18 -0
- package/dist/preview/chunk.VYKEIKY5.js +1 -0
- package/dist/preview/{chunk.EIWTZC4A.js → chunk.W6NCLU5Y.js} +1 -1
- package/dist/preview/{chunk.KFTZLNHY.js → chunk.WHGEDJB2.js} +19 -14
- package/dist/preview/{chunk.J263VQF5.js → chunk.WICMCZ27.js} +1 -1
- package/dist/preview/{chunk.QPP3OJVR.js → chunk.WVWXNW74.js} +2 -2
- package/dist/preview/chunk.XBDFXFWM.js +1 -0
- package/dist/preview/chunk.XE72DFBV.js +13 -0
- package/dist/preview/{chunk.LSL25VXW.js → chunk.XTT6ERI3.js} +1 -1
- package/dist/preview/{chunk.KPUX27ZT.js → chunk.XZJ6XX5I.js} +1 -1
- package/dist/preview/chunk.Y2DFDMT6.js +1 -0
- package/dist/preview/{chunk.G7XKQNOL.js → chunk.Y36MLVMT.js} +1 -1
- package/dist/preview/chunk.Y36WSKL5.js +1 -0
- package/dist/preview/chunk.YXRKZMS5.js +1 -0
- package/dist/preview/chunk.Z6O7RUSR.js +1 -0
- package/dist/preview/chunk.ZAGP3OKY.js +1 -0
- package/dist/preview/{chunk.M33LUF3Q.js → chunk.ZBHFCSKO.js} +1 -1
- package/dist/preview/{chunk.Y37DXEHG.js → chunk.ZDDWXRPK.js} +1 -1
- package/dist/preview/{chunk.5WU2UTP7.js → chunk.ZUBC3UFG.js} +1 -1
- package/dist/preview/{chunk.7FMS57QO.js → chunk.ZYW7Q5EN.js} +1 -1
- package/dist/preview/index.html +50 -51
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2EB7COX5.js +0 -1
- package/dist/preview/chunk.2X3UZJWI.js +0 -1
- package/dist/preview/chunk.337JMOTL.js +0 -1
- package/dist/preview/chunk.3ZQAPPJ5.js +0 -18
- package/dist/preview/chunk.4LI73QOY.js +0 -6
- package/dist/preview/chunk.4VI3EYDL.js +0 -1
- package/dist/preview/chunk.4ZLCMATU.js +0 -2
- package/dist/preview/chunk.5LWPNOJA.js +0 -1
- package/dist/preview/chunk.63SRVTG2.js +0 -19
- package/dist/preview/chunk.6BA6RUK7.js +0 -1
- package/dist/preview/chunk.6JERQFZI.js +0 -1
- package/dist/preview/chunk.6NIE3ILA.js +0 -1
- package/dist/preview/chunk.6QNBUBGD.js +0 -1
- package/dist/preview/chunk.7OAXW7QF.js +0 -1
- package/dist/preview/chunk.7SNIX56B.js +0 -1
- package/dist/preview/chunk.AI2HBKVP.js +0 -359
- package/dist/preview/chunk.BDQ4FUKO.js +0 -1
- package/dist/preview/chunk.BRDAO2OF.js +0 -4
- package/dist/preview/chunk.CC7E6NUQ.js +0 -1
- package/dist/preview/chunk.CHMUL36A.js +0 -1
- package/dist/preview/chunk.D2T563AA.js +0 -1
- package/dist/preview/chunk.DC7M56NM.js +0 -9
- package/dist/preview/chunk.DIS7JS7X.js +0 -1
- package/dist/preview/chunk.DVLWSCIC.js +0 -35
- package/dist/preview/chunk.EHOEMVQP.js +0 -1
- package/dist/preview/chunk.EME5HQ3H.js +0 -1
- package/dist/preview/chunk.FJEXINFF.js +0 -1
- package/dist/preview/chunk.G446PWV6.js +0 -1
- package/dist/preview/chunk.HST7BYFW.js +0 -1
- package/dist/preview/chunk.JOWJNIWH.js +0 -4
- package/dist/preview/chunk.JV7FLVUV.js +0 -1
- package/dist/preview/chunk.KQSD5MLY.js +0 -1
- package/dist/preview/chunk.KSJ3J5UN.js +0 -1
- package/dist/preview/chunk.LXJW2Z2M.js +0 -1
- package/dist/preview/chunk.MBNZ2HK7.js +0 -1
- package/dist/preview/chunk.MCFLCC42.js +0 -12
- package/dist/preview/chunk.MYKRJ4SV.js +0 -1
- package/dist/preview/chunk.NICCIJV4.js +0 -1
- package/dist/preview/chunk.NQPNK6I5.js +0 -1
- package/dist/preview/chunk.NWK4E7TJ.js +0 -1
- package/dist/preview/chunk.NZB5S5UO.js +0 -1
- package/dist/preview/chunk.PFXGWY3P.js +0 -1
- package/dist/preview/chunk.PRCWGE7A.js +0 -1
- package/dist/preview/chunk.PXHBPLTQ.js +0 -1
- package/dist/preview/chunk.PXVJBL2C.js +0 -1
- package/dist/preview/chunk.Q3XKNZQW.js +0 -1
- package/dist/preview/chunk.Q5IAXTF5.js +0 -25
- package/dist/preview/chunk.Q5WEOX3Q.js +0 -1
- package/dist/preview/chunk.QXCYAFRT.js +0 -1
- package/dist/preview/chunk.RMRO5JZX.js +0 -1
- package/dist/preview/chunk.S4ZWBCYC.js +0 -1
- package/dist/preview/chunk.SELLAVIQ.js +0 -1
- package/dist/preview/chunk.SHNYYBNW.js +0 -1
- package/dist/preview/chunk.SM6HTPYF.js +0 -1
- package/dist/preview/chunk.T6KKNWZT.js +0 -1
- package/dist/preview/chunk.U6PCKJ26.js +0 -1
- package/dist/preview/chunk.UEPVA6IS.js +0 -1
- package/dist/preview/chunk.UMS7XRPO.js +0 -1
- package/dist/preview/chunk.VGIWQNJB.js +0 -1
- package/dist/preview/chunk.VOHRQXCF.js +0 -5
- package/dist/preview/chunk.W5UJLKIT.js +0 -1
- package/dist/preview/chunk.WUEU3QBL.js +0 -1
- package/dist/preview/chunk.WWUMSCYC.js +0 -1
- package/dist/preview/chunk.XPR3QFF4.js +0 -1
- package/dist/preview/chunk.YKXUDACI.js +0 -28
- package/dist/preview/chunk.YUEOUV7G.js +0 -5
- package/dist/preview/chunk.YYWLYVAW.js +0 -1
- package/dist/preview/chunk.Z2JMTRF4.js +0 -1
- package/dist/preview/chunk.Z2UFPOAN.js +0 -88
- package/dist/preview/chunk.ZEKKIMKI.js +0 -1
- package/dist/preview/chunk.ZJXUWOG3.js +0 -1
- package/dist/preview/chunk.ZZGXVYW2.js +0 -1
|
@@ -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{q as He}from"./chunk.7KZ44FEU.js";import{d as Je,e as Ee,f as ze,g as je}from"./chunk.Y37DXEHG.js";import{a as Ie}from"./chunk.7FZY5E2U.js";import{e as X}from"./chunk.C7EEYSAM.js";import{a as j}from"./chunk.FEBCIEI3.js";import{f as De,g as Y,i as Pe}from"./chunk.OYRZ2DEI.js";import{a as Se}from"./chunk.7EA7THSM.js";import{$a as ke,Ba as K,Bb as ve,Da as he,Eb as Ae,Fa as ye,Fb as Oe,Ga as Z,Ib as Re,K as pe,Lb as Te,Na as ge,Oa as be,Ob as C,Ra as we,Wb as _e,Ya as W,a as fe,cd as $e,ea as G,kc as xe,lc as Me,mc as Ne,ya as me}from"./chunk.VOHRQXCF.js";var E=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},z=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},Q=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},Le=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},qe=(t,e)=>{t.multipleOf??=[],t.multipleOf.includes(e)||t.multipleOf.push(e)},Fe=(t,e)=>(t.patterns??=new Set).add(e),sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function I(t){let e={},{def:n,bag:r}=t._zod,i=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(let o of i){let a=o._zod.def;switch(a.check){case"greater_than":E(e,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":z(e,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":qe(e,a.value);break;case"number_format":{Q(e,a.format);let d=sn[a.format];d&&(E(e,"minimum",d[0]),z(e,"maximum",d[1]));break}case"bigint_format":Q(e,a.format);break;case"min_length":case"min_size":E(e,"minimum",a.minimum);break;case"max_length":case"max_size":z(e,"maximum",a.maximum);break;case"length_equals":E(e,"minimum",a.length),z(e,"maximum",a.length);break;case"size_equals":E(e,"minimum",a.size),z(e,"maximum",a.size);break;case"string_format":Q(e,a.format),a.pattern&&Fe(e,a.pattern),(a.format==="base64"||a.format==="base64url")&&(e.contentEncoding=a.format),(a.local||a.precision===-1)&&(e.laxFormat=!0);break;case"mime_type":Le(e,a.mime);break}}r.minimum!==void 0&&E(e,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&E(e,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&z(e,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&z(e,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&qe(e,r.multipleOf),r.format!==void 0&&(e.format??=r.format,r.format.includes("int")&&(e.isInt=!0)),r.mime&&Le(e,r.mime);for(let o of r.patterns??[])Fe(e,o);return e}var dn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function L(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?L(e.out):e.type==="catch"?L(e.innerType):t._zod.optin}var cn=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function _(t,e=new Set){if(e.has(t))return!1;e.add(t);let n=t._zod.def,r=n.type;return r==="transform"?!0:r==="array"?_(n.element,e):r==="set"?_(n.valueType,e):r==="lazy"?_(n.getter(),e):cn.has(r)?_(n.innerType,e):r==="intersection"?_(n.left,e)||_(n.right,e):r==="record"||r==="map"?_(n.keyType,e)||_(n.valueType,e):r==="pipe"?t._zod.traits.has("$ZodCodec")||_(n.in,e)||_(n.out,e):r==="object"?Object.values(n.shape).some(i=>_(i,e)):r==="union"?n.options.some(i=>_(i,e)):r==="tuple"?n.items.some(i=>_(i,e))||(n.rest?_(n.rest,e):!1):!1}function ln(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n])=>e.indexOf(+n)===-1).map(([,n])=>n)}function Be(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let n=[];for(let r of e){if(!r||typeof r!="object")return;Be(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;for(let o of[r.type].flat()){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete t.anyOf,t.type=n.length===1?n[0]:n}var Ue=new Set(["type","properties","required","additionalProperties"]),We=t=>{let e=t.additionalProperties;return e&&typeof e=="object"&&Object.keys(e).length?e:null},Ce=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function ee(t){for(let i of t){if(typeof i!="object"||i.type!=="object")return null;for(let o in i)if(!Ue.has(o))return null}let e={},n=new Set;for(let i of t){for(let o in i.properties){if(Object.prototype.hasOwnProperty.call(e,o))continue;let a=[];for(let d of t){let s=d.properties?.[o]??We(d);s&&!a.some(y=>Ce(y,s))&&a.push(s)}e[o]=a.length===1?a[0]:ee(a)??{allOf:a}}for(let o of i.required??[])n.add(o)}let r={type:"object",properties:e};if(n.size&&(r.required=[...n]),t.every(i=>i.additionalProperties===!1))r.additionalProperties=!1;else{let i=[];for(let o of t){let a=We(o);a&&!i.some(d=>Ce(d,a))&&i.push(a)}i.length===1?r.additionalProperties=i[0]:i.length>1&&(r.additionalProperties={allOf:i})}return r}function un(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let i of Ue)if(i in t)return;let n=e.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),r;if(!n.length)r=ee(e);else{let i=n[0],o=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=e.filter(s=>s!==i),d=i[o].map(s=>ee([...a,s]));if(d.some(s=>!s))return;r={[o]:d}}r&&(delete t.allOf,Object.assign(t,r))}function Ve(t){let e=t;for(let S of["anyOf","oneOf"]){let T=e[S];if(!Array.isArray(T))continue;let O=T.map(Ve);O.some((v,h)=>v!==T[h])&&(e={...e,[S]:O})}let n=[e.type].flat(),r=!n.includes("string")&&n.some(S=>S==="number"||S==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!r&&!i?.some(S=>typeof S=="number"))return e;let{minimum:o,maximum:a,exclusiveMinimum:d,exclusiveMaximum:s,multipleOf:y,format:p,id:b,...f}=e;return f.enum?f.enum=f.enum.map(S=>typeof S=="number"?String(S):S):typeof f.const=="number"&&(f.const=String(f.const)),r&&(f.type="string",i||(f.pattern=n.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),f}var B=class{constructor(e,n){this.override=e;this.refs=n}done=new Map;path=[];cyclic=new Map;write(e,n=!1){let r=this.refs.get(e);if(r!==void 0&&!n)return{$ref:r};if(this.path.includes(e))return this.cyclic.has(e)||this.cyclic.set(e,""),{};let i=this.done.get(e);if(i)return i;this.path.push(e);try{let o=this.written(e);return this.done.set(e,o),o}finally{this.path.pop()}}written(e){let n={},r,i=e._zod.toJSONSchema?.();i?Object.assign(n,i):r=this.process(e,n);let o=fe.get(e);if(o)for(let d of Object.keys(o))n[d]=o[d];_(e)&&(delete n.examples,delete n.default),"_prefault"in n&&(n.default??=n._prefault,delete n._prefault);let a=n;if(r){let d=this.write(r);a={...n};for(let s of Object.keys(d))s in n||(a[s]=d[s])}return this.override({zodSchema:e,jsonSchema:a}),Be(a),e._zod.def.type==="intersection"&&un(a),a}process(e,n){let r=e._zod.def;switch(r.type){case"string":{n.type="string";let{minimum:i,maximum:o,format:a,patterns:d,contentEncoding:s,laxFormat:y}=I(e);if(typeof i=="number"&&(n.minLength=i),typeof o=="number"&&(n.maxLength=o),a&&(n.format=dn[a]??a,(n.format===""||a==="time"||y)&&delete n.format),s&&(n.contentEncoding=s),d&&d.size>0){let p=[...d];p.length===1?n.pattern=p[0].source:n.allOf=p.map(b=>({pattern:b.source}))}return}case"number":{let{minimum:i,maximum:o,multipleOf:a,exclusiveMinimum:d,exclusiveMaximum:s,isInt:y}=I(e);if(n.type=y?"integer":"number",typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY)?n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY)?n.exclusiveMaximum=s:typeof o=="number"&&(n.maximum=o),a){let[p,...b]=new Set(a.filter(f=>Number.isFinite(f)&&f!==0).map(Math.abs));p!==void 0&&(n.multipleOf=p),b.length&&(n.allOf=[...n.allOf??[],...b.map(f=>({multipleOf:f}))])}return}case"boolean":case"success":n.type="boolean";return;case"null":n.type="null";return;case"never":n.not={};return;case"enum":{let i=ln(r.entries);i.length===0?n.not={}:(i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i);return}case"literal":{let i=r.values.filter(o=>o!==void 0).map(o=>typeof o=="bigint"?Number(o):o);if(r.values.length===0)n.not={};else if(i.length===1)n.type=i[0]===null?"null":typeof i[0],n.const=i[0];else if(i.length>1){for(let o of["number","string","boolean"])i.every(a=>typeof a===o)&&(n.type=o);i.every(o=>o===null)&&(n.type="null"),n.enum=i}return}case"template_literal":n.type="string",n.pattern=e._zod.pattern.source;return;case"file":{n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:i,maximum:o,mime:a}=I(e);i!==void 0&&(n.minLength=i),o!==void 0&&(n.maxLength=o),a&&(a.length===0?n.not={}:a.length===1?n.contentMediaType=a[0]:n.anyOf=a.map(d=>({contentMediaType:d})));return}case"array":{let{minimum:i,maximum:o}=I(e);typeof i=="number"&&(n.minItems=i),typeof o=="number"&&(n.maxItems=o),n.type="array",n.items=this.write(r.element);return}case"object":{let i=r.shape;n.type="object";let o={};n.properties=o;for(let d in i)Object.defineProperty(o,d,{value:this.write(i[d]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(d=>L(i[d])===void 0);a.length>0&&(n.required=a),r.catchall?._zod.def.type==="never"?n.additionalProperties=!1:r.catchall&&(n.additionalProperties=this.write(r.catchall));return}case"union":n[r.inclusive===!1?"oneOf":"anyOf"]=r.options.map(i=>this.write(i));return;case"intersection":{let i=d=>"allOf"in d&&Object.keys(d).length===1,o=this.write(r.left),a=this.write(r.right);n.allOf=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];return}case"tuple":{let i=r.items;n.type="array",n.prefixItems=i.map(s=>this.write(s)),r.rest?n.items=this.write(r.rest):n.items=!1;let o=i.length;for(;o>0&&L(i[o-1])!==void 0;)o-=1;o>0&&(n.minItems=o),r.rest||(n.maxItems=i.length);let{minimum:a,maximum:d}=I(e);typeof a=="number"&&(n.minItems=a),typeof d=="number"&&(n.maxItems=d);return}case"record":{let i=r.keyType;n.type="object";let o=I(i).patterns;if(r.mode==="loose"&&o&&o.size>0){let d=this.write(r.valueType),s={};for(let y of o)s[y.source]=d;n.patternProperties=s}else n.propertyNames=Ve(this.write(i)),n.additionalProperties=this.write(r.valueType);let a=i._zod.values;if(a&&!r.partial&&L(r.valueType)===void 0){let d=[...a].filter(s=>typeof s=="string"||typeof s=="number");d.length>0&&(n.required=d.map(String))}return}case"nullable":n.anyOf=[this.write(r.innerType),{type:"null"}];return;case"default":case"prefault":{let i=r.defaultValue,o,a=!1,d=JSON.stringify(i,(s,y)=>typeof y=="bigint"?(a=!0,null):y);return!a&&d!==void 0&&(o=JSON.parse(d)),a||(n[r.type==="default"?"default":"_prefault"]=o),r.innerType}case"catch":{try{n.default=r.catchValue(void 0)}catch{}return r.innerType}case"readonly":return n.readOnly=!0,r.innerType;case"pipe":return r.in._zod.traits.has("$ZodTransform")?r.out:r.in;case"lazy":return e._zod.innerType;case"optional":case"nonoptional":case"promise":return r.innerType;default:return}}};function Ge(t,e=()=>{}){let n=t,r=new B(e,new Map),i=r.write(n,!0);if(r.cyclic.size>0){let o=new Map,a=0,d=[];for(let y of r.cyclic.keys())if(y===n)o.set(y,"#");else{let p=`__schema${a++}`;o.set(y,`#/$defs/${p}`),d.push([y,p])}r=new B(e,o),i=r.write(n,!0);let s={};for(let[y,p]of d)s[p]=r.write(y,!0);d.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function Ke(t){return Ge(t,mn)}var fn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},pn={phone:"A phone number as it is written, like +1 555 123 4567 or 020 7946 0958 ext. 12.",place:"An address or a place's name, as a person would search a map for it.",duration:"A length of time in whole minutes: 90 is 1 h 30 min."};function mn(t){me(t.zodSchema)&&(t.jsonSchema["x-graview-app-link"]=!0);let e=ye(t.zodSchema);if(e&&(t.jsonSchema.type==="string"||t.jsonSchema.type==="array")){t.jsonSchema["x-graview-linked"]={address:e.address,kinds:[...e.kinds],cardinality:e.cardinality};let s=e.kinds.join(" or "),y=`${e.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${e.address}, as "${e.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,p=t.jsonSchema.description;typeof p=="string"&&p.includes(y)||(t.jsonSchema.description=`${typeof p=="string"&&p?`${p.replace(/\.?$/,".")} `:""}${y}`)}if(we(t.zodSchema)&&(t.jsonSchema["x-graview-repeat"]=!0,!t.jsonSchema.type&&!t.jsonSchema.anyOf&&!t.jsonSchema.oneOf&&Object.assign(t.jsonSchema,hn())),Se(t.zodSchema)){t.jsonSchema.contentMediaType="text/markdown";let s=t.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(t.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let n=Te(t.zodSchema);if(n){let s=t.jsonSchema;s["x-graview-type"]=n,n==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=pn[n]}let r=Re(t.zodSchema,!1);if(r){let s=De(r);t.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(t.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(t.jsonSchema["x-graview-unit"]=s.unit);let y=t.jsonSchema.description;t.jsonSchema.description=typeof y=="string"&&y.length>0?`${y} ${Y(s)}`:Y(s)}let i=t.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let o=t.jsonSchema,a=(i.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete o.pattern;let d=o.allOf;Array.isArray(d)&&d.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete o.allOf,o.format=fn[i.format]??i.format,a.length===1?o.pattern=a[0]:a.length>1&&(o.allOf=a.map(s=>({pattern:s})))}function ne(t,e){let n=C(t.input),r=Ke(t.input);if(e&&r.properties){let o=a=>e.includes(a)?e.indexOf(a):e.length;r.properties=Object.fromEntries(Object.entries(r.properties).sort(([a],[d])=>o(a)-o(d)))}let i=r.properties??{};if(Ae(t)){let o=t.creates.join(" | ");i.id={type:"string",minLength:1,description:`Optional: the id for the ${o} this makes. Refused if the graph already has it; left out, one is minted from the label.`},r.properties=i}Oe(t)&&(r.additionalProperties=!1);for(let o of n){let a=i[o.name];if(!a)continue;let d=o.kinds.includes("*")?"any node kind":o.kinds.join(" | ");a.description=[a.description,`Id of a node (${d}).`].filter(Boolean).join(" ")}return{name:t.name,...t.title===void 0?{}:{title:t.title},description:t.description??t.title??t.name,inputSchema:r,nodeRefs:n}}function hn(){let t={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},e=(n,r)=>({type:"integer",minimum:n,maximum:r});return{type:"object",description:'How the date beside it repeats; the date is the first occurrence. "on" is weekdays for "week", days of the month (-1 the last) for "month".',properties:{every:{type:"string",enum:[...be]},interval:e(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ge]},e(-1,31)]}},until:t,count:e(1,1e3),except:{type:"array",maxItems:500,items:t},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function Ze(t){let e=new Set;for(let n=t;n;n=n.onBehalfOf)n.id!==void 0&&e.add(`${n.kind}:${n.id}`);return e}function U(t,e){let n=Ze(e),r=p=>{if(p.kind==="rule")return!1;let b=Ze(p);if(b.size===0)return!1;for(let f of b)if(n.has(f))return!1;return!0},i,o=()=>{if(i)return i;i=new Map;for(let p of t.log.live()){if(p.undoes!==void 0)continue;let b=r(p.author)?p.author:void 0;for(let f of p.primitives){f.op==="remove-node"&&i.delete(f.node.id);let S=f.op==="add-node"?f.node.id:f.op==="patch-node"||f.op==="splice-text"?f.id:void 0;if(S===void 0)continue;let T=f.op==="add-node"?Object.keys(f.node):f.op==="splice-text"?[f.field]:Object.keys(f.after),O=i.get(S);(f.op==="add-node"||!O)&&i.set(S,O=new Map);for(let v of T)v==="id"||v==="kind"||(b?O.set(v,b):O.delete(v))}}return i},a=t.schema,d=new Map,s=(p,b)=>{let f=`${p}\0${b}`,S=d.get(f);if(S===void 0){let T=a.tryDefinition(p)?.fields?.shape;S=T!==void 0&&b in T&&Pe(T[b]).type==="text",d.set(f,S)}return S},y=p=>t.graph.getNode(p)?.kind;return{prose:s,say:p=>W(p,{graph:t.graph,schema:a}),fieldBy(p,b){let f=y(p);if(!(f===void 0||!s(f,b)))return o().get(p)?.get(b)},recordBy(p){let b=y(p),f=o().get(p);if(b===void 0||!f)return;let S;for(let[T,O]of f)s(b,T)&&(S=O);return S}}}var te=(t,e,n)=>({untrusted:!0,authoredBy:n.say(e),text:t}),yn="the host's ranker";function Ye(t,e){return{...t,hits:t.hits.map(n=>{if(n.about!=="node")return n;n.why.by==="meaning"&&n.why.matched!==void 0&&(n={...n,why:{...n.why,matched:{untrusted:!0,authoredBy:yn,text:n.why.matched}}});let r=e.recordBy(n.id);if(!r)return n;let i=e.prose(n.kind,n.why.field)?e.fieldBy(n.id,n.why.field):r;return{...n,label:te(n.label,r,e),...n.apart!==void 0?{apart:te(n.apart,r,e)}:{},why:i?{...n.why,fragment:te(n.why.fragment,i,e)}:n.why}})}}var ie=(t,e,n)=>({title:t,readOnlyHint:e,destructiveHint:!1,idempotentHint:n,openWorldHint:!1}),gn={name:"subscribe",title:"Notify me when something happens",description:`Subscribe the person you act for to be told when something happens in this app \u2014 their host delivers it (an email, a push). on is one of: "act" (an act runs; give act, its declared name, and/or record), "created" (a record of kind is added), "changed" (a record of kind, or the one record, changes), "reaches" (a record of kind, or the one record, comes to satisfy condition, an expression in the app's rule language such as done == true or amount > 100). They are told only of changes someone else made, unless alsoMine is true, and only of records they may see. Returns the subscription and its sentence. Changes nothing in the app.`,inputSchema:{type:"object",properties:{on:{type:"string",enum:["act","created","changed","reaches"],description:"What to be told of."},act:{type:"string",description:"An act's declared name, for on: act."},kind:{type:"string",description:"A kind, for created, changed and reaches."},record:{type:"string",description:"One record, by id or name: for act, changed and reaches."},condition:{type:"string",description:"For reaches: what the record should come to satisfy, in the rule language (done == true)."},alsoMine:{type:"boolean",description:"Also when the person themselves made the change; false when unsaid."}},required:["on"],additionalProperties:!1},mutating:!1,annotations:ie("Notify me when something happens",!1,!1)},bn={name:"unsubscribe",title:"Stop notifying me",description:"Take away one of the person's subscriptions, by the id list_subscriptions or subscribe answered. Changes nothing in the app.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The subscription's id."}},required:["id"],additionalProperties:!1},mutating:!1,annotations:ie("Stop notifying me",!1,!0)},wn={name:"list_subscriptions",title:"What I am notified of",description:`List what the person you act for is told of in this app: each subscription's id and its sentence ("When someone else adds a task").`,inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:ie("What I am notified of",!0,!0)},re=[gn,bn,wn];var F=t=>{let e;return()=>e??=t().catch(n=>{throw e=void 0,n})},Sn=F(()=>(__graviewPreload(import.meta.url,["./chunk.BJL6EL6B.js","./chunk.SZCZD2GM.js","./chunk.C7EEYSAM.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.5LWPNOJA.js"))),kn=()=>(__graviewPreload(import.meta.url,["./chunk.FEBCIEI3.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.ULAMIQ52.js")).catch(()=>{}),vn=async()=>{(await kn())?.judgeWithLines()},q=F(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.7EA7THSM.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.GZHEGKPF.js"))),An=F(()=>(__graviewPreload(import.meta.url,["./chunk.4LI73QOY.js","./chunk.G4JJXA63.js","./chunk.VGTEEANA.js","./chunk.SZCZD2GM.js","./chunk.XLM4ONUB.js","./chunk.XOZU4OFA.js","./chunk.C7EEYSAM.js","./chunk.Q5WEOX3Q.js","./chunk.CHMUL36A.js","./chunk.U6PCKJ26.js","./chunk.FEBCIEI3.js","./chunk.WVUJXDXZ.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.NICCIJV4.js"))),On=F(()=>(__graviewPreload(import.meta.url,["./chunk.NHIPVAGR.js","./chunk.BJL6EL6B.js","./chunk.SZCZD2GM.js","./chunk.7FZY5E2U.js","./chunk.7354O67H.js","./chunk.C7EEYSAM.js","./chunk.QRCTTDDQ.js","./chunk.3TME4BG3.js","./chunk.I43ONAEL.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.Z2JMTRF4.js"))),Rn=F(()=>(__graviewPreload(import.meta.url,["./chunk.XZLKTOJE.js","./chunk.R7ZZJOJW.js","./chunk.73EKJ4JN.js","./chunk.INL4OZI7.js","./chunk.5WU2UTP7.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.EIWTZC4A.js"))),Tn=t=>t.definitions.some(e=>Z(e).size>0),Xe=t=>({value:K(t),label:t.label,...t.describe?{describe:t.describe}:{},...t.card?{card:t.card}:{},fields:t.fields,...t.app?{app:t.app}:{}});async function _n(t,e,n,r){let i=String(n.relation??""),[o,a]=i.includes(".")?i.split(".",2):[void 0,i],d=t.schema.definitions.flatMap(v=>[...Z(v)].map(([h,u])=>({kind:v.kind,name:h,relation:u}))),s=d.filter(v=>v.name===a&&(o===void 0||v.kind===o));if(s.length!==1){let v=d.map(h=>`${h.kind}.${h.name}`).join(", ")||"none";return{ok:!1,error:`${s.length===0?`No relation to another app is called "${i}"`:`"${i}" names a relation of several kinds`}. The relations to other apps are: ${v}.`}}let{kind:y,name:p,relation:b}=s[0];if(!r)return{ok:!1,error:`This seat cannot read ${b.address}: its host reads no other app's records. Nothing was changed.`};let f={kind:e.kind,...e.id===void 0?{}:{id:e.id},...e.roles?{roles:e.roles}:{}},S=typeof n.of=="string"?n.of:void 0;if(S!==void 0){let v=t.graph.getNode(S);if(!v||v.kind!==y)return{ok:!1,error:`No ${y} "${S}".`};let h=he(v[p],b),u=await Promise.all(h.map(w=>Promise.resolve().then(()=>r.resolve(w,f)).catch(()=>null)));return{ok:!0,data:{relation:`${y}.${p}`,app:b.address,records:u.map((w,k)=>w===null?{value:K(h[k]),missing:!0}:"denied"in w?{denied:!0,said:"linked record (no access)"}:Xe(w))},reads:[S]}}let T=typeof n.limit=="number"&&n.limit>0?Math.min(n.limit,20):20,O=await Promise.resolve().then(()=>r.find({address:b.address,kinds:b.kinds,query:String(n.query??""),limit:T},f)).catch(()=>[]);return Array.isArray(O)?{ok:!0,data:{relation:`${y}.${p}`,app:b.address,records:O.map(Xe),link:`edit-${y} with ${p} set to a record's value`}}:{ok:!0,data:{relation:`${y}.${p}`,app:b.address,denied:!0,said:"linked record (no access)"}}}var M=t=>({title:t,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),Qe={description:'Which records: false (the default) the live ones, true only the archived ones, "all" both. An archived record is set aside, not gone: unarchive-<kind> brings it back.',anyOf:[{type:"boolean"},{type:"string",enum:["all"]}]},oe={type:"number",description:"Where the page starts; 0 when unsaid."},se=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too. When few records match exactly, records with a near word follow \u2014 a typo, another form of the word, a meaning \u2014 each with near: true and why.matched, the record's own word that answered.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."},archived:Qe},required:["query"],additionalProperties:!1},mutating:!1,annotations:M("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:oe,archived:Qe},additionalProperties:!1},mutating:!1,annotations:M("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:oe},required:["id"],additionalProperties:!1},mutating:!1,annotations:M("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:oe,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:M("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:M("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, the forms it offers (each field in the order asked, its label, whether it must be answered, what it takes and its choices), and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers"), a record's id, or a visitor form's "forms/<name>", and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, a record's id, or "forms/<name>" for a visitor form.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:M("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:M("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},{name:"list_suggestions",title:"List what is suggested",description:"List the suggestions waiting for a person: changes the app's own actor proposed and did not make, each with its id, what it would do, who suggested it, what it was based on and how sure (0 to 1). Nothing changes until one is accepted (accept_suggestion) or declined (decline_suggestion); a declined one is never suggested again.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:M("List what is suggested")},{name:"accept_suggestion",title:"Accept a suggestion",description:"Make a waiting suggestion's change, as this seat, carrying what it was based on. Returns the batch (undo_batch takes it back).",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Accept a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},{name:"decline_suggestion",title:"Decline a suggestion",description:"Decline a waiting suggestion: nothing changes, the decline is kept in the log, and the same change is never suggested or made by the app's own actor again.",inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Decline a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}],nn={name:"act_on_several",title:"Do one act to several records",description:`Run one act on several records at once, as one change with one undo. act is the act (its tool name or its declared name), records the records it runs on (ids or names; each goes in the act's subject), args what every call shares ("Set stage to Declined" is args { stage: "declined" }). Each record is judged on its own: one this seat may not change is named with why, and the rest still apply. Returns the batch (undo_batch takes it all back), the records changed, those already so, and those refused.`,inputSchema:{type:"object",properties:{act:{type:"string",description:"The act to run on each record."},records:{type:"array",items:{type:"string"},minItems:1,maxItems:200,description:"Ids or names of the records."},args:{type:"object",description:"Arguments every call shares, besides the record."}},required:["act","records"],additionalProperties:!1},mutating:!0,annotations:{title:"Do one act to several records",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},ue={name:"suggest_changes",title:"Suggest changes",description:"Keep calls ({ act, args }) as one suggestion a person accepts or declines, with its basis and confidence (0 to 1). Changes nothing; a declined change is refused.",inputSchema:{type:"object",properties:{calls:{type:"array",items:{type:"object"}},basis:{type:"string"},confidence:{type:"number"}},required:["calls","basis"]},mutating:!0,annotations:{title:"Suggest changes",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},de={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},ce={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:de,current:de},additionalProperties:!1},mutating:!1,annotations:M("Draw a view")},tn={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...de,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},rn={name:"find_linked",title:"Find a record in another app",description:`A relation may go to a kind in another app (describe_app lists them under "Linked from other apps"). With relation and words, list the records there this seat may link \u2014 each with the value to link it by ("house:h1"), its name and its describe line. With of (a record id here), read the records that record links, as this seat may see them there. Linking one is the record's edit (edit-<kind>) with the relation set to the value. Another app this seat may not open answers denied, and nothing of it. Writes nothing; never changes the other app.`,inputSchema:{type:"object",properties:{relation:{type:"string",description:"The relation, by name (forHouse) or as <kind>.<relation> (scenario.forHouse)."},query:{type:"string",description:"Words to find by, in the other app's names; empty for the first few."},of:{type:"string",description:"A record here whose linked records to read, instead of finding."},limit:{type:"number",description:"Most records to return; at most 20."}},required:["relation"],additionalProperties:!1},mutating:!1,annotations:M("Find a record in another app")};function xn(t,e){return t===void 0?[]:t==="keep"&&!e?[ce,tn]:[ce]}var Mn="An argument that names a record takes its id or its name.",on=[...se.map(t=>t.name),nn.name,ue.name,ce.name,tn.name,rn.name,...re.map(t=>t.name)],an=64;function N(t){let{line:e,...n}=t;return n}function en(t){return{...t,...t.introduces?{introduces:t.introduces.map(N)}:{},...t.resolves?{resolves:t.resolves.map(N)}:{},...t.violationsAfter?{violationsAfter:t.violationsAfter.map(N)}:{}}}function Nn(t){let e=t.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return e.length===0&&(e="act"),/^[A-Za-z_]/.test(e)||(e=`act_${e}`),e.slice(0,an)}function $n(t){let e=new Set(on),n=new Map;for(let r of t){let i=Nn(r),o=i;for(let a=2;e.has(o);a+=1)o=`${i.slice(0,an-`_${a}`.length)}_${a}`;e.add(o),n.set(r,o)}return n}function Dn(t,e){if(e.size===0)return t;let n=Object.fromEntries(Object.entries(t.properties??{}).filter(([i])=>!e.has(i))),r=(t.required??[]).filter(i=>!e.has(i));return{...t,properties:n,...t.required?{required:r}:{}}}function Pn(t,e,n,r){let i=ne(t,_e(r,t)),o=G(t),a=i.nodeRefs.length>0?`${i.description}${/[.!?]$/.test(i.description)?"":"."} ${Mn}`:i.description;return{name:e,title:o,description:a,inputSchema:Dn(i.inputSchema,n),mutating:!0,annotations:{title:o,readOnlyHint:!1,destructiveHint:t.destructive===!0||(t.severs?.length??0)>0,idempotentHint:t.idempotent===!0,openWorldHint:!1},act:t.name}}function le(t){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(le).join(",")}]`;let e=t;return`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${le(e[n])}`).join(",")}}`}function Jn(t){return`sha256:${$e(le(t))}`}function En(t,e,n,r,i,o=!1,a=!1,d=!1,s){let y=$n(t.map(f=>f.name)),p=[...xn(r,n),...o?[rn]:[],...a?re:[]];return{definitions:n?[...se.filter(f=>!f.mutating),...p]:[...se,nn,...d?[ue]:[],...p,...t.filter(f=>e.has(f.name)).map(f=>Pn(f,y.get(f.name),i(f),s))],names:y}}function At(t,e={}){let n=e.author??{kind:"agent"},r=t.allMutations(),i=new Set(t.permittedMutations(n).map(h=>h.name)),{definitions:o,names:a}=En(r,i,e.readOnly===!0,e.drafts?e.drafts.keep?"keep":"draw":void 0,h=>X(t.schema,t.policy,n,h),Tn(t.schema),e.subscriptions!==void 0,Ne(n),t.schema),d=Jn(o),s={app:e.app?.brand?.locale,appTimeZone:e.app?.brand?.timeZone},y=h=>pe(s,h),p=h=>{if(!on.includes(h)){for(let[u,w]of a)if(w===h)return u;return a.has(h)?h:xe(h,a.keys())}},b=h=>{let u=Me(h,a.keys());return u?` Did you mean "${u}"?`:""},f=h=>{let u=o.find(k=>k.name===h)??o.find(k=>k.act===h);if(u)return u;let w=p(h);return w===void 0?void 0:o.find(k=>k.act===w)},S=(h,u)=>{let w=r.find(c=>c.name===h);if(!w)return{args:u,resolved:[]};let k={...u},l=[];for(let c of C(w.input)){let m=k[c.name];if(typeof m!="string"||m.trim()==="")continue;let g=t.resolveRef(c,m,n);if(!g.ok){let A=g.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${c.name}.`:" Nothing was changed.";return{ok:!1,error:`${g.message}${A}`,argument:c.name,candidates:g.candidates}}g.by!=="id"&&(k[c.name]=g.id,l.push({argument:c.name,given:m,id:g.id,label:g.label}))}return{args:k,resolved:l}},T=async(h,u)=>{try{await vn();let w=f(h);if(!w&&h===ue.name)return{ok:!1,error:"Only the app's own actor (automated: true) suggests changes.",reason:"forbidden"};if(!w){let l=p(h);if(l){let c=t.permits({name:l,args:u},n);if(!c.ok)return{ok:!1,error:c.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${h}".${b(h)} Available: ${o.map(c=>c.name).join(", ")}`}}if(w.mutating&&e.readOnly)return{ok:!1,error:`"${h}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(w.act!==void 0){let l=S(w.act,u);if("ok"in l)return l;let c=w.act,m=y(()=>j(t,n,t.apply({name:c,args:l.args},{...e.author?{author:e.author}:{},...V(e.via)})));return{ok:!0,data:{batch:m.batch,intent:m.intent,introduces:m.introduces.map(N),resolves:m.resolves.map(N),...l.resolved.length>0?{resolved:l.resolved}:{}},diff:m.diff}}let k=t.seenBy(n);switch(w.name){case"search_graph":{let l=typeof e.places=="function"?e.places():e.places,c=typeof u.subject=="string"?u.subject:void 0,m=He(k,String(u.query??""),{principal:n,rank:e.near,archived:ke(u.archived),limit:typeof u.limit=="number"&&u.limit>0?Math.min(u.limit,20):20,...l?{places:l}:{},...c?{subject:c,from:[c]}:{}}),g=m.later?await m.later:m;return{ok:!0,data:(await q()).searchRead(g,Ye(g,U(k,n))),reads:g.hits.flatMap(A=>A.about==="node"?[A.id]:[])}}case"get_graph":return{ok:!0,...(await q()).graphRead(k,U(k,n),u)};case"get_node":{let l=String(u.id??""),c=l,m;if(!k.graph.getNode(l)){let A=l.trim()===""?void 0:t.resolveRef({name:"id",kinds:["*"]},l,n);if(A?.ok)c=A.id,m={argument:"id",given:l,id:c,label:A.label};else return A?.reason==="ambiguous"?{ok:!1,error:A.message,argument:"id",candidates:A.candidates}:{ok:!1,error:`No node "${l}".`}}let g=(await q()).nodeRead(k,U(k,n),c,u);return{ok:!0,data:m?{...g.data,resolved:[m]}:g.data,reads:g.reads}}case"describe_place":{let l=e.app??{name:"",schema:t.schema},c=typeof u.width=="number"&&Number.isFinite(u.width)&&u.width>0?u.width:1440,{describePlace:m}=await Sn(),g=m(t,n,String(u.place??""),{app:l,width:c});if(!g.ok)return{ok:!1,error:`${g.error} The places are: ${g.places.join(", ")}.`};let A=new Set,$=H=>{for(let P of H)for(let x of P.groups??[])for(let D of x.items)A.add(D.id),$(D.parts)};return $(g.description.parts),{ok:!0,data:g.description,reads:[...A]}}case"find_linked":return _n(k,n,u,e.linked);case"draft_view":case"keep_lens":{let l=e.app??{name:"",schema:t.schema};return(await An()).runDraftTool(w.name,u,{app:l,principal:n,...e.drafts?{drafts:e.drafts}:{}})}case"get_violations":{let l=k.violations(u.context);return{ok:!0,...(await q()).violationsRead(l,u)}}case"get_affordances":{let l=u.selection??[];return{ok:!0,data:Ie(k,l,{...typeof e.derive=="function"?e.derive():e.derive,...e.author?{principal:e.author}:{},...u.context?{context:u.context}:{}}),reads:l.filter(m=>k.graph.has(m))}}case"preview_mutation":{let l=String(u.mutation),c=p(l)??l,m=S(c,u.args??{});if("ok"in m)return m;let g=t.missingFor({name:c,args:m.args},n);if(g)return{ok:!1,error:g.message,reason:"missing"};let A=j(t,n,t.preview({name:c,args:m.args},void 0,{author:n})),$=en(A);return{ok:!0,data:m.resolved.length>0?{...$,resolved:m.resolved}:$}}case"act_on_several":{let l=String(u.act??""),c=p(l)??l,m=r.find(R=>R.name===c);if(!m||!i.has(c)){let R=m?t.permits({name:c,args:{}},n):void 0;return R&&!R.ok?{ok:!1,error:R.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${l}" this seat may run.${b(l)} Nothing was changed.`,reason:"invalid"}}let g=m.subject;if(!g)return{ok:!1,error:`"${G(m)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let A=Array.isArray(u.records)?u.records.filter(R=>typeof R=="string"&&R.trim()!==""):[];if(A.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let $=[],H=[];for(let R of A.slice(0,200)){let J=t.resolveRef({name:g.arg,kinds:g.kinds},R,n);if(!J.ok)return{ok:!1,error:`${J.message} Nothing was changed.`,argument:"records",candidates:J.candidates};$.push(J.id),J.by!=="id"&&H.push({argument:"records",given:R,id:J.id,label:J.label})}let P=S(c,{...u.args??{}});if("ok"in P)return P;let x=(await On()).actOnSeveral(t,{mutation:c,subject:g.arg,args:P.args},$,{author:n,...V(e.via)}),D=x.result?j(t,n,x.result):void 0;return{ok:!0,data:{...x.batch?{batch:x.batch,intent:x.intent}:{},applied:x.applied,unchanged:x.unchanged,refused:x.refused.map(R=>({record:R.id,label:R.label,error:R.message,reason:R.reason})),...x.allOrNothing?{keptNone:!0}:{},...D?{introduces:D.introduces.map(N),resolves:D.resolves.map(N)}:{},...H.length>0||P.resolved.length>0?{resolved:[...H,...P.resolved]}:{}},...D?{diff:D.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let l=await(await Rn()).runSubscriptionTool(w.name,u,{store:t,principal:e.subscriber??n,app:e.app?.name??"app",subscriptions:e.subscriptions});return l.ok?{ok:!0,data:l.data}:{ok:!1,error:l.error}}case"list_suggestions":{let l=Ee(t,n).map(c=>{let m=W(c.author,{graph:k.graph,schema:t.schema});return{id:c.id,intent:c.intent,by:m,at:c.at,about:c.about,...c.lineage?{basis:{untrusted:!0,authoredBy:m,text:c.lineage.basis},...c.lineage.confidence!==void 0?{confidence:c.lineage.confidence}:{}}:{}}});return{ok:!0,data:{suggestions:l},reads:[...new Set(l.flatMap(c=>c.about))]}}case"suggest_changes":{let l=u.calls.map(m=>({name:p(m.act)??m.act,args:m.args}));return{ok:!0,data:{suggestion:Je(t,l,{author:n,lineage:{basis:u.basis,confidence:u.confidence},...V(e.via)})?.id??null}}}case"accept_suggestion":case"decline_suggestion":{let l=String(u.suggestion??""),c={author:n,...V(e.via)},m=w.name==="accept_suggestion"?ze(t,l,c):je(t,l,c),g=j(t,n,m);return{ok:!0,data:{batch:g.batch,intent:g.intent,introduces:g.introduces.map(N),resolves:g.resolves.map(N)},diff:g.diff}}case"undo_batch":{let l=String(u.batch),c=u.include??[],m=k.canUndo([l,...c]);if(!m.ok)return{ok:!1,error:m.message};let g=j(t,n,t.undo([l,...c],{...e.author?{author:e.author}:{}}));return{ok:!0,data:en(g),diff:g.diff}}default:return{ok:!1,error:`Unknown tool "${h}".`}}}catch(w){let{reason:k,wouldNeed:l}=ve(w);return{ok:!1,error:w instanceof Error?w.message:String(w),reason:k,...l?{wouldNeed:l}:{}}}},O=new Set,v=h=>{for(let u of O)u(h)};return{definitions:o,hash:d,...e.author?{author:e.author}:{},onDiff(h){return t.subscribe(h)},onCall(h){return O.add(h),()=>O.delete(h)},async call(h,u){let w=f(h)?.mutating??!1,k={name:h,args:u,mutating:w,at:new Date().toISOString()};v({...k,phase:"running"});let l=m=>(v(m.ok?{...k,phase:"ok",...!w&&m.reads?{reads:m.reads}:{}}:{...k,phase:"failed",error:m.error}),m),c=await T(h,u);return l(c.ok&&!w?{...c,data:(await q()).withinReadChars(h,c.data)}:c)}}}function V(t){let e=typeof t=="function"?t():t;return e?{via:e}:{}}export{le as a,At as b};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{a as D,b as L,c as C,d as M,e as _,f as N,h as T}from"./chunk.BRDAO2OF.js";import"./chunk.AJZBJBMO.js";var W=0,K=1,z=2,X=3,I=1,Y=2,j=3,J=1,q=3,Q=8,P="~",A=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),F=new Set(["input","select","textarea","option"]),Z=new Set(["value","checked","selected"]);function H(r,t){let l=r.ownerDocument??r,h=t.maxNodes??5e3,y=[],g=new Map,E=new WeakMap,x={dom:r,name:"div",namespace:"html",children:[],id:P};g.set(P,x);let R=0,S=!1,O=new Map,u=e=>{y.push(e),y.length>200&&y.shift(),t.onRefused?.(e)},s=()=>({dom:l.createComment(""),children:[],refused:!0}),o=(e,a)=>{if(e.namespace==="html"&&e.name&&F.has(e.name))return e.dom;if(a?.namespace==="html"&&a.name==="textarea")return a.dom},m=(e,a,f)=>{let i=e.dom;if(f!=null&&typeof f!="string")return u({reason:"value",element:e.name,name:a});let n=T(e.namespace,e.name,a,f??null,t);if("refused"in n){let v=T(e.namespace,e.name,a,null,t);return"refused"in v||i.removeAttribute(v.name),u(n.refused)}for(let v of n.dropped??[])u(v);let d=e.namespace==="html"&&Z.has(n.name)&&F.has(e.name),c=i,p=d?n.name==="value"?c.value:n.name==="checked"?c.checked:c.selected:void 0;n.value===null?i.removeAttribute(n.name):i.setAttribute(n.name,n.value),t.onAttribute?.(i,n.name),d&&(n.name==="value"&&"value"in c?(c.value=n.value??"",p!==c.value&&t.onFieldSet?.(i)):n.name==="checked"&&"checked"in c?(c.checked=n.value!==null,p!==c.checked&&t.onFieldSet?.(i)):n.name==="selected"&&"selected"in c&&(c.selected=n.value!==null,p!==c.selected&&t.onFieldSet?.(i.parentElement?.closest("select")??i)))},w=e=>{if(!e.refused){R-=1,e.id!==void 0&&g.delete(e.id);for(let a of e.children)w(a)}},b=(e,a)=>{if(!A(e)||typeof e.id!="string"||g.has(e.id))return u({reason:"record"}),s();if(R>=h)return u({reason:"budget"}),S||(S=!0,t.onOverBudget?.()),s();let f=e.id;if(e.type===Q)return s();if(e.type===q){if(N(a.namespace,a.name))return u({reason:"child",element:a.name}),s();let p=l.createTextNode(String(e.data??"").slice(0,D)),v={dom:p,children:[],text:!0,id:f,parent:a};return g.set(f,v),E.set(p,f),R+=1,v}if(e.type!==J)return u({reason:"record"}),s();let i=String(e.element);if(N(a.namespace,a.name))return u({reason:"child",element:i}),s();let n=_(i,a.namespace);if("refused"in n)return u(n.refused),s();let d=l.createElementNS(n.namespace==="svg"?C:L,n.name);n.as&&d.setAttribute("data-graview-as",n.as),n.namespace==="html"&&n.name==="img"&&d.setAttribute("referrerpolicy","no-referrer"),n.namespace==="html"&&n.name==="a"&&(d.setAttribute("target","_blank"),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("referrerpolicy","no-referrer"));let c={dom:d,name:n.name,namespace:n.namespace,children:[],id:f,parent:a};if(g.set(f,c),E.set(d,f),R+=1,A(e.attributes))for(let[p,v]of Object.entries(e.attributes))m(c,p,v);if(t.decorate?.(d,n.name,n.namespace),A(e.properties))for(let p of Object.keys(e.properties))u({reason:"attribute",element:n.name,name:p});if(A(e.eventListeners))for(let p of Object.keys(e.eventListeners))e.eventListeners[p]!=null&&u({reason:"attribute",element:n.name,name:`on${p}`});if(Array.isArray(e.children))for(let p of e.children){let v=b(p,c);c.children.push(v),d.appendChild(v.dom)}return c},k=e=>{if(!Array.isArray(e))return u({reason:"record"});let[a,f]=e,i=typeof f=="string"?g.get(f):void 0;if(!i)return u({reason:"record"});switch(a){case W:{if(i.text)return u({reason:"record"});let n=Number(e[3]),d=Number.isInteger(n)&&n>=0&&n<=i.children.length?n:i.children.length,c=e[2],p=A(c)&&typeof c.id=="string"?O.get(c.id):void 0,v;p&&p.parent?.namespace===i.namespace&&!N(i.namespace,i.name)?(O.delete(c.id),p.parent=i,v=p):v=b(c,i),i.dom.insertBefore(v.dom,i.children[d]?.dom??null),i.children.splice(d,0,v),i.namespace==="html"&&i.name==="textarea"&&t.onFieldSet?.(i.dom);return}case K:{let n=Number(e[2]),d=i.children[n];if(!d)return u({reason:"record"});i.children.splice(n,1),d.dom.parentNode?.removeChild(d.dom),d.id!==void 0&&!d.refused?O.set(d.id,d):w(d);return}case z:{if(!i.text)return u({reason:"record"});i.dom.data=String(e[2]??"").slice(0,D);let n=o(i,i.parent);n&&t.onFieldSet?.(n);return}case X:{if(i===x||i.text)return u({reason:"record"});let n=String(e[2]),d=e[4]??I;return d===Y?m(i,n,e[3]):u(d===I||d===j?{reason:"attribute",element:i.name,name:d===j?`on${n}`:n}:{reason:"record"})}default:return u({reason:"record"})}};return{apply(e,a){if(!Array.isArray(e))return u({reason:"record"}),!0;try{for(let f=0;f<e.length;f+=1){if(a&&f%32===0&&a())return!1;k(e[f])}return!0}finally{for(let f of O.values())w(f);O.clear()}},get refused(){return y},get size(){return R},idOf:e=>E.get(e),elementOf(e){let a=g.get(e);return a&&!a.text&&a!==x?a.dom:void 0},dispose(){for(let e of x.children)w(e);for(x.children.length=0;r.firstChild;)r.removeChild(r.firstChild)}}}var B=["https:","mailto:","tel:"];function U(r){if(!(typeof r!="string"||r.length>2e3||/[\s<>"]/.test(r.trim())||r.trim()!==r))try{let t=new URL(r);return!B.includes(t.protocol)||t.protocol==="https:"&&(t.hostname===""||t.username!==""||t.password!=="")?void 0:t.href}catch{return}}function ee(r){let t=new Set,l=h=>{if(typeof h!="string"||!/^(https|mailto|tel):/i.test(h))return;let y=U(h);y&&t.add(y)};for(let h of[...r?.node?[r.node]:[],...r?.nodes??[]])for(let[y,g]of Object.entries(h))y==="id"||y==="kind"||(Array.isArray(g)?g.forEach(l):l(g));return t}function G(r){return(r??[]).flatMap(t=>{try{let l=new URL(t);return l.protocol==="https:"&&l.hostname!==""&&l.username===""&&l.password===""?[l.origin]:[]}catch{return[]}})}function te(r,t){let l=U(r);if(l&&(t.handed.has(l)||l.startsWith("https:")&&G(t.origins).includes(new URL(l).origin)))return l}function ne(r,t){let l=r.length>120?`${r.slice(0,119)}\u2026`:r,h="";try{h=new URL(r).protocol}catch{h=""}if(!B.includes(h))return`The link "${l}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let y=G(t);return`The link "${l}" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${y.length>0?`, or an https: address on ${y.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}var re=`
|
|
2
|
-
:host { display: block; position: relative; contain: layout paint style; isolation: isolate; overflow: clip; min-width: 0; }
|
|
3
|
-
:host(:focus-within) { overflow-clip-margin: var(--graview-ring-reach, 4px); }
|
|
4
|
-
[data-graview-view-root] { display: flow-root; color: var(--graview-ink, CanvasText); font-family: var(--graview-font-body, system-ui, sans-serif); line-height: 1.45; }
|
|
5
|
-
:where([data-graview-view-root]) :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; appearance: none; cursor: pointer; }
|
|
6
|
-
:where([data-graview-view-root]) :where(a[data-graview-link]) { color: inherit; text-decoration: none; }
|
|
7
|
-
[data-graview-view-root] :is([data-graview-link], [data-graview-press]) { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: rgb(128 128 128 / 0.16); }
|
|
8
|
-
[data-graview-view-root] :focus-visible { outline: max(2px, var(--graview-focus-width, 2px)) solid var(--graview-focus-color, var(--graview-accent, Highlight)) !important; outline-offset: var(--graview-focus-offset, 2px) !important; }
|
|
9
|
-
[data-graview-view-root] [data-graview-ring-inside]:focus-visible { outline-offset: calc(-1 * max(2px, var(--graview-focus-width, 2px))) !important; }
|
|
10
|
-
[data-graview-view-root] .graview-sr { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
|
|
11
|
-
[data-graview-view-root] a[href]:not([data-graview-link])::after { content: " \u2197" !important; content: " \u2197" / " (opens in a new tab)" !important; }
|
|
12
|
-
`,V=4,oe=16;function ie(r){let t=r.ownerDocument.defaultView?.getComputedStyle(r);if(!t)return V;let l=Number.parseFloat(t.outlineWidth)||0,h=Math.max(0,Number.parseFloat(t.outlineOffset)||0);return Math.min(oe,Math.max(V,Math.ceil(l+h)))}var se=new Set(["Enter"," ","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),$=["click","input","change","keydown"];function me(r,t){let l=r.ownerDocument,h=l.createElement("style");h.setAttribute("data-graview-region",""),h.textContent=re;let y=l.createElement("style");y.setAttribute("data-graview-view-style","");let g=l.createElement("div");g.setAttribute("data-graview-view-root",""),r.append(h,y,g);let E=H(g,{origin:t.origin,...t.asset?{asset:t.asset}:{},...t.imageOrigins?{imageOrigins:t.imageOrigins}:{},...t.picture?{picture:t.picture}:{},...t.link?{link:t.link}:{},...t.onRefused?{onRefused:t.onRefused}:{},...t.maxNodes!==void 0?{maxNodes:t.maxNodes}:{},...t.onOverBudget?{onOverBudget:t.onOverBudget}:{},decorate:(s,o,m)=>{m==="html"&&o==="button"&&s.setAttribute("type","button"),m==="html"&&(o==="input"||o==="textarea"||o==="select")&&s.setAttribute("autocomplete","off"),t.decorate?.(s,o,m)},...t.onFieldSet?{onFieldSet:t.onFieldSet}:{},...t.onAttribute?{onAttribute:t.onAttribute}:{}}),x=[],R="",S=s=>{for(let o=s.composedPath()[0];o&&o!==g&&o!==r;o=o.parentNode)if(o.nodeType===1&&E.idOf(o)!==void 0)return o},O=s=>{let o=S(s);if(!o||s.type==="keydown"&&!se.has(s.key))return;let m=t.before?.(s,o,g);if(m===!1)return;let w=o,b=o.namespaceURI==="http://www.w3.org/1999/xhtml"&&["input","select","textarea"].includes(o.localName);t.send({type:"dom-event",target:E.idOf(o),event:s.type,...b?{value:String(w.value??"")}:{},...b&&(w.type==="checkbox"||w.type==="radio")?{checked:w.checked}:{},...s.type==="keydown"?{key:s.key}:{},...m??{}});let k=s.type==="keydown"?s.key:void 0;(k==="Enter"||k===" ")&&o.hasAttribute("data-graview-press")&&s.composedPath()[0]===o&&(s.preventDefault(),t.send({type:"dom-event",target:E.idOf(o),event:"click"}))};for(let s of $)r.addEventListener(s,O);r.addEventListener("toggle",O,!0);let u=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("overflow-clip-margin","4px");return r.addEventListener("focusin",s=>{let o=s.composedPath()[0],m=r.host;if(!o||o.nodeType!==1||!g.contains(o))return;let w=ie(o);if(u){m.style.setProperty("--graview-ring-reach",`${w}px`);return}let b=m.getBoundingClientRect(),k=o.getBoundingClientRect(),e=w*(m.offsetWidth>0?b.width/m.offsetWidth:1),a=k.left-b.left<e||b.right-k.right<e||k.top-b.top<e||b.bottom-k.bottom<e;o.toggleAttribute("data-graview-ring-inside",a)}),{apply(s,o){let m=r.activeElement,w=m?E.idOf(m):void 0,b=E.apply(s,o);if(w!==void 0&&r.activeElement!==m){let k=E.elementOf(w);k?.isConnected&&typeof k.focus=="function"&&k.focus({preventScroll:!0})}return b},style(s){let o=M(s);x.length=0;for(let m of o.refused)x.push({reason:"css",name:"stylesheet",css:m}),x.length>200&&x.shift();R=o.css,y.textContent=R},renderer:E,get refused(){return[...E.refused,...x]},get css(){return R},dispose(){for(let s of $)r.removeEventListener(s,O);r.removeEventListener("toggle",O,!0),E.dispose(),r.replaceChildren()}}}export{re as REGION_CSS,me as createOpenDrawing,ee as handedLinks,te as judgeLink,ne as linkRefusedWords,ie as ringReach};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as V,b as _,c as F,d as $}from"./chunk.R7ZZJOJW.js";import"./chunk.AI2HBKVP.js";import{G as ee,O as B,P as H,T as L,ba as K}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Oc as T,R as z,Xa as N,Ya as I}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as A}from"./chunk.AJZBJBMO.js";function x(t,n){let r=N(t);return r==="agent"?"agent":r!=="human"&&r!=="visitor"?"app":t.onBehalfOf!==void 0?"person":t.id===void 0||n?.id===void 0||t.id===n.id?"you":"person"}var te=t=>t.ops.filter(n=>n.withheld!==!0);function U(t,n={}){let r=[];for(let e of t.batches()){let s=e.ops[0],d=e.ops.at(-1),c=te(e).length===0,h=c?void 0:_(e.ops),l=r.at(-1);if(h&&l?.typed&&l.author&&V(l.author,e.author)&&l.typed.node===h.node&&l.typed.field===h.field){let y=F(l.typed,h);r[r.length-1]={...l,seq:d.seq+1,at:d.at,batch:e.id,batches:[...l.batches??[],e.id],typed:y,said:$(y,t.schema,t.graph,!1)};continue}r.push({seq:d.seq+1,from:s.seq,at:d.at,batch:e.id,maker:c?"person":x(e.author,n.me),author:c?void 0:e.author,said:h?$(h,t.schema,t.graph,!1):e.intent,declaration:!1,withheld:c,...h?{batches:[e.id],typed:h}:{}})}let i=[...t.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...n.declarations??[]];for(let e of i){if(e.seq<t.log.horizon||e.seq>t.log.length)continue;let s=r.findIndex(d=>d.seq===e.seq);if(s>=0&&!r[s].withheld){r[s]={...r[s],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?x(e.author,n.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,s)=>e.seq-s.seq||+(e.batch!==void 0)-+(s.batch!==void 0))}function Y(t,n){let r=t.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return t.batches().filter(e=>!e.undone&&e.ops[0].seq>=n).filter(e=>!e.ops.every(s=>s.undoes!==void 0&&(i.get(s.undoes)??-1)>=n)).map(e=>e.id)}function G(t,n){return t.withheld?"Someone":t.maker==="you"?"you":t.author?I(t.author,n):"the app"}var p=A(ee(),1);var o=A(L(),1),ne={kind:"human"},ae=[1,2,4,8],re=900,R={you:"You",person:"A person",agent:"An agent",app:"The app"},X={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function oe(t,n,r){let i=r?Array.from({length:n},(e,s)=>s):[];return[...new Set([...i,n,...t.map(e=>e.seq)])].sort((e,s)=>e-s)}function se(t,n){let r=t.withheld===!0;return{seq:t.seq+1,from:t.seq,at:t.at,batch:t.batch,maker:r?"person":x(t.author,n),author:r?void 0:t.author,said:t.batchIntent??t.intent,declaration:!1,withheld:r}}function ie(t,n){let r=0;for(let i=0;i<t.length;i++)t[i]<=n&&(r=i);return r}function de(t,n,r){let i=Y(t,n);if(i.length===0)return null;let e=t.canUndo(i);if(!e.ok)return null;let s=new Set(t.permittedMutations(r).map(d=>d.name));return e.ops.every(d=>d.mutation!==null&&s.has(d.mutation.name))?i:null}function be({face:t}){let n=B(),r=K(),i=r?.principal??ne,e=H(n.live,i),s=e.log.length,d=(0,p.useMemo)(()=>U(e,{me:i,...n.host?.declarations?{declarations:n.host.declarations}:{}}),[e,i,n.host,s]),c=e.log.horizon,h=c>0&&n.host?.archived!==void 0,l=(0,p.useMemo)(()=>oe(d,c,h),[d,c,h]),y=n.archive,m=y?.seq??n.past?.seq??s,v=ie(l,m),f=l.length-1,M=m<c&&n.past?.seq===m?n.past.store.log.all().at(-1):void 0,k=M?se(M,i):m<c?void 0:[...d].reverse().find(a=>a.seq<=m&&a.seq>(l[v-1]??-1))??[...d].reverse().find(a=>a.seq<=m),[w,q]=(0,p.useState)(!1),[P,J]=(0,p.useState)(1),[D,E]=(0,p.useState)(null);(0,p.useEffect)(()=>{if(!w)return;if(v>=f){q(!1);return}let a=setTimeout(()=>n.show(l[v+1]),re/P);return()=>clearTimeout(a)},[w,v,f,P,l,n]);let j=(0,p.useMemo)(()=>n.past&&!y&&m>=c?de(e,m,i):null,[n.past,y,e,m,c,i,s]),C=a=>G(a,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),g=n.past?n.past.at?z(n.past.at,r?.locale):"the start":null,O=y?y.refused?"The archive could not be read":"Reading the older changes from the archive\u2026":k?`${C(k)==="you"?"You":C(k)}: ${k.said}`:"Nothing had happened yet",W=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let a=W.current,b=a?.parentElement;if(t!=="scene"||!a||!b)return;let u=()=>b.style.setProperty("--graview-sheet",`${Math.ceil(a.getBoundingClientRect().height)+24}px`);u();let S=typeof ResizeObserver>"u"?null:new ResizeObserver(u);return S?.observe(a),()=>{S?.disconnect(),b.style.removeProperty("--graview-sheet")}},[t]);let Q=t==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:T("rail")}:{position:"sticky",top:0,zIndex:T("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{ref:W,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":n.past?String(n.past.seq):"now","data-graview-offstage":"",style:{...Q,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,o.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:y?"Archived changes":g?`As of ${g}`:"Now"}),(0,o.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:O}),g?(0,o.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,o.jsxs)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:[h?(0,o.jsx)("span",{"data-testid":"timeline-archived",title:"Changes read from the archive as you scrub back",style:{position:"absolute",left:0,bottom:0,height:6,width:`${f===0?0:l.indexOf(c)/f*100}%`,borderRadius:2,background:"var(--graview-edge)"}}):null,l.slice(1).map((a,b)=>{let u=[...d].reverse().find(Z=>Z.seq===a);if(!u)return null;let S=f===0?0:(b+1)/f*100;return(0,o.jsx)("span",{"data-graview-tick":a,"data-maker":u.maker,...u.declaration?{"data-declaration":""}:{},title:`${R[u.maker]}: ${u.said}`,style:{position:"absolute",left:`calc(${S}% - 1px)`,bottom:0,width:u.declaration?4:2,height:u.declaration?22:12,borderRadius:2,background:u.declaration?"var(--graview-ink)":X[u.maker],opacity:a<=m?1:.45}},`${a}:${u.batch??"declaration"}`)})]}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:f,step:1,value:v,"aria-valuetext":g?`As of ${g}. ${O}`:`Now. ${O}`,onChange:a=>{q(!1),n.show(l[Number(a.currentTarget.value)]??s)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,o.jsx)("button",{type:"button","data-testid":"play","aria-pressed":w,onClick:()=>{!w&&v>=f&&n.show(l[0]),q(!w)},style:{minHeight:28,minWidth:64},children:w?"Pause":"Play"}),(0,o.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,o.jsx)("select",{"data-testid":"speed",value:P,onChange:a=>J(Number(a.currentTarget.value)),style:{minHeight:28},children:ae.map(a=>(0,o.jsxs)("option",{value:a,children:[a,"\xD7"]},a))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(R).filter(a=>d.some(b=>b.maker===a)).map(a=>(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:X[a]}}),R[a]]},a))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[j?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{E(null);try{e.undo([...j],{author:i,intent:g?`Restore to ${g}`:"Restore"}),n.show(null)}catch(a){E(a instanceof Error?a.message:String(a))}},style:{minHeight:28},children:"Restore to here"}):null,(0,o.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>n.show(null),style:{minHeight:28},children:"Back to now"})]})]}),D?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:D}):null,y?.refused?(0,o.jsx)("span",{role:"alert","data-testid":"archive-refused",style:{color:"var(--graview-warn)"},children:y.refused}):null,c>0&&!h?(0,o.jsx)("span",{"data-testid":"timeline-horizon",style:{color:"var(--graview-ink-faint)"},children:"The changes before the timeline's start were archived."}):null]})}export{be as Timeline};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.4LI73QOY.js";import"./chunk.G4JJXA63.js";import"./chunk.VGTEEANA.js";import"./chunk.SZCZD2GM.js";import"./chunk.XLM4ONUB.js";import"./chunk.XOZU4OFA.js";import"./chunk.C7EEYSAM.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.CHMUL36A.js";import"./chunk.U6PCKJ26.js";import"./chunk.FEBCIEI3.js";import"./chunk.WVUJXDXZ.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.VOHRQXCF.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
|
-
import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./chunk.63SRVTG2.js";import{a,b}from"./chunk.C4EPMV7O.js";import"./chunk.G7XKQNOL.js";import"./chunk.7KZ44FEU.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{j as ARRANGE_NARROW,o as ArrangeBar,e as CHIP_FIELDS,d as MANY_AT_THE_FAR_END,c as TYPED_FROM,p as arrangementCaption,a as arrangementOf,i as chipOffers,m as directionWords,g as farCount,f as farCounts,l as inSentence,h as offeredFilters,n as preloadArrangeLists,k as sayCondition,b as withArrangement};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as I,c as x}from"./chunk.7UXDIEPK.js";import"./chunk.AI2HBKVP.js";import{b,c as A,j as v,q as w,s as O,v as G}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Fd as E,Md as S,Nd as W,pd as k}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.KHRS2SKB.js";import"./chunk.25VJPUDH.js";import"./chunk.NB6WN4DO.js";import"./chunk.MBNZ2HK7.js";import"./chunk.NHIPVAGR.js";import{a as L,b as R,c as N}from"./chunk.R6FHEEJ7.js";import{b as T}from"./chunk.LESRQN3Y.js";import"./chunk.7UJZP3YK.js";import"./chunk.R77TACXU.js";import"./chunk.JOWJNIWH.js";import"./chunk.6JERQFZI.js";import"./chunk.7XJ3XQZD.js";import"./chunk.52J42KR5.js";import"./chunk.T2Q3AAQI.js";import"./chunk.63SRVTG2.js";import"./chunk.C4EPMV7O.js";import"./chunk.G7XKQNOL.js";import"./chunk.7KZ44FEU.js";import"./chunk.HJCQ6I3S.js";import"./chunk.JQBP6QWQ.js";import"./chunk.I2W7HSBU.js";import"./chunk.BJL6EL6B.js";import"./chunk.Y37DXEHG.js";import"./chunk.DXZ5VYCQ.js";import"./chunk.J2R55TM7.js";import"./chunk.KPUX27ZT.js";import"./chunk.DIS7JS7X.js";import"./chunk.D2T563AA.js";import"./chunk.JV7FLVUV.js";import"./chunk.GL3YVGAP.js";import"./chunk.VGTEEANA.js";import"./chunk.SZCZD2GM.js";import"./chunk.7FZY5E2U.js";import"./chunk.7354O67H.js";import"./chunk.XLM4ONUB.js";import"./chunk.XOZU4OFA.js";import"./chunk.C7EEYSAM.js";import"./chunk.ZJXUWOG3.js";import"./chunk.TI4OSTQV.js";import"./chunk.FEBCIEI3.js";import"./chunk.WVUJXDXZ.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.GZHZLJBF.js";import{r as C}from"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{G as S,I as $,T as p,aa as x,ca as A}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Oc as k,ca as h}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as i}from"./chunk.AJZBJBMO.js";var r=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function Y({page:n=!1,go:E,onPick:y,onDiscard:D}){let{store:d,seatTalk:c}=x(),u=$(c),M=N(),b=E??M,{keep:P}=L(b),[H,f]=(0,r.useState)(!1);A();let t=u.draft;(0,r.useEffect)(()=>f(!1),[t]),(0,r.useEffect)(()=>{n||R(!1)},[n]);let v=(0,r.useRef)(null),w=t!==null&&!n;if((0,r.useLayoutEffect)(()=>{let s=v.current;if(!w||!s?.parentElement)return;let o=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,o.push(a));return()=>{for(let a of o)a.inert=!1}},[w]),!t)return null;let G=T(t.drawn),F=d.schema.tryDefinition(t.kind),q=d.graph.nodesOfKind(t.kind).filter(s=>h(F,s)),z=()=>{c.setDraft(null),D?.()};return(0,e.jsxs)("section",{ref:v,"data-testid":"draft-frame","data-graview-draft-frame":n?"page":"scene","aria-label":`Draft: ${t.title}`,style:n?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:12,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:12,boxShadow:"var(--graview-lift-high)",overflow:"hidden",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...K,...n?{}:{padding:"10px 16px"}},children:[n?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),P(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:z,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:n?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,role:"group","aria-label":t.title,tabIndex:0,style:n?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let o=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!o||!d.graph.getNode(o))return;s.preventDefault();let a=d.graph.getNode(o);y?(c.setDraft(null),y(o)):b({to:"record",id:o,kind:a.kind,label:o,address:"",said:""})},children:(0,e.jsx)(C,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:q,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var K={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{Y as DraftFrame};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk.ZJXUWOG3.js";import"./chunk.TI4OSTQV.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{e as askArchived,b as askDeclaration,a as declarationAt,f as pastAt,d as pastOf,c as seqAt};
|
|
@@ -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{a as y}from"./chunk.DGWNVDZB.js";import{D as v,G as I,T as h,aa as w}from"./chunk.Q5IAXTF5.js";import{Ya as g}from"./chunk.VOHRQXCF.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function E({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function F({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.7IOC6U3C.js","./chunk.7FZY5E2U.js","./chunk.7354O67H.js","./chunk.XLM4ONUB.js","./chunk.XOZU4OFA.js","./chunk.C7EEYSAM.js","./chunk.DGWNVDZB.js","./chunk.TI4OSTQV.js","./chunk.3TME4BG3.js","./chunk.CV4QA4ZF.js","./chunk.OYRZ2DEI.js","./chunk.7EA7THSM.js","./chunk.AI2HBKVP.js","./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.2EB7COX5.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{E as a,F as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as U,b as X,c as L}from"./chunk.KVEDMKUN.js";import{a as O,b as R}from"./chunk.J263VQF5.js";import{a as _,e as Q}from"./chunk.RWCWRJJC.js";import{e as q,f as z,g as J}from"./chunk.NVNQSZ43.js";import"./chunk.FJEXINFF.js";import{G as K,Ha as I,Ia as M,M as T,O as G,T as D,ba as x,ia as v,la as V,ma as H,oa as C,qa as j}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b}from"./chunk.AJZBJBMO.js";var a=b(K(),1);var s=b(D(),1),Y=e=>({...e.node?{node:{id:e.node.id}}:{},...e.nodes?{nodes:e.nodes.map(t=>({id:t.id}))}:{},...e.label!==void 0?{label:e.label}:{},fidelity:e.fidelity,cardinality:e.cardinality,mode:e.mode,selected:e.selected,...e.implicated?{implicated:e.implicated}:{},...e.flagged?{flagged:e.flagged}:{}});function B(e){let t=G(),r=t?.past?.seq,i=t?.host?.viewAt,n=(0,a.useMemo)(()=>r===void 0||!i||e.draft?void 0:i(e.manifest.name,r),[i,r,e]);return(0,a.useMemo)(()=>n===null?null:n===void 0?e:{...e,worker:n},[n,e])}function E({definition:e,store:t,principal:r,input:i,goTo:n,places:o,scheme:c,brand:l,onFailure:u,drawsItsOwn:m,tick:f}){let p=(0,a.useRef)(null),w=(0,a.useRef)(null),y=T(),k=(0,a.useContext)(M),d=(0,a.useRef)({input:i,goTo:n,places:o,onFailure:u,brand:l,hostFiles:y,told:k});d.current={input:i,goTo:n,places:o,onFailure:u,brand:l,hostFiles:y,told:k},(0,a.useEffect)(()=>{let P=p.current;if(!P)return;let A=e.file??(d.current.hostFiles?.src?g=>d.current.hostFiles?.src?.(g)??g:void 0);typeof e.worker=="function"&&L(e.worker).catch(()=>{});let N=R(O,({mountWorkerView:g})=>{w.current=g(P,{manifest:e.manifest,worker:e.worker,store:t,principal:r,input:()=>d.current.input?.()??{},goTo:()=>d.current.goTo,places:()=>d.current.places?.()??[],brand:()=>d.current.brand,onFailure:(W,$)=>d.current.onFailure(W,$),...m?{fallback:!1}:{},...e.limits?{limits:e.limits}:{},...e.author?{author:e.author}:{},...e.onProblem?{onProblem:e.onProblem}:{},...e.asset?{asset:e.asset}:{},...A?{file:A}:{},...e.images?{images:e.images}:{},...e.links?{links:e.links}:{},files:()=>d.current.hostFiles,onContentHeight:W=>d.current.told?.(W)})});return()=>{N(),w.current?.dispose(),w.current=null}},[e,t,r]),(0,a.useEffect)(()=>w.current?.update(),[c,l,f]);let h=(0,s.jsx)("div",{ref:p,"data-worker-view-place":e.manifest.name});if(!e.draft)return h;let F=e.manifest.title??e.manifest.name;return(0,s.jsxs)("div",{role:"group","aria-label":`Draft: ${F}`,"data-graview-draft-view":e.manifest.name,style:{display:"grid",gap:8,alignContent:"start",minWidth:0},children:[(0,s.jsxs)("p",{"data-testid":"draft-view-line",style:Z,children:[(0,s.jsxs)("span",{children:["Draft \u2014 ",(0,s.jsx)("span",{style:{color:"var(--graview-ink)",fontWeight:600},children:F})]}),(0,s.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,s.jsx)("span",{children:"Not kept"})]}),h]})}var Z={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};function S(e,t={}){let r=t.fallback,i=e.manifest.replaces==="page";function n(o){let c=x(),l=v(),u=(0,a.useContext)(I),[m,f]=(0,a.useState)(null),p=(0,a.useRef)(o);p.current=o;let w=B(e);if(!c)return null;if(w===null)return r&&!(u&&V(r)&&!i)?(0,s.jsx)(r,{...o}):null;if(m&&r)return u&&V(r)&&!i?null:(0,s.jsx)(r,{...o});let y=t.beside&&!(u&&V(t.beside))?t.beside:void 0,k=(0,s.jsx)(E,{definition:w,store:c.store,principal:c.principal,input:()=>Y(p.current),goTo:l,places:()=>c.views.places(),scheme:c.scheme,brand:c.brand,tick:o,drawsItsOwn:r!==void 0,onFailure:(d,h)=>{f(d),e.onFailure?.(d,h)}});return y?(0,s.jsxs)("div",{"data-worker-view-beside":e.manifest.name,style:{display:"grid",gap:12,minWidth:0},children:[k,(0,s.jsx)(y,{...o})]}):k}return n.displayName=`WorkerView(${e.manifest.name})`,n}function ee(e,t){let{manifest:r}=t;if(r.attach==="home"){if(!e.home)throw new Error(`The worker view "${r.name}" is the home's body: draw it with workerHome, on the home.`);let m=t.draft?void 0:e.homeView?.(),f=S(t,m?{fallback:m}:{});return e.home(r.bleed===!0?C(f):f),e}let i={cardinality:r.cardinality,fidelity:"full"},n=e.lookup(r.attach,i)??e.resolve(r.attach,i)?.view,o=r.cardinality==="one",c=t.draft===!0,l=S(t,{...n&&!c?{fallback:n}:{},...o&&r.replaces!=="page"&&n?{beside:n}:{}});o&&r.replaces==="page"&&H(l);let u=n?.says;return o&&r.replaces!=="page"&&typeof u=="function"&&(l.says=u),r.bleed===!0&&C(l),l.flows=r.flows!==!1,j(l,r.scene?.maxHeight!==void 0?{maxHeight:r.scene.maxHeight}:{}),e.register(r.attach,i,l,r.title?{title:r.title,...c?{}:{name:r.name},lens:"view",...r.reads?.kinds?.length?{reads:r.reads.kinds}:{}}:void 0),e}function re(e,t={}){let r=t.fallback;function i({context:n}){let o=x(),c=v(),[l,u]=(0,a.useState)(null),m=B(e);return(l||m===null)&&r?(0,s.jsx)(r,{context:n}):m===null?null:(0,s.jsx)(E,{definition:m,store:n.store,principal:n.principal??o?.principal??{kind:"human"},goTo:c,...o?{places:()=>o.views.places(),scheme:o.scheme,brand:o.brand}:{},drawsItsOwn:r!==void 0,onFailure:(f,p)=>{u(f),e.onFailure?.(f,p)}})}return i.displayName=`WorkerHome(${e.manifest.name})`,i}export{z as checkManifest,U as checkViewSource,Q as judgeCodeAct,q as manifestActs,ee as registerWorkerView,_ as sightIsTotal,X as viewScript,re as workerHome,S as workerView,J as workerViewProps};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f}from"./chunk.CHMUL36A.js";import"./chunk.U6PCKJ26.js";import"./chunk.I43ONAEL.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import{Ab as a}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{a as ActRefusal,e as compileDocumentWithoutCheck,d as effectsOf,f as inDocumentWords,c as kindShapes,b as readDocument};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as U}from"./chunk.GL3YVGAP.js";import"./chunk.AI2HBKVP.js";import{G as ne,T as z,aa as R,da as $}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Pd as K,ob as W}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as L}from"./chunk.AJZBJBMO.js";var p=L(ne(),1);function b(e,t,a=!1){if(e<t.at||e===t.at&&a)return e;let o=t.at+t.removed.length;return e>=o?e+t.inserted.length-t.removed.length:a?t.at:t.at+t.inserted.length}var F=e=>e>=55296&&e<=56319,_=e=>e>=56320&&e<=57343;function X(e,t,a){let o=Math.min(e.length,t.length),n=0,l=Math.max(0,Math.min(o,t.length-a));for(;n<l&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;let r=0;for(;r<o-n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return r>0&&F(e.charCodeAt(r-1))&&r--,n>0&&_(e.charCodeAt(e.length-n))&&n--,{at:r,removed:e.slice(r,e.length-n),inserted:t.slice(r,t.length-n)}}function A(e,t){let a=Math.min(e.length,t.length),o=0;for(;o<a&&e.charCodeAt(o)===t.charCodeAt(o);)o++;o>0&&F(e.charCodeAt(o-1))&&o--;let n=0;for(;n<a-o&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;return n>0&&_(e.charCodeAt(e.length-n))&&n--,{at:o,removed:e.slice(o,e.length-n),inserted:t.slice(o,t.length-n)}}function Y(e,t){let a=s=>s.at+s.removed.length;if(a(e)<t.at)return e;if(e.at>a(t))return{...e,at:e.at+t.inserted.length-t.removed.length};let o=Math.min(e.at,t.at),n=a(e)-a(t),l=e.removed.slice(0,t.at-o)+t.inserted+(n>0?e.removed.slice(e.removed.length-n):""),r=t.at<=e.at?t.inserted+e.inserted:e.inserted+t.inserted,d=A(l,r);return{...d,at:o+d.at}}function V(e,t){let a=b(e.start,t,!0),o=e.end===e.start?a:b(e.end,t);return{start:a,end:Math.max(a,o)}}function re(e,t){let{kind:a,id:o,session:n}=e.author,l=`${a}:${o??""}:`;return t.startsWith(l)&&(!n||t.slice(l.length)===n)}function q(e,t,a,o){let n=e.anchor,l=e.head;for(let d of a)if(!(d.seq<e.rev||re(d,t)))for(let s of d.primitives)s.op!=="splice-text"||s.id!==e.node||s.field!==e.field||(n=b(n,s),l=b(l,s));let r=d=>Math.max(0,Math.min(o,d));return{start:r(n),end:r(l)}}var M=(e,t,a)=>e.ops.length>0&&e.ops.every(o=>{let n=o.mutation?.args;return o.mutation?.name===W&&n?.node===t&&n.field===a}),oe=(e,t,a,o)=>t.ops.length>0&&t.ops.every(n=>n.undoes!==void 0)&&e.batches().some(n=>t.ops.some(l=>l.undoes===n.id||l.undoes===n.ops[0]?.id)&&M(n,a,o)),G=(e,t)=>e.author.kind==="human"&&(t?.id===void 0||e.author.id===void 0||e.author.id===t.id);function I(e,t,a,o){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(!(!G(r,t)||r.undone||!M(r,a,o))&&e.canUndo(r.id).ok)return r.id}}function Z(e,t,a,o){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(G(r,t)){if(M(r,a,o))return;if(oe(e,r,a,o))return r.undone?void 0:r.id}}}var u=L(z(),1);function ie(e){let{store:t}=R(),{live:a,nodeId:o,field:n}=e,[l,r]=(0,p.useState)(null);return(0,p.useEffect)(()=>{let d=!0;return a.typing(o,n).then(s=>d&&r(s)),()=>{d=!1}},[o,n]),l&&!t.collaborative(o,n)?(0,u.jsx)(u.Fragment,{children:e.writtenWhole}):(0,u.jsx)(ae,{...e,typing:l})}function ae({nodeId:e,field:t,label:a,markdown:o,live:n,onDone:l,typing:r}){let{store:d,principal:s}=R(),f=$(e),h=J(f?.[t]),[v,ee]=(0,p.useState)(!1),y=(0,p.useRef)(null),E=(0,p.useRef)(h),w=(0,p.useRef)(!1),P=(0,p.useRef)(n);P.current=n;let B=()=>J(d.graph.getNode(e)?.[t]);(0,p.useEffect)(()=>y.current?.focus(),[v,r]);let x=(0,p.useRef)(void 0),T=()=>{x.current===void 0&&(x.current=setTimeout(()=>{x.current=void 0;let i=y.current;if(!i||i.ownerDocument.activeElement!==i)return;let c=i.selectionDirection==="backward";P.current.sayCaret({node:e,field:t,anchor:c?i.selectionEnd:i.selectionStart,head:c?i.selectionStart:i.selectionEnd,rev:d.log.length})},le))};(0,p.useEffect)(()=>()=>{clearTimeout(x.current),P.current.sayCaret(null)},[]);let D=i=>{let c=y.current;if(c){if(c.value!==i){let g=V({start:c.selectionStart,end:c.selectionEnd},A(c.value,i)),m=c.selectionDirection??"none";c.value=i,c.setSelectionRange(g.start,g.end,m)}E.current=i}},H=()=>{let i=y.current;if(!i||!r||w.current)return;let c=E.current,g=B(),m=X(c,i.value,i.selectionEnd);if(m.removed===""&&m.inserted==="")return D(g);let S=c===g?m:Y(m,A(c,g));try{r.splice(S.at,S.removed.length,S.inserted)}catch{}let k=B();if(i.value!==k){i.value=k;let N=Math.min(k.length,S.at+S.inserted.length);i.setSelectionRange(N,N)}E.current=k,T()};(0,p.useLayoutEffect)(()=>{w.current||D(h)},[h]);let te=async i=>{if(!r)return;r.flush();for(let g=0;r.waiting()>0&&g<100;g++)await new Promise(m=>setTimeout(m,30));let c=i?Z(d,s,e,t):I(d,s,e,t);if(c)try{i?d.redo(c,{author:s}):d.undo(c,{author:s})}catch{}},C=i=>{r?.flush(),n.sayCaret(null),l(i)},O=[...n.who.values()].filter(i=>i.caret?.node===e&&i.caret.field===t);return(0,u.jsxs)("div",{style:{display:"grid",gap:8,minWidth:0},"data-graview-live":t,children:[v?(0,u.jsx)("div",{"data-graview-preview":t,"aria-label":`${a}, as it will read`,role:"region",style:de,children:(0,u.jsx)(U,{text:h,markdown:!0})}):(0,u.jsxs)("div",{style:{position:"relative",minWidth:0},children:[(0,u.jsx)("textarea",{ref:y,"aria-label":a,"data-graview-field":t,defaultValue:h,readOnly:!r,rows:3,onInput:H,onCompositionStart:()=>{w.current=!0},onCompositionEnd:()=>{w.current=!1,H()},onSelect:T,onFocus:T,onPointerDown:()=>r?.flush(),onKeyDown:i=>{let c=i.key;c==="Escape"?(i.preventDefault(),C(!1)):(i.metaKey||i.ctrlKey)&&!i.altKey&&c.toLowerCase()==="z"?(i.preventDefault(),te(i.shiftKey)):(i.metaKey||i.ctrlKey)&&c==="Enter"?(i.preventDefault(),C(!1)):(c==="Enter"||ce.has(c))&&r?.flush()},onKeyUp:T,onBlur:i=>{r?.flush(),n.sayCaret(null);let c=i.relatedTarget;c instanceof Node&&i.currentTarget.closest("[data-graview-live]")?.contains(c)||C(!0)},style:ue}),O.length>0?(0,u.jsx)(se,{text:h,others:O,area:y,log:d.log.all()}):null]}),(0,u.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,u.jsx)("button",{type:"button",onClick:()=>C(!1),style:Q,children:"Done"}),o?(0,u.jsx)("button",{type:"button","aria-pressed":v,onClick:()=>ee(!v),style:Q,children:v?"Write":"Preview"}):null,(0,u.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Saved as you type \xB7 Ctrl or \u2318 Z takes back your typing"})]})]})}function se({text:e,others:t,area:a,log:o}){let n=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let s=a.current,f=n.current;if(!s||!f)return;let h=()=>{f.scrollTop=s.scrollTop};return h(),s.addEventListener("scroll",h),()=>s.removeEventListener("scroll",h)});let l=t.map(s=>({one:s,at:q(s.caret,s.participant,o,e.length).end})).sort((s,f)=>s.at-f.at),r=[],d=0;for(let{one:s,at:f}of l){r.push(e.slice(d,f)),d=f;let h=K(s)||"Somebody";r.push((0,u.jsx)("span",{"data-graview-caret":s.participant,title:`${h} is typing here`,style:{borderLeft:`2px solid hsl(${Math.round(s.hue)} 55% 52%)`,marginLeft:-1,marginRight:-1,pointerEvents:"auto"}},s.participant))}return r.push(`${e.slice(d)}\u200B`),(0,u.jsx)("div",{ref:n,"aria-hidden":"true",style:pe,children:r})}var le=120,J=e=>typeof e=="string"?e:"",ce=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]),de={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},Q={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},j={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",borderRadius:6},ue={...j,resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)"},pe={...j,position:"absolute",inset:0,height:"100%",border:"1px solid transparent",color:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word",overflow:"hidden",pointerEvents:"none"};export{ie as default};
|
|
@@ -1,25 +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{a as $e}from"./chunk.SDO3U72B.js";import{Ga as Xn,J as Zn,Ka as kt,Kd as so,Ma as Jn,Oc as to,Od as lo,Qd as ze,Rd as Rt,Ya as Qn,Yc as no,_c as oo,bd as ro,ed as io,rc as eo,ud as ao}from"./chunk.VOHRQXCF.js";import{a as qe,b as L}from"./chunk.AJZBJBMO.js";var To=qe(w=>{"use strict";var _t=Symbol.for("react.transitional.element"),ti=Symbol.for("react.portal"),ni=Symbol.for("react.fragment"),oi=Symbol.for("react.strict_mode"),ri=Symbol.for("react.profiler"),ii=Symbol.for("react.consumer"),ai=Symbol.for("react.context"),si=Symbol.for("react.forward_ref"),li=Symbol.for("react.suspense"),di=Symbol.for("react.memo"),xo=Symbol.for("react.lazy"),ui=Symbol.for("react.activity"),So=Symbol.iterator;function ci(e){return e===null||typeof e!="object"?null:(e=So&&e[So]||e["@@iterator"],typeof e=="function"?e:null)}var Eo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Po=Object.assign,Ao={};function ge(e,t,n){this.props=e,this.context=t,this.refs=Ao,this.updater=n||Eo}ge.prototype.isReactComponent={};ge.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ko(){}ko.prototype=ge.prototype;function Ht(e,t,n){this.props=e,this.context=t,this.refs=Ao,this.updater=n||Eo}var Dt=Ht.prototype=new ko;Dt.constructor=Ht;Po(Dt,ge.prototype);Dt.isPureReactComponent=!0;var wo=Array.isArray;function Lt(){}var O={H:null,A:null,T:null,S:null},Ro=Object.prototype.hasOwnProperty;function Nt(e,t,n){var o=n.ref;return{$$typeof:_t,type:e,key:t,ref:o!==void 0?o:null,props:n}}function pi(e,t){return Nt(e.type,t,e.props)}function jt(e){return typeof e=="object"&&e!==null&&e.$$typeof===_t}function fi(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vo=/\/+/g;function It(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fi(""+e.key):t.toString(36)}function yi(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Lt,Lt):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function me(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case _t:case ti:a=!0;break;case xo:return a=e._init,me(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+It(e,0):o,wo(r)?(n="",a!=null&&(n=a.replace(vo,"$&/")+"/"),me(r,t,n,"",function(c){return c})):r!=null&&(jt(r)&&(r=pi(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(vo,"$&/")+"/")+a)),t.push(r)),1;a=0;var s=o===""?".":o+":";if(wo(e))for(var l=0;l<e.length;l++)o=e[l],i=s+It(o,l),a+=me(o,t,n,i,r);else if(l=ci(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,i=s+It(o,l++),a+=me(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return me(yi(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function tt(e,t,n){if(e==null)return e;var o=[],r=0;return me(e,o,"","",function(i){return t.call(n,i,r++)}),o}function mi(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var bo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},gi={map:tt,forEach:function(e,t,n){tt(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tt(e,function(){t++}),t},toArray:function(e){return tt(e,function(t){return t})||[]},only:function(e){if(!jt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=ui;w.Children=gi;w.Component=ge;w.Fragment=ni;w.Profiler=ri;w.PureComponent=Ht;w.StrictMode=oi;w.Suspense=li;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Po({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Ro.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];o.children=a}return Nt(e.type,r,o)};w.createContext=function(e){return e={$$typeof:ai,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:ii,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Ro.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Nt(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:si,render:e}};w.isValidElement=jt;w.lazy=function(e){return{$$typeof:xo,_payload:{_status:-1,_result:e},_init:mi}};w.memo=function(e,t){return{$$typeof:di,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=O.T,n={};O.T=n;try{var o=e(),r=O.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(Lt,bo)}catch(i){bo(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),O.T=t}};w.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()};w.use=function(e){return O.H.use(e)};w.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)};w.useCallback=function(e,t){return O.H.useCallback(e,t)};w.useContext=function(e){return O.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return O.H.useEffect(e,t)};w.useEffectEvent=function(e){return O.H.useEffectEvent(e)};w.useId=function(){return O.H.useId()};w.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return O.H.useMemo(e,t)};w.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)};w.useRef=function(e){return O.H.useRef(e)};w.useState=function(e){return O.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return O.H.useTransition()};w.version="19.2.8"});var N=qe((es,Mo)=>{"use strict";Mo.exports=To()});var Wo=qe(rt=>{"use strict";var ki=Symbol.for("react.transitional.element"),Ri=Symbol.for("react.fragment");function jo(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:ki,type:e,key:o,ref:t!==void 0?t:null,props:n}}rt.Fragment=Ri;rt.jsx=jo;rt.jsxs=jo});var _e=qe((us,Go)=>{"use strict";Go.exports=Wo()});var pe={focusId:null,relation:null,expanded:[],pins:{}},Ue=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function J(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Ye(r.x)},${Ye(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Ye(e.pan.x)},${Ye(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function Yr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ze(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[m,f]of n){if(!m.startsWith("pin."))continue;let[g,x]=f.split(","),k=g===void 0?null:Ue(g),y=x===void 0?null:Ue(x);k===null||y===null||(o[m.slice(4)]={x:k,y})}let r=Object.create(null);for(let[m,f]of n)!m.startsWith("in.")||f.length===0||(r[m.slice(3)]=f);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],s=a[0]===void 0?null:Ue(a[0]),l=a[1]===void 0?null:Ue(a[1]),c=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),u=n.get("overview")==="1";return{...c.length>0?{selection:c}:{},...u?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...s!==null&&l!==null?{pan:{x:s,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:Yr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(u||!m.startsWith("kind:"))).sort(),pins:o}}function Da(e){let t=Ze(e);return J(t)==="#"?{...t,overview:!0}:t}function Na(e){let t=J(e);return t==="#overview=1"?"":t}function Ye(e){return Math.round(e*100)/100}function co(e,t){return J(e)===J(t)}var uo="edge:";function po(e){if(!e.startsWith(uo))return null;let t=e.slice(uo.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Tt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function z(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Tt(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function fo(e,t){return{...e,relation:t}}function ae(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function fe(e,t){if(t!==e.overview&&(e=Tt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function Xe(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Ie(e,t){if(t!==(e.zoom===!0)&&(e=Tt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Je(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var et="aggregate:",Qe="kind:";function Mt(e){return`${Qe}${e}`}function ye(e){return e.startsWith(Qe)?e.slice(Qe.length):null}var Ga="kinds:beyond";function Zr(e){let t=ye(e);return t?[t]:se(e)}function Q(...e){return`${et}${[...e].sort().join("+")}`}function yo(e){return e.startsWith(et)}function se(e){return!yo(e)||e.includes("|")?[]:e.slice(et.length).split("+").filter(Boolean)}function mo(e,t,n={}){let o=ye(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Je(e,t);let r=o!==null?Q(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Ie(e,!1);if(o!==null&&n.carry){let i=fe({...z(e,r),relation:null},!1);return ae(Ie(i,!0),"q",n.carry)}return Ie({...z(e,r),relation:null},!0)}function Xr(e,t,n){return ae(fe(z(e,Q(t)),!1),"view",n)}function Fa(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var go="aggregate:";function Ct(e){return e.startsWith(go)&&e.includes("|")}var Ot=e=>e?.off===!0,Jr=e=>e!==void 0&&!Ot(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),ho=e=>e!==void 0&&!Ot(e)&&(e.fast!==void 0||e.decide!==void 0),Qr=e=>e?.suggestOnOpen!==!1&&ho(e),ei=e=>e?.hoverChips===!0&&ho(e);var Vt={};var Co=L(N(),1),hi={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},Oo=e=>`graview:seat:${e}`;function Si(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function wi(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Wt(e){let t=e===null?null:Oo(e),n={...hi,...Si(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&wi(t,n);for(let s of[...o])s()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function vi(e){return(0,Co.useSyncExternalStore)(e.subscribe,e.get,e.get)}var Io=L(N(),1),bi={entries:[],ghost:null,loaded:!1};function Vo(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function Gt(e){let t=bi,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:Vo(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:Vo(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function xi(e){return(0,Io.useSyncExternalStore)(e.subscribe,e.get,e.get)}function Lo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var nt=L(N(),1),ot=(0,nt.createContext)(void 0),Ei=()=>(0,nt.useContext)(ot);var P=L(N(),1),Le=(0,P.createContext)(null);function Ho(){return(0,P.useContext)(Le)}function Pi(e,t){let n=Ho(),o=(0,P.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,P.useRef)(0),i=(0,P.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,P.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Do=$e(()=>(__graviewPreload(import.meta.url,["./chunk.ZJXUWOG3.js","./chunk.TI4OSTQV.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.PFXGWY3P.js")));function Ft(e){let[,t]=(0,P.useReducer)(o=>o+1,0),n=e.publishing?.mode==="on-publish"&&!no();return(0,P.useEffect)(()=>{n&&Do().then(t,()=>{})},[n]),!n}var _o,Ai=400;function Kt(e,t,n){let o=(0,P.useContext)(Le),r=o!==null&&o.owns(e,t),[i,a]=(0,P.useState)(null),[s,l]=(0,P.useState)(_o);(0,P.useEffect)(()=>{if(s||r||i===null)return;let b=!0;return Do().then(V=>{_o=V,b&&l(V)},()=>{}),()=>{b=!1}},[s,r,i]);let[c,u]=(0,P.useState)(0),m=(0,P.useMemo)(()=>r||i===null||i>=e.log.length||!s?void 0:s.askArchived(e,i,n)??s.askDeclaration(n,i),[r,e,i,n,s,c]),f=m&&"waiting"in m?m.waiting:void 0,g=m&&"seq"in m?m:null,[x,k]=(0,P.useState)(void 0);(0,P.useEffect)(()=>{if(!f)return;let b=!0,V=setTimeout(()=>b&&k(f),Ai);return f.then(()=>b&&u(I=>I+1)),()=>{b=!1,clearTimeout(V)}},[f]);let y=f!==void 0&&x!==f||g!==null,v=(0,P.useMemo)(()=>{if(r||i===null||i>=e.log.length||!s||y)return null;try{let b=s.pastAt(e,i,n);return{seq:i,at:b.past?.at,store:b}}catch{return null}},[r,e,i,n,s,y,c]),S=(0,P.useRef)(null),E=y?S.current:v;(0,P.useEffect)(()=>{S.current=E},[E]);let A=(0,P.useCallback)(b=>a(b===null?null:b>=e.log.length?Number.POSITIVE_INFINITY:b),[e]),F=(0,P.useCallback)((b,V)=>[e,E?.store].some(I=>I!==void 0&&(I===b||I.seenBy(V)===b)),[e,E]),H=i!==null,j=(0,P.useMemo)(()=>({past:E,open:H,show:A,live:e,host:n,owns:F,archive:g}),[E,H,A,e,n,F,g]);return r?o:j}var No=L(N(),1),Bt=(0,No.createContext)(null);var Fo=e=>`graview:setting:${e}`;function Ko(){return localStorage}function Bo(e,t){try{let n=(t??Ko()).getItem(Fo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function qo(e,t,n){try{(n??Ko()).setItem(Fo(e.name),t)}catch{}}function zo(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var _=L(N(),1);function qt(e){return ze(e)}var Ti=12,Mi=4;function Ci(e,t,n){let o=qt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var it=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Ti);function $o(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Mi)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?Mt([...o][0]):n[0]}function zt(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,s]of e)s.mode!=="asking"&&s.mode!=="docked"&&t.at-s.since>=t.holdMs&&o.set(a,{...s,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=Ci(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=$o(t.ids,n);return i({at:a,mode:"reading",trail:it(r.trail,a)}),o}case"about-to-write":case"write":{let a=$o(t.ids,n);return i({at:a,mode:"writing",trail:it(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:it(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:it(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var Uo="graview:session";function Yo(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(Uo);if(o)return o;let r=t();return n.setItem(Uo,r),r}catch{return t()}}var $t={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},Ut={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},Zo=[$t,Ut],Oi=800;function Xo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:s,settingValues:l,setView:c,ttlMs:u=lo,people:m,seats:f}=e,[g,x]=(0,_.useState)(()=>new Map),[k,y]=(0,_.useState)(null),[v,S]=(0,_.useState)(null),[E,A]=(0,_.useState)(null),F=typeof r.id=="string"&&r.id.length>0,H=F&&(l[$t.name]??$t.initial)==="shared",j=H&&(l[Ut.name]??Ut.initial)==="shared",b=qt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),V=F?Qn(r,{graph:n.graph,schema:n.schema,...f?{seats:f}:{},...m?{people:m}:{}}):"",I=s?a.get(`agent:${s}:${i}`):void 0,W=(0,_.useMemo)(()=>!t||!H?null:{participant:b,kind:r.kind,name:V,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:eo(r.id??"nobody"),stop:E??J(o),...j?{over:k}:{},...I?{robot:{at:I.at,mode:I.mode}}:{},at:new Date().toISOString()},[t,H,j,b,V,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,k,I?.at,I?.mode]),Ne=(0,_.useRef)(null),Ee=R=>R&&t?.here({...R,caret:Ne.current??void 0,at:new Date().toISOString()}),Pe=(0,_.useCallback)(R=>{Ne.current=R,Ee(W)},[t,W]);(0,_.useEffect)(()=>{if(!W)return;Ee(W);let R=setInterval(()=>Ee(W),Oi);return()=>clearInterval(R)},[t,W]),(0,_.useEffect)(()=>t?t.onWho(K=>x(Rt(new Map,K,Date.now(),u))):void 0,[t,u]);let Ae=g.size>0;(0,_.useEffect)(()=>{if(!Ae)return;let R=setInterval(()=>{x(K=>{let oe=Rt(K,[],Date.now(),u);return oe.size===K.size?K:oe})},Math.max(250,Math.min(1e3,u/4)));return()=>clearInterval(R)},[Ae,u]),(0,_.useEffect)(()=>{if(!t||typeof window>"u")return;let R=()=>t.leave();return window.addEventListener("pagehide",R),()=>window.removeEventListener("pagehide",R)},[t]),(0,_.useEffect)(()=>{if(!j||typeof document>"u")return;let R=null,K=oe=>{let de=Lo(oe.target);de!==R&&(R=de,y(de))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[j]);let le=(0,_.useRef)(null),B=v?g.get(v)??null:null,ne=(0,_.useCallback)(R=>{le.current=null,S(R)},[]);return(0,_.useEffect)(()=>{if(v){if(!B){S(null);return}B.stop!==le.current?.stop&&(le.current={stop:B.stop,at:Date.now()},c(Ze(B.stop)))}},[v,B,c]),(0,_.useEffect)(()=>{let R=le.current;!v||R===null||Date.now()-R.at<400||co(o,Ze(R.stop))||S(null)},[o,v]),(0,_.useEffect)(()=>{if(!v||typeof document>"u")return;let R=K=>{K.key==="Escape"&&S(null)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[v]),(0,_.useMemo)(()=>({who:g,sharing:W?{participant:b,name:V}:null,following:B,follow:ne,sayWhere:A,sayCaret:Pe}),[g,W,b,V,B,ne,Pe])}var U=L(N(),1);function Jo(e){return ze(e.author)}function Vi(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Qo(e,t,n,o,r){let i=new Map;for(let[l,c]of e)o-c.at<r&&i.set(l,c);let a=new Set(n.flatMap(l=>l.nodeIds)),s=(l,c,u)=>{let m=i.get(l),f=m?.participants.includes(Jo(c))?m.participants:[...m?.participants??[],Jo(c)];i.set(l,{at:o,manner:Vi(f,c.author.kind),intent:c.intent,wrote:(m?.wrote??!1)||(u.wrote??!1),read:(m?.read??!1)||(u.read??!1),broke:(m?.broke??!1)||a.has(l),participants:f})};for(let l of t){for(let c of l.writes)s(c,l,{wrote:!0});for(let c of l.reads)l.writes.includes(c)||s(c,l,{read:!0})}for(let l of n)for(let c of l.nodeIds){let u=i.get(c);i.set(c,{at:o,manner:u?.manner??"rule",intent:u?.intent??l.message,wrote:u?.wrote??!1,read:u?.read??!1,broke:!0,participants:u?.participants??["rule::"]})}return i}var Ii=2600;function er(e,t=Ii){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),a=(0,U.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let l=e.violations(),c=e.subscribe((u,m)=>{let f=e.violations(),g=io(e.allInvariants(),l,f).introduces;l=f,a(Qo(r.current,m,g.map(x=>({nodeIds:x.nodeIds,message:x.message})),Date.now(),t))});return()=>{c(),i.current&&clearTimeout(i.current)}},[e,t,a]);let s=(0,U.useCallback)(l=>{l.reads.length!==0&&a(Qo(r.current,[Li(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:s}}function Li(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var d=L(N(),1);function tr(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var at=L(N(),1),_i=e=>e.definitions.some(t=>Xn(t).size>0);function nr(e,t,n){let[o,r]=(0,at.useState)(void 0),i=(n.roles??[]).join("\0");return(0,at.useEffect)(()=>{if(!t||!_i(e.schema)){r(void 0);return}let a=!0,s=!1,l=e.graph,c=()=>{s||(s=!0,queueMicrotask(()=>{s=!1,a&&e.reread()}))},u=Jn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},c);return kt(l,u.read),r(u),e.reread(),()=>{a=!1,kt(l,void 0)}},[e,t,n.kind,n.id,i]),o}function or(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var ee=L(_e(),1),Hi="graview:place-menu",He=(0,d.createContext)(null),sr=(0,d.createContext)("scene");function Di({mode:e,children:t}){return(0,ee.jsx)(sr.Provider,{value:e,children:t})}function Ni(){return(0,d.useContext)(sr)}var lr={kind:"human"},ji=[],Wi=[],Gi=[],Yt=[];function dr(e,t){let n=(0,d.useId)();(0,d.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??lr,r=()=>ro(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var Fi=()=>{try{return typeof location<"u"&&new URLSearchParams(location.search).get("as")==="published"?"published":void 0}catch{return}},Ki={off:!0};function Bi({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,as:a,seats:s=ji,onSeat:l,people:c=Wi,memory:u,presenceTtlMs:m,app:f,settings:g=f?.settings??Gi,presence:x,typing:k,brand:y,locale:v,timeZone:S,onKeepLens:E,providers:A,ai:F,files:H,resolveApp:j,history:b,linkedRecords:V,menuSections:I,keptViews:W,onExport:Ne,subscriptions:Ee,dismissals:Pe,whileAway:Ae,signIn:le,view:B,onViewChange:ne,children:R}){let K=(0,d.useContext)(He),oe=I??K?.menuSections,de=le??K?.signIn,ht=W??K?.keptViews,St=Ne??K?.onExport,[_r,Hr]=(0,d.useState)(null),ue=_r??i??s[0]?.principal??lr,je=Kt(e,ue,b),fn=je.past&&je.live===e?je.past.store:e,wt=a??Fi(),vt=!Ft(e),D=(0,d.useMemo)(()=>vt?e:fn.seenBy(ue,wt?{as:wt}:void 0),[vt,e,fn,ue,wt]);dr(e,ue);let[re]=(0,d.useState)(()=>Yo(u)),[yn,Dr]=(0,d.useState)(!1),mn=(0,d.useCallback)(()=>Dr(!0),[]),ie=(0,d.useMemo)(()=>x?[...g,...Zo]:g,[g,x]),[bt]=(0,d.useState)(()=>n??Qt(t,e.schema)),[Nr,gn]=(0,d.useState)(()=>Xe(bt??pe,r??bt?.selection??[])),ke=(0,d.useRef)(bt??pe).current,[hn,jr]=(0,d.useState)(null),[Sn,Wr]=(0,d.useState)(null),Z=(0,d.useContext)(He),[wn]=(0,d.useState)(()=>Z?.seatTalk??Wt(y?.name??e.schema.kinds.join(","))),xt=F??Z?.ai??Vt,We=(0,d.useMemo)(()=>xt.off?Ki:xt,[xt]),vn=(0,d.useRef)(We.interactions);vn.current=We.interactions;let[bn]=(0,d.useState)(()=>Z?.aiDesk??Gt(()=>vn.current)),[Gr]=(0,d.useState)(()=>Z?.subscriptions??oo()),xn=Ee??Z?.subscriptions??Gr,Et=E??Z?.onKeepLens,Ge=f??Z?.app,Fe=v??Z?.locale,Fr=y?.locale??Ge?.brand?.locale,Ke=S??Z?.timeZone;Zn({reader:Fe,app:Fr,readerTimeZone:Ke,appTimeZone:y?.timeZone??Ge?.brand?.timeZone});let En=(0,d.useRef)(null),Pn=(0,d.useCallback)(p=>{En.current=p},[]),An=(0,d.useCallback)(p=>En.current?.whereIs(p)??null,[]),[kn]=(0,d.useState)(()=>tr()),[Rn]=(0,d.useState)(()=>or()),[Pt,Kr]=(0,d.useState)(null),[Re,Tn]=(0,d.useState)(()=>new Map),Te=(0,d.useRef)(Re);Te.current=Re;let Me=(0,d.useRef)(null),At=(0,d.useCallback)(p=>D.graph.getNode(p)?.kind,[D]),X=(0,d.useCallback)(p=>{let h=zt(Te.current,p,At);Te.current=h,Tn(h),Me.current&&clearTimeout(Me.current),[...h.values()].some(C=>C.mode!=="docked"&&C.mode!=="asking")&&(Me.current=setTimeout(()=>{let C=zt(Te.current,{type:"rest",at:Date.now(),holdMs:Jt},At);Te.current=C,Tn(C)},Jt+20))},[At]),Mn=(0,d.useCallback)(p=>X({...p,at:p.at??Date.now()}),[X]),Cn=(0,d.useCallback)(p=>{Kr(p),p&&X({type:"home",author:{kind:"agent",id:p,session:re},at:Date.now()})},[X,re]);(0,d.useEffect)(()=>D.subscribe((p,h)=>{for(let T of h)T.author.kind==="agent"&&X({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[D,X]),(0,d.useEffect)(()=>()=>{Me.current&&clearTimeout(Me.current)},[]);let $=(0,d.useMemo)(()=>({...ue,session:re}),[ue,re]),On=nr(D,V,$),Vn=(0,d.useCallback)(p=>{Hr(p),l?.(p)},[l]),[Ce,Br]=(0,d.useState)(()=>Object.fromEntries(ie.map(p=>[p.name,Bo(p,u)])));(0,d.useEffect)(()=>{for(let p of ie)zo(p,Ce[p.name]??p.initial)},[ie,Ce]);let In=(0,d.useCallback)((p,h)=>{let T=ie.find(C=>C.name===p);!T||!T.options.some(C=>C.value===h)||(qo(T,h,u),Br(C=>({...C,[p]:h})))},[ie,u]),[Ln,qr]=(0,d.useState)(null),{activity:_n,noteAttention:Hn}=er(D),Dn=(0,d.useCallback)(p=>{Hn(p),X({type:"read",author:p.author,ids:p.reads,at:Date.now()})},[Hn,X]),ce=(0,d.useCallback)(p=>{if(ye(p)!==null||se(p).length>0||Ct(p))return!0;let h=po(p);return h?D.graph.allEdges().some(T=>T.kind===h.kind&&T.from===h.from&&T.to===h.to):D.graph.getNode(p)!==void 0},[D]),Nn=(0,d.useCallback)(p=>{let h=p.selection??Yt,T=h.filter(ce),C=T.length===h.length?p:Xe(p,T);return C.focusId!==null&&!ce(C.focusId)&&(C=z(C,null)),C},[ce]),Oe=(0,d.useCallback)(p=>{let h=Nn(p),T=ar(D,$,h.shown);if(h.focusId!==null&&T.size>0){let C=se(h.focusId),Yn=D.graph.getNode(h.focusId);(C.length>0?C.every(Ur=>T.has(Ur)):Yn?T.has(Yn.kind):!1)&&(h={...h,focusId:null})}if(!h.overview&&h.focusId===null){let C=ke.focusId!==null&&!ce(ke.focusId)?Qt(t,e.schema)??{...pe,overview:!0}:ke;C.focusId!==null&&ce(C.focusId)?h={...h,focusId:C.focusId}:C.overview===!0&&(h={...h,overview:!0})}return h},[Nn,ce,D,ke,$,t,e.schema]),q=Oe(B??Nr),jn=(0,d.useMemo)(()=>ar(D,$,q.shown),[D,$,q.shown]),Wn=(0,d.useMemo)(()=>[...D.modules.administered.entries()].map(([p,h])=>{let T=D.mayAdminister(p,$);return{name:p,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:T,shown:T&&(q.shown??[]).includes(p)}}),[D,$,q.shown]),Ve=(0,d.useCallback)(p=>{let h=T=>Oe(typeof p=="function"?p(T):p);if(B!==void 0){ne?.(h(B));return}ne&&ne(h(q)),gn(T=>h(T))},[q,ne,B,Oe]);(0,d.useEffect)(()=>{B===void 0&&gn(p=>{let h=Oe(p);return h===p?p:h})},[q,B,Oe]);let Gn=q.selection??Yt,Fn=(0,d.useCallback)(p=>{Ve(h=>Xe(h,typeof p=="function"?p(h.selection??Yt):p))},[Ve]),{who:Be,following:Kn,follow:Bn,sayWhere:zr,sayCaret:qn,sharing:zn}=Xo({channel:x,store:D,view:q,principal:$,session:re,robots:Re,seatWho:Pt,settingValues:Ce,setView:Ve,seats:s,people:c,...m!==void 0?{ttlMs:m}:{}}),$r=(0,d.useMemo)(()=>({store:D,scheme:o,views:t,view:q,setView:Ve,homeView:ke,selection:Gn,setSelection:Fn,menuAt:hn,setMenuAt:jr,whereIs:An,pointer:kn,motion:Rn,registerScene:Pn,robots:Re,noteSeat:Mn,seatWho:Pt,registerSeatWho:Cn,actsDoor:Sn,registerActsDoor:Wr,seatTalk:wn,aiDesk:bn,...u?{memory:u}:{},who:Be,following:Kn,follow:Bn,sayWhere:zr,sharing:zn,session:re,ai:We,resolveApp:j,linkedRecords:V,menuSections:oe,...ht?{keptViews:ht}:{},...St?{onExport:St}:{},subscriptions:xn,dismissals:Pe,whileAway:Ae,signIn:de,linkedReads:On,movedByHand:yn,noteMoved:mn,emphasis:Ln,setEmphasis:qr,activity:_n,noteAttention:Dn,principal:$,seats:s,people:c,takeSeat:Vn,settings:ie,settingValues:Ce,chooseSetting:In,hiddenKinds:jn,administered:Wn,...A?{providers:A}:{},...y?{brand:y}:{},...Et?{onKeepLens:Et}:{},app:Ge,...Fe?{locale:Fe}:{},...Ke?{timeZone:Ke}:{}}),[D,o,t,q,Ve,Gn,Fn,hn,An,kn,Rn,Pn,Re,Mn,Pt,Cn,Sn,wn,bn,u,Be,Kn,Bn,zn,re,We,j,V,oe,ht,St,xn,Pe,Ae,de,On,yn,mn,Ln,_n,Dn,$,s,c,Vn,ie,Ce,In,jn,Wn,A,y,Et,Ge,Fe,Ke]),$n=(0,d.useMemo)(()=>k?{typing:k,sayCaret:qn,who:Be}:null,[k,qn,Be]),Un=H?(0,ee.jsx)(ot.Provider,{value:H,children:R}):R;return(0,ee.jsx)(He.Provider,{value:$r,children:(0,ee.jsx)(Le.Provider,{value:je,children:(0,ee.jsx)(Yi,{children:vt?null:$n?(0,ee.jsx)(Bt.Provider,{value:$n,children:Un}):Un})})})}var ur=(0,d.createContext)(null),Zt,Xt=new Set,qi=e=>(Xt.add(e),()=>void Xt.delete(e)),rr=()=>Zt;function zi(e){if(!Zt){Zt=e;for(let t of[...Xt])t()}}var $i=300;function Ui(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,$i)),r===t?e(n,o):[]}}function Yi({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:s}=te(),l=st(),c=n.q,u=n.focusId,m=!!(c&&c.trim().length>0),f=(0,d.useSyncExternalStore)(qi,rr,rr),g=(0,d.useMemo)(()=>m&&f?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:f.touchWeights(t.log.all())}:null,[t,l,m,f]),x=u?t.graph.getNode(u)?.kind??ye(u)??(se(u).length===1?se(u)[0]:void 0):void 0,k=(0,d.useMemo)(()=>s.near&&Ui(s.near),[s.near]),y=(0,d.useMemo)(()=>!c||!g||!f?null:f.search(t,c,{...x?{inKind:x}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...u&&t.graph.has(u)?[u]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:k}),[t,c,r,o,i,a,u,x,g,k]),[v,S]=(0,d.useState)();return(0,d.useEffect)(()=>void y?.later?.then(E=>S([y,E])),[y]),(0,ee.jsx)(ur.Provider,{value:v?.[0]===y?v[1]:y,children:e})}var ir=new WeakMap;function Gs(e){let t=ir.get(e);return t||ir.set(e,t=new Set(e.matched)),t}function Zi(){return(0,d.useContext)(ur)}function te(){let e=(0,d.useContext)(He);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function en(){return(0,d.useContext)(He)??null}function st(){let{store:e}=te(),t=(0,d.useRef)(null),n=(0,d.useRef)(null),o=(0,d.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,d.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,d.useSyncExternalStore)(r,o,o)}function Xi(e){let{store:t}=te(),n=(0,d.useCallback)(r=>t.subscribe(r),[t]),o=(0,d.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,d.useSyncExternalStore)(n,o,o)}function ar(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var Jt=2600;var cr=new WeakSet,Ji=e=>cr.has(e),Qi=e=>void cr.add(e);function Qt(e,t){let n=so(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...pe,focusId:Q(n.place.kind),within:{view:n.place.as}}:{...pe,focusId:Q(n.kind)}}var pr=L(N(),1),ea=(0,pr.createContext)(!1);var lt=Symbol.for("graview.default-view");function fr(e){return Object.defineProperty(e,lt,{value:!0,enumerable:!1}),e}function yr(e){return typeof e=="function"&&e[lt]===!0}var dt=Symbol.for("graview.replaces-page");function mr(e){return Object.defineProperty(e,dt,{value:!0,enumerable:!1}),e}function gr(e){return typeof e=="function"&&e[dt]===!0}var ut=Symbol.for("graview.bleeds");function hr(e){return Object.defineProperty(e,ut,{value:!0,enumerable:!1}),e}function Sr(e){return typeof e=="function"&&e[ut]===!0}var ct=Symbol.for("graview.previews");function wr(e,t={}){return Object.defineProperty(e,ct,{value:t,enumerable:!1}),e}function vr(e){return typeof e=="function"?e[ct]:void 0}function ta(e){return ao(e)}function na(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var M=L(N(),1),Y=L(_e(),1),tn=new Set,pt=0;function nn(e){return()=>{pt+=1;let t=e();return t.then(()=>void(pt-=1),()=>void(pt-=1)),t}}var oa=()=>pt,yt=(0,M.createContext)(null);function ra(){return{waiting:new Map,at:0}}function ia(e){for(let[t,n]of e.waiting)n<e.at&&e.waiting.delete(t);e.at+=1}var aa=e=>e?.waiting.size??0;function Er(e,t){e?.waiting.set(t,e.at)}function Pr(e){let t=(0,M.useContext)(yt);(0,M.useLayoutEffect)(()=>{t?.waiting.delete(e)},[t,e])}function sa(e){let t={},n=!1,o=new Set,r=(0,M.lazy)(nn(()=>e().then(a=>{n=!0;let s=a.default;function l(c){return Pr(t),(0,M.createElement)(s,c)}return{default:l}},a=>{for(let s of o)s.waiting.delete(t);throw a})));function i(a){let s=(0,M.useContext)(yt);return!n&&s&&(o.add(s),Er(s,t)),(0,M.createElement)(r,a)}return i}var Ar=!1,kr=!1,ft=new Set;function la(){Ar=!0}function da(){kr=!0;for(let e of[...ft])e();ft.clear()}var Rr=()=>kr||!Ar;function ua(e){return Rr()?(e(),()=>{}):(ft.add(e),()=>void ft.delete(e))}var br=!1;function on(){for(let e of[...tn])e()}function ca(){br||typeof window>"u"||(br=!0,window.addEventListener("online",on))}function rn(e){let t,n=!1,o=!1,r,i=0,a=new Set,s=()=>{i+=1;for(let f of[...a])f()},l=f=>(a.add(f),()=>void a.delete(f)),c=()=>i,u=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let f=e().then(g=>(t=g,n=!0,o=!1,r=void 0,tn.delete(u),s(),g),g=>{throw r=void 0,o=!0,tn.add(u),ca(),s(),g});return f.catch(()=>{}),r=f,f}return{load:m,prefetch:u,get current(){return t},get failed(){return o},part(f,g={}){let x=g.what??"This part",k={};function y(E){(0,M.useSyncExternalStore)(l,c,c),Pr(k);let A=(0,M.useRef)(null),F=(0,M.useRef)(null),H=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{o&&r===void 0&&u()},[]),n&&typeof document<"u"&&A.current!==null&&document.activeElement===A.current&&(H.current=!0),(0,M.useLayoutEffect)(()=>{if(!(!n||!H.current)){H.current=!1;for(let j=F.current?.nextElementSibling??null;j!==null;j=j.nextElementSibling){let b=j.matches(xr)?j:j.querySelector(xr);if(b instanceof HTMLElement){b.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[H.current?(0,Y.jsx)("span",{ref:F,hidden:!0}):null,f(t,E)]}):g.quiet?null:(0,Y.jsx)(pa,{what:x,button:A,...g.as?{as:g.as}:{}})}let v=(0,M.lazy)(nn(()=>m().then(()=>({default:y}),()=>({default:y}))));function S(E){let A=(0,M.useContext)(yt),[F]=(0,M.useState)(()=>n||o);return!n&&!o&&Er(A,k),(0,M.createElement)(F?y:v,E)}return S}}}var xr="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function pa({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,Y.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Y.jsx)("span",{role:"status",children:r})," ",(0,Y.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:on,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var Se=L(N(),1);function fa(){let{selection:e,setSelection:t}=te();return(0,Se.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function ya(){let{store:e}=te(),t=st();return(0,Se.useMemo)(()=>ma(e),[e,t])}var Tr=new WeakMap;function ma(e){let t=Tr.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Tr.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function ga(){let{view:e,setView:t}=te();return(0,Se.useMemo)(()=>({view:e,url:J(e),focus:n=>t(o=>z(o,n)),show:n=>t(o=>fo(o,n)),toggle:n=>t(o=>Je(o,n)),go:n=>t(n)}),[e,t])}var he={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;he.at=typeof t?.graview=="number"?t.graview:0,he.at>he.depth&&(he.depth=he.at),he.tell()});var G=L(N(),1),sn={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},ha={position:"fixed",inset:"auto",margin:0,zIndex:to("popover"),boxSizing:"border-box"},mt=6,we=8,Sa=e=>typeof e.showPopover=="function";function gt(e){try{return e.matches(":popover-open")}catch{return!1}}function wa(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function ln(e,t,n={}){let o=wa(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),s=r.height-o.bottom-mt-we,l=o.top-mt-we,c=a.height<=s||s>=l,u=Math.max(96,Math.floor(c?s:l)),m=Math.min(a.height,u);a.height>u&&(e.style.maxHeight=i?`min(${i}, ${u}px)`:`${u}px`);let f=a.width,g=n.align==="start"?o.left:o.right-f,x=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();x&&f<=x.right-x.left&&(g<x.left?g=o.left+f<=x.right?o.left:x.left:g+f>x.right&&(g=o.right-f>=x.left?o.right-f:x.right-f));let k=f>=r.width-2*we?Math.max(0,(r.width-f)/2):Math.max(we,Math.min(g,r.width-we-f)),y=c?o.bottom+mt:Math.max(we,o.top-mt-m);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(y)}px`}function Mr(e,t,n,o={}){let r=o.align??"end";(0,G.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Sa(i)&&!gt(i))try{i.showPopover(),ba()}catch{}let a=0,s=c=>{c?.target instanceof Node&&i.contains(c.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>ln(i,n,{align:r})))};ln(i,n,{align:r}),addEventListener("resize",s),addEventListener("scroll",s,!0);let l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>s());return l?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",s),removeEventListener("scroll",s,!0),l?.disconnect(),i.isConnected&>(i))try{i.hidePopover()}catch{}}},[t,e,r])}var dn=new Set;function va(e){return dn.add(e),()=>dn.delete(e)}function ba(){for(let e of dn)if(!(!e.isConnected||!gt(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ve=null,xa='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Ea(e){for(let t of e.querySelectorAll(xa))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var an=()=>{let e=document.activeElement;return e===null||e===document.body};function Pa(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,s]=(0,G.useState)(!1),l=t.open??a,c=(0,G.useRef)(null),u=(0,G.useRef)(null),m=(0,G.useCallback)(S=>{c.current=S},[]),f=(0,G.useCallback)(S=>{u.current=S},[]),g=`graview-popover-${(0,G.useId)().replace(/:/g,"")}`,x=(0,G.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});x.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,G.useCallback)(S=>{x.current.controlled||s(S),x.current.onOpenChange?.(S)},[]),y=(0,G.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??c.current??x.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),v=(0,G.useCallback)(S=>{let E=u.current,A=typeof document>"u"?null:document.activeElement,F=A===null||A===document.body||E!==null&&E.contains(A);k(!1),!(!S||!F)&&(y(),requestAnimationFrame(()=>{an()&&y()}))},[k,y]);return Mr(u,i&&l,n??c,t.align?{align:t.align}:{}),(0,G.useEffect)(()=>{if(!i||!l)return;let S={name:e,close:()=>v(!1)};if(ve&&ve.close!==S.close&&ve.close(),ve=S,sn[e].focus==="into"){let b=u.current;b&&!b.contains(document.activeElement)&&Ea(b).focus({preventScroll:!0})}let E=b=>{b.key==="Escape"&&v(!0)},A=b=>{let V=b.target;if(!(V instanceof Node))return;let I=u.current;if(I?.contains(V)||c.current?.contains(V))return;let W=V instanceof Element?V.closest('[role="dialog"], [role="alertdialog"]'):null;W&&!(I&&W.contains(I))||(v(!1),sn[e].focus==="into"&&requestAnimationFrame(()=>{(an()||I!==null&&I.contains(document.activeElement))&&y()}))},F=null,H=null,j=b=>{let V=b.target;if(!(V instanceof Element))return;let I=u.current,W=V.closest('[role="dialog"], [role="alertdialog"]');!W||I&&(I.contains(W)||W.contains(I))||(F=W,v(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",A,!0),document.addEventListener("focusin",j),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",A,!0),document.removeEventListener("focusin",j);let b=F;b&&typeof MutationObserver<"u"&&(H?.disconnect(),H=new MutationObserver(()=>{b.isConnected||(H?.disconnect(),requestAnimationFrame(()=>{(an()||document.activeElement.closest("[hidden]")!==null)&&y()}))}),H.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>H?.disconnect(),10*6e4)),ve?.close===S.close&&(ve=null)}},[i,l,e,v,y]),{open:l,setOpen:S=>S?k(!0):v(!0),toggle:()=>l?v(!0):k(!0),trigger:{ref:m,"aria-expanded":l,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:f,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var be=L(N(),1);var Cr=(0,be.createContext)(null);function Aa(){let e=(0,be.useContext)(Cr),t=en(),n=(o,r,i)=>t?.setView(a=>ae(ae(fe(z(a,Q(o)),!1),"view",r),"filter",i?.filter??null));return(0,be.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>z(fe(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var xe=L(N(),1);var ka=rn($e(()=>(__graviewPreload(import.meta.url,["./chunk.Q5IAXTF5.js","./chunk.SDO3U72B.js","./chunk.VOHRQXCF.js","./chunk.SLBWPVIY.js","./chunk.AJZBJBMO.js"]),import("./chunk.HST7BYFW.js"))));function Ra(e,t,n){let o,r=!1,i=()=>{let{hidden:s,removed:l}=t.current();o||r||s.length+l.length===0||(o=()=>{},ka.load().then(c=>{r||(o=c.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function Ta(e,t){let[n,o]=(0,xe.useState)();return(0,xe.useEffect)(()=>t?Ra(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var Or=L(N(),1),Ma=(0,Or.createContext)(!1);var un=L(N(),1),Ca=(0,un.createContext)(null),Oa=(0,un.createContext)(null);var Vr=L(N(),1),Va=(0,Vr.createContext)(null);var Ir=L(N(),1),cn='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',pn=e=>e instanceof HTMLElement&&(e.matches(cn)||e.hasAttribute("tabindex")),De=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Ia(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let s=e.querySelector(a);return s&&pn(s)&&De(s)?s:null}var La=e=>e.isConnected&&pn(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&De(e);function Lr(e,t){let n=t?Ia(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&De(o))return o;for(let r of e.querySelectorAll(cn))if(De(r))return r;return pn(e)&&De(e)?e:null}function _a(e){(0,Ir.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=y=>{let v=y.target;if(v instanceof Element){n=[];for(let S=v;S&&S!==t.parentElement;S=S.parentElement)n.push(S)}},r=!1,i=!1,a=t.ownerDocument,s=()=>!i&&a.defaultView!==null,l=(y,v)=>void setTimeout(()=>s()&&v(),y),c=y=>void requestAnimationFrame(()=>s()&&y()),u=y=>{if(r=!1,i)return;let v=a.activeElement;if(!(!(v===null||v===a.body||v===a.documentElement)||n.length===0)){if(La(n[0])){y&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let A=Lr(E,n[0]);if(A){A.focus({preventScroll:!0}),n=[];return}}}},m=(y,v=Date.now()+2500)=>{l(100,()=>{u(y);let S=a.activeElement;(S===null||S===a.body||S===a.documentElement)&&n.length>0&&Date.now()<v&&m(y,v)})},f=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{u(!1),m(!1)})))},g=y=>{if(!(y instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(y.key))){if(!(y instanceof KeyboardEvent)){let v=y.target instanceof Element?y.target.closest(cn):null,S=a.activeElement,E=S===null||S===a.body||S===a.documentElement;if(v&&E&&t.contains(v)){n=[];for(let A=v;A&&A!==t.parentElement;A=A.parentElement)n.push(A);l(150,()=>c(()=>{u(!1),m(!1)}));return}}!(y instanceof KeyboardEvent)&&!(y.target instanceof Node&&n[0]?.contains(y.target))||l(150,()=>c(()=>{u(!0),m(!0)}))}},x=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&f()}),k=y=>{y.relatedTarget===null&&f()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),x.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),x.disconnect()}},[e])}export{pe as a,J as b,Ze as c,Da as d,Na as e,co as f,uo as g,po as h,Tt as i,z as j,fo as k,ae as l,fe as m,Xe as n,Ie as o,Je as p,et as q,Mt as r,ye as s,Ga as t,Zr as u,Q as v,yo as w,se as x,mo as y,Xr as z,Fa as A,go as B,Ct as C,Jr as D,Qr as E,ei as F,N as G,Wt as H,vi as I,xi as J,Lo as K,ot as L,Ei as M,Le as N,Ho as O,Pi as P,Ft as Q,Kt as R,Bt as S,_e as T,Hi as U,Di as V,Ni as W,dr as X,Bi as Y,zi as Z,Gs as _,Zi as $,te as aa,en as ba,st as ca,Xi as da,Ji as ea,Qi as fa,Qt as ga,Cr as ha,Aa as ia,ea as ja,fr as ka,yr as la,mr as ma,gr as na,hr as oa,Sr as pa,wr as qa,vr as ra,ta as sa,na as ta,nn as ua,oa as va,yt as wa,ra as xa,ia as ya,aa as za,sa as Aa,la as Ba,da as Ca,Rr as Da,ua as Ea,rn as Fa,Ta as Ga,Ma as Ha,Ca as Ia,Oa as Ja,Va as Ka,fa as La,ya as Ma,ga as Na,he as Oa,_a as Pa,ha as Qa,gt as Ra,Mr as Sa,va as Ta,Pa as Ua};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
react/cjs/react.production.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license React
|
|
7
|
-
* react.production.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*)
|
|
14
|
-
|
|
15
|
-
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
-
(**
|
|
17
|
-
* @license React
|
|
18
|
-
* react-jsx-runtime.production.js
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*)
|
|
25
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(n){if(Array.isArray(n))return n.map(t);if(n&&typeof n=="object"){let r={};for(let o of Object.keys(n).sort()){let e=n[o];e!==void 0&&(r[o]=t(e))}return r}return n}function i(n){return JSON.stringify(t(n))??"undefined"}export{i as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.LESRQN3Y.js";import"./chunk.7UJZP3YK.js";import"./chunk.R77TACXU.js";import"./chunk.JOWJNIWH.js";import"./chunk.6JERQFZI.js";import"./chunk.7XJ3XQZD.js";import"./chunk.52J42KR5.js";import"./chunk.T2Q3AAQI.js";import"./chunk.63SRVTG2.js";import"./chunk.C4EPMV7O.js";import"./chunk.G7XKQNOL.js";import"./chunk.7KZ44FEU.js";import"./chunk.HJCQ6I3S.js";import"./chunk.JQBP6QWQ.js";import"./chunk.I2W7HSBU.js";import"./chunk.BJL6EL6B.js";import"./chunk.KPUX27ZT.js";import"./chunk.DIS7JS7X.js";import"./chunk.D2T563AA.js";import"./chunk.JV7FLVUV.js";import"./chunk.GL3YVGAP.js";import"./chunk.VGTEEANA.js";import"./chunk.SZCZD2GM.js";import"./chunk.7FZY5E2U.js";import"./chunk.7354O67H.js";import"./chunk.C7EEYSAM.js";import"./chunk.FEBCIEI3.js";import"./chunk.WVUJXDXZ.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.GZHZLJBF.js";import"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as O,b}from"./chunk.XZLKTOJE.js";import"./chunk.R7ZZJOJW.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.AI2HBKVP.js";import{G as z,T as M,aa as S}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Zc as A}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function j({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function B({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{B as NotifiedList,j as NotifySheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.GZHZLJBF.js";import{n as D}from"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import{a as $}from"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{G as P,T as C}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Na as w,Pa as R,Ta as c,Y as S}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as k}from"./chunk.AJZBJBMO.js";var m=k(P(),1);var e=k(C(),1),W=[["","Does not repeat"],["day","Daily"],["week","Weekly"],["month","Monthly"],["year","Yearly"]],E=r=>`${r}${r%100>=11&&r%100<=13?"th":["th","st","nd","rd"][r%10]??"th"}`,v={display:"flex",flexWrap:"wrap",gap:"6px 12px",alignItems:"center"};function N({value:r,onChange:d,start:p,label:s,name:l="repeat"}){let f=(0,m.useId)(),a=c(r)?r:void 0,i=typeof p=="string"&&/^\d{4}-\d{2}-\d{2}/.test(p)?p:void 0,u=i?w[new Date(`${i.slice(0,10)}T00:00:00Z`).getUTCDay()]:void 0,o=t=>{let n={...a??{every:"week"},...t};for(let b of Object.keys(n))n[b]===void 0&&delete n[b];d(n)},y=a?.every??"week",g=a?.on??(u?[u]:[]);return(0,e.jsxs)("fieldset",{"data-graview-part":"field","data-graview-field":"repeat","data-graview-repeat":l,style:{display:"grid",gap:8,border:"1px solid var(--graview-edge)",borderRadius:8,padding:"8px 12px",margin:0,minWidth:0},children:[(0,e.jsx)("legend",{"data-graview-part":"label",style:{padding:"0 4px"},children:s}),(0,e.jsxs)("div",{style:v,children:[(0,e.jsx)("label",{htmlFor:`${f}-every`,children:"Repeats"}),(0,e.jsx)("select",{id:`${f}-every`,name:`${l}.every`,value:a?.every??"",onChange:t=>{let n=t.target.value;d(n===""?void 0:{...a?.interval?{interval:a.interval}:{},...a?.until?{until:a.until}:{},every:n})},"data-graview-part":"control",children:W.map(([t,n])=>(0,e.jsx)("option",{value:t,children:n},t))}),a?(0,e.jsxs)("label",{style:v,children:["every",(0,e.jsx)("input",{type:"number",min:1,max:99,name:`${l}.interval`,"aria-label":`Every how many ${y}s`,value:a.interval??1,onChange:t=>o({interval:Number(t.target.value)>1?Math.min(99,Math.round(Number(t.target.value))):void 0}),style:{width:"4.5em"},"data-graview-part":"control"}),y,(a.interval??1)>1?"s":""]}):null]}),a?.every==="week"?(0,e.jsxs)("div",{role:"group","aria-label":"On",style:v,children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"On"}),w.map((t,n)=>(0,e.jsxs)("label",{style:{display:"inline-flex",gap:4,alignItems:"center",minHeight:24},children:[(0,e.jsx)("input",{type:"checkbox",name:`${l}.on`,value:t,checked:g.includes(t),onChange:b=>{let h=w.filter(x=>x===t?b.target.checked:g.includes(x));o({on:h.length===0||h.length===1&&h[0]===u?void 0:h})}}),S(n,"short")]},t))]}):null,a?.every==="month"?(0,e.jsxs)("label",{style:v,children:["On",(0,e.jsxs)("select",{name:`${l}.on`,value:a.on?.[0]===-1?"last":"",onChange:t=>o({on:t.target.value==="last"?[-1]:void 0}),"data-graview-part":"control",children:[(0,e.jsx)("option",{value:"",children:i?`the ${E(Number(i.slice(8,10)))}`:"the same day"}),(0,e.jsx)("option",{value:"last",children:"the last day"})]})]}):null,a?(0,e.jsxs)("label",{style:v,children:["Until",(0,e.jsx)("input",{type:"date",name:`${l}.until`,value:a.until??"",onChange:t=>o({until:t.target.value||void 0}),"data-graview-part":"control"})]}):null,(0,e.jsx)("p",{"aria-live":"polite","data-graview-repeat-said":"",style:{margin:0,color:"var(--graview-ink-dim)",fontSize:"0.8125rem"},children:a?$(i??"",a):"Does not repeat"})]})}function M({nodeId:r,field:d,start:p,value:s,label:l}){let{fields:f,commit:a}=D(r),i=f.find(t=>t.field===R(d)&&t.takesValue&&t.open.length===0),[u,o]=(0,m.useState)(!1),[y,g]=(0,m.useState)(c(s)?s:void 0);return i?u?(0,e.jsxs)("form",{onSubmit:t=>{t.preventDefault(),o(!1),a(i,y??null)},style:{display:"grid",gap:6,marginTop:6},children:[(0,e.jsx)(N,{value:y,onChange:g,start:p,label:l,name:R(d)}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,e.jsx)("button",{type:"submit","data-graview-repeat-keep":d,children:"Keep"}),(0,e.jsx)("button",{type:"button",onClick:()=>o(!1),children:"Cancel"})]})]}):(0,e.jsx)("button",{type:"button","data-graview-repeat-open":d,onClick:()=>(g(c(s)?s:void 0),o(!0)),style:{marginInlineStart:8,fontSize:"0.75rem",padding:"1px 8px",borderRadius:999,minHeight:24},children:c(s)?"Change how it repeats":"Repeat\u2026"}):null}export{M as RepeatEditor,N as RepeatPicker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as D}from"./chunk.PXQVXBNG.js";import{a as L,f as P,g as N,h as R}from"./chunk.G446PWV6.js";import{pd as E}from"./chunk.VOHRQXCF.js";var z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),T=e=>e?._zod?.def;function W(e){let n=T(e);for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)n=T(n.innerType);return n}function K(e){if(e?.type==="boolean")return["true","false"];if(e?.type==="enum")return(e.entries?Object.values(e.entries):e.values??[]).filter(n=>typeof n=="string")}var v=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/^./,n=>n.toUpperCase());function J(e,n,i){let a=e.tryDefinition(n);if(!a)return[];let c=new Set(a.display?.hide??[]),r=[];for(let[s,l]of Object.entries(a.fields.shape??{})){if(s==="id"||s==="kind"||s==="label"||c.has(s))continue;let o=W(l);if(o?.type==="array"||o?.type==="object"||o?.type==="record")continue;let u=K(o);r.push({key:s,label:v(s),...u?{options:u}:{}})}let y=new Map;for(let[s,l]of Object.entries(a.edges??{}))y.set(s,l.to==="*"?[]:[...l.to]);for(let s of e.definitions)if(s.kind!==n)for(let[l,o]of Object.entries(s.edges??{}))!y.has(l)&&(o.to==="*"||o.to.includes(n))&&y.set(l,[s.kind]);let g=[];for(let[s,l]of y){r.push({key:s,label:v(s)});let o=i&&l.length===1&&l[0]!==n?e.tryDefinition(l[0]):void 0;for(let[u,f]of Object.entries(o?.fields.shape??{})){let p=W(f);p?.type==="enum"&&!o?.display?.hide?.includes(u)&&g.push({key:`${s}.${u}`,label:`${v(s)} \xB7 ${v(u)}`,options:K(p)})}}return r.push(...g),r.push({key:"is",label:"Is",options:a.lifecycle?["current","past","any","flagged","clear"]:["flagged","clear"]}),r}var I=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function G(e,n,i,a={}){if(i==null)return{ok:!0};if(!z(i))return{ok:!1,says:'A filter is an object of a field and the value it keeps, like { where: { stage: "building" } }.'};let c=Object.entries(i);if(c.length===0)return{ok:!0};let r=[];for(let l of n)for(let o of J(e,l,a.through===!0))r.some(u=>u.key===o.key)||r.push(o);let y=n[0]?e.tryDefinition(n[0]):void 0,g=y?y.plural??`${v(y.kind)}s`:"These",s=[];for(let[l,o]of c){let u=r.find(p=>p.key===l);if(!u)return{ok:!1,says:`${g.replace(/^./,p=>p.toUpperCase())} have no field "${l}" to filter by${r.length>0?`; they filter by ${I(r.map(p=>p.key))}`:""}.`};if(typeof o!="string"&&typeof o!="number"&&typeof o!="boolean")return{ok:!1,says:`The filter on "${l}" is ${Array.isArray(o)?"a list":o===null?"null":`a ${typeof o}`}; it keeps one value: a word, a number, or true or false.`};let f=String(o);if(f.trim().length===0)return{ok:!1,says:`The filter on "${l}" keeps nothing; give it a value, or leave "${l}" out.`};if(f.includes(","))return{ok:!1,says:`The filter on "${l}" holds a comma, which an address reads as a second filter; keep one value.`};if(u.options&&u.options.length>0&&!u.options.includes(f))return{ok:!1,says:`${u.label} has no choice "${f}"; its choices are ${I(u.options.map(p=>`"${p}"`))}.`};s.push(`${l}:${f}`)}return{ok:!0,filter:s.join(",")}}var C=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function q(e,n){let i=e.find(r=>r.as===n);if(i)return i;let a=n.trim().toLowerCase(),c=C(n);return e.find(r=>r.title!==void 0&&r.title.trim().toLowerCase()===a)??(c?e.find(r=>r.as===c||r.title!==void 0&&C(r.title)===c):void 0)}function Z(e){let n=[];for(let i of e){if(typeof i!="object"||i===null)continue;let{as:a,slug:c,title:r,kind:y}=i,g=typeof a=="string"&&a.length>0?a:typeof c=="string"&&c.length>0?c:void 0;!g||n.some(s=>s.as===g)||n.push({as:g,title:typeof r=="string"?r:g,kind:typeof y=="string"?y:""})}return n}var F=e=>` Its places: ${e.map(n=>typeof n=="string"?`"${n}"`:n.title&&n.title!==n.as?`"${n.as}" (${n.title})`:`"${n.as}"`).join(", ")||"none"}.`;var b=e=>`"${e.length>80?`${e.slice(0,79)}\u2026`:e}"`,O=(e,n)=>`${"place"in e?`The place ${b(e.place)}`:`${b(e.record)} is no record this viewer may see and`} is no place of this app: it goes nowhere.${F(n)}`;function S(e){let n={};for(let i of e.split(",")){let a=i.indexOf(":");a>0&&(n[i.slice(0,a).trim()]=i.slice(a+1).trim())}return n}function ne(e,n=new Set){return e.kinds.filter(i=>!n.has(i)).map(i=>({slug:E(e,i).slice(1),kind:i}))}function U(e,n){let i=[...new Set(n.places.map(f=>f.as))],a=n.lists.map(f=>f.slug).filter(f=>!i.includes(f)),c;if(e.section!==void 0&&e.section!==null){if(typeof e.section!="string"||D(e.section).length===0||e.section.length>120)return{ok:!1,says:`The section ${typeof e.section=="string"?b(e.section):"asked for"} names nothing on a page: a section is a heading's words or an element's id, like "shipping-soon". It goes nowhere.`};c=e.section}let r=c!==void 0?{section:c}:{};if("record"in e&&n.sees(e.record))return e.where!==void 0&&e.where!==null?{ok:!1,says:`${b(e.record)} is one record, and a filter narrows a list or a place: it goes nowhere. Go to { place, where } for a list narrowed.`}:{ok:!0,arrival:{record:e.record,...r}};let y="place"in e?e.place:e.record,g=q(n.places,y),s=g?void 0:n.lists.find(f=>f.slug===y||f.kind===y);if(!g&&!s)return{ok:!1,says:`${O(e,n.places.filter((f,p,m)=>m.findIndex(t=>t.as===f.as)===p))}${_(a)}`};let l=g?[g.kind]:[s.kind],o;if(e.where!==void 0&&e.where!==null){if(!n.schema)return{ok:!1,says:`The place ${b(y)} cannot be narrowed here: it goes nowhere.`};let f=G(n.schema,l,e.where,{through:s!==void 0});if(!f.ok)return{ok:!1,says:`The filter on ${b(y)} goes nowhere: ${f.says}`};o=f.filter}let u=o?{filter:o}:{};return{ok:!0,arrival:g?{place:g.as,...u,...r}:{list:s.kind,...u,...r}}}var _=e=>e.length===0?"":` Its lists: ${e.slice(0,8).map(n=>`"${n}"`).join(", ")}${e.length>8?` and ${e.length-8} more`:""}.`,M="http://www.w3.org/1999/xhtml",V=e=>{let n=e;return n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||e.type==="click"&&typeof n.button=="number"&&n.button!==0};function re(e){let n=new WeakSet,i=new WeakSet,a=new WeakMap,c=new WeakMap,r=t=>U(t,{sees:e.sees,places:e.places(),lists:e.lists?.()??[],...e.schema?{schema:e.schema}:{}}),y=t=>{let d=r(t);return d.ok?e.onNavigate?.(d.arrival):e.onLost?.(d.says),d.ok},g=t=>{let d=t.getAttribute("data-record"),h=t.getAttribute("data-place"),k=t.getAttribute("data-filter"),w=t.getAttribute("data-section"),$={...k?{where:S(k)}:{},...w?{section:w}:{}};if(d)return{record:d,...$};if(h)return{place:h,...$}},s=t=>{if(!e.hrefOf)return;let d=g(t),h=d?r(d):void 0;return h?.ok?e.hrefOf(h.arrival):void 0},l=t=>t.hasAttribute("tabindex")?!1:(t.setAttribute("tabindex","0"),n.add(t),!0),o=t=>{n.delete(t)&&t.removeAttribute("tabindex")},u=t=>{i.delete(t)&&t.getAttribute("role")==="link"&&t.removeAttribute("role")},f=t=>{let d=a.get(t);d&&(a.delete(t),t.getAttribute("href")===d.href&&t.removeAttribute("href"),d.target!==null&&!t.hasAttribute("target")&&t.setAttribute("target",d.target))},p=t=>{let d=c.get(t);d&&(c.delete(t),o(d))},m={link(t){if(!N(t,[...t.querySelectorAll("input, select, textarea")].some(L))){if(!t.hasAttribute("data-graview-link"))return;t.removeAttribute("data-graview-link"),u(t),o(t),f(t),p(t);return}t.hasAttribute("data-graview-link")||t.setAttribute("data-graview-link","");let h=t.localName==="a"&&t.namespaceURI===M,k=t.getAttribute("href"),w=a.get(t),$=k!==null&&w?.href!==k,A=h&&!$?s(t):void 0;if(A!==void 0){k!==A&&t.setAttribute("href",A),a.set(t,{href:A,target:w?w.target:t.getAttribute("target")}),t.removeAttribute("target"),u(t),o(t);return}if($?a.delete(t):f(t),!t.hasAttribute("role")&&(h||P(t))&&(t.setAttribute("role","link"),i.add(t)),t.localName==="tr"&&t.namespaceURI===M){o(t);let x=[...t.children].find(j=>j.localName==="td"||j.localName==="th");c.get(t)!==x&&p(t),x&&!c.has(t)&&l(x)&&c.set(t,x);return}t.localName!=="button"&&l(t)},refresh(t){for(let d of t.querySelectorAll("[data-record], [data-place], [data-graview-link]"))m.link(d)},pressed(t,d,h){if(t.type!=="click"&&!(t.type==="keydown"&&t.key==="Enter"))return!1;let k=R(d,h,w=>w.hasAttribute("data-graview-link"));return k?(t.stopPropagation(),a.has(k)&&V(t)||(t.preventDefault(),m.follow(k)),!0):!1},follow(t){let d=g(t);d&&y(d)},go:y};return m}export{Z as a,F as b,b as c,O as d,S as e,ne as f,U as g,re as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.AJZBJBMO.js";var W=1200,Y="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",q=4e7,A=e=>/^image\//i.test(e.type)&&!/^image\/svg/i.test(e.type);function w(e,t={}){let u={name:e.name,type:e.type,bytes:e.bytes};return/^video\//i.test(e.type)?{...u,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.caption!==void 0?{caption:e.caption}:{},...e.duration!==void 0?{duration:e.duration}:{}}:A(e)?{...u,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.caption!==void 0?{caption:e.caption}:{},...t.src!==void 0?{src:t.src}:{},...t.left!==void 0?{left:t.left}:{}}:u}var z=new Set(["id","kind","label"]),L=e=>{let t=e;return typeof t=="object"&&t!==null&&typeof t.href=="string"&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.bytes=="number"};function R(e,t){let u=o=>{let d;for(let[f,c]of Object.entries(o)){if(z.has(f))continue;let l=L(c)?t(c,o):Array.isArray(c)&&c.length>0&&c.every(L)?c.map(a=>t(a,o)):void 0;l!==void 0&&((d??={...o})[f]=l)}return d??o};return{...e,...e.node?{node:u(e.node)}:{},...e.nodes?{nodes:e.nodes.map(u)}:{}}}var B=e=>e.toLocaleString("en-US"),_=(e,t)=>`The picture "${e.name}" on ${t.label?`"${t.label}"`:"a record"}`;function C(e,t,u){let o=e===!0?1200:e.width??1200,d=t?.pictureBytes??15e5,f=t?.picturesBytes??12e6,c=Math.round(o*Math.min(2,Math.max(1,u||1)));return{width:o,perFile:d,perView:f,need:c,reckon:a=>Math.min(d,Math.ceil(a.bytes*(a.width&&a.width>c?(c/a.width)**2:1)))}}var M=(e,t)=>`${_(e,t)} is left out: at ${B(e.bytes)} bytes it is more than the host fetches for a view.`,N=(e,t,u,o)=>`${_(e,t)} is left out: the view ${u} is handed at most ${B(o)} bytes of pictures, and the pictures before it took them.`;function K(e,t){let{perView:u,reckon:o}=C(t.pictures,t.limits,2),d=[],f=0;return{props:R(e,(l,a)=>{if(!A(l))return w(l);let p=y=>(d.includes(y)||d.push(y),w(l,{left:y}));if(l.bytes>4e7)return p(M(l,a));let P=o(l);return f+P>u?p(N(l,a,t.view,u)):(f+=P,w(l,{src:t.standIn}))}),left:d}}function Q(e,t){let{width:u,perFile:o,perView:d,need:f,reckon:c}=C(t.pictures,t.limits,e.devicePixelRatio),l=t.shrink??((n,r,s)=>D(e,n,r,s)),a=new Map,p=new Map,P=new Set,y=!1,v=!1,F=()=>{v||y||(v=!0,queueMicrotask(()=>{v=!1,y||t.moved()}))},G=n=>{P.has(n)||(P.add(n),t.onLeft?.(n))},T=n=>{n?.state==="ready"&&(p.delete(n.url),n.url.startsWith("blob:")&&e.URL.revokeObjectURL(n.url))},E=_,k,S=n=>new Promise(r=>{let s=new e.Image;s.onload=()=>r(!0),s.onerror=()=>r(!1),e.setTimeout(()=>r(!1),2e3),s.src=n}),x=n=>new Promise((r,s)=>{let b=new e.FileReader;b.onload=()=>r(String(b.result)),b.onerror=s,b.readAsDataURL(n)}),H=async n=>{if(t.as==="blob"){let s=e.URL.createObjectURL(n);return k??=S(s),await k?{url:s,drawn:s}:{url:s,drawn:await x(n)}}let r=await x(n);return{url:r,drawn:r}},I=(n,r,s)=>({state:"left",said:`${E(n,r)} could not be loaded for the view ${t.view}${s?`: the host answered ${s}.`:"."}${s&&!t.file?" A host that serves the app under a base says where a record's files are (file, on the view's definition).":""}`}),O=async(n,r)=>{let s=I(n,r),b=t.file?t.file(n.href):n.href;if(b===void 0)return s;let i=new e.URL(b,e.document.baseURI);if(i.origin!==e.location.origin||!/^https?:$/.test(i.protocol))return s;let m=await e.fetch(i.href,{credentials:"same-origin"}),h=(m.headers.get("content-type")??"").split(";")[0].trim();if(!m.ok)return I(n,r,String(m.status));if(!A({type:h}))return I(n,r,`${h||"no type"}, not a picture`);let g=new e.Blob([await m.arrayBuffer()],{type:h});if(g.size>4e7)return s;if(!(n.width!==void 0&&n.width<=f)||g.size>o){let V=await l(g,f,o).catch(()=>{});if(V)g=V;else if(g.size>o)return s}return g.size>o?{state:"left",said:`${E(n,r)} is left out: made as small as the ${B(u)} pixels across the view ${t.view} draws a picture at, it is still more than the ${B(o)} bytes one picture is handed.`}:{state:"ready",...await H(g),bytes:g.size}},j=(n,r)=>{a.set(n.href,{state:"pending",bytes:c(n)}),O(n,r).then(s=>U(n.href,s),()=>U(n.href,{state:"left",said:`${E(n,r)} could not be loaded for the view ${t.view}.`}))},U=(n,r)=>{if(y||a.get(n)?.state!=="pending")return T(r);a.set(n,r),r.state==="ready"&&p.set(r.url,r.drawn),r.state==="left"&&G(r.said),F()};return{hand(n){if(y)return R(n,i=>w(i));let r=0,s=new Set,b=R(n,(i,m)=>{if(!A(i))return w(i);s.add(i.href);let h=a.get(i.href);if(h?.state==="left")return w(i,{left:h.said});if(!h&&i.bytes>4e7)return h={state:"left",said:M(i,m)},a.set(i.href,h),G(h.said),w(i,{left:h.said});let g=h?h.bytes:c(i);if(r+g>d){let $=N(i,m,t.view,d);return G($),w(i,{left:$})}return r+=g,h||j(i,m),w(i,h?.state==="ready"?{src:h.url}:{})});for(let[i,m]of a)s.has(i)||(T(m),a.delete(i));return b},drawn:n=>p.get(n),waiting:()=>[...a.values()].some(n=>n.state==="pending"),dispose(){y=!0;for(let n of a.values())T(n);a.clear(),p.clear()}}}async function D(e,t,u,o){if(typeof e.createImageBitmap!="function")return;let d=await e.createImageBitmap(t);try{if(d.width<=u&&t.size<=o)return t;let f=Math.min(1,u/d.width),c=Math.max(1,Math.round(d.width*f)),l=Math.max(1,Math.round(d.height*f)),a=e.document.createElement("canvas");a.width=c,a.height=l;let p=a.getContext("2d");if(!p)return;p.drawImage(d,0,0,c,l);let P=F=>new Promise(G=>a.toBlob(G,F,.85)),y=/^image\/(jpeg|webp|png)$/i.test(t.type)?t.type:"image/png",v=await P(y);return v&&v.size<=o?v:await P("image/jpeg")??v??void 0}finally{d.close()}}export{q as PICTURE_FETCH_BYTES,Y as PICTURE_STAND_IN,W as PICTURE_WIDTH,Q as createGuestPictures,w as guestFileOf,R as handFiles,A as isGuestPicture,C as pictureBudget,K as standInPictures};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as x}from"./chunk.D2T563AA.js";import"./chunk.JV7FLVUV.js";import"./chunk.GL3YVGAP.js";import"./chunk.WVUJXDXZ.js";import"./chunk.QRCTTDDQ.js";import"./chunk.3TME4BG3.js";import"./chunk.I43ONAEL.js";import"./chunk.73EKJ4JN.js";import"./chunk.INL4OZI7.js";import"./chunk.5WU2UTP7.js";import"./chunk.GZHZLJBF.js";import{n as R}from"./chunk.YKACMLLU.js";import"./chunk.OJGHDWI6.js";import"./chunk.337JMOTL.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{G as A,T as v,ba as g}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Nc as k,ka as y,oa as c}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as u}from"./chunk.AJZBJBMO.js";var f=u(A(),1);var L=u(A(),1),S=(0,L.createContext)(void 0);var i=u(v(),1),W=new WeakMap,m=new WeakMap,P=(e,n)=>`${n.kind}\0${n.id??""}\0${e}`;function b(e,n,a){let p=P(n,a),o=W.get(e);o||W.set(e,o=new Map);let t=o.get(p);return t||(t=Promise.resolve().then(()=>e(n,a)).then(r=>C(r)?r:null,()=>null).then(r=>{let s=m.get(e);return s||m.set(e,s=new Map),s.set(p,r),r}),o.set(p,t)),t}function C(e){if(e===null)return!0;if(typeof e!="object"||e===void 0)return!1;if(e.denied===!0)return!0;let n=e;return typeof n.name=="string"&&n.name.trim()!==""&&typeof n.href=="string"}function h(e){if(/^https?:\/\//i.test(e))try{return new URL(e).href}catch{return}}var N=e=>h(e)??(c(e)?e:void 0),E=e=>h(e)??(e.startsWith("/")&&c(e)?e:void 0),I={kind:"human"},w={color:"var(--graview-ink-muted)"};function M({icon:e}){if(!e)return null;let n=E(e);if(n)return(0,i.jsx)("img",{src:n,alt:"",width:20,height:20,"data-graview-app-icon":"",style:{width:20,height:20,borderRadius:5,objectFit:"cover",flex:"0 0 auto"}});let a=[...e.trim()].slice(0,2).join("");return a?(0,i.jsx)("span",{"aria-hidden":"true","data-graview-app-icon":"",style:{flex:"0 0 auto",lineHeight:"20px"},children:a}):null}function V(e){let n=g(),a=(0,f.useContext)(S)??n?.resolveApp,p=n?.principal??I,o=()=>a?m.get(a)?.get(P(e,p))??"asking":null,[t,r]=(0,f.useState)(o);return(0,f.useEffect)(()=>{let s=o();if(r(s),s!=="asking"||!a)return;let l=!0;return b(a,e,p).then(d=>l&&r(d)),()=>{l=!1}},[a,e,p.kind,p.id]),t}function D({address:e,as:n="chip",nodeId:a,field:p,style:o}){let t=V(e),r={position:"relative",zIndex:k.raised,overflowWrap:"anywhere",minWidth:0,maxWidth:"100%",...o},s;if(t==="asking")s=(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"asking","aria-busy":"true",style:{...w,...r},children:"Linked app"});else if(t&&"denied"in t)s=(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"denied",style:{...w,fontStyle:"italic",...r},children:"linked app (no access)"});else if(t){let l=N(t.href),d=n==="record"?t.headline?.trim():void 0;s=(0,i.jsxs)(l?"a":"span",{"data-graview-app-link":"","data-graview-app-state":"found",...l?{href:l}:{},...!d&&t.headline?{title:t.headline}:{},style:{display:"inline-flex",alignItems:d?"flex-start":"center",minHeight:24,gap:8,color:"inherit",textUnderlineOffset:3,...r},children:[(0,i.jsx)(M,{icon:t.icon}),(0,i.jsxs)("span",{style:{display:"grid",minWidth:0},children:[(0,i.jsx)("span",{"data-graview-app-name":"",style:{fontWeight:600},children:t.name}),d?(0,i.jsx)("span",{"data-graview-app-headline":"",style:{...w,fontSize:"0.8125em",fontWeight:400},children:d}):null]})]})}else{let l=h(e);s=l?(0,i.jsx)("a",{"data-graview-app-link":"","data-graview-app-state":"plain",href:l,rel:"noopener noreferrer",target:"_blank",style:{color:"var(--graview-accent)",display:"inline-flex",alignItems:"center",minHeight:24,...r},children:e}):(0,i.jsx)("span",{"data-graview-app-link":"","data-graview-app-state":"plain",style:r,children:e})}return a&&p?(0,i.jsx)(H,{nodeId:a,field:p,address:e,drawn:s}):s}function H({nodeId:e,field:n,address:a,drawn:p}){let o=R(e).fields.some(s=>s.field===n),t=g()?.store;if(!o)return p;let r=y(t?t.schema.tryDefinition(String(t.graph.getNode(e)?.kind)):void 0,n).toLowerCase();return(0,i.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px",maxWidth:"100%",minWidth:0},children:[p,(0,i.jsx)("span",{style:{fontSize:"0.8125rem"},children:(0,i.jsx)(x,{nodeId:e,field:n,value:"Change",stored:a,said:`Change the ${r}`})})]})}var _=e=>(0,i.jsx)(D,{...e});export{D as AppLink,_ as drawAppLink};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v,b as y,c as m}from"./chunk.MB7LKKUD.js";import"./chunk.AI2HBKVP.js";import{G as N,Ra as c,T as u,Ta as b}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Oc as f}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as p}from"./chunk.AJZBJBMO.js";var l=p(N(),1);var t=p(u(),1);function P({notices:o,anchor:n,board:a}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,t.jsx)(w,{notices:o.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var h={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:o,at:n,anchor:a,board:i}){let d=(0,l.useRef)(null),e=o.length>0;return(0,l.useLayoutEffect)(()=>{let r=d.current;if(!e||!r)return;if(typeof r.showPopover=="function"&&!c(r))try{r.showPopover()}catch{}let s=()=>(n==="top"?m:y)(r,a());s(),n==="foot"&&i.hold?.(()=>r.matches(":hover, :focus-within"));let S=b(r);addEventListener("resize",s),addEventListener("scroll",s,!0),n==="foot"&&addEventListener(v,s);let g=typeof ResizeObserver=="function"?new ResizeObserver(s):null;return g?.observe(r),()=>{if(S(),g?.disconnect(),removeEventListener("resize",s),removeEventListener("scroll",s,!0),removeEventListener(v,s),r.isConnected&&c(r))try{r.hidePopover()}catch{}}},[e,n,a,i]),e?(0,t.jsx)("div",{ref:d,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:o.map(r=>(0,t.jsx)(C,{notice:r,board:i},r.id))}):null}var T=o=>o.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or ");function C({notice:o,board:n}){let a=o.tone??"info",i=[...o.action?[o.action]:[],...o.actions??[]],d=()=>n.dismiss(o.id);return(0,t.jsxs)("div",{"data-testid":"notice","data-kind":o.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:o.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${h[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:h[a]}}),(0,t.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:o.sentence}),i.length>0?(0,t.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((e,r)=>e.href!==void 0?(0,t.jsx)("a",{href:e.href,...e.target?{target:e.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{e.onSelect?.(),d()},style:{...x,...r===0?k:{}},children:e.label},e.label):(0,t.jsx)("button",{type:"button","data-testid":"notice-action",...e.keys?{"aria-keyshortcuts":e.keys,title:`${e.label} \u2014 ${T(e.keys)}`}:{},onClick:()=>{d(),e.onSelect?.()},style:{...x,...r===0?k:{}},children:e.label},e.label))}):null,(0,t.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${o.sentence}`,title:"Dismiss",onClick:d,style:E,children:"\xD7"})]})}var x={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{P as NoticeStacks};
|