You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
39 KiB
JavaScript

9 months ago
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5860],{21390:function(t,i,e){e.d(i,{a:function(){return l},c:function(){return o}});var s=e(51893),n=e(56858),a=e(54525);function h(t,i,e){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",i*e-.1+"em").attr("dy",e+"em")}function o(t,i,e){var s;let n=t.append("text"),a=h(n,1,i);r(a,[{content:e,type:"normal"}]);let o=null==(s=a.node())?void 0:s.getBoundingClientRect();return o&&n.remove(),o}function r(t,i){t.text(""),i.forEach((i,e)=>{let s=t.append("tspan").attr("font-style","emphasis"===i.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===i.type?"bold":"normal");0===e?s.text(i.content):s.text(" "+i.content)})}let l=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",{style:e="",isTitle:o=!1,classes:l="",useHtmlLabels:c=!0,isNode:g=!0,width:u=200,addSvgBackground:x=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(s.l.info("createText",i,e,o,l,c,g,x),!c)return function(t,i,e){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=i.append("g"),a=n.insert("rect").attr("class","background"),o=n.append("text").attr("y","-10.1"),l=0;for(let i of e){let e=i=>(function(t,i,e){let s=t.append("text"),n=h(s,1,1.1);r(n,e);let a=n.node().getComputedTextLength();return s.remove(),a})(n,0,i)<=t;for(let t of e(i)?[i]:function(t,i){if(t.some(t=>{let{content:i}=t;return i.includes("\n")}))throw Error("splitLineToFitWidth does not support newlines in the line");return function t(i,e){var s,n;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(0===i.length)return h.length>0&&a.push(h),a.length>0?a:[];let o="";" "===i[0].content&&(o=" ",i.shift());let r=null!==(s=i.shift())&&void 0!==s?s:{content:" ",type:"normal"},l=[...h];if(""!==o&&l.push({content:o,type:"normal"}),l.push(r),e(l))return t(i,e,a,l);if(h.length>0)a.push(h),i.unshift(r);else if(r.content){let[t,s]=function t(i,e,s,n){if(0===s.length)return[{content:e.join(""),type:n},{content:"",type:n}];let[a,...h]=s,o=[...e,a];return i([{content:o.join(""),type:n}])?t(i,o,h,n):(0===e.length&&a&&(e.push(a),s.shift()),[{content:e.join(""),type:n},{content:s.join(""),type:n}])}(e,[],(n=r.content,Intl.Segmenter?[...new Intl.Segmenter().segment(n)].map(t=>t.segment):[...n]),r.type);a.push([t]),s.content&&i.unshift(s)}return t(i,e,a)}(t,i)}(i,e))r(h(o,l,1.1),t),l++}if(!s)return o.node();{let t=o.node().getBBox();return a.attr("x",-2).attr("y",-2).attr("width",t.width+4).attr("height",t.height+4),n.node()}}(u,t,function(t){let i=function(t){let i=t.replace(/\n{2,}/g,"\n");return(0,a.Z)(i)}(t),{children:e}=(0,n.V)(i),s=[[]],h=0;return e.forEach(t=>{"paragraph"===t.type&&t.children.forEach(t=>{!function t(i){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";"text"===i.type?i.value.split("\n").forEach((t,i)=>{0!==i&&(h++,s.push([])),t.split(" ").forEach(t=>{t&&s[h].push({content:t,type:e})})}):("strong"===i.type||"emphasis"===i.type)&&i.children.forEach(e=>{t(e,i.type)})}(t)})}),s}(i),x);{let a=function(t){let{children:i}=(0,n.V)(t);return i.map(function t(i){return"text"===i.type?i.value.replace(/\n/g,"<br/>"):"strong"===i.type?"<strong>".concat(i.children.map(t).join(""),"</strong>"):"emphasis"===i.type?"<em>".concat(i.children.map(t).join(""),"</em>"):"paragraph"===i.type?"<p>".concat(i.children.map(t).join(""),"</p>"):"Unsupported markdown: ".concat(i.type)}).join("")}(i);return function(t,i,e,s){var n;let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],h=t.append("foreignObject"),o=h.append("xhtml:div"),r=i.label,l=i.isNode?"nodeLabel":"edgeLabel";o.html('\n <span class="'.concat(l," ").concat(s,'" ')+(i.labelStyle?'style="'+i.labelStyle+'"':"")+">"+r+"</span>"),(n=i.labelStyle)&&o.attr("style",n),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("max-width",e+"px"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),a&&o.attr("class","labelBkg");let c=o.node().getBoundingClientRect();retur