f7cloud_client/apps/text/js/diagram-PSM6KHXK-Dz6SO3L1.chunk.mjs
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

26 lines
16 KiB
JavaScript

import{_ as w,F as Y,G as ee,K as oe,e as ie,l as Q,aZ as B,d as K,b as ce,a as de,q as pe,t as he,g as ue,s as fe,H as me,a_ as ye,z as ge}from"./mermaid.core-BxtrgwOm.chunk.mjs";import{s as xe}from"./chunk-QN33PNHL-BzMeKeZN.chunk.mjs";import{p as Se}from"./chunk-4BX2VUAB-De5HNejl.chunk.mjs";import{p as ve}from"./treemap-KMMF4GRG-DJhEU9NB.chunk.mjs";import{b as R}from"./defaultLocale-0_YM-Ssk.chunk.mjs";import{o as J}from"./ordinal-D6YK7yj2.chunk.mjs";import"./index-CYtgifWR.chunk.mjs";import"./emoji-picker-B23JpFV7.chunk.mjs";import"./NcLoadingIcon-zQCGdPwE.chunk.mjs";import"./vue.runtime.esm-fahCO3eG.chunk.mjs";import"./index-DxwFe63_.chunk.mjs";import"./_baseUniq-08qBA_if.chunk.mjs";import"./_basePickBy-D4Ve5JSk.chunk.mjs";import"./clone-Cq87TdKW.chunk.mjs";import"./init-CLzSasj9.chunk.mjs";function Ce(t){var a=0,n=t.children,r=n&&n.length;if(!r)a=1;else for(;--r>=0;)a+=n[r].value;t.value=a}function be(){return this.eachAfter(Ce)}function we(t,a){let n=-1;for(const r of this)t.call(a,r,++n,this);return this}function $e(t,a){for(var n=this,r=[n],o,s,d=-1;n=r.pop();)if(t.call(a,n,++d,this),o=n.children)for(s=o.length-1;s>=0;--s)r.push(o[s]);return this}function Le(t,a){for(var n=this,r=[n],o=[],s,d,p,f=-1;n=r.pop();)if(o.push(n),s=n.children)for(d=0,p=s.length;d<p;++d)r.push(s[d]);for(;n=o.pop();)t.call(a,n,++f,this);return this}function Te(t,a){let n=-1;for(const r of this)if(t.call(a,r,++n,this))return r}function Me(t){return this.eachAfter(function(a){for(var n=+t(a.data)||0,r=a.children,o=r&&r.length;--o>=0;)n+=r[o].value;a.value=n})}function ke(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ze(t){for(var a=this,n=Fe(a,t),r=[a];a!==n;)a=a.parent,r.push(a);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function Fe(t,a){if(t===a)return t;var n=t.ancestors(),r=a.ancestors(),o=null;for(t=n.pop(),a=r.pop();t===a;)o=t,t=n.pop(),a=r.pop();return o}function Ae(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Pe(){return Array.from(this)}function Be(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ne(){var t=this,a=[];return t.each(function(n){n!==t&&a.push({source:n.parent,target:n})}),a}function*We(){var t=this,a,n=[t],r,o,s;do for(a=n.reverse(),n=[];t=a.pop();)if(yield t,r=t.children)for(o=0,s=r.length;o<s;++o)n.push(r[o]);while(n.length)}function U(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ee)):a===void 0&&(a=Ie);for(var n=new Z(t),r,o=[n],s,d,p,f;r=o.pop();)if((d=a(r.data))&&(f=(d=Array.from(d)).length))for(r.children=d,p=f-1;p>=0;--p)o.push(s=d[p]=new Z(d[p])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(He)}function De(){return U(this).eachBefore(Re)}function Ie(t){return t.children}function Ee(t){return Array.isArray(t)?t[1]:null}function Re(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function He(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=U.prototype={constructor:Z,count:be,each:we,eachAfter:Le,eachBefore:$e,find:Te,sum:Me,sort:ke,path:ze,ancestors:Ae,descendants:Pe,leaves:Be,links:Ne,copy:De,[Symbol.iterator]:We};function Ve(t){if(typeof t!="function")throw new Error;return t}function H(){return 0}function V(t){return function(){return t}}function je(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ge(t,a,n,r,o){for(var s=t.children,d,p=-1,f=s.length,i=t.value&&(r-a)/t.value;++p<f;)d=s[p],d.y0=n,d.y1=o,d.x0=a,d.x1=a+=d.value*i}function _e(t,a,n,r,o){for(var s=t.children,d,p=-1,f=s.length,i=t.value&&(o-n)/t.value;++p<f;)d=s[p],d.x0=a,d.x1=r,d.y0=n,d.y1=n+=d.value*i}var qe=(1+Math.sqrt(5))/2;function Oe(t,a,n,r,o,s){for(var d=[],p=a.children,f,i,h=0,v=0,l=p.length,S,g,x=a.value,u,m,A,k,P,W,T;h<l;){S=o-n,g=s-r;do u=p[v++].value;while(!u&&v<l);for(m=A=u,W=Math.max(g/S,S/g)/(x*t),T=u*u*W,P=Math.max(A/T,T/m);v<l;++v){if(u+=i=p[v].value,i<m&&(m=i),i>A&&(A=i),T=u*u*W,k=Math.max(A/T,T/m),k>P){u-=i;break}P=k}d.push(f={value:u,dice:S<g,children:p.slice(h,v)}),f.dice?Ge(f,n,r,o,x?r+=g*u/x:s):_e(f,n,r,x?n+=S*u/x:o,s),x-=u,h=v}return d}const Ke=(function t(a){function n(r,o,s,d,p){Oe(a,r,o,s,d,p)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(qe);function Ze(){var t=Ke,a=!1,n=1,r=1,o=[0],s=H,d=H,p=H,f=H,i=H;function h(l){return l.x0=l.y0=0,l.x1=n,l.y1=r,l.eachBefore(v),o=[0],a&&l.eachBefore(je),l}function v(l){var S=o[l.depth],g=l.x0+S,x=l.y0+S,u=l.x1-S,m=l.y1-S;u<g&&(g=u=(g+u)/2),m<x&&(x=m=(x+m)/2),l.x0=g,l.y0=x,l.x1=u,l.y1=m,l.children&&(S=o[l.depth+1]=s(l)/2,g+=i(l)-S,x+=d(l)-S,u-=p(l)-S,m-=f(l)-S,u<g&&(g=u=(g+u)/2),m<x&&(x=m=(x+m)/2),t(l,g,x,u,m))}return h.round=function(l){return arguments.length?(a=!!l,h):a},h.size=function(l){return arguments.length?(n=+l[0],r=+l[1],h):[n,r]},h.tile=function(l){return arguments.length?(t=Ve(l),h):t},h.padding=function(l){return arguments.length?h.paddingInner(l).paddingOuter(l):h.paddingInner()},h.paddingInner=function(l){return arguments.length?(s=typeof l=="function"?l:V(+l),h):s},h.paddingOuter=function(l){return arguments.length?h.paddingTop(l).paddingRight(l).paddingBottom(l).paddingLeft(l):h.paddingTop()},h.paddingTop=function(l){return arguments.length?(d=typeof l=="function"?l:V(+l),h):d},h.paddingRight=function(l){return arguments.length?(p=typeof l=="function"?l:V(+l),h):p},h.paddingBottom=function(l){return arguments.length?(f=typeof l=="function"?l:V(+l),h):f},h.paddingLeft=function(l){return arguments.length?(i=typeof l=="function"?l:V(+l),h):i},h}var te=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=ce,this.getAccTitle=de,this.setDiagramTitle=pe,this.getDiagramTitle=he,this.getAccDescription=ue,this.setAccDescription=fe}static{w(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const t=me,a=ee();return Y({...t.treemap,...a.treemap??{}})}addNode(t,a){this.nodes.push(t),this.levels.set(t,a),a===0&&(this.outerNodes.push(t),this.root??=t)}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,a){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},r=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(o=>{ye(o)&&(n?.textStyles?n.textStyles.push(o):n.textStyles=[o]),n?.styles?n.styles.push(o):n.styles=[o]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){ge(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function ae(t){if(!t.length)return[];const a=[],n=[];return t.forEach(r=>{const o={name:r.name,children:r.type==="Leaf"?void 0:[]};for(o.classSelector=r?.classSelector,r?.cssCompiledStyles&&(o.cssCompiledStyles=[r.cssCompiledStyles]),r.type==="Leaf"&&r.value!==void 0&&(o.value=r.value);n.length>0&&n[n.length-1].level>=r.level;)n.pop();if(n.length===0)a.push(o);else{const s=n[n.length-1].node;s.children?s.children.push(o):s.children=[o]}r.type!=="Leaf"&&n.push({node:o,level:r.level})}),a}w(ae,"buildHierarchy");var Je=w((t,a)=>{Se(t,a);const n=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const p=s.indent?parseInt(s.indent):0,f=Qe(d),i=d.classSelector?a.getStylesForClass(d.classSelector):[],h=i.length>0?i.join(";"):void 0,v={level:p,name:f,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:h};n.push(v)}const r=ae(n),o=w((s,d)=>{for(const p of s)a.addNode(p,d),p.children&&p.children.length>0&&o(p.children,d+1)},"addNodesRecursively");o(r,0)},"populate"),Qe=w(t=>t.name?String(t.name):"","getItemName"),ne={parser:{yy:void 0},parse:w(async t=>{try{const a=await ve("treemap",t);Q.debug("Treemap AST:",a);const n=ne.parser?.yy;if(!(n instanceof te))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Je(a,n)}catch(a){throw Q.error("Error parsing treemap:",a),a}},"parse")},Ue=10,N=10,j=25,Xe=w((t,a,n,r)=>{const o=r.db,s=o.getConfig(),d=s.padding??Ue,p=o.getDiagramTitle(),f=o.getRoot(),{themeVariables:i}=ee();if(!f)return;const h=p?30:0,v=oe(a),l=s.nodeWidth?s.nodeWidth*N:960,S=s.nodeHeight?s.nodeHeight*N:500,g=l,x=S+h;v.attr("viewBox",`0 0 ${g} ${x}`),ie(v,x,g,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=w(c=>"$"+R(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),y=c?c[0]:"";u=w($=>"$"+R(","+y)($),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);u=w(y=>"$"+R(c||"")(y),"valueFormat")}else u=R(e)}catch(e){Q.error("Error creating format function:",e),u=R(",")}const m=J().range(["transparent",i.cScale0,i.cScale1,i.cScale2,i.cScale3,i.cScale4,i.cScale5,i.cScale6,i.cScale7,i.cScale8,i.cScale9,i.cScale10,i.cScale11]),A=J().range(["transparent",i.cScalePeer0,i.cScalePeer1,i.cScalePeer2,i.cScalePeer3,i.cScalePeer4,i.cScalePeer5,i.cScalePeer6,i.cScalePeer7,i.cScalePeer8,i.cScalePeer9,i.cScalePeer10,i.cScalePeer11]),k=J().range([i.cScaleLabel0,i.cScaleLabel1,i.cScaleLabel2,i.cScaleLabel3,i.cScaleLabel4,i.cScaleLabel5,i.cScaleLabel6,i.cScaleLabel7,i.cScaleLabel8,i.cScaleLabel9,i.cScaleLabel10,i.cScaleLabel11]);p&&v.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(p);const P=v.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),W=U(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),T=Ze().size([l,S]).paddingTop(e=>e.children&&e.children.length>0?j+N:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?N:0).paddingRight(e=>e.children&&e.children.length>0?N:0).paddingBottom(e=>e.children&&e.children.length>0?N:0).round(!0)(W),re=T.descendants().filter(e=>e.children&&e.children.length>0),D=P.selectAll(".treemapSection").data(re).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",j).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),D.append("clipPath").attr("id",(e,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",j),D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>m(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>A(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=B({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",j/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=K(this),y=e.data.name;c.text(y);const $=e.x1-e.x0,z=6;let F;s.showValues!==!1&&e.value?F=$-10-30-10-z:F=$-z-6;const M=Math.max(15,F),L=c.node();if(L.getComputedTextLength()>M){let b=y;for(;b.length>0;){if(b=y.substring(0,b.length-1),b.length===0){c.text("..."),L.getComputedTextLength()>M&&c.text("");break}if(c.text(b+"..."),L.getComputedTextLength()<=M)break}}}),s.showValues!==!1&&D.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",j/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")});const le=T.leaves(),G=P.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);G.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("stroke-width",3),G.append("clipPath").attr("id",(e,c)=>`clip-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),G.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",y=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.data.name).each(function(e){const c=K(this),y=e.x1-e.x0,$=e.y1-e.y0,z=c.node(),F=4,M=y-2*F,L=$-2*F;if(M<10||L<10){c.style("display","none");return}let C=parseInt(c.style("font-size"),10);const b=8,I=28,_=.6,E=6,q=2;for(;z.getComputedTextLength()>M&&C>b;)C--,c.style("font-size",`${C}px`);let O=Math.max(E,Math.min(I,Math.round(C*_))),X=C+q+O;for(;X>L&&C>b&&(C--,O=Math.max(E,Math.min(I,Math.round(C*_))),!(O<E&&C===b));)c.style("font-size",`${C}px`),X=C+q+O;c.style("font-size",`${C}px`),(z.getComputedTextLength()>M||C<b||L<C)&&c.style("display","none")}),s.showValues!==!1&&G.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(e.data.name)+";",y=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.value?u(e.value):"").each(function(e){const c=K(this),y=this.parentNode;if(!y){c.style("display","none");return}const $=K(y).select(".treemapLabel");if($.empty()||$.style("display")==="none"){c.style("display","none");return}const z=parseFloat($.style("font-size")),F=28,M=.6,L=6,C=2,b=Math.max(L,Math.min(F,Math.round(z*M)));c.style("font-size",`${b}px`);const I=(e.y1-e.y0)/2+z/2+C;c.attr("y",I);const _=e.x1-e.x0,E=e.y1-e.y0-4,q=_-8;c.node().getComputedTextLength()>q||I+b>E||b<L?c.style("display","none"):c.style("display",null)});const se=s.diagramPadding??8;xe(v,se,"flowchart",s?.useMaxWidth||!1)},"draw"),Ye=w(function(t,a){return a.db.getClasses()},"getClasses"),et={draw:Xe,getClasses:Ye},tt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},at=w(({treemap:t}={})=>{const a=Y(tt,t);return`
.treemapNode.section {
stroke: ${a.sectionStrokeColor};
stroke-width: ${a.sectionStrokeWidth};
fill: ${a.sectionFillColor};
}
.treemapNode.leaf {
stroke: ${a.leafStrokeColor};
stroke-width: ${a.leafStrokeWidth};
fill: ${a.leafFillColor};
}
.treemapLabel {
fill: ${a.labelColor};
font-size: ${a.labelFontSize};
}
.treemapValue {
fill: ${a.valueColor};
font-size: ${a.valueFontSize};
}
.treemapTitle {
fill: ${a.titleColor};
font-size: ${a.titleFontSize};
}
`},"getStyles"),nt=at,St={parser:ne,get db(){return new te},renderer:et,styles:nt};export{St as diagram};
//# sourceMappingURL=diagram-PSM6KHXK-Dz6SO3L1.chunk.mjs.map