1
0
ultimatedocs/docs/.vitepress/dist/assets/chunks/createText-ca0c5216.CfRbav5E.js

8 lines
59 KiB
JavaScript
Raw Permalink Normal View History

2024-07-27 13:25:59 +02:00
import{l as At,an as zt,ap as It}from"../app.CV7ObeM5.js";const Tt={};function Bt(n,r){const t=Tt,e=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,u=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return et(n,e,u)}function et(n,r,t){if(Lt(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return Vn(n.children,r,t)}return Array.isArray(n)?Vn(n,r,t):""}function Vn(n,r,t){const e=[];let u=-1;for(;++u<n.length;)e[u]=et(n[u],r,t);return e.join("")}function Lt(n){return!!(n&&typeof n=="object")}function tn(n,r,t,e){const u=n.length;let i=0,l;if(r<0?r=-r>u?0:u+r:r=r>u?u:r,t=t>0?t:0,e.length<1e4)l=Array.from(e),l.unshift(r,t),n.splice(...l);else for(t&&n.splice(r,t);i<e.length;)l=e.slice(i,i+1e4),l.unshift(r,0),n.splice(...l),i+=1e4,r+=1e4}function Y(n,r){return n.length>0?(tn(n,n.length,0,r),n):r}const Wn={}.hasOwnProperty;function Ot(n){const r={};let t=-1;for(;++t<n.length;)Dt(r,n[t]);return r}function Dt(n,r){let t;for(t in r){const u=(Wn.call(n,t)?n[t]:void 0)||(n[t]={}),i=r[t];let l;if(i)for(l in i){Wn.call(u,l)||(u[l]=[]);const a=i[l];Pt(u[l],Array.isArray(a)?a:a?[a]:[])}}}function Pt(n,r){let t=-1;const e=[];for(;++t<r.length;)(r[t].add==="after"?n:e).push(r[t]);tn(n,0,0,e)}const _t=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,nn=cn(/[A-Za-z]/),v=cn(/[\dA-Za-z]/),Mt=cn(/[#-'*+\--9=?A-Z^-~]/);function An(n){return n!==null&&(n<32||n===127)}const zn=cn(/\d/),jt=cn(/[\dA-Fa-f]/),Rt=cn(/[!-/:-@[-`{-~]/);function C(n){return n!==null&&n<-2}function Z(n){return n!==null&&(n<0||n===32)}function z(n){return n===-2||n===-1||n===32}const qt=cn(_t),Ht=cn(/\s/);function cn(n){return r;function r(t){return t!==null&&n.test(String.fromCharCode(t))}}function O(n,r,t,e){const u=e?e-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(m){return z(m)?(n.enter(t),a(m)):r(m)}function a(m){return z(m)&&i++<u?(n.consume(m),a):(n.exit(t),r(m))}}const Nt={tokenize:Vt};function Vt(n){const r=n.attempt(this.parser.constructs.contentInitial,e,u);let t;return r;function e(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),O(n,r,"linePrefix")}function u(a){return n.enter("paragraph"),i(a)}function i(a){const m=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=m),t=m,l(a)}function l(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return C(a)?(n.consume(a),n.exit("chunkText"),i):(n.consume(a),l)}}const Wt={tokenize:Qt},Qn={tokenize:Ut};function Qt(n){const r=this,t=[];let e=0,u,i,l;return a;function a(F){if(e<t.length){const D=t[e];return r.containerState=D[1],n.attempt(D[0].continuation,m,c)(F)}return c(F)}function m(F){if(e++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,u&&j();const D=r.events.length;let _=D,k;for(;_--;)if(r.events[_][0]==="exit
`;break}case-3:{l=`\r
`;break}case-2:{l=r?" ":" ";break}case-1:{if(!r&&u)continue;l=" ";break}default:l=String.fromCharCode(i)}u=i===-2,e.push(l)}return e.join("")}const xr={42:$,43:$,45:$,48:$,49:$,50:$,51:$,52:$,53:$,54:$,55:$,56:$,57:$,62:rt},gr={91:ke},kr={[-2]:Cn,[-1]:Cn,32:Cn},dr={35:Ee,42:bn,45:[Kn,bn],60:ze,61:Kn,95:bn,96:Gn,126:Gn},br={38:ut,92:it},yr={[-5]:wn,[-4]:wn,[-3]:wn,33:Ue,38:ut,42:In,60:[Yt,Pe],91:Ze,92:[Se,it],93:Dn,95:In,96:ae},Sr={null:[In,or]},Fr={null:[42,95]},Er={null:[]},Cr=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Fr,contentInitial:gr,disable:Er,document:xr,flow:dr,flowInitial:kr,insideSpan:Sr,string:br,text:yr},Symbol.toStringTag,{value:"Module"}));function wr(n){const t=Ot([Cr,...(n||{}).extensions||[]]),e={defined:[],lazy:{},constructs:t,content:u(Nt),document:u(Wt),flow:u(lr),string:u(sr),text:u(cr)};return e;function u(i){return l;function l(a){return pr(e,i,a)}}}const Xn=/[\0\t\n\r]/g;function Ar(){let n=1,r="",t=!0,e;return u;function u(i,l,a){const m=[];let c,p,f,x,h;for(i=r+i.toString(l),f=0,r="",t&&(i.charCodeAt(0)===65279&&f++,t=void 0);f<i.length;){if(Xn.lastIndex=f,c=Xn.exec(i),x=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(x),!c){r=i.slice(f);break}if(h===10&&f===x&&e)m.push(-3),e=void 0;else switch(e&&(m.push(-5),e=void 0),f<x&&(m.push(i.slice(f,x)),n+=x-f),h){case 0:{m.push(65533),n++;break}case 9:{for(p=Math.ceil(n/4)*4,m.push(-2);n++<p;)m.push(-1);break}case 10:{m.push(-4),n=1;break}default:e=!0,n=1}f=x+1}return a&&(e&&m.push(-5),r&&m.push(r),m.push(null)),m}}function zr(n){for(;!lt(n););return n}function pt(n,r){const t=Number.parseInt(n,r);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"<22>":String.fromCharCode(t)}const Ir=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Tr(n){return n.replace(Ir,Br)}function Br(n,r,t){if(r)return r;if(t.charCodeAt(0)===35){const u=t.charCodeAt(1),i=u===120||u===88;return pt(t.slice(i?2:1),i?16:10)}return On(t)||n}function yn(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?vn(n.position):"start"in n||"end"in n?vn(n):"line"in n||"column"in n?Tn(n):""}function Tn(n){return nt(n&&n.line)+":"+nt(n&&n.column)}function vn(n){return Tn(n&&n.start)+"-"+Tn(n&&n.end)}function nt(n){return n&&typeof n=="number"?n:1}const ft={}.hasOwnProperty,mt=function(n,r,t){return typeof r!="string"&&(t=r,r=void 0),Lr(t)(zr(wr(t).document().write(Ar()(n,r,!0))))};function Lr(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Hn),autolinkProtocol:y,autolinkEmail:y,atxHeading:a(jn),blockQuote:a(Fn),characterEscape:y,characterReference:y,codeFenced:a(Mn),codeFencedFenceInfo:m,codeFencedFenceMeta:m,codeIndented:a(Mn,m),codeText:a(kt,m),codeTextData:y,data:y,codeFlowValue:y,definition:a(dt),definitionDestinationString:m,definitionLabelString:m,definitionTitleString:m,emphasis:a(bt),hardBreakEscape:a(Rn),hardBreakTrailing:a(Rn),htmlFlow:a(qn,m),htmlFlowData:y,htmlText:a(qn,m),htmlTextData:y,image:a(yt),label:m,link:a(Hn),listItem:a(St),listItemValue:A,listOrdered:a(Nn,h),listUnordered:a(Nn),paragraph:a(Ft),reference:hn,referenceString:m,resourceDestinationString:m,resourceTitleString:m,setextHeading:a(jn),strong:a(Et),thematicBreak:a(wt)},exit:{atxHeading:p(),atxHeadingSequence:T,autolink:p(),autolinkEmail:mn,autolinkProtocol:fn,blockQuote:p(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:pn,characterReferenceMarkerNumeric:pn,characterReferenceValue:an,codeFenced:p(j),codeFencedFence:b,codeFencedFenceInfo:I,codeFencedFenceMeta:M,codeFlowValue:S,codeIndented:p(F),codeText:p(W),codeTextData:S,data:S,definition:p(),definitionDestinationString:k,definitionLabelString:D,definitionTitleString:_,emphasis:p(),hardBreakEscape:p(R),hardBreakTrailing:p(R),htmlFlow:p(w),htmlFlowData:S,htmlText:p(U),htmlTextData:S,image:p(en),label:J,labelText:o,lineEnding:P,link:p(G),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:Q,resourceDestinationString:rn,
`);return It(r)}function Pr(n){const r=Dr(n),{children:t}=mt(r),e=[[]];let u=0;function i(l,a="normal"){l.type==="text"?l.value.split(`
`).forEach((c,p)=>{p!==0&&(u++,e.push([])),c.split(" ").forEach(f=>{f&&e[u].push({content:f,type:a})})}):(l.type==="strong"||l.type==="emphasis")&&l.children.forEach(m=>{i(m,l.type)})}return t.forEach(l=>{l.type==="paragraph"&&l.children.forEach(a=>{i(a)})}),e}function _r(n){const{children:r}=mt(n);function t(e){return e.type==="text"?e.value.replace(/\n/g,"<br/>"):e.type==="strong"?`<strong>${e.children.map(t).join("")}</strong>`:e.type==="emphasis"?`<em>${e.children.map(t).join("")}</em>`:e.type==="paragraph"?`<p>${e.children.map(t).join("")}</p>`:`Unsupported markdown: ${e.type}`}return r.map(t).join("")}function Mr(n){return Intl.Segmenter?[...new Intl.Segmenter().segment(n)].map(r=>r.segment):[...n]}function jr(n,r){const t=Mr(r.content);return gt(n,[],t,r.type)}function gt(n,r,t,e){if(t.length===0)return[{content:r.join(""),type:e},{content:"",type:e}];const[u,...i]=t,l=[...r,u];return n([{content:l.join(""),type:e}])?gt(n,l,i,e):(r.length===0&&u&&(r.push(u),t.shift()),[{content:r.join(""),type:e},{content:t.join(""),type:e}])}function Rr(n,r){if(n.some(({content:t})=>t.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Bn(n,r)}function Bn(n,r,t=[],e=[]){if(n.length===0)return e.length>0&&t.push(e),t.length>0?t:[];let u="";n[0].content===" "&&(u=" ",n.shift());const i=n.shift()??{content:" ",type:"normal"},l=[...e];if(u!==""&&l.push({content:u,type:"normal"}),l.push(i),r(l))return Bn(n,r,t,l);if(e.length>0)t.push(e),n.unshift(i);else if(i.content){const[a,m]=jr(r,i);t.push([a]),m.content&&n.unshift(m)}return Bn(n,r,t)}function qr(n,r){r&&n.attr("style",r)}function Hr(n,r,t,e,u=!1){const i=n.append("foreignObject"),l=i.append("xhtml:div"),a=r.label,m=r.isNode?"nodeLabel":"edgeLabel";l.html(`
<span class="${m} ${e}" `+(r.labelStyle?'style="'+r.labelStyle+'"':"")+">"+a+"</span>"),qr(l,r.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("max-width",t+"px"),l.attr("xmlns","http://www.w3.org/1999/xhtml"),u&&l.attr("class","labelBkg");let c=l.node().getBoundingClientRect();return c.width===t&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",t+"px"),c=l.node().getBoundingClientRect()),i.style("width",c.width),i.style("height",c.height),i.node()}function Pn(n,r,t){return n.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",r*t-.1+"em").attr("dy",t+"em")}function Nr(n,r,t){const e=n.append("text"),u=Pn(e,1,r);_n(u,t);const i=u.node().getComputedTextLength();return e.remove(),i}function Qr(n,r,t){var e;const u=n.append("text"),i=Pn(u,1,r);_n(i,[{content:t,type:"normal"}]);const l=(e=i.node())==null?void 0:e.getBoundingClientRect();return l&&u.remove(),l}function Vr(n,r,t,e=!1){const i=r.append("g"),l=i.insert("rect").attr("class","background"),a=i.append("text").attr("y","-10.1");let m=0;for(const c of t){const p=x=>Nr(i,1.1,x)<=n,f=p(c)?[c]:Rr(c,p);for(const x of f){const h=Pn(a,m,1.1);_n(h,x),m++}}if(e){const c=a.node().getBBox(),p=2;return l.attr("x",-p).attr("y",-p).attr("width",c.width+2*p).attr("height",c.height+2*p),i.node()}else return a.node()}function _n(n,r){n.text(""),r.forEach((t,e)=>{const u=n.append("tspan").attr("font-style",t.type==="emphasis"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",t.type==="strong"?"bold":"normal");e===0?u.text(t.content):u.text(" "+t.content)})}const Ur=(n,r="",{style:t="",isTitle:e=!1,classes:u="",useHtmlLabels:i=!0,isNode:l=!0,width:a=200,addSvgBackground:m=!1}={})=>{if(At.info("createText",r,t,e,u,i,l,m),i){const c=_r(r),p={isNode:l,label:zt(c).replace(/fa[blrs]?:fa-[\w-]+/g,x=>`<i class='${x.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return Hr(n,p,a,u,m)}else{const c=Pr(r);return Vr(a,n,c,m)}};export{Qr as a,Ur as c};