PageSourceSearch

https://gamma.com.ai/_nuxt/B4so6mzm.js

js gamma.com.ai collected 2026-10-03 23:41:20 UTC 7,918 bytes, 1 lines download raw bytes

1import{w as t,n as a,d as e,i,E as n,S as r,a as o,r as s,b as d,c as g,h}from"./CybhNaRy.js";const c=t=>String(t).split(/\s+/).map((t=>{if(/^[\d.]+/.test(t)){let a=/^([\d.]+)(.*)$/.exec(t);return[Number(a[1]),a[2]]}return t})),l=(t,a)=>t*a,m=(t,a)=>a/t,p={left:0,top:0,center:50,bottom:100,right:100},u=(t,a,e)=>{t.drawImage(a,e.sx,e.sy,e.swidth,e.sheight,e.x,e.y,e.width,e.height)},w=(t,a,e,i,{backgroundSize:n,backgroundPosition:r,backgroundRepeat:o},s=(()=>{}))=>{let d=a/e,g=new Image;g.src=i,g.onload=()=>{let i=g.width,h=g.height,w=i/h,f={sx:0,sy:0,swidth:i,sheight:h,x:0,y:0,width:i,height:h};(({backgroundSize:t,drawOpt:a,imageRatio:e,canvasWidth:i,canvasHeight:n,canvasRatio:r})=>{if(t){let o=c(t);if("auto"===o[0]&&"auto"===o[1])return;if("cover"===o[0])return void(e>r?(a.height=n,a.width=l(e,n)):(a.width=i,a.height=m(e,i)));if("contain"===o[0])return void(e>r?(a.width=i,a.height=m(e,i)):(a.height=n,a.width=l(e,n)));let s=-1;o[0]&&(Array.isArray(o[0])?"%"===o[0][1]?(a.width=o[0][0]/100*i,s=a.width):(a.width=o[0][0],s=o[0][0]):"auto"===o[0]&&o[1]&&("%"===o[1][1]?a.width=l(e,o[1][0]/100*n):a.width=l(e,o[1][0]))),o[1]&&Array.isArray(o[1])?"%"===o[1][1]?a.height=o[1][0]/100*n:a.height=o[1][0]:-1!==s&&(a.height=m(e,s))}})({backgroundSize:n,drawOpt:f,imageRatio:w,canvasWidth:a,canvasHeight:e,canvasRatio:d}),(({backgroundPosition:t,drawOpt:a,imgWidth:e,imgHeight:i,canvasWidth:n,canvasHeight:r})=>{if(t){let o=c(t);if(o=o.map((t=>"string"==typeof t&&void 0!==p[t]?[p[t],"%"]:t)),Array.isArray(o[0])){if(1===o.length&&o.push([50,"%"]),"%"===o[0][1]){let t=
1o[0][0]/100*n,i=o[0][0]/100*e;a.x=t-i}else a.x=o[0][0];if("%"===o[1][1]){let t=o[1][0]/100*r,e=o[1][0]/100*i;a.y=t-e}else a.y=o[1][0]}}})({backgroundPosition:r,drawOpt:f,imgWidth:f.width,imgHeight:f.height,imageRatio:w,canvasWidth:a,canvasHeight:e,canvasRatio:d});let x=(({ctx:t,image:a,backgroundRepeat:e,drawOpt:i,imgWidth:n,imgHeight:r,canvasWidth:o,canvasHeight:s})=>{if(e){let d=i.x,g=i.y,h=d-Math.ceil(d/n)*n,l=g-Math.ceil(g/r)*r,m=c(e);if("no-repeat"===m[0]||n>=o&&r>=s)return;if("repeat-x"===m[0]&&o>n){let e=h;for(;e<o;)u(t,a,{...i,x:e}),e+=n;return!0}if("repeat-y"===m[0]&&s>r){let e=l;for(;e<s;)u(t,a,{...i,y:e}),e+=r;return!0}if("repeat"===m[0]){let e=h;for(;e<o;){if(s>r){let n=l;for(;n<s;)u(t,a,{...i,x:e,y:n}),n+=r}e+=n}return!0}}})({ctx:t,image:g,backgroundRepeat:o,drawOpt:f,imgWidth:f.width,imgHeight:f.height,imageRatio:w,canvasWidth:a,canvasHeight:e,canvasRatio:d});x||u(t,g,f),s()},g.onerror=t=>{s(t)}},f=t=>t.richText?a(t.text):t.text,x=a=>{let e="";return t(a,null,((t,a,i,n)=>{const r=n+1;e+=r<=6?(t=>new Array(t).fill("#").join(""))(r):(t=>new Array(t-6).fill("   ").join("")+"*")(r),e+=" "+f(t.data);const o=t.data.generalization;if(Array.isArray(o))e+=o.map((t=>` [${f(t)}]`));else if(o&&o.text){const t=f(o);e+=` [${t}]`}e+="\n\n",t.data.note&&(e+=t.data.note+"\n\n")}),(()=>{}),!0),e},y=t=>t.richText?a(t.text):t.text,v=a=>{let e="";return t(a,null,((t,a,i,n)=>{e+=new Array(n).fill("   ").join(""),e+=" "+y(t.data);const r=t.data.generalization;Array.isArray(r)?e+=r.map((t=>` [${y(t)}]`)):r&&r.text&&(e+=` [${y(r)}]`),e+="\n\n"}),(()=>{}),!0),e};class b{constructor(t){this.mindMap=t.mindMap}async export(t,a=!0,i="思维导图",...n){if(this[t]){const r=await this[t](i,...n);return a&&e(r,i+"."+t),r}return null}createTransformImgTaskList(t,a,e,n){return t.find(a).map((async t=>{const a=n(t);if(/^data:/.test(a)||"none"===a)return;const r=await i(a);t.attr(e,r)}))}async getSvgData(t){let{exportPaddingX:a,exportPaddingY:e,errorHandler:i,resetCss:s,addContentToHeader:d,addContentToFooter:g,handleBeingExportSvg:h}=this.mindMap.opt,{svg:c,svgHTML:l,clipData:m}=this.mindMap.getSvgData({paddingX:a,paddingY:e,addContentToHeader:d,addContentToFooter:g,node:t});m&&(m.paddingX=a,m.paddingY=e);let p=!1;const u=[...this.createTransformImgTaskList(c,"image","href",(t=>t.attr("href")||t.attr("xlink:href"))),...this.createTransformImgTaskList(c,"img","src",(t=>t.attr("src")))];try{await Promise.all(u)}catch(w){i(n.EXPORT_LOAD_IMAGE_ERROR,w)}if(this.mindMap.richText){const t=c.find("foreignObject");if(t.length>0&&(t[0].add(r(`<style>${s}</style>`)),p=!0),this.mindMap.formula){if(c.find(".ql-formula").length>0){const a=this.mindMap.formula.getStyleText();if(a){const e=document.createElement("style");e.innerHTML=a,o(e),t[0].add(e),p=!0}}}}return"function"==typeof h&&(p=!0,c=h(c)),(u.length>0||p)&&(l=c.svg()),{node:c,str:l,clipData:m}}svgToPng(t,a,e=null,i=!1,n="image/png"){const{maxCanvasSize:r,minExportImgCanvasScale:o}=this.mindMap.opt;return new Promise(((d,g)=>{const h=new Image;h.setAttribute("crossOrigin","anonymous"),h.onload=async()=>{try{const t=document.createElement("canvas"),g=Math.max(window.devicePixelRatio,o);let c=h.width,l=h.height,m=0,p=0;e&&(m=e.paddingX,p=e.paddingY,c=e.width+2*m,l=e.height+2*p);let u=0,w=0;const{backgroundImage:f}=this.mindMap.themeConfig;if(i&&f&&!a){const t=await new Promise((t=>{const a=new Image;a.onload=()=>{t([a.width,a.height])},a.onerror=()=>{t(null)},a.src=f}));if(t){const a=c/l,e=t[0]/t[1];a>e?(u=c,w=c/e):(w=l,u=l*e)}}let x=1,y=1,v=(u||c)*g,b=(w||l)*g;if(v>r||b>r){let t=null,a=null;v>r?t=r:b>r&&(a=r);const e=s(v,b,t,a);x=e[0]/v,y=e[1]/b,v=e[0],b=e[1]}t.width=v,t.height=b;
1const k=v/g,M=b/g;t.style.width=k+"px",t.style.height=M+"px";const T=t.getContext("2d");T.scale(g,g),a||await this.drawBackgroundToCanvas(T,k,M);const S=(u>0?(u-c)/2:0)*x,E=(w>0?(w-l)/2:0)*y;e?T.drawImage(h,e.left,e.top,e.width,e.height,m*x+S,p*y+E,e.width*x,e.height*y):T.drawImage(h,S,E,c*x,l*y),d(t.toDataURL(n))}catch(t){g(t)}},h.onerror=t=>{g(t)},h.src=t}))}drawBackgroundToCanvas(t,a,e){return new Promise(((i,n)=>{const{backgroundColor:r="#fff",backgroundImage:o,backgroundRepeat:s="no-repeat",backgroundPosition:d="center center",backgroundSize:g="cover"}=this.mindMap.themeConfig;t.save(),t.rect(0,0,a,e),t.fillStyle=r,t.fill(),t.restore(),o&&"none"!==o?(t.save(),w(t,a,e,o,{backgroundRepeat:s,backgroundPosition:d,backgroundSize:g},(a=>{a?n(a):i(),t.restore()}))):i()}))}drawBackgroundToSvg(t){return new Promise((async a=>{const{backgroundColor:e="#fff",backgroundImage:n,backgroundRepeat:r="repeat"}=this.mindMap.themeConfig;if(t.css("background-color",e),n&&"none"!==n){const e=await i(n);t.css("background-image",`url(${e})`),t.css("background-repeat",r),a()}else a()}))}async _image(t,a,e=!1,i=null,n=!1){this.mindMap.renderer.textEdit.hideEditTextBox(),this.handleNodeExport(i);const{str:r,clipData:o}
1=await this.getSvgData(i),s=await this.fixSvgStrAndToBlob(r);return await this.svgToPng(s,e,o,n,t)}async png(...t){return await this._image("image/png",...t)}async jpg(...t){return await this._image("image/jpg",...t)}handleNodeExport(t){if(t&&t.getData("isActive")){t.deactivate();const{alwaysShowExpandBtn:a,notShowExpandBtn:e}=this.mindMap.opt;a||e||!t.getData("expand")||t.removeExpandBtn()}}async pdf(t,a=!1,e=!1){if(!this.mindMap.doExportPDF)throw new Error("请注册ExportPDF插件");const i=await this.png(t,a,null,e);return await this.mindMap.doExportPDF.pdf(i)}async xmind(t){if(!this.mindMap.doExportXMind)throw new Error("请注册ExportXMind插件");const a=this.mindMap.getData(),e=await this.mindMap.doExportXMind.xmind(a,t);return await d(e)}async svg(t){this.mindMap.renderer.textEdit.hideEditTextBox();const{node:a}=await this.getSvgData();a.first().before(r(`<title>${t}</title>`)),await this.drawBackgroundToSvg(a);const e=a.svg();return await this.fixSvgStrAndToBlob(e)}async fixSvgStrAndToBlob(t){t=g(t),t=h(t);const a=new Blob([t],{type:"image/svg+xml"});return await d(a)}async json(t,a=!0){const e=this.mindMap.getData(a),i=JSON.stringify(e),n=new Blob([i]);return await d(n)}async smm(t,a){return await this.json(t,a)}async md(){const t=this.mindMap.getData(),a=x(t),e=new Blob([a]);return await d(e)}async txt(){const t=this.mindMap.getData(),a=v(t),e=new Blob([a]);return await d(e)}}b.instanceName="doExport";export{b as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.