studiograph 1.3.3-next.21 → 1.3.3-next.22
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/server/chrome/chrome.js +23 -252
- package/dist/server/collab.d.ts +27 -0
- package/dist/server/collab.js +117 -0
- package/dist/server/collab.js.map +1 -0
- package/dist/server/index.js +11 -6
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/collab.d.ts +6 -0
- package/dist/server/routes/collab.js +10 -0
- package/dist/server/routes/collab.js.map +1 -0
- package/dist/server/routes/graph-api.d.ts +2 -2
- package/dist/server/routes/graph-api.js +25 -6
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/server/routes/sync-api.d.ts +2 -1
- package/dist/server/routes/sync-api.js +13 -1
- package/dist/server/routes/sync-api.js.map +1 -1
- package/dist/server/routes/ws.js +38 -0
- package/dist/server/routes/ws.js.map +1 -1
- package/dist/server/session-manager.d.ts +40 -0
- package/dist/server/session-manager.js +130 -0
- package/dist/server/session-manager.js.map +1 -0
- package/dist/server/ws-hub.d.ts +60 -1
- package/dist/server/ws-hub.js +113 -2
- package/dist/server/ws-hub.js.map +1 -1
- package/dist/web/_app/immutable/assets/AppShell.EyPUoNrB.css +1 -0
- package/dist/web/_app/immutable/assets/{editor.CaaAjbLg.css → entity.Bjlko8oW.css} +1 -1
- package/dist/web/_app/immutable/chunks/{DRChbfXz.js → 38MyG-mV.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DFSquWcI.js → BV_9Nfp2.js} +1 -1
- package/dist/web/_app/immutable/chunks/Bk7i2AGK.js +5 -0
- package/dist/web/_app/immutable/chunks/ByFfmBEu.js +2 -0
- package/dist/web/_app/immutable/chunks/Bz2vmWce.js +2 -0
- package/dist/web/_app/immutable/chunks/C6jTKM_R.js +1 -0
- package/dist/web/_app/immutable/chunks/CaITTL5o.js +2 -0
- package/dist/web/_app/immutable/chunks/Cc7CYb94.js +1 -0
- package/dist/web/_app/immutable/chunks/{BDskUnFZ.js → CiTQ_W2r.js} +10 -10
- package/dist/web/_app/immutable/chunks/{BfTJ6NzK.js → CjKjQEMp.js} +1 -1
- package/dist/web/_app/immutable/chunks/{GRkK54yd.js → D-tW7Byc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Ddy4RvyP.js → DCWeodCf.js} +1 -1
- package/dist/web/_app/immutable/chunks/DWSjaG46.js +1 -0
- package/dist/web/_app/immutable/chunks/DkM5hMeY.js +1 -0
- package/dist/web/_app/immutable/chunks/{BbLYZVsw.js → Dpn7ZAUg.js} +1 -1
- package/dist/web/_app/immutable/chunks/EhE2EcYu.js +1 -0
- package/dist/web/_app/immutable/chunks/JFkcr2-N.js +1 -0
- package/dist/web/_app/immutable/chunks/Mxe2MMs2.js +27 -0
- package/dist/web/_app/immutable/chunks/{BjnErSlK.js → eEhMI0BQ.js} +1 -1
- package/dist/web/_app/immutable/entry/app.DLneBeWX.js +2 -0
- package/dist/web/_app/immutable/entry/start.BYwqba4F.js +1 -0
- package/dist/web/_app/immutable/nodes/0.DtQFMo5Z.js +2 -0
- package/dist/web/_app/immutable/nodes/{1.gy-UNDF3.js → 1.DJ2AQD2m.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.CFmJZos9.js → 2.DWr3ykuO.js} +1 -1
- package/dist/web/_app/immutable/nodes/3.qGcB9YWB.js +1 -0
- package/dist/web/_app/immutable/nodes/4.DU5ubOPD.js +17 -0
- package/dist/web/_app/immutable/nodes/{5.C7yLiq2I.js → 5.CD_z4c5g.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.DKaTmAiw.js → 6.Bd2482PN.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.CA3sQ74A.js → 7.BTx2RBdr.js} +1 -1
- package/dist/web/_app/immutable/nodes/8.I6vnVY2_.js +2 -0
- package/dist/web/_app/immutable/nodes/{9.BVVyKTae.js → 9.u8QBhCns.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +10 -10
- package/package.json +2 -1
- package/dist/web/_app/immutable/assets/AppShell.C00jH_aT.css +0 -1
- package/dist/web/_app/immutable/chunks/B3v6bkHV.js +0 -27
- package/dist/web/_app/immutable/chunks/BQlTvYWB.js +0 -1
- package/dist/web/_app/immutable/chunks/BzhnXU6Q.js +0 -1
- package/dist/web/_app/immutable/chunks/CRcLi9EQ.js +0 -1
- package/dist/web/_app/immutable/chunks/DL7u7dQi.js +0 -2
- package/dist/web/_app/immutable/chunks/m74CvwCG.js +0 -2
- package/dist/web/_app/immutable/chunks/trveDs8t.js +0 -1
- package/dist/web/_app/immutable/entry/app.3j3I-9SC.js +0 -2
- package/dist/web/_app/immutable/entry/start.CYScsHkx.js +0 -1
- package/dist/web/_app/immutable/nodes/0.CxCm4CPW.js +0 -2
- package/dist/web/_app/immutable/nodes/3.D1yvWsPv.js +0 -1
- package/dist/web/_app/immutable/nodes/4.LKUIo9Zg.js +0 -16
- package/dist/web/_app/immutable/nodes/8.DEuJARDO.js +0 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DWSjaG46.js","../chunks/D-tW7Byc.js","../chunks/Bk7i2AGK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{h as Vt,r as jt,i as Mt,B as St,s as Zt,d as Yt,w as Gt}from"../chunks/ByFfmBEu.js";import{d as Xt,b as Ct,a as ot,f as lt,e as $t,s as qt}from"../chunks/CjKjQEMp.js";import{p as Bt,z as _t,S as Pt,D as Ft,_ as te,ap as ee,o as Q,q as G,y as h,u as N,v as At,x as I,f as Ht,t as re,n as Qt,m as ne,T as ie,F as se,V as Rt,U as ae}from"../chunks/D-tW7Byc.js";import{i as kt,b as oe}from"../chunks/EhE2EcYu.js";import{a as Ot,X as Kt,i as xt,P as It,e as dt,n as Ut,r as le}from"../chunks/JFkcr2-N.js";import{g as ue}from"../chunks/DkM5hMeY.js";import{A as he}from"../chunks/Mxe2MMs2.js";import{V as fe,C as de}from"../chunks/CiTQ_W2r.js";import{I as ce,C as pe,t as _e}from"../chunks/Bz2vmWce.js";import{_ as ge}from"../chunks/PPVm8Dsz.js";import{g as ve}from"../chunks/CqkleIqs.js";const me=async({params:O})=>{const{repo:c,type:w,id:l,path:F}=O,L=await Vt(c,w,l,F);return{repo:c,type:w,id:l,filePath:F,fileName:F.split("/").pop()??F,content:L}},Je=Object.freeze(Object.defineProperty({__proto__:null,load:me},Symbol.toStringTag,{value:"Module"}));var Tt={exports:{}};var ye=Tt.exports,Nt;function ke(){return Nt||(Nt=1,(function(O,c){((w,l)=>{O.exports=l()})(ye,function w(){var l=typeof self<"u"?self:typeof window<"u"?window:l!==void 0?l:{},F,L=!l.document&&!!l.postMessage,S=l.IS_PAPA_WORKER||!1,Z={},tt=0,d={};function W(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var r=nt(e);r.chunkSize=parseInt(r.chunkSize),e.step||e.chunk||(r.chunkSize=null),this._handle=new pt(r),(this._handle.streamer=this)._config=r}).call(this,t),this.parseChunk=function(e,r){var s=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<s){let y=this._config.newline;y||(a=this._config.quoteChar||'"',y=this._handle.guessLineEndings(e,a)),e=[...e.split(y).slice(s)].join(y)}this.isFirstChunk&&p(this._config.beforeFirstChunk)&&(a=this._config.beforeFirstChunk(e))!==void 0&&(e=a),this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+e,a=(this._partialLine="",this._handle.parse(s,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,s=(this._finished||(this._partialLine=s.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),S)l.postMessage({results:a,workerId:d.WORKER_ID,finished:s});else if(p(this._config.chunk)&&!r){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!s||!p(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){p(this._config.error)?this._config.error(e):S&&this._config.error&&l.postMessage({workerId:d.WORKER_ID,error:e,finished:!1})}}function rt(t){var e;(t=t||{}).chunkSize||(t.chunkSize=d.RemoteChunkSize),W.call(this,t),this._nextChunk=L?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(r){this._input=r,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),L||(e.onload=m(this._chunkLoaded,this),e.onerror=m(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!L),this._config.downloadRequestHeaders){var r,s=this._config.downloadRequestHeaders;for(r in s)e.setRequestHeader(r,s[r])}var a;this._config.chunkSize&&(a=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+a));try{e.send(this._config.downloadRequestBody)}catch(y){this._chunkError(y.message)}L&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(r=>(r=r.getResponseHeader("Content-Range"))!==null?parseInt(r.substring(r.lastIndexOf("/")+1)):-1)(e),this.parseChunk(e.responseText)))},this._chunkError=function(r){r=e.statusText||r,this._sendError(new Error(r))}}function ut(t){(t=t||{}).chunkSize||(t.chunkSize=d.LocalChunkSize),W.call(this,t);var e,r,s=typeof FileReader<"u";this.stream=function(a){this._input=a,r=a.slice||a.webkitSlice||a.mozSlice,s?((e=new FileReader).onload=m(this._chunkLoaded,this),e.onerror=m(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var a=this._input,y=(this._config.chunkSize&&(y=Math.min(this._start+this._config.chunkSize,this._input.size),a=r.call(a,this._start,y)),e.readAsText(a,this._config.encoding));s||this._chunkLoaded({target:{result:y}})},this._chunkLoaded=function(a){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(a.target.result)},this._chunkError=function(){this._sendError(e.error)}}function X(t){var e;W.call(this,t=t||{}),this.stream=function(r){return e=r,this._nextChunk()},this._nextChunk=function(){var r,s;if(!this._finished)return r=this._config.chunkSize,e=r?(s=e.substring(0,r),e.substring(r)):(s=e,""),this._finished=!e,this.parseChunk(s)}}function $(t){W.call(this,t=t||{});var e=[],r=!0,s=!1;this.pause=function(){W.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){W.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(a){this._input=a,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=m(function(a){try{e.push(typeof a=="string"?a:a.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(y){this._streamError(y)}},this),this._streamError=m(function(a){this._streamCleanUp(),this._sendError(a)},this),this._streamEnd=m(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=m(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function pt(t){var e,r,s,a,y=Math.pow(2,53),z=-y,J=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,n=this,u=0,f=0,A=!1,v=!1,b=[],o={data:[],errors:[],meta:{}};function D(k){return t.skipEmptyLines==="greedy"?k.join("").trim()==="":k.length===1&&k[0].length===0}function _(){if(o&&s&&(U("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),s=!1),t.skipEmptyLines&&(o.data=o.data.filter(function(g){return!D(g)})),T()){let g=function(M,q){p(t.transformHeader)&&(M=t.transformHeader(M,q)),b.push(M)};if(o)if(Array.isArray(o.data[0])){for(var k=0;T()&&k<o.data.length;k++)o.data[k].forEach(g);o.data.splice(0,1)}else o.data.forEach(g)}function C(g,M){for(var q=t.header?{}:[],x=0;x<g.length;x++){var P=x,R=g[x],R=((et,E)=>(K=>(t.dynamicTypingFunction&&t.dynamicTyping[K]===void 0&&(t.dynamicTyping[K]=t.dynamicTypingFunction(K)),(t.dynamicTyping[K]||t.dynamicTyping)===!0))(et)?E==="true"||E==="TRUE"||E!=="false"&&E!=="FALSE"&&((K=>{if(J.test(K)&&(K=parseFloat(K),z<K&&K<y))return 1})(E)?parseFloat(E):i.test(E)?new Date(E):E===""?null:E):E)(P=t.header?x>=b.length?"__parsed_extra":b[x]:P,R=t.transform?t.transform(R,P):R);P==="__parsed_extra"?(q[P]=q[P]||[],q[P].push(R)):q[P]=R}return t.header&&(x>b.length?U("FieldMismatch","TooManyFields","Too many fields: expected "+b.length+" fields but parsed "+x,f+M):x<b.length&&U("FieldMismatch","TooFewFields","Too few fields: expected "+b.length+" fields but parsed "+x,f+M)),q}var j;o&&(t.header||t.dynamicTyping||t.transform)&&(j=1,!o.data.length||Array.isArray(o.data[0])?(o.data=o.data.map(C),j=o.data.length):o.data=C(o.data,0),t.header&&o.meta&&(o.meta.fields=b),f+=j)}function T(){return t.header&&b.length===0}function U(k,C,j,g){k={type:k,code:C,message:j},g!==void 0&&(k.row=g),o.errors.push(k)}p(t.step)&&(a=t.step,t.step=function(k){o=k,T()?_():(_(),o.data.length!==0&&(u+=k.data.length,t.preview&&u>t.preview?r.abort():(o.data=o.data[0],a(o,n))))}),this.parse=function(k,C,j){var g=t.quoteChar||'"',g=(t.newline||(t.newline=this.guessLineEndings(k,g)),s=!1,t.delimiter?p(t.delimiter)&&(t.delimiter=t.delimiter(k),o.meta.delimiter=t.delimiter):((g=((M,q,x,P,R)=>{var et,E,K,ct;R=R||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var mt=0;mt<R.length;mt++){for(var it,Et=R[mt],V=0,st=0,H=0,Y=(K=void 0,new B({comments:P,delimiter:Et,newline:q,preview:10}).parse(M)),ft=0;ft<Y.data.length;ft++)x&&D(Y.data[ft])?H++:(it=Y.data[ft].length,st+=it,K===void 0?K=it:0<it&&(V+=Math.abs(it-K),K=it));0<Y.data.length&&(st/=Y.data.length-H),(E===void 0||V<=E)&&(ct===void 0||ct<st)&&1.99<st&&(E=V,et=Et,ct=st)}return{successful:!!(t.delimiter=et),bestDelimiter:et}})(k,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=g.bestDelimiter:(s=!0,t.delimiter=d.DefaultDelimiter),o.meta.delimiter=t.delimiter),nt(t));return t.preview&&t.header&&g.preview++,e=k,r=new B(g),o=r.parse(e,C,j),_(),A?{meta:{paused:!0}}:o||{meta:{paused:!1}}},this.paused=function(){return A},this.pause=function(){A=!0,r.abort(),e=p(t.chunk)?"":e.substring(r.getCharIndex())},this.resume=function(){n.streamer._halted?(A=!1,n.streamer.parseChunk(e,!0)):setTimeout(n.resume,3)},this.aborted=function(){return v},this.abort=function(){v=!0,r.abort(),o.meta.aborted=!0,p(t.complete)&&t.complete(o),e=""},this.guessLineEndings=function(M,g){M=M.substring(0,1048576);var g=new RegExp(ht(g)+"([^]*?)"+ht(g),"gm"),j=(M=M.replace(g,"")).split("\r"),g=M.split(`
|
|
3
|
+
`),M=1<g.length&&g[0].length<j[0].length;if(j.length===1||M)return`
|
|
4
|
+
`;for(var q=0,x=0;x<j.length;x++)j[x][0]===`
|
|
5
|
+
`&&q++;return q>=j.length/2?`\r
|
|
6
|
+
`:"\r"}}function ht(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function B(t){var e=(t=t||{}).delimiter,r=t.newline,s=t.comments,a=t.step,y=t.preview,z=t.fastMode,J=null,i=!1,n=t.quoteChar==null?'"':t.quoteChar,u=n;if(t.escapeChar!==void 0&&(u=t.escapeChar),(typeof e!="string"||-1<d.BAD_DELIMITERS.indexOf(e))&&(e=","),s===e)throw new Error("Comment character same as delimiter");s===!0?s="#":(typeof s!="string"||-1<d.BAD_DELIMITERS.indexOf(s))&&(s=!1),r!==`
|
|
7
|
+
`&&r!=="\r"&&r!==`\r
|
|
8
|
+
`&&(r=`
|
|
9
|
+
`);var f=0,A=!1;this.parse=function(v,b,o){if(typeof v!="string")throw new Error("Input must be a string");var D=v.length,_=e.length,T=r.length,U=s.length,k=p(a),C=[],j=[],g=[],M=f=0;if(!v)return V();if(z||z!==!1&&v.indexOf(n)===-1){for(var q=v.split(r),x=0;x<q.length;x++){if(g=q[x],f+=g.length,x!==q.length-1)f+=r.length;else if(o)return V();if(!s||g.substring(0,U)!==s){if(k){if(C=[],ct(g.split(e)),st(),A)return V()}else ct(g.split(e));if(y&&y<=x)return C=C.slice(0,y),V(!0)}}return V()}for(var P=v.indexOf(e,f),R=v.indexOf(r,f),et=new RegExp(ht(u)+ht(n),"g"),E=v.indexOf(n,f);;)if(v[f]===n)for(E=f,f++;;){if((E=v.indexOf(n,E+1))===-1)return o||j.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:C.length,index:f}),it();if(E===D-1)return it(v.substring(f,E).replace(et,n));if(n===u&&v[E+1]===u)E++;else if(n===u||E===0||v[E-1]!==u){P!==-1&&P<E+1&&(P=v.indexOf(e,E+1));var K=mt((R=R!==-1&&R<E+1?v.indexOf(r,E+1):R)===-1?P:Math.min(P,R));if(v.substr(E+1+K,_)===e){g.push(v.substring(f,E).replace(et,n)),v[f=E+1+K+_]!==n&&(E=v.indexOf(n,f)),P=v.indexOf(e,f),R=v.indexOf(r,f);break}if(K=mt(R),v.substring(E+1+K,E+1+K+T)===r){if(g.push(v.substring(f,E).replace(et,n)),Et(E+1+K+T),P=v.indexOf(e,f),E=v.indexOf(n,f),k&&(st(),A))return V();if(y&&C.length>=y)return V(!0);break}j.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:C.length,index:f}),E++}}else if(s&&g.length===0&&v.substring(f,f+U)===s){if(R===-1)return V();f=R+T,R=v.indexOf(r,f),P=v.indexOf(e,f)}else if(P!==-1&&(P<R||R===-1))g.push(v.substring(f,P)),f=P+_,P=v.indexOf(e,f);else{if(R===-1)break;if(g.push(v.substring(f,R)),Et(R+T),k&&(st(),A))return V();if(y&&C.length>=y)return V(!0)}return it();function ct(H){C.push(H),M=f}function mt(H){var Y=0;return Y=H!==-1&&(H=v.substring(E+1,H))&&H.trim()===""?H.length:Y}function it(H){return o||(H===void 0&&(H=v.substring(f)),g.push(H),f=D,ct(g),k&&st()),V()}function Et(H){f=H,ct(g),g=[],R=v.indexOf(r,f)}function V(H){if(t.header&&!b&&C.length&&!i){var Y=C[0],ft=Object.create(null),Dt=new Set(Y);let Lt=!1;for(let yt=0;yt<Y.length;yt++){let at=Y[yt];if(ft[at=p(t.transformHeader)?t.transformHeader(at,yt):at]){let wt,zt=ft[at];for(;wt=at+"_"+zt,zt++,Dt.has(wt););Dt.add(wt),Y[yt]=wt,ft[at]++,Lt=!0,(J=J===null?{}:J)[wt]=at}else ft[at]=1,Y[yt]=at;Dt.add(at)}Lt&&console.warn("Duplicate headers found and renamed."),i=!0}return{data:C,errors:j,meta:{delimiter:e,linebreak:r,aborted:A,truncated:!!H,cursor:M+(b||0),renamedHeaders:J}}}function st(){a(V()),C=[],j=[]}},this.abort=function(){A=!0},this.getCharIndex=function(){return f}}function bt(t){var e=t.data,r=Z[e.workerId],s=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var a={abort:function(){s=!0,gt(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:vt,resume:vt};if(p(r.userStep)){for(var y=0;y<e.results.data.length&&(r.userStep({data:e.results.data[y],errors:e.results.errors,meta:e.results.meta},a),!s);y++);delete e.results}else p(r.userChunk)&&(r.userChunk(e.results,a,e.file),delete e.results)}e.finished&&!s&>(e.workerId,e.results)}function gt(t,e){var r=Z[t];p(r.userComplete)&&r.userComplete(e),r.terminate(),delete Z[t]}function vt(){throw new Error("Not implemented.")}function nt(t){if(typeof t!="object"||t===null)return t;var e,r=Array.isArray(t)?[]:{};for(e in t)r[e]=nt(t[e]);return r}function m(t,e){return function(){t.apply(e,arguments)}}function p(t){return typeof t=="function"}return d.parse=function(t,e){var r=(e=e||{}).dynamicTyping||!1;if(p(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=!!p(e.transform)&&e.transform,!e.worker||!d.WORKERS_SUPPORTED)return r=null,d.NODE_STREAM_INPUT,typeof t=="string"?(t=(s=>s.charCodeAt(0)!==65279?s:s.slice(1))(t),r=new(e.download?rt:X)(e)):t.readable===!0&&p(t.read)&&p(t.on)?r=new $(e):(l.File&&t instanceof File||t instanceof Object)&&(r=new ut(e)),r.stream(t);(r=(()=>{var s;return!!d.WORKERS_SUPPORTED&&(s=(()=>{var a=l.URL||l.webkitURL||null,y=w.toString();return d.BLOB_URL||(d.BLOB_URL=a.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",y,")();"],{type:"text/javascript"})))})(),(s=new l.Worker(s)).onmessage=bt,s.id=tt++,Z[s.id]=s)})()).userStep=e.step,r.userChunk=e.chunk,r.userComplete=e.complete,r.userError=e.error,e.step=p(e.step),e.chunk=p(e.chunk),e.complete=p(e.complete),e.error=p(e.error),delete e.worker,r.postMessage({input:t,config:e,workerId:r.id})},d.unparse=function(t,e){var r=!1,s=!0,a=",",y=`\r
|
|
10
|
+
`,z='"',J=z+z,i=!1,n=null,u=!1,f=((()=>{if(typeof e=="object"){if(typeof e.delimiter!="string"||d.BAD_DELIMITERS.filter(function(b){return e.delimiter.indexOf(b)!==-1}).length||(a=e.delimiter),typeof e.quotes!="boolean"&&typeof e.quotes!="function"&&!Array.isArray(e.quotes)||(r=e.quotes),typeof e.skipEmptyLines!="boolean"&&typeof e.skipEmptyLines!="string"||(i=e.skipEmptyLines),typeof e.newline=="string"&&(y=e.newline),typeof e.quoteChar=="string"&&(z=e.quoteChar),typeof e.header=="boolean"&&(s=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");n=e.columns}e.escapeChar!==void 0&&(J=e.escapeChar+z),e.escapeFormulae instanceof RegExp?u=e.escapeFormulae:typeof e.escapeFormulae=="boolean"&&e.escapeFormulae&&(u=/^[=+\-@\t\r].*$/)}})(),new RegExp(ht(z),"g"));if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return A(null,t,i);if(typeof t[0]=="object")return A(n||Object.keys(t[0]),t,i)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||n),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||typeof t.data[0]=="object"||(t.data=[t.data])),A(t.fields||[],t.data||[],i);throw new Error("Unable to serialize unrecognized input");function A(b,o,D){var _="",T=(typeof b=="string"&&(b=JSON.parse(b)),typeof o=="string"&&(o=JSON.parse(o)),Array.isArray(b)&&0<b.length),U=!Array.isArray(o[0]);if(T&&s){for(var k=0;k<b.length;k++)0<k&&(_+=a),_+=v(b[k],k);0<o.length&&(_+=y)}for(var C=0;C<o.length;C++){var j=(T?b:o[C]).length,g=!1,M=T?Object.keys(o[C]).length===0:o[C].length===0;if(D&&!T&&(g=D==="greedy"?o[C].join("").trim()==="":o[C].length===1&&o[C][0].length===0),D==="greedy"&&T){for(var q=[],x=0;x<j;x++){var P=U?b[x]:x;q.push(o[C][P])}g=q.join("").trim()===""}if(!g){for(var R=0;R<j;R++){0<R&&!M&&(_+=a);var et=T&&U?b[R]:R;_+=v(o[C][et],R)}C<o.length-1&&(!D||0<j&&!M)&&(_+=y)}}return _}function v(b,o){var D,_;return b==null?"":b.constructor===Date?JSON.stringify(b).slice(1,25):(_=!1,u&&typeof b=="string"&&u.test(b)&&(b="'"+b,_=!0),D=b.toString().replace(f,J),(_=_||r===!0||typeof r=="function"&&r(b,o)||Array.isArray(r)&&r[o]||((T,U)=>{for(var k=0;k<U.length;k++)if(-1<T.indexOf(U[k]))return!0;return!1})(D,d.BAD_DELIMITERS)||-1<D.indexOf(a)||D.charAt(0)===" "||D.charAt(D.length-1)===" ")?z+D+z:D)}},d.RECORD_SEP="",d.UNIT_SEP="",d.BYTE_ORDER_MARK="\uFEFF",d.BAD_DELIMITERS=["\r",`
|
|
11
|
+
`,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!L&&!!l.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=B,d.ParserHandle=pt,d.NetworkStreamer=rt,d.FileStreamer=ut,d.StringStreamer=X,d.ReadableStreamStreamer=$,l.jQuery&&((F=l.jQuery).fn.parse=function(t){var e=t.config||{},r=[];return this.each(function(y){if(!(F(this).prop("tagName").toUpperCase()==="INPUT"&&F(this).attr("type").toLowerCase()==="file"&&l.FileReader)||!this.files||this.files.length===0)return!0;for(var z=0;z<this.files.length;z++)r.push({file:this.files[z],inputElem:this,instanceConfig:F.extend({},e)})}),s(),this;function s(){if(r.length===0)p(t.complete)&&t.complete();else{var y,z,J,i,n=r[0];if(p(t.before)){var u=t.before(n.file,n.inputElem);if(typeof u=="object"){if(u.action==="abort")return y="AbortError",z=n.file,J=n.inputElem,i=u.reason,void(p(t.error)&&t.error({name:y},z,J,i));if(u.action==="skip")return void a();typeof u.config=="object"&&(n.instanceConfig=F.extend(n.instanceConfig,u.config))}else if(u==="skip")return void a()}var f=n.instanceConfig.complete;n.instanceConfig.complete=function(A){p(f)&&f(A,n.file,n.inputElem),a()},d.parse(n.file,n.instanceConfig)}}function a(){r.splice(0,1),s()}}),S&&(l.onmessage=function(t){t=t.data,d.WORKER_ID===void 0&&t&&(d.WORKER_ID=t.workerId),typeof t.input=="string"?l.postMessage({workerId:d.WORKER_ID,results:d.parse(t.input,t.config),finished:!0}):(l.File&&t.input instanceof File||t.input instanceof Object)&&(t=d.parse(t.input,t.config))&&l.postMessage({workerId:d.WORKER_ID,results:t,finished:!0})}),(rt.prototype=Object.create(W.prototype)).constructor=rt,(ut.prototype=Object.create(W.prototype)).constructor=ut,(X.prototype=Object.create(X.prototype)).constructor=X,($.prototype=Object.create(W.prototype)).constructor=$,d})})(Tt)),Tt.exports}var be=ke();const Wt=ve(be);var Ee=lt('<th class="svelte-63hltt"><input class="cell-input header-input svelte-63hltt"/> <!></th>'),we=lt('<td class="svelte-63hltt"><input class="cell-input svelte-63hltt"/></td>'),Ce=lt('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),Re=lt("<!> <span>Add row</span>",1),Se=lt('<div class="csv-editor svelte-63hltt"><div class="table-scroll svelte-63hltt"><table class="svelte-63hltt"><thead><tr class="svelte-63hltt"><th class="row-num svelte-63hltt"></th><!><th class="col-add svelte-63hltt"><!></th></tr></thead><tbody></tbody></table></div> <div class="csv-footer svelte-63hltt"><!></div></div>');function Oe(O,c){Bt(c,!0);let w=_t(Pt([])),l=_t(Pt([])),F=_t(void 0),L=!1,S=null,Z=!1;function tt(i){const n=Wt.parse(i.trim(),{header:!1,skipEmptyLines:!0});n.data.length>0?(I(w,n.data[0],!0),I(l,n.data.slice(1),!0)):(I(w,[],!0),I(l,[],!0))}tt(c.content),Ft(()=>{L||tt(c.content)}),te(async()=>{if(c.collabDocName)try{const{collab:i}=await ge(async()=>{const{collab:u}=await import("../chunks/DWSjaG46.js");return{collab:u}},__vite__mapDeps([0,1,2]),import.meta.url),n=i.connect(c.collabDocName);if(!n||i.status==="unavailable")return;S=n.yText,L=!0,S.length===0&&c.content?S.insert(0,c.content):S.length>0&&tt(S.toString()),S.observe(()=>{!Z&&S&&tt(S.toString())})}catch{}}),ee(()=>{S=null,L=!1});function d(){return Wt.unparse([h(w),...h(l)])}function W(){const i=d();L&&S?(Z=!0,S.doc?.transact(()=>{S.delete(0,S.length),S.insert(0,i)}),Z=!1):c.onchange?.(i)}function rt(i,n,u){h(l)[i][n]=u,I(l,[...h(l)],!0),W()}function ut(i,n){h(w)[i]=n,I(w,[...h(w)],!0),W()}function X(){I(l,[...h(l),h(w).map(()=>"")],!0),W(),B(h(l).length-1,0)}function $(i){I(l,h(l).filter((n,u)=>u!==i),!0),W()}function pt(){const i=`col${h(w).length+1}`;I(w,[...h(w),i],!0),I(l,h(l).map(n=>[...n,""]),!0),W(),requestAnimationFrame(()=>{const n=h(F)?.querySelector(`thead th:nth-child(${h(w).length+1}) input`);n&&(n.focus(),n.select())})}function ht(i){h(w).length<=1||(I(w,h(w).filter((n,u)=>u!==i),!0),I(l,h(l).map(n=>n.filter((u,f)=>f!==i)),!0),W())}function B(i,n){requestAnimationFrame(()=>{if(!h(F))return;let u=null;i<0?u=h(F).querySelector(`thead th:nth-child(${n+2}) input`):u=h(F).querySelector(`tbody tr:nth-child(${i+1}) td:nth-child(${n+2}) input`),u&&(u.focus(),u.select())})}function bt(i,n,u){if(i.key==="Tab"){i.preventDefault(),i.shiftKey?u>0?B(n,u-1):n>0?B(n-1,h(w).length-1):n===0&&B(-1,h(w).length-1):u<h(w).length-1?B(n,u+1):n<h(l).length-1?B(n+1,0):n===h(l).length-1&&X();return}if(i.key==="Enter"){i.preventDefault(),i.shiftKey?n>0?B(n-1,u):B(-1,u):n<h(l).length-1?B(n+1,u):X();return}if(i.key==="Escape"){i.target.blur();return}}function gt(i,n){if(i.key==="Tab"){i.preventDefault(),i.shiftKey?n>0&&B(-1,n-1):n<h(w).length-1?B(-1,n+1):h(l).length>0&&B(0,0);return}if(i.key==="Enter"){i.preventDefault(),h(l).length>0?B(0,n):X();return}if(i.key==="Escape"){i.target.blur();return}}function vt(i){(i.metaKey||i.ctrlKey)&&i.key==="s"&&(i.preventDefault(),c.onsave?.())}var nt=Se(),m=Q(nt),p=Q(m),t=Q(p),e=Q(t),r=G(Q(e));Ot(r,17,()=>h(w),xt,(i,n,u)=>{var f=Ee(),A=Q(f);jt(A);var v=G(A,2);{var b=o=>{St(o,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>ht(u),children:(D,_)=>{Kt(D,{size:12})},$$slots:{default:!0}})};kt(v,o=>{h(w).length>1&&o(b)})}N(f),At(()=>Mt(A,h(n))),Ct("input",A,o=>ut(u,o.currentTarget.value)),Ct("keydown",A,o=>gt(o,u)),ot(i,f)});var s=G(r),a=Q(s);St(a,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:pt,children:(i,n)=>{It(i,{size:14})},$$slots:{default:!0}}),N(s),N(e),N(t);var y=G(t);Ot(y,21,()=>h(l),xt,(i,n,u)=>{var f=Ce(),A=Q(f);A.textContent=u+1;var v=G(A);Ot(v,17,()=>h(n),xt,(D,_,T)=>{var U=we(),k=Q(U);jt(k),N(U),At(()=>Mt(k,h(_))),Ct("input",k,C=>rt(u,T,C.currentTarget.value)),Ct("keydown",k,C=>bt(C,u,T)),ot(D,U)});var b=G(v),o=Q(b);St(o,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>$(u),children:(D,_)=>{Kt(D,{size:12})},$$slots:{default:!0}}),N(b),N(f),ot(i,f)}),N(y),N(p),oe(p,i=>I(F,i),()=>h(F)),N(m);var z=G(m,2),J=Q(z);St(J,{variant:"ghost",class:"add-row-btn",onclick:X,children:(i,n)=>{var u=Re(),f=Ht(u);It(f,{size:14}),re(2),ot(i,u)},$$slots:{default:!0}}),N(z),N(nt),Ct("keydown",nt,vt),ot(O,nt),Qt()}Xt(["keydown","input"]);function xe(O){if(!O.startsWith("---"))return{frontmatter:{},content:O};const c=O.indexOf(`
|
|
12
|
+
---`,3);if(c===-1)return{frontmatter:{},content:O};const w=O.slice(4,c),l=O.slice(c+4).replace(/^\n/,"");try{return{frontmatter:Te(w),content:l}}catch{return{frontmatter:{},content:O}}}function Te(O){const c={},w=O.split(`
|
|
13
|
+
`);let l=0;for(;l<w.length;){const F=w[l];if(!F.trim()||F.trim().startsWith("#")){l++;continue}const L=F.match(/^([a-zA-Z_][a-zA-Z0-9_-]*):\s*(.*)/);if(!L){l++;continue}const S=L[1],Z=L[2].trim();if(!Z&&l+1<w.length&&w[l+1]?.match(/^\s+-\s/)){const tt=[];for(l++;l<w.length&&w[l].match(/^\s+-\s/);){const d=w[l].match(/^\s+-\s+(.*)/);d&&tt.push(Jt(d[1].trim())),l++}c[S]=tt;continue}c[S]=Ae(Z),l++}return c}function Jt(O){return O.startsWith("'")&&O.endsWith("'")||O.startsWith('"')&&O.endsWith('"')?O.slice(1,-1):O}function Ae(O){if(!O)return"";const c=Jt(O);return c==="true"?!0:c==="false"?!1:c==="null"||c==="~"?null:O===c&&/^-?\d+(\.\d+)?$/.test(O)?Number(O):c}var De=lt('<span class="bc-sep svelte-xtfs5g">/</span>'),Pe=lt("<!><span> </span>",1),Fe=lt('<span class="status-text saving svelte-xtfs5g">Saving...</span>'),Le=lt('<span class="status-text error svelte-xtfs5g"> </span>'),ze=lt('<div class="content-row svelte-xtfs5g"><div class="entity-area svelte-xtfs5g"><!> <div class="editor-bar svelte-xtfs5g"><div class="breadcrumb-path svelte-xtfs5g"></div> <div class="editor-actions svelte-xtfs5g"><!></div></div> <div class="document-scroll svelte-xtfs5g"><!> <!></div></div> <!></div>');function Ve(O,c){Bt(c,!0);const w=ne("chat"),l=Rt(()=>c.data.fileName.endsWith(".csv")),F=Rt(()=>c.data.fileName.endsWith(".md"));let L=_t(""),S=_t(Pt({})),Z=_t(0);const tt=Rt(()=>_e(h(S))),d=Rt(()=>Object.keys(h(S)).length>0),W=Rt(()=>[c.data.repo,c.data.id,...c.data.filePath.split("/")]);let rt=_t("");Ft(()=>{const m=`${c.data.repo}/${c.data.type}/${c.data.id}/${c.data.filePath}`;if(m!==h(rt)){if(h(rt)&&dt.flush(),I(rt,m),h(F)||h(l)){const p=xe(c.data.content);I(S,{...p.frontmatter},!0),I(L,p.content,!0)}else I(S,{},!0),I(L,c.data.content,!0);ie(Z),dt.reset()}}),Ft(()=>{const m=c.data.repo,p=c.data.type,t=c.data.id,e=c.data.filePath;se(()=>{Ut.select(m,p,t,e),Ut.showEntity()})});function ut(m){return/[\[\]{}'":,#|>&*!?]/.test(m)||/^\s|\s$/.test(m)}function X(){if(h(d)){const m=[];for(const[p,t]of Object.entries(h(S)))if(Array.isArray(t)){m.push(`${p}:`);for(const e of t){const r=String(e);m.push(` - ${ut(r)?`'${r}'`:r}`)}}else{const e=String(t??"");m.push(`${p}: ${ut(e)?`'${e}'`:e}`)}return`---
|
|
14
|
+
${m.join(`
|
|
15
|
+
`)}
|
|
16
|
+
---
|
|
17
|
+
${h(L)}`}return h(L)}function $(){const m=X();dt.scheduleContentFileSave(c.data.repo,c.data.type,c.data.id,c.data.filePath,m)}function pt(m){I(L,m,!0),$()}function ht(m,p){I(S,{...h(S),[m]:p},!0),$()}function B(m){const{[m]:p,...t}=h(S);I(S,t,!0),$()}function bt(m,p){I(S,{...h(S),[m]:p},!0),$()}function gt(m,p){$()}function vt(m){for(const p of Gt.repos){const t=p.entities.find(e=>e.id===m);if(t){ue(`/${p.name}/${t.entityType}/${t.id}`);return}}le.showToast(`"${m}" is in a collection you don't have access to`)}function nt(m){(m.metaKey||m.ctrlKey)&&m.key==="s"&&(m.preventDefault(),dt.flush())}$t("keydown",ae,nt),he(O,{children:(m,p)=>{var t=ze(),e=Q(t),r=Q(e);fe(r,{activeView:"entity"});var s=G(r,2),a=Q(s);Ot(a,21,()=>h(W),xt,(_,T,U)=>{var k=Pe(),C=Ht(k);{var j=q=>{var x=De();ot(q,x)};kt(C,q=>{U>0&&q(j)})}var g=G(C),M=Q(g,!0);N(g),At(()=>{Zt(g,1,Yt(U===h(W).length-1?"bc-current":"bc-segment"),"svelte-xtfs5g"),qt(M,h(T))}),ot(_,k)}),N(a);var y=G(a,2),z=Q(y);{var J=_=>{var T=Fe();ot(_,T)},i=_=>{var T=Le(),U=Q(T,!0);N(T),At(()=>qt(U,dt.error)),ot(_,T)};kt(z,_=>{dt.saving?_(J):dt.error&&_(i,1)})}N(y),N(s);var n=G(s,2),u=Q(n);{var f=_=>{ce(_,{get properties(){return h(tt)},editable:!0,onedit:ht,onremove:B,onadd:bt,ontypechange:gt})};kt(u,_=>{h(d)&&_(f)})}var A=G(u,2);{var v=_=>{Oe(_,{get content(){return h(L)},onchange:pt,onsave:()=>dt.flush()})},b=_=>{pe(_,{get content(){return h(L)},readonly:!1,onchange:pt,onsave:()=>dt.flush(),onwikilinkclick:vt,get resetKey(){return h(Z)}})};kt(A,_=>{h(l)?_(v):_(b,!1)})}N(n),N(e);var o=G(e,2);{var D=_=>{de(_,{})};kt(o,_=>{w.open&&_(D)})}N(t),ot(m,t)},$$slots:{default:!0}}),Qt()}export{Ve as component,Je as universal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as dt,s as J,w as ut}from"../chunks/
|
|
1
|
+
import{f as dt,s as J,w as ut}from"../chunks/ByFfmBEu.js";import{a as k,s as Z,f as M,c as ft}from"../chunks/CjKjQEMp.js";import{p as $,D as tt,_ as mt,o as T,q as H,y as h,u as I,v as O,n as et,z as Q,x as S,f as vt,V as ht}from"../chunks/D-tW7Byc.js";import{b as X,i as j}from"../chunks/EhE2EcYu.js";import{A as yt}from"../chunks/Mxe2MMs2.js";import{g as pt}from"../chunks/DkM5hMeY.js";import{n as Y}from"../chunks/JFkcr2-N.js";const bt=async({params:g})=>{const{repo:o,type:l,id:c}=g,f=await dt(o,l,c);return{repo:o,type:l,id:c,entity:f}},Tt=Object.freeze(Object.defineProperty({__proto__:null,load:bt},Symbol.toStringTag,{value:"Module"}));var gt=M('<div class="loading-indicator svelte-1fltv0h">Loading editor...</div>'),wt=M('<div class="error-indicator svelte-1fltv0h"> </div>'),_t=M('<div><div class="header-mount svelte-1fltv0h"></div> <!> <!> <div></div></div>');function At(g,o){$(o,!0);let l,c,f=Q(!0),m=Q(null),p=[],b=[],w=[],d={},y=[],v=null,_=null,A=0;function q(){const e=window.StudioChrome,i=document.querySelector(".sg-chrome-overflow-menu");if(i&&(i.innerHTML=""),e&&(e.clearViewAction(),e.clearSaveHandlers()),_&&(_.el.removeEventListener("click",_.handler,!0),_=null),e){e.unmountHeader();for(const{event:r,fn:s}of w)e.off(r,s)}w=[];for(const r of p)r.remove();p=[];for(const r of b)r.remove();b=[],v&&(v.remove(),v=null);for(const[r,s]of Object.entries(d))s===void 0?document.body.removeAttribute(r):document.body.setAttribute(r,s);d={};for(const r of y)document.body.classList.remove(r);y=[],c&&(c.innerHTML="")}async function F(){const e=++A;S(f,!0),S(m,null),q();try{const i=`${o.appMountPath}/edit/${encodeURIComponent(o.repo)}/${encodeURIComponent(o.entityId)}`,r=await fetch(i);if(!r.ok)throw new Error(`Failed to load editor: ${r.status}`);if(e!==A)return;const s=await r.text(),P=new DOMParser().parseFromString(s,"text/html"),at=P.querySelectorAll('link[rel="stylesheet"]');for(const t of at){if(t.href.includes("chrome.css"))continue;let n=t.getAttribute("href")||"";n&&!n.startsWith("http")&&!n.startsWith("/")&&(n=`${o.appMountPath}/${n}`);const a=document.createElement("link");a.rel="stylesheet",a.href=n,document.head.appendChild(a),p.push(a)}const it=P.querySelectorAll("head style");for(const t of it){const n=document.createElement("style");n.textContent=t.textContent,document.head.appendChild(n),p.push(n)}v=document.createElement("style"),v.textContent=`
|
|
2
2
|
body.sg-chrome-active { height: auto !important; }
|
|
3
3
|
body.sg-chrome-active > :not(.sg-chrome-header):not(.sg-chrome-footer) { overflow: visible !important; }
|
|
4
4
|
`,document.head.appendChild(v);const L=P.body;for(const t of Array.from(L.attributes))t.name.startsWith("data-")&&(d[t.name]=document.body.getAttribute(t.name)??void 0,document.body.setAttribute(t.name,t.value));const st=Array.from(L.classList);for(const t of st)t!=="sg-chrome-active"&&(document.body.classList.contains(t)||(document.body.classList.add(t),y.push(t)));const ct=L.querySelectorAll("script"),R=[],K=[];for(const t of ct){if(t.src){const n=t.getAttribute("src")||"";if(n.includes("chrome.js"))continue;let a=n;a&&!a.startsWith("http")&&!a.startsWith("/")&&(a=`${o.appMountPath}/${a}`),R.push(a)}else t.textContent&&K.push(t.textContent);t.remove()}c.innerHTML=L.innerHTML;const u=window.StudioChrome;if(u){u.updateBreadcrumb(o.repo,o.entityId),u.mountHeader(l);const t=document.body.dataset.sgViewUrl,n=document.body.dataset.sgViewLabel;t?u.setViewAction(t,n):u.clearViewAction();const a=l.querySelector(".sg-chrome-back");if(a){const N=G=>{G.preventDefault(),G.stopPropagation(),pt(`/${o.repo}/${o.entityType}/${o.entityId}`)};a.addEventListener("click",N,!0),_={el:a,handler:N}}}let E=null;u&&(E=u.on,u.on=function(t,n){w.push({event:t,fn:n}),E.call(this,t,n)});const lt=`?_v=${Date.now()}`;for(const t of R){if(e!==A)return;await ot(t+lt)}for(const t of K){if(e!==A)return;const n=document.createElement("script");n.textContent=t,document.body.appendChild(n),b.push(n)}u&&E&&(u.on=E),S(f,!1)}catch(i){if(e!==A)return;S(m,i.message||"Failed to load editor",!0),S(f,!1)}}function ot(e){return new Promise((i,r)=>{const s=document.createElement("script");s.src=e,s.onload=()=>i(),s.onerror=()=>r(new Error(`Failed to load script: ${e}`)),document.body.appendChild(s),b.push(s)})}let x="";tt(()=>{const e=`${o.appMountPath}|${o.repo}|${o.entityId}`;x&&x!==e&&c&&F(),x=e}),mt(()=>(F(),q));var C=_t();let V;var B=T(C);X(B,e=>l=e,()=>l);var W=H(B,2);{var nt=e=>{var i=gt();k(e,i)};j(W,e=>{h(f)&&e(nt)})}var D=H(W,2);{var rt=e=>{var i=wt(),r=T(i,!0);I(i),O(()=>Z(r,h(m))),k(e,i)};j(D,e=>{h(m)&&e(rt)})}var U=H(D,2);let z;X(U,e=>c=e,()=>c),I(C),O(()=>{V=J(C,1,"editor-frame svelte-1fltv0h",null,V,{loading:h(f)}),z=J(U,1,"editor-container svelte-1fltv0h",null,z,{hidden:h(f)||!!h(m)})}),k(g,C),et()}var St=M('<div class="no-editor svelte-bzivfp"> </div>');function It(g,o){$(o,!0);const l=ht(()=>ut.getAppForEntityType(o.data.type));tt(()=>{Y.select(o.data.repo,o.data.type,o.data.id),Y.showEntity()}),yt(g,{showSidebar:!1,children:(c,f)=>{var m=ft(),p=vt(m);{var b=d=>{At(d,{get appMountPath(){return h(l).mountPath},get repo(){return o.data.repo},get entityId(){return o.data.id},get entityType(){return o.data.type}})},w=d=>{var y=St(),v=T(y);I(y),O(()=>Z(v,`No app editor available for entity type "${o.data.type??""}"`)),k(d,y)};j(p,d=>{h(l)?d(b):d(w,!1)})}k(c,m)},$$slots:{default:!0}}),et()}export{It as component,Tt as universal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BB_5th5W.js","../chunks/PPVm8Dsz.js","../chunks/CqkleIqs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{d as Ie,b as bt,a as gt,f as Tt,s as Rt,e as te,c as ae}from"../chunks/BfTJ6NzK.js";import{p as se,m as Ce,D as Nt,y as p,V as et,_ as De,bq as He,v as At,n as le,o as ut,q as dt,u as it,x as ot,z as pt,f as ce,bb as Ve}from"../chunks/GRkK54yd.js";import{p as Gt,b as Ne,l as Ae,s as ze,i as ee}from"../chunks/trveDs8t.js";import{x as _t,A as Ke}from"../chunks/B3v6bkHV.js";import{V as Qe,c as qe,C as Je}from"../chunks/BDskUnFZ.js";import{_ as Ze}from"../chunks/PPVm8Dsz.js";import{e as ne,i as ie,I as Pe,s as Se,n as Zt}from"../chunks/CRcLi9EQ.js";import{s as tn,l as zt,B as en,w as Yt}from"../chunks/m74CvwCG.js";import{g as nn}from"../chunks/BzhnXU6Q.js";import"../chunks/BjnErSlK.js";function rn(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return ke(this.cover(e,n),e,n,t)}function ke(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,s=t._root,c={data:i},o=t._x0,h=t._y0,a=t._x1,d=t._y1,C,x,f,y,u,l,g,w;if(!s)return t._root=c,t;for(;s.length;)if((u=e>=(C=(o+a)/2))?o=C:a=C,(l=n>=(x=(h+d)/2))?h=x:d=x,r=s,!(s=s[g=l<<1|u]))return r[g]=c,t;if(f=+t._x.call(null,s.data),y=+t._y.call(null,s.data),e===f&&n===y)return c.next=s,r?r[g]=c:t._root=c,t;do r=r?r[g]=new Array(4):t._root=new Array(4),(u=e>=(C=(o+a)/2))?o=C:a=C,(l=n>=(x=(h+d)/2))?h=x:d=x;while((g=l<<1|u)===(w=(y>=x)<<1|f>=C));return r[w]=s,r[g]=c,t}function on(t){var e,n,i=t.length,r,s,c=new Array(i),o=new Array(i),h=1/0,a=1/0,d=-1/0,C=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(s=+this._y.call(null,e))||(c[n]=r,o[n]=s,r<h&&(h=r),r>d&&(d=r),s<a&&(a=s),s>C&&(C=s));if(h>d||a>C)return this;for(this.cover(h,a).cover(d,C),n=0;n<i;++n)ke(this,c[n],o[n],t[n]);return this}function an(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,s=(i=Math.floor(e))+1;else{for(var c=r-n||1,o=this._root,h,a;n>t||t>=r||i>e||e>=s;)switch(a=(e<i)<<1|t<n,h=new Array(4),h[a]=o,o=h,c*=2,a){case 0:r=n+c,s=i+c;break;case 1:n=r-c,s=i+c;break;case 2:r=n+c,i=s-c;break;case 3:n=r-c,i=s-c;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this}function sn(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function ln(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function at(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function cn(t,e,n){var i,r=this._x0,s=this._y0,c,o,h,a,d=this._x1,C=this._y1,x=[],f=this._root,y,u;for(f&&x.push(new at(f,r,s,d,C)),n==null?n=1/0:(r=t-n,s=e-n,d=t+n,C=e+n,n*=n);y=x.pop();)if(!(!(f=y.node)||(c=y.x0)>d||(o=y.y0)>C||(h=y.x1)<r||(a=y.y1)<s))if(f.length){var l=(c+h)/2,g=(o+a)/2;x.push(new at(f[3],l,g,h,a),new at(f[2],c,g,l,a),new at(f[1],l,o,h,g),new at(f[0],c,o,l,g)),(u=(e>=g)<<1|t>=l)&&(y=x[x.length-1],x[x.length-1]=x[x.length-1-u],x[x.length-1-u]=y)}else{var w=t-+this._x.call(null,f.data),N=e-+this._y.call(null,f.data),m=w*w+N*N;if(m<n){var z=Math.sqrt(n=m);r=t-z,s=e-z,d=t+z,C=e+z,i=f.data}}return i}function fn(t){if(isNaN(d=+this._x.call(null,t))||isNaN(C=+this._y.call(null,t)))return this;var e,n=this._root,i,r,s,c=this._x0,o=this._y0,h=this._x1,a=this._y1,d,C,x,f,y,u,l,g;if(!n)return this;if(n.length)for(;;){if((y=d>=(x=(c+h)/2))?c=x:h=x,(u=C>=(f=(o+a)/2))?o=f:a=f,e=n,!(n=n[l=u<<1|y]))return this;if(!n.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(i=e,g=l)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):e?(s?e[l]=s:delete e[l],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[g]=n:this._root=n),this):(this._root=s,this)}function un(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function hn(){return this._root}function dn(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function gn(t){var e=[],n,i=this._root,r,s,c,o,h;for(i&&e.push(new at(i,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(i=n.node,s=n.x0,c=n.y0,o=n.x1,h=n.y1)&&i.length){var a=(s+o)/2,d=(c+h)/2;(r=i[3])&&e.push(new at(r,a,d,o,h)),(r=i[2])&&e.push(new at(r,s,d,a,h)),(r=i[1])&&e.push(new at(r,a,c,o,d)),(r=i[0])&&e.push(new at(r,s,c,a,d))}return this}function vn(t){var e=[],n=[],i;for(this._root&&e.push(new at(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var r=i.node;if(r.length){var s,c=i.x0,o=i.y0,h=i.x1,a=i.y1,d=(c+h)/2,C=(o+a)/2;(s=r[0])&&e.push(new at(s,c,o,d,C)),(s=r[1])&&e.push(new at(s,d,o,h,C)),(s=r[2])&&e.push(new at(s,c,C,d,a)),(s=r[3])&&e.push(new at(s,d,C,h,a))}n.push(i)}for(;i=n.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function pn(t){return t[0]}function yn(t){return arguments.length?(this._x=t,this):this._x}function xn(t){return t[1]}function mn(t){return arguments.length?(this._y=t,this):this._y}function fe(t,e,n){var i=new ue(e??pn,n??xn,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function ue(t,e,n,i,r,s){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function ge(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var lt=fe.prototype=ue.prototype;lt.copy=function(){var t=new ue(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,i;if(!e)return t;if(!e.length)return t._root=ge(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(i=e.source[r])&&(i.length?n.push({source:i,target:e.target[r]=new Array(4)}):e.target[r]=ge(i));return t};lt.add=rn;lt.addAll=on;lt.cover=an;lt.data=sn;lt.extent=ln;lt.find=cn;lt.remove=fn;lt.removeAll=un;lt.root=hn;lt.size=dn;lt.visit=gn;lt.visitAfter=vn;lt.x=yn;lt.y=mn;function st(t){return function(){return t}}function yt(t){return(t()-.5)*1e-6}function wn(t){return t.x+t.vx}function _n(t){return t.y+t.vy}function ve(t){var e,n,i,r=1,s=1;typeof t!="function"&&(t=st(t==null?1:+t));function c(){for(var a,d=e.length,C,x,f,y,u,l,g=0;g<s;++g)for(C=fe(e,wn,_n).visitAfter(o),a=0;a<d;++a)x=e[a],u=n[x.index],l=u*u,f=x.x+x.vx,y=x.y+x.vy,C.visit(w);function w(N,m,z,P,j){var B=N.data,J=N.r,$=u+J;if(B){if(B.index>x.index){var ct=f-B.x-B.vx,Q=y-B.y-B.vy,rt=ct*ct+Q*Q;rt<$*$&&(ct===0&&(ct=yt(i),rt+=ct*ct),Q===0&&(Q=yt(i),rt+=Q*Q),rt=($-(rt=Math.sqrt(rt)))/rt*r,x.vx+=(ct*=rt)*($=(J*=J)/(l+J)),x.vy+=(Q*=rt)*$,B.vx-=ct*($=1-$),B.vy-=Q*$)}return}return m>f+$||P<f-$||z>y+$||j<y-$}}function o(a){if(a.data)return a.r=n[a.data.index];for(var d=a.r=0;d<4;++d)a[d]&&a[d].r>a.r&&(a.r=a[d].r)}function h(){if(e){var a,d=e.length,C;for(n=new Array(d),a=0;a<d;++a)C=e[a],n[C.index]=+t(C,a,e)}}return c.initialize=function(a,d){e=a,i=d,h()},c.iterations=function(a){return arguments.length?(s=+a,c):s},c.strength=function(a){return arguments.length?(r=+a,c):r},c.radius=function(a){return arguments.length?(t=typeof a=="function"?a:st(+a),h(),c):t},c}function bn(t){return t.index}function pe(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function ye(t){var e=bn,n=C,i,r=st(30),s,c,o,h,a,d=1;t==null&&(t=[]);function C(l){return 1/Math.min(o[l.source.index],o[l.target.index])}function x(l){for(var g=0,w=t.length;g<d;++g)for(var N=0,m,z,P,j,B,J,$;N<w;++N)m=t[N],z=m.source,P=m.target,j=P.x+P.vx-z.x-z.vx||yt(a),B=P.y+P.vy-z.y-z.vy||yt(a),J=Math.sqrt(j*j+B*B),J=(J-s[N])/J*l*i[N],j*=J,B*=J,P.vx-=j*($=h[N]),P.vy-=B*$,z.vx+=j*($=1-$),z.vy+=B*$}function f(){if(c){var l,g=c.length,w=t.length,N=new Map(c.map((z,P)=>[e(z,P,c),z])),m;for(l=0,o=new Array(g);l<w;++l)m=t[l],m.index=l,typeof m.source!="object"&&(m.source=pe(N,m.source)),typeof m.target!="object"&&(m.target=pe(N,m.target)),o[m.source.index]=(o[m.source.index]||0)+1,o[m.target.index]=(o[m.target.index]||0)+1;for(l=0,h=new Array(w);l<w;++l)m=t[l],h[l]=o[m.source.index]/(o[m.source.index]+o[m.target.index]);i=new Array(w),y(),s=new Array(w),u()}}function y(){if(c)for(var l=0,g=t.length;l<g;++l)i[l]=+n(t[l],l,t)}function u(){if(c)for(var l=0,g=t.length;l<g;++l)s[l]=+r(t[l],l,t)}return x.initialize=function(l,g){c=l,a=g,f()},x.links=function(l){return arguments.length?(t=l,f(),x):t},x.id=function(l){return arguments.length?(e=l,x):e},x.iterations=function(l){return arguments.length?(d=+l,x):d},x.strength=function(l){return arguments.length?(n=typeof l=="function"?l:st(+l),y(),x):n},x.distance=function(l){return arguments.length?(r=typeof l=="function"?l:st(+l),u(),x):r},x}var Mn={value:()=>{}};function Ee(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Wt(n)}function Wt(t){this._=t}function Tn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Wt.prototype=Ee.prototype={constructor:Wt,on:function(t,e){var n=this._,i=Tn(t+"",n),r,s=-1,c=i.length;if(arguments.length<2){for(;++s<c;)if((r=(t=i[s]).type)&&(r=In(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<c;)if(r=(t=i[s]).type)n[r]=xe(n[r],t.name,e);else if(e==null)for(r in n)n[r]=xe(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Wt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],i=0,r=s.length;i<r;++i)s[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};function In(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function xe(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Mn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var Pt=0,kt=0,St=0,Re=1e3,$t,Et,jt=0,Mt=0,Ut=0,Lt=typeof performance=="object"&&performance.now?performance:Date,Le=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xe(){return Mt||(Le(Cn),Mt=Lt.now()+Ut)}function Cn(){Mt=0}function re(){this._call=this._time=this._next=null}re.prototype=Fe.prototype={constructor:re,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Xe():+n)+(e==null?0:+e),!this._next&&Et!==this&&(Et?Et._next=this:$t=this,Et=this),this._call=t,this._time=n,oe()},stop:function(){this._call&&(this._call=null,this._time=1/0,oe())}};function Fe(t,e,n){var i=new re;return i.restart(t,e,n),i}function Dn(){Xe(),++Pt;for(var t=$t,e;t;)(e=Mt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Pt}function me(){Mt=(jt=Lt.now())+Ut,Pt=kt=0;try{Dn()}finally{Pt=0,An(),Mt=0}}function Nn(){var t=Lt.now(),e=t-jt;e>Re&&(Ut-=e,jt=t)}function An(){for(var t,e=$t,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:$t=n);Et=t,oe(i)}function oe(t){if(!Pt){kt&&(kt=clearTimeout(kt));var e=t-Mt;e>24?(t<1/0&&(kt=setTimeout(me,t-Lt.now()-Ut)),St&&(St=clearInterval(St))):(St||(jt=Lt.now(),St=setInterval(Nn,Re)),Pt=1,Le(me))}}const zn=1664525,Pn=1013904223,we=4294967296;function Sn(){let t=1;return()=>(t=(zn*t+Pn)%we)/we}function kn(t){return t.x}function En(t){return t.y}var Rn=10,Ln=Math.PI*(3-Math.sqrt(5));function _e(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,c=.6,o=new Map,h=Fe(C),a=Ee("tick","end"),d=Sn();t==null&&(t=[]);function C(){x(),a.call("tick",e),n<i&&(h.stop(),a.call("end",e))}function x(u){var l,g=t.length,w;u===void 0&&(u=1);for(var N=0;N<u;++N)for(n+=(s-n)*r,o.forEach(function(m){m(n)}),l=0;l<g;++l)w=t[l],w.fx==null?w.x+=w.vx*=c:(w.x=w.fx,w.vx=0),w.fy==null?w.y+=w.vy*=c:(w.y=w.fy,w.vy=0);return e}function f(){for(var u=0,l=t.length,g;u<l;++u){if(g=t[u],g.index=u,g.fx!=null&&(g.x=g.fx),g.fy!=null&&(g.y=g.fy),isNaN(g.x)||isNaN(g.y)){var w=Rn*Math.sqrt(.5+u),N=u*Ln;g.x=w*Math.cos(N),g.y=w*Math.sin(N)}(isNaN(g.vx)||isNaN(g.vy))&&(g.vx=g.vy=0)}}function y(u){return u.initialize&&u.initialize(t,d),u}return f(),e={tick:x,restart:function(){return h.restart(C),e},stop:function(){return h.stop(),e},nodes:function(u){return arguments.length?(t=u,f(),o.forEach(y),e):t},alpha:function(u){return arguments.length?(n=+u,e):n},alphaMin:function(u){return arguments.length?(i=+u,e):i},alphaDecay:function(u){return arguments.length?(r=+u,e):+r},alphaTarget:function(u){return arguments.length?(s=+u,e):s},velocityDecay:function(u){return arguments.length?(c=1-u,e):1-c},randomSource:function(u){return arguments.length?(d=u,o.forEach(y),e):d},force:function(u,l){return arguments.length>1?(l==null?o.delete(u):o.set(u,y(l)),e):o.get(u)},find:function(u,l,g){var w=0,N=t.length,m,z,P,j,B;for(g==null?g=1/0:g*=g,w=0;w<N;++w)j=t[w],m=u-j.x,z=l-j.y,P=m*m+z*z,P<g&&(B=j,g=P);return B},on:function(u,l){return arguments.length>1?(a.on(u,l),e):a.on(u)}}}function be(){var t,e,n,i,r=st(-30),s,c=1,o=1/0,h=.81;function a(f){var y,u=t.length,l=fe(t,kn,En).visitAfter(C);for(i=f,y=0;y<u;++y)e=t[y],l.visit(x)}function d(){if(t){var f,y=t.length,u;for(s=new Array(y),f=0;f<y;++f)u=t[f],s[u.index]=+r(u,f,t)}}function C(f){var y=0,u,l,g=0,w,N,m;if(f.length){for(w=N=m=0;m<4;++m)(u=f[m])&&(l=Math.abs(u.value))&&(y+=u.value,g+=l,w+=l*u.x,N+=l*u.y);f.x=w/g,f.y=N/g}else{u=f,u.x=u.data.x,u.y=u.data.y;do y+=s[u.data.index];while(u=u.next)}f.value=y}function x(f,y,u,l){if(!f.value)return!0;var g=f.x-e.x,w=f.y-e.y,N=l-y,m=g*g+w*w;if(N*N/h<m)return m<o&&(g===0&&(g=yt(n),m+=g*g),w===0&&(w=yt(n),m+=w*w),m<c&&(m=Math.sqrt(c*m)),e.vx+=g*f.value*i/m,e.vy+=w*f.value*i/m),!0;if(f.length||m>=o)return;(f.data!==e||f.next)&&(g===0&&(g=yt(n),m+=g*g),w===0&&(w=yt(n),m+=w*w),m<c&&(m=Math.sqrt(c*m)));do f.data!==e&&(N=s[f.data.index]*i/m,e.vx+=g*N,e.vy+=w*N);while(f=f.next)}return a.initialize=function(f,y){t=f,n=y,d()},a.strength=function(f){return arguments.length?(r=typeof f=="function"?f:st(+f),d(),a):r},a.distanceMin=function(f){return arguments.length?(c=f*f,a):Math.sqrt(c)},a.distanceMax=function(f){return arguments.length?(o=f*f,a):Math.sqrt(o)},a.theta=function(f){return arguments.length?(h=f*f,a):Math.sqrt(h)},a}function Me(t){var e=st(.1),n,i,r;typeof t!="function"&&(t=st(t==null?0:+t));function s(o){for(var h=0,a=n.length,d;h<a;++h)d=n[h],d.vx+=(r[h]-d.x)*i[h]*o}function c(){if(n){var o,h=n.length;for(i=new Array(h),r=new Array(h),o=0;o<h;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return s.initialize=function(o){n=o,c()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:st(+o),c(),s):e},s.x=function(o){return arguments.length?(t=typeof o=="function"?o:st(+o),c(),s):t},s}function Te(t){var e=st(.1),n,i,r;typeof t!="function"&&(t=st(t==null?0:+t));function s(o){for(var h=0,a=n.length,d;h<a;++h)d=n[h],d.vy+=(r[h]-d.y)*i[h]*o}function c(){if(n){var o,h=n.length;for(i=new Array(h),r=new Array(h),o=0;o<h;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return s.initialize=function(o){n=o,c()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:st(+o),c(),s):e},s.y=function(o){return arguments.length?(t=typeof o=="function"?o:st(+o),c(),s):t},s}var Xn=Tt('<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>'),Fn=Tt('<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><div class="legend-panel svelte-1i33fky"></div></div></div>');function On(t,e){se(e,!0);let n=Gt(e,"selectedEntityId",3,null),i=Gt(e,"filteredIds",3,null),r=Gt(e,"sidebarHoveredId",3,null),s=Gt(e,"highlightedIds",3,null);function c(v){return e.nameMap?.get(v)??v.replace(/-/g," ").replace(/\b\w/g,_=>_.toUpperCase())}const o=Ce("theme"),h=et(()=>o.current==="light"?{default:14211288,dim:15263976,conn:12632256,labelText:1710623}:{default:2763306,dim:1315860,conn:4210752,labelText:15592943}),a=et(()=>o.current==="light"?16316666:592139),d=.75;Nt(()=>{o.current,K&&(K.style.fill=p(h).labelText);const v=p(Bt);for(const _ of y)_t(_.type)===Ct&&(_.color=v);tt()}),Nt(()=>{i(),tt()}),Nt(()=>{s(),tt()}),Nt(()=>{n(),tt()});let C=!1;Nt(()=>{const v=e.graphData;if(!Z||!D||!R)return;if(!C){C=!0;return}const _=new Map;for(const T of v.edges)_.set(T.source,(_.get(T.source)??0)+1),_.set(T.target,(_.get(T.target)??0)+1);const b=new Map;for(const T of y)b.set(T.id,{x:T.x,y:T.y});const G=3600*v.nodes.length,Y=Math.sqrt(G),O=v.nodes.map(T=>{const W=_.get(T.id)??0,ht=b.get(T.id);return{id:T.id,type:T.type,repo:T.repo,color:_t(T.type)===Ct?p(Bt):_t(T.type),weight:W,x:ht?.x??(Math.random()-.5)*Y,y:ht?.y??(Math.random()-.5)*Y,vx:0,vy:0,r:It(W)}}),V=new Map;for(const T of O)V.set(T.id,T);const nt=new Set(L.keys()),ft=new Set(v.nodes.map(T=>T.id));for(const T of nt)if(!ft.has(T)){const W=L.get(T);W&&(R.removeChild(W),W.destroy()),L.delete(T)}let F=null;if(L.size>0&&(F=L.values().next().value?.texture),!F){const T=document.createElement("canvas");T.width=100,T.height=100;const W=T.getContext("2d");W.beginPath(),W.arc(50,50,48,0,Math.PI*2),W.fillStyle="#ffffff",W.fill(),F=Z.Texture.from(T)}for(const T of O){let W=L.get(T.id);W||(W=new Z.Sprite(F),W.anchor.set(.5),R.addChild(W),L.set(T.id,W)),W.tint=Ft(T.color)}y=O,f?.stop();const vt=v.edges.map(T=>({source:T.source,target:T.target})),X=ye(vt).id(T=>T.id).distance(250);f=_e(y).force("link",X).force("charge",be().strength(-1e3).distanceMin(30)).force("x",Me(0).strength(.1)).force("y",Te(0).strength(.1)).force("collide",ve().radius(60).strength(.5)).velocityDecay(.4).alpha(.3).on("tick",()=>{rt||Vt(),tt()}),u=X.links(),z=null,Xt(),tt()}),Nt(()=>{const v=r();if(v){const _=y.find(b=>b.id===v)??null;z=_,Xt(),M=_?1:0}else P||(M=0);tt()});let x,f=null,y=[],u=[],l=!1,g=0,w=0,N=0,m=1,z=null,P=null,j=pt(!1),B=0,J=0,$=0,ct=0,Q=new Set,rt=!1,xt=pt(null),I=0,M=0;const E=4;let D=null,S=null,U=null,R=null,L=new Map,H=null,K=null,Z=null;function It(v){return Math.max(3,Math.min(Math.sqrt(v+1)+2,10))}function Ht(v,_){const b=x.getBoundingClientRect();return{x:(v-b.left-w)/m,y:(_-b.top-N)/m}}function he(v,_){for(let b=y.length-1;b>=0;b--){const k=y[b],G=v-k.x,Y=_-k.y,O=(k.r*1.5+4)/m;if(G*G+Y*Y<=O*O)return k}return null}function Xt(){const v=z??null;if(Q.clear(),!!v){Q.add(v.id);for(const _ of u)_.source.id===v.id&&Q.add(_.target.id),_.target.id===v.id&&Q.add(_.source.id);if(R){const _=L.get(v.id);_&&R.setChildIndex(_,R.children.length-1)}}}function Vt(){if(y.length===0||!x)return;let v=1/0,_=-1/0,b=1/0,k=-1/0,G=0;for(const F of y)F.x<v&&(v=F.x),F.x>_&&(_=F.x),F.y<b&&(b=F.y),F.y>k&&(k=F.y),F.r>G&&(G=F.r);const Y=x.clientWidth,O=x.clientHeight,V=_-v,nt=k-b;if(V===0||nt===0)return;const ft=(60+G)*2;m=Math.min((Y-ft)/V,(O-ft)/nt,3),w=Y/2-(v+_)/2*m,N=O/2-(b+k)/2*m,tt()}function tt(){l=!0,g=0}function Ft(v){return parseInt(v.replace("#",""),16)}function mt(v,_,b){const k=(v>>16&255)+b*((_>>16&255)-(v>>16&255)),G=(v>>8&255)+b*((_>>8&255)-(v>>8&255)),Y=(v&255)+b*((_&255)-(v&255));return Math.round(k)<<16|Math.round(G)<<8|Math.round(Y)}function Oe(){if(!Z||!S||!U)return;S.clear(),U.clear();const _=z!==null,b=I,k=p(xt),G=s(),Y=i(),O=p(h).default,V=p(h).dim,nt=p(h).conn;for(let ft=0;ft<u.length;ft++){const F=u[ft],vt=F.source.x*m+w,X=F.source.y*m+N,T=F.target.x*m+w,W=F.target.y*m+N,ht=_&&b>.01&&Q.has(F.source.id)&&Q.has(F.target.id);let A=O;_&&b>.01?A=ht?mt(O,nt,b):mt(O,V,b):(k!==null||G!==null||Y!==null)&&(A=V);const q=ht?U:S,Dt=ht?1:.2;q.setStrokeStyle({width:1,color:A,alpha:Dt}),q.moveTo(vt,X),q.lineTo(T,W),q.stroke()}}function Be(){if(!Z)return;const v=z,_=v!==null,b=I,k=p(xt),G=s(),Y=i(),O=!v&&n()?y.find(X=>X.id===n())??null:null,V=new Set;if(O){V.add(O.id);for(const X of u)X.source.id===O.id&&V.add(X.target.id),X.target.id===O.id&&V.add(X.source.id)}for(const X of y){const T=L.get(X.id);if(!T)continue;const W=X.x*m+w,ht=X.y*m+N;T.position.set(W,ht),T.scale.set(X.r/50),T.alpha=1;const A=Ft(X.color);if(O&&!v){const q=V.has(X.id);T.tint=q?A:mt(A,p(a),d)}else{const q=X===v,Dt=_&&Q.has(X.id),je=k!==null&&(k==="other"?_t(X.type)===Ct:X.type===k);if(q&&b>.01)T.tint=A,T.scale.set(X.r*(1+b*.4)/50);else if(Dt)T.tint=A;else if(k!==null)T.tint=je?A:mt(A,p(a),d);else if(G!==null){const Jt=G.has(X.id)?b*d:d;T.tint=mt(A,p(a),Jt)}else if(Y!==null){const Jt=Y.has(X.id)?b*d:d;T.tint=mt(A,p(a),Jt)}else T.tint=mt(A,p(a),b*d)}}const nt=v??O,ft=v?b>.01:!!O;if(nt&&ft&&H){H.visible=!0;const X=nt.x*m+w,T=nt.y*m+N;H.position.set(X,T),H.scale.set(nt.r*5/64),H.alpha=v?b*.25:.25,H.tint=Ft(nt.color)}else H&&(H.visible=!1);const F=v??O,vt=v?b>.01:!!O;if(F&&vt&&K){const X=F.x*m+w,T=F.y*m+N;K.text=c(F.id),K.style.fontSize=12,K.position.set(X,T+F.r+8),K.alpha=v?b:1,K.visible=!0}else K&&(K.visible=!1)}let Ot=!1;function Ge(v){if(v.button!==0)return;Ot=!1;const _=Ht(v.clientX,v.clientY),b=he(_.x,_.y);b?(P=b,rt=!0,b.fx=b.x,b.fy=b.y,f?.alphaTarget(.3).restart(),tt()):(ot(j,!0),B=v.clientX,J=v.clientY,$=w,ct=N),x.setPointerCapture(v.pointerId),window.addEventListener("pointerup",Kt,{once:!0})}function Ye(v){if(P){Ot=!0;const _=Ht(v.clientX,v.clientY);P.fx=_.x,P.fy=_.y,tt()}else if(p(j))Ot=!0,w=$+(v.clientX-B),N=ct+(v.clientY-J),tt();else{const _=Ht(v.clientX,v.clientY),b=he(_.x,_.y);b?b!==z?(z&&(I=.15),z=b,Xt(),M=1,x.style.cursor="pointer",tt()):M!==1&&(M=1,x.style.cursor="pointer",tt()):M!==0&&(M=0,x.style.cursor="grab",tt())}}function Kt(v){if(!P&&!p(j))return;window.removeEventListener("pointerup",Kt);const _=Ot;if(P){const b=P;P.fx=null,P.fy=null,f?.alphaTarget(0),P=null,M=0,tt(),_||nn(`/${b.repo}/${b.type}/${b.id}`)}else p(j)&&ot(j,!1);try{x.releasePointerCapture(v.pointerId)}catch{}}const Ct="#5c5c66",We="#b0b0b8",Bt=et(()=>o.current==="light"?We:Ct),$e=et(()=>{const v=new Map;for(const k of e.graphData.nodes)v.set(k.type,(v.get(k.type)??0)+1);const _=[];let b=0;for(const[k,G]of v){const Y=_t(k);Y===Ct?b+=G:_.push({name:k,color:Y,count:G})}return _.sort((k,G)=>G.count-k.count),b>0&&_.push({name:"other",color:p(Bt),count:b}),_});De(async()=>{Z=await Ze(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url),D=new Z.Application,await D.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:x}),x.insertBefore(D.canvas,x.firstChild),D.canvas.style.position="absolute",D.canvas.style.inset="0",S=new Z.Graphics,D.stage.addChild(S),U=new Z.Graphics,D.stage.addChild(U),R=new Z.Container,D.stage.addChild(R);const v=document.createElement("canvas");v.width=128,v.height=128;const _=v.getContext("2d"),b=_.createRadialGradient(64,64,0,64,64,64);b.addColorStop(0,"rgba(255,255,255,0.5)"),b.addColorStop(1,"rgba(255,255,255,0)"),_.fillStyle=b,_.fillRect(0,0,128,128);const k=Z.Texture.from(v);H=new Z.Sprite(k),H.anchor.set(.5),H.visible=!1,D.stage.addChild(H);const G=document.createElement("canvas");G.width=100,G.height=100;const Y=G.getContext("2d");Y.beginPath(),Y.arc(50,50,48,0,Math.PI*2),Y.fillStyle="#ffffff",Y.fill();const O=Z.Texture.from(G),V=new Map;for(const A of e.graphData.edges)V.set(A.source,(V.get(A.source)??0)+1),V.set(A.target,(V.get(A.target)??0)+1);const nt=new Map,F=3600*e.graphData.nodes.length,vt=Math.sqrt(F);y=e.graphData.nodes.map(A=>{const q=V.get(A.id)??0,Dt={id:A.id,type:A.type,repo:A.repo,color:_t(A.type)===Ct?p(Bt):_t(A.type),weight:q,x:(Math.random()-.5)*vt,y:(Math.random()-.5)*vt,vx:0,vy:0,r:It(q)};return nt.set(A.id,Dt),Dt});for(const A of y){const q=new Z.Sprite(O);q.anchor.set(.5),q.tint=Ft(A.color),R.addChild(q),L.set(A.id,q)}K=new Z.Text({text:"",style:{fontFamily:"Inter, system-ui, sans-serif",fontWeight:"500",fontSize:12,fill:p(h).labelText,align:"center"}}),K.anchor.set(.5,0),K.visible=!1,D.stage.addChild(K);const X=e.graphData.edges.map(A=>({source:A.source,target:A.target})),T=ye(X).id(A=>A.id).distance(250);f=_e(y).force("link",T).force("charge",be().strength(-1e3).distanceMin(30)).force("x",Me(0).strength(.1)).force("y",Te(0).strength(.1)).force("collide",ve().radius(60).strength(.5)).velocityDecay(.4).alpha(1).on("tick",()=>{rt||Vt(),tt()}),u=T.links();let W=0;D.ticker.add(()=>{const A=performance.now(),q=W?Math.min((A-W)/1e3,.05):.016;W=A,I<M?(I=Math.min(M,I+E*q),l=!0):I>M&&(I=Math.max(M,I-E*q),l=!0),I===0&&M===0&&z&&!P&&(z=null,Xt(),l=!0),(l||g<120)&&(Oe(),Be(),l=!1,g++)});const ht=new ResizeObserver(()=>{D.renderer.resize(x.clientWidth,x.clientHeight),Vt()});return ht.observe(x),()=>{ht.disconnect()}}),He(()=>{f?.stop(),D&&(D.destroy(!0,{children:!0}),D=null)});var Qt=Fn(),wt=ut(Qt);let de;var qt=ut(wt);ne(qt,21,()=>p($e),ie,(v,_)=>{var b=Xn();let k;var G=ut(b);let Y;var O=dt(G,2),V=ut(O,!0);it(O);var nt=dt(O,2),ft=ut(nt,!0);it(nt),it(b),At(()=>{k=tn(b,1,"legend-item svelte-1i33fky",null,k,{"legend-item-active":p(xt)===p(_).name}),Y=zt(G,"",Y,{background:p(_).color}),Rt(V,p(_).name),Rt(ft,p(_).count)}),te("mouseenter",b,()=>{ot(xt,p(_).name,!0),tt()}),te("mouseleave",b,()=>{ot(xt,null),tt()}),gt(v,b)}),it(qt),it(wt),Ne(wt,v=>x=v,()=>x),it(Qt),At(()=>de=zt(wt,"",de,{cursor:p(j)?"grabbing":"grab"})),bt("pointerdown",wt,Ge),bt("pointermove",wt,Ye),bt("pointerup",wt,Kt),bt("pointerdown",qt,v=>v.stopPropagation()),gt(t,Qt),le()}Ie(["pointerdown","pointermove","pointerup"]);function Bn(t,e){const n=Ae(e,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]];Pe(t,ze({name:"play"},()=>n,{get iconNode(){return i},children:(r,s)=>{var c=ae(),o=ce(c);Se(o,e,"default",{}),gt(r,c)},$$slots:{default:!0}}))}function Gn(t,e){const n=Ae(e,["children","$$slots","$$events","$$legacy"]);const i=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"}]];Pe(t,ze({name:"pause"},()=>n,{get iconNode(){return i},children:(r,s)=>{var c=ae(),o=ce(c);Se(o,e,"default",{}),gt(r,c)},$$slots:{default:!0}}))}var Yn=Tt('<div class="density-bar svelte-lzvab"></div>'),Wn=Tt('<span class="date-label svelte-lzvab"> </span>'),$n=Tt('<div class="timeline-tooltip svelte-lzvab"><div class="tooltip-date svelte-lzvab"> </div> <div class="tooltip-count svelte-lzvab"> </div></div>'),jn=Tt('<div class="timeline-bar svelte-lzvab"><!> <div class="timeline-track svelte-lzvab"><div class="track-line svelte-lzvab"></div> <div class="density-bars svelte-lzvab"></div> <div class="playhead svelte-lzvab"></div> <div class="date-labels svelte-lzvab"></div> <!></div></div>');function Un(t,e){se(e,!0);let n=pt(null),i=pt(0),r=pt(!1),s=pt(!1),c=pt(null),o=null;const h=et(()=>{let I=1/0,M=-1/0;for(const E of e.entities){const D=E.createdAt?new Date(E.createdAt).getTime():0;D>0&&D<I&&(I=D),D>M&&(M=D)}return I===1/0&&(I=Date.now()),M===-1/0&&(M=Date.now()),{min:I,max:M}}),a=et(()=>{let{min:I,max:M}=p(h);return M-I<864e5&&(I-=864e5*15,M+=864e5*15),{min:new Date(I),max:new Date(M)}}),d=et(()=>{const M=p(a).min.getTime(),E=p(a).max.getTime(),D=new Map;for(const S of e.entities){const U=S.createdAt?new Date(S.createdAt).getTime():0;if(U<=0)continue;const R=Math.floor((U-M)/864e5),L=M+R*864e5,H=D.get(L)??[];H.push(S),D.set(L,H)}return{map:D,minTime:M,maxTime:E,dayMs:864e5}}),C=et(()=>{let I=0;for(const M of p(d).map.values())M.length>I&&(I=M.length);return Math.max(1,I)}),x=et(()=>{const{minTime:I,maxTime:M}=p(d),E=M-I,D=[],S=Math.max(4,Math.min(8,Math.floor(p(i)/100))),U=E/S;for(let R=0;R<=S;R++){const L=I+R*U,K=new Date(L).toLocaleDateString("en-US",{month:"short",day:"numeric"});D.push({label:K,x:R/S})}return D}),f=et(()=>{const{minTime:I,maxTime:M}=p(d),E=M-I;if(E<=0)return .5;const D=e.currentDate?e.currentDate.getTime():p(h).max,S=Math.max(p(h).min,Math.min(p(h).max,D));return Math.max(0,Math.min(1,(S-I)/E))});function y(I){if(!p(n))return new Date;const M=p(n).getBoundingClientRect(),E=40,S=M.width-E-12,U=Math.max(0,Math.min(1,(I-M.left-E)/S)),{minTime:R,maxTime:L}=p(d),H=R+U*(L-R);return new Date(Math.max(p(h).min,Math.min(p(h).max,H)))}function u(I){ot(r,!0),z();const M=y(I.clientX);e.onDateChange(M),I.target.setPointerCapture(I.pointerId)}function l(I){if(p(r)&&e.onDateChange(y(I.clientX)),!p(n))return;const M=p(n).getBoundingClientRect(),E=40,S=M.width-E-12,U=(I.clientX-M.left-E)/S;if(U<0||U>1){ot(c,null);return}const{minTime:R,dayMs:L,map:H}=p(d),K=R+U*(p(d).maxTime-R),Z=R+Math.floor((K-R)/L)*L,It=H.get(Z);It&&It.length>0?ot(c,{date:new Date(Z),count:It.length,x:I.clientX-M.left},!0):ot(c,null)}function g(){ot(r,!1)}function w(){ot(c,null)}function N(){p(s)?z():m()}function m(){ot(s,!0);const{min:I,max:M}=p(h),D=(M-I)/200;let S=e.currentDate?.getTime()??I;S>=M&&(S=I),o=setInterval(()=>{if(S+=D,S>=M){e.onDateChange(null),z();return}e.onDateChange(new Date(S))},50)}function z(){ot(s,!1),o&&(clearInterval(o),o=null)}De(()=>{if(p(n)){const I=new ResizeObserver(M=>{ot(i,M[0]?.contentRect.width??0,!0)});return I.observe(p(n)),()=>I.disconnect()}});var P=jn(),j=ut(P);{let I=et(()=>p(s)?"Pause":"Play");en(j,{variant:"ghost",size:"icon",class:"play-btn",onclick:N,get title(){return p(I)},children:(M,E)=>{var D=ae(),S=ce(D);{var U=L=>{Gn(L,{size:14})},R=L=>{Bn(L,{size:14})};ee(S,L=>{p(s)?L(U):L(R,!1)})}gt(M,D)},$$slots:{default:!0}})}var B=dt(j,2),J=dt(ut(B),2);ne(J,21,()=>Array.from(p(d).map.entries()),ie,(I,M)=>{var E=et(()=>Ve(p(M),2));let D=()=>p(E)[0],S=()=>p(E)[1];const U=et(()=>(D()-p(d).minTime)/(p(d).maxTime-p(d).minTime)),R=et(()=>S().length/p(C)),L=et(()=>.05+.95*p(R)*p(R));var H=Yn();let K;At(()=>K=zt(H,"",K,{left:`${p(U)*100}%`,opacity:p(L)})),gt(I,H)}),it(J);var $=dt(J,2);let ct;var Q=dt($,2);ne(Q,21,()=>p(x),ie,(I,M)=>{var E=Wn();let D;var S=ut(E,!0);it(E),At(()=>{D=zt(E,"",D,{left:`${p(M).x*100}%`}),Rt(S,p(M).label)}),gt(I,E)}),it(Q);var rt=dt(Q,2);{var xt=I=>{var M=$n();let E;var D=ut(M),S=ut(D,!0);it(D);var U=dt(D,2),R=ut(U);it(U),it(M),At(L=>{E=zt(M,"",E,{left:`${p(c).x??""}px`}),Rt(S,L),Rt(R,`${p(c).count??""} ${p(c).count===1?"entity":"entities"}`)},[()=>p(c).date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]),gt(I,M)};ee(rt,I=>{p(c)&&!p(r)&&I(xt)})}it(B),it(P),Ne(P,I=>ot(n,I),()=>p(n)),At(()=>ct=zt($,"",ct,{left:`${p(f)*100}%`})),bt("pointerdown",B,u),bt("pointermove",B,l),bt("pointerup",B,g),te("pointerleave",B,w),gt(t,P),le()}Ie(["pointerdown","pointermove","pointerup"]);var Hn=Tt('<div class="content-row svelte-315y67"><div class="graph-area svelte-315y67"><!> <!> <!></div> <!></div>');function ri(t,e){se(e,!0);const n=Ce("chat");Zt.showGraph();let i=pt(null);const r=et(()=>{const o=new Map;for(const h of Yt.repos)for(const a of h.entities)o.set(a.id,a.title);return o}),s=et(()=>{const o=[];for(const h of Yt.repos)for(const a of h.entities)a.id.toLowerCase().startsWith("readme")||o.push(a);return o}),c=et(()=>{const o=[],h=[],a=new Set,d=new Set,C=p(i)?.getTime()??1/0;for(const f of Yt.repos)for(const y of f.entities){if(y.id.toLowerCase().startsWith("readme")||a.has(y.id)||(y.createdAt?new Date(y.createdAt).getTime():0)>C)continue;a.add(y.id),o.push({id:y.id,type:y.entityType,repo:f.name});const l=y.wikilinks??[];for(const g of l){const w=y.id<g?`${y.id}|${g}`:`${g}|${y.id}`;!d.has(w)&&y.id!==g&&(d.add(w),h.push({source:y.id,target:g}))}}const x=h.filter(f=>a.has(f.source)&&a.has(f.target));return{nodes:o,edges:x}});Ke(t,{children:(o,h)=>{var a=Hn(),d=ut(a),C=ut(d);Qe(C,{activeView:"graph"});var x=dt(C,2);On(x,{get graphData(){return p(c)},get selectedEntityId(){return Zt.selectedId},get nameMap(){return p(r)},get filteredIds(){return Yt.filteredIds},get sidebarHoveredId(){return Zt.hoveredEntityId},get highlightedIds(){return qe.highlightedIds}});var f=dt(x,2);Un(f,{get entities(){return p(s)},get currentDate(){return p(i)},onDateChange:l=>{ot(i,l,!0)}}),it(d);var y=dt(d,2);{var u=l=>{Je(l,{})};ee(y,l=>{n.open&&l(u)})}it(a),gt(o,a)},$$slots:{default:!0}}),le()}export{ri as component};
|
|
2
|
+
import{d as Ie,b as Mt,a as gt,f as Tt,s as Rt,e as te,c as ae}from"../chunks/CjKjQEMp.js";import{p as se,m as Ce,D as Nt,y as p,V as et,_ as De,ap as He,v as At,n as le,o as ut,q as dt,u as it,x as ot,z as pt,f as ce,bc as Ve}from"../chunks/D-tW7Byc.js";import{p as Gt,b as Ne,l as Ae,s as ze,i as ee}from"../chunks/EhE2EcYu.js";import{y as _t,A as Ke}from"../chunks/Mxe2MMs2.js";import{V as Qe,c as Je,C as Ze}from"../chunks/CiTQ_W2r.js";import{_ as qe}from"../chunks/PPVm8Dsz.js";import{a as ne,i as ie,I as Pe,s as Se,n as qt}from"../chunks/JFkcr2-N.js";import{s as tn,l as zt,B as en,w as Yt}from"../chunks/ByFfmBEu.js";import{g as nn}from"../chunks/DkM5hMeY.js";import"../chunks/eEhMI0BQ.js";function rn(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return ke(this.cover(e,n),e,n,t)}function ke(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,s=t._root,c={data:i},o=t._x0,h=t._y0,a=t._x1,d=t._y1,C,x,f,y,u,l,g,w;if(!s)return t._root=c,t;for(;s.length;)if((u=e>=(C=(o+a)/2))?o=C:a=C,(l=n>=(x=(h+d)/2))?h=x:d=x,r=s,!(s=s[g=l<<1|u]))return r[g]=c,t;if(f=+t._x.call(null,s.data),y=+t._y.call(null,s.data),e===f&&n===y)return c.next=s,r?r[g]=c:t._root=c,t;do r=r?r[g]=new Array(4):t._root=new Array(4),(u=e>=(C=(o+a)/2))?o=C:a=C,(l=n>=(x=(h+d)/2))?h=x:d=x;while((g=l<<1|u)===(w=(y>=x)<<1|f>=C));return r[w]=s,r[g]=c,t}function on(t){var e,n,i=t.length,r,s,c=new Array(i),o=new Array(i),h=1/0,a=1/0,d=-1/0,C=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(s=+this._y.call(null,e))||(c[n]=r,o[n]=s,r<h&&(h=r),r>d&&(d=r),s<a&&(a=s),s>C&&(C=s));if(h>d||a>C)return this;for(this.cover(h,a).cover(d,C),n=0;n<i;++n)ke(this,c[n],o[n],t[n]);return this}function an(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,s=(i=Math.floor(e))+1;else{for(var c=r-n||1,o=this._root,h,a;n>t||t>=r||i>e||e>=s;)switch(a=(e<i)<<1|t<n,h=new Array(4),h[a]=o,o=h,c*=2,a){case 0:r=n+c,s=i+c;break;case 1:n=r-c,s=i+c;break;case 2:r=n+c,i=s-c;break;case 3:n=r-c,i=s-c;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this}function sn(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function ln(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function at(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function cn(t,e,n){var i,r=this._x0,s=this._y0,c,o,h,a,d=this._x1,C=this._y1,x=[],f=this._root,y,u;for(f&&x.push(new at(f,r,s,d,C)),n==null?n=1/0:(r=t-n,s=e-n,d=t+n,C=e+n,n*=n);y=x.pop();)if(!(!(f=y.node)||(c=y.x0)>d||(o=y.y0)>C||(h=y.x1)<r||(a=y.y1)<s))if(f.length){var l=(c+h)/2,g=(o+a)/2;x.push(new at(f[3],l,g,h,a),new at(f[2],c,g,l,a),new at(f[1],l,o,h,g),new at(f[0],c,o,l,g)),(u=(e>=g)<<1|t>=l)&&(y=x[x.length-1],x[x.length-1]=x[x.length-1-u],x[x.length-1-u]=y)}else{var w=t-+this._x.call(null,f.data),N=e-+this._y.call(null,f.data),m=w*w+N*N;if(m<n){var z=Math.sqrt(n=m);r=t-z,s=e-z,d=t+z,C=e+z,i=f.data}}return i}function fn(t){if(isNaN(d=+this._x.call(null,t))||isNaN(C=+this._y.call(null,t)))return this;var e,n=this._root,i,r,s,c=this._x0,o=this._y0,h=this._x1,a=this._y1,d,C,x,f,y,u,l,g;if(!n)return this;if(n.length)for(;;){if((y=d>=(x=(c+h)/2))?c=x:h=x,(u=C>=(f=(o+a)/2))?o=f:a=f,e=n,!(n=n[l=u<<1|y]))return this;if(!n.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(i=e,g=l)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):e?(s?e[l]=s:delete e[l],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[g]=n:this._root=n),this):(this._root=s,this)}function un(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function hn(){return this._root}function dn(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function gn(t){var e=[],n,i=this._root,r,s,c,o,h;for(i&&e.push(new at(i,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(i=n.node,s=n.x0,c=n.y0,o=n.x1,h=n.y1)&&i.length){var a=(s+o)/2,d=(c+h)/2;(r=i[3])&&e.push(new at(r,a,d,o,h)),(r=i[2])&&e.push(new at(r,s,d,a,h)),(r=i[1])&&e.push(new at(r,a,c,o,d)),(r=i[0])&&e.push(new at(r,s,c,a,d))}return this}function vn(t){var e=[],n=[],i;for(this._root&&e.push(new at(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var r=i.node;if(r.length){var s,c=i.x0,o=i.y0,h=i.x1,a=i.y1,d=(c+h)/2,C=(o+a)/2;(s=r[0])&&e.push(new at(s,c,o,d,C)),(s=r[1])&&e.push(new at(s,d,o,h,C)),(s=r[2])&&e.push(new at(s,c,C,d,a)),(s=r[3])&&e.push(new at(s,d,C,h,a))}n.push(i)}for(;i=n.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function pn(t){return t[0]}function yn(t){return arguments.length?(this._x=t,this):this._x}function xn(t){return t[1]}function mn(t){return arguments.length?(this._y=t,this):this._y}function fe(t,e,n){var i=new ue(e??pn,n??xn,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function ue(t,e,n,i,r,s){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function ge(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var lt=fe.prototype=ue.prototype;lt.copy=function(){var t=new ue(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,i;if(!e)return t;if(!e.length)return t._root=ge(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(i=e.source[r])&&(i.length?n.push({source:i,target:e.target[r]=new Array(4)}):e.target[r]=ge(i));return t};lt.add=rn;lt.addAll=on;lt.cover=an;lt.data=sn;lt.extent=ln;lt.find=cn;lt.remove=fn;lt.removeAll=un;lt.root=hn;lt.size=dn;lt.visit=gn;lt.visitAfter=vn;lt.x=yn;lt.y=mn;function st(t){return function(){return t}}function yt(t){return(t()-.5)*1e-6}function wn(t){return t.x+t.vx}function _n(t){return t.y+t.vy}function ve(t){var e,n,i,r=1,s=1;typeof t!="function"&&(t=st(t==null?1:+t));function c(){for(var a,d=e.length,C,x,f,y,u,l,g=0;g<s;++g)for(C=fe(e,wn,_n).visitAfter(o),a=0;a<d;++a)x=e[a],u=n[x.index],l=u*u,f=x.x+x.vx,y=x.y+x.vy,C.visit(w);function w(N,m,z,P,j){var B=N.data,Z=N.r,$=u+Z;if(B){if(B.index>x.index){var ct=f-B.x-B.vx,Q=y-B.y-B.vy,rt=ct*ct+Q*Q;rt<$*$&&(ct===0&&(ct=yt(i),rt+=ct*ct),Q===0&&(Q=yt(i),rt+=Q*Q),rt=($-(rt=Math.sqrt(rt)))/rt*r,x.vx+=(ct*=rt)*($=(Z*=Z)/(l+Z)),x.vy+=(Q*=rt)*$,B.vx-=ct*($=1-$),B.vy-=Q*$)}return}return m>f+$||P<f-$||z>y+$||j<y-$}}function o(a){if(a.data)return a.r=n[a.data.index];for(var d=a.r=0;d<4;++d)a[d]&&a[d].r>a.r&&(a.r=a[d].r)}function h(){if(e){var a,d=e.length,C;for(n=new Array(d),a=0;a<d;++a)C=e[a],n[C.index]=+t(C,a,e)}}return c.initialize=function(a,d){e=a,i=d,h()},c.iterations=function(a){return arguments.length?(s=+a,c):s},c.strength=function(a){return arguments.length?(r=+a,c):r},c.radius=function(a){return arguments.length?(t=typeof a=="function"?a:st(+a),h(),c):t},c}function Mn(t){return t.index}function pe(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function ye(t){var e=Mn,n=C,i,r=st(30),s,c,o,h,a,d=1;t==null&&(t=[]);function C(l){return 1/Math.min(o[l.source.index],o[l.target.index])}function x(l){for(var g=0,w=t.length;g<d;++g)for(var N=0,m,z,P,j,B,Z,$;N<w;++N)m=t[N],z=m.source,P=m.target,j=P.x+P.vx-z.x-z.vx||yt(a),B=P.y+P.vy-z.y-z.vy||yt(a),Z=Math.sqrt(j*j+B*B),Z=(Z-s[N])/Z*l*i[N],j*=Z,B*=Z,P.vx-=j*($=h[N]),P.vy-=B*$,z.vx+=j*($=1-$),z.vy+=B*$}function f(){if(c){var l,g=c.length,w=t.length,N=new Map(c.map((z,P)=>[e(z,P,c),z])),m;for(l=0,o=new Array(g);l<w;++l)m=t[l],m.index=l,typeof m.source!="object"&&(m.source=pe(N,m.source)),typeof m.target!="object"&&(m.target=pe(N,m.target)),o[m.source.index]=(o[m.source.index]||0)+1,o[m.target.index]=(o[m.target.index]||0)+1;for(l=0,h=new Array(w);l<w;++l)m=t[l],h[l]=o[m.source.index]/(o[m.source.index]+o[m.target.index]);i=new Array(w),y(),s=new Array(w),u()}}function y(){if(c)for(var l=0,g=t.length;l<g;++l)i[l]=+n(t[l],l,t)}function u(){if(c)for(var l=0,g=t.length;l<g;++l)s[l]=+r(t[l],l,t)}return x.initialize=function(l,g){c=l,a=g,f()},x.links=function(l){return arguments.length?(t=l,f(),x):t},x.id=function(l){return arguments.length?(e=l,x):e},x.iterations=function(l){return arguments.length?(d=+l,x):d},x.strength=function(l){return arguments.length?(n=typeof l=="function"?l:st(+l),y(),x):n},x.distance=function(l){return arguments.length?(r=typeof l=="function"?l:st(+l),u(),x):r},x}var bn={value:()=>{}};function Ee(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Wt(n)}function Wt(t){this._=t}function Tn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Wt.prototype=Ee.prototype={constructor:Wt,on:function(t,e){var n=this._,i=Tn(t+"",n),r,s=-1,c=i.length;if(arguments.length<2){for(;++s<c;)if((r=(t=i[s]).type)&&(r=In(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<c;)if(r=(t=i[s]).type)n[r]=xe(n[r],t.name,e);else if(e==null)for(r in n)n[r]=xe(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Wt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],i=0,r=s.length;i<r;++i)s[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};function In(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function xe(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=bn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var Pt=0,kt=0,St=0,Re=1e3,$t,Et,jt=0,bt=0,Ut=0,Lt=typeof performance=="object"&&performance.now?performance:Date,Le=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xe(){return bt||(Le(Cn),bt=Lt.now()+Ut)}function Cn(){bt=0}function re(){this._call=this._time=this._next=null}re.prototype=Fe.prototype={constructor:re,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Xe():+n)+(e==null?0:+e),!this._next&&Et!==this&&(Et?Et._next=this:$t=this,Et=this),this._call=t,this._time=n,oe()},stop:function(){this._call&&(this._call=null,this._time=1/0,oe())}};function Fe(t,e,n){var i=new re;return i.restart(t,e,n),i}function Dn(){Xe(),++Pt;for(var t=$t,e;t;)(e=bt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Pt}function me(){bt=(jt=Lt.now())+Ut,Pt=kt=0;try{Dn()}finally{Pt=0,An(),bt=0}}function Nn(){var t=Lt.now(),e=t-jt;e>Re&&(Ut-=e,jt=t)}function An(){for(var t,e=$t,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:$t=n);Et=t,oe(i)}function oe(t){if(!Pt){kt&&(kt=clearTimeout(kt));var e=t-bt;e>24?(t<1/0&&(kt=setTimeout(me,t-Lt.now()-Ut)),St&&(St=clearInterval(St))):(St||(jt=Lt.now(),St=setInterval(Nn,Re)),Pt=1,Le(me))}}const zn=1664525,Pn=1013904223,we=4294967296;function Sn(){let t=1;return()=>(t=(zn*t+Pn)%we)/we}function kn(t){return t.x}function En(t){return t.y}var Rn=10,Ln=Math.PI*(3-Math.sqrt(5));function _e(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,c=.6,o=new Map,h=Fe(C),a=Ee("tick","end"),d=Sn();t==null&&(t=[]);function C(){x(),a.call("tick",e),n<i&&(h.stop(),a.call("end",e))}function x(u){var l,g=t.length,w;u===void 0&&(u=1);for(var N=0;N<u;++N)for(n+=(s-n)*r,o.forEach(function(m){m(n)}),l=0;l<g;++l)w=t[l],w.fx==null?w.x+=w.vx*=c:(w.x=w.fx,w.vx=0),w.fy==null?w.y+=w.vy*=c:(w.y=w.fy,w.vy=0);return e}function f(){for(var u=0,l=t.length,g;u<l;++u){if(g=t[u],g.index=u,g.fx!=null&&(g.x=g.fx),g.fy!=null&&(g.y=g.fy),isNaN(g.x)||isNaN(g.y)){var w=Rn*Math.sqrt(.5+u),N=u*Ln;g.x=w*Math.cos(N),g.y=w*Math.sin(N)}(isNaN(g.vx)||isNaN(g.vy))&&(g.vx=g.vy=0)}}function y(u){return u.initialize&&u.initialize(t,d),u}return f(),e={tick:x,restart:function(){return h.restart(C),e},stop:function(){return h.stop(),e},nodes:function(u){return arguments.length?(t=u,f(),o.forEach(y),e):t},alpha:function(u){return arguments.length?(n=+u,e):n},alphaMin:function(u){return arguments.length?(i=+u,e):i},alphaDecay:function(u){return arguments.length?(r=+u,e):+r},alphaTarget:function(u){return arguments.length?(s=+u,e):s},velocityDecay:function(u){return arguments.length?(c=1-u,e):1-c},randomSource:function(u){return arguments.length?(d=u,o.forEach(y),e):d},force:function(u,l){return arguments.length>1?(l==null?o.delete(u):o.set(u,y(l)),e):o.get(u)},find:function(u,l,g){var w=0,N=t.length,m,z,P,j,B;for(g==null?g=1/0:g*=g,w=0;w<N;++w)j=t[w],m=u-j.x,z=l-j.y,P=m*m+z*z,P<g&&(B=j,g=P);return B},on:function(u,l){return arguments.length>1?(a.on(u,l),e):a.on(u)}}}function Me(){var t,e,n,i,r=st(-30),s,c=1,o=1/0,h=.81;function a(f){var y,u=t.length,l=fe(t,kn,En).visitAfter(C);for(i=f,y=0;y<u;++y)e=t[y],l.visit(x)}function d(){if(t){var f,y=t.length,u;for(s=new Array(y),f=0;f<y;++f)u=t[f],s[u.index]=+r(u,f,t)}}function C(f){var y=0,u,l,g=0,w,N,m;if(f.length){for(w=N=m=0;m<4;++m)(u=f[m])&&(l=Math.abs(u.value))&&(y+=u.value,g+=l,w+=l*u.x,N+=l*u.y);f.x=w/g,f.y=N/g}else{u=f,u.x=u.data.x,u.y=u.data.y;do y+=s[u.data.index];while(u=u.next)}f.value=y}function x(f,y,u,l){if(!f.value)return!0;var g=f.x-e.x,w=f.y-e.y,N=l-y,m=g*g+w*w;if(N*N/h<m)return m<o&&(g===0&&(g=yt(n),m+=g*g),w===0&&(w=yt(n),m+=w*w),m<c&&(m=Math.sqrt(c*m)),e.vx+=g*f.value*i/m,e.vy+=w*f.value*i/m),!0;if(f.length||m>=o)return;(f.data!==e||f.next)&&(g===0&&(g=yt(n),m+=g*g),w===0&&(w=yt(n),m+=w*w),m<c&&(m=Math.sqrt(c*m)));do f.data!==e&&(N=s[f.data.index]*i/m,e.vx+=g*N,e.vy+=w*N);while(f=f.next)}return a.initialize=function(f,y){t=f,n=y,d()},a.strength=function(f){return arguments.length?(r=typeof f=="function"?f:st(+f),d(),a):r},a.distanceMin=function(f){return arguments.length?(c=f*f,a):Math.sqrt(c)},a.distanceMax=function(f){return arguments.length?(o=f*f,a):Math.sqrt(o)},a.theta=function(f){return arguments.length?(h=f*f,a):Math.sqrt(h)},a}function be(t){var e=st(.1),n,i,r;typeof t!="function"&&(t=st(t==null?0:+t));function s(o){for(var h=0,a=n.length,d;h<a;++h)d=n[h],d.vx+=(r[h]-d.x)*i[h]*o}function c(){if(n){var o,h=n.length;for(i=new Array(h),r=new Array(h),o=0;o<h;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return s.initialize=function(o){n=o,c()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:st(+o),c(),s):e},s.x=function(o){return arguments.length?(t=typeof o=="function"?o:st(+o),c(),s):t},s}function Te(t){var e=st(.1),n,i,r;typeof t!="function"&&(t=st(t==null?0:+t));function s(o){for(var h=0,a=n.length,d;h<a;++h)d=n[h],d.vy+=(r[h]-d.y)*i[h]*o}function c(){if(n){var o,h=n.length;for(i=new Array(h),r=new Array(h),o=0;o<h;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return s.initialize=function(o){n=o,c()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:st(+o),c(),s):e},s.y=function(o){return arguments.length?(t=typeof o=="function"?o:st(+o),c(),s):t},s}var Xn=Tt('<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>'),Fn=Tt('<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><div class="legend-panel svelte-1i33fky"></div></div></div>');function On(t,e){se(e,!0);let n=Gt(e,"selectedEntityId",3,null),i=Gt(e,"filteredIds",3,null),r=Gt(e,"sidebarHoveredId",3,null),s=Gt(e,"highlightedIds",3,null);function c(v){return e.nameMap?.get(v)??v.replace(/-/g," ").replace(/\b\w/g,_=>_.toUpperCase())}const o=Ce("theme"),h=et(()=>o.current==="light"?{default:14211288,dim:15263976,conn:12632256,labelText:1710623}:{default:2763306,dim:1315860,conn:4210752,labelText:15592943}),a=et(()=>o.current==="light"?16316666:592139),d=.75;Nt(()=>{o.current,K&&(K.style.fill=p(h).labelText);const v=p(Bt);for(const _ of y)_t(_.type)===Ct&&(_.color=v);tt()}),Nt(()=>{i(),tt()}),Nt(()=>{s(),tt()}),Nt(()=>{n(),tt()});let C=!1;Nt(()=>{const v=e.graphData;if(!q||!D||!R)return;if(!C){C=!0;return}const _=new Map;for(const T of v.edges)_.set(T.source,(_.get(T.source)??0)+1),_.set(T.target,(_.get(T.target)??0)+1);const M=new Map;for(const T of y)M.set(T.id,{x:T.x,y:T.y});const G=3600*v.nodes.length,Y=Math.sqrt(G),O=v.nodes.map(T=>{const W=_.get(T.id)??0,ht=M.get(T.id);return{id:T.id,type:T.type,repo:T.repo,color:_t(T.type)===Ct?p(Bt):_t(T.type),weight:W,x:ht?.x??(Math.random()-.5)*Y,y:ht?.y??(Math.random()-.5)*Y,vx:0,vy:0,r:It(W)}}),V=new Map;for(const T of O)V.set(T.id,T);const nt=new Set(L.keys()),ft=new Set(v.nodes.map(T=>T.id));for(const T of nt)if(!ft.has(T)){const W=L.get(T);W&&(R.removeChild(W),W.destroy()),L.delete(T)}let F=null;if(L.size>0&&(F=L.values().next().value?.texture),!F){const T=document.createElement("canvas");T.width=100,T.height=100;const W=T.getContext("2d");W.beginPath(),W.arc(50,50,48,0,Math.PI*2),W.fillStyle="#ffffff",W.fill(),F=q.Texture.from(T)}for(const T of O){let W=L.get(T.id);W||(W=new q.Sprite(F),W.anchor.set(.5),R.addChild(W),L.set(T.id,W)),W.tint=Ft(T.color)}y=O,f?.stop();const vt=v.edges.map(T=>({source:T.source,target:T.target})),X=ye(vt).id(T=>T.id).distance(250);f=_e(y).force("link",X).force("charge",Me().strength(-1e3).distanceMin(30)).force("x",be(0).strength(.1)).force("y",Te(0).strength(.1)).force("collide",ve().radius(60).strength(.5)).velocityDecay(.4).alpha(.3).on("tick",()=>{rt||Vt(),tt()}),u=X.links(),z=null,Xt(),tt()}),Nt(()=>{const v=r();if(v){const _=y.find(M=>M.id===v)??null;z=_,Xt(),b=_?1:0}else P||(b=0);tt()});let x,f=null,y=[],u=[],l=!1,g=0,w=0,N=0,m=1,z=null,P=null,j=pt(!1),B=0,Z=0,$=0,ct=0,Q=new Set,rt=!1,xt=pt(null),I=0,b=0;const E=4;let D=null,S=null,U=null,R=null,L=new Map,H=null,K=null,q=null;function It(v){return Math.max(3,Math.min(Math.sqrt(v+1)+2,10))}function Ht(v,_){const M=x.getBoundingClientRect();return{x:(v-M.left-w)/m,y:(_-M.top-N)/m}}function he(v,_){for(let M=y.length-1;M>=0;M--){const k=y[M],G=v-k.x,Y=_-k.y,O=(k.r*1.5+4)/m;if(G*G+Y*Y<=O*O)return k}return null}function Xt(){const v=z??null;if(Q.clear(),!!v){Q.add(v.id);for(const _ of u)_.source.id===v.id&&Q.add(_.target.id),_.target.id===v.id&&Q.add(_.source.id);if(R){const _=L.get(v.id);_&&R.setChildIndex(_,R.children.length-1)}}}function Vt(){if(y.length===0||!x)return;let v=1/0,_=-1/0,M=1/0,k=-1/0,G=0;for(const F of y)F.x<v&&(v=F.x),F.x>_&&(_=F.x),F.y<M&&(M=F.y),F.y>k&&(k=F.y),F.r>G&&(G=F.r);const Y=x.clientWidth,O=x.clientHeight,V=_-v,nt=k-M;if(V===0||nt===0)return;const ft=(60+G)*2;m=Math.min((Y-ft)/V,(O-ft)/nt,3),w=Y/2-(v+_)/2*m,N=O/2-(M+k)/2*m,tt()}function tt(){l=!0,g=0}function Ft(v){return parseInt(v.replace("#",""),16)}function mt(v,_,M){const k=(v>>16&255)+M*((_>>16&255)-(v>>16&255)),G=(v>>8&255)+M*((_>>8&255)-(v>>8&255)),Y=(v&255)+M*((_&255)-(v&255));return Math.round(k)<<16|Math.round(G)<<8|Math.round(Y)}function Oe(){if(!q||!S||!U)return;S.clear(),U.clear();const _=z!==null,M=I,k=p(xt),G=s(),Y=i(),O=p(h).default,V=p(h).dim,nt=p(h).conn;for(let ft=0;ft<u.length;ft++){const F=u[ft],vt=F.source.x*m+w,X=F.source.y*m+N,T=F.target.x*m+w,W=F.target.y*m+N,ht=_&&M>.01&&Q.has(F.source.id)&&Q.has(F.target.id);let A=O;_&&M>.01?A=ht?mt(O,nt,M):mt(O,V,M):(k!==null||G!==null||Y!==null)&&(A=V);const J=ht?U:S,Dt=ht?1:.2;J.setStrokeStyle({width:1,color:A,alpha:Dt}),J.moveTo(vt,X),J.lineTo(T,W),J.stroke()}}function Be(){if(!q)return;const v=z,_=v!==null,M=I,k=p(xt),G=s(),Y=i(),O=!v&&n()?y.find(X=>X.id===n())??null:null,V=new Set;if(O){V.add(O.id);for(const X of u)X.source.id===O.id&&V.add(X.target.id),X.target.id===O.id&&V.add(X.source.id)}for(const X of y){const T=L.get(X.id);if(!T)continue;const W=X.x*m+w,ht=X.y*m+N;T.position.set(W,ht),T.scale.set(X.r/50),T.alpha=1;const A=Ft(X.color);if(O&&!v){const J=V.has(X.id);T.tint=J?A:mt(A,p(a),d)}else{const J=X===v,Dt=_&&Q.has(X.id),je=k!==null&&(k==="other"?_t(X.type)===Ct:X.type===k);if(J&&M>.01)T.tint=A,T.scale.set(X.r*(1+M*.4)/50);else if(Dt)T.tint=A;else if(k!==null)T.tint=je?A:mt(A,p(a),d);else if(G!==null){const Zt=G.has(X.id)?M*d:d;T.tint=mt(A,p(a),Zt)}else if(Y!==null){const Zt=Y.has(X.id)?M*d:d;T.tint=mt(A,p(a),Zt)}else T.tint=mt(A,p(a),M*d)}}const nt=v??O,ft=v?M>.01:!!O;if(nt&&ft&&H){H.visible=!0;const X=nt.x*m+w,T=nt.y*m+N;H.position.set(X,T),H.scale.set(nt.r*5/64),H.alpha=v?M*.25:.25,H.tint=Ft(nt.color)}else H&&(H.visible=!1);const F=v??O,vt=v?M>.01:!!O;if(F&&vt&&K){const X=F.x*m+w,T=F.y*m+N;K.text=c(F.id),K.style.fontSize=12,K.position.set(X,T+F.r+8),K.alpha=v?M:1,K.visible=!0}else K&&(K.visible=!1)}let Ot=!1;function Ge(v){if(v.button!==0)return;Ot=!1;const _=Ht(v.clientX,v.clientY),M=he(_.x,_.y);M?(P=M,rt=!0,M.fx=M.x,M.fy=M.y,f?.alphaTarget(.3).restart(),tt()):(ot(j,!0),B=v.clientX,Z=v.clientY,$=w,ct=N),x.setPointerCapture(v.pointerId),window.addEventListener("pointerup",Kt,{once:!0})}function Ye(v){if(P){Ot=!0;const _=Ht(v.clientX,v.clientY);P.fx=_.x,P.fy=_.y,tt()}else if(p(j))Ot=!0,w=$+(v.clientX-B),N=ct+(v.clientY-Z),tt();else{const _=Ht(v.clientX,v.clientY),M=he(_.x,_.y);M?M!==z?(z&&(I=.15),z=M,Xt(),b=1,x.style.cursor="pointer",tt()):b!==1&&(b=1,x.style.cursor="pointer",tt()):b!==0&&(b=0,x.style.cursor="grab",tt())}}function Kt(v){if(!P&&!p(j))return;window.removeEventListener("pointerup",Kt);const _=Ot;if(P){const M=P;P.fx=null,P.fy=null,f?.alphaTarget(0),P=null,b=0,tt(),_||nn(`/${M.repo}/${M.type}/${M.id}`)}else p(j)&&ot(j,!1);try{x.releasePointerCapture(v.pointerId)}catch{}}const Ct="#5c5c66",We="#b0b0b8",Bt=et(()=>o.current==="light"?We:Ct),$e=et(()=>{const v=new Map;for(const k of e.graphData.nodes)v.set(k.type,(v.get(k.type)??0)+1);const _=[];let M=0;for(const[k,G]of v){const Y=_t(k);Y===Ct?M+=G:_.push({name:k,color:Y,count:G})}return _.sort((k,G)=>G.count-k.count),M>0&&_.push({name:"other",color:p(Bt),count:M}),_});De(async()=>{q=await qe(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url),D=new q.Application,await D.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:x}),x.insertBefore(D.canvas,x.firstChild),D.canvas.style.position="absolute",D.canvas.style.inset="0",S=new q.Graphics,D.stage.addChild(S),U=new q.Graphics,D.stage.addChild(U),R=new q.Container,D.stage.addChild(R);const v=document.createElement("canvas");v.width=128,v.height=128;const _=v.getContext("2d"),M=_.createRadialGradient(64,64,0,64,64,64);M.addColorStop(0,"rgba(255,255,255,0.5)"),M.addColorStop(1,"rgba(255,255,255,0)"),_.fillStyle=M,_.fillRect(0,0,128,128);const k=q.Texture.from(v);H=new q.Sprite(k),H.anchor.set(.5),H.visible=!1,D.stage.addChild(H);const G=document.createElement("canvas");G.width=100,G.height=100;const Y=G.getContext("2d");Y.beginPath(),Y.arc(50,50,48,0,Math.PI*2),Y.fillStyle="#ffffff",Y.fill();const O=q.Texture.from(G),V=new Map;for(const A of e.graphData.edges)V.set(A.source,(V.get(A.source)??0)+1),V.set(A.target,(V.get(A.target)??0)+1);const nt=new Map,F=3600*e.graphData.nodes.length,vt=Math.sqrt(F);y=e.graphData.nodes.map(A=>{const J=V.get(A.id)??0,Dt={id:A.id,type:A.type,repo:A.repo,color:_t(A.type)===Ct?p(Bt):_t(A.type),weight:J,x:(Math.random()-.5)*vt,y:(Math.random()-.5)*vt,vx:0,vy:0,r:It(J)};return nt.set(A.id,Dt),Dt});for(const A of y){const J=new q.Sprite(O);J.anchor.set(.5),J.tint=Ft(A.color),R.addChild(J),L.set(A.id,J)}K=new q.Text({text:"",style:{fontFamily:"Inter, system-ui, sans-serif",fontWeight:"500",fontSize:12,fill:p(h).labelText,align:"center"}}),K.anchor.set(.5,0),K.visible=!1,D.stage.addChild(K);const X=e.graphData.edges.map(A=>({source:A.source,target:A.target})),T=ye(X).id(A=>A.id).distance(250);f=_e(y).force("link",T).force("charge",Me().strength(-1e3).distanceMin(30)).force("x",be(0).strength(.1)).force("y",Te(0).strength(.1)).force("collide",ve().radius(60).strength(.5)).velocityDecay(.4).alpha(1).on("tick",()=>{rt||Vt(),tt()}),u=T.links();let W=0;D.ticker.add(()=>{const A=performance.now(),J=W?Math.min((A-W)/1e3,.05):.016;W=A,I<b?(I=Math.min(b,I+E*J),l=!0):I>b&&(I=Math.max(b,I-E*J),l=!0),I===0&&b===0&&z&&!P&&(z=null,Xt(),l=!0),(l||g<120)&&(Oe(),Be(),l=!1,g++)});const ht=new ResizeObserver(()=>{D.renderer.resize(x.clientWidth,x.clientHeight),Vt()});return ht.observe(x),()=>{ht.disconnect()}}),He(()=>{f?.stop(),D&&(D.destroy(!0,{children:!0}),D=null)});var Qt=Fn(),wt=ut(Qt);let de;var Jt=ut(wt);ne(Jt,21,()=>p($e),ie,(v,_)=>{var M=Xn();let k;var G=ut(M);let Y;var O=dt(G,2),V=ut(O,!0);it(O);var nt=dt(O,2),ft=ut(nt,!0);it(nt),it(M),At(()=>{k=tn(M,1,"legend-item svelte-1i33fky",null,k,{"legend-item-active":p(xt)===p(_).name}),Y=zt(G,"",Y,{background:p(_).color}),Rt(V,p(_).name),Rt(ft,p(_).count)}),te("mouseenter",M,()=>{ot(xt,p(_).name,!0),tt()}),te("mouseleave",M,()=>{ot(xt,null),tt()}),gt(v,M)}),it(Jt),it(wt),Ne(wt,v=>x=v,()=>x),it(Qt),At(()=>de=zt(wt,"",de,{cursor:p(j)?"grabbing":"grab"})),Mt("pointerdown",wt,Ge),Mt("pointermove",wt,Ye),Mt("pointerup",wt,Kt),Mt("pointerdown",Jt,v=>v.stopPropagation()),gt(t,Qt),le()}Ie(["pointerdown","pointermove","pointerup"]);function Bn(t,e){const n=Ae(e,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]];Pe(t,ze({name:"play"},()=>n,{get iconNode(){return i},children:(r,s)=>{var c=ae(),o=ce(c);Se(o,e,"default",{}),gt(r,c)},$$slots:{default:!0}}))}function Gn(t,e){const n=Ae(e,["children","$$slots","$$events","$$legacy"]);const i=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"}]];Pe(t,ze({name:"pause"},()=>n,{get iconNode(){return i},children:(r,s)=>{var c=ae(),o=ce(c);Se(o,e,"default",{}),gt(r,c)},$$slots:{default:!0}}))}var Yn=Tt('<div class="density-bar svelte-lzvab"></div>'),Wn=Tt('<span class="date-label svelte-lzvab"> </span>'),$n=Tt('<div class="timeline-tooltip svelte-lzvab"><div class="tooltip-date svelte-lzvab"> </div> <div class="tooltip-count svelte-lzvab"> </div></div>'),jn=Tt('<div class="timeline-bar svelte-lzvab"><!> <div class="timeline-track svelte-lzvab"><div class="track-line svelte-lzvab"></div> <div class="density-bars svelte-lzvab"></div> <div class="playhead svelte-lzvab"></div> <div class="date-labels svelte-lzvab"></div> <!></div></div>');function Un(t,e){se(e,!0);let n=pt(null),i=pt(0),r=pt(!1),s=pt(!1),c=pt(null),o=null;const h=et(()=>{let I=1/0,b=-1/0;for(const E of e.entities){const D=E.createdAt?new Date(E.createdAt).getTime():0;D>0&&D<I&&(I=D),D>b&&(b=D)}return I===1/0&&(I=Date.now()),b===-1/0&&(b=Date.now()),{min:I,max:b}}),a=et(()=>{let{min:I,max:b}=p(h);return b-I<864e5&&(I-=864e5*15,b+=864e5*15),{min:new Date(I),max:new Date(b)}}),d=et(()=>{const b=p(a).min.getTime(),E=p(a).max.getTime(),D=new Map;for(const S of e.entities){const U=S.createdAt?new Date(S.createdAt).getTime():0;if(U<=0)continue;const R=Math.floor((U-b)/864e5),L=b+R*864e5,H=D.get(L)??[];H.push(S),D.set(L,H)}return{map:D,minTime:b,maxTime:E,dayMs:864e5}}),C=et(()=>{let I=0;for(const b of p(d).map.values())b.length>I&&(I=b.length);return Math.max(1,I)}),x=et(()=>{const{minTime:I,maxTime:b}=p(d),E=b-I,D=[],S=Math.max(4,Math.min(8,Math.floor(p(i)/100))),U=E/S;for(let R=0;R<=S;R++){const L=I+R*U,K=new Date(L).toLocaleDateString("en-US",{month:"short",day:"numeric"});D.push({label:K,x:R/S})}return D}),f=et(()=>{const{minTime:I,maxTime:b}=p(d),E=b-I;if(E<=0)return .5;const D=e.currentDate?e.currentDate.getTime():p(h).max,S=Math.max(p(h).min,Math.min(p(h).max,D));return Math.max(0,Math.min(1,(S-I)/E))});function y(I){if(!p(n))return new Date;const b=p(n).getBoundingClientRect(),E=40,S=b.width-E-12,U=Math.max(0,Math.min(1,(I-b.left-E)/S)),{minTime:R,maxTime:L}=p(d),H=R+U*(L-R);return new Date(Math.max(p(h).min,Math.min(p(h).max,H)))}function u(I){ot(r,!0),z();const b=y(I.clientX);e.onDateChange(b),I.target.setPointerCapture(I.pointerId)}function l(I){if(p(r)&&e.onDateChange(y(I.clientX)),!p(n))return;const b=p(n).getBoundingClientRect(),E=40,S=b.width-E-12,U=(I.clientX-b.left-E)/S;if(U<0||U>1){ot(c,null);return}const{minTime:R,dayMs:L,map:H}=p(d),K=R+U*(p(d).maxTime-R),q=R+Math.floor((K-R)/L)*L,It=H.get(q);It&&It.length>0?ot(c,{date:new Date(q),count:It.length,x:I.clientX-b.left},!0):ot(c,null)}function g(){ot(r,!1)}function w(){ot(c,null)}function N(){p(s)?z():m()}function m(){ot(s,!0);const{min:I,max:b}=p(h),D=(b-I)/200;let S=e.currentDate?.getTime()??I;S>=b&&(S=I),o=setInterval(()=>{if(S+=D,S>=b){e.onDateChange(null),z();return}e.onDateChange(new Date(S))},50)}function z(){ot(s,!1),o&&(clearInterval(o),o=null)}De(()=>{if(p(n)){const I=new ResizeObserver(b=>{ot(i,b[0]?.contentRect.width??0,!0)});return I.observe(p(n)),()=>I.disconnect()}});var P=jn(),j=ut(P);{let I=et(()=>p(s)?"Pause":"Play");en(j,{variant:"ghost",size:"icon",class:"play-btn",onclick:N,get title(){return p(I)},children:(b,E)=>{var D=ae(),S=ce(D);{var U=L=>{Gn(L,{size:14})},R=L=>{Bn(L,{size:14})};ee(S,L=>{p(s)?L(U):L(R,!1)})}gt(b,D)},$$slots:{default:!0}})}var B=dt(j,2),Z=dt(ut(B),2);ne(Z,21,()=>Array.from(p(d).map.entries()),ie,(I,b)=>{var E=et(()=>Ve(p(b),2));let D=()=>p(E)[0],S=()=>p(E)[1];const U=et(()=>(D()-p(d).minTime)/(p(d).maxTime-p(d).minTime)),R=et(()=>S().length/p(C)),L=et(()=>.05+.95*p(R)*p(R));var H=Yn();let K;At(()=>K=zt(H,"",K,{left:`${p(U)*100}%`,opacity:p(L)})),gt(I,H)}),it(Z);var $=dt(Z,2);let ct;var Q=dt($,2);ne(Q,21,()=>p(x),ie,(I,b)=>{var E=Wn();let D;var S=ut(E,!0);it(E),At(()=>{D=zt(E,"",D,{left:`${p(b).x*100}%`}),Rt(S,p(b).label)}),gt(I,E)}),it(Q);var rt=dt(Q,2);{var xt=I=>{var b=$n();let E;var D=ut(b),S=ut(D,!0);it(D);var U=dt(D,2),R=ut(U);it(U),it(b),At(L=>{E=zt(b,"",E,{left:`${p(c).x??""}px`}),Rt(S,L),Rt(R,`${p(c).count??""} ${p(c).count===1?"entity":"entities"}`)},[()=>p(c).date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]),gt(I,b)};ee(rt,I=>{p(c)&&!p(r)&&I(xt)})}it(B),it(P),Ne(P,I=>ot(n,I),()=>p(n)),At(()=>ct=zt($,"",ct,{left:`${p(f)*100}%`})),Mt("pointerdown",B,u),Mt("pointermove",B,l),Mt("pointerup",B,g),te("pointerleave",B,w),gt(t,P),le()}Ie(["pointerdown","pointermove","pointerup"]);var Hn=Tt('<div class="content-row svelte-315y67"><div class="graph-area svelte-315y67"><!> <!> <!></div> <!></div>');function ri(t,e){se(e,!0);const n=Ce("chat");qt.showGraph();let i=pt(null);const r=et(()=>{const o=new Map;for(const h of Yt.repos)for(const a of h.entities)o.set(a.id,a.title);return o}),s=et(()=>{const o=[];for(const h of Yt.repos)for(const a of h.entities)a.id.toLowerCase().startsWith("readme")||o.push(a);return o}),c=et(()=>{const o=[],h=[],a=new Set,d=new Set,C=p(i)?.getTime()??1/0;for(const f of Yt.repos)for(const y of f.entities){if(y.id.toLowerCase().startsWith("readme")||a.has(y.id)||(y.createdAt?new Date(y.createdAt).getTime():0)>C)continue;a.add(y.id),o.push({id:y.id,type:y.entityType,repo:f.name});const l=y.wikilinks??[];for(const g of l){const w=y.id<g?`${y.id}|${g}`:`${g}|${y.id}`;!d.has(w)&&y.id!==g&&(d.add(w),h.push({source:y.id,target:g}))}}const x=h.filter(f=>a.has(f.source)&&a.has(f.target));return{nodes:o,edges:x}});Ke(t,{children:(o,h)=>{var a=Hn(),d=ut(a),C=ut(d);Qe(C,{activeView:"graph"});var x=dt(C,2);On(x,{get graphData(){return p(c)},get selectedEntityId(){return qt.selectedId},get nameMap(){return p(r)},get filteredIds(){return Yt.filteredIds},get sidebarHoveredId(){return qt.hoveredEntityId},get highlightedIds(){return Je.highlightedIds}});var f=dt(x,2);Un(f,{get entities(){return p(s)},get currentDate(){return p(i)},onDateChange:l=>{ot(i,l,!0)}}),it(d);var y=dt(d,2);{var u=l=>{Ze(l,{})};ee(y,l=>{n.open&&l(u)})}it(a),gt(o,a)},$$slots:{default:!0}}),le()}export{ri as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as F,a as x,f as q,t as G,s as y}from"../chunks/
|
|
1
|
+
import{e as F,a as x,f as q,t as G,s as y}from"../chunks/CjKjQEMp.js";import{p as H,v as w,n as J,w as K,q as r,o as a,$ as L,u as t,x as l,y as i,t as M,z as u}from"../chunks/D-tW7Byc.js";import{i as N}from"../chunks/EhE2EcYu.js";import{h as O}from"../chunks/DCWeodCf.js";import{g as Q}from"../chunks/DkM5hMeY.js";import{B as R,w as $,a as U}from"../chunks/ByFfmBEu.js";import{I as S}from"../chunks/BV_9Nfp2.js";var V=q('<p class="error-msg svelte-1x05zx6"> </p>'),W=q('<div class="login-page svelte-1x05zx6"><div class="login-card svelte-1x05zx6"><div class="logo svelte-1x05zx6"><div class="logo-icon svelte-1x05zx6">S</div> <span class="logo-text svelte-1x05zx6"> </span></div> <form class="svelte-1x05zx6"><label class="field svelte-1x05zx6"><span class="field-label svelte-1x05zx6">Email</span> <!></label> <label class="field svelte-1x05zx6"><span class="field-label svelte-1x05zx6">Password</span> <!></label> <!> <!></form></div></div>');function re(I,P){H(P,!0);let g=u(""),b=u(""),n=u(""),v=u(!1);async function k(e){e.preventDefault();const s=e.currentTarget,o=s.querySelector('input[type="email"]').value,A=s.querySelector('input[type="password"]').value;l(n,""),l(v,!0);try{await U.login(o,A),Q("/")}catch(C){l(n,C.message||"Invalid credentials",!0)}finally{l(v,!1)}}var p=W();O("1x05zx6",e=>{K(()=>{L.title=`Sign in — ${($.name||"Studiograph")??""}`})});var _=a(p),d=a(_),z=r(a(d),2),B=a(z,!0);t(z),t(d);var c=r(d,2),m=a(c),E=r(a(m),2);S(E,{type:"email",required:!0,autocomplete:"email",autofocus:!0,class:"field-input",get value(){return i(g)},set value(e){l(g,e,!0)}}),t(m);var f=r(m,2),D=r(a(f),2);S(D,{type:"password",required:!0,autocomplete:"current-password",class:"field-input",get value(){return i(b)},set value(e){l(b,e,!0)}}),t(f);var h=r(f,2);{var T=e=>{var s=V(),o=a(s,!0);t(s),w(()=>y(o,i(n))),x(e,s)};N(h,e=>{i(n)&&e(T)})}var j=r(h,2);R(j,{variant:"accent",type:"submit",class:"submit-btn",get disabled(){return i(v)},children:(e,s)=>{M();var o=G("Sign in");x(e,o)},$$slots:{default:!0}}),t(c),t(_),t(p),w(()=>y(B,$.name||"Studiograph")),F("submit",c,k),x(I,p),J()}export{re as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BVBRzmeQ.js","../chunks/Cs5oz2oJ.js","../chunks/BBLgaWN8.js","../chunks/0oxpWEgM.js","../chunks/BXuvR8Ks.js","../chunks/D2aTbzFm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as Hs,q as yt,c as x,a as r,f as c,s as Z,d as Ta,t as F,e as $s,b as Ps}from"../chunks/CjKjQEMp.js";import{i as Ls}from"../chunks/eEhMI0BQ.js";import{b6 as Oa,bo as Ea,br as Va,V as f,y as t,D as Ot,F as Fa,x as s,z,S as gt,p as De,f as n,n as Me,o as b,bd as ot,u as p,q as l,B as Ha,v as se,b0 as La,m as Ua,_ as qa,ap as Ba,t as M}from"../chunks/D-tW7Byc.js";import{g as Ka,C as Et,e as bt,z as Us,j as C,B as It,G as Jt,H as sr,I as br,J as ar,w as _t,K as Yr,L as Pr,R as Wa,k as xt,n as kt,m as dt,N as wr,O as Gr,Q as ja,U as Ja,V as Ga,W as Ya,X as Xa,Y as Wt,Z as rr,_ as ws,$ as qs,a0 as Bs,a1 as Ks,a2 as Ws,a3 as Qa,a4 as Za,a5 as eo,a6 as to,a7 as ro,a8 as so,a9 as Cs,aa as ao,P as oo,ab as no,ac as Zt,ad as Er,ae as Vr,af as Fr,ag as Hr,ah as Lr,ai as Ur,aj as qr,ak as Br,al as vr,am as fr,an as gr,ao as pr,ap as mr,x as ks,aq as Ss,ar as io,as as lo,at as co,au as uo,av as zs,A as ho}from"../chunks/Mxe2MMs2.js";import{p as _,i as H,r as Ye,s as ht,b as Cr,l as kr}from"../chunks/EhE2EcYu.js";import{a as ft,b as vo,I as Sr,s as zr,n as js,R as fo,P as go,T as Kr,i as mt}from"../chunks/JFkcr2-N.js";import{c as y}from"../chunks/Dpn7ZAUg.js";import{e as Ne,b as tt,d as po,c as St,s as mo,t as _o,m as Nr,w as lt,n as Ns,o as yo,B as Ee,a as As,p as Wr,q as bo,v as xo,x as $o,g as Po}from"../chunks/ByFfmBEu.js";import{g as wo,P as Co,a as ko,F as So,b as zo}from"../chunks/Cc7CYb94.js";import{b as Js,I as qt}from"../chunks/BV_9Nfp2.js";import{C as xr}from"../chunks/C6jTKM_R.js";import{_ as er}from"../chunks/PPVm8Dsz.js";import{P as No}from"../chunks/38MyG-mV.js";const Ao=[];function $r(d,e=!1,a=!1){return yr(d,new Map,"",Ao,null,a)}function yr(d,e,a,o,i=null,h=!1){if(typeof d=="object"&&d!==null){var u=e.get(d);if(u!==void 0)return u;if(d instanceof Map)return new Map(d);if(d instanceof Set)return new Set(d);if(Oa(d)){var v=Array(d.length);e.set(d,v),i!==null&&e.set(i,v);for(var w=0;w<d.length;w+=1){var k=d[w];w in d&&(v[w]=yr(k,e,a,o,null,h))}return v}if(Ea(d)===Va){v={},e.set(d,v),i!==null&&e.set(i,v);for(var $ of Object.keys(d))v[$]=yr(d[$],e,a,o,null,h);return v}if(d instanceof Date)return structuredClone(d);if(typeof d.toJSON=="function"&&!h)return yr(d.toJSON(),e,a,o,d)}if(d instanceof EventTarget)return d;try{return structuredClone(d)}catch{return d}}const Ro={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},Io=Ka(Ro);class Do{#e=()=>{};#t=f(()=>this.#e());constructor(e,a){let o;a!==void 0&&(o=a),this.#e=()=>{try{return o}finally{o=e()}}}get current(){return t(this.#t)}}function Mo(d){Ot(()=>Fa(()=>d()))}const jt=Pr({component:"accordion",parts:["root","trigger","content","item","header"]}),Gs=new Et("Accordion.Root"),Ar=new Et("Accordion.Item");class Ys{opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.rovingFocusGroup=new Wa({rootNode:this.opts.ref,candidateAttr:jt.trigger,loop:this.opts.loop,orientation:this.opts.orientation}),this.attachment=bt(this.opts.ref)}#e=f(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":It(this.opts.disabled.current),[jt.root]:"",...this.attachment}));get props(){return t(this.#e)}set props(e){s(this.#e,e)}}class To extends Ys{opts;isMulti=!1;constructor(e){super(e),this.opts=e,this.includesItem=this.includesItem.bind(this),this.toggleItem=this.toggleItem.bind(this)}includesItem(e){return this.opts.value.current===e}toggleItem(e){this.opts.value.current=this.includesItem(e)?"":e}}class Oo extends Ys{#e;isMulti=!0;constructor(e){super(e),this.#e=e.value,this.includesItem=this.includesItem.bind(this),this.toggleItem=this.toggleItem.bind(this)}includesItem(e){return this.#e.current.includes(e)}toggleItem(e){this.#e.current=this.includesItem(e)?this.#e.current.filter(a=>a!==e):[...this.#e.current,e]}}class Eo{static create(e){const{type:a,...o}=e,i=a==="single"?new To(o):new Oo(o);return Gs.set(i)}}class Xr{static create(e){return Ar.set(new Xr({...e,rootState:Gs.get()}))}opts;root;#e=f(()=>this.root.includesItem(this.opts.value.current));get isActive(){return t(this.#e)}set isActive(e){s(this.#e,e)}#t=f(()=>this.opts.disabled.current||this.root.opts.disabled.current);get isDisabled(){return t(this.#t)}set isDisabled(e){s(this.#t,e)}attachment;#r=z(null);get contentNode(){return t(this.#r)}set contentNode(e){s(this.#r,e,!0)}contentPresence;constructor(e){this.opts=e,this.root=e.rootState,this.updateValue=this.updateValue.bind(this),this.attachment=bt(this.opts.ref),this.contentPresence=new Us({ref:C(()=>this.contentNode),open:C(()=>this.isActive)})}updateValue(){this.root.toggleItem(this.opts.value.current)}#s=f(()=>({id:this.opts.id.current,"data-state":Jt(this.isActive),"data-disabled":It(this.isDisabled),"data-orientation":this.root.opts.orientation.current,[jt.item]:"",...this.attachment}));get props(){return t(this.#s)}set props(e){s(this.#s,e)}}class Qr{opts;itemState;#e;#t=f(()=>this.opts.disabled.current||this.itemState.opts.disabled.current||this.#e.opts.disabled.current);attachment;constructor(e,a){this.opts=e,this.itemState=a,this.#e=a.root,this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.attachment=bt(this.opts.ref)}static create(e){return new Qr(e,Ar.get())}onclick(e){if(t(this.#t)||e.button!==0){e.preventDefault();return}this.itemState.updateValue()}onkeydown(e){if(!t(this.#t)){if(e.key===sr||e.key===br){e.preventDefault(),this.itemState.updateValue();return}this.#e.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#r=f(()=>({id:this.opts.id.current,disabled:t(this.#t),"aria-expanded":ar(this.itemState.isActive),"aria-disabled":ar(t(this.#t)),"data-disabled":It(t(this.#t)),"data-state":Jt(this.itemState.isActive),"data-orientation":this.#e.opts.orientation.current,[jt.trigger]:"",tabindex:this.opts.tabindex.current,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return t(this.#r)}set props(e){s(this.#r,e)}}class Zr{opts;item;attachment;#e=void 0;#t=!1;#r=z(gt({width:0,height:0}));#s=f(()=>this.opts.hiddenUntilFound.current?this.item.isActive:this.opts.forceMount.current||this.item.isActive);get open(){return t(this.#s)}set open(e){s(this.#s,e)}constructor(e,a){this.opts=e,this.item=a,this.#t=this.item.isActive,this.attachment=bt(this.opts.ref,o=>this.item.contentNode=o),Ot(()=>{const o=requestAnimationFrame(()=>{this.#t=!1});return()=>cancelAnimationFrame(o)}),_t.pre([()=>this.opts.ref.current,()=>this.opts.hiddenUntilFound.current],([o,i])=>!o||!i?void 0:Hs(o,"beforematch",()=>{this.item.isActive||requestAnimationFrame(()=>{this.item.updateValue()})})),_t([()=>this.open,()=>this.opts.ref.current],this.#a)}static create(e){return new Zr(e,Ar.get())}#a=([e,a])=>{a&&Yr(()=>{const o=this.opts.ref.current;if(!o)return;this.#e??={transitionDuration:o.style.transitionDuration,animationName:o.style.animationName},o.style.transitionDuration="0s",o.style.animationName="none";const i=o.getBoundingClientRect();s(this.#r,{width:i.width,height:i.height},!0),!this.#t&&this.#e&&(o.style.transitionDuration=this.#e.transitionDuration,o.style.animationName=this.#e.animationName)})};get shouldRender(){return this.item.contentPresence.shouldRender}#o=f(()=>({open:this.item.isActive}));get snippetProps(){return t(this.#o)}set snippetProps(e){s(this.#o,e)}#n=f(()=>({id:this.opts.id.current,"data-state":Jt(this.item.isActive),"data-disabled":It(this.item.isDisabled),"data-orientation":this.item.root.opts.orientation.current,[jt.content]:"",style:{"--bits-accordion-content-height":`${t(this.#r).height}px`,"--bits-accordion-content-width":`${t(this.#r).width}px`},hidden:this.opts.hiddenUntilFound.current&&!this.item.isActive?"until-found":void 0,...this.opts.hiddenUntilFound.current&&!this.shouldRender?{}:{hidden:this.opts.hiddenUntilFound.current?!this.shouldRender:this.opts.forceMount.current?void 0:!this.shouldRender},...this.attachment}));get props(){return t(this.#n)}set props(e){s(this.#n,e)}}class es{opts;item;attachment;constructor(e,a){this.opts=e,this.item=a,this.attachment=bt(this.opts.ref)}static create(e){return new es(e,Ar.get())}#e=f(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,"data-heading-level":this.opts.level.current,"data-state":Jt(this.item.isActive),"data-orientation":this.item.root.opts.orientation.current,[jt.header]:"",...this.attachment}));get props(){return t(this.#e)}set props(e){s(this.#e,e)}}var Vo=c("<div><!></div>");function Rs(d,e){const a=yt();De(e,!0);let o=_(e,"disabled",3,!1),i=_(e,"value",15),h=_(e,"ref",15,null),u=_(e,"id",19,()=>xt(a)),v=_(e,"onValueChange",3,kt),w=_(e,"loop",3,!0),k=_(e,"orientation",3,"vertical"),$=Ye(e,["$$slots","$$events","$$legacy","disabled","children","child","type","value","ref","id","onValueChange","loop","orientation"]);function S(){i()===void 0&&i(e.type==="single"?"":[])}S(),_t.pre(()=>i(),()=>{S()});const R=Eo.create({type:e.type,value:C(()=>i(),N=>{i(N),v()(N)}),id:C(()=>u()),disabled:C(()=>o()),loop:C(()=>w()),orientation:C(()=>k()),ref:C(()=>h(),N=>h(N))}),T=f(()=>dt($,R.props));var m=x(),P=n(m);{var E=N=>{var oe=x(),ye=n(oe);Ne(ye,()=>e.child,()=>({props:t(T)})),r(N,oe)},L=N=>{var oe=Vo();tt(oe,()=>({...t(T)}));var ye=b(oe);Ne(ye,()=>e.children??ot),p(oe),r(N,oe)};H(P,N=>{e.child?N(E):N(L,!1)})}r(d,m),Me()}var Fo=c("<div><!></div>");function Is(d,e){const a=yt();De(e,!0);const o=xt(a);let i=_(e,"id",3,o),h=_(e,"disabled",3,!1),u=_(e,"value",3,o),v=_(e,"ref",15,null),w=Ye(e,["$$slots","$$events","$$legacy","id","disabled","value","children","child","ref"]);const k=Xr.create({value:C(()=>u()),disabled:C(()=>h()),id:C(()=>i()),ref:C(()=>v(),P=>v(P))}),$=f(()=>dt(w,k.props));var S=x(),R=n(S);{var T=P=>{var E=x(),L=n(E);Ne(L,()=>e.child,()=>({props:t($)})),r(P,E)},m=P=>{var E=Fo();tt(E,()=>({...t($)}));var L=b(E);Ne(L,()=>e.children??ot),p(E),r(P,E)};H(R,P=>{e.child?P(T):P(m,!1)})}r(d,S),Me()}var Ho=c("<div><!></div>");function Ds(d,e){const a=yt();De(e,!0);let o=_(e,"id",19,()=>xt(a)),i=_(e,"level",3,2),h=_(e,"ref",15,null),u=Ye(e,["$$slots","$$events","$$legacy","id","level","children","child","ref"]);const v=es.create({id:C(()=>o()),level:C(()=>i()),ref:C(()=>h(),T=>h(T))}),w=f(()=>dt(u,v.props));var k=x(),$=n(k);{var S=T=>{var m=x(),P=n(m);Ne(P,()=>e.child,()=>({props:t(w)})),r(T,m)},R=T=>{var m=Ho();tt(m,()=>({...t(w)}));var P=b(m);Ne(P,()=>e.children??ot),p(m),r(T,m)};H($,T=>{e.child?T(S):T(R,!1)})}r(d,k),Me()}var Lo=c("<button><!></button>");function Ms(d,e){const a=yt();De(e,!0);let o=_(e,"disabled",3,!1),i=_(e,"ref",15,null),h=_(e,"id",19,()=>xt(a)),u=_(e,"tabindex",3,0),v=Ye(e,["$$slots","$$events","$$legacy","disabled","ref","id","tabindex","children","child"]);const w=Qr.create({disabled:C(()=>o()),id:C(()=>h()),tabindex:C(()=>u()??0),ref:C(()=>i(),m=>i(m))}),k=f(()=>dt(v,w.props));var $=x(),S=n($);{var R=m=>{var P=x(),E=n(P);Ne(E,()=>e.child,()=>({props:t(k)})),r(m,P)},T=m=>{var P=Lo();tt(P,()=>({type:"button",...t(k)}));var E=b(P);Ne(E,()=>e.children??ot),p(P),r(m,P)};H(S,m=>{e.child?m(R):m(T,!1)})}r(d,$),Me()}var Uo=c("<div><!></div>");function Ts(d,e){const a=yt();De(e,!0);let o=_(e,"ref",15,null),i=_(e,"id",19,()=>xt(a)),h=_(e,"forceMount",3,!1),u=_(e,"hiddenUntilFound",3,!1),v=Ye(e,["$$slots","$$events","$$legacy","child","ref","id","forceMount","children","hiddenUntilFound"]);const w=Zr.create({forceMount:C(()=>h()),id:C(()=>i()),ref:C(()=>o(),m=>o(m)),hiddenUntilFound:C(()=>u())}),k=f(()=>dt(v,w.props));var $=x(),S=n($);{var R=m=>{var P=x(),E=n(P);{let L=f(()=>({props:t(k),...w.snippetProps}));Ne(E,()=>e.child,()=>t(L))}r(m,P)},T=m=>{var P=Uo();tt(P,()=>({...t(k)}));var E=b(P);Ne(E,()=>e.children??ot),p(P),r(m,P)};H(S,m=>{e.child?m(R):m(T,!1)})}r(d,$),Me()}const Xs=Pr({component:"avatar",parts:["root","image","fallback"]}),Qs=new Et("Avatar.Root");class ts{static create(e){return Qs.set(new ts(e))}opts;domContext;attachment;constructor(e){this.opts=e,this.domContext=new wr(this.opts.ref),this.loadImage=this.loadImage.bind(this),this.attachment=bt(this.opts.ref)}loadImage(e,a,o){if(this.opts.loadingStatus.current==="loaded")return;let i;const h=new Image;return h.src=e,a!==void 0&&(h.crossOrigin=a),o&&(h.referrerPolicy=o),this.opts.loadingStatus.current="loading",h.onload=()=>{i=this.domContext.setTimeout(()=>{this.opts.loadingStatus.current="loaded"},this.opts.delayMs.current)},h.onerror=()=>{this.opts.loadingStatus.current="error"},()=>{i&&this.domContext.clearTimeout(i)}}#e=f(()=>({id:this.opts.id.current,[Xs.root]:"","data-status":this.opts.loadingStatus.current,...this.attachment}));get props(){return t(this.#e)}set props(e){s(this.#e,e)}}class rs{static create(e){return new rs(e,Qs.get())}opts;root;attachment;constructor(e,a){this.opts=e,this.root=a,this.attachment=bt(this.opts.ref)}#e=f(()=>this.root.opts.loadingStatus.current==="loaded"?{display:"none"}:void 0);get style(){return t(this.#e)}set style(e){s(this.#e,e)}#t=f(()=>({style:this.style,"data-status":this.root.opts.loadingStatus.current,[Xs.fallback]:"",...this.attachment}));get props(){return t(this.#t)}set props(e){s(this.#t,e)}}var qo=c("<div><!></div>");function Bo(d,e){const a=yt();De(e,!0);let o=_(e,"delayMs",3,0),i=_(e,"loadingStatus",15,"loading"),h=_(e,"id",19,()=>xt(a)),u=_(e,"ref",15,null),v=Ye(e,["$$slots","$$events","$$legacy","delayMs","loadingStatus","onLoadingStatusChange","child","children","id","ref"]);const w=ts.create({delayMs:C(()=>o()),loadingStatus:C(()=>i(),m=>{i()!==m&&(i(m),e.onLoadingStatusChange?.(m))}),id:C(()=>h()),ref:C(()=>u(),m=>u(m))}),k=f(()=>dt(v,w.props));var $=x(),S=n($);{var R=m=>{var P=x(),E=n(P);Ne(E,()=>e.child,()=>({props:t(k)})),r(m,P)},T=m=>{var P=qo();tt(P,()=>({...t(k)}));var E=b(P);Ne(E,()=>e.children??ot),p(P),r(m,P)};H(S,m=>{e.child?m(R):m(T,!1)})}r(d,$),Me()}var Ko=c("<span><!></span>");function Wo(d,e){const a=yt();De(e,!0);let o=_(e,"id",19,()=>xt(a)),i=_(e,"ref",15,null),h=Ye(e,["$$slots","$$events","$$legacy","children","child","id","ref"]);const u=rs.create({id:C(()=>o()),ref:C(()=>i(),R=>i(R))}),v=f(()=>dt(h,u.props));var w=x(),k=n(w);{var $=R=>{var T=x(),m=n(T);Ne(m,()=>e.child,()=>({props:t(v)})),r(R,T)},S=R=>{var T=Ko();tt(T,()=>({...t(v)}));var m=b(T);Ne(m,()=>e.children??ot),p(T),r(R,T)};H(k,R=>{e.child?R($):R(S,!1)})}r(d,w),Me()}const Zs=Pr({component:"checkbox",parts:["root","group","group-label","input"]}),ea=new Et("Checkbox.Group");class ss{static create(e){return ea.set(new ss(e))}opts;attachment;#e=z(void 0);get labelId(){return t(this.#e)}set labelId(e){s(this.#e,e,!0)}constructor(e){this.opts=e,this.attachment=bt(this.opts.ref)}addValue(e){if(e&&!this.opts.value.current.includes(e)){const a=[...$r(this.opts.value.current),e];if(this.opts.value.current=a,Gr(this.opts.value.current,a))return;this.opts.onValueChange.current(a)}}removeValue(e){if(!e||this.opts.value.current.indexOf(e)===-1)return;const o=this.opts.value.current.filter(i=>i!==e);this.opts.value.current=o,!Gr(this.opts.value.current,o)&&this.opts.onValueChange.current(o)}#t=f(()=>({id:this.opts.id.current,role:"group","aria-labelledby":this.labelId,"data-disabled":It(this.opts.disabled.current),[Zs.group]:"",...this.attachment}));get props(){return t(this.#t)}set props(e){s(this.#t,e)}}const ta=new Et("Checkbox.Root");class as{static create(e,a=null){return ta.set(new as(e,a))}opts;group;#e=f(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return t(this.#e)}set trueName(e){s(this.#e,e)}#t=f(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return t(this.#t)}set trueRequired(e){s(this.#t,e)}#r=f(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return t(this.#r)}set trueDisabled(e){s(this.#r,e)}#s=f(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return t(this.#s)}set trueReadonly(e){s(this.#s,e)}attachment;constructor(e,a){this.opts=e,this.group=a,this.attachment=bt(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),_t.pre([()=>$r(this.group?.opts.value.current),()=>this.opts.value.current],([o,i])=>{!o||!i||(this.opts.checked.current=o.includes(i))}),_t.pre(()=>this.opts.checked.current,o=>{this.group&&(o?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===br){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===sr&&(e.preventDefault(),this.#a())}}#a(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current==="submit"){this.#a();return}e.preventDefault(),this.#a()}}#o=f(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return t(this.#o)}set snippetProps(e){s(this.#o,e)}#n=f(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":ja(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":ar(this.trueRequired),"aria-readonly":ar(this.trueReadonly),"data-disabled":It(this.trueDisabled),"data-readonly":It(this.trueReadonly),"data-state":jo(this.opts.checked.current,this.opts.indeterminate.current),[Zs.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return t(this.#n)}set props(e){s(this.#n,e)}}class os{static create(){return new os(ta.get())}root;#e=f(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return t(this.#e)}set trueChecked(e){s(this.#e,e)}#t=f(()=>!!this.root.trueName);get shouldRender(){return t(this.#t)}set shouldRender(e){s(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Ja(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#r=f(()=>({type:"checkbox",checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return t(this.#r)}set props(e){s(this.#r,e)}}function jo(d,e){return e?"indeterminate":d?"checked":"unchecked"}var Jo=c("<input/>"),Go=c("<input/>");function ra(d,e){De(e,!0);let a=_(e,"value",15),o=Ye(e,["$$slots","$$events","$$legacy","value"]);const i=f(()=>dt(o,{"aria-hidden":"true",tabindex:-1,style:Io}));var h=x(),u=n(h);{var v=k=>{var $=Jo();tt($,()=>({...t(i),value:a()}),void 0,void 0,void 0,void 0,!0),r(k,$)},w=k=>{var $=Go();tt($,()=>({...t(i)}),void 0,void 0,void 0,void 0,!0),Js($,a),r(k,$)};H(u,k=>{t(i).type==="checkbox"?k(v):k(w,!1)})}r(d,h),Me()}function Yo(d,e){De(e,!1);const a=os.create();Ls();var o=x(),i=n(o);{var h=u=>{ra(u,ht(()=>a.props))};H(i,u=>{a.shouldRender&&u(h)})}r(d,o),Me()}var Xo=c("<button><!></button>"),Qo=c("<!> <!>",1);function Zo(d,e){const a=yt();De(e,!0);let o=_(e,"checked",15,!1),i=_(e,"ref",15,null),h=_(e,"disabled",3,!1),u=_(e,"required",3,!1),v=_(e,"name",3,void 0),w=_(e,"value",3,"on"),k=_(e,"id",19,()=>xt(a)),$=_(e,"indeterminate",15,!1),S=_(e,"type",3,"button"),R=Ye(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const T=ea.getOr(null);T&&w()&&(T.opts.value.current.includes(w())?o(!0):o(!1)),_t.pre(()=>w(),()=>{T&&w()&&(T.opts.value.current.includes(w())?o(!0):o(!1))});const m=as.create({checked:C(()=>o(),ue=>{o(ue),e.onCheckedChange?.(ue)}),disabled:C(()=>h()??!1),required:C(()=>u()),name:C(()=>v()),value:C(()=>w()),id:C(()=>k()),ref:C(()=>i(),ue=>i(ue)),indeterminate:C(()=>$(),ue=>{$(ue),e.onIndeterminateChange?.(ue)}),type:C(()=>S()),readonly:C(()=>!!e.readonly)},T),P=f(()=>dt({...R},m.props));var E=Qo(),L=n(E);{var N=ue=>{var Qe=x(),te=n(Qe);{let Ve=f(()=>({props:t(P),...m.snippetProps}));Ne(te,()=>e.child,()=>t(Ve))}r(ue,Qe)},oe=ue=>{var Qe=Xo();tt(Qe,()=>({...t(P)}));var te=b(Qe);Ne(te,()=>e.children??ot,()=>m.snippetProps),p(Qe),r(ue,Qe)};H(L,ue=>{e.child?ue(N):ue(oe,!1)})}var ye=l(L,2);Yo(ye,{}),r(d,E),Me()}var en=c("<div><!></div>");function tn(d,e){const a=yt();De(e,!0);let o=_(e,"ref",15,null),i=_(e,"id",19,()=>xt(a)),h=_(e,"value",31,()=>gt([])),u=_(e,"onValueChange",3,kt),v=Ye(e,["$$slots","$$events","$$legacy","ref","id","value","onValueChange","name","required","disabled","children","child","readonly"]);const w=ss.create({id:C(()=>i()),ref:C(()=>o(),m=>o(m)),disabled:C(()=>!!e.disabled),required:C(()=>!!e.required),readonly:C(()=>!!e.readonly),name:C(()=>e.name),value:C(()=>$r(h()),m=>{Gr(h(),m)||(h($r(m)),u()(m))}),onValueChange:C(()=>u())}),k=f(()=>dt(v,w.props));var $=x(),S=n($);{var R=m=>{var P=x(),E=n(P);Ne(E,()=>e.child,()=>({props:t(k)})),r(m,P)},T=m=>{var P=en();tt(P,()=>({...t(k)}));var E=b(P);Ne(E,()=>e.children??ot),p(P),r(m,P)};H(S,m=>{e.child?m(R):m(T,!1)})}r(d,$),Me()}class rn{#e;#t=f(()=>this.#e.candidateValues());#r;constructor(e){this.#e=e,this.#r=Ga("",{afterMs:1e3,getWindow:this.#e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e){if(!this.#e.enabled()||!t(this.#t).length)return;this.#r.current=this.#r.current+e;const a=this.#e.getCurrentItem(),o=t(this.#t).find(v=>v===a)??"",i=t(this.#t).map(v=>v??""),h=Ya(i,this.#r.current,o),u=t(this.#t).find(v=>v===h);return u&&this.#e.onMatch(u),u}resetTypeahead(){this.#r.current=""}}const sn=[rr,qs,Bs],an=[Wt,Ks,Ws],on=[...sn,...an],nn=Pr({component:"select",parts:["trigger","content","item","viewport","scroll-up-button","scroll-down-button","group","group-label","separator","arrow","input","content-wrapper","item-text","value"]}),or=new Et("Select.Root | Combobox.Root"),ln=new Et("Select.Content | Combobox.Content");class sa{opts;#e=z(!1);get touchedInput(){return t(this.#e)}set touchedInput(e){s(this.#e,e,!0)}#t=z(null);get inputNode(){return t(this.#t)}set inputNode(e){s(this.#t,e,!0)}#r=z(null);get contentNode(){return t(this.#r)}set contentNode(e){s(this.#r,e,!0)}contentPresence;#s=z(null);get viewportNode(){return t(this.#s)}set viewportNode(e){s(this.#s,e,!0)}#a=z(null);get triggerNode(){return t(this.#a)}set triggerNode(e){s(this.#a,e,!0)}#o=z("");get valueId(){return t(this.#o)}set valueId(e){s(this.#o,e,!0)}#n=z(null);get highlightedNode(){return t(this.#n)}set highlightedNode(e){s(this.#n,e,!0)}#i=f(()=>this.highlightedNode?this.highlightedNode.getAttribute("data-value"):null);get highlightedValue(){return t(this.#i)}set highlightedValue(e){s(this.#i,e)}#l=f(()=>{if(this.highlightedNode)return this.highlightedNode.id});get highlightedId(){return t(this.#l)}set highlightedId(e){s(this.#l,e)}#d=f(()=>this.highlightedNode?this.highlightedNode.getAttribute("data-label"):null);get highlightedLabel(){return t(this.#d)}set highlightedLabel(e){s(this.#d,e)}isUsingKeyboard=!1;isCombobox=!1;domContext=new wr(()=>null);constructor(e){this.opts=e,this.isCombobox=e.isCombobox,this.contentPresence=new Us({ref:C(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),Ha(()=>{this.opts.open.current||this.setHighlightedNode(null)})}setHighlightedNode(e,a=!1){this.highlightedNode=e,e&&(this.isUsingKeyboard||a)&&e.scrollIntoView({block:this.opts.scrollAlignment.current})}getCandidateNodes(){const e=this.contentNode;return e?Array.from(e.querySelectorAll(`[${this.getBitsAttr("item")}]:not([data-disabled])`)):[]}setHighlightedToFirstCandidate(e=!1){this.setHighlightedNode(null);let a=this.getCandidateNodes();if(a.length){if(this.viewportNode){const o=this.viewportNode.getBoundingClientRect();a=a.filter(i=>{if(!this.viewportNode)return!1;const h=i.getBoundingClientRect();return h.right<=o.right&&h.left>=o.left&&h.bottom<=o.bottom&&h.top>=o.top})}this.setHighlightedNode(a[0],e)}}getNodeByValue(e){return this.getCandidateNodes().find(o=>o.dataset.value===e)??null}setOpen(e){this.opts.open.current=e}toggleOpen(){this.opts.open.current=!this.opts.open.current}handleOpen(){this.setOpen(!0)}handleClose(){this.setHighlightedNode(null),this.setOpen(!1)}toggleMenu(){this.toggleOpen()}getBitsAttr=e=>nn.getAttr(e,this.isCombobox?"combobox":void 0)}class dn extends sa{opts;isMulti=!1;#e=f(()=>this.opts.value.current!=="");get hasValue(){return t(this.#e)}set hasValue(e){s(this.#e,e)}#t=f(()=>this.opts.items.current.length?this.opts.items.current.find(e=>e.value===this.opts.value.current)?.label??"":"");get currentLabel(){return t(this.#t)}set currentLabel(e){s(this.#t,e)}#r=f(()=>this.opts.items.current.length?this.opts.items.current.filter(a=>!a.disabled).map(a=>a.label):[]);get candidateLabels(){return t(this.#r)}set candidateLabels(e){s(this.#r,e)}#s=f(()=>!(this.isMulti||this.opts.items.current.length===0));get dataTypeaheadEnabled(){return t(this.#s)}set dataTypeaheadEnabled(e){s(this.#s,e)}constructor(e){super(e),this.opts=e,Ot(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),_t(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}includesItem(e){return this.opts.value.current===e}toggleItem(e,a=e){const o=this.includesItem(e)?"":e;this.opts.value.current=o,o!==""&&(this.opts.inputValue.current=a)}setInitialHighlightedNode(){Yr(()=>{if(!(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))){if(this.opts.value.current!==""){const e=this.getNodeByValue(this.opts.value.current);if(e){this.setHighlightedNode(e,!0);return}}this.setHighlightedToFirstCandidate(!0)}})}}class cn extends sa{opts;isMulti=!0;#e=f(()=>this.opts.value.current.length>0);get hasValue(){return t(this.#e)}set hasValue(e){s(this.#e,e)}constructor(e){super(e),this.opts=e,Ot(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),_t(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,a=e){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(o=>o!==e):this.opts.value.current=[...this.opts.value.current,e],this.opts.inputValue.current=a}setInitialHighlightedNode(){Yr(()=>{if(this.domContext&&!(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))){if(this.opts.value.current.length&&this.opts.value.current[0]!==""){const e=this.getNodeByValue(this.opts.value.current[0]);if(e){this.setHighlightedNode(e,!0);return}}this.setHighlightedToFirstCandidate(!0)}})}}class un{static create(e){const{type:a,...o}=e,i=a==="single"?new dn(o):new cn(o);return or.set(i)}}class ns{static create(e){return new ns(e,or.get())}opts;root;attachment;#e;#t;constructor(e,a){this.opts=e,this.root=a,this.attachment=bt(e.ref,o=>this.root.triggerNode=o),this.root.domContext=new wr(e.ref),this.#e=new Xa({getCurrentItem:()=>this.root.highlightedNode,onMatch:o=>{this.root.setHighlightedNode(o)},getActiveElement:()=>this.root.domContext.getActiveElement(),getWindow:()=>this.root.domContext.getWindow()}),this.#t=new rn({getCurrentItem:()=>this.root.isMulti?"":this.root.currentLabel,onMatch:o=>{if(this.root.isMulti||!this.root.opts.items.current)return;const i=this.root.opts.items.current.find(h=>h.label===o);i&&(this.root.opts.value.current=i.value)},enabled:()=>!this.root.isMulti&&this.root.dataTypeaheadEnabled,candidateValues:()=>this.root.isMulti?[]:this.root.candidateLabels,getWindow:()=>this.root.domContext.getWindow()}),this.onkeydown=this.onkeydown.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onclick=this.onclick.bind(this)}#r(){this.root.opts.open.current=!0,this.#t.resetTypeahead(),this.#e.resetTypeahead()}#s(e){this.#r()}#a(){const e=this.root.highlightedValue===this.root.opts.value.current;return!this.root.opts.allowDeselect.current&&e&&!this.root.isMulti?(this.root.handleClose(),!0):(this.root.highlightedValue!==null&&this.root.toggleItem(this.root.highlightedValue,this.root.highlightedLabel??void 0),!this.root.isMulti&&!e?(this.root.handleClose(),!0):!1)}onkeydown(e){if(this.root.isUsingKeyboard=!0,(e.key===Wt||e.key===rr)&&e.preventDefault(),!this.root.opts.open.current){if(e.key===br||e.key===sr||e.key===rr||e.key===Wt)e.preventDefault(),this.root.handleOpen();else if(!this.root.isMulti&&this.root.dataTypeaheadEnabled){this.#t.handleTypeaheadSearch(e.key);return}if(this.root.hasValue)return;const u=this.root.getCandidateNodes();if(!u.length)return;if(e.key===rr){const v=u[0];this.root.setHighlightedNode(v)}else if(e.key===Wt){const v=u[u.length-1];this.root.setHighlightedNode(v)}return}if(e.key===ws){this.root.handleClose();return}if((e.key===br||e.key===sr&&this.#e.search==="")&&!e.isComposing&&(e.preventDefault(),this.#a()))return;if(e.key===Wt&&e.altKey&&this.root.handleClose(),on.includes(e.key)){e.preventDefault();const u=this.root.getCandidateNodes(),v=this.root.highlightedNode,w=v?u.indexOf(v):-1,k=this.root.opts.loop.current;let $;if(e.key===rr?$=Qa(u,w,k):e.key===Wt?$=Za(u,w,k):e.key===Ks?$=eo(u,w,10,k):e.key===qs?$=to(u,w,10,k):e.key===Bs?$=u[0]:e.key===Ws&&($=u[u.length-1]),!$)return;this.root.setHighlightedNode($);return}const a=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1,i=e.key===sr,h=this.root.getCandidateNodes();if(e.key!==ws){if(!a&&(o||i)){!this.#e.handleTypeaheadSearch(e.key,h)&&i&&(e.preventDefault(),this.#a());return}this.root.highlightedNode||this.root.setHighlightedToFirstCandidate()}}onclick(e){e.currentTarget.focus()}onpointerdown(e){if(this.root.opts.disabled.current)return;if(e.pointerType==="touch")return e.preventDefault();const a=e.target;a?.hasPointerCapture(e.pointerId)&&a?.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&(this.root.opts.open.current===!1?this.#s(e):this.root.handleClose())}onpointerup(e){this.root.opts.disabled.current||(e.preventDefault(),e.pointerType==="touch"&&(this.root.opts.open.current===!1?this.#s(e):this.root.handleClose()))}#o=f(()=>({id:this.opts.id.current,disabled:this.root.opts.disabled.current?!0:void 0,"aria-haspopup":"listbox","aria-expanded":ar(this.root.opts.open.current),"aria-activedescendant":this.root.highlightedId,"data-state":Jt(this.root.opts.open.current),"data-disabled":It(this.root.opts.disabled.current),"data-placeholder":this.root.hasValue?void 0:"",[this.root.getBitsAttr("trigger")]:"",onpointerdown:this.onpointerdown,onkeydown:this.onkeydown,onclick:this.onclick,onpointerup:this.onpointerup,...this.attachment}));get props(){return t(this.#o)}set props(e){s(this.#o,e)}}class is{static create(e){return ln.set(new is(e,or.get()))}opts;root;attachment;#e=z(!1);get isPositioned(){return t(this.#e)}set isPositioned(e){s(this.#e,e,!0)}domContext;constructor(e,a){this.opts=e,this.root=a,this.attachment=bt(e.ref,o=>this.root.contentNode=o),this.domContext=new wr(this.opts.ref),this.root.domContext===null&&(this.root.domContext=this.domContext),ro(()=>{this.root.contentNode=null,this.isPositioned=!1}),_t(()=>this.root.opts.open.current,()=>{this.root.opts.open.current||(this.isPositioned=!1)}),this.onpointermove=this.onpointermove.bind(this)}onpointermove(e){this.root.isUsingKeyboard=!1}#t=f(()=>wo(this.root.isCombobox?"combobox":"select"));onInteractOutside=e=>{if(e.target===this.root.triggerNode||e.target===this.root.inputNode){e.preventDefault();return}this.opts.onInteractOutside.current(e),!e.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=e=>{e.preventDefault()};onCloseAutoFocus=e=>{e.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#r=f(()=>({open:this.root.opts.open.current}));get snippetProps(){return t(this.#r)}set snippetProps(e){s(this.#r,e)}#s=f(()=>({id:this.opts.id.current,role:"listbox","aria-multiselectable":this.root.isMulti?"true":void 0,"data-state":Jt(this.root.opts.open.current),[this.root.getBitsAttr("content")]:"",style:{display:"flex",flexDirection:"column",outline:"none",boxSizing:"border-box",pointerEvents:"auto",...t(this.#t)},onpointermove:this.onpointermove,...this.attachment}));get props(){return t(this.#s)}set props(e){s(this.#s,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus,trapFocus:!1,loop:!1,onPlaced:()=>{this.root.opts.open.current&&(this.isPositioned=!0)}}}class ls{static create(e){return new ls(e,or.get())}opts;root;attachment;#e=f(()=>this.root.includesItem(this.opts.value.current));get isSelected(){return t(this.#e)}set isSelected(e){s(this.#e,e)}#t=f(()=>this.root.highlightedValue===this.opts.value.current);get isHighlighted(){return t(this.#t)}set isHighlighted(e){s(this.#t,e)}prevHighlighted=new Do(()=>this.isHighlighted);#r=z(!1);get mounted(){return t(this.#r)}set mounted(e){s(this.#r,e,!0)}constructor(e,a){this.opts=e,this.root=a,this.attachment=bt(e.ref),_t([()=>this.isHighlighted,()=>this.prevHighlighted.current],()=>{this.isHighlighted?this.opts.onHighlight.current():this.prevHighlighted.current&&this.opts.onUnhighlight.current()}),_t(()=>this.mounted,()=>{this.mounted&&this.root.setInitialHighlightedNode()}),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onpointermove=this.onpointermove.bind(this)}handleSelect(){if(this.opts.disabled.current)return;const e=this.opts.value.current===this.root.opts.value.current;if(!this.root.opts.allowDeselect.current&&e&&!this.root.isMulti){this.root.handleClose();return}this.root.toggleItem(this.opts.value.current,this.opts.label.current),!this.root.isMulti&&!e&&this.root.handleClose()}#s=f(()=>({selected:this.isSelected,highlighted:this.isHighlighted}));get snippetProps(){return t(this.#s)}set snippetProps(e){s(this.#s,e)}onpointerdown(e){e.preventDefault()}onpointerup(e){if(!(e.defaultPrevented||!this.opts.ref.current)){if(e.pointerType==="touch"&&!so){Hs(this.opts.ref.current,"click",()=>{this.handleSelect(),this.root.setHighlightedNode(this.opts.ref.current)},{once:!0});return}e.preventDefault(),this.handleSelect(),e.pointerType==="touch"&&this.root.setHighlightedNode(this.opts.ref.current)}}onpointermove(e){e.pointerType!=="touch"&&this.root.highlightedNode!==this.opts.ref.current&&this.root.setHighlightedNode(this.opts.ref.current)}#a=f(()=>({id:this.opts.id.current,role:"option","aria-selected":this.root.includesItem(this.opts.value.current)?"true":void 0,"data-value":this.opts.value.current,"data-disabled":It(this.opts.disabled.current),"data-highlighted":this.root.highlightedValue===this.opts.value.current&&!this.opts.disabled.current?"":void 0,"data-selected":this.root.includesItem(this.opts.value.current)?"":void 0,"data-label":this.opts.label.current,[this.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,...this.attachment}));get props(){return t(this.#a)}set props(e){s(this.#a,e)}}class ds{static create(e){return new ds(e,or.get())}opts;root;#e=f(()=>this.root.opts.name.current!=="");get shouldRender(){return t(this.#e)}set shouldRender(e){s(this.#e,e)}constructor(e,a){this.opts=e,this.root=a,this.onfocus=this.onfocus.bind(this)}onfocus(e){e.preventDefault(),this.root.isCombobox?this.root.inputNode?.focus():this.root.triggerNode?.focus()}#t=f(()=>({disabled:Cs(this.root.opts.disabled.current),required:Cs(this.root.opts.required.current),name:this.root.opts.name.current,value:this.opts.value.current,onfocus:this.onfocus}));get props(){return t(this.#t)}set props(e){s(this.#t,e)}}function jr(d,e){De(e,!0);let a=_(e,"value",15);const o=ds.create({value:C(()=>a())});var i=x(),h=n(i);{var u=v=>{ra(v,ht(()=>o.props,{get autocomplete(){return e.autocomplete},get value(){return a()},set value(w){a(w)}}))};H(h,v=>{o.shouldRender&&v(u)})}r(d,i),Me()}var hn=c("<div><div><!></div></div>"),vn=c("<div><div><!></div></div>");function fn(d,e){const a=yt();De(e,!0);let o=_(e,"id",19,()=>xt(a)),i=_(e,"ref",15,null),h=_(e,"forceMount",3,!1),u=_(e,"side",3,"bottom"),v=_(e,"onInteractOutside",3,kt),w=_(e,"onEscapeKeydown",3,kt),k=_(e,"preventScroll",3,!1),$=Ye(e,["$$slots","$$events","$$legacy","id","ref","forceMount","side","onInteractOutside","onEscapeKeydown","children","child","preventScroll","style"]);const S=is.create({id:C(()=>o()),ref:C(()=>i(),L=>i(L)),onInteractOutside:C(()=>v()),onEscapeKeydown:C(()=>w())}),R=f(()=>dt($,S.props));var T=x(),m=n(T);{var P=L=>{Co(L,ht(()=>t(R),()=>S.popperProps,{get ref(){return S.opts.ref},get side(){return u()},get enabled(){return S.root.opts.open.current},get id(){return o()},get preventScroll(){return k()},forceMount:!0,get shouldRender(){return S.shouldRender},popper:(oe,ye)=>{let ue=()=>ye?.().props,Qe=()=>ye?.().wrapperProps;const te=f(()=>dt(ue(),{style:S.props.style},{style:e.style}));var Ve=x(),nt=n(Ve);{var st=Ke=>{var Fe=x(),je=n(Fe);{let Je=f(()=>({props:t(te),wrapperProps:Qe(),...S.snippetProps}));Ne(je,()=>e.child,()=>t(Je))}r(Ke,Fe)},zt=Ke=>{var Fe=hn();tt(Fe,()=>({...Qe()}));var je=b(Fe);tt(je,()=>({...t(te)}));var Je=b(je);Ne(Je,()=>e.children??ot),p(je),p(Fe),r(Ke,Fe)};H(nt,Ke=>{e.child?Ke(st):Ke(zt,!1)})}r(oe,Ve)},$$slots:{popper:!0}}))},E=L=>{ko(L,ht(()=>t(R),()=>S.popperProps,{get ref(){return S.opts.ref},get side(){return u()},get open(){return S.root.opts.open.current},get id(){return o()},get preventScroll(){return k()},forceMount:!1,get shouldRender(){return S.shouldRender},popper:(oe,ye)=>{let ue=()=>ye?.().props,Qe=()=>ye?.().wrapperProps;const te=f(()=>dt(ue(),{style:S.props.style},{style:e.style}));var Ve=x(),nt=n(Ve);{var st=Ke=>{var Fe=x(),je=n(Fe);{let Je=f(()=>({props:t(te),wrapperProps:Qe(),...S.snippetProps}));Ne(je,()=>e.child,()=>t(Je))}r(Ke,Fe)},zt=Ke=>{var Fe=vn();tt(Fe,()=>({...Qe()}));var je=b(Fe);tt(je,()=>({...t(te)}));var Je=b(je);Ne(Je,()=>e.children??ot),p(je),p(Fe),r(Ke,Fe)};H(nt,Ke=>{e.child?Ke(st):Ke(zt,!1)})}r(oe,Ve)},$$slots:{popper:!0}}))};H(m,L=>{h()?L(P):h()||L(E,1)})}r(d,T),Me()}function gn(d,e){De(e,!0);let a=_(e,"mounted",15,!1),o=_(e,"onMountedChange",3,kt);Mo(()=>(a(!0),o()(!0),()=>{a(!1),o()(!1)})),Me()}var pn=c("<div><!></div>"),mn=c("<!> <!>",1);function _n(d,e){const a=yt();De(e,!0);let o=_(e,"id",19,()=>xt(a)),i=_(e,"ref",15,null),h=_(e,"label",19,()=>e.value),u=_(e,"disabled",3,!1),v=_(e,"onHighlight",3,kt),w=_(e,"onUnhighlight",3,kt),k=Ye(e,["$$slots","$$events","$$legacy","id","ref","value","label","disabled","children","child","onHighlight","onUnhighlight"]);const $=ls.create({id:C(()=>o()),ref:C(()=>i(),L=>i(L)),value:C(()=>e.value),disabled:C(()=>u()),label:C(()=>h()),onHighlight:C(()=>v()),onUnhighlight:C(()=>w())}),S=f(()=>dt(k,$.props));var R=mn(),T=n(R);{var m=L=>{var N=x(),oe=n(N);{let ye=f(()=>({props:t(S),...$.snippetProps}));Ne(oe,()=>e.child,()=>t(ye))}r(L,N)},P=L=>{var N=pn();tt(N,()=>({...t(S)}));var oe=b(N);Ne(oe,()=>e.children??ot,()=>$.snippetProps),p(N),r(L,N)};H(T,L=>{e.child?L(m):L(P,!1)})}var E=l(T,2);gn(E,{get mounted(){return $.mounted},set mounted(L){$.mounted=L}}),r(d,R),Me()}var yn=c("<!> <!>",1);function bn(d,e){De(e,!0);let a=_(e,"value",15),o=_(e,"onValueChange",3,kt),i=_(e,"name",3,""),h=_(e,"disabled",3,!1),u=_(e,"open",15,!1),v=_(e,"onOpenChange",3,kt),w=_(e,"onOpenChangeComplete",3,kt),k=_(e,"loop",3,!1),$=_(e,"scrollAlignment",3,"nearest"),S=_(e,"required",3,!1),R=_(e,"items",19,()=>[]),T=_(e,"allowDeselect",3,!1);function m(){a()===void 0&&a(e.type==="single"?"":[])}m(),_t.pre(()=>a(),()=>{m()});let P=z("");const E=un.create({type:e.type,value:C(()=>a(),te=>{a(te),o()(te)}),disabled:C(()=>h()),required:C(()=>S()),open:C(()=>u(),te=>{u(te),v()(te)}),loop:C(()=>k()),scrollAlignment:C(()=>$()),name:C(()=>i()),isCombobox:!1,items:C(()=>R()),allowDeselect:C(()=>T()),inputValue:C(()=>t(P),te=>s(P,te,!0)),onOpenChangeComplete:C(()=>w())});var L=yn(),N=n(L);So(N,{children:(te,Ve)=>{var nt=x(),st=n(nt);Ne(st,()=>e.children??ot),r(te,nt)},$$slots:{default:!0}});var oe=l(N,2);{var ye=te=>{var Ve=x(),nt=n(Ve);{var st=Ke=>{jr(Ke,{get autocomplete(){return e.autocomplete}})},zt=Ke=>{var Fe=x(),je=n(Fe);ft(je,16,()=>E.opts.value.current,Je=>Je,(Je,Vt)=>{jr(Je,{get value(){return Vt},get autocomplete(){return e.autocomplete}})}),r(Ke,Fe)};H(nt,Ke=>{E.opts.value.current.length===0?Ke(st):Ke(zt,!1)})}r(te,Ve)},ue=f(()=>Array.isArray(E.opts.value.current)),Qe=te=>{jr(te,{get autocomplete(){return e.autocomplete},get value(){return E.opts.value.current},set value(Ve){E.opts.value.current=Ve}})};H(oe,te=>{t(ue)?te(ye):te(Qe,!1)})}r(d,L),Me()}var xn=c("<button><!></button>");function $n(d,e){const a=yt();De(e,!0);let o=_(e,"id",19,()=>xt(a)),i=_(e,"ref",15,null),h=_(e,"type",3,"button"),u=Ye(e,["$$slots","$$events","$$legacy","id","ref","child","children","type"]);const v=ns.create({id:C(()=>o()),ref:C(()=>i(),S=>i(S))}),w=f(()=>dt(u,v.props,{type:h()}));var k=x(),$=n(k);y($,()=>zo,(S,R)=>{R(S,{get id(){return o()},get ref(){return v.opts.ref},children:(T,m)=>{var P=x(),E=n(P);{var L=oe=>{var ye=x(),ue=n(ye);Ne(ue,()=>e.child,()=>({props:t(w)})),r(oe,ye)},N=oe=>{var ye=xn();tt(ye,()=>({...t(w)}));var ue=b(ye);Ne(ue,()=>e.children??ot),p(ye),r(oe,ye)};H(E,oe=>{e.child?oe(L):oe(N,!1)})}r(T,P)},$$slots:{default:!0}})}),r(d,k),Me()}var Pn=c("<div><!></div>");function _r(d,e){De(e,!0);var a=Pn(),o=b(a);Ne(o,()=>e.children),p(a),se(i=>mo(a,1,i),[()=>po(St("dialog-footer",e.class))]),r(d,a),Me()}var wn=c("<span> </span>"),Cn=c('<span class="select-placeholder"> </span>'),kn=c("<!> <!>",1);function Os(d,e){De(e,!0);let a=_(e,"placeholder",3,"Select..."),o=_(e,"size",3,"default"),i=Ye(e,["$$slots","$$events","$$legacy","children","value","placeholder","class","size"]);var h=x(),u=n(h);{let v=f(()=>St("select-trigger",o()==="sm"&&"select-trigger-sm",e.class));y(u,()=>$n,(w,k)=>{k(w,ht({get class(){return t(v)}},()=>i,{children:($,S)=>{var R=kn(),T=n(R);{var m=N=>{var oe=x(),ye=n(oe);Ne(ye,()=>e.children),r(N,oe)},P=N=>{var oe=wn(),ye=b(oe,!0);p(oe),se(()=>Z(ye,e.value)),r(N,oe)},E=N=>{var oe=Cn(),ye=b(oe,!0);p(oe),se(()=>Z(ye,a())),r(N,oe)};H(T,N=>{e.children?N(m):e.value?N(P,1):N(E,!1)})}var L=l(T,2);{let N=f(()=>o()==="sm"?12:14);ao(L,{get size(){return t(N)},class:"select-chevron"})}r($,R)},$$slots:{default:!0}}))})}r(d,h),Me()}function Es(d,e){De(e,!0);let a=_(e,"side",3,"bottom"),o=_(e,"sideOffset",3,4),i=Ye(e,["$$slots","$$events","$$legacy","children","class","side","sideOffset"]);var h=x(),u=n(h);y(u,()=>oo,(v,w)=>{w(v,{children:(k,$)=>{var S=x(),R=n(S);{let T=f(()=>St("select-content",e.class));y(R,()=>fn,(m,P)=>{P(m,ht({get class(){return t(T)},get side(){return a()},get sideOffset(){return o()}},()=>i,{children:(E,L)=>{var N=x(),oe=n(N);Ne(oe,()=>e.children),r(E,N)},$$slots:{default:!0}}))})}r(k,S)},$$slots:{default:!0}})}),r(d,h),Me()}var Sn=c('<span class="select-item-text"> </span> <!>',1);function Jr(d,e){De(e,!0);let a=_(e,"disabled",3,!1),o=Ye(e,["$$slots","$$events","$$legacy","value","label","disabled","class"]);var i=x(),h=n(i);{const u=(w,k)=>{let $=()=>k?.().selected;var S=Sn(),R=n(S),T=b(R,!0);p(R);var m=l(R,2);{var P=E=>{xr(E,{size:12,class:"select-item-check"})};H(m,E=>{$()&&E(P)})}se(()=>Z(T,e.label??e.value)),r(w,S)};let v=f(()=>St("select-item",e.class));y(h,()=>_n,(w,k)=>{k(w,ht({get value(){return e.value},get label(){return e.label},get disabled(){return a()},get class(){return t(v)}},()=>o,{children:u,$$slots:{default:!0}}))})}r(d,i),Me()}const Vs=bn;function Bt(d,e){De(e,!0);let a=_(e,"ref",15,null),o=_(e,"loadingStatus",15,"loading"),i=Ye(e,["$$slots","$$events","$$legacy","ref","loadingStatus","class"]);var h=x(),u=n(h);{let v=f(()=>St("relative flex size-[22px] shrink-0 overflow-hidden rounded-full border border-[var(--color-border)]",e.class));y(u,()=>Bo,(w,k)=>{k(w,ht({"data-slot":"avatar",get class(){return t(v)}},()=>i,{get ref(){return a()},set ref($){a($)},get loadingStatus(){return o()},set loadingStatus($){o($)}}))})}r(d,h),Me()}function Kt(d,e){De(e,!0);let a=_(e,"ref",15,null),o=Ye(e,["$$slots","$$events","$$legacy","ref","class"]);var i=x(),h=n(i);{let u=f(()=>St("bg-[var(--color-bg-surface)] flex size-full items-center justify-center rounded-full text-[10px] font-semibold text-[var(--color-text-secondary)]",e.class));y(h,()=>Wo,(v,w)=>{w(v,ht({"data-slot":"avatar-fallback",get class(){return t(u)}},()=>o,{get ref(){return a()},set ref(k){a(k)}}))})}r(d,i),Me()}const zn=_o({base:"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border px-2 py-0.5 text-[11px] font-medium whitespace-nowrap [&>svg]:pointer-events-none [&>svg]:size-3",variants:{variant:{default:"bg-[var(--color-bg-surface)] text-[var(--color-text-secondary)] border-[var(--color-border)]",accent:"bg-transparent text-[var(--color-accent)] border-transparent",secondary:"bg-[var(--color-badge-bg)] text-[var(--color-badge-text)] border-transparent",destructive:"bg-[var(--color-destructive)] text-white border-transparent",outline:"bg-transparent text-[var(--color-text-secondary)] border-[var(--color-border)]"}},defaultVariants:{variant:"default"}});function tr(d,e){De(e,!0);let a=_(e,"ref",15,null),o=_(e,"variant",3,"default"),i=Ye(e,["$$slots","$$events","$$legacy","ref","href","class","variant","children"]);var h=x(),u=n(h);vo(u,()=>e.href?"a":"span",!1,(v,w)=>{Cr(v,S=>a(S),()=>a()),tt(v,S=>({"data-slot":"badge",href:e.href,class:S,...i}),[()=>St(zn({variant:o()}),e.class)]);var k=x(),$=n(k);Ne($,()=>e.children??ot),r(w,k)}),r(d,h),Me()}var Nn=c("<textarea></textarea>");function Fs(d,e){De(e,!0);let a=_(e,"ref",15,null),o=_(e,"value",15),i=Ye(e,["$$slots","$$events","$$legacy","class","ref","value"]);var h=Nn();La(h),tt(h,u=>({class:u,...i}),[()=>St("w-full rounded-md border border-[var(--color-border)] bg-[var(--color-bg)] px-2.5 py-2 text-[13px] text-[var(--color-text-primary)] font-[inherit] leading-relaxed outline-none transition-colors placeholder:text-[var(--color-text-tertiary)] focus:border-[var(--color-accent,#6e6ee8)] disabled:cursor-not-allowed disabled:opacity-50",e.class)]),Cr(h,u=>a(u),()=>a()),Js(h,o),r(d,h),Me()}var An=c("<label><!></label>");function Ct(d,e){De(e,!0);let a=_(e,"ref",15,null),o=Ye(e,["$$slots","$$events","$$legacy","class","ref","children"]);var i=An();tt(i,u=>({class:u,...o}),[()=>St("text-xs font-medium text-[var(--color-text-secondary)]",e.class)]);var h=b(i);Ne(h,()=>e.children??ot),p(i),Cr(i,u=>a(u),()=>a()),r(d,i),Me()}function Rn(d,e){const a=kr(e,["children","$$slots","$$events","$$legacy"]);const o=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]];Sr(d,ht({name:"key-round"},()=>a,{get iconNode(){return o},children:(i,h)=>{var u=x(),v=n(u);zr(v,e,"default",{}),r(i,u)},$$slots:{default:!0}}))}function In(d,e){const a=kr(e,["children","$$slots","$$events","$$legacy"]);const o=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];Sr(d,ht({name:"external-link"},()=>a,{get iconNode(){return o},children:(i,h)=>{var u=x(),v=n(u);zr(v,e,"default",{}),r(i,u)},$$slots:{default:!0}}))}function Dn(d,e){const a=kr(e,["children","$$slots","$$events","$$legacy"]);const o=[["path",{d:"M5 12h14"}]];Sr(d,ht({name:"minus"},()=>a,{get iconNode(){return o},children:(i,h)=>{var u=x(),v=n(u);zr(v,e,"default",{}),r(i,u)},$$slots:{default:!0}}))}var Mn=c('<span class="flex items-center justify-center text-current"><!></span>');function Tn(d,e){De(e,!0);let a=_(e,"checked",15,!1),o=_(e,"indeterminate",15,!1),i=_(e,"ref",15,null),h=Ye(e,["$$slots","$$events","$$legacy","class","checked","indeterminate","ref"]);var u=x(),v=n(u);{const w=($,S)=>{let R=()=>S?.().checked,T=()=>S?.().indeterminate;var m=Mn(),P=b(m);{var E=N=>{Dn(N,{class:"size-3"})},L=N=>{xr(N,{class:"size-3"})};H(P,N=>{T()?N(E):R()&&N(L,1)})}p(m),r($,m)};let k=f(()=>St("peer inline-flex size-4 shrink-0 items-center justify-center rounded-sm border border-[var(--color-border)] bg-transparent transition-colors","hover:border-[var(--color-accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-primary)]","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-[var(--color-accent)] data-[state=checked]:bg-[var(--color-accent)] data-[state=checked]:text-white",e.class));y(v,()=>Zo,($,S)=>{S($,ht({get class(){return t(k)}},()=>h,{get checked(){return a()},set checked(R){a(R)},get indeterminate(){return o()},set indeterminate(R){o(R)},get ref(){return i()},set ref(R){i(R)},children:w,$$slots:{default:!0}}))})}r(d,u),Me()}var On=c('<div class="json-editor-wrap svelte-1grruw9"></div>');function En(d,e){De(e,!0);const a=Ua("theme");let o,i=null,h=e.content,u=!1;function v(S,R){return S.theme({"&":{backgroundColor:"var(--color-bg-surface)",color:"var(--color-text-primary)",fontSize:"12px",fontFamily:"'SF Mono', 'Fira Code', 'Cascadia Code', monospace",borderRadius:"6px",border:"1px solid var(--color-border)"},".cm-content":{padding:"12px",caretColor:"var(--color-accent)",lineHeight:"1.5"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:R?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:R?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},"&.cm-focused":{outline:"none"}},{dark:R})}qa(async()=>{const{EditorState:S}=await er(async()=>{const{EditorState:te}=await import("../chunks/Cs5oz2oJ.js");return{EditorState:te}},[],import.meta.url),{EditorView:R,keymap:T}=await er(async()=>{const{EditorView:te,keymap:Ve}=await import("../chunks/BVBRzmeQ.js").then(nt=>nt.i);return{EditorView:te,keymap:Ve}},__vite__mapDeps([0,1]),import.meta.url),{json:m}=await er(async()=>{const{json:te}=await import("../chunks/BBLgaWN8.js");return{json:te}},__vite__mapDeps([2,3,4,5,1,0]),import.meta.url),{syntaxHighlighting:P,HighlightStyle:E}=await er(async()=>{const{syntaxHighlighting:te,HighlightStyle:Ve}=await import("../chunks/D2aTbzFm.js");return{syntaxHighlighting:te,HighlightStyle:Ve}},__vite__mapDeps([5,4,1,0]),import.meta.url),{tags:L}=await er(async()=>{const{tags:te}=await import("../chunks/BXuvR8Ks.js").then(Ve=>Ve.i);return{tags:te}},[],import.meta.url),N=a.current==="dark",oe=v(R,N),ye=E.define([{tag:L.propertyName,color:N?"#7cacf8":"#1a56db"},{tag:L.string,color:N?"#a8d4a0":"#2d7a3a"},{tag:L.number,color:N?"#d4a0d4":"#9333ea"},{tag:L.bool,color:N?"#f0a870":"#b45309"},{tag:L.null,color:N?"#888":"#666"},{tag:L.punctuation,color:N?"#888":"#999"}]),ue=[m(),oe,P(ye),R.lineWrapping];e.onchange&&ue.push(R.updateListener.of(te=>{if(te.docChanged&&!u){const Ve=te.state.doc.toString();h=Ve,e.onchange(Ve)}})),e.onsave&&ue.push(T.of([{key:"Mod-s",run:()=>(e.onsave(),!0)}]));const Qe=S.create({doc:e.content,extensions:ue});i=new R({state:Qe,parent:o})}),Ot(()=>{i&&e.content!==h&&(h=e.content,u=!0,i.dispatch({changes:{from:0,to:i.state.doc.length,insert:e.content}}),u=!1)}),Ba(()=>{i?.destroy()});function w(){return i?i.state.doc.toString():e.content}var k={getContent:w},$=On();return Cr($,S=>o=S,()=>o),r(d,$),Me(k)}function Vn(){return Nr("/api/permissions/collections")}function Fn(d,e){return Nr("/api/permissions/grant",{method:"POST",body:JSON.stringify({userId:d,collection:e})})}function Hn(d,e){return Nr("/api/permissions/revoke",{method:"POST",body:JSON.stringify({userId:d,collection:e})})}function Ln(d,e){const a=kr(e,["children","$$slots","$$events","$$legacy"]);const o=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];Sr(d,ht({name:"copy"},()=>a,{get iconNode(){return o},children:(i,h)=>{var u=x(),v=n(u);zr(v,e,"default",{}),r(i,u)},$$slots:{default:!0}}))}var Un=c('<div class="status-msg error svelte-zymv0t"> </div>'),qn=c('<div class="status-msg error svelte-zymv0t"> </div>'),Bn=c('<div class="about-actions svelte-zymv0t"><!> <!></div>'),Kn=c("<!> ",1),Wn=c("<!> Copied",1),jn=c("<!> Copy",1),Jn=c('<div class="mcp-section svelte-zymv0t"><div class="mcp-header svelte-zymv0t"><!> <div class="mcp-actions svelte-zymv0t"><!> <!></div></div> <p class="mcp-hint svelte-zymv0t">Add this to your MCP client config (Claude Code, Cursor, etc.) to connect to this workspace.</p> <!></div>'),Gn=c('<div class="tab-header svelte-zymv0t"><h2 class="tab-title svelte-zymv0t">Workspace</h2> <p class="tab-description svelte-zymv0t">Describe your workspace so agents understand your organization.</p></div> <div class="about-section svelte-zymv0t"><div class="ws-field svelte-zymv0t"><!> <!></div> <div class="ws-field svelte-zymv0t"><!> <!></div> <!> <!></div> <!>',1),Yn=c('<div class="loading-text svelte-zymv0t">Loading users...</div>'),Xn=c("<!> Add Member",1),Qn=c("<!> <!>",1),Zn=c('<div class="member-row svelte-zymv0t"><!> <span class="member-name-cell svelte-zymv0t"><span class="member-name svelte-zymv0t"> </span> <!></span> <span class="member-email svelte-zymv0t"> </span> <span class="member-actions svelte-zymv0t"><!></span></div>'),ei=c("<!> <!>",1),ti=c("<!> <!>",1),ri=c("<!> <!>",1),si=c("<!> <!>",1),ai=c('<div class="status-msg error mb-4 svelte-zymv0t"> </div>'),oi=c("<!> <!>",1),ni=c("<!> <form><!> <!> <!></form>",1),ii=c("<!> <!>",1),li=c("<!> <!>",1),di=c('<div class="status-msg error svelte-zymv0t"> </div>'),ci=c('<p style="color: var(--color-text-tertiary); font-size: 13px; margin-bottom: 12px;">Create a new user account for this workspace.</p> <div class="dialog-fields svelte-zymv0t"><div class="dialog-field svelte-zymv0t"><!> <!></div> <div class="dialog-field svelte-zymv0t"><!> <!></div> <div class="dialog-field svelte-zymv0t"><!> <!></div> <div class="dialog-field svelte-zymv0t"><!> <!></div></div> <!>',1),ui=c("<!> <!>",1),hi=c("<!> <form><!> <!></form>",1),vi=c('<div class="content-toolbar svelte-zymv0t"><span class="content-count svelte-zymv0t"> </span> <!></div> <div class="member-list svelte-zymv0t"></div> <!> <!> <!>',1),fi=c('<div class="tab-header svelte-zymv0t"><h2 class="tab-title svelte-zymv0t">Team</h2> <p class="tab-description svelte-zymv0t">Manage who has access to this workspace.</p></div> <!>',1),gi=c('<div class="loading-text svelte-zymv0t">Loading collections...</div>'),pi=c('<span class="accordion-chevron svelte-zymv0t"><!></span> <span class="accordion-label svelte-zymv0t"> </span> <!>',1),mi=c('<div class="member-row svelte-zymv0t"><!> <span class="member-name-cell svelte-zymv0t"><span class="member-name svelte-zymv0t"> </span> <!></span> <span class="member-email svelte-zymv0t"> </span> <span class="member-actions svelte-zymv0t"></span></div>'),_i=c('<div class="member-row confirm-row svelte-zymv0t"><span class="confirm-text svelte-zymv0t"> </span> <!> <!></div>'),yi=c('<div class="member-row svelte-zymv0t"><!> <span class="member-name-cell svelte-zymv0t"><span class="member-name svelte-zymv0t"> </span></span> <span class="member-email svelte-zymv0t"> </span> <span class="member-actions svelte-zymv0t"><!></span></div>'),bi=c('<div class="section-header svelte-zymv0t"><span class="section-label svelte-zymv0t">Members</span> <!></div> <!> <!>',1),xi=c("<!> <!>",1),$i=c('<div class="modal-member-row svelte-zymv0t" role="button" tabindex="0"><!> <div class="modal-member-info svelte-zymv0t"><span class="member-name svelte-zymv0t"> </span> <span class="member-email svelte-zymv0t"> </span></div></div>'),Pi=c('<div class="modal-member-list svelte-zymv0t"></div>'),wi=c('<p style="color: var(--color-text-tertiary); font-size: 13px; margin-bottom: 12px;">Select a user to grant access to this collection.</p> <!>',1),Ci=c("<!> <!> <!>",1),ki=c("<!> <!>",1),Si=c('<div class="tab-header svelte-zymv0t"><h2 class="tab-title svelte-zymv0t">Permissions</h2> <p class="tab-description svelte-zymv0t">Control which users can access each collection.</p></div> <!>',1),zi=c('<div class="loading-text svelte-zymv0t">Loading...</div>'),Ni=c('<span class="accordion-chevron svelte-zymv0t"><!></span> <span class="accordion-label svelte-zymv0t"> </span> <!>',1),Ai=c('<div class="member-row svelte-zymv0t"><!> <span class="member-name-cell svelte-zymv0t"><span class="member-name svelte-zymv0t"> </span> <!></span> <span class="member-email svelte-zymv0t"></span> <span class="member-actions svelte-zymv0t"><!></span></div>'),Ri=c('<div class="section-header svelte-zymv0t"><span class="section-label svelte-zymv0t">Collections</span> <!></div> <!>',1),Ii=c("<!> <!>",1),Di=c('<p style="color: var(--color-text-tertiary); font-size: 13px; padding: 20px 0; text-align: center;">No sync sources configured. Connect a service in the Connectors tab to get started.</p>'),Mi=c("<!> <!>",1),Ti=c('<label class="checkbox-item svelte-zymv0t"><!> <span> </span></label>'),Oi=c('<div class="checkbox-list svelte-zymv0t"></div>'),Ei=c('<div class="dialog-field svelte-zymv0t"><!> <!></div>'),Vi=c('<p style="color: var(--color-text-tertiary); font-size: 13px; margin-bottom: 12px;">Select a collection to sync entities into.</p> <div class="dialog-fields svelte-zymv0t"><div class="dialog-field svelte-zymv0t"><!> <!></div> <!></div>',1),Fi=c("<!> <!>",1),Hi=c("<!> <!> <!>",1),Li=c("<!> <!> <!>",1),Ui=c('<div class="tab-header svelte-zymv0t"><h2 class="tab-title svelte-zymv0t">Sync Sources</h2> <p class="tab-description svelte-zymv0t">Assign sync sources to collections.</p></div> <!>',1),qi=c('<div class="loading-text svelte-zymv0t">Loading connectors...</div>'),Bi=c('<div class="loading-text svelte-zymv0t">No connectors available</div>'),Ki=c("<!> Connected",1),Wi=c('<span class="connector-row-actions svelte-zymv0t"><!> <!></span>'),ji=c('<div class="connector-row svelte-zymv0t"><!> <span class="member-name svelte-zymv0t"> </span> <!></div>'),Ji=c('<div class="loading-text svelte-zymv0t" style="padding: 8px 0;">Loading...</div>'),Gi=c('<div class="status-msg error svelte-zymv0t"> </div>'),Yi=c("<!> <!>",1),Xi=c('<p class="connector-hint"><!></p>'),Qi=c('<span style="font-size: 12px; color: var(--color-text-tertiary); margin-top: 8px;"> </span>'),Zi=c('<div style="display: flex; flex-direction: column; gap: 6px;"><!> <!> <!></div>'),el=c('<a target="_blank" rel="noopener noreferrer" class="connector-docs-link"><!> API docs</a>'),tl=c('<div class="status-msg error svelte-zymv0t"> </div>'),rl=c('<!> <div style="display: flex; flex-direction: column; gap: 16px; margin-top: 24px;"></div> <!> <!>',1),sl=c('<p class="connector-description"> </p> <!>',1),al=c('<div style="flex: 1;"></div> <!> <!>',1),ol=c("<!> <!>",1),nl=c('<!> <div style="flex: 1;"></div> <!>',1),il=c("<!> <!> <!>",1),ll=c("<!> <!>",1),dl=c("<!> <!>",1),cl=c("<!> <!>",1),ul=c('<div class="connector-list svelte-zymv0t"></div> <!> <!>',1),hl=c('<div class="tab-header svelte-zymv0t"><h2 class="tab-title svelte-zymv0t">Connectors</h2> <p class="tab-description svelte-zymv0t">MCP connectors available to the agent and sync sources.</p></div> <!>',1),vl=c('<div class="settings-page svelte-zymv0t"><div class="settings-header svelte-zymv0t"></div> <div class="settings-content svelte-zymv0t"><!> <!></div></div>');function fl(d,e){De(e,!0);let a=f(()=>js.settingsTab),o=z(gt([])),i=z(!1),h=z(gt([])),u=z(!1),v=z(""),w=z(!1),k=z(""),$=z(""),S=z(""),R=z("member"),T=z(!1),m=z(""),P=z(null),E=z(!1),L=z(null),N=z(""),oe=z(!1),ye=z(""),ue=z(null),Qe=z(null),te=z(null),Ve=z(!1),nt=z(gt([])),st=z(gt([])),zt=z(!1),Ke=z(!1),Fe=z(null),je=z(""),Je=z(""),Vt=z(!1),Ft=z(!1),$t=z(null),Mt=z(null),Nt=z(gt({})),Gt=z(!1),Dt=z(!1),Pt=z(""),vt=z(null),wt=z(""),At=z(gt([])),cs=z(gt([])),us=z(gt([])),hs=z(gt(lt.repos.length)),Rr=z(!0),Ir=z(!0);Ot(()=>{const g=lt.repos.length;g!==t(hs)&&(s(hs,g,!0),s(Rr,!0),s(Ir,!0))}),Ot(()=>{t(a)==="general"&&!t(cr)&&ys(),t(a)==="users"&&t(o).length===0&&Dr(),t(a)==="collections"&&t(Rr)&&(s(Rr,!1),nr()),t(a)==="sources"&&(t(Ir)||!t(Ke))&&(s(Ir,!1),ps()),t(a)==="connectors"&&!t(_s)&&ga()});async function Dr(){s(i,!0),s(v,"");try{const g=await Ns();s(o,g.users,!0)}catch(g){s(v,g.message,!0)}finally{s(i,!1)}}async function nr(){s(u,!0),s(v,"");try{const[g,A]=await Promise.all([t(o).length===0?Ns():Promise.resolve({users:t(o)}),Vn()]);s(o,g.users,!0),s(h,A,!0)}catch(g){s(v,g.message,!0)}finally{s(u,!1)}}async function aa(g){g.preventDefault(),s(m,""),s(T,!0);try{await $o(t($),t(S),t(k)||t($).split("@")[0],t(R)),s(k,""),s($,""),s(S,""),s(R,"member"),s(w,!1),await Dr()}catch(A){s(m,A.message||"Failed to create user",!0)}finally{s(T,!1)}}async function oa(){if(t(P)){s(E,!0);try{await bo(t(P).id),s(P,null),await Dr(),t(h).length>0&&nr()}catch(g){s(v,g.message,!0),s(P,null)}finally{s(E,!1)}}}async function na(){if(!(!t(L)||!t(N))){s(oe,!0),s(ye,"");try{await xo(t(L).id,t(N)),s(L,null),s(N,"")}catch(g){s(ye,g.message||"Failed to reset password",!0)}finally{s(oe,!1)}}}function ia(){return t(o).filter(g=>g.role==="admin")}function vs(g){const A=new Set(g.users.map(he=>he.id));return t(o).filter(he=>he.role==="member"&&!A.has(he.id))}async function fs(g,A){s(Qe,g,!0);try{await Fn(A,g),s(ue,null),await nr()}catch(he){s(v,he.message,!0)}finally{s(Qe,null)}}async function la(){if(t(te)){s(Ve,!0);try{await Hn(t(te).user.id,t(te).collection),s(te,null),await nr()}catch(g){s(v,g.message,!0),s(te,null)}finally{s(Ve,!1)}}}async function da(g){s(Gt,!0),s(Pt,"");try{const A=await lo(g);s(Mt,A.config,!0),s(Nt,{},!0);const he=t(st).find(He=>He.name===g);if(he)for(const He of he.credentialFields){const Xe=t(Mt)?ca(t(Mt),He.key):"";t(Nt)[He.key]=Xe??""}}catch(A){s(Pt,A.message,!0)}finally{s(Gt,!1)}}function ca(g,A){if(A.startsWith("env.")){const he=A.slice(4);return g.env?.[he]}return g[A]}async function ua(g){s(Dt,!0),s(Pt,"");try{await zs(g,t(Nt));const A=await Zt();s(st,A.connectors,!0),s(Mt,null),s(Nt,{},!0),s($t,null)}catch(A){s(Pt,A.message,!0)}finally{s(Dt,!1)}}async function ha(g){s(Dt,!0),s(Pt,"");try{await zs(g,{});const A=await Zt();s(st,A.connectors,!0)}catch(A){s(Pt,A.message,!0)}finally{s(Dt,!1)}}function gs(g){s($t,g,!0),s(Mt,null),s(Nt,{},!0),s(Pt,""),da(g)}function va(g){s(Ft,!0),s($t,g,!0),s(Mt,null),s(Nt,{},!0),s(Pt,""),s(Gt,!1),pa(g)}function Ht(){s($t,null),s(Mt,null),s(Nt,{},!0),s(Pt,""),s(Fe,null),s(je,""),s(Je,""),s(Ft,!1)}let Rt=z(null),ir=z(!1);async function fa(){if(t(Rt)){s(ir,!0);try{await io(t(Rt)),s(Rt,null);const g=await Zt();s(st,g.connectors,!0)}catch{s(Rt,null)}finally{s(ir,!1)}}}async function ps(){s(zt,!0),s(v,"");try{const[g,A]=await Promise.all([no(),Zt()]);s(nt,g.sources,!0),s(st,A.connectors,!0)}catch(g){s(v,g.message,!0)}finally{s(zt,!1),s(Ke,!0)}}async function ga(){s(Mr,!0),s(v,"");try{const g=await Zt();s(st,g.connectors,!0)}catch(g){s(v,g.message,!0)}finally{s(Mr,!1),s(_s,!0)}}async function pa(g){s(Je,""),s(je,""),s(Fe,g,!0);try{const A=await uo(g);s(je,JSON.stringify(A.source,null,2),!0)}catch(A){s(Je,`Failed to load: ${A.message}`)}}async function ms(){if(t(Fe)){s(Je,""),s(Vt,!0);try{const g=JSON.parse(t(je)),A=await co(t(Fe),g);A.errors&&A.errors.length>0?s(Je,A.errors.join("; "),!0):(s(Fe,null),s(je,""),t(Ft)&&(s(Ft,!1),Ht()),await ps())}catch(g){g instanceof SyntaxError?s(Je,`Invalid JSON: ${g.message}`):s(Je,g.message||"Failed to save",!0)}finally{s(Vt,!1)}}}function ma(g){const A=[];for(const he of lt.repos)for(const He of he.sync??[])He.source===g&&A.push({collection:he.name,entity_type:He.entity_type});return A}function _a(g){const A=new Map;for(const he of g){const He=A.get(he.collection)??[];he.entity_type&&He.push(he.entity_type),A.set(he.collection,He)}return Array.from(A,([he,He])=>({collection:he,entityTypes:He}))}function ya(g){return lt.repos.map(A=>A.name)}async function ba(g){if(!t(wt))return;const A=lt.repos.find(Se=>Se.name===t(wt));if(!A)return;const he=A.sync??[],Xe=(t(At).length>0?t(At).map(Se=>({source:g,entity_type:Se})):[{source:g}]).filter(Se=>!he.some(Ae=>Ae.source===Se.source&&Ae.entity_type===Se.entity_type));if(Xe.length===0){s(vt,null),s(wt,""),s(At,[],!0);return}try{await Ss(t(wt),[...he,...Xe]),await lt.load(),s(vt,null),s(wt,""),s(At,[],!0)}catch(Se){s(v,Se.message,!0)}}async function xa(g,A){const he=lt.repos.find(Xe=>Xe.name===A);if(!he)return;const He=(he.sync??[]).filter(Xe=>Xe.source!==g);try{await Ss(A,He),await lt.load()}catch(Xe){s(v,Xe.message,!0)}}let _s=z(!1),Mr=z(!1),Yt=z(gt(lt.name)),Xt=z(gt(lt.about??"")),lr=z(!1),dr=z(""),$a=f(()=>t(Yt)!==lt.name||t(Xt)!==(lt.about??"")),Qt=z(""),cr=z(!1),Tr=z(!1),ur=z(!1);async function ys(){if(!t(cr))try{const g=await yo();s(Qt,JSON.stringify(g.config,null,2),!0),s(cr,!0)}catch{s(Qt,"")}}function Pa(){navigator.clipboard.writeText(t(Qt)),s(Tr,!0),setTimeout(()=>{s(Tr,!1)},2e3)}async function wa(){s(ur,!0);try{await Nr("/api/auth/api-key/regenerate",{method:"POST"}),s(cr,!1),await ys()}catch{}finally{s(ur,!1)}}async function Ca(){s(lr,!0),s(dr,"");try{await lt.updateWorkspace({name:t(Yt),about:t(Xt)})}catch(g){s(dr,g.message||"Failed to save",!0)}finally{s(lr,!1)}}function ka(){s(Yt,lt.name,!0),s(Xt,lt.about??"",!0)}var Or=vl(),bs=l(b(Or),2),xs=b(bs);{var Sa=g=>{var A=Un(),he=b(A,!0);p(A),se(()=>Z(he,t(v))),r(g,A)};H(xs,g=>{t(v)&&g(Sa)})}var za=l(xs,2);{var Na=g=>{var A=Gn(),he=l(n(A),2),He=b(he),Xe=b(He);Ct(Xe,{for:"ws-name",children:(re,le)=>{M();var ee=F("Name");r(re,ee)},$$slots:{default:!0}});var Se=l(Xe,2);qt(Se,{id:"ws-name",placeholder:"Your Organization",get value(){return t(Yt)},set value(re){s(Yt,re,!0)}}),p(He);var Ae=l(He,2),xe=b(Ae);Ct(xe,{for:"ws-about",children:(re,le)=>{M();var ee=F("Description");r(re,ee)},$$slots:{default:!0}});var ct=l(xe,2);Fs(ct,{id:"ws-about",rows:14,placeholder:"Describe your organization...",class:"resize-y",get value(){return t(Xt)},set value(re){s(Xt,re,!0)}}),p(Ae);var pt=l(Ae,2);{var ut=re=>{var le=qn(),ee=b(le,!0);p(le),se(()=>Z(ee,t(dr))),r(re,le)};H(pt,re=>{t(dr)&&re(ut)})}var rt=l(pt,2);{var Be=re=>{var le=Bn(),ee=b(le);Ee(ee,{variant:"ghost",onclick:ka,children:(Re,Ie)=>{M();var $e=F("Cancel");r(Re,$e)},$$slots:{default:!0}});var me=l(ee,2);Ee(me,{onclick:Ca,get disabled(){return t(lr)},children:(Re,Ie)=>{M();var $e=F();se(()=>Z($e,t(lr)?"Saving...":"Save")),r(Re,$e)},$$slots:{default:!0}}),p(le),r(re,le)};H(rt,re=>{t($a)&&re(Be)})}p(he);var Le=l(he,2);{var Ze=re=>{var le=Jn(),ee=b(le),me=b(ee);Ct(me,{children:(we,Oe)=>{M();var Pe=F("MCP Connection");r(we,Pe)},$$slots:{default:!0}});var Re=l(me,2),Ie=b(Re);Ee(Ie,{variant:"ghost",size:"sm",onclick:wa,get disabled(){return t(ur)},children:(we,Oe)=>{var Pe=Kn(),ae=n(Pe);fo(ae,{size:12});var de=l(ae);se(()=>Z(de,` ${t(ur)?"Regenerating...":"Regenerate Key"}`)),r(we,Pe)},$$slots:{default:!0}});var $e=l(Ie,2);Ee($e,{variant:"ghost",size:"sm",onclick:Pa,children:(we,Oe)=>{var Pe=x(),ae=n(Pe);{var de=Y=>{var U=Wn(),j=n(U);xr(j,{size:12}),M(),r(Y,U)},ve=Y=>{var U=jn(),j=n(U);Ln(j,{size:12}),M(),r(Y,U)};H(ae,Y=>{t(Tr)?Y(de):Y(ve,!1)})}r(we,Pe)},$$slots:{default:!0}}),p(Re),p(ee);var Te=l(ee,4);Fs(Te,{get value(){return t(Qt)},rows:10,readonly:!0,class:"mcp-config-textarea"}),p(le),r(re,le)};H(Le,re=>{t(Qt)&&re(Ze)})}r(g,A)},Aa=g=>{var A=fi(),he=l(n(A),2);{var He=Se=>{var Ae=Yn();r(Se,Ae)},Xe=Se=>{var Ae=vi(),xe=n(Ae),ct=b(xe),pt=b(ct);p(ct);var ut=l(ct,2);Ee(ut,{onclick:()=>{s(w,!0)},children:(re,le)=>{var ee=Xn(),me=n(ee);go(me,{size:14}),M(),r(re,ee)},$$slots:{default:!0}}),p(xe);var rt=l(xe,2);ft(rt,21,()=>t(o),mt,(re,le)=>{var ee=Zn(),me=b(ee);y(me,()=>Bt,(Y,U)=>{U(Y,{children:(j,X)=>{var I=x(),O=n(I);y(O,()=>Kt,(V,K)=>{K(V,{children:(W,B)=>{M();var q=F();se(D=>Z(q,D),[()=>(t(le).displayName||t(le).email)[0].toUpperCase()]),r(W,q)},$$slots:{default:!0}})}),r(j,I)},$$slots:{default:!0}})});var Re=l(me,2),Ie=b(Re),$e=b(Ie,!0);p(Ie);var Te=l(Ie,2);{var we=Y=>{tr(Y,{variant:"accent",class:"ml-2",children:(U,j)=>{M();var X=F("Admin");r(U,X)},$$slots:{default:!0}})};H(Te,Y=>{t(le).role==="admin"&&Y(we)})}p(Re);var Oe=l(Re,2),Pe=b(Oe,!0);p(Oe);var ae=l(Oe,2),de=b(ae);{var ve=Y=>{var U=Qn(),j=n(U);Ee(j,{variant:"ghost",size:"icon",title:"Reset password",onclick:()=>{s(L,t(le),!0),s(N,""),s(ye,"")},children:(I,O)=>{Rn(I,{size:13})},$$slots:{default:!0}});var X=l(j,2);Ee(X,{variant:"ghost",size:"icon",class:"icon-danger",title:"Delete user",onclick:()=>{s(P,t(le),!0)},children:(I,O)=>{Kr(I,{size:13})},$$slots:{default:!0}}),r(Y,U)};H(de,Y=>{As.user&&t(le).id!==As.user.id&&Y(ve)})}p(ae),p(ee),se(()=>{Z($e,t(le).displayName),Z(Pe,t(le).email)}),r(re,ee)}),p(rt);var Be=l(rt,2);{let re=f(()=>!!t(P));y(Be,()=>Br,(le,ee)=>{ee(le,{get open(){return t(re)},onOpenChange:me=>{me||s(P,null)},children:(me,Re)=>{var Ie=x(),$e=n(Ie);y($e,()=>Er,(Te,we)=>{we(Te,{children:(Oe,Pe)=>{var ae=ri(),de=n(ae);y(de,()=>Vr,(Y,U)=>{U(Y,{children:(j,X)=>{var I=ei(),O=n(I);y(O,()=>Fr,(K,W)=>{W(K,{children:(B,q)=>{M();var D=F("Delete user");r(B,D)},$$slots:{default:!0}})});var V=l(O,2);y(V,()=>Hr,(K,W)=>{W(K,{children:(B,q)=>{M();var D=F();se(()=>Z(D,`Are you sure you want to delete ${t(P)?.displayName??""}? This action cannot be undone.`)),r(B,D)},$$slots:{default:!0}})}),r(j,I)},$$slots:{default:!0}})});var ve=l(de,2);y(ve,()=>Lr,(Y,U)=>{U(Y,{children:(j,X)=>{var I=ti(),O=n(I);y(O,()=>Ur,(K,W)=>{W(K,{get disabled(){return t(E)},children:(B,q)=>{M();var D=F("Cancel");r(B,D)},$$slots:{default:!0}})});var V=l(O,2);{let K=f(()=>Wr({variant:"destructive"}));y(V,()=>qr,(W,B)=>{B(W,{get class(){return t(K)},onclick:oa,get disabled(){return t(E)},children:(q,D)=>{M();var fe=F();se(()=>Z(fe,t(E)?"Deleting...":"Delete")),r(q,fe)},$$slots:{default:!0}})})}r(j,I)},$$slots:{default:!0}})}),r(Oe,ae)},$$slots:{default:!0}})}),r(me,Ie)},$$slots:{default:!0}})})}var Le=l(Be,2);{let re=f(()=>!!t(L));y(Le,()=>Br,(le,ee)=>{ee(le,{get open(){return t(re)},onOpenChange:me=>{me||(s(L,null),s(N,""),s(ye,""))},children:(me,Re)=>{var Ie=x(),$e=n(Ie);y($e,()=>Er,(Te,we)=>{we(Te,{children:(Oe,Pe)=>{var ae=ni(),de=n(ae);y(de,()=>Vr,(I,O)=>{O(I,{children:(V,K)=>{var W=si(),B=n(W);y(B,()=>Fr,(D,fe)=>{fe(D,{children:(ge,J)=>{M();var ie=F("Reset password");r(ge,ie)},$$slots:{default:!0}})});var q=l(B,2);y(q,()=>Hr,(D,fe)=>{fe(D,{children:(ge,J)=>{M();var ie=F();se(()=>Z(ie,`Set a new password for ${t(L)?.displayName??""}.`)),r(ge,ie)},$$slots:{default:!0}})}),r(V,W)},$$slots:{default:!0}})});var ve=l(de,2),Y=b(ve);qt(Y,{type:"password",placeholder:"New password (8+ characters)",required:!0,minlength:8,autocomplete:"new-password",class:"mb-4",get value(){return t(N)},set value(I){s(N,I,!0)}});var U=l(Y,2);{var j=I=>{var O=ai(),V=b(O,!0);p(O),se(()=>Z(V,t(ye))),r(I,O)};H(U,I=>{t(ye)&&I(j)})}var X=l(U,2);y(X,()=>Lr,(I,O)=>{O(I,{children:(V,K)=>{var W=oi(),B=n(W);y(B,()=>Ur,(D,fe)=>{fe(D,{type:"button",get disabled(){return t(oe)},children:(ge,J)=>{M();var ie=F("Cancel");r(ge,ie)},$$slots:{default:!0}})});var q=l(B,2);{let D=f(()=>Wr({variant:"accent"})),fe=f(()=>t(oe)||!t(N));y(q,()=>qr,(ge,J)=>{J(ge,{get class(){return t(D)},type:"submit",get disabled(){return t(fe)},children:(ie,pe)=>{M();var _e=F();se(()=>Z(_e,t(oe)?"Resetting...":"Reset Password")),r(ie,_e)},$$slots:{default:!0}})})}r(V,W)},$$slots:{default:!0}})}),p(ve),$s("submit",ve,I=>{I.preventDefault(),na()}),r(Oe,ae)},$$slots:{default:!0}})}),r(me,Ie)},$$slots:{default:!0}})})}var Ze=l(Le,2);y(Ze,()=>mr,(re,le)=>{le(re,{get open(){return t(w)},onOpenChange:ee=>{ee||(s(w,!1),s(m,""))},children:(ee,me)=>{var Re=x(),Ie=n(Re);y(Ie,()=>vr,($e,Te)=>{Te($e,{size:"sm",children:(we,Oe)=>{var Pe=hi(),ae=n(Pe);y(ae,()=>fr,(U,j)=>{j(U,{children:(X,I)=>{var O=x(),V=n(O);y(V,()=>gr,(K,W)=>{W(K,{children:(B,q)=>{M();var D=F("Add Member");r(B,D)},$$slots:{default:!0}})}),r(X,O)},$$slots:{default:!0}})});var de=l(ae,2),ve=b(de);y(ve,()=>pr,(U,j)=>{j(U,{children:(X,I)=>{var O=ci(),V=l(n(O),2),K=b(V),W=b(K);Ct(W,{for:"add-name",children:(G,ce)=>{M();var ne=F("Name");r(G,ne)},$$slots:{default:!0}});var B=l(W,2);qt(B,{id:"add-name",type:"text",placeholder:"Name",autocomplete:"off",get value(){return t(k)},set value(G){s(k,G,!0)}}),p(K);var q=l(K,2),D=b(q);Ct(D,{for:"add-email",children:(G,ce)=>{M();var ne=F("Email");r(G,ne)},$$slots:{default:!0}});var fe=l(D,2);qt(fe,{id:"add-email",type:"email",placeholder:"Email",required:!0,autocomplete:"off",get value(){return t($)},set value(G){s($,G,!0)}}),p(q);var ge=l(q,2),J=b(ge);Ct(J,{for:"add-password",children:(G,ce)=>{M();var ne=F("Password");r(G,ne)},$$slots:{default:!0}});var ie=l(J,2);qt(ie,{id:"add-password",type:"password",placeholder:"8+ characters",required:!0,minlength:8,autocomplete:"new-password",get value(){return t(S)},set value(G){s(S,G,!0)}}),p(ge);var pe=l(ge,2),_e=b(pe);Ct(_e,{children:(G,ce)=>{M();var ne=F("Role");r(G,ne)},$$slots:{default:!0}});var Ce=l(_e,2);y(Ce,()=>Vs,(G,ce)=>{ce(G,{type:"single",get value(){return t(R)},onValueChange:ne=>{s(R,ne,!0)},children:(ne,Q)=>{var ze=li(),Ge=n(ze);{let qe=f(()=>t(R)==="admin"?"Admin":"Member");y(Ge,()=>Os,(et,We)=>{We(et,{size:"sm",get value(){return t(qe)}})})}var Ue=l(Ge,2);y(Ue,()=>Es,(qe,et)=>{et(qe,{children:(We,at)=>{var it=ii(),Tt=n(it);y(Tt,()=>Jr,(hr,Ut)=>{Ut(hr,{value:"member",label:"Member"})});var Lt=l(Tt,2);y(Lt,()=>Jr,(hr,Ut)=>{Ut(hr,{value:"admin",label:"Admin"})}),r(We,it)},$$slots:{default:!0}})}),r(ne,ze)},$$slots:{default:!0}})}),p(pe),p(V);var ke=l(V,2);{var be=G=>{var ce=di(),ne=b(ce,!0);p(ce),se(()=>Z(ne,t(m))),r(G,ce)};H(ke,G=>{t(m)&&G(be)})}r(X,O)},$$slots:{default:!0}})});var Y=l(ve,2);y(Y,()=>_r,(U,j)=>{j(U,{children:(X,I)=>{var O=ui(),V=n(O);Ee(V,{variant:"ghost",type:"button",onclick:()=>{s(w,!1),s(m,"")},children:(W,B)=>{M();var q=F("Cancel");r(W,q)},$$slots:{default:!0}});var K=l(V,2);Ee(K,{type:"submit",get disabled(){return t(T)},children:(W,B)=>{M();var q=F();se(()=>Z(q,t(T)?"Adding...":"Add Member")),r(W,q)},$$slots:{default:!0}}),r(X,O)},$$slots:{default:!0}})}),p(de),$s("submit",de,aa),r(we,Pe)},$$slots:{default:!0}})}),r(ee,Re)},$$slots:{default:!0}})}),se(()=>Z(pt,`${t(o).length??""} ${t(o).length===1?"member":"members"}`)),r(Se,Ae)};H(he,Se=>{t(i)?Se(He):Se(Xe,!1)})}r(g,A)},Ra=g=>{var A=Si(),he=l(n(A),2);{var He=Se=>{var Ae=gi();r(Se,Ae)},Xe=Se=>{const Ae=f(()=>t(ue)?t(h).find(ut=>ut.collection===t(ue)):null);var xe=ki(),ct=n(xe);y(ct,()=>Rs,(ut,rt)=>{rt(ut,{type:"multiple",get value(){return t(cs)},set value(Be){s(cs,Be,!0)},children:(Be,Le)=>{var Ze=x(),re=n(Ze);ft(re,17,()=>t(h),mt,(le,ee)=>{const me=f(ia);var Re=x(),Ie=n(Re);y(Ie,()=>Is,($e,Te)=>{Te($e,{get value(){return t(ee).collection},class:"accordion-item",children:(we,Oe)=>{var Pe=xi(),ae=n(Pe);y(ae,()=>Ds,(ve,Y)=>{Y(ve,{children:(U,j)=>{var X=x(),I=n(X);y(I,()=>Ms,(O,V)=>{V(O,{class:"accordion-trigger",children:(K,W)=>{var B=pi(),q=n(B),D=b(q);ks(D,{size:14}),p(q);var fe=l(q,2),ge=b(fe,!0);p(fe);var J=l(fe,2);tr(J,{variant:"outline",class:"accordion-count",children:(ie,pe)=>{M();var _e=F();se(()=>Z(_e,t(me).length+t(ee).users.length)),r(ie,_e)},$$slots:{default:!0}}),se(()=>Z(ge,t(ee).collection)),r(K,B)},$$slots:{default:!0}})}),r(U,X)},$$slots:{default:!0}})});var de=l(ae,2);y(de,()=>Ts,(ve,Y)=>{Y(ve,{class:"accordion-content",children:(U,j)=>{var X=bi(),I=n(X),O=l(b(I),2);{var V=q=>{Ee(q,{size:"sm",onclick:()=>{s(ue,t(ee).collection,!0)},children:(D,fe)=>{M();var ge=F("Add Member");r(D,ge)},$$slots:{default:!0}})},K=f(()=>vs(t(ee)).length>0);H(O,q=>{t(K)&&q(V)})}p(I);var W=l(I,2);ft(W,17,()=>t(me),mt,(q,D)=>{var fe=mi(),ge=b(fe);y(ge,()=>Bt,(be,G)=>{G(be,{children:(ce,ne)=>{var Q=x(),ze=n(Q);y(ze,()=>Kt,(Ge,Ue)=>{Ue(Ge,{children:(qe,et)=>{M();var We=F();se(at=>Z(We,at),[()=>(t(D).displayName||t(D).email)[0].toUpperCase()]),r(qe,We)},$$slots:{default:!0}})}),r(ce,Q)},$$slots:{default:!0}})});var J=l(ge,2),ie=b(J),pe=b(ie,!0);p(ie);var _e=l(ie,2);tr(_e,{variant:"accent",class:"ml-2",children:(be,G)=>{M();var ce=F("Admin");r(be,ce)},$$slots:{default:!0}}),p(J);var Ce=l(J,2),ke=b(Ce,!0);p(Ce),M(2),p(fe),se(()=>{Z(pe,t(D).displayName),Z(ke,t(D).email)}),r(q,fe)});var B=l(W,2);ft(B,17,()=>t(ee).users,mt,(q,D)=>{var fe=x(),ge=n(fe);{var J=pe=>{var _e=_i(),Ce=b(_e),ke=b(Ce);p(Ce);var be=l(Ce,2);Ee(be,{variant:"ghost",size:"sm",onclick:()=>{s(te,null)},get disabled(){return t(Ve)},children:(ce,ne)=>{M();var Q=F("Cancel");r(ce,Q)},$$slots:{default:!0}});var G=l(be,2);Ee(G,{variant:"destructive",size:"sm",onclick:la,get disabled(){return t(Ve)},children:(ce,ne)=>{M();var Q=F("Remove");r(ce,Q)},$$slots:{default:!0}}),p(_e),se(()=>Z(ke,`Remove ${t(D).displayName??""}?`)),r(pe,_e)},ie=pe=>{var _e=yi(),Ce=b(_e);y(Ce,()=>Bt,(Ge,Ue)=>{Ue(Ge,{children:(qe,et)=>{var We=x(),at=n(We);y(at,()=>Kt,(it,Tt)=>{Tt(it,{children:(Lt,hr)=>{M();var Ut=F();se(Ma=>Z(Ut,Ma),[()=>(t(D).displayName||t(D).email)[0].toUpperCase()]),r(Lt,Ut)},$$slots:{default:!0}})}),r(qe,We)},$$slots:{default:!0}})});var ke=l(Ce,2),be=b(ke),G=b(be,!0);p(be),p(ke);var ce=l(ke,2),ne=b(ce,!0);p(ce);var Q=l(ce,2),ze=b(Q);Ee(ze,{variant:"ghost",size:"icon",class:"icon-danger",title:"Remove access",onclick:()=>{s(te,{collection:t(ee).collection,user:t(D)},!0)},children:(Ge,Ue)=>{Kr(Ge,{size:13})},$$slots:{default:!0}}),p(Q),p(_e),se(()=>{Z(G,t(D).displayName),Z(ne,t(D).email)}),r(pe,_e)};H(ge,pe=>{t(te)?.collection===t(ee).collection&&t(te)?.user.id===t(D).id?pe(J):pe(ie,!1)})}r(q,fe)}),r(U,X)},$$slots:{default:!0}})}),r(we,Pe)},$$slots:{default:!0}})}),r(le,Re)}),r(Be,Ze)},$$slots:{default:!0}})});var pt=l(ct,2);{let ut=f(()=>!!t(ue));y(pt,()=>mr,(rt,Be)=>{Be(rt,{get open(){return t(ut)},onOpenChange:Le=>{Le||s(ue,null)},children:(Le,Ze)=>{var re=x(),le=n(re);y(le,()=>vr,(ee,me)=>{me(ee,{size:"sm",children:(Re,Ie)=>{var $e=Ci(),Te=n($e);y(Te,()=>fr,(Pe,ae)=>{ae(Pe,{children:(de,ve)=>{var Y=x(),U=n(Y);y(U,()=>gr,(j,X)=>{X(j,{children:(I,O)=>{M();var V=F();se(()=>Z(V,`Add member to ${t(ue)??""}`)),r(I,V)},$$slots:{default:!0}})}),r(de,Y)},$$slots:{default:!0}})});var we=l(Te,2);y(we,()=>pr,(Pe,ae)=>{ae(Pe,{children:(de,ve)=>{var Y=wi(),U=l(n(Y),2);{var j=X=>{var I=Pi();ft(I,21,()=>vs(t(Ae)),mt,(O,V)=>{var K=$i(),W=b(K);y(W,()=>Bt,(J,ie)=>{ie(J,{children:(pe,_e)=>{var Ce=x(),ke=n(Ce);y(ke,()=>Kt,(be,G)=>{G(be,{children:(ce,ne)=>{M();var Q=F();se(ze=>Z(Q,ze),[()=>(t(V).displayName||t(V).email)[0].toUpperCase()]),r(ce,Q)},$$slots:{default:!0}})}),r(pe,Ce)},$$slots:{default:!0}})});var B=l(W,2),q=b(B),D=b(q,!0);p(q);var fe=l(q,2),ge=b(fe,!0);p(fe),p(B),p(K),se(()=>{Z(D,t(V).displayName),Z(ge,t(V).email)}),Ps("click",K,()=>t(ue)&&fs(t(ue),t(V).id)),Ps("keydown",K,J=>{J.key==="Enter"&&t(ue)&&fs(t(ue),t(V).id)}),r(O,K)}),p(I),r(X,I)};H(U,X=>{t(Ae)&&X(j)})}r(de,Y)},$$slots:{default:!0}})});var Oe=l(we,2);y(Oe,()=>_r,(Pe,ae)=>{ae(Pe,{children:(de,ve)=>{Ee(de,{variant:"ghost",onclick:()=>{s(ue,null)},children:(Y,U)=>{M();var j=F("Cancel");r(Y,j)},$$slots:{default:!0}})},$$slots:{default:!0}})}),r(Re,$e)},$$slots:{default:!0}})}),r(Le,re)},$$slots:{default:!0}})})}r(Se,xe)};H(he,Se=>{t(u)?Se(He):Se(Xe,!1)})}r(g,A)},Ia=g=>{var A=Ui(),he=l(n(A),2);{var He=Se=>{var Ae=zi();r(Se,Ae)},Xe=Se=>{var Ae=Li(),xe=n(Ae);y(xe,()=>Rs,(rt,Be)=>{Be(rt,{type:"multiple",get value(){return t(us)},set value(Le){s(us,Le,!0)},children:(Le,Ze)=>{var re=x(),le=n(re);ft(le,17,()=>t(nt),mt,(ee,me)=>{const Re=f(()=>ma(t(me).name)),Ie=f(()=>_a(t(Re)));var $e=x(),Te=n($e);y(Te,()=>Is,(we,Oe)=>{Oe(we,{get value(){return t(me).name},class:"accordion-item",children:(Pe,ae)=>{var de=Ii(),ve=n(de);y(ve,()=>Ds,(U,j)=>{j(U,{children:(X,I)=>{var O=x(),V=n(O);y(V,()=>Ms,(K,W)=>{W(K,{class:"accordion-trigger",children:(B,q)=>{var D=Ni(),fe=n(D),ge=b(fe);ks(ge,{size:14}),p(fe);var J=l(fe,2),ie=b(J,!0);p(J);var pe=l(J,2);tr(pe,{variant:"outline",class:"accordion-count",children:(_e,Ce)=>{M();var ke=F();se(()=>Z(ke,t(Ie).length)),r(_e,ke)},$$slots:{default:!0}}),se(_e=>Z(ie,_e),[()=>t(me).name[0].toUpperCase()+t(me).name.slice(1)]),r(B,D)},$$slots:{default:!0}})}),r(X,O)},$$slots:{default:!0}})});var Y=l(ve,2);y(Y,()=>Ts,(U,j)=>{j(U,{class:"accordion-content",children:(X,I)=>{var O=Ri(),V=n(O),K=l(b(V),2);Ee(K,{size:"sm",onclick:()=>{s(vt,t(me).name,!0),s(wt,""),s(At,[...t(me).entityTypes],!0)},children:(B,q)=>{M();var D=F("Add Collection");r(B,D)},$$slots:{default:!0}}),p(V);var W=l(V,2);ft(W,17,()=>t(Ie),mt,(B,q)=>{let D=()=>t(q).collection,fe=()=>t(q).entityTypes;var ge=Ai(),J=b(ge);y(J,()=>Bt,(G,ce)=>{ce(G,{children:(ne,Q)=>{var ze=x(),Ge=n(ze);y(Ge,()=>Kt,(Ue,qe)=>{qe(Ue,{children:(et,We)=>{M();var at=F();se(it=>Z(at,it),[()=>D()[0].toUpperCase()]),r(et,at)},$$slots:{default:!0}})}),r(ne,ze)},$$slots:{default:!0}})});var ie=l(J,2),pe=b(ie),_e=b(pe,!0);p(pe);var Ce=l(pe,2);ft(Ce,17,fe,mt,(G,ce)=>{tr(G,{variant:"secondary",class:"ml-1",children:(ne,Q)=>{M();var ze=F();se(()=>Z(ze,t(ce))),r(ne,ze)},$$slots:{default:!0}})}),p(ie);var ke=l(ie,4),be=b(ke);Ee(be,{variant:"ghost",size:"icon",class:"icon-danger",title:"Remove",onclick:()=>xa(t(me).name,D()),children:(G,ce)=>{Kr(G,{size:13})},$$slots:{default:!0}}),p(ke),p(ge),se(()=>Z(_e,D())),r(B,ge)}),r(X,O)},$$slots:{default:!0}})}),r(Pe,de)},$$slots:{default:!0}})}),r(ee,$e)}),r(Le,re)},$$slots:{default:!0}})});var ct=l(xe,2);{var pt=rt=>{var Be=Di();r(rt,Be)};H(ct,rt=>{t(nt).length===0&&rt(pt)})}var ut=l(ct,2);{let rt=f(()=>!!t(vt));y(ut,()=>mr,(Be,Le)=>{Le(Be,{get open(){return t(rt)},onOpenChange:Ze=>{Ze||s(vt,null)},children:(Ze,re)=>{var le=x(),ee=n(le);y(ee,()=>vr,(me,Re)=>{Re(me,{size:"sm",children:(Ie,$e)=>{var Te=Hi(),we=n(Te);y(we,()=>fr,(ae,de)=>{de(ae,{children:(ve,Y)=>{var U=x(),j=n(U);y(j,()=>gr,(X,I)=>{I(X,{children:(O,V)=>{M();var K=F();se(()=>Z(K,`Add ${t(vt)??""} to collection`)),r(O,K)},$$slots:{default:!0}})}),r(ve,U)},$$slots:{default:!0}})});var Oe=l(we,2);y(Oe,()=>pr,(ae,de)=>{de(ae,{children:(ve,Y)=>{const U=f(()=>t(vt)?ya(t(vt)):[]);var j=Vi(),X=l(n(j),2),I=b(X),O=b(I);Ct(O,{children:(B,q)=>{M();var D=F("Collection");r(B,D)},$$slots:{default:!0}});var V=l(O,2);y(V,()=>Vs,(B,q)=>{q(B,{type:"single",get value(){return t(wt)},set value(D){s(wt,D,!0)},children:(D,fe)=>{var ge=Mi(),J=n(ge);y(J,()=>Os,(pe,_e)=>{_e(pe,{get value(){return t(wt)},placeholder:"Select collection..."})});var ie=l(J,2);y(ie,()=>Es,(pe,_e)=>{_e(pe,{children:(Ce,ke)=>{var be=x(),G=n(be);ft(G,17,()=>t(U),mt,(ce,ne)=>{var Q=x(),ze=n(Q);y(ze,()=>Jr,(Ge,Ue)=>{Ue(Ge,{get value(){return t(ne)},get label(){return t(ne)}})}),r(ce,Q)}),r(Ce,be)},$$slots:{default:!0}})}),r(D,ge)},$$slots:{default:!0}})}),p(I);var K=l(I,2);{var W=B=>{const q=f(()=>t(nt).find(J=>J.name===t(vt))?.entityTypes??[]);var D=x(),fe=n(D);{var ge=J=>{var ie=Ei(),pe=b(ie);Ct(pe,{children:(Ce,ke)=>{M();var be=F("Entity types");r(Ce,be)},$$slots:{default:!0}});var _e=l(pe,2);y(_e,()=>tn,(Ce,ke)=>{ke(Ce,{get value(){return t(At)},set value(be){s(At,be,!0)},children:(be,G)=>{var ce=Oi();ft(ce,21,()=>t(q),mt,(ne,Q)=>{var ze=Ti(),Ge=b(ze);{let et=f(()=>t(At).includes(t(Q)));Tn(Ge,{get value(){return t(Q)},get checked(){return t(et)}})}var Ue=l(Ge,2),qe=b(Ue,!0);p(Ue),p(ze),se(()=>Z(qe,t(Q))),r(ne,ze)}),p(ce),r(be,ce)},$$slots:{default:!0}})}),p(ie),r(J,ie)};H(fe,J=>{t(q).length>1&&J(ge)})}r(B,D)};H(K,B=>{t(vt)&&B(W)})}p(X),r(ve,j)},$$slots:{default:!0}})});var Pe=l(Oe,2);y(Pe,()=>_r,(ae,de)=>{de(ae,{children:(ve,Y)=>{var U=Fi(),j=n(U);Ee(j,{variant:"ghost",onclick:()=>{s(vt,null)},children:(I,O)=>{M();var V=F("Cancel");r(I,V)},$$slots:{default:!0}});var X=l(j,2);{let I=f(()=>!t(wt)||t(At).length===0);Ee(X,{get disabled(){return t(I)},onclick:()=>t(vt)&&ba(t(vt)),children:(O,V)=>{M();var K=F("Add");r(O,K)},$$slots:{default:!0}})}r(ve,U)},$$slots:{default:!0}})}),r(Ie,Te)},$$slots:{default:!0}})}),r(Ze,le)},$$slots:{default:!0}})})}r(Se,Ae)};H(he,Se=>{t(zt)?Se(He):Se(Xe,!1)})}r(g,A)},Da=g=>{var A=hl(),he=l(n(A),2);{var He=Ae=>{var xe=qi();r(Ae,xe)},Xe=Ae=>{var xe=Bi();r(Ae,xe)},Se=Ae=>{const xe=f(()=>t($t)?t(st).find(Be=>Be.name===t($t)):null);var ct=ul(),pt=n(ct);ft(pt,21,()=>t(st),mt,(Be,Le)=>{var Ze=ji(),re=b(Ze);y(re,()=>Bt,($e,Te)=>{Te($e,{children:(we,Oe)=>{var Pe=x(),ae=n(Pe);y(ae,()=>Kt,(de,ve)=>{ve(de,{children:(Y,U)=>{M();var j=F();se(X=>Z(j,X),[()=>t(Le).label[0].toUpperCase()]),r(Y,j)},$$slots:{default:!0}})}),r(we,Pe)},$$slots:{default:!0}})});var le=l(re,2),ee=b(le,!0);p(le);var me=l(le,2);{var Re=$e=>{var Te=Wi(),we=b(Te);{var Oe=ae=>{Ee(ae,{variant:"ghost",size:"icon",title:"Edit source definition",onclick:()=>va(t(Le).name),children:(de,ve)=>{No(de,{size:13})},$$slots:{default:!0}})};H(we,ae=>{t(Le).hasSource&&ae(Oe)})}var Pe=l(we,2);Ee(Pe,{variant:"ghost",size:"sm",class:"connector-action connected",onclick:()=>gs(t(Le).name),children:(ae,de)=>{var ve=Ki(),Y=n(ve);xr(Y,{size:12}),M(),r(ae,ve)},$$slots:{default:!0}}),p(Te),r($e,Te)},Ie=$e=>{Ee($e,{variant:"ghost",size:"sm",class:"connector-action",onclick:()=>gs(t(Le).name),children:(Te,we)=>{M();var Oe=F("Connect");r(Te,Oe)},$$slots:{default:!0}})};H(me,$e=>{t(Le).configured?$e(Re):$e(Ie,!1)})}p(Ze),se(()=>Z(ee,t(Le).label)),r(Be,Ze)}),p(pt);var ut=l(pt,2);{let Be=f(()=>!!t($t));y(ut,()=>mr,(Le,Ze)=>{Ze(Le,{get open(){return t(Be)},onOpenChange:re=>{re||Ht()},children:(re,le)=>{var ee=x(),me=n(ee);y(me,()=>vr,(Re,Ie)=>{Ie(Re,{size:"sm",children:($e,Te)=>{var we=x(),Oe=n(we);{var Pe=ae=>{var de=il(),ve=n(de);y(ve,()=>fr,(X,I)=>{I(X,{children:(O,V)=>{var K=x(),W=n(K);y(W,()=>gr,(B,q)=>{q(B,{children:(D,fe)=>{M();var ge=F();se(()=>Z(ge,t(xe).label)),r(D,ge)},$$slots:{default:!0}})}),r(O,K)},$$slots:{default:!0}})});var Y=l(ve,2);y(Y,()=>pr,(X,I)=>{I(X,{children:(O,V)=>{var K=sl(),W=n(K),B=b(W,!0);p(W);var q=l(W,2);{var D=J=>{var ie=Ji();r(J,ie)},fe=J=>{var ie=Yi(),pe=n(ie);En(pe,{get content(){return t(je)},onchange:ke=>{s(je,ke,!0)},onsave:ms});var _e=l(pe,2);{var Ce=ke=>{var be=Gi(),G=b(be,!0);p(be),se(()=>Z(G,t(Je))),r(ke,be)};H(_e,ke=>{t(Je)&&ke(Ce)})}r(J,ie)},ge=J=>{var ie=rl(),pe=n(ie);{var _e=ne=>{var Q=Xi(),ze=b(Q);{var Ge=qe=>{var et=F("Authorized via browser. Re-authorize happens on next agent start.");r(qe,et)},Ue=qe=>{var et=F("You'll authorize in your browser on next agent start.");r(qe,et)};H(ze,qe=>{t(xe).configured?qe(Ge):qe(Ue,!1)})}p(Q),r(ne,Q)};H(pe,ne=>{t(xe).type==="oauth"&&ne(_e)})}var Ce=l(pe,2);ft(Ce,21,()=>t(xe).credentialFields,mt,(ne,Q)=>{var ze=Zi(),Ge=b(ze);Ct(Ge,{get for(){return`cred-${t(xe).name??""}-${t(Q).key??""}`},children:(We,at)=>{M();var it=F();se(()=>Z(it,t(Q).label)),r(We,it)},$$slots:{default:!0}});var Ue=l(Ge,2);{let We=f(()=>t(Q).secret?"password":"text"),at=f(()=>t(Q).placeholder??""),it=f(()=>t(Nt)[t(Q).key]??"");qt(Ue,{get id(){return`cred-${t(xe).name??""}-${t(Q).key??""}`},get type(){return t(We)},get placeholder(){return t(at)},get value(){return t(it)},oninput:Tt=>{t(Nt)[t(Q).key]=Tt.currentTarget.value}})}var qe=l(Ue,2);{var et=We=>{var at=Qi(),it=b(at,!0);p(at),se(()=>Z(it,t(Q).description)),r(We,at)};H(qe,We=>{t(Q).description&&We(et)})}p(ze),r(ne,ze)}),p(Ce);var ke=l(Ce,2);{var be=ne=>{var Q=el(),ze=b(Q);In(ze,{size:12}),M(),p(Q),se(()=>Po(Q,"href",t(xe).docsUrl)),r(ne,Q)};H(ke,ne=>{t(xe).docsUrl&&ne(be)})}var G=l(ke,2);{var ce=ne=>{var Q=tl(),ze=b(Q,!0);p(Q),se(()=>Z(ze,t(Pt))),r(ne,Q)};H(G,ne=>{t(Pt)&&ne(ce)})}r(J,ie)};H(q,J=>{t(Gt)?J(D):t(Fe)===t(xe).name?J(fe,1):J(ge,!1)})}se(()=>Z(B,t(xe).description)),r(O,K)},$$slots:{default:!0}})});var U=l(Y,2);{var j=X=>{var I=x(),O=n(I);y(O,()=>_r,(V,K)=>{K(V,{children:(W,B)=>{var q=x(),D=n(q);{var fe=J=>{var ie=al(),pe=l(n(ie),2);Ee(pe,{variant:"ghost",onclick:()=>{t(Ft)?(s(Ft,!1),Ht()):(s(Fe,null),s(je,""),s(Je,""))},children:(Ce,ke)=>{M();var be=F("Cancel");r(Ce,be)},$$slots:{default:!0}});var _e=l(pe,2);Ee(_e,{onclick:ms,get disabled(){return t(Vt)},children:(Ce,ke)=>{M();var be=F();se(()=>Z(be,t(Vt)?"Saving...":"Save")),r(Ce,be)},$$slots:{default:!0}}),r(J,ie)},ge=J=>{var ie=nl(),pe=n(ie);{var _e=G=>{Ee(G,{variant:"ghost",class:"icon-danger",onclick:()=>{s(Rt,t(xe).name,!0),Ht()},children:(ce,ne)=>{M();var Q=F("Disconnect");r(ce,Q)},$$slots:{default:!0}})};H(pe,G=>{t(xe).configured&&G(_e)})}var Ce=l(pe,4);{var ke=G=>{Ee(G,{variant:"ghost",onclick:Ht,children:(ce,ne)=>{M();var Q=F("Close");r(ce,Q)},$$slots:{default:!0}})},be=G=>{var ce=ol(),ne=n(ce);Ee(ne,{variant:"ghost",onclick:Ht,children:(Ue,qe)=>{M();var et=F("Cancel");r(Ue,et)},$$slots:{default:!0}});var Q=l(ne,2);{var ze=Ue=>{Ee(Ue,{onclick:()=>t($t)&&ua(t($t)),get disabled(){return t(Dt)},children:(qe,et)=>{M();var We=F();se(()=>Z(We,t(Dt)?"Saving...":"Save")),r(qe,We)},$$slots:{default:!0}})},Ge=Ue=>{var qe=x(),et=n(qe);{var We=at=>{Ee(at,{onclick:()=>t($t)&&ha(t($t)),get disabled(){return t(Dt)},children:(it,Tt)=>{M();var Lt=F();se(()=>Z(Lt,t(Dt)?"Connecting...":"Connect")),r(it,Lt)},$$slots:{default:!0}})};H(et,at=>{t(xe).configured||at(We)})}r(Ue,qe)};H(Q,Ue=>{t(xe).credentialFields.length>0?Ue(ze):Ue(Ge,!1)})}r(G,ce)};H(Ce,G=>{t(xe).configured&&t(xe).credentialFields.length===0&&t(xe).type!=="oauth"?G(ke):G(be,!1)})}r(J,ie)};H(D,J=>{t(Fe)===t(xe).name?J(fe):J(ge,!1)})}r(W,q)},$$slots:{default:!0}})}),r(X,I)};H(U,X=>{t(Gt)||X(j)})}r(ae,de)};H(Oe,ae=>{t(xe)&&ae(Pe)})}r($e,we)},$$slots:{default:!0}})}),r(re,ee)},$$slots:{default:!0}})})}var rt=l(ut,2);{let Be=f(()=>!!t(Rt));y(rt,()=>Br,(Le,Ze)=>{Ze(Le,{get open(){return t(Be)},onOpenChange:re=>{re||s(Rt,null)},children:(re,le)=>{var ee=x(),me=n(ee);y(me,()=>Er,(Re,Ie)=>{Ie(Re,{children:($e,Te)=>{var we=cl(),Oe=n(we);y(Oe,()=>Vr,(ae,de)=>{de(ae,{children:(ve,Y)=>{var U=ll(),j=n(U);y(j,()=>Fr,(I,O)=>{O(I,{children:(V,K)=>{M();var W=F();se(B=>Z(W,`Disconnect ${B??""}?`),[()=>t(Rt)?t(st).find(B=>B.name===t(Rt))?.label:""]),r(V,W)},$$slots:{default:!0}})});var X=l(j,2);y(X,()=>Hr,(I,O)=>{O(I,{children:(V,K)=>{M();var W=F("This will remove the connector configuration. You can reconnect it later.");r(V,W)},$$slots:{default:!0}})}),r(ve,U)},$$slots:{default:!0}})});var Pe=l(Oe,2);y(Pe,()=>Lr,(ae,de)=>{de(ae,{children:(ve,Y)=>{var U=dl(),j=n(U);y(j,()=>Ur,(I,O)=>{O(I,{children:(V,K)=>{M();var W=F("Cancel");r(V,W)},$$slots:{default:!0}})});var X=l(j,2);{let I=f(()=>Wr({variant:"destructive"}));y(X,()=>qr,(O,V)=>{V(O,{get class(){return t(I)},onclick:fa,get disabled(){return t(ir)},children:(K,W)=>{M();var B=F();se(()=>Z(B,t(ir)?"Disconnecting...":"Disconnect")),r(K,B)},$$slots:{default:!0}})})}r(ve,U)},$$slots:{default:!0}})}),r($e,we)},$$slots:{default:!0}})}),r(re,ee)},$$slots:{default:!0}})})}r(Ae,ct)};H(he,Ae=>{t(Mr)?Ae(He):t(st).length===0?Ae(Xe,1):Ae(Se,!1)})}r(g,A)};H(za,g=>{t(a)==="general"?g(Na):t(a)==="users"?g(Aa,1):t(a)==="collections"?g(Ra,2):t(a)==="sources"?g(Ia,3):t(a)==="connectors"&&g(Da,4)})}p(bs),p(Or),r(d,Or),Me()}Ta(["click","keydown"]);function zl(d,e){De(e,!1),js.showSettings(),Ls(),ho(d,{children:(a,o)=>{fl(a,{})},$$slots:{default:!0}}),Me()}export{zl as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as A,a as _,t as D,f as S,s as E}from"../chunks/
|
|
1
|
+
import{e as A,a as _,t as D,f as S,s as E}from"../chunks/CjKjQEMp.js";import{p as M,n as Y,M as j,x as s,y as a,z as o,q as t,o as l,$ as F,u as i,t as $,v as G}from"../chunks/D-tW7Byc.js";import{i as H}from"../chunks/EhE2EcYu.js";import{h as J}from"../chunks/DCWeodCf.js";import{g as K}from"../chunks/DkM5hMeY.js";import{B as L,a as O,w as Q}from"../chunks/ByFfmBEu.js";import{I as y}from"../chunks/BV_9Nfp2.js";var R=S('<p class="error-msg svelte-g40i6i"> </p>'),T=S('<div class="setup-page svelte-g40i6i"><div class="setup-card svelte-g40i6i"><div class="logo svelte-g40i6i"><div class="logo-icon svelte-g40i6i">S</div> <span class="logo-text svelte-g40i6i">Studiograph</span></div> <p class="subtitle svelte-g40i6i">Create your admin account to get started.</p> <form class="svelte-g40i6i"><label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Name</span> <!></label> <label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Email</span> <!></label> <label class="field svelte-g40i6i"><span class="field-label svelte-g40i6i">Password</span> <!> <span class="field-hint svelte-g40i6i">At least 8 characters</span></label> <!> <!></form></div></div>');function te(q,k){M(k,!0);let u=o(""),n=o(""),v=o(""),p=o(""),d=o(!1);async function B(e){e.preventDefault(),s(p,""),s(d,!0);try{await O.setup(a(u),a(n),a(v)||void 0),Q.load(),K("/")}catch(r){s(p,r.message||"Setup failed",!0)}finally{s(d,!1)}}var c=T();J("g40i6i",e=>{j(()=>{F.title="Setup — Studiograph"})});var x=l(c),m=t(l(x),4),f=l(m),C=t(l(f),2);y(C,{type:"text",placeholder:"Your name",autocomplete:"name",autofocus:!0,class:"field-input",get value(){return a(v)},set value(e){s(v,e,!0)}}),i(f);var g=t(f,2),I=t(l(g),2);y(I,{type:"email",required:!0,autocomplete:"email",class:"field-input",get value(){return a(u)},set value(e){s(u,e,!0)}}),i(g);var b=t(g,2),N=t(l(b),2);y(N,{type:"password",required:!0,minlength:8,autocomplete:"new-password",class:"field-input",get value(){return a(n)},set value(e){s(n,e,!0)}}),$(2),i(b);var w=t(b,2);{var P=e=>{var r=R(),h=l(r,!0);i(r),G(()=>E(h,a(p))),_(e,r)};H(w,e=>{a(p)&&e(P)})}var z=t(w,2);L(z,{variant:"accent",type:"submit",class:"submit-btn",get disabled(){return a(d)},children:(e,r)=>{$();var h=D("Create account");_(e,h)},$$slots:{default:!0}}),i(m),i(x),i(c),A("submit",m,B),_(q,c),Y()}export{te as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1773729131306"}
|