@openparachute/notes-ui 0.1.0 → 0.1.1
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/CHANGELOG.md +54 -0
- package/dist/.parachute/info +1 -1
- package/dist/assets/{Activity-B6k-9wWy.js → Activity-DCz02G45.js} +1 -1
- package/dist/assets/{AddVault-DA_s9Ua2.js → AddVault-KGZOIx2j.js} +1 -1
- package/dist/assets/{Calendar-Dgd0dTEM.js → Calendar-CgYUCaSZ.js} +1 -1
- package/dist/assets/{Capture-C_s94G98.js → Capture-YgzRoZZX.js} +1 -1
- package/dist/assets/{NoteEditor-CxoH85Is.js → NoteEditor-DNYo0bPT.js} +1 -1
- package/dist/assets/{NoteNew-CTTJ_2cU.js → NoteNew-BWuLHfJV.js} +1 -1
- package/dist/assets/{NoteRenderer-cz03kLyS.js → NoteRenderer-CWW2zAJs.js} +1 -1
- package/dist/assets/{NoteView-B8BN-Dm4.js → NoteView-DR9WYC4s.js} +2 -2
- package/dist/assets/{OAuthCallback-CHpF2exs.js → OAuthCallback-5pCjuCLO.js} +1 -1
- package/dist/assets/{PinArchiveButtons-DogtDLiB.js → PinArchiveButtons-BO3QwhOp.js} +1 -1
- package/dist/assets/{Settings-DpNYPt6E.js → Settings-D8q_-oSw.js} +1 -1
- package/dist/assets/{Tags-C2seZlc0.js → Tags-BQjXsHYG.js} +1 -1
- package/dist/assets/{Today-Co3rl2Tl.js → Today-BZ5ksWIi.js} +1 -1
- package/dist/assets/VaultGraph-mQzbyY3l.js +3 -0
- package/dist/assets/{Vaults-GFmUZ3tT.js → Vaults-EaMq5ivX.js} +1 -1
- package/dist/assets/{index-BDPMEkxL.js → index-BF1NxtUe.js} +13 -13
- package/dist/assets/{react-force-graph-2d-CokIfB0T.js → react-force-graph-2d-CtvMkQ0a.js} +1 -1
- package/dist/assets/{useAttachmentUploader-CRSqlwYK.js → useAttachmentUploader-Du2IiCzJ.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/VaultGraph-9bEHl7fl.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as at,R as xo,p as bo}from"./index-
|
|
1
|
+
import{x as at,R as xo,p as bo}from"./index-BF1NxtUe.js";function wo(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function ko(e,n,r){return n=Eo(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e,n){return So(e)||wo(e,n)||ui(e,n)||Po()}function Ao(e){return Co(e)||Mo(e)||ui(e)||To()}function Co(e){if(Array.isArray(e))return gn(e)}function So(e){if(Array.isArray(e))return e}function Mo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ui(e,n){if(e){if(typeof e=="string")return gn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gn(e,n)}}function gn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function To(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Po(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Eo(e){var n=Oo(e,"string");return typeof n=="symbol"?n:String(n)}var Ro=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(Ao(Object.entries(n).filter(function(o){var a=Jn(o,1),s=a[0];return!i.has(s)}).map(function(o){var a=Jn(o,2),s=a[0],u=a[1];return ko({},s,u)}))))};function yn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function zo(e){if(Array.isArray(e))return e}function No(e){if(Array.isArray(e))return yn(e)}function Io(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $o(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function Do(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as N,r as te,a9 as Kf,M as Jf,c as eu,S as tu}from"./index-
|
|
1
|
+
import{x as N,r as te,a9 as Kf,M as Jf,c as eu,S as tu}from"./index-BF1NxtUe.js";function pS({onDropFiles:r,children:e,className:t,hint:i}){const[n,s]=N.useState(!1),l=N.useRef(0),o=N.useCallback(f=>{Ji(f.dataTransfer)&&(f.preventDefault(),l.current+=1,s(!0))},[]),a=N.useCallback(f=>{Ji(f.dataTransfer)&&(f.preventDefault(),l.current=Math.max(0,l.current-1),l.current===0&&s(!1))},[]),h=N.useCallback(f=>{Ji(f.dataTransfer)&&(f.preventDefault(),f.dataTransfer.dropEffect="copy")},[]),c=N.useCallback(f=>{if(!Ji(f.dataTransfer))return;f.preventDefault(),s(!1),l.current=0;const u=Array.from(f.dataTransfer.files);u.length>0&&r(u)},[r]);return te.jsxs("div",{className:`relative ${t??""}`,onDragEnter:o,onDragLeave:a,onDragOver:h,onDrop:c,children:[e,n?te.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-md border-2 border-dashed border-accent bg-accent/10 text-sm text-accent",children:te.jsxs("div",{className:"rounded-md bg-bg/80 px-4 py-2 font-medium shadow",children:["Drop to attach",i?te.jsxs("span",{className:"ml-2 text-fg-dim",children:["— ",i]}):null]})}):null]})}function Ji(r){if(!r)return!1;const e=r.types;for(let t=0;t<e.length;t++)if(e[t]==="Files")return!0;return!1}const iu="image/png,image/jpeg,image/gif,image/webp,audio/wav,audio/mpeg,audio/mp4,audio/ogg,audio/webm,video/webm,.wav,.mp3,.m4a,.ogg,.webm,.png,.jpg,.jpeg,.gif,.webp";function gS({onPickFiles:r,label:e="Attach files…",className:t}){const i=N.useRef(null);return te.jsxs(te.Fragment,{children:[te.jsx("button",{type:"button",onClick:()=>{var n;return(n=i.current)==null?void 0:n.click()},className:t??"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",title:"Upload an attachment",children:e}),te.jsx("input",{ref:i,type:"file",multiple:!0,accept:iu,className:"hidden",onChange:n=>{const s=Array.from(n.target.files??[]);s.length>0&&r(s),n.target.value=""}})]})}function mS({uploads:r,onCancel:e,onDismiss:t}){return r.length===0?null:te.jsx("ul",{className:"space-y-2",children:r.map(i=>te.jsxs("li",{className:"rounded-md border border-border bg-card/60 px-3 py-2 text-xs text-fg-muted",children:[te.jsxs("div",{className:"flex items-center justify-between gap-2",children:[te.jsx("span",{className:"truncate font-mono",title:i.filename,children:i.filename}),te.jsx("span",{className:"shrink-0",children:ru(i)})]}),i.status==="uploading"?te.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded bg-border/40",children:te.jsx("div",{className:"h-full bg-accent transition-[width]",style:{width:`${ja(i)}%`}})}):null,i.status==="error"&&i.error?te.jsx("p",{className:"mt-1 text-red-400",children:i.error}):null,te.jsx("div",{className:"mt-1 flex justify-end gap-2 text-xs",children:i.status==="uploading"||i.status==="linking"?te.jsx("button",{type:"button",onClick:()=>e(i.id),className:"text-fg-dim hover:text-fg",children:"Cancel"}):te.jsx("button",{type:"button",onClick:()=>t(i.id),className:"text-fg-dim hover:text-fg",children:"Dismiss"})})]},i.id))})}function ja(r){return r.size===0?0:Math.min(100,Math.round(r.loaded/r.size*100))}function ru(r){switch(r.status){case"uploading":return`${ja(r)}%`;case"linking":return"Linking…";case"done":return"Done";case"cancelled":return"Cancelled";case"error":return"Error"}}let Un=[],za=[];(()=>{let r="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<r.length;e++)(e%2?za:Un).push(t=t+r[e])})();function nu(r){if(r<768)return!1;for(let e=0,t=Un.length;;){let i=e+t>>1;if(r<Un[i])t=i;else if(r>=za[i])e=i+1;else return!0;if(e==t)return!1}}function Cl(r){return r>=127462&&r<=127487}const Al=8205;function su(r,e,t=!0,i=!0){return(t?La:lu)(r,e,i)}function La(r,e,t){if(e==r.length)return e;e&&_a(r.charCodeAt(e))&&Ya(r.charCodeAt(e-1))&&e--;let i=dn(r,e);for(e+=Rl(i);e<r.length;){let n=dn(r,e);if(i==Al||n==Al||t&&nu(n))e+=Rl(n),i=n;else if(Cl(n)){let s=0,l=e-2;for(;l>=0&&Cl(dn(r,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function lu(r,e,t){for(;e>0;){let i=La(r,e-2,t);if(i<e)return i;e--}return 0}function dn(r,e){let t=r.charCodeAt(e);if(!Ya(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return _a(i)?(t-55296<<10)+(i-56320)+65536:t}function _a(r){return r>=56320&&r<57344}function Ya(r){return r>=55296&&r<56320}function Rl(r){return r<65536?1:2}class z{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Dt(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),Be.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Dt(this,e,t);let i=[];return this.decompose(e,t,i,0),Be.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new mi(this),s=new mi(e);for(let l=t,o=t;;){if(n.next(l),s.next(l),l=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(o+=n.value.length,n.done||o>=i)return!0}}iter(e=1){return new mi(this,e)}iterRange(e,t=this.length){return new Ea(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Va(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new J(e):Be.from(J.split(e,[]))}}class J extends z{constructor(e,t=ou(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.text[s],o=n+l.length;if((t?i:o)>=e)return new au(n,o,i,l);n=o+1,i++}}decompose(e,t,i,n){let s=e<=0&&t>=this.length?this:new J(Ml(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let l=i.pop(),o=Sr(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new J(o,l.length+s.length));else{let a=o.length>>1;i.push(new J(o.slice(0,a)),new J(o.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof J))return super.replace(e,t,i);[e,t]=Dt(this,e,t);let n=Sr(this.text,Sr(i.text,Ml(this.text,0,e)),t),s=this.length+i.length-(t-e);return n.length<=32?new J(n,s):Be.from(J.split(n,[]),s)}sliceString(e,t=this.length,i=`
|
|
2
2
|
`){[e,t]=Dt(this,e,t);let n="";for(let s=0,l=0;s<=t&&l<this.text.length;l++){let o=this.text[l],a=s+o.length;s>e&&l&&(n+=i),e<a&&t>s&&(n+=o.slice(Math.max(0,e-s),t-s)),s=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let s of e)i.push(s),n+=s.length+1,i.length==32&&(t.push(new J(i,n)),i=[],n=-1);return n>-1&&t.push(new J(i,n)),t}}class Be extends z{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.children[s],o=n+l.length,a=i+l.lines-1;if((t?a:o)>=e)return l.lineInner(e,t,i,n);n=o+1,i=a+1}}decompose(e,t,i,n){for(let s=0,l=0;l<=t&&s<this.children.length;s++){let o=this.children[s],a=l+o.length;if(e<=a&&t>=l){let h=n&((l<=e?1:0)|(a>=t?2:0));l>=e&&a<=t&&!h?i.push(o):o.decompose(e-l,t-l,i,h)}l=a+1}}replace(e,t,i){if([e,t]=Dt(this,e,t),i.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let l=this.children[n],o=s+l.length;if(e>=s&&t<=o){let a=l.replace(e-s,t-s,i),h=this.lines-l.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[n]=a,new Be(c,this.length-(t-e)+i.length)}return super.replace(s,o,a)}s=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
3
3
|
`){[e,t]=Dt(this,e,t);let n="";for(let s=0,l=0;s<this.children.length&&l<=t;s++){let o=this.children[s],a=l+o.length;l>e&&s&&(n+=i),e<a&&t>l&&(n+=o.sliceString(e-l,t-l,i)),l=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Be))return 0;let i=0,[n,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==l||s==o)return i;let a=this.children[n],h=e.children[s];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let O of e)i+=O.lines;if(i<32){let O=[];for(let d of e)d.flatten(O);return new J(O,t)}let n=Math.max(32,i>>5),s=n<<1,l=n>>1,o=[],a=0,h=-1,c=[];function f(O){let d;if(O.lines>s&&O instanceof Be)for(let p of O.children)f(p);else O.lines>l&&(a>l||!a)?(u(),o.push(O)):O instanceof J&&a&&(d=c[c.length-1])instanceof J&&O.lines+d.lines<=32?(a+=O.lines,h+=O.length+1,c[c.length-1]=new J(d.text.concat(O.text),d.length+1+O.length)):(a+O.lines>n&&u(),a+=O.lines,h+=O.length+1,c.push(O))}function u(){a!=0&&(o.push(c.length==1?c[0]:Be.from(c,h)),h=-1,a=c.length=0)}for(let O of e)f(O);return u(),o.length==1?o[0]:new Be(o,t)}}z.empty=new J([""],0);function ou(r){let e=-1;for(let t of r)e+=t.length+1;return e}function Sr(r,e,t=0,i=1e9){for(let n=0,s=0,l=!0;s<r.length&&n<=i;s++){let o=r[s],a=n+o.length;a>=t&&(a>i&&(o=o.slice(0,i-n)),n<t&&(o=o.slice(t-n)),l?(e[e.length-1]+=o,l=!1):e.push(o)),n=a+1}return e}function Ml(r,e,t){return Sr(r,[""],e,t)}class mi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof J?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],l=s>>1,o=n instanceof J?n.text.length:n.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
4
|
`,this;e--}else if(n instanceof J){let a=n.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=n.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof J?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Ea{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new mi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Va{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(z.prototype[Symbol.iterator]=function(){return this.iter()},mi.prototype[Symbol.iterator]=Ea.prototype[Symbol.iterator]=Va.prototype[Symbol.iterator]=function(){return this});let au=class{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}};function Dt(r,e,t){return e=Math.max(0,Math.min(r.length,e)),[e,Math.max(e,Math.min(r.length,t))]}function he(r,e,t=!0,i=!0){return su(r,e,t,i)}function hu(r){return r>=56320&&r<57344}function cu(r){return r>=55296&&r<56320}function fu(r,e){let t=r.charCodeAt(e);if(!cu(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return hu(i)?(t-55296<<10)+(i-56320)+65536:t}function uu(r){return r<65536?1:2}const Fn=/\r\n?|\n/;var Oe=(function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r})(Oe||(Oe={}));class Ue{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,n=0;t<this.sections.length;){let s=this.sections[t++],l=this.sections[t++];l<0?(e(i,n,s),n+=s):n+=l,i+=s}}iterChangedRanges(e,t=!1){Hn(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];n<0?e.push(i,n):e.push(n,i)}return new Ue(e)}composeDesc(e){return this.empty?e:e.empty?this:Wa(this,e)}mapDesc(e,t=!1){return e.empty?this:Kn(this,e,t)}mapPos(e,t=-1,i=Oe.Simple){let n=0,s=0;for(let l=0;l<this.sections.length;){let o=this.sections[l++],a=this.sections[l++],h=n+o;if(a<0){if(h>e)return s+(e-n);s+=o}else{if(i!=Oe.Simple&&h>=e&&(i==Oe.TrackDel&&n<e&&h>e||i==Oe.TrackBefore&&n<e||i==Oe.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!o)return e==n||t<0?s:s+a;s+=a}n=h}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let i=0,n=0;i<this.sections.length&&n<=t;){let s=this.sections[i++],l=this.sections[i++],o=n+s;if(l>=0&&n<=t&&o>=e)return n<e&&o>t?"cover":!0;n=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+i+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ue(e)}static create(e){return new Ue(e)}}class re extends Ue{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Hn(this,(t,i,n,s,l)=>e=e.replace(n,n+(i-t),l),!1),e}mapDesc(e,t=!1){return Kn(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,s=0;n<t.length;n+=2){let l=t[n],o=t[n+1];if(o>=0){t[n]=o,t[n+1]=l;let a=n>>1;for(;i.length<a;)i.push(z.empty);i.push(l?e.slice(s,s+l):z.empty)}s+=l}return new re(t,i)}compose(e){return this.empty?e:e.empty?this:Wa(this,e,!0)}map(e,t=!1){return e.empty?this:Kn(this,e,t,!0)}iterChanges(e,t=!1){Hn(this,e,t)}get desc(){return Ue.create(this.sections)}filter(e){let t=[],i=[],n=[],s=new wi(this);e:for(let l=0,o=0;;){let a=l==e.length?1e9:e[l++];for(;o<a||o==a&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,a-o);ae(n,c,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;ae(t,c,f),f>0&&Ot(i,t,s.text),s.forward(c),o+=c}let h=e[l++];for(;o<h;){if(s.done)break e;let c=Math.min(s.len,h-o);ae(t,c,-1),ae(n,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),o+=c}}return{changes:new re(t,i),filtered:Ue.create(n)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],n=this.sections[t+1];n<0?e.push(i):n==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let n=[],s=[],l=0,o=null;function a(c=!1){if(!c&&!n.length)return;l<t&&ae(n,t-l,-1);let f=new re(n,s);o=o?o.compose(f.map(o)):f,n=[],s=[],l=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof re){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),o=o?o.compose(c.map(o)):c}else{let{from:f,to:u=f,insert:O}=c;if(f>u||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let d=O?typeof O=="string"?z.of(O.split(i||Fn)):O:z.empty,p=d.length;if(f==u&&p==0)return;f<l&&a(),f>l&&ae(n,f-l,-1),ae(n,u-f,p),Ot(s,n,d),l=u}}return h(e),a(!o),o}static empty(e){return new re(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;n<e.length;n++){let s=e[n];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((l,o)=>o&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length<n;)i.push(z.empty);i[n]=z.of(s.slice(1)),t.push(s[0],i[n].length)}}}return new re(t,i)}static createSet(e,t){return new re(e,t)}}function ae(r,e,t,i=!1){if(e==0&&t<=0)return;let n=r.length-2;n>=0&&t<=0&&t==r[n+1]?r[n]+=e:n>=0&&e==0&&r[n]==0?r[n+1]+=t:i?(r[n]+=e,r[n+1]+=t):r.push(e,t)}function Ot(r,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<r.length)r[r.length-1]=r[r.length-1].append(t);else{for(;r.length<i;)r.push(z.empty);r.push(t)}}function Hn(r,e,t){let i=r.inserted;for(let n=0,s=0,l=0;l<r.sections.length;){let o=r.sections[l++],a=r.sections[l++];if(a<0)n+=o,s+=o;else{let h=n,c=s,f=z.empty;for(;h+=o,c+=a,a&&i&&(f=f.append(i[l-2>>1])),!(t||l==r.sections.length||r.sections[l+1]<0);)o=r.sections[l++],a=r.sections[l++];e(n,h,s,c,f),n=h,s=c}}}function Kn(r,e,t,i=!1){let n=[],s=i?[]:null,l=new wi(r),o=new wi(e);for(let a=-1;;){if(l.done&&o.len||o.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&o.ins==-1){let h=Math.min(l.len,o.len);ae(n,h,-1),l.forward(h),o.forward(h)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len<l.len||o.len==l.len&&!t))){let h=o.len;for(ae(n,o.ins,-1);h;){let c=Math.min(l.len,h);l.ins>=0&&a<l.i&&l.len<=c&&(ae(n,0,l.ins),s&&Ot(s,n,l.text),a=l.i),l.forward(c),h-=c}o.next()}else if(l.ins>=0){let h=0,c=l.len;for(;c;)if(o.ins==-1){let f=Math.min(c,o.len);h+=f,c-=f,o.forward(f)}else if(o.ins==0&&o.len<c)c-=o.len,o.next();else break;ae(n,h,a<l.i?l.ins:0),s&&a<l.i&&Ot(s,n,l.text),a=l.i,l.forward(l.len-c)}else{if(l.done&&o.done)return s?re.createSet(n,s):Ue.create(n);throw new Error("Mismatched change set lengths")}}}function Wa(r,e,t=!1){let i=[],n=t?[]:null,s=new wi(r),l=new wi(e);for(let o=!1;;){if(s.done&&l.done)return n?re.createSet(i,n):Ue.create(i);if(s.ins==0)ae(i,s.len,0,o),s.next();else if(l.len==0&&!l.done)ae(i,0,l.ins,o),n&&Ot(n,i,l.text),l.next();else{if(s.done||l.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,l.len),h=i.length;if(s.ins==-1){let c=l.ins==-1?-1:l.off?0:l.ins;ae(i,a,c,o),n&&c&&Ot(n,i,l.text)}else l.ins==-1?(ae(i,s.off?0:s.len,a,o),n&&Ot(n,i,s.textBit(a))):(ae(i,s.off?0:s.len,l.off?0:l.ins,o),n&&!l.off&&Ot(n,i,l.text));o=(s.ins>a||l.ins>=0&&l.len>a)&&(o||i.length>h),s.forward2(a),l.forward(a)}}}}class wi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?z.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?z.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class vt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new vt(i,n,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t,void 0,void 0,i);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,n,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,i){return new vt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new b([this.main],0)}addRange(e,t=!0){return b.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,b.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>vt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<e.length;n++){let s=e[n];if(s.empty?s.from<=i:s.from<i)return b.normalized(e.slice(),t);i=s.to}return new b(e,t)}static cursor(e,t=0,i,n){return vt.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(n??16777215)<<6)}static range(e,t,i,n,s){let l=(i??16777215)<<6|(n==null?7:Math.min(6,n));return!s&&e!=t&&(s=t<e?1:-1),t<e?vt.create(t,e,48|l):vt.create(e,t,(s?s<0?8:16:0)|l)}static normalized(e,t=0){let i=e[t];e.sort((n,s)=>n.from-s.from),t=e.indexOf(i);for(let n=1;n<e.length;n++){let s=e[n],l=e[n-1];if(s.empty?s.from<=l.to:s.from<l.to){let o=l.from,a=Math.max(s.to,l.to);n<=t&&t--,e.splice(--n,2,s.anchor>s.head?b.range(a,o):b.range(o,a))}}return new b(e,t)}}function Ba(r,e){for(let t of r.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Ds=0;class X{constructor(e,t,i,n,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=Ds++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new X(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Is),!!e.static,e.enables)}of(e){return new Qr([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Qr(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Qr(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Is(r,e){return r==e||r.length==e.length&&r.every((t,i)=>t===e[i])}class Qr{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=Ds++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[l]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Jn(f,c)){let O=i(f);if(o?!jl(O,f.values[l],n):!n(O,f.values[l]))return f.values[l]=O,1}return 0},reconfigure:(f,u)=>{let O,d=u.config.address[s];if(d!=null){let p=Zr(u,d);if(this.dependencies.every(m=>m instanceof X?u.facet(m)===f.facet(m):m instanceof lt?u.field(m,!1)==f.field(m,!1):!0)||(o?jl(O=i(f),p,n):n(O=i(f),p)))return f.values[l]=p,0}else O=i(f);return f.values[l]=O,1}}}}function jl(r,e,t){if(r.length!=e.length)return!1;for(let i=0;i<r.length;i++)if(!t(r[i],e[i]))return!1;return!0}function Jn(r,e){let t=!1;for(let i of e)Si(r,i)&1&&(t=!0);return t}function Ou(r,e,t){let i=t.map(a=>r[a.id]),n=t.map(a=>a.type),s=i.filter(a=>!(a&1)),l=r[e.id]>>1;function o(a){let h=[];for(let c=0;c<i.length;c++){let f=Zr(a,i[c]);if(n[c]==2)for(let u of f)h.push(u);else h.push(f)}return e.combine(h)}return{create(a){for(let h of i)Si(a,h);return a.values[l]=o(a),1},update(a,h){if(!Jn(a,s))return 0;let c=o(a);return e.compare(c,a.values[l])?0:(a.values[l]=c,1)},reconfigure(a,h){let c=Jn(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&Is(t,f))return a.values[l]=u,0;let O=o(a);return e.compare(O,u)?(a.values[l]=u,0):(a.values[l]=O,1)}}}const er=X.define({static:!0});class lt{constructor(e,t,i,n,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=n,this.spec=s,this.provides=void 0}static define(e){let t=new lt(Ds++,e.create,e.update,e.compare||((i,n)=>i===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(er).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,n)=>{let s=i.values[t],l=this.updateF(s,n);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,n)=>{let s=i.facet(er),l=n.facet(er),o;return(o=s.find(a=>a.field==this))&&o!=l.find(a=>a.field==this)?(i.values[t]=o.create(i),1):n.config.address[this.id]!=null?(i.values[t]=n.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,er.of({field:this,create:e})]}get extension(){return this}}const $t={lowest:4,low:3,default:2,high:1,highest:0};function li(r){return e=>new qa(e,r)}const Ei={highest:li($t.highest),high:li($t.high),default:li($t.default),low:li($t.low),lowest:li($t.lowest)};class qa{constructor(e,t){this.inner=e,this.prec=t}}class Jr{of(e){return new es(this,e)}reconfigure(e){return Jr.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class es{constructor(e,t){this.compartment=e,this.inner=t}}class Tr{constructor(e,t,i,n,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let n=[],s=Object.create(null),l=new Map;for(let u of du(e,t,l))u instanceof lt?n.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let o=Object.create(null),a=[],h=[];for(let u of n)o[u.id]=h.length<<1,h.push(O=>u.slot(O));let c=i==null?void 0:i.config.facets;for(let u in s){let O=s[u],d=O[0].facet,p=c&&c[u]||[];if(O.every(m=>m.type==0))if(o[d.id]=a.length<<1|1,Is(p,O))a.push(i.facet(d));else{let m=d.combine(O.map(S=>S.value));a.push(i&&d.compare(m,i.facet(d))?i.facet(d):m)}else{for(let m of O)m.type==0?(o[m.id]=a.length<<1|1,a.push(m.value)):(o[m.id]=h.length<<1,h.push(S=>m.dynamicSlot(S)));o[d.id]=h.length<<1,h.push(m=>Ou(m,d,O))}}let f=h.map(u=>u(o));return new Tr(e,l,f,o,a,s)}}function du(r,e,t){let i=[[],[],[],[],[]],n=new Map;function s(l,o){let a=n.get(l);if(a!=null){if(a<=o)return;let h=i[a].indexOf(l);h>-1&&i[a].splice(h,1),l instanceof es&&t.delete(l.compartment)}if(n.set(l,o),Array.isArray(l))for(let h of l)s(h,o);else if(l instanceof es){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),s(h,o)}else if(l instanceof qa)s(l.inner,l.prec);else if(l instanceof lt)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof Qr)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,$t.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,o)}}return s(r,$t.default),i.reduce((l,o)=>l.concat(o))}function Si(r,e){if(e&1)return 2;let t=e>>1,i=r.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;r.status[t]=4;let n=r.computeSlot(r,r.config.dynamicSlots[t]);return r.status[t]=2|n}function Zr(r,e){return e&1?r.config.staticValues[e>>1]:r.values[e>>1]}const Da=X.define(),ts=X.define({combine:r=>r.some(e=>e),static:!0}),Ia=X.define({combine:r=>r.length?r[0]:void 0,static:!0}),Ga=X.define(),Na=X.define(),Ua=X.define(),Fa=X.define({combine:r=>r.length?r[0]:!1});class ot{constructor(e,t){this.type=e,this.value=t}static define(){return new pu}}class pu{of(e){return new ot(this,e)}}class gu{constructor(e){this.map=e}of(e){return new I(this,e)}}class I{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new I(this.type,t)}is(e){return this.type==e}static define(e={}){return new gu(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let s=n.map(t);s&&i.push(s)}return i}}I.reconfigure=I.define();I.appendConfig=I.define();class ie{constructor(e,t,i,n,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&Ba(i,t.newLength),s.some(o=>o.type==ie.time)||(this.annotations=s.concat(ie.time.of(Date.now())))}static create(e,t,i,n,s,l){return new ie(e,t,i,n,s,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ie.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ie.time=ot.define();ie.userEvent=ot.define();ie.addToHistory=ot.define();ie.remote=ot.define();function mu(r,e){let t=[];for(let i=0,n=0;;){let s,l;if(i<r.length&&(n==e.length||e[n]>=r[i]))s=r[i++],l=r[i++];else if(n<e.length)s=e[n++],l=e[n++];else return t;!t.length||t[t.length-1]<s?t.push(s,l):t[t.length-1]<l&&(t[t.length-1]=l)}}function Ha(r,e,t){var i;let n,s,l;return t?(n=e.changes,s=re.empty(e.changes.length),l=r.changes.compose(e.changes)):(n=e.changes.map(r.changes),s=r.changes.mapDesc(e.changes,!0),l=r.changes.compose(n)),{changes:l,selection:e.selection?e.selection.map(s):(i=r.selection)===null||i===void 0?void 0:i.map(n),effects:I.mapEffects(r.effects,n).concat(I.mapEffects(e.effects,s)),annotations:r.annotations.length?r.annotations.concat(e.annotations):e.annotations,scrollIntoView:r.scrollIntoView||e.scrollIntoView}}function is(r,e,t){let i=e.selection,n=Yt(e.annotations);return e.userEvent&&(n=n.concat(ie.userEvent.of(e.userEvent))),{changes:e.changes instanceof re?e.changes:re.of(e.changes||[],t,r.facet(Ia)),selection:i&&(i instanceof b?i:b.single(i.anchor,i.head)),effects:Yt(e.effects),annotations:n,scrollIntoView:!!e.scrollIntoView}}function Ka(r,e,t){let i=is(r,e.length?e[0]:{},r.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let l=!!e[s].sequential;i=Ha(i,is(r,e[s],l?i.changes.newLength:r.doc.length),l)}let n=ie.create(r,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Qu(t?Su(n):n)}function Su(r){let e=r.startState,t=!0;for(let n of e.facet(Ga)){let s=n(r);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:mu(t,s))}if(t!==!0){let n,s;if(t===!1)s=r.changes.invertedDesc,n=re.empty(e.doc.length);else{let l=r.changes.filter(t);n=l.changes,s=l.filtered.mapDesc(l.changes).invertedDesc}r=ie.create(e,n,r.selection&&r.selection.map(s),I.mapEffects(r.effects,s),r.annotations,r.scrollIntoView)}let i=e.facet(Na);for(let n=i.length-1;n>=0;n--){let s=i[n](r);s instanceof ie?r=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ie?r=s[0]:r=Ka(e,Yt(s),!1)}return r}function Qu(r){let e=r.startState,t=e.facet(Ua),i=r;for(let n=t.length-1;n>=0;n--){let s=t[n](r);s&&Object.keys(s).length&&(i=Ha(i,is(e,s,r.changes.newLength),!0))}return i==r?r:ie.create(e,r.changes,r.selection,i.effects,i.annotations,i.scrollIntoView)}const bu=[];function Yt(r){return r==null?bu:Array.isArray(r)?r:[r]}var tt=(function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r})(tt||(tt={}));const ku=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let rs;try{rs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function yu(r){if(rs)return rs.test(r);for(let e=0;e<r.length;e++){let t=r[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||ku.test(t)))return!0}return!1}function xu(r){return e=>{if(!/\S/.test(e))return tt.Space;if(yu(e))return tt.Word;for(let t=0;t<r.length;t++)if(e.indexOf(r[t])>-1)return tt.Word;return tt.Other}}class _{constructor(e,t,i,n,s,l){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)Si(this,o<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Si(this,i),Zr(this,i)}update(...e){return Ka(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:n}=t;for(let o of e.effects)o.is(Jr.reconfigure)?(t&&(n=new Map,t.compartments.forEach((a,h)=>n.set(h,a)),t=null),n.set(o.value.compartment,o.value.extension)):o.is(I.reconfigure)?(t=null,i=o.value):o.is(I.appendConfig)&&(t=null,i=Yt(i).concat(o.value));let s;t?s=e.startState.values.slice():(t=Tr.resolve(i,n,this),s=new _(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let l=e.startState.facet(ts)?e.newSelection:e.newSelection.asSingle();new _(t,e.newDoc,l,s,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),s=[i.range],l=Yt(i.effects);for(let o=1;o<t.ranges.length;o++){let a=e(t.ranges[o]),h=this.changes(a.changes),c=h.map(n);for(let u=0;u<o;u++)s[u]=s[u].map(c);let f=n.mapDesc(h,!0);s.push(a.range.map(f)),n=n.compose(c),l=I.mapEffects(l,c).concat(I.mapEffects(Yt(a.effects),f))}return{changes:n,selection:b.create(s,t.mainIndex),effects:l}}changes(e=[]){return e instanceof re?e:re.of(e,this.doc.length,this.facet(_.lineSeparator))}toText(e){return z.of(e.split(this.facet(_.lineSeparator)||Fn))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Si(this,t),Zr(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let n=e[i];n instanceof lt&&this.config.address[n.id]!=null&&(t[i]=n.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let l=i[s],o=e[s];n.push(l.init(a=>l.spec.fromJSON(o,a)))}}return _.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=Tr.resolve(e.extensions||[],new Map),i=e.doc instanceof z?e.doc:z.of((e.doc||"").split(t.staticFacet(_.lineSeparator)||Fn)),n=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return Ba(n,i.length),t.staticFacet(ts)||(n=n.asSingle()),new _(t,i,n,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(_.tabSize)}get lineBreak(){return this.facet(_.lineSeparator)||`
|
package/dist/index.html
CHANGED
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
} catch (e) {}
|
|
20
20
|
})();
|
|
21
21
|
</script>
|
|
22
|
-
<script type="module" crossorigin src="
|
|
23
|
-
<link rel="stylesheet" crossorigin href="
|
|
24
|
-
<link rel="manifest" href="
|
|
22
|
+
<script type="module" crossorigin src="./assets/index-BF1NxtUe.js"></script>
|
|
23
|
+
<link rel="stylesheet" crossorigin href="./assets/index-D_L2igjK.css">
|
|
24
|
+
<link rel="manifest" href="./manifest.webmanifest"></head>
|
|
25
25
|
<body>
|
|
26
26
|
<div id="root"></div>
|
|
27
27
|
</body>
|
package/dist/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),t={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map(e=>t[e]||o(e))).then(e=>(l(...e),a))}}define(["./workbox-b9acee4e"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"},{url:"index.html",revision:"
|
|
1
|
+
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),t={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map(e=>t[e]||o(e))).then(e=>(l(...e),a))}}define(["./workbox-b9acee4e"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"},{url:"index.html",revision:"fa9e70940ab322ea0b4a1e0eab08985b"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/useAttachmentUploader-Du2IiCzJ.js",revision:null},{url:"assets/react-force-graph-2d-CtvMkQ0a.js",revision:null},{url:"assets/index-D_L2igjK.css",revision:null},{url:"assets/index-BF1NxtUe.js",revision:null},{url:"assets/dates-BGZoWpL2.js",revision:null},{url:"assets/Vaults-EaMq5ivX.js",revision:null},{url:"assets/VaultGraph-mQzbyY3l.js",revision:null},{url:"assets/Today-BZ5ksWIi.js",revision:null},{url:"assets/Tags-BQjXsHYG.js",revision:null},{url:"assets/Settings-D8q_-oSw.js",revision:null},{url:"assets/PinArchiveButtons-BO3QwhOp.js",revision:null},{url:"assets/OAuthCallback-5pCjuCLO.js",revision:null},{url:"assets/NoteView-DR9WYC4s.js",revision:null},{url:"assets/NoteRenderer-CWW2zAJs.js",revision:null},{url:"assets/NoteNew-BWuLHfJV.js",revision:null},{url:"assets/NoteEditor-DNYo0bPT.js",revision:null},{url:"assets/Capture-YgzRoZZX.js",revision:null},{url:"assets/Calendar-CgYUCaSZ.js",revision:null},{url:"assets/AddVault-KGZOIx2j.js",revision:null},{url:"assets/Activity-DCz02G45.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/notes/index.html"),{denylist:[/^\/api\//,/^\/oauth\//,/^\/\.well-known\//]})),e.registerRoute(/^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts",plugins:[new e.ExpirationPlugin({maxEntries:30,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openparachute/notes-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Parachute Notes UI bundle — the SPA installed under parachute-app as the canonical first app. No daemon, no module surface; just the built dist/.",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-force-graph-2d-CokIfB0T.js","assets/index-BDPMEkxL.js","assets/index-D_L2igjK.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{aa as w,F as N,x as f,r as s,N as k,L as v,Q as C,V as I,_ as M}from"./index-BDPMEkxL.js";const S={search:"",tags:[]};function T(e){const t=new Map;for(const i of e)t.set(i.id,i);const a=new Map,o=new Map;for(const i of e)for(const n of i.links??[]){if(n.sourceId===n.targetId||!t.has(n.sourceId)||!t.has(n.targetId))continue;const c=`${n.sourceId}|${n.targetId}|${n.relationship}`;a.has(c)||(a.set(c,{source:n.sourceId,target:n.targetId,relationship:n.relationship}),o.set(n.sourceId,(o.get(n.sourceId)??0)+1),o.set(n.targetId,(o.get(n.targetId)??0)+1))}return{nodes:e.map(i=>{var c;const n=i.tags??[];return{id:i.id,path:i.path,title:A(i),tags:n,topTag:n[0],degree:o.get(i.id)??0,summary:typeof((c=i.metadata)==null?void 0:c.summary)=="string"?i.metadata.summary:void 0}}),edges:[...a.values()]}}function A(e){return e.path?(e.path.split("/").pop()??e.path).replace(/\.md$/i,""):e.id}function R(e,t){const a=t.search.trim().toLowerCase();return!(a&&![e.path??"",e.title,e.id].join(" ").toLowerCase().includes(a)||t.tags.length>0&&!t.tags.some(d=>e.tags.includes(d)))}function E(e){const t=new Map;for(const a of e)for(const o of a.tags)t.set(o,(t.get(o)??0)+1);return[...t.entries()].sort((a,o)=>o[1]-a[1]||a[0].localeCompare(o[0])).map(([a])=>a)}function F(e){if(!e)return"#8a9a7a";let t=0;for(let o=0;o<e.length;o++)t=t*31+e.charCodeAt(o)&16777215;return`hsl(${t%360}, 40%, 55%)`}const _=f.lazy(()=>M(()=>import("./react-force-graph-2d-CokIfB0T.js"),__vite__mapDeps([0,1,2]))),L=20;function O(){const e=w(c=>c.getActiveVault()),t=N(),[a,o]=f.useState(S),d=f.useMemo(()=>t.data?T(t.data):null,[t.data]),i=f.useMemo(()=>d?E(d.nodes):[],[d]),n=f.useMemo(()=>d?new Set(d.nodes.filter(c=>R(c,a)).map(c=>c.id)):new Set,[d,a]);return e?s.jsxs("div",{className:"flex h-[calc(100dvh-5rem)] flex-col",children:[s.jsx("div",{className:"border-b border-border bg-card/40 px-6 py-3",children:s.jsxs("div",{className:"mx-auto flex max-w-6xl flex-wrap items-center gap-4",children:[s.jsx("input",{type:"search",value:a.search,onChange:c=>o(m=>({...m,search:c.target.value})),placeholder:"Search nodes…","aria-label":"Search graph nodes",className:"min-w-48 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg focus:border-accent focus:outline-none"}),s.jsx($,{allTags:i,selected:a.tags,onChange:c=>o(m=>({...m,tags:c}))}),d?s.jsxs("span",{className:"text-xs text-fg-dim",children:[n.size," / ",d.nodes.length," notes"]}):null]})}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(P,{query:t,graph:d,matched:n})})]}):s.jsx(k,{to:"/",replace:!0})}function P({query:e,graph:t,matched:a}){return e.isPending?s.jsx(y,{message:"Loading vault…"}):e.isError?s.jsx(B,{error:e.error}):!t||t.nodes.length===0?s.jsx("div",{className:"flex h-full items-center justify-center p-10",children:s.jsxs("div",{className:"max-w-sm rounded-md border border-border bg-card p-8 text-center",children:[s.jsx("p",{className:"mb-2 font-serif text-xl",children:"No notes yet"}),s.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:"This vault is empty. Start by creating the first note."}),s.jsx(v,{to:"/new",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Create a note"})]})}):s.jsx(z,{graph:t,matched:a})}function $({allTags:e,selected:t,onChange:a}){const o=e.slice(0,L);if(o.length===0)return null;const d=i=>a(t.includes(i)?t.filter(n=>n!==i):[...t,i]);return s.jsxs("fieldset",{"aria-label":"Filter by tag",className:"flex flex-wrap items-center gap-1 text-xs text-fg-dim",children:[s.jsx("legend",{className:"mr-1 inline-block",children:"Tags"}),o.map(i=>{const n=t.includes(i);return s.jsx("button",{type:"button","aria-pressed":n,onClick:()=>d(i),className:n?"max-w-full break-all rounded-full border border-accent bg-accent/10 px-2 py-0.5 text-accent":"max-w-full break-all rounded-full border border-border bg-card px-2 py-0.5 hover:text-accent",children:i},i)}),t.length>0?s.jsx("button",{type:"button",onClick:()=>a([]),className:"ml-1 text-xs text-fg-dim hover:text-accent",children:"Clear"}):null]})}function y({message:e}){return s.jsx("div",{"aria-busy":"true",className:"flex h-full animate-pulse items-center justify-center bg-card/30 text-sm text-fg-dim",children:e})}function z({graph:e,matched:t}){const a=C(),o=f.useRef(null),d=f.useRef(null),[i,n]=f.useState({w:800,h:600});f.useEffect(()=>{const r=o.current;if(!r)return;const l=()=>{const u=r.getBoundingClientRect();n({w:Math.max(320,Math.floor(u.width)),h:Math.max(320,Math.floor(u.height))})};l();const h=new ResizeObserver(l);return h.observe(r),()=>h.disconnect()},[]);const c=()=>{var r,l;(l=(r=d.current)==null?void 0:r.zoomToFit)==null||l.call(r,400,40)},m=f.useMemo(()=>({nodes:e.nodes.map(r=>({...r})),links:e.edges.map(r=>({source:r.source,target:r.target,rel:r.relationship}))}),[e]),g=t.size!==e.nodes.length,j=r=>!g||t.has(r)?1:.15;return s.jsxs("div",{ref:o,"data-testid":"vault-graph-canvas",className:"relative h-full w-full touch-none",children:[s.jsx(f.Suspense,{fallback:s.jsx(y,{message:"Rendering graph…"}),children:s.jsx(_,{ref:d,graphData:m,width:i.w,height:i.h,backgroundColor:"rgba(0,0,0,0)",nodeLabel:r=>V(r),nodeRelSize:5,nodeVal:r=>2+Math.min(r.degree,12),nodeColor:r=>{const l=r,h=F(l.topTag);return g&&!t.has(l.id)?G(h):h},nodePointerAreaPaint:(r,l,h)=>{const u=r;if(u.x==null||u.y==null)return;const x=2+Math.min(u.degree,12),p=Math.max(Math.sqrt(x)*5,10);h.fillStyle=l,h.beginPath(),h.arc(u.x,u.y,p,0,2*Math.PI),h.fill()},linkColor:r=>{const l=r,h=b(l.source),u=b(l.target);return g&&(!t.has(h)||!t.has(u))?"rgba(160, 160, 160, 0.08)":"rgba(160, 160, 160, 0.35)"},linkDirectionalArrowLength:2.5,linkDirectionalArrowRelPos:1,cooldownTicks:100,onEngineStop:()=>c(),nodeCanvasObjectMode:()=>"after",nodeCanvasObject:(r,l,h)=>{const u=r;if(u.x==null||u.y==null||j(u.id)<.5)return;const p=10/h;l.font=`${p}px sans-serif`,l.fillStyle="rgba(220, 220, 220, 0.8)",l.textAlign="left",l.textBaseline="middle",l.fillText(u.title,u.x+6,u.y)},onNodeClick:r=>{a(`/n/${encodeURIComponent(r.id)}`)}})}),s.jsx("button",{type:"button",onClick:c,className:"absolute right-3 bottom-3 rounded-md border border-border bg-card/90 px-3 py-1.5 text-xs text-fg-muted shadow-sm backdrop-blur hover:text-accent",children:"Fit to screen"})]})}function V(e){const t=[e.path??e.id,`${e.degree} link${e.degree===1?"":"s"}`];return e.tags.length>0&&t.push(`tags: ${e.tags.join(", ")}`),e.summary&&t.push(e.summary),t.join(`
|
|
3
|
-
`)}function G(e){return e.startsWith("hsl(")?e.replace("hsl(","hsla(").replace(")",", 0.2)"):e}function b(e){return typeof e=="string"?e:e&&typeof e=="object"&&"id"in e?String(e.id):""}function B({error:e}){const t=e instanceof I;return s.jsx("div",{className:"flex h-full items-center justify-center p-10",children:s.jsxs("div",{className:"max-w-md rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[s.jsx("p",{className:"mb-2 font-medium text-red-400",children:t?"Session expired":"Could not load vault"}),s.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:e.message}),t?s.jsx(v,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})})}export{O as VaultGraph};
|