mdast-to-docx
Version:
Convert Markdown Abstract Syntax Tree (MDAST) to DOCX seamlessly. Supports footnotes, images, links, and customizable document properties.
2 lines • 141 kB
JavaScript
import{a as R,b as E,c as On,d as br,f as Fe,g as Yr}from"./chunk-3B7PIKIS.mjs";var K=E(($f,Et)=>{"use strict";var yt=function(e){return typeof e!="undefined"&&e!==null},ta=function(e){return typeof e=="object"},ia=function(e){return Object.prototype.toString.call(e)==="[object Object]"},na=function(e){return typeof e=="function"},aa=function(e){return typeof e=="boolean"},sa=function(e){return e instanceof Buffer},oa=function(e){if(yt(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},la=function(e){return e instanceof ArrayBuffer},ca=function(e){return typeof e=="string"&&e.length>0},fa=function(e){return typeof e=="number"&&!Number.isNaN(e)},ha=function(e){return Number.isInteger(e)},ua=function(e,r,t){return e>=r&&e<=t},da=function(e,r){return r.includes(e)},ma=function(e,r,t){return new Error(`Expected ${r} for ${e} but received ${t} of type ${typeof t}`)},ga=function(e,r){return r.message=e.message,r};Et.exports={defined:yt,object:ta,plainObject:ia,fn:na,bool:aa,buffer:sa,typedArray:oa,arrayBuffer:la,string:ca,number:fa,integer:ha,inRange:ua,inArray:da,invalidParameterError:ma,nativeError:ga}});var xt=E((jf,Pt)=>{"use strict";var vt=()=>process.platform==="linux",Ze=null,pa=()=>{if(!Ze)if(vt()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,Ze=process.report.getReport(),process.report.excludeNetwork=e}else Ze={};return Ze};Pt.exports={isLinux:vt,getReport:pa}});var It=E((Tf,Rt)=>{"use strict";var Ie=R("fs"),ba="/usr/bin/ldd",wa="/proc/self/exe",er=2048,ya=e=>{let r=Ie.openSync(e,"r"),t=Buffer.alloc(er),i=Ie.readSync(r,t,0,er,0);return Ie.close(r,()=>{}),t.subarray(0,i)},Ea=e=>new Promise((r,t)=>{Ie.open(e,"r",(i,n)=>{if(i)t(i);else{let a=Buffer.alloc(er);Ie.read(n,a,0,er,0,(o,l)=>{r(a.subarray(0,l)),Ie.close(n,()=>{})})}})});Rt.exports={LDD_PATH:ba,SELF_PATH:wa,readFileSync:ya,readFile:Ea}});var At=E((Nf,St)=>{"use strict";var va=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let r=e.readUInt32LE(32),t=e.readUInt16LE(54),i=e.readUInt16LE(56);for(let n=0;n<i;n++){let a=r+n*t;if(e.readUInt32LE(a)===3){let l=e.readUInt32LE(a+8),h=e.readUInt32LE(a+32);return e.subarray(l,l+h).toString().replace(/\0.*$/g,"")}}return null};St.exports={interpreterPath:va}});var tr=E((Cf,Gt)=>{"use strict";var Lt=R("child_process"),{isLinux:Se,getReport:$t}=xt(),{LDD_PATH:rr,SELF_PATH:jt,readFile:Pr,readFileSync:xr}=It(),{interpreterPath:Tt}=At(),Y,Z,ee,Nt="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",he="",Ct=()=>he||new Promise(e=>{Lt.exec(Nt,(r,t)=>{he=r?" ":t,e(he)})}),Bt=()=>{if(!he)try{he=Lt.execSync(Nt,{encoding:"utf8"})}catch{he=" "}return he},se="glibc",Ft=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,pe="musl",Pa=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),_t=()=>{let e=$t();return e.header&&e.header.glibcVersionRuntime?se:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(Pa)?pe:null},Mt=e=>{let[r,t]=e.split(/[\r\n]+/);return r&&r.includes(se)?se:t&&t.includes(pe)?pe:null},qt=e=>{if(e){if(e.includes("/ld-musl-"))return pe;if(e.includes("/ld-linux-"))return se}return null},Dt=e=>(e=e.toString(),e.includes("musl")?pe:e.includes("GNU C Library")?se:null),xa=async()=>{if(Z!==void 0)return Z;Z=null;try{let e=await Pr(rr);Z=Dt(e)}catch{}return Z},Ra=()=>{if(Z!==void 0)return Z;Z=null;try{let e=xr(rr);Z=Dt(e)}catch{}return Z},Ia=async()=>{if(Y!==void 0)return Y;Y=null;try{let e=await Pr(jt),r=Tt(e);Y=qt(r)}catch{}return Y},Sa=()=>{if(Y!==void 0)return Y;Y=null;try{let e=xr(jt),r=Tt(e);Y=qt(r)}catch{}return Y},Ot=async()=>{let e=null;if(Se()&&(e=await Ia(),!e&&(e=await xa(),e||(e=_t()),!e))){let r=await Ct();e=Mt(r)}return e},Ut=()=>{let e=null;if(Se()&&(e=Sa(),!e&&(e=Ra(),e||(e=_t()),!e))){let r=Bt();e=Mt(r)}return e},Aa=async()=>Se()&&await Ot()!==se,ka=()=>Se()&&Ut()!==se,La=async()=>{if(ee!==void 0)return ee;ee=null;try{let r=(await Pr(rr)).match(Ft);r&&(ee=r[1])}catch{}return ee},$a=()=>{if(ee!==void 0)return ee;ee=null;try{let r=xr(rr).match(Ft);r&&(ee=r[1])}catch{}return ee},zt=()=>{let e=$t();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},kt=e=>e.trim().split(/\s+/)[1],Ht=e=>{let[r,t,i]=e.split(/[\r\n]+/);return r&&r.includes(se)?kt(r):t&&i&&t.includes(pe)?kt(i):null},ja=async()=>{let e=null;if(Se()&&(e=await La(),e||(e=zt()),!e)){let r=await Ct();e=Ht(r)}return e},Ta=()=>{let e=null;if(Se()&&(e=$a(),e||(e=zt()),!e)){let r=Bt();e=Ht(r)}return e};Gt.exports={GLIBC:se,MUSL:pe,family:Ot,familySync:Ut,isNonGlibcLinux:Aa,isNonGlibcLinuxSync:ka,version:ja,versionSync:Ta}});var qe=E((Bf,Wt)=>{"use strict";var Na=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Wt.exports=Na});var ir=E((Ff,Xt)=>{"use strict";var Ca="2.0.0",Ba=Number.MAX_SAFE_INTEGER||9007199254740991,Fa=16,_a=250,Ma=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Xt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Fa,MAX_SAFE_BUILD_LENGTH:_a,MAX_SAFE_INTEGER:Ba,RELEASE_TYPES:Ma,SEMVER_SPEC_VERSION:Ca,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var De=E((re,Vt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Rr,MAX_SAFE_BUILD_LENGTH:qa,MAX_LENGTH:Da}=ir(),Oa=qe();re=Vt.exports={};var Ua=re.re=[],za=re.safeRe=[],m=re.src=[],Ha=re.safeSrc=[],g=re.t={},Ga=0,Ir="[a-zA-Z0-9-]",Wa=[["\\s",1],["\\d",Da],[Ir,qa]],Xa=e=>{for(let[r,t]of Wa)e=e.split(`${r}*`).join(`${r}{0,${t}}`).split(`${r}+`).join(`${r}{1,${t}}`);return e},y=(e,r,t)=>{let i=Xa(r),n=Ga++;Oa(e,n,r),g[e]=n,m[n]=r,Ha[n]=i,Ua[n]=new RegExp(r,t?"g":void 0),za[n]=new RegExp(i,t?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*");y("NUMERICIDENTIFIERLOOSE","\\d+");y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ir}*`);y("MAINVERSION",`(${m[g.NUMERICIDENTIFIER]})\\.(${m[g.NUMERICIDENTIFIER]})\\.(${m[g.NUMERICIDENTIFIER]})`);y("MAINVERSIONLOOSE",`(${m[g.NUMERICIDENTIFIERLOOSE]})\\.(${m[g.NUMERICIDENTIFIERLOOSE]})\\.(${m[g.NUMERICIDENTIFIERLOOSE]})`);y("PRERELEASEIDENTIFIER",`(?:${m[g.NONNUMERICIDENTIFIER]}|${m[g.NUMERICIDENTIFIER]})`);y("PRERELEASEIDENTIFIERLOOSE",`(?:${m[g.NONNUMERICIDENTIFIER]}|${m[g.NUMERICIDENTIFIERLOOSE]})`);y("PRERELEASE",`(?:-(${m[g.PRERELEASEIDENTIFIER]}(?:\\.${m[g.PRERELEASEIDENTIFIER]})*))`);y("PRERELEASELOOSE",`(?:-?(${m[g.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${m[g.PRERELEASEIDENTIFIERLOOSE]})*))`);y("BUILDIDENTIFIER",`${Ir}+`);y("BUILD",`(?:\\+(${m[g.BUILDIDENTIFIER]}(?:\\.${m[g.BUILDIDENTIFIER]})*))`);y("FULLPLAIN",`v?${m[g.MAINVERSION]}${m[g.PRERELEASE]}?${m[g.BUILD]}?`);y("FULL",`^${m[g.FULLPLAIN]}$`);y("LOOSEPLAIN",`[v=\\s]*${m[g.MAINVERSIONLOOSE]}${m[g.PRERELEASELOOSE]}?${m[g.BUILD]}?`);y("LOOSE",`^${m[g.LOOSEPLAIN]}$`);y("GTLT","((?:<|>)?=?)");y("XRANGEIDENTIFIERLOOSE",`${m[g.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);y("XRANGEIDENTIFIER",`${m[g.NUMERICIDENTIFIER]}|x|X|\\*`);y("XRANGEPLAIN",`[v=\\s]*(${m[g.XRANGEIDENTIFIER]})(?:\\.(${m[g.XRANGEIDENTIFIER]})(?:\\.(${m[g.XRANGEIDENTIFIER]})(?:${m[g.PRERELEASE]})?${m[g.BUILD]}?)?)?`);y("XRANGEPLAINLOOSE",`[v=\\s]*(${m[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[g.XRANGEIDENTIFIERLOOSE]})(?:${m[g.PRERELEASELOOSE]})?${m[g.BUILD]}?)?)?`);y("XRANGE",`^${m[g.GTLT]}\\s*${m[g.XRANGEPLAIN]}$`);y("XRANGELOOSE",`^${m[g.GTLT]}\\s*${m[g.XRANGEPLAINLOOSE]}$`);y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Rr}})(?:\\.(\\d{1,${Rr}}))?(?:\\.(\\d{1,${Rr}}))?`);y("COERCE",`${m[g.COERCEPLAIN]}(?:$|[^\\d])`);y("COERCEFULL",m[g.COERCEPLAIN]+`(?:${m[g.PRERELEASE]})?(?:${m[g.BUILD]})?(?:$|[^\\d])`);y("COERCERTL",m[g.COERCE],!0);y("COERCERTLFULL",m[g.COERCEFULL],!0);y("LONETILDE","(?:~>?)");y("TILDETRIM",`(\\s*)${m[g.LONETILDE]}\\s+`,!0);re.tildeTrimReplace="$1~";y("TILDE",`^${m[g.LONETILDE]}${m[g.XRANGEPLAIN]}$`);y("TILDELOOSE",`^${m[g.LONETILDE]}${m[g.XRANGEPLAINLOOSE]}$`);y("LONECARET","(?:\\^)");y("CARETTRIM",`(\\s*)${m[g.LONECARET]}\\s+`,!0);re.caretTrimReplace="$1^";y("CARET",`^${m[g.LONECARET]}${m[g.XRANGEPLAIN]}$`);y("CARETLOOSE",`^${m[g.LONECARET]}${m[g.XRANGEPLAINLOOSE]}$`);y("COMPARATORLOOSE",`^${m[g.GTLT]}\\s*(${m[g.LOOSEPLAIN]})$|^$`);y("COMPARATOR",`^${m[g.GTLT]}\\s*(${m[g.FULLPLAIN]})$|^$`);y("COMPARATORTRIM",`(\\s*)${m[g.GTLT]}\\s*(${m[g.LOOSEPLAIN]}|${m[g.XRANGEPLAIN]})`,!0);re.comparatorTrimReplace="$1$2$3";y("HYPHENRANGE",`^\\s*(${m[g.XRANGEPLAIN]})\\s+-\\s+(${m[g.XRANGEPLAIN]})\\s*$`);y("HYPHENRANGELOOSE",`^\\s*(${m[g.XRANGEPLAINLOOSE]})\\s+-\\s+(${m[g.XRANGEPLAINLOOSE]})\\s*$`);y("STAR","(<|>)?=?\\s*\\*");y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var nr=E((_f,Qt)=>{"use strict";var Va=Object.freeze({loose:!0}),Qa=Object.freeze({}),Ja=e=>e?typeof e!="object"?Va:e:Qa;Qt.exports=Ja});var Zt=E((Mf,Yt)=>{"use strict";var Jt=/^[0-9]+$/,Kt=(e,r)=>{if(typeof e=="number"&&typeof r=="number")return e===r?0:e<r?-1:1;let t=Jt.test(e),i=Jt.test(r);return t&&i&&(e=+e,r=+r),e===r?0:t&&!i?-1:i&&!t?1:e<r?-1:1},Ka=(e,r)=>Kt(r,e);Yt.exports={compareIdentifiers:Kt,rcompareIdentifiers:Ka}});var Ae=E((qf,ri)=>{"use strict";var ar=qe(),{MAX_LENGTH:ei,MAX_SAFE_INTEGER:sr}=ir(),{safeRe:or,t:lr}=De(),Ya=nr(),{compareIdentifiers:Sr}=Zt(),Ar=class e{constructor(r,t){if(t=Ya(t),r instanceof e){if(r.loose===!!t.loose&&r.includePrerelease===!!t.includePrerelease)return r;r=r.version}else if(typeof r!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof r}".`);if(r.length>ei)throw new TypeError(`version is longer than ${ei} characters`);ar("SemVer",r,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=r.trim().match(t.loose?or[lr.LOOSE]:or[lr.FULL]);if(!i)throw new TypeError(`Invalid Version: ${r}`);if(this.raw=r,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>sr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>sr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>sr||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let a=+n;if(a>=0&&a<sr)return a}return n}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(r){if(ar("SemVer.compare",this.version,this.options,r),!(r instanceof e)){if(typeof r=="string"&&r===this.version)return 0;r=new e(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(r){return r instanceof e||(r=new e(r,this.options)),this.major<r.major?-1:this.major>r.major?1:this.minor<r.minor?-1:this.minor>r.minor?1:this.patch<r.patch?-1:this.patch>r.patch?1:0}comparePre(r){if(r instanceof e||(r=new e(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let t=0;do{let i=this.prerelease[t],n=r.prerelease[t];if(ar("prerelease compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return Sr(i,n)}while(++t)}compareBuild(r){r instanceof e||(r=new e(r,this.options));let t=0;do{let i=this.build[t],n=r.build[t];if(ar("build compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return Sr(i,n)}while(++t)}inc(r,t,i){if(r.startsWith("pre")){if(!t&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?or[lr.PRERELEASELOOSE]:or[lr.PRERELEASE]);if(!n||n[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(r){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,i),this.inc("pre",t,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,i),this.inc("pre",t,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let n=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let a=[t,n];i===!1&&(a=[t]),Sr(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ri.exports=Ar});var ni=E((Df,ii)=>{"use strict";var ti=Ae(),Za=(e,r,t=!1)=>{if(e instanceof ti)return e;try{return new ti(e,r)}catch(i){if(!t)return null;throw i}};ii.exports=Za});var si=E((Of,ai)=>{"use strict";var es=Ae(),rs=ni(),{safeRe:cr,t:fr}=De(),ts=(e,r)=>{if(e instanceof es)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;r=r||{};let t=null;if(!r.rtl)t=e.match(r.includePrerelease?cr[fr.COERCEFULL]:cr[fr.COERCE]);else{let h=r.includePrerelease?cr[fr.COERCERTLFULL]:cr[fr.COERCERTL],u;for(;(u=h.exec(e))&&(!t||t.index+t[0].length!==e.length);)(!t||u.index+u[0].length!==t.index+t[0].length)&&(t=u),h.lastIndex=u.index+u[1].length+u[2].length;h.lastIndex=-1}if(t===null)return null;let i=t[2],n=t[3]||"0",a=t[4]||"0",o=r.includePrerelease&&t[5]?`-${t[5]}`:"",l=r.includePrerelease&&t[6]?`+${t[6]}`:"";return rs(`${i}.${n}.${a}${o}${l}`,r)};ai.exports=ts});var be=E((Uf,li)=>{"use strict";var oi=Ae(),is=(e,r,t)=>new oi(e,t).compare(new oi(r,t));li.exports=is});var kr=E((zf,ci)=>{"use strict";var ns=be(),as=(e,r,t)=>ns(e,r,t)>=0;ci.exports=as});var hi=E((Hf,fi)=>{"use strict";var Lr=class{constructor(){this.max=1e3,this.map=new Map}get(r){let t=this.map.get(r);if(t!==void 0)return this.map.delete(r),this.map.set(r,t),t}delete(r){return this.map.delete(r)}set(r,t){if(!this.delete(r)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(r,t)}return this}};fi.exports=Lr});var di=E((Gf,ui)=>{"use strict";var ss=be(),os=(e,r,t)=>ss(e,r,t)===0;ui.exports=os});var gi=E((Wf,mi)=>{"use strict";var ls=be(),cs=(e,r,t)=>ls(e,r,t)!==0;mi.exports=cs});var bi=E((Xf,pi)=>{"use strict";var fs=be(),hs=(e,r,t)=>fs(e,r,t)>0;pi.exports=hs});var yi=E((Vf,wi)=>{"use strict";var us=be(),ds=(e,r,t)=>us(e,r,t)<0;wi.exports=ds});var vi=E((Qf,Ei)=>{"use strict";var ms=be(),gs=(e,r,t)=>ms(e,r,t)<=0;Ei.exports=gs});var xi=E((Jf,Pi)=>{"use strict";var ps=di(),bs=gi(),ws=bi(),ys=kr(),Es=yi(),vs=vi(),Ps=(e,r,t,i)=>{switch(r){case"===":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e===t;case"!==":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e!==t;case"":case"=":case"==":return ps(e,t,i);case"!=":return bs(e,t,i);case">":return ws(e,t,i);case">=":return ys(e,t,i);case"<":return Es(e,t,i);case"<=":return vs(e,t,i);default:throw new TypeError(`Invalid operator: ${r}`)}};Pi.exports=Ps});var $i=E((Kf,Li)=>{"use strict";var Oe=Symbol("SemVer ANY"),Tr=class e{static get ANY(){return Oe}constructor(r,t){if(t=Ri(t),r instanceof e){if(r.loose===!!t.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),jr("comparator",r,t),this.options=t,this.loose=!!t.loose,this.parse(r),this.semver===Oe?this.value="":this.value=this.operator+this.semver.version,jr("comp",this)}parse(r){let t=this.options.loose?Ii[Si.COMPARATORLOOSE]:Ii[Si.COMPARATOR],i=r.match(t);if(!i)throw new TypeError(`Invalid comparator: ${r}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new Ai(i[2],this.options.loose):this.semver=Oe}toString(){return this.value}test(r){if(jr("Comparator.test",r,this.options.loose),this.semver===Oe||r===Oe)return!0;if(typeof r=="string")try{r=new Ai(r,this.options)}catch{return!1}return $r(r,this.operator,this.semver,this.options)}intersects(r,t){if(!(r instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ki(r.value,t).test(this.value):r.operator===""?r.value===""?!0:new ki(this.value,t).test(r.semver):(t=Ri(t),t.includePrerelease&&(this.value==="<0.0.0-0"||r.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||r.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&r.operator.startsWith(">")||this.operator.startsWith("<")&&r.operator.startsWith("<")||this.semver.version===r.semver.version&&this.operator.includes("=")&&r.operator.includes("=")||$r(this.semver,"<",r.semver,t)&&this.operator.startsWith(">")&&r.operator.startsWith("<")||$r(this.semver,">",r.semver,t)&&this.operator.startsWith("<")&&r.operator.startsWith(">")))}};Li.exports=Tr;var Ri=nr(),{safeRe:Ii,t:Si}=De(),$r=xi(),jr=qe(),Ai=Ae(),ki=Nr()});var Nr=E((Yf,Ci)=>{"use strict";var xs=/\s+/g,Cr=class e{constructor(r,t){if(t=Is(t),r instanceof e)return r.loose===!!t.loose&&r.includePrerelease===!!t.includePrerelease?r:new e(r.raw,t);if(r instanceof Br)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=r.trim().replace(xs," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!Ti(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Ts(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let r=0;r<this.set.length;r++){r>0&&(this.formatted+="||");let t=this.set[r];for(let i=0;i<t.length;i++)i>0&&(this.formatted+=" "),this.formatted+=t[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(r){let i=((this.options.includePrerelease&&$s)|(this.options.loose&&js))+":"+r,n=ji.get(i);if(n)return n;let a=this.options.loose,o=a?C[j.HYPHENRANGELOOSE]:C[j.HYPHENRANGE];r=r.replace(o,Us(this.options.includePrerelease)),x("hyphen replace",r),r=r.replace(C[j.COMPARATORTRIM],As),x("comparator trim",r),r=r.replace(C[j.TILDETRIM],ks),x("tilde trim",r),r=r.replace(C[j.CARETTRIM],Ls),x("caret trim",r);let l=r.split(" ").map(w=>Ns(w,this.options)).join(" ").split(/\s+/).map(w=>Os(w,this.options));a&&(l=l.filter(w=>(x("loose invalid filter",w,this.options),!!w.match(C[j.COMPARATORLOOSE])))),x("range list",l);let h=new Map,u=l.map(w=>new Br(w,this.options));for(let w of u){if(Ti(w))return[w];h.set(w.value,w)}h.size>1&&h.has("")&&h.delete("");let b=[...h.values()];return ji.set(i,b),b}intersects(r,t){if(!(r instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>Ni(i,t)&&r.set.some(n=>Ni(n,t)&&i.every(a=>n.every(o=>a.intersects(o,t)))))}test(r){if(!r)return!1;if(typeof r=="string")try{r=new Ss(r,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(zs(this.set[t],r,this.options))return!0;return!1}};Ci.exports=Cr;var Rs=hi(),ji=new Rs,Is=nr(),Br=$i(),x=qe(),Ss=Ae(),{safeRe:C,t:j,comparatorTrimReplace:As,tildeTrimReplace:ks,caretTrimReplace:Ls}=De(),{FLAG_INCLUDE_PRERELEASE:$s,FLAG_LOOSE:js}=ir(),Ti=e=>e.value==="<0.0.0-0",Ts=e=>e.value==="",Ni=(e,r)=>{let t=!0,i=e.slice(),n=i.pop();for(;t&&i.length;)t=i.every(a=>n.intersects(a,r)),n=i.pop();return t},Ns=(e,r)=>(e=e.replace(C[j.BUILD],""),x("comp",e,r),e=Fs(e,r),x("caret",e),e=Cs(e,r),x("tildes",e),e=Ms(e,r),x("xrange",e),e=Ds(e,r),x("stars",e),e),B=e=>!e||e.toLowerCase()==="x"||e==="*",Cs=(e,r)=>e.trim().split(/\s+/).map(t=>Bs(t,r)).join(" "),Bs=(e,r)=>{let t=r.loose?C[j.TILDELOOSE]:C[j.TILDE];return e.replace(t,(i,n,a,o,l)=>{x("tilde",e,i,n,a,o,l);let h;return B(n)?h="":B(a)?h=`>=${n}.0.0 <${+n+1}.0.0-0`:B(o)?h=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:l?(x("replaceTilde pr",l),h=`>=${n}.${a}.${o}-${l} <${n}.${+a+1}.0-0`):h=`>=${n}.${a}.${o} <${n}.${+a+1}.0-0`,x("tilde return",h),h})},Fs=(e,r)=>e.trim().split(/\s+/).map(t=>_s(t,r)).join(" "),_s=(e,r)=>{x("caret",e,r);let t=r.loose?C[j.CARETLOOSE]:C[j.CARET],i=r.includePrerelease?"-0":"";return e.replace(t,(n,a,o,l,h)=>{x("caret",e,n,a,o,l,h);let u;return B(a)?u="":B(o)?u=`>=${a}.0.0${i} <${+a+1}.0.0-0`:B(l)?a==="0"?u=`>=${a}.${o}.0${i} <${a}.${+o+1}.0-0`:u=`>=${a}.${o}.0${i} <${+a+1}.0.0-0`:h?(x("replaceCaret pr",h),a==="0"?o==="0"?u=`>=${a}.${o}.${l}-${h} <${a}.${o}.${+l+1}-0`:u=`>=${a}.${o}.${l}-${h} <${a}.${+o+1}.0-0`:u=`>=${a}.${o}.${l}-${h} <${+a+1}.0.0-0`):(x("no pr"),a==="0"?o==="0"?u=`>=${a}.${o}.${l}${i} <${a}.${o}.${+l+1}-0`:u=`>=${a}.${o}.${l}${i} <${a}.${+o+1}.0-0`:u=`>=${a}.${o}.${l} <${+a+1}.0.0-0`),x("caret return",u),u})},Ms=(e,r)=>(x("replaceXRanges",e,r),e.split(/\s+/).map(t=>qs(t,r)).join(" ")),qs=(e,r)=>{e=e.trim();let t=r.loose?C[j.XRANGELOOSE]:C[j.XRANGE];return e.replace(t,(i,n,a,o,l,h)=>{x("xRange",e,i,n,a,o,l,h);let u=B(a),b=u||B(o),w=b||B(l),S=w;return n==="="&&S&&(n=""),h=r.includePrerelease?"-0":"",u?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&S?(b&&(o=0),l=0,n===">"?(n=">=",b?(a=+a+1,o=0,l=0):(o=+o+1,l=0)):n==="<="&&(n="<",b?a=+a+1:o=+o+1),n==="<"&&(h="-0"),i=`${n+a}.${o}.${l}${h}`):b?i=`>=${a}.0.0${h} <${+a+1}.0.0-0`:w&&(i=`>=${a}.${o}.0${h} <${a}.${+o+1}.0-0`),x("xRange return",i),i})},Ds=(e,r)=>(x("replaceStars",e,r),e.trim().replace(C[j.STAR],"")),Os=(e,r)=>(x("replaceGTE0",e,r),e.trim().replace(C[r.includePrerelease?j.GTE0PRE:j.GTE0],"")),Us=e=>(r,t,i,n,a,o,l,h,u,b,w,S)=>(B(i)?t="":B(n)?t=`>=${i}.0.0${e?"-0":""}`:B(a)?t=`>=${i}.${n}.0${e?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${e?"-0":""}`,B(u)?h="":B(b)?h=`<${+u+1}.0.0-0`:B(w)?h=`<${u}.${+b+1}.0-0`:S?h=`<=${u}.${b}.${w}-${S}`:e?h=`<${u}.${b}.${+w+1}-0`:h=`<=${h}`,`${t} ${h}`.trim()),zs=(e,r,t)=>{for(let i=0;i<e.length;i++)if(!e[i].test(r))return!1;if(r.prerelease.length&&!t.includePrerelease){for(let i=0;i<e.length;i++)if(x(e[i].semver),e[i].semver!==Br.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return!0}return!1}return!0}});var Fi=E((Zf,Bi)=>{"use strict";var Hs=Nr(),Gs=(e,r,t)=>{try{r=new Hs(r,t)}catch{return!1}return r.test(e)};Bi.exports=Gs});var Fr=E((eh,Ws)=>{Ws.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.34.4",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>"],scripts:{install:"node install/check.js",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types","test-lint":"semistandard && cpplint","test-unit":"nyc --reporter=lcov --reporter=text --check-coverage --branches=100 mocha","test-licensing":'license-checker --production --summary --onlyAllow="Apache-2.0;BSD;ISC;LGPL-3.0-or-later;MIT"',"test-leak":"./test/leak/leak.sh","test-types":"tsd","package-from-local-build":"node npm/from-local-build.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.0.0","detect-libc":"^2.1.0",semver:"^7.7.2"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.4","@img/sharp-darwin-x64":"0.34.4","@img/sharp-libvips-darwin-arm64":"1.2.3","@img/sharp-libvips-darwin-x64":"1.2.3","@img/sharp-libvips-linux-arm":"1.2.3","@img/sharp-libvips-linux-arm64":"1.2.3","@img/sharp-libvips-linux-ppc64":"1.2.3","@img/sharp-libvips-linux-s390x":"1.2.3","@img/sharp-libvips-linux-x64":"1.2.3","@img/sharp-libvips-linuxmusl-arm64":"1.2.3","@img/sharp-libvips-linuxmusl-x64":"1.2.3","@img/sharp-linux-arm":"0.34.4","@img/sharp-linux-arm64":"0.34.4","@img/sharp-linux-ppc64":"0.34.4","@img/sharp-linux-s390x":"0.34.4","@img/sharp-linux-x64":"0.34.4","@img/sharp-linuxmusl-arm64":"0.34.4","@img/sharp-linuxmusl-x64":"0.34.4","@img/sharp-wasm32":"0.34.4","@img/sharp-win32-arm64":"0.34.4","@img/sharp-win32-ia32":"0.34.4","@img/sharp-win32-x64":"0.34.4"},devDependencies:{"@emnapi/runtime":"^1.5.0","@img/sharp-libvips-dev":"1.2.3","@img/sharp-libvips-dev-wasm32":"1.2.3","@img/sharp-libvips-win32-arm64":"1.2.3","@img/sharp-libvips-win32-ia32":"1.2.3","@img/sharp-libvips-win32-x64":"1.2.3","@types/node":"*",cc:"^3.0.1",emnapi:"^1.5.0","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.2","license-checker":"^25.0.1",mocha:"^11.7.2","node-addon-api":"^8.5.0","node-gyp":"^11.4.2",nyc:"^17.1.0",semistandard:"^17.0.0","tar-fs":"^3.1.1",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.17.2"},funding:{url:"https://opencollective.com/libvips"},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}});var Mr=E((rh,Wi)=>{"use strict";var{spawnSync:hr}=R("child_process"),{createHash:Xs}=R("crypto"),Di=si(),Vs=kr(),Qs=Fi(),_i=tr(),{config:Js,engines:Mi,optionalDependencies:Ks}=Fr(),Ys=process.env.npm_package_config_libvips||Js.libvips,Oi=Di(Ys).version,Zs=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],ur={encoding:"utf8",shell:!0},eo=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},Ui=()=>_i.isNonGlibcLinuxSync()?_i.familySync():"",ro=()=>`${process.platform}${Ui()}-${process.arch}`,ke=()=>{if(zi())return"wasm32";let{npm_config_arch:e,npm_config_platform:r,npm_config_libc:t}=process.env,i=typeof t=="string"?t:Ui();return`${r||process.platform}${i}-${e||process.arch}`},to=()=>{try{return R(`@img/sharp-libvips-dev-${ke()}/include`)}catch{try{return R("@img/sharp-libvips-dev/include")}catch{}}return""},io=()=>{try{return R("@img/sharp-libvips-dev/cplusplus")}catch{}return""},no=()=>{try{return R(`@img/sharp-libvips-dev-${ke()}/lib`)}catch{try{return R(`@img/sharp-libvips-${ke()}/lib`)}catch{}}return""},ao=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!Qs(process.versions.node,Mi.node))return{found:process.versions.node,expected:Mi.node}},zi=()=>{let{CC:e}=process.env;return!!(e&&e.endsWith("/emcc"))},so=()=>process.platform==="darwin"&&process.arch==="x64"?(hr("sysctl sysctl.proc_translated",ur).stdout||"").trim()==="sysctl.proc_translated: 1":!1,qi=e=>Xs("sha512").update(e).digest("hex"),oo=()=>{try{let e=qi(`imgsharp-libvips-${ke()}`),r=Di(Ks[`@img/sharp-libvips-${ke()}`],{includePrerelease:!0}).version;return qi(`${e}npm:${r}`).slice(0,10)}catch{}return""},lo=()=>hr(`node-gyp rebuild --directory=src ${zi()?"--nodedir=emscripten":""}`,{...ur,stdio:"inherit"}).status,Hi=()=>process.platform!=="win32"?(hr("pkg-config --modversion vips-cpp",{...ur,env:{...process.env,PKG_CONFIG_PATH:Gi()}}).stdout||"").trim():"",Gi=()=>process.platform!=="win32"?[(hr('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',ur).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":"):"",_r=(e,r,t)=>(t&&t(`Detected ${r}, skipping search for globally-installed libvips`),e),co=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return _r(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return _r(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(so())return _r(!1,"Rosetta",e);let r=Hi();return!!r&&Vs(r,Oi)};Wi.exports={minimumLibvipsVersion:Oi,prebuiltPlatforms:Zs,buildPlatformArch:ke,buildSharpLibvipsIncludeDir:to,buildSharpLibvipsCPlusPlusDir:io,buildSharpLibvipsLibDir:no,isUnsupportedNodeRuntime:ao,runtimePlatformArch:ro,log:eo,yarnLocator:oo,spawnRebuild:lo,globalLibvipsVersion:Hi,pkgConfigPath:Gi,useGlobalLibvips:co}});var ze=E((ih,Vi)=>{"use strict";var{familySync:fo,versionSync:ho}=tr(),{runtimePlatformArch:uo,isUnsupportedNodeRuntime:Xi,prebuiltPlatforms:mo,minimumLibvipsVersion:go}=Mr(),we=uo(),po=[`../src/build/Release/sharp-${we}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${we}/sharp.node`,"@img/sharp-wasm32/sharp.node"],qr,Le,Ue=[];for(qr of po)try{Le=R(qr);break}catch(e){Ue.push(e)}if(Le&&qr.startsWith("@img/sharp-linux-x64")&&!Le._isUsingX64V2()){let e=new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");e.code="Unsupported CPU",Ue.push(e),Le=null}if(Le)Vi.exports=Le;else{let[e,r,t]=["linux","darwin","win32"].map(a=>we.startsWith(a)),i=[`Could not load the "sharp" module using the ${we} runtime`];Ue.forEach(a=>{a.code!=="MODULE_NOT_FOUND"&&i.push(`${a.code}: ${a.message}`)});let n=Ue.map(a=>a.message).join(" ");if(i.push("Possible solutions:"),Xi()){let{found:a,expected:o}=Xi();i.push("- Please upgrade Node.js:",` Found ${a}`,` Requires ${o}`)}else if(mo.includes(we)){let[a,o]=we.split("-"),l=a.endsWith("musl")?" --libc=musl":"";i.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${a.replace("musl","")}${l} --cpu=${o} sharp`)}else i.push(`- Manually install libvips >= ${go}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(n))try{let{config:a}=R(`@img/sharp-libvips-${we}/package`),o=`${fo()} ${ho()}`,l=`${a.musl?"musl":"glibc"} ${a.musl||a.glibc}`;i.push("- Update your OS:",` Found ${o}`,` Requires ${l}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(n)&&i.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),r&&/Incompatible library version/.test(n)&&i.push("- Update Homebrew:"," brew update && brew upgrade vips"),Ue.some(a=>a.code==="ERR_DLOPEN_DISABLED")&&i.push("- Run Node.js without using the --no-addons flag"),t&&/The specified procedure could not be found/.test(n)&&i.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),i.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(i.join(`
`))}});var Ji=E((ah,Qi)=>{"use strict";var bo=R("util"),Dr=R("stream"),wo=K();ze();var yo=bo.debuglog("sharp"),ye=function(e,r){if(arguments.length===1&&!wo.defined(e))throw new Error("Invalid input");return this instanceof ye?(Dr.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:8,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:t=>{this.emit("warning",t),yo(t)},queueListener:function(t){ye.queue.emit("change",t)}},this.options.input=this._createInputDescriptor(e,r,{allowStream:!0}),this):new ye(e,r)};Object.setPrototypeOf(ye.prototype,Dr.Duplex.prototype);Object.setPrototypeOf(ye,Dr.Duplex);function Eo(){let e=this.constructor.call(),{debuglog:r,queueListener:t,...i}=this.options;return e.options=structuredClone(i),e.options.debuglog=r,e.options.queueListener=t,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}Object.assign(ye.prototype,{clone:Eo});Qi.exports=ye});var Zi=E((sh,Yi)=>{"use strict";var c=K(),ue=ze(),vo={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},Po=["failOn","limitInputPixels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","failOnError","openSlideLevel","pdfBackground","tiffSubifd"];function Ki(e){let r=Po.filter(t=>c.defined(e[t])).map(t=>[t,e[t]]);return r.length?Object.fromEntries(r):void 0}function xo(e,r,t){let i={autoOrient:!1,failOn:"warning",limitInputPixels:Math.pow(16383,2),ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(c.string(e))i.file=e;else if(c.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");i.buffer=e}else if(c.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");i.buffer=Buffer.from(e,0,e.byteLength)}else if(c.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");i.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(c.plainObject(e)&&!c.defined(r))r=e,Ki(r)&&(i.buffer=[]);else if(!c.defined(e)&&!c.defined(r)&&c.object(t)&&t.allowStream)i.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map(n=>this._createInputDescriptor(n));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${e}' of type ${typeof e}${c.defined(r)?` when also providing options of type ${typeof r}`:""}`);if(c.object(r)){if(c.defined(r.failOnError))if(c.bool(r.failOnError))i.failOn=r.failOnError?"warning":"none";else throw c.invalidParameterError("failOnError","boolean",r.failOnError);if(c.defined(r.failOn))if(c.string(r.failOn)&&c.inArray(r.failOn,["none","truncated","error","warning"]))i.failOn=r.failOn;else throw c.invalidParameterError("failOn","one of: none, truncated, error, warning",r.failOn);if(c.defined(r.autoOrient))if(c.bool(r.autoOrient))i.autoOrient=r.autoOrient;else throw c.invalidParameterError("autoOrient","boolean",r.autoOrient);if(c.defined(r.density))if(c.inRange(r.density,1,1e5))i.density=r.density;else throw c.invalidParameterError("density","number between 1 and 100000",r.density);if(c.defined(r.ignoreIcc))if(c.bool(r.ignoreIcc))i.ignoreIcc=r.ignoreIcc;else throw c.invalidParameterError("ignoreIcc","boolean",r.ignoreIcc);if(c.defined(r.limitInputPixels))if(c.bool(r.limitInputPixels))i.limitInputPixels=r.limitInputPixels?Math.pow(16383,2):0;else if(c.integer(r.limitInputPixels)&&c.inRange(r.limitInputPixels,0,Number.MAX_SAFE_INTEGER))i.limitInputPixels=r.limitInputPixels;else throw c.invalidParameterError("limitInputPixels","positive integer",r.limitInputPixels);if(c.defined(r.unlimited))if(c.bool(r.unlimited))i.unlimited=r.unlimited;else throw c.invalidParameterError("unlimited","boolean",r.unlimited);if(c.defined(r.sequentialRead))if(c.bool(r.sequentialRead))i.sequentialRead=r.sequentialRead;else throw c.invalidParameterError("sequentialRead","boolean",r.sequentialRead);if(c.defined(r.raw)){if(c.object(r.raw)&&c.integer(r.raw.width)&&r.raw.width>0&&c.integer(r.raw.height)&&r.raw.height>0&&c.integer(r.raw.channels)&&c.inRange(r.raw.channels,1,4))switch(i.rawWidth=r.raw.width,i.rawHeight=r.raw.height,i.rawChannels=r.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:i.rawDepth="uchar";break;case Int8Array:i.rawDepth="char";break;case Uint16Array:i.rawDepth="ushort";break;case Int16Array:i.rawDepth="short";break;case Uint32Array:i.rawDepth="uint";break;case Int32Array:i.rawDepth="int";break;case Float32Array:i.rawDepth="float";break;case Float64Array:i.rawDepth="double";break;default:i.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(i.rawPremultiplied=!1,c.defined(r.raw.premultiplied))if(c.bool(r.raw.premultiplied))i.rawPremultiplied=r.raw.premultiplied;else throw c.invalidParameterError("raw.premultiplied","boolean",r.raw.premultiplied);if(i.rawPageHeight=0,c.defined(r.raw.pageHeight))if(c.integer(r.raw.pageHeight)&&r.raw.pageHeight>0&&r.raw.pageHeight<=r.raw.height){if(r.raw.height%r.raw.pageHeight!==0)throw new Error(`Expected raw.height ${r.raw.height} to be a multiple of raw.pageHeight ${r.raw.pageHeight}`);i.rawPageHeight=r.raw.pageHeight}else throw c.invalidParameterError("raw.pageHeight","positive integer",r.raw.pageHeight)}if(c.defined(r.animated))if(c.bool(r.animated))i.pages=r.animated?-1:1;else throw c.invalidParameterError("animated","boolean",r.animated);if(c.defined(r.pages))if(c.integer(r.pages)&&c.inRange(r.pages,-1,1e5))i.pages=r.pages;else throw c.invalidParameterError("pages","integer between -1 and 100000",r.pages);if(c.defined(r.page))if(c.integer(r.page)&&c.inRange(r.page,0,1e5))i.page=r.page;else throw c.invalidParameterError("page","integer between 0 and 100000",r.page);if(c.object(r.openSlide)&&c.defined(r.openSlide.level))if(c.integer(r.openSlide.level)&&c.inRange(r.openSlide.level,0,256))i.openSlideLevel=r.openSlide.level;else throw c.invalidParameterError("openSlide.level","integer between 0 and 256",r.openSlide.level);else if(c.defined(r.level))if(c.integer(r.level)&&c.inRange(r.level,0,256))i.openSlideLevel=r.level;else throw c.invalidParameterError("level","integer between 0 and 256",r.level);if(c.object(r.tiff)&&c.defined(r.tiff.subifd))if(c.integer(r.tiff.subifd)&&c.inRange(r.tiff.subifd,-1,1e5))i.tiffSubifd=r.tiff.subifd;else throw c.invalidParameterError("tiff.subifd","integer between -1 and 100000",r.tiff.subifd);else if(c.defined(r.subifd))if(c.integer(r.subifd)&&c.inRange(r.subifd,-1,1e5))i.tiffSubifd=r.subifd;else throw c.invalidParameterError("subifd","integer between -1 and 100000",r.subifd);if(c.object(r.svg)){if(c.defined(r.svg.stylesheet))if(c.string(r.svg.stylesheet))i.svgStylesheet=r.svg.stylesheet;else throw c.invalidParameterError("svg.stylesheet","string",r.svg.stylesheet);if(c.defined(r.svg.highBitdepth))if(c.bool(r.svg.highBitdepth))i.svgHighBitdepth=r.svg.highBitdepth;else throw c.invalidParameterError("svg.highBitdepth","boolean",r.svg.highBitdepth)}if(c.object(r.pdf)&&c.defined(r.pdf.background)?i.pdfBackground=this._getBackgroundColourOption(r.pdf.background):c.defined(r.pdfBackground)&&(i.pdfBackground=this._getBackgroundColourOption(r.pdfBackground)),c.object(r.jp2)&&c.defined(r.jp2.oneshot))if(c.bool(r.jp2.oneshot))i.jp2Oneshot=r.jp2.oneshot;else throw c.invalidParameterError("jp2.oneshot","boolean",r.jp2.oneshot);if(c.defined(r.create))if(c.object(r.create)&&c.integer(r.create.width)&&r.create.width>0&&c.integer(r.create.height)&&r.create.height>0&&c.integer(r.create.channels)){if(i.createWidth=r.create.width,i.createHeight=r.create.height,i.createChannels=r.create.channels,i.createPageHeight=0,c.defined(r.create.pageHeight))if(c.integer(r.create.pageHeight)&&r.create.pageHeight>0&&r.create.pageHeight<=r.create.height){if(r.create.height%r.create.pageHeight!==0)throw new Error(`Expected create.height ${r.create.height} to be a multiple of create.pageHeight ${r.create.pageHeight}`);i.createPageHeight=r.create.pageHeight}else throw c.invalidParameterError("create.pageHeight","positive integer",r.create.pageHeight);if(c.defined(r.create.noise)){if(!c.object(r.create.noise))throw new Error("Expected noise to be an object");if(r.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(i.createNoiseType=r.create.noise.type,!c.inRange(r.create.channels,1,4))throw c.invalidParameterError("create.channels","number between 1 and 4",r.create.channels);if(i.createNoiseMean=128,c.defined(r.create.noise.mean))if(c.number(r.create.noise.mean)&&c.inRange(r.create.noise.mean,0,1e4))i.createNoiseMean=r.create.noise.mean;else throw c.invalidParameterError("create.noise.mean","number between 0 and 10000",r.create.noise.mean);if(i.createNoiseSigma=30,c.defined(r.create.noise.sigma))if(c.number(r.create.noise.sigma)&&c.inRange(r.create.noise.sigma,0,1e4))i.createNoiseSigma=r.create.noise.sigma;else throw c.invalidParameterError("create.noise.sigma","number between 0 and 10000",r.create.noise.sigma)}else if(c.defined(r.create.background)){if(!c.inRange(r.create.channels,3,4))throw c.invalidParameterError("create.channels","number between 3 and 4",r.create.channels);i.createBackground=this._getBackgroundColourOption(r.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete i.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(c.defined(r.text))if(c.object(r.text)&&c.string(r.text.text)){if(i.textValue=r.text.text,c.defined(r.text.height)&&c.defined(r.text.dpi))throw new Error("Expected only one of dpi or height");if(c.defined(r.text.font))if(c.string(r.text.font))i.textFont=r.text.font;else throw c.invalidParameterError("text.font","string",r.text.font);if(c.defined(r.text.fontfile))if(c.string(r.text.fontfile))i.textFontfile=r.text.fontfile;else throw c.invalidParameterError("text.fontfile","string",r.text.fontfile);if(c.defined(r.text.width))if(c.integer(r.text.width)&&r.text.width>0)i.textWidth=r.text.width;else throw c.invalidParameterError("text.width","positive integer",r.text.width);if(c.defined(r.text.height))if(c.integer(r.text.height)&&r.text.height>0)i.textHeight=r.text.height;else throw c.invalidParameterError("text.height","positive integer",r.text.height);if(c.defined(r.text.align))if(c.string(r.text.align)&&c.string(this.constructor.align[r.text.align]))i.textAlign=this.constructor.align[r.text.align];else throw c.invalidParameterError("text.align","valid alignment",r.text.align);if(c.defined(r.text.justify))if(c.bool(r.text.justify))i.textJustify=r.text.justify;else throw c.invalidParameterError("text.justify","boolean",r.text.justify);if(c.defined(r.text.dpi))if(c.integer(r.text.dpi)&&c.inRange(r.text.dpi,1,1e6))i.textDpi=r.text.dpi;else throw c.invalidParameterError("text.dpi","integer between 1 and 1000000",r.text.dpi);if(c.defined(r.text.rgba))if(c.bool(r.text.rgba))i.textRgba=r.text.rgba;else throw c.invalidParameterError("text.rgba","bool",r.text.rgba);if(c.defined(r.text.spacing))if(c.integer(r.text.spacing)&&c.inRange(r.text.spacing,-1e6,1e6))i.textSpacing=r.text.spacing;else throw c.invalidParameterError("text.spacing","integer between -1000000 and 1000000",r.text.spacing);if(c.defined(r.text.wrap))if(c.string(r.text.wrap)&&c.inArray(r.text.wrap,["word","char","word-char","none"]))i.textWrap=r.text.wrap;else throw c.invalidParameterError("text.wrap","one of: word, char, word-char, none",r.text.wrap);delete i.buffer}else throw new Error("Expected a valid string to create an image with text.");if(c.defined(r.join))if(c.defined(this.options.join)){if(c.defined(r.join.animated))if(c.bool(r.join.animated))i.joinAnimated=r.join.animated;else throw c.invalidParameterError("join.animated","boolean",r.join.animated);if(c.defined(r.join.across))if(c.integer(r.join.across)&&c.inRange(r.join.across,1,1e6))i.joinAcross=r.join.across