@griddo/cx 11.0.12 → 11.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ GFS4: `),console.error(e)});H[de]||(Os=global[de]||[],Ts(H,Os),H.close=function(
6
6
 
7
7
  see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:a}=await On.checkPaths(e,t,"copy",n);if(await On.checkParentPaths(e,i,t,"copy"),!await Hs(e,t,n))return;let r=Rn.dirname(t);await Ah(r)||await Ph(r),await Ws(a,e,t,n)}async function Hs(e,t,n){return n.filter?n.filter(e,t):!0}async function Ws(e,t,n,i){let o=await(i.dereference?he.stat:he.lstat)(t);if(o.isDirectory())return qh(o,e,t,n,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return jh(o,e,t,n,i);if(o.isSymbolicLink())return Uh(e,t,n,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}async function jh(e,t,n,i,a){if(!t)return Xs(e,n,i,a);if(a.overwrite)return await he.unlink(i),Xs(e,n,i,a);if(a.errorOnExist)throw new Error(`'${i}' already exists`)}async function Xs(e,t,n,i){if(await he.copyFile(t,n),i.preserveTimestamps){Lh(e.mode)&&await Nh(n,e.mode);let a=await he.stat(t);await Fh(n,a.atime,a.mtime)}return he.chmod(n,e.mode)}function Lh(e){return(e&128)===0}function Nh(e,t){return he.chmod(e,t|128)}async function qh(e,t,n,i,a){t||await he.mkdir(i);let o=await he.readdir(n);await Promise.all(o.map(async r=>{let s=Rn.join(n,r),p=Rn.join(i,r);if(!await Hs(s,p,a))return;let{destStat:c}=await On.checkPaths(s,p,"copy",a);return Ws(c,s,p,a)})),t||await he.chmod(i,e.mode)}async function Uh(e,t,n,i){let a=await he.readlink(t);if(i.dereference&&(a=Rn.resolve(process.cwd(),a)),!e)return he.symlink(a,n);let o=null;try{o=await he.readlink(n)}catch(r){if(r.code==="EINVAL"||r.code==="UNKNOWN")return he.symlink(a,n);throw r}if(i.dereference&&(o=Rn.resolve(process.cwd(),o)),On.isSrcSubdir(a,o))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${o}'.`);if(On.isSrcSubdir(o,a))throw new Error(`Cannot overwrite '${o}' with '${a}'.`);return await he.unlink(n),he.symlink(a,n)}Vs.exports=kh});var ec=g((oS,Zs)=>{"use strict";var ge=Wt(),Cn=require("path"),Bh=Le().mkdirsSync,Mh=ka().utimesMillisSync,Tn=Dt();function $h(e,t,n){typeof n=="function"&&(n={filter:n}),n=n||{},n.clobber="clobber"in n?!!n.clobber:!0,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
8
8
 
9
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:a}=Tn.checkPathsSync(e,t,"copy",n);if(Tn.checkParentPathsSync(e,i,t,"copy"),n.filter&&!n.filter(e,t))return;let o=Cn.dirname(t);return ge.existsSync(o)||Bh(o),Ys(a,e,t,n)}function Ys(e,t,n,i){let o=(i.dereference?ge.statSync:ge.lstatSync)(t);if(o.isDirectory())return Jh(o,e,t,n,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return Gh(o,e,t,n,i);if(o.isSymbolicLink())return Qh(e,t,n,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function Gh(e,t,n,i,a){return t?zh(e,n,i,a):Ks(e,n,i,a)}function zh(e,t,n,i){if(i.overwrite)return ge.unlinkSync(n),Ks(e,t,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}function Ks(e,t,n,i){return ge.copyFileSync(t,n),i.preserveTimestamps&&Xh(e.mode,t,n),La(n,e.mode)}function Xh(e,t,n){return Hh(e)&&Wh(n,e),Vh(t,n)}function Hh(e){return(e&128)===0}function Wh(e,t){return La(e,t|128)}function La(e,t){return ge.chmodSync(e,t)}function Vh(e,t){let n=ge.statSync(e);return Mh(t,n.atime,n.mtime)}function Jh(e,t,n,i,a){return t?Qs(n,i,a):Yh(e.mode,n,i,a)}function Yh(e,t,n,i){return ge.mkdirSync(n),Qs(t,n,i),La(n,e)}function Qs(e,t,n){ge.readdirSync(e).forEach(i=>Kh(i,e,t,n))}function Kh(e,t,n,i){let a=Cn.join(t,e),o=Cn.join(n,e);if(i.filter&&!i.filter(a,o))return;let{destStat:r}=Tn.checkPathsSync(a,o,"copy",i);return Ys(r,a,o,i)}function Qh(e,t,n,i){let a=ge.readlinkSync(t);if(i.dereference&&(a=Cn.resolve(process.cwd(),a)),e){let o;try{o=ge.readlinkSync(n)}catch(r){if(r.code==="EINVAL"||r.code==="UNKNOWN")return ge.symlinkSync(a,n);throw r}if(i.dereference&&(o=Cn.resolve(process.cwd(),o)),Tn.isSrcSubdir(a,o))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${o}'.`);if(Tn.isSrcSubdir(o,a))throw new Error(`Cannot overwrite '${o}' with '${a}'.`);return Zh(a,n)}else return ge.symlinkSync(a,n)}function Zh(e,t){return ge.unlinkSync(t),ge.symlinkSync(e,t)}Zs.exports=$h});var mi=g((rS,tc)=>{"use strict";var ex=se().fromPromise;tc.exports={copy:ex(Js()),copySync:ec()}});var In=g((sS,ic)=>{"use strict";var nc=Wt(),tx=se().fromCallback;function nx(e,t){nc.rm(e,{recursive:!0,force:!0},t)}function ix(e){nc.rmSync(e,{recursive:!0,force:!0})}ic.exports={remove:tx(nx),removeSync:ix}});var uc=g((cS,lc)=>{"use strict";var ax=se().fromPromise,rc=ve(),sc=require("path"),cc=Le(),pc=In(),ac=ax(async function(t){let n;try{n=await rc.readdir(t)}catch{return cc.mkdirs(t)}return Promise.all(n.map(i=>pc.remove(sc.join(t,i))))});function oc(e){let t;try{t=rc.readdirSync(e)}catch{return cc.mkdirsSync(e)}t.forEach(n=>{n=sc.join(e,n),pc.removeSync(n)})}lc.exports={emptyDirSync:oc,emptydirSync:oc,emptyDir:ac,emptydir:ac}});var hc=g((pS,fc)=>{"use strict";var ox=se().fromPromise,dc=require("path"),it=ve(),mc=Le();async function rx(e){let t;try{t=await it.stat(e)}catch{}if(t&&t.isFile())return;let n=dc.dirname(e),i=null;try{i=await it.stat(n)}catch(a){if(a.code==="ENOENT"){await mc.mkdirs(n),await it.writeFile(e,"");return}else throw a}i.isDirectory()?await it.writeFile(e,""):await it.readdir(n)}function sx(e){let t;try{t=it.statSync(e)}catch{}if(t&&t.isFile())return;let n=dc.dirname(e);try{it.statSync(n).isDirectory()||it.readdirSync(n)}catch(i){if(i&&i.code==="ENOENT")mc.mkdirsSync(n);else throw i}it.writeFileSync(e,"")}fc.exports={createFile:ox(rx),createFileSync:sx}});var yc=g((lS,bc)=>{"use strict";var cx=se().fromPromise,xc=require("path"),ut=ve(),vc=Le(),{pathExists:px}=lt(),{areIdentical:gc}=Dt();async function lx(e,t){let n;try{n=await ut.lstat(t)}catch{}let i;try{i=await ut.lstat(e)}catch(r){throw r.message=r.message.replace("lstat","ensureLink"),r}if(n&&gc(i,n))return;let a=xc.dirname(t);await px(a)||await vc.mkdirs(a),await ut.link(e,t)}function ux(e,t){let n;try{n=ut.lstatSync(t)}catch{}try{let o=ut.lstatSync(e);if(n&&gc(o,n))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let i=xc.dirname(t);return ut.existsSync(i)||vc.mkdirsSync(i),ut.linkSync(e,t)}bc.exports={createLink:cx(lx),createLinkSync:ux}});var _c=g((uS,wc)=>{"use strict";var dt=require("path"),Pn=ve(),{pathExists:dx}=lt(),mx=se().fromPromise;async function fx(e,t){if(dt.isAbsolute(e)){try{await Pn.lstat(e)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:e,toDst:e}}let n=dt.dirname(t),i=dt.join(n,e);if(await dx(i))return{toCwd:i,toDst:e};try{await Pn.lstat(e)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:e,toDst:dt.relative(n,e)}}function hx(e,t){if(dt.isAbsolute(e)){if(!Pn.existsSync(e))throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}let n=dt.dirname(t),i=dt.join(n,e);if(Pn.existsSync(i))return{toCwd:i,toDst:e};if(!Pn.existsSync(e))throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:dt.relative(n,e)}}wc.exports={symlinkPaths:mx(fx),symlinkPathsSync:hx}});var Dc=g((dS,Ec)=>{"use strict";var Sc=ve(),xx=se().fromPromise;async function vx(e,t){if(t)return t;let n;try{n=await Sc.lstat(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}function gx(e,t){if(t)return t;let n;try{n=Sc.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}Ec.exports={symlinkType:xx(vx),symlinkTypeSync:gx}});var Tc=g((mS,Cc)=>{"use strict";var bx=se().fromPromise,Rc=require("path"),We=ve(),{mkdirs:yx,mkdirsSync:wx}=Le(),{symlinkPaths:_x,symlinkPathsSync:Sx}=_c(),{symlinkType:Ex,symlinkTypeSync:Dx}=Dc(),{pathExists:Rx}=lt(),{areIdentical:Oc}=Dt();async function Ox(e,t,n){let i;try{i=await We.lstat(t)}catch{}if(i&&i.isSymbolicLink()){let[s,p]=await Promise.all([We.stat(e),We.stat(t)]);if(Oc(s,p))return}let a=await _x(e,t);e=a.toDst;let o=await Ex(a.toCwd,n),r=Rc.dirname(t);return await Rx(r)||await yx(r),We.symlink(e,t,o)}function Cx(e,t,n){let i;try{i=We.lstatSync(t)}catch{}if(i&&i.isSymbolicLink()){let s=We.statSync(e),p=We.statSync(t);if(Oc(s,p))return}let a=Sx(e,t);e=a.toDst,n=Dx(a.toCwd,n);let o=Rc.dirname(t);return We.existsSync(o)||wx(o),We.symlinkSync(e,t,n)}Cc.exports={createSymlink:bx(Ox),createSymlinkSync:Cx}});var Nc=g((fS,Lc)=>{"use strict";var{createFile:Ic,createFileSync:Pc}=hc(),{createLink:Ac,createLinkSync:Fc}=yc(),{createSymlink:kc,createSymlinkSync:jc}=Tc();Lc.exports={createFile:Ic,createFileSync:Pc,ensureFile:Ic,ensureFileSync:Pc,createLink:Ac,createLinkSync:Fc,ensureLink:Ac,ensureLinkSync:Fc,createSymlink:kc,createSymlinkSync:jc,ensureSymlink:kc,ensureSymlinkSync:jc}});var fi=g((hS,qc)=>{function Tx(e,{EOL:t=`
9
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:a}=Tn.checkPathsSync(e,t,"copy",n);if(Tn.checkParentPathsSync(e,i,t,"copy"),n.filter&&!n.filter(e,t))return;let o=Cn.dirname(t);return ge.existsSync(o)||Bh(o),Ys(a,e,t,n)}function Ys(e,t,n,i){let o=(i.dereference?ge.statSync:ge.lstatSync)(t);if(o.isDirectory())return Jh(o,e,t,n,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return Gh(o,e,t,n,i);if(o.isSymbolicLink())return Qh(e,t,n,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function Gh(e,t,n,i,a){return t?zh(e,n,i,a):Ks(e,n,i,a)}function zh(e,t,n,i){if(i.overwrite)return ge.unlinkSync(n),Ks(e,t,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}function Ks(e,t,n,i){return ge.copyFileSync(t,n),i.preserveTimestamps&&Xh(e.mode,t,n),La(n,e.mode)}function Xh(e,t,n){return Hh(e)&&Wh(n,e),Vh(t,n)}function Hh(e){return(e&128)===0}function Wh(e,t){return La(e,t|128)}function La(e,t){return ge.chmodSync(e,t)}function Vh(e,t){let n=ge.statSync(e);return Mh(t,n.atime,n.mtime)}function Jh(e,t,n,i,a){return t?Qs(n,i,a):Yh(e.mode,n,i,a)}function Yh(e,t,n,i){return ge.mkdirSync(n),Qs(t,n,i),La(n,e)}function Qs(e,t,n){ge.readdirSync(e).forEach(i=>Kh(i,e,t,n))}function Kh(e,t,n,i){let a=Cn.join(t,e),o=Cn.join(n,e);if(i.filter&&!i.filter(a,o))return;let{destStat:r}=Tn.checkPathsSync(a,o,"copy",i);return Ys(r,a,o,i)}function Qh(e,t,n,i){let a=ge.readlinkSync(t);if(i.dereference&&(a=Cn.resolve(process.cwd(),a)),e){let o;try{o=ge.readlinkSync(n)}catch(r){if(r.code==="EINVAL"||r.code==="UNKNOWN")return ge.symlinkSync(a,n);throw r}if(i.dereference&&(o=Cn.resolve(process.cwd(),o)),Tn.isSrcSubdir(a,o))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${o}'.`);if(Tn.isSrcSubdir(o,a))throw new Error(`Cannot overwrite '${o}' with '${a}'.`);return Zh(a,n)}else return ge.symlinkSync(a,n)}function Zh(e,t){return ge.unlinkSync(t),ge.symlinkSync(e,t)}Zs.exports=$h});var mi=g((rS,tc)=>{"use strict";var ex=se().fromPromise;tc.exports={copy:ex(Js()),copySync:ec()}});var In=g((sS,ic)=>{"use strict";var nc=Wt(),tx=se().fromCallback;function nx(e,t){nc.rm(e,{recursive:!0,force:!0},t)}function ix(e){nc.rmSync(e,{recursive:!0,force:!0})}ic.exports={remove:tx(nx),removeSync:ix}});var uc=g((cS,lc)=>{"use strict";var ax=se().fromPromise,rc=ve(),sc=require("path"),cc=Le(),pc=In(),ac=ax(async function(t){let n;try{n=await rc.readdir(t)}catch{return cc.mkdirs(t)}return Promise.all(n.map(i=>pc.remove(sc.join(t,i))))});function oc(e){let t;try{t=rc.readdirSync(e)}catch{return cc.mkdirsSync(e)}t.forEach(n=>{n=sc.join(e,n),pc.removeSync(n)})}lc.exports={emptyDirSync:oc,emptydirSync:oc,emptyDir:ac,emptydir:ac}});var hc=g((pS,fc)=>{"use strict";var ox=se().fromPromise,dc=require("path"),it=ve(),mc=Le();async function rx(e){let t;try{t=await it.stat(e)}catch{}if(t&&t.isFile())return;let n=dc.dirname(e),i=null;try{i=await it.stat(n)}catch(a){if(a.code==="ENOENT"){await mc.mkdirs(n),await it.writeFile(e,"");return}else throw a}i.isDirectory()?await it.writeFile(e,""):await it.readdir(n)}function sx(e){let t;try{t=it.statSync(e)}catch{}if(t&&t.isFile())return;let n=dc.dirname(e);try{it.statSync(n).isDirectory()||it.readdirSync(n)}catch(i){if(i&&i.code==="ENOENT")mc.mkdirsSync(n);else throw i}it.writeFileSync(e,"")}fc.exports={createFile:ox(rx),createFileSync:sx}});var yc=g((lS,bc)=>{"use strict";var cx=se().fromPromise,xc=require("path"),ut=ve(),vc=Le(),{pathExists:px}=lt(),{areIdentical:gc}=Dt();async function lx(e,t){let n;try{n=await ut.lstat(t)}catch{}let i;try{i=await ut.lstat(e)}catch(r){throw r.message=r.message.replace("lstat","ensureLink"),r}if(n&&gc(i,n))return;let a=xc.dirname(t);await px(a)||await vc.mkdirs(a),await ut.link(e,t)}function ux(e,t){let n;try{n=ut.lstatSync(t)}catch{}try{let o=ut.lstatSync(e);if(n&&gc(o,n))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let i=xc.dirname(t);return ut.existsSync(i)||vc.mkdirsSync(i),ut.linkSync(e,t)}bc.exports={createLink:cx(lx),createLinkSync:ux}});var _c=g((uS,wc)=>{"use strict";var dt=require("path"),Pn=ve(),{pathExists:dx}=lt(),mx=se().fromPromise;async function fx(e,t){if(dt.isAbsolute(e)){try{await Pn.lstat(e)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:e,toDst:e}}let n=dt.dirname(t),i=dt.join(n,e);if(await dx(i))return{toCwd:i,toDst:e};try{await Pn.lstat(e)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:e,toDst:dt.relative(n,e)}}function hx(e,t){if(dt.isAbsolute(e)){if(!Pn.existsSync(e))throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}let n=dt.dirname(t),i=dt.join(n,e);if(Pn.existsSync(i))return{toCwd:i,toDst:e};if(!Pn.existsSync(e))throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:dt.relative(n,e)}}wc.exports={symlinkPaths:mx(fx),symlinkPathsSync:hx}});var Dc=g((dS,Ec)=>{"use strict";var Sc=ve(),xx=se().fromPromise;async function vx(e,t){if(t)return t;let n;try{n=await Sc.lstat(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}function gx(e,t){if(t)return t;let n;try{n=Sc.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}Ec.exports={symlinkType:xx(vx),symlinkTypeSync:gx}});var Tc=g((mS,Cc)=>{"use strict";var bx=se().fromPromise,Rc=require("path"),Ve=ve(),{mkdirs:yx,mkdirsSync:wx}=Le(),{symlinkPaths:_x,symlinkPathsSync:Sx}=_c(),{symlinkType:Ex,symlinkTypeSync:Dx}=Dc(),{pathExists:Rx}=lt(),{areIdentical:Oc}=Dt();async function Ox(e,t,n){let i;try{i=await Ve.lstat(t)}catch{}if(i&&i.isSymbolicLink()){let[s,p]=await Promise.all([Ve.stat(e),Ve.stat(t)]);if(Oc(s,p))return}let a=await _x(e,t);e=a.toDst;let o=await Ex(a.toCwd,n),r=Rc.dirname(t);return await Rx(r)||await yx(r),Ve.symlink(e,t,o)}function Cx(e,t,n){let i;try{i=Ve.lstatSync(t)}catch{}if(i&&i.isSymbolicLink()){let s=Ve.statSync(e),p=Ve.statSync(t);if(Oc(s,p))return}let a=Sx(e,t);e=a.toDst,n=Dx(a.toCwd,n);let o=Rc.dirname(t);return Ve.existsSync(o)||wx(o),Ve.symlinkSync(e,t,n)}Cc.exports={createSymlink:bx(Ox),createSymlinkSync:Cx}});var Nc=g((fS,Lc)=>{"use strict";var{createFile:Ic,createFileSync:Pc}=hc(),{createLink:Ac,createLinkSync:Fc}=yc(),{createSymlink:kc,createSymlinkSync:jc}=Tc();Lc.exports={createFile:Ic,createFileSync:Pc,ensureFile:Ic,ensureFileSync:Pc,createLink:Ac,createLinkSync:Fc,ensureLink:Ac,ensureLinkSync:Fc,createSymlink:kc,createSymlinkSync:jc,ensureSymlink:kc,ensureSymlinkSync:jc}});var fi=g((hS,qc)=>{function Tx(e,{EOL:t=`
10
10
  `,finalEOL:n=!0,replacer:i=null,spaces:a}={}){let o=n?t:"";return JSON.stringify(e,i,a).replace(/\n/g,t)+o}function Ix(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}qc.exports={stringify:Tx,stripBom:Ix}});var $c=g((xS,Mc)=>{var Yt;try{Yt=Wt()}catch{Yt=require("fs")}var hi=se(),{stringify:Uc,stripBom:Bc}=fi();async function Px(e,t={}){typeof t=="string"&&(t={encoding:t});let n=t.fs||Yt,i="throws"in t?t.throws:!0,a=await hi.fromCallback(n.readFile)(e,t);a=Bc(a);let o;try{o=JSON.parse(a,t?t.reviver:null)}catch(r){if(i)throw r.message=`${e}: ${r.message}`,r;return null}return o}var Ax=hi.fromPromise(Px);function Fx(e,t={}){typeof t=="string"&&(t={encoding:t});let n=t.fs||Yt,i="throws"in t?t.throws:!0;try{let a=n.readFileSync(e,t);return a=Bc(a),JSON.parse(a,t.reviver)}catch(a){if(i)throw a.message=`${e}: ${a.message}`,a;return null}}async function kx(e,t,n={}){let i=n.fs||Yt,a=Uc(t,n);await hi.fromCallback(i.writeFile)(e,a,n)}var jx=hi.fromPromise(kx);function Lx(e,t,n={}){let i=n.fs||Yt,a=Uc(t,n);return i.writeFileSync(e,a,n)}var Nx={readFile:Ax,readFileSync:Fx,writeFile:jx,writeFileSync:Lx};Mc.exports=Nx});var zc=g((vS,Gc)=>{"use strict";var xi=$c();Gc.exports={readJson:xi.readFile,readJsonSync:xi.readFileSync,writeJson:xi.writeFile,writeJsonSync:xi.writeFileSync}});var vi=g((gS,Wc)=>{"use strict";var qx=se().fromPromise,Na=ve(),Xc=require("path"),Hc=Le(),Ux=lt().pathExists;async function Bx(e,t,n="utf-8"){let i=Xc.dirname(e);return await Ux(i)||await Hc.mkdirs(i),Na.writeFile(e,t,n)}function Mx(e,...t){let n=Xc.dirname(e);Na.existsSync(n)||Hc.mkdirsSync(n),Na.writeFileSync(e,...t)}Wc.exports={outputFile:qx(Bx),outputFileSync:Mx}});var Jc=g((bS,Vc)=>{"use strict";var{stringify:$x}=fi(),{outputFile:Gx}=vi();async function zx(e,t,n={}){let i=$x(t,n);await Gx(e,i,n)}Vc.exports=zx});var Kc=g((yS,Yc)=>{"use strict";var{stringify:Xx}=fi(),{outputFileSync:Hx}=vi();function Wx(e,t,n){let i=Xx(t,n);Hx(e,i,n)}Yc.exports=Wx});var Zc=g((wS,Qc)=>{"use strict";var Vx=se().fromPromise,be=zc();be.outputJson=Vx(Jc());be.outputJsonSync=Kc();be.outputJSON=be.outputJson;be.outputJSONSync=be.outputJsonSync;be.writeJSON=be.writeJson;be.writeJSONSync=be.writeJsonSync;be.readJSON=be.readJson;be.readJSONSync=be.readJsonSync;Qc.exports=be});var ap=g((_S,ip)=>{"use strict";var Jx=ve(),ep=require("path"),{copy:Yx}=mi(),{remove:np}=In(),{mkdirp:Kx}=Le(),{pathExists:Qx}=lt(),tp=Dt();async function Zx(e,t,n={}){let i=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=await tp.checkPaths(e,t,"move",n);await tp.checkParentPaths(e,a,t,"move");let r=ep.dirname(t);return ep.parse(r).root!==r&&await Kx(r),ev(e,t,i,o)}async function ev(e,t,n,i){if(!i){if(n)await np(t);else if(await Qx(t))throw new Error("dest already exists.")}try{await Jx.rename(e,t)}catch(a){if(a.code!=="EXDEV")throw a;await tv(e,t,n)}}async function tv(e,t,n){return await Yx(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),np(e)}ip.exports=Zx});var pp=g((SS,cp)=>{"use strict";var rp=Wt(),Ua=require("path"),nv=mi().copySync,sp=In().removeSync,iv=Le().mkdirpSync,op=Dt();function av(e,t,n){n=n||{};let i=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=op.checkPathsSync(e,t,"move",n);return op.checkParentPathsSync(e,a,t,"move"),ov(t)||iv(Ua.dirname(t)),rv(e,t,i,o)}function ov(e){let t=Ua.dirname(e);return Ua.parse(t).root===t}function rv(e,t,n,i){if(i)return qa(e,t,n);if(n)return sp(t),qa(e,t,n);if(rp.existsSync(t))throw new Error("dest already exists.");return qa(e,t,n)}function qa(e,t,n){try{rp.renameSync(e,t)}catch(i){if(i.code!=="EXDEV")throw i;return sv(e,t,n)}}function sv(e,t,n){return nv(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),sp(e)}cp.exports=av});var up=g((ES,lp)=>{"use strict";var cv=se().fromPromise;lp.exports={move:cv(ap()),moveSync:pp()}});var Rt=g((DS,dp)=>{"use strict";dp.exports={...ve(),...mi(),...uc(),...Nc(),...Zc(),...Le(),...up(),...vi(),...lt(),...In()}});var yp=g((KS,bp)=>{var Ma=class{constructor(t){this.value=t,this.next=void 0}},$a=class{constructor(){this.clear()}enqueue(t){let n=new Ma(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){let t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};bp.exports=$a});var Ga=g((QS,wp)=>{"use strict";var lv=yp(),uv=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new lv,n=0,i=()=>{n--,t.size>0&&t.dequeue()()},a=async(s,p,...l)=>{n++;let c=(async()=>s(...l))();p(c);try{await c}catch{}i()},o=(s,p,...l)=>{t.enqueue(a.bind(null,s,p,...l)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},r=(s,...p)=>new Promise(l=>{o(s,l,...p)});return Object.defineProperties(r,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),r};wp.exports=uv});var Ep=g((ZS,Sp)=>{"use strict";var _p=Ga(),gi=class extends Error{constructor(t){super(),this.value=t}},dv=async(e,t)=>t(await e),mv=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new gi(t[0]);return!1},fv=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};let i=_p(n.concurrency),a=[...e].map(r=>[r,i(dv,r,t)]),o=_p(n.preserveOrder?1:1/0);try{await Promise.all(a.map(r=>o(mv,r)))}catch(r){if(r instanceof gi)return r.value;throw r}};Sp.exports=fv});var Ip=g((eE,za)=>{"use strict";var Dp=require("path"),bi=require("fs"),{promisify:Rp}=require("util"),hv=Ep(),xv=Rp(bi.stat),vv=Rp(bi.lstat),Op={directory:"isDirectory",file:"isFile"};function Cp({type:e}){if(!(e in Op))throw new Error(`Invalid type specified: ${e}`)}var Tp=(e,t)=>e===void 0||t[Op[e]]();za.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Cp(t);let n=t.allowSymlinks?xv:vv;return hv(e,async i=>{try{let a=await n(Dp.resolve(t.cwd,i));return Tp(t.type,a)}catch{return!1}},t)};za.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Cp(t);let n=t.allowSymlinks?bi.statSync:bi.lstatSync;for(let i of e)try{let a=n(Dp.resolve(t.cwd,i));if(Tp(t.type,a))return i}catch{}}});var Ap=g((tE,Xa)=>{"use strict";var Pp=require("fs"),{promisify:gv}=require("util"),bv=gv(Pp.access);Xa.exports=async e=>{try{return await bv(e),!0}catch{return!1}};Xa.exports.sync=e=>{try{return Pp.accessSync(e),!0}catch{return!1}}});var Wa=g((nE,Kt)=>{"use strict";var mt=require("path"),yi=Ip(),Fp=Ap(),Ha=Symbol("findUp.stop");Kt.exports=async(e,t={})=>{let n=mt.resolve(t.cwd||""),{root:i}=mt.parse(n),a=[].concat(e),o=async r=>{if(typeof e!="function")return yi(a,r);let s=await e(r.cwd);return typeof s=="string"?yi([s],r):s};for(;;){let r=await o({...t,cwd:n});if(r===Ha)return;if(r)return mt.resolve(n,r);if(n===i)return;n=mt.dirname(n)}};Kt.exports.sync=(e,t={})=>{let n=mt.resolve(t.cwd||""),{root:i}=mt.parse(n),a=[].concat(e),o=r=>{if(typeof e!="function")return yi.sync(a,r);let s=e(r.cwd);return typeof s=="string"?yi.sync([s],r):s};for(;;){let r=o({...t,cwd:n});if(r===Ha)return;if(r)return mt.resolve(n,r);if(n===i)return;n=mt.dirname(n)}};Kt.exports.exists=Fp;Kt.exports.sync.exists=Fp.sync;Kt.exports.stop=Ha});var wi=g((iE,Va)=>{"use strict";var kp=require("path"),jp=Wa(),yv=async e=>{let t=await jp("package.json",{cwd:e});return t&&kp.dirname(t)};Va.exports=yv;Va.exports.sync=e=>{let t=jp.sync("package.json",{cwd:e});return t&&kp.dirname(t)}});function K(e,t){let{error:n,message:i,expected:a,hint:o}=e,r=Y.red("[ "+n+" ]"),s=[a,o].filter(Boolean).join(`
11
11
  `);throw console.log(`
12
12
  ${r}
@@ -14,8 +14,8 @@ ${i}
14
14
  ${s}
15
15
 
16
16
  ${Y.red("stack")}
17
- ${JSON.stringify(t,null,2)}`),new An}var An,Ve=Sn(()=>{"use strict";Xt();An=class extends Error{constructor(){super(),this.name="InternalCXError",this.stack=""}}});var oe=g(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.isUndefined=_e.fixName=_e.validateName=_e.validateSingleChar=_e.fixChar=_e.validateChar=void 0;function wv(e){for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(!(n===9||n===10||n===13||n>=32&&n<=55295||n>=57344&&n<=65533)){if(t+1===e.length)return!1;var i=e.charCodeAt(t+1);if(n>=55296&&n<=56319&&i>=56320&&i<=57343){t++;continue}return!1}}return!0}_e.validateChar=wv;function _v(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i===9||i===10||i===13||i>=32&&i<=55295||i>=57344&&i<=65533){t+=e[n];continue}if(n+1===e.length)return t+="\uFFFD",t;var a=e.charCodeAt(n+1);if(i>=55296&&i<=56319&&a>=56320&&a<=57343){t+=e[n]+e[n+1],n++;continue}t+="\uFFFD"}return t}_e.fixChar=_v;function Sv(e){if(e.length===0)return!1;var t=e.charCodeAt(0);if(e.length===1)return t===9||t===10||t===13||t>=32&&t<=55295||t>=57344&&t<=65533;if(e.length!==2)return!1;var n=e.charCodeAt(1);return t>=55296&&t<=56319&&n>=56320&&n<=57343}_e.validateSingleChar=Sv;function Ev(e){if(e.length===0)return!1;var t=e.charCodeAt(0),n=t===58||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533;if(e.length===1)return n;var i=e.charCodeAt(1),a=t>=55296&&t<=56191&&i>=56320&&i<=57343;if(!n&&!a)return!1;for(var o=a?2:1,r=o;r<e.length;r++){var s=e.charCodeAt(r);if(!(s===58||s===95||s===45||s===46||s===183||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||s>=192&&s<=214||s>=216&&s<=246||s>=248&&s<=767||s>=768&&s<=879||s>=880&&s<=893||s>=895&&s<=8191||s>=8204&&s<=8205||s>=8255&&s<=8256||s>=8304&&s<=8591||s>=11264&&s<=12271||s>=12289&&s<=55295||s>=63744&&s<=64975||s>=65008&&s<=65533)){if(r+1===e.length)return!1;var p=e.charCodeAt(r+1);if(s>=55296&&s<=56191&&p>=56320&&p<=57343){r++;continue}return!1}}return!0}_e.validateName=Ev;function Dv(e){var t="";if(e.length===0)return t;var n=e.charCodeAt(0),i=n===58||n===95||n>=65&&n<=90||n>=97&&n<=122||n>=192&&n<=214||n>=216&&n<=246||n>=248&&n<=767||n>=880&&n<=893||n>=895&&n<=8191||n>=8204&&n<=8205||n>=8304&&n<=8591||n>=11264&&n<=12271||n>=12289&&n<=55295||n>=63744&&n<=64975||n>=65008&&n<=65533;if(e.length===1)return i?t=e[0]:t="\uFFFD",t;var a=e.charCodeAt(1),o=n>=55296&&n<=56191&&a>=56320&&a<=57343;o?t=e[0]+e[1]:i?t=e[0]:t="\uFFFD";for(var r=o?2:1,s=r;s<e.length;s++){var p=e.charCodeAt(s);if(p===58||p===95||p===45||p===46||p===183||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||p>=192&&p<=214||p>=216&&p<=246||p>=248&&p<=767||p>=768&&p<=879||p>=880&&p<=893||p>=895&&p<=8191||p>=8204&&p<=8205||p>=8255&&p<=8256||p>=8304&&p<=8591||p>=11264&&p<=12271||p>=12289&&p<=55295||p>=63744&&p<=64975||p>=65008&&p<=65533){t+=e[s];continue}if(s+1===e.length)return t+="\uFFFD",t;var l=e.charCodeAt(s+1);if(p>=55296&&p<=56191&&l>=56320&&l<=57343){t+=e[s]+e[s+1],s++;continue}t+="\uFFFD"}return t}_e.fixName=Dv;function Rv(e){return Object.prototype.toString.call(e)==="[object Undefined]"}_e.isUndefined=Rv});var en=g(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.StringOptions=void 0;var Si=oe(),Ov=function(){function e(t){this.doubleQuotes=!1,this.indent=" ",this.newline=`
18
- `,this.pretty=!0,(0,Si.isUndefined)(t.doubleQuotes)||(this.doubleQuotes=t.doubleQuotes),(0,Si.isUndefined)(t.indent)||(this.indent=t.indent),(0,Si.isUndefined)(t.newline)||(this.newline=t.newline),(0,Si.isUndefined)(t.pretty)||(this.pretty=t.pretty)}return e}();Ei.StringOptions=Ov});var Di=g(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.escapeDoubleQuotes=ke.escapeSingleQuotes=ke.escapeRightAngleBracketsInCdataTerminator=ke.escapeLeftAngleBrackets=ke.escapeAmpersands=void 0;function Cv(e){return e.replace(/&/g,"&amp;")}ke.escapeAmpersands=Cv;function Tv(e){return e.replace(/</g,"&lt;")}ke.escapeLeftAngleBrackets=Tv;function Iv(e){return e.replace(/]]>/g,"]]&gt;")}ke.escapeRightAngleBracketsInCdataTerminator=Iv;function Pv(e){return e.replace(/'/g,"&apos;")}ke.escapeSingleQuotes=Pv;function Av(e){return e.replace(/"/g,"&quot;")}ke.escapeDoubleQuotes=Av});var Qa=g(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});var Fv=me(),qp=Di(),Ya=oe(),kv=function(){function e(t,n,i){this._validation=n,(0,Ya.isUndefined)(i.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=i.replaceInvalidCharsInCharData,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,Ya.fixChar)(t);else if(this._validation&&!(0,Ya.validateChar)(t))throw new Error((0,Fv.getContext)(this.up())+": attribute text"+(' "'+t+'" should not contain characters not')+" allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t=this._charData;return t=(0,qp.escapeAmpersands)(t),t=(0,qp.escapeLeftAngleBrackets)(t),t},e.prototype.up=function(){return this._parent},e}();Ka.default=kv});var Ri=g(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});var Up=me(),Bp=oe(),jv=function(){function e(t,n,i){this._hex=!1,this._validation=n,this._parent=t,this.char=i.char,(0,Bp.isUndefined)(i.hex)||(this.hex=i.hex)}return Object.defineProperty(e.prototype,"char",{get:function(){return this._char},set:function(t){if(this._validation&&!(0,Bp.validateSingleChar)(t))throw new Error((0,Up.getContext)(this.up())+": character reference"+(' "'+t+'" should reference a single character,')+" and this character should be allowed in XML");this._char=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hex",{get:function(){return this._hex},set:function(t){this._hex=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t;if(this._char.length===1)t=this._char.charCodeAt(0);else{var n=this._char.charCodeAt(0);if(n>=55296&&n<=56319&&this._char.length>1){var i=this._char.charCodeAt(1);if(i>=56320&&i<=57343)t=(n-55296)*1024+i-56320+65536;else throw new Error((0,Up.getContext)(this.up())+": character"+(' reference "'+this.char+'" should')+" reference a valid Unicode character")}else t=n}return this._hex?"&#x"+t.toString(16)+";":"&#"+t+";"},e.prototype.up=function(){return this._parent},e}();Za.default=jv});var Oi=g(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});var Lv=me(),Nv=oe(),qv=function(){function e(t,n,i){this._validation=n,this._parent=t,this.name=i.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._validation&&!(0,Nv.validateName)(t))throw new Error((0,Lv.getContext)(this.up())+": entity reference name"+(' "'+t+'" should not contain characters not')+" allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"&"+this._name+";"},e.prototype.up=function(){return this._parent},e}();eo.default=qv});var Ci=g(Fn=>{"use strict";var io=Fn&&Fn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fn,"__esModule",{value:!0});var to=me(),Mp=Di(),Uv=en(),no=oe(),Bv=io(Qa()),Mv=io(Ri()),$v=io(Oi()),Gv=function(){function e(t,n,i){this._validation=n,(0,no.isUndefined)(i.replaceInvalidCharsInName)?this._replaceInvalidCharsInName=!1:this._replaceInvalidCharsInName=i.replaceInvalidCharsInName,this._children=[],this._parent=t,this.name=i.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._replaceInvalidCharsInName){if(t=(0,no.fixName)(t),t.length===0)throw new Error((0,to.getContext)(this.up())+": attribute name should not be empty")}else if(this._validation&&!(0,no.validateName)(t))throw t.length===0?new Error((0,to.getContext)(this.up())+": attribute name should not be empty"):new Error((0,to.getContext)(this.up())+": attribute name"+(' "'+t+'" should not contain characters not')+" allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.charRef=function(t){var n=new Mv.default(this,this._validation,t);return this._children.push(n),n},e.prototype.entityRef=function(t){var n=new $v.default(this,this._validation,t);return this._children.push(n),n},e.prototype.text=function(t){var n=new Bv.default(this,this._validation,t);return this._children.push(n),n},e.prototype.toString=function(t){t===void 0&&(t={});for(var n=new Uv.StringOptions(t),i=n.doubleQuotes?'"':"'",a=this._name+"="+i,o=0,r=this._children;o<r.length;o++){var s=r[o];n.doubleQuotes?a+=(0,Mp.escapeDoubleQuotes)(s.toString()):a+=(0,Mp.escapeSingleQuotes)(s.toString())}return a+=i,a},e.prototype.up=function(){return this._parent},e}();Fn.default=Gv});var oo=g(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});var zv=me(),Xv=oe(),Hv=function(){function e(t,n,i){this._validation=n,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._validation&&!(0,Xv.validateChar)(t))throw new Error((0,zv.getContext)(this.up())+": attribute-list"+(' declaration "'+t+'" should not contain')+" characters not allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!ATTLIST "+this._charData+">"},e.prototype.up=function(){return this._parent},e}();ao.default=Hv});var so=g(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});var Wv=me(),Vv=oe(),Jv=function(){function e(t,n,i){this._validation=n,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._validation&&!(0,Vv.validateChar)(t))throw new Error((0,Wv.getContext)(this.up())+": element declaration"+(' "'+t+'" should not contain characters')+" not allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!ELEMENT "+this._charData+">"},e.prototype.up=function(){return this._parent},e}();ro.default=Jv});var po=g(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});var Yv=me(),Kv=oe(),Qv=function(){function e(t,n,i){this._validation=n,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._validation&&!(0,Kv.validateChar)(t))throw new Error((0,Yv.getContext)(this.up())+": entity declaration"+(' "'+t+'" should not contain characters')+" not allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!ENTITY "+this._charData+">"},e.prototype.up=function(){return this._parent},e}();co.default=Qv});var uo=g(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});var Zv=me(),eg=oe(),tg=function(){function e(t,n,i){this._validation=n,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._validation&&!(0,eg.validateChar)(t))throw new Error((0,Zv.getContext)(this.up())+": notation declaration"+(' "'+t+'" should not contain characters')+" not allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!NOTATION "+this._charData+">"},e.prototype.up=function(){return this._parent},e}();lo.default=tg});var fo=g(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});var ng=me(),ig=oe(),ag=function(){function e(t,n,i){this._validation=n,this._parent=t,this.name=i.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._validation&&!(0,ig.validateName)(t))throw new Error((0,ng.getContext)(this.up())+": parameter entity"+(' reference name "'+t+'" should not contain')+" characters not allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"%"+this._name+";"},e.prototype.up=function(){return this._parent},e}();mo.default=ag});var kn=g(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});var Ti=me(),Ii=oe(),og=function(){function e(t,n,i){this._validation=n,this._parent=t,this.content=i.content,this.target=i.target}return Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){if(!(0,Ii.isUndefined)(t)){if(this._validation&&!(0,Ii.validateChar)(t))throw new Error((0,Ti.getContext)(this.up())+": processing"+(' instruction content "'+t+'" should')+" not contain characters not allowed in XML");if(this._validation&&t.indexOf("?>")!==-1)throw new Error((0,Ti.getContext)(this.up())+": processing"+(' instruction content "'+t+'" should')+" not contain the string '?>'")}this._content=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(t){if(this._validation&&!(0,Ii.validateName)(t))throw new Error((0,Ti.getContext)(this.up())+": processing"+(' instruction target "'+t+'" should')+" not contain characters not allowed in XML names");if(this._validation&&t==="xml")throw new Error((0,Ti.getContext)(this.up())+": processing"+(' instruction target "'+t+'" should')+" not be the string 'xml'");this._target=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return(0,Ii.isUndefined)(this._content)?"<?"+this._target+"?>":"<?"+this._target+" "+this._content+"?>"},e.prototype.up=function(){return this._parent},e}();ho.default=og});var Pi=g(Ct=>{"use strict";var Tt=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.validatePubId=void 0;var ft=me(),rg=en(),Je=oe(),sg=Tt(jn()),cg=Tt(oo()),pg=Tt(so()),lg=Tt(po()),ug=Tt(uo()),dg=Tt(fo()),mg=Tt(kn()),fg=function(){function e(t,n,i){this._pubId=void 0,this._sysId=void 0,this._validation=n,this._children=[],this._parent=t,this.name=i.name,(0,Je.isUndefined)(i.sysId)||(this.sysId=i.sysId),(0,Je.isUndefined)(i.pubId)||(this.pubId=i.pubId)}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._validation&&!(0,Je.validateName)(t))throw new Error((0,ft.getContext)(this.up())+': DTD name "'+t+'" should not contain characters not allowed in XML names');this._name=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pubId",{get:function(){return this._pubId},set:function(t){if(!(0,Je.isUndefined)(t)){if(this._validation&&!$p(t))throw new Error((0,ft.getContext)(this.up())+": DTD public"+(' identifier "'+t+'" should not contain')+" characters not allowed in public identifiers");if(this._validation&&(0,Je.isUndefined)(this._sysId))throw new Error((0,ft.getContext)(this.up())+": DTD public"+(' identifier "'+t+'" should not be defined')+" if system identifier is undefined")}this._pubId=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sysId",{get:function(){return this._sysId},set:function(t){if(!(0,Je.isUndefined)(t)){if(this._validation&&!(0,Je.validateChar)(t))throw new Error((0,ft.getContext)(this.up())+": DTD system"+(' identifier "'+t+'" should not contain')+" characters not allowed in XML");if(this._validation&&t.indexOf("'")!==-1&&t.indexOf('"')!==-1)throw new Error((0,ft.getContext)(this.up())+": DTD system"+(' identifier "'+t+'" should not contain')+" both single quotes and double quotes")}this._sysId=t},enumerable:!1,configurable:!0}),e.prototype.attlist=function(t){var n=new cg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.comment=function(t){var n=new sg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.element=function(t){var n=new pg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.entity=function(t){var n=new lg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.notation=function(t){var n=new ug.default(this,this._validation,t);return this._children.push(n),n},e.prototype.paramEntityRef=function(t){var n=new dg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.procInst=function(t){var n=new mg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.toString=function(t){t===void 0&&(t={});var n=new rg.StringOptions(t),i="<!DOCTYPE "+this._name;if((0,Je.isUndefined)(this._pubId))(0,Je.isUndefined)(this._sysId)||(i+=" ",i=this.appendId("SYSTEM",this._sysId,i,n));else{if((0,Je.isUndefined)(this._sysId))throw new Error((0,ft.getContext)(this.up())+": DTD system identifier is not undefined");i+=" ",i=this.appendId("PUBLIC",this._pubId,i,n),i=this.appendId("",this._sysId,i,n)}if(this._children.length!==0){i+=" [";for(var a=0,o=this._children;a<o.length;a++){var r=o[a];n.pretty&&(i+=n.newline+n.indent),i+=r.toString()}n.pretty&&(i+=n.newline),i+="]>"}else i+=">";return i},e.prototype.up=function(){return this._parent},e.prototype.appendId=function(t,n,i,a){if(i+=t+" ",a.doubleQuotes){if(this._validation&&n.indexOf('"')!==-1)throw new Error((0,ft.getContext)(this.up())+": doubleQuotes option inconsistent with DTD system identifier or public identifier");i+='"'+n+'"'}else{if(this._validation&&n.indexOf("'")!==-1)throw new Error((0,ft.getContext)(this)+": doubleQuotes option inconsistent with DTD system identifier or public identifier");i+="'"+n+"'"}return i},e}();Ct.default=fg;function $p(e){for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(!(n===10||n===13||n===32||n===33||n>=35&&n<=37||n>=39&&n<=47||n>=48&&n<=57||n===58||n===59||n===61||n===63||n>=64&&n<=90||n===95||n>=97&&n<=122))return t+1===e.length,!1}return!0}Ct.validatePubId=$p});var go=g(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});var Gp=me(),xo=oe(),hg=function(){function e(t,n,i){this._validation=n,(0,xo.isUndefined)(i.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=i.replaceInvalidCharsInCharData,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,xo.fixChar)(t);else if(this._validation&&!(0,xo.validateChar)(t))throw new Error((0,Gp.getContext)(this.up())+": CDATA section"+(' "'+t+'" should not contain characters')+" not allowed in XML");if(this._replaceInvalidCharsInCharData)t=t.replace("]]>","\uFFFD\uFFFD\uFFFD");else if(this._validation&&t.indexOf("]]>")!==-1)throw new Error((0,Gp.getContext)(this.up())+": CDATA section"+(' "'+t+'" should not contain the string')+" ']]>'");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<![CDATA["+this._charData+"]]>"},e.prototype.up=function(){return this._parent},e}();vo.default=hg});var _o=g(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});var xg=me(),bo=Di(),yo=oe(),vg=function(){function e(t,n,i){this._validation=n,(0,yo.isUndefined)(i.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=i.replaceInvalidCharsInCharData,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,yo.fixChar)(t);else if(this._validation&&!(0,yo.validateChar)(t))throw new Error((0,xg.getContext)(this.up())+": character data"+('"'+t+'" should not contain characters not')+" allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t=this._charData;return t=(0,bo.escapeAmpersands)(t),t=(0,bo.escapeLeftAngleBrackets)(t),t=(0,bo.escapeRightAngleBracketsInCdataTerminator)(t),t},e.prototype.up=function(){return this._parent},e}();wo.default=vg});var ji=g(qn=>{"use strict";var It=qn&&qn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qn,"__esModule",{value:!0});var Ai=me(),gg=en(),Ln=oe(),zp=It(Ci()),bg=It(go()),Nn=It(_o()),Fi=It(Ri()),yg=It(jn()),ki=It(Oi()),wg=It(kn()),_g=function(){function e(t,n,i){this._validation=n,(0,Ln.isUndefined)(i.replaceInvalidCharsInName)?this._replaceInvalidCharsInName=!1:this._replaceInvalidCharsInName=i.replaceInvalidCharsInName,(0,Ln.isUndefined)(i.useSelfClosingTagIfEmpty)?this._useSelfClosingTagIfEmpty=!0:this._useSelfClosingTagIfEmpty=i.useSelfClosingTagIfEmpty,this._children=[],this._attributeNames=[],this._parent=t,this.name=i.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._replaceInvalidCharsInName){if(t=(0,Ln.fixName)(t),t.length===0)throw new Error((0,Ai.getContext)(this.up())+": element name should not be empty")}else if(this._validation&&!(0,Ln.validateName)(t))throw t.length===0?new Error((0,Ai.getContext)(this.up())+": element name should not be empty"):new Error((0,Ai.getContext)(this.up())+": element name"+(' "'+t+'" should not contain characters not')+" allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.attribute=function(t){if(this._validation&&this._attributeNames.indexOf(t.name)!==-1)throw new Error((0,Ai.getContext)(this.up())+': element "'+this.name+'" already contains an attribute with the'+(' name "'+t.name+'"'));var n=new zp.default(this,this._validation,t);return this._children.push(n),this._attributeNames.push(t.name),n},e.prototype.cdata=function(t){var n=new bg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.charData=function(t){var n=new Nn.default(this,this._validation,t);return this._children.push(n),n},e.prototype.charRef=function(t){var n=new Fi.default(this,this._validation,t);return this._children.push(n),n},e.prototype.comment=function(t){var n=new yg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.element=function(t){var n=new e(this,this._validation,t);return this._children.push(n),n},e.prototype.entityRef=function(t){var n=new ki.default(this,this._validation,t);return this._children.push(n),n},e.prototype.procInst=function(t){var n=new wg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.toString=function(t){return t===void 0&&(t={}),this.toStringWithIndent(t,"")},e.prototype.up=function(){return this._parent},e.prototype.toStringWithIndent=function(t,n){for(var i=new gg.StringOptions(t),a=n+i.indent,o="<"+this._name,r=[],s=0,p=this._children;s<p.length;s++){var l=p[s];l instanceof zp.default?o+=" "+l.toString(t):r.push(l)}if(r.length>0){for(var c="",u=0;u<r.length;u++){var f=r[u],h="";f instanceof e?h+=f.toStringWithIndent(i,a):h+=f.toString();var m=u>0?r[u-1]:void 0;f instanceof Nn.default&&f.toString()===""||(i.pretty&&(this.allSameLineNodes(r)||u>0&&this.onSameLine(f,m)||(h=i.newline+a+h)),c+=h)}i.pretty&&(this.allSameLineNodes(r)||(c+=i.newline+n)),c.length===0&&this._useSelfClosingTagIfEmpty?o+="/>":o+=">"+c+"</"+this._name+">"}else this._useSelfClosingTagIfEmpty?o+="/>":o+="></"+this._name+">";return o},e.prototype.allSameLineNodes=function(t){for(var n=0,i=t;n<i.length;n++){var a=i[n];if(!(a instanceof Fi.default||a instanceof ki.default||a instanceof Nn.default))return!1}return!0},e.prototype.onSameLine=function(t,n){return(t instanceof Fi.default||t instanceof ki.default||t instanceof Nn.default)&&!(0,Ln.isUndefined)(n)&&(n instanceof Fi.default||n instanceof ki.default||n instanceof Nn.default)},e}();qn.default=_g});var me=g(tn=>{"use strict";var Ni=tn&&tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.getContext=void 0;var Sg=Ni(Ci()),Eg=Ni(qi()),Dg=Ni(Pi()),Rg=Ni(ji());function Li(e){if(e instanceof Sg.default)return Li(e.up())+(' > attribute "'+e.name+'"');if(e instanceof Eg.default)return"in XML document";if(e instanceof Dg.default)return Li(e.up())+" > DTD";if(e instanceof Rg.default)return Li(e.up())+(' > element "'+e.name+'"');throw new Error("Unrecognized object of type "+Object.prototype.toString.call(e))}tn.getContext=Li});var jn=g(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});var So=me(),Eo=oe(),Og=function(){function e(t,n,i){this._validation=n,(0,Eo.isUndefined)(i.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=i.replaceInvalidCharsInCharData,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,Eo.fixChar)(t);else if(this._validation&&!(0,Eo.validateChar)(t))throw new Error((0,So.getContext)(this.up())+": comment content"+(' "'+t+'" should not contain characters')+" not allowed in XML");if(this._replaceInvalidCharsInCharData)t=t.replace("--","\uFFFD\uFFFD");else if(this._validation&&t.indexOf("--")!==-1)throw new Error((0,So.getContext)(this.up())+": comment content"+(' "'+t+'" should not contain the string')+" '--'");if(this._replaceInvalidCharsInCharData)t.lastIndexOf("-")===t.length-1&&(t=t.substr(0,t.length-1)+"\uFFFD");else if(this._validation&&t.lastIndexOf("-")===t.length-1)throw new Error((0,So.getContext)(this.up())+": comment content"+(' "'+t+'" should not end with the string')+" '-'");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!--"+this._charData+"-->"},e.prototype.up=function(){return this._parent},e}();Do.default=Og});var Co=g(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});var Ro=me(),Cg=en(),Un=oe(),Tg=function(){function e(t,n,i){this._version="1.0",this._validation=n,this._parent=t,this.encoding=i.encoding,this.standalone=i.standalone,(0,Un.isUndefined)(i.version)||(this.version=i.version)}return Object.defineProperty(e.prototype,"encoding",{get:function(){return this._encoding},set:function(t){if(this._validation&&!(0,Un.isUndefined)(t)&&!Ig(t))throw new Error((0,Ro.getContext)(this.up())+": declaration"+(" encoding attribute "+t+" should be a")+" valid encoding");this._encoding=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"standalone",{get:function(){return this._standalone},set:function(t){if(this._validation&&!(0,Un.isUndefined)(t)&&t!=="yes"&&t!=="no")throw new Error((0,Ro.getContext)(this.up())+": declaration"+(" standalone attribute "+t+" should")+" be the string 'yes' or the string 'no'");this._standalone=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},set:function(t){if(this._validation&&!Pg(t))throw new Error((0,Ro.getContext)(this.up())+": declaration version"+(" attribute "+t+" should be a valid XML")+" version");this._version=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(t){t===void 0&&(t={});var n=new Cg.StringOptions(t),i=n.doubleQuotes?'"':"'",a="<?xml version="+i+this._version+i;return(0,Un.isUndefined)(this._encoding)||(a+=" encoding="+i+this._encoding+i),(0,Un.isUndefined)(this._standalone)||(a+=" standalone="+i+this._standalone+i),a+="?>",a},e.prototype.up=function(){return this._parent},e}();Oo.default=Tg;function Ig(e){if(e.length===0)return!1;var t=e.charCodeAt(0);if(!(t>=65&&t<=90||t>=97&&t<=122))return!1;for(var n=1;n<e.length;n++){var i=e.charCodeAt(n);if(!(i===95||i===45||i===46||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122))return n+1===e.length,!1}return!0}function Pg(e){for(var t=0;t<=9;t++)if(e==="1."+t)return!0;return!1}});var qi=g(Mn=>{"use strict";var $n=Mn&&Mn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mn,"__esModule",{value:!0});var Ag=en(),Fg=oe(),kg=$n(jn()),Xp=$n(Co()),Hp=$n(Pi()),Bn=$n(ji()),jg=$n(kn()),Lg=function(){function e(t){this._children=[],this._validation=(0,Fg.isUndefined)(t.validation)?!0:t.validation}return e.prototype.comment=function(t){var n=new kg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.decl=function(t){if(t===void 0&&(t={}),this._validation&&this._children.length!==0)throw new Error("in XML document: declaration must be the first child");var n=new Xp.default(this,this._validation,t);return this._children.push(n),n},e.prototype.dtd=function(t){var n=this._children.filter(function(a){return a instanceof Bn.default});if(this._validation&&n.length!==0)throw new Error("in XML document: DTD must precede the root element");var i=new Hp.default(this,this._validation,t);return this._children.push(i),i},e.prototype.element=function(t){var n=this._children.filter(function(a){return a instanceof Bn.default});if(this._validation&&n.length!==0)throw new Error("in XML document: only one root element is permitted");var i=new Bn.default(this,this._validation,t);return this._children.push(i),i},e.prototype.procInst=function(t){var n=new jg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.toString=function(t){t===void 0&&(t={});var n=this._children.filter(function(l){return l instanceof Bn.default});if(this._validation&&n.length!==1)throw new Error("in XML document: no more than one root element is permitted");for(var i=new Ag.StringOptions(t),a="",o=0,r=this._children;o<r.length;o++){var s=r[o];s instanceof Xp.default||s instanceof Hp.default||s instanceof Bn.default?a+=s.toString(t):a+=s.toString(),i.pretty&&(a+=i.newline)}var p=a.length-i.newline.length;return a.substr(p)===i.newline&&(a=a.substr(0,p)),a},e}();Mn.default=Lg});var Wp=g(I=>{"use strict";var pe=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I,"__esModule",{value:!0});I.document=I.XmlProcInst=I.XmlEntityRef=I.XmlElement=I.XmlDtdParamEntityRef=I.XmlDtdNotation=I.XmlDtdEntity=I.XmlDtdElement=I.XmlDtdAttlist=I.XmlDtd=I.XmlDocument=I.XmlDecl=I.XmlComment=I.XmlCharRef=I.XmlCharData=I.XmlCdata=I.XmlAttributeText=I.XmlAttribute=void 0;var Ng=pe(qi()),qg=Ci();Object.defineProperty(I,"XmlAttribute",{enumerable:!0,get:function(){return pe(qg).default}});var Ug=Qa();Object.defineProperty(I,"XmlAttributeText",{enumerable:!0,get:function(){return pe(Ug).default}});var Bg=go();Object.defineProperty(I,"XmlCdata",{enumerable:!0,get:function(){return pe(Bg).default}});var Mg=_o();Object.defineProperty(I,"XmlCharData",{enumerable:!0,get:function(){return pe(Mg).default}});var $g=Ri();Object.defineProperty(I,"XmlCharRef",{enumerable:!0,get:function(){return pe($g).default}});var Gg=jn();Object.defineProperty(I,"XmlComment",{enumerable:!0,get:function(){return pe(Gg).default}});var zg=Co();Object.defineProperty(I,"XmlDecl",{enumerable:!0,get:function(){return pe(zg).default}});var Xg=qi();Object.defineProperty(I,"XmlDocument",{enumerable:!0,get:function(){return pe(Xg).default}});var Hg=Pi();Object.defineProperty(I,"XmlDtd",{enumerable:!0,get:function(){return pe(Hg).default}});var Wg=oo();Object.defineProperty(I,"XmlDtdAttlist",{enumerable:!0,get:function(){return pe(Wg).default}});var Vg=so();Object.defineProperty(I,"XmlDtdElement",{enumerable:!0,get:function(){return pe(Vg).default}});var Jg=po();Object.defineProperty(I,"XmlDtdEntity",{enumerable:!0,get:function(){return pe(Jg).default}});var Yg=uo();Object.defineProperty(I,"XmlDtdNotation",{enumerable:!0,get:function(){return pe(Yg).default}});var Kg=fo();Object.defineProperty(I,"XmlDtdParamEntityRef",{enumerable:!0,get:function(){return pe(Kg).default}});var Qg=ji();Object.defineProperty(I,"XmlElement",{enumerable:!0,get:function(){return pe(Qg).default}});var Zg=Oi();Object.defineProperty(I,"XmlEntityRef",{enumerable:!0,get:function(){return pe(Zg).default}});var eb=kn();Object.defineProperty(I,"XmlProcInst",{enumerable:!0,get:function(){return pe(eb).default}});function tb(e){return e===void 0&&(e={}),new Ng.default(e)}I.document=tb});var To=g(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.stringify=le.isMap=le.isSet=le.isFunction=le.isArray=le.isObject=le.isNull=le.isUndefined=void 0;function Vp(e){return Object.prototype.toString.call(e)==="[object Undefined]"}le.isUndefined=Vp;function Jp(e){return Object.prototype.toString.call(e)==="[object Null]"}le.isNull=Jp;function nb(e){return Object.prototype.toString.call(e)==="[object Object]"}le.isObject=nb;function ib(e){return Object.prototype.toString.call(e)==="[object Array]"}le.isArray=ib;function Yp(e){return Object.prototype.toString.call(e)==="[object Function]"}le.isFunction=Yp;function ab(e){return Object.prototype.toString.call(e)==="[object Set]"}le.isSet=ab;function ob(e){return Object.prototype.toString.call(e)==="[object Map]"}le.isMap=ob;function rb(e){return!Vp(e)&&!Jp(e)&&Yp(e?.toString)&&(e=e.toString()),String(e)}le.stringify=rb});var nl=g(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.WrapHandlers=Se.TypeHandlers=Se.FormatOptions=Se.DtdOptions=Se.DeclarationOptions=Se.Options=void 0;var Ne=To(),sb=function(){function e(t){t===void 0&&(t={}),this.aliasString="=",this.attributeString="@",this.cdataInvalidChars=!1,this.cdataKeys=[],this.replaceInvalidChars=!1,this.useSelfClosingTagIfEmpty=!0,this.validation=!0,this.valueString="#",(0,Ne.isUndefined)(t.validation)||(this.validation=t.validation),(0,Ne.isUndefined)(t.aliasString)||(this.aliasString=t.aliasString),(0,Ne.isUndefined)(t.attributeString)||(this.attributeString=t.attributeString),(0,Ne.isUndefined)(t.cdataInvalidChars)||(this.cdataInvalidChars=t.cdataInvalidChars),(0,Ne.isUndefined)(t.cdataKeys)||(this.cdataKeys=t.cdataKeys),this.declaration=new Kp(t.declaration),this.dtd=new Qp(this.validation,t.dtd),this.format=new Zp(t.format),(0,Ne.isUndefined)(t.replaceInvalidChars)||(this.replaceInvalidChars=t.replaceInvalidChars),this.typeHandlers=new el(t.typeHandlers),(0,Ne.isUndefined)(t.useSelfClosingTagIfEmpty)||(this.useSelfClosingTagIfEmpty=t.useSelfClosingTagIfEmpty),(0,Ne.isUndefined)(t.valueString)||(this.valueString=t.valueString),this.wrapHandlers=new tl(t.wrapHandlers)}return e}();Se.Options=sb;var Kp=function(){function e(t){t===void 0&&(t={}),this.include=!0,(0,Ne.isUndefined)(t.include)||(this.include=t.include),this.encoding=t.encoding,this.standalone=t.standalone,this.version=t.version}return e}();Se.DeclarationOptions=Kp;var Qp=function(){function e(t,n){if(n===void 0&&(n={}),this.include=!1,(0,Ne.isUndefined)(n.include)||(this.include=n.include),t&&(0,Ne.isUndefined)(n.name)&&this.include)throw new Error("options.dtd.name should be defined if options.dtd.include is true");this.name=n.name,this.sysId=n.sysId,this.pubId=n.pubId}return e}();Se.DtdOptions=Qp;var Zp=function(){function e(t){t===void 0&&(t={}),this.doubleQuotes=t.doubleQuotes,this.indent=t.indent,this.newline=t.newline,this.pretty=t.pretty}return e}();Se.FormatOptions=Zp;var el=function(){function e(t){t===void 0&&(t={});for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this[n]=t[n])}return e}();Se.TypeHandlers=el;var tl=function(){function e(t){t===void 0&&(t={});for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this[n]=t[n])}return e}();Se.WrapHandlers=tl});var cl=g(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.parse=ht.parseToExistingElement=ht.Absent=void 0;var al=Wp(),ol=nl(),Z=To(),Ui=function(){function e(){}return Object.defineProperty(e,"instance",{get:function(){return e._instance},enumerable:!1,configurable:!0}),e._instance=new e,e}();ht.Absent=Ui;function Bi(e,t){var n=Object.prototype.toString.call(e),i;return Object.prototype.hasOwnProperty.call(t.typeHandlers,"*")&&(i=t.typeHandlers["*"]),Object.prototype.hasOwnProperty.call(t.typeHandlers,n)&&(i=t.typeHandlers[n]),i}function rl(e,t,n){var i=function(r){return n.cdataInvalidChars&&(r.indexOf("<")!==-1||r.indexOf("&")!==-1)||n.cdataKeys.indexOf(t.name)!==-1||n.cdataKeys.indexOf("*")!==-1};if(t instanceof al.XmlElement)if(i(e))for(var a=e.split("]]>"),o=0;o<a.length;o++)i(a[o])?t.cdata({charData:a[o],replaceInvalidCharsInCharData:n.replaceInvalidChars}):t.charData({charData:a[o],replaceInvalidCharsInCharData:n.replaceInvalidChars}),o<a.length-1&&t.charData({charData:"]]>",replaceInvalidCharsInCharData:n.replaceInvalidChars});else t.charData({charData:e,replaceInvalidCharsInCharData:n.replaceInvalidChars});else t.text({charData:e,replaceInvalidCharsInCharData:n.replaceInvalidChars})}function cb(e,t,n,i){var a=n.attribute({name:e,replaceInvalidCharsInName:i.replaceInvalidChars});rl((0,Z.stringify)(t),a,i)}function il(e,t,n,i){if(e===i.aliasString){n.name=(0,Z.stringify)(t);return}if(e.indexOf(i.attributeString)===0&&(0,Z.isObject)(t)){for(var a=0,o=Object.keys(t);a<o.length;a++){var r=o[a],s=t[r],p=Bi(s,i);!(0,Z.isUndefined)(p)&&(s=p(s),p(t)===Ui.instance)||cb(r,s,n,i)}return}if(e.indexOf(i.valueString)===0){Mi(e,t,n,i);return}var l=n;if(!(0,Z.isArray)(t)&&!(0,Z.isSet)(t)){var p=Bi(t,i);if(!(0,Z.isUndefined)(p)&&p(t)===Ui.instance)return;l=n.element({name:e,replaceInvalidCharsInName:i.replaceInvalidChars,useSelfClosingTagIfEmpty:i.useSelfClosingTagIfEmpty})}Mi(e,t,l,i)}function pb(e,t,n){if((0,Z.isMap)(e))e.forEach(function(r,s){il((0,Z.stringify)(s),r,t,n)});else for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i];il(o,e[o],t,n)}}function lb(e,t,n,i){var a;Object.prototype.hasOwnProperty.call(i.wrapHandlers,"*")&&(a=i.wrapHandlers["*"]),Object.prototype.hasOwnProperty.call(i.wrapHandlers,e)&&(a=i.wrapHandlers[e]);var o=e,r=n;if(!(0,Z.isUndefined)(a)){var s=a(o,t);(0,Z.isNull)(s)||(o=s,r=n.element({name:e,replaceInvalidCharsInName:i.replaceInvalidChars,useSelfClosingTagIfEmpty:i.useSelfClosingTagIfEmpty}))}t.forEach(function(p){var l=r;if(!(0,Z.isArray)(p)&&!(0,Z.isSet)(p)){var c=Bi(p,i);if(!(0,Z.isUndefined)(c)&&c(p)===Ui.instance)return;l=r.element({name:o,replaceInvalidCharsInName:i.replaceInvalidChars,useSelfClosingTagIfEmpty:i.useSelfClosingTagIfEmpty})}Mi(o,p,l,i)})}function Mi(e,t,n,i){var a=Bi(t,i);if((0,Z.isUndefined)(a)||(t=a(t)),(0,Z.isObject)(t)||(0,Z.isMap)(t)){pb(t,n,i);return}if((0,Z.isArray)(t)||(0,Z.isSet)(t)){lb(e,t,n,i);return}rl((0,Z.stringify)(t),n,i)}function sl(e,t,n){var i=new ol.Options(n);Mi(e.name,t,e,i)}ht.parseToExistingElement=sl;function ub(e,t,n){var i=new ol.Options(n),a=new al.XmlDocument({validation:i.validation});i.declaration.include&&a.decl(i.declaration),i.dtd.include&&a.dtd({name:i.dtd.name,pubId:i.dtd.pubId,sysId:i.dtd.sysId});var o=a.element({name:e,replaceInvalidCharsInName:i.replaceInvalidChars,useSelfClosingTagIfEmpty:i.useSelfClosingTagIfEmpty});return sl(o,t,n),a.toString(i.format)}ht.parse=ub});var Pt,pl,ll,ul,dl,ml,fl,hl,at=Sn(()=>{"use strict";Pt={error:"ArtifactError",message:"There was a problem with an artifact",expected:"An external process may have has modified or deleted one of the artifacts (files and directories).",hint:"Have there been any recent deployments? These can delete directories from the current render."},pl=e=>({error:"ErrorInSSGBuildProcess",message:`Error in SSG build process: ${JSON.stringify(e)}`,expected:"This can happen if there was a problem with the SSG build process."}),ll=(e,t)=>({error:"LifecycleExecutionError",message:`Exceeded maximum retry attempts (${e}) for ${t} LifeCycle`}),ul={error:"LoginError",message:"There was a problem logging in to the API",expected:"This happens if the API is currently not working or the credentials are incorrect."},dl={error:"NoDomainsFoundError",message:"No domains were found in this instance. The process cannot continue.",expected:"This may happen if the API is not functioning, or the site is not properly configured, or the domains are not registered.",hint:"You can contact the instance administrator."},ml={error:"NoJSConfigFileFound",message:"Could not find jsconfig.json or tsconfig.json",expected:"This can happen if the instance is not properly configured with a jsconfig.json or tsconfig.json file."},fl={error:"RenderUUIDError",message:`Render sentinel file does not exist.
17
+ ${JSON.stringify(t,null,2)}`),new An}var An,Je=Sn(()=>{"use strict";Xt();An=class extends Error{constructor(){super(),this.name="InternalCXError",this.stack=""}}});var oe=g(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.isUndefined=_e.fixName=_e.validateName=_e.validateSingleChar=_e.fixChar=_e.validateChar=void 0;function wv(e){for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(!(n===9||n===10||n===13||n>=32&&n<=55295||n>=57344&&n<=65533)){if(t+1===e.length)return!1;var i=e.charCodeAt(t+1);if(n>=55296&&n<=56319&&i>=56320&&i<=57343){t++;continue}return!1}}return!0}_e.validateChar=wv;function _v(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i===9||i===10||i===13||i>=32&&i<=55295||i>=57344&&i<=65533){t+=e[n];continue}if(n+1===e.length)return t+="\uFFFD",t;var a=e.charCodeAt(n+1);if(i>=55296&&i<=56319&&a>=56320&&a<=57343){t+=e[n]+e[n+1],n++;continue}t+="\uFFFD"}return t}_e.fixChar=_v;function Sv(e){if(e.length===0)return!1;var t=e.charCodeAt(0);if(e.length===1)return t===9||t===10||t===13||t>=32&&t<=55295||t>=57344&&t<=65533;if(e.length!==2)return!1;var n=e.charCodeAt(1);return t>=55296&&t<=56319&&n>=56320&&n<=57343}_e.validateSingleChar=Sv;function Ev(e){if(e.length===0)return!1;var t=e.charCodeAt(0),n=t===58||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533;if(e.length===1)return n;var i=e.charCodeAt(1),a=t>=55296&&t<=56191&&i>=56320&&i<=57343;if(!n&&!a)return!1;for(var o=a?2:1,r=o;r<e.length;r++){var s=e.charCodeAt(r);if(!(s===58||s===95||s===45||s===46||s===183||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||s>=192&&s<=214||s>=216&&s<=246||s>=248&&s<=767||s>=768&&s<=879||s>=880&&s<=893||s>=895&&s<=8191||s>=8204&&s<=8205||s>=8255&&s<=8256||s>=8304&&s<=8591||s>=11264&&s<=12271||s>=12289&&s<=55295||s>=63744&&s<=64975||s>=65008&&s<=65533)){if(r+1===e.length)return!1;var p=e.charCodeAt(r+1);if(s>=55296&&s<=56191&&p>=56320&&p<=57343){r++;continue}return!1}}return!0}_e.validateName=Ev;function Dv(e){var t="";if(e.length===0)return t;var n=e.charCodeAt(0),i=n===58||n===95||n>=65&&n<=90||n>=97&&n<=122||n>=192&&n<=214||n>=216&&n<=246||n>=248&&n<=767||n>=880&&n<=893||n>=895&&n<=8191||n>=8204&&n<=8205||n>=8304&&n<=8591||n>=11264&&n<=12271||n>=12289&&n<=55295||n>=63744&&n<=64975||n>=65008&&n<=65533;if(e.length===1)return i?t=e[0]:t="\uFFFD",t;var a=e.charCodeAt(1),o=n>=55296&&n<=56191&&a>=56320&&a<=57343;o?t=e[0]+e[1]:i?t=e[0]:t="\uFFFD";for(var r=o?2:1,s=r;s<e.length;s++){var p=e.charCodeAt(s);if(p===58||p===95||p===45||p===46||p===183||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||p>=192&&p<=214||p>=216&&p<=246||p>=248&&p<=767||p>=768&&p<=879||p>=880&&p<=893||p>=895&&p<=8191||p>=8204&&p<=8205||p>=8255&&p<=8256||p>=8304&&p<=8591||p>=11264&&p<=12271||p>=12289&&p<=55295||p>=63744&&p<=64975||p>=65008&&p<=65533){t+=e[s];continue}if(s+1===e.length)return t+="\uFFFD",t;var l=e.charCodeAt(s+1);if(p>=55296&&p<=56191&&l>=56320&&l<=57343){t+=e[s]+e[s+1],s++;continue}t+="\uFFFD"}return t}_e.fixName=Dv;function Rv(e){return Object.prototype.toString.call(e)==="[object Undefined]"}_e.isUndefined=Rv});var en=g(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.StringOptions=void 0;var Si=oe(),Ov=function(){function e(t){this.doubleQuotes=!1,this.indent=" ",this.newline=`
18
+ `,this.pretty=!0,(0,Si.isUndefined)(t.doubleQuotes)||(this.doubleQuotes=t.doubleQuotes),(0,Si.isUndefined)(t.indent)||(this.indent=t.indent),(0,Si.isUndefined)(t.newline)||(this.newline=t.newline),(0,Si.isUndefined)(t.pretty)||(this.pretty=t.pretty)}return e}();Ei.StringOptions=Ov});var Di=g(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.escapeDoubleQuotes=ke.escapeSingleQuotes=ke.escapeRightAngleBracketsInCdataTerminator=ke.escapeLeftAngleBrackets=ke.escapeAmpersands=void 0;function Cv(e){return e.replace(/&/g,"&amp;")}ke.escapeAmpersands=Cv;function Tv(e){return e.replace(/</g,"&lt;")}ke.escapeLeftAngleBrackets=Tv;function Iv(e){return e.replace(/]]>/g,"]]&gt;")}ke.escapeRightAngleBracketsInCdataTerminator=Iv;function Pv(e){return e.replace(/'/g,"&apos;")}ke.escapeSingleQuotes=Pv;function Av(e){return e.replace(/"/g,"&quot;")}ke.escapeDoubleQuotes=Av});var Qa=g(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});var Fv=me(),qp=Di(),Ya=oe(),kv=function(){function e(t,n,i){this._validation=n,(0,Ya.isUndefined)(i.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=i.replaceInvalidCharsInCharData,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,Ya.fixChar)(t);else if(this._validation&&!(0,Ya.validateChar)(t))throw new Error((0,Fv.getContext)(this.up())+": attribute text"+(' "'+t+'" should not contain characters not')+" allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t=this._charData;return t=(0,qp.escapeAmpersands)(t),t=(0,qp.escapeLeftAngleBrackets)(t),t},e.prototype.up=function(){return this._parent},e}();Ka.default=kv});var Ri=g(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});var Up=me(),Bp=oe(),jv=function(){function e(t,n,i){this._hex=!1,this._validation=n,this._parent=t,this.char=i.char,(0,Bp.isUndefined)(i.hex)||(this.hex=i.hex)}return Object.defineProperty(e.prototype,"char",{get:function(){return this._char},set:function(t){if(this._validation&&!(0,Bp.validateSingleChar)(t))throw new Error((0,Up.getContext)(this.up())+": character reference"+(' "'+t+'" should reference a single character,')+" and this character should be allowed in XML");this._char=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hex",{get:function(){return this._hex},set:function(t){this._hex=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t;if(this._char.length===1)t=this._char.charCodeAt(0);else{var n=this._char.charCodeAt(0);if(n>=55296&&n<=56319&&this._char.length>1){var i=this._char.charCodeAt(1);if(i>=56320&&i<=57343)t=(n-55296)*1024+i-56320+65536;else throw new Error((0,Up.getContext)(this.up())+": character"+(' reference "'+this.char+'" should')+" reference a valid Unicode character")}else t=n}return this._hex?"&#x"+t.toString(16)+";":"&#"+t+";"},e.prototype.up=function(){return this._parent},e}();Za.default=jv});var Oi=g(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});var Lv=me(),Nv=oe(),qv=function(){function e(t,n,i){this._validation=n,this._parent=t,this.name=i.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._validation&&!(0,Nv.validateName)(t))throw new Error((0,Lv.getContext)(this.up())+": entity reference name"+(' "'+t+'" should not contain characters not')+" allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"&"+this._name+";"},e.prototype.up=function(){return this._parent},e}();eo.default=qv});var Ci=g(Fn=>{"use strict";var io=Fn&&Fn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fn,"__esModule",{value:!0});var to=me(),Mp=Di(),Uv=en(),no=oe(),Bv=io(Qa()),Mv=io(Ri()),$v=io(Oi()),Gv=function(){function e(t,n,i){this._validation=n,(0,no.isUndefined)(i.replaceInvalidCharsInName)?this._replaceInvalidCharsInName=!1:this._replaceInvalidCharsInName=i.replaceInvalidCharsInName,this._children=[],this._parent=t,this.name=i.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._replaceInvalidCharsInName){if(t=(0,no.fixName)(t),t.length===0)throw new Error((0,to.getContext)(this.up())+": attribute name should not be empty")}else if(this._validation&&!(0,no.validateName)(t))throw t.length===0?new Error((0,to.getContext)(this.up())+": attribute name should not be empty"):new Error((0,to.getContext)(this.up())+": attribute name"+(' "'+t+'" should not contain characters not')+" allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.charRef=function(t){var n=new Mv.default(this,this._validation,t);return this._children.push(n),n},e.prototype.entityRef=function(t){var n=new $v.default(this,this._validation,t);return this._children.push(n),n},e.prototype.text=function(t){var n=new Bv.default(this,this._validation,t);return this._children.push(n),n},e.prototype.toString=function(t){t===void 0&&(t={});for(var n=new Uv.StringOptions(t),i=n.doubleQuotes?'"':"'",a=this._name+"="+i,o=0,r=this._children;o<r.length;o++){var s=r[o];n.doubleQuotes?a+=(0,Mp.escapeDoubleQuotes)(s.toString()):a+=(0,Mp.escapeSingleQuotes)(s.toString())}return a+=i,a},e.prototype.up=function(){return this._parent},e}();Fn.default=Gv});var oo=g(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});var zv=me(),Xv=oe(),Hv=function(){function e(t,n,i){this._validation=n,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._validation&&!(0,Xv.validateChar)(t))throw new Error((0,zv.getContext)(this.up())+": attribute-list"+(' declaration "'+t+'" should not contain')+" characters not allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!ATTLIST "+this._charData+">"},e.prototype.up=function(){return this._parent},e}();ao.default=Hv});var so=g(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});var Wv=me(),Vv=oe(),Jv=function(){function e(t,n,i){this._validation=n,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._validation&&!(0,Vv.validateChar)(t))throw new Error((0,Wv.getContext)(this.up())+": element declaration"+(' "'+t+'" should not contain characters')+" not allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!ELEMENT "+this._charData+">"},e.prototype.up=function(){return this._parent},e}();ro.default=Jv});var po=g(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});var Yv=me(),Kv=oe(),Qv=function(){function e(t,n,i){this._validation=n,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._validation&&!(0,Kv.validateChar)(t))throw new Error((0,Yv.getContext)(this.up())+": entity declaration"+(' "'+t+'" should not contain characters')+" not allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!ENTITY "+this._charData+">"},e.prototype.up=function(){return this._parent},e}();co.default=Qv});var uo=g(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});var Zv=me(),eg=oe(),tg=function(){function e(t,n,i){this._validation=n,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._validation&&!(0,eg.validateChar)(t))throw new Error((0,Zv.getContext)(this.up())+": notation declaration"+(' "'+t+'" should not contain characters')+" not allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!NOTATION "+this._charData+">"},e.prototype.up=function(){return this._parent},e}();lo.default=tg});var fo=g(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});var ng=me(),ig=oe(),ag=function(){function e(t,n,i){this._validation=n,this._parent=t,this.name=i.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._validation&&!(0,ig.validateName)(t))throw new Error((0,ng.getContext)(this.up())+": parameter entity"+(' reference name "'+t+'" should not contain')+" characters not allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"%"+this._name+";"},e.prototype.up=function(){return this._parent},e}();mo.default=ag});var kn=g(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});var Ti=me(),Ii=oe(),og=function(){function e(t,n,i){this._validation=n,this._parent=t,this.content=i.content,this.target=i.target}return Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){if(!(0,Ii.isUndefined)(t)){if(this._validation&&!(0,Ii.validateChar)(t))throw new Error((0,Ti.getContext)(this.up())+": processing"+(' instruction content "'+t+'" should')+" not contain characters not allowed in XML");if(this._validation&&t.indexOf("?>")!==-1)throw new Error((0,Ti.getContext)(this.up())+": processing"+(' instruction content "'+t+'" should')+" not contain the string '?>'")}this._content=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(t){if(this._validation&&!(0,Ii.validateName)(t))throw new Error((0,Ti.getContext)(this.up())+": processing"+(' instruction target "'+t+'" should')+" not contain characters not allowed in XML names");if(this._validation&&t==="xml")throw new Error((0,Ti.getContext)(this.up())+": processing"+(' instruction target "'+t+'" should')+" not be the string 'xml'");this._target=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return(0,Ii.isUndefined)(this._content)?"<?"+this._target+"?>":"<?"+this._target+" "+this._content+"?>"},e.prototype.up=function(){return this._parent},e}();ho.default=og});var Pi=g(Ct=>{"use strict";var Tt=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.validatePubId=void 0;var ft=me(),rg=en(),Ye=oe(),sg=Tt(jn()),cg=Tt(oo()),pg=Tt(so()),lg=Tt(po()),ug=Tt(uo()),dg=Tt(fo()),mg=Tt(kn()),fg=function(){function e(t,n,i){this._pubId=void 0,this._sysId=void 0,this._validation=n,this._children=[],this._parent=t,this.name=i.name,(0,Ye.isUndefined)(i.sysId)||(this.sysId=i.sysId),(0,Ye.isUndefined)(i.pubId)||(this.pubId=i.pubId)}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._validation&&!(0,Ye.validateName)(t))throw new Error((0,ft.getContext)(this.up())+': DTD name "'+t+'" should not contain characters not allowed in XML names');this._name=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pubId",{get:function(){return this._pubId},set:function(t){if(!(0,Ye.isUndefined)(t)){if(this._validation&&!$p(t))throw new Error((0,ft.getContext)(this.up())+": DTD public"+(' identifier "'+t+'" should not contain')+" characters not allowed in public identifiers");if(this._validation&&(0,Ye.isUndefined)(this._sysId))throw new Error((0,ft.getContext)(this.up())+": DTD public"+(' identifier "'+t+'" should not be defined')+" if system identifier is undefined")}this._pubId=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sysId",{get:function(){return this._sysId},set:function(t){if(!(0,Ye.isUndefined)(t)){if(this._validation&&!(0,Ye.validateChar)(t))throw new Error((0,ft.getContext)(this.up())+": DTD system"+(' identifier "'+t+'" should not contain')+" characters not allowed in XML");if(this._validation&&t.indexOf("'")!==-1&&t.indexOf('"')!==-1)throw new Error((0,ft.getContext)(this.up())+": DTD system"+(' identifier "'+t+'" should not contain')+" both single quotes and double quotes")}this._sysId=t},enumerable:!1,configurable:!0}),e.prototype.attlist=function(t){var n=new cg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.comment=function(t){var n=new sg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.element=function(t){var n=new pg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.entity=function(t){var n=new lg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.notation=function(t){var n=new ug.default(this,this._validation,t);return this._children.push(n),n},e.prototype.paramEntityRef=function(t){var n=new dg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.procInst=function(t){var n=new mg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.toString=function(t){t===void 0&&(t={});var n=new rg.StringOptions(t),i="<!DOCTYPE "+this._name;if((0,Ye.isUndefined)(this._pubId))(0,Ye.isUndefined)(this._sysId)||(i+=" ",i=this.appendId("SYSTEM",this._sysId,i,n));else{if((0,Ye.isUndefined)(this._sysId))throw new Error((0,ft.getContext)(this.up())+": DTD system identifier is not undefined");i+=" ",i=this.appendId("PUBLIC",this._pubId,i,n),i=this.appendId("",this._sysId,i,n)}if(this._children.length!==0){i+=" [";for(var a=0,o=this._children;a<o.length;a++){var r=o[a];n.pretty&&(i+=n.newline+n.indent),i+=r.toString()}n.pretty&&(i+=n.newline),i+="]>"}else i+=">";return i},e.prototype.up=function(){return this._parent},e.prototype.appendId=function(t,n,i,a){if(i+=t+" ",a.doubleQuotes){if(this._validation&&n.indexOf('"')!==-1)throw new Error((0,ft.getContext)(this.up())+": doubleQuotes option inconsistent with DTD system identifier or public identifier");i+='"'+n+'"'}else{if(this._validation&&n.indexOf("'")!==-1)throw new Error((0,ft.getContext)(this)+": doubleQuotes option inconsistent with DTD system identifier or public identifier");i+="'"+n+"'"}return i},e}();Ct.default=fg;function $p(e){for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(!(n===10||n===13||n===32||n===33||n>=35&&n<=37||n>=39&&n<=47||n>=48&&n<=57||n===58||n===59||n===61||n===63||n>=64&&n<=90||n===95||n>=97&&n<=122))return t+1===e.length,!1}return!0}Ct.validatePubId=$p});var go=g(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});var Gp=me(),xo=oe(),hg=function(){function e(t,n,i){this._validation=n,(0,xo.isUndefined)(i.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=i.replaceInvalidCharsInCharData,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,xo.fixChar)(t);else if(this._validation&&!(0,xo.validateChar)(t))throw new Error((0,Gp.getContext)(this.up())+": CDATA section"+(' "'+t+'" should not contain characters')+" not allowed in XML");if(this._replaceInvalidCharsInCharData)t=t.replace("]]>","\uFFFD\uFFFD\uFFFD");else if(this._validation&&t.indexOf("]]>")!==-1)throw new Error((0,Gp.getContext)(this.up())+": CDATA section"+(' "'+t+'" should not contain the string')+" ']]>'");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<![CDATA["+this._charData+"]]>"},e.prototype.up=function(){return this._parent},e}();vo.default=hg});var _o=g(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});var xg=me(),bo=Di(),yo=oe(),vg=function(){function e(t,n,i){this._validation=n,(0,yo.isUndefined)(i.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=i.replaceInvalidCharsInCharData,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,yo.fixChar)(t);else if(this._validation&&!(0,yo.validateChar)(t))throw new Error((0,xg.getContext)(this.up())+": character data"+('"'+t+'" should not contain characters not')+" allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t=this._charData;return t=(0,bo.escapeAmpersands)(t),t=(0,bo.escapeLeftAngleBrackets)(t),t=(0,bo.escapeRightAngleBracketsInCdataTerminator)(t),t},e.prototype.up=function(){return this._parent},e}();wo.default=vg});var ji=g(qn=>{"use strict";var It=qn&&qn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qn,"__esModule",{value:!0});var Ai=me(),gg=en(),Ln=oe(),zp=It(Ci()),bg=It(go()),Nn=It(_o()),Fi=It(Ri()),yg=It(jn()),ki=It(Oi()),wg=It(kn()),_g=function(){function e(t,n,i){this._validation=n,(0,Ln.isUndefined)(i.replaceInvalidCharsInName)?this._replaceInvalidCharsInName=!1:this._replaceInvalidCharsInName=i.replaceInvalidCharsInName,(0,Ln.isUndefined)(i.useSelfClosingTagIfEmpty)?this._useSelfClosingTagIfEmpty=!0:this._useSelfClosingTagIfEmpty=i.useSelfClosingTagIfEmpty,this._children=[],this._attributeNames=[],this._parent=t,this.name=i.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._replaceInvalidCharsInName){if(t=(0,Ln.fixName)(t),t.length===0)throw new Error((0,Ai.getContext)(this.up())+": element name should not be empty")}else if(this._validation&&!(0,Ln.validateName)(t))throw t.length===0?new Error((0,Ai.getContext)(this.up())+": element name should not be empty"):new Error((0,Ai.getContext)(this.up())+": element name"+(' "'+t+'" should not contain characters not')+" allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.attribute=function(t){if(this._validation&&this._attributeNames.indexOf(t.name)!==-1)throw new Error((0,Ai.getContext)(this.up())+': element "'+this.name+'" already contains an attribute with the'+(' name "'+t.name+'"'));var n=new zp.default(this,this._validation,t);return this._children.push(n),this._attributeNames.push(t.name),n},e.prototype.cdata=function(t){var n=new bg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.charData=function(t){var n=new Nn.default(this,this._validation,t);return this._children.push(n),n},e.prototype.charRef=function(t){var n=new Fi.default(this,this._validation,t);return this._children.push(n),n},e.prototype.comment=function(t){var n=new yg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.element=function(t){var n=new e(this,this._validation,t);return this._children.push(n),n},e.prototype.entityRef=function(t){var n=new ki.default(this,this._validation,t);return this._children.push(n),n},e.prototype.procInst=function(t){var n=new wg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.toString=function(t){return t===void 0&&(t={}),this.toStringWithIndent(t,"")},e.prototype.up=function(){return this._parent},e.prototype.toStringWithIndent=function(t,n){for(var i=new gg.StringOptions(t),a=n+i.indent,o="<"+this._name,r=[],s=0,p=this._children;s<p.length;s++){var l=p[s];l instanceof zp.default?o+=" "+l.toString(t):r.push(l)}if(r.length>0){for(var c="",u=0;u<r.length;u++){var f=r[u],h="";f instanceof e?h+=f.toStringWithIndent(i,a):h+=f.toString();var m=u>0?r[u-1]:void 0;f instanceof Nn.default&&f.toString()===""||(i.pretty&&(this.allSameLineNodes(r)||u>0&&this.onSameLine(f,m)||(h=i.newline+a+h)),c+=h)}i.pretty&&(this.allSameLineNodes(r)||(c+=i.newline+n)),c.length===0&&this._useSelfClosingTagIfEmpty?o+="/>":o+=">"+c+"</"+this._name+">"}else this._useSelfClosingTagIfEmpty?o+="/>":o+="></"+this._name+">";return o},e.prototype.allSameLineNodes=function(t){for(var n=0,i=t;n<i.length;n++){var a=i[n];if(!(a instanceof Fi.default||a instanceof ki.default||a instanceof Nn.default))return!1}return!0},e.prototype.onSameLine=function(t,n){return(t instanceof Fi.default||t instanceof ki.default||t instanceof Nn.default)&&!(0,Ln.isUndefined)(n)&&(n instanceof Fi.default||n instanceof ki.default||n instanceof Nn.default)},e}();qn.default=_g});var me=g(tn=>{"use strict";var Ni=tn&&tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.getContext=void 0;var Sg=Ni(Ci()),Eg=Ni(qi()),Dg=Ni(Pi()),Rg=Ni(ji());function Li(e){if(e instanceof Sg.default)return Li(e.up())+(' > attribute "'+e.name+'"');if(e instanceof Eg.default)return"in XML document";if(e instanceof Dg.default)return Li(e.up())+" > DTD";if(e instanceof Rg.default)return Li(e.up())+(' > element "'+e.name+'"');throw new Error("Unrecognized object of type "+Object.prototype.toString.call(e))}tn.getContext=Li});var jn=g(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});var So=me(),Eo=oe(),Og=function(){function e(t,n,i){this._validation=n,(0,Eo.isUndefined)(i.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=i.replaceInvalidCharsInCharData,this._parent=t,this.charData=i.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,Eo.fixChar)(t);else if(this._validation&&!(0,Eo.validateChar)(t))throw new Error((0,So.getContext)(this.up())+": comment content"+(' "'+t+'" should not contain characters')+" not allowed in XML");if(this._replaceInvalidCharsInCharData)t=t.replace("--","\uFFFD\uFFFD");else if(this._validation&&t.indexOf("--")!==-1)throw new Error((0,So.getContext)(this.up())+": comment content"+(' "'+t+'" should not contain the string')+" '--'");if(this._replaceInvalidCharsInCharData)t.lastIndexOf("-")===t.length-1&&(t=t.substr(0,t.length-1)+"\uFFFD");else if(this._validation&&t.lastIndexOf("-")===t.length-1)throw new Error((0,So.getContext)(this.up())+": comment content"+(' "'+t+'" should not end with the string')+" '-'");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"<!--"+this._charData+"-->"},e.prototype.up=function(){return this._parent},e}();Do.default=Og});var Co=g(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});var Ro=me(),Cg=en(),Un=oe(),Tg=function(){function e(t,n,i){this._version="1.0",this._validation=n,this._parent=t,this.encoding=i.encoding,this.standalone=i.standalone,(0,Un.isUndefined)(i.version)||(this.version=i.version)}return Object.defineProperty(e.prototype,"encoding",{get:function(){return this._encoding},set:function(t){if(this._validation&&!(0,Un.isUndefined)(t)&&!Ig(t))throw new Error((0,Ro.getContext)(this.up())+": declaration"+(" encoding attribute "+t+" should be a")+" valid encoding");this._encoding=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"standalone",{get:function(){return this._standalone},set:function(t){if(this._validation&&!(0,Un.isUndefined)(t)&&t!=="yes"&&t!=="no")throw new Error((0,Ro.getContext)(this.up())+": declaration"+(" standalone attribute "+t+" should")+" be the string 'yes' or the string 'no'");this._standalone=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},set:function(t){if(this._validation&&!Pg(t))throw new Error((0,Ro.getContext)(this.up())+": declaration version"+(" attribute "+t+" should be a valid XML")+" version");this._version=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(t){t===void 0&&(t={});var n=new Cg.StringOptions(t),i=n.doubleQuotes?'"':"'",a="<?xml version="+i+this._version+i;return(0,Un.isUndefined)(this._encoding)||(a+=" encoding="+i+this._encoding+i),(0,Un.isUndefined)(this._standalone)||(a+=" standalone="+i+this._standalone+i),a+="?>",a},e.prototype.up=function(){return this._parent},e}();Oo.default=Tg;function Ig(e){if(e.length===0)return!1;var t=e.charCodeAt(0);if(!(t>=65&&t<=90||t>=97&&t<=122))return!1;for(var n=1;n<e.length;n++){var i=e.charCodeAt(n);if(!(i===95||i===45||i===46||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122))return n+1===e.length,!1}return!0}function Pg(e){for(var t=0;t<=9;t++)if(e==="1."+t)return!0;return!1}});var qi=g(Mn=>{"use strict";var $n=Mn&&Mn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mn,"__esModule",{value:!0});var Ag=en(),Fg=oe(),kg=$n(jn()),Xp=$n(Co()),Hp=$n(Pi()),Bn=$n(ji()),jg=$n(kn()),Lg=function(){function e(t){this._children=[],this._validation=(0,Fg.isUndefined)(t.validation)?!0:t.validation}return e.prototype.comment=function(t){var n=new kg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.decl=function(t){if(t===void 0&&(t={}),this._validation&&this._children.length!==0)throw new Error("in XML document: declaration must be the first child");var n=new Xp.default(this,this._validation,t);return this._children.push(n),n},e.prototype.dtd=function(t){var n=this._children.filter(function(a){return a instanceof Bn.default});if(this._validation&&n.length!==0)throw new Error("in XML document: DTD must precede the root element");var i=new Hp.default(this,this._validation,t);return this._children.push(i),i},e.prototype.element=function(t){var n=this._children.filter(function(a){return a instanceof Bn.default});if(this._validation&&n.length!==0)throw new Error("in XML document: only one root element is permitted");var i=new Bn.default(this,this._validation,t);return this._children.push(i),i},e.prototype.procInst=function(t){var n=new jg.default(this,this._validation,t);return this._children.push(n),n},e.prototype.toString=function(t){t===void 0&&(t={});var n=this._children.filter(function(l){return l instanceof Bn.default});if(this._validation&&n.length!==1)throw new Error("in XML document: no more than one root element is permitted");for(var i=new Ag.StringOptions(t),a="",o=0,r=this._children;o<r.length;o++){var s=r[o];s instanceof Xp.default||s instanceof Hp.default||s instanceof Bn.default?a+=s.toString(t):a+=s.toString(),i.pretty&&(a+=i.newline)}var p=a.length-i.newline.length;return a.substr(p)===i.newline&&(a=a.substr(0,p)),a},e}();Mn.default=Lg});var Wp=g(I=>{"use strict";var pe=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I,"__esModule",{value:!0});I.document=I.XmlProcInst=I.XmlEntityRef=I.XmlElement=I.XmlDtdParamEntityRef=I.XmlDtdNotation=I.XmlDtdEntity=I.XmlDtdElement=I.XmlDtdAttlist=I.XmlDtd=I.XmlDocument=I.XmlDecl=I.XmlComment=I.XmlCharRef=I.XmlCharData=I.XmlCdata=I.XmlAttributeText=I.XmlAttribute=void 0;var Ng=pe(qi()),qg=Ci();Object.defineProperty(I,"XmlAttribute",{enumerable:!0,get:function(){return pe(qg).default}});var Ug=Qa();Object.defineProperty(I,"XmlAttributeText",{enumerable:!0,get:function(){return pe(Ug).default}});var Bg=go();Object.defineProperty(I,"XmlCdata",{enumerable:!0,get:function(){return pe(Bg).default}});var Mg=_o();Object.defineProperty(I,"XmlCharData",{enumerable:!0,get:function(){return pe(Mg).default}});var $g=Ri();Object.defineProperty(I,"XmlCharRef",{enumerable:!0,get:function(){return pe($g).default}});var Gg=jn();Object.defineProperty(I,"XmlComment",{enumerable:!0,get:function(){return pe(Gg).default}});var zg=Co();Object.defineProperty(I,"XmlDecl",{enumerable:!0,get:function(){return pe(zg).default}});var Xg=qi();Object.defineProperty(I,"XmlDocument",{enumerable:!0,get:function(){return pe(Xg).default}});var Hg=Pi();Object.defineProperty(I,"XmlDtd",{enumerable:!0,get:function(){return pe(Hg).default}});var Wg=oo();Object.defineProperty(I,"XmlDtdAttlist",{enumerable:!0,get:function(){return pe(Wg).default}});var Vg=so();Object.defineProperty(I,"XmlDtdElement",{enumerable:!0,get:function(){return pe(Vg).default}});var Jg=po();Object.defineProperty(I,"XmlDtdEntity",{enumerable:!0,get:function(){return pe(Jg).default}});var Yg=uo();Object.defineProperty(I,"XmlDtdNotation",{enumerable:!0,get:function(){return pe(Yg).default}});var Kg=fo();Object.defineProperty(I,"XmlDtdParamEntityRef",{enumerable:!0,get:function(){return pe(Kg).default}});var Qg=ji();Object.defineProperty(I,"XmlElement",{enumerable:!0,get:function(){return pe(Qg).default}});var Zg=Oi();Object.defineProperty(I,"XmlEntityRef",{enumerable:!0,get:function(){return pe(Zg).default}});var eb=kn();Object.defineProperty(I,"XmlProcInst",{enumerable:!0,get:function(){return pe(eb).default}});function tb(e){return e===void 0&&(e={}),new Ng.default(e)}I.document=tb});var To=g(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.stringify=le.isMap=le.isSet=le.isFunction=le.isArray=le.isObject=le.isNull=le.isUndefined=void 0;function Vp(e){return Object.prototype.toString.call(e)==="[object Undefined]"}le.isUndefined=Vp;function Jp(e){return Object.prototype.toString.call(e)==="[object Null]"}le.isNull=Jp;function nb(e){return Object.prototype.toString.call(e)==="[object Object]"}le.isObject=nb;function ib(e){return Object.prototype.toString.call(e)==="[object Array]"}le.isArray=ib;function Yp(e){return Object.prototype.toString.call(e)==="[object Function]"}le.isFunction=Yp;function ab(e){return Object.prototype.toString.call(e)==="[object Set]"}le.isSet=ab;function ob(e){return Object.prototype.toString.call(e)==="[object Map]"}le.isMap=ob;function rb(e){return!Vp(e)&&!Jp(e)&&Yp(e?.toString)&&(e=e.toString()),String(e)}le.stringify=rb});var nl=g(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.WrapHandlers=Se.TypeHandlers=Se.FormatOptions=Se.DtdOptions=Se.DeclarationOptions=Se.Options=void 0;var Ne=To(),sb=function(){function e(t){t===void 0&&(t={}),this.aliasString="=",this.attributeString="@",this.cdataInvalidChars=!1,this.cdataKeys=[],this.replaceInvalidChars=!1,this.useSelfClosingTagIfEmpty=!0,this.validation=!0,this.valueString="#",(0,Ne.isUndefined)(t.validation)||(this.validation=t.validation),(0,Ne.isUndefined)(t.aliasString)||(this.aliasString=t.aliasString),(0,Ne.isUndefined)(t.attributeString)||(this.attributeString=t.attributeString),(0,Ne.isUndefined)(t.cdataInvalidChars)||(this.cdataInvalidChars=t.cdataInvalidChars),(0,Ne.isUndefined)(t.cdataKeys)||(this.cdataKeys=t.cdataKeys),this.declaration=new Kp(t.declaration),this.dtd=new Qp(this.validation,t.dtd),this.format=new Zp(t.format),(0,Ne.isUndefined)(t.replaceInvalidChars)||(this.replaceInvalidChars=t.replaceInvalidChars),this.typeHandlers=new el(t.typeHandlers),(0,Ne.isUndefined)(t.useSelfClosingTagIfEmpty)||(this.useSelfClosingTagIfEmpty=t.useSelfClosingTagIfEmpty),(0,Ne.isUndefined)(t.valueString)||(this.valueString=t.valueString),this.wrapHandlers=new tl(t.wrapHandlers)}return e}();Se.Options=sb;var Kp=function(){function e(t){t===void 0&&(t={}),this.include=!0,(0,Ne.isUndefined)(t.include)||(this.include=t.include),this.encoding=t.encoding,this.standalone=t.standalone,this.version=t.version}return e}();Se.DeclarationOptions=Kp;var Qp=function(){function e(t,n){if(n===void 0&&(n={}),this.include=!1,(0,Ne.isUndefined)(n.include)||(this.include=n.include),t&&(0,Ne.isUndefined)(n.name)&&this.include)throw new Error("options.dtd.name should be defined if options.dtd.include is true");this.name=n.name,this.sysId=n.sysId,this.pubId=n.pubId}return e}();Se.DtdOptions=Qp;var Zp=function(){function e(t){t===void 0&&(t={}),this.doubleQuotes=t.doubleQuotes,this.indent=t.indent,this.newline=t.newline,this.pretty=t.pretty}return e}();Se.FormatOptions=Zp;var el=function(){function e(t){t===void 0&&(t={});for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this[n]=t[n])}return e}();Se.TypeHandlers=el;var tl=function(){function e(t){t===void 0&&(t={});for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this[n]=t[n])}return e}();Se.WrapHandlers=tl});var cl=g(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.parse=ht.parseToExistingElement=ht.Absent=void 0;var al=Wp(),ol=nl(),Z=To(),Ui=function(){function e(){}return Object.defineProperty(e,"instance",{get:function(){return e._instance},enumerable:!1,configurable:!0}),e._instance=new e,e}();ht.Absent=Ui;function Bi(e,t){var n=Object.prototype.toString.call(e),i;return Object.prototype.hasOwnProperty.call(t.typeHandlers,"*")&&(i=t.typeHandlers["*"]),Object.prototype.hasOwnProperty.call(t.typeHandlers,n)&&(i=t.typeHandlers[n]),i}function rl(e,t,n){var i=function(r){return n.cdataInvalidChars&&(r.indexOf("<")!==-1||r.indexOf("&")!==-1)||n.cdataKeys.indexOf(t.name)!==-1||n.cdataKeys.indexOf("*")!==-1};if(t instanceof al.XmlElement)if(i(e))for(var a=e.split("]]>"),o=0;o<a.length;o++)i(a[o])?t.cdata({charData:a[o],replaceInvalidCharsInCharData:n.replaceInvalidChars}):t.charData({charData:a[o],replaceInvalidCharsInCharData:n.replaceInvalidChars}),o<a.length-1&&t.charData({charData:"]]>",replaceInvalidCharsInCharData:n.replaceInvalidChars});else t.charData({charData:e,replaceInvalidCharsInCharData:n.replaceInvalidChars});else t.text({charData:e,replaceInvalidCharsInCharData:n.replaceInvalidChars})}function cb(e,t,n,i){var a=n.attribute({name:e,replaceInvalidCharsInName:i.replaceInvalidChars});rl((0,Z.stringify)(t),a,i)}function il(e,t,n,i){if(e===i.aliasString){n.name=(0,Z.stringify)(t);return}if(e.indexOf(i.attributeString)===0&&(0,Z.isObject)(t)){for(var a=0,o=Object.keys(t);a<o.length;a++){var r=o[a],s=t[r],p=Bi(s,i);!(0,Z.isUndefined)(p)&&(s=p(s),p(t)===Ui.instance)||cb(r,s,n,i)}return}if(e.indexOf(i.valueString)===0){Mi(e,t,n,i);return}var l=n;if(!(0,Z.isArray)(t)&&!(0,Z.isSet)(t)){var p=Bi(t,i);if(!(0,Z.isUndefined)(p)&&p(t)===Ui.instance)return;l=n.element({name:e,replaceInvalidCharsInName:i.replaceInvalidChars,useSelfClosingTagIfEmpty:i.useSelfClosingTagIfEmpty})}Mi(e,t,l,i)}function pb(e,t,n){if((0,Z.isMap)(e))e.forEach(function(r,s){il((0,Z.stringify)(s),r,t,n)});else for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i];il(o,e[o],t,n)}}function lb(e,t,n,i){var a;Object.prototype.hasOwnProperty.call(i.wrapHandlers,"*")&&(a=i.wrapHandlers["*"]),Object.prototype.hasOwnProperty.call(i.wrapHandlers,e)&&(a=i.wrapHandlers[e]);var o=e,r=n;if(!(0,Z.isUndefined)(a)){var s=a(o,t);(0,Z.isNull)(s)||(o=s,r=n.element({name:e,replaceInvalidCharsInName:i.replaceInvalidChars,useSelfClosingTagIfEmpty:i.useSelfClosingTagIfEmpty}))}t.forEach(function(p){var l=r;if(!(0,Z.isArray)(p)&&!(0,Z.isSet)(p)){var c=Bi(p,i);if(!(0,Z.isUndefined)(c)&&c(p)===Ui.instance)return;l=r.element({name:o,replaceInvalidCharsInName:i.replaceInvalidChars,useSelfClosingTagIfEmpty:i.useSelfClosingTagIfEmpty})}Mi(o,p,l,i)})}function Mi(e,t,n,i){var a=Bi(t,i);if((0,Z.isUndefined)(a)||(t=a(t)),(0,Z.isObject)(t)||(0,Z.isMap)(t)){pb(t,n,i);return}if((0,Z.isArray)(t)||(0,Z.isSet)(t)){lb(e,t,n,i);return}rl((0,Z.stringify)(t),n,i)}function sl(e,t,n){var i=new ol.Options(n);Mi(e.name,t,e,i)}ht.parseToExistingElement=sl;function ub(e,t,n){var i=new ol.Options(n),a=new al.XmlDocument({validation:i.validation});i.declaration.include&&a.decl(i.declaration),i.dtd.include&&a.dtd({name:i.dtd.name,pubId:i.dtd.pubId,sysId:i.dtd.sysId});var o=a.element({name:e,replaceInvalidCharsInName:i.replaceInvalidChars,useSelfClosingTagIfEmpty:i.useSelfClosingTagIfEmpty});return sl(o,t,n),a.toString(i.format)}ht.parse=ub});var Pt,pl,ll,ul,dl,ml,fl,hl,at=Sn(()=>{"use strict";Pt={error:"ArtifactError",message:"There was a problem with an artifact",expected:"An external process may have has modified or deleted one of the artifacts (files and directories).",hint:"Have there been any recent deployments? These can delete directories from the current render."},pl=e=>({error:"ErrorInSSGBuildProcess",message:`Error in SSG build process: ${JSON.stringify(e)}`,expected:"This can happen if there was a problem with the SSG build process."}),ll=(e,t)=>({error:"LifecycleExecutionError",message:`Exceeded maximum retry attempts (${e}) for ${t} LifeCycle`}),ul={error:"LoginError",message:"There was a problem logging in to the API",expected:"This happens if the API is currently not working or the credentials are incorrect."},dl={error:"NoDomainsFoundError",message:"No domains were found in this instance. The process cannot continue.",expected:"This may happen if the API is not functioning, or the site is not properly configured, or the domains are not registered.",hint:"You can contact the instance administrator."},ml={error:"NoJSConfigFileFound",message:"Could not find jsconfig.json or tsconfig.json",expected:"This can happen if the instance is not properly configured with a jsconfig.json or tsconfig.json file."},fl={error:"RenderUUIDError",message:`Render sentinel file does not exist.
19
19
  The rendering UUID cannot be read safely.
20
20
  There was probably an instance deployment during the render, and files were deleted.
21
21
 
@@ -24,7 +24,7 @@ The files generated in this render will not be published.`},hl={error:"WriteToSt
24
24
  `).join(`
25
25
  `+o),e.push(a+"m+"+ea.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=gw()+t+" "+e[0]}function gw(){return fe.inspectOpts.hideDate?"":new Date().toISOString()+" "}function bw(...e){return process.stderr.write(Zi.format(...e)+`
26
26
  `)}function yw(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function ww(){return process.env.DEBUG}function _w(e){e.inspectOpts={};let t=Object.keys(fe.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=fe.inspectOpts[t[n]]}ea.exports=rr()(fe);var{formatters:Lu}=ea.exports;Lu.o=function(e){return this.inspectOpts.colors=this.useColors,Zi.inspect(e,this.inspectOpts).split(`
27
- `).map(t=>t.trim()).join(" ")};Lu.O=function(e){return this.inspectOpts.colors=this.useColors,Zi.inspect(e,this.inspectOpts)}});var qu=g((gD,pr)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?pr.exports=Iu():pr.exports=Nu()});var Bu=g((bD,Uu)=>{var Jn;Uu.exports=function(){if(!Jn){try{Jn=qu()("follow-redirects")}catch{}typeof Jn!="function"&&(Jn=function(){})}Jn.apply(null,arguments)}});var Xu=g((yD,wr)=>{var Kn=require("url"),Yn=Kn.URL,Sw=require("http"),Ew=require("https"),fr=require("stream").Writable,hr=require("assert"),Mu=Bu();(function(){var t=typeof process<"u",n=typeof window<"u"&&typeof document<"u",i=Nt(Error.captureStackTrace);!t&&(n||!i)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var xr=!1;try{hr(new Yn(""))}catch(e){xr=e.code==="ERR_INVALID_URL"}var Dw=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],vr=["abort","aborted","connect","error","socket","timeout"],gr=Object.create(null);vr.forEach(function(e){gr[e]=function(t,n,i){this._redirectable.emit(e,t,n,i)}});var ur=Qn("ERR_INVALID_URL","Invalid URL",TypeError),dr=Qn("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Rw=Qn("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",dr),Ow=Qn("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Cw=Qn("ERR_STREAM_WRITE_AFTER_END","write after end"),Tw=fr.prototype.destroy||Gu;function Re(e,t){fr.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(i){try{n._processResponse(i)}catch(a){n.emit("error",a instanceof dr?a:new dr({cause:a}))}},this._performRequest()}Re.prototype=Object.create(fr.prototype);Re.prototype.abort=function(){yr(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Re.prototype.destroy=function(e){return yr(this._currentRequest,e),Tw.call(this,e),this};Re.prototype.write=function(e,t,n){if(this._ending)throw new Cw;if(!Lt(e)&&!Aw(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Nt(t)&&(n=t,t=null),e.length===0){n&&n();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new Ow),this.abort())};Re.prototype.end=function(e,t,n){if(Nt(e)?(n=e,e=t=null):Nt(t)&&(n=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,n);else{var i=this,a=this._currentRequest;this.write(e,t,function(){i._ended=!0,a.end(null,null,n)}),this._ending=!0}};Re.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Re.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Re.prototype.setTimeout=function(e,t){var n=this;function i(r){r.setTimeout(e),r.removeListener("timeout",r.destroy),r.addListener("timeout",r.destroy)}function a(r){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout(function(){n.emit("timeout"),o()},e),i(r)}function o(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",o),n.removeListener("error",o),n.removeListener("response",o),n.removeListener("close",o),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",a)}return t&&this.on("timeout",t),this.socket?a(this.socket):this._currentRequest.once("socket",a),this.on("socket",i),this.on("abort",o),this.on("error",o),this.on("response",o),this.on("close",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Re.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Re.prototype,e,{get:function(){return this._currentRequest[e]}})});Re.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Re.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);i._redirectable=this;for(var a of vr)i.on(a,gr[a]);if(this._currentUrl=/^\//.test(this._options.path)?Kn.format(this._options):this._options.path,this._isRedirect){var o=0,r=this,s=this._requestBodyBuffers;(function p(l){if(i===r._currentRequest)if(l)r.emit("error",l);else if(o<s.length){var c=s[o++];i.finished||i.write(c.data,c.encoding,p)}else r._ended&&i.end()})()}};Re.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(!n||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(yr(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Rw;var i,a=this._options.beforeRedirect;a&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],lr(/^content-/i,this._options.headers));var r=lr(/^host$/i,this._options.headers),s=br(this._currentUrl),p=r||s.host,l=/^\w+:/.test(n)?this._currentUrl:Kn.format(Object.assign(s,{host:p})),c=Iw(n,l);if(Mu("redirecting to",c.href),this._isRedirect=!0,mr(c,this._options),(c.protocol!==s.protocol&&c.protocol!=="https:"||c.host!==p&&!Pw(c.host,p))&&lr(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Nt(a)){var u={headers:e.headers,statusCode:t},f={url:l,method:o,headers:i};a(this._options,u,f),this._sanitizeOptions(this._options)}this._performRequest()};function $u(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach(function(i){var a=i+":",o=n[a]=e[i],r=t[i]=Object.create(o);function s(l,c,u){return Fw(l)?l=mr(l):Lt(l)?l=mr(br(l)):(u=c,c=zu(l),l={protocol:a}),Nt(c)&&(u=c,c=null),c=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},l,c),c.nativeProtocols=n,!Lt(c.host)&&!Lt(c.hostname)&&(c.hostname="::1"),hr.equal(c.protocol,a,"protocol mismatch"),Mu("options",c),new Re(c,u)}function p(l,c,u){var f=r.request(l,c,u);return f.end(),f}Object.defineProperties(r,{request:{value:s,configurable:!0,enumerable:!0,writable:!0},get:{value:p,configurable:!0,enumerable:!0,writable:!0}})}),t}function Gu(){}function br(e){var t;if(xr)t=new Yn(e);else if(t=zu(Kn.parse(e)),!Lt(t.protocol))throw new ur({input:e});return t}function Iw(e,t){return xr?new Yn(e,t):br(Kn.resolve(t,e))}function zu(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new ur({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new ur({input:e.href||e});return e}function mr(e,t){var n=t||{};for(var i of Dw)n[i]=e[i];return n.hostname.startsWith("[")&&(n.hostname=n.hostname.slice(1,-1)),n.port!==""&&(n.port=Number(n.port)),n.path=n.search?n.pathname+n.search:n.pathname,n}function lr(e,t){var n;for(var i in t)e.test(i)&&(n=t[i],delete t[i]);return n===null||typeof n>"u"?void 0:String(n).trim()}function Qn(e,t,n){function i(a){Nt(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,a||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(n||Error),Object.defineProperties(i.prototype,{constructor:{value:i,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),i}function yr(e,t){for(var n of vr)e.removeListener(n,gr[n]);e.on("error",Gu),e.destroy(t)}function Pw(e,t){hr(Lt(e)&&Lt(t));var n=e.length-t.length-1;return n>0&&e[n]==="."&&e.endsWith(t)}function Lt(e){return typeof e=="string"||e instanceof String}function Nt(e){return typeof e=="function"}function Aw(e){return typeof e=="object"&&"length"in e}function Fw(e){return Yn&&e instanceof Yn}wr.exports=$u({http:Sw,https:Ew});wr.exports.wrap=$u});function wn(e=""){return h_?Vr.default.resolve(Yr.default.sync(__dirname),"../../../",e):Vr.default.resolve(Yr.default.sync(__dirname),"../griddo-components",e)}function x_(){let e=Jr.default.sync("jsconfig.json",{cwd:wn()});return Jr.default.sync("tsconfig.json",{cwd:wn()})||e}function v_(){let e=require(x_());return e||K(ml),Object.keys(e.compilerOptions?.paths).reduce((t,n)=>{let[i]=n.split("/"),[a]=e.compilerOptions.paths[n],[o]=a.split("/*"),r=wn(o);return{...t,[i]:r}},{"@griddo-instance":`${wn()}/src/index.js`})}var Vr,Jr,Yr,h_,WC,Kd=Sn(()=>{"use strict";Vr=R(require("node:path")),Jr=R(Wa()),Yr=R(wi());Ve();at();h_=__dirname.includes("node_modules"),WC=v_()});var em={};ps(em,{default:()=>S_});var Ke,da,Zd,ua,g_,b_,y_,Qd,w_,__,S_,tm=Sn(()=>{"use strict";Ke=R(require("node:path")),da=R(wi());Kd();Zd=da.default.sync(Ke.default.resolve(__dirname,"../..")),ua=da.default.sync(__dirname),g_=Ke.default.resolve(da.default.sync(__dirname)),b_=Ke.default.resolve(ua,".cx-cache"),y_=wn(),Qd=Ke.default.join(Zd,"exports/sites"),{version:w_}=require(Ke.default.join(ua,"package.json")),__={proDomain:"pro-",griddoVersion:w_,buildReportFileName:"build-report.json",paths:e=>({__cache:Ke.default.join(b_,e||""),__components:y_,__cx:ua,__exports:Ke.default.join(Qd,e||""),__root:Zd,__ssg:g_,__exports_dist:e?Ke.default.join(Qd,e,"dist"):"",__cx_dist:Ke.default.join(ua,"dist")})},S_=__});Xt();var ya=R(require("node:path"));var nf=require("node:child_process"),ct=R(require("node:path")),af=R(En()),Ge=R(Rt());var sm=R(En());var Qe=R(require("node:fs")),Mt=R(require("node:path")),ma=R(Rt());Xt();var Ba,mp,fp,hp,xp=!0;typeof process<"u"&&({FORCE_COLOR:Ba,NODE_DISABLE_COLORS:mp,NO_COLOR:fp,TERM:hp}=process.env||{},xp=process.stdout&&process.stdout.isTTY);var pv={enabled:!mp&&fp==null&&hp!=="dumb"&&(Ba!=null&&Ba!=="0"||xp)};function G(e,t){let n=new RegExp(`\\x1b\\[${t}m`,"g"),i=`\x1B[${e}m`,a=`\x1B[${t}m`;return function(o){return!pv.enabled||o==null?o:i+(~(""+o).indexOf(a)?o.replace(n,a+i):o)+a}}var RS=G(0,0),OS=G(1,22),CS=G(2,22),TS=G(3,23),IS=G(4,24),PS=G(7,27),AS=G(8,28),FS=G(9,29),vp=G(30,39),kS=G(31,39),jS=G(32,39),LS=G(33,39),NS=G(34,39),qS=G(35,39),US=G(36,39),BS=G(37,39),MS=G(90,39),$S=G(90,39),GS=G(40,49),gp=G(41,49),zS=G(42,49),XS=G(43,49),HS=G(44,49),WS=G(45,49),VS=G(46,49),JS=G(47,49);var nm=R(wi());Ve();Xt();function U(e){O.GRIDDO_VERBOSE_LOGS&&console.log(Y.yellow("verbose"),Y.dim(e.replace(/(\s)\s+/g,"$1").trim()))}function Qt(e,t="",n=1,i=1){let a=e.split(`
27
+ `).map(t=>t.trim()).join(" ")};Lu.O=function(e){return this.inspectOpts.colors=this.useColors,Zi.inspect(e,this.inspectOpts)}});var qu=g((gD,pr)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?pr.exports=Iu():pr.exports=Nu()});var Bu=g((bD,Uu)=>{var Jn;Uu.exports=function(){if(!Jn){try{Jn=qu()("follow-redirects")}catch{}typeof Jn!="function"&&(Jn=function(){})}Jn.apply(null,arguments)}});var Xu=g((yD,wr)=>{var Kn=require("url"),Yn=Kn.URL,Sw=require("http"),Ew=require("https"),fr=require("stream").Writable,hr=require("assert"),Mu=Bu();(function(){var t=typeof process<"u",n=typeof window<"u"&&typeof document<"u",i=Nt(Error.captureStackTrace);!t&&(n||!i)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var xr=!1;try{hr(new Yn(""))}catch(e){xr=e.code==="ERR_INVALID_URL"}var Dw=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],vr=["abort","aborted","connect","error","socket","timeout"],gr=Object.create(null);vr.forEach(function(e){gr[e]=function(t,n,i){this._redirectable.emit(e,t,n,i)}});var ur=Qn("ERR_INVALID_URL","Invalid URL",TypeError),dr=Qn("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Rw=Qn("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",dr),Ow=Qn("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Cw=Qn("ERR_STREAM_WRITE_AFTER_END","write after end"),Tw=fr.prototype.destroy||Gu;function Re(e,t){fr.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(i){try{n._processResponse(i)}catch(a){n.emit("error",a instanceof dr?a:new dr({cause:a}))}},this._performRequest()}Re.prototype=Object.create(fr.prototype);Re.prototype.abort=function(){yr(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Re.prototype.destroy=function(e){return yr(this._currentRequest,e),Tw.call(this,e),this};Re.prototype.write=function(e,t,n){if(this._ending)throw new Cw;if(!Lt(e)&&!Aw(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Nt(t)&&(n=t,t=null),e.length===0){n&&n();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new Ow),this.abort())};Re.prototype.end=function(e,t,n){if(Nt(e)?(n=e,e=t=null):Nt(t)&&(n=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,n);else{var i=this,a=this._currentRequest;this.write(e,t,function(){i._ended=!0,a.end(null,null,n)}),this._ending=!0}};Re.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Re.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Re.prototype.setTimeout=function(e,t){var n=this;function i(r){r.setTimeout(e),r.removeListener("timeout",r.destroy),r.addListener("timeout",r.destroy)}function a(r){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout(function(){n.emit("timeout"),o()},e),i(r)}function o(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",o),n.removeListener("error",o),n.removeListener("response",o),n.removeListener("close",o),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",a)}return t&&this.on("timeout",t),this.socket?a(this.socket):this._currentRequest.once("socket",a),this.on("socket",i),this.on("abort",o),this.on("error",o),this.on("response",o),this.on("close",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Re.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Re.prototype,e,{get:function(){return this._currentRequest[e]}})});Re.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Re.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var i=this._currentRequest=t.request(this._options,this._onNativeResponse);i._redirectable=this;for(var a of vr)i.on(a,gr[a]);if(this._currentUrl=/^\//.test(this._options.path)?Kn.format(this._options):this._options.path,this._isRedirect){var o=0,r=this,s=this._requestBodyBuffers;(function p(l){if(i===r._currentRequest)if(l)r.emit("error",l);else if(o<s.length){var c=s[o++];i.finished||i.write(c.data,c.encoding,p)}else r._ended&&i.end()})()}};Re.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(!n||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(yr(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Rw;var i,a=this._options.beforeRedirect;a&&(i=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],lr(/^content-/i,this._options.headers));var r=lr(/^host$/i,this._options.headers),s=br(this._currentUrl),p=r||s.host,l=/^\w+:/.test(n)?this._currentUrl:Kn.format(Object.assign(s,{host:p})),c=Iw(n,l);if(Mu("redirecting to",c.href),this._isRedirect=!0,mr(c,this._options),(c.protocol!==s.protocol&&c.protocol!=="https:"||c.host!==p&&!Pw(c.host,p))&&lr(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Nt(a)){var u={headers:e.headers,statusCode:t},f={url:l,method:o,headers:i};a(this._options,u,f),this._sanitizeOptions(this._options)}this._performRequest()};function $u(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach(function(i){var a=i+":",o=n[a]=e[i],r=t[i]=Object.create(o);function s(l,c,u){return Fw(l)?l=mr(l):Lt(l)?l=mr(br(l)):(u=c,c=zu(l),l={protocol:a}),Nt(c)&&(u=c,c=null),c=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},l,c),c.nativeProtocols=n,!Lt(c.host)&&!Lt(c.hostname)&&(c.hostname="::1"),hr.equal(c.protocol,a,"protocol mismatch"),Mu("options",c),new Re(c,u)}function p(l,c,u){var f=r.request(l,c,u);return f.end(),f}Object.defineProperties(r,{request:{value:s,configurable:!0,enumerable:!0,writable:!0},get:{value:p,configurable:!0,enumerable:!0,writable:!0}})}),t}function Gu(){}function br(e){var t;if(xr)t=new Yn(e);else if(t=zu(Kn.parse(e)),!Lt(t.protocol))throw new ur({input:e});return t}function Iw(e,t){return xr?new Yn(e,t):br(Kn.resolve(t,e))}function zu(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new ur({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new ur({input:e.href||e});return e}function mr(e,t){var n=t||{};for(var i of Dw)n[i]=e[i];return n.hostname.startsWith("[")&&(n.hostname=n.hostname.slice(1,-1)),n.port!==""&&(n.port=Number(n.port)),n.path=n.search?n.pathname+n.search:n.pathname,n}function lr(e,t){var n;for(var i in t)e.test(i)&&(n=t[i],delete t[i]);return n===null||typeof n>"u"?void 0:String(n).trim()}function Qn(e,t,n){function i(a){Nt(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,a||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return i.prototype=new(n||Error),Object.defineProperties(i.prototype,{constructor:{value:i,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),i}function yr(e,t){for(var n of vr)e.removeListener(n,gr[n]);e.on("error",Gu),e.destroy(t)}function Pw(e,t){hr(Lt(e)&&Lt(t));var n=e.length-t.length-1;return n>0&&e[n]==="."&&e.endsWith(t)}function Lt(e){return typeof e=="string"||e instanceof String}function Nt(e){return typeof e=="function"}function Aw(e){return typeof e=="object"&&"length"in e}function Fw(e){return Yn&&e instanceof Yn}wr.exports=$u({http:Sw,https:Ew});wr.exports.wrap=$u});function wn(e=""){return h_?Vr.default.resolve(Yr.default.sync(__dirname),"../../../",e):Vr.default.resolve(Yr.default.sync(__dirname),"../griddo-components",e)}function x_(){let e=Jr.default.sync("jsconfig.json",{cwd:wn()});return Jr.default.sync("tsconfig.json",{cwd:wn()})||e}function v_(){let e=require(x_());return e||K(ml),Object.keys(e.compilerOptions?.paths).reduce((t,n)=>{let[i]=n.split("/"),[a]=e.compilerOptions.paths[n],[o]=a.split("/*"),r=wn(o);return{...t,[i]:r}},{"@griddo-instance":`${wn()}/src/index.js`})}var Vr,Jr,Yr,h_,WC,Kd=Sn(()=>{"use strict";Vr=R(require("node:path")),Jr=R(Wa()),Yr=R(wi());Je();at();h_=__dirname.includes("node_modules"),WC=v_()});var em={};ps(em,{default:()=>S_});var Qe,da,Zd,ua,g_,b_,y_,Qd,w_,__,S_,tm=Sn(()=>{"use strict";Qe=R(require("node:path")),da=R(wi());Kd();Zd=da.default.sync(Qe.default.resolve(__dirname,"../..")),ua=da.default.sync(__dirname),g_=Qe.default.resolve(da.default.sync(__dirname)),b_=Qe.default.resolve(ua,".cx-cache"),y_=wn(),Qd=Qe.default.join(Zd,"exports/sites"),{version:w_}=require(Qe.default.join(ua,"package.json")),__={proDomain:"pro-",griddoVersion:w_,buildReportFileName:"build-report.json",paths:e=>({__cache:Qe.default.join(b_,e||""),__components:y_,__cx:ua,__exports:Qe.default.join(Qd,e||""),__root:Zd,__ssg:g_,__exports_dist:e?Qe.default.join(Qd,e,"dist"):"",__cx_dist:Qe.default.join(ua,"dist")})},S_=__});Xt();var ya=R(require("node:path"));var nf=require("node:child_process"),ct=R(require("node:path")),af=R(En()),Ge=R(Rt());var sm=R(En());var Ze=R(require("node:fs")),Mt=R(require("node:path")),ma=R(Rt());Xt();var Ba,mp,fp,hp,xp=!0;typeof process<"u"&&({FORCE_COLOR:Ba,NODE_DISABLE_COLORS:mp,NO_COLOR:fp,TERM:hp}=process.env||{},xp=process.stdout&&process.stdout.isTTY);var pv={enabled:!mp&&fp==null&&hp!=="dumb"&&(Ba!=null&&Ba!=="0"||xp)};function G(e,t){let n=new RegExp(`\\x1b\\[${t}m`,"g"),i=`\x1B[${e}m`,a=`\x1B[${t}m`;return function(o){return!pv.enabled||o==null?o:i+(~(""+o).indexOf(a)?o.replace(n,a+i):o)+a}}var RS=G(0,0),OS=G(1,22),CS=G(2,22),TS=G(3,23),IS=G(4,24),PS=G(7,27),AS=G(8,28),FS=G(9,29),vp=G(30,39),kS=G(31,39),jS=G(32,39),LS=G(33,39),NS=G(34,39),qS=G(35,39),US=G(36,39),BS=G(37,39),MS=G(90,39),$S=G(90,39),GS=G(40,49),gp=G(41,49),zS=G(42,49),XS=G(43,49),HS=G(44,49),WS=G(45,49),VS=G(46,49),JS=G(47,49);var nm=R(wi());Je();Xt();function U(e){O.GRIDDO_VERBOSE_LOGS&&console.log(Y.yellow("verbose"),Y.dim(e.replace(/(\s)\s+/g,"$1").trim()))}function Qt(e,t="",n=1,i=1){let a=e.split(`
28
28
  `).map(m=>m.trim()),o=t?` ${t} `:"",r=t?o.length:0,s=Math.max(...a.map(m=>m.length))+n*2,p=Math.max(s,r),l=`\u2502${" ".repeat(p)}\u2502
29
29
  `.repeat(i),c=p,u=`\u256D${o}${"\u2500".repeat(c-r)}\u256E
30
30
  `,f=`\u2570${"\u2500".repeat(c)}\u256F`,h=a.map(m=>{let x=" ".repeat(p-m.length-n);return`\u2502${" ".repeat(n)}${m}${x}\u2502
@@ -34,10 +34,10 @@ ${Y.bold("Griddo Exporter "+n)} ${Y.dim("~ node "+t)}
34
34
  ${e}
35
35
 
36
36
  ${i.join(`
37
- `)||"---"}`)}var wt=R(require("node:path")),yn=R(Rt()),zr=R(cl());var xt=R(require("node:fs")),Ee=R(require("node:path")),Io=R(Rt());Ve();at();var nn=V();async function Po(){let{__cx:e}=nn.paths(),{sitesToPublish:t,createdPages:n,buildProcessData:i}=Io.default.readJSONSync(Ee.default.join(e,"render-metadata.json"));return{buildProcessData:i,createdPages:n,sitesToPublish:t}}function xl(){let{__cx:e}=nn.paths(),t=Ee.default.join(e,"store");xt.default.existsSync(t)||(xt.default.mkdirSync(t),xt.default.mkdirSync(Ee.default.join(t,"metadata"))),console.info("Store initialized")}function Ao(e){let{__cx:t}=nn.paths();xt.default.writeFileSync(Ee.default.join(t,"render-metadata.json"),JSON.stringify(e))}function db(e){return xt.default.readdirSync(e).filter(n=>{let i=`${e}/${n}`;if(xt.default.statSync(i)?.isDirectory()||Ee.default.extname(n)!==".json")return!1;let o=Ee.default.basename(n,Ee.default.extname(n));return!Number.isNaN(Number.parseInt(o))}).map(n=>{let i=Ee.default.basename(n,Ee.default.extname(n));return Number.parseInt(i)})}function vl(e,t){let{__cx:n}=nn.paths();try{for(let i of t){ko(i,["editorID","parentEditorID"]);let a=`${i.context.page.id}.json`,o=Ee.default.join(n,"store",e,a);Io.default.writeJSONSync(o,i)}}catch(i){K(hl,i)}}function gl(e,t){let{__cx:n}=nn.paths();if(t.length!==0)for(let i of t){let a=Ee.default.join(n,"store",e,`${i}.json`);try{xt.default.unlinkSync(a)}catch(o){throw console.log(o),new Error(`Error removing file ${i}`)}}}async function bl(e){let{__cx:t}=nn.paths(),n=Ee.default.join(t,"store"),{changedPages:i,validPagesIds:a,siteDirName:o}=e,r=Ee.default.join(n,o),s=db(r),p=a.filter(f=>!s.includes(f)),l=p.concat(i),c=s.filter(f=>!a.includes(f)),u=Array.from(new Set(l)).filter(f=>!c.includes(f));return{pagesInStore:s,pagesMissingInStore:p,pagesToDeleteFromStore:[...c],pagesToWriteToStore:u}}Ve();at();var jo=class{headers;async login(){try{let t=await fetch(ee.LOGIN,{method:"POST",headers:{"Content-Type":"application/json",Connection:"close"},body:JSON.stringify({username:O.GRIDDO_BOT_USER,password:O.GRIDDO_BOT_PASSWORD})});if(!t.ok)throw new Error("Error while login in the API");let{token:n}=await t.json();return this.headers={Authorization:`bearer ${n}`,"Cache-Control":"no-store"},this.headers}catch(t){K(ul,t)}}},ot=new jo;function Gn(e,t){return function(){return e.apply(t,arguments)}}var{toString:mb}=Object.prototype,{getPrototypeOf:qo}=Object,Gi=(e=>t=>{let n=mb.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qe=e=>(e=e.toLowerCase(),t=>Gi(t)===e),zi=e=>t=>typeof t===e,{isArray:an}=Array,zn=zi("undefined");function fb(e){return e!==null&&!zn(e)&&e.constructor!==null&&!zn(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var _l=qe("ArrayBuffer");function hb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_l(e.buffer),t}var xb=zi("string"),Ie=zi("function"),Sl=zi("number"),Xi=e=>e!==null&&typeof e=="object",vb=e=>e===!0||e===!1,$i=e=>{if(Gi(e)!=="object")return!1;let t=qo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},gb=qe("Date"),bb=qe("File"),yb=qe("Blob"),wb=qe("FileList"),_b=e=>Xi(e)&&Ie(e.pipe),Sb=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ie(e.append)&&((t=Gi(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},Eb=qe("URLSearchParams"),[Db,Rb,Ob,Cb]=["ReadableStream","Request","Response","Headers"].map(qe),Tb=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Xn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,a;if(typeof e!="object"&&(e=[e]),an(e))for(i=0,a=e.length;i<a;i++)t.call(null,e[i],i,e);else{let o=n?Object.getOwnPropertyNames(e):Object.keys(e),r=o.length,s;for(i=0;i<r;i++)s=o[i],t.call(null,e[s],s,e)}}function El(e,t){t=t.toLowerCase();let n=Object.keys(e),i=n.length,a;for(;i-- >0;)if(a=n[i],t===a.toLowerCase())return a;return null}var At=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Dl=e=>!zn(e)&&e!==At;function No(){let{caseless:e}=Dl(this)&&this||{},t={},n=(i,a)=>{let o=e&&El(t,a)||a;$i(t[o])&&$i(i)?t[o]=No(t[o],i):$i(i)?t[o]=No({},i):an(i)?t[o]=i.slice():t[o]=i};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&Xn(arguments[i],n);return t}var Ib=(e,t,n,{allOwnKeys:i}={})=>(Xn(t,(a,o)=>{n&&Ie(a)?e[o]=Gn(a,n):e[o]=a},{allOwnKeys:i}),e),Pb=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ab=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fb=(e,t,n,i)=>{let a,o,r,s={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)r=a[o],(!i||i(r,e,t))&&!s[r]&&(t[r]=e[r],s[r]=!0);e=n!==!1&&qo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kb=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let i=e.indexOf(t,n);return i!==-1&&i===n},jb=e=>{if(!e)return null;if(an(e))return e;let t=e.length;if(!Sl(t))return null;let n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Lb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qo(Uint8Array)),Nb=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),a;for(;(a=i.next())&&!a.done;){let o=a.value;t.call(e,o[0],o[1])}},qb=(e,t)=>{let n,i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},Ub=qe("HTMLFormElement"),Bb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,a){return i.toUpperCase()+a}),yl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Mb=qe("RegExp"),Rl=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),i={};Xn(n,(a,o)=>{let r;(r=t(a,o,e))!==!1&&(i[o]=r||a)}),Object.defineProperties(e,i)},$b=e=>{Rl(e,(t,n)=>{if(Ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=e[n];if(Ie(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gb=(e,t)=>{let n={},i=a=>{a.forEach(o=>{n[o]=!0})};return an(e)?i(e):i(String(e).split(t)),n},zb=()=>{},Xb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Lo="abcdefghijklmnopqrstuvwxyz",wl="0123456789",Ol={DIGIT:wl,ALPHA:Lo,ALPHA_DIGIT:Lo+Lo.toUpperCase()+wl},Hb=(e=16,t=Ol.ALPHA_DIGIT)=>{let n="",{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n};function Wb(e){return!!(e&&Ie(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var Vb=e=>{let t=new Array(10),n=(i,a)=>{if(Xi(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[a]=i;let o=an(i)?[]:{};return Xn(i,(r,s)=>{let p=n(r,a+1);!zn(p)&&(o[s]=p)}),t[a]=void 0,o}}return i};return n(e,0)},Jb=qe("AsyncFunction"),Yb=e=>e&&(Xi(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),Cl=((e,t)=>e?setImmediate:t?((n,i)=>(At.addEventListener("message",({source:a,data:o})=>{a===At&&o===n&&i.length&&i.shift()()},!1),a=>{i.push(a),At.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ie(At.postMessage)),Kb=typeof queueMicrotask<"u"?queueMicrotask.bind(At):typeof process<"u"&&process.nextTick||Cl,d={isArray:an,isArrayBuffer:_l,isBuffer:fb,isFormData:Sb,isArrayBufferView:hb,isString:xb,isNumber:Sl,isBoolean:vb,isObject:Xi,isPlainObject:$i,isReadableStream:Db,isRequest:Rb,isResponse:Ob,isHeaders:Cb,isUndefined:zn,isDate:gb,isFile:bb,isBlob:yb,isRegExp:Mb,isFunction:Ie,isStream:_b,isURLSearchParams:Eb,isTypedArray:Lb,isFileList:wb,forEach:Xn,merge:No,extend:Ib,trim:Tb,stripBOM:Pb,inherits:Ab,toFlatObject:Fb,kindOf:Gi,kindOfTest:qe,endsWith:kb,toArray:jb,forEachEntry:Nb,matchAll:qb,isHTMLForm:Ub,hasOwnProperty:yl,hasOwnProp:yl,reduceDescriptors:Rl,freezeMethods:$b,toObjectSet:Gb,toCamelCase:Bb,noop:zb,toFiniteNumber:Xb,findKey:El,global:At,isContextDefined:Dl,ALPHABET:Ol,generateString:Hb,isSpecCompliantForm:Wb,toJSONObject:Vb,isAsyncFn:Jb,isThenable:Yb,setImmediate:Cl,asap:Kb};function on(e,t,n,i,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),a&&(this.response=a,this.status=a.status?a.status:null)}d.inherits(on,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.status}}});var Tl=on.prototype,Il={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Il[e]={value:e}});Object.defineProperties(on,Il);Object.defineProperty(Tl,"isAxiosError",{value:!0});on.from=(e,t,n,i,a,o)=>{let r=Object.create(Tl);return d.toFlatObject(e,r,function(p){return p!==Error.prototype},s=>s!=="isAxiosError"),on.call(r,e.message,t,n,i,a),r.cause=e,r.name=e.name,o&&Object.assign(r,o),r};var y=on;var du=R(uu(),1),Vi=du.default;function Jo(e){return d.isPlainObject(e)||d.isArray(e)}function fu(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function mu(e,t,n){return e?e.concat(t).map(function(a,o){return a=fu(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function ky(e){return d.isArray(e)&&!e.some(Jo)}var jy=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function Ly(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new(Vi||FormData),n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,v){return!d.isUndefined(v[x])});let i=n.metaTokens,a=n.visitor||c,o=n.dots,r=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(a))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(d.isDate(m))return m.toISOString();if(!p&&d.isBlob(m))throw new y("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(m)||d.isTypedArray(m)?p&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,x,v){let b=m;if(m&&!v&&typeof m=="object"){if(d.endsWith(x,"{}"))x=i?x:x.slice(0,-2),m=JSON.stringify(m);else if(d.isArray(m)&&ky(m)||(d.isFileList(m)||d.endsWith(x,"[]"))&&(b=d.toArray(m)))return x=fu(x),b.forEach(function(_,T){!(d.isUndefined(_)||_===null)&&t.append(r===!0?mu([x],T,o):r===null?x:x+"[]",l(_))}),!1}return Jo(m)?!0:(t.append(mu(v,x,o),l(m)),!1)}let u=[],f=Object.assign(jy,{defaultVisitor:c,convertValue:l,isVisitable:Jo});function h(m,x){if(!d.isUndefined(m)){if(u.indexOf(m)!==-1)throw Error("Circular reference detected in "+x.join("."));u.push(m),d.forEach(m,function(b,E){(!(d.isUndefined(b)||b===null)&&a.call(t,b,d.isString(E)?E.trim():E,x,f))===!0&&h(b,x?x.concat(E):[E])}),u.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return h(e),t}var vt=Ly;function hu(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function xu(e,t){this._pairs=[],e&&vt(e,this,t)}var vu=xu.prototype;vu.append=function(t,n){this._pairs.push([t,n])};vu.toString=function(t){let n=t?function(i){return t.call(this,i,hu)}:hu;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};var gu=xu;function Ny(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ft(e,t,n){if(!t)return e;let i=n&&n.encode||Ny,a=n&&n.serialize,o;if(a?o=a(t,n):o=d.isURLSearchParams(t)?t.toString():new gu(t,n).toString(i),o){let r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var Yo=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(i){i!==null&&t(i)})}},Ko=Yo;var rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var bu=R(require("url"),1),yu=bu.default.URLSearchParams;var wu={isNode:!0,classes:{URLSearchParams:yu,FormData:Vi,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var er={};ps(er,{hasBrowserEnv:()=>Zo,hasStandardBrowserEnv:()=>qy,hasStandardBrowserWebWorkerEnv:()=>Uy,navigator:()=>Qo,origin:()=>By});var Zo=typeof window<"u"&&typeof document<"u",Qo=typeof navigator=="object"&&navigator||void 0,qy=Zo&&(!Qo||["ReactNative","NativeScript","NS"].indexOf(Qo.product)<0),Uy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",By=Zo&&window.location.href||"http://localhost";var B={...er,...wu};function tr(e,t){return vt(e,new B.classes.URLSearchParams,Object.assign({visitor:function(n,i,a,o){return B.isNode&&d.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function My(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $y(e){let t={},n=Object.keys(e),i,a=n.length,o;for(i=0;i<a;i++)o=n[i],t[o]=e[o];return t}function Gy(e){function t(n,i,a,o){let r=n[o++];if(r==="__proto__")return!0;let s=Number.isFinite(+r),p=o>=n.length;return r=!r&&d.isArray(a)?a.length:r,p?(d.hasOwnProp(a,r)?a[r]=[a[r],i]:a[r]=i,!s):((!a[r]||!d.isObject(a[r]))&&(a[r]=[]),t(n,i,a[r],o)&&d.isArray(a[r])&&(a[r]=$y(a[r])),!s)}if(d.isFormData(e)&&d.isFunction(e.entries)){let n={};return d.forEachEntry(e,(i,a)=>{t(My(i),a,n,0)}),n}return null}var Ji=Gy;function zy(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}var nr={transitional:rn,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i=n.getContentType()||"",a=i.indexOf("application/json")>-1,o=d.isObject(t);if(o&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return a?JSON.stringify(Ji(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return tr(t,this.formSerializer).toString();if((s=d.isFileList(t))||i.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return vt(s?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||a?(n.setContentType("application/json",!1),zy(t)):t}],transformResponse:[function(t){let n=this.transitional||nr.transitional,i=n&&n.forcedJSONParsing,a=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(i&&!this.responseType||a)){let r=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(s){if(r)throw s.name==="SyntaxError"?y.from(s,y.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{nr.headers[e]={}});var sn=nr;var Xy=d.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_u=e=>{let t={},n,i,a;return e&&e.split(`
37
+ `)||"---"}`)}var wt=R(require("node:path")),yn=R(Rt()),zr=R(cl());var xt=R(require("node:fs")),Ee=R(require("node:path")),Io=R(Rt());Je();at();var nn=V();async function Po(){let{__cx:e}=nn.paths(),{sitesToPublish:t,createdPages:n,buildProcessData:i}=Io.default.readJSONSync(Ee.default.join(e,"render-metadata.json"));return{buildProcessData:i,createdPages:n,sitesToPublish:t}}function xl(){let{__cx:e}=nn.paths(),t=Ee.default.join(e,"store");xt.default.existsSync(t)||(xt.default.mkdirSync(t),xt.default.mkdirSync(Ee.default.join(t,"metadata"))),console.info("Store initialized")}function Ao(e){let{__cx:t}=nn.paths();xt.default.writeFileSync(Ee.default.join(t,"render-metadata.json"),JSON.stringify(e))}function db(e){return xt.default.readdirSync(e).filter(n=>{let i=`${e}/${n}`;if(xt.default.statSync(i)?.isDirectory()||Ee.default.extname(n)!==".json")return!1;let o=Ee.default.basename(n,Ee.default.extname(n));return!Number.isNaN(Number.parseInt(o))}).map(n=>{let i=Ee.default.basename(n,Ee.default.extname(n));return Number.parseInt(i)})}function vl(e,t){let{__cx:n}=nn.paths();try{for(let i of t){ko(i,["editorID","parentEditorID"]);let a=`${i.context.page.id}.json`,o=Ee.default.join(n,"store",e,a);Io.default.writeJSONSync(o,i)}}catch(i){K(hl,i)}}function gl(e,t){let{__cx:n}=nn.paths();if(t.length!==0)for(let i of t){let a=Ee.default.join(n,"store",e,`${i}.json`);try{xt.default.unlinkSync(a)}catch(o){throw console.log(o),new Error(`Error removing file ${i}`)}}}async function bl(e){let{__cx:t}=nn.paths(),n=Ee.default.join(t,"store"),{changedPages:i,validPagesIds:a,siteDirName:o}=e,r=Ee.default.join(n,o),s=db(r),p=a.filter(f=>!s.includes(f)),l=p.concat(i),c=s.filter(f=>!a.includes(f)),u=Array.from(new Set(l)).filter(f=>!c.includes(f));return{pagesInStore:s,pagesMissingInStore:p,pagesToDeleteFromStore:[...c],pagesToWriteToStore:u}}Je();at();var jo=class{headers;async login(){try{let t=await fetch(ee.LOGIN,{method:"POST",headers:{"Content-Type":"application/json",Connection:"close"},body:JSON.stringify({username:O.GRIDDO_BOT_USER,password:O.GRIDDO_BOT_PASSWORD})});if(!t.ok)throw new Error("Error while login in the API");let{token:n}=await t.json();return this.headers={Authorization:`bearer ${n}`,"Cache-Control":"no-store"},this.headers}catch(t){K(ul,t)}}},ot=new jo;function Gn(e,t){return function(){return e.apply(t,arguments)}}var{toString:mb}=Object.prototype,{getPrototypeOf:qo}=Object,Gi=(e=>t=>{let n=mb.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qe=e=>(e=e.toLowerCase(),t=>Gi(t)===e),zi=e=>t=>typeof t===e,{isArray:an}=Array,zn=zi("undefined");function fb(e){return e!==null&&!zn(e)&&e.constructor!==null&&!zn(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var _l=qe("ArrayBuffer");function hb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_l(e.buffer),t}var xb=zi("string"),Ie=zi("function"),Sl=zi("number"),Xi=e=>e!==null&&typeof e=="object",vb=e=>e===!0||e===!1,$i=e=>{if(Gi(e)!=="object")return!1;let t=qo(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},gb=qe("Date"),bb=qe("File"),yb=qe("Blob"),wb=qe("FileList"),_b=e=>Xi(e)&&Ie(e.pipe),Sb=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ie(e.append)&&((t=Gi(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},Eb=qe("URLSearchParams"),[Db,Rb,Ob,Cb]=["ReadableStream","Request","Response","Headers"].map(qe),Tb=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Xn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,a;if(typeof e!="object"&&(e=[e]),an(e))for(i=0,a=e.length;i<a;i++)t.call(null,e[i],i,e);else{let o=n?Object.getOwnPropertyNames(e):Object.keys(e),r=o.length,s;for(i=0;i<r;i++)s=o[i],t.call(null,e[s],s,e)}}function El(e,t){t=t.toLowerCase();let n=Object.keys(e),i=n.length,a;for(;i-- >0;)if(a=n[i],t===a.toLowerCase())return a;return null}var At=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Dl=e=>!zn(e)&&e!==At;function No(){let{caseless:e}=Dl(this)&&this||{},t={},n=(i,a)=>{let o=e&&El(t,a)||a;$i(t[o])&&$i(i)?t[o]=No(t[o],i):$i(i)?t[o]=No({},i):an(i)?t[o]=i.slice():t[o]=i};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&Xn(arguments[i],n);return t}var Ib=(e,t,n,{allOwnKeys:i}={})=>(Xn(t,(a,o)=>{n&&Ie(a)?e[o]=Gn(a,n):e[o]=a},{allOwnKeys:i}),e),Pb=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ab=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fb=(e,t,n,i)=>{let a,o,r,s={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)r=a[o],(!i||i(r,e,t))&&!s[r]&&(t[r]=e[r],s[r]=!0);e=n!==!1&&qo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kb=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let i=e.indexOf(t,n);return i!==-1&&i===n},jb=e=>{if(!e)return null;if(an(e))return e;let t=e.length;if(!Sl(t))return null;let n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Lb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qo(Uint8Array)),Nb=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),a;for(;(a=i.next())&&!a.done;){let o=a.value;t.call(e,o[0],o[1])}},qb=(e,t)=>{let n,i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},Ub=qe("HTMLFormElement"),Bb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,a){return i.toUpperCase()+a}),yl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Mb=qe("RegExp"),Rl=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),i={};Xn(n,(a,o)=>{let r;(r=t(a,o,e))!==!1&&(i[o]=r||a)}),Object.defineProperties(e,i)},$b=e=>{Rl(e,(t,n)=>{if(Ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=e[n];if(Ie(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gb=(e,t)=>{let n={},i=a=>{a.forEach(o=>{n[o]=!0})};return an(e)?i(e):i(String(e).split(t)),n},zb=()=>{},Xb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Lo="abcdefghijklmnopqrstuvwxyz",wl="0123456789",Ol={DIGIT:wl,ALPHA:Lo,ALPHA_DIGIT:Lo+Lo.toUpperCase()+wl},Hb=(e=16,t=Ol.ALPHA_DIGIT)=>{let n="",{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n};function Wb(e){return!!(e&&Ie(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var Vb=e=>{let t=new Array(10),n=(i,a)=>{if(Xi(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[a]=i;let o=an(i)?[]:{};return Xn(i,(r,s)=>{let p=n(r,a+1);!zn(p)&&(o[s]=p)}),t[a]=void 0,o}}return i};return n(e,0)},Jb=qe("AsyncFunction"),Yb=e=>e&&(Xi(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),Cl=((e,t)=>e?setImmediate:t?((n,i)=>(At.addEventListener("message",({source:a,data:o})=>{a===At&&o===n&&i.length&&i.shift()()},!1),a=>{i.push(a),At.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ie(At.postMessage)),Kb=typeof queueMicrotask<"u"?queueMicrotask.bind(At):typeof process<"u"&&process.nextTick||Cl,d={isArray:an,isArrayBuffer:_l,isBuffer:fb,isFormData:Sb,isArrayBufferView:hb,isString:xb,isNumber:Sl,isBoolean:vb,isObject:Xi,isPlainObject:$i,isReadableStream:Db,isRequest:Rb,isResponse:Ob,isHeaders:Cb,isUndefined:zn,isDate:gb,isFile:bb,isBlob:yb,isRegExp:Mb,isFunction:Ie,isStream:_b,isURLSearchParams:Eb,isTypedArray:Lb,isFileList:wb,forEach:Xn,merge:No,extend:Ib,trim:Tb,stripBOM:Pb,inherits:Ab,toFlatObject:Fb,kindOf:Gi,kindOfTest:qe,endsWith:kb,toArray:jb,forEachEntry:Nb,matchAll:qb,isHTMLForm:Ub,hasOwnProperty:yl,hasOwnProp:yl,reduceDescriptors:Rl,freezeMethods:$b,toObjectSet:Gb,toCamelCase:Bb,noop:zb,toFiniteNumber:Xb,findKey:El,global:At,isContextDefined:Dl,ALPHABET:Ol,generateString:Hb,isSpecCompliantForm:Wb,toJSONObject:Vb,isAsyncFn:Jb,isThenable:Yb,setImmediate:Cl,asap:Kb};function on(e,t,n,i,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),a&&(this.response=a,this.status=a.status?a.status:null)}d.inherits(on,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.status}}});var Tl=on.prototype,Il={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Il[e]={value:e}});Object.defineProperties(on,Il);Object.defineProperty(Tl,"isAxiosError",{value:!0});on.from=(e,t,n,i,a,o)=>{let r=Object.create(Tl);return d.toFlatObject(e,r,function(p){return p!==Error.prototype},s=>s!=="isAxiosError"),on.call(r,e.message,t,n,i,a),r.cause=e,r.name=e.name,o&&Object.assign(r,o),r};var y=on;var du=R(uu(),1),Vi=du.default;function Jo(e){return d.isPlainObject(e)||d.isArray(e)}function fu(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function mu(e,t,n){return e?e.concat(t).map(function(a,o){return a=fu(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function ky(e){return d.isArray(e)&&!e.some(Jo)}var jy=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function Ly(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new(Vi||FormData),n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,v){return!d.isUndefined(v[x])});let i=n.metaTokens,a=n.visitor||c,o=n.dots,r=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(a))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(d.isDate(m))return m.toISOString();if(!p&&d.isBlob(m))throw new y("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(m)||d.isTypedArray(m)?p&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,x,v){let b=m;if(m&&!v&&typeof m=="object"){if(d.endsWith(x,"{}"))x=i?x:x.slice(0,-2),m=JSON.stringify(m);else if(d.isArray(m)&&ky(m)||(d.isFileList(m)||d.endsWith(x,"[]"))&&(b=d.toArray(m)))return x=fu(x),b.forEach(function(_,T){!(d.isUndefined(_)||_===null)&&t.append(r===!0?mu([x],T,o):r===null?x:x+"[]",l(_))}),!1}return Jo(m)?!0:(t.append(mu(v,x,o),l(m)),!1)}let u=[],f=Object.assign(jy,{defaultVisitor:c,convertValue:l,isVisitable:Jo});function h(m,x){if(!d.isUndefined(m)){if(u.indexOf(m)!==-1)throw Error("Circular reference detected in "+x.join("."));u.push(m),d.forEach(m,function(b,E){(!(d.isUndefined(b)||b===null)&&a.call(t,b,d.isString(E)?E.trim():E,x,f))===!0&&h(b,x?x.concat(E):[E])}),u.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return h(e),t}var vt=Ly;function hu(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function xu(e,t){this._pairs=[],e&&vt(e,this,t)}var vu=xu.prototype;vu.append=function(t,n){this._pairs.push([t,n])};vu.toString=function(t){let n=t?function(i){return t.call(this,i,hu)}:hu;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};var gu=xu;function Ny(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ft(e,t,n){if(!t)return e;let i=n&&n.encode||Ny,a=n&&n.serialize,o;if(a?o=a(t,n):o=d.isURLSearchParams(t)?t.toString():new gu(t,n).toString(i),o){let r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var Yo=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(i){i!==null&&t(i)})}},Ko=Yo;var rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var bu=R(require("url"),1),yu=bu.default.URLSearchParams;var wu={isNode:!0,classes:{URLSearchParams:yu,FormData:Vi,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var er={};ps(er,{hasBrowserEnv:()=>Zo,hasStandardBrowserEnv:()=>qy,hasStandardBrowserWebWorkerEnv:()=>Uy,navigator:()=>Qo,origin:()=>By});var Zo=typeof window<"u"&&typeof document<"u",Qo=typeof navigator=="object"&&navigator||void 0,qy=Zo&&(!Qo||["ReactNative","NativeScript","NS"].indexOf(Qo.product)<0),Uy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",By=Zo&&window.location.href||"http://localhost";var B={...er,...wu};function tr(e,t){return vt(e,new B.classes.URLSearchParams,Object.assign({visitor:function(n,i,a,o){return B.isNode&&d.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function My(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $y(e){let t={},n=Object.keys(e),i,a=n.length,o;for(i=0;i<a;i++)o=n[i],t[o]=e[o];return t}function Gy(e){function t(n,i,a,o){let r=n[o++];if(r==="__proto__")return!0;let s=Number.isFinite(+r),p=o>=n.length;return r=!r&&d.isArray(a)?a.length:r,p?(d.hasOwnProp(a,r)?a[r]=[a[r],i]:a[r]=i,!s):((!a[r]||!d.isObject(a[r]))&&(a[r]=[]),t(n,i,a[r],o)&&d.isArray(a[r])&&(a[r]=$y(a[r])),!s)}if(d.isFormData(e)&&d.isFunction(e.entries)){let n={};return d.forEachEntry(e,(i,a)=>{t(My(i),a,n,0)}),n}return null}var Ji=Gy;function zy(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}var nr={transitional:rn,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i=n.getContentType()||"",a=i.indexOf("application/json")>-1,o=d.isObject(t);if(o&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return a?JSON.stringify(Ji(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return tr(t,this.formSerializer).toString();if((s=d.isFileList(t))||i.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return vt(s?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||a?(n.setContentType("application/json",!1),zy(t)):t}],transformResponse:[function(t){let n=this.transitional||nr.transitional,i=n&&n.forcedJSONParsing,a=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(i&&!this.responseType||a)){let r=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(s){if(r)throw s.name==="SyntaxError"?y.from(s,y.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{nr.headers[e]={}});var sn=nr;var Xy=d.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_u=e=>{let t={},n,i,a;return e&&e.split(`
38
38
  `).forEach(function(r){a=r.indexOf(":"),n=r.substring(0,a).trim().toLowerCase(),i=r.substring(a+1).trim(),!(!n||t[n]&&Xy[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t};var Su=Symbol("internals");function Hn(e){return e&&String(e).trim().toLowerCase()}function Yi(e){return e===!1||e==null?e:d.isArray(e)?e.map(Yi):String(e)}function Hy(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}var Wy=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ir(e,t,n,i,a){if(d.isFunction(i))return i.call(this,t,n);if(a&&(t=n),!!d.isString(t)){if(d.isString(i))return t.indexOf(i)!==-1;if(d.isRegExp(i))return i.test(t)}}function Vy(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function Jy(e,t){let n=d.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(a,o,r){return this[i].call(this,t,a,o,r)},configurable:!0})})}var cn=class{constructor(t){t&&this.set(t)}set(t,n,i){let a=this;function o(s,p,l){let c=Hn(p);if(!c)throw new Error("header name must be a non-empty string");let u=d.findKey(a,c);(!u||a[u]===void 0||l===!0||l===void 0&&a[u]!==!1)&&(a[u||p]=Yi(s))}let r=(s,p)=>d.forEach(s,(l,c)=>o(l,c,p));if(d.isPlainObject(t)||t instanceof this.constructor)r(t,n);else if(d.isString(t)&&(t=t.trim())&&!Wy(t))r(_u(t),n);else if(d.isHeaders(t))for(let[s,p]of t.entries())o(p,s,i);else t!=null&&o(n,t,i);return this}get(t,n){if(t=Hn(t),t){let i=d.findKey(this,t);if(i){let a=this[i];if(!n)return a;if(n===!0)return Hy(a);if(d.isFunction(n))return n.call(this,a,i);if(d.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Hn(t),t){let i=d.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||ir(this,this[i],i,n)))}return!1}delete(t,n){let i=this,a=!1;function o(r){if(r=Hn(r),r){let s=d.findKey(i,r);s&&(!n||ir(i,i[s],s,n))&&(delete i[s],a=!0)}}return d.isArray(t)?t.forEach(o):o(t),a}clear(t){let n=Object.keys(this),i=n.length,a=!1;for(;i--;){let o=n[i];(!t||ir(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){let n=this,i={};return d.forEach(this,(a,o)=>{let r=d.findKey(i,o);if(r){n[r]=Yi(a),delete n[o];return}let s=t?Vy(o):String(o).trim();s!==o&&delete n[o],n[s]=Yi(a),i[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return d.forEach(this,(i,a)=>{i!=null&&i!==!1&&(n[a]=t&&d.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
39
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(a=>i.set(a)),i}static accessor(t){let i=(this[Su]=this[Su]={accessors:{}}).accessors,a=this.prototype;function o(r){let s=Hn(r);i[s]||(Jy(a,r),i[s]=!0)}return d.isArray(t)?t.forEach(o):o(t),this}};cn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(cn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});d.freezeMethods(cn);var W=cn;function Wn(e,t){let n=this||sn,i=t||n,a=W.from(i.headers),o=i.data;return d.forEach(e,function(s){o=s.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function Vn(e){return!!(e&&e.__CANCEL__)}function Eu(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}d.inherits(Eu,y,{__CANCEL__:!0});var Pe=Eu;function Ye(e,t,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ar(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function or(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function kt(e,t){return e&&!ar(t)?or(e,t):t}var sd=R(Ru(),1),cd=R(require("http"),1),pd=R(require("https"),1),ld=R(require("util"),1),ud=R(Xu(),1),st=R(require("zlib"),1);var qt="1.7.7";function Zn(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var kw=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function _r(e,t,n){let i=n&&n.Blob||B.classes.Blob,a=Zn(e);if(t===void 0&&i&&(t=!0),a==="data"){e=a.length?e.slice(a.length+1):e;let o=kw.exec(e);if(!o)throw new y("Invalid URL",y.ERR_INVALID_URL);let r=o[1],s=o[2],p=o[3],l=Buffer.from(decodeURIComponent(p),s?"base64":"utf8");if(t){if(!i)throw new y("Blob is not supported",y.ERR_NOT_SUPPORT);return new i([l],{type:r})}return l}throw new y("Unsupported protocol "+a,y.ERR_NOT_SUPPORT)}var Ut=R(require("stream"),1);var Hu=R(require("stream"),1);var Sr=Symbol("internals"),Er=class extends Hu.default.Transform{constructor(t){t=d.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,a)=>!d.isUndefined(a[i])),super({readableHighWaterMark:t.chunkSize});let n=this[Sr]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(n.isCaptured||(n.isCaptured=!0))})}_read(t){let n=this[Sr];return n.onReadCallback&&n.onReadCallback(),super._read(t)}_transform(t,n,i){let a=this[Sr],o=a.maxRate,r=this.readableHighWaterMark,s=a.timeWindow,p=1e3/s,l=o/p,c=a.minChunkSize!==!1?Math.max(a.minChunkSize,l*.01):0,u=(h,m)=>{let x=Buffer.byteLength(h);a.bytesSeen+=x,a.bytes+=x,a.isCaptured&&this.emit("progress",a.bytesSeen),this.push(h)?process.nextTick(m):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(m)}},f=(h,m)=>{let x=Buffer.byteLength(h),v=null,b=r,E,_=0;if(o){let T=Date.now();(!a.ts||(_=T-a.ts)>=s)&&(a.ts=T,E=l-a.bytes,a.bytes=E<0?-E:0,_=0),E=l-a.bytes}if(o){if(E<=0)return setTimeout(()=>{m(null,h)},s-_);E<b&&(b=E)}b&&x>b&&x-b>c&&(v=h.subarray(b),h=h.subarray(0,b)),u(h,v?()=>{process.nextTick(m,null,v)}:m)};f(t,function h(m,x){if(m)return i(m);x?f(x,h):i(null)})}},Dr=Er;var dd=require("events");var Vu=require("util"),Ju=require("stream");var{asyncIterator:Wu}=Symbol,jw=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Wu]?yield*e[Wu]():yield e},ta=jw;var Lw=d.ALPHABET.ALPHA_DIGIT+"-_",ei=new Vu.TextEncoder,bt=`\r
40
- `,Nw=ei.encode(bt),qw=2,Rr=class{constructor(t,n){let{escapeName:i}=this.constructor,a=d.isString(n),o=`Content-Disposition: form-data; name="${i(t)}"${!a&&n.name?`; filename="${i(n.name)}"`:""}${bt}`;a?n=ei.encode(String(n).replace(/\r?\n|\r\n?/g,bt)):o+=`Content-Type: ${n.type||"application/octet-stream"}${bt}`,this.headers=ei.encode(o+bt),this.contentLength=a?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+qw,this.name=t,this.value=n}async*encode(){yield this.headers;let{value:t}=this;d.isTypedArray(t)?yield t:yield*ta(t),yield Nw}static escapeName(t){return String(t).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},Uw=(e,t,n)=>{let{tag:i="form-data-boundary",size:a=25,boundary:o=i+"-"+d.generateString(a,Lw)}=n||{};if(!d.isFormData(e))throw TypeError("FormData instance required");if(o.length<1||o.length>70)throw Error("boundary must be 10-70 characters long");let r=ei.encode("--"+o+bt),s=ei.encode("--"+o+"--"+bt+bt),p=s.byteLength,l=Array.from(e.entries()).map(([u,f])=>{let h=new Rr(u,f);return p+=h.size,h});p+=r.byteLength*l.length,p=d.toFiniteNumber(p);let c={"Content-Type":`multipart/form-data; boundary=${o}`};return Number.isFinite(p)&&(c["Content-Length"]=p),t&&t(c),Ju.Readable.from(async function*(){for(let u of l)yield r,yield*u.encode();yield s}())},Yu=Uw;var Ku=R(require("stream"),1),Or=class extends Ku.default.Transform{__transform(t,n,i){this.push(t),i()}_transform(t,n,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let a=Buffer.alloc(2);a[0]=120,a[1]=156,this.push(a,n)}this.__transform(t,n,i)}},Qu=Or;var Bw=(e,t)=>d.isAsyncFn(e)?function(...n){let i=n.pop();e.apply(this,n).then(a=>{try{t?i(null,...t(a)):i(null,a)}catch(o){i(o)}},i)}:e,Zu=Bw;function Mw(e,t){e=e||10;let n=new Array(e),i=new Array(e),a=0,o=0,r;return t=t!==void 0?t:1e3,function(p){let l=Date.now(),c=i[o];r||(r=l),n[a]=p,i[a]=l;let u=o,f=0;for(;u!==a;)f+=n[u++],u=u%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),l-r<t)return;let h=c&&l-c;return h?Math.round(f*1e3/h):void 0}}var ed=Mw;function $w(e,t){let n=0,i=1e3/t,a,o,r=(l,c=Date.now())=>{n=c,a=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{let c=Date.now(),u=c-n;u>=i?r(l,c):(a=l,o||(o=setTimeout(()=>{o=null,r(a)},i-u)))},()=>a&&r(a)]}var td=$w;var rt=(e,t,n=3)=>{let i=0,a=ed(50,250);return td(o=>{let r=o.loaded,s=o.lengthComputable?o.total:void 0,p=r-i,l=a(p),c=r<=s;i=r;let u={loaded:r,total:s,progress:s?r/s:void 0,bytes:p,rate:l||void 0,estimated:l&&s&&c?(s-r)/l:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(u)},n)},mn=(e,t)=>{let n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},fn=e=>(...t)=>d.asap(()=>e(...t));var nd={flush:st.default.constants.Z_SYNC_FLUSH,finishFlush:st.default.constants.Z_SYNC_FLUSH},Gw={flush:st.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:st.default.constants.BROTLI_OPERATION_FLUSH},id=d.isFunction(st.default.createBrotliDecompress),{http:zw,https:Xw}=ud.default,Hw=/https:?/,ad=B.protocols.map(e=>e+":"),od=(e,[t,n])=>(e.on("end",n).on("error",n),t);function Ww(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function md(e,t,n){let i=t;if(!i&&i!==!1){let a=(0,sd.getProxyForUrl)(n);a&&(i=new URL(a))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let o=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+o}e.headers.host=e.hostname+(e.port?":"+e.port:"");let a=i.hostname||i.host;e.hostname=a,e.host=a,e.port=i.port,e.path=n,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(o){md(o,t,o.href)}}var Vw=typeof process<"u"&&d.kindOf(process)==="process",Jw=e=>new Promise((t,n)=>{let i,a,o=(p,l)=>{a||(a=!0,i&&i(p,l))},r=p=>{o(p),t(p)},s=p=>{o(p,!0),n(p)};e(r,s,p=>i=p).catch(s)}),Yw=({address:e,family:t})=>{if(!d.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},rd=(e,t)=>Yw(d.isObject(e)?e:{address:e,family:t}),fd=Vw&&function(t){return Jw(async function(i,a,o){let{data:r,lookup:s,family:p}=t,{responseType:l,responseEncoding:c}=t,u=t.method.toUpperCase(),f,h=!1,m;if(s){let w=Zu(s,S=>d.isArray(S)?S:[S]);s=(S,C,ze)=>{w(S,C,(ie,Xe,Gt)=>{if(ie)return ze(ie);let Te=d.isArray(Xe)?Xe.map(we=>rd(we)):[rd(Xe,Gt)];C.all?ze(ie,Te):ze(ie,Te[0].address,Te[0].family)})}}let x=new dd.EventEmitter,v=()=>{t.cancelToken&&t.cancelToken.unsubscribe(b),t.signal&&t.signal.removeEventListener("abort",b),x.removeAllListeners()};o((w,S)=>{f=!0,S&&(h=!0,v())});function b(w){x.emit("abort",!w||w.type?new Pe(null,t,m):w)}x.once("abort",a),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(b),t.signal&&(t.signal.aborted?b():t.signal.addEventListener("abort",b)));let E=kt(t.baseURL,t.url),_=new URL(E,B.hasBrowserEnv?B.origin:void 0),T=_.protocol||ad[0];if(T==="data:"){let w;if(u!=="GET")return Ye(i,a,{status:405,statusText:"method not allowed",headers:{},config:t});try{w=_r(t.url,l==="blob",{Blob:t.env&&t.env.Blob})}catch(S){throw y.from(S,y.ERR_BAD_REQUEST,t)}return l==="text"?(w=w.toString(c),(!c||c==="utf8")&&(w=d.stripBOM(w))):l==="stream"&&(w=Ut.default.Readable.from(w)),Ye(i,a,{data:w,status:200,statusText:"OK",headers:new W,config:t})}if(ad.indexOf(T)===-1)return a(new y("Unsupported protocol "+T,y.ERR_BAD_REQUEST,t));let P=W.from(t.headers).normalize();P.set("User-Agent","axios/"+qt,!1);let{onUploadProgress:z,onDownloadProgress:ne}=t,Q=t.maxRate,D,A;if(d.isSpecCompliantForm(r)){let w=P.getContentType(/boundary=([-_\w\d]{10,70})/i);r=Yu(r,S=>{P.set(S)},{tag:`axios-${qt}-boundary`,boundary:w&&w[1]||void 0})}else if(d.isFormData(r)&&d.isFunction(r.getHeaders)){if(P.set(r.getHeaders()),!P.hasContentLength())try{let w=await ld.default.promisify(r.getLength).call(r);Number.isFinite(w)&&w>=0&&P.setContentLength(w)}catch{}}else if(d.isBlob(r))r.size&&P.setContentType(r.type||"application/octet-stream"),P.setContentLength(r.size||0),r=Ut.default.Readable.from(ta(r));else if(r&&!d.isStream(r)){if(!Buffer.isBuffer(r))if(d.isArrayBuffer(r))r=Buffer.from(new Uint8Array(r));else if(d.isString(r))r=Buffer.from(r,"utf-8");else return a(new y("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",y.ERR_BAD_REQUEST,t));if(P.setContentLength(r.length,!1),t.maxBodyLength>-1&&r.length>t.maxBodyLength)return a(new y("Request body larger than maxBodyLength limit",y.ERR_BAD_REQUEST,t))}let F=d.toFiniteNumber(P.getContentLength());d.isArray(Q)?(D=Q[0],A=Q[1]):D=A=Q,r&&(z||D)&&(d.isStream(r)||(r=Ut.default.Readable.from(r,{objectMode:!1})),r=Ut.default.pipeline([r,new Dr({maxRate:d.toFiniteNumber(D)})],d.noop),z&&r.on("progress",od(r,mn(F,rt(fn(z),!1,3)))));let M;if(t.auth){let w=t.auth.username||"",S=t.auth.password||"";M=w+":"+S}if(!M&&_.username){let w=_.username,S=_.password;M=w+":"+S}M&&P.delete("authorization");let X;try{X=Ft(_.pathname+_.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(w){let S=new Error(w.message);return S.config=t,S.url=t.url,S.exists=!0,a(S)}P.set("Accept-Encoding","gzip, compress, deflate"+(id?", br":""),!1);let k={path:X,method:u,headers:P.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:M,protocol:T,family:p,beforeRedirect:Ww,beforeRedirects:{}};!d.isUndefined(s)&&(k.lookup=s),t.socketPath?k.socketPath=t.socketPath:(k.hostname=_.hostname.startsWith("[")?_.hostname.slice(1,-1):_.hostname,k.port=_.port,md(k,t.proxy,T+"//"+_.hostname+(_.port?":"+_.port:"")+k.path));let L,N=Hw.test(k.protocol);if(k.agent=N?t.httpsAgent:t.httpAgent,t.transport?L=t.transport:t.maxRedirects===0?L=N?pd.default:cd.default:(t.maxRedirects&&(k.maxRedirects=t.maxRedirects),t.beforeRedirect&&(k.beforeRedirects.config=t.beforeRedirect),L=N?Xw:zw),t.maxBodyLength>-1?k.maxBodyLength=t.maxBodyLength:k.maxBodyLength=1/0,t.insecureHTTPParser&&(k.insecureHTTPParser=t.insecureHTTPParser),m=L.request(k,function(S){if(m.destroyed)return;let C=[S],ze=+S.headers["content-length"];if(ne||A){let we=new Dr({maxRate:d.toFiniteNumber(A)});ne&&we.on("progress",od(we,mn(ze,rt(fn(ne),!0,3)))),C.push(we)}let ie=S,Xe=S.req||m;if(t.decompress!==!1&&S.headers["content-encoding"])switch((u==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":C.push(st.default.createUnzip(nd)),delete S.headers["content-encoding"];break;case"deflate":C.push(new Qu),C.push(st.default.createUnzip(nd)),delete S.headers["content-encoding"];break;case"br":id&&(C.push(st.default.createBrotliDecompress(Gw)),delete S.headers["content-encoding"])}ie=C.length>1?Ut.default.pipeline(C,d.noop):C[0];let Gt=Ut.default.finished(ie,()=>{Gt(),v()}),Te={status:S.statusCode,statusText:S.statusMessage,headers:new W(S.headers),config:t,request:Xe};if(l==="stream")Te.data=ie,Ye(i,a,Te);else{let we=[],ii=0;ie.on("data",function(re){we.push(re),ii+=re.length,t.maxContentLength>-1&&ii>t.maxContentLength&&(h=!0,ie.destroy(),a(new y("maxContentLength size of "+t.maxContentLength+" exceeded",y.ERR_BAD_RESPONSE,t,Xe)))}),ie.on("aborted",function(){if(h)return;let re=new y("maxContentLength size of "+t.maxContentLength+" exceeded",y.ERR_BAD_RESPONSE,t,Xe);ie.destroy(re),a(re)}),ie.on("error",function(re){m.destroyed||a(y.from(re,null,t,Xe))}),ie.on("end",function(){try{let re=we.length===1?we[0]:Buffer.concat(we);l!=="arraybuffer"&&(re=re.toString(c),(!c||c==="utf8")&&(re=d.stripBOM(re))),Te.data=re}catch(re){return a(y.from(re,null,t,Te.request,Te))}Ye(i,a,Te)})}x.once("abort",we=>{ie.destroyed||(ie.emit("error",we),ie.destroy())})}),x.once("abort",w=>{a(w),m.destroy(w)}),m.on("error",function(S){a(y.from(S,null,t,m))}),m.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),t.timeout){let w=parseInt(t.timeout,10);if(Number.isNaN(w)){a(new y("error trying to parse `config.timeout` to int",y.ERR_BAD_OPTION_VALUE,t,m));return}m.setTimeout(w,function(){if(f)return;let C=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",ze=t.transitional||rn;t.timeoutErrorMessage&&(C=t.timeoutErrorMessage),a(new y(C,ze.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,t,m)),b()})}if(d.isStream(r)){let w=!1,S=!1;r.on("end",()=>{w=!0}),r.once("error",C=>{S=!0,m.destroy(C)}),r.on("close",()=>{!w&&!S&&b(new Pe("Request stream has been aborted",t,m))}),r.pipe(m)}else m.end(r)})};var hd=B.hasStandardBrowserEnv?function(){let t=B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent),n=document.createElement("a"),i;function a(o){let r=o;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=a(window.location.href),function(r){let s=d.isString(r)?a(r):r;return s.protocol===i.protocol&&s.host===i.host}}():function(){return function(){return!0}}();var xd=B.hasStandardBrowserEnv?{write(e,t,n,i,a,o){let r=[e+"="+encodeURIComponent(t)];d.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),d.isString(i)&&r.push("path="+i),d.isString(a)&&r.push("domain="+a),o===!0&&r.push("secure"),document.cookie=r.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var vd=e=>e instanceof W?{...e}:e;function Be(e,t){t=t||{};let n={};function i(l,c,u){return d.isPlainObject(l)&&d.isPlainObject(c)?d.merge.call({caseless:u},l,c):d.isPlainObject(c)?d.merge({},c):d.isArray(c)?c.slice():c}function a(l,c,u){if(d.isUndefined(c)){if(!d.isUndefined(l))return i(void 0,l,u)}else return i(l,c,u)}function o(l,c){if(!d.isUndefined(c))return i(void 0,c)}function r(l,c){if(d.isUndefined(c)){if(!d.isUndefined(l))return i(void 0,l)}else return i(void 0,c)}function s(l,c,u){if(u in t)return i(l,c);if(u in e)return i(void 0,l)}let p={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:s,headers:(l,c)=>a(vd(l),vd(c),!0)};return d.forEach(Object.keys(Object.assign({},e,t)),function(c){let u=p[c]||a,f=u(e[c],t[c],c);d.isUndefined(f)&&u!==s||(n[c]=f)}),n}var na=e=>{let t=Be({},e),{data:n,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:o,headers:r,auth:s}=t;t.headers=r=W.from(r),t.url=Ft(kt(t.baseURL,t.url),e.params,e.paramsSerializer),s&&r.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let p;if(d.isFormData(n)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if((p=r.getContentType())!==!1){let[l,...c]=p?p.split(";").map(u=>u.trim()).filter(Boolean):[];r.setContentType([l||"multipart/form-data",...c].join("; "))}}if(B.hasStandardBrowserEnv&&(i&&d.isFunction(i)&&(i=i(t)),i||i!==!1&&hd(t.url))){let l=a&&o&&xd.read(o);l&&r.set(a,l)}return t};var Kw=typeof XMLHttpRequest<"u",gd=Kw&&function(e){return new Promise(function(n,i){let a=na(e),o=a.data,r=W.from(a.headers).normalize(),{responseType:s,onUploadProgress:p,onDownloadProgress:l}=a,c,u,f,h,m;function x(){h&&h(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(c),a.signal&&a.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(a.method.toUpperCase(),a.url,!0),v.timeout=a.timeout;function b(){if(!v)return;let _=W.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),P={data:!s||s==="text"||s==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:_,config:e,request:v};Ye(function(ne){n(ne),x()},function(ne){i(ne),x()},P),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(b)},v.onabort=function(){v&&(i(new y("Request aborted",y.ECONNABORTED,e,v)),v=null)},v.onerror=function(){i(new y("Network Error",y.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let T=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",P=a.transitional||rn;a.timeoutErrorMessage&&(T=a.timeoutErrorMessage),i(new y(T,P.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,v)),v=null},o===void 0&&r.setContentType(null),"setRequestHeader"in v&&d.forEach(r.toJSON(),function(T,P){v.setRequestHeader(P,T)}),d.isUndefined(a.withCredentials)||(v.withCredentials=!!a.withCredentials),s&&s!=="json"&&(v.responseType=a.responseType),l&&([f,m]=rt(l,!0),v.addEventListener("progress",f)),p&&v.upload&&([u,h]=rt(p),v.upload.addEventListener("progress",u),v.upload.addEventListener("loadend",h)),(a.cancelToken||a.signal)&&(c=_=>{v&&(i(!_||_.type?new Pe(null,e,v):_),v.abort(),v=null)},a.cancelToken&&a.cancelToken.subscribe(c),a.signal&&(a.signal.aborted?c():a.signal.addEventListener("abort",c)));let E=Zn(a.url);if(E&&B.protocols.indexOf(E)===-1){i(new y("Unsupported protocol "+E+":",y.ERR_BAD_REQUEST,e));return}v.send(o||null)})};var Qw=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,a,o=function(l){if(!a){a=!0,s();let c=l instanceof Error?l:this.reason;i.abort(c instanceof y?c:new Pe(c instanceof Error?c.message:c))}},r=t&&setTimeout(()=>{r=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t),s=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));let{signal:p}=i;return p.unsubscribe=()=>d.asap(s),p}},bd=Qw;var Zw=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let i=0,a;for(;i<n;)a=i+t,yield e.slice(i,a),i=a},e_=async function*(e,t){for await(let n of t_(e))yield*Zw(n,t)},t_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},Cr=(e,t,n,i)=>{let a=e_(e,t),o=0,r,s=p=>{r||(r=!0,i&&i(p))};return new ReadableStream({async pull(p){try{let{done:l,value:c}=await a.next();if(l){s(),p.close();return}let u=c.byteLength;if(n){let f=o+=u;n(f)}p.enqueue(new Uint8Array(c))}catch(l){throw s(l),l}},cancel(p){return s(p),a.return()}},{highWaterMark:2})};var aa=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",wd=aa&&typeof ReadableStream=="function",n_=aa&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),_d=(e,...t)=>{try{return!!e(...t)}catch{return!1}},i_=wd&&_d(()=>{let e=!1,t=new Request(B.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),yd=64*1024,Tr=wd&&_d(()=>d.isReadableStream(new Response("").body)),ia={stream:Tr&&(e=>e.body)};aa&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ia[t]&&(ia[t]=d.isFunction(e[t])?n=>n[t]():(n,i)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,i)})})})(new Response);var a_=async e=>{if(e==null)return 0;if(d.isBlob(e))return e.size;if(d.isSpecCompliantForm(e))return(await new Request(B.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(d.isArrayBufferView(e)||d.isArrayBuffer(e))return e.byteLength;if(d.isURLSearchParams(e)&&(e=e+""),d.isString(e))return(await n_(e)).byteLength},o_=async(e,t)=>{let n=d.toFiniteNumber(e.getContentLength());return n??a_(t)},Sd=aa&&(async e=>{let{url:t,method:n,data:i,signal:a,cancelToken:o,timeout:r,onDownloadProgress:s,onUploadProgress:p,responseType:l,headers:c,withCredentials:u="same-origin",fetchOptions:f}=na(e);l=l?(l+"").toLowerCase():"text";let h=bd([a,o&&o.toAbortSignal()],r),m,x=h&&h.unsubscribe&&(()=>{h.unsubscribe()}),v;try{if(p&&i_&&n!=="get"&&n!=="head"&&(v=await o_(c,i))!==0){let P=new Request(t,{method:"POST",body:i,duplex:"half"}),z;if(d.isFormData(i)&&(z=P.headers.get("content-type"))&&c.setContentType(z),P.body){let[ne,Q]=mn(v,rt(fn(p)));i=Cr(P.body,yd,ne,Q)}}d.isString(u)||(u=u?"include":"omit");let b="credentials"in Request.prototype;m=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:i,duplex:"half",credentials:b?u:void 0});let E=await fetch(m),_=Tr&&(l==="stream"||l==="response");if(Tr&&(s||_&&x)){let P={};["status","statusText","headers"].forEach(D=>{P[D]=E[D]});let z=d.toFiniteNumber(E.headers.get("content-length")),[ne,Q]=s&&mn(z,rt(fn(s),!0))||[];E=new Response(Cr(E.body,yd,ne,()=>{Q&&Q(),x&&x()}),P)}l=l||"text";let T=await ia[d.findKey(ia,l)||"text"](E,e);return!_&&x&&x(),await new Promise((P,z)=>{Ye(P,z,{data:T,headers:W.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:m})})}catch(b){throw x&&x(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,m),{cause:b.cause||b}):y.from(b,b&&b.code,e,m)}});var Ir={http:fd,xhr:gd,fetch:Sd};d.forEach(Ir,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var Ed=e=>`- ${e}`,r_=e=>d.isFunction(e)||e===null||e===!1,oa={getAdapter:e=>{e=d.isArray(e)?e:[e];let{length:t}=e,n,i,a={};for(let o=0;o<t;o++){n=e[o];let r;if(i=n,!r_(n)&&(i=Ir[(r=String(n)).toLowerCase()],i===void 0))throw new y(`Unknown adapter '${r}'`);if(i)break;a[r||"#"+o]=i}if(!i){let o=Object.entries(a).map(([s,p])=>`adapter ${s} `+(p===!1?"is not supported by the environment":"is not available in the build")),r=t?o.length>1?`since :
39
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(a=>i.set(a)),i}static accessor(t){let i=(this[Su]=this[Su]={accessors:{}}).accessors,a=this.prototype;function o(r){let s=Hn(r);i[s]||(Jy(a,r),i[s]=!0)}return d.isArray(t)?t.forEach(o):o(t),this}};cn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(cn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});d.freezeMethods(cn);var W=cn;function Wn(e,t){let n=this||sn,i=t||n,a=W.from(i.headers),o=i.data;return d.forEach(e,function(s){o=s.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function Vn(e){return!!(e&&e.__CANCEL__)}function Eu(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}d.inherits(Eu,y,{__CANCEL__:!0});var Pe=Eu;function Ke(e,t,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ar(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function or(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function kt(e,t){return e&&!ar(t)?or(e,t):t}var sd=R(Ru(),1),cd=R(require("http"),1),pd=R(require("https"),1),ld=R(require("util"),1),ud=R(Xu(),1),st=R(require("zlib"),1);var qt="1.7.7";function Zn(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var kw=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function _r(e,t,n){let i=n&&n.Blob||B.classes.Blob,a=Zn(e);if(t===void 0&&i&&(t=!0),a==="data"){e=a.length?e.slice(a.length+1):e;let o=kw.exec(e);if(!o)throw new y("Invalid URL",y.ERR_INVALID_URL);let r=o[1],s=o[2],p=o[3],l=Buffer.from(decodeURIComponent(p),s?"base64":"utf8");if(t){if(!i)throw new y("Blob is not supported",y.ERR_NOT_SUPPORT);return new i([l],{type:r})}return l}throw new y("Unsupported protocol "+a,y.ERR_NOT_SUPPORT)}var Ut=R(require("stream"),1);var Hu=R(require("stream"),1);var Sr=Symbol("internals"),Er=class extends Hu.default.Transform{constructor(t){t=d.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,a)=>!d.isUndefined(a[i])),super({readableHighWaterMark:t.chunkSize});let n=this[Sr]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(n.isCaptured||(n.isCaptured=!0))})}_read(t){let n=this[Sr];return n.onReadCallback&&n.onReadCallback(),super._read(t)}_transform(t,n,i){let a=this[Sr],o=a.maxRate,r=this.readableHighWaterMark,s=a.timeWindow,p=1e3/s,l=o/p,c=a.minChunkSize!==!1?Math.max(a.minChunkSize,l*.01):0,u=(h,m)=>{let x=Buffer.byteLength(h);a.bytesSeen+=x,a.bytes+=x,a.isCaptured&&this.emit("progress",a.bytesSeen),this.push(h)?process.nextTick(m):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(m)}},f=(h,m)=>{let x=Buffer.byteLength(h),v=null,b=r,E,_=0;if(o){let T=Date.now();(!a.ts||(_=T-a.ts)>=s)&&(a.ts=T,E=l-a.bytes,a.bytes=E<0?-E:0,_=0),E=l-a.bytes}if(o){if(E<=0)return setTimeout(()=>{m(null,h)},s-_);E<b&&(b=E)}b&&x>b&&x-b>c&&(v=h.subarray(b),h=h.subarray(0,b)),u(h,v?()=>{process.nextTick(m,null,v)}:m)};f(t,function h(m,x){if(m)return i(m);x?f(x,h):i(null)})}},Dr=Er;var dd=require("events");var Vu=require("util"),Ju=require("stream");var{asyncIterator:Wu}=Symbol,jw=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Wu]?yield*e[Wu]():yield e},ta=jw;var Lw=d.ALPHABET.ALPHA_DIGIT+"-_",ei=new Vu.TextEncoder,bt=`\r
40
+ `,Nw=ei.encode(bt),qw=2,Rr=class{constructor(t,n){let{escapeName:i}=this.constructor,a=d.isString(n),o=`Content-Disposition: form-data; name="${i(t)}"${!a&&n.name?`; filename="${i(n.name)}"`:""}${bt}`;a?n=ei.encode(String(n).replace(/\r?\n|\r\n?/g,bt)):o+=`Content-Type: ${n.type||"application/octet-stream"}${bt}`,this.headers=ei.encode(o+bt),this.contentLength=a?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+qw,this.name=t,this.value=n}async*encode(){yield this.headers;let{value:t}=this;d.isTypedArray(t)?yield t:yield*ta(t),yield Nw}static escapeName(t){return String(t).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},Uw=(e,t,n)=>{let{tag:i="form-data-boundary",size:a=25,boundary:o=i+"-"+d.generateString(a,Lw)}=n||{};if(!d.isFormData(e))throw TypeError("FormData instance required");if(o.length<1||o.length>70)throw Error("boundary must be 10-70 characters long");let r=ei.encode("--"+o+bt),s=ei.encode("--"+o+"--"+bt+bt),p=s.byteLength,l=Array.from(e.entries()).map(([u,f])=>{let h=new Rr(u,f);return p+=h.size,h});p+=r.byteLength*l.length,p=d.toFiniteNumber(p);let c={"Content-Type":`multipart/form-data; boundary=${o}`};return Number.isFinite(p)&&(c["Content-Length"]=p),t&&t(c),Ju.Readable.from(async function*(){for(let u of l)yield r,yield*u.encode();yield s}())},Yu=Uw;var Ku=R(require("stream"),1),Or=class extends Ku.default.Transform{__transform(t,n,i){this.push(t),i()}_transform(t,n,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let a=Buffer.alloc(2);a[0]=120,a[1]=156,this.push(a,n)}this.__transform(t,n,i)}},Qu=Or;var Bw=(e,t)=>d.isAsyncFn(e)?function(...n){let i=n.pop();e.apply(this,n).then(a=>{try{t?i(null,...t(a)):i(null,a)}catch(o){i(o)}},i)}:e,Zu=Bw;function Mw(e,t){e=e||10;let n=new Array(e),i=new Array(e),a=0,o=0,r;return t=t!==void 0?t:1e3,function(p){let l=Date.now(),c=i[o];r||(r=l),n[a]=p,i[a]=l;let u=o,f=0;for(;u!==a;)f+=n[u++],u=u%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),l-r<t)return;let h=c&&l-c;return h?Math.round(f*1e3/h):void 0}}var ed=Mw;function $w(e,t){let n=0,i=1e3/t,a,o,r=(l,c=Date.now())=>{n=c,a=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{let c=Date.now(),u=c-n;u>=i?r(l,c):(a=l,o||(o=setTimeout(()=>{o=null,r(a)},i-u)))},()=>a&&r(a)]}var td=$w;var rt=(e,t,n=3)=>{let i=0,a=ed(50,250);return td(o=>{let r=o.loaded,s=o.lengthComputable?o.total:void 0,p=r-i,l=a(p),c=r<=s;i=r;let u={loaded:r,total:s,progress:s?r/s:void 0,bytes:p,rate:l||void 0,estimated:l&&s&&c?(s-r)/l:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(u)},n)},mn=(e,t)=>{let n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},fn=e=>(...t)=>d.asap(()=>e(...t));var nd={flush:st.default.constants.Z_SYNC_FLUSH,finishFlush:st.default.constants.Z_SYNC_FLUSH},Gw={flush:st.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:st.default.constants.BROTLI_OPERATION_FLUSH},id=d.isFunction(st.default.createBrotliDecompress),{http:zw,https:Xw}=ud.default,Hw=/https:?/,ad=B.protocols.map(e=>e+":"),od=(e,[t,n])=>(e.on("end",n).on("error",n),t);function Ww(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function md(e,t,n){let i=t;if(!i&&i!==!1){let a=(0,sd.getProxyForUrl)(n);a&&(i=new URL(a))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let o=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+o}e.headers.host=e.hostname+(e.port?":"+e.port:"");let a=i.hostname||i.host;e.hostname=a,e.host=a,e.port=i.port,e.path=n,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(o){md(o,t,o.href)}}var Vw=typeof process<"u"&&d.kindOf(process)==="process",Jw=e=>new Promise((t,n)=>{let i,a,o=(p,l)=>{a||(a=!0,i&&i(p,l))},r=p=>{o(p),t(p)},s=p=>{o(p,!0),n(p)};e(r,s,p=>i=p).catch(s)}),Yw=({address:e,family:t})=>{if(!d.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},rd=(e,t)=>Yw(d.isObject(e)?e:{address:e,family:t}),fd=Vw&&function(t){return Jw(async function(i,a,o){let{data:r,lookup:s,family:p}=t,{responseType:l,responseEncoding:c}=t,u=t.method.toUpperCase(),f,h=!1,m;if(s){let w=Zu(s,S=>d.isArray(S)?S:[S]);s=(S,C,ze)=>{w(S,C,(ie,Xe,Gt)=>{if(ie)return ze(ie);let Te=d.isArray(Xe)?Xe.map(we=>rd(we)):[rd(Xe,Gt)];C.all?ze(ie,Te):ze(ie,Te[0].address,Te[0].family)})}}let x=new dd.EventEmitter,v=()=>{t.cancelToken&&t.cancelToken.unsubscribe(b),t.signal&&t.signal.removeEventListener("abort",b),x.removeAllListeners()};o((w,S)=>{f=!0,S&&(h=!0,v())});function b(w){x.emit("abort",!w||w.type?new Pe(null,t,m):w)}x.once("abort",a),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(b),t.signal&&(t.signal.aborted?b():t.signal.addEventListener("abort",b)));let E=kt(t.baseURL,t.url),_=new URL(E,B.hasBrowserEnv?B.origin:void 0),T=_.protocol||ad[0];if(T==="data:"){let w;if(u!=="GET")return Ke(i,a,{status:405,statusText:"method not allowed",headers:{},config:t});try{w=_r(t.url,l==="blob",{Blob:t.env&&t.env.Blob})}catch(S){throw y.from(S,y.ERR_BAD_REQUEST,t)}return l==="text"?(w=w.toString(c),(!c||c==="utf8")&&(w=d.stripBOM(w))):l==="stream"&&(w=Ut.default.Readable.from(w)),Ke(i,a,{data:w,status:200,statusText:"OK",headers:new W,config:t})}if(ad.indexOf(T)===-1)return a(new y("Unsupported protocol "+T,y.ERR_BAD_REQUEST,t));let P=W.from(t.headers).normalize();P.set("User-Agent","axios/"+qt,!1);let{onUploadProgress:z,onDownloadProgress:ne}=t,Q=t.maxRate,D,A;if(d.isSpecCompliantForm(r)){let w=P.getContentType(/boundary=([-_\w\d]{10,70})/i);r=Yu(r,S=>{P.set(S)},{tag:`axios-${qt}-boundary`,boundary:w&&w[1]||void 0})}else if(d.isFormData(r)&&d.isFunction(r.getHeaders)){if(P.set(r.getHeaders()),!P.hasContentLength())try{let w=await ld.default.promisify(r.getLength).call(r);Number.isFinite(w)&&w>=0&&P.setContentLength(w)}catch{}}else if(d.isBlob(r))r.size&&P.setContentType(r.type||"application/octet-stream"),P.setContentLength(r.size||0),r=Ut.default.Readable.from(ta(r));else if(r&&!d.isStream(r)){if(!Buffer.isBuffer(r))if(d.isArrayBuffer(r))r=Buffer.from(new Uint8Array(r));else if(d.isString(r))r=Buffer.from(r,"utf-8");else return a(new y("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",y.ERR_BAD_REQUEST,t));if(P.setContentLength(r.length,!1),t.maxBodyLength>-1&&r.length>t.maxBodyLength)return a(new y("Request body larger than maxBodyLength limit",y.ERR_BAD_REQUEST,t))}let F=d.toFiniteNumber(P.getContentLength());d.isArray(Q)?(D=Q[0],A=Q[1]):D=A=Q,r&&(z||D)&&(d.isStream(r)||(r=Ut.default.Readable.from(r,{objectMode:!1})),r=Ut.default.pipeline([r,new Dr({maxRate:d.toFiniteNumber(D)})],d.noop),z&&r.on("progress",od(r,mn(F,rt(fn(z),!1,3)))));let M;if(t.auth){let w=t.auth.username||"",S=t.auth.password||"";M=w+":"+S}if(!M&&_.username){let w=_.username,S=_.password;M=w+":"+S}M&&P.delete("authorization");let X;try{X=Ft(_.pathname+_.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(w){let S=new Error(w.message);return S.config=t,S.url=t.url,S.exists=!0,a(S)}P.set("Accept-Encoding","gzip, compress, deflate"+(id?", br":""),!1);let k={path:X,method:u,headers:P.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:M,protocol:T,family:p,beforeRedirect:Ww,beforeRedirects:{}};!d.isUndefined(s)&&(k.lookup=s),t.socketPath?k.socketPath=t.socketPath:(k.hostname=_.hostname.startsWith("[")?_.hostname.slice(1,-1):_.hostname,k.port=_.port,md(k,t.proxy,T+"//"+_.hostname+(_.port?":"+_.port:"")+k.path));let L,N=Hw.test(k.protocol);if(k.agent=N?t.httpsAgent:t.httpAgent,t.transport?L=t.transport:t.maxRedirects===0?L=N?pd.default:cd.default:(t.maxRedirects&&(k.maxRedirects=t.maxRedirects),t.beforeRedirect&&(k.beforeRedirects.config=t.beforeRedirect),L=N?Xw:zw),t.maxBodyLength>-1?k.maxBodyLength=t.maxBodyLength:k.maxBodyLength=1/0,t.insecureHTTPParser&&(k.insecureHTTPParser=t.insecureHTTPParser),m=L.request(k,function(S){if(m.destroyed)return;let C=[S],ze=+S.headers["content-length"];if(ne||A){let we=new Dr({maxRate:d.toFiniteNumber(A)});ne&&we.on("progress",od(we,mn(ze,rt(fn(ne),!0,3)))),C.push(we)}let ie=S,Xe=S.req||m;if(t.decompress!==!1&&S.headers["content-encoding"])switch((u==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":C.push(st.default.createUnzip(nd)),delete S.headers["content-encoding"];break;case"deflate":C.push(new Qu),C.push(st.default.createUnzip(nd)),delete S.headers["content-encoding"];break;case"br":id&&(C.push(st.default.createBrotliDecompress(Gw)),delete S.headers["content-encoding"])}ie=C.length>1?Ut.default.pipeline(C,d.noop):C[0];let Gt=Ut.default.finished(ie,()=>{Gt(),v()}),Te={status:S.statusCode,statusText:S.statusMessage,headers:new W(S.headers),config:t,request:Xe};if(l==="stream")Te.data=ie,Ke(i,a,Te);else{let we=[],ii=0;ie.on("data",function(re){we.push(re),ii+=re.length,t.maxContentLength>-1&&ii>t.maxContentLength&&(h=!0,ie.destroy(),a(new y("maxContentLength size of "+t.maxContentLength+" exceeded",y.ERR_BAD_RESPONSE,t,Xe)))}),ie.on("aborted",function(){if(h)return;let re=new y("maxContentLength size of "+t.maxContentLength+" exceeded",y.ERR_BAD_RESPONSE,t,Xe);ie.destroy(re),a(re)}),ie.on("error",function(re){m.destroyed||a(y.from(re,null,t,Xe))}),ie.on("end",function(){try{let re=we.length===1?we[0]:Buffer.concat(we);l!=="arraybuffer"&&(re=re.toString(c),(!c||c==="utf8")&&(re=d.stripBOM(re))),Te.data=re}catch(re){return a(y.from(re,null,t,Te.request,Te))}Ke(i,a,Te)})}x.once("abort",we=>{ie.destroyed||(ie.emit("error",we),ie.destroy())})}),x.once("abort",w=>{a(w),m.destroy(w)}),m.on("error",function(S){a(y.from(S,null,t,m))}),m.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),t.timeout){let w=parseInt(t.timeout,10);if(Number.isNaN(w)){a(new y("error trying to parse `config.timeout` to int",y.ERR_BAD_OPTION_VALUE,t,m));return}m.setTimeout(w,function(){if(f)return;let C=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",ze=t.transitional||rn;t.timeoutErrorMessage&&(C=t.timeoutErrorMessage),a(new y(C,ze.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,t,m)),b()})}if(d.isStream(r)){let w=!1,S=!1;r.on("end",()=>{w=!0}),r.once("error",C=>{S=!0,m.destroy(C)}),r.on("close",()=>{!w&&!S&&b(new Pe("Request stream has been aborted",t,m))}),r.pipe(m)}else m.end(r)})};var hd=B.hasStandardBrowserEnv?function(){let t=B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent),n=document.createElement("a"),i;function a(o){let r=o;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=a(window.location.href),function(r){let s=d.isString(r)?a(r):r;return s.protocol===i.protocol&&s.host===i.host}}():function(){return function(){return!0}}();var xd=B.hasStandardBrowserEnv?{write(e,t,n,i,a,o){let r=[e+"="+encodeURIComponent(t)];d.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),d.isString(i)&&r.push("path="+i),d.isString(a)&&r.push("domain="+a),o===!0&&r.push("secure"),document.cookie=r.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var vd=e=>e instanceof W?{...e}:e;function Be(e,t){t=t||{};let n={};function i(l,c,u){return d.isPlainObject(l)&&d.isPlainObject(c)?d.merge.call({caseless:u},l,c):d.isPlainObject(c)?d.merge({},c):d.isArray(c)?c.slice():c}function a(l,c,u){if(d.isUndefined(c)){if(!d.isUndefined(l))return i(void 0,l,u)}else return i(l,c,u)}function o(l,c){if(!d.isUndefined(c))return i(void 0,c)}function r(l,c){if(d.isUndefined(c)){if(!d.isUndefined(l))return i(void 0,l)}else return i(void 0,c)}function s(l,c,u){if(u in t)return i(l,c);if(u in e)return i(void 0,l)}let p={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:s,headers:(l,c)=>a(vd(l),vd(c),!0)};return d.forEach(Object.keys(Object.assign({},e,t)),function(c){let u=p[c]||a,f=u(e[c],t[c],c);d.isUndefined(f)&&u!==s||(n[c]=f)}),n}var na=e=>{let t=Be({},e),{data:n,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:o,headers:r,auth:s}=t;t.headers=r=W.from(r),t.url=Ft(kt(t.baseURL,t.url),e.params,e.paramsSerializer),s&&r.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let p;if(d.isFormData(n)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if((p=r.getContentType())!==!1){let[l,...c]=p?p.split(";").map(u=>u.trim()).filter(Boolean):[];r.setContentType([l||"multipart/form-data",...c].join("; "))}}if(B.hasStandardBrowserEnv&&(i&&d.isFunction(i)&&(i=i(t)),i||i!==!1&&hd(t.url))){let l=a&&o&&xd.read(o);l&&r.set(a,l)}return t};var Kw=typeof XMLHttpRequest<"u",gd=Kw&&function(e){return new Promise(function(n,i){let a=na(e),o=a.data,r=W.from(a.headers).normalize(),{responseType:s,onUploadProgress:p,onDownloadProgress:l}=a,c,u,f,h,m;function x(){h&&h(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(c),a.signal&&a.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(a.method.toUpperCase(),a.url,!0),v.timeout=a.timeout;function b(){if(!v)return;let _=W.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),P={data:!s||s==="text"||s==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:_,config:e,request:v};Ke(function(ne){n(ne),x()},function(ne){i(ne),x()},P),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(b)},v.onabort=function(){v&&(i(new y("Request aborted",y.ECONNABORTED,e,v)),v=null)},v.onerror=function(){i(new y("Network Error",y.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let T=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",P=a.transitional||rn;a.timeoutErrorMessage&&(T=a.timeoutErrorMessage),i(new y(T,P.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,v)),v=null},o===void 0&&r.setContentType(null),"setRequestHeader"in v&&d.forEach(r.toJSON(),function(T,P){v.setRequestHeader(P,T)}),d.isUndefined(a.withCredentials)||(v.withCredentials=!!a.withCredentials),s&&s!=="json"&&(v.responseType=a.responseType),l&&([f,m]=rt(l,!0),v.addEventListener("progress",f)),p&&v.upload&&([u,h]=rt(p),v.upload.addEventListener("progress",u),v.upload.addEventListener("loadend",h)),(a.cancelToken||a.signal)&&(c=_=>{v&&(i(!_||_.type?new Pe(null,e,v):_),v.abort(),v=null)},a.cancelToken&&a.cancelToken.subscribe(c),a.signal&&(a.signal.aborted?c():a.signal.addEventListener("abort",c)));let E=Zn(a.url);if(E&&B.protocols.indexOf(E)===-1){i(new y("Unsupported protocol "+E+":",y.ERR_BAD_REQUEST,e));return}v.send(o||null)})};var Qw=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,a,o=function(l){if(!a){a=!0,s();let c=l instanceof Error?l:this.reason;i.abort(c instanceof y?c:new Pe(c instanceof Error?c.message:c))}},r=t&&setTimeout(()=>{r=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t),s=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));let{signal:p}=i;return p.unsubscribe=()=>d.asap(s),p}},bd=Qw;var Zw=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let i=0,a;for(;i<n;)a=i+t,yield e.slice(i,a),i=a},e_=async function*(e,t){for await(let n of t_(e))yield*Zw(n,t)},t_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},Cr=(e,t,n,i)=>{let a=e_(e,t),o=0,r,s=p=>{r||(r=!0,i&&i(p))};return new ReadableStream({async pull(p){try{let{done:l,value:c}=await a.next();if(l){s(),p.close();return}let u=c.byteLength;if(n){let f=o+=u;n(f)}p.enqueue(new Uint8Array(c))}catch(l){throw s(l),l}},cancel(p){return s(p),a.return()}},{highWaterMark:2})};var aa=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",wd=aa&&typeof ReadableStream=="function",n_=aa&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),_d=(e,...t)=>{try{return!!e(...t)}catch{return!1}},i_=wd&&_d(()=>{let e=!1,t=new Request(B.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),yd=64*1024,Tr=wd&&_d(()=>d.isReadableStream(new Response("").body)),ia={stream:Tr&&(e=>e.body)};aa&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ia[t]&&(ia[t]=d.isFunction(e[t])?n=>n[t]():(n,i)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,i)})})})(new Response);var a_=async e=>{if(e==null)return 0;if(d.isBlob(e))return e.size;if(d.isSpecCompliantForm(e))return(await new Request(B.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(d.isArrayBufferView(e)||d.isArrayBuffer(e))return e.byteLength;if(d.isURLSearchParams(e)&&(e=e+""),d.isString(e))return(await n_(e)).byteLength},o_=async(e,t)=>{let n=d.toFiniteNumber(e.getContentLength());return n??a_(t)},Sd=aa&&(async e=>{let{url:t,method:n,data:i,signal:a,cancelToken:o,timeout:r,onDownloadProgress:s,onUploadProgress:p,responseType:l,headers:c,withCredentials:u="same-origin",fetchOptions:f}=na(e);l=l?(l+"").toLowerCase():"text";let h=bd([a,o&&o.toAbortSignal()],r),m,x=h&&h.unsubscribe&&(()=>{h.unsubscribe()}),v;try{if(p&&i_&&n!=="get"&&n!=="head"&&(v=await o_(c,i))!==0){let P=new Request(t,{method:"POST",body:i,duplex:"half"}),z;if(d.isFormData(i)&&(z=P.headers.get("content-type"))&&c.setContentType(z),P.body){let[ne,Q]=mn(v,rt(fn(p)));i=Cr(P.body,yd,ne,Q)}}d.isString(u)||(u=u?"include":"omit");let b="credentials"in Request.prototype;m=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:i,duplex:"half",credentials:b?u:void 0});let E=await fetch(m),_=Tr&&(l==="stream"||l==="response");if(Tr&&(s||_&&x)){let P={};["status","statusText","headers"].forEach(D=>{P[D]=E[D]});let z=d.toFiniteNumber(E.headers.get("content-length")),[ne,Q]=s&&mn(z,rt(fn(s),!0))||[];E=new Response(Cr(E.body,yd,ne,()=>{Q&&Q(),x&&x()}),P)}l=l||"text";let T=await ia[d.findKey(ia,l)||"text"](E,e);return!_&&x&&x(),await new Promise((P,z)=>{Ke(P,z,{data:T,headers:W.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:m})})}catch(b){throw x&&x(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,m),{cause:b.cause||b}):y.from(b,b&&b.code,e,m)}});var Ir={http:fd,xhr:gd,fetch:Sd};d.forEach(Ir,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var Ed=e=>`- ${e}`,r_=e=>d.isFunction(e)||e===null||e===!1,oa={getAdapter:e=>{e=d.isArray(e)?e:[e];let{length:t}=e,n,i,a={};for(let o=0;o<t;o++){n=e[o];let r;if(i=n,!r_(n)&&(i=Ir[(r=String(n)).toLowerCase()],i===void 0))throw new y(`Unknown adapter '${r}'`);if(i)break;a[r||"#"+o]=i}if(!i){let o=Object.entries(a).map(([s,p])=>`adapter ${s} `+(p===!1?"is not supported by the environment":"is not available in the build")),r=t?o.length>1?`since :
41
41
  `+o.map(Ed).join(`
42
42
  `):" "+Ed(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:Ir};function Pr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pe(null,e)}function ra(e){return Pr(e),e.headers=W.from(e.headers),e.data=Wn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),oa.getAdapter(e.adapter||sn.adapter)(e).then(function(i){return Pr(e),i.data=Wn.call(e,e.transformResponse,i),i.headers=W.from(i.headers),i},function(i){return Vn(i)||(Pr(e),i&&i.response&&(i.response.data=Wn.call(e,e.transformResponse,i.response),i.response.headers=W.from(i.response.headers))),Promise.reject(i)})}var Ar={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ar[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});var Dd={};Ar.transitional=function(t,n,i){function a(o,r){return"[Axios v"+qt+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,s)=>{if(t===!1)throw new y(a(r," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!Dd[r]&&(Dd[r]=!0,console.warn(a(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,r,s):!0}};function s_(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);let i=Object.keys(e),a=i.length;for(;a-- >0;){let o=i[a],r=t[o];if(r){let s=e[o],p=s===void 0||r(s,o,e);if(p!==!0)throw new y("option "+o+" must be "+p,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}var sa={assertOptions:s_,validators:Ar};var yt=sa.validators,hn=class{constructor(t){this.defaults=t,this.interceptors={request:new Ko,response:new Ko}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let a;Error.captureStackTrace?Error.captureStackTrace(a={}):a=new Error;let o=a.stack?a.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
43
43
  `+o):i.stack=o}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Be(this.defaults,n);let{transitional:i,paramsSerializer:a,headers:o}=n;i!==void 0&&sa.assertOptions(i,{silentJSONParsing:yt.transitional(yt.boolean),forcedJSONParsing:yt.transitional(yt.boolean),clarifyTimeoutError:yt.transitional(yt.boolean)},!1),a!=null&&(d.isFunction(a)?n.paramsSerializer={serialize:a}:sa.assertOptions(a,{encode:yt.function,serialize:yt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=o&&d.merge(o.common,o[n.method]);o&&d.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),n.headers=W.concat(r,o);let s=[],p=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(p=p&&x.synchronous,s.unshift(x.fulfilled,x.rejected))});let l=[];this.interceptors.response.forEach(function(x){l.push(x.fulfilled,x.rejected)});let c,u=0,f;if(!p){let m=[ra.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,l),f=m.length,c=Promise.resolve(n);u<f;)c=c.then(m[u++],m[u++]);return c}f=s.length;let h=n;for(u=0;u<f;){let m=s[u++],x=s[u++];try{h=m(h)}catch(v){x.call(this,v);break}}try{c=ra.call(this,h)}catch(m){return Promise.reject(m)}for(u=0,f=l.length;u<f;)c=c.then(l[u++],l[u++]);return c}getUri(t){t=Be(this.defaults,t);let n=kt(t.baseURL,t.url);return Ft(n,t.params,t.paramsSerializer)}};d.forEach(["delete","get","head","options"],function(t){hn.prototype[t]=function(n,i){return this.request(Be(i||{},{method:t,url:n,data:(i||{}).data}))}});d.forEach(["post","put","patch"],function(t){function n(i){return function(o,r,s){return this.request(Be(s||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}hn.prototype[t]=n(),hn.prototype[t+"Form"]=n(!0)});var ti=hn;var Fr=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});let i=this;this.promise.then(a=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](a);i._listeners=null}),this.promise.then=a=>{let o,r=new Promise(s=>{i.subscribe(s),o=s}).then(a);return r.cancel=function(){i.unsubscribe(o)},r},t(function(o,r,s){i.reason||(i.reason=new Pe(o,r,s),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new e(function(a){t=a}),cancel:t}}},Rd=Fr;function kr(e){return function(n){return e.apply(null,n)}}function jr(e){return d.isObject(e)&&e.isAxiosError===!0}var Lr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Lr).forEach(([e,t])=>{Lr[t]=e});var Od=Lr;function Cd(e){let t=new ti(e),n=Gn(ti.prototype.request,t);return d.extend(n,ti.prototype,t,{allOwnKeys:!0}),d.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return Cd(Be(e,a))},n}var te=Cd(sn);te.Axios=ti;te.CanceledError=Pe;te.CancelToken=Rd;te.isCancel=Vn;te.VERSION=qt;te.toFormData=vt;te.AxiosError=y;te.Cancel=te.CanceledError;te.all=function(t){return Promise.all(t)};te.spread=kr;te.isAxiosError=jr;te.mergeConfig=Be;te.AxiosHeaders=W;te.formToJSON=e=>Ji(d.isHTMLForm(e)?new FormData(e):e);te.getAdapter=oa.getAdapter;te.HttpStatusCode=Od;te.default=te;var xn=te;var{Axios:HO,AxiosError:WO,CanceledError:VO,isCancel:JO,CancelToken:YO,VERSION:KO,all:QO,Cancel:ZO,isAxiosError:eC,spread:tC,toFormData:nC,AxiosHeaders:iC,HttpStatusCode:aC,formToJSON:oC,getAdapter:rC,mergeConfig:sC}=xn;var Ld=R(En());Xt();var Td=R(require("node:crypto")),Bt=R(require("node:fs")),vn=R(require("node:path")),Nr=R(Rt());var ca=V();function Id(){let{__cx:e}=ca.paths(),t=vn.default.join(e,"apiCache");Bt.default.existsSync(t)||Bt.default.mkdirSync(t),console.info("Cache initialized")}function Pd(e){let{__cx:t}=ca.paths(),n=vn.default.join(t,"apiCache"),i=Td.default.createHash("sha256");return i.update(JSON.stringify(e)),`${n}/${i.digest("hex")}`}function Ad(e,t){let n=typeof t=="string"?t:JSON.stringify(t),i=Pd(e),a=vn.default.dirname(i);Bt.default.existsSync(a)||Bt.default.mkdirSync(a,{recursive:!0}),Bt.default.writeFileSync(i,n,"utf8")}function Fd(e){try{let t=Pd(e);return Nr.default.readJSONSync(t,{encoding:"utf-8"})}catch{return null}}function c_(){let{__cx:e}=ca.paths(),n=`${vn.default.join(e,"apiCache")}/siteHash.json`;try{return Nr.default.readJSONSync(n,{encoding:"utf-8"})||{}}catch{return{}}}function kd(e,t){let n=c_(),i=n[e],a=t||i||new Date().valueOf(),{__cx:o}=ca.paths(),s=`${vn.default.join(o,"apiCache")}/siteHash.json`;return a!==i&&(n[e]=a,Bt.default.writeFileSync(s,JSON.stringify(n),{encoding:"utf-8"})),a.toString()}var gn=class{entries;constructor(t){this.entries=t}insert(t,n){this.entries[t].entries.push(n)}get(t){return this.entries[t]}getAll(){return this.entries}};var bn=class{strategy;constructor(t){this.strategy=t}insert(t,n){this.strategy.insert(t,n)}get(t){return this.strategy.get(t)}getAll(){return this.strategy.getAll()}};var p_={API_RESPONSE_TOO_BIG:{title:"API response size is too large",description:"API response size is too large and may affect rendering performance",entries:[]}},l_=new bn(new gn(p_)),ni=l_;var u_={GATSBY_PAGE_SIZE_TOO_BIG:{title:"Gatsby JSON page size is too large",description:"The JSON of some Gatsby pages (page-data folder) are too large and may affect rendering performance",entries:[]}},hC=new bn(new gn(u_));Ld.default.config();var{env:{RETRY_WAIT_SECONDS:d_="4",RETRY_ATTEMPTS:jd="4"}}=process;async function Br(e,t,n=""){let{endpoint:i,body:a,cacheKey:o="",attempt:r=1,headers:s}=e,p={endpoint:i,body:a,headers:s,cacheKey:o};if(o){let l=new Date,c=Fd(p);if(c){let u=Ur(c),f=u?`site: ${u}`:"",h=qr(new Date().getTime()-l.getTime());return Ot(`${t} (cache) ${f} ${i} - ${h}s ${n}`),c}}try{let l=new Date,{data:c,headers:u}=await xn({url:i,method:t,headers:Object.assign({},s,ot.headers),data:a}),f=Ur(c),h=f?`site: ${f}`:"",m=qr(new Date().getTime()-l.getTime());if(Ot(`${t} (fetch) ${h} ${i} - ${m}s ${n}`),Ad(p,c),O.GRIDDO_ALERT_FEATURE){let x=Number.parseInt(u["content-length"]);x>O.GRIDDO_API_MAX_RESPONSE_SIZE&&ni.insert("API_RESPONSE_TOO_BIG",{endpoint:i,responseSize:x,duration:m})}return c}catch(l){let c=l;return c.response?.status===404?null:(r>parseInt(jd)&&(console.log(`
@@ -66,13 +66,13 @@ ${f}
66
66
  =============
67
67
  `))}async function Nd(){return await Oe({endpoint:ee.GET_ALL})}async function qd(e,t){return await Oe({endpoint:`${ee.GET_PAGE}/${e}`,cacheKey:t})}async function Ud(e,t=""){let[n,i]=ee.INFO;return await Oe({endpoint:`${n}${e}${i}`,cacheKey:t})}async function $r(e,t=""){let[n,i]=ee.LANGUAGES;return await Oe({endpoint:`${n}${e}${i}`,cacheKey:t})}async function Gr(e){let[t,n]=ee.BUILD_START;return await Oe({endpoint:`${t}${e}${n}`})}async function Bd(e,t){let[n,i]=ee.BUILD_END;return await pa({endpoint:`${n}${e}${i}`,body:t})}async function Md(e,t,n,i,a){let[o,r]=ee.GET_REFERENCE_FIELD_DATA,s=i||e.site,p=a||e.language;return await pa({endpoint:`${o}${s}${r}`,body:t,headers:{lang:p},cacheKey:n})}async function $d(e){let[t,n]=ee.GET_SITEMAP;return await Oe({endpoint:`${t}${e}${n}`})}async function Gd(e,t=""){let[n,i]=ee.SOCIALS;return await Oe({endpoint:`${n}${e}${i}`,cacheKey:t})}var la=V();async function Xd(e){console.info(`API URL ${O.GRIDDO_API_URL}`),await ot.login();let t=await Nd(),n=O.GRIDDO_RENDER_ALL_SITES?t.filter(r=>!O.GRIDDO_RENDER_SITE||r.id===O.GRIDDO_RENDER_SITE):t.filter(r=>O.GRIDDO_RENDER_SITE?r.id===O.GRIDDO_RENDER_SITE:!!r.shouldBeUpdated);if(n.length)for(let r of n){let{items:s}=await $r(r.id);r.domains=s.filter(p=>p.domain&&(p.domain.slug===e||p.domain.slug===`/${e}`)).map(p=>({[p.id]:`${p.domain.slug}${p.path}`}))}let i=n.filter(r=>r.domains.length>0),a=i.filter(r=>O.GRIDDO_RENDER_SITE?r.id===O.GRIDDO_RENDER_SITE:!!r.isPublished),o=i.filter(r=>!r.isPublished&&r.shouldBeUpdated);return{sitesToPublish:a,sitesToUnpublish:o}}async function Hd(e){let{__cx:t}=la.paths();for(let n of e){let i=await Gr(n.id),{siteHash:a}=i,o={siteHash:a,publishHashes:[],unpublishHashes:[]};await Bd(n.id,o),yn.default.rmSync(wt.default.join(t,"store",n.id.toString()),{force:!0,recursive:!0})}}async function Wd(e){let t=await Gr(e),n=await Ud(e),i=await $r(e),a=await Gd(e),o=i.items,r=o.find(m=>m.isDefault),{siteHash:s,unpublishHashes:p,publishIds:l}=t,{headers:c,footers:u}=n,f=O.GRIDDO_RENDER_PAGES.length?O.GRIDDO_RENDER_PAGES.filter(m=>l.includes(m)):l;return{siteInfo:n,validPagesIds:f,siteHash:s,unpublishHashes:p,siteLangs:o,defaultLang:r,headers:c,footers:u,socials:a}}async function Vd(){let{__cx:e}=la.paths(),{buildReportFileName:t}=la,{buildProcessData:n}=await Po(),i=await ot.login(),a=Object.keys(n).map(s=>({...n[s],siteId:Number.parseInt(s)})),o={authControl:i,sites:a},r=wt.default.join(e,"dist",t);yn.default.writeFileSync(r,JSON.stringify(o)),U(`build report saved in ${r}`),Ot(`Build report saved for ${a.length} site(s)`)}async function Jd(){let{sitesToPublish:e}=await Po(),{__cx:t}=la.paths(),n=wt.default.join(t,"dist");for(let i of e){let{id:a,languages:o}=i;for(let r of o){ot.headers&&(ot.headers.lang=r.id.toString());let s=await $d(a);if(!s)continue;let{items:p,url:{home:l,domain:c}}=s;if(!l)continue;let u=i.domains.find(E=>Object.keys(E)[0]===r.id.toString());if(!u)continue;let f=Object.values(u)[0],h=[],m=Object.keys(p),x=wt.default.join(n,f.replace(c,""));for(let E of m){let _=p[E];if(!_.length)continue;let T=(0,zr.parse)("urlset",{"@":{xmlns:"http://www.sitemaps.org/schemas/sitemap/0.9","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation":"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"},url:_}),P=`/sitemap-${E.toLowerCase()}.xml`,z=wt.default.join(x,P);zd(z,T),h.push(`${l.endsWith("/")?l.slice(0,-1):l}${P}`)}if(!h.length)continue;let v=(0,zr.parse)("sitemapindex",{"@":{xmlns:"http://www.sitemaps.org/schemas/sitemap/0.9"},sitemap:h.map(E=>({loc:E}))}),b=wt.default.join(x,"sitemap.xml");zd(b,v),U(`sitemap generated in ${b}`)}}}function zd(e,t){try{let n=wt.default.dirname(e);yn.default.existsSync(n)||yn.default.mkdirSync(n,{recursive:!0}),yn.default.writeFileSync(e,t)}catch(n){throw console.log(n),new Error("Error saving a file")}}at();var Xr=R(require("node:fs")),Hr=R(require("node:path"));var f_=V(),Wr=class{robots;settings;constructor(){this.robots=[],this.settings={}}async getRobots(){try{let t=await Oe({endpoint:ee.ROBOTS});this.robots=t?.filter(n=>!!n.path).map(({path:n,content:i})=>({path:n,content:i||`User-agent: *
68
68
  \r
69
- \rAllow: /`}))||[]}catch(t){console.warn(`${this.constructor.name}: ${t.message}`)}}async writeFiles(t){let{__cx:n}=f_.paths(t),i=Hr.default.join(n,"dist");await this.getRobots();let a=this.robots.find(({path:o})=>o===`/${t}`);if(!a){console.log(`Robots not found for ${t}`);return}if(Xr.default.existsSync(i)){let o=Hr.default.join(i,"robots.txt");Xr.default.writeFileSync(o,a?.content),U(`wrote robots.txt to ${o}`)}else console.log(`${i} not found`)}},Yd=new Wr;var im=V(),aT=nm.default.sync();function V(){try{return(tm(),Xf(em)).default}catch(e){throw console.log(e),new Error("Error while reading configuration file")}}function Me(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;if(e.toLowerCase()==="on")return!0;if(e.toLowerCase()==="off")return!1;let t=Number.parseInt(e,10);return Number.isNaN(t)?!1:t>0}function Fo(e){let t=[],n=Qe.default.readdirSync(e).filter(i=>{let a=Mt.default.join(e,i);return Qe.default.statSync(a).isDirectory()&&i!=="metadata"});for(let i of n){let a=Mt.default.join(e,i),o=Qe.default.readdirSync(a).filter(r=>r.endsWith(".json"));for(let r of o)t.push(Mt.default.join(a,r))}return t}function Mr(e){return new Promise(t=>setTimeout(t,e))}function qr(e,t=3){return(e/1e3).toFixed(t)}function Ur(e){if(typeof e!="string")return"site"in e&&e.site?e?.site:void 0}function ko(e,t){for(let n in e)t.includes(n)?delete e[n]:typeof e[n]=="object"&&ko(e[n],t)}function am(){let{__cx:e}=im.paths(),t=Mt.default.join(e,"apiCache"),n=Qe.default.readdirSync(t),i={},a=n.filter(r=>{let s=`${t}/${r}`,p=ma.default.readJSONSync(s,"utf-8"),{id:l,entity:c,fullUrl:u}=p;return!!(l&&c&&u)});for(let r of a){let s=`${t}/${r}`,p=ma.default.readJSONSync(s,"utf-8"),l=Qe.default.statSync(s).mtimeMs,{id:c}=p;(!i[c]||l>Qe.default.statSync(`${t}/${i[c]}`).mtimeMs)&&(i[c]=r)}let o=0;for(let r of a){let s=`${t}/${r}`,p=ma.default.readJSONSync(s,"utf-8"),{id:l}=p;r!==i[l]&&(Qe.default.unlinkSync(s),o++)}console.log(`Sanitize apiCache dir for ${o} files`)}async function Kr(e,t=0){let n=process.hrtime();for(let r of e)await r(),t>0&&await Mr(t);let[i,a]=process.hrtime(n);return+(i+a/1e9).toFixed(3)}function E_(e){if(O.GRIDDO_RENDER_BREAKPOINTS_FEATURE)return new Promise(n=>{console.log(`
69
+ \rAllow: /`}))||[]}catch(t){console.warn(`${this.constructor.name}: ${t.message}`)}}async writeFiles(t){let{__cx:n}=f_.paths(t),i=Hr.default.join(n,"dist");await this.getRobots();let a=this.robots.find(({path:o})=>o===`/${t}`);if(!a){console.log(`Robots not found for ${t}`);return}if(Xr.default.existsSync(i)){let o=Hr.default.join(i,"robots.txt");Xr.default.writeFileSync(o,a?.content),U(`wrote robots.txt to ${o}`)}else console.log(`${i} not found`)}},Yd=new Wr;var im=V(),aT=nm.default.sync();function V(){try{return(tm(),Xf(em)).default}catch(e){throw console.log(e),new Error("Error while reading configuration file")}}function Me(e){if(typeof e=="boolean")return e;if(e==null)return!1;if(e.toLowerCase()==="true")return!0;if(e.toLowerCase()==="false")return!1;if(e.toLowerCase()==="on")return!0;if(e.toLowerCase()==="off")return!1;let t=Number.parseInt(e,10);return Number.isNaN(t)?!1:t>0}function Fo(e){let t=[],n=Ze.default.readdirSync(e).filter(i=>{let a=Mt.default.join(e,i);return Ze.default.statSync(a).isDirectory()&&i!=="metadata"});for(let i of n){let a=Mt.default.join(e,i),o=Ze.default.readdirSync(a).filter(r=>r.endsWith(".json"));for(let r of o)t.push(Mt.default.join(a,r))}return t}function Mr(e){return new Promise(t=>setTimeout(t,e))}function qr(e,t=3){return(e/1e3).toFixed(t)}function Ur(e){if(typeof e!="string")return"site"in e&&e.site?e?.site:void 0}function ko(e,t){for(let n in e)t.includes(n)?delete e[n]:typeof e[n]=="object"&&ko(e[n],t)}function am(){let{__cx:e}=im.paths(),t=Mt.default.join(e,"apiCache"),n=Ze.default.readdirSync(t),i={},a=n.filter(r=>{let s=`${t}/${r}`,p=ma.default.readJSONSync(s,"utf-8"),{id:l,entity:c,fullUrl:u}=p;return!!(l&&c&&u)});for(let r of a){let s=`${t}/${r}`,p=ma.default.readJSONSync(s,"utf-8"),l=Ze.default.statSync(s).mtimeMs,{id:c}=p;(!i[c]||l>Ze.default.statSync(`${t}/${i[c]}`).mtimeMs)&&(i[c]=r)}let o=0;for(let r of a){let s=`${t}/${r}`,p=ma.default.readJSONSync(s,"utf-8"),{id:l}=p;r!==i[l]&&(Ze.default.unlinkSync(s),o++)}console.log(`Sanitize apiCache dir for ${o} files`)}async function Kr(e,t=0){let n=process.hrtime();for(let r of e)await r(),t>0&&await Mr(t);let[i,a]=process.hrtime(n);return+(i+a/1e9).toFixed(3)}function E_(e){if(O.GRIDDO_RENDER_BREAKPOINTS_FEATURE)return new Promise(n=>{console.log(`
70
70
  `),Qt(`\u231B\uFE0F ${e}`,"",1,0),process.stdin.once("data",()=>{n()})})}async function $e(e,t){let{steps:n,bypass:i,delay:a}=t;if(i)return;let o={Archive:O.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS,Data:O.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS,Meta:O.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS,Relocation:O.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS,Clean:O.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS,Restore:O.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS,Prepare:O.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS,Close:O.GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS,SSG:O.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS,HealthCheck:1,__DEBUG__:1},r=0,s=o[e]||1;for(;r<s;)try{Zt(`start ${e} life-cycle`);let p=await Kr(n,a);Lp(`${e} - ${p}s
71
71
  `),await E_(`${e} LifeCycle`);break}catch(p){let l=gp(vp(` Error in ${e} LifeCycle `)),c=Y.yellow(`Attempt (${r+1})`);console.log(`
72
72
  ${l} ${c}
73
- `),console.log(p),console.log(),r++}r===s&&K(ll(s,e))}async function om(e){await Vd(),await Jd(),await Yd.writeFiles(e)}function rm(){let{__cx:e}=im.paths(),t=Mt.default.join(e,"store"),a=Qe.default.readdirSync(t).filter(o=>o!=="metadata").map(o=>Mt.default.join(t,o));for(let o of a)Qe.default.rmSync(o,{recursive:!0,force:!0})}sm.default.config();var Fe=process.env.GRIDDO_API_URL||process.env.API_URL,fa=process.env.GRIDDO_PUBLIC_API_URL||process.env.PUBLIC_API_URL,cm=process.env.botEmail,pm=process.env.botPassword,lm=Number.parseInt(process.env.GRIDDO_API_CONCURRENCY_COUNT||"10"),um=Me(process.env.GRIDDO_RENDER_ALL_SITES||process.env.updateAllSites),dm=Number.parseInt(process.env.GRIDDO_RENDER_SITE||""),mm=(process.env.GRIDDO_RENDER_PAGES||"").split(",").map(e=>Number.parseInt(e)).filter(Boolean),fm=Me(process.env.GRIDDO_SKIP_BUILD_CHECKS),hm=Me(process.env.GRIDDO_DEBUG_LOGS),xm=Me(process.env.GRIDDO_BUILD_LOGS),vm=Me(process.env.GRIDDO_RENDER_BREAKPOINTS_FEATURE),gm=Me(process.env.GRIDDO_SSG_VERBOSE_LOGS),bm=Me(process.env.GRIDGRIDDO_SEARCH_FEATURE_FEATURE),ym=process.env.GRIDDO_ASSET_PREFIX||process.env.ASSET_PREFIX,wm=process.env.GRIDDO_REACT_APP_INSTANCE||process.env.REACT_APP_INSTANCE,_m=Me(process.env.GRIDDO_AI_EMBEDDINGS),Sm=Me(process.env.GRIDDO_VERBOSE_LOGS),Em=Me(process.env.GRIDDO_ALERT_FEATURE),Dm=Number.parseInt(process.env.GRIDDO_API_MAX_RESPONSE_SIZE||"81920"),Rm=Number.parseInt(process.env.GRIDDO_SSG_MAX_PAGE_SIZE||"524288"),Om=Number.parseInt(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS||"1"),Cm=Number.parseInt(process.env.GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS||"1"),Tm=Number.parseInt(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS||"1"),Im=Number.parseInt(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS||"1"),Pm=Number.parseInt(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS||"1"),Am=Number.parseInt(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS||"2"),Fm=Number.parseInt(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS||"1"),km=Number.parseInt(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS||"4"),jm=Number.parseInt(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS||"1"),Lm=process.env.GRIDDO_CX_FIXTURES_DOMAIN_NAMES,Nm=process.env.GRIDDO_CX_FIXTURES_SITE_NAMES;var _t=`${Fe}/site/`,qm=`${Fe}/ai/embeddings`,Um=`${fa}/alert`,Bm=`${Fe}/domains`,Mm=`${Fe}/sites/all`,$m=`${Fe}/page`,Gm=`${Fe}/login_check`,zm=`${Fe}/debug/reset-render`,Xm=`${Fe}/domains/robots`,Hm=`${Fe}/search`,Wm=`${Fe}/settings`,Vm=[_t,"/build/end"],Jm=[_t,"/build/start"],Ym=[_t,"/pages?pagination=false"],Km=[_t,"/distributor"],Qm=[_t,"/sitemap"],Zm=[_t,"/all"],ef=[_t,"/languages"],tf=[_t,"/socials"];var ee={ALERT:Um,AI_EMBEDDINGS:qm,BUILD_END:Vm,BUILD_START:Jm,DOMAINS:Bm,GET_ALL:Mm,GET_PAGE:$m,GET_PAGES:Ym,GET_REFERENCE_FIELD_DATA:Km,GET_SITEMAP:Qm,INFO:Zm,LANGUAGES:ef,LOGIN:Gm,RESET_RENDER:zm,ROBOTS:Xm,SEARCH:Hm,SETTINGS:Wm,SOCIALS:tf},O={GRIDDO_AI_EMBEDDINGS:_m,GRIDDO_ALERT_FEATURE:Em,GRIDDO_API_CONCURRENCY_COUNT:lm,GRIDDO_API_MAX_RESPONSE_SIZE:Dm,GRIDDO_API_URL:Fe,GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS:jm,GRIDDO_ASSET_PREFIX:ym,GRIDDO_BOT_PASSWORD:pm,GRIDDO_BOT_USER:cm,GRIDDO_BUILD_LOGS:xm,GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS:Om,GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS:Cm,GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS:Pm,GRIDDO_DEBUG_LOGS:hm,GRIDDO_FIXTURES_DOMAIN_NAMES:Lm,GRIDDO_FIXTURES_SITE_NAMES:Nm,GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS:km,GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS:Tm,GRIDDO_PUBLIC_API_URL:fa,GRIDDO_REACT_APP_INSTANCE:wm,GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS:Fm,GRIDDO_RENDER_ALL_SITES:um,GRIDDO_RENDER_BREAKPOINTS_FEATURE:vm,GRIDDO_RENDER_PAGES:mm,GRIDDO_RENDER_SITE:dm,GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS:Im,GRIDDO_SEARCH_FEATURE:bm,GRIDDO_SKIP_BUILD_CHECKS:fm,GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS:Am,GRIDDO_SSG_MAX_PAGE_SIZE:Rm,GRIDDO_SSG_VERBOSE_LOGS:gm,GRIDDO_VERBOSE_LOGS:Sm};Ve();at();af.default.config();var of=V();function rf(e){let{proDomain:t}=V();if(!O.GRIDDO_ASSET_PREFIX||!e||!e.startsWith(t))return"";let n=`${O.GRIDDO_ASSET_PREFIX}/${e}`;return U(`Reading process.env.GRIDDO_ASSET_PREFIX, ${O.GRIDDO_ASSET_PREFIX}`),U(`Setting the asset prefix with the domain concatenated, ${n}`),n}function sf(e){U(`read assetPrefixWithDomain, ${e}`),U(`using this NODE_OPTIONS in gatsby command: ${process.env.NODE_OPTIONS}`);let{__ssg:t}=of.paths(),n=process.env.NODE_OPTIONS?process.env.NODE_OPTIONS.replace(/--openssl-legacy-provider\s*/g,"").trim():"",i=(0,nf.spawnSync)("yarn",["gatsby-build",O.GRIDDO_SSG_VERBOSE_LOGS?"--verbose":""],{cwd:t,stdio:["ignore","inherit","ignore"],encoding:"utf8",shell:!0,env:Object.assign(process.env,{GRIDDO_EXPORTER:"true",SPAWN_ASSET_PREFIX_WITH_DOMAIN:e,NODE_OPTIONS:n})});i.status!==0&&K(pl(i))}async function cf(e,t){let{__cx:n,__ssg:i}=of.paths(e),a=ct.default.join(n,"dist"),o=ct.default.join(n,"assets"),r=ct.default.join(n,"dist",e),s=ct.default.join(i,"public"),p=Ge.default.readdirSync(s).filter(x=>ct.default.extname(x)===".js"||ct.default.extname(x)===".json"||ct.default.extname(x)===".css"),l=`${s}/page-data`,c=`${o}/page-data`,u=ct.default.join(i,"static"),f=o,h=`${a}/static`,m=`${o}/static`;try{Ge.default.mkdirSync(o,{recursive:!0}),Ge.default.copySync(s,a,{preserveTimestamps:!0}),t&&(Ge.default.copySync(l,c,{preserveTimestamps:!0}),Ge.default.existsSync(u)&&Ge.default.copySync(u,f,{overwrite:!1,preserveTimestamps:!0}),Ge.default.copySync(h,m,{overwrite:!1,preserveTimestamps:!0}),Ge.default.existsSync(u)&&Ge.default.copySync(u,r,{overwrite:!1,preserveTimestamps:!0}),p.map(async x=>{let v=`${s}/${x}`,b=`${o}/${x}`;Ge.default.copySync(v,b,{preserveTimestamps:!0})}))}catch(x){console.error(x)}}var $t=R(require("node:path"));function D_(e){let{__cx:t,__exports:n,__cache:i}=e;return{initials:[n,i,$t.default.join(t,"store"),$t.default.join(t,"apiCache")],disposables:[$t.default.join(t,"store"),$t.default.join(t,"apiCache"),$t.default.join(t,"render-metadata.json"),$t.default.join(t,"dist")],cacheables:["apiCache","store"],archivables:["dist","assets"]}}var ha=D_;var xa=R(require("node:path"));function R_(e){let{__ssg:t}=e;return{disposables:[xa.default.join(t,"public"),xa.default.join(t,"static"),xa.default.join(t,".cache")],cacheables:[".cache"],initials:[],archivables:[]}}var pf=R_;function lf(e,t){let{cxPaths:n}=t,i={gatsby:pf(n)};return{cx:ha(n),[e]:i[e],all:{initials:[...ha(n).initials,...i[e].initials],disposables:[...ha(n).disposables,...i[e].disposables]}}}async function uf({area:e,description:t,fullData:n,instantNotification:i=!1,level:a}){let o=ee.ALERT,r={level:a,area:e,description:t,fullData:n,instantNotification:i};try{await xn.post(o,r,{headers:{"Content-Type":"application/json",Connection:"close"}})}catch(s){console.error("Error creating Griddo alert:",s)}}var Sf=R(require("node:fs")),ts=R(require("node:path")),Ef=R(Ga());var va=class{_defaultHeaders;_defaultFooters;_navigations;constructor(){this._navigations={footers:[],headers:[]},this._defaultHeaders={},this._defaultFooters={}}set navigations(t){this._navigations=t,this._defaultFooters=this.getDefaultFooters(),this._defaultHeaders=this.getDefaultHeaders()}get navigations(){return this._navigations}getDefaultFooters(){let n=[...this.navigations.footers].filter(a=>a.setAsDefault),i={};for(let a of n)i[a.language]=a;return i}getDefaultHeaders(){let n=[...this.navigations.headers].filter(a=>a.setAsDefault),i={};for(let a of n)i[a.language]=a;return i}getRightLanguage(t,n,i){if(!t||!n)return null;let o=t.find(r=>r.language===i&&r.navigationLanguages?.find(s=>s.navigationId===n))||t.find(r=>r.id===n);return o?{...o}:null}getPageHeader(t,n){return this.getRightLanguage(this.navigations.headers,t,n)}getPageFooter(t,n){return this.getRightLanguage(this.navigations.footers,t,n)}getPageNavigations(t){let{header:n,footer:i,language:a,template:{templateType:o},templateConfig:{defaultHeader:r,defaultFooter:s,templates:p}}=t,l=m=>{let x=m.find(v=>typeof v=="number");return typeof x=="number"?x:null},c=l([n,p?.[o]?.defaultHeader,r]),u=l([i,p?.[o]?.defaultFooter,s]),f=c?this.getPageHeader(c,a):c===0?null:this._defaultHeaders[a],h=u?this.getPageFooter(u,a):u===0?null:this._defaultFooters[a];return{header:f,footer:h}}};function O_(e,t){let{order:n,sources:i,quantity:a,mode:o,fixed:r,fullRelations:s=!1,allLanguages:p=!1,preferenceLanguage:l=!1,referenceId:c,fields:u}=e;return o==="auto"?{mode:o,order:n,sources:i,quantity:a,fullRelations:s,allLanguages:p,preferenceLanguage:l,fields:u}:o==="manual"?{mode:o,fixed:r,fullRelations:s,fields:u}:o==="navigation"?{mode:o,order:n,quantity:a,fullRelations:s,referenceId:c||t?.structuredDataContent?.id,fields:u}:(console.log(`Error: ReferenceField mode: ${o} is not recognized on page ${t?.id}.`),e)}async function C_(e){let{page:t,component:{data:n},cacheKey:i}=e;if(!n)return Qt(`Error: Page ${t.id} has \`hasDistributorData: true\` or \`getStaticData: true\` but it doesn't have a \`data\` property.`,"No `data` in `ReferenceField`"),[];if(Array.isArray(n.sources)&&n.sources.length<1)return Qt(`Warning: Page with id: ${t.id} has a ReferenceField with empty \`data.sources\``,"Empty data.sources in ReferenceField"),[];let{site:a,lang:o}=n;!n.sources&&n.mode==="auto"&&Qt(`Warning: Page with id: ${t.id} has a ReferenceField with \`undefined\` \`data.sources\``,"undefined data.sources in ReferenceField");let r=O_(n,t);return await Md(t,r,i,a,o)}async function df({page:e,cacheKey:t=""}){try{let{template:n}=e,i=async(r,s=1)=>{if(!(!r||typeof r!="object"||!(JSON.stringify(r).includes('"hasDistributorData":true')||JSON.stringify(r).includes('"getStaticData":true'))))for(let l in r){if(l==="queriedItems")continue;let u=r[l];if(!u||typeof u!="object")continue;(u.hasDistributorData||u.getStaticData)&&(u.queriedItems=await C_({page:e,cacheKey:t,component:u})),await i(u,s+1)}};return await(async r=>(await i([r]),r))(n)}catch(n){console.error(`Error in getReferenceFieldData ${n}`),process.exit(1)}}async function mf(){return await Oe({endpoint:ee.SETTINGS})}var xf=R(En());function Qr(e,t,n,i="jpg"){let a=typeof e=="string"?e:e?.url;return a?a.split("/")[2].includes("cloudinary.com")?I_(a,`c_fill,w_${t},h_${n}`):T_(a,`f/${i}/w/${t}/h/${n}`):null}function T_(e,t){let n=e.split("/"),i=n.slice(0,-1).join("/"),a=n.slice(-1)[0];return`${i}/${t}/${a}`}function I_(e,t){let n=e.replace("https://",""),i=n.split("/").slice(0,4).join("/"),a=n.replace(i,"");return`https://${i}/${t}${a}`}xf.default.config();var P_=25;function A_({socialTitle:e,socialDescription:t,socialImage:n}){return{type:"website",title:e,description:t,image:n?Qr(n,1280,768):"",twitterImage:n?Qr(n,1280,768):""}}function F_(e){let{title:t,metaTitle:n,metaDescription:i,canonicalURL:a,locale:o,url:r,isIndexed:s,follow:p,metasAdvanced:l,pageLanguages:c,fullUrl:u,metaKeywords:f}=e,h=l?.split(",").filter(Boolean).map(m=>m.trim().toLowerCase())||[];return{title:(n||t||"").trim(),description:i,canonical:a?.trim()&&a!==u?a.trim():s?u:void 0,locale:o,url:r,index:s?"index":"noindex",follow:p?"follow":"nofollow",translate:h.includes("notranslate")?"notranslate":"",metasAdvanced:h.filter(m=>m!=="notranslate").join(),pageLanguages:c,metaKeywords:f?.filter(Boolean).map(m=>m.replace(/"/g,"'")).join(", ")}}async function es(e,t){let{id:n,title:i,fullPath:a,language:o,breadcrumb:r,socialDescription:s,socialImage:p,socialTitle:l}=e,{baseUrl:c,cloudinaryName:u,griddoVersion:f,siteLangs:h,siteMetadata:m,siteOptions:x,siteScript:v,siteSlug:b,socials:E,theme:_,navigations:{header:T,footer:P}}=t;e.breadcrumb=r,e.siteSlug=b,e.apiUrl=c,e.publicApiUrl=t.publicBaseUrl,e.instance=t.instance;let ne=h.find(({id:X})=>X===e?.language)?.locale.replace(/_/g,"-"),Q=F_(e),D=A_({socialDescription:s,socialImage:p,socialTitle:l}),A=a.compose,F=new Date().toString();return{path:A,size:void 0,context:{id:n,title:i,fullPath:a,locale:ne,languageId:o,theme:_,siteMetadata:m,pageMetadata:Q,openGraph:D,socials:E,siteLangs:h,cloudinaryName:u,siteOptions:x,griddoVersion:f,renderDate:F,siteScript:v,header:T,footer:P,page:e}}}async function vf(e,t){return await es(e,t)}async function gf({page:e,pages:t,isRoot:n=!1,defaultLang:i,template:a,totalQueriedItems:o},r){let s=t.map(async(p,l)=>{let c=l===0,u=l+1,{domainUrl:f,compose:h}=e.fullPath,m={...e,id:Number.parseInt(`-${e.id}${l}`),fullPath:{...e.fullPath,compose:Zr(h,u,{addEndingSlash:!0})},fullUrl:Zr(e.fullUrl,u,{addEndingSlash:!0}),slug:Zr(e.slug,u),title:hf(e.title,u),metaTitle:hf(e.metaTitle||"",u),disableHrefLangs:u>1,template:{...a,isFirstPage:c,pageNumber:u,totalPages:t.length,baseLink:`${f}${h}`,queriedItems:p,totalQueriedItems:o?.length},isRoot:n,defaultLang:i};return await es(m,r)});return Promise.all(s)}function bf(e,t){let{multiPageElements:n,...i}=e,a=JSON.parse(JSON.stringify(n));a.find(({sectionSlug:r})=>r==="/")||a.push({});let o=a.map(async(r,s)=>{let p=JSON.parse(JSON.stringify(i)),{sectionSlug:l="/",title:c="",metaTitle:u="",metaDescription:f=""}=r,h=typeof c=="string"?c:c.content,m=p.fullPath.compose||"",x=p.fullUrl.endsWith("/")?p.fullUrl.slice(0,-1):p.fullUrl,v=l?.replace(/\//g,""),E=l==="/"?v:`${v}/`,_=m.endsWith("/")?"":"/",T=`${m}${_}${E}`;return h.trim()&&(p.title=h),f.trim()&&(p.metaDescription=f),p.id=Number.parseInt(`-${p.id}${s}`),p.fullUrl=`${x}/${E}`,p.fullPath.compose=T,p.slug=T,p.template.activeSectionSlug=l,p.template.activeSectionBase=x,p.metaTitle=u.trim()||h.trim()||p.metaTitle,await es(p,t)});return Promise.all(o)}function yf(e){return new Promise(n=>{let i=(a,o=0)=>{if(!(!a||typeof a!="object")){for(let r in a){let s=a[r],p=s||typeof s=="object",l=JSON.stringify(s).includes('"hasGriddoMultiPage":true');if(!p||!l)continue;let{component:c,hasGriddoMultiPage:u,elements:f}=s;c&&u&&n(f||[]),i(s,o+1)}o||n(null)}};i([e])})}function k_(e,t,n){return t?.slice(e*(n-1),e*n)}function j_(e,t){let n=Math.ceil(t.length/e)||1;return Array.from({length:n},(a,o)=>o+1)?.map(a=>k_(e,t,a))}function wf(e){let t=e.queriedItems||[],n=e?.itemsPerPage||P_;return j_(n,t)}function ff(e){return e.replace(/\/+$/,"/")}function Zr(e,t,n){let i=e.endsWith("/")?"":"/",a=n?.addEndingSlash?"/":"";return t<=1?ff(`${e}${a}`):ff(`${e}${i}${t}${a}`)}function hf(e,t){return!e||t<=1?e:`${e} - ${t}`}var _f=V(),L_=new Date().valueOf().toString();async function Df(e){xl(),console.info(`API calls with ${O.GRIDDO_API_CONCURRENCY_COUNT} threads`);let{__cx:t}=_f.paths(),{griddoVersion:n}=_f,i=ts.default.join(t,"store");try{let a=[],o={},{sitesToPublish:r,sitesToUnpublish:s}=await Xd(e),p=r.length>0||s.length>0;p||console.warn(`There are no sites to update in the domain ${e}`),Ja("Sites to publish:",r),Ja("Sites to unpublish:",s),await Hd(s);for(let l of r){let{id:c,slug:u,theme:f,favicon:h,changedPages:m=[]}=l,{siteInfo:x,validPagesIds:v,siteHash:b,unpublishHashes:E,siteLangs:_,defaultLang:T,headers:P,footers:z,socials:ne}=await Wd(c),{cloudinaryName:Q,useMetaTitle:D,useMetaKeywords:A,showBasicMetaRobots:F,avoidHrefLangsOnCanonicals:M,avoidSelfReferenceCanonicals:X,avoidHrefLangXDefault:k,avoidDebugMetas:L}=await mf();o[c]={siteHash:b,unpublishHashes:E,publishHashes:[]};let N=new va;N.navigations={headers:P,footers:z},l.languages=_;let w=kd(c,b),S=x.siteScript,C={siteUrl:x.slug,title:x.name,favicon:h},ze={baseUrl:O.GRIDDO_API_URL,publicBaseUrl:O.GRIDDO_PUBLIC_API_URL,instance:O.GRIDDO_REACT_APP_INSTANCE,siteSlug:u,theme:f,siteMetadata:C,socials:ne,siteLangs:_,cloudinaryName:Q,griddoVersion:n,siteOptions:{useMetaTitle:D,useMetaKeywords:A,showBasicMetaRobots:F,avoidHrefLangsOnCanonicals:M,avoidSelfReferenceCanonicals:X,avoidHrefLangXDefault:k,avoidDebugMetas:L},siteScript:S};Ot(`${l.name} site`),Sf.default.mkdirSync(ts.default.join(i,c.toString()),{recursive:!0});let ie=async(St,re)=>{let ai=[],et=await qd(re,w);if(!et)return;a.push(re);let oi=JSON.parse(JSON.stringify(ze));oi.navigations=N.getPageNavigations(et);let zt=await df({page:et,cacheKey:L_}),ss=await yf(zt),wa=et?.mode==="list",cs=!wa&&ss,Uf=!cs&&!wa;if(wa){let He={page:et,pages:wf(zt),isRoot:!1,defaultLang:T,template:zt,totalQueriedItems:zt.queriedItems};ai=await gf(He,oi)}if(cs){let He=et;He.template=zt,He.multiPageElements=ss,He.defaultLang=T,ai=await bf(He,oi)}if(Uf){let He=et;He.template=zt,He.defaultLang=T,ai=[await vf(He,oi)]}et.hash!==null&&o[c].publishHashes.push(et.hash),vl(St,ai)},{pagesMissingInStore:Xe,pagesToDeleteFromStore:Gt,pagesToWriteToStore:Te}=await bl({sitesToPublish:r,validPagesIds:v,changedPages:m,siteDirName:c.toString()});gl(c.toString(),Gt);let we=(0,Ef.default)(O.GRIDDO_API_CONCURRENCY_COUNT),ii=Te.map(St=>we(()=>ie(c.toString(),St)));U(`Store site: ${l.name}`),U(`${v.length} valid pages from API`),U(`changed ${m.length} pages from API`),U(`deleted ${Gt.length} pages from store`),U(`missing ${Xe.length} pages in store`),U(`write ${Te.length} pages to store`),await Promise.all(ii)}p?Ao({buildProcessData:o,createdPages:a,sitesToPublish:r}):(rm(),Ao({buildProcessData:o,createdPages:[],sitesToPublish:[]}))}catch(a){console.error(a.message),process.exit(1)}}async function Rf(e){Id(),await Df(e),am()}Ve();at();async function Of(){return await Oe({endpoint:ee.DOMAINS})}async function Cf(){await ot.login();let e=await Of();return e.length||K(dl),U(`getting domains names (${e.length})`),N_(e)}function N_(e){let t=e.filter(({slug:n})=>!!n).map(({slug:n})=>n.replace("/",""));return[...new Set(t)]}var Ce=R(require("node:fs")),Ze=R(require("node:path")),ye=R(Rt());Ve();at();var q_=V(),ns=e=>{if(!ye.default.statSync(e).isDirectory())return;let n=ye.default.readdirSync(e);if(n.length>0){let a=n.length,o=n.filter(r=>Ze.default.extname(r).toLowerCase()===".xml").length;if(a===o){for(let r of n){let s=Ze.default.join(e,r);ye.default.rmSync(s)}n=ye.default.readdirSync(e)}for(let r of n){let s=Ze.default.join(e,r);ns(s)}n=ye.default.readdirSync(e)}if(n.length===0){ye.default.rmdirSync(e);return}};function Tf(e,t){for(let n of e)try{Ce.default.existsSync(n)||(Ce.default.mkdirSync(n,{recursive:!0,...t}),U(`create directory: ${n}`))}catch(i){K(Pt,i)}}function If(e,t){try{Ce.default.existsSync(e)&&(Ce.default.renameSync(e,t),U(`rename ${e} to ${t}`))}catch(n){K(Pt,n)}}function is(e,t,n,i={withBackup:!1}){let{withBackup:a}=i;for(let o of n){let r=Ze.default.join(e,o),s=Ze.default.join(t,o);if(!ye.default.existsSync(r)){console.log(`(Maybe first render) Source directory does not exist: ${r}`);continue}a&&(Ff(s),U(`create backup: ${s}`));try{ye.default.existsSync(s)&&(Ce.default.rmSync(s,{recursive:!0,force:!0}),U(`clean destination: ${s}`)),Ce.default.cpSync(r,s,{recursive:!0,preserveTimestamps:!0}),U(`copy: ${r} to ${s}`),a&&(Af(s),U(`delete backup: ${s}`))}catch(p){a&&(Pf(s),console.log("Backup has been restored.")),K(Pt,p)}}}function _n(e,t,n,i){let{override:a,withBackup:o}=i||{};for(let r of n){let s=Ze.default.join(e,r),p=Ze.default.join(t,r);if(ye.default.existsSync(s)){o&&Ff(p);try{a&&ye.default.existsSync(p)&&Ce.default.rmSync(p,{recursive:!0,force:!0}),Ce.default.renameSync(s,p),U(`moved: ${s} to ${p}`),o&&Af(p)}catch(l){o&&(Pf(p),console.log("Backup has been restored.")),K(Pt,l)}}}}function as(e){for(let t of e)if(t)try{ye.default.existsSync(t)&&(Ce.default.rmSync(t,{recursive:!0,force:!0}),U(`removed directory: ${t}`))}catch(n){K(Pt,n)}}function Pf(e,t="-BACKUP"){let n=e+t;try{Ce.default.renameSync(n,e),console.log(`Backup ${n} has been restored`)}catch(i){throw console.log(i),new Error(`Error while delete ${n} backup`)}}function Af(e,t="-BACKUP"){let n=e+t;if(ye.default.existsSync(n))try{Ce.default.rmSync(n,{recursive:!0,force:!0}),console.log(`Backup ${n} has been deleted`)}catch(i){throw console.log(i),new Error(`Error while delete ${n} backup`)}}function Ff(e,t="-BACKUP"){let n=e+t;if(ye.default.existsSync(e)){if(ye.default.existsSync(n)){console.log(`Destination ${n} already exists`);return}try{Ce.default.renameSync(e,n),console.log(`Backup of ${e} has been created in ${n}`)}catch(i){console.log(`Error while coping ${e} to ${n} backup`),K(Pt,i)}}}async function kf(){let{__cx:e}=q_.paths(),t=Ze.default.join(e,"store");try{let n=Fo(t);for(let i of n)Ze.default.basename(i).startsWith("-")&&Ce.default.unlinkSync(i)}catch{console.info("`store` folder does not exist. Skipping multipage or static list template cleaning.")}}var ga=R(require("node:fs")),ba=R(require("node:path"));Ve();at();var os=V();function jf(){let{__cx:e}=os.paths(),t=ba.default.join(e,".render-sentinel");ga.default.writeFileSync(t,new Date().toISOString())}function Lf(){let{__cx:e}=os.paths(),t=ba.default.join(e,".render-sentinel");ga.default.unlinkSync(t)}function Nf(){let{__cx:e}=os.paths(),t=ba.default.join(e,".render-sentinel");ga.default.existsSync(t)||K(fl)}var U_=V();async function B_(){Np();let e=await Cf();for(let t of e)await M_(t);if(O.GRIDDO_ALERT_FEATURE){let t=ni.get("API_RESPONSE_TOO_BIG");if(t.entries.length<1)return;_i(`
73
+ `),console.log(p),console.log(),r++}r===s&&K(ll(s,e))}async function om(e){await Vd(),await Jd(),await Yd.writeFiles(e)}function rm(){let{__cx:e}=im.paths(),t=Mt.default.join(e,"store"),a=Ze.default.readdirSync(t).filter(o=>o!=="metadata").map(o=>Mt.default.join(t,o));for(let o of a)Ze.default.rmSync(o,{recursive:!0,force:!0})}sm.default.config();var Fe=process.env.GRIDDO_API_URL||process.env.API_URL,fa=process.env.GRIDDO_PUBLIC_API_URL||process.env.PUBLIC_API_URL,cm=process.env.botEmail,pm=process.env.botPassword,lm=Number.parseInt(process.env.GRIDDO_API_CONCURRENCY_COUNT||"10"),um=Me(process.env.GRIDDO_RENDER_ALL_SITES||process.env.updateAllSites),dm=Number.parseInt(process.env.GRIDDO_RENDER_SITE||""),mm=(process.env.GRIDDO_RENDER_PAGES||"").split(",").map(e=>Number.parseInt(e)).filter(Boolean),fm=Me(process.env.GRIDDO_SKIP_BUILD_CHECKS),hm=Me(process.env.GRIDDO_DEBUG_LOGS),xm=Me(process.env.GRIDDO_BUILD_LOGS),vm=Me(process.env.GRIDDO_RENDER_BREAKPOINTS_FEATURE),gm=Me(process.env.GRIDDO_SSG_VERBOSE_LOGS),bm=Me(process.env.GRIDGRIDDO_SEARCH_FEATURE_FEATURE),ym=process.env.GRIDDO_ASSET_PREFIX||process.env.ASSET_PREFIX,wm=process.env.GRIDDO_REACT_APP_INSTANCE||process.env.REACT_APP_INSTANCE,_m=Me(process.env.GRIDDO_AI_EMBEDDINGS),Sm=Me(process.env.GRIDDO_VERBOSE_LOGS),Em=Me(process.env.GRIDDO_ALERT_FEATURE),Dm=Number.parseInt(process.env.GRIDDO_API_MAX_RESPONSE_SIZE||"81920"),Rm=Number.parseInt(process.env.GRIDDO_SSG_MAX_PAGE_SIZE||"524288"),Om=Number.parseInt(process.env.GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS||"1"),Cm=Number.parseInt(process.env.GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS||"1"),Tm=Number.parseInt(process.env.GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS||"1"),Im=Number.parseInt(process.env.GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS||"1"),Pm=Number.parseInt(process.env.GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS||"1"),Am=Number.parseInt(process.env.GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS||"2"),Fm=Number.parseInt(process.env.GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS||"1"),km=Number.parseInt(process.env.GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS||"4"),jm=Number.parseInt(process.env.GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS||"1"),Lm=process.env.GRIDDO_CX_FIXTURES_DOMAIN_NAMES,Nm=process.env.GRIDDO_CX_FIXTURES_SITE_NAMES;var _t=`${Fe}/site/`,qm=`${Fe}/ai/embeddings`,Um=`${fa}/alert`,Bm=`${Fe}/domains`,Mm=`${Fe}/sites/all`,$m=`${Fe}/page`,Gm=`${Fe}/login_check`,zm=`${Fe}/debug/reset-render`,Xm=`${Fe}/domains/robots`,Hm=`${Fe}/search`,Wm=`${Fe}/settings`,Vm=[_t,"/build/end"],Jm=[_t,"/build/start"],Ym=[_t,"/pages?pagination=false"],Km=[_t,"/distributor"],Qm=[_t,"/sitemap"],Zm=[_t,"/all"],ef=[_t,"/languages"],tf=[_t,"/socials"];var ee={ALERT:Um,AI_EMBEDDINGS:qm,BUILD_END:Vm,BUILD_START:Jm,DOMAINS:Bm,GET_ALL:Mm,GET_PAGE:$m,GET_PAGES:Ym,GET_REFERENCE_FIELD_DATA:Km,GET_SITEMAP:Qm,INFO:Zm,LANGUAGES:ef,LOGIN:Gm,RESET_RENDER:zm,ROBOTS:Xm,SEARCH:Hm,SETTINGS:Wm,SOCIALS:tf},O={GRIDDO_AI_EMBEDDINGS:_m,GRIDDO_ALERT_FEATURE:Em,GRIDDO_API_CONCURRENCY_COUNT:lm,GRIDDO_API_MAX_RESPONSE_SIZE:Dm,GRIDDO_API_URL:Fe,GRIDDO_ARCHIVE_LIFECYCLE_MAX_ATTEMPTS:jm,GRIDDO_ASSET_PREFIX:ym,GRIDDO_BOT_PASSWORD:pm,GRIDDO_BOT_USER:cm,GRIDDO_BUILD_LOGS:xm,GRIDDO_CLEAN_LIFECYCLE_MAX_ATTEMPTS:Om,GRIDDO_CLOSE_LIFECYCLE_MAX_ATTEMPTS:Cm,GRIDDO_DATA_LIFECYCLE_MAX_ATTEMPTS:Pm,GRIDDO_DEBUG_LOGS:hm,GRIDDO_FIXTURES_DOMAIN_NAMES:Lm,GRIDDO_FIXTURES_SITE_NAMES:Nm,GRIDDO_META_LIFECYCLE_MAX_ATTEMPTS:km,GRIDDO_PREPARE_LIFECYCLE_MAX_ATTEMPTS:Tm,GRIDDO_PUBLIC_API_URL:fa,GRIDDO_REACT_APP_INSTANCE:wm,GRIDDO_RELOCATION_LIFECYCLE_MAX_ATTEMPTS:Fm,GRIDDO_RENDER_ALL_SITES:um,GRIDDO_RENDER_BREAKPOINTS_FEATURE:vm,GRIDDO_RENDER_PAGES:mm,GRIDDO_RENDER_SITE:dm,GRIDDO_RESTORE_LIFECYCLE_MAX_ATTEMPTS:Im,GRIDDO_SEARCH_FEATURE:bm,GRIDDO_SKIP_BUILD_CHECKS:fm,GRIDDO_SSG_LIFECYCLE_MAX_ATTEMPTS:Am,GRIDDO_SSG_MAX_PAGE_SIZE:Rm,GRIDDO_SSG_VERBOSE_LOGS:gm,GRIDDO_VERBOSE_LOGS:Sm};Je();at();af.default.config();var of=V();function rf(e){let{proDomain:t}=V();if(!O.GRIDDO_ASSET_PREFIX||!e||!e.startsWith(t))return"";let n=`${O.GRIDDO_ASSET_PREFIX}/${e}`;return U(`Reading process.env.GRIDDO_ASSET_PREFIX, ${O.GRIDDO_ASSET_PREFIX}`),U(`Setting the asset prefix with the domain concatenated, ${n}`),n}function sf(e){U(`read assetPrefixWithDomain, ${e}`),U(`using this NODE_OPTIONS in gatsby command: ${process.env.NODE_OPTIONS}`);let{__ssg:t}=of.paths(),n=process.env.NODE_OPTIONS?process.env.NODE_OPTIONS.replace(/--openssl-legacy-provider\s*/g,"").trim():"",i=(0,nf.spawnSync)("yarn",["gatsby-build",O.GRIDDO_SSG_VERBOSE_LOGS?"--verbose":""],{cwd:t,stdio:["ignore","inherit","ignore"],encoding:"utf8",shell:!0,env:Object.assign(process.env,{GRIDDO_EXPORTER:"true",SPAWN_ASSET_PREFIX_WITH_DOMAIN:e,NODE_OPTIONS:n})});i.status!==0&&K(pl(i))}async function cf(e,t){let{__cx:n,__ssg:i}=of.paths(e),a=ct.default.join(n,"dist"),o=ct.default.join(n,"assets"),r=ct.default.join(n,"dist",e),s=ct.default.join(i,"public"),p=Ge.default.readdirSync(s).filter(x=>ct.default.extname(x)===".js"||ct.default.extname(x)===".json"||ct.default.extname(x)===".css"),l=`${s}/page-data`,c=`${o}/page-data`,u=ct.default.join(i,"static"),f=o,h=`${a}/static`,m=`${o}/static`;try{Ge.default.mkdirSync(o,{recursive:!0}),Ge.default.copySync(s,a,{preserveTimestamps:!0}),t&&(Ge.default.copySync(l,c,{preserveTimestamps:!0}),Ge.default.existsSync(u)&&Ge.default.copySync(u,f,{overwrite:!1,preserveTimestamps:!0}),Ge.default.copySync(h,m,{overwrite:!1,preserveTimestamps:!0}),Ge.default.existsSync(u)&&Ge.default.copySync(u,r,{overwrite:!1,preserveTimestamps:!0}),p.map(async x=>{let v=`${s}/${x}`,b=`${o}/${x}`;Ge.default.copySync(v,b,{preserveTimestamps:!0})}))}catch(x){console.error(x)}}var $t=R(require("node:path"));function D_(e){let{__cx:t,__exports:n,__cache:i}=e;return{initials:[n,i,$t.default.join(t,"store"),$t.default.join(t,"apiCache")],disposables:[$t.default.join(t,"store"),$t.default.join(t,"apiCache"),$t.default.join(t,"render-metadata.json"),$t.default.join(t,"dist")],cacheables:["apiCache","store"],archivables:["dist","assets"]}}var ha=D_;var xa=R(require("node:path"));function R_(e){let{__ssg:t}=e;return{disposables:[xa.default.join(t,"public"),xa.default.join(t,"static"),xa.default.join(t,".cache")],cacheables:[".cache"],initials:[],archivables:[]}}var pf=R_;function lf(e,t){let{cxPaths:n}=t,i={gatsby:pf(n)};return{cx:ha(n),[e]:i[e],all:{initials:[...ha(n).initials,...i[e].initials],disposables:[...ha(n).disposables,...i[e].disposables]}}}async function uf({area:e,description:t,fullData:n,instantNotification:i=!1,level:a}){let o=ee.ALERT,r={level:a,area:e,description:t,fullData:n,instantNotification:i};try{await xn.post(o,r,{headers:{"Content-Type":"application/json",Connection:"close"}})}catch(s){console.error("Error creating Griddo alert:",s)}}var Sf=R(require("node:fs")),ts=R(require("node:path")),Ef=R(Ga());var va=class{_defaultHeaders;_defaultFooters;_navigations;constructor(){this._navigations={footers:[],headers:[]},this._defaultHeaders={},this._defaultFooters={}}set navigations(t){this._navigations=t,this._defaultFooters=this.getDefaultFooters(),this._defaultHeaders=this.getDefaultHeaders()}get navigations(){return this._navigations}getDefaultFooters(){let n=[...this.navigations.footers].filter(a=>a.setAsDefault),i={};for(let a of n)i[a.language]=a;return i}getDefaultHeaders(){let n=[...this.navigations.headers].filter(a=>a.setAsDefault),i={};for(let a of n)i[a.language]=a;return i}getRightLanguage(t,n,i){if(!t||!n)return null;let o=t.find(r=>r.language===i&&r.navigationLanguages?.find(s=>s.navigationId===n))||t.find(r=>r.id===n);return o?{...o}:null}getPageHeader(t,n){return this.getRightLanguage(this.navigations.headers,t,n)}getPageFooter(t,n){return this.getRightLanguage(this.navigations.footers,t,n)}getPageNavigations(t){let{header:n,footer:i,language:a,template:{templateType:o},templateConfig:{defaultHeader:r,defaultFooter:s,templates:p}}=t,l=m=>{let x=m.find(v=>typeof v=="number");return typeof x=="number"?x:null},c=l([n,p?.[o]?.defaultHeader,r]),u=l([i,p?.[o]?.defaultFooter,s]),f=c?this.getPageHeader(c,a):c===0?null:this._defaultHeaders[a],h=u?this.getPageFooter(u,a):u===0?null:this._defaultFooters[a];return{header:f,footer:h}}};function O_(e,t){let{order:n,sources:i,quantity:a,mode:o,fixed:r,fullRelations:s=!1,allLanguages:p=!1,preferenceLanguage:l=!1,referenceId:c,fields:u}=e;return o==="auto"?{mode:o,order:n,sources:i,quantity:a,fullRelations:s,allLanguages:p,preferenceLanguage:l,fields:u}:o==="manual"?{mode:o,fixed:r,fullRelations:s,fields:u}:o==="navigation"?{mode:o,order:n,quantity:a,fullRelations:s,referenceId:c||t?.structuredDataContent?.id,fields:u}:(console.log(`Error: ReferenceField mode: ${o} is not recognized on page ${t?.id}.`),e)}async function C_(e){let{page:t,component:{data:n},cacheKey:i}=e;if(!n)return Qt(`Error: Page ${t.id} has \`hasDistributorData: true\` or \`getStaticData: true\` but it doesn't have a \`data\` property.`,"No `data` in `ReferenceField`"),[];if(Array.isArray(n.sources)&&n.sources.length<1)return Qt(`Warning: Page with id: ${t.id} has a ReferenceField with empty \`data.sources\``,"Empty data.sources in ReferenceField"),[];let{site:a,lang:o}=n;!n.sources&&n.mode==="auto"&&Qt(`Warning: Page with id: ${t.id} has a ReferenceField with \`undefined\` \`data.sources\``,"undefined data.sources in ReferenceField");let r=O_(n,t);return await Md(t,r,i,a,o)}async function df({page:e,cacheKey:t=""}){try{let{template:n}=e,i=async(r,s=1)=>{if(!(!r||typeof r!="object"||!(JSON.stringify(r).includes('"hasDistributorData":true')||JSON.stringify(r).includes('"getStaticData":true'))))for(let l in r){if(l==="queriedItems")continue;let u=r[l];if(!u||typeof u!="object")continue;(u.hasDistributorData||u.getStaticData)&&(u.queriedItems=await C_({page:e,cacheKey:t,component:u})),await i(u,s+1)}};return await(async r=>(await i([r]),r))(n)}catch(n){console.error(`Error in getReferenceFieldData ${n}`),process.exit(1)}}async function mf(){return await Oe({endpoint:ee.SETTINGS})}var xf=R(En());function Qr(e,t,n,i="jpg"){let a=typeof e=="string"?e:e?.url;return a?a.split("/")[2].includes("cloudinary.com")?I_(a,`c_fill,w_${t},h_${n}`):T_(a,`f/${i}/w/${t}/h/${n}`):null}function T_(e,t){let n=e.split("/"),i=n.slice(0,-1).join("/"),a=n.slice(-1)[0];return`${i}/${t}/${a}`}function I_(e,t){let n=e.replace("https://",""),i=n.split("/").slice(0,4).join("/"),a=n.replace(i,"");return`https://${i}/${t}${a}`}xf.default.config();var P_=25;function A_({socialTitle:e,socialDescription:t,socialImage:n}){return{type:"website",title:e,description:t,image:n?Qr(n,1280,768):"",twitterImage:n?Qr(n,1280,768):""}}function F_(e){let{title:t,metaTitle:n,metaDescription:i,canonicalURL:a,locale:o,url:r,isIndexed:s,follow:p,metasAdvanced:l,pageLanguages:c,fullUrl:u,metaKeywords:f}=e,h=l?.split(",").filter(Boolean).map(m=>m.trim().toLowerCase())||[];return{title:(n||t||"").trim(),description:i,canonical:a?.trim()&&a!==u?a.trim():s?u:void 0,locale:o,url:r,index:s?"index":"noindex",follow:p?"follow":"nofollow",translate:h.includes("notranslate")?"notranslate":"",metasAdvanced:h.filter(m=>m!=="notranslate").join(),pageLanguages:c,metaKeywords:f?.filter(Boolean).map(m=>m.replace(/"/g,"'")).join(", ")}}async function es(e,t){let{id:n,title:i,fullPath:a,language:o,breadcrumb:r,socialDescription:s,socialImage:p,socialTitle:l}=e,{baseUrl:c,cloudinaryName:u,griddoVersion:f,siteLangs:h,siteMetadata:m,siteOptions:x,siteScript:v,siteSlug:b,socials:E,theme:_,navigations:{header:T,footer:P}}=t;e.breadcrumb=r,e.siteSlug=b,e.apiUrl=c,e.publicApiUrl=t.publicBaseUrl,e.instance=t.instance;let ne=h.find(({id:X})=>X===e?.language)?.locale.replace(/_/g,"-"),Q=F_(e),D=A_({socialDescription:s,socialImage:p,socialTitle:l}),A=a.compose,F=new Date().toString();return{path:A,size:void 0,context:{id:n,title:i,fullPath:a,locale:ne,languageId:o,theme:_,siteMetadata:m,pageMetadata:Q,openGraph:D,socials:E,siteLangs:h,cloudinaryName:u,siteOptions:x,griddoVersion:f,renderDate:F,siteScript:v,header:T,footer:P,page:e}}}async function vf(e,t){return await es(e,t)}async function gf({page:e,pages:t,isRoot:n=!1,defaultLang:i,template:a,totalQueriedItems:o},r){let s=t.map(async(p,l)=>{let c=l===0,u=l+1,{domainUrl:f,compose:h}=e.fullPath,m={...e,id:Number.parseInt(`-${e.id}${l}`),fullPath:{...e.fullPath,compose:Zr(h,u,{addEndingSlash:!0})},fullUrl:Zr(e.fullUrl,u,{addEndingSlash:!0}),slug:Zr(e.slug,u),title:hf(e.title,u),metaTitle:hf(e.metaTitle||"",u),disableHrefLangs:u>1,template:{...a,isFirstPage:c,pageNumber:u,totalPages:t.length,baseLink:`${f}${h}`,queriedItems:p,totalQueriedItems:o?.length},isRoot:n,defaultLang:i};return await es(m,r)});return Promise.all(s)}function bf(e,t){let{multiPageElements:n,...i}=e,a=JSON.parse(JSON.stringify(n));a.find(({sectionSlug:r})=>r==="/")||a.push({});let o=a.map(async(r,s)=>{let p=JSON.parse(JSON.stringify(i)),{sectionSlug:l="/",title:c="",metaTitle:u="",metaDescription:f=""}=r,h=typeof c=="string"?c:c.content,m=p.fullPath.compose||"",x=p.fullUrl.endsWith("/")?p.fullUrl.slice(0,-1):p.fullUrl,v=l?.replace(/\//g,""),E=l==="/"?v:`${v}/`,_=m.endsWith("/")?"":"/",T=`${m}${_}${E}`;return h.trim()&&(p.title=h),f.trim()&&(p.metaDescription=f),p.id=Number.parseInt(`-${p.id}${s}`),p.fullUrl=`${x}/${E}`,p.fullPath.compose=T,p.slug=T,p.template.activeSectionSlug=l,p.template.activeSectionBase=x,p.metaTitle=u.trim()||h.trim()||p.metaTitle,await es(p,t)});return Promise.all(o)}function yf(e){return new Promise(n=>{let i=(a,o=0)=>{if(!(!a||typeof a!="object")){for(let r in a){let s=a[r],p=s||typeof s=="object",l=JSON.stringify(s).includes('"hasGriddoMultiPage":true');if(!p||!l)continue;let{component:c,hasGriddoMultiPage:u,elements:f}=s;c&&u&&n(f||[]),i(s,o+1)}o||n(null)}};i([e])})}function k_(e,t,n){return t?.slice(e*(n-1),e*n)}function j_(e,t){let n=Math.ceil(t.length/e)||1;return Array.from({length:n},(a,o)=>o+1)?.map(a=>k_(e,t,a))}function wf(e){let t=e.queriedItems||[],n=e?.itemsPerPage||P_;return j_(n,t)}function ff(e){return e.replace(/\/+$/,"/")}function Zr(e,t,n){let i=e.endsWith("/")?"":"/",a=n?.addEndingSlash?"/":"";return t<=1?ff(`${e}${a}`):ff(`${e}${i}${t}${a}`)}function hf(e,t){return!e||t<=1?e:`${e} - ${t}`}var _f=V(),L_=new Date().valueOf().toString();async function Df(e){xl(),console.info(`API calls with ${O.GRIDDO_API_CONCURRENCY_COUNT} threads`);let{__cx:t}=_f.paths(),{griddoVersion:n}=_f,i=ts.default.join(t,"store");try{let a=[],o={},{sitesToPublish:r,sitesToUnpublish:s}=await Xd(e),p=r.length>0||s.length>0;p||console.warn(`There are no sites to update in the domain ${e}`),Ja("Sites to publish:",r),Ja("Sites to unpublish:",s),await Hd(s);for(let l of r){let{id:c,slug:u,theme:f,favicon:h,changedPages:m=[]}=l,{siteInfo:x,validPagesIds:v,siteHash:b,unpublishHashes:E,siteLangs:_,defaultLang:T,headers:P,footers:z,socials:ne}=await Wd(c),{cloudinaryName:Q,useMetaTitle:D,useMetaKeywords:A,showBasicMetaRobots:F,avoidHrefLangsOnCanonicals:M,avoidSelfReferenceCanonicals:X,avoidHrefLangXDefault:k,avoidDebugMetas:L}=await mf();o[c]={siteHash:b,unpublishHashes:E,publishHashes:[]};let N=new va;N.navigations={headers:P,footers:z},l.languages=_;let w=kd(c,b),S=x.siteScript,C={siteUrl:x.slug,title:x.name,favicon:h},ze={baseUrl:O.GRIDDO_API_URL,publicBaseUrl:O.GRIDDO_PUBLIC_API_URL,instance:O.GRIDDO_REACT_APP_INSTANCE,siteSlug:u,theme:f,siteMetadata:C,socials:ne,siteLangs:_,cloudinaryName:Q,griddoVersion:n,siteOptions:{useMetaTitle:D,useMetaKeywords:A,showBasicMetaRobots:F,avoidHrefLangsOnCanonicals:M,avoidSelfReferenceCanonicals:X,avoidHrefLangXDefault:k,avoidDebugMetas:L},siteScript:S};Ot(`${l.name} site`),Sf.default.mkdirSync(ts.default.join(i,c.toString()),{recursive:!0});let ie=async(St,re)=>{let ai=[],He=await qd(re,w);if(!He)return;a.push(re);let oi=JSON.parse(JSON.stringify(ze));oi.navigations=N.getPageNavigations(He);let zt=await df({page:He,cacheKey:L_}),ss=await yf(zt),wa=He?.mode==="list"||He?.mode==="paginated-data",cs=!wa&&ss,Uf=!cs&&!wa;if(wa){let We={page:He,pages:wf(zt),isRoot:!1,defaultLang:T,template:zt,totalQueriedItems:zt.queriedItems};ai=await gf(We,oi)}if(cs){let We=He;We.template=zt,We.multiPageElements=ss,We.defaultLang=T,ai=await bf(We,oi)}if(Uf){let We=He;We.template=zt,We.defaultLang=T,ai=[await vf(We,oi)]}He.hash!==null&&o[c].publishHashes.push(He.hash),vl(St,ai)},{pagesMissingInStore:Xe,pagesToDeleteFromStore:Gt,pagesToWriteToStore:Te}=await bl({sitesToPublish:r,validPagesIds:v,changedPages:m,siteDirName:c.toString()});gl(c.toString(),Gt);let we=(0,Ef.default)(O.GRIDDO_API_CONCURRENCY_COUNT),ii=Te.map(St=>we(()=>ie(c.toString(),St)));U(`Store site: ${l.name}`),U(`${v.length} valid pages from API`),U(`changed ${m.length} pages from API`),U(`deleted ${Gt.length} pages from store`),U(`missing ${Xe.length} pages in store`),U(`write ${Te.length} pages to store`),await Promise.all(ii)}p?Ao({buildProcessData:o,createdPages:a,sitesToPublish:r}):(rm(),Ao({buildProcessData:o,createdPages:[],sitesToPublish:[]}))}catch(a){console.error(a.message),process.exit(1)}}async function Rf(e){Id(),await Df(e),am()}Je();at();async function Of(){return await Oe({endpoint:ee.DOMAINS})}async function Cf(){await ot.login();let e=await Of();return e.length||K(dl),U(`getting domains names (${e.length})`),N_(e)}function N_(e){let t=e.filter(({slug:n})=>!!n).map(({slug:n})=>n.replace("/",""));return[...new Set(t)]}var Ce=R(require("node:fs")),et=R(require("node:path")),ye=R(Rt());Je();at();var q_=V(),ns=e=>{if(!ye.default.statSync(e).isDirectory())return;let n=ye.default.readdirSync(e);if(n.length>0){let a=n.length,o=n.filter(r=>et.default.extname(r).toLowerCase()===".xml").length;if(a===o){for(let r of n){let s=et.default.join(e,r);ye.default.rmSync(s)}n=ye.default.readdirSync(e)}for(let r of n){let s=et.default.join(e,r);ns(s)}n=ye.default.readdirSync(e)}if(n.length===0){ye.default.rmdirSync(e);return}};function Tf(e,t){for(let n of e)try{Ce.default.existsSync(n)||(Ce.default.mkdirSync(n,{recursive:!0,...t}),U(`create directory: ${n}`))}catch(i){K(Pt,i)}}function If(e,t){try{Ce.default.existsSync(e)&&(Ce.default.renameSync(e,t),U(`rename ${e} to ${t}`))}catch(n){K(Pt,n)}}function is(e,t,n,i={withBackup:!1}){let{withBackup:a}=i;for(let o of n){let r=et.default.join(e,o),s=et.default.join(t,o);if(!ye.default.existsSync(r)){console.log(`(Maybe first render) Source directory does not exist: ${r}`);continue}a&&(Ff(s),U(`create backup: ${s}`));try{ye.default.existsSync(s)&&(Ce.default.rmSync(s,{recursive:!0,force:!0}),U(`clean destination: ${s}`)),Ce.default.cpSync(r,s,{recursive:!0,preserveTimestamps:!0}),U(`copy: ${r} to ${s}`),a&&(Af(s),U(`delete backup: ${s}`))}catch(p){a&&(Pf(s),console.log("Backup has been restored.")),K(Pt,p)}}}function _n(e,t,n,i){let{override:a,withBackup:o}=i||{};for(let r of n){let s=et.default.join(e,r),p=et.default.join(t,r);if(ye.default.existsSync(s)){o&&Ff(p);try{a&&ye.default.existsSync(p)&&Ce.default.rmSync(p,{recursive:!0,force:!0}),Ce.default.renameSync(s,p),U(`moved: ${s} to ${p}`),o&&Af(p)}catch(l){o&&(Pf(p),console.log("Backup has been restored.")),K(Pt,l)}}}}function as(e){for(let t of e)if(t)try{ye.default.existsSync(t)&&(Ce.default.rmSync(t,{recursive:!0,force:!0}),U(`removed directory: ${t}`))}catch(n){K(Pt,n)}}function Pf(e,t="-BACKUP"){let n=e+t;try{Ce.default.renameSync(n,e),console.log(`Backup ${n} has been restored`)}catch(i){throw console.log(i),new Error(`Error while delete ${n} backup`)}}function Af(e,t="-BACKUP"){let n=e+t;if(ye.default.existsSync(n))try{Ce.default.rmSync(n,{recursive:!0,force:!0}),console.log(`Backup ${n} has been deleted`)}catch(i){throw console.log(i),new Error(`Error while delete ${n} backup`)}}function Ff(e,t="-BACKUP"){let n=e+t;if(ye.default.existsSync(e)){if(ye.default.existsSync(n)){console.log(`Destination ${n} already exists`);return}try{Ce.default.renameSync(e,n),console.log(`Backup of ${e} has been created in ${n}`)}catch(i){console.log(`Error while coping ${e} to ${n} backup`),K(Pt,i)}}}async function kf(){let{__cx:e}=q_.paths(),t=et.default.join(e,"store");try{let n=Fo(t);for(let i of n)et.default.basename(i).startsWith("-")&&Ce.default.unlinkSync(i)}catch{console.info("`store` folder does not exist. Skipping multipage or static list template cleaning.")}}var ga=R(require("node:fs")),ba=R(require("node:path"));Je();at();var os=V();function jf(){let{__cx:e}=os.paths(),t=ba.default.join(e,".render-sentinel");ga.default.writeFileSync(t,new Date().toISOString())}function Lf(){let{__cx:e}=os.paths(),t=ba.default.join(e,".render-sentinel");ga.default.unlinkSync(t)}function Nf(){let{__cx:e}=os.paths(),t=ba.default.join(e,".render-sentinel");ga.default.existsSync(t)||K(fl)}var U_=V();async function B_(){Np();let e=await Cf();for(let t of e)await M_(t);if(O.GRIDDO_ALERT_FEATURE){let t=ni.get("API_RESPONSE_TOO_BIG");if(t.entries.length<1)return;_i(`
74
74
  Render register report
75
- `),_i(t),_i(),uf({description:`API response size is too large (${O.GRIDDO_API_MAX_RESPONSE_SIZE}KB).`,area:"Griddo",level:"W",fullData:{output:t,date:new Date().toISOString()}})}}async function M_(e){Zt(`Initializing render for the domain ${e}`),jf();let t=U_.paths(e),{all:n,gatsby:i,cx:a}=lf("gatsby",{cxPaths:t}),{__ssg:o,__exports:r,__cache:s,__cx:p,__components:l}=t,c=rf(e),u=!!c&&c!=="";await $e("Clean",{steps:[()=>as(n.disposables)]}),await $e("Prepare",{steps:[()=>Tf(n.initials)]}),await $e("Restore",{steps:[()=>is(l,o,["static"]),()=>is(r,p,a.archivables),()=>If(ya.default.join(p,"dist"),ya.default.join(o,"public")),()=>_n(s,p,a.cacheables),()=>_n(s,o,i.cacheables)]}),await $e("Data",{steps:[()=>Rf(e)]}),await $e("SSG",{steps:[()=>sf(c)]}),await $e("Relocation",{steps:[()=>cf(e,u)]}),await $e("Meta",{steps:[()=>om(e)]}),await $e("Archive",{steps:[()=>kf(),()=>ns(ya.default.join(p,"dist")),()=>_n(p,r,a.archivables,{withBackup:!0}),()=>_n(p,s,a.cacheables),()=>_n(o,s,i.cacheables)]}),await $e("Close",{steps:[()=>as(n.disposables)]}),await $e("HealthCheck",{steps:[()=>Nf()]}),Lf()}var rs=B_;Ve();async function qf(){try{let e=await Kr([()=>rs()]);Zt(`All domains rendered in ${e}s.`),process.exit(0)}catch(e){e instanceof An&&(console.log(),console.log(Y.black().bgRed(" GRIDDO InternalCXError ")),console.log(),process.exit(1)),console.log(),console.log(Y.black().bgRed(" GRIDDO UnknownError ")),console.log(),console.log(e),console.log(),process.exit(1)}}qf();
75
+ `),_i(t),_i(),uf({description:`API response size is too large (${O.GRIDDO_API_MAX_RESPONSE_SIZE}KB).`,area:"Griddo",level:"W",fullData:{output:t,date:new Date().toISOString()}})}}async function M_(e){Zt(`Initializing render for the domain ${e}`),jf();let t=U_.paths(e),{all:n,gatsby:i,cx:a}=lf("gatsby",{cxPaths:t}),{__ssg:o,__exports:r,__cache:s,__cx:p,__components:l}=t,c=rf(e),u=!!c&&c!=="";await $e("Clean",{steps:[()=>as(n.disposables)]}),await $e("Prepare",{steps:[()=>Tf(n.initials)]}),await $e("Restore",{steps:[()=>is(l,o,["static"]),()=>is(r,p,a.archivables),()=>If(ya.default.join(p,"dist"),ya.default.join(o,"public")),()=>_n(s,p,a.cacheables),()=>_n(s,o,i.cacheables)]}),await $e("Data",{steps:[()=>Rf(e)]}),await $e("SSG",{steps:[()=>sf(c)]}),await $e("Relocation",{steps:[()=>cf(e,u)]}),await $e("Meta",{steps:[()=>om(e)]}),await $e("Archive",{steps:[()=>kf(),()=>ns(ya.default.join(p,"dist")),()=>_n(p,r,a.archivables,{withBackup:!0}),()=>_n(p,s,a.cacheables),()=>_n(o,s,i.cacheables)]}),await $e("Close",{steps:[()=>as(n.disposables)]}),await $e("HealthCheck",{steps:[()=>Nf()]}),Lf()}var rs=B_;Je();async function qf(){try{let e=await Kr([()=>rs()]);Zt(`All domains rendered in ${e}s.`),process.exit(0)}catch(e){e instanceof An&&(console.log(),console.log(Y.black().bgRed(" GRIDDO InternalCXError ")),console.log(),process.exit(1)),console.log(),console.log(Y.black().bgRed(" GRIDDO UnknownError ")),console.log(),console.log(e),console.log(),process.exit(1)}}qf();
76
76
  /*! Bundled license information:
77
77
 
78
78
  mime-db/index.js: