mdast2docx 0.1.1 → 0.2.0

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.
Files changed (46) hide show
  1. package/dist/{chunk-7LR5HC5O.mjs → chunk-35E6UZDH.mjs} +3 -3
  2. package/dist/{chunk-7W4N3GRD.mjs → chunk-ALSMH2CW.mjs} +1 -1
  3. package/dist/{chunk-D4MVNKG6.mjs → chunk-CRVVOUD7.mjs} +1 -1
  4. package/dist/chunk-ECHPYCZC.mjs +2 -0
  5. package/dist/chunk-I5QUWH2X.mjs +1 -0
  6. package/dist/{chunk-Z5DPYROV.mjs → chunk-JOIHCSIR.mjs} +1 -1
  7. package/dist/chunk-LXTXD4UG.mjs +1 -0
  8. package/dist/chunk-MSGIMOZN.mjs +1 -0
  9. package/dist/chunk-X6PWMGYB.mjs +5 -0
  10. package/dist/{chunk-ZKNVKZAF.mjs → chunk-Z2MODMIK.mjs} +1 -1
  11. package/dist/index.d.ts +1 -2
  12. package/dist/index.js +2 -2
  13. package/dist/index.mjs +1 -1
  14. package/dist/{multipart-parser-WKN2UV32.mjs → multipart-parser-ECCTUILZ.mjs} +1 -1
  15. package/dist/plugins/html.d.ts +9 -0
  16. package/dist/plugins/html.js +5 -1
  17. package/dist/plugins/html.mjs +1 -0
  18. package/dist/plugins/image.d.ts +8 -4
  19. package/dist/plugins/image.js +1 -1
  20. package/dist/plugins/image.mjs +1 -1
  21. package/dist/plugins/index.d.ts +1 -0
  22. package/dist/plugins/index.js +70 -66
  23. package/dist/plugins/index.mjs +1 -1
  24. package/dist/plugins/list.js +1 -1
  25. package/dist/plugins/list.mjs +1 -1
  26. package/dist/plugins/math.mjs +1 -1
  27. package/dist/plugins/{node.js → node/index.js} +1 -1
  28. package/dist/plugins/node/index.mjs +1 -0
  29. package/dist/plugins/{node-image.d.ts → node/node-image.d.ts} +9 -5
  30. package/dist/plugins/{node-image.js → node/node-image.js} +1 -1
  31. package/dist/plugins/node/node-image.mjs +1 -0
  32. package/dist/plugins/table.mjs +1 -1
  33. package/dist/section.d.ts +1 -6
  34. package/dist/section.js +2 -2
  35. package/dist/section.mjs +1 -1
  36. package/dist/utils.d.ts +10 -7
  37. package/dist/utils.js +1 -1
  38. package/dist/utils.mjs +1 -1
  39. package/package.json +3 -1
  40. package/dist/chunk-3ZZBJC3M.mjs +0 -1
  41. package/dist/chunk-AHXJDPOO.mjs +0 -2
  42. package/dist/chunk-IBVI6OKS.mjs +0 -1
  43. package/dist/chunk-XIRSNIMN.mjs +0 -1
  44. package/dist/plugins/node-image.mjs +0 -1
  45. package/dist/plugins/node.mjs +0 -1
  46. /package/dist/plugins/{node.d.ts → node/index.d.ts} +0 -0
@@ -1 +1 @@
1
- import{a as f,b as m}from"../chunk-Q6Q2NBIZ.mjs";import{a as o,b as r,c as e}from"../chunk-XIRSNIMN.mjs";import{a as p,b as t}from"../chunk-D4MVNKG6.mjs";import"../chunk-IBVI6OKS.mjs";import{a as x,b as a}from"../chunk-7W4N3GRD.mjs";import"../chunk-ZKNVKZAF.mjs";import"../chunk-3ZZBJC3M.mjs";export{o as SUPPORTED_IMAGE_TYPES,p as createLevels,f as defaultTableOptions,r as getImageMimeType,e as imagePlugin,t as listPlugin,a as mathPlugin,x as parseLatex,m as tablePlugin};
1
+ import{a as m,b as p}from"../chunk-Q6Q2NBIZ.mjs";import{a as o}from"../chunk-X6PWMGYB.mjs";import{a as r,b as e,c as f}from"../chunk-LXTXD4UG.mjs";import{a as t,b as x}from"../chunk-CRVVOUD7.mjs";import"../chunk-MSGIMOZN.mjs";import{a,b}from"../chunk-ALSMH2CW.mjs";import"../chunk-Z2MODMIK.mjs";import"../chunk-I5QUWH2X.mjs";export{r as SUPPORTED_IMAGE_TYPES,t as createLevels,m as defaultTableOptions,e as getImageMimeType,o as htmlPlugin,f as imagePlugin,x as listPlugin,b as mathPlugin,a as parseLatex,p as tablePlugin};
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var i in t)f(o,i,{get:t[i],enumerable:!0})},h=(o,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of O(t))!D.call(o,n)&&n!==i&&f(o,n,{get:()=>t[n],enumerable:!(r=m(t,n))||r.enumerable});return o};var C=o=>h(f({},"__esModule",{value:!0}),o);var k={};b(k,{createLevels:()=>I,listPlugin:()=>v});module.exports=C(k);var e=require("docx");var x=()=>Math.random().toString(16).slice(2);var R=[e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.UPPER_LETTER,e.LevelFormat.LOWER_LETTER,e.LevelFormat.LOWER_ROMAN,e.LevelFormat.UPPER_ROMAN],I=(o,t=.4,i=.25)=>o.map((r,n)=>({level:n,format:r,text:(r===e.LevelFormat.DECIMAL?Array(n+1).fill(`%${n+1}`).join("."):`%${n+1}`)+".",alignment:e.AlignmentType.START,style:{paragraph:{indent:{left:(0,e.convertInchesToTwip)(t+n*i)}}}})),M=I(R),L=["\u25CF","\u25CB","\u25A0","\u25C6","\u25B6","\u25C9","\u2B24","\u2666","\u25E6","\u25AA"],E={levels:M,bullets:L,defaultBullets:!1},v=o=>{let t=x(),i=`numbering-${t}`,r=`bullet-${t}`,{levels:n,bulletLevels:c,bullets:y,defaultBullets:T}={...E,...o};return{block:async(u,s,l,d)=>{var p,P;if(s.type!=="list")return[];let a=((P=(p=l.bullet)==null?void 0:p.level)!=null?P:-1)+1;return l.numbering=T?void 0:{level:a,reference:s.ordered?i:r},l.bullet={level:a},s.type="",await d(s,l)},root:u=>{var s,l;u.numbering={config:[...(l=(s=u.numbering)==null?void 0:s.config)!=null?l:[],{reference:i,levels:n},{reference:r,levels:c!=null?c:n.map((d,a)=>{var p;return{...d,text:(p=y[a])!=null?p:"\u2022",format:e.LevelFormat.BULLET}})}]}}}};0&&(module.exports={createLevels,listPlugin});
1
+ "use strict";var f=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var D=(o,t)=>{for(var i in t)f(o,i,{get:t[i],enumerable:!0})},T=(o,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of y(t))!O.call(o,n)&&n!==i&&f(o,n,{get:()=>t[n],enumerable:!(r=b(t,n))||r.enumerable});return o};var C=o=>T(f({},"__esModule",{value:!0}),o);var k={};D(k,{createLevels:()=>h,listPlugin:()=>v});module.exports=C(k);var e=require("docx");var P=()=>Math.random().toString(16).slice(2);var R=[e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.DECIMAL,e.LevelFormat.UPPER_LETTER,e.LevelFormat.LOWER_LETTER,e.LevelFormat.LOWER_ROMAN,e.LevelFormat.UPPER_ROMAN],h=(o,t=.4,i=.25)=>o.map((r,n)=>({level:n,format:r,text:(r===e.LevelFormat.DECIMAL?Array(n+1).fill(`%${n+1}`).join("."):`%${n+1}`)+".",alignment:e.AlignmentType.START,style:{paragraph:{indent:{left:(0,e.convertInchesToTwip)(t+n*i)}}}})),M=h(R),E=["\u25CF","\u25CB","\u25A0","\u25C6","\u25B6","\u25C9","\u2B24","\u2666","\u25E6","\u25AA"],L={levels:M,bullets:E,defaultBullets:!1},v=o=>{let t=P(),i=`numbering-${t}`,r=`bullet-${t}`,{levels:n,bulletLevels:c,bullets:m,defaultBullets:I}={...L,...o};return{block:async(u,s,l,d)=>{var a,g;if(s.type!=="list")return[];let p=((g=(a=l.bullet)==null?void 0:a.level)!=null?g:-1)+1;return l.numbering=I?void 0:{level:p,reference:s.ordered?i:r},l.bullet={level:p},s.type="",await d(s,l)},root:u=>{var s,l;u.numbering={config:[...(l=(s=u.numbering)==null?void 0:s.config)!=null?l:[],{reference:i,levels:n},{reference:r,levels:c!=null?c:n.map((d,p)=>{var a;return{...d,text:(a=m[p])!=null?a:"\u2022",format:e.LevelFormat.BULLET}})}]}}}};0&&(module.exports={createLevels,listPlugin});
@@ -1 +1 @@
1
- import{a,b}from"../chunk-D4MVNKG6.mjs";import"../chunk-IBVI6OKS.mjs";import"../chunk-3ZZBJC3M.mjs";export{a as createLevels,b as listPlugin};
1
+ import{a,b}from"../chunk-CRVVOUD7.mjs";import"../chunk-MSGIMOZN.mjs";import"../chunk-I5QUWH2X.mjs";export{a as createLevels,b as listPlugin};
@@ -1 +1 @@
1
- import{a,b}from"../chunk-7W4N3GRD.mjs";import"../chunk-ZKNVKZAF.mjs";import"../chunk-3ZZBJC3M.mjs";export{b as mathPlugin,a as parseLatex};
1
+ import{a,b}from"../chunk-ALSMH2CW.mjs";import"../chunk-Z2MODMIK.mjs";import"../chunk-I5QUWH2X.mjs";export{b as mathPlugin,a as parseLatex};
@@ -12,7 +12,7 @@ Content-Type: ${l.type||"application/octet-stream"}\r
12
12
  `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),xt=(e,t,n)=>{if(t.length<n)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${n} arguments required, but only ${t.length} present.`)},It=(pu=class{constructor(...t){Ce(this,_e,[]);if(t.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Cr](){return"FormData"}[Jb](){return this.entries()}static[Kb](t){return t&&typeof t=="object"&&t[Cr]==="FormData"&&!Zb.some(n=>typeof t[n]!="function")}append(...t){xt("append",arguments,2),J(this,_e).push(bu(...t))}delete(t){xt("delete",arguments,1),t+="",de(this,_e,J(this,_e).filter(([n])=>n!==t))}get(t){xt("get",arguments,1),t+="";for(var n=J(this,_e),a=n.length,o=0;o<a;o++)if(n[o][0]===t)return n[o][1];return null}getAll(t,n){return xt("getAll",arguments,1),n=[],t+="",J(this,_e).forEach(a=>a[0]===t&&n.push(a[1])),n}has(t){return xt("has",arguments,1),t+="",J(this,_e).some(n=>n[0]===t)}forEach(t,n){xt("forEach",arguments,1);for(var[a,o]of this)t.call(n,o,a,this)}set(...t){xt("set",arguments,2);var n=[],a=!0;t=bu(...t),J(this,_e).forEach(o=>{o[0]===t[0]?a&&(a=!n.push(t)):n.push(o)}),a&&n.push(t),de(this,_e,n)}*entries(){yield*J(this,_e)}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}},_e=new WeakMap,pu)});var _u=k((kg,Su)=>{"use strict";if(!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),t=new e().port1,n=new ArrayBuffer;t.postMessage(n,[n,n])}catch(e){e.constructor.name==="DOMException"&&(globalThis.DOMException=e.constructor)}Su.exports=globalThis.DOMException});var On,ra,tp,qg,la=pr(()=>{"use strict";On=require("fs"),tp=Ve(_u(),1);aa();Pr();({stat:qg}=On.promises)});var vu={};ko(vu,{toFormData:()=>lp});function sp(e){let t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let n=t[2]||t[3]||"",a=n.slice(n.lastIndexOf("\\")+1);return a=a.replace(/%22/g,'"'),a=a.replace(/&#(\d{4});/g,(o,l)=>String.fromCharCode(l)),a}async function lp(e,t){if(!/multipart/i.test(t))throw new TypeError("Failed to fetch");let n=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let a=new ua(n[1]||n[2]),o,l,f,m,d,b,w=[],P=new It,I=F=>{f+=O.decode(F,{stream:!0})},V=F=>{w.push(F)},S=()=>{let F=new rr(w,b,{type:d});P.append(m,F)},D=()=>{P.append(m,f)},O=new TextDecoder("utf-8");O.decode(),a.onPartBegin=function(){a.onPartData=I,a.onPartEnd=D,o="",l="",f="",m="",d="",b=null,w.length=0},a.onHeaderField=function(F){o+=O.decode(F,{stream:!0})},a.onHeaderValue=function(F){l+=O.decode(F,{stream:!0})},a.onHeaderEnd=function(){if(l+=O.decode(),o=o.toLowerCase(),o==="content-disposition"){let F=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);F&&(m=F[2]||F[3]||""),b=sp(l),b&&(a.onPartData=V,a.onPartEnd=S)}else o==="content-type"&&(d=l);l="",o=""};for await(let F of e)a.write(F);return a.end(),P}var Fe,G,Ru,pt,Fn,jn,rp,Ir,np,ip,ap,op,kt,ua,Pu=pr(()=>{"use strict";la();qn();Fe=0,G={START_BOUNDARY:Fe++,HEADER_FIELD_START:Fe++,HEADER_FIELD:Fe++,HEADER_VALUE_START:Fe++,HEADER_VALUE:Fe++,HEADER_VALUE_ALMOST_DONE:Fe++,HEADERS_ALMOST_DONE:Fe++,PART_DATA_START:Fe++,PART_DATA:Fe++,END:Fe++},Ru=1,pt={PART_BOUNDARY:Ru,LAST_BOUNDARY:Ru*=2},Fn=10,jn=13,rp=32,Ir=45,np=58,ip=97,ap=122,op=e=>e|32,kt=()=>{},ua=class{constructor(t){this.index=0,this.flags=0,this.onHeaderEnd=kt,this.onHeaderField=kt,this.onHeadersEnd=kt,this.onHeaderValue=kt,this.onPartBegin=kt,this.onPartData=kt,this.onPartEnd=kt,this.boundaryChars={},t=`\r
13
13
  --`+t;let n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a),this.boundaryChars[n[a]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=G.START_BOUNDARY}write(t){let n=0,a=t.length,o=this.index,{lookbehind:l,boundary:f,boundaryChars:m,index:d,state:b,flags:w}=this,P=this.boundary.length,I=P-1,V=t.length,S,D,O=N=>{this[N+"Mark"]=n},F=N=>{delete this[N+"Mark"]},z=(N,W,Y,et)=>{(W===void 0||W!==Y)&&this[N](et&&et.subarray(W,Y))},te=(N,W)=>{let Y=N+"Mark";Y in this&&(W?(z(N,this[Y],n,t),delete this[Y]):(z(N,this[Y],t.length,t),this[Y]=0))};for(n=0;n<a;n++)switch(S=t[n],b){case G.START_BOUNDARY:if(d===f.length-2){if(S===Ir)w|=pt.LAST_BOUNDARY;else if(S!==jn)return;d++;break}else if(d-1===f.length-2){if(w&pt.LAST_BOUNDARY&&S===Ir)b=G.END,w=0;else if(!(w&pt.LAST_BOUNDARY)&&S===Fn)d=0,z("onPartBegin"),b=G.HEADER_FIELD_START;else return;break}S!==f[d+2]&&(d=-2),S===f[d+2]&&d++;break;case G.HEADER_FIELD_START:b=G.HEADER_FIELD,O("onHeaderField"),d=0;case G.HEADER_FIELD:if(S===jn){F("onHeaderField"),b=G.HEADERS_ALMOST_DONE;break}if(d++,S===Ir)break;if(S===np){if(d===1)return;te("onHeaderField",!0),b=G.HEADER_VALUE_START;break}if(D=op(S),D<ip||D>ap)return;break;case G.HEADER_VALUE_START:if(S===rp)break;O("onHeaderValue"),b=G.HEADER_VALUE;case G.HEADER_VALUE:S===jn&&(te("onHeaderValue",!0),z("onHeaderEnd"),b=G.HEADER_VALUE_ALMOST_DONE);break;case G.HEADER_VALUE_ALMOST_DONE:if(S!==Fn)return;b=G.HEADER_FIELD_START;break;case G.HEADERS_ALMOST_DONE:if(S!==Fn)return;z("onHeadersEnd"),b=G.PART_DATA_START;break;case G.PART_DATA_START:b=G.PART_DATA,O("onPartData");case G.PART_DATA:if(o=d,d===0){for(n+=I;n<V&&!(t[n]in m);)n+=P;n-=I,S=t[n]}if(d<f.length)f[d]===S?(d===0&&te("onPartData",!0),d++):d=0;else if(d===f.length)d++,S===jn?w|=pt.PART_BOUNDARY:S===Ir?w|=pt.LAST_BOUNDARY:d=0;else if(d-1===f.length)if(w&pt.PART_BOUNDARY){if(d=0,S===Fn){w&=~pt.PART_BOUNDARY,z("onPartEnd"),z("onPartBegin"),b=G.HEADER_FIELD_START;break}}else w&pt.LAST_BOUNDARY&&S===Ir?(z("onPartEnd"),b=G.END,w=0):d=0;if(d>0)l[d-1]=S;else if(o>0){let N=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);z("onPartData",0,o,N),o=0,O("onPartData"),n--}break;case G.END:break;default:throw new Error(`Unexpected state entered: ${b}`)}te("onHeaderField"),te("onHeaderValue"),te("onPartData"),this.index=d,this.state=b,this.flags=w}end(){if(this.state===G.HEADER_FIELD_START&&this.index===0||this.state===G.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==G.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var Ep={};ko(Ep,{SUPPORTED_IMAGE_TYPES:()=>Hn,nodeImagePlugin:()=>wp});module.exports=jc(Ep);var Un=Ve(ou());var Nu=Ve(require("http"),1),Wu=Ve(require("https"),1),Bt=Ve(require("zlib"),1),ge=Ve(require("stream"),1),Br=require("buffer");function Vb(e){if(!/^data:/i.test(e))throw new TypeError('`uri` does not appear to Br a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");let t=e.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");let n=e.substring(5,t).split(";"),a="",o=!1,l=n[0]||"text/plain",f=l;for(let w=1;w<n.length;w++)n[w]==="base64"?o=!0:n[w]&&(f+=`;${n[w]}`,n[w].indexOf("charset=")===0&&(a=n[w].substring(8)));!n[0]&&!a.length&&(f+=";charset=US-ASCII",a="US-ASCII");let m=o?"base64":"ascii",d=unescape(e.substring(t+1)),b=Buffer.from(d,m);return b.type=l,b.typeFull=f,b.charset=a,b}var su=Vb;var Re=Ve(require("stream"),1);Pr();qn();var Ke=class extends Error{constructor(t,n){super(t),Error.captureStackTrace(this,this.constructor),this.type=n}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var ue=class extends Ke{constructor(t,n,a){super(t,n),a&&(this.code=this.errno=a.code,this.erroredSysCall=a.syscall)}};var $n=Symbol.toStringTag,sa=e=>typeof e=="object"&&typeof e.append=="function"&&typeof e.delete=="function"&&typeof e.get=="function"&&typeof e.getAll=="function"&&typeof e.has=="function"&&typeof e.set=="function"&&typeof e.sort=="function"&&e[$n]==="URLSearchParams",xr=e=>e&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.constructor=="function"&&/^(Blob|File)$/.test(e[$n]),yu=e=>typeof e=="object"&&(e[$n]==="AbortSignal"||e[$n]==="EventTarget"),wu=(e,t)=>{let n=new URL(t).hostname,a=new URL(e).hostname;return n===a||n.endsWith(`.${a}`)},Eu=(e,t)=>{let n=new URL(t).protocol,a=new URL(e).protocol;return n===a};var up=(0,Yh.promisify)(Re.default.pipeline),fe=Symbol("Body internals"),je=class{constructor(t,{size:n=0}={}){let a=null;t===null?t=null:sa(t)?t=Br.Buffer.from(t.toString()):xr(t)||Br.Buffer.isBuffer(t)||(Yh.types.isAnyArrayBuffer(t)?t=Br.Buffer.from(t):ArrayBuffer.isView(t)?t=Br.Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof Re.default||(t instanceof It?(t=gu(t),a=t.type.split("=")[1]):t=Br.Buffer.from(String(t))));let o=t;Br.Buffer.isBuffer(t)?o=Re.default.Readable.from(t):xr(t)&&(o=Re.default.Readable.from(t.stream())),this[fe]={body:t,stream:o,boundary:a,disturbed:!1,error:null},this.size=n,t instanceof Re.default&&t.on("error",l=>{let f=l instanceof Ke?l:new ue(`Invalid response body while trying to fetch ${this.url}: ${l.message}`,"system",l);this[fe].error=f})}get body(){return this[fe].stream}get bodyUsed(){return this[fe].disturbed}async arrayBuffer(){let{buffer:t,byteOffset:n,byteLength:a}=await fa(this);return t.slice(n,n+a)}async formData(){let t=this.headers.get("content-type");if(t.startsWith("application/x-www-form-urlencoded")){let a=new It,o=new URLSearchParams(await this.text());for(let[l,f]of o)a.append(l,f);return a}let{toFormData:n}=await Promise.resolve().then(()=>(Pu(),vu));return n(this.body,t)}async blob(){let t=this.headers&&this.headers.get("content-type")||this[fe].body&&this[fe].body.type||"",n=await this.arrayBuffer();return new Je([n],{type:t})}async json(){let t=await this.text();return JSON.parse(t)}async text(){let t=await fa(this);return new TextDecoder().decode(t)}buffer(){return fa(this)}};je.prototype.buffer=(0,Yh.deprecate)(je.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(je.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Yh.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function fa(e){if(e[fe].disturbed)throw new TypeError(`body used already for: ${e.url}`);if(e[fe].disturbed=!0,e[fe].error)throw e[fe].error;let{body:t}=e;if(t===null)return Br.Buffer.alloc(0);if(!(t instanceof Re.default))return Br.Buffer.alloc(0);let n=[],a=0;try{for await(let o of t){if(e.size>0&&a+o.length>e.size){let l=new ue(`content size at ${e.url} over limit: ${e.size}`,"max-size");throw t.destroy(l),l}a+=o.length,n.push(o)}}catch(o){throw o instanceof Ke?o:new ue(`Invalid response body while trying to fetch ${e.url}: ${o.message}`,"system",o)}if(t.readableEnded===!0||t._readableState.ended===!0)try{return n.every(o=>typeof o=="string")?Br.Buffer.from(n.join("")):Br.Buffer.concat(n,a)}catch(o){throw new ue(`Could not create Buffer from response body for ${e.url}: ${o.message}`,"system",o)}else throw new ue(`Premature close of server response while trying to fetch ${e.url}`)}var nr=(e,t)=>{let n,a,{body:o}=e[fe];if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof Re.default&&typeof o.getBoundary!="function"&&(n=new Re.PassThrough({highWaterMark:t}),a=new Re.PassThrough({highWaterMark:t}),o.pipe(n),o.pipe(a),e[fe].stream=n,o=a),o},fp=(0,Yh.deprecate)(e=>e.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),Dn=(e,t)=>e===null?null:typeof e=="string"?"text/plain;charset=UTF-8":sa(e)?"application/x-www-form-urlencoded;charset=UTF-8":xr(e)?e.type||null:Br.Buffer.isBuffer(e)||Yh.types.isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof It?`multipart/form-data; boundary=${t[fe].boundary}`:e&&typeof e.getBoundary=="function"?`multipart/form-data;boundary=${fp(e)}`:e instanceof Re.default?null:"text/plain;charset=UTF-8",Au=e=>{let{body:t}=e[fe];return t===null?0:xr(t)?t.size:Br.Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},Tu=async(e,{body:t})=>{t===null?e.end():await up(t,e)};var kr=Ve(require("http"),1),Nn=typeof kr.default.validateHeaderName=="function"?kr.default.validateHeaderName:e=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=new TypeError(`Header name must Br a valid HTTP token [${e}]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),t}},da=typeof kr.default.validateHeaderValue=="function"?kr.default.validateHeaderValue:(e,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}},pe=class e extends URLSearchParams{constructor(t){let n=[];if(t instanceof e){let a=t.raw();for(let[o,l]of Object.entries(a))n.push(...l.map(f=>[o,f]))}else if(t!=null)if(typeof t=="object"&&!Yh.types.isBoxedPrimitive(t)){let a=t[Symbol.iterator];if(a==null)n.push(...Object.entries(t));else{if(typeof a!="function")throw new TypeError("Header pairs must Br iterable");n=[...t].map(o=>{if(typeof o!="object"||Yh.types.isBoxedPrimitive(o))throw new TypeError("Each header pair must Br an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must Br a name/value tuple");return[...o]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return n=n.length>0?n.map(([a,o])=>(Nn(a),da(a,String(o)),[String(a).toLowerCase(),String(o)])):void 0,super(n),new Proxy(this,{get(a,o,l){switch(o){case"append":case"set":return(f,m)=>(Nn(f),da(f,String(m)),URLSearchParams.prototype[o].call(a,String(f).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return f=>(Nn(f),URLSearchParams.prototype[o].call(a,String(f).toLowerCase()));case"keys":return()=>(a.sort(),new Set(URLSearchParams.prototype.keys.call(a)).keys());default:return Reflect.get(a,o,l)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(t){let n=this.getAll(t);if(n.length===0)return null;let a=n.join(", ");return/^content-encoding$/i.test(t)&&(a=a.toLowerCase()),a}forEach(t,n=void 0){for(let a of this.keys())Reflect.apply(t,n,[this.get(a),a,this])}*values(){for(let t of this.keys())yield this.get(t)}*entries(){for(let t of this.keys())yield[t,this.get(t)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((t,n)=>(t[n]=this.getAll(n),t),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((t,n)=>{let a=this.getAll(n);return n==="host"?t[n]=a[0]:t[n]=a.length>1?a:a[0],t},{})}};Object.defineProperties(pe.prototype,["get","entries","forEach","values"].reduce((e,t)=>(e[t]={enumerable:!0},e),{}));function Cu(e=[]){return new pe(e.reduce((t,n,a,o)=>(a%2===0&&t.push(o.slice(a,a+2)),t),[]).filter(([t,n])=>{try{return Nn(t),da(t,String(n)),!0}catch{return!1}}))}var cp=new Set([301,302,303,307,308]),Wn=e=>cp.has(e);var xe=Symbol("Response internals"),ve=class e extends je{constructor(t=null,n={}){super(t,n);let a=n.status!=null?n.status:200,o=new pe(n.headers);if(t!==null&&!o.has("Content-Type")){let l=Dn(t,this);l&&o.append("Content-Type",l)}this[xe]={type:"default",url:n.url,status:a,statusText:n.statusText||"",headers:o,counter:n.counter,highWaterMark:n.highWaterMark}}get type(){return this[xe].type}get url(){return this[xe].url||""}get status(){return this[xe].status}get ok(){return this[xe].status>=200&&this[xe].status<300}get redirected(){return this[xe].counter>0}get statusText(){return this[xe].statusText}get headers(){return this[xe].headers}get highWaterMark(){return this[xe].highWaterMark}clone(){return new e(nr(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,n=302){if(!Wn(n))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new e(null,{headers:{location:new URL(t).toString()},status:n})}static error(){let t=new e(null,{status:0,statusText:""});return t[xe].type="error",t}static json(t=void 0,n={}){let a=JSON.stringify(t);if(a===void 0)throw new TypeError("data is not JSON serializable");let o=new pe(n&&n.headers);return o.has("content-type")||o.set("content-type","application/json"),new e(a,{...n,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(ve.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});var Fu=require("url");var xu=e=>{if(e.search)return e.search;let t=e.href.length-1,n=e.hash||(e.href[t]==="#"?"#":"");return e.href[t-n.length]==="?"?"?":""};var ku=require("net");function Iu(e,t=!1){return e==null||(e=new URL(e),/^(about|blob|data):$/.test(e.protocol))?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}var Lu=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Bu="strict-origin-when-cross-origin";function qu(e){if(!Lu.has(e))throw new TypeError(`Invalid referrerPolicy: ${e}`);return e}function dp(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,""),n=(0,ku.isIP)(t);return n===4&&/^127\./.test(t)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t)?!0:e.host==="localhost"||e.host.endsWith(".localhost")?!1:e.protocol==="file:"}function ir(e){return/^about:(blank|srcdoc)$/.test(e)||e.protocol==="data:"||/^(blob|filesystem):$/.test(e.protocol)?!0:dp(e)}function $u(e,{referrerURLCallback:t,referrerOriginCallback:n}={}){if(e.referrer==="no-referrer"||e.referrerPolicy==="")return null;let a=e.referrerPolicy;if(e.referrer==="about:client")return"no-referrer";let o=e.referrer,l=Iu(o),f=Iu(o,!0);l.toString().length>4096&&(l=f),t&&(l=t(l)),n&&(f=n(f));let m=new URL(e.url);switch(a){case"no-referrer":return"no-referrer";case"origin":return f;case"unsafe-url":return l;case"strict-origin":return ir(l)&&!ir(m)?"no-referrer":f.toString();case"strict-origin-when-cross-origin":return l.origin===m.origin?l:ir(l)&&!ir(m)?"no-referrer":f;case"same-origin":return l.origin===m.origin?l:"no-referrer";case"origin-when-cross-origin":return l.origin===m.origin?l:f;case"no-referrer-when-downgrade":return ir(l)&&!ir(m)?"no-referrer":l;default:throw new TypeError(`Invalid referrerPolicy: ${a}`)}}function Ou(e){let t=(e.get("referrer-policy")||"").split(/[,\s]+/),n="";for(let a of t)a&&Lu.has(a)&&(n=a);return n}var ee=Symbol("Request internals"),Lr=e=>typeof e=="object"&&typeof e[ee]=="object",hp=(0,Yh.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Lt=class e extends je{constructor(t,n={}){let a;if(Lr(t)?a=new URL(t.url):(a=new URL(t),t={}),a.username!==""||a.password!=="")throw new TypeError(`${a} is an url with embedded credentials.`);let o=n.method||t.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!Lr(n)&&"data"in n&&hp(),(n.body!=null||Lr(t)&&t.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let l=n.body?n.body:Lr(t)&&t.body!==null?nr(t):null;super(l,{size:n.size||t.size||0});let f=new pe(n.headers||t.headers||{});if(l!==null&&!f.has("Content-Type")){let b=Dn(l,this);b&&f.set("Content-Type",b)}let m=Lr(t)?t.signal:null;if("signal"in n&&(m=n.signal),m!=null&&!yu(m))throw new TypeError("Expected signal to Br an instanceof AbortSignal or EventTarget");let d=n.referrer==null?t.referrer:n.referrer;if(d==="")d="no-referrer";else if(d){let b=new URL(d);d=/^about:(\/\/)?client$/.test(b)?"client":b}else d=void 0;this[ee]={method:o,redirect:n.redirect||t.redirect||"follow",headers:f,parsedURL:a,signal:m,referrer:d},this.follow=n.follow===void 0?t.follow===void 0?20:t.follow:n.follow,this.compress=n.compress===void 0?t.compress===void 0?!0:t.compress:n.compress,this.counter=n.counter||t.counter||0,this.agent=n.agent||t.agent,this.highWaterMark=n.highWaterMark||t.highWaterMark||16384,this.insecureHTTPParser=n.insecureHTTPParser||t.insecureHTTPParser||!1,this.referrerPolicy=n.referrerPolicy||t.referrerPolicy||""}get method(){return this[ee].method}get url(){return(0,Fu.format)(this[ee].parsedURL)}get headers(){return this[ee].headers}get redirect(){return this[ee].redirect}get signal(){return this[ee].signal}get referrer(){if(this[ee].referrer==="no-referrer")return"";if(this[ee].referrer==="client")return"about:client";if(this[ee].referrer)return this[ee].referrer.toString()}get referrerPolicy(){return this[ee].referrerPolicy}set referrerPolicy(t){this[ee].referrerPolicy=qu(t)}clone(){return new e(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Lt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var Du=e=>{let{parsedURL:t}=e[ee],n=new pe(e[ee].headers);n.has("Accept")||n.set("Accept","*/*");let a=null;if(e.body===null&&/^(post|put)$/i.test(e.method)&&(a="0"),e.body!==null){let m=Au(e);typeof m=="number"&&!Number.isNaN(m)&&(a=String(m))}a&&n.set("Content-Length",a),e.referrerPolicy===""&&(e.referrerPolicy=Bu),e.referrer&&e.referrer!=="no-referrer"?e[ee].referrer=$u(e):e[ee].referrer="no-referrer",e[ee].referrer instanceof URL&&n.set("Referer",e.referrer),n.has("User-Agent")||n.set("User-Agent","node-fetch"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip, deflate, br");let{agent:o}=e;typeof o=="function"&&(o=o(t));let l=xu(t),f={path:t.pathname+l,method:e.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:e.insecureHTTPParser,agent:o};return{parsedURL:t,options:f}};var Mn=class extends Ke{constructor(t,n="aborted"){super(t,n)}};qn();la();var mp=new Set(["data:","http:","https:"]);async function zn(e,t){return new Promise((n,a)=>{let o=new Lt(e,t),{parsedURL:l,options:f}=Du(o);if(!mp.has(l.protocol))throw new TypeError(`node-fetch cannot load ${e}. URL scheme "${l.protocol.replace(/:$/,"")}" is not supported.`);if(l.protocol==="data:"){let S=su(o.url),D=new ve(S,{headers:{"Content-Type":S.typeFull}});n(D);return}let m=(l.protocol==="https:"?Wu.default:Nu.default).request,{signal:d}=o,b=null,w=()=>{let S=new Mn("The operation was aborted.");a(S),o.body&&o.body instanceof ge.default.Readable&&o.body.destroy(S),!(!b||!b.body)&&b.body.emit("error",S)};if(d&&d.aborted){w();return}let P=()=>{w(),V()},I=m(l.toString(),f);d&&d.addEventListener("abort",P);let V=()=>{I.abort(),d&&d.removeEventListener("abort",P)};I.on("error",S=>{a(new ue(`request to ${o.url} failed, reason: ${S.message}`,"system",S)),V()}),bp(I,S=>{b&&b.body&&b.body.destroy(S)}),process.version<"v14"&&I.on("socket",S=>{let D;S.prependListener("end",()=>{D=S._eventsCount}),S.prependListener("close",O=>{if(b&&D<S._eventsCount&&!O){let F=new Error("Premature close");F.code="ERR_STREAM_PREMATURE_CLOSE",b.body.emit("error",F)}})}),I.on("response",S=>{I.setTimeout(0);let D=Cu(S.rawHeaders);if(Wn(S.statusCode)){let N=D.get("Location"),W=null;try{W=N===null?null:new URL(N,o.url)}catch{if(o.redirect!=="manual"){a(new ue(`uri requested responds with an invalid redirect URL: ${N}`,"invalid-redirect")),V();return}}switch(o.redirect){case"error":a(new ue(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),V();return;case"manual":break;case"follow":{if(W===null)break;if(o.counter>=o.follow){a(new ue(`maximum redirect reached at: ${o.url}`,"max-redirect")),V();return}let Y={headers:new pe(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:nr(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!wu(o.url,W)||!Eu(o.url,W))for(let ar of["authorization","www-authenticate","cookie","cookie2"])Y.headers.delete(ar);if(S.statusCode!==303&&o.body&&t.body instanceof ge.default.Readable){a(new ue("Cannot follow redirect with body being a readable stream","unsupported-redirect")),V();return}(S.statusCode===303||(S.statusCode===301||S.statusCode===302)&&o.method==="POST")&&(Y.method="GET",Y.body=void 0,Y.headers.delete("content-length"));let et=Ou(D);et&&(Y.referrerPolicy=et),n(zn(new Lt(W,Y))),V();return}default:return a(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}d&&S.once("end",()=>{d.removeEventListener("abort",P)});let O=(0,ge.pipeline)(S,new ge.PassThrough,N=>{N&&a(N)});process.version<"v12.10"&&S.on("aborted",P);let F={url:o.url,status:S.statusCode,statusText:S.statusMessage,headers:D,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},z=D.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||z===null||S.statusCode===204||S.statusCode===304){b=new ve(O,F),n(b);return}let te={flush:Bt.default.Z_SYNC_FLUSH,finishFlush:Bt.default.Z_SYNC_FLUSH};if(z==="gzip"||z==="x-gzip"){O=(0,ge.pipeline)(O,Bt.default.createGunzip(te),N=>{N&&a(N)}),b=new ve(O,F),n(b);return}if(z==="deflate"||z==="x-deflate"){let N=(0,ge.pipeline)(S,new ge.PassThrough,W=>{W&&a(W)});N.once("data",W=>{(W[0]&15)===8?O=(0,ge.pipeline)(O,Bt.default.createInflate(),Y=>{Y&&a(Y)}):O=(0,ge.pipeline)(O,Bt.default.createInflateRaw(),Y=>{Y&&a(Y)}),b=new ve(O,F),n(b)}),N.once("end",()=>{b||(b=new ve(O,F),n(b))});return}if(z==="br"){O=(0,ge.pipeline)(O,Bt.default.createBrotliDecompress(),N=>{N&&a(N)}),b=new ve(O,F),n(b);return}b=new ve(O,F),n(b)}),Tu(I,o).catch(a)})}function bp(e,t){let n=Br.Buffer.from(`0\r
14
14
  \r
15
- `),a=!1,o=!1,l;e.on("response",f=>{let{headers:m}=f;a=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),e.on("socket",f=>{let m=()=>{if(a&&!o){let b=new Error("Premature close");b.code="ERR_STREAM_PREMATURE_CLOSE",t(b)}},d=b=>{o=Br.Buffer.compare(b.slice(-5),n)===0,!o&&l&&(o=Br.Buffer.compare(l.slice(-3),n.slice(0,3))===0&&Br.Buffer.compare(b.slice(-2),n.slice(3))===0),l=b};f.prependListener("close",m),f.on("data",d),e.on("close",()=>{f.removeListener("close",m),f.removeListener("data",d)})})}var Hn=["jpg","gif","png"],pp=async(e,t)=>{var b,w,P;let n=(0,Un.default)(e),a=await n.metadata(),o=(b=a.width)!=null?b:100,l=(w=a.height)!=null?w:100,f=e.split(";")[0].split("/")[1];if(Hn.includes(f))return{type:f,data:e,transformation:{width:o,height:l}};let m=(P=t==null?void 0:t.fallbackImageType)!=null?P:"png",d={data:await n.toFormat(m).toBuffer(),type:m,transformation:{width:o,height:l}};return e.includes("svg")?{...d,type:"svg",data:e,fallback:{type:m,data:d.data}}:d},gp=async(e,t)=>{var f,m,d,b,w,P,I,V;let n,a,o;if(e.startsWith("http")){let S=await zn(e),D=await S.arrayBuffer(),F=((m=(f=S.headers.get("content-type"))==null?void 0:f.split(";")[0])!=null?m:"image/png").split("/")[1];n=(0,Un.default)(D);let z=await n.metadata();if(a=(d=z.width)!=null?d:100,o=(b=z.height)!=null?b:100,Hn.includes(F))return{type:F,data:D,transformation:{width:a,height:o}}}else{let S=(w=t==null?void 0:t.pathPrefix)!=null?w:"";n=(0,Un.default)(S+e);let D=await n.metadata();a=(P=D.width)!=null?P:100,o=(I=D.height)!=null?I:100;let O=e.split(".").pop();if(Hn.includes(O))return{type:O,data:await n.toBuffer(),transformation:{width:a,height:o}}}let l=(V=t==null?void 0:t.fallbackImageType)!=null?V:"png";return{data:await n.toFormat(l).toBuffer(),type:l,transformation:{width:a,height:o}}},yp=async(e,t)=>{try{return e.startsWith("data:")?await pp(e,t):await gp(e,t)}catch(n){return console.error(`Error resolving image: ${e}`,n),{type:"png",data:Buffer.from([]),transformation:{width:100,height:100}}}},wp=e=>({inline:async(t,n,a,o)=>{var l,f,m;if(/^image/.test(n.type)){let d=(f=n.url)!=null?f:o[(l=n.identifier)==null?void 0:l.toUpperCase()],b=(m=n.alt)!=null?m:d==null?void 0:d.split("/").pop();return n.type="",[new t.ImageRun({...await yp(d,e),altText:{description:b,name:b,title:b}})]}return[]}});0&&(module.exports={SUPPORTED_IMAGE_TYPES,nodeImagePlugin});
15
+ `),a=!1,o=!1,l;e.on("response",f=>{let{headers:m}=f;a=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),e.on("socket",f=>{let m=()=>{if(a&&!o){let b=new Error("Premature close");b.code="ERR_STREAM_PREMATURE_CLOSE",t(b)}},d=b=>{o=Br.Buffer.compare(b.slice(-5),n)===0,!o&&l&&(o=Br.Buffer.compare(l.slice(-3),n.slice(0,3))===0&&Br.Buffer.compare(b.slice(-2),n.slice(3))===0),l=b};f.prependListener("close",m),f.on("data",d),e.on("close",()=>{f.removeListener("close",m),f.removeListener("data",d)})})}var Hn=["jpg","gif","png"],pp=async(e,t)=>{var b,w,P;let n=(0,Un.default)(e),a=await n.metadata(),o=(b=a.width)!=null?b:100,l=(w=a.height)!=null?w:100,f=e.split(";")[0].split("/")[1];if(Hn.includes(f))return{type:f,data:e,transformation:{width:o,height:l}};let m=(P=t==null?void 0:t.fallbackImageType)!=null?P:"png",d={data:await n.toFormat(m).toBuffer(),type:m,transformation:{width:o,height:l}};return e.includes("svg")?{...d,type:"svg",data:e,fallback:{type:m,data:d.data}}:d},gp=async(e,t)=>{var f,m,d,b,w,P,I,V;let n,a,o;if(e.startsWith("http")){let S=await zn(e),D=await S.arrayBuffer(),F=((m=(f=S.headers.get("content-type"))==null?void 0:f.split(";")[0])!=null?m:"image/png").split("/")[1];n=(0,Un.default)(D);let z=await n.metadata();if(a=(d=z.width)!=null?d:100,o=(b=z.height)!=null?b:100,Hn.includes(F))return{type:F,data:D,transformation:{width:a,height:o}}}else{let S=(w=t==null?void 0:t.pathPrefix)!=null?w:"";n=(0,Un.default)(S+e);let D=await n.metadata();a=(P=D.width)!=null?P:100,o=(I=D.height)!=null?I:100;let O=e.split(".").pop();if(Hn.includes(O))return{type:O,data:await n.toBuffer(),transformation:{width:a,height:o}}}let l=(V=t==null?void 0:t.fallbackImageType)!=null?V:"png";return{data:await n.toFormat(l).toBuffer(),type:l,transformation:{width:a,height:o}}},yp=async(e,t)=>{try{return e.startsWith("data:")?await pp(e,t):await gp(e,t)}catch(n){return console.error(`Error resolving image: ${e}`,n),{type:"png",data:Buffer.from([]),transformation:{width:100,height:100}}}},wp=e=>({inline:async(t,n,a,o)=>{var l,f,m,d;if(/^image/.test(n.type)){let b=(f=n.url)!=null?f:o[(l=n.identifier)==null?void 0:l.toUpperCase()],w=(m=n.alt)!=null?m:b==null?void 0:b.split("/").pop();return n.type="",[new t.ImageRun({...await((d=e==null?void 0:e.imageResolver)!=null?d:yp)(b,e),altText:{description:w,name:w,title:w}})]}return[]}});0&&(module.exports={SUPPORTED_IMAGE_TYPES,nodeImagePlugin});
16
16
  /*! Bundled license information:
17
17
 
18
18
  web-streams-polyfill/dist/ponyfill.es2018.js:
@@ -0,0 +1 @@
1
+ import{a as o,b as r}from"../../chunk-35E6UZDH.mjs";import"../../chunk-JOIHCSIR.mjs";import"../../chunk-Z2MODMIK.mjs";import"../../chunk-I5QUWH2X.mjs";export{o as SUPPORTED_IMAGE_TYPES,r as nodeImagePlugin};
@@ -2,8 +2,12 @@
2
2
  * This plugin is not working at the moment because of issues in installing sharp or canvas
3
3
  */
4
4
  import { IImageOptions } from "docx";
5
- import { IPlugin } from "../utils";
5
+ import { IPlugin } from "../../utils";
6
6
  export declare const SUPPORTED_IMAGE_TYPES: readonly ["jpg", "gif", "png"];
7
+ /**
8
+ * Resolves an image source URL into the appropriate image options for DOCX conversion.
9
+ */
10
+ export type NodeImageResolver = (src: string, options?: INodeImagePluginOptions) => Promise<IImageOptions>;
7
11
  interface INodeImagePluginOptions {
8
12
  /**
9
13
  * pathPrefix
@@ -14,11 +18,11 @@ interface INodeImagePluginOptions {
14
18
  * @default "png"
15
19
  */
16
20
  fallbackImageType?: "png" | "jpg" | "gif";
21
+ /**
22
+ * Custom image resolver to resolve an image source URL into the appropriate image options for DOCX conversion.
23
+ */
24
+ imageResolver?: NodeImageResolver;
17
25
  }
18
- /**
19
- * Resolves an image source URL into the appropriate image options for DOCX conversion.
20
- */
21
- export type NodeImageResolver = (src: string, options?: INodeImagePluginOptions) => Promise<IImageOptions>;
22
26
  /**
23
27
  * Image plugin for processing inline image nodes in Markdown AST.
24
28
  * This plugin is designed for server-side (node.js) environments.
@@ -12,7 +12,7 @@ Content-Type: ${l.type||"application/octet-stream"}\r
12
12
  `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),xt=(e,t,n)=>{if(t.length<n)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${n} arguments required, but only ${t.length} present.`)},It=(pu=class{constructor(...t){Ce(this,_e,[]);if(t.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Cr](){return"FormData"}[Jb](){return this.entries()}static[Kb](t){return t&&typeof t=="object"&&t[Cr]==="FormData"&&!Zb.some(n=>typeof t[n]!="function")}append(...t){xt("append",arguments,2),J(this,_e).push(bu(...t))}delete(t){xt("delete",arguments,1),t+="",de(this,_e,J(this,_e).filter(([n])=>n!==t))}get(t){xt("get",arguments,1),t+="";for(var n=J(this,_e),a=n.length,o=0;o<a;o++)if(n[o][0]===t)return n[o][1];return null}getAll(t,n){return xt("getAll",arguments,1),n=[],t+="",J(this,_e).forEach(a=>a[0]===t&&n.push(a[1])),n}has(t){return xt("has",arguments,1),t+="",J(this,_e).some(n=>n[0]===t)}forEach(t,n){xt("forEach",arguments,1);for(var[a,o]of this)t.call(n,o,a,this)}set(...t){xt("set",arguments,2);var n=[],a=!0;t=bu(...t),J(this,_e).forEach(o=>{o[0]===t[0]?a&&(a=!n.push(t)):n.push(o)}),a&&n.push(t),de(this,_e,n)}*entries(){yield*J(this,_e)}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}},_e=new WeakMap,pu)});var _u=k((kg,Su)=>{"use strict";if(!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),t=new e().port1,n=new ArrayBuffer;t.postMessage(n,[n,n])}catch(e){e.constructor.name==="DOMException"&&(globalThis.DOMException=e.constructor)}Su.exports=globalThis.DOMException});var On,ra,tp,qg,la=pr(()=>{"use strict";On=require("fs"),tp=Ve(_u(),1);aa();Pr();({stat:qg}=On.promises)});var vu={};ko(vu,{toFormData:()=>lp});function sp(e){let t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let n=t[2]||t[3]||"",a=n.slice(n.lastIndexOf("\\")+1);return a=a.replace(/%22/g,'"'),a=a.replace(/&#(\d{4});/g,(o,l)=>String.fromCharCode(l)),a}async function lp(e,t){if(!/multipart/i.test(t))throw new TypeError("Failed to fetch");let n=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let a=new ua(n[1]||n[2]),o,l,f,m,d,b,w=[],P=new It,I=F=>{f+=O.decode(F,{stream:!0})},V=F=>{w.push(F)},S=()=>{let F=new rr(w,b,{type:d});P.append(m,F)},D=()=>{P.append(m,f)},O=new TextDecoder("utf-8");O.decode(),a.onPartBegin=function(){a.onPartData=I,a.onPartEnd=D,o="",l="",f="",m="",d="",b=null,w.length=0},a.onHeaderField=function(F){o+=O.decode(F,{stream:!0})},a.onHeaderValue=function(F){l+=O.decode(F,{stream:!0})},a.onHeaderEnd=function(){if(l+=O.decode(),o=o.toLowerCase(),o==="content-disposition"){let F=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);F&&(m=F[2]||F[3]||""),b=sp(l),b&&(a.onPartData=V,a.onPartEnd=S)}else o==="content-type"&&(d=l);l="",o=""};for await(let F of e)a.write(F);return a.end(),P}var Fe,G,Ru,pt,Fn,jn,rp,Ir,np,ip,ap,op,kt,ua,Pu=pr(()=>{"use strict";la();qn();Fe=0,G={START_BOUNDARY:Fe++,HEADER_FIELD_START:Fe++,HEADER_FIELD:Fe++,HEADER_VALUE_START:Fe++,HEADER_VALUE:Fe++,HEADER_VALUE_ALMOST_DONE:Fe++,HEADERS_ALMOST_DONE:Fe++,PART_DATA_START:Fe++,PART_DATA:Fe++,END:Fe++},Ru=1,pt={PART_BOUNDARY:Ru,LAST_BOUNDARY:Ru*=2},Fn=10,jn=13,rp=32,Ir=45,np=58,ip=97,ap=122,op=e=>e|32,kt=()=>{},ua=class{constructor(t){this.index=0,this.flags=0,this.onHeaderEnd=kt,this.onHeaderField=kt,this.onHeadersEnd=kt,this.onHeaderValue=kt,this.onPartBegin=kt,this.onPartData=kt,this.onPartEnd=kt,this.boundaryChars={},t=`\r
13
13
  --`+t;let n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a),this.boundaryChars[n[a]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=G.START_BOUNDARY}write(t){let n=0,a=t.length,o=this.index,{lookbehind:l,boundary:f,boundaryChars:m,index:d,state:b,flags:w}=this,P=this.boundary.length,I=P-1,V=t.length,S,D,O=N=>{this[N+"Mark"]=n},F=N=>{delete this[N+"Mark"]},z=(N,W,Y,et)=>{(W===void 0||W!==Y)&&this[N](et&&et.subarray(W,Y))},te=(N,W)=>{let Y=N+"Mark";Y in this&&(W?(z(N,this[Y],n,t),delete this[Y]):(z(N,this[Y],t.length,t),this[Y]=0))};for(n=0;n<a;n++)switch(S=t[n],b){case G.START_BOUNDARY:if(d===f.length-2){if(S===Ir)w|=pt.LAST_BOUNDARY;else if(S!==jn)return;d++;break}else if(d-1===f.length-2){if(w&pt.LAST_BOUNDARY&&S===Ir)b=G.END,w=0;else if(!(w&pt.LAST_BOUNDARY)&&S===Fn)d=0,z("onPartBegin"),b=G.HEADER_FIELD_START;else return;break}S!==f[d+2]&&(d=-2),S===f[d+2]&&d++;break;case G.HEADER_FIELD_START:b=G.HEADER_FIELD,O("onHeaderField"),d=0;case G.HEADER_FIELD:if(S===jn){F("onHeaderField"),b=G.HEADERS_ALMOST_DONE;break}if(d++,S===Ir)break;if(S===np){if(d===1)return;te("onHeaderField",!0),b=G.HEADER_VALUE_START;break}if(D=op(S),D<ip||D>ap)return;break;case G.HEADER_VALUE_START:if(S===rp)break;O("onHeaderValue"),b=G.HEADER_VALUE;case G.HEADER_VALUE:S===jn&&(te("onHeaderValue",!0),z("onHeaderEnd"),b=G.HEADER_VALUE_ALMOST_DONE);break;case G.HEADER_VALUE_ALMOST_DONE:if(S!==Fn)return;b=G.HEADER_FIELD_START;break;case G.HEADERS_ALMOST_DONE:if(S!==Fn)return;z("onHeadersEnd"),b=G.PART_DATA_START;break;case G.PART_DATA_START:b=G.PART_DATA,O("onPartData");case G.PART_DATA:if(o=d,d===0){for(n+=I;n<V&&!(t[n]in m);)n+=P;n-=I,S=t[n]}if(d<f.length)f[d]===S?(d===0&&te("onPartData",!0),d++):d=0;else if(d===f.length)d++,S===jn?w|=pt.PART_BOUNDARY:S===Ir?w|=pt.LAST_BOUNDARY:d=0;else if(d-1===f.length)if(w&pt.PART_BOUNDARY){if(d=0,S===Fn){w&=~pt.PART_BOUNDARY,z("onPartEnd"),z("onPartBegin"),b=G.HEADER_FIELD_START;break}}else w&pt.LAST_BOUNDARY&&S===Ir?(z("onPartEnd"),b=G.END,w=0):d=0;if(d>0)l[d-1]=S;else if(o>0){let N=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);z("onPartData",0,o,N),o=0,O("onPartData"),n--}break;case G.END:break;default:throw new Error(`Unexpected state entered: ${b}`)}te("onHeaderField"),te("onHeaderValue"),te("onPartData"),this.index=d,this.state=b,this.flags=w}end(){if(this.state===G.HEADER_FIELD_START&&this.index===0||this.state===G.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==G.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var Ep={};ko(Ep,{SUPPORTED_IMAGE_TYPES:()=>Hn,nodeImagePlugin:()=>wp});module.exports=jc(Ep);var Un=Ve(ou());var Nu=Ve(require("http"),1),Wu=Ve(require("https"),1),Bt=Ve(require("zlib"),1),ge=Ve(require("stream"),1),Br=require("buffer");function Vb(e){if(!/^data:/i.test(e))throw new TypeError('`uri` does not appear to Br a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");let t=e.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");let n=e.substring(5,t).split(";"),a="",o=!1,l=n[0]||"text/plain",f=l;for(let w=1;w<n.length;w++)n[w]==="base64"?o=!0:n[w]&&(f+=`;${n[w]}`,n[w].indexOf("charset=")===0&&(a=n[w].substring(8)));!n[0]&&!a.length&&(f+=";charset=US-ASCII",a="US-ASCII");let m=o?"base64":"ascii",d=unescape(e.substring(t+1)),b=Buffer.from(d,m);return b.type=l,b.typeFull=f,b.charset=a,b}var su=Vb;var Re=Ve(require("stream"),1);Pr();qn();var Ke=class extends Error{constructor(t,n){super(t),Error.captureStackTrace(this,this.constructor),this.type=n}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var ue=class extends Ke{constructor(t,n,a){super(t,n),a&&(this.code=this.errno=a.code,this.erroredSysCall=a.syscall)}};var $n=Symbol.toStringTag,sa=e=>typeof e=="object"&&typeof e.append=="function"&&typeof e.delete=="function"&&typeof e.get=="function"&&typeof e.getAll=="function"&&typeof e.has=="function"&&typeof e.set=="function"&&typeof e.sort=="function"&&e[$n]==="URLSearchParams",xr=e=>e&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.constructor=="function"&&/^(Blob|File)$/.test(e[$n]),yu=e=>typeof e=="object"&&(e[$n]==="AbortSignal"||e[$n]==="EventTarget"),wu=(e,t)=>{let n=new URL(t).hostname,a=new URL(e).hostname;return n===a||n.endsWith(`.${a}`)},Eu=(e,t)=>{let n=new URL(t).protocol,a=new URL(e).protocol;return n===a};var up=(0,Yh.promisify)(Re.default.pipeline),fe=Symbol("Body internals"),je=class{constructor(t,{size:n=0}={}){let a=null;t===null?t=null:sa(t)?t=Br.Buffer.from(t.toString()):xr(t)||Br.Buffer.isBuffer(t)||(Yh.types.isAnyArrayBuffer(t)?t=Br.Buffer.from(t):ArrayBuffer.isView(t)?t=Br.Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof Re.default||(t instanceof It?(t=gu(t),a=t.type.split("=")[1]):t=Br.Buffer.from(String(t))));let o=t;Br.Buffer.isBuffer(t)?o=Re.default.Readable.from(t):xr(t)&&(o=Re.default.Readable.from(t.stream())),this[fe]={body:t,stream:o,boundary:a,disturbed:!1,error:null},this.size=n,t instanceof Re.default&&t.on("error",l=>{let f=l instanceof Ke?l:new ue(`Invalid response body while trying to fetch ${this.url}: ${l.message}`,"system",l);this[fe].error=f})}get body(){return this[fe].stream}get bodyUsed(){return this[fe].disturbed}async arrayBuffer(){let{buffer:t,byteOffset:n,byteLength:a}=await fa(this);return t.slice(n,n+a)}async formData(){let t=this.headers.get("content-type");if(t.startsWith("application/x-www-form-urlencoded")){let a=new It,o=new URLSearchParams(await this.text());for(let[l,f]of o)a.append(l,f);return a}let{toFormData:n}=await Promise.resolve().then(()=>(Pu(),vu));return n(this.body,t)}async blob(){let t=this.headers&&this.headers.get("content-type")||this[fe].body&&this[fe].body.type||"",n=await this.arrayBuffer();return new Je([n],{type:t})}async json(){let t=await this.text();return JSON.parse(t)}async text(){let t=await fa(this);return new TextDecoder().decode(t)}buffer(){return fa(this)}};je.prototype.buffer=(0,Yh.deprecate)(je.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(je.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Yh.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function fa(e){if(e[fe].disturbed)throw new TypeError(`body used already for: ${e.url}`);if(e[fe].disturbed=!0,e[fe].error)throw e[fe].error;let{body:t}=e;if(t===null)return Br.Buffer.alloc(0);if(!(t instanceof Re.default))return Br.Buffer.alloc(0);let n=[],a=0;try{for await(let o of t){if(e.size>0&&a+o.length>e.size){let l=new ue(`content size at ${e.url} over limit: ${e.size}`,"max-size");throw t.destroy(l),l}a+=o.length,n.push(o)}}catch(o){throw o instanceof Ke?o:new ue(`Invalid response body while trying to fetch ${e.url}: ${o.message}`,"system",o)}if(t.readableEnded===!0||t._readableState.ended===!0)try{return n.every(o=>typeof o=="string")?Br.Buffer.from(n.join("")):Br.Buffer.concat(n,a)}catch(o){throw new ue(`Could not create Buffer from response body for ${e.url}: ${o.message}`,"system",o)}else throw new ue(`Premature close of server response while trying to fetch ${e.url}`)}var nr=(e,t)=>{let n,a,{body:o}=e[fe];if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof Re.default&&typeof o.getBoundary!="function"&&(n=new Re.PassThrough({highWaterMark:t}),a=new Re.PassThrough({highWaterMark:t}),o.pipe(n),o.pipe(a),e[fe].stream=n,o=a),o},fp=(0,Yh.deprecate)(e=>e.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),Dn=(e,t)=>e===null?null:typeof e=="string"?"text/plain;charset=UTF-8":sa(e)?"application/x-www-form-urlencoded;charset=UTF-8":xr(e)?e.type||null:Br.Buffer.isBuffer(e)||Yh.types.isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof It?`multipart/form-data; boundary=${t[fe].boundary}`:e&&typeof e.getBoundary=="function"?`multipart/form-data;boundary=${fp(e)}`:e instanceof Re.default?null:"text/plain;charset=UTF-8",Au=e=>{let{body:t}=e[fe];return t===null?0:xr(t)?t.size:Br.Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},Tu=async(e,{body:t})=>{t===null?e.end():await up(t,e)};var kr=Ve(require("http"),1),Nn=typeof kr.default.validateHeaderName=="function"?kr.default.validateHeaderName:e=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=new TypeError(`Header name must Br a valid HTTP token [${e}]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),t}},da=typeof kr.default.validateHeaderValue=="function"?kr.default.validateHeaderValue:(e,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}},pe=class e extends URLSearchParams{constructor(t){let n=[];if(t instanceof e){let a=t.raw();for(let[o,l]of Object.entries(a))n.push(...l.map(f=>[o,f]))}else if(t!=null)if(typeof t=="object"&&!Yh.types.isBoxedPrimitive(t)){let a=t[Symbol.iterator];if(a==null)n.push(...Object.entries(t));else{if(typeof a!="function")throw new TypeError("Header pairs must Br iterable");n=[...t].map(o=>{if(typeof o!="object"||Yh.types.isBoxedPrimitive(o))throw new TypeError("Each header pair must Br an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must Br a name/value tuple");return[...o]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return n=n.length>0?n.map(([a,o])=>(Nn(a),da(a,String(o)),[String(a).toLowerCase(),String(o)])):void 0,super(n),new Proxy(this,{get(a,o,l){switch(o){case"append":case"set":return(f,m)=>(Nn(f),da(f,String(m)),URLSearchParams.prototype[o].call(a,String(f).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return f=>(Nn(f),URLSearchParams.prototype[o].call(a,String(f).toLowerCase()));case"keys":return()=>(a.sort(),new Set(URLSearchParams.prototype.keys.call(a)).keys());default:return Reflect.get(a,o,l)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(t){let n=this.getAll(t);if(n.length===0)return null;let a=n.join(", ");return/^content-encoding$/i.test(t)&&(a=a.toLowerCase()),a}forEach(t,n=void 0){for(let a of this.keys())Reflect.apply(t,n,[this.get(a),a,this])}*values(){for(let t of this.keys())yield this.get(t)}*entries(){for(let t of this.keys())yield[t,this.get(t)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((t,n)=>(t[n]=this.getAll(n),t),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((t,n)=>{let a=this.getAll(n);return n==="host"?t[n]=a[0]:t[n]=a.length>1?a:a[0],t},{})}};Object.defineProperties(pe.prototype,["get","entries","forEach","values"].reduce((e,t)=>(e[t]={enumerable:!0},e),{}));function Cu(e=[]){return new pe(e.reduce((t,n,a,o)=>(a%2===0&&t.push(o.slice(a,a+2)),t),[]).filter(([t,n])=>{try{return Nn(t),da(t,String(n)),!0}catch{return!1}}))}var cp=new Set([301,302,303,307,308]),Wn=e=>cp.has(e);var xe=Symbol("Response internals"),ve=class e extends je{constructor(t=null,n={}){super(t,n);let a=n.status!=null?n.status:200,o=new pe(n.headers);if(t!==null&&!o.has("Content-Type")){let l=Dn(t,this);l&&o.append("Content-Type",l)}this[xe]={type:"default",url:n.url,status:a,statusText:n.statusText||"",headers:o,counter:n.counter,highWaterMark:n.highWaterMark}}get type(){return this[xe].type}get url(){return this[xe].url||""}get status(){return this[xe].status}get ok(){return this[xe].status>=200&&this[xe].status<300}get redirected(){return this[xe].counter>0}get statusText(){return this[xe].statusText}get headers(){return this[xe].headers}get highWaterMark(){return this[xe].highWaterMark}clone(){return new e(nr(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,n=302){if(!Wn(n))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new e(null,{headers:{location:new URL(t).toString()},status:n})}static error(){let t=new e(null,{status:0,statusText:""});return t[xe].type="error",t}static json(t=void 0,n={}){let a=JSON.stringify(t);if(a===void 0)throw new TypeError("data is not JSON serializable");let o=new pe(n&&n.headers);return o.has("content-type")||o.set("content-type","application/json"),new e(a,{...n,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(ve.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});var Fu=require("url");var xu=e=>{if(e.search)return e.search;let t=e.href.length-1,n=e.hash||(e.href[t]==="#"?"#":"");return e.href[t-n.length]==="?"?"?":""};var ku=require("net");function Iu(e,t=!1){return e==null||(e=new URL(e),/^(about|blob|data):$/.test(e.protocol))?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}var Lu=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Bu="strict-origin-when-cross-origin";function qu(e){if(!Lu.has(e))throw new TypeError(`Invalid referrerPolicy: ${e}`);return e}function dp(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,""),n=(0,ku.isIP)(t);return n===4&&/^127\./.test(t)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t)?!0:e.host==="localhost"||e.host.endsWith(".localhost")?!1:e.protocol==="file:"}function ir(e){return/^about:(blank|srcdoc)$/.test(e)||e.protocol==="data:"||/^(blob|filesystem):$/.test(e.protocol)?!0:dp(e)}function $u(e,{referrerURLCallback:t,referrerOriginCallback:n}={}){if(e.referrer==="no-referrer"||e.referrerPolicy==="")return null;let a=e.referrerPolicy;if(e.referrer==="about:client")return"no-referrer";let o=e.referrer,l=Iu(o),f=Iu(o,!0);l.toString().length>4096&&(l=f),t&&(l=t(l)),n&&(f=n(f));let m=new URL(e.url);switch(a){case"no-referrer":return"no-referrer";case"origin":return f;case"unsafe-url":return l;case"strict-origin":return ir(l)&&!ir(m)?"no-referrer":f.toString();case"strict-origin-when-cross-origin":return l.origin===m.origin?l:ir(l)&&!ir(m)?"no-referrer":f;case"same-origin":return l.origin===m.origin?l:"no-referrer";case"origin-when-cross-origin":return l.origin===m.origin?l:f;case"no-referrer-when-downgrade":return ir(l)&&!ir(m)?"no-referrer":l;default:throw new TypeError(`Invalid referrerPolicy: ${a}`)}}function Ou(e){let t=(e.get("referrer-policy")||"").split(/[,\s]+/),n="";for(let a of t)a&&Lu.has(a)&&(n=a);return n}var ee=Symbol("Request internals"),Lr=e=>typeof e=="object"&&typeof e[ee]=="object",hp=(0,Yh.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Lt=class e extends je{constructor(t,n={}){let a;if(Lr(t)?a=new URL(t.url):(a=new URL(t),t={}),a.username!==""||a.password!=="")throw new TypeError(`${a} is an url with embedded credentials.`);let o=n.method||t.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!Lr(n)&&"data"in n&&hp(),(n.body!=null||Lr(t)&&t.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let l=n.body?n.body:Lr(t)&&t.body!==null?nr(t):null;super(l,{size:n.size||t.size||0});let f=new pe(n.headers||t.headers||{});if(l!==null&&!f.has("Content-Type")){let b=Dn(l,this);b&&f.set("Content-Type",b)}let m=Lr(t)?t.signal:null;if("signal"in n&&(m=n.signal),m!=null&&!yu(m))throw new TypeError("Expected signal to Br an instanceof AbortSignal or EventTarget");let d=n.referrer==null?t.referrer:n.referrer;if(d==="")d="no-referrer";else if(d){let b=new URL(d);d=/^about:(\/\/)?client$/.test(b)?"client":b}else d=void 0;this[ee]={method:o,redirect:n.redirect||t.redirect||"follow",headers:f,parsedURL:a,signal:m,referrer:d},this.follow=n.follow===void 0?t.follow===void 0?20:t.follow:n.follow,this.compress=n.compress===void 0?t.compress===void 0?!0:t.compress:n.compress,this.counter=n.counter||t.counter||0,this.agent=n.agent||t.agent,this.highWaterMark=n.highWaterMark||t.highWaterMark||16384,this.insecureHTTPParser=n.insecureHTTPParser||t.insecureHTTPParser||!1,this.referrerPolicy=n.referrerPolicy||t.referrerPolicy||""}get method(){return this[ee].method}get url(){return(0,Fu.format)(this[ee].parsedURL)}get headers(){return this[ee].headers}get redirect(){return this[ee].redirect}get signal(){return this[ee].signal}get referrer(){if(this[ee].referrer==="no-referrer")return"";if(this[ee].referrer==="client")return"about:client";if(this[ee].referrer)return this[ee].referrer.toString()}get referrerPolicy(){return this[ee].referrerPolicy}set referrerPolicy(t){this[ee].referrerPolicy=qu(t)}clone(){return new e(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Lt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var Du=e=>{let{parsedURL:t}=e[ee],n=new pe(e[ee].headers);n.has("Accept")||n.set("Accept","*/*");let a=null;if(e.body===null&&/^(post|put)$/i.test(e.method)&&(a="0"),e.body!==null){let m=Au(e);typeof m=="number"&&!Number.isNaN(m)&&(a=String(m))}a&&n.set("Content-Length",a),e.referrerPolicy===""&&(e.referrerPolicy=Bu),e.referrer&&e.referrer!=="no-referrer"?e[ee].referrer=$u(e):e[ee].referrer="no-referrer",e[ee].referrer instanceof URL&&n.set("Referer",e.referrer),n.has("User-Agent")||n.set("User-Agent","node-fetch"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip, deflate, br");let{agent:o}=e;typeof o=="function"&&(o=o(t));let l=xu(t),f={path:t.pathname+l,method:e.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:e.insecureHTTPParser,agent:o};return{parsedURL:t,options:f}};var Mn=class extends Ke{constructor(t,n="aborted"){super(t,n)}};qn();la();var mp=new Set(["data:","http:","https:"]);async function zn(e,t){return new Promise((n,a)=>{let o=new Lt(e,t),{parsedURL:l,options:f}=Du(o);if(!mp.has(l.protocol))throw new TypeError(`node-fetch cannot load ${e}. URL scheme "${l.protocol.replace(/:$/,"")}" is not supported.`);if(l.protocol==="data:"){let S=su(o.url),D=new ve(S,{headers:{"Content-Type":S.typeFull}});n(D);return}let m=(l.protocol==="https:"?Wu.default:Nu.default).request,{signal:d}=o,b=null,w=()=>{let S=new Mn("The operation was aborted.");a(S),o.body&&o.body instanceof ge.default.Readable&&o.body.destroy(S),!(!b||!b.body)&&b.body.emit("error",S)};if(d&&d.aborted){w();return}let P=()=>{w(),V()},I=m(l.toString(),f);d&&d.addEventListener("abort",P);let V=()=>{I.abort(),d&&d.removeEventListener("abort",P)};I.on("error",S=>{a(new ue(`request to ${o.url} failed, reason: ${S.message}`,"system",S)),V()}),bp(I,S=>{b&&b.body&&b.body.destroy(S)}),process.version<"v14"&&I.on("socket",S=>{let D;S.prependListener("end",()=>{D=S._eventsCount}),S.prependListener("close",O=>{if(b&&D<S._eventsCount&&!O){let F=new Error("Premature close");F.code="ERR_STREAM_PREMATURE_CLOSE",b.body.emit("error",F)}})}),I.on("response",S=>{I.setTimeout(0);let D=Cu(S.rawHeaders);if(Wn(S.statusCode)){let N=D.get("Location"),W=null;try{W=N===null?null:new URL(N,o.url)}catch{if(o.redirect!=="manual"){a(new ue(`uri requested responds with an invalid redirect URL: ${N}`,"invalid-redirect")),V();return}}switch(o.redirect){case"error":a(new ue(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),V();return;case"manual":break;case"follow":{if(W===null)break;if(o.counter>=o.follow){a(new ue(`maximum redirect reached at: ${o.url}`,"max-redirect")),V();return}let Y={headers:new pe(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:nr(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!wu(o.url,W)||!Eu(o.url,W))for(let ar of["authorization","www-authenticate","cookie","cookie2"])Y.headers.delete(ar);if(S.statusCode!==303&&o.body&&t.body instanceof ge.default.Readable){a(new ue("Cannot follow redirect with body being a readable stream","unsupported-redirect")),V();return}(S.statusCode===303||(S.statusCode===301||S.statusCode===302)&&o.method==="POST")&&(Y.method="GET",Y.body=void 0,Y.headers.delete("content-length"));let et=Ou(D);et&&(Y.referrerPolicy=et),n(zn(new Lt(W,Y))),V();return}default:return a(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}d&&S.once("end",()=>{d.removeEventListener("abort",P)});let O=(0,ge.pipeline)(S,new ge.PassThrough,N=>{N&&a(N)});process.version<"v12.10"&&S.on("aborted",P);let F={url:o.url,status:S.statusCode,statusText:S.statusMessage,headers:D,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},z=D.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||z===null||S.statusCode===204||S.statusCode===304){b=new ve(O,F),n(b);return}let te={flush:Bt.default.Z_SYNC_FLUSH,finishFlush:Bt.default.Z_SYNC_FLUSH};if(z==="gzip"||z==="x-gzip"){O=(0,ge.pipeline)(O,Bt.default.createGunzip(te),N=>{N&&a(N)}),b=new ve(O,F),n(b);return}if(z==="deflate"||z==="x-deflate"){let N=(0,ge.pipeline)(S,new ge.PassThrough,W=>{W&&a(W)});N.once("data",W=>{(W[0]&15)===8?O=(0,ge.pipeline)(O,Bt.default.createInflate(),Y=>{Y&&a(Y)}):O=(0,ge.pipeline)(O,Bt.default.createInflateRaw(),Y=>{Y&&a(Y)}),b=new ve(O,F),n(b)}),N.once("end",()=>{b||(b=new ve(O,F),n(b))});return}if(z==="br"){O=(0,ge.pipeline)(O,Bt.default.createBrotliDecompress(),N=>{N&&a(N)}),b=new ve(O,F),n(b);return}b=new ve(O,F),n(b)}),Tu(I,o).catch(a)})}function bp(e,t){let n=Br.Buffer.from(`0\r
14
14
  \r
15
- `),a=!1,o=!1,l;e.on("response",f=>{let{headers:m}=f;a=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),e.on("socket",f=>{let m=()=>{if(a&&!o){let b=new Error("Premature close");b.code="ERR_STREAM_PREMATURE_CLOSE",t(b)}},d=b=>{o=Br.Buffer.compare(b.slice(-5),n)===0,!o&&l&&(o=Br.Buffer.compare(l.slice(-3),n.slice(0,3))===0&&Br.Buffer.compare(b.slice(-2),n.slice(3))===0),l=b};f.prependListener("close",m),f.on("data",d),e.on("close",()=>{f.removeListener("close",m),f.removeListener("data",d)})})}var Hn=["jpg","gif","png"],pp=async(e,t)=>{var b,w,P;let n=(0,Un.default)(e),a=await n.metadata(),o=(b=a.width)!=null?b:100,l=(w=a.height)!=null?w:100,f=e.split(";")[0].split("/")[1];if(Hn.includes(f))return{type:f,data:e,transformation:{width:o,height:l}};let m=(P=t==null?void 0:t.fallbackImageType)!=null?P:"png",d={data:await n.toFormat(m).toBuffer(),type:m,transformation:{width:o,height:l}};return e.includes("svg")?{...d,type:"svg",data:e,fallback:{type:m,data:d.data}}:d},gp=async(e,t)=>{var f,m,d,b,w,P,I,V;let n,a,o;if(e.startsWith("http")){let S=await zn(e),D=await S.arrayBuffer(),F=((m=(f=S.headers.get("content-type"))==null?void 0:f.split(";")[0])!=null?m:"image/png").split("/")[1];n=(0,Un.default)(D);let z=await n.metadata();if(a=(d=z.width)!=null?d:100,o=(b=z.height)!=null?b:100,Hn.includes(F))return{type:F,data:D,transformation:{width:a,height:o}}}else{let S=(w=t==null?void 0:t.pathPrefix)!=null?w:"";n=(0,Un.default)(S+e);let D=await n.metadata();a=(P=D.width)!=null?P:100,o=(I=D.height)!=null?I:100;let O=e.split(".").pop();if(Hn.includes(O))return{type:O,data:await n.toBuffer(),transformation:{width:a,height:o}}}let l=(V=t==null?void 0:t.fallbackImageType)!=null?V:"png";return{data:await n.toFormat(l).toBuffer(),type:l,transformation:{width:a,height:o}}},yp=async(e,t)=>{try{return e.startsWith("data:")?await pp(e,t):await gp(e,t)}catch(n){return console.error(`Error resolving image: ${e}`,n),{type:"png",data:Buffer.from([]),transformation:{width:100,height:100}}}},wp=e=>({inline:async(t,n,a,o)=>{var l,f,m;if(/^image/.test(n.type)){let d=(f=n.url)!=null?f:o[(l=n.identifier)==null?void 0:l.toUpperCase()],b=(m=n.alt)!=null?m:d==null?void 0:d.split("/").pop();return n.type="",[new t.ImageRun({...await yp(d,e),altText:{description:b,name:b,title:b}})]}return[]}});0&&(module.exports={SUPPORTED_IMAGE_TYPES,nodeImagePlugin});
15
+ `),a=!1,o=!1,l;e.on("response",f=>{let{headers:m}=f;a=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),e.on("socket",f=>{let m=()=>{if(a&&!o){let b=new Error("Premature close");b.code="ERR_STREAM_PREMATURE_CLOSE",t(b)}},d=b=>{o=Br.Buffer.compare(b.slice(-5),n)===0,!o&&l&&(o=Br.Buffer.compare(l.slice(-3),n.slice(0,3))===0&&Br.Buffer.compare(b.slice(-2),n.slice(3))===0),l=b};f.prependListener("close",m),f.on("data",d),e.on("close",()=>{f.removeListener("close",m),f.removeListener("data",d)})})}var Hn=["jpg","gif","png"],pp=async(e,t)=>{var b,w,P;let n=(0,Un.default)(e),a=await n.metadata(),o=(b=a.width)!=null?b:100,l=(w=a.height)!=null?w:100,f=e.split(";")[0].split("/")[1];if(Hn.includes(f))return{type:f,data:e,transformation:{width:o,height:l}};let m=(P=t==null?void 0:t.fallbackImageType)!=null?P:"png",d={data:await n.toFormat(m).toBuffer(),type:m,transformation:{width:o,height:l}};return e.includes("svg")?{...d,type:"svg",data:e,fallback:{type:m,data:d.data}}:d},gp=async(e,t)=>{var f,m,d,b,w,P,I,V;let n,a,o;if(e.startsWith("http")){let S=await zn(e),D=await S.arrayBuffer(),F=((m=(f=S.headers.get("content-type"))==null?void 0:f.split(";")[0])!=null?m:"image/png").split("/")[1];n=(0,Un.default)(D);let z=await n.metadata();if(a=(d=z.width)!=null?d:100,o=(b=z.height)!=null?b:100,Hn.includes(F))return{type:F,data:D,transformation:{width:a,height:o}}}else{let S=(w=t==null?void 0:t.pathPrefix)!=null?w:"";n=(0,Un.default)(S+e);let D=await n.metadata();a=(P=D.width)!=null?P:100,o=(I=D.height)!=null?I:100;let O=e.split(".").pop();if(Hn.includes(O))return{type:O,data:await n.toBuffer(),transformation:{width:a,height:o}}}let l=(V=t==null?void 0:t.fallbackImageType)!=null?V:"png";return{data:await n.toFormat(l).toBuffer(),type:l,transformation:{width:a,height:o}}},yp=async(e,t)=>{try{return e.startsWith("data:")?await pp(e,t):await gp(e,t)}catch(n){return console.error(`Error resolving image: ${e}`,n),{type:"png",data:Buffer.from([]),transformation:{width:100,height:100}}}},wp=e=>({inline:async(t,n,a,o)=>{var l,f,m,d;if(/^image/.test(n.type)){let b=(f=n.url)!=null?f:o[(l=n.identifier)==null?void 0:l.toUpperCase()],w=(m=n.alt)!=null?m:b==null?void 0:b.split("/").pop();return n.type="",[new t.ImageRun({...await((d=e==null?void 0:e.imageResolver)!=null?d:yp)(b,e),altText:{description:w,name:w,title:w}})]}return[]}});0&&(module.exports={SUPPORTED_IMAGE_TYPES,nodeImagePlugin});
16
16
  /*! Bundled license information:
17
17
 
18
18
  web-streams-polyfill/dist/ponyfill.es2018.js:
@@ -0,0 +1 @@
1
+ import{a,b}from"../../chunk-35E6UZDH.mjs";import"../../chunk-JOIHCSIR.mjs";import"../../chunk-Z2MODMIK.mjs";import"../../chunk-I5QUWH2X.mjs";export{a as SUPPORTED_IMAGE_TYPES,b as nodeImagePlugin};
@@ -1 +1 @@
1
- import{a,b}from"../chunk-Q6Q2NBIZ.mjs";import"../chunk-3ZZBJC3M.mjs";export{a as defaultTableOptions,b as tablePlugin};
1
+ import{a,b}from"../chunk-Q6Q2NBIZ.mjs";import"../chunk-I5QUWH2X.mjs";export{a as defaultTableOptions,b as tablePlugin};
package/dist/section.d.ts CHANGED
@@ -1,12 +1,7 @@
1
1
  import type { Root } from "mdast";
2
- import type { Definitions, FootnoteDefinitions, IMdastToDocxSectionProps } from "./utils";
2
+ import type { Definitions, FootnoteDefinitions, ISectionProps } from "./utils";
3
3
  import { Paragraph } from "docx";
4
- import type { ISectionOptions } from "docx";
5
4
  import * as docx from "docx";
6
- /**
7
- * Defines properties for a document section, omitting the "children" property from ISectionOptions.
8
- */
9
- export type ISectionProps = Omit<ISectionOptions, "children"> & IMdastToDocxSectionProps;
10
5
  /**
11
6
  * Converts an MDAST tree to a DOCX document section.
12
7
  * @param node - The root MDAST node
package/dist/section.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var O=Object.create;var y=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var v=(e,n)=>{for(var l in n)y(e,l,{get:n[l],enumerable:!0})},T=(e,n,l,P)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of N(n))!B.call(e,s)&&s!==l&&y(e,s,{get:()=>n[s],enumerable:!(P=M(n,s))||P.enumerable});return e};var E=(e,n,l)=>(l=e!=null?O(S(e)):{},T(n||!e||!e.__esModule?y(l,"default",{value:e,enumerable:!0}):l,e)),F=e=>T(y({},"__esModule",{value:!0}),e);var K={};v(K,{toSection:()=>j});module.exports=F(K);var k=require("docx");var I=e=>{var n,l;return(n=e.children)!=null&&n.length?e.children.map(I).join(""):(l=e.value)!=null?l:""};var g={useTitle:!0,plugins:[]};var R=E(require("docx")),H=(e,n,l)=>{let P=async(a,f)=>{var t,u,c;let r=Object.assign({},f),p=(await Promise.all(l.map(i=>{var h,x;return(x=(h=i.inline)==null?void 0:h.call(i,R,a,r,e,n,s))!=null?x:[]}))).flat(),d=(u=a.url)!=null?u:e[(t=a.identifier)==null?void 0:t.toUpperCase()];switch(a.type){case"text":return[...p,new k.TextRun({text:a.value,...r})];case"break":return[...p,new k.TextRun({break:1})];case"inlineCode":return[...p,new k.TextRun({text:a.value,...r,style:"code",font:{name:"Consolas"}})];case"emphasis":return r.italics=!0,[...p,...await s(a,r)];case"strong":return r.bold=!0,[...p,...await s(a,r)];case"delete":return r.strike=!0,[...p,...await s(a,r)];case"link":case"linkReference":return[...p,d.startsWith("#")?new k.InternalHyperlink({anchor:d.slice(1),children:await s(a,r)}):new k.ExternalHyperlink({link:d,children:await s(a,r)})];case"footnoteReference":return[...p,new k.FootnoteReferenceRun((c=n[a.identifier].id)!=null?c:0)];default:return[...p]}},s=async(a,f=new Set)=>{var r;return(await Promise.all((r=a.children)==null?void 0:r.map(p=>P(p,f)))).flat()};return s},j=async(e,n,l,P)=>{let{plugins:s,useTitle:a,...f}={...g,...P},r=H(n,l,s),p=async(t,u)=>{var h,x,b,C;let c=Object.assign({},u),i=(await Promise.all(s.map(m=>{var w,D;return(D=(w=m.block)==null?void 0:w.call(m,R,t,c,d,r))!=null?D:[]}))).flat();switch(t.type){case"paragraph":return[...i,new k.Paragraph({...u,children:await r(t)})];case"heading":return[new k.Paragraph({...i,heading:a?t.depth===1?"Title":`Heading${t.depth-1}`:`Heading${t.depth}`,children:[new k.Bookmark({id:I(t).replace(/[. ]+/g,"-").toLowerCase(),children:await r(t)})]})];case"code":return[...i,new k.Paragraph({alignment:"start",style:"blockCode",children:t.value.split(`
2
- `).map(m=>new k.TextRun({text:m,break:1,style:"code",font:{name:"Consolas"}}))})];case"list":return t.ordered?(c.bullet={level:((x=(h=c.bullet)==null?void 0:h.level)!=null?x:-1)+1},console.warn("Please add numbering plugin to support ordered lists. For now, we use only bullets for both the ordered and the unordered list.")):c.bullet={level:((C=(b=c.bullet)==null?void 0:b.level)!=null?C:-1)+1},[...i,...await d(t,c)];case"blockquote":return[...i,...await d(t,c)];case"listItem":return[...i,...await d(t,c)];case"thematicBreak":return[...i,new k.Paragraph({border:{top:{style:k.BorderStyle.SINGLE,size:6}}})];case"definition":case"footnoteDefinition":return i;case"table":return console.warn("Please add table plugin to support tables."),i;case"":return i;case"yaml":case"html":default:return console.warn(`May be an unsupported node type: ${t.type}`,t),i}},d=async(t,u)=>{var c;return(await Promise.all((c=t.children)==null?void 0:c.map(i=>p(i,u)))).flat()};return{...f,children:await d(e,{})}};0&&(module.exports={toSection});
1
+ "use strict";var O=Object.create;var m=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var v=(e,o)=>{for(var l in o)m(e,l,{get:o[l],enumerable:!0})},D=(e,o,l,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of N(o))!B.call(e,a)&&a!==l&&m(e,a,{get:()=>o[a],enumerable:!(f=M(o,a))||f.enumerable});return e};var E=(e,o,l)=>(l=e!=null?O(S(e)):{},D(o||!e||!e.__esModule?m(l,"default",{value:e,enumerable:!0}):l,e)),F=e=>D(m({},"__esModule",{value:!0}),e);var j={};v(j,{toSection:()=>X});module.exports=F(j);var R=require("docx");var y=e=>{var o,l;return(o=e.children)!=null&&o.length?e.children.map(y).join(""):(l=e.value)!=null?l:""};var k={useTitle:!0,plugins:[]};var T=E(require("docx")),H=(e,o,l)=>{let f=async(i,h)=>{var t,u,p;let s=Object.assign({},h),c=(await Promise.all(l.map(r=>{var P,x;return(x=(P=r.inline)==null?void 0:P.call(r,T,i,h,e,o,a))!=null?x:[]}))).flat(),d=(u=i.url)!=null?u:e[(t=i.identifier)==null?void 0:t.toUpperCase()];switch(i.type){case"text":return[...c,new R.TextRun({text:i.value,...s})];case"break":return[...c,new R.TextRun({break:1})];case"inlineCode":return[...c,new R.TextRun({text:i.value,...s,style:"code",font:{name:"Consolas"}})];case"emphasis":return s.italics=!0,[...c,...await a(i,s)];case"strong":return s.bold=!0,[...c,...await a(i,s)];case"delete":return s.strike=!0,[...c,...await a(i,s)];case"link":case"linkReference":return[...c,d.startsWith("#")?new R.InternalHyperlink({anchor:d.slice(1),children:await a(i,s)}):new R.ExternalHyperlink({link:d,children:await a(i,s)})];case"footnoteReference":return[...c,new R.FootnoteReferenceRun((p=o[i.identifier].id)!=null?p:0)];case"":return[...c];default:return console.warn(`Unsupported inline node type: ${i.type}`),[...c]}},a=async(i,h={})=>{var s,c;return(await Promise.all((c=(s=i.children)==null?void 0:s.map(d=>f(d,h)))!=null?c:[])).flat()};return a},X=async(e,o,l,f)=>{let{plugins:a,useTitle:i,...h}={...k,...f},s=H(o,l,a),c=async(t,u)=>{var P,x,b,C;let p=Object.assign({},u),r=(await Promise.all(a.map(g=>{var I,w;return(w=(I=g.block)==null?void 0:I.call(g,T,t,p,d,s))!=null?w:[]}))).flat();switch(t.type){case"root":return[...r,...await d(t,p)];case"paragraph":return[...r,new R.Paragraph({...u,children:await s(t)})];case"heading":return[new R.Paragraph({...r,heading:i?t.depth===1?"Title":`Heading${t.depth-1}`:`Heading${t.depth}`,children:[new R.Bookmark({id:y(t).replace(/[. ]+/g,"-").toLowerCase(),children:await s(t)})]})];case"code":return[...r,new R.Paragraph({alignment:"start",style:"blockCode",children:t.value.split(`
2
+ `).map(g=>new R.TextRun({text:g,break:1,style:"code",font:{name:"Consolas"}}))})];case"list":return t.ordered?(p.bullet={level:((x=(P=p.bullet)==null?void 0:P.level)!=null?x:-1)+1},console.warn("Please add numbering plugin to support ordered lists. For now, we use only bullets for both the ordered and the unordered list.")):p.bullet={level:((C=(b=p.bullet)==null?void 0:b.level)!=null?C:-1)+1},[...r,...await d(t,p)];case"blockquote":return[...r,...await d(t,p)];case"listItem":return[...r,...await d(t,p)];case"thematicBreak":return[...r,new R.Paragraph({border:{top:{style:R.BorderStyle.SINGLE,size:6}}})];case"definition":case"footnoteDefinition":return r;case"table":return console.warn("Please add table plugin to support tables."),r;case"":return r;case"yaml":case"html":default:return console.warn(`May be an unsupported node type: ${t.type}`,t),r}},d=async(t,u)=>{var p;return(await Promise.all((p=t.children)==null?void 0:p.map(r=>c(r,u)))).flat()};return{...h,children:await d(e,{})}};0&&(module.exports={toSection});
package/dist/section.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-AHXJDPOO.mjs";import"./chunk-IBVI6OKS.mjs";import"./chunk-3ZZBJC3M.mjs";export{a as toSection};
1
+ import{a}from"./chunk-ECHPYCZC.mjs";import"./chunk-MSGIMOZN.mjs";import"./chunk-I5QUWH2X.mjs";export{a as toSection};
package/dist/utils.d.ts CHANGED
@@ -32,7 +32,7 @@ type ExtendedRootContent<T extends {
32
32
  type: string;
33
33
  } = {
34
34
  type: "";
35
- }> = RootContent | T;
35
+ }> = RootContent | Root | T;
36
36
  /**
37
37
  * Extracts the textual content from a given MDAST node.
38
38
  * Recursively processes child nodes if present.
@@ -49,7 +49,7 @@ export declare const uuid: () => string;
49
49
  /**
50
50
  * Default configuration for converting MDAST to DOCX, including title handling and plugin extensions.
51
51
  */
52
- interface IDefaultMdastToDocxSectionProps {
52
+ interface IDefaultMdastToDocxSectionProps extends Omit<DOCX.ISectionOptions, "children"> {
53
53
  /**
54
54
  * If true, H1 corresponds to the title, H2 to Heading1, etc.
55
55
  * @default true
@@ -61,19 +61,20 @@ interface IDefaultMdastToDocxSectionProps {
61
61
  plugins: Array<IPlugin>;
62
62
  }
63
63
  /**
64
- * Interface defining properties for MDAST to DOCX conversion.
64
+ * Defines properties for a document section, omitting the "children" property from ISectionOptions.
65
+ * Also defining properties for MDAST to DOCX conversion
65
66
  */
66
- export type IMdastToDocxSectionProps = Optional<IDefaultMdastToDocxSectionProps>;
67
- export declare const defaultProps: IDefaultMdastToDocxSectionProps;
67
+ export type ISectionProps = Optional<IDefaultMdastToDocxSectionProps>;
68
+ export declare const defaultSectionProps: IDefaultMdastToDocxSectionProps;
68
69
  /**
69
70
  * Defines document properties, excluding sections and footnotes (which are managed internally).
70
71
  */
71
72
  export type IDocxProps = Omit<Mutable<IPropertiesOptions>, "sections" | "footnotes">;
73
+ export declare const defaultDocxProps: IDocxProps;
72
74
  /**
73
75
  * Mutable version of IRunOptions where all properties are writable.
74
76
  */
75
77
  export type MutableRunOptions = Mutable<Omit<IRunOptions, "children">>;
76
- export type InlineParentType = "strong" | "emphasis" | "delete" | "link";
77
78
  export type InlineDocxNodes = TextRun | ImageRun | InternalHyperlink | ExternalHyperlink | DOCXMath;
78
79
  export type InlineProcessor = (node: ExtendedRootContent, runProps: MutableRunOptions) => Promise<InlineDocxNodes[]>;
79
80
  export type InlineChildrenProcessor = (node: Parent, runProps?: MutableRunOptions) => Promise<InlineDocxNodes[]>;
@@ -98,12 +99,14 @@ export interface IPlugin<T extends {
98
99
  /**
99
100
  * Processes inline-level nodes.
100
101
  */
101
- inline?: (docx: typeof DOCX, node: ExtendedRootContent<T>, parentSet: MutableRunOptions, definitions: Definitions, footnoteDefinitions: FootnoteDefinitions, inlineChildrenProcessor: InlineChildrenProcessor) => Promise<InlineDocxNodes[]>;
102
+ inline?: (docx: typeof DOCX, node: ExtendedRootContent<T>, runProps: MutableRunOptions, definitions: Definitions, footnoteDefinitions: FootnoteDefinitions, inlineChildrenProcessor: InlineChildrenProcessor) => Promise<InlineDocxNodes[]>;
102
103
  /**
103
104
  * Allows plugins to modify document-level DOCX properties, such as styles, numbering, headers, and footers. This is useful for global formatting customizations.
104
105
  */
105
106
  root?: (props: IDocxProps) => void;
106
107
  }
108
+ export declare const inlineMdastNodes: string[];
109
+ export declare const standardize_color: (str: string) => string;
107
110
  /**
108
111
  * @mayank/docx is a fork of the `docx` library with minor modifications,
109
112
  * primarily adding exports for additional types missing from the original `docx` library.
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- "use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var n in e)s(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!d.call(t,r)&&r!==n&&s(t,r,{get:()=>e[r],enumerable:!(o=l(e,r))||o.enumerable});return t};var u=t=>x(s({},"__esModule",{value:!0}),t);var y={};P(y,{convertInchesToTwip:()=>i.convertInchesToTwip,convertMillimetersToTwip:()=>i.convertMillimetersToTwip,defaultProps:()=>h,getDefinitions:()=>p,getTextContent:()=>a,uuid:()=>f});module.exports=u(y);var i=require("docx"),p=t=>{let e={},n={};return t.forEach(o=>{var r;o.type==="definition"?e[o.identifier.toUpperCase()]=o.url:o.type==="footnoteDefinition"?n[o.identifier.toUpperCase()]={children:o.children}:(r=o.children)!=null&&r.length&&Object.assign(e,p(o.children))}),{definitions:e,footnoteDefinitions:n}},a=t=>{var e,n;return(e=t.children)!=null&&e.length?t.children.map(a).join(""):(n=t.value)!=null?n:""},f=()=>Math.random().toString(16).slice(2),h={useTitle:!0,plugins:[]};0&&(module.exports={convertInchesToTwip,convertMillimetersToTwip,defaultProps,getDefinitions,getTextContent,uuid});
1
+ "use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},u=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!d.call(t,r)&&r!==n&&a(t,r,{get:()=>e[r],enumerable:!(o=l(e,r))||o.enumerable});return t};var x=t=>u(a({},"__esModule",{value:!0}),t);var b={};f(b,{convertInchesToTwip:()=>i.convertInchesToTwip,convertMillimetersToTwip:()=>i.convertMillimetersToTwip,defaultDocxProps:()=>h,defaultSectionProps:()=>g,getDefinitions:()=>s,getTextContent:()=>p,inlineMdastNodes:()=>y,standardize_color:()=>D,uuid:()=>P});module.exports=x(b);var i=require("docx"),s=t=>{let e={},n={};return t.forEach(o=>{var r;o.type==="definition"?e[o.identifier.toUpperCase()]=o.url:o.type==="footnoteDefinition"?n[o.identifier.toUpperCase()]={children:o.children}:(r=o.children)!=null&&r.length&&Object.assign(e,s(o.children))}),{definitions:e,footnoteDefinitions:n}},p=t=>{var e,n;return(e=t.children)!=null&&e.length?t.children.map(p).join(""):(n=t.value)!=null?n:""},P=()=>Math.random().toString(16).slice(2),g={useTitle:!0,plugins:[]},h={styles:{default:{document:{paragraph:{spacing:{before:175,line:300},alignment:"thaiDistribute"},run:{size:24}},heading1:{paragraph:{spacing:{before:350}}},heading2:{paragraph:{spacing:{before:350}}},heading3:{paragraph:{spacing:{before:350}}},heading4:{paragraph:{spacing:{before:350}}},heading5:{paragraph:{spacing:{before:350}}},heading6:{paragraph:{spacing:{before:350}}}}}},y=["text","break","inlineCode","image","emphasis","strong","delete","link","linkReference","footnoteReference"],D=t=>{let e=document.createElement("canvas").getContext("2d");return e?(e.fillStyle=t,e.fillStyle):t.startsWith("#")?t:"auto"};0&&(module.exports={convertInchesToTwip,convertMillimetersToTwip,defaultDocxProps,defaultSectionProps,getDefinitions,getTextContent,inlineMdastNodes,standardize_color,uuid});
package/dist/utils.mjs CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"./chunk-IBVI6OKS.mjs";import"./chunk-3ZZBJC3M.mjs";export{e as convertInchesToTwip,f as convertMillimetersToTwip,d as defaultProps,a as getDefinitions,b as getTextContent,c as uuid};
1
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-MSGIMOZN.mjs";import"./chunk-I5QUWH2X.mjs";export{h as convertInchesToTwip,i as convertMillimetersToTwip,e as defaultDocxProps,d as defaultSectionProps,a as getDefinitions,b as getTextContent,f as inlineMdastNodes,g as standardize_color,c as uuid};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mdast2docx",
3
3
  "author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
4
4
  "private": false,
5
- "version": "0.1.1",
5
+ "version": "0.2.0",
6
6
  "description": "Convert Markdown Abstract Syntax Tree (MDAST) to DOCX seamlessly. Supports footnotes, images, links, and customizable document properties.",
7
7
  "license": "MPL-2.0",
8
8
  "main": "./dist/index.js",
@@ -34,6 +34,8 @@
34
34
  "@unified-latex/unified-latex-util-parse": "^1.8.2",
35
35
  "@vitest/coverage-v8": "^3.0.8",
36
36
  "esbuild-plugin-rdi": "^0.0.0",
37
+ "hast-util-from-html": "^2.0.3",
38
+ "hast-util-to-mdast": "^10.1.2",
37
39
  "jsdom": "^26.0.0",
38
40
  "node-fetch": "^3.3.2",
39
41
  "remark-gfm": "^4.0.1",
@@ -1 +0,0 @@
1
- var i=Object.create;var f=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var g=a=>{throw TypeError(a)};var o=(a=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(a,{get:(b,c)=>(typeof require!="undefined"?require:b)[c]}):a)(function(a){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var p=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var n=(a,b,c,d)=>{if(b&&typeof b=="object"||typeof b=="function")for(let e of k(b))!m.call(a,e)&&e!==c&&f(a,e,{get:()=>b[e],enumerable:!(d=j(b,e))||d.enumerable});return a};var q=(a,b,c)=>(c=a!=null?i(l(a)):{},n(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a));var h=(a,b,c)=>b.has(a)||g("Cannot "+c);var r=(a,b,c)=>(h(a,b,"read from private field"),c?c.call(a):b.get(a)),s=(a,b,c)=>b.has(a)?g("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),t=(a,b,c,d)=>(h(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c);export{o as a,p as b,q as c,r as d,s as e,t as f};
@@ -1,2 +0,0 @@
1
- import{b as C,d as N}from"./chunk-IBVI6OKS.mjs";import{Bookmark as D,BorderStyle as S,ExternalHyperlink as B,FootnoteReferenceRun as R,InternalHyperlink as v,Paragraph as m,TextRun as f}from"docx";import*as g from"docx";var T=(w,h,P)=>{let y=async(o,c)=>{var e,l,n;let t=Object.assign({},c),s=(await Promise.all(P.map(r=>{var d,p;return(p=(d=r.inline)==null?void 0:d.call(r,g,o,t,w,h,a))!=null?p:[]}))).flat(),i=(l=o.url)!=null?l:w[(e=o.identifier)==null?void 0:e.toUpperCase()];switch(o.type){case"text":return[...s,new f({text:o.value,...t})];case"break":return[...s,new f({break:1})];case"inlineCode":return[...s,new f({text:o.value,...t,style:"code",font:{name:"Consolas"}})];case"emphasis":return t.italics=!0,[...s,...await a(o,t)];case"strong":return t.bold=!0,[...s,...await a(o,t)];case"delete":return t.strike=!0,[...s,...await a(o,t)];case"link":case"linkReference":return[...s,i.startsWith("#")?new v({anchor:i.slice(1),children:await a(o,t)}):new B({link:i,children:await a(o,t)})];case"footnoteReference":return[...s,new R((n=h[o.identifier].id)!=null?n:0)];default:return[...s]}},a=async(o,c=new Set)=>{var t;return(await Promise.all((t=o.children)==null?void 0:t.map(s=>y(s,c)))).flat()};return a},H=async(w,h,P,y)=>{let{plugins:a,useTitle:o,...c}={...N,...y},t=T(h,P,a),s=async(e,l)=>{var d,p,b,k;let n=Object.assign({},l),r=(await Promise.all(a.map(u=>{var I,x;return(x=(I=u.block)==null?void 0:I.call(u,g,e,n,i,t))!=null?x:[]}))).flat();switch(e.type){case"paragraph":return[...r,new m({...l,children:await t(e)})];case"heading":return[new m({...r,heading:o?e.depth===1?"Title":`Heading${e.depth-1}`:`Heading${e.depth}`,children:[new D({id:C(e).replace(/[. ]+/g,"-").toLowerCase(),children:await t(e)})]})];case"code":return[...r,new m({alignment:"start",style:"blockCode",children:e.value.split(`
2
- `).map(u=>new f({text:u,break:1,style:"code",font:{name:"Consolas"}}))})];case"list":return e.ordered?(n.bullet={level:((p=(d=n.bullet)==null?void 0:d.level)!=null?p:-1)+1},console.warn("Please add numbering plugin to support ordered lists. For now, we use only bullets for both the ordered and the unordered list.")):n.bullet={level:((k=(b=n.bullet)==null?void 0:b.level)!=null?k:-1)+1},[...r,...await i(e,n)];case"blockquote":return[...r,...await i(e,n)];case"listItem":return[...r,...await i(e,n)];case"thematicBreak":return[...r,new m({border:{top:{style:S.SINGLE,size:6}}})];case"definition":case"footnoteDefinition":return r;case"table":return console.warn("Please add table plugin to support tables."),r;case"":return r;case"yaml":case"html":default:return console.warn(`May be an unsupported node type: ${e.type}`,e),r}},i=async(e,l)=>{var n;return(await Promise.all((n=e.children)==null?void 0:n.map(r=>s(r,l)))).flat()};return{...c,children:await i(w,{})}};export{H as a};
@@ -1 +0,0 @@
1
- import{convertInchesToTwip as d,convertMillimetersToTwip as P}from"docx";var i=o=>{let t={},n={};return o.forEach(e=>{var r;e.type==="definition"?t[e.identifier.toUpperCase()]=e.url:e.type==="footnoteDefinition"?n[e.identifier.toUpperCase()]={children:e.children}:(r=e.children)!=null&&r.length&&Object.assign(t,i(e.children))}),{definitions:t,footnoteDefinitions:n}},s=o=>{var t,n;return(t=o.children)!=null&&t.length?o.children.map(s).join(""):(n=o.value)!=null?n:""},p=()=>Math.random().toString(16).slice(2),a={useTitle:!0,plugins:[]};export{i as a,s as b,p as c,a as d,d as e,P as f};
@@ -1 +0,0 @@
1
- var u=["jpeg","jpg","bmp","gif","png"],f=t=>{let a=new Uint8Array(t).slice(0,4);if(a[0]===66&&a[1]===77)return"bmp";switch(a.reduce((n,i)=>n+i.toString(16).padStart(2,"0"),"")){case"89504E47":return"png";case"47494638":return"gif";case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":case"FFD8FFE8":return"jpg"}},d=3,p=async(t,a)=>{var l,h;let e=(l=a==null?void 0:a.scale)!=null?l:d,n=document.createElement("canvas"),i=n.getContext("2d");if(!i)throw new Error("Canvas context not available");let r=new Image;r.src=t,await new Promise(I=>r.onload=I);let s=r.width*e,g=r.height*e;n.width=s,n.height=g,i.drawImage(r,0,0,s,g);let o=t.split(";")[0].split("/")[1];if(u.includes(o))return{data:t,type:o,transformation:{width:s/e,height:g/e}};let c=(h=a==null?void 0:a.fallbackImageType)!=null?h:"png",m={data:n.toDataURL(`image/${c}`),type:c,transformation:{width:s/e,height:g/e}};return t.includes("svg")?{...m,type:"svg",data:t,fallback:{type:c,data:m.data}}:m},y=async(t,a)=>{var s;let e=await fetch(t.startsWith("http")?t:`${window.location.origin}/${t.replace(/^\/+/,"")}`);if(/(svg|xml)/.test((s=e.headers.get("content-type"))!=null?s:"")||t.endsWith(".svg")){let g=await e.text();return p(`data:image/svg+xml;base64,${btoa(g)}`,a)}let n=await e.arrayBuffer(),i=f(n)||"png",r=await createImageBitmap(new Blob([n],{type:i}));return u.includes(i)?{type:i,data:n,transformation:{width:r.width,height:r.height}}:(console.warn(`${i} not supported by docx. Using one of the supported mime types.`),p(t,a))},w=async(t,a)=>{try{return t.startsWith("data:")?await p(t,a):await y(t,a)}catch(e){return console.error(`Error resolving image: ${t}`,e),{type:"png",data:Buffer.from([]),transformation:{width:100,height:100}}}},F=t=>({inline:async(a,e,n,i)=>{var r,s,g;if(/^image/.test(e.type)){let o=(s=e.url)!=null?s:i[(r=e.identifier)==null?void 0:r.toUpperCase()],c=(g=e.alt)!=null?g:o==null?void 0:o.split("/").pop();return e.type="",[new a.ImageRun({...await w(o,t),altText:{description:c,name:c,title:c}})]}return[]}});export{u as a,f as b,F as c};
@@ -1 +0,0 @@
1
- import{a,b}from"../chunk-7LR5HC5O.mjs";import"../chunk-Z5DPYROV.mjs";import"../chunk-ZKNVKZAF.mjs";import"../chunk-3ZZBJC3M.mjs";export{a as SUPPORTED_IMAGE_TYPES,b as nodeImagePlugin};
@@ -1 +0,0 @@
1
- import{a as o,b as r}from"../chunk-7LR5HC5O.mjs";import"../chunk-Z5DPYROV.mjs";import"../chunk-ZKNVKZAF.mjs";import"../chunk-3ZZBJC3M.mjs";export{o as SUPPORTED_IMAGE_TYPES,r as nodeImagePlugin};
File without changes