graview 0.1.46 → 0.1.47
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.L2PI7V4R.js → chunk.24OZGU7J.js} +1 -1
- package/dist/preview/{chunk.FGR7KCI6.js → chunk.2CLANQHZ.js} +1 -1
- package/dist/preview/{chunk.P4O5DGLN.js → chunk.2L3VFGHX.js} +1 -1
- package/dist/preview/chunk.2MCZ4CU5.js +1 -0
- package/dist/preview/{chunk.R2AG4NHQ.js → chunk.2W22AWSL.js} +1 -1
- package/dist/preview/chunk.3LDYUO77.js +1 -0
- package/dist/preview/{chunk.6OPI4WWO.js → chunk.47RTA6M3.js} +1 -1
- package/dist/preview/{chunk.N7VNEUJR.js → chunk.4YS7547F.js} +1 -1
- package/dist/preview/{chunk.W45NKVSV.js → chunk.4YXJPKXD.js} +1 -1
- package/dist/preview/{chunk.UNCS63AM.js → chunk.52VGZBO3.js} +1 -1
- package/dist/preview/{chunk.X25KXCWI.js → chunk.57ZSMK3R.js} +1 -1
- package/dist/preview/{chunk.6MADC6DM.js → chunk.5AGW4NRZ.js} +1 -1
- package/dist/preview/chunk.5G53VDOC.js +1 -0
- package/dist/preview/chunk.5M4TMZXC.js +1 -0
- package/dist/preview/{chunk.GEPNIMXW.js → chunk.5TM5VA2H.js} +1 -1
- package/dist/preview/{chunk.Y5ARSVH4.js → chunk.63MS2LOP.js} +1 -1
- package/dist/preview/{chunk.LKVXSC5O.js → chunk.6QVXXQCW.js} +1 -1
- package/dist/preview/{chunk.RNBPDB37.js → chunk.6TIEX67B.js} +1 -1
- package/dist/preview/{chunk.JF3GD4H5.js → chunk.76GF5US2.js} +1 -1
- package/dist/preview/{chunk.55D33E5A.js → chunk.7ELB37JU.js} +1 -1
- package/dist/preview/chunk.7N2GXZYI.js +3 -0
- package/dist/preview/{chunk.ATDU5Y7V.js → chunk.7NNI7YH4.js} +1 -1
- package/dist/preview/{chunk.MWONSI3P.js → chunk.A3RNSSUQ.js} +1 -1
- package/dist/preview/{chunk.CICGAEBW.js → chunk.A7RKTSOH.js} +2 -2
- package/dist/preview/{chunk.T7O6K3IN.js → chunk.AWXDZUKH.js} +1 -1
- package/dist/preview/{chunk.FXTBMW3S.js → chunk.BBS5C2BY.js} +1 -1
- package/dist/preview/{chunk.IJABD7SI.js → chunk.C3NHNYA6.js} +1 -1
- package/dist/preview/{chunk.S5MQVPLF.js → chunk.C44MC5X3.js} +1 -1
- package/dist/preview/{chunk.O24DD2VF.js → chunk.CMOXKRWT.js} +1 -1
- package/dist/preview/{chunk.HBD7FBZS.js → chunk.COYLGLTI.js} +1 -1
- package/dist/preview/{chunk.6SOUQNXR.js → chunk.CTQULC5F.js} +1 -1
- package/dist/preview/{chunk.PLWVLW22.js → chunk.DNROW6LX.js} +1 -1
- package/dist/preview/{chunk.JLEC3USG.js → chunk.DQS7D2W2.js} +1 -1
- package/dist/preview/{chunk.UR3XYOQ6.js → chunk.ETPKXUAN.js} +1 -1
- package/dist/preview/{chunk.XXEYRHRG.js → chunk.ETR6AV47.js} +1 -1
- package/dist/preview/{chunk.6QYJ2K6K.js → chunk.EUPSAYEI.js} +1 -1
- package/dist/preview/{chunk.I3GP5JW7.js → chunk.EYI3Y2DY.js} +1 -1
- package/dist/preview/chunk.F2VMMCVK.js +1 -0
- package/dist/preview/{chunk.SS27NH5O.js → chunk.F67F6QZ6.js} +1 -1
- package/dist/preview/chunk.FOJDVK2Q.js +1 -0
- package/dist/preview/{chunk.VC3BX2ZF.js → chunk.FOQ27RAR.js} +1 -1
- package/dist/preview/{chunk.EPUBSKKL.js → chunk.FWSCBHZ5.js} +1 -1
- package/dist/preview/chunk.G446PWV6.js +1 -0
- package/dist/preview/{chunk.WP5W44Y4.js → chunk.GCKZ2YRJ.js} +2 -2
- package/dist/preview/{chunk.WO3DDFFY.js → chunk.GQHAAKJG.js} +1 -1
- package/dist/preview/{chunk.F37DHXA2.js → chunk.I6JLOEJU.js} +1 -1
- package/dist/preview/chunk.IJNOT4S4.js +4 -0
- package/dist/preview/{chunk.ONEYVLC2.js → chunk.IPAZOKMQ.js} +1 -1
- package/dist/preview/{chunk.5ESCD57M.js → chunk.IQ2HKGJS.js} +1 -1
- package/dist/preview/{chunk.DEUTHHGI.js → chunk.IROYMLER.js} +1 -1
- package/dist/preview/chunk.ISNEX772.js +1 -0
- package/dist/preview/{chunk.R4OU7O6C.js → chunk.IXOQQBJE.js} +1 -1
- package/dist/preview/{chunk.NWA7Q6CI.js → chunk.IYIN6VSN.js} +1 -1
- package/dist/preview/{chunk.FO5BOBYV.js → chunk.JUWWRRHA.js} +1 -1
- package/dist/preview/{chunk.JNIGZEOF.js → chunk.K2NCGPCL.js} +1 -1
- package/dist/preview/{chunk.4KNEBLB7.js → chunk.KSM6NVAT.js} +1 -1
- package/dist/preview/{chunk.BFKV4GKP.js → chunk.L4YNDNX7.js} +1 -1
- package/dist/preview/{chunk.A5VGTO3E.js → chunk.MBETS27C.js} +1 -1
- package/dist/preview/{chunk.3OSGN463.js → chunk.MCB26YCQ.js} +1 -1
- package/dist/preview/chunk.MCCUVGTE.js +1 -0
- package/dist/preview/{chunk.BCWPV4WR.js → chunk.MF73YBJL.js} +1 -1
- package/dist/preview/{chunk.UOXFALRL.js → chunk.N7JT6MG2.js} +1 -1
- package/dist/preview/{chunk.V5Z2OED6.js → chunk.NDWW5EER.js} +1 -1
- package/dist/preview/{chunk.LVEFQLGQ.js → chunk.NEEOVRB7.js} +1 -1
- package/dist/preview/{chunk.NMIXBH37.js → chunk.NFIGGSMJ.js} +1 -1
- package/dist/preview/{chunk.JBW3DI7E.js → chunk.O2WWYZI7.js} +1 -1
- package/dist/preview/{chunk.XSNAG4JT.js → chunk.O4WEJ47H.js} +3 -3
- package/dist/preview/{chunk.LUNATPAB.js → chunk.OCTOGZVJ.js} +2 -2
- package/dist/preview/{chunk.BAMPYMUE.js → chunk.OJGUIWDD.js} +1 -1
- package/dist/preview/{chunk.VDVJCLGS.js → chunk.OONCUAOH.js} +1 -1
- package/dist/preview/{chunk.VBPK6ARF.js → chunk.P4KCZRIG.js} +1 -1
- package/dist/preview/{chunk.4Y6VGQVQ.js → chunk.PBKO5CKD.js} +1 -1
- package/dist/preview/{chunk.JLYNMAME.js → chunk.PYE3WZM7.js} +1 -1
- package/dist/preview/{chunk.F5PBK4TF.js → chunk.QGG6ZRJ5.js} +2 -2
- package/dist/preview/{chunk.LETJC5TD.js → chunk.QZEZHCOI.js} +1 -1
- package/dist/preview/{chunk.DQOCBKC3.js → chunk.R6V37SR7.js} +1 -1
- package/dist/preview/{chunk.NGIPVTTE.js → chunk.RBJAPOZ3.js} +1 -1
- package/dist/preview/{chunk.RZXPBOGT.js → chunk.RG6WNOBW.js} +1 -1
- package/dist/preview/{chunk.LKN734RR.js → chunk.RUPRZDN3.js} +1 -1
- package/dist/preview/{chunk.S6WHA4CW.js → chunk.RVJXO5GG.js} +1 -1
- package/dist/preview/chunk.RX2M4C5W.js +2 -0
- package/dist/preview/{chunk.EAJB2PJZ.js → chunk.RZF3QM4E.js} +1 -1
- package/dist/preview/{chunk.JLIUUFK2.js → chunk.S5IQFZ5Z.js} +1 -1
- package/dist/preview/{chunk.TOZJZXWQ.js → chunk.SD6N4DGF.js} +1 -1
- package/dist/preview/{chunk.URO2EGY7.js → chunk.SGKK4UKP.js} +1 -1
- package/dist/preview/{chunk.OHSJQYJN.js → chunk.SWWAEOZ7.js} +1 -1
- package/dist/preview/chunk.SZR3Z43B.js +1 -0
- package/dist/preview/{chunk.RTI3FEDD.js → chunk.T42S2WMB.js} +1 -1
- package/dist/preview/chunk.T7RJCEJB.js +18 -0
- package/dist/preview/{chunk.3MMLRSRC.js → chunk.TCXKPILZ.js} +1 -1
- package/dist/preview/{chunk.TFVFJFXC.js → chunk.TJEV5ZAM.js} +3 -3
- package/dist/preview/{chunk.Z5IGHCZX.js → chunk.UV3YU64Z.js} +1 -1
- package/dist/preview/{chunk.WQONZBA3.js → chunk.V7XHNRQM.js} +2 -2
- package/dist/preview/{chunk.M5GJHVWZ.js → chunk.VC3UGFHY.js} +1 -1
- package/dist/preview/{chunk.NIVTK2W5.js → chunk.VSNHCGKC.js} +1 -1
- package/dist/preview/{chunk.UVNVDLV5.js → chunk.VXVWUIGO.js} +1 -1
- package/dist/preview/chunk.W6COSBO2.js +21 -0
- package/dist/preview/{chunk.3VFYSXMQ.js → chunk.WHEUTAXA.js} +1 -1
- package/dist/preview/{chunk.ITYQUSZI.js → chunk.WJS6P7GI.js} +1 -1
- package/dist/preview/chunk.X5G7FOPY.js +12 -0
- package/dist/preview/{chunk.6WA6ASQB.js → chunk.XYEFZ2OO.js} +1 -1
- package/dist/preview/chunk.Y4ZUJUUT.js +25 -0
- package/dist/preview/{chunk.HZCA3UWJ.js → chunk.YHH4TWZ2.js} +1 -1
- package/dist/preview/{chunk.4RJZVTW7.js → chunk.YVONXFKE.js} +1 -1
- package/dist/preview/{chunk.5R2R364Q.js → chunk.Z4UM4CMT.js} +1 -1
- package/dist/preview/{chunk.4HYJHGI4.js → chunk.ZCYGUP3I.js} +1 -1
- package/dist/preview/{chunk.FVOJCVRX.js → chunk.ZL7ZBJUU.js} +1 -1
- package/dist/preview/{chunk.JT3IZIU5.js → chunk.ZQY6ODXC.js} +1 -1
- package/dist/preview/{chunk.SL2FZ54V.js → chunk.ZWVN75EY.js} +1 -1
- package/dist/preview/index.html +33 -33
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2JJYGYT2.js +0 -1
- package/dist/preview/chunk.5K6KX3UC.js +0 -1
- package/dist/preview/chunk.6BDM2XRX.js +0 -1
- package/dist/preview/chunk.6UIW664O.js +0 -6
- package/dist/preview/chunk.AQQZY6OY.js +0 -3
- package/dist/preview/chunk.GVY5UQTJ.js +0 -1
- package/dist/preview/chunk.JHIUG25Q.js +0 -1
- package/dist/preview/chunk.JQLR6KO2.js +0 -1
- package/dist/preview/chunk.NITU5H4J.js +0 -1
- package/dist/preview/chunk.UPQZU7UO.js +0 -21
- package/dist/preview/chunk.V3QUTJR2.js +0 -2
- package/dist/preview/chunk.WM2LWHTJ.js +0 -1
- package/dist/preview/chunk.WSTBCWW7.js +0 -4
- package/dist/preview/chunk.X233NILF.js +0 -1
- package/dist/preview/chunk.XWAMQPUM.js +0 -25
- package/dist/preview/chunk.XXDBZQNY.js +0 -18
- package/dist/preview/chunk.ZTIF23VF.js +0 -1
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ke}from"./chunk.SDO3U72B.js";import{$b as Nn,Fa as Ln,Hc as Gn,J as _n,Ja as gt,Kc as Wn,La as Hn,Nc as Fn,Wa as Dn,ad as Kn,qd as Bn,vd as Fe,wc as jn,wd as ht}from"./chunk.AS4CQBOQ.js";import{a as We,b as _}from"./chunk.AJZBJBMO.js";var uo=We(w=>{"use strict";var kt=Symbol.for("react.transitional.element"),Vr=Symbol.for("react.portal"),Ir=Symbol.for("react.fragment"),Cr=Symbol.for("react.strict_mode"),_r=Symbol.for("react.profiler"),Lr=Symbol.for("react.consumer"),Hr=Symbol.for("react.context"),Dr=Symbol.for("react.forward_ref"),Nr=Symbol.for("react.suspense"),jr=Symbol.for("react.memo"),oo=Symbol.for("react.lazy"),Gr=Symbol.for("react.activity"),Qn=Symbol.iterator;function Wr(e){return e===null||typeof e!="object"?null:(e=Qn&&e[Qn]||e["@@iterator"],typeof e=="function"?e:null)}var ro={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},io=Object.assign,ao={};function ge(e,t,n){this.props=e,this.context=t,this.refs=ao,this.updater=n||ro}ge.prototype.isReactComponent={};ge.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function so(){}so.prototype=ge.prototype;function Pt(e,t,n){this.props=e,this.context=t,this.refs=ao,this.updater=n||ro}var Rt=Pt.prototype=new so;Rt.constructor=Pt;io(Rt,ge.prototype);Rt.isPureReactComponent=!0;var eo=Array.isArray;function At(){}var M={H:null,A:null,T:null,S:null},lo=Object.prototype.hasOwnProperty;function Tt(e,t,n){var o=n.ref;return{$$typeof:kt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Fr(e,t){return Tt(e.type,t,e.props)}function Mt(e){return typeof e=="object"&&e!==null&&e.$$typeof===kt}function Kr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var to=/\/+/g;function Et(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Kr(""+e.key):t.toString(36)}function Br(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(At,At):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function me(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case kt:case Vr:a=!0;break;case oo:return a=e._init,me(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+Et(e,0):o,eo(r)?(n="",a!=null&&(n=a.replace(to,"$&/")+"/"),me(r,t,n,"",function(u){return u})):r!=null&&(Mt(r)&&(r=Fr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(to,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(eo(e))for(var s=0;s<e.length;s++)o=e[s],i=d+Et(o,s),a+=me(o,t,n,i,r);else if(s=Wr(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+Et(o,s++),a+=me(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return me(Br(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 Xe(e,t,n){if(e==null)return e;var o=[],r=0;return me(e,o,"","",function(i){return t.call(n,i,r++)}),o}function qr(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 no=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)},$r={map:Xe,forEach:function(e,t,n){Xe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xe(e,function(){t++}),t},toArray:function(e){return Xe(e,function(t){return t})||[]},only:function(e){if(!Mt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=Gr;w.Children=$r;w.Component=ge;w.Fragment=Ir;w.Profiler=_r;w.PureComponent=Pt;w.StrictMode=Cr;w.Suspense=Nr;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return M.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=io({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!lo.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),d=0;d<i;d++)a[d]=arguments[d+2];o.children=a}return Tt(e.type,r,o)};w.createContext=function(e){return e={$$typeof:Hr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Lr,_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)lo.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 d=Array(a),s=0;s<a;s++)d[s]=arguments[s+2];r.children=d}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Tt(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:Dr,render:e}};w.isValidElement=Mt;w.lazy=function(e){return{$$typeof:oo,_payload:{_status:-1,_result:e},_init:qr}};w.memo=function(e,t){return{$$typeof:jr,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=M.T,n={};M.T=n;try{var o=e(),r=M.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(At,no)}catch(i){no(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),M.T=t}};w.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()};w.use=function(e){return M.H.use(e)};w.useActionState=function(e,t,n){return M.H.useActionState(e,t,n)};w.useCallback=function(e,t){return M.H.useCallback(e,t)};w.useContext=function(e){return M.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return M.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return M.H.useEffect(e,t)};w.useEffectEvent=function(e){return M.H.useEffectEvent(e)};w.useId=function(){return M.H.useId()};w.useImperativeHandle=function(e,t,n){return M.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return M.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return M.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return M.H.useMemo(e,t)};w.useOptimistic=function(e,t){return M.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return M.H.useReducer(e,t,n)};w.useRef=function(e){return M.H.useRef(e)};w.useState=function(e){return M.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return M.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return M.H.useTransition()};w.version="19.2.8"});var N=We((ka,co)=>{"use strict";co.exports=uo()});var vo=We(et=>{"use strict";var oi=Symbol.for("react.transitional.element"),ri=Symbol.for("react.fragment");function wo(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:oi,type:e,key:o,ref:t!==void 0?t:null,props:n}}et.Fragment=ri;et.jsx=wo;et.jsxs=wo});var Ce=We((Ca,bo)=>{"use strict";bo.exports=vo()});var fe={focusId:null,relation:null,expanded:[],pins:{}},Be=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function te(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}`,`${qe(r.x)},${qe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${qe(e.pan.x)},${qe(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 kr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function $e(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[m,p]of n){if(!m.startsWith("pin."))continue;let[g,v]=p.split(","),k=g===void 0?null:Be(g),y=v===void 0?null:Be(v);k===null||y===null||(o[m.slice(4)]={x:k,y})}let r=Object.create(null);for(let[m,p]of n)!m.startsWith("in.")||p.length===0||(r[m.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],d=a[0]===void 0?null:Be(a[0]),s=a[1]===void 0?null:Be(a[1]),u=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{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()}:{},...d!==null&&s!==null?{pan:{x:d,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:kr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(f||!m.startsWith("kind:"))).sort(),pins:o}}function la(e){let t=$e(e);return te(t)==="#"?{...t,overview:!0}:t}function da(e){let t=te(e);return t==="#overview=1"?"":t}function qe(e){return Math.round(e*100)/100}function $n(e,t){return te(e)===te(t)}var qn="edge:";function zn(e){if(!e.startsWith(qn))return null;let t=e.slice(qn.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 St(e){let{pan:t,...n}=e;return{...n,pins:{}}}function q(e,t){if(t===e.focusId)return{...e,focusId:t};let n=St(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function Un(e,t){return{...e,relation:t}}function ae(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function pe(e,t){if(t!==e.overview&&(e=St(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function ze(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Ve(e,t){if(t!==(e.zoom===!0)&&(e=St(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Ue(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Ze="aggregate:",Ye="kind:";function wt(e){return`${Ye}${e}`}function ye(e){return e.startsWith(Ye)?e.slice(Ye.length):null}var fa="kinds:beyond";function Pr(e){let t=ye(e);return t?[t]:se(e)}function ne(...e){return`${Ze}${[...e].sort().join("+")}`}function Yn(e){return e.startsWith(Ze)}function se(e){return!Yn(e)||e.includes("|")?[]:e.slice(Ze.length).split("+").filter(Boolean)}function Zn(e,t,n={}){let o=ye(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Ue(e,t);let r=o!==null?ne(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Ve(e,!1);if(o!==null&&n.carry){let i=pe({...q(e,r),relation:null},!1);return ae(Ve(i,!0),"q",n.carry)}return Ve({...q(e,r),relation:null},!0)}function Rr(e,t,n){return ae(pe(q(e,ne(t)),!1),"view",n)}function pa(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Xn="aggregate:";function vt(e){return e.startsWith(Xn)&&e.includes("|")}var bt=e=>e?.off===!0,Tr=e=>e!==void 0&&!bt(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),Jn=e=>e!==void 0&&!bt(e)&&(e.fast!==void 0||e.decide!==void 0),Mr=e=>e?.suggestOnOpen!==!1&&Jn(e),Or=e=>e?.hoverChips===!0&&Jn(e);var xt={};var fo=_(N(),1),zr={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},po=e=>`graview:seat:${e}`;function Ur(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 Yr(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Ot(e){let t=e===null?null:po(e),n={...zr,...Ur(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&Yr(t,n);for(let d of[...o])d()};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 Zr(e){return(0,fo.useSyncExternalStore)(e.subscribe,e.get,e.get)}var mo=_(N(),1),Xr={entries:[],ghost:null,loaded:!1};function yo(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 Vt(e){let t=Xr,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:yo(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:yo(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Jr(e){return(0,mo.useSyncExternalStore)(e.subscribe,e.get,e.get)}function go(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Je=_(N(),1),Qe=(0,Je.createContext)(void 0),Qr=()=>(0,Je.useContext)(Qe);var A=_(N(),1),Ie=(0,A.createContext)(null);function So(){return(0,A.useContext)(Ie)}function ei(e,t){let n=So(),o=(0,A.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,A.useRef)(0),i=(0,A.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,A.useSyncExternalStore)(i,()=>r.current,()=>0),o}var ti=Ke(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.E2AJ7U5Z.js"))),ho,ni=400;function It(e,t,n){let o=(0,A.useContext)(Ie),r=o!==null&&o.owns(e,t),[i,a]=(0,A.useState)(null),[d,s]=(0,A.useState)(ho);(0,A.useEffect)(()=>{if(d||r||i===null)return;let x=!0;return ti().then(V=>{ho=V,x&&s(V)},()=>{}),()=>{x=!1}},[d,r,i]);let[u,f]=(0,A.useState)(0),m=(0,A.useMemo)(()=>r||i===null||i>=e.log.length||!d?void 0:d.askArchived(e,i,n)??d.askDeclaration(n,i),[r,e,i,n,d,u]),p=m&&"waiting"in m?m.waiting:void 0,g=m&&"seq"in m?m:null,[v,k]=(0,A.useState)(void 0);(0,A.useEffect)(()=>{if(!p)return;let x=!0,V=setTimeout(()=>x&&k(p),ni);return p.then(()=>x&&f(O=>O+1)),()=>{x=!1,clearTimeout(V)}},[p]);let y=p!==void 0&&v!==p||g!==null,b=(0,A.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d||y)return null;try{let x=d.pastAt(e,i,n);return{seq:i,at:x.past?.at,store:x}}catch{return null}},[r,e,i,n,d,y,u]),h=(0,A.useRef)(null),E=y?h.current:b;(0,A.useEffect)(()=>{h.current=E},[E]);let P=(0,A.useCallback)(x=>a(x===null?null:x>=e.log.length?Number.POSITIVE_INFINITY:x),[e]),D=(0,A.useCallback)((x,V)=>[e,E?.store].some(O=>O!==void 0&&(O===x||O.seenBy(V)===x)),[e,E]),C=i!==null,G=(0,A.useMemo)(()=>({past:E,open:C,show:P,live:e,host:n,owns:D,archive:g}),[E,C,P,e,n,D,g]);return r?o:G}var xo=e=>`graview:setting:${e}`;function Eo(){return localStorage}function Ao(e,t){try{let n=(t??Eo()).getItem(xo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function ko(e,t,n){try{(n??Eo()).setItem(xo(e.name),t)}catch{}}function Po(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var L=_(N(),1);function Ct(e){return Fe(e)}var ii=12,ai=4;function si(e,t,n){let o=Ct(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var tt=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-ii);function Ro(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=ai)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?wt([...o][0]):n[0]}function _t(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(a,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=si(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=Ro(t.ids,n);return i({at:a,mode:"reading",trail:tt(r.trail,a)}),o}case"about-to-write":case"write":{let a=Ro(t.ids,n);return i({at:a,mode:"writing",trail:tt(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:tt(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:tt(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 To="graview:session";function Mo(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(To);if(o)return o;let r=t();return n.setItem(To,r),r}catch{return t()}}var Lt={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"},Ht={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"},Oo=[Lt,Ht],di=800;function Vo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:m,seats:p}=e,[g,v]=(0,L.useState)(()=>new Map),[k,y]=(0,L.useState)(null),[b,h]=(0,L.useState)(null),[E,P]=(0,L.useState)(null),D=typeof r.id=="string"&&r.id.length>0,C=D&&(s[Lt.name]??Lt.initial)==="shared",G=C&&(s[Ht.name]??Ht.initial)==="shared",x=Ct({kind:r.kind,...r.id?{id:r.id}:{},session:i}),V=D?Dn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...m?{people:m}:{}}):"",O=d?a.get(`agent:${d}:${i}`):void 0,W=(0,L.useMemo)(()=>!t||!C?null:{participant:x,kind:r.kind,name:V,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Nn(r.id??"nobody"),stop:E??te(o),...G?{over:k}:{},...O?{robot:{at:O.at,mode:O.mode}}:{},at:new Date().toISOString()},[t,C,G,x,V,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,k,O?.at,O?.mode]);(0,L.useEffect)(()=>{if(!t||!W)return;t.here(W);let I=setInterval(()=>t.here({...W,at:new Date().toISOString()}),di);return()=>clearInterval(I)},[t,W]),(0,L.useEffect)(()=>t?t.onWho(K=>v(ht(new Map,K,Date.now(),f))):void 0,[t,f]);let Z=g.size>0;(0,L.useEffect)(()=>{if(!Z)return;let I=setInterval(()=>{v(K=>{let Q=ht(K,[],Date.now(),f);return Q.size===K.size?K:Q})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(I)},[Z,f]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let I=()=>t.leave();return window.addEventListener("pagehide",I),()=>window.removeEventListener("pagehide",I)},[t]),(0,L.useEffect)(()=>{if(!G||typeof document>"u")return;let I=null,K=Q=>{let Ee=go(Q.target);Ee!==I&&(I=Ee,y(Ee))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[G]);let X=(0,L.useRef)(null),$=b?g.get(b)??null:null,de=(0,L.useCallback)(I=>{X.current=null,h(I)},[]);return(0,L.useEffect)(()=>{if(b){if(!$){h(null);return}$.stop!==X.current?.stop&&(X.current={stop:$.stop,at:Date.now()},u($e($.stop)))}},[b,$,u]),(0,L.useEffect)(()=>{let I=X.current;!b||I===null||Date.now()-I.at<400||$n(o,$e(I.stop))||h(null)},[o,b]),(0,L.useEffect)(()=>{if(!b||typeof document>"u")return;let I=K=>{K.key==="Escape"&&h(null)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[b]),(0,L.useMemo)(()=>({who:g,sharing:W?{participant:x,name:V}:null,following:$,follow:de,sayWhere:P}),[g,W,x,V,$,de])}var U=_(N(),1);function Io(e){return Fe(e.author)}function ui(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Co(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),d=(s,u,f)=>{let m=i.get(s),p=m?.participants.includes(Io(u))?m.participants:[...m?.participants??[],Io(u)];i.set(s,{at:o,manner:ui(p,u.author.kind),intent:u.intent,wrote:(m?.wrote??!1)||(f.wrote??!1),read:(m?.read??!1)||(f.read??!1),broke:(m?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)d(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||d(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var ci=2600;function _o(e,t=ci){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)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,m)=>{let p=e.violations(),g=Fn(e.allInvariants(),s,p).introduces;s=p,a(Co(r.current,m,g.map(v=>({nodeIds:v.nodeIds,message:v.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,U.useCallback)(s=>{s.reads.length!==0&&a(Co(r.current,[fi(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function fi(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 l=_(N(),1);function Lo(){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 nt=_(N(),1),pi=e=>e.definitions.some(t=>Ln(t).size>0);function Ho(e,t,n){let[o,r]=(0,nt.useState)(void 0),i=(n.roles??[]).join("\0");return(0,nt.useEffect)(()=>{if(!t||!pi(e.schema)){r(void 0);return}let a=!0,d=!1,s=e.graph,u=()=>{d||(d=!0,queueMicrotask(()=>{d=!1,a&&e.reread()}))},f=Hn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return gt(s,f.read),r(f),e.reread(),()=>{a=!1,gt(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Do(){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 le=_(Ce(),1),yi="graview:place-menu",_e=(0,l.createContext)(null),Wo=(0,l.createContext)("scene");function mi({mode:e,children:t}){return(0,le.jsx)(Wo.Provider,{value:e,children:t})}function gi(){return(0,l.useContext)(Wo)}var Fo={kind:"human"},hi=[],Si=[],wi=[],Dt=[];function Ko(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Fo,r=()=>Wn(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 vi={off:!0};function bi({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=hi,onSeat:d,people:s=Si,memory:u,presenceTtlMs:f,app:m,settings:p=m?.settings??wi,presence:g,brand:v,locale:k,timeZone:y,onKeepLens:b,providers:h,ai:E,files:P,resolveApp:D,history:C,linkedRecords:G,menuSections:x,keptViews:V,subscriptions:O,signIn:W,view:Z,onViewChange:X,children:$}){let de=(0,l.useContext)(_e),I=x??de?.menuSections,K=W??de?.signIn,Q=V??de?.keptViews,[Ee,fr]=(0,l.useState)(null),ue=Ee??i??a[0]?.principal??Fo,He=It(e,ue,C),Jt=He.past&&He.live===e?He.past.store:e,H=(0,l.useMemo)(()=>Jt.seenBy(ue),[Jt,ue]);Ko(e,ue);let[re]=(0,l.useState)(()=>Mo(u)),[Qt,pr]=(0,l.useState)(!1),en=(0,l.useCallback)(()=>pr(!0),[]),ie=(0,l.useMemo)(()=>g?[...p,...Oo]:p,[p,g]),[ct]=(0,l.useState)(()=>n??Wt(t,e.schema)),[yr,tn]=(0,l.useState)(()=>ze(ct??fe,r??ct?.selection??[])),Ae=(0,l.useRef)(ct??fe).current,[nn,mr]=(0,l.useState)(null),[on,gr]=(0,l.useState)(null),J=(0,l.useContext)(_e),[rn]=(0,l.useState)(()=>J?.seatTalk??Ot(v?.name??e.schema.kinds.join(","))),ft=E??J?.ai??xt,De=(0,l.useMemo)(()=>ft.off?vi:ft,[ft]),an=(0,l.useRef)(De.interactions);an.current=De.interactions;let[sn]=(0,l.useState)(()=>J?.aiDesk??Vt(()=>an.current)),[hr]=(0,l.useState)(()=>J?.subscriptions??Gn()),ln=O??J?.subscriptions??hr,pt=b??J?.onKeepLens,Ne=m??J?.app,je=k??J?.locale,Sr=v?.locale??Ne?.brand?.locale,Ge=y??J?.timeZone;_n({reader:je,app:Sr,readerTimeZone:Ge,appTimeZone:v?.timeZone??Ne?.brand?.timeZone});let dn=(0,l.useRef)(null),un=(0,l.useCallback)(c=>{dn.current=c},[]),cn=(0,l.useCallback)(c=>dn.current?.whereIs(c)??null,[]),[fn]=(0,l.useState)(()=>Lo()),[pn]=(0,l.useState)(()=>Do()),[yt,wr]=(0,l.useState)(null),[ke,yn]=(0,l.useState)(()=>new Map),Pe=(0,l.useRef)(ke);Pe.current=ke;let Re=(0,l.useRef)(null),mt=(0,l.useCallback)(c=>H.graph.getNode(c)?.kind,[H]),ee=(0,l.useCallback)(c=>{let S=_t(Pe.current,c,mt);Pe.current=S,yn(S),Re.current&&clearTimeout(Re.current),[...S.values()].some(T=>T.mode!=="docked"&&T.mode!=="asking")&&(Re.current=setTimeout(()=>{let T=_t(Pe.current,{type:"rest",at:Date.now(),holdMs:Gt},mt);Pe.current=T,yn(T)},Gt+20))},[mt]),mn=(0,l.useCallback)(c=>ee({...c,at:c.at??Date.now()}),[ee]),gn=(0,l.useCallback)(c=>{wr(c),c&&ee({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[ee,re]);(0,l.useEffect)(()=>H.subscribe((c,S)=>{for(let R of S)R.author.kind==="agent"&&ee({type:"write",author:R.author,ids:R.writes,at:Date.now()})}),[H,ee]),(0,l.useEffect)(()=>()=>{Re.current&&clearTimeout(Re.current)},[]);let z=(0,l.useMemo)(()=>({...ue,session:re}),[ue,re]),hn=Ho(H,G,z),Sn=(0,l.useCallback)(c=>{fr(c),d?.(c)},[d]),[Te,vr]=(0,l.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,Ao(c,u)])));(0,l.useEffect)(()=>{for(let c of ie)Po(c,Te[c.name]??c.initial)},[ie,Te]);let wn=(0,l.useCallback)((c,S)=>{let R=ie.find(T=>T.name===c);!R||!R.options.some(T=>T.value===S)||(ko(R,S,u),vr(T=>({...T,[c]:S})))},[ie,u]),[vn,br]=(0,l.useState)(null),{activity:bn,noteAttention:xn}=_o(H),En=(0,l.useCallback)(c=>{xn(c),ee({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[xn,ee]),ce=(0,l.useCallback)(c=>{if(ye(c)!==null||se(c).length>0||vt(c))return!0;let S=zn(c);return S?H.graph.allEdges().some(R=>R.kind===S.kind&&R.from===S.from&&R.to===S.to):H.graph.getNode(c)!==void 0},[H]),An=(0,l.useCallback)(c=>{let S=c.selection??Dt,R=S.filter(ce),T=R.length===S.length?c:ze(c,R);return T.focusId!==null&&!ce(T.focusId)&&(T=q(T,null)),T},[ce]),Me=(0,l.useCallback)(c=>{let S=An(c),R=Go(H,z,S.shown);if(S.focusId!==null&&R.size>0){let T=se(S.focusId),Cn=H.graph.getNode(S.focusId);(T.length>0?T.every(Ar=>R.has(Ar)):Cn?R.has(Cn.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let T=Ae.focusId!==null&&!ce(Ae.focusId)?Wt(t,e.schema)??{...fe,overview:!0}:Ae;T.focusId!==null&&ce(T.focusId)?S={...S,focusId:T.focusId}:T.overview===!0&&(S={...S,overview:!0})}return S},[An,ce,H,Ae,z,t,e.schema]),B=Me(Z??yr),kn=(0,l.useMemo)(()=>Go(H,z,B.shown),[H,z,B.shown]),Pn=(0,l.useMemo)(()=>[...H.modules.administered.entries()].map(([c,S])=>{let R=H.mayAdminister(c,z);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:R,shown:R&&(B.shown??[]).includes(c)}}),[H,z,B.shown]),Oe=(0,l.useCallback)(c=>{let S=R=>Me(typeof c=="function"?c(R):c);if(Z!==void 0){X?.(S(Z));return}X&&X(S(B)),tn(R=>S(R))},[B,X,Z,Me]);(0,l.useEffect)(()=>{Z===void 0&&tn(c=>{let S=Me(c);return S===c?c:S})},[B,Z,Me]);let Rn=B.selection??Dt,Tn=(0,l.useCallback)(c=>{Oe(S=>ze(S,typeof c=="function"?c(S.selection??Dt):c))},[Oe]),{who:Mn,following:On,follow:Vn,sayWhere:xr,sharing:In}=Vo({channel:g,store:H,view:B,principal:z,session:re,robots:ke,seatWho:yt,settingValues:Te,setView:Oe,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),Er=(0,l.useMemo)(()=>({store:H,scheme:o,views:t,view:B,setView:Oe,homeView:Ae,selection:Rn,setSelection:Tn,menuAt:nn,setMenuAt:mr,whereIs:cn,pointer:fn,motion:pn,registerScene:un,robots:ke,noteSeat:mn,seatWho:yt,registerSeatWho:gn,actsDoor:on,registerActsDoor:gr,seatTalk:rn,aiDesk:sn,...u?{memory:u}:{},who:Mn,following:On,follow:Vn,sayWhere:xr,sharing:In,session:re,ai:De,resolveApp:D,linkedRecords:G,menuSections:I,...Q?{keptViews:Q}:{},subscriptions:ln,signIn:K,linkedReads:hn,movedByHand:Qt,noteMoved:en,emphasis:vn,setEmphasis:br,activity:bn,noteAttention:En,principal:z,seats:a,people:s,takeSeat:Sn,settings:ie,settingValues:Te,chooseSetting:wn,hiddenKinds:kn,administered:Pn,...h?{providers:h}:{},...v?{brand:v}:{},...pt?{onKeepLens:pt}:{},app:Ne,...je?{locale:je}:{},...Ge?{timeZone:Ge}:{}}),[H,o,t,B,Oe,Rn,Tn,nn,cn,fn,pn,un,ke,mn,yt,gn,on,rn,sn,u,Mn,On,Vn,In,re,De,D,G,I,Q,ln,K,hn,Qt,en,vn,bn,En,z,a,s,Sn,ie,Te,wn,kn,Pn,h,v,pt,Ne,je,Ge]);return(0,le.jsx)(_e.Provider,{value:Er,children:(0,le.jsx)(Ie.Provider,{value:He,children:(0,le.jsx)(Pi,{children:P?(0,le.jsx)(Qe.Provider,{value:P,children:$}):$})})})}var Bo=(0,l.createContext)(null),Nt,jt=new Set,xi=e=>(jt.add(e),()=>void jt.delete(e)),No=()=>Nt;function Ei(e){if(!Nt){Nt=e;for(let t of[...jt])t()}}var Ai=300;function ki(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,Ai)),r===t?e(n,o):[]}}function Pi({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=oe(),s=ot(),u=n.q,f=n.focusId,m=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(xi,No,No),g=(0,l.useMemo)(()=>m&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,m,p]),v=f?t.graph.getNode(f)?.kind??ye(f)??(se(f).length===1?se(f)[0]:void 0):void 0,k=(0,l.useMemo)(()=>d.near&&ki(d.near),[d.near]),y=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...v?{inKind:v}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:k}),[t,u,r,o,i,a,f,v,g,k]),[b,h]=(0,l.useState)();return(0,l.useEffect)(()=>void y?.later?.then(E=>h([y,E])),[y]),(0,le.jsx)(Bo.Provider,{value:b?.[0]===y?b[1]:y,children:e})}var jo=new WeakMap;function ds(e){let t=jo.get(e);return t||jo.set(e,t=new Set(e.matched)),t}function Ri(){return(0,l.useContext)(Bo)}function oe(){let e=(0,l.useContext)(_e);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Ft(){return(0,l.useContext)(_e)??null}function ot(){let{store:e}=oe(),t=(0,l.useRef)(null),n=(0,l.useRef)(null),o=(0,l.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,l.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,l.useSyncExternalStore)(r,o,o)}function Ti(e){let{store:t}=oe(),n=(0,l.useCallback)(r=>t.subscribe(r),[t]),o=(0,l.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,l.useSyncExternalStore)(n,o,o)}function Go(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 Gt=2600;var qo=new WeakSet,Mi=e=>qo.has(e),Oi=e=>void qo.add(e);function Wt(e,t){let n=Bn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...fe,focusId:ne(n.place.kind),within:{view:n.place.as}}:{...fe,focusId:ne(n.kind)}}var $o=_(N(),1),Vi=(0,$o.createContext)(!1);var rt=Symbol.for("graview.default-view");function zo(e){return Object.defineProperty(e,rt,{value:!0,enumerable:!1}),e}function Uo(e){return typeof e=="function"&&e[rt]===!0}var it=Symbol.for("graview.replaces-page");function Yo(e){return Object.defineProperty(e,it,{value:!0,enumerable:!1}),e}function Zo(e){return typeof e=="function"&&e[it]===!0}var at=Symbol.for("graview.bleeds");function Xo(e){return Object.defineProperty(e,at,{value:!0,enumerable:!1}),e}function Jo(e){return typeof e=="function"&&e[at]===!0}function Ii(e){return Kn(e)}function Ci(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var F=_(N(),1),Y=_(Ce(),1),Kt=new Set,st=0;function tr(e){return()=>{st+=1;let t=e();return t.then(()=>void(st-=1),()=>void(st-=1)),t}}var _i=()=>st,nr=!1,or=!1,lt=new Set;function Li(){nr=!0}function Hi(){or=!0;for(let e of[...lt])e();lt.clear()}var rr=()=>or||!nr;function Di(e){return rr()?(e(),()=>{}):(lt.add(e),()=>void lt.delete(e))}var Qo=!1;function Bt(){for(let e of[...Kt])e()}function Ni(){Qo||typeof window>"u"||(Qo=!0,window.addEventListener("online",Bt))}function qt(e){let t,n=!1,o=!1,r,i=0,a=new Set,d=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Kt.delete(f),d(),g),g=>{throw r=void 0,o=!0,Kt.add(f),Ni(),d(),g});return p.catch(()=>{}),r=p,p}return{load:m,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let v=g.what??"This part";function k(h){(0,F.useSyncExternalStore)(s,u,u);let E=(0,F.useRef)(null),P=(0,F.useRef)(null),D=(0,F.useRef)(!1);return(0,F.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(D.current=!0),(0,F.useLayoutEffect)(()=>{if(!(!n||!D.current)){D.current=!1;for(let C=P.current?.nextElementSibling??null;C!==null;C=C.nextElementSibling){let G=C.matches(er)?C:C.querySelector(er);if(G instanceof HTMLElement){G.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[D.current?(0,Y.jsx)("span",{ref:P,hidden:!0}):null,p(t,h)]}):g.quiet?null:(0,Y.jsx)(ji,{what:v,button:E,...g.as?{as:g.as}:{}})}let y=(0,F.lazy)(tr(()=>m().then(()=>({default:k}),()=>({default:k}))));function b(h){let[E]=(0,F.useState)(()=>n||o);return(0,F.createElement)(E?k:y,h)}return b}}}var er="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function ji({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:Bt,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var Se=_(N(),1);function Gi(){let{selection:e,setSelection:t}=oe();return(0,Se.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function Wi(){let{store:e}=oe(),t=ot();return(0,Se.useMemo)(()=>Fi(e),[e,t])}var ir=new WeakMap;function Fi(e){let t=ir.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),ir.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Ki(){let{view:e,setView:t}=oe();return(0,Se.useMemo)(()=>({view:e,url:te(e),focus:n=>t(o=>q(o,n)),show:n=>t(o=>Un(o,n)),toggle:n=>t(o=>Ue(o,n)),go:n=>t(n)}),[e,t])}var he={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;he.at=typeof t?.graview=="number"?t.graview:0,he.at>he.depth&&(he.depth=he.at),he.tell()});var j=_(N(),1),zt={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"]}},Bi={position:"fixed",inset:"auto",margin:0,zIndex:jn("popover"),boxSizing:"border-box"},dt=6,we=8,qi=e=>typeof e.showPopover=="function";function ut(e){try{return e.matches(":popover-open")}catch{return!1}}function $i(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 Ut(e,t,n={}){let o=$i(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(),d=r.height-o.bottom-dt-we,s=o.top-dt-we,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),m=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,v=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();v&&p<=v.right-v.left&&(g<v.left?g=o.left+p<=v.right?o.left:v.left:g+p>v.right&&(g=o.right-p>=v.left?o.right-p:v.right-p));let k=p>=r.width-2*we?Math.max(0,(r.width-p)/2):Math.max(we,Math.min(g,r.width-we-p)),y=u?o.bottom+dt:Math.max(we,o.top-dt-m);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(y)}px`}function ar(e,t,n,o={}){let r=o.align??"end";(0,j.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(qi(i)&&!ut(i))try{i.showPopover(),Ui()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>Ut(i,n,{align:r})))};Ut(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",d),removeEventListener("scroll",d,!0),s?.disconnect(),i.isConnected&&ut(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Yt=new Set;function zi(e){return Yt.add(e),()=>Yt.delete(e)}function Ui(){for(let e of Yt)if(!(!e.isConnected||!ut(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ve=null,Yi='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Zi(e){for(let t of e.querySelectorAll(Yi))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var $t=()=>{let e=document.activeElement;return e===null||e===document.body};function Xi(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,j.useState)(!1),s=t.open??a,u=(0,j.useRef)(null),f=(0,j.useRef)(null),m=(0,j.useCallback)(h=>{u.current=h},[]),p=(0,j.useCallback)(h=>{f.current=h},[]),g=`graview-popover-${(0,j.useId)().replace(/:/g,"")}`,v=(0,j.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});v.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,j.useCallback)(h=>{v.current.controlled||d(h),v.current.onOpenChange?.(h)},[]),y=(0,j.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??v.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),b=(0,j.useCallback)(h=>{let E=f.current,P=typeof document>"u"?null:document.activeElement,D=P===null||P===document.body||E!==null&&E.contains(P);k(!1),!(!h||!D)&&(y(),requestAnimationFrame(()=>{$t()&&y()}))},[k,y]);return ar(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,j.useEffect)(()=>{if(!i||!s)return;let h={name:e,close:()=>b(!1)};if(ve&&ve.close!==h.close&&ve.close(),ve=h,zt[e].focus==="into"){let x=f.current;x&&!x.contains(document.activeElement)&&Zi(x).focus({preventScroll:!0})}let E=x=>{x.key==="Escape"&&b(!0)},P=x=>{let V=x.target;if(!(V instanceof Node))return;let O=f.current;if(O?.contains(V)||u.current?.contains(V))return;let W=V instanceof Element?V.closest('[role="dialog"], [role="alertdialog"]'):null;W&&!(O&&W.contains(O))||(b(!1),zt[e].focus==="into"&&requestAnimationFrame(()=>{($t()||O!==null&&O.contains(document.activeElement))&&y()}))},D=null,C=null,G=x=>{let V=x.target;if(!(V instanceof Element))return;let O=f.current,W=V.closest('[role="dialog"], [role="alertdialog"]');!W||O&&(O.contains(W)||W.contains(O))||(D=W,b(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",G),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",G);let x=D;x&&typeof MutationObserver<"u"&&(C?.disconnect(),C=new MutationObserver(()=>{x.isConnected||(C?.disconnect(),requestAnimationFrame(()=>{($t()||document.activeElement.closest("[hidden]")!==null)&&y()}))}),C.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>C?.disconnect(),10*6e4)),ve?.close===h.close&&(ve=null)}},[i,s,e,b,y]),{open:s,setOpen:h=>h?k(!0):b(!0),toggle:()=>s?b(!0):k(!0),trigger:{ref:m,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var be=_(N(),1);var sr=(0,be.createContext)(null);function Ji(){let e=(0,be.useContext)(sr),t=Ft(),n=(o,r,i)=>t?.setView(a=>ae(ae(pe(q(a,ne(o)),!1),"view",r),"filter",i?.filter??null));return(0,be.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>q(pe(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var xe=_(N(),1);var Qi=qt(Ke(()=>(__graviewPreload(import.meta.url,["./chunk.XWAMQPUM.js","./chunk.SDO3U72B.js","./chunk.AS4CQBOQ.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.4HYJHGI4.js"))));function ea(e,t,n){let o,r=!1,i=()=>{let{hidden:d,removed:s}=t.current();o||r||d.length+s.length===0||(o=()=>{},Qi.load().then(u=>{r||(o=u.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function ta(e,t){let[n,o]=(0,xe.useState)();return(0,xe.useEffect)(()=>t?ea(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var lr=_(N(),1),na=(0,lr.createContext)(!1);var dr=_(N(),1),oa=(0,dr.createContext)(null);var ur=_(N(),1),Zt='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Xt=e=>e instanceof HTMLElement&&(e.matches(Zt)||e.hasAttribute("tabindex")),Le=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function ra(e,t){let n=s=>s.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 d=e.querySelector(a);return d&&Xt(d)&&Le(d)?d:null}var ia=e=>e.isConnected&&Xt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Le(e);function cr(e,t){let n=t?ra(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Le(o))return o;for(let r of e.querySelectorAll(Zt))if(Le(r))return r;return Xt(e)&&Le(e)?e:null}function aa(e){(0,ur.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=y=>{let b=y.target;if(b instanceof Element){n=[];for(let h=b;h&&h!==t.parentElement;h=h.parentElement)n.push(h)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(y,b)=>void setTimeout(()=>d()&&b(),y),u=y=>void requestAnimationFrame(()=>d()&&y()),f=y=>{if(r=!1,i)return;let b=a.activeElement;if(!(!(b===null||b===a.body||b===a.documentElement)||n.length===0)){if(ia(n[0])){y&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let P=cr(E,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},m=(y,b=Date.now()+2500)=>{s(100,()=>{f(y);let h=a.activeElement;(h===null||h===a.body||h===a.documentElement)&&n.length>0&&Date.now()<b&&m(y,b)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),m(!1)})))},g=y=>{if(!(y instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(y.key))){if(!(y instanceof KeyboardEvent)){let b=y.target instanceof Element?y.target.closest(Zt):null,h=a.activeElement,E=h===null||h===a.body||h===a.documentElement;if(b&&E&&t.contains(b)){n=[];for(let P=b;P&&P!==t.parentElement;P=P.parentElement)n.push(P);s(150,()=>u(()=>{f(!1),m(!1)}));return}}!(y instanceof KeyboardEvent)&&!(y.target instanceof Node&&n[0]?.contains(y.target))||s(150,()=>u(()=>{f(!0),m(!0)}))}},v=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),k=y=>{y.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),v.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),v.disconnect()}},[e])}export{fe as a,te as b,$e as c,la as d,da as e,$n as f,qn as g,zn as h,St as i,q as j,Un as k,ae as l,pe as m,ze as n,Ve as o,Ue as p,Ze as q,wt as r,ye as s,fa as t,Pr as u,ne as v,Yn as w,se as x,Zn as y,Rr as z,pa as A,Xn as B,vt as C,Tr as D,Mr as E,Or as F,N as G,Ot as H,Zr as I,Jr as J,go as K,Qe as L,Qr as M,Ie as N,So as O,ei as P,It as Q,Ce as R,yi as S,mi as T,gi as U,Ko as V,bi as W,Ei as X,ds as Y,Ri as Z,oe as _,Ft as $,ot as aa,Ti as ba,Mi as ca,Oi as da,Wt as ea,sr as fa,Ji as ga,Vi as ha,zo as ia,Uo as ja,Yo as ka,Zo as la,Xo as ma,Jo as na,Ii as oa,Ci as pa,tr as qa,_i as ra,Li as sa,Hi as ta,rr as ua,Di as va,qt as wa,ta as xa,na as ya,oa as za,Gi as Aa,Wi as Ba,Ki as Ca,he as Da,aa as Ea,Bi as Fa,ut as Ga,ar as Ha,zi as Ia,Xi as Ja};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
react/cjs/react.production.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license React
|
|
7
|
-
* react.production.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*)
|
|
14
|
-
|
|
15
|
-
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
-
(**
|
|
17
|
-
* @license React
|
|
18
|
-
* react-jsx-runtime.production.js
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*)
|
|
25
|
-
*/
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{A as zt,B as Ae,C as ro,D as ct,E as pe,F as Wn,G as De,H as Ue,I as oo,J as Kn,K as Re,L as io,M as so,N,O as pt,P as wt,Q as lo,R as vt,S as Qt,T as co,U as ee,V as Zt,W as ae,X as Bn,a as V,b as we,c as _,d as jt,e as Hn,f as In,g as dt,h as Z,i as he,j as ne,k as A,l as J,m as U,n as Ge,o as ve,p as _t,q as Se,r as ie,s as to,t as ht,u as no,v as Fn,w as Dn,x as z,y as Fe,z as ao}from"./chunk.JF3GD4H5.js";import{a as Ie}from"./chunk.UR3XYOQ6.js";import{a as Qe,b as Yt,d as Y}from"./chunk.ONEYVLC2.js";import{b as Nn,c as Jr,d as eo}from"./chunk.WQONZBA3.js";import{a as Qr,d as Zr,e as Xr}from"./chunk.UGFDSE37.js";import{a as Ur,c as Vr,f as jr,g as _r,i as zr,j as Yr}from"./chunk.NWA7Q6CI.js";import{a as Nr,b as Hr,c as Ir,d as On}from"./chunk.WP5W44Y4.js";import{b as Or}from"./chunk.M5GJHVWZ.js";import{a as Fr,b as Dr,d as qt,e as Wr,f as Kr,g as Br,j as Gt}from"./chunk.HZCA3UWJ.js";import{a as Ut,b as Vt}from"./chunk.PXQVXBNG.js";import{a as Ht,b as za,c as Ya,d as It,e as Qa}from"./chunk.6QYJ2K6K.js";import{b as ar,c as mr,e as fr,f as Tn}from"./chunk.3MMLRSRC.js";import{a as Ln,b as gr}from"./chunk.DQOCBKC3.js";import{a as Kt,b as Bt,c as Mr,e as Er}from"./chunk.EPUBSKKL.js";import{a as lt,b as pr,e as ur}from"./chunk.ATDU5Y7V.js";import{m as $r}from"./chunk.BCWPV4WR.js";import{a as hr,b as wr,c as vr,e as Tr,f as $n,h as Wt}from"./chunk.PKUDIWIF.js";import{d as br,e as xr,f as Pr,g as Cr,n as Ar,o as Rr,q as Lr,s as Dt}from"./chunk.VW2VCPJX.js";import{a as Mn}from"./chunk.UKAPFIPJ.js";import{a as An,b as tr,c as nr}from"./chunk.UT6642FC.js";import{a as yr}from"./chunk.IW7YFPGG.js";import{c as or,d as ir,e as sr,f as lr,j as yt,k as dr}from"./chunk.ZIEHF67C.js";import{a as rr}from"./chunk.UHX4WTM7.js";import{r as Rn,s as cr}from"./chunk.6MADC6DM.js";import{g as Ft}from"./chunk.HDRD33II.js";import{b as Za,c as Xa,d as Ja,e as er}from"./chunk.DX357TZ3.js";import{C as En,K as qr,N as Gr,e as ja,f as _a,j as Zo,u as Sr,v as kr}from"./chunk.XSNAG4JT.js";import{$ as oe,Ea as Va,G as He,L as Ha,N as Ia,Q as Fa,R as G,S as Cn,V as Da,W as Wa,_ as Ka,ca as Ba,da as qa,fa as Ga,ja as st,la as Ua,na as Ot,qa as Nt,r as Na,v as Ne}from"./chunk.XWAMQPUM.js";import{a as Oa}from"./chunk.SDO3U72B.js";import{$c as Ma,J as wa,U as ft,Vc as xn,Wb as Aa,Xa as xa,Za as Pa,Zb as Ra,_b as La,_c as Et,ba as it,bd as $t,ca as ce,ea as ze,fa as Tt,gb as bn,ha as qe,hb as Ca,ja as va,ka as Sa,kd as Pn,la as Ye,ld as Ea,qb as Mt,qd as $a,vc as Ta,wa as ka,xa as ba}from"./chunk.AS4CQBOQ.js";import{b as I}from"./chunk.AJZBJBMO.js";function po(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=s=>ce(e.schema.tryDefinition(s.kind),s),l=new Map;for(let s of e.graph.allEdges()){let d=s.from===t?"out":s.to===t?"in":null;if(!d)continue;let c=d==="out"?s.to:s.from,p=e.graph.getNode(c);if(!p)continue;let w=(d==="out"?r:e.schema.tryDefinition(p.kind))?.edges?.[s.kind],g=d==="in"?w?.inverse??w?.description:w?.description,L=`${s.kind}|${d}|${g??""}`;(l.get(L)??(()=>{let x={edgeKind:s.kind,direction:d,...g?{description:g}:{},targets:[]};return l.set(L,x),x})()).targets.push({id:p.id,kind:p.kind,label:o(p)})}return{id:t,kind:a.kind,label:o(a),fields:Ja(yt(e.schema,e.graph,a),r),violations:bn(e.violations(n.context),[t]),actions:Mn(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...l.values()].map(s=>{let d=Za(s.targets.flatMap(c=>{let p=e.graph.getNode(c.id);return p?[p]:[]}),c=>e.schema.tryDefinition(c));return{...s,targets:[...s.targets].map(c=>d.has(c.id)?{...c,apart:d.get(c.id)}:c).sort((c,p)=>c.label.localeCompare(p.label))}})}}function Ze(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:Mn(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function uo(e,t){let n=(o,l)=>`${o}|${JSON.stringify(l)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let l=n(o.mutation,o.args);a.has(l)||a.set(l,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...t].map((o,l)=>({repair:o,declared:l})).sort((o,l)=>(a.get(n(o.repair.mutation,o.repair.args??{}))??r)-(a.get(n(l.repair.mutation,l.repair.args??{}))??r)||o.declared-l.declared).map(o=>o.repair)}function Xe(e){let t=e.schema.kinds.map(r=>({kind:r,plural:qe(e.schema,r),count:e.graph.nodesOfKind(r).length})),n=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),l=e.graph.getNode(r.to);if(!o||!l)continue;let s=`${r.kind}|${o.kind}|${l.kind}`;n.set(s,(n.get(s)??0)+1)}let a=[];for(let{kind:r}of t){let o=e.schema.tryDefinition(r)?.edges??{};for(let[l,s]of Object.entries(o)){let d=s.to==="*"||s.to===void 0?(()=>{let c=[...n.keys()].filter(p=>p.startsWith(`${l}|${r}|`)).map(p=>p.split("|")[2]);return c.length>0?c:["*"]})():s.to;for(let c of d)a.push({edgeKind:l,from:r,to:c,...s.description?{description:s.description}:{},...s.inverse?{inverse:s.inverse}:{},count:n.get(`${l}|${r}|${c}`)??0})}}return{kinds:t,relations:a}}var We=I(He(),1);var St=I(He(),1);var Le=I(G(),1),Jo={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},ei=e=>{try{return decodeURIComponent(e)}catch{return e}};function ti(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[l="/",s=""]=t.split("#")[0].split("?"),d=(b,$,j)=>({label:b,href:`${o}${$}`,path:$,...j?{current:j}:{}}),c=b=>{let $=n.registry?.sectionOf(b);return $?[$.path===void 0?{label:$.label}:d($.label,$.path)]:[]},p=b=>n.registry?.sectionOf(b)?.label,S=b=>{let $=p(b);return $===void 0?{}:{section:$}},[w,g,...L]=l.split("/").filter(Boolean).map(ei);if(w===void 0)return{as:"home",label:"Home",trail:[d("Home","/",!0)]};if(w==="places"&&g!==void 0&&L.length===0){let b=new URLSearchParams(s).get("of"),$=new Set(Fe(a,e.principal)),j=e.views?.places()??[],C=j.find(D=>$.has(D.kind)&&D.as===g&&(!b||V(r,D.kind)===b));if(C){let D=jt(C.as,Et(C,j)?V(r,C.kind):void 0);return{as:"place",kind:C.kind,label:C.title,...S(C.kind),trail:[...c(C.kind),d(C.title,D,!0)]}}}let H=L.length===0?we(r,w):void 0;if(H!==void 0){let b=d(qe(r,H),`/${V(r,H)}`);if(g===void 0)return{as:"list",kind:H,label:b.label,...S(H),trail:[...c(H),{...b,current:!0}]};let $=a.graph.getNode(g),j=$&&$.kind===H?ce(r.tryDefinition(H),$):"Nothing lives here";return{as:"record",kind:H,id:g,label:j,...S(H),trail:[...c(H),b,d(j,_(r,H,g),!0)]}}let x=Jo[w]??ni((L.at(-1)??g??w).replace(/[-_]+/g," "));return{as:"page",label:x,trail:[d(x,l,!0)]}}var ni=e=>e.charAt(0).toUpperCase()+e.slice(1),qn=(0,St.createContext)(null);function ai(e){let t=pe(),n=ct("/");return Y(e.context.store),ti(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var ri={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},go={display:"flex",alignItems:"center",gap:6,minWidth:0},mo={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function ut({context:e,style:t}){let n=(0,St.useContext)(qn),a=(0,St.useContext)(wt);return vt(a??ii,"trail")||n?.registry?.without().has("trail")?null:(0,Le.jsx)(oi,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function oi({root:e,context:t,style:n}){let a=ai(e);return a.trail.length<2?null:(0,Le.jsx)(si,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var ii={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function si({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Le.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Le.jsx)("ol",{style:{...he,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,l)=>(0,Le.jsxs)("li",{style:o.current?ri:{...go,flexShrink:l===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[l>0&&!o.current?(0,Le.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Le.jsxs)(N,{to:o.path,style:{...ve,...go},...l===r?{"data-testid":"trail-list"}:{},children:[l===r&&t?(0,Le.jsx)(ie,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Le.jsx)("span",{style:mo,children:o.label})]}):(0,Le.jsx)("span",{style:mo,children:o.label})]},`${l}:${o.label}`))})})}var R=I(G(),1);function Te(e){let t=e.views;if(!t)return[];let n=new Set(Fe(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function Xt(e,t){if(!t.over)return[t.kind];let n=new Set(Fe(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var Je=e=>`place:${e.kind}:${e.as}`;function ue(e,t){return jt(t.as,Et(t,e.views?.places()??[])?V(e.store.schema,t.kind):void 0)}function kt(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>it(n,a))}function Gn(e,t,n){let a=(o,l)=>Tt(e.schema,l,o),r=(typeof t=="string"?[t]:t).map(o=>a(kt(e,o).length,o)).join(" and ");return n?`${r} across ${a(kt(e,n).length,n)}`:r}function Un({context:e,place:t,chosen:n,filter:a}){let{store:r,views:o,invariantContext:l}=e,d=o?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view,c=[...new Set(r.violations(l).flatMap(w=>w.nodeIds))],p=Xt(e,t).flatMap(w=>kt(r,w));if(!d)return null;let S=li(r,p,a,c);return(0,R.jsx)(Rn,{kind:t.kind,view:t.title,children:(0,R.jsx)(d,{nodes:S,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})}function li(e,t,n,a){let r=n?$t({filter:n}).filter??[]:[];return r.length===0?t:Wt(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function di({store:e,views:t,as:n,invariantContext:a}){Y(e);let r={store:e,views:t,...a?{invariantContext:a}:{}},o=t.places().find(l=>l.as===n);return o?(0,R.jsx)(Un,{context:r,place:o}):null}function ci({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=kt(n,t),l=n.schema.tryDefinition(t),s=z(n,t),c=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,p=[...new Set(n.violations(r).flatMap(L=>L.nodeIds))];if(c&&!st(c))return(0,R.jsx)(Rn,{kind:t,children:(0,R.jsx)(c,{nodes:o,label:s,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...p.length>0?{flagged:p}:{}})});let S=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,w=8,g=o.slice(0,w);return(0,R.jsxs)("div",{"data-testid":"kind-sheet",style:S?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[g.map(L=>S?(0,R.jsx)(S,{node:L,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...p.includes(L.id)?{flagged:[L.id]}:{}},L.id):(0,R.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:ce(l,L)},L.id)),o.length>w?(0,R.jsxs)("span",{style:{...A,alignSelf:"center",padding:"0 6px"},children:["+",o.length-w," more ",s.toLowerCase()]}):null]})}function Vn(e){let{store:t}=e,n=ao(e),a=Te(e),r=e.views?.arrangement?.()?.order??[],o=d=>{let c=d.name===void 0?-1:r.indexOf(`view:${d.name}`);return c>=0?c-r.length:n.indexOf(d.kind)},l=xn([...a].sort((d,c)=>o(d)-o(c))).filter(d=>!d.hidden),s=new Set(l.flatMap(d=>d.over??[d.kind]));return[...l.map(d=>({key:Je(d),kind:d.kind,title:Ma(d,a,t.schema),to:ue(e,d),place:d})),...zt(e).filter(d=>!s.has(d)).map(d=>({key:`kind:${d}`,kind:d,title:z(t,d),to:`/${V(t.schema,d)}`}))]}var fo=.72,pi=540,yo=16/10;function ui(e){let t=(0,We.useRef)(null),[n,a]=(0,We.useState)(e);return(0,We.useLayoutEffect)(()=>{let r=t.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let s=r.getBoundingClientRect().width;s>0&&a(d=>Math.abs(d-s)<.5?d:s)};o();let l=new ResizeObserver(o);return l.observe(r),()=>l.disconnect()},[]),{ref:t,width:n}}function gi(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function mi(e){let[t,n]=(0,We.useState)(()=>typeof IntersectionObserver>"u");return(0,We.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&(r.disconnect(),n(!0))},{root:gi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function jn({context:e,entry:t}){let{store:n,brand:a,principal:r}=e,{ref:o,width:l}=ui(pi),s=mi(o),d=l/fo,c=kt(n,t.kind),p=n.schema.tryDefinition(t.kind),S=c.length===0?Ze(n,t.kind,{...r?{principal:r}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,w=t.place!==void 0;return(0,R.jsxs)(N,{to:t.to,"data-testid":w?"place-card":"kind-card",className:"graview-gallery-card",style:{...ve,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,R.jsxs)("span",{ref:o,"data-testid":w?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${yo}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,R.jsx)("span",{style:{position:"absolute",left:0,top:0,width:d,height:d/yo,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${fo})`,transformOrigin:"0 0"},children:s?(0,R.jsx)(qt.Provider,{value:null,children:t.place?(0,R.jsx)(Un,{context:e,place:t.place}):(0,R.jsx)(ci,{context:e,kind:t.kind})}):null}),c.length===0?(0,R.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,R.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,R.jsxs)("span",{style:{fontFamily:In,fontWeight:"var(--graview-weight-display)"},children:["No ",z(n,t.kind).toLowerCase()," yet"]}),S?(0,R.jsxs)("span",{style:A,children:["Begin with \u201C",S.label,"\u201D"]}):null]})}):null]}),(0,R.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,R.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[w?null:(0,R.jsx)(ie,{kind:t.kind,brand:a,schema:n.schema,size:8}),(0,R.jsx)("span",{style:{fontFamily:In,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:t.title})]}),(0,R.jsxs)("span",{style:A,children:[t.place?Gn(n,Xt(e,t.place),t.place.across):Gn(n,t.kind),!w&&p?.description?` \xB7 ${p.description}`:null]})]})]})}var ho={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},fi=`
|
|
2
|
-
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
3
|
-
.graview-gallery-card:hover > span:first-child,
|
|
4
|
-
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
5
|
-
`;function _n({context:e}){Y(e.store);let t=Vn(e);return t.length===0?null:(0,R.jsxs)("section",{style:ho,"data-testid":"gallery",children:[(0,R.jsx)("style",{children:fi}),t.map(n=>(0,R.jsx)(jn,{context:e,entry:n},n.key))]})}function zn({context:e}){let{store:t}=e;Y(t);let n=xn(Te(e)).filter(r=>!r.hidden),a=Vn(e);return(0,R.jsxs)(ee,{context:e,style:dt,children:[(0,R.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,R.jsx)("p",{style:he,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,R.jsx)(ae,{context:e,children:"Pictures"}),(0,R.jsx)("p",{style:ne,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,R.jsx)("div",{style:ho,"data-testid":"places",children:a.map(r=>(0,R.jsx)(jn,{context:e,entry:r},r.key))}):null]})}var yi={lede:!0},hi={lede:!1},wi={...ne,textWrap:"pretty"};function vi(e,t){if(t===void 0)return;let[n]=lr(sr([t]),dr(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function Yn({context:e}){let{store:t,principal:n}=e;Y(t);let a=Ue(),r=De(),[o]=pt(),l=decodeURIComponent(a.as??""),[s,d]=(0,We.useState)(null),c=o.get("of"),p=o.get("filter"),w=Te(e).find(C=>C.as===l&&(!c||V(t.schema,C.kind)===c));if(!w)return(0,R.jsxs)(ee,{context:e,children:[(0,R.jsx)(ae,{context:e,children:"No picture is called that."}),(0,R.jsx)("p",{style:ne,children:(0,R.jsx)(N,{to:"/places",style:Ge,children:(0,R.jsx)(Qe,{children:"The pictures there are"})})})]});let g=z(t,w.kind),L=e.views?.resolve(w.kind,{cardinality:"many",fidelity:"full"},w.as)?.view,H=L?.flows===!0,x=L?.creates!==!1,b=vi(e,L?.lede),$=Ze(t,w.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}),j=x?$.actions.affordances.map(C=>({affordance:C,mutation:t.allMutations().find(D=>D.name===C.mutation)})).filter(C=>C.mutation!==void 0):[];return(0,R.jsxs)(ee,{context:e,style:{...dt,gap:"var(--graview-space-6, 32px)"},children:[(0,R.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,R.jsx)(ut,{context:e}),(0,R.jsx)(ae,{context:e,children:w.title}),(0,R.jsx)("p",{style:wi,"data-testid":"place-lede",...b!==void 0?{"data-graview-lede":"headline"}:{},children:b??`${Gn(t,Xt(e,w),w.across)}.`}),p&&!H?(0,R.jsxs)("p",{style:{...A,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(C=>C.replace(":"," is ")).join(" and ")}. `,(0,R.jsx)(N,{to:`?${(()=>{let C=new URLSearchParams(o);return C.delete("filter"),C.toString()})()}`,style:{...U,...A},children:"Show all"})]}):null,(0,R.jsx)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Xt(e,w).map((C,D)=>(0,R.jsx)(N,{to:`/${V(t.schema,C)}`,style:{...Ge,...A},...D===0?{"data-testid":"place-as-list"}:{},children:(0,R.jsxs)(Qe,{children:["All ",(C===w.kind?g:z(t,C)).toLowerCase()," as a list"]})},C))})]}),(0,R.jsx)("div",{"data-testid":"place-lens","data-flows":H?"":void 0,style:H?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:C=>{let D=C.target?.closest("[data-graview-pick]"),le=D?.getAttribute("data-graview-pick"),be=D?.getAttribute("data-graview-joins");if(be)try{let X=JSON.parse(be);if(Array.isArray(X)&&X.every(de=>typeof de=="string")){C.preventDefault(),d({at:Je(w),ids:X});return}}catch{}if(!le)return;let fe=t.graph.getNode(le);fe&&(C.preventDefault(),r(_(t.schema,fe.kind,le)))},children:(0,R.jsx)(Br.Provider,{value:b!==void 0?yi:hi,children:(0,R.jsx)(Un,{context:e,place:w,filter:p,...s?.at===Je(w)?{chosen:s.ids}:{}})})}),j.length>0?(0,R.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:j.map(({affordance:C,mutation:D})=>(0,R.jsxs)("section",{style:{...J,display:"grid",gap:14},children:[(0,R.jsx)("h2",{style:Z,children:D.title??D.name}),D.description?(0,R.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:D.description}):null,(0,R.jsx)(Ie,{store:t,mutation:D,prefilled:C.args,open:C.open,label:C.label,...n?{principal:n}:{}})]},C.id))}):null]})}function Si(e,t=document){let n=Ut(e);if(!n)return null;let a=[t,...[...t.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let l=o.getAttribute("data-section")??o.id;if(l===e||Ut(l)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(Ut(o.textContent??"")===n)return o;return null}function wo(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=Si(e,t.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var q=I(He(),1);var Jt=I(He(),1);var et=I(G(),1);function vo({context:e}){return oe()?(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(ki,{context:e}),(0,et.jsx)(Vr,{face:"pages",on:e.quickAsk??!0})]}):null}function ki({context:e}){let{store:t}=e,n=oe(),{pathname:a}=pe(),r=(0,Jt.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,Jt.useEffect)(()=>{let o=r.current;if(!o)return;let[,l,s]=a.split("/"),d=(()=>{if(l==="places"){let p=e.views?.places().find(S=>S.as===decodeURIComponent(s??""));return p?[Ne(p.kind)]:[]}let c=l?we(t.schema,l):void 0;return c&&s?[decodeURIComponent(s)]:c?[Na(c)]:[]})();o(c=>c.length===d.length&&c.every((p,S)=>p===d[S])?c:d)},[a]),null}var ge=I(He(),1);var ko=I(Zo(),1);var se=I(G(),1);var bi=(0,ge.lazy)(Nt(Oa(()=>(__graviewPreload(import.meta.url,["./chunk.ONEYVLC2.js","./chunk.WQONZBA3.js","./chunk.UGFDSE37.js","./chunk.NWA7Q6CI.js","./chunk.WP5W44Y4.js","./chunk.M5GJHVWZ.js","./chunk.HZCA3UWJ.js","./chunk.JBW3DI7E.js","./chunk.AGIO2GRV.js","./chunk.NIVTK2W5.js","./chunk.6QYJ2K6K.js","./chunk.3MMLRSRC.js","./chunk.DQOCBKC3.js","./chunk.OHSJQYJN.js","./chunk.DEUTHHGI.js","./chunk.EPUBSKKL.js","./chunk.ATDU5Y7V.js","./chunk.AQQZY6OY.js","./chunk.BCWPV4WR.js","./chunk.Y5ARSVH4.js","./chunk.PKUDIWIF.js","./chunk.VW2VCPJX.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.ZIEHF67C.js","./chunk.UHX4WTM7.js","./chunk.IKX4VDTW.js","./chunk.RNEJYIQ7.js","./chunk.TBQOSI4J.js","./chunk.KWQ7QOHD.js","./chunk.GZHZLJBF.js","./chunk.6MADC6DM.js","./chunk.OJGHDWI6.js","./chunk.JLEC3USG.js","./chunk.HDRD33II.js","./chunk.DX357TZ3.js","./chunk.H7KCWCB4.js","./chunk.XSNAG4JT.js","./chunk.XWAMQPUM.js","./chunk.SDO3U72B.js","./chunk.AS4CQBOQ.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ITYQUSZI.js")).then(e=>({default:e.TakeBack})))));function xi({context:e,docked:t,at:n,...a}){let{store:r}=e,o=Y(r),[l]=(0,ge.useState)(()=>r.batches().length),s=(0,ge.useRef)(!1);return s.current||=o>0||!t&&l>0,s.current?(0,se.jsx)(ge.Suspense,{fallback:null,children:(0,se.jsx)(bi,{context:e,docked:t,at:n,since:l,...a})}):null}function Pi(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,ge.useEffect)(()=>{if(!n)return;let l=s=>{if(!Xr(s))return;let d=s.target,c=d instanceof Node&&t.current?.contains(d),p=d===document.body||d===document.documentElement||d===document;if(!(!c&&!(p&&!o))&&Qr(a,r)){s.preventDefault();try{Zr(a,r)}catch{}}};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[a,r,o,t,n])}function bo({context:e,registry:t,root:n,children:a}){let r=(0,ge.useMemo)(lo,[]),o=t?.without()??new Set;return Pi(e,n,!o.has("undo")),(0,se.jsxs)(wt.Provider,{value:r,children:[(0,se.jsx)(Ci,{context:e,placed:r,without:o}),a]})}function Ci({context:e,placed:t,without:n}){let[a,r]=(0,ge.useState)(!1);(0,ge.useLayoutEffect)(()=>r(!0),[]);let o=vt(t,"find"),l=vt(t,"undo"),s=pe(),d=kr();if(!a)return null;let c=s.pathname.split("/").filter(Boolean),S=(c.length===1?we(e.store.schema,c[0]):void 0)!==void 0;return(0,se.jsxs)(se.Fragment,{children:[!o&&!n.has("find")&&d?(0,ko.createPortal)((0,se.jsx)(So,{context:e,narrowsLists:S}),d.slot):null,!o&&!n.has("find")&&!d?(0,se.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,se.jsx)(So,{context:e,narrowsLists:S})}):null,!l&&!n.has("undo")?(0,se.jsx)(xi,{context:e,docked:!0,at:s.pathname+s.search}):null,d?.own&&!n.has("undo")?(0,se.jsx)(ro,{context:e,own:d.own}):null]})}function So({context:e,narrowsLists:t}){return(0,se.jsx)(wt.Provider,{value:null,children:(0,se.jsx)(Bn,{context:e,narrowsLists:t})})}var Q=I(He(),1);var ke=I(G(),1),Ai=500,Ri=10;function en(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Li(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function xo(e){let t=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(t)return t;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Po({context:e,root:t,children:n}){return oe()===null?(0,ke.jsx)(ke.Fragment,{children:n}):(0,ke.jsx)(Ti,{context:e,root:t,children:n})}function Ti({context:e,root:t,children:n}){let{setMenuAt:a}=Ka(),{store:r}=e,o=r.schema,l=De(),{pathname:s,search:d}=pe(),c=ct("/").replace(/\/$/,""),p=(0,Q.useCallback)((h,m)=>e.views?.places().find(T=>T.as===h&&(m===null||T.kind===m)),[e.views]),S=(0,Q.useCallback)((h,m)=>{let[T="",E,te]=h.split("/").filter(Boolean).map(P=>{try{return decodeURIComponent(P)}catch{return P}});if(te!==void 0)return null;if(T==="places"&&E!==void 0){let P=p(E,new URLSearchParams(m).get("of"));return P?{face:"pages",place:P.as,about:[Ne(P.kind)],title:P.title}:null}let u=we(o,T);return u?E===void 0?{face:"pages",about:[Ne(u)],title:qe(o,u)}:r.graph.getNode(E)?{face:"pages",on:E,about:[E]}:null:null},[o,r,p]),w=(0,Q.useCallback)(h=>{let m=h.href;try{let T=new URL(m,location.href);if(T.origin===location.origin&&(c===""||T.pathname===c||T.pathname.startsWith(`${c}/`))){let E=S(T.pathname.slice(c.length),T.search);if(E)return{...E,href:m}}}catch{}return{face:"pages",about:[],href:m}},[c,S]),g=(0,Q.useCallback)(()=>S(s,d)??{face:"pages",about:[]},[S,s,d]),L=(0,Q.useCallback)(h=>{let m=g(),T=h.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(T&&m.on!==void 0&&h.closest("[data-graview-pick], a[href]")===null)return{...m,field:T};let E=h.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(E)return{...m,act:E};let te=h.closest("a[href]"),u=h.closest("[data-graview-listed]"),P=[h.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),u&&(!te||u.contains(te)&&te.classList.contains("graview-spec-item-link"))?u.getAttribute("data-graview-listed"):null].map(ye=>ye?r.graph.getNode(ye):void 0).find(Boolean);if(P)return{face:"pages",on:P.id,about:[P.id],href:`${c}${_(o,P.kind,P.id)}`};if(te)return w(te);let B=h.closest("[data-graview-record]")?.getAttribute("data-graview-record");return B&&r.graph.getNode(B)?{face:"pages",on:B,about:[B]}:m},[g,w,r,o,c]),H=(0,Q.useCallback)(h=>{let m=t.current;if(m===null||!m.contains(h)||en(h)||h.closest("[data-graview-popover]"))return null;let T=L(h);return{face:"pages",on:T.on,about:T.about??[],field:T.field,place:T.place,href:T.href,act:T.act,element:xo(h)}},[L,t]),x=(0,Q.useCallback)((h,m,T)=>{let E=L(h);a({...E,x:Math.round(m),y:Math.round(T),returnTo:xo(h)})},[L,a]),b=(0,Q.useCallback)(h=>{let m=h.getBoundingClientRect();x(h,m.left+Math.min(16,m.width/2),Math.min(m.bottom,m.top+36))},[x]),$=(0,Q.useRef)(0),j=(0,Q.useRef)(null),C=(0,Q.useRef)(!1),D=()=>{j.current&&clearTimeout(j.current.timer),j.current=null};(0,Q.useEffect)(()=>D,[]),(0,Q.useEffect)(()=>{let h=m=>{if(m.defaultPrevented||!(m.key==="ContextMenu"||m.key==="F10"&&m.shiftKey))return;let T=t.current,E=m.target instanceof Element?m.target:null,te=E===null||E===document.body||E===document.documentElement,u=T!==null&&E!==null&&T.contains(E);if(!u&&!(te&&document.querySelector("[data-graview-face='pages']")===T)||en(E)||E?.closest("[data-graview-popover]"))return;m.preventDefault(),$.current=Date.now();let P=u&&E instanceof HTMLElement?E:T?.querySelector("[data-graview-page-title], main h1, main")??null;P&&b(P)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[t,b]),(0,Q.useEffect)(()=>{let h=t.current;if(!h)return;let m=T=>{let E=T.detail;E&&a({...E,face:"pages"})};return h.addEventListener(Cn,m),()=>h.removeEventListener(Cn,m)},[t,a]);let le=(0,Q.useMemo)(()=>h=>{if(h.face!=="pages")return null;let m=[],T=h.on===void 0?void 0:r.graph.getNode(h.on),E=h.place===void 0?void 0:e.views?.places().find(Ee=>Ee.as===h.place),te=T?void 0:h.about.length===1&&h.about[0].startsWith("aggregate:")&&!E?Mi(h.about[0]):void 0,u=T?_(o,T.kind,T.id):E?ue(e,E):te?`/${V(o,te)}`:void 0,P=u!==void 0&&s===u.split("?")[0];u!==void 0&&!P&&m.push({id:"open",label:"Open",run:()=>l(u)});let B=u!==void 0?`${c}${u}`:h.href;B!==void 0&&m.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(B,"_blank","noopener")});let ye=T?`#focus=${encodeURIComponent(T.id)}`:E?`#focus=${encodeURIComponent(Ne(E.kind))}&view=${encodeURIComponent(E.as)}`:te?`#focus=${encodeURIComponent(Ne(te))}`:void 0;if(ye!==void 0&&(e.overview||!e.embedded)){let Ee=e.overview;m.push({id:"in-the-scene",label:"Show in the scene",run:()=>Ee?Ee(ye):location.assign(`${e.sceneHref??"/"}${ye}`)})}return T===void 0&&h.href===void 0&&m.push({id:"find",label:"Find\u2026",run:()=>{let Ee=t.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');Ee&&Ee.offsetParent!==null?Ee.focus():l("/search")}}),m.length>0?{id:"pages",items:m}:null},[r,o,e,s,c,l,t]),be=(0,Q.useMemo)(()=>h=>{if(h.face!=="pages"||h.field===void 0||h.on===void 0)return null;let m=r.graph.getNode(h.on),T=h.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(h.field)}"]`);return!m||!(T instanceof HTMLElement)||!T.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${va(o.tryDefinition(m.kind),h.field)}\u201D`,run:()=>T.click()}]}},[r,o,t]),fe=_r(),X=mr(),de=Or(),Ke=(0,Q.useCallback)((h,m)=>{s===ue(e,h).split("?")[0]&&l(m?ue(e,m):"/")},[s,e,l]),xe=Yr(Ke),Pe=(0,Q.useMemo)(()=>[be,de,le,...xe?[xe]:[],...X?[X]:[],...fe?[fe]:[]],[be,de,le,xe,X,fe]);return(0,ke.jsxs)(cr,{sections:Pe,children:[(0,ke.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:h=>{let m=h.target;h.shiftKey||en(m)||Li(m)||(h.preventDefault(),!m.closest("[data-graview-popover]")&&(Date.now()-$.current<700||(h.clientX===0&&h.clientY===0&&m instanceof HTMLElement?b(m):x(m,h.clientX,h.clientY))))},onPointerDown:h=>{if(C.current=!1,h.pointerType==="mouse"||!h.isPrimary)return;let m=h.target;if(en(m)||m.closest("[data-graview-choose], [data-graview-popover]"))return;D();let{clientX:T,clientY:E}=h;j.current={x:T,y:E,timer:setTimeout(()=>{j.current=null,C.current=!0,$.current=Date.now(),x(m,T,E)},Ai)}},onPointerMove:h=>{let m=j.current;m&&Math.hypot(h.clientX-m.x,h.clientY-m.y)>Ri&&D()},onPointerUp:D,onPointerCancel:D,onClickCapture:h=>{C.current&&(C.current=!1,h.preventDefault(),h.stopPropagation())},children:n}),(0,ke.jsx)(Ei,{openAt:b,readyAt:H}),(0,ke.jsx)(zr,{placement:"page"}),(0,ke.jsx)(fr,{})]})}function Mi(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function Ei({openAt:e,readyAt:t}){return(0,ke.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,ke.jsx)(Ur,{placement:"menu",openActs:e,aimAt:t})})}var W=I(G(),1);function Co(e,t){return t==="*"?{label:"anything",path:null}:{label:z(e,t),path:`/${V(e.schema,t)}`}}function $i({context:e,relation:t}){let{store:n}=e,a=Co(n,t.from),r=Co(n,t.to),o=l=>l.path?(0,W.jsx)(N,{to:l.path,style:{...ve,fontWeight:550},children:l.label}):(0,W.jsx)("span",{children:l.label});return(0,W.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,W.jsx)(jr,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,W.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,W.jsxs)("span",{children:[o(a)," ",(0,W.jsxs)("span",{style:A,"data-graview-speaks-ids":"",children:[ze(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,W.jsxs)("span",{style:A,children:[t.description?Ae(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,W.jsx)(N,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{...U,...A,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:t.count}):(0,W.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function Ao({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Fe(n,e.principal)),r=Xe(n).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,W.jsxs)("section",{style:{...J,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,W.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,W.jsx)("h2",{style:Z,children:(0,W.jsx)(N,{to:"/map",style:ve,children:"Connections"})}),(0,W.jsx)("span",{style:A,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,W.jsx)($i,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function Qn({context:e}){let{store:t}=e;Y(t);let n=new Set(Fe(t,e.principal)),a=Xe(t),r=a.relations.filter(o=>n.has(o.from));return(0,W.jsxs)(ee,{context:e,children:[(0,W.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,W.jsx)("p",{style:he,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,W.jsx)(ae,{context:e,children:"Connections"}),(0,W.jsx)("p",{style:ne,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>n.has(o.kind)).map(o=>(0,W.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,W.jsx)(ie,{kind:o.kind,brand:e.brand,schema:t.schema,size:7}),(0,W.jsx)(N,{to:`/${V(t.schema,o.kind)}`,style:U,children:o.plural}),(0,W.jsx)("span",{style:A,children:o.count})]},o.kind))}),(0,W.jsx)(Ao,{context:e,heading:!1})]})}function Ro({context:e}){let n=[...oe()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=e;return(0,W.jsxs)("section",{style:{...J,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,W.jsx)("h2",{style:Z,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,W.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,W.jsx)("span",{children:r.say}),o?(0,W.jsxs)(N,{to:_(a.schema,o.kind,o.id),style:{...U,...A},children:[ce(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}var K=I(G(),1);function Zn({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:r}=e;Y(n);let o=n.violations(r),l=`${o.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,s=[...n.log.all()].slice(-5).reverse(),c=zt(e).map(b=>({kind:b,members:n.graph.nodesOfKind(b).filter($=>it(n.schema.tryDefinition(b),$))})),p=c.filter(b=>b.members.length>0),S=c.map(b=>({entry:b,creator:n.allMutations().find($=>($.creates??[]).includes(b.kind)&&n.permits({name:$.name,args:{}},e.principal).ok)})).find(b=>b.creator!==void 0),w=p.length===0?"Nothing here yet.":`${p.map(b=>Tt(n.schema,b.kind,b.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,g=e.views?.homeView?.(),L=n.schema.kinds.some(b=>n.graph.nodesOfKind(b).length>0);if(g&&L){let b=a?.subtitle&&a.subtitleDrawn!==!1?(0,K.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,$=g[Symbol.for("graview.home-blocks")]===!0;return(0,K.jsx)(ee,{context:e,style:dt,children:(0,K.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[$?null:b,o.length>0?(0,K.jsx)(N,{to:"/problems",style:{...U,color:"var(--graview-warn)"},children:l}):null,(0,K.jsx)(Kr.Provider,{value:$?b:null,children:(0,K.jsx)(Zt,{when:Ot(g),children:(0,K.jsx)(g,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})})]})})}let H=new Set(Fe(n,e.principal)),x=Xe(n).relations.filter(b=>H.has(b.from)&&(b.to==="*"||H.has(b.to)));return(0,K.jsxs)(ee,{context:e,style:dt,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,K.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,K.jsx)(ae,{context:e,"data-testid":"standing",children:w}),(0,K.jsxs)("p",{style:{...ne,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&S?(0,K.jsxs)("span",{children:["Begin with \u201C",S.creator?.title??S.creator?.name,"\u201D, under"," ",(0,K.jsx)(N,{to:`/${V(n.schema,S.entry.kind)}`,style:U,children:z(n,S.entry.kind)}),"."]}):null,o.length===0?(0,K.jsx)("span",{children:"All rules hold."}):(0,K.jsx)(N,{to:"/problems",style:{...U,color:"var(--graview-warn)"},children:l})]})]}),(0,K.jsx)(_n,{context:e}),(0,K.jsxs)("section",{style:{...J,display:"grid",gap:14},"data-testid":"kinds",children:[(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:Z,children:"What is here"}),x.length>0?(0,K.jsx)(N,{to:"/map",style:{...Ge,...A,marginLeft:"auto"},"data-testid":"map-link",children:(0,K.jsxs)(Qe,{children:["Connections \xB7 ",x.length===1?"1 relation":`${x.length} relations`]})}):null]}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:b,members:$})=>(0,K.jsx)("li",{style:{maxWidth:"100%"},children:(0,K.jsxs)(N,{to:`/${V(n.schema,b)}`,style:{...ve,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,K.jsx)(ie,{kind:b,brand:a,schema:n.schema,size:7}),(0,K.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:z(n,b)}),(0,K.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:$.length===0?"none yet":ft($.length)})]})},b))})]}),s.length>0?(0,K.jsxs)("section",{style:{...J,display:"grid",gap:10},children:[(0,K.jsx)("h2",{style:Z,children:"Recently"}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:s.map(b=>(0,K.jsxs)("li",{style:A,children:[(0,K.jsx)("span",{style:{color:"var(--graview-ink)"},children:b.intent})," \u2014 ",ht(b,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},b.id))})]}):null]})}var Me=I(He(),1);var tt=I(G(),1);function tn({context:e,withheld:t,style:n,testId:a}){let r=oe(),o=La(t,e.signIn??r?.signIn);return o?(0,tt.jsx)("p",{style:{...n,margin:0},children:(0,tt.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:Se,children:o.label})}):t.length===0?null:(0,tt.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(l=>(0,tt.jsxs)("li",{style:A,children:[(0,tt.jsx)("s",{children:l.label})," \u2014 ",l.refusal.message]},l.id))})}var M=I(G(),1);function Xn({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;Y(t);let[o]=pt(),l=o.get("q")??"",s=typeof r?.today=="string"?r.today:void 0,d=Lr(t,l,{...a?{principal:a}:{},places:Te(e),flagged:new Set(t.violations(r).flatMap(g=>g.nodeIds)),...s?{today:s}:{},limit:200}),c=d.hits.filter(g=>g.about==="node"),p=d.hits.filter(g=>g.about==="kind"||g.about==="place"||g.about==="rule"),S=[...new Set(c.map(g=>g.kind))],w=l.trim();return(0,M.jsxs)(ee,{context:e,children:[(0,M.jsx)("style",{children:_t}),(0,M.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,M.jsx)("p",{style:he,children:"Search"}),(0,M.jsx)(ae,{context:e,"data-testid":"search-heading",children:w.length===0?"Find anything by its name":d.hits.length===0?(0,M.jsxs)(M.Fragment,{children:["Nothing here is called \u201C",w,"\u201D."]}):(0,M.jsxs)(M.Fragment,{children:[Oi(t,d.byKind)," for \u201C",w,"\u201D"]})}),w.length>0?(0,M.jsxs)("p",{style:{...A,margin:0},"data-testid":"search-searched",children:[Dt(t.schema,d.searched),d.conditions.filter(g=>g.key!=="is"&&g.admittedBy.length<d.searched.kinds.length).map(g=>(0,M.jsxs)("span",{children:[" ",g.key,":",g.value," narrows"," ",g.admittedBy.length===0?"nothing here":g.admittedBy.map(L=>z(t,L).toLowerCase()).join(" and "),"."]},`${g.key}:${g.value}`))]}):(0,M.jsxs)("p",{style:ne,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,M.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,M.jsx)("code",{children:"is:any"})," includes what is past."]})]}),p.length>0?(0,M.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:p.map(g=>(0,M.jsx)("li",{"data-testid":"search-hit","data-about":g.about,children:g.about==="kind"?(0,M.jsxs)(N,{to:`/${V(t.schema,g.kind)}`,style:U,children:[g.label,g.count>0?(0,M.jsxs)("span",{style:A,children:[" \xB7 ",g.count," match"]}):null]}):g.about==="place"?(0,M.jsxs)(N,{to:ue(e,g),style:U,children:["Go to ",g.title]}):g.about==="rule"?(0,M.jsxs)(N,{to:"/problems",style:U,children:["The rule \u201C",g.label,"\u201D"]}):null},`${g.about}:${g.about==="rule"?g.name:g.about==="place"?g.as:g.kind}`))}):null,S.map(g=>(0,M.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":g,children:[(0,M.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,M.jsx)(ie,{kind:g,brand:n,schema:t.schema,size:8}),(0,M.jsx)(N,{to:`/${V(t.schema,g)}?${new URLSearchParams({q:w}).toString()}`,style:U,"data-testid":"search-kind-link",children:z(t,g)}),(0,M.jsx)("span",{children:d.byKind[g]})]}),(0,M.jsx)("ul",{className:"graview-rows",children:c.filter(L=>L.kind===g).map(L=>(0,M.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,M.jsxs)(N,{to:_(t.schema,g,L.id),className:"graview-row-title",...L.label.length>60?{title:L.label}:{},children:[L.flagged?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,L.label]}),L.apart||!L.current?(0,M.jsx)("span",{className:"graview-row-glance",children:[L.apart,L.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,M.jsx)(nn,{why:L.why})]},L.id))})]},g)),w.length>0?(0,M.jsx)(Ni,{asked:w}):null,w.length>0&&d.hits.length===0?(0,M.jsx)(To,{store:t,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function nn({why:e}){return e.strength==="near"?(0,M.jsxs)("span",{style:A,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,M.jsxs)("span",{style:A,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function Oi(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?Ye(e.schema.tryDefinition(a),a):z(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Ae(n[0]):Ae(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function Lo(e,t,n={}){let a=[];for(let r of t){let o=Ze(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let l of an(e,r,o.actions.affordances))a.some(s=>s.mutation.name===l.mutation.name)||a.push(l)}return a}function an(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,r=[];for(let o of n){let l=e.allMutations().find(c=>c.name===o.mutation);if(!l||!l.creates?.includes(t)||r.some(c=>c.mutation.name===l.name))continue;let s=yr(l.input).map(c=>c.name),d=s.includes("label")?"label":a&&s.includes(a)?a:void 0;!d||o.args[d]!==void 0||r.push({kind:t,affordance:o,mutation:l,arg:d})}return r}function To({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=Lo(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,M.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:l,affordance:s,mutation:d,arg:c})=>(0,M.jsxs)("section",{style:{...J,display:"grid",gap:14},children:[(0,M.jsxs)("h2",{style:Z,children:[Ae(Sa(Ye(e.schema.tryDefinition(l),l)))," called \u201C",n,"\u201D"]}),(0,M.jsx)(Ie,{store:e,mutation:d,prefilled:s.args,open:s.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${s.id}|${n}`))})}function Ni({asked:e}){let t=oe();return t?(0,M.jsx)(Hi,{asked:e,desk:t.aiDesk}):null}function Hi({asked:e,desk:t}){return _a(t)?(0,M.jsx)("p",{style:{margin:0},children:(0,M.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>ja(t,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{...U,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var y=I(G(),1),Eo=8,$o=40;function Ii(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>ba(n[r])&&ka(e[r]));return a===void 0?void 0:e[a]}function Jn({context:e}){let t=Ue(),n=we(e.store.schema,t.slug??"");return n?(0,y.jsx)(Oo,{context:e,kind:n}):(0,y.jsx)(ee,{context:e,children:(0,y.jsx)(ae,{context:e,children:"No such kind of thing here."})})}function Oo({context:e,kind:t,opening:n,row:a,layout:r="list",description:o,bare:l}){let{store:s,brand:d,invariantContext:c}=e;Y(s);let[p,S]=pt(),w=`list-${(0,Me.useId)().replace(/:/g,"")}`,g=s.schema.tryDefinition(t),L=Pa(p.get("archived")),H=s.graph.nodesOfKind(t,{archived:L}),x=Xe(s).relations.filter(i=>i.from===t||i.to===t),b=new Set(s.violations(c).flatMap(i=>i.nodeIds)),$=Cr(s.schema,Pr(s.schema,xr(s.schema,t))),j=x.map(i=>i.edgeKind),C=qi(p,$,j),D=["sort","filter","group","q","by","with","past","archived",...j].some(i=>p.has(i)),le=H.length>=$o,be=g?.fieldRoles?.when,fe=e.views?.arrangement?.()?.lists?.[t],X=wr(fe),de=hr(fe?.group),Ke=Bi(le,be),xe=n??(X?{...Ke,...X}:Ke),Pe=D?C.arrangement:$n(xe,$).arrangement,h=X?.sort,m=Pe.sort&&h?.then&&Pe.sort.by===h.by&&Pe.sort.direction===h.direction?{...Pe,sort:h}:Pe,T=Ar(m.query??""),E=[...m.filter??[],...T.conditions].some(i=>i.key==="is"&&(i.value==="past"||i.value==="any"))||br(g,[...m.filter??[],...T.conditions]),te=E||!g?.lifecycle?m:{...m,filter:[...m.filter??[],{key:"is",value:"current"}]},u=new Map,P=Wt(H,te,{schema:s.schema,graph:s.graph,flagged:b,...typeof c?.today=="string"?{today:c.today}:{},read:(i,f)=>{let O=u.get(i.id);return O||u.set(i.id,O=yt(s.schema,s.graph,i)),O[f]}}),B=de&&m.group?.by===de.by&&!m.group.bucket?$.groups.find(i=>i.key===de.by):void 0,ye=de&&B&&(B.type==="choice"||B.type==="boolean")?vr(P.groups,de,{type:B.type,...B.options?{options:B.options}:{}}):P.groups.map(i=>({...i,closed:!1})),Ee=new Set((p.get("open")??"").split(",").filter(Boolean)),Wo=!!m.query||(m.filter??[]).some(i=>i.key===de?.by),aa=i=>B?.type==="boolean"?i==="1"?"true":"false":i,ra=i=>i.closed&&!Wo&&!Ee.has(aa(i.key)),Ko=i=>{let f=new URLSearchParams(p),O=new Set(Ee);O.has(i)?O.delete(i):O.add(i),O.size>0?f.set("open",[...O].join(",")):f.delete("open"),S(f,{replace:!0})},Ce=P.nodes,at=g?.lifecycle&&!E?H.filter(i=>it(g,i)):H,oa=H.length-at.length,sn=m.group?.by??null,Bo=i=>{let f=new URLSearchParams(p);for(let re of["sort","filter","group","q","by","with","past","archived",...x.map(Rt=>Rt.edgeKind)])f.delete(re);let O=Tr(i);for(let re of["sort","filter","group","q","archived"])O[re]&&f.set(re,O[re]);![...f.keys()].some(re=>["sort","filter","group","q"].includes(re))&&(n||X||le||be)&&f.set("sort",""),S(f)},{principal:rt}=e,ln=Ze(s,t,{...rt?{principal:rt}:{},...e.invariantContext?{context:e.invariantContext}:{}}),Be=ln.actions.affordances.map(i=>({affordance:i,mutation:s.allMutations().find(f=>f.name===i.mutation)})).filter(i=>i.mutation!==void 0),qo=ln.actions.withheld,dn=()=>new Set(Ce.length===0?Be.map(({mutation:i})=>i.name):[]),[cn,ia]=(0,Me.useState)(()=>({kind:t,open:dn()}));cn.kind!==t&&ia({kind:t,open:dn()});let sa=i=>(cn.kind===t?cn.open:dn()).has(i),la=(i,f)=>ia(O=>{let re=new Set(O.open);return f?re.add(i):re.delete(i),{kind:O.kind,open:re}}),da=`begin-${(0,Me.useId)().replace(/:/g,"")}`,ca=T.words&&Ce.length===0?Object.fromEntries(an(s,t,ln.actions.affordances).map(i=>[i.mutation.name,i.arg])):{},je=z(s,t),xt=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),pn=xt!==void 0&&!st(xt)?xt:void 0,un=(m.group?.bucket??"day")==="day"?m.group?.by:void 0,gn=(m.filter??[]).map(i=>i.key),Go=gn.filter(i=>gn.indexOf(i)===gn.lastIndexOf(i)&&/choice|boolean/.test($.filters.find(f=>f.key===i)?.type??"")),mn=i=>{let f={...g?.computed?yt(s.schema,s.graph,i):i};un&&!String(f[un]).includes("T")&&delete f[un];for(let O of Go)delete f[O];return f},pa=i=>rr(g?.fields?.shape?.[i])?.type==="enum",Pt=i=>{let f=ce(g,i);if(a)return(0,y.jsxs)("li",{"data-testid":"record-row","data-graview-record":i.id,style:{minWidth:0},...Sn(i.id),children:[vn(i,f),a(i,{label:f,href:_(s.schema,t,i.id),flagged:b.has(i.id),glance:no(mn(i),g,f)})]},i.id);if(pn){let kn=Gt(xt,i,s.graph),Yo=Object.fromEntries(Object.entries(mn(i)).filter(([Qo])=>!kn?.fields.has(Qo))),ha=kn?Fn(Yo,g,kn.title??f,pa):[];return(0,y.jsxs)("li",{"data-testid":"record-row","data-graview-record":i.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...Sn(i.id),children:[vn(i,f),(0,y.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,y.jsx)(pn,{node:i,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...b.has(i.id)?{flagged:[i.id]}:{}})}),ha.length>0?(0,y.jsx)("span",{style:{...A,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,y.jsx)(Dn,{runs:ha})}):null,(0,y.jsx)(Vi,{to:_(s.schema,t,i.id),label:b.has(i.id)?`${f} \u2014 implicated in a problem`:f})]},i.id)}let O=Fn(mn(i),g,f,pa),re=O.length>0,Rt=T.words?Rr(g,i,T.words):void 0,fa=le?void 0:ir(i,g),Lt=Ii(i,g),ya=(0,y.jsxs)(N,{to:_(s.schema,t,i.id),className:"graview-row-title",...f.length>60?{title:f}:{},children:[b.has(i.id)?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,f]});return(0,y.jsxs)("li",{className:"graview-row","data-graview-record":i.id,...Sn(i.id),children:[vn(i,f),fa?(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,y.jsx)(lt,{as:"thumb",file:fa}),ya]}):ya,re||Lt?(0,y.jsxs)("span",{className:"graview-row-glance",children:[(0,y.jsx)(Dn,{runs:O}),re&&Lt?" \xB7 ":null,Lt?(0,y.jsx)(Kt,{address:Lt}):null]}):null,Rt?(0,y.jsx)(nn,{why:Rt}):null]},i.id)},fn=Te(e).filter(i=>i.kind===t),ua=fe?.filters,Uo=(m.filter??[]).some(i=>i.key!=="is"||i.value!=="any"),Vo=!!(m.sort||m.group||m.query||Uo),jo=at.length>=Eo||D&&Vo,Oe=m.sort?$.sorts.find(i=>i.key===m.sort.by):void 0,yn=Oe?.type==="date"||Oe!==void 0&&Oe.key===be,ga=le&&!P.grouped&&Oe&&(Oe.about==="label"||Oe.type==="text"||yn)?i=>{let f=Oe.about==="label"?ce(g,i):i[Oe.key];if(typeof f!="string"||f.length===0)return yn?"No date":"#";if(yn)return f.slice(0,4);let O=f.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(O)?O:"#"}:void 0,_e=ga?Ce.reduce((i,f)=>{let O=ga(f);return i.at(-1)?.key===O?i.at(-1).nodes.push(f):i.push({key:O,nodes:[f]}),i},[]):void 0,ma=P.grouped&&sn?ye.flatMap(i=>ra(i)?[]:i.nodes):_e&&_e.length>1?_e.flatMap(i=>i.nodes):Ce,hn=(0,Me.useMemo)(()=>ma.map(i=>i.id),[ma.map(i=>i.id).join(`
|
|
6
|
-
`)]),$e=Nr(hn),wn=(0,Me.useId)(),gt=(rt?s.permittedMutations(rt):s.permittedMutations()).some(i=>{let f=i.subject?.kinds;return f!==void 0&&(f==="*"||f.includes(t))}),vn=(i,f)=>gt?(0,y.jsx)("span",{className:"graview-choose-at",children:(0,y.jsx)("input",{...$e.boxProps(i.id,f),onPointerEnter:On,onFocus:On})}):null,Sn=i=>gt?{"data-graview-choose":i}:{},_o=(0,Me.useCallback)(i=>{$e.choose(i),requestAnimationFrame(()=>{let f=$e.list.current;((i[0]===void 0?null:f?.querySelector(`[data-graview-choose-box="${CSS.escape(i[0])}"]`))??f)?.focus({preventScroll:!0})})},[$e]),ot=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||pn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,Ct=ot?void 0:"graview-rows",mt=i=>`list-at-${i.replace(/[^\p{L}\p{N}]/gu,"_")}`,At=x.map(i=>{let f=i.from===t?i.to:i.from,O=i.from===t?i.description:i.inverse??i.description;return{relation:i,far:f,words:O}}),zo=new Set(At.map(i=>(i.words??"").toLowerCase()).filter((i,f,O)=>i&&O.indexOf(i)!==f));return(0,y.jsxs)(l?Ki:ee,{context:e,children:[(0,y.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,y.jsxs)("header",{style:{display:"grid",gap:4},children:[l?null:(0,y.jsx)(ut,{context:e}),(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,y.jsx)(ie,{kind:t,brand:d,schema:s.schema,size:8}),(0,y.jsx)(ae,{context:e,children:je}),Be.length>0?(0,y.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:Be.map(({affordance:i,mutation:f})=>(0,y.jsx)(Gi,{name:f.name,title:f.title??f.name,panel:`${da}-${f.name}`,open:sa(f.name),onOpen:O=>la(f.name,O)},i.id))}):null]}),Ce.length>0?(0,y.jsx)(Jr,{place:"here",to:[{label:`Skip to the ${Ce.length===1?Ye(g,t):`${Ce.length} ${je.toLowerCase()}`}`,testid:"records",go:()=>{let i=document.querySelector(`[data-graview-skip-target="${CSS.escape(wn)}"]`);Nn(i?.querySelector('[data-graview-choose-box][tabindex="0"]')??i)}},...at.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let i=document.querySelector(`[data-graview-skip-target="${CSS.escape(wn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');Nn(i?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??i)}}]:[]]}):null,o??g?.description?(0,y.jsx)("p",{style:ne,children:o??g?.description}):null,At.length>0||fn.length>0?(0,y.jsxs)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[At.length>0?(0,y.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",At.map(({relation:i,far:f,words:O},re)=>(0,y.jsxs)("span",{"data-relation":i.edgeKind,children:[re>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,f==="*"?Ae(O??ze(i.edgeKind)):(0,y.jsx)(N,{to:`/${V(s.schema,f)}`,style:U,title:z(s,f),children:O&&zo.has(O.toLowerCase())?`${Ae(O)}: ${z(s,f).toLowerCase()}`:Ae(O??z(s,f))})]},`${i.edgeKind}|${i.from}|${i.to}`))]}):null,fn.length>0?(0,y.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",fn.map((i,f)=>(0,y.jsxs)("span",{children:[f>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,y.jsx)(N,{to:ue(e,i),style:U,children:i.title})]},Je(i)))]}):null]}):null]}),Be.length>0?(0,y.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:Be.map(({affordance:i,mutation:f})=>{let O=!!(ca[f.name]&&Ce.length===0);return(0,y.jsx)(Ui,{name:f.name,id:`${da}-${f.name}`,description:f.description,open:sa(f.name),onClose:()=>la(f.name,!1),children:(0,y.jsx)(Ie,{store:s,mutation:f,prefilled:i.args,open:i.open,...O?{initial:{[ca[f.name]]:T.words}}:{},...e.principal?{principal:e.principal}:{}},O?`${f.name}|${T.words}`:f.name)},i.id)})}):null,C.dropped.length>0?(0,y.jsxs)("p",{style:{...A,margin:0},"data-testid":"list-dropped",children:["This link asked for ",C.dropped.join(", "),", which ",je.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,at.length>0?(0,y.jsx)($r,{schema:s.schema,graph:s.graph,kind:t,arrangement:m,onChange:Bo,kept:{shown:Ce.length,of:at.length},noun:{one:Ye(g,t),many:je.toLowerCase()},...jo?{}:{allow:!1},...ua?{filters:ua}:{},offers:$,chips:{nodes:at,flagged:b,...typeof c?.today=="string"?{today:c.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,y.jsx)("style",{children:_t}),gt?(0,y.jsx)("style",{children:Hr+Wi}):null,(0,y.jsx)("div",{className:"graview-list","data-graview-skip-target":wn,...gt?{...$e.listProps,ref:$e.list,tabIndex:-1,"data-graview-choosable":"","aria-label":$e.chosen.length>0?`${je}, ${$e.chosen.length} chosen`:je,role:"group"}:{},children:Ce.length===0&&T.words?(0,y.jsxs)("p",{style:ne,"data-testid":"none-yet",children:["Nothing here is called \u201C",T.words,"\u201D."," ",(0,y.jsx)("span",{style:A,"data-testid":"list-searched",children:Dt(s.schema,{kinds:[t],past:E})})," ",(0,y.jsx)(N,{to:"?",style:U,children:"Show every one"})]}):Ce.length===0?(0,y.jsxs)("p",{style:ne,"data-testid":"none-yet",children:[m.filter?.length||m.query?"None of them.":"None yet",!m.filter?.length&&!m.query&&Be.length>0?` \u2014 the first one starts above, with \u201C${Be[0]?.mutation.title??Be[0]?.mutation.name}\u201D.`:!m.filter?.length&&!m.query?".":"",m.filter?.length||m.query?(0,y.jsxs)(y.Fragment,{children:[" ",(0,y.jsx)(N,{to:"?",style:U,children:"Show every one"})]}):null]}):P.grouped&&sn?(0,y.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":sn,children:ye.map(i=>{if(!i.closed)return(0,y.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,y.jsxs)("h2",{className:"graview-group-head",children:[i.label," ",(0,y.jsx)("span",{children:i.nodes.length})]}),(0,y.jsx)("ul",{style:ot,className:Ct,"data-graview-rows":"",children:i.nodes.map(Pt)})]},i.key||"-");let f=ra(i),O=`${w}-${mt(i.key||"none")}`;return(0,y.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":f?"shut":"open",children:[(0,y.jsx)("h2",{className:"graview-group-head",children:(0,y.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!f,"aria-controls":O,"data-testid":"list-group-toggle",onClick:()=>Ko(aa(i.key)),children:[(0,y.jsx)("span",{"aria-hidden":"true",children:f?"\u25B8":"\u25BE"}),i.label," ",(0,y.jsxs)("span",{children:["\xB7 ",i.nodes.length]}),(0,y.jsxs)("span",{style:Fi,children:[" ",i.nodes.length===1?Ye(g,t):je.toLowerCase()]})]})}),(0,y.jsx)("ul",{id:O,style:f?{...ot,display:"none"}:ot,className:Ct,"data-graview-rows":"",hidden:f,children:f?null:i.nodes.map(Pt)})]},i.key||"-")})}):_e&&_e.length>1?(0,y.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Oe?.type==="date"?"year":"letter",children:[(0,y.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...A,display:"flex",flexWrap:"wrap",gap:Oe?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:_e.map(i=>(0,y.jsx)("a",{href:`#${mt(i.key)}`,onClick:f=>{f.preventDefault(),document.getElementById(mt(i.key))?.scrollIntoView({block:"start"})},style:{...ve,minWidth:24,justifyContent:"center"},children:i.key},i.key))}),_e.map(i=>(0,y.jsxs)("section",{"data-testid":"list-section","aria-labelledby":mt(i.key),style:{display:"grid",gap:0},children:[(0,y.jsx)("h2",{id:mt(i.key),className:"graview-group-head",children:i.key}),(0,y.jsx)("ul",{style:ot,className:Ct,"data-graview-rows":"",children:i.nodes.map(Pt)})]},i.key))]}):(0,y.jsx)("ul",{style:ot,className:Ct,"data-testid":"records","data-graview-rows":"",children:Ce.map(Pt)})}),gt?(0,y.jsx)(Ir,{store:s,chosen:$e.chosen,...rt?{principal:rt}:{},...c?{context:c}:{},anchor:Di,of:hn.length,onChooseAll:()=>$e.choose(hn),onClear:$e.clear,onActed:_o}):null,oa>0?(0,y.jsxs)(N,{to:Mo(p,"filter","is:any"),style:{...U,...A,justifySelf:"start"},"data-testid":"past-link",children:["+",oa," past"]}):null,L===!1&&s.graph.count(t,{archived:!0})>0?(0,y.jsxs)(N,{to:Mo(p,"archived","true"),style:{...U,...A,justifySelf:"start"},"data-testid":"archived-link",children:["+",s.graph.count(t,{archived:!0})," archived"]}):null]}),(0,y.jsx)(tn,{context:e,withheld:qo,style:J,testId:"withheld"})]})}var Fi={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Di=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,Wi=`
|
|
7
|
-
.graview-list[data-graview-choosable]{outline:none}
|
|
8
|
-
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
9
|
-
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${Ta.raised};display:flex;align-items:center}
|
|
10
|
-
@media (min-width: 900px) and (pointer: fine){
|
|
11
|
-
.graview-list [data-graview-choose]{padding-left:0}
|
|
12
|
-
.graview-choose-at{left:-34px}
|
|
13
|
-
}
|
|
14
|
-
@media (pointer: coarse){
|
|
15
|
-
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
16
|
-
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
17
|
-
}
|
|
18
|
-
`;function Ki({children:e}){return(0,y.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var Bi=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function qi(e,t,n){let a=$t({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),l=a.group??(o?{by:o}:void 0);for(let d of n){let c=e.get(d);c&&r.push({key:d,value:c})}let s=e.get("with");return s&&r.push({key:s,value:"*"}),e.get("past")==="1"&&!r.some(d=>d.key==="is")&&r.push({key:"is",value:"any"}),$n({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...l?{group:l}:{},...a.archived!==void 0?{archived:a.archived}:{}},t)}function Mo(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function Gi({name:e,title:t,panel:n,open:a,onOpen:r}){return(0,y.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...ve,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,y.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),t]})}function Ui({name:e,id:t,description:n,open:a,onClose:r,children:o}){return(0,y.jsxs)("div",{"data-testid":`act-${e}`,id:t,hidden:!a,onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),r(),document.querySelector(`[aria-controls="${t}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,y.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function Vi({to:e,label:t}){let n=(0,Me.useRef)(null);return Fr(n),(0,y.jsx)(N,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var nt=I(He(),1);var bt=I(He(),1);var F=I(G(),1);function ea({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;Y(t);let o=t.violations(a),l=t.allInvariants(),s=Ht(t,o),d=za(t.schema,l);return(0,F.jsxs)(ee,{context:e,children:[(0,F.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,F.jsx)(ae,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,F.jsx)("p",{style:ne,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":Ca(o)})]}),(0,F.jsx)(Ro,{context:e}),s.map((c,p)=>{let S=c.nodeIds[0],w=S?t.graph.getNode(S):void 0;return(0,F.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,F.jsx)(rn,{violation:c,schema:t.schema,...n?{brand:n}:{}}),w?(0,F.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,F.jsx)(ie,{kind:w.kind,brand:n,schema:t.schema,size:7}),(0,F.jsx)(N,{to:_(t.schema,w.kind,w.id),style:U,children:ce(t.schema.tryDefinition(w.kind),w)})]}):null,c.line?(0,F.jsx)(rn,{violation:c,schema:t.schema,...n?{brand:n}:{}}):null,(0,F.jsx)(on,{store:t,repairs:c.repairs,...r?{principal:r}:{}})]},p)}),l.length>0?(0,F.jsxs)("section",{style:{...J,display:"grid",gap:12},"data-testid":"rules",children:[(0,F.jsx)("h2",{style:Z,children:"The rules"}),(0,F.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:l.map(c=>{let p=o.filter(g=>g.invariant===c.name).length,S=d.get(c.name),w=c.label??c.name;return(0,F.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,F.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[S?(0,F.jsx)(It,{line:S,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,F.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:w}),(0,F.jsx)("span",{style:{...A,color:p>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:p===0?"holds":`broken in ${p} ${p===1?"place":"places"}`})]}),S&&w.trim().length>0?(0,F.jsx)("span",{style:A,children:w}):null]},c.name)})})]}):null]})}function rn({violation:e,schema:t,brand:n}){if(!e.line)return(0,F.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=Qa(e),r=Ya(e);return r?(0,F.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,F.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,F.jsx)("span",{style:A,children:a}):null,(0,F.jsxs)("details",{"data-testid":"problem-judged",style:A,children:[(0,F.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,F.jsx)(It,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none"})]})]}):(0,F.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,F.jsx)(It,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,F.jsx)("span",{style:A,children:a}):null]})}function on({store:e,repairs:t,principal:n}){let[a,r]=(0,bt.useState)(null),[o,l]=(0,bt.useState)(null),s=(0,bt.useRef)([]);if(t.length===0)return null;let d=a===null?null:t[a],c=d&&(d.missing??[]).length>0?e.allMutations().find(p=>p.name===d.mutation):void 0;return(0,F.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,F.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((p,S)=>{let w=(p.missing??[]).length>0,g=e.permits({name:p.mutation,args:{...p.args}},n);return g.ok?(0,F.jsx)("button",{ref:L=>{s.current[S]=L},type:"button","data-graview-repair":p.mutation,"data-graview-asks":w||void 0,"aria-expanded":w?a===S:void 0,onClick:()=>{if(l(null),w){r(a===S?null:S);return}r(null);try{e.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(L){l(Ft(e.schema,e.allMutations(),L))}},style:Se,children:w?`${p.label} \u2026`:p.label},S):(0,F.jsxs)("p",{"data-testid":"withheld","data-withheld":g.refusal.wouldNeed.join(",")||"nobody",style:{...A,margin:0},children:[(0,F.jsx)("s",{children:p.label})," \u2014 ",g.refusal.message]},S)})}),c&&d?(0,F.jsx)(Ie,{store:e,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,autoFocus:!0,onDone:()=>{let p=a;r(null),requestAnimationFrame(()=>{let S=p===null?null:s.current[p];if(S?.isConnected){S.focus();return}let w=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");w&&(w.hasAttribute("tabindex")||(w.tabIndex=-1),w.focus())})},...n?{principal:n}:{}}):null,d&&!c&&(d.missing??[]).length>0?(0,F.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Hn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,o?(0,F.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Hn},children:o}):null]})}var ta=I(He(),1);var Ve=I(G(),1);function No({store:e,link:t,principal:n}){let[a,r]=(0,ta.useState)(!1),[o,l]=(0,ta.useState)(null),s=tr(t);return(0,Ve.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Ve.jsx)("button",{type:"button","data-graview-provisional":"",title:s,"aria-label":`Unsure link: ${s}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,Ve.jsxs)("span",{style:{...A,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Ve.jsx)("span",{children:s}),(0,Ve.jsx)("button",{type:"button",style:{...Se,padding:"4px 10px"},onClick:()=>{try{e.apply({name:Aa,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(d){l(Ft(e.schema,e.allMutations(),d))}},children:"Keep this link"}),o?(0,Ve.jsx)("span",{role:"alert",children:o}):null]}):null]})}var me=I(G(),1);function Ho({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=he}){return n.files?(0,me.jsx)(lt,{as:"field",read:!a,nodeId:e,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,me.jsx)(Er,{nodeId:e,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,me.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,me.jsx)("dt",{style:r,children:n.label}),(0,me.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,me.jsx)(pr,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,me.jsx)(Kt,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,me.jsx)(Mr,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:e}:{}}):a?(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(Bt,{nodeId:e,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,me.jsx)(ur,{nodeId:e,field:n.key,start:t?.[n.key],value:t?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var v=I(G(),1),ji=[];function na({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;Y(t);let o=oe()!==null,l=Ue(),s=decodeURIComponent(l.id??""),d=po(t,s,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Ht(t,d?.violations??ji),[p,S]=(0,nt.useState)(null),[w,g]=(0,nt.useState)(!1),[L,H]=(0,nt.useState)(null),x=(0,nt.useRef)(null),b=(0,nt.useRef)(null),$=gr({flow:"both",letters:!0}),j=u=>{(x.current?.parentElement?.querySelector(`[data-affordance="${u.replace(/["\\]/g,"\\$&")}"]`)??x.current)?.focus()};if(!d)return(0,v.jsx)(ee,{context:e,children:(0,v.jsx)(ae,{context:e,children:"Nothing lives at this address."})});let C=t.graph.getNode(s),D=t.schema.tryDefinition(d.kind),le=D?.describe&&C?Xa(D,C):null,be=[...t.log.all()].filter(u=>!Mt(u)&&(u.writes.includes(s)||u.reads.includes(s))).slice(-8).reverse(),fe=t.log.all().find(u=>!Mt(u)&&u.undoes===void 0&&u.primitives.some(P=>P.op==="add-node"&&P.node.id===s)),X=d.actions.affordances.filter(u=>u.provider!=="invariant"),de=X.filter(u=>u.destructive||u.setsAside),Ke=w||de.length<2?X:X.filter(u=>!de.includes(u)),xe=e.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),Pe=xe!==void 0&&!st(xe)?xe:void 0,h=Pe&&C?Gt(xe,C,t.graph):void 0,m=h?d.fields.filter(u=>!h.fields.has(u.key)):d.fields,T=h?d.links.flatMap(u=>{let P=u.targets.filter(B=>!h.records.has(B.id));return P.length>0?[{...u,targets:P}]:[]}):d.links,E=Pe!==void 0&&Ua(xe),te=o&&or(D).length>0;return(0,v.jsxs)(ee,{context:e,children:[(0,v.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,v.jsx)(ut,{context:e}),(0,v.jsx)(ae,{context:e,children:o&&C?.label===d.label?(0,v.jsx)(Bt,{nodeId:s,field:"label",value:d.label,said:d.label}):d.label}),le&&le!==d.label?(0,v.jsx)("p",{style:ne,children:le}):null,fe?.lineage?(0,v.jsxs)("p",{style:{...A,margin:0},"data-testid":"record-lineage",children:["Made by ",ht(fe,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",An(fe.lineage)]}):null,(0,v.jsx)(Yt,{context:e,stop:`#focus=${encodeURIComponent(s)}`,style:{...Ge,...A},"data-testid":"spatial-link"}),o&&C?(0,v.jsx)(Tn,{choices:[{on:"changed",record:s},{on:"act",record:s},{on:"reaches",kind:d.kind,condition:"",record:s}],label:"Notify me when this changes",testId:"record-notify",style:{...Se,...A,justifySelf:"start"}}):null,Te(e).some(u=>u.kind===d.kind||u.across===d.kind)?(0,v.jsxs)("p",{style:{...A,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",Te(e).filter(u=>u.kind===d.kind||u.across===d.kind).map((u,P)=>(0,v.jsxs)("span",{children:[P>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,v.jsx)(N,{to:ue(e,u),style:U,children:u.title})," ",(0,v.jsx)(Yt,{context:e,stop:`#view=${encodeURIComponent(u.as)}`,style:{...U,...A,display:"inline-block",minWidth:24,textAlign:"center"},title:`${u.title}, in the scene`,label:`${u.title}, in the scene`,children:(0,v.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},Je(u)))]}):null]}),C&&xa(C)?(0,v.jsx)(zi,{context:e,id:s,kind:d.kind}):null,C&&Ra(t,s)?(0,v.jsx)(_i,{context:e,id:s,kind:d.kind}):null,Pe&&C?(0,v.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,v.jsx)(Dr,{children:(0,v.jsx)(Zt,{when:Ot(xe),children:(0,v.jsx)(Pe,{node:C,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[s]}:{}})})})}):null,d.violations.length>0?(0,v.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((u,P)=>(0,v.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,v.jsx)(rn,{violation:u,schema:t.schema,...n?{brand:n}:{}}),(0,v.jsx)(on,{store:t,repairs:uo(d.actions,u.repairs),...a?{principal:a}:{}})]},P))}):null,!E&&(m.length>0||te)?(0,v.jsxs)("section",{style:{...J,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,v.jsx)("h2",{style:Z,children:"The facts"}),er(D,m).map((u,P)=>{let B=(0,v.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:u.fields.map(ye=>(0,v.jsx)(Ho,{nodeId:s,node:C,field:ye,inPlace:o},ye.key))});return u.title?(0,v.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,v.jsx)("h3",{"data-graview-field-group":u.title,style:{...Z,fontSize:"inherit"},children:u.title}),B]},P):(0,v.jsx)("div",{children:B},P)}),te?(0,v.jsx)(lt,{as:"unfilled",nodeId:s,skip:[...h?.fields??[]],labelStyle:he,style:{gap:4}}):null]}):null,(E?[]:T).map(u=>(0,v.jsxs)("section",{style:{...J,display:"grid",gap:10},children:[(0,v.jsx)("p",{style:he,children:to(t,u)}),u.description?(0,v.jsx)("h2",{style:Z,children:Ae(u.description)}):(0,v.jsxs)("h2",{style:Z,"aria-label":ze(u.edgeKind),children:[u.direction==="in"?"\u2190 ":"\u2192 ",ze(u.edgeKind)]}),(0,v.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:u.targets.map(P=>{let B=nr(t,u.direction==="in"?{kind:u.edgeKind,from:P.id,to:s}:{kind:u.edgeKind,from:s,to:P.id});return(0,v.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,v.jsx)(ie,{kind:P.kind,brand:n,schema:t.schema,size:7}),(0,v.jsxs)(N,{to:_(t.schema,P.kind,P.id),style:U,children:[P.label,P.apart?(0,v.jsxs)("span",{style:A,children:[" \xB7 ",P.apart]}):null]}),B?.provisional?(0,v.jsx)(No,{store:t,link:B,...a?{principal:a}:{}}):null]},P.id)})}),(u.direction==="out"&&t.schema.edge(u.edgeKind)?.cardinality==="one"?[]:[...new Set(u.targets.map(P=>P.kind))]).map(P=>(0,v.jsx)(N,{to:`/${V(t.schema,P)}?${encodeURIComponent(u.edgeKind)}=${encodeURIComponent(s)}`,style:{...Ge,...A},"data-testid":"related-all",children:(0,v.jsxs)(Qe,{children:["Sort and filter ",u.description??`these ${z(t,P).toLowerCase()}`,u.targets.some(B=>B.kind!==P)?` (${z(t,P).toLowerCase()})`:""]})},P))]},`${u.edgeKind}|${u.direction}|${u.description??""}`)),!E&&(X.length>0||d.actions.withheld.length>0)?(0,v.jsxs)("section",{style:{...J,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,v.jsx)("h2",{style:Z,ref:x,tabIndex:-1,children:"What can be done"}),(0,v.jsxs)("div",{role:"toolbar","aria-label":"What can be done",...$,style:{display:"flex",flexWrap:"wrap",gap:8},children:[Ke.map(u=>{let P=p===u.id;return(0,v.jsx)("button",{type:"button","data-affordance":u.id,"data-rank":u.rank,"data-graview-act":u.mutation,[Ln]:"",autoFocus:w&&u===de[0],"aria-expanded":P,onClick:()=>S(P?null:u.id),style:{...Se,...P?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:u.label},u.id)}),Ke.length<X.length?(0,v.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>g(!0),style:{...Se,...A},"data-testid":"record-actions-more",[Ln]:"",children:["Show ",X.length-Ke.length," more"]}):null]}),X.map(u=>{if(p!==u.id)return null;let P=t.allMutations().find(B=>B.name===u.mutation);return P?(0,v.jsxs)("div",{ref:b,onKeyDown:B=>{if(B.key!=="Escape"||B.defaultPrevented)return;B.preventDefault(),S(null);let ye=u.id;requestAnimationFrame(()=>j(ye))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsx)("h3",{style:Z,children:u.label}),P.description?(0,v.jsx)("p",{style:{...A,margin:0},children:P.description}):null,(0,v.jsx)(Ie,{store:t,mutation:P,prefilled:u.args,open:u.open,label:u.label,autoFocus:!0,onDone:()=>{S(null),H(u.mutation);let B=u.id;requestAnimationFrame(()=>j(B))},...a?{principal:a}:{}})]},u.id):null}),o&&L!==null&&p===null?(0,v.jsx)(Tn,{choices:[{on:"act",act:L,record:s},{on:"act",act:L}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...Se,...A,justifySelf:"start"}}):null,(0,v.jsx)(tn,{context:e,withheld:d.actions.withheld})]}):null,o?(0,v.jsx)(eo,{id:s,style:J,headingStyle:Z}):null,be.length>0?(0,v.jsxs)("section",{style:{...J,display:"grid",gap:10},"data-testid":"record-history",children:[(0,v.jsx)("h2",{style:Z,children:"What has happened"}),(0,v.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:be.map(u=>(0,v.jsxs)("li",{style:A,children:[(0,v.jsx)("span",{style:{color:"var(--graview-ink)"},children:u.intent}),u.lineage?(0,v.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",An(u.lineage)]}):null," \u2014 ",ht(u,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},u.id))})]}):null]})}function _i({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`allow-tidying-${n}`,args:{id:t}},l=a.allMutations().some(s=>s.name===o.name)&&a.permits(o,r).ok;return(0,v.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,v.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),l?(0,v.jsx)("button",{type:"button",style:Se,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function zi({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`unarchive-${n}`,args:{id:t}},l=a.allMutations().some(c=>c.name===o.name)&&a.permits(o,r).ok,s=[...a.log.all()].reverse().find(c=>!Mt(c)&&c.mergedInto!==void 0&&c.writes.includes(t)),d=s?.mergedInto!==void 0?a.graph.getNode(s.mergedInto):void 0;return(0,v.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,v.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,v.jsxs)(v.Fragment,{children:[" ","Merged into ",(0,v.jsx)(N,{to:_(a.schema,d.kind,d.id),style:U,children:ce(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),l?(0,v.jsx)("button",{type:"button",style:Se,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var k=I(G(),1),Yi=(0,q.lazy)(Nt(()=>(__graviewPreload(import.meta.url,["./chunk.JF3GD4H5.js","./chunk.ONEYVLC2.js","./chunk.WQONZBA3.js","./chunk.UGFDSE37.js","./chunk.NWA7Q6CI.js","./chunk.WP5W44Y4.js","./chunk.M5GJHVWZ.js","./chunk.HZCA3UWJ.js","./chunk.JBW3DI7E.js","./chunk.AGIO2GRV.js","./chunk.NIVTK2W5.js","./chunk.6QYJ2K6K.js","./chunk.3MMLRSRC.js","./chunk.DQOCBKC3.js","./chunk.OHSJQYJN.js","./chunk.DEUTHHGI.js","./chunk.EPUBSKKL.js","./chunk.ATDU5Y7V.js","./chunk.AQQZY6OY.js","./chunk.BCWPV4WR.js","./chunk.Y5ARSVH4.js","./chunk.PKUDIWIF.js","./chunk.VW2VCPJX.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.ZIEHF67C.js","./chunk.UHX4WTM7.js","./chunk.IKX4VDTW.js","./chunk.RNEJYIQ7.js","./chunk.TBQOSI4J.js","./chunk.KWQ7QOHD.js","./chunk.GZHZLJBF.js","./chunk.6MADC6DM.js","./chunk.OJGHDWI6.js","./chunk.JLEC3USG.js","./chunk.HDRD33II.js","./chunk.DX357TZ3.js","./chunk.H7KCWCB4.js","./chunk.XSNAG4JT.js","./chunk.XWAMQPUM.js","./chunk.SDO3U72B.js","./chunk.AS4CQBOQ.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.MWONSI3P.js")).then(e=>({default:e.DraftPage})))),Qi={kind:"human"};function Zi({list:e,store:t}){let n=new Set(e.members.map(l=>l.kind)),a=e.total-e.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,k.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=qe(t.schema,r).toLowerCase();return(0,k.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,k.jsx)(N,{to:`/${V(t.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===t.graph.nodesOfKind(r).length?`See all ${ft(e.total)} ${o}`:`${ft(a)} more \xB7 all ${o}`})})}function Xi({context:e,children:t}){let n=De(),a=e.store.schema,r=ct("/").replace(/\/$/,""),o=(0,q.useMemo)(()=>({href:l=>`${r}${_(a,l.kind,l.id)}`,go:l=>n(_(a,l.kind,l.id)),more:l=>(0,k.jsx)(Zi,{list:l,store:e.store})}),[r,a,n,e.store]);return(0,k.jsx)(qt.Provider,{value:o,children:(0,k.jsx)(Wr.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}function Ji({steering:e}){let t=pe(),n=De(),a=`${t.pathname}${t.search}`;return(0,q.useLayoutEffect)(()=>e.at(a),[a,e]),(0,q.useLayoutEffect)(()=>{let r=l=>{l!==a&&n(l)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,n,e]),null}function es({context:e,to:t}){let{pathname:n}=pe(),a=oe(),r=(t??a)?.sayWhere,o=ts(e,n);return(0,q.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function ts(e,t){let[n="",a,r]=t.split("/").filter(Boolean).map(l=>{try{return decodeURIComponent(l)}catch{return l}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===Pn)return"#overview=1";let l=e.views?.places().find(s=>s.as===a);return l?`#focus=${encodeURIComponent(Ne(l.kind))}&view=${encodeURIComponent(l.as)}`:"#"}let o=we(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??Ne(o))}`:"#"}function ns({onNavigate:e,path:t}){let n=pe(),a=Wn(),r=De(),o=n.hash&&!n.hash.includes("=")?n.hash:"",l=`${n.pathname}${n.search}${o}`,s=(0,q.useRef)(e);s.current=e;let d=(0,q.useRef)(null);(0,q.useEffect)(()=>{let p=d.current;d.current=l,p!==null&&(l===p&&a!=="PUSH"||s.current?.(l,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,q.useRef)(t);return(0,q.useEffect)(()=>{t===void 0||t===c.current||(c.current=t,t!==l&&r(t))},[t]),null}function Io({context:e,registry:t,page:n}){let a=Ue(),r=we(e.store.schema,a.slug??""),o=n==="list"?Jn:na,s=(r?t?.lookup(r,n):void 0)??o;return(0,k.jsx)(s,{context:e})}function as({context:e,registry:t,children:n}){let a=(0,q.useRef)(null);return Va(a),(0,k.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,k.jsx)(bo,{context:e,registry:t,root:a,children:(0,k.jsx)(Po,{context:e,root:a,children:n})})})}function rs(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function os(){let{pathname:e}=pe(),t=Wn(),n=(0,q.useRef)(null);(0,q.useLayoutEffect)(()=>{if(t!=="POP"){for(let o=n.current?.parentElement;o;o=o.parentElement){let{overflowY:l}=getComputedStyle(o);if((l==="auto"||l==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,q.useRef)(e),r=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(rs(o))return;let l=n.current?.closest("main")??document.querySelector("main"),d=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??l?.querySelector("h1, h2")??null??l??null;d&&(d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus({preventScroll:!0}))},[e]),(0,k.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function Fo({context:e,children:t}){let n=De(),a=(0,q.useMemo)(()=>({record:(r,o)=>{let l=e.store.graph.getNode(r);l&&n(Vt(_(e.store.schema,l.kind,r),{section:o?.section}))},place:(r,o)=>{let l=e.views?.places().find(s=>s.as===r);l&&n(Vt(ue(e,l),o))},list:(r,o)=>{e.store.schema.tryDefinition(r)&&n(Vt(`/${V(e.store.schema,r)}`,o))},draft:()=>n("/~draft")}),[e,n]);return(0,k.jsx)(Ga.Provider,{value:a,children:t})}function is(){let{pathname:e,search:t,hash:n}=pe();return(0,q.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return wo(a)},[e,t,n]),null}function ss({context:e,Home:t}){let n=pe(),a=e.views,r=n.key==="default"&&!(a&&Ba(a));(0,q.useEffect)(()=>{a&&qa(a)},[a]);let o=r?$a(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,l=o?.to==="place"?ue(e,o.place):o?.to==="kind"?`/${V(e.store.schema,o.kind)}`:void 0;return l?(0,k.jsx)(Kn,{to:l,replace:!0}):(0,k.jsx)(t,{context:e})}function Do({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,r=a&&(t?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,l=H=>n===void 0?(0,k.jsx)(Qt,{context:e,children:H}):r?(0,k.jsx)(n,{context:e,children:H}):(0,k.jsx)(Qt,{context:e,children:(0,k.jsx)(n,{context:o,children:H})}),s=t?.lookupSurface("home")??Zn,d=t?.lookupSurface("problems")??ea,c=a?{...o,framed:!0}:e,[p,S]=(0,q.useState)(null),w=(0,q.useMemo)(()=>({context:c,registry:t}),[c,t]),g=(0,q.useMemo)(()=>({onFind:S,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),L=(0,k.jsx)(qn.Provider,{value:w,children:(0,k.jsx)(Fo,{context:e,children:(0,k.jsx)(as,{context:e,registry:t,children:l((0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ar,{face:"pages"}),(0,k.jsxs)(Xi,{context:c,children:[(0,k.jsx)(os,{}),(0,k.jsx)(is,{}),(0,k.jsxs)(io,{children:[(t?.routes()??[]).map(({path:H,component:x})=>(0,k.jsx)(Re,{path:H,element:(0,k.jsx)(x,{context:c})},H)),(0,k.jsx)(Re,{path:"/",element:(0,k.jsx)(ss,{context:c,Home:s})}),(0,k.jsx)(Re,{path:"/problems",element:(0,k.jsx)(d,{context:c})}),(0,k.jsx)(Re,{path:"/~draft",element:(0,k.jsx)(q.Suspense,{fallback:null,children:(0,k.jsx)(Yi,{context:c})})}),(0,k.jsx)(Re,{path:"/search",element:(0,k.jsx)(Xn,{context:c})}),(0,k.jsx)(Re,{path:"/map",element:(0,k.jsx)(Qn,{context:c})}),(0,k.jsx)(Re,{path:"/places",element:(0,k.jsx)(zn,{context:c})}),Te(c).some(H=>H.as===Pn)?null:(0,k.jsx)(Re,{path:Ea,element:(0,k.jsx)(Kn,{to:"/",replace:!0})}),(0,k.jsx)(Re,{path:"/places/:as",element:(0,k.jsx)(Yn,{context:c})}),(0,k.jsx)(Re,{path:"/:slug",element:(0,k.jsx)(Io,{context:c,registry:t,page:"list"})}),(0,k.jsx)(Re,{path:"/:slug/:id",element:(0,k.jsx)(Io,{context:c,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?L:(0,k.jsx)(co.Provider,{value:g,children:(0,k.jsx)(Sr.Provider,{value:p,children:L})})}var ls=()=>typeof document>"u"?null:document.body;function ds({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:l,firstLook:s}){let[d,c]=(0,q.useState)(void 0),p=d!==void 0&&d.from===e.principal?{...e,principal:d.seat}:e;(0,q.useState)(()=>p.views?qr(p.views,p.store.schema,En(p.brand,p.store.schema)):void 0);let S=oe();wa({reader:p.locale??S?.locale,app:p.brand?.locale??p.app?.brand?.locale,readerTimeZone:p.timeZone??S?.timeZone,appTimeZone:p.brand?.timeZone??p.app?.brand?.timeZone});let w=p.principal??Qi,g=Fa(p.store,w,p.history),H=(g.past&&g.live===p.store?g.past.store:p.store).seenBy(w),x=H===p.store?p:{...p,store:H};Da(p.store,p.principal);let b=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ns,{onNavigate:r,path:o}),l?(0,k.jsx)(Ji,{steering:l}):null,x.presence||S?(0,k.jsx)(es,{context:x,to:S}):null,(0,k.jsx)(Do,{context:x,...t?{registry:t}:{}}),s?(0,k.jsx)(Gr,{firstLook:s,root:ls,app:En(p.brand,p.store.schema)}):null]}),$=x.views?(0,k.jsxs)(Wa,{store:x.store,views:x.views,...x.principal?{principal:x.principal}:{},...x.brand?{brand:x.brand}:{},...x.locale?{locale:x.locale}:{},...x.timeZone?{timeZone:x.timeZone}:{},...x.settings?{settings:x.settings}:{},...x.presence&&!S?{presence:x.presence}:{},...x.people?{people:x.people}:{},...x.seats?{seats:x.seats}:{},onSeat:D=>S?S.takeSeat(D):c({from:e.principal,seat:D}),...x.onKeepLens?{onKeepLens:x.onKeepLens}:{},...x.ai?{ai:x.ai}:{},...x.subscriptions?{subscriptions:x.subscriptions}:{},...x.signIn?{signIn:x.signIn}:{},resolveApp:x.resolveApp??S?.resolveApp,linkedRecords:x.linkedRecords??S?.linkedRecords,...x.app?{app:x.app}:{},...x.menuSections?{menuSections:x.menuSections}:{},children:[b,(0,k.jsx)(Fo,{context:x,children:(0,k.jsx)(vo,{context:x})})]}):b,j=(0,k.jsx)(Ia.Provider,{value:g,children:$}),C=x.files?(0,k.jsx)(Ha.Provider,{value:x.files,children:j}):j;if(a!==void 0){let D=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,k.jsx)(oo,{initialEntries:[D],...n===void 0?{}:{basename:n},children:C})}return(0,k.jsx)(so,{...n===void 0?{}:{basename:n},children:C})}export{di as a,ds as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as A,c as m,d as v}from"./chunk.55D33E5A.js";import"./chunk.2JJYGYT2.js";import"./chunk.NMIXBH37.js";import{b as g,c as b,d as S}from"./chunk.GVY5UQTJ.js";import"./chunk.AS4CQBOQ.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var N=new Set(["input","select","textarea"]),h=r=>r.namespaceURI==="http://www.w3.org/1999/xhtml"&&N.has(r.localName),x=r=>r.localName==="select"||r.type==="checkbox"||r.type==="radio",w=r=>r.type==="checkbox"||r.type==="radio"?!r.checked:r.localName!=="select"&&r.value==="";function y(r){return r.type==="checkbox"||r.type==="radio"?`checked:${r.checked}`:r.localName==="select"&&r.multiple?`selected:${[...r.selectedOptions].map(a=>a.value).join("\0")}`:`value:${r.value}`}function I(r=a=>a.isTrusted){let a=new WeakMap,c=new WeakSet,o=new WeakMap,i={heard(e,t){if(!(!h(t)||!r(e))&&(e.type==="input"||e.type==="change"&&x(t))&&((x(t)||w(t))&&c.delete(t),w(t)&&o.delete(t),a.set(t,y(t)),t.type==="radio"&&t.name)){let d=t.getRootNode();for(let u of d.querySelectorAll?.('input[type="radio"]')??[])u.name===t.name&&a.set(u,y(u))}},filled(e){a.delete(e),o.delete(e),h(e)&&!w(e)?c.add(e):c.delete(e)},press(e,t,d){if(!r(e))return;let u=t.closest("[data-act]");if(!u||!b(u))return;let l=e.type==="keydown"?e.key:void 0;if(!(e.type!=="click"&&!((l==="Enter"||l===" ")&&t===u&&!g(u))))return i.collect(u,d)},collect(e,t){if(!e.hasAttribute("data-act")||!t.contains(e))return;let d=e.closest("[data-record]"),u=e.closest("fieldset, [role='group']")??t,l=[];for(let n of u.querySelectorAll("input[name], select[name], textarea[name]")){let s=n,f=!c.has(s)&&a.get(s)===y(s);if(s.type==="radio"){if(!s.checked)continue;l.push({name:s.name,value:s.value,typed:f,empty:!1,chosen:!0});continue}if(s.localName==="select"){l.push({name:s.name,value:s.value,typed:f,empty:s.value===""&&!f,chosen:!0});continue}if(s.type==="checkbox"){l.push({name:s.name,value:s.checked,typed:f,empty:!s.checked&&!c.has(s)&&!f});continue}let P=(s.type==="number"||s.type==="range")&&s.value!==""&&Number.isFinite(s.valueAsNumber)?s.valueAsNumber:s.value,E=f?o.get(s):void 0;l.push({name:s.name,value:P,typed:f,empty:s.value===""&&!f,...E?{from:E}:{}})}return{as:e.getAttribute("data-act")??"",...d&&t.contains(d)?{record:d.getAttribute("data-record")}:{},fields:l}},prefilled(e,t){c.delete(e),o.set(e,t),a.set(e,y(e))}};return i}var k=new WeakMap;function H(r){for(let a of r.querySelectorAll("[data-act], [data-graview-press]")){let c=b(a)&&!g(a)&&!h(a),o=k.get(a);if(c&&!o){let i=!a.hasAttribute("tabindex"),e=S(a);i&&a.setAttribute("tabindex","0"),e&&a.setAttribute("role","button"),a.setAttribute("data-graview-press",""),k.set(a,{tab:i,role:e})}else!c&&o&&(o.tab&&a.removeAttribute("tabindex"),o.role&&a.getAttribute("role")==="button"&&a.removeAttribute("role"),a.removeAttribute("data-graview-press"),k.delete(a))}}var T=1e3;function R(r){let a=r.getAttribute("data-debounce")?.trim(),c=a?Number(a):Number.NaN;return Number.isFinite(c)?Math.min(1e4,Math.max(250,Math.round(c))):T}function $(r){let a=r.trusted??(e=>e.isTrusted),c=r.timers??{set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)},o=new Map,i=(e,t)=>{let d=o.get(e);d&&c.clear(d.handle),o.delete(e);let u=r.reader.collect(e,t);u&&r.save(u,e)};return{heard(e,t,d){if(!h(t)||!a(e)||!t.hasAttribute("data-act"))return;let u=t.getAttribute("data-save");if(e.type==="input"&&u==="input"){let l=o.get(t);l&&c.clear(l.handle),o.set(t,{root:d,handle:c.set(()=>i(t,d),R(t))})}else e.type==="change"&&(u==="change"||u==="input"&&o.has(t))&&i(t,d)},flush(){for(let[e,{root:t}]of[...o])i(e,t)},get waiting(){return o.size}}}var O=new Set(["text","search","email","url","tel","number"]);function F(r,a,c,o){for(let i of r.querySelectorAll("input[data-prefill], textarea[data-prefill]")){let e=i;if(c.has(e))continue;let t=e.getAttribute("data-prefill")??"";if(t===""||e.getAttribute("name")!==t||e.localName==="input"&&!O.has(e.type))continue;if(e.value!==""){c.add(e);continue}let u=[...(e.closest("fieldset, [role='group']")??r).querySelectorAll("[data-act]")],l=e.closest("[data-record]"),n=new Set(u.map(p=>p.closest("[data-record]")?.getAttribute("data-record")).filter(p=>typeof p=="string")),s=l&&r.contains(l)?l.getAttribute("data-record"):n.size===1?[...n][0]:void 0;if(!s)continue;let f=o({record:s,field:t,acts:u.map(p=>p.getAttribute("data-act")??"")});if(f!==void 0){if(e.value=f,c.add(e),e.value!==f){e.value="";continue}a.prefilled(e,{record:s,field:t,value:f})}}}function W(r,a,c,o){let i=v(a,o.as);if(!i)return m("undeclared",`This view may not ask for \u201C${o.as}\u201D: its manifest does not name it.`);let e=r.allMutations().find(n=>n.name===i.act);if(!e)return m("unknown-act","There is no act by that name here.");let t={};if(o.record!==void 0){let n=i.record??e.subject?.arg;if(!n)return m("unbound",`\u201C${o.as}\u201D is not done to a record.`);if(!c.has(o.record))return m("unbound","That press is bound to a record this view was not shown.");t[n]=o.record}for(let[n,s]of Object.entries(i.constants??{})){if(n in t)return m("malformed",`\u201C${n}\u201D is both the bound record and a constant.`);t[n]=s}let d=e.input?.shape??{},u=new Set(Object.keys(d)),l=new Set;for(let n of o.fields)if(!(!u.has(n.name)||n.name in t)){if(l.has(n.name))return m("malformed",`Two fields here are called \u201C${n.name}\u201D.`);if(l.add(n.name),n.typed&&n.chosen){let s=A(d[n.name])?.find(f=>String(f)===String(n.value));if(s!==void 0)t[n.name]=s;else if(typeof n.value=="string"&&c.has(n.value))t[n.name]=n.value;else return m("untyped",`\u201C${n.name}\u201D was a choice among the view's own words, not one this app declares, so it was not sent.`)}else{if(n.typed&&n.from&&!(o.record===n.from.record&&n.name===n.from.field&&M(r,i,n.from.record,n.from.field)))return m("untyped",`\u201C${n.name}\u201D was filled in from a record for an act that writes it back there, not for this one, so it was not sent.`);if(n.typed&&n.from&&String(n.value)===n.from.value)t[n.name]=r.graph.getNode(n.from.record)?.[n.name]??n.value;else if(n.typed)t[n.name]=n.value;else if(!n.empty)return m("untyped",`\u201C${n.name}\u201D was filled in by the view, not typed by you, so it was not sent.`)}}return{ok:!0,name:i.act,args:t}}function M(r,a,c,o){let i=r.allMutations().find(u=>u.name===a.act),e=i?.subject;if(!i||!e||(a.record??e.arg)!==e.arg||o===e.arg||Object.hasOwn(a.constants??{},o)||!Object.hasOwn(i.input.shape??{},o)||Object.keys(i.writesOther??{}).length>0)return!1;let t=r.graph.getNode(c)?.kind,d=t===void 0?void 0:r.schema.tryDefinition(t);return!d||e.kinds!=="*"&&!e.kinds.includes(t)||!Object.hasOwn(d.fields.shape??{},o)?!1:i.writes?.includes(o)??!1}function q(r,a,c,o,i){if(!o.has(i.record))return;let e=r.seenBy(a).graph.getNode(i.record);if(!e||!i.acts.some(u=>{let l=v(c,u);if(!l||!M(r,l,i.record,i.field))return!1;let n=r.allMutations().find(s=>s.name===l.act).subject;return r.permits({name:l.act,args:{[n.arg]:i.record}},a).ok}))return;let d=e[i.field];return typeof d=="string"?d:typeof d=="number"&&Number.isFinite(d)?String(d):void 0}export{T as SAVE_DEBOUNCE_MS,I as createPressReader,$ as createSaver,F as fillPrefills,W as judgePress,H as markPresses,q as prefillOf,R as saveDebounceOf,M as writesBack};
|