graview 0.1.50 → 0.1.52
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.2EB7COX5.js +1 -0
- package/dist/preview/{chunk.FKUVIG6D.js → chunk.2K3YQJW3.js} +1 -1
- package/dist/preview/{chunk.2P66HH5Y.js → chunk.2X3UZJWI.js} +1 -1
- package/dist/preview/chunk.337JMOTL.js +1 -0
- package/dist/preview/{chunk.YEKHDZ45.js → chunk.3FKP32RG.js} +2 -2
- package/dist/preview/{chunk.MQISKON2.js → chunk.3TME4BG3.js} +1 -1
- package/dist/preview/chunk.3ZQAPPJ5.js +18 -0
- package/dist/preview/{chunk.KZ3UPV2L.js → chunk.4LI73QOY.js} +1 -1
- package/dist/preview/{chunk.T4UYLB3Y.js → chunk.4VI3EYDL.js} +1 -1
- package/dist/preview/chunk.4ZLCMATU.js +2 -0
- package/dist/preview/{chunk.ETWREHXF.js → chunk.52J42KR5.js} +1 -1
- package/dist/preview/{chunk.ETX4QMM2.js → chunk.5DDHFNZM.js} +1 -1
- package/dist/preview/chunk.5LWPNOJA.js +1 -0
- package/dist/preview/{chunk.KFHXTHIY.js → chunk.5WU2UTP7.js} +1 -1
- package/dist/preview/{chunk.OUNLAMBA.js → chunk.63SRVTG2.js} +2 -2
- package/dist/preview/chunk.6BA6RUK7.js +1 -0
- package/dist/preview/{chunk.QZMBEG4E.js → chunk.6CY3EA6U.js} +1 -1
- package/dist/preview/chunk.6JERQFZI.js +1 -0
- package/dist/preview/chunk.6NIE3ILA.js +1 -0
- package/dist/preview/{chunk.OB7XLVK6.js → chunk.6QNBUBGD.js} +1 -1
- package/dist/preview/chunk.6YGRRXJB.js +2 -0
- package/dist/preview/{chunk.IDQHSAAQ.js → chunk.7354O67H.js} +1 -1
- package/dist/preview/{chunk.LJXAZ5TF.js → chunk.73EKJ4JN.js} +1 -1
- package/dist/preview/{chunk.O6SKKF4V.js → chunk.7EA7THSM.js} +1 -1
- package/dist/preview/{chunk.F7AFJRPP.js → chunk.7FMS57QO.js} +1 -1
- package/dist/preview/{chunk.L5MDUZLQ.js → chunk.7FZY5E2U.js} +1 -1
- package/dist/preview/chunk.7IOC6U3C.js +1 -0
- package/dist/preview/{chunk.7VX6TBNY.js → chunk.7KZ44FEU.js} +1 -1
- package/dist/preview/chunk.7OAXW7QF.js +1 -0
- package/dist/preview/chunk.7SNIX56B.js +1 -0
- package/dist/preview/{chunk.GZEZMU2T.js → chunk.7UJZP3YK.js} +2 -2
- package/dist/preview/{chunk.YUV7HZYG.js → chunk.7UXDIEPK.js} +1 -1
- package/dist/preview/{chunk.ZITDUHX3.js → chunk.7XJ3XQZD.js} +1 -1
- package/dist/preview/chunk.AI2HBKVP.js +359 -0
- package/dist/preview/chunk.BDQ4FUKO.js +1 -0
- package/dist/preview/{chunk.IMFAPZ6J.js → chunk.BHPZK4WJ.js} +2 -2
- package/dist/preview/{chunk.AXMC6XVT.js → chunk.BJL6EL6B.js} +1 -1
- package/dist/preview/{chunk.HGP3Q7QX.js → chunk.C4EPMV7O.js} +1 -1
- package/dist/preview/chunk.C4UNAJWC.js +1 -0
- package/dist/preview/{chunk.CR5MQMOL.js → chunk.C7EEYSAM.js} +1 -1
- package/dist/preview/{chunk.LGHMUUTG.js → chunk.CBGKWYGI.js} +1 -1
- package/dist/preview/chunk.CC7E6NUQ.js +1 -0
- package/dist/preview/chunk.CHMUL36A.js +1 -0
- package/dist/preview/{chunk.TT6QBWRA.js → chunk.CV4QA4ZF.js} +1 -1
- package/dist/preview/chunk.D2T563AA.js +1 -0
- package/dist/preview/{chunk.UDTBFAS5.js → chunk.D62V3TBW.js} +1 -1
- package/dist/preview/{chunk.ECSWXLBI.js → chunk.DC7M56NM.js} +2 -2
- package/dist/preview/chunk.DGWNVDZB.js +1 -0
- package/dist/preview/{chunk.73BJYIYS.js → chunk.DIS7JS7X.js} +1 -1
- package/dist/preview/{chunk.A53G42QO.js → chunk.DVLWSCIC.js} +1 -1
- package/dist/preview/{chunk.LDE5HLTM.js → chunk.DXZ5VYCQ.js} +1 -1
- package/dist/preview/{chunk.GPJFNLEJ.js → chunk.EHOEMVQP.js} +1 -1
- package/dist/preview/chunk.EIWTZC4A.js +1 -0
- package/dist/preview/chunk.EME5HQ3H.js +1 -0
- package/dist/preview/{chunk.JJP5OL5E.js → chunk.FEBCIEI3.js} +1 -1
- package/dist/preview/{chunk.CDZVUCEK.js → chunk.FJC6PMOG.js} +1 -1
- package/dist/preview/{chunk.U2M4SGUU.js → chunk.FJEXINFF.js} +1 -1
- package/dist/preview/{chunk.UOC3SIYT.js → chunk.FLNYLE6S.js} +1 -1
- package/dist/preview/{chunk.QSZLY62B.js → chunk.G7XKQNOL.js} +1 -1
- package/dist/preview/{chunk.MRUDTYOL.js → chunk.GL3YVGAP.js} +2 -2
- package/dist/preview/{chunk.UGJ32SEL.js → chunk.GZHEGKPF.js} +1 -1
- package/dist/preview/{chunk.S64LCR23.js → chunk.HSGUXMAO.js} +1 -1
- package/dist/preview/{chunk.ODHCSYXX.js → chunk.HST7BYFW.js} +1 -1
- package/dist/preview/{chunk.TY6VILZB.js → chunk.I2W7HSBU.js} +1 -1
- package/dist/preview/{chunk.GQX57JIE.js → chunk.I43ONAEL.js} +1 -1
- package/dist/preview/{chunk.QFI4L2HK.js → chunk.INL4OZI7.js} +1 -1
- package/dist/preview/{chunk.ZBBCUK2K.js → chunk.IVI3HRSF.js} +1 -1
- package/dist/preview/{chunk.JYJNRCK5.js → chunk.J263VQF5.js} +1 -1
- package/dist/preview/{chunk.GTUBIJTP.js → chunk.J2R55TM7.js} +1 -1
- package/dist/preview/{chunk.MCPLU2U4.js → chunk.J6IB2HUZ.js} +1 -1
- package/dist/preview/{chunk.TL7UGUY4.js → chunk.JOWJNIWH.js} +2 -2
- package/dist/preview/{chunk.XWLGHTH6.js → chunk.JQBP6QWQ.js} +1 -1
- package/dist/preview/chunk.JV7FLVUV.js +1 -0
- package/dist/preview/{chunk.KOPRZLJH.js → chunk.KFTZLNHY.js} +2 -2
- package/dist/preview/{chunk.DUIKIJKC.js → chunk.KPUX27ZT.js} +1 -1
- package/dist/preview/chunk.KSJ3J5UN.js +1 -0
- package/dist/preview/chunk.LESRQN3Y.js +32 -0
- package/dist/preview/{chunk.FFPG4PHX.js → chunk.LSL25VXW.js} +1 -1
- package/dist/preview/{chunk.VVRI7DNK.js → chunk.LTJYKQJG.js} +1 -1
- package/dist/preview/chunk.LXJW2Z2M.js +1 -0
- package/dist/preview/{chunk.AXCRFJDL.js → chunk.M33LUF3Q.js} +1 -1
- package/dist/preview/chunk.MBNZ2HK7.js +1 -0
- package/dist/preview/chunk.MYKRJ4SV.js +1 -0
- package/dist/preview/{chunk.L2AV6JRA.js → chunk.N7D5LKBI.js} +1 -1
- package/dist/preview/{chunk.WGRF6EHC.js → chunk.NAPTE3S6.js} +1 -1
- package/dist/preview/{chunk.BBNF52IB.js → chunk.NHIPVAGR.js} +1 -1
- package/dist/preview/chunk.NICCIJV4.js +1 -0
- package/dist/preview/{chunk.UJTRKSCK.js → chunk.NQPNK6I5.js} +1 -1
- package/dist/preview/{chunk.JLPBXG4P.js → chunk.NVNQSZ43.js} +1 -1
- package/dist/preview/{chunk.7QW6JYGP.js → chunk.NWK4E7TJ.js} +1 -1
- package/dist/preview/chunk.NZB5S5UO.js +1 -0
- package/dist/preview/{chunk.53BGPCM6.js → chunk.OS3WZV6C.js} +1 -1
- package/dist/preview/{chunk.UCS3CBT4.js → chunk.OYRZ2DEI.js} +1 -1
- package/dist/preview/{chunk.KGGWFL54.js → chunk.P5PXWOHI.js} +1 -1
- package/dist/preview/chunk.PFXGWY3P.js +1 -0
- package/dist/preview/chunk.PRCWGE7A.js +1 -0
- package/dist/preview/{chunk.4SHSEIHT.js → chunk.PXHBPLTQ.js} +1 -1
- package/dist/preview/chunk.PXVJBL2C.js +1 -0
- package/dist/preview/chunk.Q3XKNZQW.js +1 -0
- package/dist/preview/chunk.Q5IAXTF5.js +25 -0
- package/dist/preview/{chunk.V5IWJ3ZV.js → chunk.QPP3OJVR.js} +1 -1
- package/dist/preview/{chunk.6SHF6IL5.js → chunk.QRCTTDDQ.js} +1 -1
- package/dist/preview/{chunk.ZOQ3OKKI.js → chunk.QWQBPJ4U.js} +1 -1
- package/dist/preview/chunk.QXCYAFRT.js +1 -0
- package/dist/preview/chunk.R6FHEEJ7.js +1 -0
- package/dist/preview/chunk.R77TACXU.js +1 -0
- package/dist/preview/{chunk.RK6BK5FD.js → chunk.R7CRV2FE.js} +1 -1
- package/dist/preview/chunk.R7ZZJOJW.js +1 -0
- package/dist/preview/{chunk.4BQNG3W3.js → chunk.RBWYXVUW.js} +1 -1
- package/dist/preview/chunk.RMRO5JZX.js +1 -0
- package/dist/preview/{chunk.4XOSDCCE.js → chunk.RWCWRJJC.js} +1 -1
- package/dist/preview/{chunk.M55U47A6.js → chunk.S4ZWBCYC.js} +1 -1
- package/dist/preview/{chunk.ZKDJQDKX.js → chunk.SELLAVIQ.js} +1 -1
- package/dist/preview/chunk.SLBWPVIY.js +1 -0
- package/dist/preview/{chunk.GDYI5QDS.js → chunk.SM6HTPYF.js} +1 -1
- package/dist/preview/chunk.SZCZD2GM.js +1 -0
- package/dist/preview/{chunk.YZ6UKKEL.js → chunk.T2Q3AAQI.js} +1 -1
- package/dist/preview/{chunk.YCJ74LZS.js → chunk.T6KKNWZT.js} +1 -1
- package/dist/preview/{chunk.BJAQRV2R.js → chunk.U6PCKJ26.js} +1 -1
- package/dist/preview/chunk.UEPVA6IS.js +1 -0
- package/dist/preview/{chunk.JC5NXMG3.js → chunk.ULAMIQ52.js} +1 -1
- package/dist/preview/chunk.UMS7XRPO.js +1 -0
- package/dist/preview/{chunk.FDFVGHQE.js → chunk.VGIWQNJB.js} +1 -1
- package/dist/preview/{chunk.64TFAR5Z.js → chunk.VGTEEANA.js} +1 -1
- package/dist/preview/{chunk.BORCUDGS.js → chunk.VKOCD5CL.js} +1 -1
- package/dist/preview/chunk.VOHRQXCF.js +5 -0
- package/dist/preview/chunk.W5UJLKIT.js +1 -0
- package/dist/preview/chunk.WUEU3QBL.js +1 -0
- package/dist/preview/chunk.WWUMSCYC.js +1 -0
- package/dist/preview/{chunk.Q7RI4SI4.js → chunk.XLM4ONUB.js} +1 -1
- package/dist/preview/{chunk.QAUZDLDA.js → chunk.XPR3QFF4.js} +1 -1
- package/dist/preview/{chunk.UN2OB6OD.js → chunk.XZLKTOJE.js} +1 -1
- package/dist/preview/chunk.Y37DXEHG.js +1 -0
- package/dist/preview/chunk.YKACMLLU.js +1 -0
- package/dist/preview/{chunk.DUJUJN35.js → chunk.YKXUDACI.js} +1 -1
- package/dist/preview/{chunk.3SY6WWWQ.js → chunk.YUEOUV7G.js} +2 -2
- package/dist/preview/chunk.YYWLYVAW.js +1 -0
- package/dist/preview/chunk.Z2JMTRF4.js +1 -0
- package/dist/preview/chunk.Z2UFPOAN.js +88 -0
- package/dist/preview/chunk.ZEKKIMKI.js +1 -0
- package/dist/preview/{chunk.SVH3OMU2.js → chunk.ZJXUWOG3.js} +1 -1
- package/dist/preview/{chunk.SWLDDQJS.js → chunk.ZK42LPF5.js} +1 -1
- package/dist/preview/{chunk.SRU2YDTJ.js → chunk.ZZGXVYW2.js} +1 -1
- package/dist/preview/index.html +51 -51
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.24MUPV4Y.js +0 -1
- package/dist/preview/chunk.2VZSC2MB.js +0 -1
- package/dist/preview/chunk.3L5USMQD.js +0 -1
- package/dist/preview/chunk.3O3H37WD.js +0 -1
- package/dist/preview/chunk.4VJARLJ5.js +0 -1
- package/dist/preview/chunk.5DZR46YG.js +0 -1
- package/dist/preview/chunk.5RNB6IC5.js +0 -1
- package/dist/preview/chunk.6BMCZPT6.js +0 -1
- package/dist/preview/chunk.6VA5XFRR.js +0 -1
- package/dist/preview/chunk.7PJVMADH.js +0 -2
- package/dist/preview/chunk.ATWNWPME.js +0 -1
- package/dist/preview/chunk.AVCW7C6V.js +0 -1
- package/dist/preview/chunk.BLS2G3CD.js +0 -5
- package/dist/preview/chunk.BNQL37AC.js +0 -88
- package/dist/preview/chunk.CBJHYNNT.js +0 -1
- package/dist/preview/chunk.EF3UB7US.js +0 -1
- package/dist/preview/chunk.EJUZGIQ5.js +0 -1
- package/dist/preview/chunk.F5FJHKWV.js +0 -1
- package/dist/preview/chunk.GQI53L5P.js +0 -1
- package/dist/preview/chunk.HG34MT7C.js +0 -1
- package/dist/preview/chunk.IATLUWAD.js +0 -1
- package/dist/preview/chunk.JLR74UFP.js +0 -1
- package/dist/preview/chunk.K4ITS63T.js +0 -1
- package/dist/preview/chunk.KT2LXHSI.js +0 -1
- package/dist/preview/chunk.M5RHVUZ6.js +0 -1
- package/dist/preview/chunk.MBZ6N5SO.js +0 -1
- package/dist/preview/chunk.N7FIUTVY.js +0 -1
- package/dist/preview/chunk.NPU4WYRB.js +0 -1
- package/dist/preview/chunk.OHAWUOUN.js +0 -1
- package/dist/preview/chunk.OKQ4JXTW.js +0 -1
- package/dist/preview/chunk.OYQ6ZA6T.js +0 -1
- package/dist/preview/chunk.Q7UQ5OXA.js +0 -1
- package/dist/preview/chunk.ROJZLOKZ.js +0 -1
- package/dist/preview/chunk.RXJBYP7B.js +0 -1
- package/dist/preview/chunk.S7OFTGBQ.js +0 -18
- package/dist/preview/chunk.SGMVLKZO.js +0 -25
- package/dist/preview/chunk.SJRXBTGP.js +0 -1
- package/dist/preview/chunk.THTHNY4N.js +0 -1
- package/dist/preview/chunk.U6FGWVGB.js +0 -1
- package/dist/preview/chunk.UEL7FLL7.js +0 -1
- package/dist/preview/chunk.VM43YREJ.js +0 -1
- package/dist/preview/chunk.YAS6LXQ7.js +0 -1
- package/dist/preview/chunk.YEMNR4WU.js +0 -1
- package/dist/preview/chunk.YG3BLY67.js +0 -32
- package/dist/preview/chunk.YYS45ZGQ.js +0 -1
- package/dist/preview/chunk.ZI66HRES.js +0 -1
- package/dist/preview/chunk.ZK446PSX.js +0 -359
- package/dist/preview/chunk.ZVETGRUM.js +0 -1
- package/dist/preview/chunk.ZVOP2HHI.js +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.
|
|
1
|
+
import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.7IOC6U3C.js";import"./chunk.7FZY5E2U.js";import"./chunk.7354O67H.js";import"./chunk.XLM4ONUB.js";import"./chunk.XOZU4OFA.js";import"./chunk.C7EEYSAM.js";import{a as A}from"./chunk.DGWNVDZB.js";import"./chunk.TI4OSTQV.js";import"./chunk.3TME4BG3.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import"./chunk.7EA7THSM.js";import"./chunk.AI2HBKVP.js";import{G as M,T as f}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as d}from"./chunk.AJZBJBMO.js";var n=d(M(),1);var r=d(f(),1),C="several";function q({chosen:c,acts:p,onAct:N}){let t=A(),u=(0,n.useMemo)(()=>[...c].sort(),[c]),i=u.join(`
|
|
2
2
|
`),o=(0,n.useMemo)(()=>({on:"selection",ids:u}),[i]),l=(0,n.useMemo)(()=>p.filter(e=>e.open.length===0&&!e.more&&!e.destructive),[p]),g=(0,n.useMemo)(()=>new Map(l.map(e=>[h(e.id),e])),[l]),v=S(t,o,C),[y,x]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(v!==void 0)return;let e=!0;return w(t,o,{by:C,ask:()=>b(t.ai,{store:t.store,target:o,principal:t.principal,interaction:k(),places:t.places,selection:t.selection,...t.place?{place:t.place}:{},shared:l.map(a=>({id:a.id,label:a.label,mutation:a.mutation,args:a.args}))})}).then(a=>{e&&x({key:i,result:a})}),()=>{e=!1}},[i]);let s=v??(y?.key===i?y.result:void 0);if(s===void 0)return(0,r.jsx)("span",{role:"status",className:"graview-several-quiet","data-testid":"several-ai-thinking",style:{textDecoration:"none"},children:"AI: thinking\u2026"});let m=s.offers.filter(e=>e.type!=="act"||g.has(e.id));if(m.length===0)return null;let E=e=>{let a=g.get(e.id);if(a){t.desk.record({...s.interaction,outcome:"accepted",accepted:[e.id]}),N(a);return}I(t,s,e)};return(0,r.jsx)("div",{role:"group","aria-label":"Suggested by AI",className:"graview-several-acts","data-testid":"several-ai",children:m.map(e=>(0,r.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-ai-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>E(e),children:[e.label,(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \xB7 suggested"})]},e.id))})}export{q as SeveralAi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk.MQISKON2.js";import{a as ie,b as de,c as se,d as le,e as V,f as L,g as ue}from"./chunk.GQX57JIE.js";import{a as fe}from"./chunk.LJXAZ5TF.js";import{c as T,e as ae}from"./chunk.QFI4L2HK.js";import{a as j,b as ee,c as ne,d as re,f as E,m as te,n as b,o as oe,p as B,q as P}from"./chunk.KFHXTHIY.js";import{b as x,d as ye,e as pe,g as me,h as ce,i as ge}from"./chunk.O6SKKF4V.js";import{C as v,Da as Y,Fb as q,Gb as Q,Hb as C,I as H,R as K,U as F,_ as J,da as X,ka as N,ma as Z,ra as G,sa as A,ta as z,ua as O,va as M}from"./chunk.BLS2G3CD.js";var he=e=>e.caption?.trim()||e.name,I=e=>A(e)?`${he(e)}, ${z(e)}`:he(e);function nn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Be(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=v(n[t]);for(;r?.innerType;)r=v(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function rn(e,n){for(let t of Be(n)){let r=O(e[t]).find(o=>G(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Oe=e=>typeof e=="string"&&ie.includes(e);function Pe(e){if(e!==void 0)return Oe(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var ve=4;function Fe(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,V):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function be(e,n=1,t=""){if(!Array.isArray(e)||n>ve)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>ae(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Pe(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Ne.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Fe(a);case"number":{let p=se.includes(a.as)?a.as:void 0,W=le.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...W?{emphasis:W}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=de.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:be(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:be(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Ne=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Me=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??te,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Me})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}var Ce=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Ce(d,n,l.value))return n.glance?ye(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):pe(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Te(n,d.expr.name):void 0;return oe(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,P(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var Ve=" \xB7 ";function Le(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split(Ve).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function we(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Oe(t.value)?t.value:"neutral"}function _e(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var je=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:me(e.definition,n)},Te=(e,n)=>q(e.definition?.fields?.shape?.[n]);function Ie(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=ce(je(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return K(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return x(t.definition,e,n);let l=typeof n=="number"?Te(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(I).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function De(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?Q(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Se(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function $e(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=we(e.tone,n),a=n.glance&&!r.problem?Le(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:we(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Y(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,P(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?_e(d):ge(je(n,e.field),d),s=k(()=>Ie(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>G(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(I).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:Re(e.blocks,Se(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?Re(e.show,Se(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:De(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return We(e,n)}}function Re(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...$e(r,n,o===t),key:r.key}))}function ke(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return ke(r.blocks,n);case"when":return r.shown&&ke(r.blocks,n);default:return!1}})}var Ue=new Set(["every","some","sum","min","max","sort"]);function An(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Ue.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function We(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=He(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??V),i=l.slice(0,L),s=l.slice(L),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ke(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function D(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var $=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function He(e,n,t){let r=o=>{let a=D(t,o.kind,n).indexOf(String($(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ke(e,n,t,r){let o=e.some(i=>D(t,i.kind,n.by).length>0)?void 0:ue(n.by);if(o&&r)return Je(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of D(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>$(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String($(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Je(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=P(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function Ae(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(Ae):e.t==="when"?e.show.some(Ae):!1}function xe(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Ge=new WeakMap;function U(e){let n=Ge.get(e);return n||Ge.set(e,n=fe(e)),n}function Xe(e,n,t,r={}){let o=U(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:ne)?.computed??[])try{let f=[],y=E(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=ee(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof re))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Gn(e,n,t){let{values:r}=Xe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}var Ze=500,ze=2e4,Ee=new WeakMap;function Ye(e,n){let t=Ee.get(e);t||Ee.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=xe(e,n)),r}function Fn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:U(d),fields:a?Ye(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??H(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?ze:Ze),...i?{}:{glance:!0}}}export{he as a,nn as b,Be as c,rn as d,be as e,Re as f,ke as g,An as h,Ae as i,Xe as j,Gn as k,Fn as l};
|
|
1
|
+
import{a as _}from"./chunk.3TME4BG3.js";import{a as ie,b as de,c as se,d as le,e as V,f as L,g as ue}from"./chunk.I43ONAEL.js";import{a as fe}from"./chunk.73EKJ4JN.js";import{c as T,e as ae}from"./chunk.INL4OZI7.js";import{a as j,b as ee,c as ne,d as re,f as E,m as te,n as b,o as oe,p as B,q as P}from"./chunk.5WU2UTP7.js";import{b as x,d as ye,e as pe,g as me,h as ce,i as ge}from"./chunk.7EA7THSM.js";import{C as v,Da as Y,I as H,Ib as q,Jb as Q,Kb as C,R as K,U as F,_ as J,da as X,ka as N,ma as Z,ra as G,sa as A,ta as z,ua as O,va as M}from"./chunk.VOHRQXCF.js";var he=e=>e.caption?.trim()||e.name,I=e=>A(e)?`${he(e)}, ${z(e)}`:he(e);function nn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Be(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=v(n[t]);for(;r?.innerType;)r=v(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function rn(e,n){for(let t of Be(n)){let r=O(e[t]).find(o=>G(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Oe=e=>typeof e=="string"&&ie.includes(e);function Pe(e){if(e!==void 0)return Oe(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var ve=4;function Fe(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,V):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function be(e,n=1,t=""){if(!Array.isArray(e)||n>ve)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>ae(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Pe(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Ne.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Fe(a);case"number":{let p=se.includes(a.as)?a.as:void 0,W=le.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...W?{emphasis:W}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=de.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:be(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:be(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Ne=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Me=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:E(e,{graph:n.graph??te,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Me})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}var Ce=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(Ce(d,n,l.value))return n.glance?ye(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):pe(l.value);let i=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Te(n,d.expr.name):void 0;return oe(d,i?C(l.value,i):b(l.value,d.format,n.today,d.formatArgs,n.money,P(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var Ve=" \xB7 ";function Le(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split(Ve).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function we(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Oe(t.value)?t.value:"neutral"}function _e(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var je=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:me(e.definition,n)},Te=(e,n)=>q(e.definition?.fields?.shape?.[n]);function Ie(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=ce(je(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return K(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&typeof n=="string")return x(t.definition,e,n);let l=typeof n=="number"?Te(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(I).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function De(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?Q(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Se(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function $e(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=we(e.tone,n),a=n.glance&&!r.problem?Le(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:we(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Y(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,P(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?_e(d):ge(je(n,e.field),d),s=k(()=>Ie(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>G(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(I).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:Re(e.blocks,Se(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?Re(e.show,Se(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:De(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return We(e,n)}}function Re(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...$e(r,n,o===t),key:r.key}))}function ke(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return ke(r.blocks,n);case"when":return r.shown&&ke(r.blocks,n);default:return!1}})}var Ue=new Set(["every","some","sum","min","max","sort"]);function An(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Ue.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function We(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=He(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??V),i=l.slice(0,L),s=l.slice(L),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ke(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function D(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var $=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function He(e,n,t){let r=o=>{let a=D(t,o.kind,n).indexOf(String($(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ke(e,n,t,r){let o=e.some(i=>D(t,i.kind,n.by).length>0)?void 0:ue(n.by);if(o&&r)return Je(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of D(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>$(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String($(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function Je(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=P(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Z(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function Ae(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(Ae):e.t==="when"?e.show.some(Ae):!1}function xe(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Ge=new WeakMap;function U(e){let n=Ge.get(e);return n||Ge.set(e,n=fe(e)),n}function Xe(e,n,t,r={}){let o=U(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:X(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:ne)?.computed??[])try{let f=[],y=E(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=ee(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof re))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Gn(e,n,t){let{values:r}=Xe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}var Ze=500,ze=2e4,Ee=new WeakMap;function Ye(e,n){let t=Ee.get(e);t||Ee.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=xe(e,n)),r}function Fn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:U(d),fields:a?Ye(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??H(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?ze:Ze),...i?{}:{glance:!0}}}export{he as a,nn as b,Be as c,rn as d,be as e,Re as f,ke as g,An as h,Ae as i,Xe as j,Gn as k,Fn as l};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as te}from"./chunk.
|
|
1
|
+
import{b as te}from"./chunk.JQBP6QWQ.js";import"./chunk.CV4QA4ZF.js";import"./chunk.OYRZ2DEI.js";import{c as ne}from"./chunk.7EA7THSM.js";import{G as ge,T as ee}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Mc as q,da as X,ga as Z}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
|
|
2
2
|
`),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
|
|
3
3
|
`)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as v,C,D as S,J as G,o as O}from"./chunk.AI2HBKVP.js";import{G as I,aa as m,c as V,j as y,l as p,m as g,n as u,o as D,v as B,z as E}from"./chunk.Q5IAXTF5.js";import{ia as M,od as P,pd as k,rd as R,sd as T}from"./chunk.VOHRQXCF.js";import{b as A}from"./chunk.AJZBJBMO.js";var W=A(I(),1);function j(e,t){try{t.length===0?localStorage.removeItem(v(e)):localStorage.setItem(v(e),JSON.stringify(t))}catch{}}function F(e,t){j(e,[...S(e).filter(n=>n.title!==t.title),t])}function H(e,t){j(e,S(e).filter(n=>n.title!==t))}function J(e,t){for(let n of e.places().filter(o=>o.title===t))e.forget?.(n.kind,n.as)}var U=e=>e===!0?{written:!0}:typeof e=="object"&&e!==null?{written:e.kept===!0,...e.said?{said:e.said}:{}}:{written:!1},N=e=>({title:e.title,lens:e.lens,on:e.on,...e.bindings?{bindings:e.bindings}:{},...e.options?{options:e.options}:{}});function Z(e,t){let n=o=>t.some(r=>r.title===o||r.as===P(o));if(!n(e))return e;for(let o=2;;o++)if(!n(`${e} ${o}`))return`${e} ${o}`}function ie(e){let{store:t,views:n,brand:o,seatTalk:r,onKeepLens:d}=m(),h=(0,W.useContext)(O),L=C(o,t.schema),b=async f=>{let{edit:i}=f;if(f.written&&d)try{await d({op:"remove-lens",title:i.title,on:i.on})}catch{}H(L,i.title),J(n,i.title),h?.dismiss(`kept:${i.title}`),r.setTurns(l=>[...l.map(s=>s.kept&&s.kept.edit.title===i.title&&!s.kept.taken?{...s,kept:{...s.kept,taken:!0}}:s),{role:"seat",text:`Took \u201C${i.title}\u201D back out of the places.`}]);let a=M(t.schema,i.on);e({to:"kind",kind:i.on,title:a,address:k(t.schema,i.on),said:`Went to ${a}.`})};return{keep:async f=>{let i=Z(f.edit.title,n.places()),a={...f.edit,title:i},l=!1,s;if(d)try{({written:l,said:s}=U(await d(a)))}catch{l=!1}l||F(L,N(a)),G(n,t.schema,[N(a)]);let K=n.places(),c=K.find(w=>w.title===i),x=s??(l?`Kept \u201C${i}\u201D as a lens: it is in the places now.`:d?`Kept \u201C${i}\u201D as your own lens. Ask the owner to keep it for everyone.`:`Kept \u201C${i}\u201D as your own lens.`),$={edit:a,written:l};r.setDraft(null),r.setTurns(w=>[...w,{role:"seat",text:x,kept:$}]),h?.notify({kind:"toast",id:`kept:${i}`,sentence:x,timeout:1e4,action:{label:"Take back",onSelect:()=>void b($)}}),c&&e({to:"picture",kind:c.kind,as:c.as,title:i,address:R(c.as,T(c,K)?k(t.schema,c.kind).slice(1):void 0),said:`Went to ${i}.`})},takeBack:b}}var q=A(I(),1);function _(e,t){switch(t.to){case"place":return{view:V("#")};case"picture":return{view:u(E(p(e,"filter",null),t.kind,t.as),[])};case"kind":{let n=D(g({...y(e,B(t.kind)),relation:null},!1),!0);return{view:u(p(p(n,"view",null),"filter",t.filter??null),[])}}case"record":return{view:u(y(g(p(p(e,"view",null),"filter",null),!1),t.id),[t.id])};case"problems":return{pane:"problems"}}}function z(e){let t=typeof document>"u"?null:document.querySelector('[data-testid="standing"]');t&&t.getAttribute("aria-expanded")==="true"!==e&&t.click()}function ae(){let{setView:e,seatTalk:t}=m();return(0,q.useCallback)(n=>{t.get().draft&&t.setDraft(null),z(n.to==="problems"),n.to!=="problems"&&e(o=>{let r=_(o,n);return"view"in r?r.view:o})},[e,t])}export{ie as a,z as b,ae as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as a}from"./chunk.YKACMLLU.js";import{G as f,T as s,aa as l}from"./chunk.Q5IAXTF5.js";import{b as i}from"./chunk.AJZBJBMO.js";var d=i(f(),1),p=i(s(),1),c=new Set;function B(e){return c.add(e),()=>void c.delete(e)}function S(){let{store:e,principal:o}=l();return(0,d.useMemo)(()=>n=>{let t=n.on===void 0?void 0:e.graph.getNode(n.on);if(!t)return null;let u=[...c].filter(r=>r.store===e&&r.kind===t.kind);return(n.element?u.find(r=>r.root()?.contains(n.element)??!1):u[0])?.section(t.id,o)??null},[e,o])}function v({children:e}){let o=S(),n=(0,d.useMemo)(()=>[o],[o]);return(0,p.jsx)(a,{sections:n,children:e})}export{B as a,S as b,v as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as z,e as D,f as H}from"./chunk.
|
|
1
|
+
import{d as z,e as D,f as H}from"./chunk.XPR3QFF4.js";import"./chunk.YUEOUV7G.js";import{a as P,b as A,c as p,d as W}from"./chunk.UGFDSE37.js";import"./chunk.W5UJLKIT.js";import"./chunk.7UJZP3YK.js";import"./chunk.R77TACXU.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.LSL25VXW.js";import"./chunk.WWUMSCYC.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{a as C,b as O}from"./chunk.MB7LKKUD.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{G as B,Ra as k,T as L}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import{Oc as R}from"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as E}from"./chunk.AJZBJBMO.js";var r=E(B(),1);var s=E(L(),1);function M(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let n=c??document,o=n.querySelector("main")??n.querySelector("[data-graview-page]")??null,t=n.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??o;t instanceof HTMLElement&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0}))}var I=1500;function N(c,e,n){let{store:o,principal:t}=c,l=z(o),g=(0,r.useMemo)(()=>P(o,t),[o,t,l]),w=(0,r.useRef)(n),[b,d]=(0,r.useState)(),[y,u]=(0,r.useState)("");(0,r.useEffect)(()=>{let a=A(o,t,w.current);w.current=o.batches().length,a&&(d({batch:a.batch,at:e,when:Date.now()}),u(""))},[o,t,l]),(0,r.useEffect)(()=>{d(a=>!a||a.at===e?a:Date.now()-a.when<I?{...a,at:e}:void 0)},[e]);let[x,i]=(0,r.useState)(null),v=(0,r.useCallback)(()=>{d(void 0),i(null)},[]),f=(0,r.useCallback)(()=>{i(null);try{let a=W(o,t);a&&u(`Took back \u201C${a.intent}\u201D`)}catch(a){i(a instanceof Error?a.message:String(a))}},[o,t]),S=g&&b?.batch===g.batch&&b.at===e?g:void 0;return{change:g,offered:S,close:v,takeBack:f,refused:x,said:y}}function ee({context:c,docked:e,at:n,since:o,compact:t=!1,className:l,size:g}){let{change:w,offered:b,close:d,takeBack:y,refused:u,said:x}=N(c,n,o),i=e?b:w,v=(0,r.useRef)(null),f=e&&(i!==void 0||u!==null);j(v,f),(0,r.useEffect)(()=>{if(!f)return;let m,h=()=>m=setTimeout(()=>v.current?.matches(":hover, :focus-within")?h():d(),1e4);return h(),()=>clearTimeout(m)},[f,i?.batch,u,d]);let S=x||(e&&i?p(i):""),a=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:R("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...f?{}:{display:"none"}}:{},T=i?(0,s.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${p(i)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");y(),requestAnimationFrame(()=>M(h))},...e?{style:U}:{className:H("graview-undo",l),...D(g),...t?{"data-compact":"","aria-label":p(i)}:{}},children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),e?(0,s.jsx)("span",{style:K,children:p(i)}):(0,s.jsx)("span",{className:"graview-undo-words",children:t?"Undo":p(i)})]}):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{role:"status","aria-live":"polite",style:V,children:S}),(0,s.jsxs)("div",{ref:v,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",...e?{style:{...F,...a}}:{className:"graview-undo-place"},children:[e?null:(0,s.jsx)("style",{children:q}),e&&i?(0,s.jsxs)("div",{"data-testid":"page-undo-notice",style:Z,children:[T,(0,s.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${p(i)}`,title:"Dismiss",onClick:m=>{let h=m.currentTarget.closest("[data-graview-face]");d(),requestAnimationFrame(()=>M(h))},style:$,children:"\xD7"})]}):T,u?(0,s.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",className:"graview-undo-refused",...e?{style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",borderRadius:6,background:"var(--graview-float)",padding:"4px 8px"}}:{},children:u}):null]})]})}function j(c,e){(0,r.useLayoutEffect)(()=>{let n=c.current;if(!n||!e)return;if(typeof n.showPopover=="function"&&!k(n))try{n.showPopover()}catch{}let o=()=>n.parentElement?.closest("[data-embed-content]")??null,t=()=>{O(n,o()),dispatchEvent(new Event(C))};t(),addEventListener("resize",t),addEventListener("scroll",t,!0);let l=typeof ResizeObserver=="function"?new ResizeObserver(t):null;return l?.observe(n),()=>{if(l?.disconnect(),removeEventListener("resize",t),removeEventListener("scroll",t,!0),n.isConnected&&k(n))try{n.hidePopover()}catch{}dispatchEvent(new Event(C))}},[c,e])}var q=`:where(.graview-undo-place){display:grid;justify-items:end;gap:4px;max-width:100%;min-width:0}
|
|
2
2
|
:where(.graview-undo){box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;min-height:var(--graview-control-height,36px);max-width:min(100%,var(--graview-undo-widest,18rem));min-width:0;padding:0 14px;border-radius:999px;border:1px solid var(--graview-edge);background:var(--graview-float);color:var(--graview-ink);font:inherit;font-size:.875rem;cursor:pointer}
|
|
3
3
|
:where(.graview-undo[data-size=sm]){--graview-control-height:30px}
|
|
4
4
|
:where(.graview-undo[data-compact]){padding:0 10px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{da as l,ka as p,ob as a}from"./chunk.VOHRQXCF.js";import{c}from"./chunk.SLBWPVIY.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.AI2HBKVP.js";import{T as o,aa as n}from"./chunk.Q5IAXTF5.js";import"./chunk.SDO3U72B.js";import"./chunk.VOHRQXCF.js";import"./chunk.SLBWPVIY.js";import{b as t}from"./chunk.AJZBJBMO.js";var a=t(o(),1),d=[["waiting","Waiting"],["active","Under way: darker and taller"],["done","Done: flat and pale"],["flagged","A problem, or past its due date"],["recent","Changed since you were last here"],["own","Yours"]],g=i=>{let e=r=>`color-mix(in oklab,var(--graview-ink) ${r}%,var(--graview-panel))`;return`.graview-map-key{display:grid;gap:4px;padding:2px 4px 8px;margin-bottom:6px;border-bottom:1px solid var(--graview-edge);font-size:.8125rem;color:var(--graview-ink-muted)}
|
|
2
2
|
.graview-map-key>div{display:flex;align-items:center;gap:8px}
|
|
3
3
|
.graview-map-key>div:first-child{color:var(--graview-ink)}
|
|
4
4
|
.graview-map-key i{flex:none;width:14px;height:10px;border-radius:2px;background:${e(i?34:42)}}
|
|
@@ -0,0 +1 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
import{e as c}from"./chunk.
|
|
1
|
+
import{e as c}from"./chunk.NVNQSZ43.js";import{cc as m}from"./chunk.VOHRQXCF.js";function k(e){let n=e.policy?.sees??[];return n.length===0?!0:e.schema.kinds.every(r=>n.some(o=>o.roles==="*"&&!o.own&&!o.via&&o.kinds.includes(r)))}function A(e){let n=e;for(let r=0;r<8&&n?._zod?.def;r+=1){let o=n._zod.def;if(o.type==="enum")return Object.values(o.entries);if(o.type==="literal")return o.values;if(!("innerType"in o))return;n=o.innerType}}var h=(e,n)=>({ok:!1,reason:e,message:n});function b(e,n){return c(e).find(r=>(r.as??r.act)===n)??c(e).find(r=>r.act===n&&r.as===void 0)}var w=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&"href"in e;function S(e,n,r,o,f){let l=b(n,r);if(!l)return h("undeclared",`This view may not ask for \u201C${r}\u201D: its manifest does not name it.`);let u={},g=0;for(let[y,i]of Object.entries(o)){let d=a=>{if(!w(a))return a;let s=typeof a.href=="string"?f?.file(a.href):void 0;if(!s)throw h("malformed",`\u201C${y}\u201D is a file the host did not hand this view: a view hands an act a file the person dropped (event.files), or one a record it was shown holds, as it was handed.`);return f?.dropped(s.href)&&(g+=1),s};try{u[y]=Array.isArray(i)?i.map(d):d(i)}catch(a){return a}}if(!k(e)){let i=e.allMutations().find(s=>s.name===l.act)?.input?.shape??{},d=(s,t)=>w(t)&&typeof t.href=="string"&&f?.dropped(t.href)===!0||m(t)||typeof t=="string"&&f?.shown.has(t)===!0||(A(i[s])?.some(p=>p===t)??!1);if(!(g>0&&Object.entries(u).every(([s,t])=>Array.isArray(t)?t.every(p=>d(s,p)):d(s,t))))return h("press-only","In this app some members may not see some records, so a view's act applies only when you press it.")}return{ok:!0,name:l.act,args:{...u,...l.constants??{}}}}export{k as a,A as b,h as c,b as d,S as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.GZHZLJBF.js";import{n as D}from"./chunk.
|
|
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 +1 @@
|
|
|
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{
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=e=>e.at+e.removed.length;function i(e,r){if(!Number.isInteger(r.at)||r.at<0||r.at>e.length||e.slice(r.at,a(r))!==r.removed)throw new RangeError(`The text does not hold ${JSON.stringify(r.removed)} at ${r.at}.`);return e.slice(0,r.at)+r.inserted+e.slice(a(r))}var s="\0graview:unset",m=e=>e===void 0||e===s;function f(e){if(e.op!=="patch-node")return e;let r=n=>Object.fromEntries(Object.entries(n).map(([t,d])=>[t,d===void 0?s:d]));return{...e,before:r(e.before),after:r(e.after)}}function o(e){switch(e.op){case"add-node":return{op:"remove-node",node:e.node};case"remove-node":return{op:"add-node",node:e.node};case"patch-node":return{op:"patch-node",id:e.id,before:e.after,after:e.before};case"add-edge":return{op:"remove-edge",edge:e.edge};case"remove-edge":return{op:"add-edge",edge:e.edge};case"splice-text":return{...e,removed:e.inserted,inserted:e.removed}}}function p(e){switch(e.op){case"add-node":case"remove-node":return[e.node.id];case"patch-node":case"splice-text":return[e.id];case"add-edge":case"remove-edge":return[e.edge.from,e.edge.to]}}function v(e,r,n=!1){let t=e[r.field];if(typeof t!="string")return e;try{return{...e,[r.field]:i(t,n?o(r):r)}}catch{return e}}var u=new WeakMap;function g(e){return[...e].reverse().map(f).map(o)}function P(e){if(e.inverse)return e.inverse;let r=u.get(e);return r||u.set(e,r=g(e.primitives)),r}function l(e,r){if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n]&&JSON.stringify(e[n])!==JSON.stringify(r[n]))return!1;return!0}function b(e){if(e.inverse===void 0||!l(e.inverse,g(e.primitives)))return e;let{inverse:r,...n}=e;return n}export{i as a,s as b,m as c,f as d,o as e,p as f,v as g,P as h,b as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as x}from"./chunk.
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ad as f,Ed as b,Fd as S,Gd as P,Jd as A,Kd as L,ia as u,ld as w,md as v,od as $,pd as c,rd as k,sd as x}from"./chunk.VOHRQXCF.js";function T(s){if(!(s.attach==="home"||s.cardinality==="one"||!s.title))return{kind:s.attach,title:s.title,as:$(s.title),name:s.name,lens:"view",...s.hidden?{hidden:!0}:{}}}function H(s,r=[]){let a=[];for(let n of f(s).drawn)for(let i of n.kinds)a.push({kind:i,title:n.title,as:n.as,...n.across?{across:n.across}:{},...n.kinds.length>1?{over:n.kinds}:{},...n.hidden?{hidden:!0}:{}});for(let n of[...s.views?.places?.()??[],...r.flatMap(i=>T(i)??[])])a.some(i=>i.kind===n.kind&&i.as===n.as)||a.push(n);return a}function U(s,r={}){return V(s.schema,H(s,r.views),{...s.pages?{pages:s.pages}:{},lenses:f(s).drawn,home:(s.home?.length??0)>0})}function V(s,r,a={}){let{pages:n}=a,i=s.kinds,d=r.filter(e=>i.includes(e.kind)),o=L(n?.first,s,d),N=new Set(n?.hide??[]),p=A(i,n?.order,d),m=p.flatMap(e=>e.view?[]:[e.kind]),O=p.flatMap(e=>e.view?[e.view]:[]),h=[{slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#",...o?.to==="home"||o===void 0&&a.home?{first:!0}:{}},{slug:b,title:P(n),kind:null,cardinality:"many",address:S,stop:"#"}],E=v([...d].sort((e,t)=>m.indexOf(e.kind)-m.indexOf(t.kind))),g=e=>{let t=a.lenses?.find(l=>l.as===e.as&&l.kinds.includes(e.kind)),y=x(e,d);return{slug:e.as,title:e.title,kind:e.kind,...e.over?{over:e.over.filter(l=>i.includes(l))}:{},cardinality:"many",address:k(e.as,y?c(s,e.kind).slice(1):void 0),stop:y?`#focus=aggregate:${e.kind}&in.view=${encodeURIComponent(e.as)}`:`#view=${encodeURIComponent(e.as)}`,...t?{lens:t.lens}:{},...e.name!==void 0?{view:e.name}:{},...e.hidden?{hidden:!0}:{},...o?.to==="place"&&o.place.as===e.as&&(o.place.kind===e.kind||e.over?.includes(o.place.kind))?{first:!0}:{}}};for(let e of E)O.some(t=>w(t,e))||h.push(g(e));for(let e of p){if(e.view){h.push(g(e.view));continue}let t=e.kind;h.push({slug:c(s,t).slice(1),title:u(s,t),kind:t,cardinality:"many",address:c(s,t),stop:`#focus=aggregate:${t}`,...N.has(t)?{hidden:!0}:{},...o?.to==="kind"&&o.kind===t?{first:!0}:{}})}return h}export{U as a,V as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as o,l as u}from"./chunk.
|
|
1
|
+
import{g as o,l as u}from"./chunk.Q5IAXTF5.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as y,c as m}from"./chunk.MB7LKKUD.js";import"./chunk.
|
|
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};
|