UNPKG

mdast2docx

Version:

Convert Markdown Abstract Syntax Tree (MDAST) to DOCX seamlessly. Supports footnotes, images, links, and customizable document properties.

2 lines 210 kB
"use strict";var $c=Object.create;var hn=Object.defineProperty;var Fc=Object.getOwnPropertyDescriptor;var Oc=Object.getOwnPropertyNames;var Dc=Object.getPrototypeOf,Nc=Object.prototype.hasOwnProperty;var Lo=e=>{throw TypeError(e)};var pr=(e,t)=>()=>(e&&(t=e(e=0)),t);var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bo=(e,t)=>{for(var n in t)hn(e,n,{get:t[n],enumerable:!0})},jo=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Oc(t))!Nc.call(e,o)&&o!==n&&hn(e,o,{get:()=>t[o],enumerable:!(a=Fc(t,o))||a.enumerable});return e};var Ve=(e,t,n)=>(n=e!=null?$c(Dc(e)):{},jo(t||!e||!e.__esModule?hn(n,"default",{value:e,enumerable:!0}):n,e)),Wc=e=>jo(hn({},"__esModule",{value:!0}),e);var qo=(e,t,n)=>t.has(e)||Lo("Cannot "+n);var J=(e,t,n)=>(qo(e,t,"read from private field"),n?n.call(e):t.get(e)),Ce=(e,t,n)=>t.has(e)?Lo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),de=(e,t,n,a)=>(qo(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n);var Le=k((Rg,Fo)=>{"use strict";var $o=function(e){return typeof e!="undefined"&&e!==null},Mc=function(e){return typeof e=="object"},zc=function(e){return Object.prototype.toString.call(e)==="[object Object]"},Uc=function(e){return typeof e=="function"},Hc=function(e){return typeof e=="boolean"},Gc=function(e){return e instanceof Buffer},Vc=function(e){if($o(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},Qc=function(e){return e instanceof ArrayBuffer},Yc=function(e){return typeof e=="string"&&e.length>0},Xc=function(e){return typeof e=="number"&&!Number.isNaN(e)},Jc=function(e){return Number.isInteger(e)},Kc=function(e,t,n){return e>=t&&e<=n},Zc=function(e,t){return t.includes(e)},ed=function(e,t,n){return new Error(`Expected ${t} for ${e} but received ${n} of type ${typeof n}`)},td=function(e,t){return t.message=e.message,t};Fo.exports={defined:$o,object:Mc,plainObject:zc,fn:Uc,bool:Hc,buffer:Gc,typedArray:Vc,arrayBuffer:Qc,string:Yc,number:Xc,integer:Jc,inRange:Kc,inArray:Zc,invalidParameterError:ed,nativeError:td}});var No=k((Pg,Do)=>{"use strict";var Oo=()=>process.platform==="linux",mn=null,rd=()=>{if(!mn)if(Oo()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,mn=process.report.getReport(),process.report.excludeNetwork=e}else mn={};return mn};Do.exports={isLinux:Oo,getReport:rd}});var zo=k((Ag,Mo)=>{"use strict";var Wo=require("fs"),nd="/usr/bin/ldd",id=e=>Wo.readFileSync(e,"utf-8"),ad=e=>new Promise((t,n)=>{Wo.readFile(e,"utf-8",(a,o)=>{a?n(a):t(o)})});Mo.exports={LDD_PATH:nd,readFileSync:id,readFile:ad}});var gn=k((Tg,os)=>{"use strict";var Ho=require("child_process"),{isLinux:Vt,getReport:Go}=No(),{LDD_PATH:bn,readFile:Vo,readFileSync:Qo}=zo(),Be,je,Yo="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",ct="",Xo=()=>ct||new Promise(e=>{Ho.exec(Yo,(t,n)=>{ct=t?" ":n,e(ct)})}),Jo=()=>{if(!ct)try{ct=Ho.execSync(Yo,{encoding:"utf8"})}catch{ct=" "}return ct},dt="glibc",Ko=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Gt="musl",od=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),Zo=()=>{let e=Go();return e.header&&e.header.glibcVersionRuntime?dt:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(od)?Gt:null},es=e=>{let[t,n]=e.split(/[\r\n]+/);return t&&t.includes(dt)?dt:n&&n.includes(Gt)?Gt:null},ts=e=>e.includes("musl")?Gt:e.includes("GNU C Library")?dt:null,sd=async()=>{if(Be!==void 0)return Be;Be=null;try{let e=await Vo(bn);Be=ts(e)}catch{}return Be},ld=()=>{if(Be!==void 0)return Be;Be=null;try{let e=Qo(bn);Be=ts(e)}catch{}return Be},rs=async()=>{let e=null;if(Vt()&&(e=await sd(),e||(e=Zo()),!e)){let t=await Xo();e=es(t)}return e},ns=()=>{let e=null;if(Vt()&&(e=ld(),e||(e=Zo()),!e)){let t=Jo();e=es(t)}return e},ud=async()=>Vt()&&await rs()!==dt,fd=()=>Vt()&&ns()!==dt,cd=async()=>{if(je!==void 0)return je;je=null;try{let t=(await Vo(bn)).match(Ko);t&&(je=t[1])}catch{}return je},dd=()=>{if(je!==void 0)return je;je=null;try{let t=Qo(bn).match(Ko);t&&(je=t[1])}catch{}return je},is=()=>{let e=Go();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},Uo=e=>e.trim().split(/\s+/)[1],as=e=>{let[t,n,a]=e.split(/[\r\n]+/);return t&&t.includes(dt)?Uo(t):n&&a&&n.includes(Gt)?Uo(a):null},hd=async()=>{let e=null;if(Vt()&&(e=await cd(),e||(e=is()),!e)){let t=await Xo();e=as(t)}return e},md=()=>{let e=null;if(Vt()&&(e=dd(),e||(e=is()),!e)){let t=Jo();e=as(t)}return e};os.exports={GLIBC:dt,MUSL:Gt,family:rs,familySync:ns,isNonGlibcLinux:ud,isNonGlibcLinuxSync:fd,version:hd,versionSync:md}});var yr=k((Cg,ss)=>{"use strict";var bd=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};ss.exports=bd});var pn=k((xg,ls)=>{"use strict";var gd="2.0.0",pd=Number.MAX_SAFE_INTEGER||9007199254740991,yd=16,wd=250,Ed=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ls.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:yd,MAX_SAFE_BUILD_LENGTH:wd,MAX_SAFE_INTEGER:pd,RELEASE_TYPES:Ed,SEMVER_SPEC_VERSION:gd,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var wr=k((qe,us)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Bi,MAX_SAFE_BUILD_LENGTH:Sd,MAX_LENGTH:_d}=pn(),vd=yr();qe=us.exports={};var Rd=qe.re=[],Pd=qe.safeRe=[],R=qe.src=[],Ad=qe.safeSrc=[],P=qe.t={},Td=0,ji="[a-zA-Z0-9-]",Cd=[["\\s",1],["\\d",_d],[ji,Sd]],xd=e=>{for(let[t,n]of Cd)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},j=(e,t,n)=>{let a=xd(t),o=Td++;vd(e,o,t),P[e]=o,R[o]=t,Ad[o]=a,Rd[o]=new RegExp(t,n?"g":void 0),Pd[o]=new RegExp(a,n?"g":void 0)};j("NUMERICIDENTIFIER","0|[1-9]\\d*");j("NUMERICIDENTIFIERLOOSE","\\d+");j("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ji}*`);j("MAINVERSION",`(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})`);j("MAINVERSIONLOOSE",`(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})`);j("PRERELEASEIDENTIFIER",`(?:${R[P.NONNUMERICIDENTIFIER]}|${R[P.NUMERICIDENTIFIER]})`);j("PRERELEASEIDENTIFIERLOOSE",`(?:${R[P.NONNUMERICIDENTIFIER]}|${R[P.NUMERICIDENTIFIERLOOSE]})`);j("PRERELEASE",`(?:-(${R[P.PRERELEASEIDENTIFIER]}(?:\\.${R[P.PRERELEASEIDENTIFIER]})*))`);j("PRERELEASELOOSE",`(?:-?(${R[P.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[P.PRERELEASEIDENTIFIERLOOSE]})*))`);j("BUILDIDENTIFIER",`${ji}+`);j("BUILD",`(?:\\+(${R[P.BUILDIDENTIFIER]}(?:\\.${R[P.BUILDIDENTIFIER]})*))`);j("FULLPLAIN",`v?${R[P.MAINVERSION]}${R[P.PRERELEASE]}?${R[P.BUILD]}?`);j("FULL",`^${R[P.FULLPLAIN]}$`);j("LOOSEPLAIN",`[v=\\s]*${R[P.MAINVERSIONLOOSE]}${R[P.PRERELEASELOOSE]}?${R[P.BUILD]}?`);j("LOOSE",`^${R[P.LOOSEPLAIN]}$`);j("GTLT","((?:<|>)?=?)");j("XRANGEIDENTIFIERLOOSE",`${R[P.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);j("XRANGEIDENTIFIER",`${R[P.NUMERICIDENTIFIER]}|x|X|\\*`);j("XRANGEPLAIN",`[v=\\s]*(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:${R[P.PRERELEASE]})?${R[P.BUILD]}?)?)?`);j("XRANGEPLAINLOOSE",`[v=\\s]*(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:${R[P.PRERELEASELOOSE]})?${R[P.BUILD]}?)?)?`);j("XRANGE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAIN]}$`);j("XRANGELOOSE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAINLOOSE]}$`);j("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Bi}})(?:\\.(\\d{1,${Bi}}))?(?:\\.(\\d{1,${Bi}}))?`);j("COERCE",`${R[P.COERCEPLAIN]}(?:$|[^\\d])`);j("COERCEFULL",R[P.COERCEPLAIN]+`(?:${R[P.PRERELEASE]})?(?:${R[P.BUILD]})?(?:$|[^\\d])`);j("COERCERTL",R[P.COERCE],!0);j("COERCERTLFULL",R[P.COERCEFULL],!0);j("LONETILDE","(?:~>?)");j("TILDETRIM",`(\\s*)${R[P.LONETILDE]}\\s+`,!0);qe.tildeTrimReplace="$1~";j("TILDE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAIN]}$`);j("TILDELOOSE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAINLOOSE]}$`);j("LONECARET","(?:\\^)");j("CARETTRIM",`(\\s*)${R[P.LONECARET]}\\s+`,!0);qe.caretTrimReplace="$1^";j("CARET",`^${R[P.LONECARET]}${R[P.XRANGEPLAIN]}$`);j("CARETLOOSE",`^${R[P.LONECARET]}${R[P.XRANGEPLAINLOOSE]}$`);j("COMPARATORLOOSE",`^${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]})$|^$`);j("COMPARATOR",`^${R[P.GTLT]}\\s*(${R[P.FULLPLAIN]})$|^$`);j("COMPARATORTRIM",`(\\s*)${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]}|${R[P.XRANGEPLAIN]})`,!0);qe.comparatorTrimReplace="$1$2$3";j("HYPHENRANGE",`^\\s*(${R[P.XRANGEPLAIN]})\\s+-\\s+(${R[P.XRANGEPLAIN]})\\s*$`);j("HYPHENRANGELOOSE",`^\\s*(${R[P.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[P.XRANGEPLAINLOOSE]})\\s*$`);j("STAR","(<|>)?=?\\s*\\*");j("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");j("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var yn=k((Ig,fs)=>{"use strict";var Id=Object.freeze({loose:!0}),kd=Object.freeze({}),Ld=e=>e?typeof e!="object"?Id:e:kd;fs.exports=Ld});var ms=k((kg,hs)=>{"use strict";var cs=/^[0-9]+$/,ds=(e,t)=>{let n=cs.test(e),a=cs.test(t);return n&&a&&(e=+e,t=+t),e===t?0:n&&!a?-1:a&&!n?1:e<t?-1:1},Bd=(e,t)=>ds(t,e);hs.exports={compareIdentifiers:ds,rcompareIdentifiers:Bd}});var Yt=k((Lg,gs)=>{"use strict";var wn=yr(),{MAX_LENGTH:bs,MAX_SAFE_INTEGER:En}=pn(),{safeRe:Sn,t:_n}=wr(),jd=yn(),{compareIdentifiers:Qt}=ms(),qi=class e{constructor(t,n){if(n=jd(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must qr a string. Got type "${typeof t}".`);if(t.length>bs)throw new TypeError(`version is longer than ${bs} characters`);wn("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let a=t.trim().match(n.loose?Sn[_n.LOOSE]:Sn[_n.FULL]);if(!a)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>En||this.major<0)throw new TypeError("Invalid major version");if(this.minor>En||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>En||this.patch<0)throw new TypeError("Invalid patch version");a[4]?this.prerelease=a[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let l=+o;if(l>=0&&l<En)return l}return o}):this.prerelease=[],this.build=a[5]?a[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(t){if(wn("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Qt(this.major,t.major)||Qt(this.minor,t.minor)||Qt(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let a=this.prerelease[n],o=t.prerelease[n];if(wn("prerelease compare",n,a,o),a===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(a===void 0)return-1;if(a===o)continue;return Qt(a,o)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let a=this.build[n],o=t.build[n];if(wn("build compare",n,a,o),a===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(a===void 0)return-1;if(a===o)continue;return Qt(a,o)}while(++n)}inc(t,n,a){if(t.startsWith("pre")){if(!n&&a===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?Sn[_n.PRERELEASELOOSE]:Sn[_n.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,a);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,a);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,a),this.inc("pre",n,a);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,a),this.inc("pre",n,a);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 o=Number(a)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&a===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let l=[n,o];a===!1&&(l=[n]),Qt(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};gs.exports=qi});var ws=k((Bg,ys)=>{"use strict";var ps=Yt(),qd=(e,t,n=!1)=>{if(e instanceof ps)return e;try{return new ps(e,t)}catch(a){if(!n)return null;throw a}};ys.exports=qd});var Ss=k((jg,Es)=>{"use strict";var $d=Yt(),Fd=ws(),{safeRe:vn,t:Rn}=wr(),Od=(e,t)=>{if(e instanceof $d)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?vn[Rn.COERCEFULL]:vn[Rn.COERCE]);else{let d=t.includePrerelease?vn[Rn.COERCERTLFULL]:vn[Rn.COERCERTL],b;for(;(b=d.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||b.index+b[0].length!==n.index+n[0].length)&&(n=b),d.lastIndex=b.index+b[1].length+b[2].length;d.lastIndex=-1}if(n===null)return null;let a=n[2],o=n[3]||"0",l=n[4]||"0",f=t.includePrerelease&&n[5]?`-${n[5]}`:"",m=t.includePrerelease&&n[6]?`+${n[6]}`:"";return Fd(`${a}.${o}.${l}${f}${m}`,t)};Es.exports=Od});var Pt=k((qg,vs)=>{"use strict";var _s=Yt(),Dd=(e,t,n)=>new _s(e,n).compare(new _s(t,n));vs.exports=Dd});var $i=k(($g,Rs)=>{"use strict";var Nd=Pt(),Wd=(e,t,n)=>Nd(e,t,n)>=0;Rs.exports=Wd});var As=k((Fg,Ps)=>{"use strict";var Fi=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(t,n)}return this}};Ps.exports=Fi});var Cs=k((Og,Ts)=>{"use strict";var Md=Pt(),zd=(e,t,n)=>Md(e,t,n)===0;Ts.exports=zd});var Is=k((Dg,xs)=>{"use strict";var Ud=Pt(),Hd=(e,t,n)=>Ud(e,t,n)!==0;xs.exports=Hd});var Ls=k((Ng,ks)=>{"use strict";var Gd=Pt(),Vd=(e,t,n)=>Gd(e,t,n)>0;ks.exports=Vd});var js=k((Wg,Bs)=>{"use strict";var Qd=Pt(),Yd=(e,t,n)=>Qd(e,t,n)<0;Bs.exports=Yd});var $s=k((Mg,qs)=>{"use strict";var Xd=Pt(),Jd=(e,t,n)=>Xd(e,t,n)<=0;qs.exports=Jd});var Os=k((zg,Fs)=>{"use strict";var Kd=Cs(),Zd=Is(),eh=Ls(),th=$i(),rh=js(),nh=$s(),ih=(e,t,n,a)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return Kd(e,n,a);case"!=":return Zd(e,n,a);case">":return eh(e,n,a);case">=":return th(e,n,a);case"<":return rh(e,n,a);case"<=":return nh(e,n,a);default:throw new TypeError(`Invalid operator: ${t}`)}};Fs.exports=ih});var Hs=k((Ug,Us)=>{"use strict";var Er=Symbol("SemVer ANY"),Ni=class e{static get ANY(){return Er}constructor(t,n){if(n=Ds(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Di("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===Er?this.value="":this.value=this.operator+this.semver.version,Di("comp",this)}parse(t){let n=this.options.loose?Ns[Ws.COMPARATORLOOSE]:Ns[Ws.COMPARATOR],a=t.match(n);if(!a)throw new TypeError(`Invalid comparator: ${t}`);this.operator=a[1]!==void 0?a[1]:"",this.operator==="="&&(this.operator=""),a[2]?this.semver=new Ms(a[2],this.options.loose):this.semver=Er}toString(){return this.value}test(t){if(Di("Comparator.test",t,this.options.loose),this.semver===Er||t===Er)return!0;if(typeof t=="string")try{t=new Ms(t,this.options)}catch{return!1}return Oi(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new zs(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new zs(this.value,n).test(t.semver):(n=Ds(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Oi(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Oi(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Us.exports=Ni;var Ds=yn(),{safeRe:Ns,t:Ws}=wr(),Oi=Os(),Di=yr(),Ms=Yt(),zs=Wi()});var Wi=k((Hg,Ys)=>{"use strict";var ah=/\s+/g,Mi=class e{constructor(t,n){if(n=sh(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof zi)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(ah," "),this.set=this.raw.split("||").map(a=>this.parseRange(a.trim())).filter(a=>a.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let a=this.set[0];if(this.set=this.set.filter(o=>!Vs(o[0])),this.set.length===0)this.set=[a];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&mh(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let n=this.set[t];for(let a=0;a<n.length;a++)a>0&&(this.formatted+=" "),this.formatted+=n[a].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let a=((this.options.includePrerelease&&dh)|(this.options.loose&&hh))+":"+t,o=Gs.get(a);if(o)return o;let l=this.options.loose,f=l?le[ie.HYPHENRANGELOOSE]:le[ie.HYPHENRANGE];t=t.replace(f,Rh(this.options.includePrerelease)),Q("hyphen replace",t),t=t.replace(le[ie.COMPARATORTRIM],uh),Q("comparator trim",t),t=t.replace(le[ie.TILDETRIM],fh),Q("tilde trim",t),t=t.replace(le[ie.CARETTRIM],ch),Q("caret trim",t);let m=t.split(" ").map(v=>bh(v,this.options)).join(" ").split(/\s+/).map(v=>vh(v,this.options));l&&(m=m.filter(v=>(Q("loose invalid filter",v,this.options),!!v.match(le[ie.COMPARATORLOOSE])))),Q("range list",m);let d=new Map,b=m.map(v=>new zi(v,this.options));for(let v of b){if(Vs(v))return[v];d.set(v.value,v)}d.size>1&&d.has("")&&d.delete("");let w=[...d.values()];return Gs.set(a,w),w}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(a=>Qs(a,n)&&t.set.some(o=>Qs(o,n)&&a.every(l=>o.every(f=>l.intersects(f,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new lh(t,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(Ph(this.set[n],t,this.options))return!0;return!1}};Ys.exports=Mi;var oh=As(),Gs=new oh,sh=yn(),zi=Hs(),Q=yr(),lh=Yt(),{safeRe:le,t:ie,comparatorTrimReplace:uh,tildeTrimReplace:fh,caretTrimReplace:ch}=wr(),{FLAG_INCLUDE_PRERELEASE:dh,FLAG_LOOSE:hh}=pn(),Vs=e=>e.value==="<0.0.0-0",mh=e=>e.value==="",Qs=(e,t)=>{let n=!0,a=e.slice(),o=a.pop();for(;n&&a.length;)n=a.every(l=>o.intersects(l,t)),o=a.pop();return n},bh=(e,t)=>(Q("comp",e,t),e=yh(e,t),Q("caret",e),e=gh(e,t),Q("tildes",e),e=Eh(e,t),Q("xrange",e),e=_h(e,t),Q("stars",e),e),ae=e=>!e||e.toLowerCase()==="x"||e==="*",gh=(e,t)=>e.trim().split(/\s+/).map(n=>ph(n,t)).join(" "),ph=(e,t)=>{let n=t.loose?le[ie.TILDELOOSE]:le[ie.TILDE];return e.replace(n,(a,o,l,f,m)=>{Q("tilde",e,a,o,l,f,m);let d;return ae(o)?d="":ae(l)?d=`>=${o}.0.0 <${+o+1}.0.0-0`:ae(f)?d=`>=${o}.${l}.0 <${o}.${+l+1}.0-0`:m?(Q("replaceTilde pr",m),d=`>=${o}.${l}.${f}-${m} <${o}.${+l+1}.0-0`):d=`>=${o}.${l}.${f} <${o}.${+l+1}.0-0`,Q("tilde return",d),d})},yh=(e,t)=>e.trim().split(/\s+/).map(n=>wh(n,t)).join(" "),wh=(e,t)=>{Q("caret",e,t);let n=t.loose?le[ie.CARETLOOSE]:le[ie.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,(o,l,f,m,d)=>{Q("caret",e,o,l,f,m,d);let b;return ae(l)?b="":ae(f)?b=`>=${l}.0.0${a} <${+l+1}.0.0-0`:ae(m)?l==="0"?b=`>=${l}.${f}.0${a} <${l}.${+f+1}.0-0`:b=`>=${l}.${f}.0${a} <${+l+1}.0.0-0`:d?(Q("replaceCaret pr",d),l==="0"?f==="0"?b=`>=${l}.${f}.${m}-${d} <${l}.${f}.${+m+1}-0`:b=`>=${l}.${f}.${m}-${d} <${l}.${+f+1}.0-0`:b=`>=${l}.${f}.${m}-${d} <${+l+1}.0.0-0`):(Q("no pr"),l==="0"?f==="0"?b=`>=${l}.${f}.${m}${a} <${l}.${f}.${+m+1}-0`:b=`>=${l}.${f}.${m}${a} <${l}.${+f+1}.0-0`:b=`>=${l}.${f}.${m} <${+l+1}.0.0-0`),Q("caret return",b),b})},Eh=(e,t)=>(Q("replaceXRanges",e,t),e.split(/\s+/).map(n=>Sh(n,t)).join(" ")),Sh=(e,t)=>{e=e.trim();let n=t.loose?le[ie.XRANGELOOSE]:le[ie.XRANGE];return e.replace(n,(a,o,l,f,m,d)=>{Q("xRange",e,a,o,l,f,m,d);let b=ae(l),w=b||ae(f),v=w||ae(m),I=v;return o==="="&&I&&(o=""),d=t.includePrerelease?"-0":"",b?o===">"||o==="<"?a="<0.0.0-0":a="*":o&&I?(w&&(f=0),m=0,o===">"?(o=">=",w?(l=+l+1,f=0,m=0):(f=+f+1,m=0)):o==="<="&&(o="<",w?l=+l+1:f=+f+1),o==="<"&&(d="-0"),a=`${o+l}.${f}.${m}${d}`):w?a=`>=${l}.0.0${d} <${+l+1}.0.0-0`:v&&(a=`>=${l}.${f}.0${d} <${l}.${+f+1}.0-0`),Q("xRange return",a),a})},_h=(e,t)=>(Q("replaceStars",e,t),e.trim().replace(le[ie.STAR],"")),vh=(e,t)=>(Q("replaceGTE0",e,t),e.trim().replace(le[t.includePrerelease?ie.GTE0PRE:ie.GTE0],"")),Rh=e=>(t,n,a,o,l,f,m,d,b,w,v,I)=>(ae(a)?n="":ae(o)?n=`>=${a}.0.0${e?"-0":""}`:ae(l)?n=`>=${a}.${o}.0${e?"-0":""}`:f?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,ae(b)?d="":ae(w)?d=`<${+b+1}.0.0-0`:ae(v)?d=`<${b}.${+w+1}.0-0`:I?d=`<=${b}.${w}.${v}-${I}`:e?d=`<${b}.${w}.${+v+1}-0`:d=`<=${d}`,`${n} ${d}`.trim()),Ph=(e,t,n)=>{for(let a=0;a<e.length;a++)if(!e[a].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let a=0;a<e.length;a++)if(Q(e[a].semver),e[a].semver!==zi.ANY&&e[a].semver.prerelease.length>0){let o=e[a].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}});var Js=k((Gg,Xs)=>{"use strict";var Ah=Wi(),Th=(e,t,n)=>{try{t=new Ah(t,n)}catch{return!1}return t.test(e)};Xs.exports=Th});var Ui=k((Vg,Ch)=>{Ch.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.2",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",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","package-from-github-release":"node npm/from-github-release","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:{color:"^4.2.3","detect-libc":"^2.0.4",semver:"^7.7.2"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.2","@img/sharp-darwin-x64":"0.34.2","@img/sharp-libvips-darwin-arm64":"1.1.0","@img/sharp-libvips-darwin-x64":"1.1.0","@img/sharp-libvips-linux-arm":"1.1.0","@img/sharp-libvips-linux-arm64":"1.1.0","@img/sharp-libvips-linux-ppc64":"1.1.0","@img/sharp-libvips-linux-s390x":"1.1.0","@img/sharp-libvips-linux-x64":"1.1.0","@img/sharp-libvips-linuxmusl-arm64":"1.1.0","@img/sharp-libvips-linuxmusl-x64":"1.1.0","@img/sharp-linux-arm":"0.34.2","@img/sharp-linux-arm64":"0.34.2","@img/sharp-linux-s390x":"0.34.2","@img/sharp-linux-x64":"0.34.2","@img/sharp-linuxmusl-arm64":"0.34.2","@img/sharp-linuxmusl-x64":"0.34.2","@img/sharp-wasm32":"0.34.2","@img/sharp-win32-arm64":"0.34.2","@img/sharp-win32-ia32":"0.34.2","@img/sharp-win32-x64":"0.34.2"},devDependencies:{"@emnapi/runtime":"^1.4.3","@img/sharp-libvips-dev":"1.1.0","@img/sharp-libvips-dev-wasm32":"1.1.0","@img/sharp-libvips-win32-arm64":"1.1.0","@img/sharp-libvips-win32-ia32":"1.1.0","@img/sharp-libvips-win32-x64":"1.1.0","@types/node":"*",cc:"^3.0.1",emnapi:"^1.4.3","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.1","license-checker":"^25.0.1",mocha:"^11.4.0","node-addon-api":"^8.3.1",nyc:"^17.1.0",prebuild:"^13.0.1",semistandard:"^17.0.0","tar-fs":"^3.0.8",tsd:"^0.32.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.16.1"},funding:{url:"https://opencollective.com/libvips"},binary:{napi_versions:[9]},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}});var Gi=k((Qg,sl)=>{"use strict";var{spawnSync:Pn}=require("child_process"),{createHash:xh}=require("crypto"),tl=Ss(),Ih=$i(),kh=Js(),Ks=gn(),{config:Lh,engines:Zs,optionalDependencies:Bh}=Ui(),jh=process.env.npm_package_config_libvips||Lh.libvips,rl=tl(jh).version,qh=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],An={encoding:"utf8",shell:!0},$h=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},nl=()=>Ks.isNonGlibcLinuxSync()?Ks.familySync():"",Fh=()=>`${process.platform}${nl()}-${process.arch}`,Xt=()=>{if(il())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:n}=process.env,a=typeof n=="string"?n:nl();return`${t||process.platform}${a}-${e||process.arch}`},Oh=()=>{try{return require(`@img/sharp-libvips-dev-${Xt()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},Dh=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},Nh=()=>{try{return require(`@img/sharp-libvips-dev-${Xt()}/lib`)}catch{try{return require(`@img/sharp-libvips-${Xt()}/lib`)}catch{}}return""},Wh=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!kh(process.versions.node,Zs.node))return{found:process.versions.node,expected:Zs.node}},il=()=>{let{CC:e}=process.env;return!!(e&&e.endsWith("/emcc"))},Mh=()=>process.platform==="darwin"&&process.arch==="x64"?(Pn("sysctl sysctl.proc_translated",An).stdout||"").trim()==="sysctl.proc_translated: 1":!1,el=e=>xh("sha512").update(e).digest("hex"),zh=()=>{try{let e=el(`imgsharp-libvips-${Xt()}`),t=tl(Bh[`@img/sharp-libvips-${Xt()}`],{includePrerelease:!0}).version;return el(`${e}npm:${t}`).slice(0,10)}catch{}return""},Uh=()=>Pn(`node-gyp rebuild --directory=src ${il()?"--nodedir=emscripten":""}`,{...An,stdio:"inherit"}).status,al=()=>process.platform!=="win32"?(Pn("pkg-config --modversion vips-cpp",{...An,env:{...process.env,PKG_CONFIG_PATH:ol()}}).stdout||"").trim():"",ol=()=>process.platform!=="win32"?[(Pn('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',An).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":"):"",Hi=(e,t,n)=>(n&&n(`Detected ${t}, skipping search for globally-installed libvips`),e),Hh=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return Hi(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return Hi(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(Mh())return Hi(!1,"Rosetta",e);let t=al();return!!t&&Ih(t,rl)};sl.exports={minimumLibvipsVersion:rl,prebuiltPlatforms:qh,buildPlatformArch:Xt,buildSharpLibvipsIncludeDir:Oh,buildSharpLibvipsCPlusPlusDir:Dh,buildSharpLibvipsLibDir:Nh,isUnsupportedNodeRuntime:Wh,runtimePlatformArch:Fh,log:$h,yarnLocator:zh,spawnRebuild:Uh,globalLibvipsVersion:al,pkgConfigPath:ol,useGlobalLibvips:Hh}});var _r=k((Yg,ul)=>{"use strict";var{familySync:Gh,versionSync:Vh}=gn(),{runtimePlatformArch:Qh,isUnsupportedNodeRuntime:ll,prebuiltPlatforms:Yh,minimumLibvipsVersion:Xh}=Gi(),At=Qh(),Jh=[`../src/build/Release/sharp-${At}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${At}/sharp.node`,"@img/sharp-wasm32/sharp.node"],Vi,Jt,Sr=[];for(Vi of Jh)try{Jt=require(Vi);break}catch(e){Sr.push(e)}if(Jt&&Vi.startsWith("@img/sharp-linux-x64")&&!Jt._isUsingX64V2()){let e=new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");e.code="Unsupported CPU",Sr.push(e),Jt=null}if(Jt)ul.exports=Jt;else{let[e,t,n]=["linux","darwin","win32"].map(l=>At.startsWith(l)),a=[`Could not load the "sharp" module using the ${At} runtime`];Sr.forEach(l=>{l.code!=="MODULE_NOT_FOUND"&&a.push(`${l.code}: ${l.message}`)});let o=Sr.map(l=>l.message).join(" ");if(a.push("Possible solutions:"),ll()){let{found:l,expected:f}=ll();a.push("- Please upgrade Node.js:",` Found ${l}`,` Requires ${f}`)}else if(Yh.includes(At)){let[l,f]=At.split("-"),m=l.endsWith("musl")?" --libc=musl":"";a.push("- Ensure optional dependencies can qr 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=${l.replace("musl","")}${m} --cpu=${f} sharp`)}else a.push(`- Manually install libvips >= ${Xh}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(o))try{let{config:l}=require(`@img/sharp-libvips-${At}/package`),f=`${Gh()} ${Vh()}`,m=`${l.musl?"musl":"glibc"} ${l.musl||l.glibc}`;a.push("- Update your OS:",` Found ${f}`,` Requires ${m}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(o)&&a.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(o)&&a.push("- Update Homebrew:"," brew update && brew upgrade vips"),Sr.some(l=>l.code==="ERR_DLOPEN_DISABLED")&&a.push("- Run Node.js without using the --no-addons flag"),n&&/The specified procedure could not qr found/.test(o)&&a.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"),a.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(a.join(` `))}});var cl=k((Xg,fl)=>{"use strict";var Kh=require("util"),Qi=require("stream"),Zh=Le();_r();var em=Kh.debuglog("sharp"),Tt=function(e,t){if(arguments.length===1&&!Zh.defined(e))throw new Error("Invalid input");return this instanceof Tt?(Qi.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],rotateBeforePreExtract:!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,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,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:n=>{this.emit("warning",n),em(n)},queueListener:function(n){Tt.queue.emit("change",n)}},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new Tt(e,t)};Object.setPrototypeOf(Tt.prototype,Qi.Duplex.prototype);Object.setPrototypeOf(Tt,Qi.Duplex);function tm(){let e=this.constructor.call(),{debuglog:t,queueListener:n,...a}=this.options;return e.options=structuredClone(a),e.options.debuglog=t,e.options.queueListener=n,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}Object.assign(Tt.prototype,{clone:tm});fl.exports=Tt});var ml=k((Jg,hl)=>{"use strict";var p=Le(),ht=_r(),rm={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"};function dl(e){let{raw:t,density:n,limitInputPixels:a,ignoreIcc:o,unlimited:l,sequentialRead:f,failOn:m,failOnError:d,animated:b,page:w,pages:v,subifd:I,pdfBackground:D,autoOrient:S}=e;return[t,n,a,o,l,f,m,d,b,w,v,I,D,S].some(p.defined)?{raw:t,density:n,limitInputPixels:a,ignoreIcc:o,unlimited:l,sequentialRead:f,failOn:m,failOnError:d,animated:b,page:w,pages:v,subifd:I,pdfBackground:D,autoOrient:S}:void 0}function nm(e,t,n){let a={autoOrient:!1,failOn:"warning",limitInputPixels:Math.pow(16383,2),ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(p.string(e))a.file=e;else if(p.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");a.buffer=e}else if(p.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");a.buffer=Buffer.from(e,0,e.byteLength)}else if(p.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");a.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(p.plainObject(e)&&!p.defined(t))t=e,dl(t)&&(a.buffer=[]);else if(!p.defined(e)&&!p.defined(t)&&p.object(n)&&n.allowStream)a.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map(o=>this._createInputDescriptor(o));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}${p.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(p.object(t)){if(p.defined(t.failOnError))if(p.bool(t.failOnError))a.failOn=t.failOnError?"warning":"none";else throw p.invalidParameterError("failOnError","boolean",t.failOnError);if(p.defined(t.failOn))if(p.string(t.failOn)&&p.inArray(t.failOn,["none","truncated","error","warning"]))a.failOn=t.failOn;else throw p.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(p.defined(t.autoOrient))if(p.bool(t.autoOrient))a.autoOrient=t.autoOrient;else throw p.invalidParameterError("autoOrient","boolean",t.autoOrient);if(p.defined(t.density))if(p.inRange(t.density,1,1e5))a.density=t.density;else throw p.invalidParameterError("density","number between 1 and 100000",t.density);if(p.defined(t.ignoreIcc))if(p.bool(t.ignoreIcc))a.ignoreIcc=t.ignoreIcc;else throw p.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(p.defined(t.limitInputPixels))if(p.bool(t.limitInputPixels))a.limitInputPixels=t.limitInputPixels?Math.pow(16383,2):0;else if(p.integer(t.limitInputPixels)&&p.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))a.limitInputPixels=t.limitInputPixels;else throw p.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(p.defined(t.unlimited))if(p.bool(t.unlimited))a.unlimited=t.unlimited;else throw p.invalidParameterError("unlimited","boolean",t.unlimited);if(p.defined(t.sequentialRead))if(p.bool(t.sequentialRead))a.sequentialRead=t.sequentialRead;else throw p.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(p.defined(t.raw))if(p.object(t.raw)&&p.integer(t.raw.width)&&t.raw.width>0&&p.integer(t.raw.height)&&t.raw.height>0&&p.integer(t.raw.channels)&&p.inRange(t.raw.channels,1,4))switch(a.rawWidth=t.raw.width,a.rawHeight=t.raw.height,a.rawChannels=t.raw.channels,a.rawPremultiplied=!!t.raw.premultiplied,e.constructor){case Uint8Array:case Uint8ClampedArray:a.rawDepth="uchar";break;case Int8Array:a.rawDepth="char";break;case Uint16Array:a.rawDepth="ushort";break;case Int16Array:a.rawDepth="short";break;case Uint32Array:a.rawDepth="uint";break;case Int32Array:a.rawDepth="int";break;case Float32Array:a.rawDepth="float";break;case Float64Array:a.rawDepth="double";break;default:a.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(p.defined(t.animated))if(p.bool(t.animated))a.pages=t.animated?-1:1;else throw p.invalidParameterError("animated","boolean",t.animated);if(p.defined(t.pages))if(p.integer(t.pages)&&p.inRange(t.pages,-1,1e5))a.pages=t.pages;else throw p.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(p.defined(t.page))if(p.integer(t.page)&&p.inRange(t.page,0,1e5))a.page=t.page;else throw p.invalidParameterError("page","integer between 0 and 100000",t.page);if(p.defined(t.level))if(p.integer(t.level)&&p.inRange(t.level,0,256))a.level=t.level;else throw p.invalidParameterError("level","integer between 0 and 256",t.level);if(p.defined(t.subifd))if(p.integer(t.subifd)&&p.inRange(t.subifd,-1,1e5))a.subifd=t.subifd;else throw p.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(p.defined(t.pdfBackground)&&(a.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),p.defined(t.create))if(p.object(t.create)&&p.integer(t.create.width)&&t.create.width>0&&p.integer(t.create.height)&&t.create.height>0&&p.integer(t.create.channels)){if(a.createWidth=t.create.width,a.createHeight=t.create.height,a.createChannels=t.create.channels,p.defined(t.create.noise)){if(!p.object(t.create.noise))throw new Error("Expected noise to qr an object");if(!p.inArray(t.create.noise.type,["gaussian"]))throw new Error("Only gaussian noise is supported at the moment");if(!p.inRange(t.create.channels,1,4))throw p.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(a.createNoiseType=t.create.noise.type,p.number(t.create.noise.mean)&&p.inRange(t.create.noise.mean,0,1e4))a.createNoiseMean=t.create.noise.mean;else throw p.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(p.number(t.create.noise.sigma)&&p.inRange(t.create.noise.sigma,0,1e4))a.createNoiseSigma=t.create.noise.sigma;else throw p.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(p.defined(t.create.background)){if(!p.inRange(t.create.channels,3,4))throw p.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);a.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete a.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(p.defined(t.text))if(p.object(t.text)&&p.string(t.text.text)){if(a.textValue=t.text.text,p.defined(t.text.height)&&p.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(p.defined(t.text.font))if(p.string(t.text.font))a.textFont=t.text.font;else throw p.invalidParameterError("text.font","string",t.text.font);if(p.defined(t.text.fontfile))if(p.string(t.text.fontfile))a.textFontfile=t.text.fontfile;else throw p.invalidParameterError("text.fontfile","string",t.text.fontfile);if(p.defined(t.text.width))if(p.integer(t.text.width)&&t.text.width>0)a.textWidth=t.text.width;else throw p.invalidParameterError("text.width","positive integer",t.text.width);if(p.defined(t.text.height))if(p.integer(t.text.height)&&t.text.height>0)a.textHeight=t.text.height;else throw p.invalidParameterError("text.height","positive integer",t.text.height);if(p.defined(t.text.align))if(p.string(t.text.align)&&p.string(this.constructor.align[t.text.align]))a.textAlign=this.constructor.align[t.text.align];else throw p.invalidParameterError("text.align","valid alignment",t.text.align);if(p.defined(t.text.justify))if(p.bool(t.text.justify))a.textJustify=t.text.justify;else throw p.invalidParameterError("text.justify","boolean",t.text.justify);if(p.defined(t.text.dpi))if(p.integer(t.text.dpi)&&p.inRange(t.text.dpi,1,1e6))a.textDpi=t.text.dpi;else throw p.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(p.defined(t.text.rgba))if(p.bool(t.text.rgba))a.textRgba=t.text.rgba;else throw p.invalidParameterError("text.rgba","bool",t.text.rgba);if(p.defined(t.text.spacing))if(p.integer(t.text.spacing)&&p.inRange(t.text.spacing,-1e6,1e6))a.textSpacing=t.text.spacing;else throw p.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(p.defined(t.text.wrap))if(p.string(t.text.wrap)&&p.inArray(t.text.wrap,["word","char","word-char","none"]))a.textWrap=t.text.wrap;else throw p.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete a.buffer}else throw new Error("Expected a valid string to create an image with text.");if(p.defined(t.join))if(p.defined(this.options.join)){if(p.defined(t.join.animated))if(p.bool(t.join.animated))a.joinAnimated=t.join.animated;else throw p.invalidParameterError("join.animated","boolean",t.join.animated);if(p.defined(t.join.across))if(p.integer(t.join.across)&&p.inRange(t.join.across,1,1e6))a.joinAcross=t.join.across;else throw p.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(p.defined(t.join.shim))if(p.integer(t.join.shim)&&p.inRange(t.join.shim,0,1e6))a.joinShim=t.join.shim;else throw p.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(p.defined(t.join.background)&&(a.joinBackground=this._getBackgroundColourOption(t.join.background)),p.defined(t.join.halign))if(p.string(t.join.halign)&&p.string(this.constructor.align[t.join.halign]))a.joinHalign=this.constructor.align[t.join.halign];else throw p.invalidParameterError("join.halign","valid alignment",t.join.halign);if(p.defined(t.join.valign))if(p.string(t.join.valign)&&p.string(this.constructor.align[t.join.valign]))a.joinValign=this.constructor.align[t.join.valign];else throw p.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to qr an array of images to join")}else if(p.defined(t))throw new Error("Invalid input options "+t);return a}function im(e,t,n){Array.isArray(this.options.input.buffer)?p.buffer(e)?(this.options.input.buffer.length===0&&this.on("finish",()=>{this.streamInFinished=!0}),this.options.input.buffer.push(e),n()):n(new Error("Non-Buffer data on Writable Stream")):n(new Error("Unexpected data on Writable Stream"))}function am(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function om(){return Array.isArray(this.options.input.buffer)}function sm(e){let t=Error();return p.fn(e)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),ht.metadata(this.options,(n,a)=>{n?e(p.nativeError(n,t)):e(null,a)})}):ht.metadata(this.options,(n,a)=>{n?e(p.nativeError(n,t)):e(null,a)}),this):this._isStreamInput()?new Promise((n,a)=>{let o=()=>{this._flattenBufferIn(),ht.metadata(this.options,(l,f)=>{l?a(p.nativeError(l,t)):n(f)})};this.writableFinished?o():this.once("finish",o)}):new Promise((n,a)=>{ht.metadata(this.options,(o,l)=>{o?a(p.nativeError(o,t)):n(l)})})}function lm(e){let t=Error();return p.fn(e)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),ht.stats(this.options,(n,a)=>{n?e(p.nativeError(n,t)):e(null,a)})}):ht.stats(this.options,(n,a)=>{n?e(p.nativeError(n,t)):e(null,a)}),this):this._isStreamInput()?new Promise((n,a)=>{this.on("finish",function(){this._flattenBufferIn(),h