studiograph 1.3.44-next.33 → 1.3.44-next.35
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/web/_app/immutable/chunks/{B1aaqRft.js → 0fV0jNaU.js} +1 -1
- package/dist/web/_app/immutable/chunks/37NdyH6G.js +32 -0
- package/dist/web/_app/immutable/chunks/{BCvH2XZU.js → 7-DE2B7E.js} +2 -2
- package/dist/web/_app/immutable/chunks/{-CxHIRVc.js → B7xd0X7I.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BlpDkscI.js → BXgvIKUZ.js} +1 -1
- package/dist/web/_app/immutable/chunks/{pDKWXwMG.js → BbpHaCvm.js} +1 -1
- package/dist/web/_app/immutable/chunks/CALGIiWi.js +1 -0
- package/dist/web/_app/immutable/chunks/{D_2DWVrt.js → CygV1PFY.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CRDbBHg_.js → IvlPKm-T.js} +1 -1
- package/dist/web/_app/immutable/chunks/{PzHyR-QE.js → T9opyOfu.js} +1 -1
- package/dist/web/_app/immutable/chunks/{AX6hyChT.js → UeWtsd3F.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DCAAT8Ui.js → boqTA85z.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CNaGj5-I.js → iJTEMyAo.js} +1 -1
- package/dist/web/_app/immutable/chunks/{kkAh13rL.js → qp7wzf3M.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.CHJK4AnR.js → app.Blb0FuUG.js} +2 -2
- package/dist/web/_app/immutable/entry/start.wcP0GSPZ.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.Cj2zShUh.js → 0.Dvic0lrH.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.CEqgSQ7P.js → 1.UBbGfecT.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.C_NvDlnM.js → 10.DaU7_cq9.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.qtt4Bum3.js +86 -0
- package/dist/web/_app/immutable/nodes/{3.zW61y6JS.js → 3.Cv9blSfb.js} +1 -1
- package/dist/web/_app/immutable/nodes/{4.nzCzm6_m.js → 4.CzpN9osl.js} +4 -4
- package/dist/web/_app/immutable/nodes/{5.CTZ7-Xho.js → 5.Bof-EuhY.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.pMsZ4EZC.js → 6.D_p1CSE0.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.DRRQADk7.js → 7.BUSA3G_x.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.B4DVlxva.js → 8.CL5IQoVq.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.Crs6k-Eh.js → 9.CuxLdIhP.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +1 -1
- package/dist/web/_app/immutable/chunks/CDcXSODb.js +0 -1
- package/dist/web/_app/immutable/entry/start.B0Vw7ufJ.js +0 -1
- package/dist/web/_app/immutable/nodes/2.CkEVgQ4c.js +0 -84
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as _,f as P,g as b,e as W,w as m,a as G,t as k,c as A,r as I,b as q,d as j,h as V,i as R,j as z,k as C,l as K,D as Q,p as X,m as Z}from"./CSVbGg_b.js";import{r as O}from"./
|
|
1
|
+
import{O as _,f as P,g as b,e as W,w as m,a as G,t as k,c as A,r as I,b as q,d as j,h as V,i as R,j as z,k as C,l as K,D as Q,p as X,m as Z}from"./CSVbGg_b.js";import{r as O}from"./7-DE2B7E.js";const T=3e4;class $ extends _{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=b();this.getLocalState()!==null&&T/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&T<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&Y(this,s,"timeout")},P(T/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:b()});const i=[],u=[],r=[],f=[];n===null?f.push(e):c==null?n!=null&&i.push(e):(u.push(e),W(c,n)||r.push(e)),(i.length>0||r.length>0||f.length>0)&&this.emit("change",[{added:i,updated:r,removed:f},"local"]),this.emit("update",[{added:i,updated:u,removed:f},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const Y=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const i=t.meta.get(c);t.meta.set(c,{clock:i.clock+1,lastUpdated:b()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},H=(t,n,e=t.states)=>{const s=n.length,a=A();m(a,s);for(let c=0;c<s;c++){const i=n[c],u=e.get(i)||null,r=t.meta.get(i).clock;m(a,i),m(a,r),G(a,JSON.stringify(u))}return k(a)},tt=(t,n,e)=>{const s=j(n),a=b(),c=[],i=[],u=[],r=[],f=I(s);for(let w=0;w<f;w++){const d=I(s);let y=I(s);const h=JSON.parse(q(s)),g=t.meta.get(d),U=t.states.get(d),S=g===void 0?0:g.clock;(S<y||S===y&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?y++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:y,lastUpdated:a}),g===void 0&&h!==null?c.push(d):g!==void 0&&h===null?r.push(d):h!==null&&(W(h,U)||u.push(d),i.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||i.length>0||r.length>0)&&t.emit("update",[{added:c,updated:i,removed:r},e])},B=0,M=1,N=2,et=(t,n)=>{m(t,B);const e=R(n);V(t,e)},nt=(t,n,e)=>{m(t,M),V(t,K(n,e))},st=(t,n,e)=>nt(n,e,C(t)),F=(t,n,e,s)=>{try{z(n,C(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},at=(t,n)=>{m(t,N),V(t,n)},ct=F,ot=(t,n,e,s,a)=>{const c=I(t);switch(c){case B:st(t,n,e);break;case M:F(t,e,s,a);break;case N:ct(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},L=0,x=1;function it(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function lt(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function ut(t,n){const e=new Q,s=e.getText("content"),a=new $(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,i=!1,u=!1;function r(){return O.ws??null}function f(o,p){const l=r();!l||l.readyState!==WebSocket.OPEN||l.send(it(t,o,p))}function w(){const o=A();et(o,e),f(L,k(o))}function d(o){const p=o??[e.clientID],l=H(a,p);f(x,l)}function y(o){if(i||typeof o.data=="string")return;const p=o.data instanceof ArrayBuffer?o.data:null;if(!p)return;const l=lt(p);if(!(!l||l.docName!==t))if(l.msgType===L){const v=j(l.payload),D=X(v),E=A();ot(v,E,e,"ws-server"),Z(E)>0&&f(L,k(E)),!u&&(D===M||D===N)&&(u=!0,S.synced=!0)}else l.msgType===x&&tt(a,l.payload,"ws-server")}function h(o,p){if(i||p==="ws-server")return;const l=A();at(l,o),f(L,k(l))}function g({added:o,updated:p,removed:l},v){if(i||v==="ws-server")return;const D=o.concat(p,l);d(D)}function U(){if(i)return;const o=r();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=y,o.addEventListener("message",c),w(),d())}const S={ydoc:e,ytext:s,awareness:a,synced:!1,destroy:J};e.on("update",h),a.on("update",g),U(),O.addConnectHandler(U);function J(){if(i)return;i=!0,Y(a,[e.clientID],"local"),d([e.clientID]);const o=r();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",h),a.off("update",g),a.destroy(),e.destroy()}return S}export{ut as createCollabSession};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function _e(e){return typeof e>"u"||e===null}function tn(e){return typeof e=="object"&&e!==null}function hn(e){return Array.isArray(e)?e:_e(e)?[]:[e]}function dn(e,n){var i,l,r,u;if(n)for(u=Object.keys(n),i=0,l=u.length;i<l;i+=1)r=u[i],e[r]=n[r];return e}function sn(e,n){var i="",l;for(l=0;l<n;l+=1)i+=e;return i}function mn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var xn=_e,gn=tn,An=hn,vn=sn,yn=mn,Cn=dn,y={isNothing:xn,isObject:gn,toArray:An,repeat:vn,isNegativeZero:yn,extend:Cn};function we(e,n){var i="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(i+=`
|
|
2
|
+
|
|
3
|
+
`+e.mark.snippet),l+" "+i):l}function Y(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=we(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Y.prototype=Object.create(Error.prototype);Y.prototype.constructor=Y;Y.prototype.toString=function(n){return this.name+": "+we(this,n)};var w=Y;function $(e,n,i,l,r){var u="",o="",f=Math.floor(r/2)-1;return l-n>f&&(u=" ... ",n=l-f+u.length),i-l>f&&(o=" ...",i=l+f-o.length),{str:u+e.slice(n,i).replace(/\t/g,"→")+o,pos:l-n+u.length}}function Q(e,n){return y.repeat(" ",n-e.length)+e}function _n(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\r?\n|\r|\0/g,l=[0],r=[],u,o=-1;u=i.exec(e.buffer);)r.push(u.index),l.push(u.index+u[0].length),e.position<=u.index&&o<0&&(o=l.length-2);o<0&&(o=l.length-1);var f="",c,a,t=Math.min(e.line+n.linesAfter,r.length).toString().length,p=n.maxLength-(n.indent+t+3);for(c=1;c<=n.linesBefore&&!(o-c<0);c++)a=$(e.buffer,l[o-c],r[o-c],e.position-(l[o]-l[o-c]),p),f=y.repeat(" ",n.indent)+Q((e.line-c+1).toString(),t)+" | "+a.str+`
|
|
4
|
+
`+f;for(a=$(e.buffer,l[o],r[o],e.position,p),f+=y.repeat(" ",n.indent)+Q((e.line+1).toString(),t)+" | "+a.str+`
|
|
5
|
+
`,f+=y.repeat("-",n.indent+t+3+a.pos)+`^
|
|
6
|
+
`,c=1;c<=n.linesAfter&&!(o+c>=r.length);c++)a=$(e.buffer,l[o+c],r[o+c],e.position-(l[o]-l[o+c]),p),f+=y.repeat(" ",n.indent)+Q((e.line+c+1).toString(),t)+" | "+a.str+`
|
|
7
|
+
`;return f.replace(/\n$/,"")}var wn=_n,En=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Sn=["scalar","sequence","mapping"];function Fn(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(l){n[String(l)]=i})}),n}function bn(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(En.indexOf(i)===-1)throw new w('Unknown option "'+i+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Fn(n.styleAliases||null),Sn.indexOf(this.kind)===-1)throw new w('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var C=bn;function fe(e,n){var i=[];return e[n].forEach(function(l){var r=i.length;i.forEach(function(u,o){u.tag===l.tag&&u.kind===l.kind&&u.multi===l.multi&&(r=o)}),i[r]=l}),i}function Tn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function l(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(l);return e}function X(e){return this.extend(e)}X.prototype.extend=function(n){var i=[],l=[];if(n instanceof C)l.push(n);else if(Array.isArray(n))l=l.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(l=l.concat(n.explicit));else throw new w("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(u){if(!(u instanceof C))throw new w("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(u.loadKind&&u.loadKind!=="scalar")throw new w("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(u.multi)throw new w("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(u){if(!(u instanceof C))throw new w("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(X.prototype);return r.implicit=(this.implicit||[]).concat(i),r.explicit=(this.explicit||[]).concat(l),r.compiledImplicit=fe(r,"implicit"),r.compiledExplicit=fe(r,"explicit"),r.compiledTypeMap=Tn(r.compiledImplicit,r.compiledExplicit),r};var Ee=X,Se=new C("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Fe=new C("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),be=new C("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Te=new Ee({explicit:[Se,Fe,be]});function On(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function In(){return null}function Ln(e){return e===null}var Oe=new C("tag:yaml.org,2002:null",{kind:"scalar",resolve:On,construct:In,predicate:Ln,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function kn(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function Nn(e){return e==="true"||e==="True"||e==="TRUE"}function Rn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Ie=new C("tag:yaml.org,2002:bool",{kind:"scalar",resolve:kn,construct:Nn,predicate:Rn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Dn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Mn(e){return 48<=e&&e<=55}function Yn(e){return 48<=e&&e<=57}function Bn(e){if(e===null)return!1;var n=e.length,i=0,l=!1,r;if(!n)return!1;if(r=e[i],(r==="-"||r==="+")&&(r=e[++i]),r==="0"){if(i+1===n)return!0;if(r=e[++i],r==="b"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(r!=="0"&&r!=="1")return!1;l=!0}return l&&r!=="_"}if(r==="x"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(!Dn(e.charCodeAt(i)))return!1;l=!0}return l&&r!=="_"}if(r==="o"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(!Mn(e.charCodeAt(i)))return!1;l=!0}return l&&r!=="_"}}if(r==="_")return!1;for(;i<n;i++)if(r=e[i],r!=="_"){if(!Yn(e.charCodeAt(i)))return!1;l=!0}return!(!l||r==="_")}function Pn(e){var n=e,i=1,l;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),l=n[0],(l==="-"||l==="+")&&(l==="-"&&(i=-1),n=n.slice(1),l=n[0]),n==="0")return 0;if(l==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function Hn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!y.isNegativeZero(e)}var Le=new C("tag:yaml.org,2002:int",{kind:"scalar",resolve:Bn,construct:Pn,predicate:Hn,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),jn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Un(e){return!(e===null||!jn.test(e)||e[e.length-1]==="_")}function Kn(e){var n,i;return n=e.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var qn=/^[-+]?[0-9]+e/;function Gn(e,n){var i;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(y.isNegativeZero(e))return"-0.0";return i=e.toString(10),qn.test(i)?i.replace("e",".e"):i}function Wn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||y.isNegativeZero(e))}var ke=new C("tag:yaml.org,2002:float",{kind:"scalar",resolve:Un,construct:Kn,predicate:Wn,represent:Gn,defaultStyle:"lowercase"}),Ne=Te.extend({implicit:[Oe,Ie,Le,ke]}),Re=Ne,De=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Me=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function $n(e){return e===null?!1:De.exec(e)!==null||Me.exec(e)!==null}function Qn(e){var n,i,l,r,u,o,f,c=0,a=null,t,p,d;if(n=De.exec(e),n===null&&(n=Me.exec(e)),n===null)throw new Error("Date resolve error");if(i=+n[1],l=+n[2]-1,r=+n[3],!n[4])return new Date(Date.UTC(i,l,r));if(u=+n[4],o=+n[5],f=+n[6],n[7]){for(c=n[7].slice(0,3);c.length<3;)c+="0";c=+c}return n[9]&&(t=+n[10],p=+(n[11]||0),a=(t*60+p)*6e4,n[9]==="-"&&(a=-a)),d=new Date(Date.UTC(i,l,r,u,o,f,c)),a&&d.setTime(d.getTime()-a),d}function Vn(e){return e.toISOString()}var Ye=new C("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:$n,construct:Qn,instanceOf:Date,represent:Vn});function Xn(e){return e==="<<"||e===null}var Be=new C("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Xn}),ne=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
+
\r`;function Zn(e){if(e===null)return!1;var n,i,l=0,r=e.length,u=ne;for(i=0;i<r;i++)if(n=u.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;l+=6}return l%8===0}function zn(e){var n,i,l=e.replace(/[\r\n=]/g,""),r=l.length,u=ne,o=0,f=[];for(n=0;n<r;n++)n%4===0&&n&&(f.push(o>>16&255),f.push(o>>8&255),f.push(o&255)),o=o<<6|u.indexOf(l.charAt(n));return i=r%4*6,i===0?(f.push(o>>16&255),f.push(o>>8&255),f.push(o&255)):i===18?(f.push(o>>10&255),f.push(o>>2&255)):i===12&&f.push(o>>4&255),new Uint8Array(f)}function Jn(e){var n="",i=0,l,r,u=e.length,o=ne;for(l=0;l<u;l++)l%3===0&&l&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]),i=(i<<8)+e[l];return r=u%3,r===0?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]):r===2?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):r===1&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}function ei(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Pe=new C("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Zn,construct:zn,predicate:ei,represent:Jn}),ni=Object.prototype.hasOwnProperty,ii=Object.prototype.toString;function ri(e){if(e===null)return!0;var n=[],i,l,r,u,o,f=e;for(i=0,l=f.length;i<l;i+=1){if(r=f[i],o=!1,ii.call(r)!=="[object Object]")return!1;for(u in r)if(ni.call(r,u))if(!o)o=!0;else return!1;if(!o)return!1;if(n.indexOf(u)===-1)n.push(u);else return!1}return!0}function li(e){return e!==null?e:[]}var He=new C("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ri,construct:li}),oi=Object.prototype.toString;function ui(e){if(e===null)return!0;var n,i,l,r,u,o=e;for(u=new Array(o.length),n=0,i=o.length;n<i;n+=1){if(l=o[n],oi.call(l)!=="[object Object]"||(r=Object.keys(l),r.length!==1))return!1;u[n]=[r[0],l[r[0]]]}return!0}function fi(e){if(e===null)return[];var n,i,l,r,u,o=e;for(u=new Array(o.length),n=0,i=o.length;n<i;n+=1)l=o[n],r=Object.keys(l),u[n]=[r[0],l[r[0]]];return u}var je=new C("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ui,construct:fi}),ci=Object.prototype.hasOwnProperty;function ai(e){if(e===null)return!0;var n,i=e;for(n in i)if(ci.call(i,n)&&i[n]!==null)return!1;return!0}function pi(e){return e!==null?e:{}}var Ue=new C("tag:yaml.org,2002:set",{kind:"mapping",resolve:ai,construct:pi}),ie=Re.extend({implicit:[Ye,Be],explicit:[Pe,He,je,Ue]}),O=Object.prototype.hasOwnProperty,j=1,Ke=2,qe=3,U=4,V=1,ti=2,ce=3,hi=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,di=/[\x85\u2028\u2029]/,si=/[,\[\]\{\}]/,Ge=/^(?:!|!!|![a-z\-]+!)$/i,We=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ae(e){return Object.prototype.toString.call(e)}function F(e){return e===10||e===13}function I(e){return e===9||e===32}function E(e){return e===9||e===32||e===10||e===13}function N(e){return e===44||e===91||e===93||e===123||e===125}function mi(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function xi(e){return e===120?2:e===117?4:e===85?8:0}function gi(e){return 48<=e&&e<=57?e-48:-1}function pe(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
9
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Ai(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function $e(e,n,i){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[n]=i}var Qe=new Array(256),Ve=new Array(256);for(var L=0;L<256;L++)Qe[L]=pe(L)?1:0,Ve[L]=pe(L);function vi(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||ie,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Xe(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=wn(i),new w(n,i)}function h(e,n){throw Xe(e,n)}function K(e,n){e.onWarning&&e.onWarning.call(null,Xe(e,n))}var te={YAML:function(n,i,l){var r,u,o;n.version!==null&&h(n,"duplication of %YAML directive"),l.length!==1&&h(n,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(l[0]),r===null&&h(n,"ill-formed argument of the YAML directive"),u=parseInt(r[1],10),o=parseInt(r[2],10),u!==1&&h(n,"unacceptable YAML version of the document"),n.version=l[0],n.checkLineBreaks=o<2,o!==1&&o!==2&&K(n,"unsupported YAML version of the document")},TAG:function(n,i,l){var r,u;l.length!==2&&h(n,"TAG directive accepts exactly two arguments"),r=l[0],u=l[1],Ge.test(r)||h(n,"ill-formed tag handle (first argument) of the TAG directive"),O.call(n.tagMap,r)&&h(n,'there is a previously declared suffix for "'+r+'" tag handle'),We.test(u)||h(n,"ill-formed tag prefix (second argument) of the TAG directive");try{u=decodeURIComponent(u)}catch{h(n,"tag prefix is malformed: "+u)}n.tagMap[r]=u}};function T(e,n,i,l){var r,u,o,f;if(n<i){if(f=e.input.slice(n,i),l)for(r=0,u=f.length;r<u;r+=1)o=f.charCodeAt(r),o===9||32<=o&&o<=1114111||h(e,"expected valid JSON character");else hi.test(f)&&h(e,"the stream contains non-printable characters");e.result+=f}}function he(e,n,i,l){var r,u,o,f;for(y.isObject(i)||h(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(i),o=0,f=r.length;o<f;o+=1)u=r[o],O.call(n,u)||($e(n,u,i[u]),l[u]=!0)}function R(e,n,i,l,r,u,o,f,c){var a,t;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),a=0,t=r.length;a<t;a+=1)Array.isArray(r[a])&&h(e,"nested arrays are not supported inside keys"),typeof r=="object"&&ae(r[a])==="[object Object]"&&(r[a]="[object Object]");if(typeof r=="object"&&ae(r)==="[object Object]"&&(r="[object Object]"),r=String(r),n===null&&(n={}),l==="tag:yaml.org,2002:merge")if(Array.isArray(u))for(a=0,t=u.length;a<t;a+=1)he(e,n,u[a],i);else he(e,n,u,i);else!e.json&&!O.call(i,r)&&O.call(n,r)&&(e.line=o||e.line,e.lineStart=f||e.lineStart,e.position=c||e.position,h(e,"duplicated mapping key")),$e(n,r,u),delete i[r];return n}function re(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):h(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function v(e,n,i){for(var l=0,r=e.input.charCodeAt(e.position);r!==0;){for(;I(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(n&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(F(r))for(re(e),r=e.input.charCodeAt(e.position),l++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return i!==-1&&l!==0&&e.lineIndent<i&&K(e,"deficient indentation"),l}function W(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||E(i)))}function le(e,n){n===1?e.result+=" ":n>1&&(e.result+=y.repeat(`
|
|
10
|
+
`,n-1))}function yi(e,n,i){var l,r,u,o,f,c,a,t,p=e.kind,d=e.result,s;if(s=e.input.charCodeAt(e.position),E(s)||N(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(r=e.input.charCodeAt(e.position+1),E(r)||i&&N(r)))return!1;for(e.kind="scalar",e.result="",u=o=e.position,f=!1;s!==0;){if(s===58){if(r=e.input.charCodeAt(e.position+1),E(r)||i&&N(r))break}else if(s===35){if(l=e.input.charCodeAt(e.position-1),E(l))break}else{if(e.position===e.lineStart&&W(e)||i&&N(s))break;if(F(s))if(c=e.line,a=e.lineStart,t=e.lineIndent,v(e,!1,-1),e.lineIndent>=n){f=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=a,e.lineIndent=t;break}}f&&(T(e,u,o,!1),le(e,e.line-c),u=o=e.position,f=!1),I(s)||(o=e.position+1),s=e.input.charCodeAt(++e.position)}return T(e,u,o,!1),e.result?!0:(e.kind=p,e.result=d,!1)}function Ci(e,n){var i,l,r;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,l=r=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(T(e,l,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)l=e.position,e.position++,r=e.position;else return!0;else F(i)?(T(e,l,r,!0),le(e,v(e,!1,n)),l=r=e.position):e.position===e.lineStart&&W(e)?h(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);h(e,"unexpected end of the stream within a single quoted scalar")}function _i(e,n){var i,l,r,u,o,f;if(f=e.input.charCodeAt(e.position),f!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=l=e.position;(f=e.input.charCodeAt(e.position))!==0;){if(f===34)return T(e,i,e.position,!0),e.position++,!0;if(f===92){if(T(e,i,e.position,!0),f=e.input.charCodeAt(++e.position),F(f))v(e,!1,n);else if(f<256&&Qe[f])e.result+=Ve[f],e.position++;else if((o=xi(f))>0){for(r=o,u=0;r>0;r--)f=e.input.charCodeAt(++e.position),(o=mi(f))>=0?u=(u<<4)+o:h(e,"expected hexadecimal character");e.result+=Ai(u),e.position++}else h(e,"unknown escape sequence");i=l=e.position}else F(f)?(T(e,i,l,!0),le(e,v(e,!1,n)),i=l=e.position):e.position===e.lineStart&&W(e)?h(e,"unexpected end of the document within a double quoted scalar"):(e.position++,l=e.position)}h(e,"unexpected end of the stream within a double quoted scalar")}function wi(e,n){var i=!0,l,r,u,o=e.tag,f,c=e.anchor,a,t,p,d,s,m=Object.create(null),g,A,S,x;if(x=e.input.charCodeAt(e.position),x===91)t=93,s=!1,f=[];else if(x===123)t=125,s=!0,f={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),x=e.input.charCodeAt(++e.position);x!==0;){if(v(e,!0,n),x=e.input.charCodeAt(e.position),x===t)return e.position++,e.tag=o,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=f,!0;i?x===44&&h(e,"expected the node content, but found ','"):h(e,"missed comma between flow collection entries"),A=g=S=null,p=d=!1,x===63&&(a=e.input.charCodeAt(e.position+1),E(a)&&(p=d=!0,e.position++,v(e,!0,n))),l=e.line,r=e.lineStart,u=e.position,D(e,n,j,!1,!0),A=e.tag,g=e.result,v(e,!0,n),x=e.input.charCodeAt(e.position),(d||e.line===l)&&x===58&&(p=!0,x=e.input.charCodeAt(++e.position),v(e,!0,n),D(e,n,j,!1,!0),S=e.result),s?R(e,f,m,A,g,S,l,r,u):p?f.push(R(e,null,m,A,g,S,l,r,u)):f.push(g),v(e,!0,n),x=e.input.charCodeAt(e.position),x===44?(i=!0,x=e.input.charCodeAt(++e.position)):i=!1}h(e,"unexpected end of the stream within a flow collection")}function Ei(e,n){var i,l,r=V,u=!1,o=!1,f=n,c=0,a=!1,t,p;if(p=e.input.charCodeAt(e.position),p===124)l=!1;else if(p===62)l=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)V===r?r=p===43?ce:ti:h(e,"repeat of a chomping mode identifier");else if((t=gi(p))>=0)t===0?h(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?h(e,"repeat of an indentation width identifier"):(f=n+t-1,o=!0);else break;if(I(p)){do p=e.input.charCodeAt(++e.position);while(I(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!F(p)&&p!==0)}for(;p!==0;){for(re(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!o||e.lineIndent<f)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>f&&(f=e.lineIndent),F(p)){c++;continue}if(e.lineIndent<f){r===ce?e.result+=y.repeat(`
|
|
11
|
+
`,u?1+c:c):r===V&&u&&(e.result+=`
|
|
12
|
+
`);break}for(l?I(p)?(a=!0,e.result+=y.repeat(`
|
|
13
|
+
`,u?1+c:c)):a?(a=!1,e.result+=y.repeat(`
|
|
14
|
+
`,c+1)):c===0?u&&(e.result+=" "):e.result+=y.repeat(`
|
|
15
|
+
`,c):e.result+=y.repeat(`
|
|
16
|
+
`,u?1+c:c),u=!0,o=!0,c=0,i=e.position;!F(p)&&p!==0;)p=e.input.charCodeAt(++e.position);T(e,i,e.position,!1)}return!0}function de(e,n){var i,l=e.tag,r=e.anchor,u=[],o,f=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,h(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!E(o))));){if(f=!0,e.position++,v(e,!0,-1)&&e.lineIndent<=n){u.push(null),c=e.input.charCodeAt(e.position);continue}if(i=e.line,D(e,n,qe,!1,!0),u.push(e.result),v(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&c!==0)h(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return f?(e.tag=l,e.anchor=r,e.kind="sequence",e.result=u,!0):!1}function Si(e,n,i){var l,r,u,o,f,c,a=e.tag,t=e.anchor,p={},d=Object.create(null),s=null,m=null,g=null,A=!1,S=!1,x;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),x=e.input.charCodeAt(e.position);x!==0;){if(!A&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,h(e,"tab characters must not be used in indentation")),l=e.input.charCodeAt(e.position+1),u=e.line,(x===63||x===58)&&E(l))x===63?(A&&(R(e,p,d,s,m,null,o,f,c),s=m=g=null),S=!0,A=!0,r=!0):A?(A=!1,r=!0):h(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,x=l;else{if(o=e.line,f=e.lineStart,c=e.position,!D(e,i,Ke,!1,!0))break;if(e.line===u){for(x=e.input.charCodeAt(e.position);I(x);)x=e.input.charCodeAt(++e.position);if(x===58)x=e.input.charCodeAt(++e.position),E(x)||h(e,"a whitespace character is expected after the key-value separator within a block mapping"),A&&(R(e,p,d,s,m,null,o,f,c),s=m=g=null),S=!0,A=!1,r=!1,s=e.tag,m=e.result;else if(S)h(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=a,e.anchor=t,!0}else if(S)h(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=a,e.anchor=t,!0}if((e.line===u||e.lineIndent>n)&&(A&&(o=e.line,f=e.lineStart,c=e.position),D(e,n,U,!0,r)&&(A?m=e.result:g=e.result),A||(R(e,p,d,s,m,g,o,f,c),s=m=g=null),v(e,!0,-1),x=e.input.charCodeAt(e.position)),(e.line===u||e.lineIndent>n)&&x!==0)h(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return A&&R(e,p,d,s,m,null,o,f,c),S&&(e.tag=a,e.anchor=t,e.kind="mapping",e.result=p),S}function Fi(e){var n,i=!1,l=!1,r,u,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&h(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(i=!0,o=e.input.charCodeAt(++e.position)):o===33?(l=!0,r="!!",o=e.input.charCodeAt(++e.position)):r="!",n=e.position,i){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(u=e.input.slice(n,e.position),o=e.input.charCodeAt(++e.position)):h(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!E(o);)o===33&&(l?h(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(n-1,e.position+1),Ge.test(r)||h(e,"named tag handle cannot contain such characters"),l=!0,n=e.position+1)),o=e.input.charCodeAt(++e.position);u=e.input.slice(n,e.position),si.test(u)&&h(e,"tag suffix cannot contain flow indicator characters")}u&&!We.test(u)&&h(e,"tag name cannot contain such characters: "+u);try{u=decodeURIComponent(u)}catch{h(e,"tag name is malformed: "+u)}return i?e.tag=u:O.call(e.tagMap,r)?e.tag=e.tagMap[r]+u:r==="!"?e.tag="!"+u:r==="!!"?e.tag="tag:yaml.org,2002:"+u:h(e,'undeclared tag handle "'+r+'"'),!0}function bi(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&h(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!E(i)&&!N(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&h(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Ti(e){var n,i,l;if(l=e.input.charCodeAt(e.position),l!==42)return!1;for(l=e.input.charCodeAt(++e.position),n=e.position;l!==0&&!E(l)&&!N(l);)l=e.input.charCodeAt(++e.position);return e.position===n&&h(e,"name of an alias node must contain at least one character"),i=e.input.slice(n,e.position),O.call(e.anchorMap,i)||h(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],v(e,!0,-1),!0}function D(e,n,i,l,r){var u,o,f,c=1,a=!1,t=!1,p,d,s,m,g,A;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,u=o=f=U===i||qe===i,l&&v(e,!0,-1)&&(a=!0,e.lineIndent>n?c=1:e.lineIndent===n?c=0:e.lineIndent<n&&(c=-1)),c===1)for(;Fi(e)||bi(e);)v(e,!0,-1)?(a=!0,f=u,e.lineIndent>n?c=1:e.lineIndent===n?c=0:e.lineIndent<n&&(c=-1)):f=!1;if(f&&(f=a||r),(c===1||U===i)&&(j===i||Ke===i?g=n:g=n+1,A=e.position-e.lineStart,c===1?f&&(de(e,A)||Si(e,A,g))||wi(e,g)?t=!0:(o&&Ei(e,g)||Ci(e,g)||_i(e,g)?t=!0:Ti(e)?(t=!0,(e.tag!==null||e.anchor!==null)&&h(e,"alias node should not have any properties")):yi(e,g,j===i)&&(t=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(t=f&&de(e,A))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&h(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,d=e.implicitTypes.length;p<d;p+=1)if(m=e.implicitTypes[p],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(O.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,s=e.typeMap.multi[e.kind||"fallback"],p=0,d=s.length;p<d;p+=1)if(e.tag.slice(0,s[p].tag.length)===s[p].tag){m=s[p];break}m||h(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&h(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):h(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||t}function Oi(e){var n=e.position,i,l,r,u=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(v(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(u=!0,o=e.input.charCodeAt(++e.position),i=e.position;o!==0&&!E(o);)o=e.input.charCodeAt(++e.position);for(l=e.input.slice(i,e.position),r=[],l.length<1&&h(e,"directive name must not be less than one character in length");o!==0;){for(;I(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!F(o));break}if(F(o))break;for(i=e.position;o!==0&&!E(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(i,e.position))}o!==0&&re(e),O.call(te,l)?te[l](e,l,r):K(e,'unknown document directive "'+l+'"')}if(v(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,v(e,!0,-1)):u&&h(e,"directives end mark is expected"),D(e,e.lineIndent-1,U,!1,!0),v(e,!0,-1),e.checkLineBreaks&&di.test(e.input.slice(n,e.position))&&K(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&W(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,v(e,!0,-1));return}if(e.position<e.length-1)h(e,"end of the stream or a document separator is expected");else return}function Ze(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
17
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new vi(e,n),l=e.indexOf("\0");for(l!==-1&&(i.position=l,h(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)Oi(i);return i.documents}function Ii(e,n,i){n!==null&&typeof n=="object"&&typeof i>"u"&&(i=n,n=null);var l=Ze(e,i);if(typeof n!="function")return l;for(var r=0,u=l.length;r<u;r+=1)n(l[r])}function Li(e,n){var i=Ze(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new w("expected a single document in the stream, but found more")}}var ki=Ii,Ni=Li,ze={loadAll:ki,load:Ni},Je=Object.prototype.toString,en=Object.prototype.hasOwnProperty,oe=65279,Ri=9,B=10,Di=13,Mi=32,Yi=33,Bi=34,Z=35,Pi=37,Hi=38,ji=39,Ui=42,nn=44,Ki=45,q=58,qi=61,Gi=62,Wi=63,$i=64,rn=91,ln=93,Qi=96,on=123,Vi=124,un=125,_={};_[0]="\\0";_[7]="\\a";_[8]="\\b";_[9]="\\t";_[10]="\\n";_[11]="\\v";_[12]="\\f";_[13]="\\r";_[27]="\\e";_[34]='\\"';_[92]="\\\\";_[133]="\\N";_[160]="\\_";_[8232]="\\L";_[8233]="\\P";var Xi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Zi=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function zi(e,n){var i,l,r,u,o,f,c;if(n===null)return{};for(i={},l=Object.keys(n),r=0,u=l.length;r<u;r+=1)o=l[r],f=String(n[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&en.call(c.styleAliases,f)&&(f=c.styleAliases[f]),i[o]=f;return i}function Ji(e){var n,i,l;if(n=e.toString(16).toUpperCase(),e<=255)i="x",l=2;else if(e<=65535)i="u",l=4;else if(e<=4294967295)i="U",l=8;else throw new w("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+y.repeat("0",l-n.length)+n}var er=1,P=2;function nr(e){this.schema=e.schema||ie,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=y.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=zi(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?P:er,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function se(e,n){for(var i=y.repeat(" ",n),l=0,r=-1,u="",o,f=e.length;l<f;)r=e.indexOf(`
|
|
18
|
+
`,l),r===-1?(o=e.slice(l),l=f):(o=e.slice(l,r+1),l=r+1),o.length&&o!==`
|
|
19
|
+
`&&(u+=i),u+=o;return u}function z(e,n){return`
|
|
20
|
+
`+y.repeat(" ",e.indent*n)}function ir(e,n){var i,l,r;for(i=0,l=e.implicitTypes.length;i<l;i+=1)if(r=e.implicitTypes[i],r.resolve(n))return!0;return!1}function G(e){return e===Mi||e===Ri}function H(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==oe||65536<=e&&e<=1114111}function me(e){return H(e)&&e!==oe&&e!==Di&&e!==B}function xe(e,n,i){var l=me(e),r=l&&!G(e);return(i?l:l&&e!==nn&&e!==rn&&e!==ln&&e!==on&&e!==un)&&e!==Z&&!(n===q&&!r)||me(n)&&!G(n)&&e===Z||n===q&&r}function rr(e){return H(e)&&e!==oe&&!G(e)&&e!==Ki&&e!==Wi&&e!==q&&e!==nn&&e!==rn&&e!==ln&&e!==on&&e!==un&&e!==Z&&e!==Hi&&e!==Ui&&e!==Yi&&e!==Vi&&e!==qi&&e!==Gi&&e!==ji&&e!==Bi&&e!==Pi&&e!==$i&&e!==Qi}function lr(e){return!G(e)&&e!==q}function M(e,n){var i=e.charCodeAt(n),l;return i>=55296&&i<=56319&&n+1<e.length&&(l=e.charCodeAt(n+1),l>=56320&&l<=57343)?(i-55296)*1024+l-56320+65536:i}function fn(e){var n=/^\n* /;return n.test(e)}var cn=1,J=2,an=3,pn=4,k=5;function or(e,n,i,l,r,u,o,f){var c,a=0,t=null,p=!1,d=!1,s=l!==-1,m=-1,g=rr(M(e,0))&&lr(M(e,e.length-1));if(n||o)for(c=0;c<e.length;a>=65536?c+=2:c++){if(a=M(e,c),!H(a))return k;g=g&&xe(a,t,f),t=a}else{for(c=0;c<e.length;a>=65536?c+=2:c++){if(a=M(e,c),a===B)p=!0,s&&(d=d||c-m-1>l&&e[m+1]!==" ",m=c);else if(!H(a))return k;g=g&&xe(a,t,f),t=a}d=d||s&&c-m-1>l&&e[m+1]!==" "}return!p&&!d?g&&!o&&!r(e)?cn:u===P?k:J:i>9&&fn(e)?k:o?u===P?k:J:d?pn:an}function ur(e,n,i,l,r){e.dump=(function(){if(n.length===0)return e.quotingType===P?'""':"''";if(!e.noCompatMode&&(Xi.indexOf(n)!==-1||Zi.test(n)))return e.quotingType===P?'"'+n+'"':"'"+n+"'";var u=e.indent*Math.max(1,i),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-u),f=l||e.flowLevel>-1&&i>=e.flowLevel;function c(a){return ir(e,a)}switch(or(n,f,e.indent,o,c,e.quotingType,e.forceQuotes&&!l,r)){case cn:return n;case J:return"'"+n.replace(/'/g,"''")+"'";case an:return"|"+ge(n,e.indent)+Ae(se(n,u));case pn:return">"+ge(n,e.indent)+Ae(se(fr(n,o),u));case k:return'"'+cr(n)+'"';default:throw new w("impossible error: invalid scalar style")}})()}function ge(e,n){var i=fn(e)?String(n):"",l=e[e.length-1]===`
|
|
21
|
+
`,r=l&&(e[e.length-2]===`
|
|
22
|
+
`||e===`
|
|
23
|
+
`),u=r?"+":l?"":"-";return i+u+`
|
|
24
|
+
`}function Ae(e){return e[e.length-1]===`
|
|
25
|
+
`?e.slice(0,-1):e}function fr(e,n){for(var i=/(\n+)([^\n]*)/g,l=(function(){var a=e.indexOf(`
|
|
26
|
+
`);return a=a!==-1?a:e.length,i.lastIndex=a,ve(e.slice(0,a),n)})(),r=e[0]===`
|
|
27
|
+
`||e[0]===" ",u,o;o=i.exec(e);){var f=o[1],c=o[2];u=c[0]===" ",l+=f+(!r&&!u&&c!==""?`
|
|
28
|
+
`:"")+ve(c,n),r=u}return l}function ve(e,n){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,l,r=0,u,o=0,f=0,c="";l=i.exec(e);)f=l.index,f-r>n&&(u=o>r?o:f,c+=`
|
|
29
|
+
`+e.slice(r,u),r=u+1),o=f;return c+=`
|
|
30
|
+
`,e.length-r>n&&o>r?c+=e.slice(r,o)+`
|
|
31
|
+
`+e.slice(o+1):c+=e.slice(r),c.slice(1)}function cr(e){for(var n="",i=0,l,r=0;r<e.length;i>=65536?r+=2:r++)i=M(e,r),l=_[i],!l&&H(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=l||Ji(i);return n}function ar(e,n,i){var l="",r=e.tag,u,o,f;for(u=0,o=i.length;u<o;u+=1)f=i[u],e.replacer&&(f=e.replacer.call(i,String(u),f)),(b(e,n,f,!1,!1)||typeof f>"u"&&b(e,n,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=r,e.dump="["+l+"]"}function ye(e,n,i,l){var r="",u=e.tag,o,f,c;for(o=0,f=i.length;o<f;o+=1)c=i[o],e.replacer&&(c=e.replacer.call(i,String(o),c)),(b(e,n+1,c,!0,!0,!1,!0)||typeof c>"u"&&b(e,n+1,null,!0,!0,!1,!0))&&((!l||r!=="")&&(r+=z(e,n)),e.dump&&B===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=u,e.dump=r||"[]"}function pr(e,n,i){var l="",r=e.tag,u=Object.keys(i),o,f,c,a,t;for(o=0,f=u.length;o<f;o+=1)t="",l!==""&&(t+=", "),e.condenseFlow&&(t+='"'),c=u[o],a=i[c],e.replacer&&(a=e.replacer.call(i,c,a)),b(e,n,c,!1,!1)&&(e.dump.length>1024&&(t+="? "),t+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),b(e,n,a,!1,!1)&&(t+=e.dump,l+=t));e.tag=r,e.dump="{"+l+"}"}function tr(e,n,i,l){var r="",u=e.tag,o=Object.keys(i),f,c,a,t,p,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new w("sortKeys must be a boolean or a function");for(f=0,c=o.length;f<c;f+=1)d="",(!l||r!=="")&&(d+=z(e,n)),a=o[f],t=i[a],e.replacer&&(t=e.replacer.call(i,a,t)),b(e,n+1,a,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&B===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,p&&(d+=z(e,n)),b(e,n+1,t,!0,p)&&(e.dump&&B===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,r+=d));e.tag=u,e.dump=r||"{}"}function Ce(e,n,i){var l,r,u,o,f,c;for(r=i?e.explicitTypes:e.implicitTypes,u=0,o=r.length;u<o;u+=1)if(f=r[u],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof n=="object"&&n instanceof f.instanceOf)&&(!f.predicate||f.predicate(n))){if(i?f.multi&&f.representName?e.tag=f.representName(n):e.tag=f.tag:e.tag="?",f.represent){if(c=e.styleMap[f.tag]||f.defaultStyle,Je.call(f.represent)==="[object Function]")l=f.represent(n,c);else if(en.call(f.represent,c))l=f.represent[c](n,c);else throw new w("!<"+f.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function b(e,n,i,l,r,u,o){e.tag=null,e.dump=i,Ce(e,i,!1)||Ce(e,i,!0);var f=Je.call(e.dump),c=l,a;l&&(l=e.flowLevel<0||e.flowLevel>n);var t=f==="[object Object]"||f==="[object Array]",p,d;if(t&&(p=e.duplicates.indexOf(i),d=p!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&n>0)&&(r=!1),d&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(t&&d&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),f==="[object Object]")l&&Object.keys(e.dump).length!==0?(tr(e,n,e.dump,r),d&&(e.dump="&ref_"+p+e.dump)):(pr(e,n,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(f==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!o&&n>0?ye(e,n-1,e.dump,r):ye(e,n,e.dump,r),d&&(e.dump="&ref_"+p+e.dump)):(ar(e,n,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(f==="[object String]")e.tag!=="?"&&ur(e,e.dump,n,u,c);else{if(f==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new w("unacceptable kind of an object to dump "+f)}e.tag!==null&&e.tag!=="?"&&(a=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?a="!"+a:a.slice(0,18)==="tag:yaml.org,2002:"?a="!!"+a.slice(18):a="!<"+a+">",e.dump=a+" "+e.dump)}return!0}function hr(e,n){var i=[],l=[],r,u;for(ee(e,i,l),r=0,u=l.length;r<u;r+=1)n.duplicates.push(i[l[r]]);n.usedDuplicates=new Array(u)}function ee(e,n,i){var l,r,u;if(e!==null&&typeof e=="object")if(r=n.indexOf(e),r!==-1)i.indexOf(r)===-1&&i.push(r);else if(n.push(e),Array.isArray(e))for(r=0,u=e.length;r<u;r+=1)ee(e[r],n,i);else for(l=Object.keys(e),r=0,u=l.length;r<u;r+=1)ee(e[l[r]],n,i)}function dr(e,n){n=n||{};var i=new nr(n);i.noRefs||hr(e,i);var l=e;return i.replacer&&(l=i.replacer.call({"":l},"",l)),b(i,0,l,!0,!0)?i.dump+`
|
|
32
|
+
`:""}var sr=dr,mr={dump:sr};function ue(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var xr=C,gr=Ee,Ar=Te,vr=Ne,yr=Re,Cr=ie,_r=ze.load,wr=ze.loadAll,Er=mr.dump,Sr=w,Fr={binary:Pe,float:ke,map:be,null:Oe,pairs:je,set:Ue,timestamp:Ye,bool:Ie,int:Le,merge:Be,omap:He,seq:Fe,str:Se},br=ue("safeLoad","load"),Tr=ue("safeLoadAll","loadAll"),Or=ue("safeDump","dump"),Ir={Type:xr,Schema:gr,FAILSAFE_SCHEMA:Ar,JSON_SCHEMA:vr,CORE_SCHEMA:yr,DEFAULT_SCHEMA:Cr,load:_r,loadAll:wr,dump:Er,YAMLException:Sr,types:Fr,safeLoad:br,safeLoadAll:Tr,safeDump:Or};export{yr as CORE_SCHEMA,Cr as DEFAULT_SCHEMA,Ar as FAILSAFE_SCHEMA,vr as JSON_SCHEMA,gr as Schema,xr as Type,Sr as YAMLException,Ir as default,Er as dump,_r as load,wr as loadAll,Or as safeDump,br as safeLoad,Tr as safeLoadAll,Fr as types};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./
|
|
2
|
-
import{_ as Y}from"./PPVm8Dsz.js";import{aY as G,aC as A,aX as X,e as S,f as P,g,s as c,a6 as D,u as q}from"./CT6oIU-C.js";import{i as z}from"./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./IvlPKm-T.js","./CT6oIU-C.js","./CALGIiWi.js","./DGbA7IXh.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Y}from"./PPVm8Dsz.js";import{aY as G,aC as A,aX as X,e as S,f as P,g,s as c,a6 as D,u as q}from"./CT6oIU-C.js";import{i as z}from"./boqTA85z.js";import{i as H,w as h}from"./CALGIiWi.js";import{a as K}from"./DbbB6Up5.js";import{n as $}from"./CygV1PFY.js";import{l as Q,o as N}from"./iDtAARVW.js";function At(...t){return t.filter(Boolean).join(" ")}const Z=typeof document<"u",v=typeof window<"u"?window:void 0;function tt(t){let e=t.activeElement;for(;e?.shadowRoot;){const s=e.shadowRoot.activeElement;if(s===e)break;e=s}return e}class et{#e;#t;constructor(e={}){const{window:s=v,document:i=s?.document}=e;s!==void 0&&(this.#e=i,this.#t=Q(n=>{const r=N(s,"focusin",n),o=N(s,"focusout",n);return()=>{r(),o()}}))}get current(){return this.#t?.(),this.#e?tt(this.#e):null}}new et;class st{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return G(this.#t)}get(){const e=A(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const s=A(this.#t);return s===void 0?e:s}set(e){return X(this.#t,e)}}const it=new st("<Toaster/>");let U=0;class nt{#e=S(P([]));get toasts(){return g(this.#e)}set toasts(e){c(this.#e,e,!0)}#t=S(P([]));get heights(){return g(this.#t)}set heights(e){c(this.#t,e,!0)}#s=e=>{const s=this.toasts.findIndex(i=>i.id===e);return s===-1?null:s};addToast=e=>{Z&&this.toasts.unshift(e)};updateToast=({id:e,data:s,type:i,message:n})=>{const r=this.toasts.findIndex(f=>f.id===e),o=this.toasts[r];this.toasts[r]={...o,...s,id:e,title:n,type:i,updated:!0}};create=e=>{const{message:s,...i}=e,n=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:U++,r=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,o=e.type===void 0?"default":e.type;return D(()=>{this.toasts.find(E=>E.id===n)?this.updateToast({id:n,data:e,type:o,message:s,dismissible:r}):this.addToast({...i,id:n,title:s,dismissible:r,type:o})}),n};dismiss=e=>(D(()=>{if(e===void 0){this.toasts=this.toasts.map(i=>({...i,dismiss:!0}));return}const s=this.toasts.findIndex(i=>i.id===e);this.toasts[s]&&(this.toasts[s]={...this.toasts[s],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const s=this.#s(e);if(s!==null)return this.toasts.splice(s,1),e};message=(e,s)=>this.create({...s,type:"default",message:e});error=(e,s)=>this.create({...s,type:"error",message:e});success=(e,s)=>this.create({...s,type:"success",message:e});info=(e,s)=>this.create({...s,type:"info",message:e});warning=(e,s)=>this.create({...s,type:"warning",message:e});loading=(e,s)=>this.create({...s,type:"loading",message:e});promise=(e,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:e,type:"loading",message:typeof s.loading=="string"?s.loading:s.loading()}));const n=e instanceof Promise?e:e();let r=i!==void 0;return n.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){r=!1;const f=rt(o);this.create({id:i,type:"error",message:f})}else if(s.success!==void 0){r=!1;const f=typeof s.success=="function"?s.success(o):s.success;this.create({id:i,type:"success",message:f})}}).catch(o=>{if(s.error!==void 0){r=!1;const f=typeof s.error=="function"?s.error(o):s.error;this.create({id:i,type:"error",message:f})}}).finally(()=>{r&&(this.dismiss(i),i=void 0),s.finally?.()}),i};custom=(e,s)=>{const i=s?.id||U++;return this.create({component:e,id:i,...s}),i};removeHeight=e=>{this.heights=this.heights.filter(s=>s.toastId!==e)};setHeight=e=>{const s=this.#s(e.toastId);if(s===null){this.heights.push(e);return}this.heights[s]=e};reset=()=>{this.toasts=[],this.heights=[]}}function rt(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const d=new nt;function ot(t,e){return d.create({message:t,...e})}class Pt{#e=q(()=>d.toasts.filter(e=>!e.dismiss));get toasts(){return g(this.#e)}}function Dt(){return it.get()}const ct=ot,u=Object.assign(ct,{success:d.success,info:d.info,warning:d.warning,error:d.error,custom:d.custom,message:d.message,promise:d.promise,dismiss:d.dismiss,loading:d.loading,getActiveToasts:()=>d.toasts.filter(t=>!t.dismiss)}),at=800;function ut(){let t=S(!1),e=S(null),s=S(null),i=null,n=null,r=!1;function o(p,w,m,l){i&&i.repo===p&&i.type===w&&i.id===m?(l.data!==void 0&&(i.payload.data=l.data),l.content!==void 0&&(i.payload.content=l.content)):i={repo:p,type:w,id:m,payload:{...l}},f()}function f(){n&&clearTimeout(n),n=setTimeout(E,at)}async function E(){if(n=null,!r&&i){const{repo:p,type:w,id:m,payload:l}=i;i=null,r=!0,c(t,!0),c(s,null);try{if(await H(p,w,m,l),c(e,new Date,!0),l.data?.name){const b=h.repos.find(C=>C.name===p)?.entities.find(C=>C.id===m);b&&(b.title=l.data.name)}}catch(y){c(s,y.message??"Save failed",!0);const b=y.status??y.statusCode;(!b||b>=500)&&(i={repo:p,type:w,id:m,payload:l})}finally{c(t,!1),r=!1,i&&E()}}}function J(){n&&(clearTimeout(n),n=null),i&&E()}async function L(p,w,m,l){c(t,!0),c(s,null);try{const y=await H(p,w,m,l);return c(e,new Date,!0),y}catch(y){return c(s,y.message??"Save failed",!0),null}finally{c(t,!1)}}function V(){c(s,null),c(e,null),i=null,n&&(clearTimeout(n),n=null)}return{get saving(){return g(t)},get lastSaved(){return g(e)},get error(){return g(s)},get hasPending(){return!!(i||r)},scheduleAutoSave:o,flush:J,saveEntity:L,reset:V}}const lt=ut();let a=null,B=null,R=null,F=[],I=null,_=1e3,k=S(!1),W=S(null);const T=new Map,x={},O={};function j(t,e){T.delete(t);const s=e.entities.length,i=s===1?`${t} updated ${e.entities[0]}`:`${t} updated ${s} entities`;u(i)}function dt(t){for(const[e,s]of T)s.repo===t&&(clearTimeout(s.timer),T.delete(e))}function ft(t){const e=K.user?.displayName;if(t.type==="sync_progress"){const s=x[t.repo];if(s){const i=t.message.trim(),n=i.match(/^Syncing from source:\s*(.+)$/i);n&&(O[t.repo]=`Syncing ${n[1].trim()}…`);const r=O[t.repo]??`Syncing ${t.repo}…`;u.loading(r,{id:s,description:i,duration:36e5})}return}if(t.type==="entity_change"){if(e&&t.actor===e&&t.source==="api"){h.refreshEntities(t.repo);return}if(h.refreshEntities(t.repo),$.selectedRepo===t.repo&&$.selectedType===t.entityType&&$.selectedId===t.entityId){lt.hasPending?u(`${t.actor} also saved changes to this entity`):z();return}const i=T.get(t.actor);if(i)clearTimeout(i.timer),i.entities.includes(t.entityId)||i.entities.push(t.entityId),i.timer=setTimeout(()=>j(t.actor,i),1e4);else{const n={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>j(t.actor,n),1e4)};T.set(t.actor,n)}return}if(t.type==="session_commit"){if(e&&t.actor===e){c(W,t.timestamp,!0);return}const s=t.entities.length,i=s===1?`${t.actor} saved changes to ${t.entities[0]}`:`${t.actor} saved ${s} changes in ${t.repo}`;u(i),h.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(dt(t.repo),!x[t.repo]){const s=t.created+t.updated+t.deleted,i=s===0?`Sync complete · no changes in ${t.repo}`:`Sync complete · ${s} ${s===1?"entity":"entities"} from ${t.source}`;u.success(i)}h.refreshEntities(t.repo);return}if(t.type==="collection_created"){u(`${t.actor} created collection ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){u(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){u(`${t.actor} pushed to ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="presence"){B?.(t);return}if(t.type==="online"){R?.(t);return}if(t.type==="insights_updated"){Y(()=>import("./IvlPKm-T.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(s=>s.insightsStore.load());return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&$.selectedRepo===t.repo&&$.deselect(),h.load();return}}function M(){if(typeof window>"u"||a&&(a.readyState===WebSocket.OPEN||a.readyState===WebSocket.CONNECTING))return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;a=new WebSocket(e),a.binaryType="arraybuffer",a.onopen=()=>{c(k,!0),_=1e3,h.refreshAll();for(const s of F)s()},a.onmessage=s=>{if(!(s.data instanceof ArrayBuffer))try{const i=JSON.parse(s.data);if(i?.type==="ping"){a?.send(JSON.stringify({type:"pong"}));return}const n=i;n.type&&n.type!=="toast"&&ft(n)}catch{}},a.onclose=()=>{c(k,!1),a=null,I=setTimeout(()=>{_=Math.min(_*2,1e4),M()},_)},a.onerror=()=>{}}function ht(){I&&(clearTimeout(I),I=null),a&&(a.close(),a=null),c(k,!1);for(const[,t]of T)clearTimeout(t.timer);T.clear()}function pt(t,e=4e3){u(t,{duration:e})}function mt(t,e){const s=crypto.randomUUID();return e?.loading?u.loading(t,{id:s,duration:36e5}):u(t,{id:s}),s}function yt(t,e,s){if(s?.loading){u.loading(e,{id:t});return}/failed|error/i.test(e)?u.error(e,{id:t,duration:s?.duration??6e3}):u.success(e,{id:t,duration:s?.duration??4e3})}function gt(t){const e=crypto.randomUUID();x[t]=e,u.loading(`Syncing ${t}…`,{id:e,duration:36e5})}function wt(t,e,s){const i=x[t];i&&(delete x[t],delete O[t],s?u.error(e,{id:i,duration:6e3}):u.success(e,{id:i,duration:4e3}))}function St(t){B=t}function Tt(t){R=t}function Et(t){F.push(t)}function bt(t){a?.readyState===WebSocket.OPEN&&a.send(JSON.stringify(t))}const Ht={get connected(){return g(k)},get lastAutoSaved(){return g(W)},get ws(){return a},connect:M,disconnect:ht,showToast:pt,showPersistentToast:mt,updateToast:yt,startSyncToast:gt,finishSyncToast:wt,send:bt,setPresenceHandler:St,setOnlineHandler:Tt,addConnectHandler:Et};export{Pt as S,d as a,At as c,lt as e,Ht as r,it as s,u as t,Dt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,a,f as l}from"./iDtAARVW.js";import{h as w}from"./CT6oIU-C.js";import{i as n}from"./72bZS3G9.js";import{p as d}from"./cLyZlkXv.js";import{L as b,T as k}from"./
|
|
1
|
+
import{c as m,a,f as l}from"./iDtAARVW.js";import{h as w}from"./CT6oIU-C.js";import{i as n}from"./72bZS3G9.js";import{p as d}from"./cLyZlkXv.js";import{L as b,T as k}from"./qp7wzf3M.js";import{t as y}from"./7-DE2B7E.js";import{u as S}from"./7-DE2B7E.js";var u=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>'),x=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>'),_=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>'),z=l('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function H(s,v){const t=d(v,"type",3,"success");var e=m(),c=w(e);{var i=o=>{var r=u();a(o,r)},p=o=>{var r=x();a(o,r)},h=o=>{var r=_();a(o,r)},g=o=>{var r=z();a(o,r)},f=o=>{};n(c,o=>{t()==="success"?o(i):t()==="error"?o(p,1):t()==="info"?o(h,2):t()==="warning"?o(g,3):o(f,!1)})}a(s,e)}export{H as Icon,b as Loader,k as Toaster,y as toast,S as useSonner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as i,f as y,g as r,s as n}from"./CT6oIU-C.js";import{g as l}from"./
|
|
1
|
+
import{e as i,f as y,g as r,s as n}from"./CT6oIU-C.js";import{g as l}from"./boqTA85z.js";import{d as v,u as V,c as F,f as h}from"./CALGIiWi.js";const d={selectedType:null,groupBy:null,sortKey:"name",sortAsc:!0,filters:{text:{},enum:{},date:{}}};function x(){let a=i(y([])),o=i(null),c=i(!1);async function w(){try{n(a,await h(),!0),n(c,!0)}catch(e){console.error("Failed to load views:",e)}}async function f(e,t="list"){const s=t==="calendar"?{...d,calendar:{dateField:"due_date",year:new Date().getFullYear(),month:new Date().getMonth()+1}}:d,u=await F(e,s,t);return n(a,[...r(a),u],!0),u}async function g(e,t){await V(e,t),n(a,r(a).map(s=>s.id===e?{...s,...t}:s),!0)}async function m(e){if(await v(e),n(a,r(a).filter(t=>t.id!==e),!0),r(o)===e){const t=r(a)[0];t?(n(o,t.id,!0),l(`/views/${t.id}`,{replaceState:!0})):(n(o,null),l("/",{replaceState:!0}))}}function p(e){n(o,e,!0)}return{get views(){return r(a)},get activeViewId(){return r(o)},get loaded(){return r(c)},load:w,create:f,update:g,remove:m,setActive:p}}const D=x();export{D as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as St,p as he,c as j,a as u,b as D,s as Tt,f as Vt,d as ve,g as X,t as Nt,e as me}from"./iDtAARVW.js";import{e as F,s as d,g as o,u as O,p as _t,h as H,b as yt,c as y,ad as Kt,r as C,l as Ht,d as ot,a as Ut,n as U,m as At,t as ut,aC as ge,a5 as be,i as z}from"./CT6oIU-C.js";import{b as dt,a as ct,r as _e,s as ye}from"./CmCtpZ1Y.js";import{i as N,b as Ce}from"./72bZS3G9.js";import{e as we}from"./CDV5Q7RN.js";import{c as q}from"./CXH6iFbA.js";import{s as Wt}from"./DGbA7IXh.js";import{b as Pe,B as xe}from"./BS2rFAVq.js";import{p as v,s as ne,r as ue,l as Mt}from"./cLyZlkXv.js";import{g as re}from"./DCAAT8Ui.js";import{i as Zt}from"./Y90OgS-9.js";import{A as Te,C as se}from"./vSaooFHB.js";import{n as et}from"./D_2DWVrt.js";import{v as Bt}from"./BlpDkscI.js";import{w as He}from"./CDcXSODb.js";import{w as Qt,H as Ae,I as bt,C as Me,a as de,J as Ve,K as Lt,E as Ie,S as Oe,L as ce,c as ke,N as De,O as ie,h as k,d as ze,f as pe,n as xt,P as Fe,p as Ee,m as $t,q as ae,r as Se,F as Ne,A as We,u as Be,v as $e,x as Ke,y as Le,z as Ye,B as Xe,G as qe}from"./CJUKmosC.js";function jt(m,t){const[e,s]=m;let n=!1;const r=t.length;for(let h=0,i=r-1;h<r;i=h++){const[f,x]=t[h]??[0,0],[_,c]=t[i]??[0,0];x>=s!=c>=s&&e<=(_-f)*(s-x)/(c-x)+f&&(n=!n)}return n}function Gt(m,t){return m[0]>=t.left&&m[0]<=t.right&&m[1]>=t.top&&m[1]<=t.bottom}function le(m,t){const e=m.left+m.width/2,s=m.top+m.height/2,n=t.left+t.width/2,r=t.top+t.height/2,h=n-e,i=r-s;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":i>0?"bottom":"top"}class je{#t;#n;#s;#r=null;#e=null;#l=[];#h=null;#o=null;#i=null;#a(){this.#o!==null&&(cancelAnimationFrame(this.#o),this.#o=null)}#d(){this.#a(),this.#o=requestAnimationFrame(()=>{this.#o=null,!(!this.#r||!this.#e)&&(this.#u(),this.#t.onPointerExit())})}#c(){this.#i!==null&&(clearTimeout(this.#i),this.#i=null)}#f(){this.#s!==null&&(this.#c(),this.#i=window.setTimeout(()=>{this.#i=null,!(!this.#r||!this.#e)&&(this.#u(),this.#t.onPointerExit())},this.#s))}constructor(t){this.#t=t,this.#n=t.buffer??1;const e=t.transitIntentTimeout;this.#s=typeof e=="number"&&e>0?e:null,Qt([t.triggerNode,t.contentNode,t.enabled],([s,n,r])=>{if(!s||!n||!r){this.#h=null,this.#u();return}this.#h&&this.#h!==s&&this.#u(),this.#h=s;const h=Ae(s),i=a=>{this.#v([a.clientX,a.clientY],s,n)},f=a=>{const p=a.relatedTarget;if(bt(p)&&n.contains(p))return;const T=this.#t.ignoredTargets?.()??[];bt(p)&&T.some(E=>E===p||E.contains(p))||(this.#l=bt(p)&&T.length>0?T.filter(E=>p.contains(E)):[],this.#r=[a.clientX,a.clientY],this.#e="content",this.#d())},x=()=>{this.#u()},_=()=>{this.#u()},c=a=>{const p=a.relatedTarget;bt(p)&&s.contains(p)||(this.#r=[a.clientX,a.clientY],this.#e="trigger",this.#d())};return[St(h,"pointermove",i),St(s,"pointerleave",f),St(s,"pointerenter",x),St(n,"pointerenter",_),St(n,"pointerleave",c)].reduce((a,p)=>()=>{a(),p()},()=>{})})}#v(t,e,s){if(!this.#r||!this.#e)return;this.#a(),this.#f();const n=e.getBoundingClientRect(),r=s.getBoundingClientRect();if(this.#e==="content"&&Gt(t,r)){this.#u();return}if(this.#e==="trigger"&&Gt(t,n)){this.#u();return}if(this.#e==="content"&&this.#l.length>0)for(const _ of this.#l){const c=_.getBoundingClientRect();if(Gt(t,c))return;const a=le(n,c),p=this.#p(n,c,a);if(p&&jt(t,p))return}const h=le(n,r),i=this.#p(n,r,h);if(i&&jt(t,i))return;const f=this.#e==="content"?r:n,x=this.#m(this.#r,f,h,this.#e);jt(t,x)||(this.#u(),this.#t.onPointerExit())}#u(){this.#r=null,this.#e=null,this.#l=[],this.#a(),this.#c()}#p(t,e,s){const n=this.#n;switch(s){case"top":return[[Math.min(t.left,e.left)-n,t.top],[Math.min(t.left,e.left)-n,e.bottom],[Math.max(t.right,e.right)+n,e.bottom],[Math.max(t.right,e.right)+n,t.top]];case"bottom":return[[Math.min(t.left,e.left)-n,t.bottom],[Math.min(t.left,e.left)-n,e.top],[Math.max(t.right,e.right)+n,e.top],[Math.max(t.right,e.right)+n,t.bottom]];case"left":return[[t.left,Math.min(t.top,e.top)-n],[e.right,Math.min(t.top,e.top)-n],[e.right,Math.max(t.bottom,e.bottom)+n],[t.left,Math.max(t.bottom,e.bottom)+n]];case"right":return[[t.right,Math.min(t.top,e.top)-n],[e.left,Math.min(t.top,e.top)-n],[e.left,Math.max(t.bottom,e.bottom)+n],[t.right,Math.max(t.bottom,e.bottom)+n]]}}#m(t,e,s,n){const r=this.#n*4,[h,i]=t;switch(n==="trigger"?this.#g(s):s){case"top":return[[h-r,i+r],[h+r,i+r],[e.right+r,e.bottom],[e.right+r,e.top],[e.left-r,e.top],[e.left-r,e.bottom]];case"bottom":return[[h-r,i-r],[h+r,i-r],[e.right+r,e.top],[e.right+r,e.bottom],[e.left-r,e.bottom],[e.left-r,e.top]];case"left":return[[h+r,i-r],[h+r,i+r],[e.right,e.bottom+r],[e.left,e.bottom+r],[e.left,e.top-r],[e.right,e.top-r]];case"right":return[[h-r,i-r],[h-r,i+r],[e.left,e.bottom+r],[e.right,e.bottom+r],[e.right,e.top-r],[e.left,e.top-r]]}}#g(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const Jt=ze({component:"popover",parts:["root","trigger","content","close","overlay"]}),Rt=new Me("Popover.Root");class te{static create(t){return Rt.set(new te(t))}opts;#t=F(null);get contentNode(){return o(this.#t)}set contentNode(t){d(this.#t,t,!0)}contentPresence;#n=F(null);get triggerNode(){return o(this.#n)}set triggerNode(t){d(this.#n,t,!0)}#s=F(null);get overlayNode(){return o(this.#s)}set overlayNode(t){d(this.#s,t,!0)}overlayPresence;#r=F(!1);get openedViaHover(){return o(this.#r)}set openedViaHover(t){d(this.#r,t,!0)}#e=F(!1);get hasInteractedWithContent(){return o(this.#e)}set hasInteractedWithContent(t){d(this.#e,t,!0)}#l=F(!1);get hoverCooldown(){return o(this.#l)}set hoverCooldown(t){d(this.#l,t,!0)}#h=F(0);get closeDelay(){return o(this.#h)}set closeDelay(t){d(this.#h,t,!0)}#o=null;#i=null;constructor(t){this.opts=t,this.contentPresence=new ie({ref:k(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new ie({ref:k(()=>this.overlayNode),open:this.opts.open}),Qt(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#a())})}setDomContext(t){this.#i=t}#a(){this.#o!==null&&this.#i&&(this.#i.clearTimeout(this.#o),this.#o=null)}toggleOpen(){this.#a(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#a(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#a(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#a(),this.closeDelay<=0?this.opts.open.current=!1:this.#i&&(this.#o=this.#i.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#o=null},this.closeDelay))))}cancelDelayedClose(){this.#a()}markInteraction(){this.hasInteractedWithContent=!0,this.#a()}}class ee{static create(t){return new ee(t,Rt.get())}opts;root;attachment;domContext;#t=null;#n=null;#s=F(!1);constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.triggerNode=s),this.domContext=new Ve(t.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Qt(()=>this.opts.closeDelay.current,s=>{this.root.closeDelay=s})}#r(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#e(){this.#n!==null&&(this.domContext.clearTimeout(this.#n),this.#n=null)}#l(){this.#r(),this.#e()}onpointerenter(t){if(this.opts.disabled.current||!this.opts.openOnHover.current||Lt(t)||(d(this.#s,!0),this.#e(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const e=this.opts.openDelay.current;e<=0?this.root.handleHoverOpen():this.#t=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#t=null},e)}onpointerleave(t){this.opts.disabled.current||this.opts.openOnHover.current&&(Lt(t)||(d(this.#s,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(t){if(!this.opts.disabled.current&&t.button===0){if(this.#l(),o(this.#s)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}o(this.#s)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(t){this.opts.disabled.current||(t.key===Ie||t.key===Oe)&&(t.preventDefault(),this.#l(),this.root.toggleOpen())}#h(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#o=O(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":ke(this.root.opts.open.current),"data-state":ce(this.root.opts.open.current),"aria-controls":this.#h(),[Jt.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#o)}set props(t){d(this.#o,t)}}class oe{static create(t){return new oe(t,Rt.get())}opts;root;attachment;constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.contentNode=s),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new je({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(t){this.root.markInteraction()}onfocusin(t){const e=t.target;bt(e)&&De(e)&&this.root.markInteraction()}onpointerenter(t){Lt(t)||this.root.cancelDelayedClose()}onpointerleave(t){Lt(t)}onInteractOutside=t=>{if(this.opts.onInteractOutside.current(t),t.defaultPrevented||!bt(t.target))return;const e=t.target.closest(Jt.selector("trigger"));if(!(e&&e===this.root.triggerNode)){if(this.opts.customAnchor.current){if(bt(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(t.target))return}else if(typeof this.opts.customAnchor.current=="string"){const s=document.querySelector(this.opts.customAnchor.current);if(s&&s.contains(t.target))return}}this.root.handleClose()}};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#t=O(()=>({open:this.root.opts.open.current}));get snippetProps(){return o(this.#t)}set snippetProps(t){d(this.#t,t)}#n=O(()=>({id:this.opts.id.current,tabindex:-1,"data-state":ce(this.root.opts.open.current),[Jt.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#n)}set props(t){d(this.#n,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var Ge=D("<div><div><!></div></div>"),Je=D("<div><div><!></div></div>");function Ue(m,t){const e=he();_t(t,!0);let s=v(t,"ref",15,null),n=v(t,"id",19,()=>pe(e)),r=v(t,"forceMount",3,!1),h=v(t,"onOpenAutoFocus",3,xt),i=v(t,"onCloseAutoFocus",3,xt),f=v(t,"onEscapeKeydown",3,xt),x=v(t,"onInteractOutside",3,xt),_=v(t,"trapFocus",3,!0),c=v(t,"preventScroll",3,!1),a=v(t,"customAnchor",3,null),p=ue(t,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const T=oe.create({id:k(()=>n()),ref:k(()=>s(),V=>s(V)),onInteractOutside:k(()=>x()),onEscapeKeydown:k(()=>f()),customAnchor:k(()=>a())}),E=O(()=>$t(p,T.props)),Ct=O(()=>_()&&T.shouldTrapFocus);function wt(V){T.shouldTrapFocus||V.preventDefault(),h()(V)}var W=j(),G=H(W);{var K=V=>{Fe(V,ne(()=>o(E),()=>T.popperProps,{get ref(){return T.opts.ref},get enabled(){return T.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return c()},loop:!0,forceMount:!0,get customAnchor(){return a()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return T.shouldRender},popper:(pt,rt)=>{let ft=()=>rt?.().props,st=()=>rt?.().wrapperProps;const it=O(()=>$t(ft(),{style:ae("popover")},{style:t.style}));var at=j(),Ot=H(at);{var kt=M=>{var A=j(),S=H(A);{let Z=O(()=>({props:o(it),wrapperProps:st(),...T.snippetProps}));dt(S,()=>t.child,()=>o(Z))}u(M,A)},Pt=M=>{var A=Ge();ct(A,()=>({...st()}));var S=y(A);ct(S,()=>({...o(it)}));var Z=y(S);dt(Z,()=>t.children??Kt),C(S),C(A),u(M,A)};N(Ot,M=>{t.child?M(kt):M(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))},nt=V=>{Ee(V,ne(()=>o(E),()=>T.popperProps,{get ref(){return T.opts.ref},get open(){return T.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return c()},loop:!0,forceMount:!1,get customAnchor(){return a()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return T.shouldRender},popper:(pt,rt)=>{let ft=()=>rt?.().props,st=()=>rt?.().wrapperProps;const it=O(()=>$t(ft(),{style:ae("popover")},{style:t.style}));var at=j(),Ot=H(at);{var kt=M=>{var A=j(),S=H(A);{let Z=O(()=>({props:o(it),wrapperProps:st(),...T.snippetProps}));dt(S,()=>t.child,()=>o(Z))}u(M,A)},Pt=M=>{var A=Je();ct(A,()=>({...st()}));var S=y(A);ct(S,()=>({...o(it)}));var Z=y(S);dt(Z,()=>t.children??Kt),C(S),C(A),u(M,A)};N(Ot,M=>{t.child?M(kt):M(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))};N(G,V=>{r()?V(K):r()||V(nt,1)})}u(m,W),yt()}var Ze=D("<button><!></button>");function Qe(m,t){const e=he();_t(t,!0);let s=v(t,"id",19,()=>pe(e)),n=v(t,"ref",15,null),r=v(t,"type",3,"button"),h=v(t,"disabled",3,!1),i=v(t,"openOnHover",3,!1),f=v(t,"openDelay",3,700),x=v(t,"closeDelay",3,300),_=ue(t,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const c=ee.create({id:k(()=>s()),ref:k(()=>n(),p=>n(p)),disabled:k(()=>!!h()),openOnHover:k(()=>i()),openDelay:k(()=>f()),closeDelay:k(()=>x())}),a=O(()=>$t(_,c.props,{type:r()}));Se(m,{get id(){return s()},get ref(){return c.opts.ref},children:(p,T)=>{var E=j(),Ct=H(E);{var wt=G=>{var K=j(),nt=H(K);dt(nt,()=>t.child,()=>({props:o(a)})),u(G,K)},W=G=>{var K=Ze();ct(K,()=>({...o(a)}));var nt=y(K);dt(nt,()=>t.children??Kt),C(K),u(G,K)};N(Ct,G=>{t.child?G(wt):G(W,!1)})}u(p,E)},$$slots:{default:!0}}),yt()}function Re(m,t){_t(t,!0);let e=v(t,"open",15,!1),s=v(t,"onOpenChange",3,xt),n=v(t,"onOpenChangeComplete",3,xt);te.create({open:k(()=>e(),r=>{e(r),s()(r)}),onOpenChangeComplete:k(()=>n())}),Ne(m,{children:(r,h)=>{var i=j(),f=H(i);dt(f,()=>t.children??Kt),u(r,i)},$$slots:{default:!0}}),yt()}var to=Vt("<title> </title>"),eo=Vt('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function oo(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=eo();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=to(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(3),C(f),u(m,f),yt()}var no=Vt("<title> </title>"),ro=Vt('<svg><!><path d="M10 6H28V8H10z"></path><path d="M10 24H28V26H10z"></path><path d="M10 15H28V17H10z"></path><path d="M4 15H6V17H4z"></path><path d="M4 6H6V8H4z"></path><path d="M4 24H6V26H4z"></path></svg>');function so(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=ro();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=no(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(6),C(f),u(m,f),yt()}var io=Vt("<title> </title>"),ao=Vt('<svg><!><path d="M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"></path></svg>');function lo(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=ao();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=io(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(),C(f),u(m,f),yt()}const ho=Re,uo=Qe,co=Ue;var po=D('<div class="tab active svelte-r6dy5f"><input class="tab-rename-input svelte-r6dy5f"/></div>'),fo=D('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),vo=D('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),mo=D('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),go=D('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),bo=D("<!> <span>New View</span>",1),_o=D('<button class="add-view-option svelte-r6dy5f"><!> List</button> <button class="add-view-option svelte-r6dy5f"><!> Calendar</button>',1),yo=D("<!> <!>",1),Co=D("<!> <!>",1),wo=D("<!> <!>",1),Po=D("<!> <!>",1),xo=D('<div class="tab-bar svelte-r6dy5f"><div class="tabs-scroll svelte-r6dy5f"><button><span class="tab-label svelte-r6dy5f">Home</span></button> <button><span class="tab-label svelte-r6dy5f">Graph</span></button> <!> <!> <!></div> <div class="bar-right svelte-r6dy5f"><!> <!></div></div> <!>',1);function $o(m,t){_t(t,!0);let e=v(t,"activeView",3,"entity");const s=ge("chat");function n(l){re(l,{noScroll:!0})}const r=O(()=>et.selectedId!==null),h=O(()=>{if(!et.selectedRepo||!et.selectedId)return"";for(const l of He.repos){if(l.name!==et.selectedRepo)continue;const g=l.entities.find(w=>w.id===et.selectedId);if(g)return g.title}return et.selectedId.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase())});function i(){et.deselect(),n("/")}let f=F(!1);async function x(l){d(f,!1);const g=l==="calendar"?"Calendar":"List",w=await Bt.create(g,l);re(`/views/${w.id}`)}let _=F(null),c=F(""),a=F(null),p=F(!1);function T(l){d(p,!1),d(_,l.id,!0),d(c,l.name,!0)}be(()=>{o(_)&&o(a)&&(o(a).focus(),o(a).select(),setTimeout(()=>{d(p,!0)},50))});function E(){o(p)&&(o(_)&&o(c).trim()&&Bt.update(o(_),{name:o(c).trim()}),d(_,null),d(p,!1))}function Ct(){d(_,null),d(p,!1)}function wt(l){l.key==="Enter"&&(l.preventDefault(),d(p,!0),E()),l.key==="Escape"&&(l.preventDefault(),Ct())}let W=F(null);function G(l,g){l.stopPropagation(),d(W,g,!0)}async function K(){o(W)&&(await Bt.remove(o(W).id),d(W,null))}var nt=xo(),V=H(nt),It=y(V),pt=y(It);let rt;var ft=z(pt,2);let st;var it=z(ft,2);we(it,17,()=>Bt.views,l=>l.id,(l,g)=>{var w=j(),Q=H(w);{var R=B=>{var I=po(),b=y(I);_e(b),Ce(b,P=>d(a,P),()=>o(a)),C(I),ut(P=>ye(b,"size",P),[()=>Math.max(o(c).length,1)]),X("keydown",b,wt),X("input",b,P=>{d(c,P.currentTarget.value,!0)}),me("blur",b,E),Pe(b,()=>o(c),P=>d(c,P)),u(B,I)},tt=B=>{const I=O(()=>e()==="view"&&et.activeViewId===o(g).id);var b=vo();let P;var lt=y(b),$=y(lt,!0);C(lt);var L=z(lt,2);{var Dt=Y=>{var J=fo(),zt=y(J);se(zt,{size:12}),C(J),X("click",J,Yt=>G(Yt,o(g))),u(Y,J)};N(L,Y=>{o(I)&&Y(Dt)})}C(b),ut(()=>{P=Wt(b,1,"tab svelte-r6dy5f",null,P,{"tab-permanent":!o(I),active:o(I)}),Tt($,o(g).name)}),X("click",b,()=>n(`/views/${o(g).id}`)),X("dblclick",b,()=>T(o(g))),u(B,b)};N(Q,B=>{o(_)===o(g).id?B(R):B(tt,!1)})}u(l,w)});var at=z(it,2);{var Ot=l=>{const g=O(()=>e()==="entity"&&o(r));var w=go();let Q;var R=y(w),tt=y(R,!0);C(R);var B=z(R,2);{var I=b=>{var P=mo(),lt=y(P);se(lt,{size:12}),C(P),X("click",P,$=>{$.stopPropagation(),i()}),u(b,P)};N(B,b=>{o(g)&&b(I)})}C(w),ut(()=>{Q=Wt(w,1,"tab svelte-r6dy5f",null,Q,{"tab-permanent":!o(g),active:o(g)}),Tt(tt,o(h))}),X("click",w,()=>n(et.entityPath??"/")),u(l,w)};N(at,l=>{o(r)&&l(Ot)})}var kt=z(at,2);q(kt,()=>ho,(l,g)=>{g(l,{get open(){return o(f)},set open(w){d(f,w,!0)},children:(w,Q)=>{var R=yo(),tt=H(R);q(tt,()=>uo,(I,b)=>{b(I,{class:"new-view-btn",title:"New view",children:(P,lt)=>{var $=bo(),L=H($);Te(L,{size:16}),U(2),u(P,$)},$$slots:{default:!0}})});var B=z(tt,2);q(B,()=>co,(I,b)=>{b(I,{class:"add-view-menu",sideOffset:4,align:"start",children:(P,lt)=>{var $=_o(),L=H($),Dt=y(L);so(Dt,{size:14}),U(),C(L);var Y=z(L,2),J=y(Y);lo(J,{size:14}),U(),C(Y),X("click",L,()=>x("list")),X("click",Y,()=>x("calendar")),u(P,$)},$$slots:{default:!0}})}),u(w,R)},$$slots:{default:!0}})}),C(It);var Pt=z(It,2),M=y(Pt);{var A=l=>{var g=j(),w=H(g);dt(w,()=>t.right),u(l,g)};N(M,l=>{t.right&&l(A)})}var S=z(M,2);{var Z=l=>{xe(l,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return s.toggle},children:(g,w)=>{oo(g,{size:14})},$$slots:{default:!0}})};N(S,l=>{s.open||l(Z)})}C(Pt),C(V);var fe=z(V,2);{let l=O(()=>!!o(W));q(fe,()=>qe,(g,w)=>{w(g,{get open(){return o(l)},onOpenChange:Q=>{Q||d(W,null)},children:(Q,R)=>{var tt=j(),B=H(tt);q(B,()=>We,(I,b)=>{b(I,{children:(P,lt)=>{var $=Po(),L=H($);q(L,()=>Be,(Y,J)=>{J(Y,{children:(zt,Yt)=>{var Ft=Co(),Et=H(Ft);q(Et,()=>$e,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt("Delete view?");u(gt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);q(Xt,()=>Ke,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt();ut(()=>Tt(ht,`The view "${o(W)?.name??""}" will be permanently deleted.`)),u(gt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})});var Dt=z(L,2);q(Dt,()=>Le,(Y,J)=>{J(Y,{children:(zt,Yt)=>{var Ft=wo(),Et=H(Ft);q(Et,()=>Ye,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt("Cancel");u(gt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);q(Xt,()=>Xe,(vt,mt)=>{mt(vt,{onclick:K,children:(gt,qt)=>{U();var ht=Nt("Delete");u(gt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})}),u(P,$)},$$slots:{default:!0}})}),u(Q,tt)},$$slots:{default:!0}})})}ut(()=>{rt=Wt(pt,1,"tab tab-permanent svelte-r6dy5f",null,rt,{active:e()==="home"}),st=Wt(ft,1,"tab tab-permanent svelte-r6dy5f",null,st,{active:e()==="graph"})}),X("click",pt,()=>n("/")),X("click",ft,()=>e()!=="graph"&&n("/graph")),u(m,nt),yt()}ve(["click","keydown","input","dblclick"]);export{co as C,ho as R,uo as T,$o as V,lo as a};
|
|
1
|
+
import{o as St,p as he,c as j,a as u,b as D,s as Tt,f as Vt,d as ve,g as X,t as Nt,e as me}from"./iDtAARVW.js";import{e as F,s as d,g as o,u as O,p as _t,h as H,b as yt,c as y,ad as Kt,r as C,l as Ht,d as ot,a as Ut,n as U,m as At,t as ut,aC as ge,a5 as be,i as z}from"./CT6oIU-C.js";import{b as dt,a as ct,r as _e,s as ye}from"./CmCtpZ1Y.js";import{i as N,b as Ce}from"./72bZS3G9.js";import{e as we}from"./CDV5Q7RN.js";import{c as q}from"./CXH6iFbA.js";import{s as Wt}from"./DGbA7IXh.js";import{b as Pe,B as xe}from"./BS2rFAVq.js";import{p as v,s as ne,r as ue,l as Mt}from"./cLyZlkXv.js";import{g as re}from"./boqTA85z.js";import{i as Zt}from"./Y90OgS-9.js";import{A as Te,C as se}from"./vSaooFHB.js";import{n as et}from"./CygV1PFY.js";import{v as Bt}from"./BXgvIKUZ.js";import{w as He}from"./CALGIiWi.js";import{w as Qt,H as Ae,I as bt,C as Me,a as de,J as Ve,K as Lt,E as Ie,S as Oe,L as ce,c as ke,N as De,O as ie,h as k,d as ze,f as pe,n as xt,P as Fe,p as Ee,m as $t,q as ae,r as Se,F as Ne,A as We,u as Be,v as $e,x as Ke,y as Le,z as Ye,B as Xe,G as qe}from"./CJUKmosC.js";function jt(m,t){const[e,s]=m;let n=!1;const r=t.length;for(let h=0,i=r-1;h<r;i=h++){const[f,x]=t[h]??[0,0],[_,c]=t[i]??[0,0];x>=s!=c>=s&&e<=(_-f)*(s-x)/(c-x)+f&&(n=!n)}return n}function Gt(m,t){return m[0]>=t.left&&m[0]<=t.right&&m[1]>=t.top&&m[1]<=t.bottom}function le(m,t){const e=m.left+m.width/2,s=m.top+m.height/2,n=t.left+t.width/2,r=t.top+t.height/2,h=n-e,i=r-s;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":i>0?"bottom":"top"}class je{#t;#n;#s;#r=null;#e=null;#l=[];#h=null;#o=null;#i=null;#a(){this.#o!==null&&(cancelAnimationFrame(this.#o),this.#o=null)}#d(){this.#a(),this.#o=requestAnimationFrame(()=>{this.#o=null,!(!this.#r||!this.#e)&&(this.#u(),this.#t.onPointerExit())})}#c(){this.#i!==null&&(clearTimeout(this.#i),this.#i=null)}#f(){this.#s!==null&&(this.#c(),this.#i=window.setTimeout(()=>{this.#i=null,!(!this.#r||!this.#e)&&(this.#u(),this.#t.onPointerExit())},this.#s))}constructor(t){this.#t=t,this.#n=t.buffer??1;const e=t.transitIntentTimeout;this.#s=typeof e=="number"&&e>0?e:null,Qt([t.triggerNode,t.contentNode,t.enabled],([s,n,r])=>{if(!s||!n||!r){this.#h=null,this.#u();return}this.#h&&this.#h!==s&&this.#u(),this.#h=s;const h=Ae(s),i=a=>{this.#v([a.clientX,a.clientY],s,n)},f=a=>{const p=a.relatedTarget;if(bt(p)&&n.contains(p))return;const T=this.#t.ignoredTargets?.()??[];bt(p)&&T.some(E=>E===p||E.contains(p))||(this.#l=bt(p)&&T.length>0?T.filter(E=>p.contains(E)):[],this.#r=[a.clientX,a.clientY],this.#e="content",this.#d())},x=()=>{this.#u()},_=()=>{this.#u()},c=a=>{const p=a.relatedTarget;bt(p)&&s.contains(p)||(this.#r=[a.clientX,a.clientY],this.#e="trigger",this.#d())};return[St(h,"pointermove",i),St(s,"pointerleave",f),St(s,"pointerenter",x),St(n,"pointerenter",_),St(n,"pointerleave",c)].reduce((a,p)=>()=>{a(),p()},()=>{})})}#v(t,e,s){if(!this.#r||!this.#e)return;this.#a(),this.#f();const n=e.getBoundingClientRect(),r=s.getBoundingClientRect();if(this.#e==="content"&&Gt(t,r)){this.#u();return}if(this.#e==="trigger"&&Gt(t,n)){this.#u();return}if(this.#e==="content"&&this.#l.length>0)for(const _ of this.#l){const c=_.getBoundingClientRect();if(Gt(t,c))return;const a=le(n,c),p=this.#p(n,c,a);if(p&&jt(t,p))return}const h=le(n,r),i=this.#p(n,r,h);if(i&&jt(t,i))return;const f=this.#e==="content"?r:n,x=this.#m(this.#r,f,h,this.#e);jt(t,x)||(this.#u(),this.#t.onPointerExit())}#u(){this.#r=null,this.#e=null,this.#l=[],this.#a(),this.#c()}#p(t,e,s){const n=this.#n;switch(s){case"top":return[[Math.min(t.left,e.left)-n,t.top],[Math.min(t.left,e.left)-n,e.bottom],[Math.max(t.right,e.right)+n,e.bottom],[Math.max(t.right,e.right)+n,t.top]];case"bottom":return[[Math.min(t.left,e.left)-n,t.bottom],[Math.min(t.left,e.left)-n,e.top],[Math.max(t.right,e.right)+n,e.top],[Math.max(t.right,e.right)+n,t.bottom]];case"left":return[[t.left,Math.min(t.top,e.top)-n],[e.right,Math.min(t.top,e.top)-n],[e.right,Math.max(t.bottom,e.bottom)+n],[t.left,Math.max(t.bottom,e.bottom)+n]];case"right":return[[t.right,Math.min(t.top,e.top)-n],[e.left,Math.min(t.top,e.top)-n],[e.left,Math.max(t.bottom,e.bottom)+n],[t.right,Math.max(t.bottom,e.bottom)+n]]}}#m(t,e,s,n){const r=this.#n*4,[h,i]=t;switch(n==="trigger"?this.#g(s):s){case"top":return[[h-r,i+r],[h+r,i+r],[e.right+r,e.bottom],[e.right+r,e.top],[e.left-r,e.top],[e.left-r,e.bottom]];case"bottom":return[[h-r,i-r],[h+r,i-r],[e.right+r,e.top],[e.right+r,e.bottom],[e.left-r,e.bottom],[e.left-r,e.top]];case"left":return[[h+r,i-r],[h+r,i+r],[e.right,e.bottom+r],[e.left,e.bottom+r],[e.left,e.top-r],[e.right,e.top-r]];case"right":return[[h-r,i-r],[h-r,i+r],[e.left,e.bottom+r],[e.right,e.bottom+r],[e.right,e.top-r],[e.left,e.top-r]]}}#g(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const Jt=ze({component:"popover",parts:["root","trigger","content","close","overlay"]}),Rt=new Me("Popover.Root");class te{static create(t){return Rt.set(new te(t))}opts;#t=F(null);get contentNode(){return o(this.#t)}set contentNode(t){d(this.#t,t,!0)}contentPresence;#n=F(null);get triggerNode(){return o(this.#n)}set triggerNode(t){d(this.#n,t,!0)}#s=F(null);get overlayNode(){return o(this.#s)}set overlayNode(t){d(this.#s,t,!0)}overlayPresence;#r=F(!1);get openedViaHover(){return o(this.#r)}set openedViaHover(t){d(this.#r,t,!0)}#e=F(!1);get hasInteractedWithContent(){return o(this.#e)}set hasInteractedWithContent(t){d(this.#e,t,!0)}#l=F(!1);get hoverCooldown(){return o(this.#l)}set hoverCooldown(t){d(this.#l,t,!0)}#h=F(0);get closeDelay(){return o(this.#h)}set closeDelay(t){d(this.#h,t,!0)}#o=null;#i=null;constructor(t){this.opts=t,this.contentPresence=new ie({ref:k(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new ie({ref:k(()=>this.overlayNode),open:this.opts.open}),Qt(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#a())})}setDomContext(t){this.#i=t}#a(){this.#o!==null&&this.#i&&(this.#i.clearTimeout(this.#o),this.#o=null)}toggleOpen(){this.#a(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#a(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#a(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#a(),this.closeDelay<=0?this.opts.open.current=!1:this.#i&&(this.#o=this.#i.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#o=null},this.closeDelay))))}cancelDelayedClose(){this.#a()}markInteraction(){this.hasInteractedWithContent=!0,this.#a()}}class ee{static create(t){return new ee(t,Rt.get())}opts;root;attachment;domContext;#t=null;#n=null;#s=F(!1);constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.triggerNode=s),this.domContext=new Ve(t.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Qt(()=>this.opts.closeDelay.current,s=>{this.root.closeDelay=s})}#r(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#e(){this.#n!==null&&(this.domContext.clearTimeout(this.#n),this.#n=null)}#l(){this.#r(),this.#e()}onpointerenter(t){if(this.opts.disabled.current||!this.opts.openOnHover.current||Lt(t)||(d(this.#s,!0),this.#e(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const e=this.opts.openDelay.current;e<=0?this.root.handleHoverOpen():this.#t=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#t=null},e)}onpointerleave(t){this.opts.disabled.current||this.opts.openOnHover.current&&(Lt(t)||(d(this.#s,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(t){if(!this.opts.disabled.current&&t.button===0){if(this.#l(),o(this.#s)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}o(this.#s)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(t){this.opts.disabled.current||(t.key===Ie||t.key===Oe)&&(t.preventDefault(),this.#l(),this.root.toggleOpen())}#h(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#o=O(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":ke(this.root.opts.open.current),"data-state":ce(this.root.opts.open.current),"aria-controls":this.#h(),[Jt.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#o)}set props(t){d(this.#o,t)}}class oe{static create(t){return new oe(t,Rt.get())}opts;root;attachment;constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.contentNode=s),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new je({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(t){this.root.markInteraction()}onfocusin(t){const e=t.target;bt(e)&&De(e)&&this.root.markInteraction()}onpointerenter(t){Lt(t)||this.root.cancelDelayedClose()}onpointerleave(t){Lt(t)}onInteractOutside=t=>{if(this.opts.onInteractOutside.current(t),t.defaultPrevented||!bt(t.target))return;const e=t.target.closest(Jt.selector("trigger"));if(!(e&&e===this.root.triggerNode)){if(this.opts.customAnchor.current){if(bt(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(t.target))return}else if(typeof this.opts.customAnchor.current=="string"){const s=document.querySelector(this.opts.customAnchor.current);if(s&&s.contains(t.target))return}}this.root.handleClose()}};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#t=O(()=>({open:this.root.opts.open.current}));get snippetProps(){return o(this.#t)}set snippetProps(t){d(this.#t,t)}#n=O(()=>({id:this.opts.id.current,tabindex:-1,"data-state":ce(this.root.opts.open.current),[Jt.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#n)}set props(t){d(this.#n,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var Ge=D("<div><div><!></div></div>"),Je=D("<div><div><!></div></div>");function Ue(m,t){const e=he();_t(t,!0);let s=v(t,"ref",15,null),n=v(t,"id",19,()=>pe(e)),r=v(t,"forceMount",3,!1),h=v(t,"onOpenAutoFocus",3,xt),i=v(t,"onCloseAutoFocus",3,xt),f=v(t,"onEscapeKeydown",3,xt),x=v(t,"onInteractOutside",3,xt),_=v(t,"trapFocus",3,!0),c=v(t,"preventScroll",3,!1),a=v(t,"customAnchor",3,null),p=ue(t,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const T=oe.create({id:k(()=>n()),ref:k(()=>s(),V=>s(V)),onInteractOutside:k(()=>x()),onEscapeKeydown:k(()=>f()),customAnchor:k(()=>a())}),E=O(()=>$t(p,T.props)),Ct=O(()=>_()&&T.shouldTrapFocus);function wt(V){T.shouldTrapFocus||V.preventDefault(),h()(V)}var W=j(),G=H(W);{var K=V=>{Fe(V,ne(()=>o(E),()=>T.popperProps,{get ref(){return T.opts.ref},get enabled(){return T.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return c()},loop:!0,forceMount:!0,get customAnchor(){return a()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return T.shouldRender},popper:(pt,rt)=>{let ft=()=>rt?.().props,st=()=>rt?.().wrapperProps;const it=O(()=>$t(ft(),{style:ae("popover")},{style:t.style}));var at=j(),Ot=H(at);{var kt=M=>{var A=j(),S=H(A);{let Z=O(()=>({props:o(it),wrapperProps:st(),...T.snippetProps}));dt(S,()=>t.child,()=>o(Z))}u(M,A)},Pt=M=>{var A=Ge();ct(A,()=>({...st()}));var S=y(A);ct(S,()=>({...o(it)}));var Z=y(S);dt(Z,()=>t.children??Kt),C(S),C(A),u(M,A)};N(Ot,M=>{t.child?M(kt):M(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))},nt=V=>{Ee(V,ne(()=>o(E),()=>T.popperProps,{get ref(){return T.opts.ref},get open(){return T.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return c()},loop:!0,forceMount:!1,get customAnchor(){return a()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return T.shouldRender},popper:(pt,rt)=>{let ft=()=>rt?.().props,st=()=>rt?.().wrapperProps;const it=O(()=>$t(ft(),{style:ae("popover")},{style:t.style}));var at=j(),Ot=H(at);{var kt=M=>{var A=j(),S=H(A);{let Z=O(()=>({props:o(it),wrapperProps:st(),...T.snippetProps}));dt(S,()=>t.child,()=>o(Z))}u(M,A)},Pt=M=>{var A=Je();ct(A,()=>({...st()}));var S=y(A);ct(S,()=>({...o(it)}));var Z=y(S);dt(Z,()=>t.children??Kt),C(S),C(A),u(M,A)};N(Ot,M=>{t.child?M(kt):M(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))};N(G,V=>{r()?V(K):r()||V(nt,1)})}u(m,W),yt()}var Ze=D("<button><!></button>");function Qe(m,t){const e=he();_t(t,!0);let s=v(t,"id",19,()=>pe(e)),n=v(t,"ref",15,null),r=v(t,"type",3,"button"),h=v(t,"disabled",3,!1),i=v(t,"openOnHover",3,!1),f=v(t,"openDelay",3,700),x=v(t,"closeDelay",3,300),_=ue(t,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const c=ee.create({id:k(()=>s()),ref:k(()=>n(),p=>n(p)),disabled:k(()=>!!h()),openOnHover:k(()=>i()),openDelay:k(()=>f()),closeDelay:k(()=>x())}),a=O(()=>$t(_,c.props,{type:r()}));Se(m,{get id(){return s()},get ref(){return c.opts.ref},children:(p,T)=>{var E=j(),Ct=H(E);{var wt=G=>{var K=j(),nt=H(K);dt(nt,()=>t.child,()=>({props:o(a)})),u(G,K)},W=G=>{var K=Ze();ct(K,()=>({...o(a)}));var nt=y(K);dt(nt,()=>t.children??Kt),C(K),u(G,K)};N(Ct,G=>{t.child?G(wt):G(W,!1)})}u(p,E)},$$slots:{default:!0}}),yt()}function Re(m,t){_t(t,!0);let e=v(t,"open",15,!1),s=v(t,"onOpenChange",3,xt),n=v(t,"onOpenChangeComplete",3,xt);te.create({open:k(()=>e(),r=>{e(r),s()(r)}),onOpenChangeComplete:k(()=>n())}),Ne(m,{children:(r,h)=>{var i=j(),f=H(i);dt(f,()=>t.children??Kt),u(r,i)},$$slots:{default:!0}}),yt()}var to=Vt("<title> </title>"),eo=Vt('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function oo(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=eo();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=to(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(3),C(f),u(m,f),yt()}var no=Vt("<title> </title>"),ro=Vt('<svg><!><path d="M10 6H28V8H10z"></path><path d="M10 24H28V26H10z"></path><path d="M10 15H28V17H10z"></path><path d="M4 15H6V17H4z"></path><path d="M4 6H6V8H4z"></path><path d="M4 24H6V26H4z"></path></svg>');function so(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=ro();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=no(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(6),C(f),u(m,f),yt()}var io=Vt("<title> </title>"),ao=Vt('<svg><!><path d="M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"></path></svg>');function lo(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=ao();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=io(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(),C(f),u(m,f),yt()}const ho=Re,uo=Qe,co=Ue;var po=D('<div class="tab active svelte-r6dy5f"><input class="tab-rename-input svelte-r6dy5f"/></div>'),fo=D('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),vo=D('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),mo=D('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),go=D('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),bo=D("<!> <span>New View</span>",1),_o=D('<button class="add-view-option svelte-r6dy5f"><!> List</button> <button class="add-view-option svelte-r6dy5f"><!> Calendar</button>',1),yo=D("<!> <!>",1),Co=D("<!> <!>",1),wo=D("<!> <!>",1),Po=D("<!> <!>",1),xo=D('<div class="tab-bar svelte-r6dy5f"><div class="tabs-scroll svelte-r6dy5f"><button><span class="tab-label svelte-r6dy5f">Home</span></button> <button><span class="tab-label svelte-r6dy5f">Graph</span></button> <!> <!> <!></div> <div class="bar-right svelte-r6dy5f"><!> <!></div></div> <!>',1);function $o(m,t){_t(t,!0);let e=v(t,"activeView",3,"entity");const s=ge("chat");function n(l){re(l,{noScroll:!0})}const r=O(()=>et.selectedId!==null),h=O(()=>{if(!et.selectedRepo||!et.selectedId)return"";for(const l of He.repos){if(l.name!==et.selectedRepo)continue;const g=l.entities.find(w=>w.id===et.selectedId);if(g)return g.title}return et.selectedId.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase())});function i(){et.deselect(),n("/")}let f=F(!1);async function x(l){d(f,!1);const g=l==="calendar"?"Calendar":"List",w=await Bt.create(g,l);re(`/views/${w.id}`)}let _=F(null),c=F(""),a=F(null),p=F(!1);function T(l){d(p,!1),d(_,l.id,!0),d(c,l.name,!0)}be(()=>{o(_)&&o(a)&&(o(a).focus(),o(a).select(),setTimeout(()=>{d(p,!0)},50))});function E(){o(p)&&(o(_)&&o(c).trim()&&Bt.update(o(_),{name:o(c).trim()}),d(_,null),d(p,!1))}function Ct(){d(_,null),d(p,!1)}function wt(l){l.key==="Enter"&&(l.preventDefault(),d(p,!0),E()),l.key==="Escape"&&(l.preventDefault(),Ct())}let W=F(null);function G(l,g){l.stopPropagation(),d(W,g,!0)}async function K(){o(W)&&(await Bt.remove(o(W).id),d(W,null))}var nt=xo(),V=H(nt),It=y(V),pt=y(It);let rt;var ft=z(pt,2);let st;var it=z(ft,2);we(it,17,()=>Bt.views,l=>l.id,(l,g)=>{var w=j(),Q=H(w);{var R=B=>{var I=po(),b=y(I);_e(b),Ce(b,P=>d(a,P),()=>o(a)),C(I),ut(P=>ye(b,"size",P),[()=>Math.max(o(c).length,1)]),X("keydown",b,wt),X("input",b,P=>{d(c,P.currentTarget.value,!0)}),me("blur",b,E),Pe(b,()=>o(c),P=>d(c,P)),u(B,I)},tt=B=>{const I=O(()=>e()==="view"&&et.activeViewId===o(g).id);var b=vo();let P;var lt=y(b),$=y(lt,!0);C(lt);var L=z(lt,2);{var Dt=Y=>{var J=fo(),zt=y(J);se(zt,{size:12}),C(J),X("click",J,Yt=>G(Yt,o(g))),u(Y,J)};N(L,Y=>{o(I)&&Y(Dt)})}C(b),ut(()=>{P=Wt(b,1,"tab svelte-r6dy5f",null,P,{"tab-permanent":!o(I),active:o(I)}),Tt($,o(g).name)}),X("click",b,()=>n(`/views/${o(g).id}`)),X("dblclick",b,()=>T(o(g))),u(B,b)};N(Q,B=>{o(_)===o(g).id?B(R):B(tt,!1)})}u(l,w)});var at=z(it,2);{var Ot=l=>{const g=O(()=>e()==="entity"&&o(r));var w=go();let Q;var R=y(w),tt=y(R,!0);C(R);var B=z(R,2);{var I=b=>{var P=mo(),lt=y(P);se(lt,{size:12}),C(P),X("click",P,$=>{$.stopPropagation(),i()}),u(b,P)};N(B,b=>{o(g)&&b(I)})}C(w),ut(()=>{Q=Wt(w,1,"tab svelte-r6dy5f",null,Q,{"tab-permanent":!o(g),active:o(g)}),Tt(tt,o(h))}),X("click",w,()=>n(et.entityPath??"/")),u(l,w)};N(at,l=>{o(r)&&l(Ot)})}var kt=z(at,2);q(kt,()=>ho,(l,g)=>{g(l,{get open(){return o(f)},set open(w){d(f,w,!0)},children:(w,Q)=>{var R=yo(),tt=H(R);q(tt,()=>uo,(I,b)=>{b(I,{class:"new-view-btn",title:"New view",children:(P,lt)=>{var $=bo(),L=H($);Te(L,{size:16}),U(2),u(P,$)},$$slots:{default:!0}})});var B=z(tt,2);q(B,()=>co,(I,b)=>{b(I,{class:"add-view-menu",sideOffset:4,align:"start",children:(P,lt)=>{var $=_o(),L=H($),Dt=y(L);so(Dt,{size:14}),U(),C(L);var Y=z(L,2),J=y(Y);lo(J,{size:14}),U(),C(Y),X("click",L,()=>x("list")),X("click",Y,()=>x("calendar")),u(P,$)},$$slots:{default:!0}})}),u(w,R)},$$slots:{default:!0}})}),C(It);var Pt=z(It,2),M=y(Pt);{var A=l=>{var g=j(),w=H(g);dt(w,()=>t.right),u(l,g)};N(M,l=>{t.right&&l(A)})}var S=z(M,2);{var Z=l=>{xe(l,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return s.toggle},children:(g,w)=>{oo(g,{size:14})},$$slots:{default:!0}})};N(S,l=>{s.open||l(Z)})}C(Pt),C(V);var fe=z(V,2);{let l=O(()=>!!o(W));q(fe,()=>qe,(g,w)=>{w(g,{get open(){return o(l)},onOpenChange:Q=>{Q||d(W,null)},children:(Q,R)=>{var tt=j(),B=H(tt);q(B,()=>We,(I,b)=>{b(I,{children:(P,lt)=>{var $=Po(),L=H($);q(L,()=>Be,(Y,J)=>{J(Y,{children:(zt,Yt)=>{var Ft=Co(),Et=H(Ft);q(Et,()=>$e,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt("Delete view?");u(gt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);q(Xt,()=>Ke,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt();ut(()=>Tt(ht,`The view "${o(W)?.name??""}" will be permanently deleted.`)),u(gt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})});var Dt=z(L,2);q(Dt,()=>Le,(Y,J)=>{J(Y,{children:(zt,Yt)=>{var Ft=wo(),Et=H(Ft);q(Et,()=>Ye,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt("Cancel");u(gt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);q(Xt,()=>Xe,(vt,mt)=>{mt(vt,{onclick:K,children:(gt,qt)=>{U();var ht=Nt("Delete");u(gt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})}),u(P,$)},$$slots:{default:!0}})}),u(Q,tt)},$$slots:{default:!0}})})}ut(()=>{rt=Wt(pt,1,"tab tab-permanent svelte-r6dy5f",null,rt,{active:e()==="home"}),st=Wt(ft,1,"tab tab-permanent svelte-r6dy5f",null,st,{active:e()==="graph"})}),X("click",pt,()=>n("/")),X("click",ft,()=>e()!=="graph"&&n("/graph")),u(m,nt),yt()}ve(["click","keydown","input","dblclick"]);export{co as C,ho as R,uo as T,$o as V,lo as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as m,f as w,s as u,g as o,u as at}from"./CT6oIU-C.js";import{a as d}from"./DGbA7IXh.js";function st(){return d("/api/workspace")}function ct(e){return d("/api/workspace",{method:"PUT",body:JSON.stringify(e)})}function Tt(){return d("/api/workspace/mcp-config")}function J(){return d("/api/repos")}function lt(e,i,s,f){return d("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,display_name:i||void 0,description:s,...f?{private:!0}:{}})})}function ut(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,display_name:s||void 0})})}function dt(e){return d(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}function pt(){return d("/api/apps")}function ft(e){return d(`/api/repos/${encodeURIComponent(e)}/entities?summary=true`)}function bt(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`)}function It(e,i,s,f,c){return d(`/api/repos/${encodeURIComponent(e)}/entities`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,data:f,content:c})})}function $t(e,i,s){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`,{method:"DELETE"})}function kt(e,i,s,f){return d(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(i)}/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify(f)})}function vt(e,i,s,f){return d(`/api/repos/${encodeURIComponent(e)}/change-type`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,newType:f})})}function At(e,i,s,f,c){return d(`/api/repos/${encodeURIComponent(e)}/transfer`,{method:"POST",body:JSON.stringify({entityType:i,entityId:s,targetRepo:f,mode:c})})}function Pt(){return d("/api/insights")}function Ut(){return d("/api/insights/generate",{method:"POST"})}function Rt(){return d("/api/preferences")}function Lt(e){return d("/api/preferences",{method:"PUT",body:JSON.stringify(e)})}function Ot(){return d("/api/views")}function _t(e,i,s){return d("/api/views",{method:"POST",body:JSON.stringify({name:e,viewType:s??"list",config:i})})}function Mt(e,i){return d(`/api/views/${e}`,{method:"PUT",body:JSON.stringify(i)})}function Ft(e){return d(`/api/views/${e}`,{method:"DELETE"})}function xt(e){return d(`/api/repos/${encodeURIComponent(e)}/commit`,{method:"POST"})}const mt=new Set(["meeting","decision","note","deal","proposal","brief"]);function yt(e){return e.replace(/-/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function M(e,i){return i||e.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}const gt="#e05050";function A(e){if(typeof document>"u")return;const i=e||gt,s=parseInt(i.slice(1,3),16),f=parseInt(i.slice(3,5),16),c=parseInt(i.slice(5,7),16),E=[document.documentElement,document.querySelector("[data-theme]")].filter(Boolean);for(const h of E)h.style.setProperty("--color-accent",i),h.style.setProperty("--color-accent-hover",ht(i,15)),h.style.setProperty("--color-accent-muted",`rgba(${s}, ${f}, ${c}, 0.08)`),h.style.setProperty("--color-link",j(i,15)),h.style.setProperty("--color-badge-bg",`rgba(${s}, ${f}, ${c}, 0.1)`),h.style.setProperty("--color-badge-text",j(i,20))}function ht(e,i){const s=Math.max(0,Math.round(parseInt(e.slice(1,3),16)*(1-i/100))),f=Math.max(0,Math.round(parseInt(e.slice(3,5),16)*(1-i/100))),c=Math.max(0,Math.round(parseInt(e.slice(5,7),16)*(1-i/100)));return`#${s.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function j(e,i){const s=Math.min(255,Math.round(parseInt(e.slice(1,3),16)+(255-parseInt(e.slice(1,3),16))*i/100)),f=Math.min(255,Math.round(parseInt(e.slice(3,5),16)+(255-parseInt(e.slice(3,5),16))*i/100)),c=Math.min(255,Math.round(parseInt(e.slice(5,7),16)+(255-parseInt(e.slice(5,7),16))*i/100));return`#${s.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function Ct(){let e=m(""),i=m(null),s=m(null),f=m(!1),c=m(w([]));const E={};let h=m(w([])),P=m(!1),U=m(null),g=m(w({})),R=w({}),L=w({}),$=w({}),F=m(0),x=m(null),C=m(""),k=null,S=m(0),T=m(0),D=m("alpha");async function W(){u(P,!0),u(U,null),u(S,0),u(T,0);try{const[t,n,r]=await Promise.all([J(),pt().catch(()=>[]),st().catch(()=>({name:""}))]);u(h,n,!0),u(e,r.name,!0),u(i,r.about??null,!0),u(s,r.accent_color??null,!0),u(f,!0),A(o(s)),u(c,t.map(a=>({name:a.name,displayName:M(a.name,a.display_name),type:a.type,private:a.private,sync:a.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(o(c).map(a=>b(a.name)))}catch(t){u(U,t.message,!0)}finally{u(P,!1)}}function V(t,n,r){const a=o(c).find(l=>l.name===t);a&&(a.entities=a.entities.filter(l=>!(l.id===r&&l.entityType===n)),a.count=a.entities.length)}async function Q(t){o(c).find(r=>r.name===t)&&await b(t,!0)}async function B(){u(S,0),u(T,0),await Promise.all(o(c).map(t=>b(t.name,!0)))}async function b(t,n=!1){const r=o(c).find(l=>l.name===t);if(!r||r.loading||!n&&r.loaded)return;const a=(E[t]??0)+1;E[t]=a,n||(r.loading=!0);try{const l=await ft(t);if(E[t]!==a)return;let y=0,O=0;for(const p of l)y+=p.document?.wikilinks?.length??0,O+=p.subContentCount??0;u(S,o(S)+y),u(T,o(T)+O);const _=new Set(["name","created_at","updated_at"]);r.entities=l.filter(p=>!p.id.toLowerCase().startsWith("readme")).map(p=>({id:p.id,title:p.data?.name??yt(p.id),entityType:p.entityType,repo:t,hasSubContent:!!p.hasSubContent,wikilinks:p.document?.wikilinks??[],createdAt:p.data?.created_at??null,updatedAt:p.data?.updated_at??null,fields:Object.fromEntries(Object.entries(p.data??{}).filter(([I])=>!_.has(I))),status:p.data?.status??void 0,priority:p.data?.priority??void 0,assignee:p.data?.assignee??void 0,dueDate:p.data?.due_date??void 0})).sort((p,I)=>{if(mt.has(p.entityType)){const it=p.fields.date??p.createdAt??"";return(I.fields.date??I.createdAt??"").localeCompare(it)}return p.title.localeCompare(I.title)}),r.count=r.entities.length,r.loaded=!0}catch(l){console.error(`Failed to load entities for ${t}:`,l)}finally{r.loading=!1}}function K(t){o(g)[t]=!o(g)[t]}function Y(t){return o(g)[t]??!1}function v(t,n,r){return`${t}/${n}/${r}`}function q(t,n,r){const a=v(t,n,r),l=R[a]??!1;R[a]=!l,!l&&!L[a]?.loaded&&z(t,n,r)}function H(t,n,r){return R[v(t,n,r)]??!1}function N(t,n,r){return L[v(t,n,r)]??{entries:[],loading:!1,loaded:!1}}async function z(t,n,r){const a=v(t,n,r);L[a]={entries:[],loading:!1,loaded:!0}}function G(t){const n=o(C).trim().toLowerCase();if(!n)return t;const r=[];for(const a of t){const l=a.entities.filter(y=>y.title.toLowerCase().includes(n)||y.id.toLowerCase().includes(n));l.length>0&&r.push({...a,entities:l,count:l.length})}return r}function X(t){if(t&&!o(C)?k={...o(g)}:!t&&o(C)&&k&&(u(g,k,!0),k=null),u(C,t,!0),t){const n=t.trim().toLowerCase();for(const r of o(c)){const a=r.entities.some(l=>l.title.toLowerCase().includes(n)||l.id.toLowerCase().includes(n));o(g)[r.name]=a}}}function Z(t){const n=t.startsWith("type:");$[t]=!($[t]??n)}function tt(t){return $[t]??!1}function et(t){return $[t]===!1}const nt=at(()=>o(c).reduce((t,n)=>t+(n.count??0),0));function ot(t){return o(h).find(n=>n.entityTypes.includes(t))}function rt(t){A(t||o(s))}return{get name(){return o(e)},get about(){return o(i)},get accentColor(){return o(s)},get nameLoaded(){return o(f)},async updateWorkspace(t){t.accent_color!==void 0&&(u(s,t.accent_color,!0),A(t.accent_color)),await ct(t),t.name?.trim()&&u(e,t.name.trim(),!0),typeof t.about=="string"&&u(i,t.about,!0)},get repos(){return o(c)},get apps(){return o(h)},get loading(){return o(P)},get error(){return o(U)},get totalEntities(){return o(nt)},get totalLinks(){return o(S)},get totalFiles(){return o(T)},get hasTasks(){return o(c).some(t=>t.entities.some(n=>n.entityType==="task"))},get sortedRepos(){const t=[...o(c)].sort((n,r)=>n.name.localeCompare(r.name));return G(t)},get filteredIds(){const t=o(C).trim().toLowerCase();if(!t)return null;const n=new Set;for(const r of o(c))for(const a of r.entities)(a.title.toLowerCase().includes(t)||a.id.toLowerCase().includes(t))&&n.add(a.id);return n},get filterQuery(){return o(C)},setFilterQuery:X,get sortMode(){return o(D)},set sortMode(t){u(D,t,!0)},get recentEntities(){const t=o(C).trim().toLowerCase();let n=[];for(const r of o(c))for(const a of r.entities)t&&!a.title.toLowerCase().includes(t)&&!a.id.toLowerCase().includes(t)||n.push(a);return n.sort((r,a)=>{const l=r.updatedAt??"";return(a.updatedAt??"").localeCompare(l)})},get sidebarScrollTop(){return o(F)},set sidebarScrollTop(t){u(F,t,!0)},get lastAutoExpandedFor(){return o(x)},set lastAutoExpandedFor(t){u(x,t,!0)},load:W,loadEntities:b,removeEntity:V,refreshEntities:Q,refreshAll:B,toggleRepo:K,isExpanded:Y,toggleEntity:q,isEntityExpanded:H,getEntityContents:N,toggleFolder:Z,isFolderExpanded:tt,isFolderCollapsed:et,applyUserAccentColor:rt,applyAccentColor:A,getAppForEntityType:ot,async renameCollectionTo(t,n,r){await ut(t,n,r);const a=o(c).find(l=>l.name===t);a&&(a.name=n,a.displayName=r||M(n),o(g)[t]&&(o(g)[n]=!0,delete o(g)[t]))},async removeCollection(t){await dt(t),u(c,o(c).filter(n=>n.name!==t),!0),delete o(g)[t]},async addCollection(t,n,r,a){await lt(t,n,r,a);const l=await J();u(c,l.map(y=>o(c).find(_=>_.name===y.name)??{name:y.name,displayName:M(y.name,y.display_name),type:y.type,private:y.private,count:null,entities:[],loading:!1,loaded:!1}),!0),o(g)[t]=!0,await b(t)}}}const Dt=Ct();export{mt as D,xt as a,Pt as b,_t as c,Ft as d,Rt as e,Ot as f,Ut as g,bt as h,kt as i,Tt as j,vt as k,$t as l,It as m,Lt as s,At as t,Mt as u,Dt as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as t,s as e,e as u}from"./CT6oIU-C.js";import{a as p}from"./
|
|
1
|
+
import{g as t,s as e,e as u}from"./CT6oIU-C.js";import{a as p}from"./CALGIiWi.js";function E(){let l=u(null),i=u(null),r=u(null),o=u(null),s=u("entity"),f=u(null),g=u(null),d=u("preferences"),h=u(!1);function v(n,c){t(l)&&(t(l)!==n||t(r)!==c)&&p(t(l)).catch(()=>{})}function w(n,c,a,V){v(n,a),e(l,n,!0),e(i,c,!0),e(r,a,!0),e(o,V??null,!0)}function y(){e(s,"entity")}function b(){e(s,"graph")}function I(n){e(s,"view"),e(f,n,!0)}function S(){e(s,"settings"),e(d,"preferences")}function m(n,c,a){t(r)===a&&t(l)===n?(e(l,null),e(i,null),e(r,null)):(e(l,n,!0),e(i,c,!0),e(r,a,!0)),e(o,null)}function T(){t(l)&&p(t(l)).catch(()=>{}),e(l,null),e(i,null),e(r,null),e(o,null)}return{get selectedRepo(){return t(l)},get selectedType(){return t(i)},get selectedId(){return t(r)},get selectedSubPath(){return t(o)},get activeView(){return t(s)},get entityPath(){return t(l)&&t(i)&&t(r)?`/${t(l)}/${t(i)}/${t(r)}`:null},get hoveredEntityId(){return t(g)},set hoveredEntityId(n){e(g,n,!0)},get settingsTab(){return t(d)},set settingsTab(n){e(d,n,!0)},get hideSidebar(){return t(h)},set hideSidebar(n){e(h,n,!0)},select:w,deselect:T,selectOnGraph:m,showEntity:y,showGraph:b,get activeViewId(){return t(f)},showView:I,showSettings:S}}const $=E();export{$ as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as r,f as A,g as n,s as e}from"./CT6oIU-C.js";import{s as f,g as _,b as I,e as v}from"./
|
|
1
|
+
import{e as r,f as A,g as n,s as e}from"./CT6oIU-C.js";import{s as f,g as _,b as I,e as v}from"./CALGIiWi.js";function B(){let a=r(A([])),s=r(null),l=r(!1),o=r(!1),i=r(""),u=r(null),c=r(!1),g=r(null);async function d(){try{const[t,h]=await Promise.all([I(),v()]);e(a,t.insights??[],!0),e(s,t.generatedAt??null,!0),e(i,h.home_brief??"",!0),e(u,h.accent_color??null,!0),e(o,!0),e(c,!0)}catch(t){console.error("Failed to load insights:",t),e(o,!0),e(c,!0)}}async function m(){e(l,!0),e(g,null);try{const t=await _();e(a,t.insights??[],!0),e(s,t.generatedAt??null,!0),e(o,!0)}catch(t){console.error("Failed to generate insights:",t),e(g,t?.message??"Failed to generate insights",!0)}finally{e(l,!1)}}async function y(t){e(i,t,!0),await f({home_brief:t})}async function b(t){e(u,t,!0),await f({accent_color:t})}function p(){e(a,[],!0),e(s,null)}async function w(){await f({home_brief:""}),e(i,""),e(a,[],!0),e(s,null)}return{get insights(){return n(a)},get generatedAt(){return n(s)},get loading(){return n(l)},get loaded(){return n(o)},get homeBrief(){return n(i)},get accentColor(){return n(u)},get briefLoaded(){return n(c)},get error(){return n(g)},load:d,generate:m,clearInsights:p,saveBrief:y,saveAccentColor:b,reset:w}}const P=B();export{P as insightsStore};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as h,f as U,s as a,g as t,av as x}from"./CT6oIU-C.js";import{i as L,g as V}from"./
|
|
1
|
+
import{e as h,f as U,s as a,g as t,av as x}from"./CT6oIU-C.js";import{i as L,g as V}from"./boqTA85z.js";import{n as y}from"./CygV1PFY.js";import{w as W}from"./CALGIiWi.js";function X(g,c,o){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:o}).then(async n=>{if(!n.ok){c({type:"error",message:`HTTP ${n.status}`});return}const r=n.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const p=new TextDecoder;let m="";for(;;){const{done:k,value:O}=await r.read();if(k)break;m+=p.decode(O,{stream:!0});const A=m.split(`
|
|
2
2
|
`);m=A.pop()??"";for(const C of A)if(C.startsWith("data: "))try{const f=JSON.parse(C.slice(6));c(f)}catch{}}}).catch(n=>{n.name!=="AbortError"&&c({type:"error",message:n.message})})}const D="sg-chat-sessions",J="sg-chat-version",z=14;function b(){try{const g=localStorage.getItem(D);if(!g)return[];if(localStorage.getItem(J)==="2")return JSON.parse(g);const n=JSON.parse(g).map(r=>({id:crypto.randomUUID(),createdAt:r.date+"T00:00:00.000Z",updatedAt:r.date+"T00:00:00.000Z",title:r.messages.find(p=>p.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(D,JSON.stringify(n)),localStorage.setItem(J,"2"),n}catch{return[]}}function _(g){const o=[...g].sort((n,r)=>r.updatedAt.localeCompare(n.updatedAt)).slice(0,z);try{localStorage.setItem(D,JSON.stringify(o)),localStorage.setItem(J,"2")}catch{}}function N(g,c){const o=b(),n=c.map(({streaming:p,...m})=>m),r=o.findIndex(p=>p.id===g);r>=0&&(o[r].messages=n,o[r].updatedAt=new Date().toISOString()),_(o)}function B(){const c=b().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt))[0];let o=h(U(c?c.messages.map(e=>({...e,streaming:!1})):[])),n=h(U(c?.id??null)),r=h(!1),p=h(0),m=h(0),k=h(0),O=h(null),A=null,C=h(""),f=h(U(!!c));const R=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function M(){$();const e=crypto.randomUUID();a(n,e,!0),a(o,[],!0),a(f,!1)}function E(){if(t(n)&&t(f))return t(n);const e=t(n)||crypto.randomUUID();a(n,e,!0);const i=new Date().toISOString(),d=b();return d.push({id:e,createdAt:i,updatedAt:i,title:"New chat",messages:[]}),_(d),a(f,!0),e}function K(e){if(!e.trim()||t(r))return;a(O,null);const i=E();t(o).push({role:"user",content:e}),t(o).push({role:"agent",content:"",segments:[],streaming:!0}),a(r,!0);const d=b(),l=d.find(s=>s.id===i);l&&l.title==="New chat"&&(l.title=e.slice(0,50),_(d)),N(i,t(o));let T=!1,w=null;A=new AbortController;const G=y.selectedSubPath?`${y.selectedRepo}/${y.selectedType}/${y.selectedId}/${y.selectedSubPath}`:y.selectedId?`${y.selectedRepo}/${y.selectedType}/${y.selectedId}`:null,P=t(o).slice(0,-2).map(s=>({role:s.role==="agent"?"assistant":s.role,content:s.content})),H={message:e,context:G??void 0,sessionId:i,history:P.length>0?P:void 0};X(H,s=>{if(!t(r))return;const u=t(o)[t(o).length-1];if(!u||u.role!=="agent")return;const S=u.segments;switch(s.type){case"token":{u.content+=s.text??"";const I=S[S.length-1];I&&I.type==="text"?I.content+=s.text??"":S.push({type:"text",content:s.text??""}),u.segments=S,x(m);break}case"tool_start":if(s.name){R.has(s.name)&&(T=!0);const I=S[S.length-1];I&&I.type==="tools"?I.names=[...I.names,s.name]:S.push({type:"tools",names:[s.name]}),u.segments=S,x(m)}break;case"mutation":T=!0,s.action==="created"&&s.repo&&s.entityType&&s.entityId&&(w={repo:s.repo,entityType:s.entityType,entityId:s.entityId}),window.StudioChrome?.emitMutation?.({action:s.action,repo:s.repo,entityType:s.entityType,entityId:s.entityId});break;case"highlight":a(O,s.entityIds&&s.entityIds.length>0?new Set(s.entityIds):null,!0);break;case"done":s.message&&!u.content&&(u.content=s.message,u.segments=[{type:"text",content:s.message}]),u.streaming=!1,a(r,!1),N(i,t(o)),T&&(L().then(()=>{x(p)}),W.refreshAll().then(()=>{w&&V(`/${w.repo}/${w.entityType}/${w.entityId}`)}));break;case"error":u.content+=`
|
|
3
3
|
|
|
4
4
|
Error: ${s.message}`,u.streaming=!1,a(r,!1),N(i,t(o));break}},A.signal)}function $(){if(!t(r))return;fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{}),A?.abort(),A=null,a(r,!1);const e=t(o)[t(o).length-1];e?.streaming&&(e.streaming=!1,t(n)&&N(t(n),t(o)))}function Y(){$(),a(o,[],!0),t(n)&&t(f)&&N(t(n),t(o))}function Z(e){const d=b().filter(l=>l.id!==e);if(_(d),t(n)===e){const l=d.sort((T,w)=>w.updatedAt.localeCompare(T.updatedAt));l.length>0?(a(n,l[0].id,!0),a(o,l[0].messages.map(T=>({...T,streaming:!1})),!0),a(f,!0)):(a(n,null),a(o,[],!0),a(f,!1))}}function j(e){const d=b().find(l=>l.id===e);d&&($(),a(n,d.id,!0),a(o,d.messages.map(l=>({...l,streaming:!1})),!0),a(f,!0))}function q(){return b().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt)).map(e=>({id:e.id,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt,preview:e.messages.find(i=>i.role==="user")?.content.slice(0,80)||"",count:e.messages.length,active:e.id===t(n)}))}return{get messages(){return t(o)},get streaming(){return t(r)},get mutationCount(){return t(p)},get scrollTick(){return t(m)},get forceScroll(){return t(k)},triggerScroll(){x(k)},get highlightedIds(){return t(O)},get activeSessionId(){return t(n)},get draftInput(){return t(C)},set draftInput(e){a(C,e,!0)},send:K,stop:$,clear:Y,newSession:M,deleteSession:Z,getSessions:q,loadSession:j}}const te=B();export{te as chatStore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./
|
|
1
|
+
import{s as e}from"./boqTA85z.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
|