graview 0.1.57 → 0.1.58
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.N33WUCAN.js → chunk.27CW6SCT.js} +1 -1
- package/dist/preview/{chunk.XTBS64IT.js → chunk.2EDC63RI.js} +1 -1
- package/dist/preview/{chunk.JD5HSAMC.js → chunk.2VYNNWW5.js} +3 -3
- package/dist/preview/chunk.32FMOHZK.js +1 -0
- package/dist/preview/{chunk.LHIT3EZD.js → chunk.34TW32TB.js} +2 -2
- package/dist/preview/{chunk.QMYHXMRV.js → chunk.3FCOFEGW.js} +1 -1
- package/dist/preview/{chunk.JETT6ELP.js → chunk.3OYGXYQY.js} +1 -1
- package/dist/preview/{chunk.RQX4CQJN.js → chunk.3YZHZGTM.js} +1 -1
- package/dist/preview/{chunk.YS5U3DUX.js → chunk.43OKZU73.js} +1 -1
- package/dist/preview/{chunk.O47MN7E5.js → chunk.4444RPWW.js} +1 -1
- package/dist/preview/{chunk.N2DM42SG.js → chunk.47JQPYXL.js} +2 -2
- package/dist/preview/{chunk.57BKS5KD.js → chunk.4AFFPYOK.js} +1 -1
- package/dist/preview/chunk.4GGPPCMM.js +1 -0
- package/dist/preview/{chunk.534TBZJ3.js → chunk.4HSH2UIK.js} +2 -2
- package/dist/preview/{chunk.LKJ6FD6Y.js → chunk.4KC35UNR.js} +1 -1
- package/dist/preview/{chunk.EZ4NUZWX.js → chunk.4Y2JTY6Q.js} +1 -1
- package/dist/preview/{chunk.5BPRGXIW.js → chunk.5ICIMQE6.js} +1 -1
- package/dist/preview/{chunk.YR75TWDV.js → chunk.64R3K2OE.js} +1 -1
- package/dist/preview/chunk.6K7EN2YI.js +1 -0
- package/dist/preview/{chunk.YQXA4WAM.js → chunk.6VC6AGYV.js} +2 -2
- package/dist/preview/{chunk.4HPP35XQ.js → chunk.6W7O5YLL.js} +1 -1
- package/dist/preview/chunk.7BBGRTXM.js +5 -0
- package/dist/preview/{chunk.IRQOJATD.js → chunk.7MSFDD7J.js} +1 -1
- package/dist/preview/{chunk.XVN3CQKH.js → chunk.7SQAKSJD.js} +1 -1
- package/dist/preview/{chunk.DM5X3JBH.js → chunk.7V23SXGJ.js} +1 -1
- package/dist/preview/{chunk.DWLKJGVT.js → chunk.A6C4AGJJ.js} +1 -1
- package/dist/preview/{chunk.LWRXCO2Z.js → chunk.ACYDJQRC.js} +1 -1
- package/dist/preview/{chunk.RVR6FWAF.js → chunk.ARWBIBSI.js} +1 -1
- package/dist/preview/{chunk.7VIFAN3O.js → chunk.B2GVJD6H.js} +1 -1
- package/dist/preview/{chunk.NL3AJZ3N.js → chunk.B3WZHPM3.js} +1 -1
- package/dist/preview/{chunk.5NZDFT6R.js → chunk.BB33TI4S.js} +1 -1
- package/dist/preview/{chunk.UBNZDSS7.js → chunk.BKVBX2YB.js} +1 -1
- package/dist/preview/{chunk.FLMNWVSY.js → chunk.BTVBZ6KE.js} +2 -2
- package/dist/preview/{chunk.JBSW7ZNH.js → chunk.CCWPF5PK.js} +1 -1
- package/dist/preview/{chunk.7UBABS2T.js → chunk.D5KTGX7F.js} +1 -1
- package/dist/preview/{chunk.YPP7FSEZ.js → chunk.DBZHRYBK.js} +1 -1
- package/dist/preview/{chunk.NUS5K56R.js → chunk.DM767F2Q.js} +2 -2
- package/dist/preview/{chunk.MAZFQIL5.js → chunk.E34OQVSR.js} +1 -1
- package/dist/preview/{chunk.72IHABM5.js → chunk.E5MSFXL6.js} +1 -1
- package/dist/preview/{chunk.7ML2BWSP.js → chunk.EB4NVTJL.js} +1 -1
- package/dist/preview/{chunk.ZNXRHOUI.js → chunk.ELAMMS2V.js} +1 -1
- package/dist/preview/{chunk.QPL3OXW3.js → chunk.ELERUERU.js} +1 -1
- package/dist/preview/{chunk.I636CZE4.js → chunk.EPPXZZPK.js} +1 -1
- package/dist/preview/{chunk.LUIRQ5UF.js → chunk.EQTSV7BK.js} +1 -1
- package/dist/preview/{chunk.MRHPOUA4.js → chunk.ETBFD76E.js} +1 -1
- package/dist/preview/{chunk.VHPGGC2P.js → chunk.F7SF6EP2.js} +1 -1
- package/dist/preview/{chunk.DSLGMCB6.js → chunk.GCBZ3WE2.js} +1 -1
- package/dist/preview/{chunk.IX63LTRQ.js → chunk.GDOTG7YA.js} +1 -1
- package/dist/preview/{chunk.LE2KAR25.js → chunk.GEB2DFBU.js} +1 -1
- package/dist/preview/{chunk.V6FUYRZI.js → chunk.GKSUTAIX.js} +1 -1
- package/dist/preview/{chunk.4L4F47QP.js → chunk.GP7F3PEF.js} +1 -1
- package/dist/preview/{chunk.FJTWAU7N.js → chunk.GQBJVCSM.js} +1 -1
- package/dist/preview/{chunk.IV7AUO53.js → chunk.GUEHKCWN.js} +1 -1
- package/dist/preview/{chunk.4HFCOMR3.js → chunk.GZB6A6KF.js} +1 -1
- package/dist/preview/{chunk.D3LQJXVP.js → chunk.H3BFHI3G.js} +1 -1
- package/dist/preview/{chunk.NZDWXX6H.js → chunk.HEWVPXRE.js} +1 -1
- package/dist/preview/{chunk.4NPXMYA5.js → chunk.HMFJT4KO.js} +1 -1
- package/dist/preview/{chunk.UGOKORIF.js → chunk.HS3GHAUR.js} +1 -1
- package/dist/preview/{chunk.DBMZ3AQB.js → chunk.HT2BEOEV.js} +1 -1
- package/dist/preview/{chunk.7IXTNST2.js → chunk.HXRV3WVJ.js} +1 -1
- package/dist/preview/{chunk.PQMMISCQ.js → chunk.HZB5F476.js} +1 -1
- package/dist/preview/{chunk.H5CRRBNU.js → chunk.I3WWCPQ2.js} +1 -1
- package/dist/preview/{chunk.UWQ3I5OW.js → chunk.IDJPBWL2.js} +1 -1
- package/dist/preview/{chunk.HFSG3F5Z.js → chunk.ILRCNTGT.js} +1 -1
- package/dist/preview/{chunk.I5PSHASU.js → chunk.INZQ6WZM.js} +1 -1
- package/dist/preview/{chunk.FLVE6IBM.js → chunk.IULQRCEE.js} +1 -1
- package/dist/preview/{chunk.JNNBHD4Z.js → chunk.JB7TTJXQ.js} +1 -1
- package/dist/preview/{chunk.Q6OZLBNL.js → chunk.JES77WXG.js} +1 -1
- package/dist/preview/{chunk.BUSFJM6P.js → chunk.JGKA5QBX.js} +1 -1
- package/dist/preview/chunk.JOAN54PN.js +1 -0
- package/dist/preview/{chunk.EXZLG3HK.js → chunk.JUNMJYH5.js} +1 -1
- package/dist/preview/{chunk.TVURUMU4.js → chunk.KFQSYCY3.js} +1 -1
- package/dist/preview/{chunk.NGK6IRV3.js → chunk.KJ264E6K.js} +1 -1
- package/dist/preview/{chunk.4XKRCAJZ.js → chunk.KJHPDL4N.js} +1 -1
- package/dist/preview/{chunk.FPGU43SC.js → chunk.KKNDX4JT.js} +1 -1
- package/dist/preview/{chunk.KYOI7BG3.js → chunk.KWJWAIQJ.js} +1 -1
- package/dist/preview/{chunk.MBLFZF5R.js → chunk.KXPRILAO.js} +1 -1
- package/dist/preview/chunk.L7V24JPO.js +1 -0
- package/dist/preview/chunk.LA4CPZ2N.js +1 -0
- package/dist/preview/{chunk.EZ4TZUMM.js → chunk.LCPGZK7G.js} +1 -1
- package/dist/preview/{chunk.7INWDFNG.js → chunk.LDAYDCUO.js} +1 -1
- package/dist/preview/{chunk.C7EJPV2N.js → chunk.LL2MLSPH.js} +1 -1
- package/dist/preview/{chunk.C5EFUODO.js → chunk.LMN4TSAP.js} +1 -1
- package/dist/preview/{chunk.TBRXNU6T.js → chunk.LO3U3P55.js} +1 -1
- package/dist/preview/{chunk.VDS3IOTK.js → chunk.LRUNFSHP.js} +1 -1
- package/dist/preview/{chunk.4W5GCPAP.js → chunk.LY3YOWKV.js} +1 -1
- package/dist/preview/{chunk.33PZEW5A.js → chunk.M34CS7DI.js} +1 -1
- package/dist/preview/{chunk.D4EP7FEC.js → chunk.MQ5HBUBL.js} +1 -1
- package/dist/preview/chunk.MV3AJ7JH.js +1 -0
- package/dist/preview/chunk.MYNQWWCL.js +1 -0
- package/dist/preview/{chunk.5GTOF5D5.js → chunk.NFX24NUI.js} +1 -1
- package/dist/preview/{chunk.47T3KUAA.js → chunk.NKC3JILT.js} +1 -1
- package/dist/preview/{chunk.N5MQARN6.js → chunk.NOFWGDOT.js} +1 -1
- package/dist/preview/{chunk.4UQBMFJZ.js → chunk.O4CVKTPJ.js} +1 -1
- package/dist/preview/{chunk.4OP4IEEY.js → chunk.OASYYMG5.js} +1 -1
- package/dist/preview/{chunk.VW4JAQCH.js → chunk.OHQ3JH65.js} +1 -1
- package/dist/preview/{chunk.NF72Z2HG.js → chunk.PBCNOFQH.js} +1 -1
- package/dist/preview/chunk.PM3SYXKB.js +1 -0
- package/dist/preview/{chunk.66LWZIY5.js → chunk.POBMGM3X.js} +1 -1
- package/dist/preview/{chunk.DJ4A76SX.js → chunk.PZG3B7F4.js} +1 -1
- package/dist/preview/chunk.QB25SMP6.js +1 -0
- package/dist/preview/{chunk.BZEJM2PY.js → chunk.QGV7H7RQ.js} +1 -1
- package/dist/preview/chunk.QPXXY2DL.js +1133 -0
- package/dist/preview/{chunk.BPEUHOKH.js → chunk.R7LFO7KI.js} +1 -1
- package/dist/preview/{chunk.NX7CR4AE.js → chunk.RE7DELSR.js} +1 -1
- package/dist/preview/{chunk.KPIDJYIU.js → chunk.RRKYJYZJ.js} +1 -1
- package/dist/preview/{chunk.KTV24HY7.js → chunk.S2H7B6RG.js} +1 -1
- package/dist/preview/chunk.S5MGE2U5.js +1 -0
- package/dist/preview/{chunk.Y3EOGXRS.js → chunk.SDVPJYVF.js} +1 -1
- package/dist/preview/{chunk.VSGTNYM2.js → chunk.SPXRLO5K.js} +1 -1
- package/dist/preview/{chunk.Z5UVYOGC.js → chunk.TBW7CU4G.js} +1 -1
- package/dist/preview/{chunk.4JDHBNEA.js → chunk.TF5I4VHX.js} +1 -1
- package/dist/preview/{chunk.4K6VAC2S.js → chunk.TJ647W6J.js} +2 -2
- package/dist/preview/{chunk.QS6YW7UY.js → chunk.TJOXNEFU.js} +1 -1
- package/dist/preview/{chunk.EQAAKYLA.js → chunk.TUUVVO5U.js} +1 -1
- package/dist/preview/{chunk.M72JKVHP.js → chunk.TWKXSLYY.js} +1 -1
- package/dist/preview/chunk.TXGNPW76.js +1 -0
- package/dist/preview/{chunk.WASWMHND.js → chunk.U6O3MMQR.js} +1 -1
- package/dist/preview/{chunk.6SD7YZ4U.js → chunk.UAP5M3CD.js} +2 -2
- package/dist/preview/chunk.UKMVJV6Q.js +1 -0
- package/dist/preview/chunk.UUG3BYVN.js +1 -0
- package/dist/preview/{chunk.BCE6LIDR.js → chunk.VG7OWV2H.js} +1 -1
- package/dist/preview/{chunk.MWWOI5PW.js → chunk.VHSWBFXB.js} +1 -1
- package/dist/preview/{chunk.3DPTDMJ7.js → chunk.VUPLFUUS.js} +1 -1
- package/dist/preview/chunk.WJFQIE3Y.js +1 -0
- package/dist/preview/{chunk.547FQPYG.js → chunk.WNQFHMNR.js} +1 -1
- package/dist/preview/{chunk.SAJLIA5M.js → chunk.WNSC3RWD.js} +1 -1
- package/dist/preview/{chunk.UV3U4FRT.js → chunk.WQOI6BLM.js} +1 -1
- package/dist/preview/{chunk.CUKRUQQ2.js → chunk.WXIEQZLY.js} +1 -1
- package/dist/preview/{chunk.53U6E5LD.js → chunk.XN2RVXOI.js} +1 -1
- package/dist/preview/{chunk.RALAID6N.js → chunk.XU34T2H4.js} +1 -1
- package/dist/preview/{chunk.JQFIZRAZ.js → chunk.YD3TKV6P.js} +2 -2
- package/dist/preview/{chunk.FRERJWZJ.js → chunk.YHTE34RN.js} +1 -1
- package/dist/preview/{chunk.CMLNBJZG.js → chunk.YIA2EDVF.js} +1 -1
- package/dist/preview/{chunk.AD3EC5DU.js → chunk.YP2F5UGY.js} +1 -1
- package/dist/preview/{chunk.G3BDQ6EA.js → chunk.YS6GVLIP.js} +1 -1
- package/dist/preview/{chunk.S5ECRIG5.js → chunk.YZZONE4M.js} +1 -1
- package/dist/preview/{chunk.2PWVDUOU.js → chunk.ZN5HTWSI.js} +1 -1
- package/dist/preview/{chunk.4BRM5SGO.js → chunk.ZOHMWSHD.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.4SBYXHCQ.js +0 -1
- package/dist/preview/chunk.57KRCHQT.js +0 -1
- package/dist/preview/chunk.6AH26OL7.js +0 -1132
- package/dist/preview/chunk.7VZA34T4.js +0 -1
- package/dist/preview/chunk.CXB4BSI4.js +0 -1
- package/dist/preview/chunk.DIFR37EZ.js +0 -5
- package/dist/preview/chunk.DQUISKTC.js +0 -1
- package/dist/preview/chunk.DSWMXM57.js +0 -1
- package/dist/preview/chunk.GBAUQXXD.js +0 -1
- package/dist/preview/chunk.I2NI7CT7.js +0 -1
- package/dist/preview/chunk.I6H3HRWT.js +0 -1
- package/dist/preview/chunk.KO7IOFNY.js +0 -1
- package/dist/preview/chunk.OYUDK3LK.js +0 -1
- package/dist/preview/chunk.PF5P5YVD.js +0 -1
- package/dist/preview/chunk.WYPL2QUA.js +0 -1
- package/dist/preview/chunk.Y4KNR76Z.js +0 -1
- package/dist/preview/chunk.YDTXCVBU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ye}from"./chunk.SDO3U72B.js";import{$d as Rt,Ed as ao,Ia as Xn,L as Zn,Ma as kt,Oa as Jn,Ud as so,Vc as to,Yd as lo,_a as Qn,_d as Ue,dd as no,fd as oo,ld as ro,od as io,uc as eo}from"./chunk.DIFR37EZ.js";import{a as $e,b as H}from"./chunk.AJZBJBMO.js";var To=$e(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 he(e,t,n){this.props=e,this.context=t,this.refs=Ao,this.updater=n||Eo}he.prototype.isReactComponent={};he.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")};he.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ko(){}ko.prototype=he.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,he.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 ge(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,ge(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,"$&/")+"/"),ge(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+=ge(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+=ge(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return ge(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 ot(e,t,n){if(e==null)return e;var o=[],r=0;return ge(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:ot,forEach:function(e,t,n){ot(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ot(e,function(){t++}),t},toArray:function(e){return ot(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=he;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 W=$e((es,Mo)=>{"use strict";Mo.exports=To()});var Wo=$e(at=>{"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}}at.Fragment=Ri;at.jsx=jo;at.jsxs=jo});var De=$e((us,Go)=>{"use strict";Go.exports=Wo()});var fe={focusId:null,relation:null,expanded:[],pins:{}},Ze=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Q(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}`,`${Xe(r.x)},${Xe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Xe(e.pan.x)},${Xe(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 Je(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[g,y]of n){if(!g.startsWith("pin."))continue;let[m,b]=y.split(","),k=m===void 0?null:Ze(m),f=b===void 0?null:Ze(b);k===null||f===null||(o[g.slice(4)]={x:k,y:f})}let r=Object.create(null);for(let[g,y]of n)!g.startsWith("in.")||y.length===0||(r[g.slice(3)]=y);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:Ze(a[0]),l=a[1]===void 0?null:Ze(a[1]),c=(n.get("sel")??"").split(",").filter(g=>g.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(g=>g.length>0&&(u||!g.startsWith("kind:"))).sort(),pins:o}}function Da(e){let t=Je(e);return Q(t)==="#"?{...t,overview:!0}:t}function Na(e){let t=Q(e);return t==="#overview=1"?"":t}function Xe(e){return Math.round(e*100)/100}function co(e,t){return Q(e)===Q(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?le(n,"q",null):n,focusId:t}}function fo(e,t){return{...e,relation:t}}function le(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 ye(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 Qe(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function _e(e,t){if(t!==(e.zoom===!0)&&(e=Tt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function et(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var nt="aggregate:",tt="kind:";function Mt(e){return`${tt}${e}`}function me(e){return e.startsWith(tt)?e.slice(tt.length):null}var Ga="kinds:beyond";function Zr(e){let t=me(e);return t?[t]:de(e)}function ee(...e){return`${nt}${[...e].sort().join("+")}`}function yo(e){return e.startsWith(nt)}function de(e){return!yo(e)||e.includes("|")?[]:e.slice(nt.length).split("+").filter(Boolean)}function mo(e,t,n={}){let o=me(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return et(e,t);let r=o!==null?ee(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return _e(e,!1);if(o!==null&&n.carry){let i=ye({...z(e,r),relation:null},!1);return le(_e(i,!0),"q",n.carry)}return _e({...z(e,r),relation:null},!0)}function Xr(e,t,n){return le(ye(z(e,ee(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=H(W(),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=H(W(),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 rt=H(W(),1),it=(0,rt.createContext)(void 0),Ei=()=>(0,rt.useContext)(it);var P=H(W(),1),He=(0,P.createContext)(null);function Ho(){return(0,P.useContext)(He)}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=Ye(()=>(__graviewPreload(import.meta.url,["./chunk.7ECBGIUK.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SDLUWRGI.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)(He),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 E=!0;return Do().then(I=>{_o=I,E&&l(I)},()=>{}),()=>{E=!1}},[s,r,i]);let[c,u]=(0,P.useState)(0),[g,y]=(0,P.useMemo)(()=>r||i===null||!s?[]:[i>=e.log.length?void 0:s.askArchived(e,i,n)??s.askDeclaration(n,i),s.keptOf(e,n)],[r,e,i,n,s,c]),m=g&&"waiting"in g?g.waiting:void 0,b=g&&"seq"in g?g:null,[k,f]=(0,P.useState)(void 0);(0,P.useEffect)(()=>{if(!m)return;let E=!0,I=setTimeout(()=>E&&f(m),Ai);return m.then(()=>E&&u(_=>_+1)),()=>{E=!1,clearTimeout(I)}},[m]);let S=m!==void 0&&k!==m||b!==null,v=(0,P.useMemo)(()=>{if(r||i===null||i>=e.log.length||!s||S)return null;try{let E=s.pastAt(e,i,n);return{seq:i,at:E.past?.at,store:E}}catch{return null}},[r,e,i,n,s,S,c]),A=(0,P.useRef)(null),x=S?A.current:v;(0,P.useEffect)(()=>{A.current=x},[x]);let F=(0,P.useCallback)(E=>a(E===null?null:E>=e.log.length?Number.POSITIVE_INFINITY:E),[e]),D=(0,P.useCallback)((E,I)=>[e,x?.store].some(_=>_!==void 0&&(_===E||_.seenBy(I)===E)),[e,x]),N=i!==null,V=(0,P.useMemo)(()=>({past:x,open:N,show:F,live:e,host:n,owns:D,archive:b,kept:y}),[x,N,F,e,n,D,b,y]);return r?o:V}var No=H(W(),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=H(W(),1);function qt(e){return Ue(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 st=(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:st(r.trail,a)}),o}case"about-to-write":case"write":{let a=$o(t.ids,n);return i({at:a,mode:"writing",trail:st(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:st(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:st(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:g,seats:y}=e,[m,b]=(0,L.useState)(()=>new Map),[k,f]=(0,L.useState)(null),[S,v]=(0,L.useState)(null),[A,x]=(0,L.useState)(null),F=typeof r.id=="string"&&r.id.length>0,D=F&&(l[$t.name]??$t.initial)==="shared",N=D&&(l[Ut.name]??Ut.initial)==="shared",V=qt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),E=F?Qn(r,{graph:n.graph,schema:n.schema,...y?{seats:y}:{},...g?{people:g}:{}}):"",I=s?a.get(`agent:${s}:${i}`):void 0,_=(0,L.useMemo)(()=>!t||!D?null:{participant:V,kind:r.kind,name:E,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:eo(r.id??"nobody"),stop:A??Q(o),...N?{over:k}:{},...I?{robot:{at:I.at,mode:I.mode}}:{},at:new Date().toISOString()},[t,D,N,V,E,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,A,k,I?.at,I?.mode]),We=(0,L.useRef)(null),Pe=R=>R&&t?.here({...R,caret:We.current??void 0,at:new Date().toISOString()}),Ae=(0,L.useCallback)(R=>{We.current=R,Pe(_)},[t,_]);(0,L.useEffect)(()=>{if(!_)return;Pe(_);let R=setInterval(()=>Pe(_),Oi);return()=>clearInterval(R)},[t,_]),(0,L.useEffect)(()=>t?t.onWho(B=>b(Rt(new Map,B,Date.now(),u))):void 0,[t,u]);let ke=m.size>0;(0,L.useEffect)(()=>{if(!ke)return;let R=setInterval(()=>{b(B=>{let X=Rt(B,[],Date.now(),u);return X.size===B.size?B:X})},Math.max(250,Math.min(1e3,u/4)));return()=>clearInterval(R)},[ke,u]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let R=()=>t.leave();return window.addEventListener("pagehide",R),()=>window.removeEventListener("pagehide",R)},[t]),(0,L.useEffect)(()=>{if(!N||typeof document>"u")return;let R=null,B=X=>{let ie=Lo(X.target);ie!==R&&(R=ie,f(ie))};return document.addEventListener("pointermove",B,{passive:!0}),()=>document.removeEventListener("pointermove",B)},[N]);let ue=(0,L.useRef)(null),K=S?m.get(S)??null:null,oe=(0,L.useCallback)(R=>{ue.current=null,v(R)},[]);(0,L.useEffect)(()=>{if(S){if(!K){v(null);return}K.stop!==ue.current?.stop&&(ue.current={stop:K.stop,at:Date.now()},c(Je(K.stop)))}},[S,K,c]),(0,L.useEffect)(()=>{let R=ue.current;!S||R===null||Date.now()-R.at<400||co(o,Je(R.stop))||v(null)},[o,S]),(0,L.useEffect)(()=>{if(!S||typeof document>"u")return;let R=B=>{B.key==="Escape"&&v(null)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[S]);let Re=_!==null,re=(0,L.useMemo)(()=>Re?{participant:V,name:E}:null,[Re,V,E]);return(0,L.useMemo)(()=>({who:m,sharing:re,following:K,follow:oe,sayWhere:x,sayCaret:Ae}),[m,re,K,oe,Ae])}var U=H(W(),1);function Jo(e){return Ue(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 g=i.get(l),y=g?.participants.includes(Jo(c))?g.participants:[...g?.participants??[],Jo(c)];i.set(l,{at:o,manner:Vi(y,c.author.kind),intent:c.intent,wrote:(g?.wrote??!1)||(u.wrote??!1),read:(g?.read??!1)||(u.read??!1),broke:(g?.broke??!1)||a.has(l),participants:y})};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,g)=>{let y=e.violations(),m=io(e.allInvariants(),l,y).introduces;l=y,a(Qo(r.current,g,m.map(b=>({nodeIds:b.nodeIds,message:b.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=H(W(),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 lt=H(W(),1),_i=e=>e.definitions.some(t=>Xn(t).size>0);function nr(e,t,n){let[o,r]=(0,lt.useState)(void 0),i=(n.roles??[]).join("\0");return(0,lt.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 te=H(De(),1),Hi="graview:place-menu",Ne=(0,d.createContext)(null),sr=(0,d.createContext)("scene");function Di({mode:e,children:t}){return(0,te.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:g,app:y,settings:m=y?.settings??Gi,presence:b,typing:k,brand:f,locale:S,timeZone:v,onKeepLens:A,providers:x,ai:F,files:D,resolveApp:N,history:V,linkedRecords:E,menuSections:I,keptViews:_,onExport:We,subscriptions:Pe,dismissals:Ae,whileAway:ke,signIn:ue,view:K,onViewChange:oe,children:Re}){let re=(0,d.useContext)(Ne),R=I??re?.menuSections,B=ue??re?.signIn,X=_??re?.keptViews,ie=We??re?.onExport,[_r,Hr]=(0,d.useState)(null),ce=_r??i??s[0]?.principal??lr,Ge=Kt(e,ce,V),fn=Ge.past&&Ge.live===e?Ge.past.store:e,wt=a??Fi(),vt=!Ft(e),j=(0,d.useMemo)(()=>vt?e:fn.seenBy(ce,wt?{as:wt}:void 0),[vt,e,fn,ce,wt]);dr(e,ce);let[ae]=(0,d.useState)(()=>Yo(u)),[yn,Dr]=(0,d.useState)(!1),mn=(0,d.useCallback)(()=>Dr(!0),[]),se=(0,d.useMemo)(()=>b?[...m,...Zo]:m,[m,b]),[bt]=(0,d.useState)(()=>n??Qt(t,e.schema)),[Nr,gn]=(0,d.useState)(()=>Qe(bt??fe,r??bt?.selection??[])),Te=(0,d.useRef)(bt??fe).current,[hn,jr]=(0,d.useState)(null),[Sn,Wr]=(0,d.useState)(null),Z=(0,d.useContext)(Ne),[wn]=(0,d.useState)(()=>Z?.seatTalk??Wt(f?.name??e.schema.kinds.join(","))),xt=F??Z?.ai??Vt,Fe=(0,d.useMemo)(()=>xt.off?Ki:xt,[xt]),vn=(0,d.useRef)(Fe.interactions);vn.current=Fe.interactions;let[bn]=(0,d.useState)(()=>Z?.aiDesk??Gt(()=>vn.current)),[Gr]=(0,d.useState)(()=>Z?.subscriptions??oo()),xn=Pe??Z?.subscriptions??Gr,Et=A??Z?.onKeepLens,Ke=y??Z?.app,Be=S??Z?.locale,Fr=f?.locale??Ke?.brand?.locale,qe=v??Z?.timeZone;Zn({reader:Be,app:Fr,readerTimeZone:qe,appTimeZone:f?.timeZone??Ke?.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),[Me,Tn]=(0,d.useState)(()=>new Map),Ce=(0,d.useRef)(Me);Ce.current=Me;let Oe=(0,d.useRef)(null),At=(0,d.useCallback)(p=>j.graph.getNode(p)?.kind,[j]),J=(0,d.useCallback)(p=>{let h=zt(Ce.current,p,At);Ce.current=h,Tn(h),Oe.current&&clearTimeout(Oe.current),[...h.values()].some(C=>C.mode!=="docked"&&C.mode!=="asking")&&(Oe.current=setTimeout(()=>{let C=zt(Ce.current,{type:"rest",at:Date.now(),holdMs:Jt},At);Ce.current=C,Tn(C)},Jt+20))},[At]),Mn=(0,d.useCallback)(p=>J({...p,at:p.at??Date.now()}),[J]),Cn=(0,d.useCallback)(p=>{Kr(p),p&&J({type:"home",author:{kind:"agent",id:p,session:ae},at:Date.now()})},[J,ae]);(0,d.useEffect)(()=>j.subscribe((p,h)=>{for(let T of h)T.author.kind==="agent"&&J({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[j,J]),(0,d.useEffect)(()=>()=>{Oe.current&&clearTimeout(Oe.current)},[]);let $=(0,d.useMemo)(()=>({...ce,session:ae}),[ce,ae]),On=nr(j,E,$),Vn=(0,d.useCallback)(p=>{Hr(p),l?.(p)},[l]),[Ve,Br]=(0,d.useState)(()=>Object.fromEntries(se.map(p=>[p.name,Bo(p,u)])));(0,d.useEffect)(()=>{for(let p of se)zo(p,Ve[p.name]??p.initial)},[se,Ve]);let In=(0,d.useCallback)((p,h)=>{let T=se.find(C=>C.name===p);!T||!T.options.some(C=>C.value===h)||(qo(T,h,u),Br(C=>({...C,[p]:h})))},[se,u]),[Ln,qr]=(0,d.useState)(null),{activity:_n,noteAttention:Hn}=er(j),Dn=(0,d.useCallback)(p=>{Hn(p),J({type:"read",author:p.author,ids:p.reads,at:Date.now()})},[Hn,J]),pe=(0,d.useCallback)(p=>{if(me(p)!==null||de(p).length>0||Ct(p))return!0;let h=po(p);return h?j.graph.allEdges().some(T=>T.kind===h.kind&&T.from===h.from&&T.to===h.to):j.graph.getNode(p)!==void 0},[j]),Nn=(0,d.useCallback)(p=>{let h=p.selection??Yt,T=h.filter(pe),C=T.length===h.length?p:Qe(p,T);return C.focusId!==null&&!pe(C.focusId)&&(C=z(C,null)),C},[pe]),Ie=(0,d.useCallback)(p=>{let h=Nn(p),T=ar(j,$,h.shown);if(h.focusId!==null&&T.size>0){let C=de(h.focusId),Yn=j.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=Te.focusId!==null&&!pe(Te.focusId)?Qt(t,e.schema)??{...fe,overview:!0}:Te;C.focusId!==null&&pe(C.focusId)?h={...h,focusId:C.focusId}:C.overview===!0&&(h={...h,overview:!0})}return h},[Nn,pe,j,Te,$,t,e.schema]),q=Ie(K??Nr),jn=(0,d.useMemo)(()=>ar(j,$,q.shown),[j,$,q.shown]),Wn=(0,d.useMemo)(()=>[...j.modules.administered.entries()].map(([p,h])=>{let T=j.mayAdminister(p,$);return{name:p,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:T,shown:T&&(q.shown??[]).includes(p)}}),[j,$,q.shown]),Le=(0,d.useCallback)(p=>{let h=T=>Ie(typeof p=="function"?p(T):p);if(K!==void 0){oe?.(h(K));return}oe&&oe(h(q)),gn(T=>h(T))},[q,oe,K,Ie]);(0,d.useEffect)(()=>{K===void 0&&gn(p=>{let h=Ie(p);return h===p?p:h})},[q,K,Ie]);let Gn=q.selection??Yt,Fn=(0,d.useCallback)(p=>{Le(h=>Qe(h,typeof p=="function"?p(h.selection??Yt):p))},[Le]),{who:ze,following:Kn,follow:Bn,sayWhere:zr,sayCaret:qn,sharing:zn}=Xo({channel:b,store:j,view:q,principal:$,session:ae,robots:Me,seatWho:Pt,settingValues:Ve,setView:Le,seats:s,people:c,...g!==void 0?{ttlMs:g}:{}}),$r=(0,d.useMemo)(()=>({store:j,scheme:o,views:t,view:q,setView:Le,homeView:Te,selection:Gn,setSelection:Fn,menuAt:hn,setMenuAt:jr,whereIs:An,pointer:kn,motion:Rn,registerScene:Pn,robots:Me,noteSeat:Mn,seatWho:Pt,registerSeatWho:Cn,actsDoor:Sn,registerActsDoor:Wr,seatTalk:wn,aiDesk:bn,...u?{memory:u}:{},who:ze,following:Kn,follow:Bn,sayWhere:zr,sharing:zn,session:ae,ai:Fe,resolveApp:N,linkedRecords:E,menuSections:R,...X?{keptViews:X}:{},...ie?{onExport:ie}:{},subscriptions:xn,dismissals:Ae,whileAway:ke,signIn:B,linkedReads:On,movedByHand:yn,noteMoved:mn,emphasis:Ln,setEmphasis:qr,activity:_n,noteAttention:Dn,principal:$,seats:s,people:c,takeSeat:Vn,settings:se,settingValues:Ve,chooseSetting:In,hiddenKinds:jn,administered:Wn,...x?{providers:x}:{},...f?{brand:f}:{},...Et?{onKeepLens:Et}:{},app:Ke,...Be?{locale:Be}:{},...qe?{timeZone:qe}:{}}),[j,o,t,q,Le,Gn,Fn,hn,An,kn,Rn,Pn,Me,Mn,Pt,Cn,Sn,wn,bn,u,ze,Kn,Bn,zn,ae,Fe,N,E,R,X,ie,xn,Ae,ke,B,On,yn,mn,Ln,_n,Dn,$,s,c,Vn,se,Ve,In,jn,Wn,x,f,Et,Ke,Be,qe]),$n=(0,d.useMemo)(()=>k?{typing:k,sayCaret:qn,who:ze}:null,[k,qn,ze]),Un=D?(0,te.jsx)(it.Provider,{value:D,children:Re}):Re;return(0,te.jsx)(Ne.Provider,{value:$r,children:(0,te.jsx)(He.Provider,{value:Ge,children:(0,te.jsx)(Yi,{children:vt?null:$n?(0,te.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}=ne(),l=dt(),c=n.q,u=n.focusId,g=!!(c&&c.trim().length>0),y=(0,d.useSyncExternalStore)(qi,rr,rr),m=(0,d.useMemo)(()=>g&&y?{flagged:new Set(t.violations().flatMap(A=>A.nodeIds)),touched:y.touchWeights(t.log.all())}:null,[t,l,g,y]),b=u?t.graph.getNode(u)?.kind??me(u)??(de(u).length===1?de(u)[0]:void 0):void 0,k=(0,d.useMemo)(()=>s.near&&Ui(s.near),[s.near]),f=(0,d.useMemo)(()=>!c||!m||!y?null:y.search(t,c,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(A=>!i.has(A)),from:[...a,...u&&t.graph.has(u)?[u]:[]],flagged:m.flagged,touched:m.touched,limit:200,rank:k}),[t,c,r,o,i,a,u,b,m,k]),[S,v]=(0,d.useState)();return(0,d.useEffect)(()=>void f?.later?.then(A=>v([f,A])),[f]),(0,te.jsx)(ur.Provider,{value:S?.[0]===f?S[1]:f,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 ne(){let e=(0,d.useContext)(Ne);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function en(){return(0,d.useContext)(Ne)??null}function dt(){let{store:e}=ne(),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}=ne(),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"?{...fe,focusId:ee(n.place.kind),within:{view:n.place.as}}:{...fe,focusId:ee(n.kind)}}var pr=H(W(),1),ea=(0,pr.createContext)(!1);var ut=Symbol.for("graview.default-view");function fr(e){return Object.defineProperty(e,ut,{value:!0,enumerable:!1}),e}function yr(e){return typeof e=="function"&&e[ut]===!0}var ct=Symbol.for("graview.replaces-page");function mr(e){return Object.defineProperty(e,ct,{value:!0,enumerable:!1}),e}function gr(e){return typeof e=="function"&&e[ct]===!0}var pt=Symbol.for("graview.bleeds");function hr(e){return Object.defineProperty(e,pt,{value:!0,enumerable:!1}),e}function Sr(e){return typeof e=="function"&&e[pt]===!0}var ft=Symbol.for("graview.previews");function wr(e,t={}){return Object.defineProperty(e,ft,{value:t,enumerable:!1}),e}function vr(e){return typeof e=="function"?e[ft]: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.homes?.()??[];if(o.length>0)for(let r of o)e.home?.(r.view,r.name!==void 0?{name:r.name}:void 0);else{let r=t.homeView?.();r&&e.home?.(r)}return e}var M=H(W(),1),Y=H(De(),1),tn=new Set,yt=0;function nn(e){return()=>{yt+=1;let t=e();return t.then(()=>void(yt-=1),()=>void(yt-=1)),t}}var oa=()=>yt,gt=(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)(gt);(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)(gt);return!n&&s&&(o.add(s),Er(s,t)),(0,M.createElement)(r,a)}return i}var Ar=!1,kr=!1,mt=new Set;function la(){Ar=!0}function da(){kr=!0;for(let e of[...mt])e();mt.clear()}var Rr=()=>kr||!Ar;function ua(e){return Rr()?(e(),()=>{}):(mt.add(e),()=>void mt.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 y of[...a])y()},l=y=>(a.add(y),()=>void a.delete(y)),c=()=>i,u=()=>void g().catch(()=>{});function g(){if(n)return Promise.resolve(t);if(r)return r;let y=e().then(m=>(t=m,n=!0,o=!1,r=void 0,tn.delete(u),s(),m),m=>{throw r=void 0,o=!0,tn.add(u),ca(),s(),m});return y.catch(()=>{}),r=y,y}return{load:g,prefetch:u,get current(){return t},get failed(){return o},part(y,m={}){let b=m.what??"This part",k={};function f(A){(0,M.useSyncExternalStore)(l,c,c),Pr(k);let x=(0,M.useRef)(null),F=(0,M.useRef)(null),D=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{o&&r===void 0&&u()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(D.current=!0),(0,M.useLayoutEffect)(()=>{if(!(!n||!D.current)){D.current=!1;for(let N=F.current?.nextElementSibling??null;N!==null;N=N.nextElementSibling){let V=N.matches(xr)?N:N.querySelector(xr);if(V instanceof HTMLElement){V.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[D.current?(0,Y.jsx)("span",{ref:F,hidden:!0}):null,y(t,A)]}):m.quiet?null:(0,Y.jsx)(pa,{what:b,button:x,...m.as?{as:m.as}:{}})}let S=(0,M.lazy)(nn(()=>g().then(()=>({default:f}),()=>({default:f}))));function v(A){let x=(0,M.useContext)(gt),[F]=(0,M.useState)(()=>n||o);return!n&&!o&&Er(x,k),(0,M.createElement)(F?f:S,A)}return v}}}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 we=H(W(),1);function fa(){let{selection:e,setSelection:t}=ne();return(0,we.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}=ne(),t=dt();return(0,we.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}=ne();return(0,we.useMemo)(()=>({view:e,url:Q(e),focus:n=>t(o=>z(o,n)),show:n=>t(o=>fo(o,n)),toggle:n=>t(o=>et(o,n)),go:n=>t(n)}),[e,t])}var Se={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;Se.at=typeof t?.graview=="number"?t.graview:0,Se.at>Se.depth&&(Se.depth=Se.at),Se.tell()});var G=H(W(),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"},ht=6,ve=8,Sa=e=>typeof e.showPopover=="function";function St(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-ht-ve,l=o.top-ht-ve,c=a.height<=s||s>=l,u=Math.max(96,Math.floor(c?s:l)),g=Math.min(a.height,u);a.height>u&&(e.style.maxHeight=i?`min(${i}, ${u}px)`:`${u}px`);let y=a.width,m=n.align==="start"?o.left:o.right-y,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&y<=b.right-b.left&&(m<b.left?m=o.left+y<=b.right?o.left:b.left:m+y>b.right&&(m=o.right-y>=b.left?o.right-y:b.right-y));let k=y>=r.width-2*ve?Math.max(0,(r.width-y)/2):Math.max(ve,Math.min(m,r.width-ve-y)),f=c?o.bottom+ht:Math.max(ve,o.top-ht-g);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(f)}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)&&!St(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&&St(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||!St(e)))try{e.hidePopover(),e.showPopover()}catch{}}var be=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),g=(0,G.useCallback)(v=>{c.current=v},[]),y=(0,G.useCallback)(v=>{u.current=v},[]),m=`graview-popover-${(0,G.useId)().replace(/:/g,"")}`,b=(0,G.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,G.useCallback)(v=>{b.current.controlled||s(v),b.current.onOpenChange?.(v)},[]),f=(0,G.useCallback)(()=>{(document.querySelector(`[aria-controls="${m}"]`)??c.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[m]),S=(0,G.useCallback)(v=>{let A=u.current,x=typeof document>"u"?null:document.activeElement,F=x===null||x===document.body||A!==null&&A.contains(x);k(!1),!(!v||!F)&&(f(),requestAnimationFrame(()=>{an()&&f()}))},[k,f]);return Mr(u,i&&l,n??c,t.align?{align:t.align}:{}),(0,G.useEffect)(()=>{if(!i||!l)return;let v={name:e,close:()=>S(!1)};if(be&&be.close!==v.close&&be.close(),be=v,sn[e].focus==="into"){let V=u.current;V&&!V.contains(document.activeElement)&&Ea(V).focus({preventScroll:!0})}let A=V=>{V.key==="Escape"&&S(!0)},x=V=>{let E=V.target;if(!(E instanceof Node))return;let I=u.current;if(I?.contains(E)||c.current?.contains(E))return;let _=E instanceof Element?E.closest('[role="dialog"], [role="alertdialog"]'):null;_&&!(I&&_.contains(I))||(S(!1),sn[e].focus==="into"&&requestAnimationFrame(()=>{(an()||I!==null&&I.contains(document.activeElement))&&f()}))},F=null,D=null,N=V=>{let E=V.target;if(!(E instanceof Element))return;let I=u.current,_=E.closest('[role="dialog"], [role="alertdialog"]');!_||I&&(I.contains(_)||_.contains(I))||(F=_,S(!1))};return document.addEventListener("keydown",A),document.addEventListener("pointerdown",x,!0),document.addEventListener("focusin",N),()=>{document.removeEventListener("keydown",A),document.removeEventListener("pointerdown",x,!0),document.removeEventListener("focusin",N);let V=F;V&&typeof MutationObserver<"u"&&(D?.disconnect(),D=new MutationObserver(()=>{V.isConnected||(D?.disconnect(),requestAnimationFrame(()=>{(an()||document.activeElement.closest("[hidden]")!==null)&&f()}))}),D.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>D?.disconnect(),10*6e4)),be?.close===v.close&&(be=null)}},[i,l,e,S,f]),{open:l,setOpen:v=>v?k(!0):S(!0),toggle:()=>l?S(!0):k(!0),trigger:{ref:g,"aria-expanded":l,"aria-controls":m,"data-graview-popover-trigger":e},pane:{ref:y,id:m,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var xe=H(W(),1);var Cr=(0,xe.createContext)(null);function Aa(){let e=(0,xe.useContext)(Cr),t=en(),n=(o,r,i)=>t?.setView(a=>le(le(ye(z(a,ee(o)),!1),"view",r),"filter",i?.filter??null));return(0,xe.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>z(ye(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 Ee=H(W(),1);var ka=rn(Ye(()=>(__graviewPreload(import.meta.url,["./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4HPP35XQ.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,Ee.useState)();return(0,Ee.useEffect)(()=>t?Ra(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var Or=H(W(),1),Ma=(0,Or.createContext)(!1);var un=H(W(),1),Ca=(0,un.createContext)(null),Oa=(0,un.createContext)(null);var Vr=H(W(),1),Va=(0,Vr.createContext)(null);var Ir=H(W(),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")),je=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)&&je(s)?s:null}var La=e=>e.isConnected&&pn(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&je(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&&je(o))return o;for(let r of e.querySelectorAll(cn))if(je(r))return r;return pn(e)&&je(e)?e:null}function _a(e){(0,Ir.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=f=>{let S=f.target;if(S instanceof Element){n=[];for(let v=S;v&&v!==t.parentElement;v=v.parentElement)n.push(v)}},r=!1,i=!1,a=t.ownerDocument,s=()=>!i&&a.defaultView!==null,l=(f,S)=>void setTimeout(()=>s()&&S(),f),c=f=>void requestAnimationFrame(()=>s()&&f()),u=f=>{if(r=!1,i)return;let S=a.activeElement;if(!(!(S===null||S===a.body||S===a.documentElement)||n.length===0)){if(La(n[0])){f&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let A of n.slice(1)){if(!A.isConnected)continue;let x=Lr(A,n[0]);if(x){x.focus({preventScroll:!0}),n=[];return}}}},g=(f,S=Date.now()+2500)=>{l(100,()=>{u(f);let v=a.activeElement;(v===null||v===a.body||v===a.documentElement)&&n.length>0&&Date.now()<S&&g(f,S)})},y=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{u(!1),g(!1)})))},m=f=>{if(!(f instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(f.key))){if(!(f instanceof KeyboardEvent)){let S=f.target instanceof Element?f.target.closest(cn):null,v=a.activeElement,A=v===null||v===a.body||v===a.documentElement;if(S&&A&&t.contains(S)){n=[];for(let x=S;x&&x!==t.parentElement;x=x.parentElement)n.push(x);l(150,()=>c(()=>{u(!1),g(!1)}));return}}!(f instanceof KeyboardEvent)&&!(f.target instanceof Node&&n[0]?.contains(f.target))||l(150,()=>c(()=>{u(!0),g(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&y()}),k=f=>{f.relatedTarget===null&&y()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",m),t.addEventListener("keydown",m),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",m),t.removeEventListener("keydown",m),b.disconnect()}},[e])}export{fe as a,Q as b,Je 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,le as l,ye as m,Qe as n,_e as o,et as p,nt as q,Mt as r,me as s,Ga as t,Zr as u,ee as v,yo as w,de 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,W as G,Wt as H,vi as I,xi as J,Lo as K,it as L,Ei as M,He as N,Ho as O,Pi as P,Ft as Q,Kt as R,Bt as S,De as T,Hi as U,Ne as V,Di as W,Ni as X,dr as Y,Bi as Z,zi as _,Gs as $,Zi as aa,ne as ba,en as ca,dt as da,Xi as ea,Ji as fa,Qi as ga,Qt as ha,Cr as ia,Aa as ja,ea as ka,fr as la,yr as ma,mr as na,gr as oa,hr as pa,Sr as qa,wr as ra,vr as sa,ta,na as ua,nn as va,oa as wa,gt as xa,ra as ya,ia as za,aa as Aa,sa as Ba,la as Ca,da as Da,Rr as Ea,ua as Fa,rn as Ga,Ta as Ha,Ma as Ia,Ca as Ja,Oa as Ka,Va as La,fa as Ma,ya as Na,ga as Oa,Se as Pa,_a as Qa,ha as Ra,St as Sa,Mr as Ta,va as Ua,Pa as Va};
|
|
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 Ye}from"./chunk.SDO3U72B.js";import{$d as Rt,Ed as ao,Ia as Xn,L as Zn,Ma as kt,Oa as Jn,Ud as so,Vc as to,Yd as lo,_a as Qn,_d as Ue,dd as no,fd as oo,ld as ro,od as io,uc as eo}from"./chunk.7BBGRTXM.js";import{a as $e,b as H}from"./chunk.AJZBJBMO.js";var To=$e(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 he(e,t,n){this.props=e,this.context=t,this.refs=Ao,this.updater=n||Eo}he.prototype.isReactComponent={};he.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")};he.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ko(){}ko.prototype=he.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,he.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 ge(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,ge(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,"$&/")+"/"),ge(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+=ge(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+=ge(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return ge(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 ot(e,t,n){if(e==null)return e;var o=[],r=0;return ge(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:ot,forEach:function(e,t,n){ot(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ot(e,function(){t++}),t},toArray:function(e){return ot(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=he;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 W=$e((es,Mo)=>{"use strict";Mo.exports=To()});var Wo=$e(at=>{"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}}at.Fragment=Ri;at.jsx=jo;at.jsxs=jo});var De=$e((us,Go)=>{"use strict";Go.exports=Wo()});var fe={focusId:null,relation:null,expanded:[],pins:{}},Ze=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Q(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}`,`${Xe(r.x)},${Xe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Xe(e.pan.x)},${Xe(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 Je(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[g,y]of n){if(!g.startsWith("pin."))continue;let[m,b]=y.split(","),k=m===void 0?null:Ze(m),f=b===void 0?null:Ze(b);k===null||f===null||(o[g.slice(4)]={x:k,y:f})}let r=Object.create(null);for(let[g,y]of n)!g.startsWith("in.")||y.length===0||(r[g.slice(3)]=y);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:Ze(a[0]),l=a[1]===void 0?null:Ze(a[1]),c=(n.get("sel")??"").split(",").filter(g=>g.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(g=>g.length>0&&(u||!g.startsWith("kind:"))).sort(),pins:o}}function Da(e){let t=Je(e);return Q(t)==="#"?{...t,overview:!0}:t}function Na(e){let t=Q(e);return t==="#overview=1"?"":t}function Xe(e){return Math.round(e*100)/100}function co(e,t){return Q(e)===Q(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?le(n,"q",null):n,focusId:t}}function fo(e,t){return{...e,relation:t}}function le(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 ye(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 Qe(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function _e(e,t){if(t!==(e.zoom===!0)&&(e=Tt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function et(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var nt="aggregate:",tt="kind:";function Mt(e){return`${tt}${e}`}function me(e){return e.startsWith(tt)?e.slice(tt.length):null}var Ga="kinds:beyond";function Zr(e){let t=me(e);return t?[t]:de(e)}function ee(...e){return`${nt}${[...e].sort().join("+")}`}function yo(e){return e.startsWith(nt)}function de(e){return!yo(e)||e.includes("|")?[]:e.slice(nt.length).split("+").filter(Boolean)}function mo(e,t,n={}){let o=me(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return et(e,t);let r=o!==null?ee(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return _e(e,!1);if(o!==null&&n.carry){let i=ye({...z(e,r),relation:null},!1);return le(_e(i,!0),"q",n.carry)}return _e({...z(e,r),relation:null},!0)}function Xr(e,t,n){return le(ye(z(e,ee(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=H(W(),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=H(W(),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 rt=H(W(),1),it=(0,rt.createContext)(void 0),Ei=()=>(0,rt.useContext)(it);var P=H(W(),1),He=(0,P.createContext)(null);function Ho(){return(0,P.useContext)(He)}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=Ye(()=>(__graviewPreload(import.meta.url,["./chunk.7ECBGIUK.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SDLUWRGI.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)(He),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 E=!0;return Do().then(I=>{_o=I,E&&l(I)},()=>{}),()=>{E=!1}},[s,r,i]);let[c,u]=(0,P.useState)(0),[g,y]=(0,P.useMemo)(()=>r||i===null||!s?[]:[i>=e.log.length?void 0:s.askArchived(e,i,n)??s.askDeclaration(n,i),s.keptOf(e,n)],[r,e,i,n,s,c]),m=g&&"waiting"in g?g.waiting:void 0,b=g&&"seq"in g?g:null,[k,f]=(0,P.useState)(void 0);(0,P.useEffect)(()=>{if(!m)return;let E=!0,I=setTimeout(()=>E&&f(m),Ai);return m.then(()=>E&&u(_=>_+1)),()=>{E=!1,clearTimeout(I)}},[m]);let S=m!==void 0&&k!==m||b!==null,v=(0,P.useMemo)(()=>{if(r||i===null||i>=e.log.length||!s||S)return null;try{let E=s.pastAt(e,i,n);return{seq:i,at:E.past?.at,store:E}}catch{return null}},[r,e,i,n,s,S,c]),A=(0,P.useRef)(null),x=S?A.current:v;(0,P.useEffect)(()=>{A.current=x},[x]);let F=(0,P.useCallback)(E=>a(E===null?null:E>=e.log.length?Number.POSITIVE_INFINITY:E),[e]),D=(0,P.useCallback)((E,I)=>[e,x?.store].some(_=>_!==void 0&&(_===E||_.seenBy(I)===E)),[e,x]),N=i!==null,V=(0,P.useMemo)(()=>({past:x,open:N,show:F,live:e,host:n,owns:D,archive:b,kept:y}),[x,N,F,e,n,D,b,y]);return r?o:V}var No=H(W(),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=H(W(),1);function qt(e){return Ue(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 st=(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:st(r.trail,a)}),o}case"about-to-write":case"write":{let a=$o(t.ids,n);return i({at:a,mode:"writing",trail:st(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:st(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:st(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:g,seats:y}=e,[m,b]=(0,L.useState)(()=>new Map),[k,f]=(0,L.useState)(null),[S,v]=(0,L.useState)(null),[A,x]=(0,L.useState)(null),F=typeof r.id=="string"&&r.id.length>0,D=F&&(l[$t.name]??$t.initial)==="shared",N=D&&(l[Ut.name]??Ut.initial)==="shared",V=qt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),E=F?Qn(r,{graph:n.graph,schema:n.schema,...y?{seats:y}:{},...g?{people:g}:{}}):"",I=s?a.get(`agent:${s}:${i}`):void 0,_=(0,L.useMemo)(()=>!t||!D?null:{participant:V,kind:r.kind,name:E,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:eo(r.id??"nobody"),stop:A??Q(o),...N?{over:k}:{},...I?{robot:{at:I.at,mode:I.mode}}:{},at:new Date().toISOString()},[t,D,N,V,E,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,A,k,I?.at,I?.mode]),We=(0,L.useRef)(null),Pe=R=>R&&t?.here({...R,caret:We.current??void 0,at:new Date().toISOString()}),Ae=(0,L.useCallback)(R=>{We.current=R,Pe(_)},[t,_]);(0,L.useEffect)(()=>{if(!_)return;Pe(_);let R=setInterval(()=>Pe(_),Oi);return()=>clearInterval(R)},[t,_]),(0,L.useEffect)(()=>t?t.onWho(B=>b(Rt(new Map,B,Date.now(),u))):void 0,[t,u]);let ke=m.size>0;(0,L.useEffect)(()=>{if(!ke)return;let R=setInterval(()=>{b(B=>{let X=Rt(B,[],Date.now(),u);return X.size===B.size?B:X})},Math.max(250,Math.min(1e3,u/4)));return()=>clearInterval(R)},[ke,u]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let R=()=>t.leave();return window.addEventListener("pagehide",R),()=>window.removeEventListener("pagehide",R)},[t]),(0,L.useEffect)(()=>{if(!N||typeof document>"u")return;let R=null,B=X=>{let ie=Lo(X.target);ie!==R&&(R=ie,f(ie))};return document.addEventListener("pointermove",B,{passive:!0}),()=>document.removeEventListener("pointermove",B)},[N]);let ue=(0,L.useRef)(null),K=S?m.get(S)??null:null,oe=(0,L.useCallback)(R=>{ue.current=null,v(R)},[]);(0,L.useEffect)(()=>{if(S){if(!K){v(null);return}K.stop!==ue.current?.stop&&(ue.current={stop:K.stop,at:Date.now()},c(Je(K.stop)))}},[S,K,c]),(0,L.useEffect)(()=>{let R=ue.current;!S||R===null||Date.now()-R.at<400||co(o,Je(R.stop))||v(null)},[o,S]),(0,L.useEffect)(()=>{if(!S||typeof document>"u")return;let R=B=>{B.key==="Escape"&&v(null)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[S]);let Re=_!==null,re=(0,L.useMemo)(()=>Re?{participant:V,name:E}:null,[Re,V,E]);return(0,L.useMemo)(()=>({who:m,sharing:re,following:K,follow:oe,sayWhere:x,sayCaret:Ae}),[m,re,K,oe,Ae])}var U=H(W(),1);function Jo(e){return Ue(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 g=i.get(l),y=g?.participants.includes(Jo(c))?g.participants:[...g?.participants??[],Jo(c)];i.set(l,{at:o,manner:Vi(y,c.author.kind),intent:c.intent,wrote:(g?.wrote??!1)||(u.wrote??!1),read:(g?.read??!1)||(u.read??!1),broke:(g?.broke??!1)||a.has(l),participants:y})};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,g)=>{let y=e.violations(),m=io(e.allInvariants(),l,y).introduces;l=y,a(Qo(r.current,g,m.map(b=>({nodeIds:b.nodeIds,message:b.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=H(W(),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 lt=H(W(),1),_i=e=>e.definitions.some(t=>Xn(t).size>0);function nr(e,t,n){let[o,r]=(0,lt.useState)(void 0),i=(n.roles??[]).join("\0");return(0,lt.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 te=H(De(),1),Hi="graview:place-menu",Ne=(0,d.createContext)(null),sr=(0,d.createContext)("scene");function Di({mode:e,children:t}){return(0,te.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:g,app:y,settings:m=y?.settings??Gi,presence:b,typing:k,brand:f,locale:S,timeZone:v,onKeepLens:A,providers:x,ai:F,files:D,resolveApp:N,history:V,linkedRecords:E,menuSections:I,keptViews:_,onExport:We,subscriptions:Pe,dismissals:Ae,whileAway:ke,signIn:ue,view:K,onViewChange:oe,children:Re}){let re=(0,d.useContext)(Ne),R=I??re?.menuSections,B=ue??re?.signIn,X=_??re?.keptViews,ie=We??re?.onExport,[_r,Hr]=(0,d.useState)(null),ce=_r??i??s[0]?.principal??lr,Ge=Kt(e,ce,V),fn=Ge.past&&Ge.live===e?Ge.past.store:e,wt=a??Fi(),vt=!Ft(e),j=(0,d.useMemo)(()=>vt?e:fn.seenBy(ce,wt?{as:wt}:void 0),[vt,e,fn,ce,wt]);dr(e,ce);let[ae]=(0,d.useState)(()=>Yo(u)),[yn,Dr]=(0,d.useState)(!1),mn=(0,d.useCallback)(()=>Dr(!0),[]),se=(0,d.useMemo)(()=>b?[...m,...Zo]:m,[m,b]),[bt]=(0,d.useState)(()=>n??Qt(t,e.schema)),[Nr,gn]=(0,d.useState)(()=>Qe(bt??fe,r??bt?.selection??[])),Te=(0,d.useRef)(bt??fe).current,[hn,jr]=(0,d.useState)(null),[Sn,Wr]=(0,d.useState)(null),Z=(0,d.useContext)(Ne),[wn]=(0,d.useState)(()=>Z?.seatTalk??Wt(f?.name??e.schema.kinds.join(","))),xt=F??Z?.ai??Vt,Fe=(0,d.useMemo)(()=>xt.off?Ki:xt,[xt]),vn=(0,d.useRef)(Fe.interactions);vn.current=Fe.interactions;let[bn]=(0,d.useState)(()=>Z?.aiDesk??Gt(()=>vn.current)),[Gr]=(0,d.useState)(()=>Z?.subscriptions??oo()),xn=Pe??Z?.subscriptions??Gr,Et=A??Z?.onKeepLens,Ke=y??Z?.app,Be=S??Z?.locale,Fr=f?.locale??Ke?.brand?.locale,qe=v??Z?.timeZone;Zn({reader:Be,app:Fr,readerTimeZone:qe,appTimeZone:f?.timeZone??Ke?.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),[Me,Tn]=(0,d.useState)(()=>new Map),Ce=(0,d.useRef)(Me);Ce.current=Me;let Oe=(0,d.useRef)(null),At=(0,d.useCallback)(p=>j.graph.getNode(p)?.kind,[j]),J=(0,d.useCallback)(p=>{let h=zt(Ce.current,p,At);Ce.current=h,Tn(h),Oe.current&&clearTimeout(Oe.current),[...h.values()].some(C=>C.mode!=="docked"&&C.mode!=="asking")&&(Oe.current=setTimeout(()=>{let C=zt(Ce.current,{type:"rest",at:Date.now(),holdMs:Jt},At);Ce.current=C,Tn(C)},Jt+20))},[At]),Mn=(0,d.useCallback)(p=>J({...p,at:p.at??Date.now()}),[J]),Cn=(0,d.useCallback)(p=>{Kr(p),p&&J({type:"home",author:{kind:"agent",id:p,session:ae},at:Date.now()})},[J,ae]);(0,d.useEffect)(()=>j.subscribe((p,h)=>{for(let T of h)T.author.kind==="agent"&&J({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[j,J]),(0,d.useEffect)(()=>()=>{Oe.current&&clearTimeout(Oe.current)},[]);let $=(0,d.useMemo)(()=>({...ce,session:ae}),[ce,ae]),On=nr(j,E,$),Vn=(0,d.useCallback)(p=>{Hr(p),l?.(p)},[l]),[Ve,Br]=(0,d.useState)(()=>Object.fromEntries(se.map(p=>[p.name,Bo(p,u)])));(0,d.useEffect)(()=>{for(let p of se)zo(p,Ve[p.name]??p.initial)},[se,Ve]);let In=(0,d.useCallback)((p,h)=>{let T=se.find(C=>C.name===p);!T||!T.options.some(C=>C.value===h)||(qo(T,h,u),Br(C=>({...C,[p]:h})))},[se,u]),[Ln,qr]=(0,d.useState)(null),{activity:_n,noteAttention:Hn}=er(j),Dn=(0,d.useCallback)(p=>{Hn(p),J({type:"read",author:p.author,ids:p.reads,at:Date.now()})},[Hn,J]),pe=(0,d.useCallback)(p=>{if(me(p)!==null||de(p).length>0||Ct(p))return!0;let h=po(p);return h?j.graph.allEdges().some(T=>T.kind===h.kind&&T.from===h.from&&T.to===h.to):j.graph.getNode(p)!==void 0},[j]),Nn=(0,d.useCallback)(p=>{let h=p.selection??Yt,T=h.filter(pe),C=T.length===h.length?p:Qe(p,T);return C.focusId!==null&&!pe(C.focusId)&&(C=z(C,null)),C},[pe]),Ie=(0,d.useCallback)(p=>{let h=Nn(p),T=ar(j,$,h.shown);if(h.focusId!==null&&T.size>0){let C=de(h.focusId),Yn=j.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=Te.focusId!==null&&!pe(Te.focusId)?Qt(t,e.schema)??{...fe,overview:!0}:Te;C.focusId!==null&&pe(C.focusId)?h={...h,focusId:C.focusId}:C.overview===!0&&(h={...h,overview:!0})}return h},[Nn,pe,j,Te,$,t,e.schema]),q=Ie(K??Nr),jn=(0,d.useMemo)(()=>ar(j,$,q.shown),[j,$,q.shown]),Wn=(0,d.useMemo)(()=>[...j.modules.administered.entries()].map(([p,h])=>{let T=j.mayAdminister(p,$);return{name:p,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:T,shown:T&&(q.shown??[]).includes(p)}}),[j,$,q.shown]),Le=(0,d.useCallback)(p=>{let h=T=>Ie(typeof p=="function"?p(T):p);if(K!==void 0){oe?.(h(K));return}oe&&oe(h(q)),gn(T=>h(T))},[q,oe,K,Ie]);(0,d.useEffect)(()=>{K===void 0&&gn(p=>{let h=Ie(p);return h===p?p:h})},[q,K,Ie]);let Gn=q.selection??Yt,Fn=(0,d.useCallback)(p=>{Le(h=>Qe(h,typeof p=="function"?p(h.selection??Yt):p))},[Le]),{who:ze,following:Kn,follow:Bn,sayWhere:zr,sayCaret:qn,sharing:zn}=Xo({channel:b,store:j,view:q,principal:$,session:ae,robots:Me,seatWho:Pt,settingValues:Ve,setView:Le,seats:s,people:c,...g!==void 0?{ttlMs:g}:{}}),$r=(0,d.useMemo)(()=>({store:j,scheme:o,views:t,view:q,setView:Le,homeView:Te,selection:Gn,setSelection:Fn,menuAt:hn,setMenuAt:jr,whereIs:An,pointer:kn,motion:Rn,registerScene:Pn,robots:Me,noteSeat:Mn,seatWho:Pt,registerSeatWho:Cn,actsDoor:Sn,registerActsDoor:Wr,seatTalk:wn,aiDesk:bn,...u?{memory:u}:{},who:ze,following:Kn,follow:Bn,sayWhere:zr,sharing:zn,session:ae,ai:Fe,resolveApp:N,linkedRecords:E,menuSections:R,...X?{keptViews:X}:{},...ie?{onExport:ie}:{},subscriptions:xn,dismissals:Ae,whileAway:ke,signIn:B,linkedReads:On,movedByHand:yn,noteMoved:mn,emphasis:Ln,setEmphasis:qr,activity:_n,noteAttention:Dn,principal:$,seats:s,people:c,takeSeat:Vn,settings:se,settingValues:Ve,chooseSetting:In,hiddenKinds:jn,administered:Wn,...x?{providers:x}:{},...f?{brand:f}:{},...Et?{onKeepLens:Et}:{},app:Ke,...Be?{locale:Be}:{},...qe?{timeZone:qe}:{}}),[j,o,t,q,Le,Gn,Fn,hn,An,kn,Rn,Pn,Me,Mn,Pt,Cn,Sn,wn,bn,u,ze,Kn,Bn,zn,ae,Fe,N,E,R,X,ie,xn,Ae,ke,B,On,yn,mn,Ln,_n,Dn,$,s,c,Vn,se,Ve,In,jn,Wn,x,f,Et,Ke,Be,qe]),$n=(0,d.useMemo)(()=>k?{typing:k,sayCaret:qn,who:ze}:null,[k,qn,ze]),Un=D?(0,te.jsx)(it.Provider,{value:D,children:Re}):Re;return(0,te.jsx)(Ne.Provider,{value:$r,children:(0,te.jsx)(He.Provider,{value:Ge,children:(0,te.jsx)(Yi,{children:vt?null:$n?(0,te.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}=ne(),l=dt(),c=n.q,u=n.focusId,g=!!(c&&c.trim().length>0),y=(0,d.useSyncExternalStore)(qi,rr,rr),m=(0,d.useMemo)(()=>g&&y?{flagged:new Set(t.violations().flatMap(A=>A.nodeIds)),touched:y.touchWeights(t.log.all())}:null,[t,l,g,y]),b=u?t.graph.getNode(u)?.kind??me(u)??(de(u).length===1?de(u)[0]:void 0):void 0,k=(0,d.useMemo)(()=>s.near&&Ui(s.near),[s.near]),f=(0,d.useMemo)(()=>!c||!m||!y?null:y.search(t,c,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(A=>!i.has(A)),from:[...a,...u&&t.graph.has(u)?[u]:[]],flagged:m.flagged,touched:m.touched,limit:200,rank:k}),[t,c,r,o,i,a,u,b,m,k]),[S,v]=(0,d.useState)();return(0,d.useEffect)(()=>void f?.later?.then(A=>v([f,A])),[f]),(0,te.jsx)(ur.Provider,{value:S?.[0]===f?S[1]:f,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 ne(){let e=(0,d.useContext)(Ne);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function en(){return(0,d.useContext)(Ne)??null}function dt(){let{store:e}=ne(),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}=ne(),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"?{...fe,focusId:ee(n.place.kind),within:{view:n.place.as}}:{...fe,focusId:ee(n.kind)}}var pr=H(W(),1),ea=(0,pr.createContext)(!1);var ut=Symbol.for("graview.default-view");function fr(e){return Object.defineProperty(e,ut,{value:!0,enumerable:!1}),e}function yr(e){return typeof e=="function"&&e[ut]===!0}var ct=Symbol.for("graview.replaces-page");function mr(e){return Object.defineProperty(e,ct,{value:!0,enumerable:!1}),e}function gr(e){return typeof e=="function"&&e[ct]===!0}var pt=Symbol.for("graview.bleeds");function hr(e){return Object.defineProperty(e,pt,{value:!0,enumerable:!1}),e}function Sr(e){return typeof e=="function"&&e[pt]===!0}var ft=Symbol.for("graview.previews");function wr(e,t={}){return Object.defineProperty(e,ft,{value:t,enumerable:!1}),e}function vr(e){return typeof e=="function"?e[ft]: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.homes?.()??[];if(o.length>0)for(let r of o)e.home?.(r.view,r.name!==void 0?{name:r.name}:void 0);else{let r=t.homeView?.();r&&e.home?.(r)}return e}var M=H(W(),1),Y=H(De(),1),tn=new Set,yt=0;function nn(e){return()=>{yt+=1;let t=e();return t.then(()=>void(yt-=1),()=>void(yt-=1)),t}}var oa=()=>yt,gt=(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)(gt);(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)(gt);return!n&&s&&(o.add(s),Er(s,t)),(0,M.createElement)(r,a)}return i}var Ar=!1,kr=!1,mt=new Set;function la(){Ar=!0}function da(){kr=!0;for(let e of[...mt])e();mt.clear()}var Rr=()=>kr||!Ar;function ua(e){return Rr()?(e(),()=>{}):(mt.add(e),()=>void mt.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 y of[...a])y()},l=y=>(a.add(y),()=>void a.delete(y)),c=()=>i,u=()=>void g().catch(()=>{});function g(){if(n)return Promise.resolve(t);if(r)return r;let y=e().then(m=>(t=m,n=!0,o=!1,r=void 0,tn.delete(u),s(),m),m=>{throw r=void 0,o=!0,tn.add(u),ca(),s(),m});return y.catch(()=>{}),r=y,y}return{load:g,prefetch:u,get current(){return t},get failed(){return o},part(y,m={}){let b=m.what??"This part",k={};function f(A){(0,M.useSyncExternalStore)(l,c,c),Pr(k);let x=(0,M.useRef)(null),F=(0,M.useRef)(null),D=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{o&&r===void 0&&u()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(D.current=!0),(0,M.useLayoutEffect)(()=>{if(!(!n||!D.current)){D.current=!1;for(let N=F.current?.nextElementSibling??null;N!==null;N=N.nextElementSibling){let V=N.matches(xr)?N:N.querySelector(xr);if(V instanceof HTMLElement){V.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[D.current?(0,Y.jsx)("span",{ref:F,hidden:!0}):null,y(t,A)]}):m.quiet?null:(0,Y.jsx)(pa,{what:b,button:x,...m.as?{as:m.as}:{}})}let S=(0,M.lazy)(nn(()=>g().then(()=>({default:f}),()=>({default:f}))));function v(A){let x=(0,M.useContext)(gt),[F]=(0,M.useState)(()=>n||o);return!n&&!o&&Er(x,k),(0,M.createElement)(F?f:S,A)}return v}}}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 we=H(W(),1);function fa(){let{selection:e,setSelection:t}=ne();return(0,we.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}=ne(),t=dt();return(0,we.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}=ne();return(0,we.useMemo)(()=>({view:e,url:Q(e),focus:n=>t(o=>z(o,n)),show:n=>t(o=>fo(o,n)),toggle:n=>t(o=>et(o,n)),go:n=>t(n)}),[e,t])}var Se={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;Se.at=typeof t?.graview=="number"?t.graview:0,Se.at>Se.depth&&(Se.depth=Se.at),Se.tell()});var G=H(W(),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"},ht=6,ve=8,Sa=e=>typeof e.showPopover=="function";function St(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-ht-ve,l=o.top-ht-ve,c=a.height<=s||s>=l,u=Math.max(96,Math.floor(c?s:l)),g=Math.min(a.height,u);a.height>u&&(e.style.maxHeight=i?`min(${i}, ${u}px)`:`${u}px`);let y=a.width,m=n.align==="start"?o.left:o.right-y,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&y<=b.right-b.left&&(m<b.left?m=o.left+y<=b.right?o.left:b.left:m+y>b.right&&(m=o.right-y>=b.left?o.right-y:b.right-y));let k=y>=r.width-2*ve?Math.max(0,(r.width-y)/2):Math.max(ve,Math.min(m,r.width-ve-y)),f=c?o.bottom+ht:Math.max(ve,o.top-ht-g);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(f)}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)&&!St(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&&St(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||!St(e)))try{e.hidePopover(),e.showPopover()}catch{}}var be=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),g=(0,G.useCallback)(v=>{c.current=v},[]),y=(0,G.useCallback)(v=>{u.current=v},[]),m=`graview-popover-${(0,G.useId)().replace(/:/g,"")}`,b=(0,G.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,G.useCallback)(v=>{b.current.controlled||s(v),b.current.onOpenChange?.(v)},[]),f=(0,G.useCallback)(()=>{(document.querySelector(`[aria-controls="${m}"]`)??c.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[m]),S=(0,G.useCallback)(v=>{let A=u.current,x=typeof document>"u"?null:document.activeElement,F=x===null||x===document.body||A!==null&&A.contains(x);k(!1),!(!v||!F)&&(f(),requestAnimationFrame(()=>{an()&&f()}))},[k,f]);return Mr(u,i&&l,n??c,t.align?{align:t.align}:{}),(0,G.useEffect)(()=>{if(!i||!l)return;let v={name:e,close:()=>S(!1)};if(be&&be.close!==v.close&&be.close(),be=v,sn[e].focus==="into"){let V=u.current;V&&!V.contains(document.activeElement)&&Ea(V).focus({preventScroll:!0})}let A=V=>{V.key==="Escape"&&S(!0)},x=V=>{let E=V.target;if(!(E instanceof Node))return;let I=u.current;if(I?.contains(E)||c.current?.contains(E))return;let _=E instanceof Element?E.closest('[role="dialog"], [role="alertdialog"]'):null;_&&!(I&&_.contains(I))||(S(!1),sn[e].focus==="into"&&requestAnimationFrame(()=>{(an()||I!==null&&I.contains(document.activeElement))&&f()}))},F=null,D=null,N=V=>{let E=V.target;if(!(E instanceof Element))return;let I=u.current,_=E.closest('[role="dialog"], [role="alertdialog"]');!_||I&&(I.contains(_)||_.contains(I))||(F=_,S(!1))};return document.addEventListener("keydown",A),document.addEventListener("pointerdown",x,!0),document.addEventListener("focusin",N),()=>{document.removeEventListener("keydown",A),document.removeEventListener("pointerdown",x,!0),document.removeEventListener("focusin",N);let V=F;V&&typeof MutationObserver<"u"&&(D?.disconnect(),D=new MutationObserver(()=>{V.isConnected||(D?.disconnect(),requestAnimationFrame(()=>{(an()||document.activeElement.closest("[hidden]")!==null)&&f()}))}),D.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>D?.disconnect(),10*6e4)),be?.close===v.close&&(be=null)}},[i,l,e,S,f]),{open:l,setOpen:v=>v?k(!0):S(!0),toggle:()=>l?S(!0):k(!0),trigger:{ref:g,"aria-expanded":l,"aria-controls":m,"data-graview-popover-trigger":e},pane:{ref:y,id:m,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var xe=H(W(),1);var Cr=(0,xe.createContext)(null);function Aa(){let e=(0,xe.useContext)(Cr),t=en(),n=(o,r,i)=>t?.setView(a=>le(le(ye(z(a,ee(o)),!1),"view",r),"filter",i?.filter??null));return(0,xe.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>z(ye(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 Ee=H(W(),1);var ka=rn(Ye(()=>(__graviewPreload(import.meta.url,["./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.6W7O5YLL.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,Ee.useState)();return(0,Ee.useEffect)(()=>t?Ra(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var Or=H(W(),1),Ma=(0,Or.createContext)(!1);var un=H(W(),1),Ca=(0,un.createContext)(null),Oa=(0,un.createContext)(null);var Vr=H(W(),1),Va=(0,Vr.createContext)(null);var Ir=H(W(),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")),je=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)&&je(s)?s:null}var La=e=>e.isConnected&&pn(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&je(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&&je(o))return o;for(let r of e.querySelectorAll(cn))if(je(r))return r;return pn(e)&&je(e)?e:null}function _a(e){(0,Ir.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=f=>{let S=f.target;if(S instanceof Element){n=[];for(let v=S;v&&v!==t.parentElement;v=v.parentElement)n.push(v)}},r=!1,i=!1,a=t.ownerDocument,s=()=>!i&&a.defaultView!==null,l=(f,S)=>void setTimeout(()=>s()&&S(),f),c=f=>void requestAnimationFrame(()=>s()&&f()),u=f=>{if(r=!1,i)return;let S=a.activeElement;if(!(!(S===null||S===a.body||S===a.documentElement)||n.length===0)){if(La(n[0])){f&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let A of n.slice(1)){if(!A.isConnected)continue;let x=Lr(A,n[0]);if(x){x.focus({preventScroll:!0}),n=[];return}}}},g=(f,S=Date.now()+2500)=>{l(100,()=>{u(f);let v=a.activeElement;(v===null||v===a.body||v===a.documentElement)&&n.length>0&&Date.now()<S&&g(f,S)})},y=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{u(!1),g(!1)})))},m=f=>{if(!(f instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(f.key))){if(!(f instanceof KeyboardEvent)){let S=f.target instanceof Element?f.target.closest(cn):null,v=a.activeElement,A=v===null||v===a.body||v===a.documentElement;if(S&&A&&t.contains(S)){n=[];for(let x=S;x&&x!==t.parentElement;x=x.parentElement)n.push(x);l(150,()=>c(()=>{u(!1),g(!1)}));return}}!(f instanceof KeyboardEvent)&&!(f.target instanceof Node&&n[0]?.contains(f.target))||l(150,()=>c(()=>{u(!0),g(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&y()}),k=f=>{f.relatedTarget===null&&y()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",m),t.addEventListener("keydown",m),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",m),t.removeEventListener("keydown",m),b.disconnect()}},[e])}export{fe as a,Q as b,Je 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,le as l,ye as m,Qe as n,_e as o,et as p,nt as q,Mt as r,me as s,Ga as t,Zr as u,ee as v,yo as w,de 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,W as G,Wt as H,vi as I,xi as J,Lo as K,it as L,Ei as M,He as N,Ho as O,Pi as P,Ft as Q,Kt as R,Bt as S,De as T,Hi as U,Ne as V,Di as W,Ni as X,dr as Y,Bi as Z,zi as _,Gs as $,Zi as aa,ne as ba,en as ca,dt as da,Xi as ea,Ji as fa,Qi as ga,Qt as ha,Cr as ia,Aa as ja,ea as ka,fr as la,yr as ma,mr as na,gr as oa,hr as pa,Sr as qa,wr as ra,vr as sa,ta,na as ua,nn as va,oa as wa,gt as xa,ra as ya,ia as za,aa as Aa,sa as Ba,la as Ca,da as Da,Rr as Ea,ua as Fa,rn as Ga,Ta as Ha,Ma as Ia,Ca as Ja,Oa as Ka,Va as La,fa as Ma,ya as Na,ga as Oa,Se as Pa,_a as Qa,ha as Ra,St as Sa,Mr as Ta,va as Ua,Pa as Va};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
react/cjs/react.production.js:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u}from"./chunk.
|
|
1
|
+
import{c as u}from"./chunk.27CW6SCT.js";import{ia as l}from"./chunk.7BBGRTXM.js";function a(e,n){let s=new Map;for(let o of e){let t=n(o.from),i=n(o.to);if(t===void 0||i===void 0)continue;let d=`${o.kind}|${t}|${i}`,r=s.get(d);r||s.set(d,r={edge:o.kind,from:t,to:i,links:0,froms:new Set,tos:new Set}),r.links+=1,r.froms.add(o.from),r.tos.add(o.to)}return[...s.entries()].sort(([o],[t])=>o<t?-1:o>t?1:0).map(([o,t])=>({key:o,edge:t.edge,from:t.from,to:t.to,links:t.links,fromCount:t.froms.size,toCount:t.tos.size}))}function m(e,n,s){let o=[],t=[];for(let d of e){let r=f(d);if(r!==null){o.includes(r)||o.push(r);continue}s(d)!==void 0&&t.push(d)}let i=n.overview&&n.focusId!==null?f(n.focusId):null;return n.beside&&n.overview&&i===null&&n.focusId!==null&&t.length===0&&o.length===0&&s(n.focusId)!==void 0&&t.push(n.focusId),{districts:o,records:t,lens:i}}function f(e){return e.startsWith("kind:")?e.slice(5)||null:e.startsWith("aggregate:")&&!e.includes("|")&&e.slice(10)||null}function y(e,n){let s=u(e,n.from,n.edge,"out"),o=n.from===n.to?" of their own":"";return`${l(e,n.from,n.fromCount)} \u2192 ${l(e,n.to,n.toCount)}${o}, ${s}`}export{a,m as b,f as c,y as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ga as l,ma as p,rb as a}from"./chunk.
|
|
1
|
+
import{ga as l,ma as p,rb as a}from"./chunk.7BBGRTXM.js";import{c}from"./chunk.FQLNBIQ5.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
|
-
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 jt,b as qt,c as Ft,d as Gn}from"./chunk.
|
|
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 jt,b as qt,c as Ft,d as Gn}from"./chunk.BTVBZ6KE.js";import{a as Gt}from"./chunk.3OYGXYQY.js";import{a as Hn,b as Dt,c as Vn,d as zt,e as Bt,f as It}from"./chunk.UAP5M3CD.js";import{c as _t,g as Kt,h as Ut,i as Yt}from"./chunk.GCBZ3WE2.js";import{e as Lt}from"./chunk.KFQSYCY3.js";import{m as Nt}from"./chunk.WQOI6BLM.js";import{a as Pt,b as Tt}from"./chunk.LCPGZK7G.js";import{f as Et,h as Mt}from"./chunk.NKC3JILT.js";import{e as At}from"./chunk.HEWVPXRE.js";import{a as Wt,b as tn,c as Ht,d as Vt}from"./chunk.7SQAKSJD.js";import{b as Ct,c as pe,d as ke,e as ze}from"./chunk.WNSC3RWD.js";import{e as $t,l as Ot}from"./chunk.LDAYDCUO.js";import{l as Rt,m as Wn}from"./chunk.ELERUERU.js";import{f as Bn,g as In}from"./chunk.3YZHZGTM.js";import{d as kt}from"./chunk.EQTSV7BK.js";import{h as Fe,j as St}from"./chunk.YD3TKV6P.js";import{G as Ee,Na as xt,Oa as nn,T as te,W as wt,ba as oe,ca as vt,da as bt,l as en}from"./chunk.HT2BEOEV.js";import{$ as Xe,Hd as yt,Nc as Ze,Oc as ht,Ra as ut,Uc as Te,Va as gt,W as cn,Wa as mt,X as st,Xa as pt,Y as lt,Z as Tn,_ as dt,bc as ft,fa as Ve,ga as xe,ia as qe,ja as un,jd as zn,ka as gn,ma as Nn,na as ct,oa as mn,uc as be,wb as Dn}from"./chunk.7BBGRTXM.js";import{b as F}from"./chunk.AJZBJBMO.js";var Kr=F(Ee(),1);var jn=F(te(),1);function Be(e,t,n){let r=e.nodes?.length??0;if(e.total===void 0||e.total<=r)return n;let a=e.nodes?.[0]?.kind,i=a?un(t,a).toLowerCase():"more";return(0,jn.jsxs)("div",{style:{display:"grid",gridTemplateRows:"minmax(0, 1fr) auto",height:"100%",minHeight:0},children:[n,(0,jn.jsxs)("p",{"data-testid":"lens-more",style:{margin:"4px 0 0",fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:["+",e.total-r," more ",i]})]})}var tr=F(Ee(),1);var rn=F(Ee(),1);var Qt=e=>`place:${e}`;function Jt(e,t){(0,rn.useEffect)(()=>{if(e===void 0)return;let n=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return n.set(e,()=>t),()=>void n.delete(e)})}var Xt=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(t=>t.saveShownList(e.read()));function Zt(e,t,n){let r={off:e,about:t,read:n,menu:(a,i,s)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void Xt(r)}],...a&&i?[{id:e?"export-on":"export-off",label:e?"Turn on export":"Turn off export",run:()=>void (__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(m=>m.switchExport(r,i,e,s))}]:[]]};return r}function er({said:e}){return(0,rn.createElement)("button",{type:"button",className:"graview-arrange-open","data-testid":"arrange-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void Xt(e)},(0,rn.createElement)("span",{"aria-hidden":"true"},"\u2193"),"CSV")}var nr=F(Ee(),1),pn=(0,nr.createContext)(null);var qn=F(te(),1),Yr=(e,t)=>{if(e===!1||t===!1)return!1;let n=e===void 0||e===!0?{}:e,r=t===void 0||t===!0?{}:t;return{sort:n.sort!==!1&&r.sort!==!1,filter:n.filter!==!1&&r.filter!==!1,group:n.group!==!1&&r.group!==!1}},Qr=["sort","filter","group","q","archived"];function Ne(e,t={}){let{store:n,onExport:r}=oe(),a=(0,tr.useContext)(pn),{view:i,go:s}=nn(),c=Qr.some(M=>i.within?.[M]!==void 0)?Pt(i):t.arrangedBy??{},b=e.nodes??[],d=t.kind??b[0]?.kind??e.node?.kind,y=c.archived!==void 0&&c.archived!==!1&&d!==void 0&&!t.subject?n.graph.nodesOfKind(d,{archived:c.archived}):b,p=t.subject??(t.only?y.filter(t.only):y),o=t.subject?[]:t.only?y.filter(M=>!t.only(M)):[],l=t.kind??p[0]?.kind,k=Yr(t.allow,t.lensAllows),u=l?At(n.schema,String(l)):void 0,x=u?Et(c,u).arrangement:{},R=Mt(p,k===!1?{}:x,{schema:n.schema,graph:n.graph,flagged:new Set(e.flagged??[]),...t.search?{searchIn:t.search}:{}}),L=e.retired!==void 0&&e.retired>0&&(b[0]?.kind??l)===l?e.retired:0,T=e.fidelity==="full"&&e.budget===void 0,w=l!==void 0&&T&&t.exportable!==!1,O=Zt(a?.export===!1,{lens:a?.title??"",...a?.on!==void 0?{on:a.on}:{}},()=>({title:a?.title??gn(n.schema,String(l)),schema:n.schema,graph:n.graph,kind:String(l),groups:R.groups,grouped:R.grouped,onExport:r,words:{labelOf:xe,readableFields:kt,withComputed:Ot}}));Jt(a&&w?Qt(a.as):void 0,O);let g=l&&k!==!1&&T&&(p.length>1||L>0)?(0,qn.jsx)(Nt,{schema:n.schema,graph:n.graph,kind:String(l),arrangement:x,allow:k,query:t.query!==!1,...t.filters?{filters:t.filters,chips:{nodes:p,flagged:new Set(e.flagged??[])}}:{},onChange:M=>s(Tt(i,M)),kept:{shown:R.nodes.length,of:p.length},...L>0?{past:{count:L,widen:()=>s(Lt(i,!0))}}:{},...w&&!O.off?{end:(0,qn.jsx)(er,{said:O})}:{}}):null;return{nodes:[...o,...R.nodes],arranged:R,arrangement:x,bar:g}}function _e(e,t,n){let r=new Set((n??[]).map(i=>i.kind)),a=new Set((n??[]).map(i=>i.id));return e.allNodes().filter(i=>r.has(i.kind)?a.has(i.id):Ve(t.tryDefinition(i.kind),i))}var Ie=F(Ee(),1);var j=F(te(),1),Jr=["slots","x","y","fill"],fn=class extends Error{constructor(n,r){super(`${n}
|
|
2
2
|
${r}`);this.hint=r;this.name="BoardBindingError"}},rr=e=>Math.max(0,Math.min(1,e));function Fn(e,t,n,r){let a=l=>l,i=l=>r?xe(r.tryDefinition(l.kind),l):String(a(l).label??l.id);if(r&&r.tryDefinition(n.slots)===void 0)throw new fn(`No kind is declared for "${n.slots}".`,'Check the lens bindings: { slots: "<kind>", x: "<field>", y: "<field>", fill: "<edge kind>" }');let s=e.filter(l=>l.kind===n.slots);if(!r&&s.length===0)throw new fn(`Nothing to arrange: no "${n.slots}" nodes.`,'Check the lens bindings: { slots: "<kind>", x: "<field>", y: "<field>", fill: "<edge kind>" }');let m=t.filter(l=>l.kind===n.fill),c=new Map(e.map(l=>[l.id,l])),b=new Map(e.map((l,k)=>[l.id,k])),d=s.map(l=>{let k=a(l),u=n.fillFrom==="occupant",x=m.filter(R=>(u?R.to:R.from)===l.id).map(R=>c.get(u?R.from:R.to)).filter(R=>R!==void 0).sort((R,L)=>(b.get(R.id)??0)-(b.get(L.id)??0)).map(R=>({id:R.id,label:i(R)}));return{id:l.id,code:String(k[n.slotCode??""]??"").trim()||i(l),label:i(l),x:rr(Number(k[n.x]??.5)),y:rr(Number(k[n.y]??.5)),occupants:x}}).sort((l,k)=>l.y-k.y||l.x-k.x),y=new Set(d.flatMap(l=>l.occupants.map(k=>k.id))),p=new Set([...y].map(l=>c.get(l)?.kind).filter(l=>l!==void 0)),o=e.filter(l=>p.has(l.kind)&&!y.has(l.id)).map(l=>({id:l.id,label:i(l)})).sort((l,k)=>l.label<k.label?-1:l.label>k.label?1:0);return{slots:d,empty:d.filter(l=>l.occupants.length===0).map(l=>l.id),spare:o}}function Xr({nodes:e,occupants:t,label:n,fidelity:r,mode:a,options:i,schema:s,implicated:m=[],flagged:c=[]}){let{store:b}=oe(),d=_e(b.graph,b.schema,e),y=t?[...d.filter(f=>f.kind===i.slots),...t.map(f=>b.graph.getNode(f)).filter(f=>f!==void 0)]:d,p=Fn(y,b.graph.allEdges(),i,s),o=new Set(m),l=new Set(c),k=xt(),u=new Map;for(let f of k)for(let v of f.nodeIds)u.set(v,[...u.get(v)??[],f.message]);let x=f=>f?u.get(f)??[]:[];if(r==="glyph")return(0,j.jsx)(ke,{label:`${n??"Board"} \xB7 ${p.slots.length-p.empty.length}/${p.slots.length}`,hue:be("board")});if(r==="summary"){let f=p.slots.filter(v=>p.empty.includes(v.id));return(0,j.jsx)(pe,{title:n??"Board",meta:`${p.slots.length-p.empty.length}/${p.slots.length}`,tone:f.length>0?"warning":"muted",fit:!0,children:f.length>0?(0,j.jsx)(ze,{pick:!0,max:5,items:f.map(v=>({id:v.id,label:v.code}))}):(0,j.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"Every slot filled."})})}let R=i.aspect??.68,L=(0,Ie.useRef)(null),[T,w]=(0,Ie.useState)(!1),[O,g]=(0,Ie.useState)(null),M=160,[N,G]=(0,Ie.useState)(!1);(0,Ie.useEffect)(()=>{let f=L.current;if(!f||typeof ResizeObserver>"u")return;let v=new ResizeObserver(S=>{let A=S[0]?.contentRect;if(!A)return;let h=A.height<M;G(h),w(!h&&R<1&&A.width/A.height>1.3),g(h?null:A.height)});return v.observe(f),()=>v.disconnect()},[R]);let C=(f,v)=>T?{x:1-v,y:f}:{x:f,y:v},q=(()=>{let f=new Map,v=(S,A,h)=>{let $=f.get(h)??{ids:[],codes:[]};$.ids.includes(S)||($.ids.push(S),$.codes.includes(A)||$.codes.push(A)),f.set(h,$)};for(let S of p.slots){for(let A of x(S.id))v(S.id,S.code,A);for(let A of S.occupants)for(let h of x(A.id))v(A.id,A.label,h)}return[...f.entries()].map(([S,A])=>({id:A.ids[0],code:A.codes.join(", "),text:S}))})(),W=a==="fullscreen",ce=q.length===0?null:(0,j.jsxs)("ul",{"data-graview-primitive":"board-key",style:{margin:"2px 0 0",padding:0,listStyle:"none",display:"grid",gap:3,flex:"0 0 auto"},children:[q.slice(0,W?6:2).map(f=>(0,j.jsxs)("li",{"data-graview-pick":f.id,"data-graview-emphasis":o.size===0?"plain":o.has(f.id)?"lit":"dimmed",title:f.text,style:{display:W?"grid":"flex",gap:W?1:7,alignItems:W?"start":"baseline",fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",minHeight:24,width:"fit-content",maxWidth:"100%",padding:W?"2px 0":"3px 6px",marginLeft:W?0:-6,borderRadius:7,cursor:"pointer"},children:[(0,j.jsxs)("span",{style:{flex:"0 0 auto",fontWeight:600,color:"var(--graview-warn)",letterSpacing:"0.02em"},children:["\u26A0 ",f.code]}),(0,j.jsx)("span",{style:{minWidth:0,...W?{}:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},children:f.text})]},f.id)),q.length>(W?6:2)?(0,j.jsxs)("li",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:["+",q.length-(W?6:2)," more"]}):null]}),ae=i.arrange==="shelf",ne=p.slots.every(f=>f.code.length<=3&&!/\s/.test(f.code)),D=(f,v)=>{let S=f.occupants.length===0,A=o.size>0&&!o.has(f.id)&&!f.occupants.some(J=>o.has(J.id)),h=l.has(f.id),$=f.occupants.some(J=>l.has(J.id)),P=h,Z=[...x(f.id),...f.occupants.flatMap(J=>x(J.id))],H=f.occupants.length===1?f.occupants[0]:null,U=i.pickTarget==="slot"?f.id:H?H.id:f.id,Y=J=>H?{}:{"data-graview-pick":J.id,"data-graview-emphasis":o.size===0?"plain":A?"dimmed":"lit"},le=J=>l.has(J.id)?"var(--graview-warn)":"var(--graview-ink-muted)",ge=i.emptyLabel??"empty";return(0,j.jsxs)("div",{"data-graview-pick":U,"data-graview-slot":f.id,"data-graview-mark":ne?"disc":"token","data-graview-flagged":h&&$?"both":h?"slot":$?"occupant":void 0,"data-graview-emphasis":o.size===0?"plain":A?"dimmed":"lit",title:[S?`${f.label} \u2014 nobody in it`:`${f.occupants.map(J=>J.label).join(", ")} at ${f.label}`,...Z].join(`
|
|
3
3
|
`),style:{...v,display:"grid",justifyItems:ne?"center":"start",gap:3,opacity:A?.5:1,transition:"opacity 160ms ease"},children:[ne?(0,j.jsxs)("span",{style:{position:"relative",width:34,height:34,borderRadius:999,display:"grid",placeItems:"center",fontSize:"0.75rem",letterSpacing:"0.02em",border:S?"1.5px dashed var(--graview-warn)":`1px solid ${P?"var(--graview-warn)":"var(--graview-edge-bright)"}`,background:S?"transparent":P?"var(--graview-panel-warning)":"var(--graview-panel)",color:S||P?"var(--graview-warn)":"var(--graview-ink)",boxShadow:S?void 0:"var(--graview-lift-low)"},children:[f.code,h&&!S?(0,j.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",top:-3,right:-3,fontSize:"0.6875rem",lineHeight:1,color:"var(--graview-warn)"},children:"\u26A0"}):null]}):(0,j.jsxs)("span",{style:{display:"grid",gap:1,minWidth:0,maxWidth:180,padding:"5px 10px 6px",borderRadius:8,border:S?"1.5px dashed var(--graview-warn)":`1px solid ${P?"var(--graview-warn)":"var(--graview-edge-bright)"}`,background:S?"transparent":P?"var(--graview-panel-warning)":"var(--graview-panel)",boxShadow:S?void 0:"var(--graview-lift-low)"},children:[(0,j.jsxs)("span",{style:{fontSize:"0.8125rem",fontWeight:550,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:S||P?"var(--graview-warn)":"var(--graview-ink)"},children:[f.code,h&&!S?" \u26A0":null]}),S?(0,j.jsx)("span",{style:{fontSize:"0.75rem",lineHeight:1.3,color:"var(--graview-warn)"},children:ge}):(0,j.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:"0 8px",fontSize:"0.75rem",lineHeight:1.3},children:f.occupants.map(J=>(0,j.jsxs)("span",{...Y(J),style:{whiteSpace:"nowrap",color:le(J)},children:[J.label,l.has(J.id)?" \u26A0":""]},J.id))})]}),ne?S?(0,j.jsx)("span",{style:{fontSize:"0.75rem",whiteSpace:"nowrap",color:"var(--graview-warn)"},children:ge}):f.occupants.map(J=>(0,j.jsxs)("span",{...Y(J),style:{fontSize:"0.75rem",whiteSpace:"nowrap",color:le(J)},children:[J.label,l.has(J.id)?" \u26A0":""]},J.id)):null]},f.id)},Q=i.zones??[],ue=Q.map((f,v)=>({label:f.label,slots:p.slots.filter(S=>S.y>=f.from&&(S.y<f.to||v===Q.length-1&&S.y<=f.to))})),I=new Set(ue.flatMap(f=>f.slots.map(v=>v.id))),E=p.slots.filter(f=>!I.has(f.id));(E.length>0||ue.length===0)&&ue.push({label:"",slots:E});let K={boxSizing:"border-box",borderRadius:12,border:"1px solid var(--graview-edge)",background:"linear-gradient(var(--graview-panel-muted), var(--graview-panel-muted)), var(--graview-panel)",overflow:"hidden"};return(0,j.jsxs)(pe,{title:n??"Board",meta:p.slots.length===0?void 0:p.empty.length===0?`all ${p.slots.length} filled`:`${p.empty.length} unfilled`,...W?{style:{flex:"1 1 auto",minHeight:0,height:"100%"}}:{},children:[(0,j.jsxs)("div",{ref:L,style:{display:"flex",gap:28,alignItems:"stretch",justifyContent:"center",flex:"1 1 auto",minHeight:0},children:[W&&ce?(0,j.jsxs)("div",{style:{width:260,flex:"0 0 auto",alignSelf:"center",display:"grid",gap:8},children:[(0,j.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"What is marked"}),ce]}):null,ae?(0,j.jsx)("div",{"data-graview-primitive":"board","data-graview-arrange":"shelf",style:{...K,overflow:"auto",flex:"1 1 auto",minWidth:0,alignSelf:"stretch",display:"grid",alignContent:"start"},children:ue.map((f,v)=>(0,j.jsxs)("section",{"data-graview-zone":f.label||void 0,style:{display:"grid",gap:8,padding:"10px 14px 14px",...v>0?{borderTop:"1px dashed var(--graview-edge)"}:{}},children:[f.label?(0,j.jsx)("span",{style:{fontSize:"0.6875rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:f.label}):null,f.slots.length>0?(0,j.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px 12px",alignItems:"flex-start"},children:f.slots.map(S=>D(S,{}))}):(0,j.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"nothing here"})]},f.label||`band-${v}`))}):(0,j.jsxs)("div",{style:{display:"flex",gap:5,alignItems:"stretch",minWidth:0,...N?{flex:"1 1 auto",alignSelf:"flex-start"}:{}},children:[!T&&Q.length>0?(0,j.jsx)("div",{"aria-hidden":"true",style:{position:"relative",width:15,flex:"0 0 auto",alignSelf:"stretch"},children:Q.map(f=>(0,j.jsx)("span",{title:f.label,style:{position:"absolute",top:`${f.from*100}%`,height:`${(f.to-f.from)*100}%`,right:0,writingMode:"vertical-rl",transform:"rotate(180deg)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.6875rem",letterSpacing:"0.14em",textTransform:"uppercase",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"var(--graview-ink-faint)"},children:f.label},f.label))}):null,(0,j.jsxs)("div",{"data-graview-primitive":"board","data-graview-arrange":"exact",style:{...K,position:"relative",aspectRatio:`${T?1/R:R}`,...N?{width:"100%",height:"auto",flex:"1 1 auto",minWidth:0,alignSelf:"flex-start"}:{height:"100%",flex:"0 1 auto",...O!==null?{width:Math.round(O*(T?1/R:R))}:{}},maxWidth:"100%"},children:[Q.map(f=>(0,j.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",...T?{top:0,bottom:0,left:`${(1-f.to)*100}%`,width:`${(f.to-f.from)*100}%`,borderLeft:"1px dashed var(--graview-edge)"}:{left:0,right:0,top:`${f.from*100}%`,height:`${(f.to-f.from)*100}%`,borderBottom:"1px dashed var(--graview-edge)"}}},f.label)),T?Q.map(f=>(0,j.jsx)("span",{"aria-hidden":"true",title:f.label,style:{position:"absolute",bottom:3,left:`${(1-f.to)*100}%`,width:`${(f.to-f.from)*100}%`,textAlign:"center",fontSize:"0.6875rem",letterSpacing:"0.14em",textTransform:"uppercase",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"var(--graview-ink-faint)"},children:f.label},`label-${f.label}`)):null,p.slots.map(f=>D(f,{position:"absolute",left:`${C(f.x,f.y).x*100}%`,top:`${C(f.x,f.y).y*100}%`,transform:"translate(-50%, -50%)",width:"max-content",maxWidth:"100%"}))]})]}),p.spare.length>0?(0,j.jsxs)("div",{style:{display:"grid",gap:6,alignContent:"start",minWidth:0},children:[(0,j.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"Not in"}),(0,j.jsx)(ze,{pick:!0,max:10,items:p.spare.map(f=>({...f,emphasis:o.size===0?"plain":o.has(f.id)?"lit":"dimmed"}))})]}):null]}),W?null:ce]})}function ar(e){function t(n){let{store:r}=oe(),a=Fn(_e(r.graph,r.schema,n.nodes),r.graph.allEdges(),e,r.schema),s=[...a.slots.flatMap(d=>d.occupants.map(y=>y.id)),...a.spare.map(d=>d.id)].map(d=>r.graph.getNode(d)).filter(d=>d!==void 0),{arranged:m,bar:c}=Ne(n,{...e.arranging!==void 0?{allow:e.arranging}:{},lensAllows:{group:!1},...e.arrangedBy?{arrangedBy:e.arrangedBy}:{},subject:s}),b=(0,j.jsx)(Xr,{schema:r.schema,...n,options:e,...e.arranging===!1?{}:{occupants:m.nodes.map(d=>d.id)}});return Be(n,r.schema,c?(0,j.jsxs)("div",{style:{display:"grid",gap:6,height:"100%",minHeight:0,gridTemplateRows:"auto 1fr"},children:[c,b]}):b)}return{name:"board",requiredRoles:[...Jr],options:e,View:t,build(n,r,a){return Fn(n,r,e,a)}}}var Cn=F(Ee(),1);var ir=864e5;function _n(e){if(typeof e!="string")return null;if(Bn(e))return In(e)?.day??null;let t=/^(\d{4}-\d{2}-\d{2})/.exec(e);return t?t[1]:null}function yn(e){if(typeof e!="string")return null;if(Bn(e))return In(e)?.minutes??null;let t=/^\d{4}-\d{2}-\d{2}[T ](\d{2}):(\d{2})/.exec(e);return t?Number(t[1])*60+Number(t[2]):null}var hn=e=>Date.UTC(Number(e.slice(0,4)),Number(e.slice(5,7))-1,Number(e.slice(8,10))),wn=e=>new Date(e).toISOString().slice(0,10);function Re(e,t){return wn(hn(e)+t*ir)}function Ge(e,t){let n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t,a=Number(e.slice(8,10)),i=new Date(Date.UTC(n,r+1,0)).getUTCDate();return wn(Date.UTC(n,r,Math.min(a,i)))}var Kn=e=>new Date(hn(e)).getUTCDay();function Ke(e,t=1){let n=(Kn(e)-t+7)%7;return Re(e,-n)}var Un=e=>`${e.slice(0,7)}-01`;function we(e,t){return Math.round((hn(t)-hn(e))/ir)}function Ue(e,t){return Array.from({length:t},(n,r)=>Re(e,r))}var or=e=>dt(e,"short"),De=e=>st(e,{weekday:"short"}),Yn=e=>Xe(e);function je(e,t){let n=t?.fieldRoles?.when;return e&&!e.start&&n?{...e,start:n}:e}function sr(e,t){return t===void 0?!1:typeof t=="string"?e[t]===!0:t.is.includes(e[t.field])}var vn=["start"],Zr=["day","week","month","quarter","year","agenda"];function bn(e){return e.horizon?["day","week","month","quarter","year","years","agenda"]:Zr}function lr(e,t){return e==="years"?t?.title??"Years":`The ${e}`}function dr(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}var Qn=class extends Error{constructor(n,r){super(`The calendar lens has no binding for ${r.map(a=>`"${a}"`).join(", ")} on "${n}". Bind them in the lens declaration: bindings: { ${n}: { start: "<field>" } }.`);this.kind=n;this.missing=r;this.name="CalendarBindingError"}};function xn(e,t,n){let r=je(t[e.kind],n?.tryDefinition(e.kind));if(!r)return null;let a=e,i=n?.tryDefinition(e.kind)?.fields.shape,s=vn.filter(y=>{let p=r[y];return p?i?!(p in i):!(p in a):!0});if(s.length>0)throw new Qn(e.kind,s);let m=_n(a[r.start]);if(m===null)return null;let c=(r.end?_n(a[r.end]):null)??m,b=yn(a[r.start]),d=r.label?a[r.label]:void 0;return{id:e.id,kind:e.kind,label:typeof d=="string"&&d.length>0?d:xe(n?.tryDefinition(e.kind),e),from:m,to:we(m,c)<0?m:c,at:r.allDay&&a[r.allDay]===!0?null:b,allDay:r.allDay&&a[r.allDay]===!0||b===null,done:sr(a,r.done)}}function cr(e,t,n,r){let a=xn(e,t,n);if(!a)return[];let i=je(t[e.kind],n?.tryDefinition(e.kind)).start,s=e,m=s[i],c=s[ut(i)];if(typeof m!="string"||!gt(c))return[a];let b=we(a.from,a.to);return("next"in r?[pt(m,c,r.next)]:mt(m,c,{from:Re(r.from,-b),to:r.to,limit:400})).map(y=>({...a,from:y.slice(0,10),to:Re(y.slice(0,10),b),repeats:!0}))}function Sn(e,t){return e.filter(n=>we(n.from,t)>=0&&we(t,n.to)>=0).sort((n,r)=>n.allDay!==r.allDay?n.allDay?-1:1:n.at!==r.at?(n.at??0)-(r.at??0):n.label.localeCompare(r.label))}function ur(e,t,n){let r=ft(e.schema,e.allMutations()).get(t)?.get(n)??[],a=new Map(e.allMutations().map(s=>[s.name,s]));for(let s of r){let m=a.get(s),c=m?.subject;if(!m||!c)continue;let b=m.input?.shape??{};if(n in b)return{name:m.name,arg:c.arg}}let i=e.allMutations().find(s=>s.derived?.act==="edit"&&s.derived.kind===t);return i?.subject?{name:i.name,arg:i.subject.arg}:null}var gr=(e,t)=>({from:Un(e),to:mr(e),label:Tn(e,{short:!0,year:t})});function mr(e){return wn(Date.UTC(Number(e.slice(0,4)),Number(e.slice(5,7)),0))}function ea(e){let t=Math.floor((Number(e.slice(5,7))-1)/3);return`${e.slice(0,4)}-${String(t*3+1).padStart(2,"0")}-01`}function pr(e,t,n={}){let r=n.weekStartsOn??1,a=(c,b)=>({from:c,to:c,label:String(Number(c.slice(8,10))),...b?{outside:!0}:{}});if(e==="day")return{title:De(t),grain:"day",columns:1,cells:[a(t)]};if(e==="week"){let c=Ke(t,r);return{title:`${De(c)} \u2013 ${De(Re(c,6))}`,grain:"day",columns:7,cells:Ue(c,7).map(b=>a(b))}}if(e==="agenda")return{title:`From ${De(t)}`,grain:"day",columns:1,cells:Ue(t,42).map(c=>a(c))};if(e==="quarter"){let c=ea(t),b=mr(Ge(c,2)),d=[];for(let y=Ke(c,r);we(y,b)>=0;y=Re(y,7))d.push({from:y,to:Re(y,6),label:lt(y),...we(y,c)>0&&we(Re(y,6),c)>0?{outside:!0}:{}});return{title:`Q${Math.floor((Number(t.slice(5,7))-1)/3)+1} ${t.slice(0,4)}`,grain:"week",columns:4,cells:d}}if(e==="year"){let c=t.slice(0,4);return{title:c,grain:"month",columns:4,cells:Array.from({length:12},(b,d)=>gr(`${c}-${String(d+1).padStart(2,"0")}-01`,!1))}}if(e==="years"){let c=Number(t.slice(0,4)),b=c+Math.max(1,n.horizon?.years??1)-1,d=n.horizon?.from!==void 0||n.horizon?.to!==void 0,y=d?n.horizon?.from??c:Math.min(c,n.fit?.first??c),o=(d?Math.max(y,n.horizon?.to??y+Math.max(1,n.horizon?.years??1)-1):Math.max(b,n.fit?.last??b))-y+1,l=Array.from({length:o},(k,u)=>String(y+u));return o>na?{title:`${n.horizon?.title??"Years"} \xB7 ${l[0]}\u2013${l[l.length-1]}`,grain:"year",columns:5,years:l,cells:l.map(k=>({from:`${k}-01-01`,to:`${k}-12-31`,label:k}))}:{title:`${n.horizon?.title??"Years"} \xB7 ${l[0]}\u2013${l[l.length-1]}`,grain:"month",columns:4,years:l,cells:l.flatMap(k=>Array.from({length:12},(u,x)=>gr(`${k}-${String(x+1).padStart(2,"0")}-01`,!0)))}}let i=Un(t),s=Ke(i,r),m=t.slice(0,7);return{title:Tn(t),grain:"day",columns:7,cells:Ue(s,42).map(c=>a(c,c.slice(0,7)!==m))}}function fr(e,t,n){return e.filter(r=>we(r.from,n)>=0&&we(t,r.to)>=0).sort((r,a)=>r.allDay!==a.allDay?r.allDay?-1:1:r.from!==a.from?r.from.localeCompare(a.from):r.at!==a.at?(r.at??0)-(a.at??0):r.label.localeCompare(a.label))}var na=10;function hr(e){return e==="year"?"year":e==="month"?"month":e==="week"?"week":"day"}var yr=F(Ee(),1);var ie=F(te(),1);function Jn({label:e,glyph:t,onPress:n}){return(0,ie.jsx)("button",{type:"button","aria-label":e,title:e,onClick:n,style:Ye,children:t})}var Ye={minHeight:24,minWidth:24,padding:"2px 9px",borderRadius:6,fontSize:"0.8125rem",borderWidth:1,borderStyle:"solid",borderColor:"transparent",color:"var(--graview-ink-muted)",background:"transparent"},wr={day:12,week:4,month:3,year:5};function vr({span:e,weekStartsOn:t,entries:n,today:r,perCell:a,emphasisOf:i,broken:s,hue:m,onOpen:c,onMove:b}){let d=(0,yr.useRef)(null),y=Fe(d),p=y===null?e.columns:Math.max(1,Math.floor(y/44)),o=p<e.columns,l=o?p:e.columns,k=!o&&e.grain==="day"&&e.columns===7?Ue(Ke(e.cells[0]?.from??r,t),7):e.grain==="day"&&e.columns===1?e.cells.map(u=>u.from):null;return o&&e.grain==="day"&&e.columns>1?(0,ie.jsx)("div",{ref:d,"data-calendar-shape":"agenda",style:{display:"grid",minHeight:0,flex:1},children:(0,ie.jsx)(kn,{days:e.cells.map(u=>u.from),entries:n,today:r,emphasisOf:i,broken:s,hue:m,onMove:(u,x)=>b(u,{from:x,to:x,label:x},"day")})}):(0,ie.jsxs)("div",{ref:d,"data-calendar-shape":o?"wrapped":"grid",style:{display:"grid",gap:4,gridTemplateRows:k?"auto 1fr":"1fr",minHeight:0,flex:1},children:[k?(0,ie.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${l}, minmax(0, 1fr))`,gap:4},children:k.map(u=>(0,ie.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-muted)",textAlign:"center"},children:e.columns===7?or(Kn(u)):De(u)},u))}):null,(0,ie.jsx)("div",{tabIndex:0,"aria-label":`The days of ${e.title}`,style:{display:"grid",gridTemplateColumns:`repeat(${l}, minmax(0, 1fr))`,gridAutoRows:"max-content",gap:4,minHeight:0,overflow:"auto"},children:e.cells.map((u,x)=>{let R=fr(n,u.from,u.to),L=R.slice(0,a),T=R.slice(a),w=T.filter(g=>s.has(g.id)).length,O=we(u.from,r)>=0&&we(r,u.to)>=0;return(0,ie.jsxs)("div",{"data-calendar-day":e.grain==="day"?u.from:void 0,"data-calendar-cell":u.from,"data-calendar-grain":e.grain,"data-calendar-count":R.length,"data-calendar-outside":u.outside||void 0,onDragOver:g=>{g.dataTransfer.types.includes("text/graview-node")&&(g.preventDefault(),g.dataTransfer.dropEffect="move")},onDrop:g=>{let M=g.dataTransfer.getData("text/graview-node");M&&(g.preventDefault(),g.stopPropagation(),b(M,u,e.grain))},style:{minHeight:62,display:"flex",flexDirection:"column",gap:2,padding:4,borderRadius:7,border:"1px solid var(--graview-edge)",background:O?"var(--graview-panel)":u.outside?"var(--graview-panel-muted)":"transparent"},children:[(0,ie.jsxs)("span",{style:{display:"flex",alignItems:"baseline",gap:4},children:[(0,ie.jsx)("span",{style:{fontSize:"0.75rem",fontVariantNumeric:"tabular-nums",color:O?"var(--graview-accent)":"var(--graview-ink-faint)"},children:u.label}),e.grain!=="day"&&R.length>0?(0,ie.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",marginLeft:"auto"},children:R.length}):null]}),L.map(g=>(0,ie.jsx)(br,{entry:g,cell:u,rowStart:x%l===0,emphasis:i(g.id),flagged:s.has(g.id),hue:m(g)},`${g.id}:${g.from}:${u.from}`)),T.length>0?(0,ie.jsxs)("button",{type:"button","data-testid":`calendar-more-${u.from}`,onClick:()=>c(u),title:`Open ${u.label}`,style:{minHeight:24,padding:"1px 5px",fontSize:"0.75rem",borderRadius:5,border:"1px dashed var(--graview-edge)",background:"transparent",color:w>0?"var(--graview-warn)":"var(--graview-ink-muted)",textAlign:"left"},children:["+",T.length," more",w>0?` \xB7 ${w} flagged`:""]}):null]},u.from)})})]})}function kn({days:e,entries:t,today:n,emphasisOf:r,broken:a,hue:i,onMove:s}){let m=e.map(c=>({day:c,here:Sn(t,c)})).filter(({here:c})=>c.length>0);return m.length===0?(0,ie.jsx)("p",{"data-testid":"calendar-empty",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:"Nothing is scheduled in the next six weeks."}):(0,ie.jsx)("ol",{tabIndex:0,"aria-label":"What is scheduled",style:{margin:0,padding:0,listStyle:"none",display:"grid",alignContent:"start",gap:10,overflow:"auto",minHeight:0},children:m.map(({day:c,here:b})=>(0,ie.jsxs)("li",{"data-calendar-day":c,onDragOver:d=>{d.dataTransfer.types.includes("text/graview-node")&&(d.preventDefault(),d.dataTransfer.dropEffect="move")},onDrop:d=>{let y=d.dataTransfer.getData("text/graview-node");y&&(d.preventDefault(),d.stopPropagation(),s(y,c))},style:{display:"grid",gap:4},children:[(0,ie.jsxs)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:c===n?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[De(c),c===n?" \xB7 today":""]}),b.map(d=>(0,ie.jsx)(br,{entry:d,cell:{from:c,to:c,label:c},emphasis:r(d.id),flagged:a.has(d.id),hue:i(d)},`${d.id}:${d.from}:${c}`))]},c))})}function br({entry:e,cell:t,emphasis:n,flagged:r,hue:a,rowStart:i=!1}){let s=we(t.from,e.from)>=0,m=we(e.to,t.to)>=0,c=!(s&&m),b=e.at!==null&&s&&e.from===t.from?`${Yn(e.at)} ${e.label}`:e.label;return(0,ie.jsx)("span",{"data-graview-pick":e.id,"data-calendar-entry":e.id,"data-calendar-repeat":e.repeats?e.from:void 0,draggable:!e.repeats,onDragStart:d=>{d.dataTransfer.setData("text/graview-node",e.id),d.dataTransfer.effectAllowed="move"},"data-graview-emphasis":n,"data-calendar-part":c?s?"opens":m?"closes":"through":void 0,"data-calendar-in":t.from,title:c?`${e.label} \xB7 ${e.from} \u2013 ${e.to}`:`${e.label}${e.at===null?" \xB7 all day":` \xB7 ${Yn(e.at)}`}${e.repeats?" \xB7 repeats":""}`,style:{display:"block",minHeight:24,boxSizing:"border-box",padding:"3px 6px",fontSize:"0.75rem",lineHeight:1.35,borderRadius:c?s?"5px 0 0 5px":m?"0 5px 5px 0":0:5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:e.done?"line-through":"none",opacity:n==="dimmed"?.35:e.done?.6:1,background:`color-mix(in oklab, hsl(${Math.round(a)} 70% 55%) ${n==="lit"?38:20}%, transparent)`,color:"var(--graview-ink)",...n==="lit"?{outline:"1px solid var(--graview-accent)"}:{},...r?{borderLeft:"3px solid var(--graview-warn)",paddingLeft:4}:{}},children:s||i?e.repeats?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)("span",{"aria-hidden":"true",children:"\u21BB "}),b]}):b:" "})}var ee=F(te(),1);function ta(e){let t=1/0,n=-1/0;for(let r of e)r&&(t=Math.min(t,Number(r.from.slice(0,4))),n=Math.max(n,Number(r.to.slice(0,4))));return Number.isFinite(t)&&Number.isFinite(n)?{first:t,last:n}:void 0}function xr(e){let t=n=>function(a){let{store:i}=oe(),{view:s}=nn(),m=n?{...e,range:n}:e,c=s.within?.range??m.range??"month",b=Object.keys(e.bindings),{nodes:d,arranged:y,arrangement:p,bar:o}=Ne(a,{...e.arranging!==void 0?{allow:e.arranging}:{},lensAllows:{sort:!1,group:c==="agenda"},...e.arrangedBy?{arrangedBy:e.arrangedBy}:{},...e.search?{search:e.search}:{},...e.filters?{filters:e.filters}:{},...b[0]?{kind:(a.nodes??[]).find(R=>b.includes(String(R.kind)))?.kind??b[0]}:{}}),l=c==="agenda"&&y.grouped&&p.group?y.groups.map(R=>({label:R.label,ids:new Set(R.nodes.map(L=>L.id))})):void 0,k=new Set((a.nodes??[]).map(R=>String(R.kind))),u=b.filter(R=>!k.has(R)&&i.schema.tryDefinition(R)!==void 0).flatMap(R=>{let L=i.schema.tryDefinition(R);return i.graph.nodesOfKind(R).filter(T=>s.past===!0||Ve(L,T))}),x=u.length===0?d:[...d,...a.budget!==void 0?u.slice(0,a.budget):u];return Be(a,i.schema,(0,ee.jsx)(ra,{schema:i.schema,...a,nodes:x,options:{...m,today:m.today??i.today()??dr()},...o?{bar:o}:{},...l?{groups:l}:{}}))};return{name:"calendar",requiredRoles:[...vn],bindings:e.bindings,options:e,View:t(),at:n=>t(n),ranges:()=>bn(e).map(n=>({range:n,title:lr(n,e.horizon)})),place:(n,r)=>n.map(a=>xn(a,e.bindings,r)).filter(a=>a!==null)}}function ra({nodes:e,label:t,fidelity:n,mode:r,options:a,schema:i,selectedIds:s=[],implicated:m=[],flagged:c=[],bar:b,groups:d}){let{view:y,go:p}=nn(),{store:o,principal:l}=oe(),k=y.within?.at??a.today,u=y.within?.range??a.range??"month",x=a.weekStartsOn??1,R=new Set([...m,...s]),L=E=>R.size===0?"plain":R.has(E)?"lit":"dimmed",T=new Set(c),w=u==="years"&&y.within?.at===void 0?ta((e??[]).map(E=>xn(E,a.bindings,i))):void 0,O=pr(u,k,{weekStartsOn:x,...a.horizon?{horizon:a.horizon}:{},...w?{fit:w}:{}}),M=n==="glyph"||n==="summary"?{next:a.today}:{from:O.cells[0]?.from??k,to:O.cells[O.cells.length-1]?.to??k},N=(e??[]).flatMap(E=>cr(E,a.bindings,i,M)),G=a.hueOf??(E=>be(E.kind));if(n==="glyph")return(0,ee.jsx)(ke,{label:`${t??"Calendar"} \xB7 ${N.length}`,hue:be("calendar")});if(n==="summary"){let E=Sn(N,a.today);return(0,ee.jsx)(pe,{title:t??"Calendar",meta:`${N.length} dated`,tone:"muted",children:(0,ee.jsx)(ze,{max:6,items:E.length>0?E.map(K=>({id:K.id,label:K.label,hue:G(K)})):N.filter(K=>we(a.today,K.from)>=0).sort((K,f)=>K.from.localeCompare(f.from)).slice(0,6).map(K=>({id:K.id,label:`${K.from.slice(5)} ${K.label}`,hue:G(K)}))})})}let C=r==="fullscreen",[q,W]=(0,Cn.useState)(null),ce=(E,K,f)=>{let v=o.graph.getNode(E);if(!v)return;let S=je(a.bindings[v.kind],o.schema.tryDefinition(v.kind));if(!S)return;let A=ur(o,v.kind,S.start);if(!A){W({text:`Nothing declared writes the ${Nn(o.schema.definitions.find(Y=>Y.kind===v.kind),S.start).toLowerCase()}, so this cannot be moved from here.`,tone:"refused"});return}let h=K.from,$=v[S.start],Z=yn($)===null?h:`${h}${String($).slice(10)}`,H={name:A.name,args:{[A.arg]:E,[S.start]:Z}},U=o.permits(H,l);if(!U.ok){W({text:U.refusal.message,tone:"refused"});return}try{o.apply(H,{author:l}),W(f==="day"?null:{text:`Moved to ${De(h)} \u2014 a ${f} is coarser than the ${Nn(o.schema.definitions.find(Y=>Y.kind===v.kind),S.start).toLowerCase()} holds, so it takes the first day of the cell. Undo puts it back.`,tone:"rounded"})}catch(Y){W({text:Y instanceof Error?Y.message:String(Y),tone:"refused"})}},ae=E=>{let K=u==="years"?Ge(`${O.years?.[0]??k.slice(0,4)}${k.slice(4)}`,E*12*Math.max(1,O.years?.length??a.horizon?.years??1)):u==="year"?Ge(k,E*12):u==="quarter"?Ge(k,E*3):u==="month"?Ge(k,E):u==="week"?Re(k,E*7):Re(k,E);p(en(y,"at",K))},ne=(E,K)=>{let f=en(y,"range",E);K!==void 0&&(f=en(f,"at",K)),p(f)},D=(0,Cn.useRef)(null),Q=Fe(D),ue=Q!==null&&Q<420,I=E=>E==="years"?a.horizon?.title??"years":E.charAt(0).toUpperCase()+E.slice(1);return(0,ee.jsx)(pe,{title:t??"Calendar",meta:O.title,style:{gap:10,...C?{flex:"1 1 auto",minHeight:0,height:"100%"}:{}},children:(0,ee.jsxs)("div",{ref:D,"data-testid":"calendar","data-calendar-range":u,"data-calendar-at":k,style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,gap:8},children:[(0,ee.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6},children:[(0,ee.jsxs)("nav",{"aria-label":"When",style:{display:"flex",gap:4},children:[(0,ee.jsx)(Jn,{label:"Previous",glyph:"\u2039",onPress:()=>ae(-1)}),(0,ee.jsx)("button",{type:"button","data-testid":"calendar-today",onClick:()=>p(en(y,"at",a.today)),style:Ye,children:"Today"}),(0,ee.jsx)(Jn,{label:"Next",glyph:"\u203A",onPress:()=>ae(1)})]}),ue?(0,ee.jsx)("select",{"aria-label":"Range","data-testid":"calendar-ranges",value:u,onChange:E=>ne(E.target.value),style:{...Ye,borderRadius:999,borderColor:"var(--graview-edge)",background:void 0,backgroundColor:"transparent",marginLeft:"auto",maxWidth:"50%",paddingRight:24,appearance:"none",WebkitAppearance:"none",backgroundImage:"linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%)",backgroundPosition:"calc(100% - 13px) 55%, calc(100% - 9px) 55%",backgroundSize:"4px 4px, 4px 4px",backgroundRepeat:"no-repeat"},children:bn(a).map(E=>(0,ee.jsx)("option",{value:E,children:I(E)},E))}):(0,ee.jsx)("div",{role:"group","aria-label":"Range","data-testid":"calendar-ranges",style:{display:"flex",flexWrap:"wrap",gap:4,marginLeft:"auto"},children:bn(a).map(E=>(0,ee.jsx)("button",{type:"button","aria-pressed":E===u,"data-testid":`calendar-range-${E}`,onClick:()=>ne(E),style:{...Ye,borderRadius:999,borderColor:"var(--graview-edge)",...E==="years"?{}:{textTransform:"capitalize"},...E===u?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)",background:"var(--graview-panel)"}:{}},children:E==="years"?a.horizon?.title??"years":E},E))})]}),q?(0,ee.jsx)("p",{"data-testid":q.tone==="refused"?"calendar-refused":"calendar-rounded",role:"status",style:{margin:0,fontSize:"0.8125rem",color:q.tone==="refused"?"var(--graview-warn)":"var(--graview-ink-muted)"},children:q.text}):null,O.years?(0,ee.jsx)("nav",{"aria-label":"Years","data-testid":"calendar-years",style:{display:"flex",flexWrap:"wrap",gap:4},children:O.years.map(E=>(0,ee.jsx)("button",{type:"button","data-testid":`calendar-year-${E}`,onClick:()=>ne("year",`${E}-01-01`),style:Ye,children:E},E))}):null,b,u==="agenda"&&d?(0,ee.jsx)("div",{"data-testid":"calendar-groups",style:{display:"grid",gap:10,minHeight:0,overflow:"auto"},children:d.map(E=>(0,ee.jsxs)("section",{"data-testid":"calendar-group",style:{display:"grid",gap:4},children:[(0,ee.jsxs)("h3",{style:{margin:0,fontSize:"0.8125rem",letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},children:[E.label," ",(0,ee.jsx)("span",{style:{fontWeight:400},children:E.ids.size})]}),(0,ee.jsx)(kn,{days:O.cells.map(K=>K.from),entries:N.filter(K=>E.ids.has(K.id)),today:a.today,emphasisOf:L,broken:T,hue:G,onMove:(K,f)=>ce(K,{from:f,to:f,label:f},"day")})]},E.label))}):u==="agenda"?(0,ee.jsx)(kn,{days:O.cells.map(E=>E.from),entries:N,today:a.today,emphasisOf:L,broken:T,hue:G,onMove:(E,K)=>ce(E,{from:K,to:K,label:K},"day")}):(0,ee.jsx)(vr,{span:O,weekStartsOn:x,entries:N,today:a.today,perCell:a.perCell??wr[O.grain],emphasisOf:L,broken:T,hue:G,onOpen:E=>ne(hr(O.grain),E.from),onMove:ce})]})})}var re=F(Ee(),1);var Qe=F(Ee(),1),Ae=F(te(),1),$n={padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"};function Sr({choices:e,close:t}){let[n,r]=(0,Qe.useState)(!1),a=(0,Qe.useRef)(null);return(0,Qe.useLayoutEffect)(()=>{n&&a.current?.querySelector("button:not([disabled])")?.focus()},[n]),(0,Ae.jsxs)("div",{children:[(0,Ae.jsxs)("button",{type:"button","data-menu-item":"move-to","aria-expanded":n,onClick:()=>r(i=>!i),style:$n,children:["Move to ",(0,Ae.jsx)("span",{"aria-hidden":"true",children:"\u203A"})]}),n?(0,Ae.jsx)("ul",{ref:a,"aria-label":"Move to","data-testid":"move-to",style:{margin:"2px 0 0 12px",padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:e.map(i=>i.run?(0,Ae.jsx)("li",{children:(0,Ae.jsx)("button",{type:"button","data-move-to":i.to,onClick:()=>{t(),i.run()},style:$n,children:i.label})},i.to):(0,Ae.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,Ae.jsx)("button",{type:"button",disabled:!0,"data-move-to":i.to,"data-withheld":"",style:{...$n,borderStyle:"dashed"},children:(0,Ae.jsx)("s",{children:i.label})}),(0,Ae.jsx)("span",{"data-testid":"move-to-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:i.why})]},i.to))}):null]})}function kr({choose:e,close:t}){return(0,Ae.jsx)("button",{type:"button","data-menu-item":"choose-several",onClick:()=>{t(),e()},style:$n,children:"Choose several"})}var z=F(te(),1),aa=`
|
|
4
4
|
.graview-columns { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
|
|
@@ -1 +1 @@
|
|
|
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 te}from"./chunk.IX63LTRQ.js";import{o as Se,p as ee,s as $,t as be}from"./chunk.QPL3OXW3.js";import{m as J,n as ye,o as we,p as X,q as Z}from"./chunk.OJGHDWI6.js";import{c as ke}from"./chunk.N33WUCAN.js";import{a as he,b as U,c as j,e as ve,l as Me}from"./chunk.JQFIZRAZ.js";import{b as de}from"./chunk.LKJ6FD6Y.js";import{D as z,Ea as fe,F as Y,Fa as ge,G as O,Ga as T,J as pe,Ma as _,O as me,Oa as F,T as M,ba as A,ca as q,da as B,m as le,v as ce,z as ue}from"./chunk.DBMZ3AQB.js";import{a as E}from"./chunk.SDO3U72B.js";import{Qc as ie,Vc as ae,ka as H,td as se}from"./chunk.DIFR37EZ.js";import{b as y}from"./chunk.AJZBJBMO.js";var P=y(O(),1),x=y(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.EXZLG3HK.js")))),xe=ne.part(t=>(0,x.jsx)(t.HoverChipDoor,{}),{quiet:!0}),De="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.UBNZDSS7.js","./chunk.644FUGSX.js","./chunk.547FQPYG.js","./chunk.6SD7YZ4U.js","./chunk.TVURUMU4.js","./chunk.47T3KUAA.js","./chunk.NZDWXX6H.js","./chunk.HJCQ6I3S.js","./chunk.7IXTNST2.js","./chunk.D4EP7FEC.js","./chunk.XVN3CQKH.js","./chunk.4BRM5SGO.js","./chunk.DJ4A76SX.js","./chunk.VDS3IOTK.js","./chunk.SAJLIA5M.js","./chunk.I2NI7CT7.js","./chunk.C7EJPV2N.js","./chunk.7ML2BWSP.js","./chunk.BCE6LIDR.js","./chunk.MBLFZF5R.js","./chunk.RALAID6N.js","./chunk.XOZU4OFA.js","./chunk.5NZDFT6R.js","./chunk.7ECBGIUK.js","./chunk.XTBS64IT.js","./chunk.7INWDFNG.js","./chunk.FPGU43SC.js","./chunk.V6FUYRZI.js","./chunk.5BPRGXIW.js","./chunk.BZEJM2PY.js","./chunk.CMLNBJZG.js","./chunk.QPL3OXW3.js","./chunk.OJGHDWI6.js","./chunk.FRERJWZJ.js","./chunk.RQX4CQJN.js","./chunk.LUIRQ5UF.js","./chunk.N33WUCAN.js","./chunk.JQFIZRAZ.js","./chunk.LKJ6FD6Y.js","./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.MRHPOUA4.js"))));var Ce=Q.part((t,e)=>(0,x.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let c=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(c)}let i=setTimeout(e,2500);return()=>clearTimeout(i)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:i,ai:c}=A(),p=be(),h=Y(c),r=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h});r.current={aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h},(0,P.useEffect)(()=>{if(typeof document>"u")return;let u=null,w=null,k=null,l=g=>{let m=r.current,b=m.chipsOn?m.aimAt(g):null;b&&(k=g,ne.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},f=()=>{u&&clearTimeout(u.timer),u=null},s=g=>{let m=r.current,b=m.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,m.store.log.length]);G!==w&&(w=G,m.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(m.store,b,{principal:m.principal,providers:m.providers}),()=>{}))},o=g=>g.target instanceof Element?g.target.closest(Ne):null,d=g=>{if(g.pointerType==="touch")return;let m=o(g);m!==null&&m===u?.element||(f(),m!==null&&(u={element:m,timer:setTimeout(()=>{u=null,s(m),l(m)},Oe)}))},v=g=>{let m=g.relatedTarget;k!==null&&!(m instanceof Node&&k.contains(m))&&(k=null,ne.current?.leaveRest()),u!==null&&(m instanceof Node&&u.element.contains(m)||f())},S=g=>{if(g.pointerType==="mouse")return;let m=o(g);m&&s(m)},I=g=>{if(!fe())return;let m=o(g);m&&s(m)};return document.addEventListener("pointerover",d,{passive:!0}),document.addEventListener("pointerout",v,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{f(),document.removeEventListener("pointerover",d),document.removeEventListener("pointerout",v),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function it({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:i,setMenuAt:c,registerActsDoor:p,ai:h}=A(),{selection:r}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let f=()=>{v(),Q.prefetch()},s=()=>{},o=ge(()=>void(s=Le(f))),d=["pointerdown","keydown"];for(let S of d)document.addEventListener(S,f,{capture:!0,passive:!0});function v(){o(),s();for(let S of d)document.removeEventListener(S,f,{capture:!0})}return v},[]),(0,P.useEffect)(()=>{if(t==="menu")return p({key:De,open:e??(f=>{let s=f.getBoundingClientRect(),o=f.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??f.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;c({x:Math.round(s.left+Math.min(16,s.width/2)),y:Math.round(Math.min(s.bottom,s.top+36)),...o?{on:o}:{}})})}),()=>p(null)},[t,p,c,e]);let u=i!==null||r.length>0&&e===void 0,[w,k]=(0,P.useState)(u);(0,P.useEffect)(()=>{u&&k(!0)},[u]);let l=Y(h)?(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(xe,{})}):null;return!w&&!u?l:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(Ce,{placement:t,chosen:e===void 0})}),l]})}var K=y(O(),1),V=y(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.UBNZDSS7.js","./chunk.25VJPUDH.js","./chunk.644FUGSX.js","./chunk.547FQPYG.js","./chunk.TBRXNU6T.js","./chunk.H5CRRBNU.js","./chunk.FLMNWVSY.js","./chunk.JETT6ELP.js","./chunk.6SD7YZ4U.js","./chunk.DSLGMCB6.js","./chunk.IX63LTRQ.js","./chunk.I636CZE4.js","./chunk.TVURUMU4.js","./chunk.UV3U4FRT.js","./chunk.EZ4TZUMM.js","./chunk.47T3KUAA.js","./chunk.NZDWXX6H.js","./chunk.HJCQ6I3S.js","./chunk.7IXTNST2.js","./chunk.D4EP7FEC.js","./chunk.XVN3CQKH.js","./chunk.4BRM5SGO.js","./chunk.DJ4A76SX.js","./chunk.VDS3IOTK.js","./chunk.YS5U3DUX.js","./chunk.SAJLIA5M.js","./chunk.LWRXCO2Z.js","./chunk.I2NI7CT7.js","./chunk.LHIT3EZD.js","./chunk.C7EJPV2N.js","./chunk.7ML2BWSP.js","./chunk.BCE6LIDR.js","./chunk.MBLFZF5R.js","./chunk.RALAID6N.js","./chunk.XOZU4OFA.js","./chunk.5NZDFT6R.js","./chunk.7ECBGIUK.js","./chunk.XTBS64IT.js","./chunk.WVUJXDXZ.js","./chunk.7INWDFNG.js","./chunk.FPGU43SC.js","./chunk.V6FUYRZI.js","./chunk.5BPRGXIW.js","./chunk.BZEJM2PY.js","./chunk.CMLNBJZG.js","./chunk.GZHZLJBF.js","./chunk.QPL3OXW3.js","./chunk.OJGHDWI6.js","./chunk.FRERJWZJ.js","./chunk.RQX4CQJN.js","./chunk.LUIRQ5UF.js","./chunk.N33WUCAN.js","./chunk.JQFIZRAZ.js","./chunk.LKJ6FD6Y.js","./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZNXRHOUI.js")))),He=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function ct(t){let{seatTalk:e}=A();return(0,K.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)(K.Suspense,{fallback:null,children:(0,V.jsx)(He,{...t})}):null}var C=y(O(),1),D=y(M(),1),Ae=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.NZDWXX6H.js","./chunk.N2DM42SG.js","./chunk.BJUUSIQY.js","./chunk.BCE6LIDR.js","./chunk.MBLFZF5R.js","./chunk.RALAID6N.js","./chunk.XOZU4OFA.js","./chunk.5NZDFT6R.js","./chunk.JBSW7ZNH.js","./chunk.FPGU43SC.js","./chunk.RQX4CQJN.js","./chunk.LUIRQ5UF.js","./chunk.N33WUCAN.js","./chunk.JQFIZRAZ.js","./chunk.LKJ6FD6Y.js","./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4HFCOMR3.js")))),ze=Ae.part((t,e)=>{let n=t.QuickAskCard;return(0,D.jsx)(n,{...e})},{what:"The quick ask"});function gt({face:t,on:e=!0}){let{ai:n,aiDesk:i,selection:c,view:p}=A(),h=me()?.open??!1,r=e&&z(n)&&!h,u=ve(i),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:c,place:p.within?.view});return k.current={selection:c,place:p.within?.view},(0,C.useEffect)(()=>{if(!r)return;let l=he(i);return l.drawn+=1,U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[r,i]),(0,C.useEffect)(()=>{if(!r)return;let l=f=>{if(f.defaultPrevented||f.key.toLowerCase()!=="k"||!(f.metaKey||f.ctrlKey)||f.altKey||f.shiftKey)return;let s=w.current?.closest("[data-graview-embed]"),o=f.target,d=!(o instanceof Node)||o===document.body||o===document.documentElement;if(s&&!(d||o instanceof Node&&s.contains(o)))return;f.preventDefault(),Ae.prefetch();let v=document.activeElement,{selection:S,place:I}=k.current;j(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:v instanceof HTMLElement&&v!==document.body?v:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,i]),r?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),u?(0,D.jsx)(C.Suspense,{fallback:null,children:(0,D.jsx)(ze,{face:t,opening:u,close:()=>j(i,null)},u.at)}):null]}):null}var R=y(O(),1),L=y(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.N2DM42SG.js","./chunk.BJUUSIQY.js","./chunk.BCE6LIDR.js","./chunk.MBLFZF5R.js","./chunk.RALAID6N.js","./chunk.XOZU4OFA.js","./chunk.5NZDFT6R.js","./chunk.JBSW7ZNH.js","./chunk.FPGU43SC.js","./chunk.RQX4CQJN.js","./chunk.LUIRQ5UF.js","./chunk.N33WUCAN.js","./chunk.JQFIZRAZ.js","./chunk.LKJ6FD6Y.js","./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YDTXCVBU.js")))),qe=oe.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),Be=oe.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function _e(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:i=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(qe,{target:n,close:i})}),prepare:()=>oe.prefetch()}):null,[e])}var Fe=[];function St({children:t}){let e=_e(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)($,{sections:n,children:t})}function bt(t){let{ai:e,aiDesk:n}=A(),{ghost:i}=pe(n);return i===null||i.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(Be,{...t})})}var N=y(O(),1);var Te=y(M(),1),Qe=t=>globalThis[Symbol.for("graview.shown-lists")]?.get(t),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.JQFIZRAZ.js","./chunk.LKJ6FD6Y.js","./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.MWWOI5PW.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function Ke(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,i=e?.views,c=(0,N.useContext)(Me);return(0,N.useMemo)(()=>i?p=>{let h=n?.current(),r=Ve(p),u=s=>s.length>0?{id:"tidy-view",items:s,prepare:()=>Ee.prefetch()}:null,w=(s,...o)=>Ee.load().then(d=>d[s](...o),()=>!1),k=(s,o)=>Qe(s)?.().menu(o,n,c)??[];if(p.place===void 0){if(p.face!=="pages"||r===void 0||p.on!==void 0)return null;let s=h?.may.lenses===!0&&n?.lens!==void 0,o=H(e.store.schema,r),d=i.arrangement?.()?.hide?.includes(r)===!0;return u([...s?[{id:d?"show-list":"hide-list",label:d?"Show":"Hide",hint:d?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void w("setListHidden",r,o,n,!d,c)}]:[],...k(`list:${r}`,s)])}let l=i.places().find(s=>s.as===p.place&&(r===void 0||s.kind===r||s.over?.includes(r)===!0));if(!l)return null;let f=n&&h?se(l,h,n):null;return u([...f?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void w("setHidden",l,f,n,!1,c)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void w("setHidden",l,f,n,!0,c)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let s=Ke(i.places(),l);w("remove",l,f,n,c).then(o=>o&&t?.(l,s))}}]:[],...k(`place:${l.as}`,f==="lens")])}:null,[n,i,c,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=F(),i=(0,N.useCallback)((h,r)=>{let u=e.within?.view;e.focusId===ce(h.kind)&&(u===void 0||u===h.as)&&n(r?ue(e,r.kind,r.as):le(e,!0))},[e,n]),c=Ye(i),p=(0,N.useMemo)(()=>c?[c]:Ue,[c]);return(0,Te.jsx)($,{sections:p,children:t})}function Nt(t={}){return t.scope===void 0?te:de(te,t.scope)}var W=y(O(),1),a=y(M(),1);function Bt({inside:t=!1,widthOf:e}={}){let{store:n,view:i,emphasis:c,setEmphasis:p}=A(),h=Se(),{selection:r,set:u}=_(),{show:w}=F(),k=B(),l=(0,W.useMemo)(()=>{let o=new Map;for(let d of n.graph.allEdges()){let v=o.get(d.kind)??{count:0,ends:new Set};v.count+=1;for(let S of[d.from,d.to]){let I=n.graph.getNode(S);I&&v.ends.add(`kind:${I.kind}`)}o.set(d.kind,v)}return[...o.entries()].sort(([d],[v])=>d.localeCompare(v)).map(([d,v])=>({kind:d,count:v.count,ends:[...v.ends]}))},[n,k]),f=Math.max(0,...l.map(o=>o.count));if((0,W.useEffect)(()=>()=>p(null),[p]),!i.overview&&!t||l.length===0)return null;let s=new Set;for(let o of r){if(o.startsWith("kind:")){s.add(o);continue}let d=n.graph.getNode(o);d&&s.add(`kind:${d.kind}`)}return(0,a.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ae("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:je,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,a.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),e?(0,a.jsx)(Xe,{aloft:i.overview===!0}):null,l.map(({kind:o,count:d,ends:v})=>{let{connector:S,style:I}=ee(h,o),g=Je(n.schema,o),m=c!==null?c===o:s.size===0||v.some(b=>s.has(b));return(0,a.jsxs)("button",{type:"button",title:n.schema.edge(o)?.description===void 0?`${d} of these`:g.words,onMouseEnter:()=>p(o),onMouseLeave:()=>p(null),onFocus:()=>p(o),onBlur:()=>p(null),onClick:()=>{u(v),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:m?1:.4},children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&e?(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(d,f)}):(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:X(I),strokeWidth:Z(I,!0),strokeDasharray:J[I.pattern],strokeLinecap:"round"})}),(0,a.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":o,children:[(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,a.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,a.jsx)("span",{"data-graview-quiet":o,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,a.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:d})]},o)})]})}var je="min(280px, calc(100% - 28px))";function Je(t,e,n){let i=t.edge(e)?.from??[],c=new Map;for(let r of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let u=ke(t,r,e,"out");c.set(u,[...c.get(u)??[],r])}let p=r=>r==="*"?"anything":H(t,r),h=[...c].map(([r,u])=>{let w=u.flatMap(l=>t.tryDefinition(l)?.edges[e]?.to??[]),k=u[0]&&w.length>0?`${u.map(p).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(p).join(", ")}`:"";return[r.charAt(0).toUpperCase()+r.slice(1),k]});return{words:h.map(([r])=>r).join(" \xB7 "),ends:h.flatMap(([,r])=>r?[r]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let i=q(),c=(0,W.useMemo)(()=>ie(e??i?.brand?.kit),[e,i?.brand?.kit]),{connector:p,style:h}=ee(c,t);return(0,a.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:p.visible?1:.35},children:(0,a.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:X(h),strokeWidth:Z(h,!0),strokeDasharray:J[h.pattern],strokeLinecap:"round"})})}function Xe({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,a.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,a.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,a.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,a.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,a.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,a.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:we,strokeWidth:1.8,strokeDasharray:ye,strokeLinecap:"round"})}),(0,a.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=y(O(),1),re=y(M(),1),Ze=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.25VJPUDH.js","./chunk.4BRM5SGO.js","./chunk.DJ4A76SX.js","./chunk.VDS3IOTK.js","./chunk.SAJLIA5M.js","./chunk.I2NI7CT7.js","./chunk.MBLFZF5R.js","./chunk.RQX4CQJN.js","./chunk.LUIRQ5UF.js","./chunk.N33WUCAN.js","./chunk.JQFIZRAZ.js","./chunk.LKJ6FD6Y.js","./chunk.DBMZ3AQB.js","./chunk.SDO3U72B.js","./chunk.DIFR37EZ.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VHPGGC2P.js")))),et=Ze.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t,whileAway:e}=A(),n=B();return(0,Ie.useMemo)(()=>t.log.all().some(c=>c.suggests!==void 0&&!c.withheld),[t,n])||e?.tidied?(0,re.jsx)(et,{}):null}export{it as a,ct as b,gt as c,Bt as d,je as e,_t as f,_e as g,St as h,bt as i,Ye as j,Dt as k,Nt as l,Vt as m};
|
|
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 te}from"./chunk.GDOTG7YA.js";import{o as Se,p as ee,s as $,t as be}from"./chunk.ELERUERU.js";import{m as J,n as ye,o as we,p as X,q as Z}from"./chunk.OJGHDWI6.js";import{c as ke}from"./chunk.27CW6SCT.js";import{a as he,b as U,c as j,e as ve,l as Me}from"./chunk.YD3TKV6P.js";import{b as de}from"./chunk.4KC35UNR.js";import{D as z,Ea as fe,F as Y,Fa as ge,G as O,Ga as T,J as pe,Ma as _,O as me,Oa as F,T as M,ba as A,ca as q,da as B,m as le,v as ce,z as ue}from"./chunk.HT2BEOEV.js";import{a as E}from"./chunk.SDO3U72B.js";import{Qc as ie,Vc as ae,ka as H,td as se}from"./chunk.7BBGRTXM.js";import{b as y}from"./chunk.AJZBJBMO.js";var P=y(O(),1),x=y(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JUNMJYH5.js")))),xe=ne.part(t=>(0,x.jsx)(t.HoverChipDoor,{}),{quiet:!0}),De="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.BKVBX2YB.js","./chunk.644FUGSX.js","./chunk.WNQFHMNR.js","./chunk.UAP5M3CD.js","./chunk.KFQSYCY3.js","./chunk.NKC3JILT.js","./chunk.HEWVPXRE.js","./chunk.HJCQ6I3S.js","./chunk.HXRV3WVJ.js","./chunk.MQ5HBUBL.js","./chunk.7SQAKSJD.js","./chunk.ZOHMWSHD.js","./chunk.PZG3B7F4.js","./chunk.LRUNFSHP.js","./chunk.WNSC3RWD.js","./chunk.S5MGE2U5.js","./chunk.LL2MLSPH.js","./chunk.EB4NVTJL.js","./chunk.VG7OWV2H.js","./chunk.KXPRILAO.js","./chunk.XU34T2H4.js","./chunk.XOZU4OFA.js","./chunk.BB33TI4S.js","./chunk.7ECBGIUK.js","./chunk.2EDC63RI.js","./chunk.LDAYDCUO.js","./chunk.KKNDX4JT.js","./chunk.GKSUTAIX.js","./chunk.5ICIMQE6.js","./chunk.QGV7H7RQ.js","./chunk.YIA2EDVF.js","./chunk.ELERUERU.js","./chunk.OJGHDWI6.js","./chunk.YHTE34RN.js","./chunk.3YZHZGTM.js","./chunk.EQTSV7BK.js","./chunk.27CW6SCT.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ETBFD76E.js"))));var Ce=Q.part((t,e)=>(0,x.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let c=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(c)}let i=setTimeout(e,2500);return()=>clearTimeout(i)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:i,ai:c}=A(),p=be(),h=Y(c),r=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h});r.current={aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h},(0,P.useEffect)(()=>{if(typeof document>"u")return;let u=null,w=null,k=null,l=g=>{let m=r.current,b=m.chipsOn?m.aimAt(g):null;b&&(k=g,ne.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},f=()=>{u&&clearTimeout(u.timer),u=null},s=g=>{let m=r.current,b=m.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,m.store.log.length]);G!==w&&(w=G,m.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(m.store,b,{principal:m.principal,providers:m.providers}),()=>{}))},o=g=>g.target instanceof Element?g.target.closest(Ne):null,d=g=>{if(g.pointerType==="touch")return;let m=o(g);m!==null&&m===u?.element||(f(),m!==null&&(u={element:m,timer:setTimeout(()=>{u=null,s(m),l(m)},Oe)}))},v=g=>{let m=g.relatedTarget;k!==null&&!(m instanceof Node&&k.contains(m))&&(k=null,ne.current?.leaveRest()),u!==null&&(m instanceof Node&&u.element.contains(m)||f())},S=g=>{if(g.pointerType==="mouse")return;let m=o(g);m&&s(m)},I=g=>{if(!fe())return;let m=o(g);m&&s(m)};return document.addEventListener("pointerover",d,{passive:!0}),document.addEventListener("pointerout",v,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{f(),document.removeEventListener("pointerover",d),document.removeEventListener("pointerout",v),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function it({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:i,setMenuAt:c,registerActsDoor:p,ai:h}=A(),{selection:r}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let f=()=>{v(),Q.prefetch()},s=()=>{},o=ge(()=>void(s=Le(f))),d=["pointerdown","keydown"];for(let S of d)document.addEventListener(S,f,{capture:!0,passive:!0});function v(){o(),s();for(let S of d)document.removeEventListener(S,f,{capture:!0})}return v},[]),(0,P.useEffect)(()=>{if(t==="menu")return p({key:De,open:e??(f=>{let s=f.getBoundingClientRect(),o=f.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??f.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;c({x:Math.round(s.left+Math.min(16,s.width/2)),y:Math.round(Math.min(s.bottom,s.top+36)),...o?{on:o}:{}})})}),()=>p(null)},[t,p,c,e]);let u=i!==null||r.length>0&&e===void 0,[w,k]=(0,P.useState)(u);(0,P.useEffect)(()=>{u&&k(!0)},[u]);let l=Y(h)?(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(xe,{})}):null;return!w&&!u?l:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(Ce,{placement:t,chosen:e===void 0})}),l]})}var K=y(O(),1),V=y(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.BKVBX2YB.js","./chunk.25VJPUDH.js","./chunk.644FUGSX.js","./chunk.WNQFHMNR.js","./chunk.LO3U3P55.js","./chunk.I3WWCPQ2.js","./chunk.BTVBZ6KE.js","./chunk.3OYGXYQY.js","./chunk.UAP5M3CD.js","./chunk.GCBZ3WE2.js","./chunk.GDOTG7YA.js","./chunk.EPPXZZPK.js","./chunk.KFQSYCY3.js","./chunk.WQOI6BLM.js","./chunk.LCPGZK7G.js","./chunk.NKC3JILT.js","./chunk.HEWVPXRE.js","./chunk.HJCQ6I3S.js","./chunk.HXRV3WVJ.js","./chunk.MQ5HBUBL.js","./chunk.7SQAKSJD.js","./chunk.ZOHMWSHD.js","./chunk.PZG3B7F4.js","./chunk.LRUNFSHP.js","./chunk.43OKZU73.js","./chunk.WNSC3RWD.js","./chunk.ACYDJQRC.js","./chunk.S5MGE2U5.js","./chunk.34TW32TB.js","./chunk.LL2MLSPH.js","./chunk.EB4NVTJL.js","./chunk.VG7OWV2H.js","./chunk.KXPRILAO.js","./chunk.XU34T2H4.js","./chunk.XOZU4OFA.js","./chunk.BB33TI4S.js","./chunk.7ECBGIUK.js","./chunk.2EDC63RI.js","./chunk.WVUJXDXZ.js","./chunk.LDAYDCUO.js","./chunk.KKNDX4JT.js","./chunk.GKSUTAIX.js","./chunk.5ICIMQE6.js","./chunk.QGV7H7RQ.js","./chunk.YIA2EDVF.js","./chunk.GZHZLJBF.js","./chunk.ELERUERU.js","./chunk.OJGHDWI6.js","./chunk.YHTE34RN.js","./chunk.3YZHZGTM.js","./chunk.EQTSV7BK.js","./chunk.27CW6SCT.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ELAMMS2V.js")))),He=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function ct(t){let{seatTalk:e}=A();return(0,K.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)(K.Suspense,{fallback:null,children:(0,V.jsx)(He,{...t})}):null}var C=y(O(),1),D=y(M(),1),Ae=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.HEWVPXRE.js","./chunk.47JQPYXL.js","./chunk.BJUUSIQY.js","./chunk.VG7OWV2H.js","./chunk.KXPRILAO.js","./chunk.XU34T2H4.js","./chunk.XOZU4OFA.js","./chunk.BB33TI4S.js","./chunk.CCWPF5PK.js","./chunk.KKNDX4JT.js","./chunk.3YZHZGTM.js","./chunk.EQTSV7BK.js","./chunk.27CW6SCT.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.GZB6A6KF.js")))),ze=Ae.part((t,e)=>{let n=t.QuickAskCard;return(0,D.jsx)(n,{...e})},{what:"The quick ask"});function gt({face:t,on:e=!0}){let{ai:n,aiDesk:i,selection:c,view:p}=A(),h=me()?.open??!1,r=e&&z(n)&&!h,u=ve(i),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:c,place:p.within?.view});return k.current={selection:c,place:p.within?.view},(0,C.useEffect)(()=>{if(!r)return;let l=he(i);return l.drawn+=1,U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[r,i]),(0,C.useEffect)(()=>{if(!r)return;let l=f=>{if(f.defaultPrevented||f.key.toLowerCase()!=="k"||!(f.metaKey||f.ctrlKey)||f.altKey||f.shiftKey)return;let s=w.current?.closest("[data-graview-embed]"),o=f.target,d=!(o instanceof Node)||o===document.body||o===document.documentElement;if(s&&!(d||o instanceof Node&&s.contains(o)))return;f.preventDefault(),Ae.prefetch();let v=document.activeElement,{selection:S,place:I}=k.current;j(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:v instanceof HTMLElement&&v!==document.body?v:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,i]),r?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),u?(0,D.jsx)(C.Suspense,{fallback:null,children:(0,D.jsx)(ze,{face:t,opening:u,close:()=>j(i,null)},u.at)}):null]}):null}var R=y(O(),1),L=y(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.47JQPYXL.js","./chunk.BJUUSIQY.js","./chunk.VG7OWV2H.js","./chunk.KXPRILAO.js","./chunk.XU34T2H4.js","./chunk.XOZU4OFA.js","./chunk.BB33TI4S.js","./chunk.CCWPF5PK.js","./chunk.KKNDX4JT.js","./chunk.3YZHZGTM.js","./chunk.EQTSV7BK.js","./chunk.27CW6SCT.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.PM3SYXKB.js")))),qe=oe.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),Be=oe.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function _e(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:i=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(qe,{target:n,close:i})}),prepare:()=>oe.prefetch()}):null,[e])}var Fe=[];function St({children:t}){let e=_e(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)($,{sections:n,children:t})}function bt(t){let{ai:e,aiDesk:n}=A(),{ghost:i}=pe(n);return i===null||i.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(Be,{...t})})}var N=y(O(),1);var Te=y(M(),1),Qe=t=>globalThis[Symbol.for("graview.shown-lists")]?.get(t),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VHSWBFXB.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function Ke(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,i=e?.views,c=(0,N.useContext)(Me);return(0,N.useMemo)(()=>i?p=>{let h=n?.current(),r=Ve(p),u=s=>s.length>0?{id:"tidy-view",items:s,prepare:()=>Ee.prefetch()}:null,w=(s,...o)=>Ee.load().then(d=>d[s](...o),()=>!1),k=(s,o)=>Qe(s)?.().menu(o,n,c)??[];if(p.place===void 0){if(p.face!=="pages"||r===void 0||p.on!==void 0)return null;let s=h?.may.lenses===!0&&n?.lens!==void 0,o=H(e.store.schema,r),d=i.arrangement?.()?.hide?.includes(r)===!0;return u([...s?[{id:d?"show-list":"hide-list",label:d?"Show":"Hide",hint:d?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void w("setListHidden",r,o,n,!d,c)}]:[],...k(`list:${r}`,s)])}let l=i.places().find(s=>s.as===p.place&&(r===void 0||s.kind===r||s.over?.includes(r)===!0));if(!l)return null;let f=n&&h?se(l,h,n):null;return u([...f?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void w("setHidden",l,f,n,!1,c)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void w("setHidden",l,f,n,!0,c)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let s=Ke(i.places(),l);w("remove",l,f,n,c).then(o=>o&&t?.(l,s))}}]:[],...k(`place:${l.as}`,f==="lens")])}:null,[n,i,c,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=F(),i=(0,N.useCallback)((h,r)=>{let u=e.within?.view;e.focusId===ce(h.kind)&&(u===void 0||u===h.as)&&n(r?ue(e,r.kind,r.as):le(e,!0))},[e,n]),c=Ye(i),p=(0,N.useMemo)(()=>c?[c]:Ue,[c]);return(0,Te.jsx)($,{sections:p,children:t})}function Nt(t={}){return t.scope===void 0?te:de(te,t.scope)}var W=y(O(),1),a=y(M(),1);function Bt({inside:t=!1,widthOf:e}={}){let{store:n,view:i,emphasis:c,setEmphasis:p}=A(),h=Se(),{selection:r,set:u}=_(),{show:w}=F(),k=B(),l=(0,W.useMemo)(()=>{let o=new Map;for(let d of n.graph.allEdges()){let v=o.get(d.kind)??{count:0,ends:new Set};v.count+=1;for(let S of[d.from,d.to]){let I=n.graph.getNode(S);I&&v.ends.add(`kind:${I.kind}`)}o.set(d.kind,v)}return[...o.entries()].sort(([d],[v])=>d.localeCompare(v)).map(([d,v])=>({kind:d,count:v.count,ends:[...v.ends]}))},[n,k]),f=Math.max(0,...l.map(o=>o.count));if((0,W.useEffect)(()=>()=>p(null),[p]),!i.overview&&!t||l.length===0)return null;let s=new Set;for(let o of r){if(o.startsWith("kind:")){s.add(o);continue}let d=n.graph.getNode(o);d&&s.add(`kind:${d.kind}`)}return(0,a.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ae("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:je,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,a.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),e?(0,a.jsx)(Xe,{aloft:i.overview===!0}):null,l.map(({kind:o,count:d,ends:v})=>{let{connector:S,style:I}=ee(h,o),g=Je(n.schema,o),m=c!==null?c===o:s.size===0||v.some(b=>s.has(b));return(0,a.jsxs)("button",{type:"button",title:n.schema.edge(o)?.description===void 0?`${d} of these`:g.words,onMouseEnter:()=>p(o),onMouseLeave:()=>p(null),onFocus:()=>p(o),onBlur:()=>p(null),onClick:()=>{u(v),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:m?1:.4},children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&e?(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(d,f)}):(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:X(I),strokeWidth:Z(I,!0),strokeDasharray:J[I.pattern],strokeLinecap:"round"})}),(0,a.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":o,children:[(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,a.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,a.jsx)("span",{"data-graview-quiet":o,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,a.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:d})]},o)})]})}var je="min(280px, calc(100% - 28px))";function Je(t,e,n){let i=t.edge(e)?.from??[],c=new Map;for(let r of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let u=ke(t,r,e,"out");c.set(u,[...c.get(u)??[],r])}let p=r=>r==="*"?"anything":H(t,r),h=[...c].map(([r,u])=>{let w=u.flatMap(l=>t.tryDefinition(l)?.edges[e]?.to??[]),k=u[0]&&w.length>0?`${u.map(p).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(p).join(", ")}`:"";return[r.charAt(0).toUpperCase()+r.slice(1),k]});return{words:h.map(([r])=>r).join(" \xB7 "),ends:h.flatMap(([,r])=>r?[r]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let i=q(),c=(0,W.useMemo)(()=>ie(e??i?.brand?.kit),[e,i?.brand?.kit]),{connector:p,style:h}=ee(c,t);return(0,a.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:p.visible?1:.35},children:(0,a.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:X(h),strokeWidth:Z(h,!0),strokeDasharray:J[h.pattern],strokeLinecap:"round"})})}function Xe({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,a.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,a.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,a.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,a.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,a.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,a.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:we,strokeWidth:1.8,strokeDasharray:ye,strokeLinecap:"round"})}),(0,a.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=y(O(),1),re=y(M(),1),Ze=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.25VJPUDH.js","./chunk.ZOHMWSHD.js","./chunk.PZG3B7F4.js","./chunk.LRUNFSHP.js","./chunk.WNSC3RWD.js","./chunk.S5MGE2U5.js","./chunk.KXPRILAO.js","./chunk.3YZHZGTM.js","./chunk.EQTSV7BK.js","./chunk.27CW6SCT.js","./chunk.YD3TKV6P.js","./chunk.4KC35UNR.js","./chunk.HT2BEOEV.js","./chunk.SDO3U72B.js","./chunk.7BBGRTXM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.F7SF6EP2.js")))),et=Ze.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t,whileAway:e}=A(),n=B();return(0,Ie.useMemo)(()=>t.log.all().some(c=>c.suggests!==void 0&&!c.withheld),[t,n])||e?.tidied?(0,re.jsx)(et,{}):null}export{it as a,ct as b,gt as c,Bt as d,je as e,_t as f,_e as g,St as h,bt as i,Ye as j,Dt as k,Nt as l,Vt as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as x}from"./chunk.
|
|
1
|
+
import{b as x}from"./chunk.ACYDJQRC.js";import"./chunk.S5MGE2U5.js";import"./chunk.34TW32TB.js";import"./chunk.WVUJXDXZ.js";import"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.GZHZLJBF.js";import{n as R}from"./chunk.ELERUERU.js";import"./chunk.OJGHDWI6.js";import"./chunk.YHTE34RN.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import{G as A,T as v,ca as g}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import{Uc as k,ma as y,qa as c}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.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 Y=e=>(0,i.jsx)(D,{...e});export{D as AppLink,Y as drawAppLink};
|