@tom2012/cc-web 1.5.37 → 1.5.39
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/README.md +5 -1
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +104 -0
- package/backend/dist/index.js.map +1 -1
- package/backend/dist/session-manager.d.ts +3 -1
- package/backend/dist/session-manager.d.ts.map +1 -1
- package/backend/dist/session-manager.js +7 -3
- package/backend/dist/session-manager.js.map +1 -1
- package/backend/dist/terminal-manager.d.ts +5 -1
- package/backend/dist/terminal-manager.d.ts.map +1 -1
- package/backend/dist/terminal-manager.js +13 -2
- package/backend/dist/terminal-manager.js.map +1 -1
- package/frontend/dist/assets/ChatView-DHceYEQu.js +16 -0
- package/frontend/dist/assets/GraphPreview-N3E2cIAz.js +22 -0
- package/frontend/dist/assets/OfficePreview-DU2Hm9q8.js +13 -0
- package/frontend/dist/assets/ProjectPage-9CEnUXvW.css +32 -0
- package/frontend/dist/assets/ProjectPage-tQtkCa-F.js +169 -0
- package/frontend/dist/assets/SettingsPage-BOkP1J2E.js +36 -0
- package/frontend/dist/assets/SkillHubPage-BCEiOqrp.js +11 -0
- package/frontend/dist/assets/chevron-down-3Iee9LeQ.js +6 -0
- package/frontend/dist/assets/index-BoRMSxCU.css +1 -0
- package/frontend/dist/assets/{index-CeSIZyhn.js → index-DosNEafF.js} +1 -1
- package/frontend/dist/assets/index-HZqCo2f1.js +270 -0
- package/frontend/dist/assets/{jszip.min-BEfuE5vH.js → jszip.min-rijCkWTm.js} +1 -1
- package/frontend/dist/assets/select-CyT5wy3n.js +11 -0
- package/frontend/dist/assets/user-DWfPqhZs.js +11 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/index-BJy7DPYK.css +0 -32
- package/frontend/dist/assets/index-D_eyHtwF.js +0 -554
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{c as je,r as C,d as De,j as y,K as q,l as he}from"./index-HZqCo2f1.js";import{L as Ye,Z as Pe,a as Be}from"./ProjectPage-tQtkCa-F.js";import"./select-CyT5wy3n.js";import"./chevron-down-3Iee9LeQ.js";import"./user-DWfPqhZs.js";/**
|
|
2
|
+
* @license lucide-react v0.309.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Re=je("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function Ce(e){return typeof e>"u"||e===null}function $e(e){return typeof e=="object"&&e!==null}function We(e){return Array.isArray(e)?e:Ce(e)?[]:[e]}function Ue(e,n){var i,o,r,c;if(n)for(c=Object.keys(n),i=0,o=c.length;i<o;i+=1)r=c[i],e[r]=n[r];return e}function Ge(e,n){var i="",o;for(o=0;o<n;o+=1)i+=e;return i}function He(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var qe=Ce,ze=$e,Ke=We,Xe=Ge,Ze=He,Ve=Ue,_={isNothing:qe,isObject:ze,toArray:Ke,repeat:Xe,isNegativeZero:Ze,extend:Ve};function ke(e,n){var i="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(i+=`
|
|
7
|
+
|
|
8
|
+
`+e.mark.snippet),o+" "+i):o}function z(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=ke(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}z.prototype=Object.create(Error.prototype);z.prototype.constructor=z;z.prototype.toString=function(n){return this.name+": "+ke(this,n)};var F=z;function ie(e,n,i,o,r){var c="",l="",u=Math.floor(r/2)-1;return o-n>u&&(c=" ... ",n=o-u+c.length),i-o>u&&(l=" ...",i=o+u-l.length),{str:c+e.slice(n,i).replace(/\t/g,"→")+l,pos:o-n+c.length}}function re(e,n){return _.repeat(" ",n-e.length)+e}function Qe(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\r?\n|\r|\0/g,o=[0],r=[],c,l=-1;c=i.exec(e.buffer);)r.push(c.index),o.push(c.index+c[0].length),e.position<=c.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);var u="",t,p,m=Math.min(e.line+n.linesAfter,r.length).toString().length,f=n.maxLength-(n.indent+m+3);for(t=1;t<=n.linesBefore&&!(l-t<0);t++)p=ie(e.buffer,o[l-t],r[l-t],e.position-(o[l]-o[l-t]),f),u=_.repeat(" ",n.indent)+re((e.line-t+1).toString(),m)+" | "+p.str+`
|
|
9
|
+
`+u;for(p=ie(e.buffer,o[l],r[l],e.position,f),u+=_.repeat(" ",n.indent)+re((e.line+1).toString(),m)+" | "+p.str+`
|
|
10
|
+
`,u+=_.repeat("-",n.indent+m+3+p.pos)+`^
|
|
11
|
+
`,t=1;t<=n.linesAfter&&!(l+t>=r.length);t++)p=ie(e.buffer,o[l+t],r[l+t],e.position-(o[l]-o[l+t]),f),u+=_.repeat(" ",n.indent)+re((e.line+t+1).toString(),m)+" | "+p.str+`
|
|
12
|
+
`;return u.replace(/\n$/,"")}var Je=Qe,en=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],nn=["scalar","sequence","mapping"];function rn(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(o){n[String(o)]=i})}),n}function on(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(en.indexOf(i)===-1)throw new F('Unknown option "'+i+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=rn(n.styleAliases||null),nn.indexOf(this.kind)===-1)throw new F('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var k=on;function de(e,n){var i=[];return e[n].forEach(function(o){var r=i.length;i.forEach(function(c,l){c.tag===o.tag&&c.kind===o.kind&&c.multi===o.multi&&(r=l)}),i[r]=o}),i}function ln(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function o(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(o);return e}function le(e){return this.extend(e)}le.prototype.extend=function(n){var i=[],o=[];if(n instanceof k)o.push(n);else if(Array.isArray(n))o=o.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(o=o.concat(n.explicit));else throw new F("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(c){if(!(c instanceof k))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(c.loadKind&&c.loadKind!=="scalar")throw new F("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(c.multi)throw new F("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(c){if(!(c instanceof k))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(le.prototype);return r.implicit=(this.implicit||[]).concat(i),r.explicit=(this.explicit||[]).concat(o),r.compiledImplicit=de(r,"implicit"),r.compiledExplicit=de(r,"explicit"),r.compiledTypeMap=ln(r.compiledImplicit,r.compiledExplicit),r};var cn=le,un=new k("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),tn=new k("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),fn=new k("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),an=new cn({explicit:[un,tn,fn]});function pn(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function sn(){return null}function hn(e){return e===null}var dn=new k("tag:yaml.org,2002:null",{kind:"scalar",resolve:pn,construct:sn,predicate:hn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function mn(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function xn(e){return e==="true"||e==="True"||e==="TRUE"}function gn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var vn=new k("tag:yaml.org,2002:bool",{kind:"scalar",resolve:mn,construct:xn,predicate:gn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function yn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function An(e){return 48<=e&&e<=55}function bn(e){return 48<=e&&e<=57}function wn(e){if(e===null)return!1;var n=e.length,i=0,o=!1,r;if(!n)return!1;if(r=e[i],(r==="-"||r==="+")&&(r=e[++i]),r==="0"){if(i+1===n)return!0;if(r=e[++i],r==="b"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(r!=="0"&&r!=="1")return!1;o=!0}return o&&r!=="_"}if(r==="x"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(!yn(e.charCodeAt(i)))return!1;o=!0}return o&&r!=="_"}if(r==="o"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(!An(e.charCodeAt(i)))return!1;o=!0}return o&&r!=="_"}}if(r==="_")return!1;for(;i<n;i++)if(r=e[i],r!=="_"){if(!bn(e.charCodeAt(i)))return!1;o=!0}return!(!o||r==="_")}function Cn(e){var n=e,i=1,o;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),o=n[0],(o==="-"||o==="+")&&(o==="-"&&(i=-1),n=n.slice(1),o=n[0]),n==="0")return 0;if(o==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function kn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!_.isNegativeZero(e)}var _n=new k("tag:yaml.org,2002:int",{kind:"scalar",resolve:wn,construct:Cn,predicate:kn,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Sn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Nn(e){return!(e===null||!Sn.test(e)||e[e.length-1]==="_")}function En(e){var n,i;return n=e.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var In=/^[-+]?[0-9]+e/;function Tn(e,n){var i;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(_.isNegativeZero(e))return"-0.0";return i=e.toString(10),In.test(i)?i.replace("e",".e"):i}function Fn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||_.isNegativeZero(e))}var On=new k("tag:yaml.org,2002:float",{kind:"scalar",resolve:Nn,construct:En,predicate:Fn,represent:Tn,defaultStyle:"lowercase"}),Mn=an.extend({implicit:[dn,vn,_n,On]}),Ln=Mn,_e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Se=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function jn(e){return e===null?!1:_e.exec(e)!==null||Se.exec(e)!==null}function Dn(e){var n,i,o,r,c,l,u,t=0,p=null,m,f,A;if(n=_e.exec(e),n===null&&(n=Se.exec(e)),n===null)throw new Error("Date resolve error");if(i=+n[1],o=+n[2]-1,r=+n[3],!n[4])return new Date(Date.UTC(i,o,r));if(c=+n[4],l=+n[5],u=+n[6],n[7]){for(t=n[7].slice(0,3);t.length<3;)t+="0";t=+t}return n[9]&&(m=+n[10],f=+(n[11]||0),p=(m*60+f)*6e4,n[9]==="-"&&(p=-p)),A=new Date(Date.UTC(i,o,r,c,l,u,t)),p&&A.setTime(A.getTime()-p),A}function Yn(e){return e.toISOString()}var Pn=new k("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:jn,construct:Dn,instanceOf:Date,represent:Yn});function Bn(e){return e==="<<"||e===null}var Rn=new k("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Bn}),ce=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
13
|
+
\r`;function $n(e){if(e===null)return!1;var n,i,o=0,r=e.length,c=ce;for(i=0;i<r;i++)if(n=c.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;o+=6}return o%8===0}function Wn(e){var n,i,o=e.replace(/[\r\n=]/g,""),r=o.length,c=ce,l=0,u=[];for(n=0;n<r;n++)n%4===0&&n&&(u.push(l>>16&255),u.push(l>>8&255),u.push(l&255)),l=l<<6|c.indexOf(o.charAt(n));return i=r%4*6,i===0?(u.push(l>>16&255),u.push(l>>8&255),u.push(l&255)):i===18?(u.push(l>>10&255),u.push(l>>2&255)):i===12&&u.push(l>>4&255),new Uint8Array(u)}function Un(e){var n="",i=0,o,r,c=e.length,l=ce;for(o=0;o<c;o++)o%3===0&&o&&(n+=l[i>>18&63],n+=l[i>>12&63],n+=l[i>>6&63],n+=l[i&63]),i=(i<<8)+e[o];return r=c%3,r===0?(n+=l[i>>18&63],n+=l[i>>12&63],n+=l[i>>6&63],n+=l[i&63]):r===2?(n+=l[i>>10&63],n+=l[i>>4&63],n+=l[i<<2&63],n+=l[64]):r===1&&(n+=l[i>>2&63],n+=l[i<<4&63],n+=l[64],n+=l[64]),n}function Gn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Hn=new k("tag:yaml.org,2002:binary",{kind:"scalar",resolve:$n,construct:Wn,predicate:Gn,represent:Un}),qn=Object.prototype.hasOwnProperty,zn=Object.prototype.toString;function Kn(e){if(e===null)return!0;var n=[],i,o,r,c,l,u=e;for(i=0,o=u.length;i<o;i+=1){if(r=u[i],l=!1,zn.call(r)!=="[object Object]")return!1;for(c in r)if(qn.call(r,c))if(!l)l=!0;else return!1;if(!l)return!1;if(n.indexOf(c)===-1)n.push(c);else return!1}return!0}function Xn(e){return e!==null?e:[]}var Zn=new k("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Kn,construct:Xn}),Vn=Object.prototype.toString;function Qn(e){if(e===null)return!0;var n,i,o,r,c,l=e;for(c=new Array(l.length),n=0,i=l.length;n<i;n+=1){if(o=l[n],Vn.call(o)!=="[object Object]"||(r=Object.keys(o),r.length!==1))return!1;c[n]=[r[0],o[r[0]]]}return!0}function Jn(e){if(e===null)return[];var n,i,o,r,c,l=e;for(c=new Array(l.length),n=0,i=l.length;n<i;n+=1)o=l[n],r=Object.keys(o),c[n]=[r[0],o[r[0]]];return c}var ei=new k("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Qn,construct:Jn}),ni=Object.prototype.hasOwnProperty;function ii(e){if(e===null)return!0;var n,i=e;for(n in i)if(ni.call(i,n)&&i[n]!==null)return!1;return!0}function ri(e){return e!==null?e:{}}var oi=new k("tag:yaml.org,2002:set",{kind:"mapping",resolve:ii,construct:ri}),li=Ln.extend({implicit:[Pn,Rn],explicit:[Hn,Zn,ei,oi]}),D=Object.prototype.hasOwnProperty,V=1,Ne=2,Ee=3,Q=4,oe=1,ci=2,me=3,ui=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ti=/[\x85\u2028\u2029]/,fi=/[,\[\]\{\}]/,Ie=/^(?:!|!!|![a-z\-]+!)$/i,Te=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function xe(e){return Object.prototype.toString.call(e)}function T(e){return e===10||e===13}function B(e){return e===9||e===32}function N(e){return e===9||e===32||e===10||e===13}function $(e){return e===44||e===91||e===93||e===123||e===125}function ai(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function pi(e){return e===120?2:e===117?4:e===85?8:0}function si(e){return 48<=e&&e<=57?e-48:-1}function ge(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
14
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function hi(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Fe(e,n,i){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[n]=i}var Oe=new Array(256),Me=new Array(256);for(var R=0;R<256;R++)Oe[R]=ge(R)?1:0,Me[R]=ge(R);function di(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||li,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Le(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=Je(i),new F(n,i)}function a(e,n){throw Le(e,n)}function J(e,n){e.onWarning&&e.onWarning.call(null,Le(e,n))}var ve={YAML:function(n,i,o){var r,c,l;n.version!==null&&a(n,"duplication of %YAML directive"),o.length!==1&&a(n,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),r===null&&a(n,"ill-formed argument of the YAML directive"),c=parseInt(r[1],10),l=parseInt(r[2],10),c!==1&&a(n,"unacceptable YAML version of the document"),n.version=o[0],n.checkLineBreaks=l<2,l!==1&&l!==2&&J(n,"unsupported YAML version of the document")},TAG:function(n,i,o){var r,c;o.length!==2&&a(n,"TAG directive accepts exactly two arguments"),r=o[0],c=o[1],Ie.test(r)||a(n,"ill-formed tag handle (first argument) of the TAG directive"),D.call(n.tagMap,r)&&a(n,'there is a previously declared suffix for "'+r+'" tag handle'),Te.test(c)||a(n,"ill-formed tag prefix (second argument) of the TAG directive");try{c=decodeURIComponent(c)}catch{a(n,"tag prefix is malformed: "+c)}n.tagMap[r]=c}};function j(e,n,i,o){var r,c,l,u;if(n<i){if(u=e.input.slice(n,i),o)for(r=0,c=u.length;r<c;r+=1)l=u.charCodeAt(r),l===9||32<=l&&l<=1114111||a(e,"expected valid JSON character");else ui.test(u)&&a(e,"the stream contains non-printable characters");e.result+=u}}function ye(e,n,i,o){var r,c,l,u;for(_.isObject(i)||a(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(i),l=0,u=r.length;l<u;l+=1)c=r[l],D.call(n,c)||(Fe(n,c,i[c]),o[c]=!0)}function W(e,n,i,o,r,c,l,u,t){var p,m;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),p=0,m=r.length;p<m;p+=1)Array.isArray(r[p])&&a(e,"nested arrays are not supported inside keys"),typeof r=="object"&&xe(r[p])==="[object Object]"&&(r[p]="[object Object]");if(typeof r=="object"&&xe(r)==="[object Object]"&&(r="[object Object]"),r=String(r),n===null&&(n={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(c))for(p=0,m=c.length;p<m;p+=1)ye(e,n,c[p],i);else ye(e,n,c,i);else!e.json&&!D.call(i,r)&&D.call(n,r)&&(e.line=l||e.line,e.lineStart=u||e.lineStart,e.position=t||e.position,a(e,"duplicated mapping key")),Fe(n,r,c),delete i[r];return n}function ue(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):a(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function w(e,n,i){for(var o=0,r=e.input.charCodeAt(e.position);r!==0;){for(;B(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(n&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(T(r))for(ue(e),r=e.input.charCodeAt(e.position),o++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return i!==-1&&o!==0&&e.lineIndent<i&&J(e,"deficient indentation"),o}function ee(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||N(i)))}function te(e,n){n===1?e.result+=" ":n>1&&(e.result+=_.repeat(`
|
|
15
|
+
`,n-1))}function mi(e,n,i){var o,r,c,l,u,t,p,m,f=e.kind,A=e.result,s;if(s=e.input.charCodeAt(e.position),N(s)||$(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(r=e.input.charCodeAt(e.position+1),N(r)||i&&$(r)))return!1;for(e.kind="scalar",e.result="",c=l=e.position,u=!1;s!==0;){if(s===58){if(r=e.input.charCodeAt(e.position+1),N(r)||i&&$(r))break}else if(s===35){if(o=e.input.charCodeAt(e.position-1),N(o))break}else{if(e.position===e.lineStart&&ee(e)||i&&$(s))break;if(T(s))if(t=e.line,p=e.lineStart,m=e.lineIndent,w(e,!1,-1),e.lineIndent>=n){u=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=t,e.lineStart=p,e.lineIndent=m;break}}u&&(j(e,c,l,!1),te(e,e.line-t),c=l=e.position,u=!1),B(s)||(l=e.position+1),s=e.input.charCodeAt(++e.position)}return j(e,c,l,!1),e.result?!0:(e.kind=f,e.result=A,!1)}function xi(e,n){var i,o,r;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=r=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(j(e,o,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)o=e.position,e.position++,r=e.position;else return!0;else T(i)?(j(e,o,r,!0),te(e,w(e,!1,n)),o=r=e.position):e.position===e.lineStart&&ee(e)?a(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);a(e,"unexpected end of the stream within a single quoted scalar")}function gi(e,n){var i,o,r,c,l,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return j(e,i,e.position,!0),e.position++,!0;if(u===92){if(j(e,i,e.position,!0),u=e.input.charCodeAt(++e.position),T(u))w(e,!1,n);else if(u<256&&Oe[u])e.result+=Me[u],e.position++;else if((l=pi(u))>0){for(r=l,c=0;r>0;r--)u=e.input.charCodeAt(++e.position),(l=ai(u))>=0?c=(c<<4)+l:a(e,"expected hexadecimal character");e.result+=hi(c),e.position++}else a(e,"unknown escape sequence");i=o=e.position}else T(u)?(j(e,i,o,!0),te(e,w(e,!1,n)),i=o=e.position):e.position===e.lineStart&&ee(e)?a(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}a(e,"unexpected end of the stream within a double quoted scalar")}function vi(e,n){var i=!0,o,r,c,l=e.tag,u,t=e.anchor,p,m,f,A,s,g=Object.create(null),b,v,h,d;if(d=e.input.charCodeAt(e.position),d===91)m=93,s=!1,u=[];else if(d===123)m=125,s=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),d=e.input.charCodeAt(++e.position);d!==0;){if(w(e,!0,n),d=e.input.charCodeAt(e.position),d===m)return e.position++,e.tag=l,e.anchor=t,e.kind=s?"mapping":"sequence",e.result=u,!0;i?d===44&&a(e,"expected the node content, but found ','"):a(e,"missed comma between flow collection entries"),v=b=h=null,f=A=!1,d===63&&(p=e.input.charCodeAt(e.position+1),N(p)&&(f=A=!0,e.position++,w(e,!0,n))),o=e.line,r=e.lineStart,c=e.position,U(e,n,V,!1,!0),v=e.tag,b=e.result,w(e,!0,n),d=e.input.charCodeAt(e.position),(A||e.line===o)&&d===58&&(f=!0,d=e.input.charCodeAt(++e.position),w(e,!0,n),U(e,n,V,!1,!0),h=e.result),s?W(e,u,g,v,b,h,o,r,c):f?u.push(W(e,null,g,v,b,h,o,r,c)):u.push(b),w(e,!0,n),d=e.input.charCodeAt(e.position),d===44?(i=!0,d=e.input.charCodeAt(++e.position)):i=!1}a(e,"unexpected end of the stream within a flow collection")}function yi(e,n){var i,o,r=oe,c=!1,l=!1,u=n,t=0,p=!1,m,f;if(f=e.input.charCodeAt(e.position),f===124)o=!1;else if(f===62)o=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)oe===r?r=f===43?me:ci:a(e,"repeat of a chomping mode identifier");else if((m=si(f))>=0)m===0?a(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?a(e,"repeat of an indentation width identifier"):(u=n+m-1,l=!0);else break;if(B(f)){do f=e.input.charCodeAt(++e.position);while(B(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!T(f)&&f!==0)}for(;f!==0;){for(ue(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!l||e.lineIndent<u)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>u&&(u=e.lineIndent),T(f)){t++;continue}if(e.lineIndent<u){r===me?e.result+=_.repeat(`
|
|
16
|
+
`,c?1+t:t):r===oe&&c&&(e.result+=`
|
|
17
|
+
`);break}for(o?B(f)?(p=!0,e.result+=_.repeat(`
|
|
18
|
+
`,c?1+t:t)):p?(p=!1,e.result+=_.repeat(`
|
|
19
|
+
`,t+1)):t===0?c&&(e.result+=" "):e.result+=_.repeat(`
|
|
20
|
+
`,t):e.result+=_.repeat(`
|
|
21
|
+
`,c?1+t:t),c=!0,l=!0,t=0,i=e.position;!T(f)&&f!==0;)f=e.input.charCodeAt(++e.position);j(e,i,e.position,!1)}return!0}function Ae(e,n){var i,o=e.tag,r=e.anchor,c=[],l,u=!1,t;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),t=e.input.charCodeAt(e.position);t!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,a(e,"tab characters must not be used in indentation")),!(t!==45||(l=e.input.charCodeAt(e.position+1),!N(l))));){if(u=!0,e.position++,w(e,!0,-1)&&e.lineIndent<=n){c.push(null),t=e.input.charCodeAt(e.position);continue}if(i=e.line,U(e,n,Ee,!1,!0),c.push(e.result),w(e,!0,-1),t=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&t!==0)a(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return u?(e.tag=o,e.anchor=r,e.kind="sequence",e.result=c,!0):!1}function Ai(e,n,i){var o,r,c,l,u,t,p=e.tag,m=e.anchor,f={},A=Object.create(null),s=null,g=null,b=null,v=!1,h=!1,d;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),d=e.input.charCodeAt(e.position);d!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,a(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),c=e.line,(d===63||d===58)&&N(o))d===63?(v&&(W(e,f,A,s,g,null,l,u,t),s=g=b=null),h=!0,v=!0,r=!0):v?(v=!1,r=!0):a(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,d=o;else{if(l=e.line,u=e.lineStart,t=e.position,!U(e,i,Ne,!1,!0))break;if(e.line===c){for(d=e.input.charCodeAt(e.position);B(d);)d=e.input.charCodeAt(++e.position);if(d===58)d=e.input.charCodeAt(++e.position),N(d)||a(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(W(e,f,A,s,g,null,l,u,t),s=g=b=null),h=!0,v=!1,r=!1,s=e.tag,g=e.result;else if(h)a(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=p,e.anchor=m,!0}else if(h)a(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=p,e.anchor=m,!0}if((e.line===c||e.lineIndent>n)&&(v&&(l=e.line,u=e.lineStart,t=e.position),U(e,n,Q,!0,r)&&(v?g=e.result:b=e.result),v||(W(e,f,A,s,g,b,l,u,t),s=g=b=null),w(e,!0,-1),d=e.input.charCodeAt(e.position)),(e.line===c||e.lineIndent>n)&&d!==0)a(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return v&&W(e,f,A,s,g,null,l,u,t),h&&(e.tag=p,e.anchor=m,e.kind="mapping",e.result=f),h}function bi(e){var n,i=!1,o=!1,r,c,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&a(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(i=!0,l=e.input.charCodeAt(++e.position)):l===33?(o=!0,r="!!",l=e.input.charCodeAt(++e.position)):r="!",n=e.position,i){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(c=e.input.slice(n,e.position),l=e.input.charCodeAt(++e.position)):a(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!N(l);)l===33&&(o?a(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(n-1,e.position+1),Ie.test(r)||a(e,"named tag handle cannot contain such characters"),o=!0,n=e.position+1)),l=e.input.charCodeAt(++e.position);c=e.input.slice(n,e.position),fi.test(c)&&a(e,"tag suffix cannot contain flow indicator characters")}c&&!Te.test(c)&&a(e,"tag name cannot contain such characters: "+c);try{c=decodeURIComponent(c)}catch{a(e,"tag name is malformed: "+c)}return i?e.tag=c:D.call(e.tagMap,r)?e.tag=e.tagMap[r]+c:r==="!"?e.tag="!"+c:r==="!!"?e.tag="tag:yaml.org,2002:"+c:a(e,'undeclared tag handle "'+r+'"'),!0}function wi(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&a(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!N(i)&&!$(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&a(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Ci(e){var n,i,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!N(o)&&!$(o);)o=e.input.charCodeAt(++e.position);return e.position===n&&a(e,"name of an alias node must contain at least one character"),i=e.input.slice(n,e.position),D.call(e.anchorMap,i)||a(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],w(e,!0,-1),!0}function U(e,n,i,o,r){var c,l,u,t=1,p=!1,m=!1,f,A,s,g,b,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,c=l=u=Q===i||Ee===i,o&&w(e,!0,-1)&&(p=!0,e.lineIndent>n?t=1:e.lineIndent===n?t=0:e.lineIndent<n&&(t=-1)),t===1)for(;bi(e)||wi(e);)w(e,!0,-1)?(p=!0,u=c,e.lineIndent>n?t=1:e.lineIndent===n?t=0:e.lineIndent<n&&(t=-1)):u=!1;if(u&&(u=p||r),(t===1||Q===i)&&(V===i||Ne===i?b=n:b=n+1,v=e.position-e.lineStart,t===1?u&&(Ae(e,v)||Ai(e,v,b))||vi(e,b)?m=!0:(l&&yi(e,b)||xi(e,b)||gi(e,b)?m=!0:Ci(e)?(m=!0,(e.tag!==null||e.anchor!==null)&&a(e,"alias node should not have any properties")):mi(e,b,V===i)&&(m=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):t===0&&(m=u&&Ae(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&a(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,A=e.implicitTypes.length;f<A;f+=1)if(g=e.implicitTypes[f],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(D.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,s=e.typeMap.multi[e.kind||"fallback"],f=0,A=s.length;f<A;f+=1)if(e.tag.slice(0,s[f].tag.length)===s[f].tag){g=s[f];break}g||a(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&a(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):a(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||m}function ki(e){var n=e.position,i,o,r,c=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(w(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(c=!0,l=e.input.charCodeAt(++e.position),i=e.position;l!==0&&!N(l);)l=e.input.charCodeAt(++e.position);for(o=e.input.slice(i,e.position),r=[],o.length<1&&a(e,"directive name must not be less than one character in length");l!==0;){for(;B(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!T(l));break}if(T(l))break;for(i=e.position;l!==0&&!N(l);)l=e.input.charCodeAt(++e.position);r.push(e.input.slice(i,e.position))}l!==0&&ue(e),D.call(ve,o)?ve[o](e,o,r):J(e,'unknown document directive "'+o+'"')}if(w(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,w(e,!0,-1)):c&&a(e,"directives end mark is expected"),U(e,e.lineIndent-1,Q,!1,!0),w(e,!0,-1),e.checkLineBreaks&&ti.test(e.input.slice(n,e.position))&&J(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ee(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,w(e,!0,-1));return}if(e.position<e.length-1)a(e,"end of the stream or a document separator is expected");else return}function _i(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
22
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new di(e,n),o=e.indexOf("\0");for(o!==-1&&(i.position=o,a(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)ki(i);return i.documents}function Si(e,n){var i=_i(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new F("expected a single document in the stream, but found more")}}var Ni=Si,Ei={load:Ni},Ii=Ei.load;function be(e){var v;const n=e.pages||[],i=e.relations||[];if(n.length===0)return{nodes:[],edges:[]};const o=new Map,r=new Map;for(const h of n)o.set(h.id,[]),r.set(h.id,0);for(const h of i)(v=o.get(h.from))==null||v.push(h.to),r.set(h.to,(r.get(h.to)||0)+1);const c=new Map,l=[];for(const h of n)(r.get(h.id)||0)===0&&(l.push(h.id),c.set(h.id,0));let u=0;for(;l.length>0;){const h=l.shift(),d=c.get(h)||0;for(const O of o.get(h)||[]){const M=d+1;M>(c.get(O)||0)&&(c.set(O,M),M>u&&(u=M));const L=(r.get(O)||1)-1;r.set(O,L),L<=0&&l.push(O)}}for(const h of n)c.has(h.id)||c.set(h.id,u+1);const t=new Map;for(const h of n){const d=c.get(h.id)||0;t.has(d)||t.set(d,[]),t.get(d).push(h.id)}const p=160,m=50,f=60,A=80,s=[],g=new Map(n.map(h=>[h.id,h]));for(const[h,d]of t){const M=-(d.length*p+(d.length-1)*f)/2;d.forEach((L,K)=>{const Y=g.get(L);s.push({id:L,title:(Y==null?void 0:Y.title)||L,x:M+K*(p+f)+p/2,y:h*(m+A),layer:h})})}const b=i.map(h=>({from:h.from,to:h.to,label:h.label}));return{nodes:s,edges:b}}const we=["#3b82f6","#8b5cf6","#ec4899","#f59e0b","#10b981","#06b6d4","#f97316","#6366f1"];function ji({folderPath:e}){const[n,i]=C.useState(null),[o,r]=C.useState(!0),[c,l]=C.useState(null),[u,t]=C.useState(1),[p,m]=C.useState({x:0,y:0}),[f,A]=C.useState(!1),[s,g]=C.useState({x:0,y:0}),b=C.useRef(null),v=C.useRef(null),h=`${e}/.notebook/graph.yaml`,d=C.useCallback(async()=>{r(!0),l(null);try{const x=await De(h);if(!x.content){l("graph.yaml is empty"),i(null);return}const I=Ii(x.content);i(I),t(1),m({x:0,y:0})}catch{l("Cannot read .notebook/graph.yaml"),i(null)}finally{r(!1)}},[h]);C.useEffect(()=>{d()},[d]);const O=C.useCallback(x=>{x.preventDefault();const I=x.deltaY>0?-.1:.1;t(S=>Math.max(.2,Math.min(3,S+I)))},[]),M=C.useCallback(x=>{x.button===0&&(A(!0),g({x:x.clientX-p.x,y:x.clientY-p.y}))},[p]),L=C.useCallback(x=>{f&&m({x:x.clientX-s.x,y:x.clientY-s.y})},[f,s]),K=C.useCallback(()=>{A(!1)},[]),Y=C.useCallback(()=>{if(!n||!v.current)return;const{nodes:x}=be(n);if(x.length===0)return;const I=Math.min(...x.map(P=>P.x))-100,S=Math.max(...x.map(P=>P.x))+100,E=Math.min(...x.map(P=>P.y))-40,G=Math.max(...x.map(P=>P.y))+60,Z=S-I,H=G-E,pe=v.current.clientWidth,se=v.current.clientHeight,ne=Math.min(pe/Z,se/H,1.5)*.9;t(ne),m({x:pe/2-(I+S)/2*ne,y:se/2-(E+G)/2*ne})},[n]),{nodes:X,edges:fe}=C.useMemo(()=>n?be(n):{nodes:[],edges:[]},[n]),ae=C.useMemo(()=>new Map(X.map(x=>[x.id,x])),[X]);return C.useEffect(()=>{n&&!o&&setTimeout(Y,50)},[n,o,Y]),o?y.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:y.jsx(Ye,{className:"h-5 w-5 animate-spin"})}):c||!n?y.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-muted-foreground text-sm px-4 text-center",children:[y.jsx("p",{children:c||"No graph data"}),y.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>void d(),children:[y.jsx(he,{className:"h-3 w-3 mr-1"})," Retry"]})]}):y.jsxs("div",{className:"flex flex-col h-full",children:[y.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 border-b shrink-0",children:[y.jsxs("span",{className:"text-xs text-muted-foreground mr-auto",children:[X.length," pages, ",fe.length," relations"]}),y.jsx(q,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>t(x=>Math.min(3,x+.2)),children:y.jsx(Pe,{className:"h-3 w-3"})}),y.jsx(q,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>t(x=>Math.max(.2,x-.2)),children:y.jsx(Be,{className:"h-3 w-3"})}),y.jsx(q,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Y,children:y.jsx(Re,{className:"h-3 w-3"})}),y.jsx(q,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>void d(),children:y.jsx(he,{className:"h-3 w-3"})})]}),y.jsx("div",{ref:v,className:"flex-1 overflow-hidden cursor-grab active:cursor-grabbing bg-muted/30",onWheel:O,onMouseDown:M,onMouseMove:L,onMouseUp:K,onMouseLeave:K,children:y.jsxs("svg",{ref:b,width:"100%",height:"100%",style:{userSelect:"none"},children:[y.jsx("defs",{children:y.jsx("marker",{id:"arrowhead",viewBox:"0 0 10 7",refX:"10",refY:"3.5",markerWidth:"8",markerHeight:"6",orient:"auto",children:y.jsx("polygon",{points:"0 0, 10 3.5, 0 7",className:"fill-muted-foreground/60"})})}),y.jsxs("g",{transform:`translate(${p.x}, ${p.y}) scale(${u})`,children:[fe.map((x,I)=>{const S=ae.get(x.from),E=ae.get(x.to);if(!S||!E)return null;const G=S.y+20,Z=E.y-20,H=(G+Z)/2;return y.jsxs("g",{children:[y.jsx("path",{d:`M ${S.x} ${G} C ${S.x} ${H}, ${E.x} ${H}, ${E.x} ${Z}`,fill:"none",className:"stroke-muted-foreground/40",strokeWidth:1.5,markerEnd:"url(#arrowhead)"}),x.label&&y.jsx("text",{x:(S.x+E.x)/2,y:H-4,textAnchor:"middle",className:"fill-muted-foreground/60",fontSize:9,children:x.label})]},`edge-${I}`)}),X.map(x=>{const I=we[x.layer%we.length],S=140,E=36;return y.jsxs("g",{transform:`translate(${x.x-S/2}, ${x.y-E/2})`,children:[y.jsx("rect",{width:S,height:E,rx:8,fill:I,fillOpacity:.15,stroke:I,strokeWidth:1.5}),y.jsx("text",{x:S/2,y:E/2+1,textAnchor:"middle",dominantBaseline:"middle",className:"fill-foreground",fontSize:11,fontWeight:500,children:x.title.length>14?x.title.slice(0,13)+"…":x.title})]},x.id)})]})]})})]})}export{ji as GraphPreview};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DosNEafF.js","assets/index-HZqCo2f1.js","assets/index-BoRMSxCU.css","assets/jszip.min-rijCkWTm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as c,_ as m,b as y,h as S}from"./index-HZqCo2f1.js";async function h(a){let l=S(a);const s=y();s&&(l+=`${l.includes("?")?"&":"?"}token=${encodeURIComponent(s)}`);const d=await fetch(l);if(!d.ok)throw new Error(`Failed to fetch file: ${d.status}`);return d.arrayBuffer()}function j({filePath:a,zoom:l}){const[s,d]=c.useState(""),[x,n]=c.useState(null),[u,i]=c.useState(!0);return c.useEffect(()=>{let t=!1;return i(!0),n(null),(async()=>{try{const r=await m(()=>import("./index-DosNEafF.js").then(f=>f.i),__vite__mapDeps([0,1,2,3])),o=await h(a),p=await r.convertToHtml({arrayBuffer:o});t||d(p.value)}catch(r){t||n(r instanceof Error?r.message:"Failed to render docx")}finally{t||i(!1)}})(),()=>{t=!0}},[a]),u?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Word 文档中..."}):x?e.jsx("p",{className:"text-sm text-destructive p-4",children:x}):e.jsx("div",{className:"p-6 prose dark:prose-invert max-w-none",style:{fontSize:`${12*l/100}px`},dangerouslySetInnerHTML:{__html:s}})}function _({filePath:a,zoom:l}){var o;const[s,d]=c.useState([]),[x,n]=c.useState(0),[u,i]=c.useState(null),[t,r]=c.useState(!0);return c.useEffect(()=>{let p=!1;return r(!0),i(null),(async()=>{try{const f=await m(()=>import("./xlsx-D_0l8YDs.js"),[]),v=await h(a),g=f.read(v,{type:"array"}),b=g.SheetNames.map(w=>({name:w,html:f.utils.sheet_to_html(g.Sheets[w],{editable:!1})}));p||(d(b),n(0))}catch(f){p||i(f instanceof Error?f.message:"Failed to render xlsx")}finally{p||r(!1)}})(),()=>{p=!0}},[a]),t?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Excel 文件中..."}):u?e.jsx("p",{className:"text-sm text-destructive p-4",children:u}):s.length===0?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsxs("div",{className:"flex flex-col h-full",children:[s.length>1&&e.jsx("div",{className:"flex gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30 flex-shrink-0 overflow-x-auto",children:s.map((p,f)=>e.jsx("button",{onClick:()=>n(f),className:`px-3 py-1 text-xs rounded-t transition-colors whitespace-nowrap ${f===x?"bg-background text-foreground border border-b-0 border-border":"text-muted-foreground hover:text-foreground"}`,children:p.name},f))}),e.jsx("div",{className:"flex-1 overflow-auto p-2 xlsx-preview",style:{fontSize:`${12*l/100}px`},dangerouslySetInnerHTML:{__html:((o=s[x])==null?void 0:o.html)??""}}),e.jsx("style",{children:`
|
|
3
|
+
.xlsx-preview table { border-collapse: collapse; width: auto; min-width: 100%; }
|
|
4
|
+
.xlsx-preview td, .xlsx-preview th {
|
|
5
|
+
border: 1px solid hsl(var(--border));
|
|
6
|
+
padding: 4px 8px;
|
|
7
|
+
text-align: left;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
font-size: inherit;
|
|
10
|
+
}
|
|
11
|
+
.xlsx-preview th { background: hsl(var(--muted)); font-weight: 600; }
|
|
12
|
+
.xlsx-preview tr:hover td { background: hsl(var(--accent) / 0.3); }
|
|
13
|
+
`})]})}async function E(a){const{default:l}=await m(async()=>{const{default:n}=await import("./jszip.min-rijCkWTm.js").then(u=>u.j);return{default:n}},__vite__mapDeps([3,1,2])),s=await l.loadAsync(a),d=[],x=Object.keys(s.files).filter(n=>/^ppt\/slides\/slide\d+\.xml$/i.test(n)).sort((n,u)=>{var r,o;const i=parseInt(((r=n.match(/slide(\d+)/))==null?void 0:r[1])??"0"),t=parseInt(((o=u.match(/slide(\d+)/))==null?void 0:o[1])??"0");return i-t});for(let n=0;n<x.length;n++){const u=await s.file(x[n]).async("text"),i=[],t=/<a:t[^>]*>([\s\S]*?)<\/a:t>/g;let r;for(;(r=t.exec(u))!==null;){const o=r[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').trim();o&&i.push(o)}d.push({index:n+1,texts:i})}return d}function N({filePath:a,zoom:l}){const[s,d]=c.useState([]),[x,n]=c.useState(null),[u,i]=c.useState(!0);return c.useEffect(()=>{let t=!1;return i(!0),n(null),(async()=>{try{const r=await h(a),o=await E(r);t||d(o)}catch(r){t||n(r instanceof Error?r.message:"Failed to render pptx")}finally{t||i(!1)}})(),()=>{t=!0}},[a]),u?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 PPT 文件中..."}):x?e.jsx("p",{className:"text-sm text-destructive p-4",children:x}):s.length===0?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsx("div",{className:"p-4 space-y-4",style:{fontSize:`${12*l/100}px`},children:s.map(t=>e.jsxs("div",{className:"border border-border rounded-lg p-5 bg-muted/20",children:[e.jsxs("div",{className:"text-xs text-muted-foreground mb-2 font-medium",children:["Slide ",t.index]}),t.texts.length>0?e.jsx("div",{className:"space-y-1.5",children:t.texts.map((r,o)=>e.jsx("p",{className:"text-foreground leading-relaxed",style:{fontSize:"inherit"},children:r},o))}):e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"(无文本内容)"})]},t.index))})}const I=new Set(["docx","xlsx","xls","pptx"]);function L({filePath:a,ext:l,zoom:s}){return l==="docx"?e.jsx(j,{filePath:a,zoom:s}):l==="xlsx"||l==="xls"?e.jsx(_,{filePath:a,zoom:s}):l==="pptx"?e.jsx(N,{filePath:a,zoom:s}):null}export{I as OFFICE_EXTS,L as OfficePreview};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
3
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
4
|
+
* https://github.com/chjj/term.js
|
|
5
|
+
* @license MIT
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in
|
|
15
|
+
* all copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
* THE SOFTWARE.
|
|
24
|
+
*
|
|
25
|
+
* Originally forked from (with the author's permission):
|
|
26
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
27
|
+
* http://bellard.org/jslinux/
|
|
28
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
29
|
+
* The original design remains. The terminal itself
|
|
30
|
+
* has been extended to include xterm CSI codes, among
|
|
31
|
+
* other features.
|
|
32
|
+
*/.xterm{cursor:text;position:relative;-moz-user-select:none;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::-moz-selection{color:transparent}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:-moz-fit-content;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:double underline;text-decoration:double underline}.xterm-underline-3{-webkit-text-decoration:wavy underline;text-decoration:wavy underline}.xterm-underline-4{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.xterm-underline-5{-webkit-text-decoration:dashed underline;text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}
|