UNPKG

@ministryofjustice/hmpps-digital-prison-reporting-frontend

Version:

The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.

56 lines 102 kB
var Mo=Object.create;var nr=Object.defineProperty;var Do=Object.getOwnPropertyDescriptor;var No=Object.getOwnPropertyNames;var Io=Object.getPrototypeOf,xo=Object.prototype.hasOwnProperty;var w=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Po=(r,e)=>{for(var t in e)nr(r,t,{get:e[t],enumerable:!0})},xt=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of No(e))!xo.call(r,i)&&i!==t&&nr(r,i,{get:()=>e[i],enumerable:!(n=Do(e,i))||n.enumerable});return r};var Pt=(r,e,t)=>(t=r!=null?Mo(Io(r)):{},xt(e||!r||!r.__esModule?nr(t,"default",{value:r,enumerable:!0}):t,r)),jo=r=>xt(nr({},"__esModule",{value:!0}),r);var Ft=w((pu,Tr)=>{var Bo=Object.prototype.hasOwnProperty;function Bt(r){return"[Throws: "+(r?r.message:"?")+"]"}function qo(r,e){if(Bo.call(r,e))try{return r[e]}catch(t){return Bt(t)}return r[e]}function qt(r){var e=[];function t(n){if(n===null||typeof n!="object")return n;if(e.indexOf(n)!==-1)return"[Circular]";if(e.push(n),typeof n.toJSON=="function")try{var i=t(n.toJSON());return e.pop(),i}catch(s){return Bt(s)}if(Array.isArray(n)){var o=n.map(t);return e.pop(),o}var a=Object.keys(n).reduce(function(s,u){return s[u]=t(qo(n,u)),s},{});return e.pop(),a}return t(r)}Tr.exports=function(r,e,t){return JSON.stringify(qt(r),e,t)};Tr.exports.ensureProperties=qt});var Gt=w((mu,Ut)=>{var U=require("fs"),Be=require("path");Ut.exports=ir;ir.ncp=ir;function ir(r,e,t,n){var i=n;n||(i=t,t={});var o=process.cwd(),a=Be.resolve(o,r),s=Be.resolve(o,e),u=t.filter,l=t.rename,c=t.transform,p=t.clobber!==!1,f=t.modified,h=t.dereference,d=null,v=0,k=0,g=0,_=t.limit||ir.limit||16;_=_<1?1:_>512?512:_,T(a);function T(y){if(v++,u){if(u instanceof RegExp){if(!u.test(y))return V(!0)}else if(typeof u=="function"&&!u(y))return V(!0)}return S(y)}function S(y){var E=h?U.stat:U.lstat;if(g>=_)return setImmediate(function(){S(y)});g++,E(y,function(R,D){var $={};if(R)return W(R);if($.name=y,$.mode=D.mode,$.mtime=D.mtime,$.atime=D.atime,D.isDirectory())return G($);if(D.isFile())return A($);if(D.isSymbolicLink())return b(y)})}function A(y){var E=y.name.replace(a,s);l&&(E=l(E)),ee(E,function(R){if(R)return K(y,E);if(p&&z(E,function(){K(y,E)}),f){var D=h?U.stat:U.lstat;D(E,function($,je){if(y.mtime.getTime()>je.mtime.getTime())K(y,E);else return V()})}else return V()})}function K(y,E){var R=U.createReadStream(y.name),D=U.createWriteStream(E,{mode:y.mode});R.on("error",W),D.on("error",W),c?c(R,D,y):D.on("open",function(){R.pipe(D)}),D.once("finish",function(){f&&U.utimesSync(E,y.atime,y.mtime),V()})}function z(y,E){U.unlink(y,function(R){return R?W(R):E()})}function G(y){var E=y.name.replace(a,s);ee(E,function(R){if(R)return N(y,E);te(y.name)})}function N(y,E){U.mkdir(E,y.mode,function(R){if(R)return W(R);te(y.name)})}function te(y){U.readdir(y,function(E,R){return E?W(E):(R.forEach(function(D){T(Be.join(y,D))}),V())})}function b(y){var E=y.replace(a,s);U.readlink(y,function(R,D){if(R)return W(R);H(D,E)})}function H(y,E){h&&(y=Be.resolve(o,y)),ee(E,function(R){if(R)return Z(y,E);U.readlink(E,function(D,$){return D?W(D):(h&&($=Be.resolve(o,$)),$===y?V():z(E,function(){Z(y,E)}))})})}function Z(y,E){U.symlink(y,E,function(R){return R?W(R):V()})}function ee(y,E){U.lstat(y,function(R){return R&&R.code==="ENOENT"?E(!0):E(!1)})}function W(y){return t.stopOnError?i(y):(!d&&t.errs?d=U.createWriteStream(t.errs):d||(d=[]),typeof d.write>"u"?d.push(y):d.write(y.stack+`

`),V())}function V(y){if(y||g--,k++,v===k&&g===0&&i!==void 0)return i(d||null)}}});var zt=w((vu,$t)=>{$t.exports=function(r,e){for(var t=[],n=0;n<r.length;n++){var i=e(r[n],n);Fo(i)?t.push.apply(t,i):t.push(i)}return t};var Fo=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"}});var Jt=w((gu,Yt)=>{"use strict";Yt.exports=Vt;function Vt(r,e,t){r instanceof RegExp&&(r=Wt(r,t)),e instanceof RegExp&&(e=Wt(e,t));var n=Qt(r,e,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+e.length)}}function Wt(r,e){var t=e.match(r);return t?t[0]:null}Vt.range=Qt;function Qt(r,e,t){var n,i,o,a,s,u=t.indexOf(r),l=t.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(r===e)return[u,l];for(n=[],o=t.length;c>=0&&!s;)c==u?(n.push(c),u=t.indexOf(r,c+1)):n.length==1?s=[n.pop(),l]:(i=n.pop(),i<o&&(o=i,a=l),l=t.indexOf(e,c+1)),c=u<l&&u>=0?u:l;n.length&&(s=[o,a])}return s}});var nn=w((yu,tn)=>{var Uo=zt(),Ht=Jt();tn.exports=zo;var Xt="\0SLASH"+Math.random()+"\0",Kt="\0OPEN"+Math.random()+"\0",Mr="\0CLOSE"+Math.random()+"\0",Zt="\0COMMA"+Math.random()+"\0",en="\0PERIOD"+Math.random()+"\0";function Lr(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function Go(r){return r.split("\\\\").join(Xt).split("\\{").join(Kt).split("\\}").join(Mr).split("\\,").join(Zt).split("\\.").join(en)}function $o(r){return r.split(Xt).join("\\").split(Kt).join("{").split(Mr).join("}").split(Zt).join(",").split(en).join(".")}function rn(r){if(!r)return[""];var e=[],t=Ht("{","}",r);if(!t)return r.split(",");var n=t.pre,i=t.body,o=t.post,a=n.split(",");a[a.length-1]+="{"+i+"}";var s=rn(o);return o.length&&(a[a.length-1]+=s.shift(),a.push.apply(a,s)),e.push.apply(e,a),e}function zo(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),be(Go(r),!0).map($o)):[]}function Wo(r){return"{"+r+"}"}function Vo(r){return/^-?0\d/.test(r)}function Qo(r,e){return r<=e}function Yo(r,e){return r>=e}function be(r,e){var t=[],n=Ht("{","}",r);if(!n||/\$$/.test(n.pre))return[r];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),a=i||o,s=n.body.indexOf(",")>=0;if(!a&&!s)return n.post.match(/,.*\}/)?(r=n.pre+"{"+n.body+Mr+n.post,be(r)):[r];var u;if(a)u=n.body.split(/\.\./);else if(u=rn(n.body),u.length===1&&(u=be(u[0],!1).map(Wo),u.length===1)){var c=n.post.length?be(n.post,!1):[""];return c.map(function(b){return n.pre+u[0]+b})}var l=n.pre,c=n.post.length?be(n.post,!1):[""],p;if(a){var f=Lr(u[0]),h=Lr(u[1]),d=Math.max(u[0].length,u[1].length),v=u.length==3?Math.abs(Lr(u[2])):1,k=Qo,g=h<f;g&&(v*=-1,k=Yo);var _=u.some(Vo);p=[];for(var T=f;k(T,h);T+=v){var S;if(o)S=String.fromCharCode(T),S==="\\"&&(S="");else if(S=String(T),_){var A=d-S.length;if(A>0){var K=new Array(A+1).join("0");T<0?S="-"+K+S.slice(1):S=K+S}}p.push(S)}}else p=Uo(u,function(te){return be(te,!1)});for(var z=0;z<p.length;z++)for(var G=0;G<c.length;G++){var N=l+p[z]+c[G];(!e||a||N)&&t.push(N)}return t}});var sr=w((_u,ln)=>{ln.exports=Q;Q.Minimatch=P;var qe=function(){try{return require("path")}catch{}}()||{sep:"/"};Q.sep=qe.sep;var Ir=Q.GLOBSTAR=P.GLOBSTAR={},Jo=nn(),on={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Dr="[^/]",Nr=Dr+"*?",Ho="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Xo="(?:(?!(?:\\/|^)\\.).)*?",an=Ko("().*{}+?[]^$\\!");function Ko(r){return r.split("").reduce(function(e,t){return e[t]=!0,e},{})}var sn=/\/+/;Q.filter=Zo;function Zo(r,e){return e=e||{},function(t,n,i){return Q(t,r,e)}}function ce(r,e){e=e||{};var t={};return Object.keys(r).forEach(function(n){t[n]=r[n]}),Object.keys(e).forEach(function(n){t[n]=e[n]}),t}Q.defaults=function(r){if(!r||typeof r!="object"||!Object.keys(r).length)return Q;var e=Q,t=function(i,o,a){return e(i,o,ce(r,a))};return t.Minimatch=function(i,o){return new e.Minimatch(i,ce(r,o))},t.Minimatch.defaults=function(i){return e.defaults(ce(r,i)).Minimatch},t.filter=function(i,o){return e.filter(i,ce(r,o))},t.defaults=function(i){return e.defaults(ce(r,i))},t.makeRe=function(i,o){return e.makeRe(i,ce(r,o))},t.braceExpand=function(i,o){return e.braceExpand(i,ce(r,o))},t.match=function(n,i,o){return e.match(n,i,ce(r,o))},t};P.defaults=function(r){return Q.defaults(r).Minimatch};function Q(r,e,t){return ar(e),t||(t={}),!t.nocomment&&e.charAt(0)==="#"?!1:new P(e,t).match(r)}function P(r,e){if(!(this instanceof P))return new P(r,e);ar(r),e||(e={}),r=r.trim(),!e.allowWindowsEscape&&qe.sep!=="/"&&(r=r.split(qe.sep).join("/")),this.options=e,this.set=[],this.pattern=r,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}P.prototype.debug=function(){};P.prototype.make=ea;function ea(){var r=this.pattern,e=this.options;if(!e.nocomment&&r.charAt(0)==="#"){this.comment=!0;return}if(!r){this.empty=!0;return}this.parseNegate();var t=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,t),t=this.globParts=t.map(function(n){return n.split(sn)}),this.debug(this.pattern,t),t=t.map(function(n,i,o){return n.map(this.parse,this)},this),this.debug(this.pattern,t),t=t.filter(function(n){return n.indexOf(!1)===-1}),this.debug(this.pattern,t),this.set=t}P.prototype.parseNegate=ra;function ra(){var r=this.pattern,e=!1,t=this.options,n=0;if(!t.nonegate){for(var i=0,o=r.length;i<o&&r.charAt(i)==="!";i++)e=!e,n++;n&&(this.pattern=r.substr(n)),this.negate=e}}Q.braceExpand=function(r,e){return un(r,e)};P.prototype.braceExpand=un;function un(r,e){return e||(this instanceof P?e=this.options:e={}),r=typeof r>"u"?this.pattern:r,ar(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:Jo(r)}var ta=1024*64,ar=function(r){if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>ta)throw new TypeError("pattern is too long")};P.prototype.parse=na;var or={};function na(r,e){ar(r);var t=this.options;if(r==="**")if(t.noglobstar)r="*";else return Ir;if(r==="")return"";var n="",i=!!t.nocase,o=!1,a=[],s=[],u,l=!1,c=-1,p=-1,f=r.charAt(0)==="."?"":t.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",h=this;function d(){if(u){switch(u){case"*":n+=Nr,i=!0;break;case"?":n+=Dr,i=!0;break;default:n+="\\"+u;break}h.debug("clearStateChar %j %j",u,n),u=!1}}for(var v=0,k=r.length,g;v<k&&(g=r.charAt(v));v++){if(this.debug("%s	%s %s %j",r,v,n,g),o&&an[g]){n+="\\"+g,o=!1;continue}switch(g){case"/":return!1;case"\\":d(),o=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s	%s %s %j <-- stateChar",r,v,n,g),l){this.debug("  in class"),g==="!"&&v===p+1&&(g="^"),n+=g;continue}h.debug("call clearStateChar %j",u),d(),u=g,t.noext&&d();continue;case"(":if(l){n+="(";continue}if(!u){n+="\\(";continue}a.push({type:u,start:v-1,reStart:n.length,open:on[u].open,close:on[u].close}),n+=u==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",u,n),u=!1;continue;case")":if(l||!a.length){n+="\\)";continue}d(),i=!0;var _=a.pop();n+=_.close,_.type==="!"&&s.push(_),_.reEnd=n.length;continue;case"|":if(l||!a.length||o){n+="\\|",o=!1;continue}d(),n+="|";continue;case"[":if(d(),l){n+="\\"+g;continue}l=!0,p=v,c=n.length,n+=g;continue;case"]":if(v===p+1||!l){n+="\\"+g,o=!1;continue}var T=r.substring(p+1,v);try{RegExp("["+T+"]")}catch{var S=this.parse(T,or);n=n.substr(0,c)+"\\["+S[0]+"\\]",i=i||S[1],l=!1;continue}i=!0,l=!1,n+=g;continue;default:d(),o?o=!1:an[g]&&!(g==="^"&&l)&&(n+="\\"),n+=g}}for(l&&(T=r.substr(p+1),S=this.parse(T,or),n=n.substr(0,c)+"\\["+S[0],i=i||S[1]),_=a.pop();_;_=a.pop()){var A=n.slice(_.reStart+_.open.length);this.debug("setting tail",n,_),A=A.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(D,$,je){return je||(je="\\"),$+$+je+"|"}),this.debug(`tail=%j
   %s`,A,A,_,n);var K=_.type==="*"?Nr:_.type==="?"?Dr:"\\"+_.type;i=!0,n=n.slice(0,_.reStart)+K+"\\("+A}d(),o&&(n+="\\\\");var z=!1;switch(n.charAt(0)){case"[":case".":case"(":z=!0}for(var G=s.length-1;G>-1;G--){var N=s[G],te=n.slice(0,N.reStart),b=n.slice(N.reStart,N.reEnd-8),H=n.slice(N.reEnd-8,N.reEnd),Z=n.slice(N.reEnd);H+=Z;var ee=te.split("(").length-1,W=Z;for(v=0;v<ee;v++)W=W.replace(/\)[+*?]?/,"");Z=W;var V="";Z===""&&e!==or&&(V="$");var y=te+b+Z+V+H;n=y}if(n!==""&&i&&(n="(?=.)"+n),z&&(n=f+n),e===or)return[n,i];if(!i)return oa(r);var E=t.nocase?"i":"";try{var R=new RegExp("^"+n+"$",E)}catch{return new RegExp("$.")}return R._glob=r,R._src=n,R}Q.makeRe=function(r,e){return new P(r,e||{}).makeRe()};P.prototype.makeRe=ia;function ia(){if(this.regexp||this.regexp===!1)return this.regexp;var r=this.set;if(!r.length)return this.regexp=!1,this.regexp;var e=this.options,t=e.noglobstar?Nr:e.dot?Ho:Xo,n=e.nocase?"i":"",i=r.map(function(o){return o.map(function(a){return a===Ir?t:typeof a=="string"?aa(a):a._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,n)}catch{this.regexp=!1}return this.regexp}Q.match=function(r,e,t){t=t||{};var n=new P(e,t);return r=r.filter(function(i){return n.match(i)}),n.options.nonull&&!r.length&&r.push(e),r};P.prototype.match=function(e,t){if(typeof t>"u"&&(t=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;var n=this.options;qe.sep!=="/"&&(e=e.split(qe.sep).join("/")),e=e.split(sn),this.debug(this.pattern,"split",e);var i=this.set;this.debug(this.pattern,"set",i);var o,a;for(a=e.length-1;a>=0&&(o=e[a],!o);a--);for(a=0;a<i.length;a++){var s=i[a],u=e;n.matchBase&&s.length===1&&(u=[o]);var l=this.matchOne(u,s,t);if(l)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate};P.prototype.matchOne=function(r,e,t){var n=this.options;this.debug("matchOne",{this:this,file:r,pattern:e}),this.debug("matchOne",r.length,e.length);for(var i=0,o=0,a=r.length,s=e.length;i<a&&o<s;i++,o++){this.debug("matchOne loop");var u=e[o],l=r[i];if(this.debug(e,u,l),u===!1)return!1;if(u===Ir){this.debug("GLOBSTAR",[e,u,l]);var c=i,p=o+1;if(p===s){for(this.debug("** at the end");i<a;i++)if(r[i]==="."||r[i]===".."||!n.dot&&r[i].charAt(0)===".")return!1;return!0}for(;c<a;){var f=r[c];if(this.debug(`
globstar while`,r,c,e,p,f),this.matchOne(r.slice(c),e.slice(p),t))return this.debug("globstar found match!",c,a,f),!0;if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",r,c,e,p);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(t&&(this.debug(`
>>> no match, partial?`,r,c,e,p),c===a))}var h;if(typeof u=="string"?(h=l===u,this.debug("string match",u,l,h)):(h=l.match(u),this.debug("pattern match",u,l,h)),!h)return!1}if(i===a&&o===s)return!0;if(i===a)return t;if(o===s)return i===a-1&&r[i]==="";throw new Error("wtf?")};function oa(r){return r.replace(/\\(.)/g,"$1")}function aa(r){return r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var cn=w((Su,xr)=>{typeof Object.create=="function"?xr.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:xr.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}});var fn=w((wu,jr)=>{try{if(Pr=require("util"),typeof Pr.inherits!="function")throw"";jr.exports=Pr.inherits}catch{jr.exports=cn()}var Pr});var lr=w((bu,ur)=>{"use strict";function hn(r){return r.charAt(0)==="/"}function dn(r){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,t=e.exec(r),n=t[1]||"",i=!!(n&&n.charAt(1)!==":");return!!(t[2]||i)}ur.exports=process.platform==="win32"?dn:hn;ur.exports.posix=hn;ur.exports.win32=dn});var Fr=w(ne=>{ne.alphasort=vn;ne.alphasorti=mn;ne.setopts=fa;ne.ownProp=pn;ne.makeAbs=qr;ne.finish=ha;ne.mark=da;ne.isIgnored=gn;ne.childrenIgnored=pa;function pn(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Ee=require("path"),sa=sr(),ua=lr(),Br=sa.Minimatch;function mn(r,e){return r.toLowerCase().localeCompare(e.toLowerCase())}function vn(r,e){return r.localeCompare(e)}function la(r,e){r.ignore=e.ignore||[],Array.isArray(r.ignore)||(r.ignore=[r.ignore]),r.ignore.length&&(r.ignore=r.ignore.map(ca))}function ca(r){var e=null;if(r.slice(-3)==="/**"){var t=r.replace(/(\/\*\*)+$/,"");e=new Br(t,{dot:!0})}return{matcher:new Br(r,{dot:!0}),gmatcher:e}}function fa(r,e,t){if(t||(t={}),t.matchBase&&e.indexOf("/")===-1){if(t.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}r.silent=!!t.silent,r.pattern=e,r.strict=t.strict!==!1,r.realpath=!!t.realpath,r.realpathCache=t.realpathCache||Object.create(null),r.follow=!!t.follow,r.dot=!!t.dot,r.mark=!!t.mark,r.nodir=!!t.nodir,r.nodir&&(r.mark=!0),r.sync=!!t.sync,r.nounique=!!t.nounique,r.nonull=!!t.nonull,r.nosort=!!t.nosort,r.nocase=!!t.nocase,r.stat=!!t.stat,r.noprocess=!!t.noprocess,r.maxLength=t.maxLength||1/0,r.cache=t.cache||Object.create(null),r.statCache=t.statCache||Object.create(null),r.symlinks=t.symlinks||Object.create(null),la(r,t),r.changedCwd=!1;var n=process.cwd();pn(t,"cwd")?(r.cwd=t.cwd,r.changedCwd=Ee.resolve(t.cwd)!==n):r.cwd=n,r.root=t.root||Ee.resolve(r.cwd,"/"),r.root=Ee.resolve(r.root),process.platform==="win32"&&(r.root=r.root.replace(/\\/g,"/")),r.nomount=!!t.nomount,t.nonegate=!0,t.nocomment=!0,r.minimatch=new Br(e,t),r.options=r.minimatch.options}function ha(r){for(var e=r.nounique,t=e?[]:Object.create(null),n=0,i=r.matches.length;n<i;n++){var o=r.matches[n];if(!o||Object.keys(o).length===0){if(r.nonull){var a=r.minimatch.globSet[n];e?t.push(a):t[a]=!0}}else{var s=Object.keys(o);e?t.push.apply(t,s):s.forEach(function(u){t[u]=!0})}}if(e||(t=Object.keys(t)),r.nosort||(t=t.sort(r.nocase?mn:vn)),r.mark){for(var n=0;n<t.length;n++)t[n]=r._mark(t[n]);r.nodir&&(t=t.filter(function(u){return!/\/$/.test(u)}))}r.ignore.length&&(t=t.filter(function(u){return!gn(r,u)})),r.found=t}function da(r,e){var t=qr(r,e),n=r.cache[t],i=e;if(n){var o=n==="DIR"||Array.isArray(n),a=e.slice(-1)==="/";if(o&&!a?i+="/":!o&&a&&(i=i.slice(0,-1)),i!==e){var s=qr(r,i);r.statCache[s]=r.statCache[t],r.cache[s]=r.cache[t]}}return i}function qr(r,e){var t=e;return e.charAt(0)==="/"?t=Ee.join(r.root,e):ua(e)||e===""?t=e:r.changedCwd?t=Ee.resolve(r.cwd,e):t=Ee.resolve(e),t}function gn(r,e){return r.ignore.length?r.ignore.some(function(t){return t.matcher.match(e)||!!(t.gmatcher&&t.gmatcher.match(e))}):!1}function pa(r,e){return r.ignore.length?r.ignore.some(function(t){return!!(t.gmatcher&&t.gmatcher.match(e))}):!1}});var bn=w((Tu,wn)=>{wn.exports=Sn;Sn.GlobSync=x;var Fe=require("fs"),yn=sr(),ku=yn.Minimatch,Au=$r().Glob,Ru=require("util"),Ur=require("path"),_n=require("assert"),cr=lr(),fe=Fr(),Cu=fe.alphasort,Ou=fe.alphasorti,ma=fe.setopts,Gr=fe.ownProp,va=fe.childrenIgnored;function Sn(r,e){if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);return new x(r,e).found}function x(r,e){if(!r)throw new Error("must provide pattern");if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof x))return new x(r,e);if(ma(this,r,e),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var n=0;n<t;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}x.prototype._finish=function(){if(_n(this instanceof x),this.realpath){var r=this;this.matches.forEach(function(e,t){var n=r.matches[t]=Object.create(null);for(var i in e)try{i=r._makeAbs(i);var o=Fe.realpathSync(i,r.realpathCache);n[o]=!0}catch(a){if(a.syscall==="stat")n[r._makeAbs(i)]=!0;else throw a}})}fe.finish(this)};x.prototype._process=function(r,e,t){_n(this instanceof x);for(var n=0;typeof r[n]=="string";)n++;var i;switch(n){case r.length:this._processSimple(r.join("/"),e);return;case 0:i=null;break;default:i=r.slice(0,n).join("/");break}var o=r.slice(n),a;i===null?a=".":((cr(i)||cr(r.join("/")))&&(!i||!cr(i))&&(i="/"+i),a=i);var s=this._makeAbs(a);if(!va(this,a)){var u=o[0]===yn.GLOBSTAR;u?this._processGlobStar(i,a,s,o,e,t):this._processReaddir(i,a,s,o,e,t)}};x.prototype._processReaddir=function(r,e,t,n,i,o){var a=this._readdir(t,o);if(a){for(var s=n[0],u=!!this.minimatch.negate,l=s._glob,c=this.dot||l.charAt(0)===".",p=[],f=0;f<a.length;f++){var h=a[f];if(h.charAt(0)!=="."||c){var d;u&&!r?d=!h.match(s):d=h.match(s),d&&p.push(h)}}var v=p.length;if(v!==0){if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var f=0;f<v;f++){var h=p[f];r&&(r.slice(-1)!=="/"?h=r+"/"+h:h=r+h),h.charAt(0)==="/"&&!this.nomount&&(h=Ur.join(this.root,h)),this.matches[i][h]=!0}return}n.shift();for(var f=0;f<v;f++){var h=p[f],k;r?k=[r,h]:k=[h],this._process(k.concat(n),i,o)}}}};x.prototype._emitMatch=function(r,e){var t=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),!this.matches[r][e]){if(this.nodir){var n=this.cache[this._makeAbs(e)];if(n==="DIR"||Array.isArray(n))return}this.matches[r][e]=!0,this.stat&&this._stat(e)}};x.prototype._readdirInGlobStar=function(r){if(this.follow)return this._readdir(r,!1);var e,t,n;try{t=Fe.lstatSync(r)}catch{return null}var i=t.isSymbolicLink();return this.symlinks[r]=i,!i&&!t.isDirectory()?this.cache[r]="FILE":e=this._readdir(r,!1),e};x.prototype._readdir=function(r,e){var t;if(e&&!Gr(this.symlinks,r))return this._readdirInGlobStar(r);if(Gr(this.cache,r)){var n=this.cache[r];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(r,Fe.readdirSync(r))}catch(i){return this._readdirError(r,i),null}};x.prototype._readdirEntries=function(r,e){if(!this.mark&&!this.stat)for(var t=0;t<e.length;t++){var n=e[t];r==="/"?n=r+n:n=r+"/"+n,this.cache[n]=!0}return this.cache[r]=e,e};x.prototype._readdirError=function(r,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":this.cache[this._makeAbs(r)]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=!1;break;default:if(this.cache[this._makeAbs(r)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};x.prototype._processGlobStar=function(r,e,t,n,i,o){var a=this._readdir(t,o);if(a){var s=n.slice(1),u=r?[r]:[],l=u.concat(s);this._process(l,i,!1);var c=a.length,p=this.symlinks[t];if(!(p&&o))for(var f=0;f<c;f++){var h=a[f];if(!(h.charAt(0)==="."&&!this.dot)){var d=u.concat(a[f],s);this._process(d,i,!0);var v=u.concat(a[f],n);this._process(v,i,!0)}}}};x.prototype._processSimple=function(r,e){var t=this._stat(r);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!t){if(r&&cr(r)&&!this.nomount){var n=/[\/\\]$/.test(r);r.charAt(0)==="/"?r=Ur.join(this.root,r):(r=Ur.resolve(this.root,r),n&&(r+="/"))}process.platform==="win32"&&(r=r.replace(/\\/g,"/")),this.matches[e][r]=!0}};x.prototype._stat=function(r){var e=this._makeAbs(r),t=r.slice(-1)==="/";if(r.length>this.maxLength)return!1;if(!this.stat&&Gr(this.cache,e)){var a=this.cache[e];if(Array.isArray(a)&&(a="DIR"),!t||a==="DIR")return a;if(t&&a==="FILE")return!1}var n,i=this.statCache[e];if(!i){var o;try{o=Fe.lstatSync(e)}catch{return!1}if(o.isSymbolicLink())try{i=Fe.statSync(e)}catch{i=o}else i=o}this.statCache[e]=i;var a=i.isDirectory()?"DIR":"FILE";return this.cache[e]=this.cache[e]||a,t&&a!=="DIR"?!1:a};x.prototype._mark=function(r){return fe.mark(this,r)};x.prototype._makeAbs=function(r){return fe.makeAbs(this,r)}});var zr=w((Lu,kn)=>{kn.exports=En;function En(r,e){if(r&&e)return En(r)(e);if(typeof r!="function")throw new TypeError("need wrapper function");return Object.keys(r).forEach(function(n){t[n]=r[n]}),t;function t(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=r.apply(this,n),a=n[n.length-1];return typeof o=="function"&&o!==a&&Object.keys(a).forEach(function(s){o[s]=a[s]}),o}}});var Vr=w((Mu,Wr)=>{var An=zr();Wr.exports=An(fr);Wr.exports.strict=An(Rn);fr.proto=fr(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return fr(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Rn(this)},configurable:!0})});function fr(r){var e=function(){return e.called?e.value:(e.called=!0,e.value=r.apply(this,arguments))};return e.called=!1,e}function Rn(r){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=r.apply(this,arguments)},t=r.name||"Function wrapped with `once`";return e.onceError=t+" shouldn't be called more than once",e.called=!1,e}});var On=w((Du,Cn)=>{var ga=zr(),Ue=Object.create(null),ya=Vr();Cn.exports=ga(_a);function _a(r,e){return Ue[r]?(Ue[r].push(e),null):(Ue[r]=[e],Sa(r))}function Sa(r){return ya(function e(){var t=Ue[r],n=t.length,i=wa(arguments);try{for(var o=0;o<n;o++)t[o].apply(null,i)}finally{t.length>n?(t.splice(0,n),process.nextTick(function(){e.apply(null,i)})):delete Ue[r]}})}function wa(r){for(var e=r.length,t=[],n=0;n<e;n++)t[n]=r[n];return t}});var $r=w((ju,Ln)=>{Ln.exports=me;var Ge=require("fs"),Tn=sr(),Nu=Tn.Minimatch,ba=fn(),Ea=require("events").EventEmitter,Qr=require("path"),Yr=require("assert"),hr=lr(),Hr=bn(),oe=Fr(),Iu=oe.alphasort,xu=oe.alphasorti,ka=oe.setopts,Jr=oe.ownProp,Xr=On(),Pu=require("util"),Aa=oe.childrenIgnored,Ra=oe.isIgnored,Ca=Vr();function me(r,e,t){if(typeof e=="function"&&(t=e,e={}),e||(e={}),e.sync){if(t)throw new TypeError("callback provided to sync glob");return Hr(r,e)}return new O(r,e,t)}me.sync=Hr;var Oa=me.GlobSync=Hr.GlobSync;me.glob=me;function Ta(r,e){if(e===null||typeof e!="object")return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}me.hasMagic=function(r,e){var t=Ta({},e);t.noprocess=!0;var n=new O(r,t),i=n.minimatch.set;if(i.length>1)return!0;for(var o=0;o<i[0].length;o++)if(typeof i[0][o]!="string")return!0;return!1};me.Glob=O;ba(O,Ea);function O(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&e.sync){if(t)throw new TypeError("callback provided to sync glob");return new Oa(r,e)}if(!(this instanceof O))return new O(r,e,t);ka(this,r,e),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=new Array(i),typeof t=="function"&&(t=Ca(t),this.on("error",t),this.on("end",function(s){t(null,s)}));var n=this,i=this.minimatch.set.length;if(this._processing=0,this.matches=new Array(i),this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(i===0)return a();for(var o=0;o<i;o++)this._process(this.minimatch.set[o],o,!1,a);function a(){--n._processing,n._processing<=0&&n._finish()}}O.prototype._finish=function(){if(Yr(this instanceof O),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();oe.finish(this),this.emit("end",this.found)}};O.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var r=this.matches.length;if(r===0)return this._finish();for(var e=this,t=0;t<this.matches.length;t++)this._realpathSet(t,n);function n(){--r===0&&e._finish()}};O.prototype._realpathSet=function(r,e){var t=this.matches[r];if(!t)return e();var n=Object.keys(t),i=this,o=n.length;if(o===0)return e();var a=this.matches[r]=Object.create(null);n.forEach(function(s,u){s=i._makeAbs(s),Ge.realpath(s,i.realpathCache,function(l,c){l?l.syscall==="stat"?a[s]=!0:i.emit("error",l):a[c]=!0,--o===0&&(i.matches[r]=a,e())})})};O.prototype._mark=function(r){return oe.mark(this,r)};O.prototype._makeAbs=function(r){return oe.makeAbs(this,r)};O.prototype.abort=function(){this.aborted=!0,this.emit("abort")};O.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};O.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var r=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;e<r.length;e++){var t=r[e];this._emitMatch(t[0],t[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var e=0;e<n.length;e++){var i=n[e];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}};O.prototype._process=function(r,e,t,n){if(Yr(this instanceof O),Yr(typeof n=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([r,e,t,n]);return}for(var i=0;typeof r[i]=="string";)i++;var o;switch(i){case r.length:this._processSimple(r.join("/"),e,n);return;case 0:o=null;break;default:o=r.slice(0,i).join("/");break}var a=r.slice(i),s;o===null?s=".":((hr(o)||hr(r.join("/")))&&(!o||!hr(o))&&(o="/"+o),s=o);var u=this._makeAbs(s);if(Aa(this,s))return n();var l=a[0]===Tn.GLOBSTAR;l?this._processGlobStar(o,s,u,a,e,t,n):this._processReaddir(o,s,u,a,e,t,n)}};O.prototype._processReaddir=function(r,e,t,n,i,o,a){var s=this;this._readdir(t,o,function(u,l){return s._processReaddir2(r,e,t,n,i,o,l,a)})};O.prototype._processReaddir2=function(r,e,t,n,i,o,a,s){if(!a)return s();for(var u=n[0],l=!!this.minimatch.negate,c=u._glob,p=this.dot||c.charAt(0)===".",f=[],h=0;h<a.length;h++){var d=a[h];if(d.charAt(0)!=="."||p){var v;l&&!r?v=!d.match(u):v=d.match(u),v&&f.push(d)}}var k=f.length;if(k===0)return s();if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var h=0;h<k;h++){var d=f[h];r&&(r!=="/"?d=r+"/"+d:d=r+d),d.charAt(0)==="/"&&!this.nomount&&(d=Qr.join(this.root,d)),this._emitMatch(i,d)}return s()}n.shift();for(var h=0;h<k;h++){var d=f[h],g;r&&(r!=="/"?d=r+"/"+d:d=r+d),this._process([d].concat(n),i,o,s)}s()};O.prototype._emitMatch=function(r,e){if(!this.aborted&&!this.matches[r][e]&&!Ra(this,e)){if(this.paused){this._emitQueue.push([r,e]);return}var t=this._makeAbs(e);if(this.nodir){var n=this.cache[t];if(n==="DIR"||Array.isArray(n))return}this.mark&&(e=this._mark(e)),this.matches[r][e]=!0;var i=this.statCache[t];i&&this.emit("stat",e,i),this.emit("match",e)}};O.prototype._readdirInGlobStar=function(r,e){if(this.aborted)return;if(this.follow)return this._readdir(r,!1,e);var t="lstat\0"+r,n=this,i=Xr(t,o);i&&Ge.lstat(r,i);function o(a,s){if(a)return e();var u=s.isSymbolicLink();n.symlinks[r]=u,!u&&!s.isDirectory()?(n.cache[r]="FILE",e()):n._readdir(r,!1,e)}};O.prototype._readdir=function(r,e,t){if(!this.aborted&&(t=Xr("readdir\0"+r+"\0"+e,t),!!t)){if(e&&!Jr(this.symlinks,r))return this._readdirInGlobStar(r,t);if(Jr(this.cache,r)){var n=this.cache[r];if(!n||n==="FILE")return t();if(Array.isArray(n))return t(null,n)}var i=this;Ge.readdir(r,La(this,r,t))}};function La(r,e,t){return function(n,i){n?r._readdirError(e,n,t):r._readdirEntries(e,i,t)}}O.prototype._readdirEntries=function(r,e,t){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<e.length;n++){var i=e[n];r==="/"?i=r+i:i=r+"/"+i,this.cache[i]=!0}return this.cache[r]=e,t(null,e)}};O.prototype._readdirError=function(r,e,t){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":this.cache[this._makeAbs(r)]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(r)]=!1;break;default:this.cache[this._makeAbs(r)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e);break}return t()}};O.prototype._processGlobStar=function(r,e,t,n,i,o,a){var s=this;this._readdir(t,o,function(u,l){s._processGlobStar2(r,e,t,n,i,o,l,a)})};O.prototype._processGlobStar2=function(r,e,t,n,i,o,a,s){if(!a)return s();var u=n.slice(1),l=r?[r]:[],c=l.concat(u);this._process(c,i,!1,s);var p=this.symlinks[t],f=a.length;if(p&&o)return s();for(var h=0;h<f;h++){var d=a[h];if(!(d.charAt(0)==="."&&!this.dot)){var v=l.concat(a[h],u);this._process(v,i,!0,s);var k=l.concat(a[h],n);this._process(k,i,!0,s)}}s()};O.prototype._processSimple=function(r,e,t){var n=this;this._stat(r,function(i,o){n._processSimple2(r,e,i,o,t)})};O.prototype._processSimple2=function(r,e,t,n,i){if(this.matches[e]||(this.matches[e]=Object.create(null)),!n)return i();if(r&&hr(r)&&!this.nomount){var o=/[\/\\]$/.test(r);r.charAt(0)==="/"?r=Qr.join(this.root,r):(r=Qr.resolve(this.root,r),o&&(r+="/"))}process.platform==="win32"&&(r=r.replace(/\\/g,"/")),this._emitMatch(e,r),i()};O.prototype._stat=function(r,e){var t=this._makeAbs(r),n=r.slice(-1)==="/";if(r.length>this.maxLength)return e();if(!this.stat&&Jr(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!n||i==="DIR")return e(null,i);if(n&&i==="FILE")return e()}var o,a=this.statCache[t];if(a!==void 0){if(a===!1)return e(null,a);var s=a.isDirectory()?"DIR":"FILE";return n&&s==="FILE"?e():e(null,s,a)}var u=this,l=Xr("stat\0"+t,c);l&&Ge.lstat(t,l);function c(p,f){if(f&&f.isSymbolicLink())return Ge.stat(t,function(h,d){h?u._stat2(r,t,null,f,e):u._stat2(r,t,h,d,e)});u._stat2(r,t,p,f,e)}};O.prototype._stat2=function(r,e,t,n,i){if(t)return this.statCache[e]=!1,i();var o=r.slice(-1)==="/";if(this.statCache[e]=n,e.slice(-1)==="/"&&!n.isDirectory())return i(null,!1,n);var a=n.isDirectory()?"DIR":"FILE";return this.cache[e]=this.cache[e]||a,o&&a!=="DIR"?i():i(null,a,n)}});var Pn=w((Bu,xn)=>{xn.exports=rt;rt.sync=In;var C=require("assert"),Mn=require("path"),mr=require("fs"),vr=$r(),Dn={nosort:!0,nocomment:!0,nonegate:!0,silent:!0},Kr=0,et=process.platform==="win32";function Nn(r){var e=["unlink","chmod","stat","lstat","rmdir","readdir"];e.forEach(function(t){r[t]=r[t]||mr[t],t=t+"Sync",r[t]=r[t]||mr[t]}),r.maxBusyTries=r.maxBusyTries||3,r.emfileWait=r.emfileWait||1e3,r.disableGlob=r.disableGlob||!1}function rt(r,e,t){typeof e=="function"&&(t=e,e={}),C(r,"rimraf: missing path"),C.equal(typeof r,"string","rimraf: path should be a string"),C(e,"rimraf: missing options"),C.equal(typeof e,"object","rimraf: options should be object"),C.equal(typeof t,"function","rimraf: callback function required"),Nn(e);var n=0,i=null,o=0;if(e.disableGlob||!vr.hasMagic(r))return s(null,[r]);mr.lstat(r,function(u,l){if(!u)return s(null,[r]);vr(r,Dn,s)});function a(u){i=i||u,--o===0&&t(i)}function s(u,l){if(u)return t(u);if(o=l.length,o===0)return t();l.forEach(function(c){Zr(c,e,function p(f){if(f){if(et&&(f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&n<e.maxBusyTries){n++;var h=n*100;return setTimeout(function(){Zr(c,e,p)},h)}if(f.code==="EMFILE"&&Kr<e.emfileWait)return setTimeout(function(){Zr(c,e,p)},Kr++);f.code==="ENOENT"&&(f=null)}Kr=0,a(f)})})}}function Zr(r,e,t){C(r),C(e),C(typeof t=="function"),e.lstat(r,function(n,i){if(n&&n.code==="ENOENT")return t(null);if(i&&i.isDirectory())return dr(r,e,n,t);e.unlink(r,function(o){if(o){if(o.code==="ENOENT")return t(null);if(o.code==="EPERM")return et?Ma(r,e,o,t):dr(r,e,o,t);if(o.code==="EISDIR")return dr(r,e,o,t)}return t(o)})})}function Ma(r,e,t,n){C(r),C(e),C(typeof n=="function"),t&&C(t instanceof Error),e.chmod(r,666,function(i){i?n(i.code==="ENOENT"?null:t):e.stat(r,function(o,a){o?n(o.code==="ENOENT"?null:t):a.isDirectory()?dr(r,e,t,n):e.unlink(r,n)})})}function Da(r,e,t){C(r),C(e),t&&C(t instanceof Error);try{e.chmodSync(r,666)}catch(i){if(i.code==="ENOENT")return;throw t}try{var n=e.statSync(r)}catch(i){if(i.code==="ENOENT")return;throw t}n.isDirectory()?pr(r,e,t):e.unlinkSync(r)}function dr(r,e,t,n){C(r),C(e),t&&C(t instanceof Error),C(typeof n=="function"),e.rmdir(r,function(i){i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?Na(r,e,n):i&&i.code==="ENOTDIR"?n(t):n(i)})}function Na(r,e,t){C(r),C(e),C(typeof t=="function"),e.readdir(r,function(n,i){if(n)return t(n);var o=i.length;if(o===0)return e.rmdir(r,t);var a;i.forEach(function(s){rt(Mn.join(r,s),e,function(u){if(!a){if(u)return t(a=u);--o===0&&e.rmdir(r,t)}})})})}function In(r,e){e=e||{},Nn(e),C(r,"rimraf: missing path"),C.equal(typeof r,"string","rimraf: path should be a string"),C(e,"rimraf: missing options"),C.equal(typeof e,"object","rimraf: options should be object");var t;if(e.disableGlob||!vr.hasMagic(r))t=[r];else try{mr.lstatSync(r),t=[r]}catch{t=vr.sync(r,Dn)}if(t.length)for(var n=0;n<t.length;n++){var r=t[n];try{var i=e.lstatSync(r)}catch(a){if(a.code==="ENOENT")return}try{i&&i.isDirectory()?pr(r,e,null):e.unlinkSync(r)}catch(a){if(a.code==="ENOENT")return;if(a.code==="EPERM")return et?Da(r,e,a):pr(r,e,a);if(a.code!=="EISDIR")throw a;pr(r,e,a)}}}function pr(r,e,t){C(r),C(e),t&&C(t instanceof Error);try{e.rmdirSync(r)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw t;(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")&&Ia(r,e)}}function Ia(r,e){C(r),C(e),e.readdirSync(r).forEach(function(t){In(Mn.join(r,t),e)}),e.rmdirSync(r,e)}});var Fn=w((qu,qn)=>{var $e=require("path"),jn=require("fs"),Bn=parseInt("0777",8);qn.exports=ke.mkdirp=ke.mkdirP=ke;function ke(r,e,t,n){typeof e=="function"?(t=e,e={}):(!e||typeof e!="object")&&(e={mode:e});var i=e.mode,o=e.fs||jn;i===void 0&&(i=Bn),n||(n=null);var a=t||function(){};r=$e.resolve(r),o.mkdir(r,i,function(s){if(!s)return n=n||r,a(null,n);switch(s.code){case"ENOENT":if($e.dirname(r)===r)return a(s);ke($e.dirname(r),e,function(u,l){u?a(u,l):ke(r,e,a,l)});break;default:o.stat(r,function(u,l){u||!l.isDirectory()?a(s,n):a(null,n)});break}})}ke.sync=function r(e,t,n){(!t||typeof t!="object")&&(t={mode:t});var i=t.mode,o=t.fs||jn;i===void 0&&(i=Bn),n||(n=null),e=$e.resolve(e);try{o.mkdirSync(e,i),n=n||e}catch(s){switch(s.code){case"ENOENT":n=r($e.dirname(e),t,n),r(e,t,n);break;default:var a;try{a=o.statSync(e)}catch{throw s}if(!a.isDirectory())throw s;break}}return n}});var Wn=w((Fu,zn)=>{var Ae=require("fs"),xa=Gt().ncp,Pa=require("path"),Un=Pn(),ja=Fn();zn.exports=Ba;function Ba(r,e,t,n){typeof t=="function"&&(n=t,t={});var i=!!t.mkdirp,o=t.clobber!==!1,a=t.limit||16;i?s():u();function s(){ja(Pa.dirname(e),function(l){if(l)return n(l);u()})}function u(){o?Ae.rename(r,e,function(l){if(!l)return n();if(l.code!=="EXDEV")return n(l);Gn(r,e,o,a,n)}):Ae.link(r,e,function(l){if(l){if(l.code==="EXDEV"){Gn(r,e,o,a,n);return}if(l.code==="EISDIR"||l.code==="EPERM"){$n(r,e,o,a,n);return}n(l);return}Ae.unlink(r,n)})}}function Gn(r,e,t,n,i){var o=t?"w":"wx",a=Ae.createReadStream(r),s=Ae.createWriteStream(e,{flags:o});a.on("error",function(l){a.destroy(),s.destroy(),s.removeListener("close",u),l.code==="EISDIR"||l.code==="EPERM"?$n(r,e,t,n,i):i(l)}),s.on("error",function(l){a.destroy(),s.destroy(),s.removeListener("close",u),i(l)}),s.once("close",u),a.pipe(s);function u(){Ae.unlink(r,i)}}function $n(r,e,t,n,i){var o={stopOnErr:!0,clobber:!1,limit:n};t?Un(e,{disableGlob:!0},function(s){if(s)return i(s);a()}):a();function a(){xa(r,e,o,function(s){if(s)return i(s[0]);Un(r,{disableGlob:!0},i)})}}});var Qn=w(tt=>{var Vn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");tt.encode=function(r){if(0<=r&&r<Vn.length)return Vn[r];throw new TypeError("Must be between 0 and 63: "+r)};tt.decode=function(r){var e=65,t=90,n=97,i=122,o=48,a=57,s=43,u=47,l=26,c=52;return e<=r&&r<=t?r-e:n<=r&&r<=i?r-n+l:o<=r&&r<=a?r-o+c:r==s?62:r==u?63:-1}});var ot=w(it=>{var Yn=Qn(),nt=5,Jn=1<<nt,Hn=Jn-1,Xn=Jn;function qa(r){return r<0?(-r<<1)+1:(r<<1)+0}function Fa(r){var e=(r&1)===1,t=r>>1;return e?-t:t}it.encode=function(e){var t="",n,i=qa(e);do n=i&Hn,i>>>=nt,i>0&&(n|=Xn),t+=Yn.encode(n);while(i>0);return t};it.decode=function(e,t,n){var i=e.length,o=0,a=0,s,u;do{if(t>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Yn.decode(e.charCodeAt(t++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));s=!!(u&Xn),u&=Hn,o=o+(u<<a),a+=nt}while(s);n.value=Fa(o),n.rest=t}});var Oe=w(F=>{function Ua(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}F.getArg=Ua;var Kn=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Ga=/^data:.+\,.+$/;function ze(r){var e=r.match(Kn);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}F.urlParse=ze;function Re(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}F.urlGenerate=Re;function at(r){var e=r,t=ze(r);if(t){if(!t.path)return r;e=t.path}for(var n=F.isAbsolute(e),i=e.split(/\/+/),o,a=0,s=i.length-1;s>=0;s--)o=i[s],o==="."?i.splice(s,1):o===".."?a++:a>0&&(o===""?(i.splice(s+1,a),a=0):(i.splice(s,2),a--));return e=i.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,Re(t)):e}F.normalize=at;function Zn(r,e){r===""&&(r="."),e===""&&(e=".");var t=ze(e),n=ze(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),Re(t);if(t||e.match(Ga))return e;if(n&&!n.host&&!n.path)return n.host=e,Re(n);var i=e.charAt(0)==="/"?e:at(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,Re(n)):i}F.join=Zn;F.isAbsolute=function(r){return r.charAt(0)==="/"||Kn.test(r)};function $a(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}F.relative=$a;var ei=function(){var r=Object.create(null);return!("__proto__"in r)}();function ri(r){return r}function za(r){return ti(r)?"$"+r:r}F.toSetString=ei?ri:za;function Wa(r){return ti(r)?r.slice(1):r}F.fromSetString=ei?ri:Wa;function ti(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function Va(r,e,t){var n=Ce(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:Ce(r.name,e.name)}F.compareByOriginalPositions=Va;function Qa(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=Ce(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:Ce(r.name,e.name)}F.compareByGeneratedPositionsDeflated=Qa;function Ce(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function Ya(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=Ce(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:Ce(r.name,e.name)}F.compareByGeneratedPositionsInflated=Ya;function Ja(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}F.parseSourceMapInput=Ja;function Ha(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=ze(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=Zn(Re(n),e)}return at(e)}F.computeSourceURL=Ha});var lt=w(ni=>{var st=Oe(),ut=Object.prototype.hasOwnProperty,ve=typeof Map<"u";function ae(){this._array=[],this._set=ve?new Map:Object.create(null)}ae.fromArray=function(e,t){for(var n=new ae,i=0,o=e.length;i<o;i++)n.add(e[i],t);return n};ae.prototype.size=function(){return ve?this._set.size:Object.getOwnPropertyNames(this._set).length};ae.prototype.add=function(e,t){var n=ve?e:st.toSetString(e),i=ve?this.has(e):ut.call(this._set,n),o=this._array.length;(!i||t)&&this._array.push(e),i||(ve?this._set.set(e,o):this._set[n]=o)};ae.prototype.has=function(e){if(ve)return this._set.has(e);var t=st.toSetString(e);return ut.call(this._set,t)};ae.prototype.indexOf=function(e){if(ve){var t=this._set.get(e);if(t>=0)return t}else{var n=st.toSetString(e);if(ut.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};ae.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};ae.prototype.toArray=function(){return this._array.slice()};ni.ArraySet=ae});var ai=w(oi=>{var ii=Oe();function Xa(r,e){var t=r.generatedLine,n=e.generatedLine,i=r.generatedColumn,o=e.generatedColumn;return n>t||n==t&&o>=i||ii.compareByGeneratedPositionsInflated(r,e)<=0}function gr(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}gr.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};gr.prototype.add=function(e){Xa(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};gr.prototype.toArray=function(){return this._sorted||(this._array.sort(ii.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};oi.MappingList=gr});var ct=w(si=>{var We=ot(),I=Oe(),yr=lt().ArraySet,Ka=ai().MappingList;function X(r){r||(r={}),this._file=I.getArg(r,"file",null),this._sourceRoot=I.getArg(r,"sourceRoot",null),this._skipValidation=I.getArg(r,"skipValidation",!1),this._sources=new yr,this._names=new yr,this._mappings=new Ka,this._sourcesContents=null}X.prototype._version=3;X.fromSourceMap=function(e){var t=e.sourceRoot,n=new X({file:e.file,sourceRoot:t});return e.eachMapping(function(i){var o={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(o.source=i.source,t!=null&&(o.source=I.relative(t,o.source)),o.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(o.name=i.name)),n.addMapping(o)}),e.sources.forEach(function(i){var o=i;t!==null&&(o=I.relative(t,i)),n._sources.has(o)||n._sources.add(o);var a=e.sourceContentFor(i);a!=null&&n.setSourceContent(i,a)}),n};X.prototype.addMapping=function(e){var t=I.getArg(e,"generated"),n=I.getArg(e,"original",null),i=I.getArg(e,"source",null),o=I.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,i,o),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:o})};X.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=I.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[I.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[I.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};X.prototype.applySourceMap=function(e,t,n){var i=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var o=this._sourceRoot;o!=null&&(i=I.relative(o,i));var a=new yr,s=new yr;this._mappings.unsortedForEach(function(u){if(u.source===i&&u.originalLine!=null){var l=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});l.source!=null&&(u.source=l.source,n!=null&&(u.source=I.join(n,u.source)),o!=null&&(u.source=I.relative(o,u.source)),u.originalLine=l.line,u.originalColumn=l.column,l.name!=null&&(u.name=l.name))}var c=u.source;c!=null&&!a.has(c)&&a.add(c);var p=u.name;p!=null&&!s.has(p)&&s.add(p)},this),this._sources=a,this._names=s,e.sources.forEach(function(u){var l=e.sourceContentFor(u);l!=null&&(n!=null&&(u=I.join(n,u)),o!=null&&(u=I.relative(o,u)),this.setSourceContent(u,l))},this)};X.prototype._validateMapping=function(e,t,n,i){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!i)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:i}))}};X.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,i=0,o=0,a=0,s="",u,l,c,p,f=this._mappings.toArray(),h=0,d=f.length;h<d;h++){if(l=f[h],u="",l.generatedLine!==t)for(e=0;l.generatedLine!==t;)u+=";",t++;else if(h>0){if(!I.compareByGeneratedPositionsInflated(l,f[h-1]))continue;u+=","}u+=We.encode(l.generatedColumn-e),e=l.generatedColumn,l.source!=null&&(p=this._sources.indexOf(l.source),u+=We.encode(p-a),a=p,u+=We.encode(l.originalLine-1-i),i=l.originalLine-1,u+=We.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(c=this._names.indexOf(l.name),u+=We.encode(c-o),o=c)),s+=u}return s};X.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=I.relative(t,n));var i=I.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};X.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};X.prototype.toString=function(){return JSON.stringify(this.toJSON())};si.SourceMapGenerator=X});var ui=w(ge=>{ge.GREATEST_LOWER_BOUND=1;ge.LEAST_UPPER_BOUND=2;function ft(r,e,t,n,i,o){var a=Math.floor((e-r)/2)+r,s=i(t,n[a],!0);return s===0?a:s>0?e-a>1?ft(a,e,t,n,i,o):o==ge.LEAST_UPPER_BOUND?e<n.length?e:-1:a:a-r>1?ft(r,a,t,n,i,o):o==ge.LEAST_UPPER_BOUND?a:r<0?-1:r}ge.search=function(e,t,n,i){if(t.length===0)return-1;var o=ft(-1,t.length,e,t,n,i||ge.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&n(t[o],t[o-1],!0)===0;)--o;return o}});var ci=w(li=>{function ht(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function Za(r,e){return Math.round(r+Math.random()*(e-r))}function dt(r,e,t,n){if(t<n){var i=Za(t,n),o=t-1;ht(r,i,n);for(var a=r[n],s=t;s<n;s++)e(r[s],a)<=0&&(o+=1,ht(r,o,s));ht(r,o+1,s);var u=o+1;dt(r,e,t,u-1),dt(r,e,u+1,n)}}li.quickSort=function(r,e){dt(r,e,0,r.length-1)}});var hi=w(_r=>{var m=Oe(),pt=ui(),Te=lt().ArraySet,es=ot(),Ve=ci().quickSort;function L(r,e){var t=r;return typeof r=="string"&&(t=m.parseSourceMapInput(r)),t.sections!=null?new re(t,e):new j(t,e)}L.fromSourceMap=function(r,e){return j.fromSourceMap(r,e)};L.prototype._version=3;L.prototype.__generatedMappings=null;Object.defineProperty(L.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});L.prototype.__originalMappings=null;Object.defineProperty(L.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});L.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};L.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};L.GENERATED_ORDER=1;L.ORIGINAL_ORDER=2;L.GREATEST_LOWER_BOUND=1;L.LEAST_UPPER_BOUND=2;L.prototype.eachMapping=function(e,t,n){var i=t||null,o=n||L.GENERATED_ORDER,a;switch(o){case L.GENERATED_ORDER:a=this._generatedMappings;break;case L.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;a.map(function(u){var l=u.source===null?null:this._sources.at(u.source);return l=m.computeSourceURL(s,l,this._sourceMapURL),{source:l,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,i)};L.prototype.allGeneratedPositionsFor=function(e){var t=m.getArg(e,"line"),n={source:m.getArg(e,"source"),originalLine:t,originalColumn:m.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",m.compareByOriginalPositions,pt.LEAST_UPPER_BOUND);if(o>=0){var a=this._originalMappings[o];if(e.column===void 0)for(var s=a.originalLine;a&&a.originalLine===s;)i.push({line:m.getArg(a,"generatedLine",null),column:m.getArg(a,"generatedColumn",null),lastColumn:m.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++o];else for(var u=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==u;)i.push({line:m.getArg(a,"generatedLine",null),column:m.getArg(a,"generatedColumn",null),lastColumn:m.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++o]}return i};_r.SourceMapConsumer=L;function j(r,e){var t=r;typeof r=="string"&&(t=m.parseSourceMapInput(r));var n=m.getArg(t,"version"),i=m.getArg(t,"sources"),o=m.getArg(t,"names",[]),a=m.getArg(t,"sourceRoot",null),s=m.getArg(t,"sourcesContent",null),u=m.getArg(t,"mappings"),l=m.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);a&&(a=m.normalize(a)),i=i.map(String).map(m.normalize).map(function(c){return a&&m.isAbsolute(a)&&m.isAbsolute(c)?m.relative(a,c):c}),this._names=Te.fromArray(o.map(String),!0),this._sources=Te.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(c){return m.computeSourceURL(a,c,e)}),this.sourceRoot=a,this.sourcesContent=s,this._mappings=u,this._sourceMapURL=e,this.file=l}j.prototype=Object.create(L.prototype);j.prototype.consumer=L;j.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=m.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==r)return t;return-1};j.fromSourceMap=function(e,t){var n=Object.create(j.prototype),i=n._names=Te.fromArray(e._names.toArray(),!0),o=n._sources=Te.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(h){return m.computeSourceURL(n.sourceRoot,h,t)});for(var a=e._mappings.toArray().slice(),s=n.__generatedMappings=[],u=n.__originalMappings=[],l=0,c=a.length;l<c;l++){var p=a[l],f=new fi;f.generatedLine=p.generatedLine,f.generatedColumn=p.generatedColumn,p.source&&(f.source=o.indexOf(p.source),f.originalLine=p.originalLine,f.originalColumn=p.originalColumn,p.name&&(f.name=i.indexOf(p.name)),u.push(f)),s.push(f)}return Ve(n.__originalMappings,m.compareByOriginalPositions),n};j.prototype._version=3;Object.defineProperty(j.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function fi(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}j.prototype._parseMappings=function(e,t){for(var n=1,i=0,o=0,a=0,s=0,u=0,l=e.length,c=0,p={},f={},h=[],d=[],v,k,g,_,T;c<l;)if(e.charAt(c)===";")n++,c++,i=0;else if(e.charAt(c)===",")c++;else{for(v=new fi,v.generatedLine=n,_=c;_<l&&!this._charIsMappingSeparator(e,_);_++);if(k=e.slice(c,_),g=p[k],g)c+=k.length;else{for(g=[];c<_;)es.decode(e,c,f),T=f.value,c=f.rest,g.push(T);if(g.length===2)throw new Error("Found a source, but no line and column");if(g.length===3)throw new Error("Found a source and line, but no column");p[k]=g}v.generatedColumn=i+g[0],i=v.generatedColumn,g.length>1&&(v.source=s+g[1],s+=g[1],v.originalLine=o+g[2],o=v.originalLine,v.originalLine+=1,v.originalColumn=a+g[3],a=v.originalColumn,g.length>4&&(v.name=u+g[4],u+=g[4])),d.push(v),typeof v.originalLine=="number"&&h.push(v)}Ve(d,m.compareByGeneratedPositionsDeflated),this.__generatedMappings=d,Ve(h,m.compareByOriginalPositions),this.__originalMappings=h};j.prototype._findMapping=function(e,t,n,i,o,a){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return pt.search(e,t,o,a)};j.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};j.prototype.originalPositionFor=function(e){var t={generatedLine:m.getArg(e,"line"),generatedColumn:m.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",m.compareByGeneratedPositionsDeflated,m.getArg(e,"bias",L.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var o=m.getArg(i,"source",null);o!==null&&(o=this._sources.at(o),o=m.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var a=m.getArg(i,"name",null);return a!==null&&(a=this._names.at(a)),{source:o,line:m.getArg(i,"originalLine",null),column:m.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};j.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};j.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=m.relative(this.sourceRoot,i));var o;if(this.sourceRoot!=null&&(o=m.urlParse(this.sourceRoot))){var a=i.replace(/^file:\/\//,"");if(o.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!o.path||o.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')};j.prototype.generatedPositionFor=function(e){var t=m.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:m.getArg(e,"line"),originalColumn:m.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",m.compareByOriginalPositions,m.getArg(e,"bias",L.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:m.getArg(o,"generatedLine",null),column:m.getArg(o,"generatedColumn",null),lastColumn:m.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};_r.BasicSourceMapConsumer=j;function re(r,e){var t=r;typeof r=="string"&&(t=m.parseSourceMapInput(r));var n=m.getArg(t,"version"),i=m.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Te,this._names=new Te;var o={line:-1,column:0};this._sections=i.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var s=m.getArg(a,"offset"),u=m.getArg(s,"line"),l=m.getArg(s,"column");if(u<o.line||u===o.line&&l<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");return o=s,{generatedOffset:{generatedLine:u+1,generatedColumn:l+1},consumer:new L(m.getArg(a,"map"),e)}})}re.prototype=Object.create(L.prototype);re.prototype.constructor=L;re.prototype._version=3;Object.defineProperty(re.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)r.push(this._sections[e].consumer.sources[t]);return r}});re.prototype.originalPositionFor=function(e){var t={generatedLine:m.getArg(e,"line"),generatedColumn:m.getArg(e,"column")},n=pt.search(t,this._sections,function(o,a){var s=o.generatedLine-a.generatedOffset.generatedLine;return s||o.generatedColumn-a.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};re.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};re.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],o=i.consumer.sourceContentFor(e,!0);if(o)return o}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};re.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(m.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var o={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}};re.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],o=i.consumer._generatedMappings,a=0;a<o.length;a++){var s=o[a],u=i.consumer._sources.at(s.source);u=m.computeSourceURL(i.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;s.name&&(l=i.consumer._names.at(s.name),this._names.add(l),l=this._names.indexOf(l));var c={source:u,generatedLine:s.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(i.generatedOffset.generatedLine===s.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:l};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}Ve(this.__generatedMappings,m.compareByGeneratedPositionsDeflated),Ve(this.__originalMappings,m.compareByOriginalPositions)};_r.IndexedSourceMapConsumer=re});var pi=w(di=>{var rs=ct().SourceMapGenerator,Sr=Oe(),ts=/(\r?\n)/,ns=10,Le="$$$isSourceNode$$$";function Y(r,e,t,n,i){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=t??null,this.name=i??null,this[Le]=!0,n!=null&&this.add(n)}Y.fromStringWithSourceMap=function(e,t,n){var i=new Y,o=e.split(ts),a=0,s=function(){var f=d(),h=d()||"";return f+h;function d(){return a<o.length?o[a++]:void 0}},u=1,l=0,c=null;return t.eachMapping(function(f){if(c!==null)if(u<f.generatedLine)p(c,s()),u++,l=0;else{var h=o[a]||"",d=h.substr(0,f.generatedColumn-l);o[a]=h.substr(f.generatedColumn-l),l=f.generatedColumn,p(c,d),c=f;return}for(;u<f.generatedLine;)i.add(s()),u++;if(l<f.generatedColumn){var h=o[a]||"";i.add(h.substr(0,f.generatedColumn)),o[a]=h.substr(f.generatedColumn),l=f.generatedColumn}c=f},this),a<o.length&&(c&&p(c,s()),i.add(o.splice(a).join(""))),t.sources.forEach(function(f){var h=t.sourceContentFor(f);h!=null&&(n!=null&&(f=Sr.join(n,f)),i.setSourceContent(f,h))}),i;function p(f,h){if(f===null||f.source===void 0)i.add(h);else{var d=n?Sr.join(n,f.source):f.source;i.add(new Y(f.originalLine,f.originalColumn,d,h,f.name))}}};Y.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[Le]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Y.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[Le]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Y.prototype.walk=function(e){for(var t,n=0,i=this.children.length;n<i;n++)t=this.children[n],t[Le]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};Y.prototype.join=function(e){var t,n,i=this.children.length;if(i>0){for(t=[],n=0;n<i-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this};Y.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[Le]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this};Y.prototype.setSourceContent=function(e,t){this.sourceContents[Sr.toSetString(e)]=t};Y.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Le]&&this.children[t].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),t=0,n=i.length;t<n;t++)e(Sr.fromSetString(i[t]),this.sourceContents[i[t]])};Y.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};Y.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new rs(e),i=!1,o=null,a=null,s=null,u=null;return this.walk(function(l,c){t.code+=l,c.source!==null&&c.line!==null&&c.column!==null?((o!==c.source||a!==c.line||s!==c.column||u!==c.name)&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:t.line,column:t.column},name:c.name}),o=c.source,a=c.line,s=c.column,u=c.name,i=!0):i&&(n.addMapping({generated:{line:t.line,column:t.column}}),o=null,i=!1);for(var p=0,f=l.length;p<f;p++)l.charCodeAt(p)===ns?(t.line++,t.column=0,p+1===f?(o=null,i=!1):i&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:t.line,column:t.column},name:c.name})):t.column++}),this.walkSourceContents(function(l,c){n.setSourceContent(l,c)}),{code:t.code,map:n}};di.SourceNode=Y});var mi=w(wr=>{wr.SourceMapGenerator=ct().SourceMapGenerator;wr.SourceMapConsumer=hi().SourceMapConsumer;wr.SourceNode=pi().SourceNode});var gi=w((Ku,vi)=>{var is=Object.prototype.toString,mt=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function os(r){return is.call(r).slice(8,-1)==="ArrayBuffer"}function as(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return mt?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function ss(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return mt?Buffer.from(r,e):new Buffer(r,e)}function us(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return os(r)?as(r,e,t):typeof r=="string"?ss(r,e):mt?Buffer.from(r):new Buffer(r)}vi.exports=us});var Ai=w((_e,_t)=>{var ls=mi().SourceMapConsumer,vt=require("path"),ie;try{ie=require("fs"),(!ie.existsSync||!ie.readFileSync)&&(ie=null)}catch{}var cs=gi();function yi(r,e){return r.require(e)}var _i=!1,Si=!1,gt=!1,Qe="auto",ye={},Ye={},fs=/^data:application\/json[^,]+base64,/,he=[],de=[];function St(){return Qe==="browser"?!0:Qe==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hs(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function ds(){return typeof process=="object"&&process!==null?process.version:""}function ps(){if(typeof process=="object"&&process!==null)return process.stderr}function ms(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function br(r){return function(e){for(var t=0;t<r.length;t++){var n=r[t](e);if(n)return n}return null}}var wt=br(he);he.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(n,i){return i?"":"/"})),r in ye)return ye[r];var e="";try{if(ie)ie.existsSync(r)&&(e=ie.readFileSync(r,"utf8"));else{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),t.readyState===4&&t.status===200&&(e=t.responseText)}}catch{}return ye[r]=e});function yt(r,e){if(!r)return e;var t=vt.dirname(r),n=/^\w+:\/\/[^\/]*/.exec(t),i=n?n[0]:"",o=t.slice(i.length);return i&&/^\/\w\:/.test(o)?(i+="/",i+vt.resolve(t.slice(i.length),e).replace(/\\/g,"/")):i+vt.resolve(t.slice(i.length),e)}function vs(r){var e;if(St())try{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),e=t.readyState===4?t.responseText:null;var n=t.getResponseHeader("SourceMap")||t.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=wt(r);for(var i=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,o,a;a=i.exec(e);)o=a;return o?o[1]:null}var bt=br(de);de.push(function(r){var e=vs(r);if(!e)return null;var t;if(fs.test(e)){var n=e.slice(e.indexOf(",")+1);t=cs(n,"base64").toString(),e=r}else e=yt(r,e),t=wt(e);return t?{url:e,map:t}:null});function Et(r){var e=Ye[r.source];if(!e){var t=bt(r.source);t?(e=Ye[r.source]={url:t.url,map:new ls(t.map)},e.map.sourcesContent&&e.map.sources.forEach(function(i,o){var a=e.map.sourcesContent[o];if(a){var s=yt(e.url,i);ye[s]=a}})):e=Ye[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(r);if(n.source!==null)return n.source=yt(e.url,n.source),n}return r}function bi(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var t=Et({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+t.source+":"+t.line+":"+(t.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+bi(e[2])+")":r}function gs(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var i="",o=this.getFunctionName(),a=!0,s=this.isConstructor(),u=!(this.isToplevel()||s);if(u){var l=this.getTypeName();l==="[object Object]"&&(l="null");var c=this.getMethodName();o?(l&&o.indexOf(l)!=0&&(i+=l+"."),i+=o,c&&o.indexOf("."+c)!=o.length-c.length-1&&(i+=" [as "+c+"]")):i+=l+"."+(c||"<anonymous>")}else s?i+="new "+(o||"<anonymous>"):o?i+=o:(i+=e,a=!1);return a&&(i+=" ("+e+")"),i}function wi(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=gs,e}function Ei(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),i=r.getColumnNumber()-1,o=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,a=o.test(ds())?0:62;n===1&&i>a&&!St()&&!r.isEval()&&(i-=a);var s=Et({source:t,line:n,column:i});e.curPosition=s,r=wi(r);var u=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},r.getFileName=function(){return s.source},r.getLineNumber=function(){return s.line},r.getColumnNumber=function(){return s.column+1},r.getScriptNameOrSourceURL=function(){return s.source},r}var l=r.isEval()&&r.getEvalOrigin();return l&&(l=bi(l),r=wi(r),r.getEvalOrigin=function(){return l}),r}function ys(r,e){gt&&(ye={},Ye={});for(var t=r.name||"Error",n=r.message||"",i=t+": "+n,o={nextPosition:null,curPosition:null},a=[],s=e.length-1;s>=0;s--)a.push(`
    at `+Ei(e[s],o)),o.nextPosition=o.curPosition;return o.curPosition=o.nextPosition=null,i+a.reverse().join("")}function ki(r){var e=/\n    at [^(]+ \((.*):(\d+):(\d+)\)/.exec(r.stack);if(e){var t=e[1],n=+e[2],i=+e[3],o=ye[t];if(!o&&ie&&ie.existsSync(t))try{o=ie.readFileSync(t,"utf8")}catch{o=""}if(o){var a=o.split(/(?:\r\n|\r|\n)/)[n-1];if(a)return t+":"+n+`
`+a+`
`+new Array(i).join(" ")+"^"}}return null}function _s(r){var e=ki(r),t=ps();t&&t._handle&&t._handle.setBlocking&&t._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),ms(1)}function Ss(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return _s(arguments[1])}return r.apply(this,arguments)}}var ws=he.slice(0),bs=de.slice(0);_e.wrapCallSite=Ei;_e.getErrorSource=ki;_e.mapSourcePosition=Et;_e.retrieveSourceMap=bt;_e.install=function(r){if(r=r||{},r.environment&&(Qe=r.environment,["node","browser","auto"].indexOf(Qe)===-1))throw new Error("environment "+Qe+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(he.length=0),he.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(de.length=0),de.unshift(r.retrieveSourceMap)),r.hookRequire&&!St()){var e=yi(_t,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(o,a){return ye[a]=o,Ye[a]=void 0,t.call(this,o,a)},e.prototype._compile.__sourceMapSupport=!0)}if(gt||(gt="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),_i||(_i=!0,Error.prepareStackTrace=ys),!Si){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var i=yi(_t,"worker_threads");i.isMainThread===!1&&(n=!1)}catch{}n&&hs()&&(Si=!0,Ss())}};_e.resetRetrieveHandlers=function(){he.length=0,de.length=0,he=ws.slice(0),de=bs.slice(0),bt=br(de),wt=br(he)}});var Ii=w((el,q)=>{var Es="1.8.15",Ci=0,De=function(e){var t=["XXX: "+e].concat(Array.prototype.slice.call(arguments,1));console.error.apply(this,t)},De=function(){},we;typeof process<"u"&&process.versions&&(process.versions.nw?we="nw":process.versions.node&&(we="node"));!we&&typeof window<"u"&&window.window===window&&(we="browser");if(!we)throw new Error("unknown runtime environment");var Er,se,Me;if(we==="browser")Er={hostname:function(){return window.location.host}},se={},Me=null;else{Er=require("os"),se=require("fs");try{Me=require("dtrace-provider")}catch{Me=null}}var le=require("util"),ue=require("assert"),Ze=require("events").EventEmitter,ks=require("stream");try{He=Ft()}catch{He=null}var He;process.env.BUNYAN_TEST_NO_SAFE_JSON_STRINGIFY&&(He=null);try{Xe=Wn()}catch{Xe=null}var Xe;try{kr=Ai()}catch{kr=null}var kr;function Se(r){if(r==null)return r;if(Array.isArray(r))return r.slice();if(typeof r=="object"){var e={};return Object.keys(r).forEach(function(t){e[t]=r[t]}),e}else return r}var B=le.format;B||(kt=le.inspect,Ri=/%[sdj%]/g,B=function(e){if(typeof e!="string"){for(var t=[],n=0;n<arguments.length;n++)t.push(kt(arguments[n]));return t.join(" ")}for(var n=1,i=arguments,o=i.length,a=String(e).replace(Ri,function(u){if(n>=o)return u;switch(u){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":return Ni(i[n++]);case"%%":return"%";default:return u}}),s=i[n];n<o;s=i[++n])s===null||typeof s!="object"?a+=" "+s:a+=" "+kt(s);return a});var kt,Ri;function Ct(){if(this!==void 0){var r={},e=Error.stackTraceLimit,t=Error.prepareStackTrace;return Error.stackTraceLimit=3,Error.prepareStackTrace=function(n,i){var o=i[2];kr&&(o=kr.wrapCallSite(o)),r.file=o.getFileName(),r.line=o.getLineNumber();var a=o.getFunctionName();a&&(r.func=a)},Error.captureStackTrace(this,Ct),this.stack,Error.stackTraceLimit=e,Error.prepareStackTrace=t,r}}function As(r,e){e||(e="    ");var t=r.split(/\r?\n/g);return e+t.join(`
`+e)}function Ot(r,e){if(ue.ok(r),e){if(At[e])return;At[e]=!0}process.stderr.write(r+`
`)}function Rs(r){return At[r]}var At={};function Oi(){}Oi.prototype.write=function(r){r.level<er?console.log(r):r.level<Ar?console.info(r):r.level<Rr?console.warn(r):console.error(r)};var Tt=10,Lt=20,er=30,Ar=40,Rr=50,Mt=60,Ne={trace:Tt,debug:Lt,info:er,warn:Ar,error:Rr,fatal:Mt},Ti={};Object.keys(Ne).forEach(function(r){Ti[Ne[r]]=r});var Je=void 0,Rt=Me&&{};function Ke(r){var e,t=typeof r;if(t==="string"){if(e=Ne[r.toLowerCase()],!e)throw new Error(B('unknown level name: "%s"',r))}else{if(t!=="number")throw new TypeError(B("cannot resolve level: invalid arg (%s):",t,r));if(r<0||Math.floor(r)!==r)throw new TypeError(B("level is not a positive integer: %s",r));e=r}return e}function Cs(r){return r instanceof ks.Writable?!0:typeof r.write=="function"}function M(r,e,t){if(De("Logger start:",r),!(this instanceof M))return new M(r,e);var n;if(e!==void 0&&(n=r,r=e,!(n instanceof M)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!r)throw new TypeError("options (object) is required");if(n){if(r.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!r.name)throw new TypeError("options.name (string) is required");if(r.stream&&r.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(r.streams&&!Array.isArray(r.streams))throw new TypeError("invalid options.streams: must be an array");if(r.serializers&&(typeof r.serializers!="object"||Array.isArray(r.serializers)))throw new TypeError("invalid options.serializers: must be an object");if(Ze.call(this),n&&t){this._isSimpleChild=!0,this._level=n._level,this.streams=n.streams,this.serializers=n.serializers,this.src=n.src;for(var f=this.fields={},i=Object.keys(n.fields),o=0;o<i.length;o++){var a=i[o];f[a]=n.fields[a]}for(var s=Object.keys(r),o=0;o<s.length;o++){var a=s[o];f[a]=r[a]}return}var u=this;if(n){this._level=n._level,this.streams=[];for(var o=0;o<n.streams.length;o++){var l=Se(n.streams[o]);l.closeOnExit=!1,this.streams.push(l)}this.serializers=Se(n.serializers),this.src=n.src,this.fields=Se(n.fields),r.level&&this.level(r.level)}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};if(!Je&&Me){Je=Me.createDTraceProvider("bunyan");for(var c in Ne){var p;Rt[Ne[c]]=p=Je.addProbe("log-"+c,"char *"),p.dtp=Je}Je.enable()}r.stream?u.addStream({type:"stream",stream:r.stream,closeOnExit:!1,level:r.level}):r.streams?r.streams.forEach(function(h){u.addStream(h,r.level)}):n&&r.level?this.level(r.level):n||(we==="browser"?u.addStream({type:"raw",stream:new Oi,closeOnExit:!1,level:r.level}):u.addStream({type:"stream",stream:process.stdout,closeOnExit:!1,level:r.level})),r.serializers&&u.addSerializers(r.serializers),r.src&&(this.src=!0),De("Logger: ",u);var f=Se(r);delete f.stream,delete f.level,delete f.streams,delete f.serializers,delete f.src,this.serializers&&this._applySerializers(f),!f.hostname&&!u.fields.hostname&&(f.hostname=Er.hostname()),f.pid||(f.pid=process.pid),Object.keys(f).forEach(function(h){u.fields[h]=f[h]})}le.inherits(M,Ze);M.prototype.addStream=function(e,t){var n=this;switch(t==null&&(t=er),e=Se(e),e.type||(e.stream?e.type="stream":e.path&&(e.type="file")),e.raw=e.type==="raw",e.level!==void 0?e.level=Ke(e.level):e.level=Ke(t),e.level<n._level&&(n._level=e.level),e.type){case"stream":ue.ok(Cs(e.stream),'"stream" stream is not writable: '+le.inspect(e.stream)),e.closeOnExit||(e.closeOnExit=!1);break;case"file":e.reemitErrorEvents===void 0&&(e.reemitErrorEvents=!0),e.stream?e.closeOnExit||(e.closeOnExit=!1):(e.stream=se.createWriteStream(e.path,{flags:"a",encoding:"utf8"}),e.closeOnExit||(e.closeOnExit=!0));break;case"rotating-file":ue.ok(!e.stream,'"rotating-file" stream should not give a "stream"'),ue.ok(e.path),ue.ok(Xe,'"rotating-file" stream type is not supported: missing "mv" module'),e.stream=new J(e),e.closeOnExit||(e.closeOnExit=!0);break;case"raw":e.closeOnExit||(e.closeOnExit=!1);break;default:throw new TypeError('unknown stream type "'+e.type+'"')}e.reemitErrorEvents&&typeof e.stream.on=="function"&&e.stream.on("error",function(o){n.emit("error",o,e)}),n.streams.push(e),delete n.haveNonRawStreams};M.prototype.addSerializers=function(e){var t=this;t.serializers||(t.serializers={}),Object.keys(e).forEach(function(n){var i=e[n];if(typeof i!="function")throw new TypeError(B('invalid serializer for "%s" field: must be a function',n));t.serializers[n]=i})};M.prototype.child=function(r,e){return new this.constructor(this,r||{},e)};M.prototype.reopenFileStreams=function(){var r=this;r.streams.forEach(function(e){e.type==="file"&&(e.stream&&(e.stream.end(),e.stream.destroySoon(),delete e.stream),e.stream=se.createWriteStream(e.path,{flags:"a",encoding:"utf8"}),e.stream.on("error",function(t){r.emit("error",t,e)}))})};M.prototype.level=function(e){if(e===void 0)return this._level;for(var t=Ke(e),n=this.streams.length,i=0;i<n;i++)this.streams[i].level=t;this._level=t};M.prototype.levels=function(e,t){if(e===void 0)return ue.equal(t,void 0),this.streams.map(function(u){return u.level});var n;if(typeof e=="number"){if(n=this.streams[e],n===void 0)throw new Error("invalid stream index: "+e)}else{for(var i=this.streams.length,o=0;o<i;o++){var a=this.streams[o];if(a.name===e){n=a;break}}if(!n)throw new Error(B('no stream with name "%s"',e))}if(t===void 0)return n.level;var s=Ke(t);n.level=s,s<this._level&&(this._level=s)};M.prototype._applySerializers=function(r,e){var t=this;De("_applySerializers: excludeFields",e),Object.keys(this.serializers).forEach(function(n){if(!(r[n]===void 0||e&&e[n])){De('_applySerializers; apply to "%s" key',n);try{r[n]=t.serializers[n](r[n])}catch(i){Ot(B(`bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bug in that serializer function.
%s`,n,i.stack||i)),r[n]=B('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',n)}}})};M.prototype._emit=function(r,e){var t;if(this.haveNonRawStreams===void 0){for(this.haveNonRawStreams=!1,t=0;t<this.streams.length;t++)if(!this.streams[t].raw){this.haveNonRawStreams=!0;break}}var n;if((e||this.haveNonRawStreams)&&(n=Ni(r)+Er.EOL),e)return n;var i=r.level;for(t=0;t<this.streams.length;t++){var o=this.streams[t];o.level<=i&&(De('writing log rec "%s" to "%s" stream (%d <= %d): %j',r.msg,o.type,o.level,i,r),o.stream.write(o.raw?r:n))}return n};function Li(r,e,t){var n,i,o;t[0]instanceof Error?(i={err:r.serializers&&r.serializers.err?r.serializers.err(t[0]):M.stdSerializers.err(t[0])},n={err:!0},t.length===1?o=[i.err.message]:o=t.slice(1)):typeof t[0]!="object"||Array.isArray(t[0])?(i=null,o=t.slice()):Buffer.isBuffer(t[0])?(i=null,o=t.slice(),o[0]=le.inspect(o[0])):(i=t[0],i&&t.length===1&&i.err&&i.err instanceof Error?o=[i.err.message]:o=t.slice(1));var a=Se(r.fields),s=a.level=e,u=i?Se(i):null;return u&&(r.serializers&&r._applySerializers(u,n),Object.keys(u).forEach(function(l){a[l]=u[l]})),a.msg=B.apply(r,o),a.time||(a.time=new Date),r.src&&!a.src&&(a.src=Ct()),a.v=Ci,a}function Os(r,e,t,n){return[r||e._emit(Li(e,t,n),!0)]}function Ie(r){return function(){var e=this,t=null,n=null;if(this._emit){if(arguments.length===0)return this._level<=r}else{var i="unbound";if(!Rs[i]){var o=Ct();Ot(B("bunyan usage error: %s:%s: attempt to log with an unbound log method: `this` is: %s",o.file,o.line,le.inspect(this)),i)}return}for(var a=new Array(arguments.length),s=0;s<a.length;++s)a[s]=arguments[s];this._level<=r&&(n=Li(e,r,a),t=this._emit(n)),Rt&&Rt[r].fire(Os,t,e,r,a)}}M.prototype.trace=Ie(Tt);M.prototype.debug=Ie(Lt);M.prototype.info=Ie(er);M.prototype.warn=Ie(Ar);M.prototype.error=Ie(Rr);M.prototype.fatal=Ie(Mt);M.stdSerializers={};M.stdSerializers.req=function(r){return!r||!r.connection?r:{method:r.method,url:r.originalUrl||r.url,headers:r.headers,remoteAddress:r.connection.remoteAddress,remotePort:r.connection.remotePort}};M.stdSerializers.res=function(r){return!r||!r.statusCode?r:{statusCode:r.statusCode,header:r._header}};function Mi(r){var e=r.stack||r.toString();if(r.cause&&typeof r.cause=="function"){var t=r.cause();t&&(e+=`
Caused by: `+Mi(t))}return e}var Zu=M.stdSerializers.err=function(r){if(!r||!r.stack)return r;var e={message:r.message,name:r.name,stack:Mi(r),code:r.code,signal:r.signal};return e};function Ts(){var r=new Set;return function(e,t){return!t||typeof t!="object"?t:r.has(t)?"[Circular]":(r.add(t),t)}}function Ls(){var r=[];return function(e,t){return!t||typeof t!="object"?t:r.indexOf(t)!==-1?"[Circular]":(r.push(t),t)}}var Di=typeof Set<"u"?Ts:Ls;function Ni(r){try{return JSON.stringify(r)}catch{try{return JSON.stringify(r,Di())}catch(n){if(He)return He(r);var e=n.stack.split(/\n/g,3).join(`
`);return Ot('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+As(B(`%s
%s`,le.inspect(r),n.stack)),e),B("(Exception in JSON.stringify(rec): %j. See stderr for details.)",n.message)}}}var J=null;Xe&&(J=function(e){if(this.path=e.path,this.count=e.count==null?10:e.count,ue.equal(typeof this.count,"number",B('rotating-file stream "count" is not a number: %j (%s) in %j',this.count,typeof this.count,this)),ue.ok(this.count>=0,B('rotating-file stream "count" is not >= 0: %j in %j',this.count,this)),e.period){var t={hourly:"1h",daily:"1d",weekly:"1w",monthly:"1m",yearly:"1y"}[e.period]||e.period,n=/^([1-9][0-9]*)([hdwmy]|ms)$/.exec(t);if(!n)throw new Error(B('invalid period: "%s"',e.period));this.periodNum=Number(n[1]),this.periodScope=n[2]}else this.periodNum=1,this.periodScope="d";var i=null;try{var o=se.statSync(this.path);i=o.mtime.getTime()}catch{}var a=!1;if(i){var s=this._calcRotTime(0);i<s&&(a=!0)}this.stream=se.createWriteStream(this.path,{flags:"a",encoding:"utf8"}),this.rotQueue=[],this.rotating=!1,a?(this._debug("rotateAfterOpen -> call rotate()"),this.rotate()):this._setupNextRot()},le.inherits(J,Ze),J.prototype._debug=function(){if(0)var r;else return!1},J.prototype._setupNextRot=function(){this.rotAt=this._calcRotTime(1),this._setRotationTimer()},J.prototype._setRotationTimer=function(){var r=this,e=this.rotAt-Date.now(),t=2147483647;e>t&&(e=t),this.timeout=setTimeout(function(){r._debug("_setRotationTimer timeout -> call rotate()"),r.rotate()},e),typeof this.timeout.unref=="function"&&this.timeout.unref()},J.prototype._calcRotTime=function(e){this._debug("_calcRotTime: %s%s",this.periodNum,this.periodScope);var t=new Date;this._debug("  now local: %s",t),this._debug("    now utc: %s",t.toISOString());var n;switch(this.periodScope){case"ms":this.rotAt?n=this.rotAt+this.periodNum*e:n=Date.now()+this.periodNum*e;break;case"h":this.rotAt?n=this.rotAt+this.periodNum*60*60*1e3*e:n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()+e);break;case"d":this.rotAt?n=this.rotAt+this.periodNum*24*60*60*1e3*e:n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+e);break;case"w":if(this.rotAt)n=this.rotAt+this.periodNum*7*24*60*60*1e3*e;else{var i=7-t.getUTCDay();e<1&&(i=-t.getUTCDay()),(e>1||e<-1)&&(i+=7*e),n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+i)}break;case"m":this.rotAt?n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+this.periodNum*e,1):n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+e,1);break;case"y":this.rotAt?n=Date.UTC(t.getUTCFullYear()+this.periodNum*e,0,1):n=Date.UTC(t.getUTCFullYear()+e,0,1);break;default:ue.fail(B('invalid period scope: "%s"',this.periodScope))}if(this._debug()){this._debug("  **rotAt**: %s (utc: %s)",n,new Date(n).toUTCString());var o=Date.now();this._debug("        now: %s (%sms == %smin == %sh to go)",o,n-o,(n-o)/1e3/60,(n-o)/1e3/60/60)}return n},J.prototype.rotate=function(){var e=this;if(e.rotAt&&e.rotAt>Date.now())return e._setRotationTimer();if(this._debug("rotate"),e.rotating)throw new TypeError("cannot start a rotation when already rotating");e.rotating=!0,e.stream.end();function t(){var a=e.path+"."+String(o-1);o===0&&(a=e.path),o-=1,e._debug("  rm %s",a),se.unlink(a,function(s){n()})}function n(){if(e.count===0||o<0)return i();var a=e.path,s=e.path+"."+String(o);o>0&&(a+="."+String(o-1)),o-=1,se.exists(a,function(u){u?(e._debug("  mv %s %s",a,s),Xe(a,s,function(l){l?(e.emit("error",l),i()):n()})):n()})}function i(){e._debug("  open %s",e.path),e.stream=se.createWriteStream(e.path,{flags:"a",encoding:"utf8"});for(var a=e.rotQueue,s=a.length,u=0;u<s;u++)e.stream.write(a[u]);e.rotQueue=[],e.rotating=!1,e.emit("drain"),e._setupNextRot()}var o=this.count;t()},J.prototype.write=function(e){return this.rotating?(this.rotQueue.push(e),!1):this.stream.write(e)},J.prototype.end=function(e){this.stream.end()},J.prototype.destroy=function(e){this.stream.destroy()},J.prototype.destroySoon=function(e){this.stream.destroySoon()});function xe(r){this.limit=r&&r.limit?r.limit:100,this.writable=!0,this.records=[],Ze.call(this)}le.inherits(xe,Ze);xe.prototype.write=function(r){if(!this.writable)throw new Error("RingBuffer has been ended already");return this.records.push(r),this.records.length>this.limit&&this.records.shift(),!0};xe.prototype.end=function(){arguments.length>0&&this.write.apply(this,Array.prototype.slice.call(arguments)),this.writable=!1};xe.prototype.destroy=function(){this.writable=!1,this.emit("close")};xe.prototype.destroySoon=function(){this.destroy()};q.exports=M;q.exports.TRACE=Tt;q.exports.DEBUG=Lt;q.exports.INFO=er;q.exports.WARN=Ar;q.exports.ERROR=Rr;q.exports.FATAL=Mt;q.exports.resolveLevel=Ke;q.exports.levelFromName=Ne;q.exports.nameFromLevel=Ti;q.exports.VERSION=Es;q.exports.LOG_VERSION=Ci;q.exports.createLogger=function(e){return new M(e)};q.exports.RingBuffer=xe;q.exports.RotatingFileStream=J;q.exports.safeCycles=Di});var Pi=w((rl,xi)=>{var Ms=Object.prototype.hasOwnProperty,Ds=Object.prototype.toString,Ns=function(r){var e=typeof r=="function"&&!(r instanceof RegExp)||Ds.call(r)==="[object Function]";return!e&&typeof window<"u"&&(e=r===window.setTimeout||r===window.alert||r===window.confirm||r===window.prompt),e};xi.exports=function(e,t){if(!Ns(t))throw new TypeError("iterator must be a function");var n,i,o=typeof e=="string",a=e.length,s=arguments.length>2?arguments[2]:null;if(a===+a)for(n=0;n<a;n++)s===null?t(o?e.charAt(n):e[n],n,e):t.call(s,o?e.charAt(n):e[n],n,e);else for(i in e)Ms.call(e,i)&&(s===null?t(e[i],i,e):t.call(s,e[i],i,e))}});var qi=w((tl,Bi)=>{var ji=Object.prototype.toString;Bi.exports=function(e){var t=ji.call(e),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&ji.call(e.callee)==="[object Function]"),n}});var Ui=w((nl,Fi)=>{(function(){"use strict";var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Pi(),n=qi(),i=!{toString:null}.propertyIsEnumerable("toString"),o=function(){}.propertyIsEnumerable("prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s;s=function(l){var c=l!==null&&typeof l=="object",p=e.call(l)==="[object Function]",f=n(l),h=[];if(!c&&!p&&!f)throw new TypeError("Object.keys called on a non-object");if(f)t(l,function(_){h.push(_)});else{var d,v=o&&p;for(d in l)!(v&&d==="prototype")&&r.call(l,d)&&h.push(d)}if(i){var k=l.constructor,g=k&&k.prototype===l;t(a,function(_){!(g&&_==="constructor")&&r.call(l,_)&&h.push(_)})}return h},Fi.exports=s})()});var $i=w((il,Gi)=>{Gi.exports=Object.keys||Ui()});var Wi=w((ol,zi)=>{zi.exports=Is;function Is(r){return r!==null&&(typeof r=="object"||typeof r=="function")}});var Dt=w((al,Vi)=>{var xs=$i(),Ps=Wi();Vi.exports=js;function js(){for(var r={},e=0;e<arguments.length;e++){var t=arguments[e];if(Ps(t))for(var n=xs(t),i=0;i<n.length;i++){var o=n[i];r[o]=t[o]}}return r}});var Hi=w((sl,Ji)=>{"use strict";var Qi={white:37,black:30,blue:34,cyan:36,green:32,magenta:35,red:31,yellow:33,brightBlack:90,brightRed:91,brightGreen:92,brightYellow:93,brightBlue:94,brightMagenta:95,brightCyan:96,brightWhite:97},Yi={bgBlack:40,bgRed:41,bgGreen:42,bgYellow:43,bgBlue:44,bgMagenta:45,bgCyan:46,bgWhite:47,bgBrightBlack:100,bgBrightRed:101,bgBrightGreen:102,bgBrightYellow:103,bgBrightBlue:104,bgBrightMagenta:105,bgBrightCyan:106,bgBrightWhite:107},Nt={};Object.keys(Qi).forEach(function(r){Nt[r]=function(e){return"\x1B["+Qi[r]+"m"+e+"\x1B[39m"}});Object.keys(Yi).forEach(function(r){Nt[r]=function(e){return"\x1B["+Yi[r]+"m"+e+"\x1B[49m"}});Ji.exports=Nt});var Zi=w((ul,Ki)=>{"use strict";var It={reset:[0,22],bright:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],blink:[5,25],inverse:[7,27]},Xi={};Object.keys(It).forEach(function(r){Xi[r]=function(e){var t=It[r][0],n=It[r][1];return"\x1B["+t+"m"+e+"\x1B["+n+"m"}});Ki.exports=Xi});var So=w((ll,_o)=>{"use strict";var no=require("util"),pe=no.format,Bs=require("http"),qs=Dt(),Fs=Hi(),Us=Zi(),Gs=qs(Us,Fs),io=1,oo=2,ao=3,so=4,uo=5,lo=6,$s={long:io,json:oo,inspect:ao,simple:so,short:uo,bunyan:lo},co=10,fo=20,ho=30,po=40,mo=50,vo=60,eo={trace:co,debug:fo,info:ho,warn:po,error:mo,fatal:vo},zs={},go={},yo={};Object.keys(eo).forEach(function(r){var e=eo[r];zs[e]=r,go[e]=r.toUpperCase(),yo[e]=(r.length===4?" ":"")+r.toUpperCase()});function ro(r){return!(r.v===null||r.level===null||r.name===null||r.hostname===null||r.pid===null||r.time===null||r.msg===null)}function Pe(r){return"  "+r.split(/\r?\n/).join(`
  `)}function Ws(r,e){if(!r)return"";var t=Gs[e];return t?t(r):r}function Vs(r,e){return r}function to(r){switch(r){case co:return"TRACE";case fo:return"DEBUG";case ho:return"INFO";case po:return"WARN";case mo:return"ERROR";case vo:return"FATAL"}}_o.exports=function(e,t){function n(b){var H="";if(b.header)H+=b.header.trimRight();else if(b.headers){b.statusCode&&(H+=pe(`HTTP/1.1 %s %s
`,b.statusCode,Bs.STATUS_CODES[b.statusCode]));var Z=b.headers;H+=Object.keys(Z).map(function(ee){return ee+": "+Z[ee]}).join(`
`)}delete b.header,delete b.headers,delete b.statusCode,b.body&&(H+=`

`+(typeof b.body=="object"?JSON.stringify(b.body,null,2):b.body),delete b.body),b.trailer&&(H+=`
`+b.trailer),delete b.trailer,H&&_.push(Pe(H)),Object.keys(b).forEach(function(ee){e["res."+ee]=b[ee]})}var i=!1,o,a=e.line,s=t.color?Ws:Vs,u=isNaN(t.outputMode)?$s[t.outputMode]:t.outputMode;switch(u){case uo:i=!0;case io:if(!ro(e))return a+`
`;delete e.v,i&&e.time[10]=="T"?(o=e.time.substr(11),o=s(o,"brightBlack")):o=s("["+e.time+"]","brightBlack"),delete e.time;var l=e.name;delete e.name,e.component&&(l+="/"+e.component),delete e.component,i||(l+="/"+e.pid),delete e.pid;var c=yo[e.level]||"LVL"+e.level;if(t.color){var p=t.colorFromLevel||{10:"brightBlack",20:"brightBlack",30:"cyan",40:"magenta",50:"red",60:"inverse"};c=s(c,p[e.level])}delete e.level;var f="",h,d,v="";e.src&&e.src.file&&(h=e.src,h.func?f=pe(" (%s:%d in %s)",h.file,h.line,h.func):f=pe(" (%s:%d)",h.file,h.line),f=s(f,"green")),delete e.src;var k=e.hostname;delete e.hostname;var g=[],_=[];e.req_id&&g.push("req_id="+e.req_id),delete e.req_id;var T;if(e.msg.indexOf(`
`)!==-1?(T="",_.push(Pe(s(e.msg,"cyan")))):T=" "+s(e.msg,"cyan"),delete e.msg,e.req&&typeof e.req=="object"){var S=e.req;delete e.req,d=S.headers,h=pe("%s %s HTTP/%s%s",S.method,S.url,S.httpVersion||"1.1",d?`
`+Object.keys(d).map(function(b){return b+": "+d[b]}).join(`
`):""),delete S.url,delete S.method,delete S.httpVersion,delete S.headers,S.body&&(h+=`

`+(typeof S.body=="object"?JSON.stringify(S.body,null,2):S.body),delete S.body),S.trailers&&Object.keys(S.trailers)>0&&(h+=`
`+Object.keys(S.trailers).map(function(b){return b+": "+S.trailers[b]}).join(`
`)),delete S.trailers,_.push(Pe(h)),Object.keys(S).forEach(function(b){e["req."+b]=S[b]})}if(e.client_req&&typeof e.client_req=="object"){var A=e.client_req;delete e.client_req,d=A.headers,h="",A.address&&(v="Host: "+A.address,A.port&&(v+=":"+A.port),v+=`
`),delete A.headers,delete A.address,delete A.port,h+=pe(`%s %s HTTP/%s
%s%s`,A.method,A.url,A.httpVersion||"1.1",v,d?Object.keys(d).map(function(b){return b+": "+d[b]}).join(`
`):""),delete A.method,delete A.url,delete A.httpVersion,A.body&&(h+=`

`+(typeof A.body=="object"?JSON.stringify(A.body,null,2):A.body),delete A.body),Object.keys(A).forEach(function(b){e["client_req."+b]=A[b]}),_.push(Pe(h))}e.res&&typeof e.res=="object"&&(n(e.res),delete e.res),e.client_res&&typeof e.client_res=="object"&&(n(e.client_res),delete e.res),e.err&&e.err.stack&&(_.push(Pe(e.err.stack)),delete e.err);for(var K=Object.keys(e),z=0;z<K.length;z++){var G=K[z],N=e[G],te=!1;typeof N!="string"&&(N=JSON.stringify(N,null,2),te=!0),N.indexOf(`
`)!==-1||N.length>50?_.push(Pe(G+": "+N)):!te&&(N.indexOf(" ")!=-1||N.length===0)?g.push(G+"="+JSON.stringify(N)):g.push(G+"="+N)}return g=s(g.length?" ("+g.join(", ")+")":"","brightBlack"),_=s(_.length?_.join(`
  --
`)+`
`:"","brightBlack"),i?pe(`%s %s %s:%s%s
%s`,o,c,l,T,g,_):pe(`%s %s: %s on %s%s:%s%s
%s`,o,c,l,k||"<no-hostname>",f,T,g,_);case ao:return no.inspect(e,!1,1/0,!0)+`
`;case lo:return t.levelInString&&(e.level=to(e.level)),JSON.stringify(e,null,0)+`
`;case oo:return t.levelInString&&(e.level=to(e.level)),JSON.stringify(e,null,t.jsonIndent)+`
`;case so:return ro(e)?pe(`%s - %s
`,go[e.level]||"LVL"+e.level,e.msg):a+`
`;default:throw new Error("unknown output mode: "+t.outputMode)}}});var Eo=w((cl,bo)=>{"use strict";var Qs=require("stream"),Ys=require("util"),Js=So(),Hs=Dt(),wo=Qs.Writable;bo.exports=rr;Ys.inherits(rr,wo);function rr(r,e){if(!(this instanceof rr))return new rr(r,e);r=r||{},r.objectMode=!0,wo.call(this,r),this.opts=Hs({outputMode:"short",color:!0,colorFromLevel:{10:"brightBlack",20:"brightBlack",30:"green",40:"magenta",50:"red",60:"brightRed"}},r),this.out=e||process.stdout}rr.prototype._write=function(r,e,t){var n;try{n=JSON.parse(r),this.out.write(Js(n,this.opts))}catch{this.out.write(r)}t()}});var cu={};Po(cu,{default:()=>Or});module.exports=jo(cu);var jt={createShowMoreHtml:(r,e)=>{let t=r?r.replace(/"/g,"'"):"";return`<div class="dpr-show-more" data-content="${t}" data-dpr-module="show-more" data-length="${e||100}">
      <div class='dpr-show-more-content'>${t}</div><a class="dpr-show-hide-button govuk-link--no-visited-state" href="#">show more</a>
  </div>`}};var ko=Pt(Ii()),Ao=Pt(Eo()),Xs=(0,Ao.default)({outputMode:"short",color:!1}),Ks=ko.default.createLogger({name:"Digital Prison Reporting:",stream:Xs,level:"debug"}),Cr=Ks;var Ro={getCurrentVariantDefinition:(r,e,t)=>{if(!r){Cr.info("No definitions");return}let n,i=r.find(o=>o.id===e);return i&&(n=i.variants.find(o=>t===o.id)),n||void 0},getFieldDisplayName:(r,e)=>{let t=e.split("."),n=r.find(i=>i.name===t[0]);return n?t[1]?`${n.display} ${t[1]}`:n.display:e},getField:(r,e)=>r.find(t=>t.name===e),getReportSummary:async(r,e,t,n)=>(await e.getDefinitions(t,n)).find(o=>o.id===r)};var Zs=r=>{let e=r.locals.csrfToken||"csrfToken",t=r.locals.user?.uuid?r.locals.user.uuid:"userId",n=r.locals.user?.token?r.locals.user.token:"token",i=r.locals.user?.activeCaseLoadId||"",o=r.locals.pathSuffix||"",a=r.locals.routePrefix||"",s=r.locals.definitions||[],u=r.locals.requestedReports||[],l=r.locals.recentlyViewedReports||[],c=r.locals.bookmarks||[],{bookmarkingEnabled:p,downloadingEnabled:f,definitionsPath:h,dpdPathFromQuery:d,dpdPathFromConfig:v,nestedBaseUrl:k}=r.locals;return{csrfToken:e,userId:t,token:n,definitions:s,requestedReports:u,recentlyViewedReports:l,bookmarks:c,bookmarkingEnabled:p,downloadingEnabled:f,dpdPathFromQuery:d,dpdPathFromConfig:v,definitionsPath:h,pathSuffix:o,routePrefix:a,activeCaseLoadId:i,nestedBaseUrl:k}},eu=(r,e)=>(e&&(r.query={...r.query,dataProductDefinitionsPath:e}),r.query),tr={getValues:Zs,setDdpPathToReqQuery:eu};var nu=r=>{let e="";switch(r){case"dashboard":e="govuk-tag--purple";break;case"unavailable":e="govuk-tag--grey";break;default:e="";break}return e},Co=(r,e,t,n)=>{let i=n?"":"dpr-display-none",o=nu(t),a=iu(t);return`<div>
  <p class="govuk-body govuk-!-margin-bottom-1"><strong>${e}</strong></p>
  <p class="govuk-body-s govuk-!-margin-bottom-3">${r}</p>
  <strong class="govuk-tag ${o} dpr-request-status-tag--small govuk-!-margin-bottom-4'">${a}</strong>
  <p class="govuk-body-xs govuk-!-margin-bottom-0 govuk-!-margin-top-3 ${i}">${n}</p>
</div>`};var Oo=(r,e,t,n,i=!0)=>{if(!i)return'<strong class="govuk-tag govuk-tag--red dpr-request-status-tag dpr-request-status-tag--small dpr-unauthorised-report" aria-label="You are unauthorised to view this report">Unauthorised</strong>';let o,a;return e==="unavailable"?(a="Request missing report",o=`<a class='dpr-user-list-action govuk-link--no-visited-state govuk-!-margin-bottom-1 dpr-missing-report' href="${r}">${a}</a>`):(a=`Request ${e}`,t&&t==="sync"&&(a=`Load ${e}`),o=`<a class='dpr-user-list-action govuk-link--no-visited-state govuk-!-margin-bottom-1 dpr-live-report dpr-type__${e}' href="${r}">${a}</a>`,n&&(o=`${o}${n}`)),o},iu=r=>r.charAt(0).toUpperCase()+r.substring(1).toLowerCase(),To=(r,e,t,n,i)=>{let o="";if(e==="unavailable")o=`dpr/request-missing-report/${t}/${n}/form`;else{let{pathSuffix:a,dpdPathFromQuery:s}=tr.getValues(i),u=s?a:"";o=`dpr/request-report/${e}/${t}/${n}/filters${u}`,r&&r==="sync"&&(o=`dpr/view-report/sync/${e}/${t}/${n}/load-report${u}`)}return o};var ou=async r=>r.map(e=>au(e)).sort((e,t)=>e.text.localeCompare(t.text)),au=r=>{let e=JSON.parse(JSON.stringify(r)),{id:t,name:n,description:i,href:o,reportName:a,type:s}=e;return{id:t,reportName:a,text:n,description:i,href:o,type:s}},su=async(r,e,t,n,i)=>{let o=await Promise.all(r.sort((a,s)=>a.name.localeCompare(s.name)).map(async a=>uu(a,e,t,n)));return{rows:i?o.slice(0,i):o,head:[{text:"Product",classes:"dpr-req-product-head"},{text:"Description",classes:"dpr-bm-description-head"},{text:"Actions",classes:"dpr-bm-actions-head"}]}},uu=async(r,e,t,n)=>{let{description:i,reportName:o,reportId:a,id:s,href:u,name:l,type:c,loadType:p}=r,f=await e.createBookMarkToggleHtml({userId:n,reportId:a,id:s,csrfToken:t,ctxId:"bookmark-list",reportType:c});return[{html:Co(o,l,c)},{html:jt.createShowMoreHtml(i),classes:"dpr-req-cell"},{html:Oo(u,c,p,f),classes:"dpr-req-cell dpr-req-cell__status"}]},lu=async(r,e,t,n,i)=>{let o=[],{definitionsPath:a}=tr.getValues(t);return await Promise.all(r.map(async s=>{let u,{reportId:l,variantId:c,id:p,automatic:f,type:h}=s,d=c||p,v=h||"report";try{let k,g,_,T="async",S=`/async/${v}/${l}/${d}/request`;if(v==="report"&&(u=await i.reportingService.getDefinition(n,l,d,a),_=u.name,k=u.variant.name,g=u.variant.description||u.description,T=u.variant.loadType||T,S=To(T,v,l,d,t)),v==="dashboard"){let A=await Ro.getReportSummary(l,i.reportingService,n,a);u=await i.dashboardService.getDefinition(n,l,d,a),k=u.name,_=A.name,g=u.description}u&&o.push({reportId:l,id:d,reportName:_,name:k,description:g,type:v,href:S,loadType:T,automatic:f})}catch{Cr.warn(`Failed to map bookmark for: Report ${l}, variant ${d}`);let g=t.locals.user?.uuid?t.locals.user.uuid:"userId";await i.bookmarkService.removeBookmark(g,d,l)}})),o},Lo={renderBookmarkList:async({services:r,maxRows:e,res:t,req:n})=>{let{token:i,csrfToken:o,userId:a,bookmarks:s}=tr.getValues(t),u=await lu(s,n,t,i,r),l=await ou(u),c=l.length;e&&(l=l.slice(0,e));let p=await su(u,r.bookmarkService,o,a,e),f={...l.length&&{href:"/dpr/my-reports/bookmarks/list"},...!l.length&&{emptyMessage:"You have 0 bookmarked reports"}},h={amount:c,shown:c>e?e:c,max:e};return{head:f,tableData:p,total:h,csrfToken:o,type:"bookmark"}}};var Or=class{constructor(e,t){this.GET=async(e,t,n)=>{t.render("dpr/routes/journeys/my-reports/view",{title:"Bookmarks",layoutPath:this.layoutPath,id:"dpr-bookmarks-list",...await Lo.renderBookmarkList({services:this.services,res:t,req:e})})};this.layoutPath=e,this.services=t}};
//# sourceMappingURL=controller.js.map