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.

59 lines 149 kB
var so=Object.create;var Tt=Object.defineProperty;var oo=Object.getOwnPropertyDescriptor;var uo=Object.getOwnPropertyNames;var lo=Object.getPrototypeOf,co=Object.prototype.hasOwnProperty;var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fo=(t,e)=>{for(var r in e)Tt(t,r,{get:e[r],enumerable:!0})},Nn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uo(e))!co.call(t,i)&&i!==r&&Tt(t,i,{get:()=>e[i],enumerable:!(n=oo(e,i))||n.enumerable});return t};var ne=(t,e,r)=>(r=t!=null?so(lo(t)):{},Nn(e||!t||!t.__esModule?Tt(r,"default",{value:t,enumerable:!0}):r,t)),ho=t=>Nn(Tt({},"__esModule",{value:!0}),t);var Vn=N(($c,lr)=>{var vo=Object.prototype.hasOwnProperty;function $n(t){return"[Throws: "+(t?t.message:"?")+"]"}function yo(t,e){if(vo.call(t,e))try{return t[e]}catch(r){return $n(r)}return t[e]}function Yn(t){var e=[];function r(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=r(n.toJSON());return e.pop(),i}catch(o){return $n(o)}if(Array.isArray(n)){var a=n.map(r);return e.pop(),a}var s=Object.keys(n).reduce(function(o,u){return o[u]=r(yo(n,u)),o},{});return e.pop(),s}return r(t)}lr.exports=function(t,e,r){return JSON.stringify(Yn(t),e,r)};lr.exports.ensureProperties=Yn});var Un=N((Yc,Pn)=>{var te=require("fs"),ot=require("path");Pn.exports=Ft;Ft.ncp=Ft;function Ft(t,e,r,n){var i=n;n||(i=r,r={});var a=process.cwd(),s=ot.resolve(a,t),o=ot.resolve(a,e),u=r.filter,l=r.rename,c=r.transform,m=r.clobber!==!1,f=r.modified,d=r.dereference,h=null,p=0,w=0,v=0,b=r.limit||Ft.limit||16;b=b<1?1:b>512?512:b,C(s);function C(g){if(p++,u){if(u instanceof RegExp){if(!u.test(g))return S(!0)}else if(typeof u=="function"&&!u(g))return S(!0)}return T(g)}function T(g){var D=d?te.stat:te.lstat;if(v>=b)return setImmediate(function(){T(g)});v++,D(g,function(_,M){var $={};if(_)return R(_);if($.name=g,$.mode=M.mode,$.mtime=M.mtime,$.atime=M.atime,M.isDirectory())return k($);if(M.isFile())return x($);if(M.isSymbolicLink())return F(g)})}function x(g){var D=g.name.replace(s,o);l&&(D=l(D)),y(D,function(_){if(_)return V(g,D);if(m&&Y(D,function(){V(g,D)}),f){var M=d?te.stat:te.lstat;M(D,function($,G){if(g.mtime.getTime()>G.mtime.getTime())V(g,D);else return S()})}else return S()})}function V(g,D){var _=te.createReadStream(g.name),M=te.createWriteStream(D,{mode:g.mode});_.on("error",R),M.on("error",R),c?c(_,M,g):M.on("open",function(){_.pipe(M)}),M.once("finish",function(){f&&te.utimesSync(D,g.atime,g.mtime),S()})}function Y(g,D){te.unlink(g,function(_){return _?R(_):D()})}function k(g){var D=g.name.replace(s,o);y(D,function(_){if(_)return L(g,D);q(g.name)})}function L(g,D){te.mkdir(D,g.mode,function(_){if(_)return R(_);q(g.name)})}function q(g){te.readdir(g,function(D,_){return D?R(D):(_.forEach(function(M){C(ot.join(g,M))}),S())})}function F(g){var D=g.replace(s,o);te.readlink(g,function(_,M){if(_)return R(_);A(M,D)})}function A(g,D){d&&(g=ot.resolve(a,g)),y(D,function(_){if(_)return E(g,D);te.readlink(D,function(M,$){return M?R(M):(d&&($=ot.resolve(a,$)),$===g?S():Y(D,function(){E(g,D)}))})})}function E(g,D){te.symlink(g,D,function(_){return _?R(_):S()})}function y(g,D){te.lstat(g,function(_){return _&&_.code==="ENOENT"?D(!0):D(!1)})}function R(g){return r.stopOnError?i(g):(!h&&r.errs?h=te.createWriteStream(r.errs):h||(h=[]),typeof h.write>"u"?h.push(g):h.write(g.stack+`

`),S())}function S(g){if(g||v--,w++,p===w&&v===0&&i!==void 0)return i(h||null)}}});var jn=N((Vc,qn)=>{qn.exports=function(t,e){for(var r=[],n=0;n<t.length;n++){var i=e(t[n],n);So(i)?r.push.apply(r,i):r.push(i)}return r};var So=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}});var Xn=N((Pc,zn)=>{"use strict";zn.exports=Gn;function Gn(t,e,r){t instanceof RegExp&&(t=Bn(t,r)),e instanceof RegExp&&(e=Bn(e,r));var n=Hn(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function Bn(t,e){var r=e.match(t);return r?r[0]:null}Gn.range=Hn;function Hn(t,e,r){var n,i,a,s,o,u=r.indexOf(t),l=r.indexOf(e,u+1),c=u;if(u>=0&&l>0){if(t===e)return[u,l];for(n=[],a=r.length;c>=0&&!o;)c==u?(n.push(c),u=r.indexOf(t,c+1)):n.length==1?o=[n.pop(),l]:(i=n.pop(),i<a&&(a=i,s=l),l=r.indexOf(e,c+1)),c=u<l&&u>=0?u:l;n.length&&(o=[a,s])}return o}});var ri=N((Uc,ti)=>{var Do=jn(),Wn=Xn();ti.exports=Ro;var Qn="\0SLASH"+Math.random()+"\0",Jn="\0OPEN"+Math.random()+"\0",fr="\0CLOSE"+Math.random()+"\0",Zn="\0COMMA"+Math.random()+"\0",Kn="\0PERIOD"+Math.random()+"\0";function cr(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function Eo(t){return t.split("\\\\").join(Qn).split("\\{").join(Jn).split("\\}").join(fr).split("\\,").join(Zn).split("\\.").join(Kn)}function _o(t){return t.split(Qn).join("\\").split(Jn).join("{").split(fr).join("}").split(Zn).join(",").split(Kn).join(".")}function ei(t){if(!t)return[""];var e=[],r=Wn("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,a=r.post,s=n.split(",");s[s.length-1]+="{"+i+"}";var o=ei(a);return a.length&&(s[s.length-1]+=o.shift(),s.push.apply(s,o)),e.push.apply(e,s),e}function Ro(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),qe(Eo(t),!0).map(_o)):[]}function bo(t){return"{"+t+"}"}function wo(t){return/^-?0\d/.test(t)}function Ao(t,e){return t<=e}function Oo(t,e){return t>=e}function qe(t,e){var r=[],n=Wn("{","}",t);if(!n||/\$$/.test(n.pre))return[t];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),s=i||a,o=n.body.indexOf(",")>=0;if(!s&&!o)return n.post.match(/,.*\}/)?(t=n.pre+"{"+n.body+fr+n.post,qe(t)):[t];var u;if(s)u=n.body.split(/\.\./);else if(u=ei(n.body),u.length===1&&(u=qe(u[0],!1).map(bo),u.length===1)){var c=n.post.length?qe(n.post,!1):[""];return c.map(function(F){return n.pre+u[0]+F})}var l=n.pre,c=n.post.length?qe(n.post,!1):[""],m;if(s){var f=cr(u[0]),d=cr(u[1]),h=Math.max(u[0].length,u[1].length),p=u.length==3?Math.abs(cr(u[2])):1,w=Ao,v=d<f;v&&(p*=-1,w=Oo);var b=u.some(wo);m=[];for(var C=f;w(C,d);C+=p){var T;if(a)T=String.fromCharCode(C),T==="\\"&&(T="");else if(T=String(C),b){var x=h-T.length;if(x>0){var V=new Array(x+1).join("0");C<0?T="-"+V+T.slice(1):T=V+T}}m.push(T)}}else m=Do(u,function(q){return qe(q,!1)});for(var Y=0;Y<m.length;Y++)for(var k=0;k<c.length;k++){var L=l+m[Y]+c[k];(!e||s||L)&&r.push(L)}return r}});var Ct=N((qc,oi)=>{oi.exports=ie;ie.Minimatch=W;var ut=function(){try{return require("path")}catch{}}()||{sep:"/"};ie.sep=ut.sep;var mr=ie.GLOBSTAR=W.GLOBSTAR={},Lo=ri(),ni={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},dr="[^/]",hr=dr+"*?",To="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Fo="(?:(?!(?:\\/|^)\\.).)*?",ii=Mo("().*{}+?[]^$\\!");function Mo(t){return t.split("").reduce(function(e,r){return e[r]=!0,e},{})}var ai=/\/+/;ie.filter=xo;function xo(t,e){return e=e||{},function(r,n,i){return ie(r,t,e)}}function we(t,e){e=e||{};var r={};return Object.keys(t).forEach(function(n){r[n]=t[n]}),Object.keys(e).forEach(function(n){r[n]=e[n]}),r}ie.defaults=function(t){if(!t||typeof t!="object"||!Object.keys(t).length)return ie;var e=ie,r=function(i,a,s){return e(i,a,we(t,s))};return r.Minimatch=function(i,a){return new e.Minimatch(i,we(t,a))},r.Minimatch.defaults=function(i){return e.defaults(we(t,i)).Minimatch},r.filter=function(i,a){return e.filter(i,we(t,a))},r.defaults=function(i){return e.defaults(we(t,i))},r.makeRe=function(i,a){return e.makeRe(i,we(t,a))},r.braceExpand=function(i,a){return e.braceExpand(i,we(t,a))},r.match=function(n,i,a){return e.match(n,i,we(t,a))},r};W.defaults=function(t){return ie.defaults(t).Minimatch};function ie(t,e,r){return xt(e),r||(r={}),!r.nocomment&&e.charAt(0)==="#"?!1:new W(e,r).match(t)}function W(t,e){if(!(this instanceof W))return new W(t,e);xt(t),e||(e={}),t=t.trim(),!e.allowWindowsEscape&&ut.sep!=="/"&&(t=t.split(ut.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}W.prototype.debug=function(){};W.prototype.make=Co;function Co(){var t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate();var r=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,r),r=this.globParts=r.map(function(n){return n.split(ai)}),this.debug(this.pattern,r),r=r.map(function(n,i,a){return n.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(n){return n.indexOf(!1)===-1}),this.debug(this.pattern,r),this.set=r}W.prototype.parseNegate=No;function No(){var t=this.pattern,e=!1,r=this.options,n=0;if(!r.nonegate){for(var i=0,a=t.length;i<a&&t.charAt(i)==="!";i++)e=!e,n++;n&&(this.pattern=t.substr(n)),this.negate=e}}ie.braceExpand=function(t,e){return si(t,e)};W.prototype.braceExpand=si;function si(t,e){return e||(this instanceof W?e=this.options:e={}),t=typeof t>"u"?this.pattern:t,xt(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Lo(t)}var ko=1024*64,xt=function(t){if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>ko)throw new TypeError("pattern is too long")};W.prototype.parse=Io;var Mt={};function Io(t,e){xt(t);var r=this.options;if(t==="**")if(r.noglobstar)t="*";else return mr;if(t==="")return"";var n="",i=!!r.nocase,a=!1,s=[],o=[],u,l=!1,c=-1,m=-1,f=t.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",d=this;function h(){if(u){switch(u){case"*":n+=hr,i=!0;break;case"?":n+=dr,i=!0;break;default:n+="\\"+u;break}d.debug("clearStateChar %j %j",u,n),u=!1}}for(var p=0,w=t.length,v;p<w&&(v=t.charAt(p));p++){if(this.debug("%s	%s %s %j",t,p,n,v),a&&ii[v]){n+="\\"+v,a=!1;continue}switch(v){case"/":return!1;case"\\":h(),a=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s	%s %s %j <-- stateChar",t,p,n,v),l){this.debug("  in class"),v==="!"&&p===m+1&&(v="^"),n+=v;continue}d.debug("call clearStateChar %j",u),h(),u=v,r.noext&&h();continue;case"(":if(l){n+="(";continue}if(!u){n+="\\(";continue}s.push({type:u,start:p-1,reStart:n.length,open:ni[u].open,close:ni[u].close}),n+=u==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",u,n),u=!1;continue;case")":if(l||!s.length){n+="\\)";continue}h(),i=!0;var b=s.pop();n+=b.close,b.type==="!"&&o.push(b),b.reEnd=n.length;continue;case"|":if(l||!s.length||a){n+="\\|",a=!1;continue}h(),n+="|";continue;case"[":if(h(),l){n+="\\"+v;continue}l=!0,m=p,c=n.length,n+=v;continue;case"]":if(p===m+1||!l){n+="\\"+v,a=!1;continue}var C=t.substring(m+1,p);try{RegExp("["+C+"]")}catch{var T=this.parse(C,Mt);n=n.substr(0,c)+"\\["+T[0]+"\\]",i=i||T[1],l=!1;continue}i=!0,l=!1,n+=v;continue;default:h(),a?a=!1:ii[v]&&!(v==="^"&&l)&&(n+="\\"),n+=v}}for(l&&(C=t.substr(m+1),T=this.parse(C,Mt),n=n.substr(0,c)+"\\["+T[0],i=i||T[1]),b=s.pop();b;b=s.pop()){var x=n.slice(b.reStart+b.open.length);this.debug("setting tail",n,b),x=x.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(M,$,G){return G||(G="\\"),$+$+G+"|"}),this.debug(`tail=%j
   %s`,x,x,b,n);var V=b.type==="*"?hr:b.type==="?"?dr:"\\"+b.type;i=!0,n=n.slice(0,b.reStart)+V+"\\("+x}h(),a&&(n+="\\\\");var Y=!1;switch(n.charAt(0)){case"[":case".":case"(":Y=!0}for(var k=o.length-1;k>-1;k--){var L=o[k],q=n.slice(0,L.reStart),F=n.slice(L.reStart,L.reEnd-8),A=n.slice(L.reEnd-8,L.reEnd),E=n.slice(L.reEnd);A+=E;var y=q.split("(").length-1,R=E;for(p=0;p<y;p++)R=R.replace(/\)[+*?]?/,"");E=R;var S="";E===""&&e!==Mt&&(S="$");var g=q+F+E+S+A;n=g}if(n!==""&&i&&(n="(?=.)"+n),Y&&(n=f+n),e===Mt)return[n,i];if(!i)return Yo(t);var D=r.nocase?"i":"";try{var _=new RegExp("^"+n+"$",D)}catch{return new RegExp("$.")}return _._glob=t,_._src=n,_}ie.makeRe=function(t,e){return new W(t,e||{}).makeRe()};W.prototype.makeRe=$o;function $o(){if(this.regexp||this.regexp===!1)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,r=e.noglobstar?hr:e.dot?To:Fo,n=e.nocase?"i":"",i=t.map(function(a){return a.map(function(s){return s===mr?r:typeof s=="string"?Vo(s):s._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,n)}catch{this.regexp=!1}return this.regexp}ie.match=function(t,e,r){r=r||{};var n=new W(e,r);return t=t.filter(function(i){return n.match(i)}),n.options.nonull&&!t.length&&t.push(e),t};W.prototype.match=function(e,r){if(typeof r>"u"&&(r=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;var n=this.options;ut.sep!=="/"&&(e=e.split(ut.sep).join("/")),e=e.split(ai),this.debug(this.pattern,"split",e);var i=this.set;this.debug(this.pattern,"set",i);var a,s;for(s=e.length-1;s>=0&&(a=e[s],!a);s--);for(s=0;s<i.length;s++){var o=i[s],u=e;n.matchBase&&o.length===1&&(u=[a]);var l=this.matchOne(u,o,r);if(l)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate};W.prototype.matchOne=function(t,e,r){var n=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var i=0,a=0,s=t.length,o=e.length;i<s&&a<o;i++,a++){this.debug("matchOne loop");var u=e[a],l=t[i];if(this.debug(e,u,l),u===!1)return!1;if(u===mr){this.debug("GLOBSTAR",[e,u,l]);var c=i,m=a+1;if(m===o){for(this.debug("** at the end");i<s;i++)if(t[i]==="."||t[i]===".."||!n.dot&&t[i].charAt(0)===".")return!1;return!0}for(;c<s;){var f=t[c];if(this.debug(`
globstar while`,t,c,e,m,f),this.matchOne(t.slice(c),e.slice(m),r))return this.debug("globstar found match!",c,s,f),!0;if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",t,c,e,m);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(r&&(this.debug(`
>>> no match, partial?`,t,c,e,m),c===s))}var d;if(typeof u=="string"?(d=l===u,this.debug("string match",u,l,d)):(d=l.match(u),this.debug("pattern match",u,l,d)),!d)return!1}if(i===s&&a===o)return!0;if(i===s)return r;if(a===o)return i===s-1&&t[i]==="";throw new Error("wtf?")};function Yo(t){return t.replace(/\\(.)/g,"$1")}function Vo(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var ui=N((jc,pr)=>{typeof Object.create=="function"?pr.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:pr.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var li=N((Bc,vr)=>{try{if(gr=require("util"),typeof gr.inherits!="function")throw"";vr.exports=gr.inherits}catch{vr.exports=ui()}var gr});var kt=N((Gc,Nt)=>{"use strict";function ci(t){return t.charAt(0)==="/"}function fi(t){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,r=e.exec(t),n=r[1]||"",i=!!(n&&n.charAt(1)!==":");return!!(r[2]||i)}Nt.exports=process.platform==="win32"?fi:ci;Nt.exports.posix=ci;Nt.exports.win32=fi});var Dr=N(he=>{he.alphasort=mi;he.alphasorti=hi;he.setopts=Bo;he.ownProp=di;he.makeAbs=Sr;he.finish=Go;he.mark=Ho;he.isIgnored=pi;he.childrenIgnored=zo;function di(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var je=require("path"),Po=Ct(),Uo=kt(),yr=Po.Minimatch;function hi(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}function mi(t,e){return t.localeCompare(e)}function qo(t,e){t.ignore=e.ignore||[],Array.isArray(t.ignore)||(t.ignore=[t.ignore]),t.ignore.length&&(t.ignore=t.ignore.map(jo))}function jo(t){var e=null;if(t.slice(-3)==="/**"){var r=t.replace(/(\/\*\*)+$/,"");e=new yr(r,{dot:!0})}return{matcher:new yr(t,{dot:!0}),gmatcher:e}}function Bo(t,e,r){if(r||(r={}),r.matchBase&&e.indexOf("/")===-1){if(r.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}t.silent=!!r.silent,t.pattern=e,t.strict=r.strict!==!1,t.realpath=!!r.realpath,t.realpathCache=r.realpathCache||Object.create(null),t.follow=!!r.follow,t.dot=!!r.dot,t.mark=!!r.mark,t.nodir=!!r.nodir,t.nodir&&(t.mark=!0),t.sync=!!r.sync,t.nounique=!!r.nounique,t.nonull=!!r.nonull,t.nosort=!!r.nosort,t.nocase=!!r.nocase,t.stat=!!r.stat,t.noprocess=!!r.noprocess,t.maxLength=r.maxLength||1/0,t.cache=r.cache||Object.create(null),t.statCache=r.statCache||Object.create(null),t.symlinks=r.symlinks||Object.create(null),qo(t,r),t.changedCwd=!1;var n=process.cwd();di(r,"cwd")?(t.cwd=r.cwd,t.changedCwd=je.resolve(r.cwd)!==n):t.cwd=n,t.root=r.root||je.resolve(t.cwd,"/"),t.root=je.resolve(t.root),process.platform==="win32"&&(t.root=t.root.replace(/\\/g,"/")),t.nomount=!!r.nomount,r.nonegate=!0,r.nocomment=!0,t.minimatch=new yr(e,r),t.options=t.minimatch.options}function Go(t){for(var e=t.nounique,r=e?[]:Object.create(null),n=0,i=t.matches.length;n<i;n++){var a=t.matches[n];if(!a||Object.keys(a).length===0){if(t.nonull){var s=t.minimatch.globSet[n];e?r.push(s):r[s]=!0}}else{var o=Object.keys(a);e?r.push.apply(r,o):o.forEach(function(u){r[u]=!0})}}if(e||(r=Object.keys(r)),t.nosort||(r=r.sort(t.nocase?hi:mi)),t.mark){for(var n=0;n<r.length;n++)r[n]=t._mark(r[n]);t.nodir&&(r=r.filter(function(u){return!/\/$/.test(u)}))}t.ignore.length&&(r=r.filter(function(u){return!pi(t,u)})),t.found=r}function Ho(t,e){var r=Sr(t,e),n=t.cache[r],i=e;if(n){var a=n==="DIR"||Array.isArray(n),s=e.slice(-1)==="/";if(a&&!s?i+="/":!a&&s&&(i=i.slice(0,-1)),i!==e){var o=Sr(t,i);t.statCache[o]=t.statCache[r],t.cache[o]=t.cache[r]}}return i}function Sr(t,e){var r=e;return e.charAt(0)==="/"?r=je.join(t.root,e):Uo(e)||e===""?r=e:t.changedCwd?r=je.resolve(t.cwd,e):r=je.resolve(e),r}function pi(t,e){return t.ignore.length?t.ignore.some(function(r){return r.matcher.match(e)||!!(r.gmatcher&&r.gmatcher.match(e))}):!1}function zo(t,e){return t.ignore.length?t.ignore.some(function(r){return!!(r.gmatcher&&r.gmatcher.match(e))}):!1}});var Di=N((Zc,Si)=>{Si.exports=yi;yi.GlobSync=z;var lt=require("fs"),gi=Ct(),zc=gi.Minimatch,Xc=Rr().Glob,Wc=require("util"),Er=require("path"),vi=require("assert"),It=kt(),Ae=Dr(),Qc=Ae.alphasort,Jc=Ae.alphasorti,Xo=Ae.setopts,_r=Ae.ownProp,Wo=Ae.childrenIgnored;function yi(t,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 z(t,e).found}function z(t,e){if(!t)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 z))return new z(t,e);if(Xo(this,t,e),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}z.prototype._finish=function(){if(vi(this instanceof z),this.realpath){var t=this;this.matches.forEach(function(e,r){var n=t.matches[r]=Object.create(null);for(var i in e)try{i=t._makeAbs(i);var a=lt.realpathSync(i,t.realpathCache);n[a]=!0}catch(s){if(s.syscall==="stat")n[t._makeAbs(i)]=!0;else throw s}})}Ae.finish(this)};z.prototype._process=function(t,e,r){vi(this instanceof z);for(var n=0;typeof t[n]=="string";)n++;var i;switch(n){case t.length:this._processSimple(t.join("/"),e);return;case 0:i=null;break;default:i=t.slice(0,n).join("/");break}var a=t.slice(n),s;i===null?s=".":((It(i)||It(t.join("/")))&&(!i||!It(i))&&(i="/"+i),s=i);var o=this._makeAbs(s);if(!Wo(this,s)){var u=a[0]===gi.GLOBSTAR;u?this._processGlobStar(i,s,o,a,e,r):this._processReaddir(i,s,o,a,e,r)}};z.prototype._processReaddir=function(t,e,r,n,i,a){var s=this._readdir(r,a);if(s){for(var o=n[0],u=!!this.minimatch.negate,l=o._glob,c=this.dot||l.charAt(0)===".",m=[],f=0;f<s.length;f++){var d=s[f];if(d.charAt(0)!=="."||c){var h;u&&!t?h=!d.match(o):h=d.match(o),h&&m.push(d)}}var p=m.length;if(p!==0){if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var f=0;f<p;f++){var d=m[f];t&&(t.slice(-1)!=="/"?d=t+"/"+d:d=t+d),d.charAt(0)==="/"&&!this.nomount&&(d=Er.join(this.root,d)),this.matches[i][d]=!0}return}n.shift();for(var f=0;f<p;f++){var d=m[f],w;t?w=[t,d]:w=[d],this._process(w.concat(n),i,a)}}}};z.prototype._emitMatch=function(t,e){var r=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),!this.matches[t][e]){if(this.nodir){var n=this.cache[this._makeAbs(e)];if(n==="DIR"||Array.isArray(n))return}this.matches[t][e]=!0,this.stat&&this._stat(e)}};z.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var e,r,n;try{r=lt.lstatSync(t)}catch{return null}var i=r.isSymbolicLink();return this.symlinks[t]=i,!i&&!r.isDirectory()?this.cache[t]="FILE":e=this._readdir(t,!1),e};z.prototype._readdir=function(t,e){var r;if(e&&!_r(this.symlinks,t))return this._readdirInGlobStar(t);if(_r(this.cache,t)){var n=this.cache[t];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(t,lt.readdirSync(t))}catch(i){return this._readdirError(t,i),null}};z.prototype._readdirEntries=function(t,e){if(!this.mark&&!this.stat)for(var r=0;r<e.length;r++){var n=e[r];t==="/"?n=t+n:n=t+"/"+n,this.cache[n]=!0}return this.cache[t]=e,e};z.prototype._readdirError=function(t,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":this.cache[this._makeAbs(t)]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};z.prototype._processGlobStar=function(t,e,r,n,i,a){var s=this._readdir(r,a);if(s){var o=n.slice(1),u=t?[t]:[],l=u.concat(o);this._process(l,i,!1);var c=s.length,m=this.symlinks[r];if(!(m&&a))for(var f=0;f<c;f++){var d=s[f];if(!(d.charAt(0)==="."&&!this.dot)){var h=u.concat(s[f],o);this._process(h,i,!0);var p=u.concat(s[f],n);this._process(p,i,!0)}}}};z.prototype._processSimple=function(t,e){var r=this._stat(t);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!r){if(t&&It(t)&&!this.nomount){var n=/[\/\\]$/.test(t);t.charAt(0)==="/"?t=Er.join(this.root,t):(t=Er.resolve(this.root,t),n&&(t+="/"))}process.platform==="win32"&&(t=t.replace(/\\/g,"/")),this.matches[e][t]=!0}};z.prototype._stat=function(t){var e=this._makeAbs(t),r=t.slice(-1)==="/";if(t.length>this.maxLength)return!1;if(!this.stat&&_r(this.cache,e)){var s=this.cache[e];if(Array.isArray(s)&&(s="DIR"),!r||s==="DIR")return s;if(r&&s==="FILE")return!1}var n,i=this.statCache[e];if(!i){var a;try{a=lt.lstatSync(e)}catch{return!1}if(a.isSymbolicLink())try{i=lt.statSync(e)}catch{i=a}else i=a}this.statCache[e]=i;var s=i.isDirectory()?"DIR":"FILE";return this.cache[e]=this.cache[e]||s,r&&s!=="DIR"?!1:s};z.prototype._mark=function(t){return Ae.mark(this,t)};z.prototype._makeAbs=function(t){return Ae.makeAbs(this,t)}});var br=N((Kc,_i)=>{_i.exports=Ei;function Ei(t,e){if(t&&e)return Ei(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){r[n]=t[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=t.apply(this,n),s=n[n.length-1];return typeof a=="function"&&a!==s&&Object.keys(s).forEach(function(o){a[o]=s[o]}),a}}});var Ar=N((ef,wr)=>{var Ri=br();wr.exports=Ri($t);wr.exports.strict=Ri(bi);$t.proto=$t(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return $t(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return bi(this)},configurable:!0})});function $t(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function bi(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var Ai=N((tf,wi)=>{var Qo=br(),ct=Object.create(null),Jo=Ar();wi.exports=Qo(Zo);function Zo(t,e){return ct[t]?(ct[t].push(e),null):(ct[t]=[e],Ko(t))}function Ko(t){return Jo(function e(){var r=ct[t],n=r.length,i=eu(arguments);try{for(var a=0;a<n;a++)r[a].apply(null,i)}finally{r.length>n?(r.splice(0,n),process.nextTick(function(){e.apply(null,i)})):delete ct[t]}})}function eu(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n]=t[n];return r}});var Rr=N((of,Li)=>{Li.exports=xe;var ft=require("fs"),Oi=Ct(),rf=Oi.Minimatch,tu=li(),ru=require("events").EventEmitter,Or=require("path"),Lr=require("assert"),Yt=kt(),Fr=Di(),ve=Dr(),nf=ve.alphasort,af=ve.alphasorti,nu=ve.setopts,Tr=ve.ownProp,Mr=Ai(),sf=require("util"),iu=ve.childrenIgnored,au=ve.isIgnored,su=Ar();function xe(t,e,r){if(typeof e=="function"&&(r=e,e={}),e||(e={}),e.sync){if(r)throw new TypeError("callback provided to sync glob");return Fr(t,e)}return new U(t,e,r)}xe.sync=Fr;var ou=xe.GlobSync=Fr.GlobSync;xe.glob=xe;function uu(t,e){if(e===null||typeof e!="object")return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}xe.hasMagic=function(t,e){var r=uu({},e);r.noprocess=!0;var n=new U(t,r),i=n.minimatch.set;if(i.length>1)return!0;for(var a=0;a<i[0].length;a++)if(typeof i[0][a]!="string")return!0;return!1};xe.Glob=U;tu(U,ru);function U(t,e,r){if(typeof e=="function"&&(r=e,e=null),e&&e.sync){if(r)throw new TypeError("callback provided to sync glob");return new ou(t,e)}if(!(this instanceof U))return new U(t,e,r);nu(this,t,e),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=new Array(i),typeof r=="function"&&(r=su(r),this.on("error",r),this.on("end",function(o){r(null,o)}));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 s();for(var a=0;a<i;a++)this._process(this.minimatch.set[a],a,!1,s);function s(){--n._processing,n._processing<=0&&n._finish()}}U.prototype._finish=function(){if(Lr(this instanceof U),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();ve.finish(this),this.emit("end",this.found)}};U.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var t=this.matches.length;if(t===0)return this._finish();for(var e=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){--t===0&&e._finish()}};U.prototype._realpathSet=function(t,e){var r=this.matches[t];if(!r)return e();var n=Object.keys(r),i=this,a=n.length;if(a===0)return e();var s=this.matches[t]=Object.create(null);n.forEach(function(o,u){o=i._makeAbs(o),ft.realpath(o,i.realpathCache,function(l,c){l?l.syscall==="stat"?s[o]=!0:i.emit("error",l):s[c]=!0,--a===0&&(i.matches[t]=s,e())})})};U.prototype._mark=function(t){return ve.mark(this,t)};U.prototype._makeAbs=function(t){return ve.makeAbs(this,t)};U.prototype.abort=function(){this.aborted=!0,this.emit("abort")};U.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};U.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;e<t.length;e++){var r=t[e];this._emitMatch(r[0],r[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])}}}};U.prototype._process=function(t,e,r,n){if(Lr(this instanceof U),Lr(typeof n=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([t,e,r,n]);return}for(var i=0;typeof t[i]=="string";)i++;var a;switch(i){case t.length:this._processSimple(t.join("/"),e,n);return;case 0:a=null;break;default:a=t.slice(0,i).join("/");break}var s=t.slice(i),o;a===null?o=".":((Yt(a)||Yt(t.join("/")))&&(!a||!Yt(a))&&(a="/"+a),o=a);var u=this._makeAbs(o);if(iu(this,o))return n();var l=s[0]===Oi.GLOBSTAR;l?this._processGlobStar(a,o,u,s,e,r,n):this._processReaddir(a,o,u,s,e,r,n)}};U.prototype._processReaddir=function(t,e,r,n,i,a,s){var o=this;this._readdir(r,a,function(u,l){return o._processReaddir2(t,e,r,n,i,a,l,s)})};U.prototype._processReaddir2=function(t,e,r,n,i,a,s,o){if(!s)return o();for(var u=n[0],l=!!this.minimatch.negate,c=u._glob,m=this.dot||c.charAt(0)===".",f=[],d=0;d<s.length;d++){var h=s[d];if(h.charAt(0)!=="."||m){var p;l&&!t?p=!h.match(u):p=h.match(u),p&&f.push(h)}}var w=f.length;if(w===0)return o();if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var d=0;d<w;d++){var h=f[d];t&&(t!=="/"?h=t+"/"+h:h=t+h),h.charAt(0)==="/"&&!this.nomount&&(h=Or.join(this.root,h)),this._emitMatch(i,h)}return o()}n.shift();for(var d=0;d<w;d++){var h=f[d],v;t&&(t!=="/"?h=t+"/"+h:h=t+h),this._process([h].concat(n),i,a,o)}o()};U.prototype._emitMatch=function(t,e){if(!this.aborted&&!this.matches[t][e]&&!au(this,e)){if(this.paused){this._emitQueue.push([t,e]);return}var r=this._makeAbs(e);if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.mark&&(e=this._mark(e)),this.matches[t][e]=!0;var i=this.statCache[r];i&&this.emit("stat",e,i),this.emit("match",e)}};U.prototype._readdirInGlobStar=function(t,e){if(this.aborted)return;if(this.follow)return this._readdir(t,!1,e);var r="lstat\0"+t,n=this,i=Mr(r,a);i&&ft.lstat(t,i);function a(s,o){if(s)return e();var u=o.isSymbolicLink();n.symlinks[t]=u,!u&&!o.isDirectory()?(n.cache[t]="FILE",e()):n._readdir(t,!1,e)}};U.prototype._readdir=function(t,e,r){if(!this.aborted&&(r=Mr("readdir\0"+t+"\0"+e,r),!!r)){if(e&&!Tr(this.symlinks,t))return this._readdirInGlobStar(t,r);if(Tr(this.cache,t)){var n=this.cache[t];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;ft.readdir(t,lu(this,t,r))}};function lu(t,e,r){return function(n,i){n?t._readdirError(e,n,r):t._readdirEntries(e,i,r)}}U.prototype._readdirEntries=function(t,e,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<e.length;n++){var i=e[n];t==="/"?i=t+i:i=t+"/"+i,this.cache[i]=!0}return this.cache[t]=e,r(null,e)}};U.prototype._readdirError=function(t,e,r){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":this.cache[this._makeAbs(t)]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e);break}return r()}};U.prototype._processGlobStar=function(t,e,r,n,i,a,s){var o=this;this._readdir(r,a,function(u,l){o._processGlobStar2(t,e,r,n,i,a,l,s)})};U.prototype._processGlobStar2=function(t,e,r,n,i,a,s,o){if(!s)return o();var u=n.slice(1),l=t?[t]:[],c=l.concat(u);this._process(c,i,!1,o);var m=this.symlinks[r],f=s.length;if(m&&a)return o();for(var d=0;d<f;d++){var h=s[d];if(!(h.charAt(0)==="."&&!this.dot)){var p=l.concat(s[d],u);this._process(p,i,!0,o);var w=l.concat(s[d],n);this._process(w,i,!0,o)}}o()};U.prototype._processSimple=function(t,e,r){var n=this;this._stat(t,function(i,a){n._processSimple2(t,e,i,a,r)})};U.prototype._processSimple2=function(t,e,r,n,i){if(this.matches[e]||(this.matches[e]=Object.create(null)),!n)return i();if(t&&Yt(t)&&!this.nomount){var a=/[\/\\]$/.test(t);t.charAt(0)==="/"?t=Or.join(this.root,t):(t=Or.resolve(this.root,t),a&&(t+="/"))}process.platform==="win32"&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t),i()};U.prototype._stat=function(t,e){var r=this._makeAbs(t),n=t.slice(-1)==="/";if(t.length>this.maxLength)return e();if(!this.stat&&Tr(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||i==="DIR")return e(null,i);if(n&&i==="FILE")return e()}var a,s=this.statCache[r];if(s!==void 0){if(s===!1)return e(null,s);var o=s.isDirectory()?"DIR":"FILE";return n&&o==="FILE"?e():e(null,o,s)}var u=this,l=Mr("stat\0"+r,c);l&&ft.lstat(r,l);function c(m,f){if(f&&f.isSymbolicLink())return ft.stat(r,function(d,h){d?u._stat2(t,r,null,f,e):u._stat2(t,r,d,h,e)});u._stat2(t,r,m,f,e)}};U.prototype._stat2=function(t,e,r,n,i){if(r)return this.statCache[e]=!1,i();var a=t.slice(-1)==="/";if(this.statCache[e]=n,e.slice(-1)==="/"&&!n.isDirectory())return i(null,!1,n);var s=n.isDirectory()?"DIR":"FILE";return this.cache[e]=this.cache[e]||s,a&&s!=="DIR"?i():i(null,s,n)}});var Ni=N((uf,Ci)=>{Ci.exports=kr;kr.sync=xi;var P=require("assert"),Ti=require("path"),Ut=require("fs"),qt=Rr(),Fi={nosort:!0,nocomment:!0,nonegate:!0,silent:!0},xr=0,Nr=process.platform==="win32";function Mi(t){var e=["unlink","chmod","stat","lstat","rmdir","readdir"];e.forEach(function(r){t[r]=t[r]||Ut[r],r=r+"Sync",t[r]=t[r]||Ut[r]}),t.maxBusyTries=t.maxBusyTries||3,t.emfileWait=t.emfileWait||1e3,t.disableGlob=t.disableGlob||!1}function kr(t,e,r){typeof e=="function"&&(r=e,e={}),P(t,"rimraf: missing path"),P.equal(typeof t,"string","rimraf: path should be a string"),P(e,"rimraf: missing options"),P.equal(typeof e,"object","rimraf: options should be object"),P.equal(typeof r,"function","rimraf: callback function required"),Mi(e);var n=0,i=null,a=0;if(e.disableGlob||!qt.hasMagic(t))return o(null,[t]);Ut.lstat(t,function(u,l){if(!u)return o(null,[t]);qt(t,Fi,o)});function s(u){i=i||u,--a===0&&r(i)}function o(u,l){if(u)return r(u);if(a=l.length,a===0)return r();l.forEach(function(c){Cr(c,e,function m(f){if(f){if(Nr&&(f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&n<e.maxBusyTries){n++;var d=n*100;return setTimeout(function(){Cr(c,e,m)},d)}if(f.code==="EMFILE"&&xr<e.emfileWait)return setTimeout(function(){Cr(c,e,m)},xr++);f.code==="ENOENT"&&(f=null)}xr=0,s(f)})})}}function Cr(t,e,r){P(t),P(e),P(typeof r=="function"),e.lstat(t,function(n,i){if(n&&n.code==="ENOENT")return r(null);if(i&&i.isDirectory())return Vt(t,e,n,r);e.unlink(t,function(a){if(a){if(a.code==="ENOENT")return r(null);if(a.code==="EPERM")return Nr?cu(t,e,a,r):Vt(t,e,a,r);if(a.code==="EISDIR")return Vt(t,e,a,r)}return r(a)})})}function cu(t,e,r,n){P(t),P(e),P(typeof n=="function"),r&&P(r instanceof Error),e.chmod(t,666,function(i){i?n(i.code==="ENOENT"?null:r):e.stat(t,function(a,s){a?n(a.code==="ENOENT"?null:r):s.isDirectory()?Vt(t,e,r,n):e.unlink(t,n)})})}function fu(t,e,r){P(t),P(e),r&&P(r instanceof Error);try{e.chmodSync(t,666)}catch(i){if(i.code==="ENOENT")return;throw r}try{var n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?Pt(t,e,r):e.unlinkSync(t)}function Vt(t,e,r,n){P(t),P(e),r&&P(r instanceof Error),P(typeof n=="function"),e.rmdir(t,function(i){i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?du(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function du(t,e,r){P(t),P(e),P(typeof r=="function"),e.readdir(t,function(n,i){if(n)return r(n);var a=i.length;if(a===0)return e.rmdir(t,r);var s;i.forEach(function(o){kr(Ti.join(t,o),e,function(u){if(!s){if(u)return r(s=u);--a===0&&e.rmdir(t,r)}})})})}function xi(t,e){e=e||{},Mi(e),P(t,"rimraf: missing path"),P.equal(typeof t,"string","rimraf: path should be a string"),P(e,"rimraf: missing options"),P.equal(typeof e,"object","rimraf: options should be object");var r;if(e.disableGlob||!qt.hasMagic(t))r=[t];else try{Ut.lstatSync(t),r=[t]}catch{r=qt.sync(t,Fi)}if(r.length)for(var n=0;n<r.length;n++){var t=r[n];try{var i=e.lstatSync(t)}catch(s){if(s.code==="ENOENT")return}try{i&&i.isDirectory()?Pt(t,e,null):e.unlinkSync(t)}catch(s){if(s.code==="ENOENT")return;if(s.code==="EPERM")return Nr?fu(t,e,s):Pt(t,e,s);if(s.code!=="EISDIR")throw s;Pt(t,e,s)}}}function Pt(t,e,r){P(t),P(e),r&&P(r instanceof Error);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw r;(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")&&hu(t,e)}}function hu(t,e){P(t),P(e),e.readdirSync(t).forEach(function(r){xi(Ti.join(t,r),e)}),e.rmdirSync(t,e)}});var Yi=N((lf,$i)=>{var dt=require("path"),ki=require("fs"),Ii=parseInt("0777",8);$i.exports=Be.mkdirp=Be.mkdirP=Be;function Be(t,e,r,n){typeof e=="function"?(r=e,e={}):(!e||typeof e!="object")&&(e={mode:e});var i=e.mode,a=e.fs||ki;i===void 0&&(i=Ii),n||(n=null);var s=r||function(){};t=dt.resolve(t),a.mkdir(t,i,function(o){if(!o)return n=n||t,s(null,n);switch(o.code){case"ENOENT":if(dt.dirname(t)===t)return s(o);Be(dt.dirname(t),e,function(u,l){u?s(u,l):Be(t,e,s,l)});break;default:a.stat(t,function(u,l){u||!l.isDirectory()?s(o,n):s(null,n)});break}})}Be.sync=function t(e,r,n){(!r||typeof r!="object")&&(r={mode:r});var i=r.mode,a=r.fs||ki;i===void 0&&(i=Ii),n||(n=null),e=dt.resolve(e);try{a.mkdirSync(e,i),n=n||e}catch(o){switch(o.code){case"ENOENT":n=t(dt.dirname(e),r,n),t(e,r,n);break;default:var s;try{s=a.statSync(e)}catch{throw o}if(!s.isDirectory())throw o;break}}return n}});var ji=N((cf,qi)=>{var Ge=require("fs"),mu=Un().ncp,pu=require("path"),Vi=Ni(),gu=Yi();qi.exports=vu;function vu(t,e,r,n){typeof r=="function"&&(n=r,r={});var i=!!r.mkdirp,a=r.clobber!==!1,s=r.limit||16;i?o():u();function o(){gu(pu.dirname(e),function(l){if(l)return n(l);u()})}function u(){a?Ge.rename(t,e,function(l){if(!l)return n();if(l.code!=="EXDEV")return n(l);Pi(t,e,a,s,n)}):Ge.link(t,e,function(l){if(l){if(l.code==="EXDEV"){Pi(t,e,a,s,n);return}if(l.code==="EISDIR"||l.code==="EPERM"){Ui(t,e,a,s,n);return}n(l);return}Ge.unlink(t,n)})}}function Pi(t,e,r,n,i){var a=r?"w":"wx",s=Ge.createReadStream(t),o=Ge.createWriteStream(e,{flags:a});s.on("error",function(l){s.destroy(),o.destroy(),o.removeListener("close",u),l.code==="EISDIR"||l.code==="EPERM"?Ui(t,e,r,n,i):i(l)}),o.on("error",function(l){s.destroy(),o.destroy(),o.removeListener("close",u),i(l)}),o.once("close",u),s.pipe(o);function u(){Ge.unlink(t,i)}}function Ui(t,e,r,n,i){var a={stopOnErr:!0,clobber:!1,limit:n};r?Vi(e,{disableGlob:!0},function(o){if(o)return i(o);s()}):s();function s(){mu(t,e,a,function(o){if(o)return i(o[0]);Vi(t,{disableGlob:!0},i)})}}});var Gi=N(Ir=>{var Bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ir.encode=function(t){if(0<=t&&t<Bi.length)return Bi[t];throw new TypeError("Must be between 0 and 63: "+t)};Ir.decode=function(t){var e=65,r=90,n=97,i=122,a=48,s=57,o=43,u=47,l=26,c=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+l:a<=t&&t<=s?t-a+c:t==o?62:t==u?63:-1}});var Vr=N(Yr=>{var Hi=Gi(),$r=5,zi=1<<$r,Xi=zi-1,Wi=zi;function yu(t){return t<0?(-t<<1)+1:(t<<1)+0}function Su(t){var e=(t&1)===1,r=t>>1;return e?-r:r}Yr.encode=function(e){var r="",n,i=yu(e);do n=i&Xi,i>>>=$r,i>0&&(n|=Wi),r+=Hi.encode(n);while(i>0);return r};Yr.decode=function(e,r,n){var i=e.length,a=0,s=0,o,u;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Hi.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));o=!!(u&Wi),u&=Xi,a=a+(u<<s),s+=$r}while(o);n.value=Su(a),n.rest=r}});var Xe=N(K=>{function Du(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}K.getArg=Du;var Qi=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Eu=/^data:.+\,.+$/;function ht(t){var e=t.match(Qi);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}K.urlParse=ht;function He(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}K.urlGenerate=He;function Pr(t){var e=t,r=ht(t);if(r){if(!r.path)return t;e=r.path}for(var n=K.isAbsolute(e),i=e.split(/\/+/),a,s=0,o=i.length-1;o>=0;o--)a=i[o],a==="."?i.splice(o,1):a===".."?s++:s>0&&(a===""?(i.splice(o+1,s),s=0):(i.splice(o,2),s--));return e=i.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,He(r)):e}K.normalize=Pr;function Ji(t,e){t===""&&(t="."),e===""&&(e=".");var r=ht(e),n=ht(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),He(r);if(r||e.match(Eu))return e;if(n&&!n.host&&!n.path)return n.host=e,He(n);var i=e.charAt(0)==="/"?e:Pr(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,He(n)):i}K.join=Ji;K.isAbsolute=function(t){return t.charAt(0)==="/"||Qi.test(t)};function _u(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}K.relative=_u;var Zi=function(){var t=Object.create(null);return!("__proto__"in t)}();function Ki(t){return t}function Ru(t){return ea(t)?"$"+t:t}K.toSetString=Zi?Ki:Ru;function bu(t){return ea(t)?t.slice(1):t}K.fromSetString=Zi?Ki:bu;function ea(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function wu(t,e,r){var n=ze(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:ze(t.name,e.name)}K.compareByOriginalPositions=wu;function Au(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=ze(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:ze(t.name,e.name)}K.compareByGeneratedPositionsDeflated=Au;function ze(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function Ou(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=ze(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:ze(t.name,e.name)}K.compareByGeneratedPositionsInflated=Ou;function Lu(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}K.parseSourceMapInput=Lu;function Tu(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=ht(r);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=Ji(He(n),e)}return Pr(e)}K.computeSourceURL=Tu});var jr=N(ta=>{var Ur=Xe(),qr=Object.prototype.hasOwnProperty,Ce=typeof Map<"u";function ye(){this._array=[],this._set=Ce?new Map:Object.create(null)}ye.fromArray=function(e,r){for(var n=new ye,i=0,a=e.length;i<a;i++)n.add(e[i],r);return n};ye.prototype.size=function(){return Ce?this._set.size:Object.getOwnPropertyNames(this._set).length};ye.prototype.add=function(e,r){var n=Ce?e:Ur.toSetString(e),i=Ce?this.has(e):qr.call(this._set,n),a=this._array.length;(!i||r)&&this._array.push(e),i||(Ce?this._set.set(e,a):this._set[n]=a)};ye.prototype.has=function(e){if(Ce)return this._set.has(e);var r=Ur.toSetString(e);return qr.call(this._set,r)};ye.prototype.indexOf=function(e){if(Ce){var r=this._set.get(e);if(r>=0)return r}else{var n=Ur.toSetString(e);if(qr.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};ye.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};ye.prototype.toArray=function(){return this._array.slice()};ta.ArraySet=ye});var ia=N(na=>{var ra=Xe();function Fu(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,a=e.generatedColumn;return n>r||n==r&&a>=i||ra.compareByGeneratedPositionsInflated(t,e)<=0}function jt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}jt.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};jt.prototype.add=function(e){Fu(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};jt.prototype.toArray=function(){return this._sorted||(this._array.sort(ra.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};na.MappingList=jt});var Br=N(aa=>{var mt=Vr(),H=Xe(),Bt=jr().ArraySet,Mu=ia().MappingList;function le(t){t||(t={}),this._file=H.getArg(t,"file",null),this._sourceRoot=H.getArg(t,"sourceRoot",null),this._skipValidation=H.getArg(t,"skipValidation",!1),this._sources=new Bt,this._names=new Bt,this._mappings=new Mu,this._sourcesContents=null}le.prototype._version=3;le.fromSourceMap=function(e){var r=e.sourceRoot,n=new le({file:e.file,sourceRoot:r});return e.eachMapping(function(i){var a={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(a.source=i.source,r!=null&&(a.source=H.relative(r,a.source)),a.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(a.name=i.name)),n.addMapping(a)}),e.sources.forEach(function(i){var a=i;r!==null&&(a=H.relative(r,i)),n._sources.has(a)||n._sources.add(a);var s=e.sourceContentFor(i);s!=null&&n.setSourceContent(i,s)}),n};le.prototype.addMapping=function(e){var r=H.getArg(e,"generated"),n=H.getArg(e,"original",null),i=H.getArg(e,"source",null),a=H.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,i,a),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:a})};le.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=H.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[H.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[H.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};le.prototype.applySourceMap=function(e,r,n){var i=r;if(r==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 a=this._sourceRoot;a!=null&&(i=H.relative(a,i));var s=new Bt,o=new Bt;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=H.join(n,u.source)),a!=null&&(u.source=H.relative(a,u.source)),u.originalLine=l.line,u.originalColumn=l.column,l.name!=null&&(u.name=l.name))}var c=u.source;c!=null&&!s.has(c)&&s.add(c);var m=u.name;m!=null&&!o.has(m)&&o.add(m)},this),this._sources=s,this._names=o,e.sources.forEach(function(u){var l=e.sourceContentFor(u);l!=null&&(n!=null&&(u=H.join(n,u)),a!=null&&(u=H.relative(a,u)),this.setSourceContent(u,l))},this)};le.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.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&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i}))}};le.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,a=0,s=0,o="",u,l,c,m,f=this._mappings.toArray(),d=0,h=f.length;d<h;d++){if(l=f[d],u="",l.generatedLine!==r)for(e=0;l.generatedLine!==r;)u+=";",r++;else if(d>0){if(!H.compareByGeneratedPositionsInflated(l,f[d-1]))continue;u+=","}u+=mt.encode(l.generatedColumn-e),e=l.generatedColumn,l.source!=null&&(m=this._sources.indexOf(l.source),u+=mt.encode(m-s),s=m,u+=mt.encode(l.originalLine-1-i),i=l.originalLine-1,u+=mt.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(c=this._names.indexOf(l.name),u+=mt.encode(c-a),a=c)),o+=u}return o};le.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=H.relative(r,n));var i=H.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};le.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};le.prototype.toString=function(){return JSON.stringify(this.toJSON())};aa.SourceMapGenerator=le});var sa=N(Ne=>{Ne.GREATEST_LOWER_BOUND=1;Ne.LEAST_UPPER_BOUND=2;function Gr(t,e,r,n,i,a){var s=Math.floor((e-t)/2)+t,o=i(r,n[s],!0);return o===0?s:o>0?e-s>1?Gr(s,e,r,n,i,a):a==Ne.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-t>1?Gr(t,s,r,n,i,a):a==Ne.LEAST_UPPER_BOUND?s:t<0?-1:t}Ne.search=function(e,r,n,i){if(r.length===0)return-1;var a=Gr(-1,r.length,e,r,n,i||Ne.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&n(r[a],r[a-1],!0)===0;)--a;return a}});var ua=N(oa=>{function Hr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function xu(t,e){return Math.round(t+Math.random()*(e-t))}function zr(t,e,r,n){if(r<n){var i=xu(r,n),a=r-1;Hr(t,i,n);for(var s=t[n],o=r;o<n;o++)e(t[o],s)<=0&&(a+=1,Hr(t,a,o));Hr(t,a+1,o);var u=a+1;zr(t,e,r,u-1),zr(t,e,u+1,n)}}oa.quickSort=function(t,e){zr(t,e,0,t.length-1)}});var ca=N(Gt=>{var O=Xe(),Xr=sa(),We=jr().ArraySet,Cu=Vr(),pt=ua().quickSort;function j(t,e){var r=t;return typeof t=="string"&&(r=O.parseSourceMapInput(t)),r.sections!=null?new ce(r,e):new Q(r,e)}j.fromSourceMap=function(t,e){return Q.fromSourceMap(t,e)};j.prototype._version=3;j.prototype.__generatedMappings=null;Object.defineProperty(j.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});j.prototype.__originalMappings=null;Object.defineProperty(j.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});j.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};j.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};j.GENERATED_ORDER=1;j.ORIGINAL_ORDER=2;j.GREATEST_LOWER_BOUND=1;j.LEAST_UPPER_BOUND=2;j.prototype.eachMapping=function(e,r,n){var i=r||null,a=n||j.GENERATED_ORDER,s;switch(a){case j.GENERATED_ORDER:s=this._generatedMappings;break;case j.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var o=this.sourceRoot;s.map(function(u){var l=u.source===null?null:this._sources.at(u.source);return l=O.computeSourceURL(o,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)};j.prototype.allGeneratedPositionsFor=function(e){var r=O.getArg(e,"line"),n={source:O.getArg(e,"source"),originalLine:r,originalColumn:O.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",O.compareByOriginalPositions,Xr.LEAST_UPPER_BOUND);if(a>=0){var s=this._originalMappings[a];if(e.column===void 0)for(var o=s.originalLine;s&&s.originalLine===o;)i.push({line:O.getArg(s,"generatedLine",null),column:O.getArg(s,"generatedColumn",null),lastColumn:O.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var u=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==u;)i.push({line:O.getArg(s,"generatedLine",null),column:O.getArg(s,"generatedColumn",null),lastColumn:O.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i};Gt.SourceMapConsumer=j;function Q(t,e){var r=t;typeof t=="string"&&(r=O.parseSourceMapInput(t));var n=O.getArg(r,"version"),i=O.getArg(r,"sources"),a=O.getArg(r,"names",[]),s=O.getArg(r,"sourceRoot",null),o=O.getArg(r,"sourcesContent",null),u=O.getArg(r,"mappings"),l=O.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=O.normalize(s)),i=i.map(String).map(O.normalize).map(function(c){return s&&O.isAbsolute(s)&&O.isAbsolute(c)?O.relative(s,c):c}),this._names=We.fromArray(a.map(String),!0),this._sources=We.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(c){return O.computeSourceURL(s,c,e)}),this.sourceRoot=s,this.sourcesContent=o,this._mappings=u,this._sourceMapURL=e,this.file=l}Q.prototype=Object.create(j.prototype);Q.prototype.consumer=j;Q.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=O.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};Q.fromSourceMap=function(e,r){var n=Object.create(Q.prototype),i=n._names=We.fromArray(e._names.toArray(),!0),a=n._sources=We.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(d){return O.computeSourceURL(n.sourceRoot,d,r)});for(var s=e._mappings.toArray().slice(),o=n.__generatedMappings=[],u=n.__originalMappings=[],l=0,c=s.length;l<c;l++){var m=s[l],f=new la;f.generatedLine=m.generatedLine,f.generatedColumn=m.generatedColumn,m.source&&(f.source=a.indexOf(m.source),f.originalLine=m.originalLine,f.originalColumn=m.originalColumn,m.name&&(f.name=i.indexOf(m.name)),u.push(f)),o.push(f)}return pt(n.__originalMappings,O.compareByOriginalPositions),n};Q.prototype._version=3;Object.defineProperty(Q.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function la(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Q.prototype._parseMappings=function(e,r){for(var n=1,i=0,a=0,s=0,o=0,u=0,l=e.length,c=0,m={},f={},d=[],h=[],p,w,v,b,C;c<l;)if(e.charAt(c)===";")n++,c++,i=0;else if(e.charAt(c)===",")c++;else{for(p=new la,p.generatedLine=n,b=c;b<l&&!this._charIsMappingSeparator(e,b);b++);if(w=e.slice(c,b),v=m[w],v)c+=w.length;else{for(v=[];c<b;)Cu.decode(e,c,f),C=f.value,c=f.rest,v.push(C);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");m[w]=v}p.generatedColumn=i+v[0],i=p.generatedColumn,v.length>1&&(p.source=o+v[1],o+=v[1],p.originalLine=a+v[2],a=p.originalLine,p.originalLine+=1,p.originalColumn=s+v[3],s=p.originalColumn,v.length>4&&(p.name=u+v[4],u+=v[4])),h.push(p),typeof p.originalLine=="number"&&d.push(p)}pt(h,O.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,pt(d,O.compareByOriginalPositions),this.__originalMappings=d};Q.prototype._findMapping=function(e,r,n,i,a,s){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 Xr.search(e,r,a,s)};Q.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};Q.prototype.originalPositionFor=function(e){var r={generatedLine:O.getArg(e,"line"),generatedColumn:O.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",O.compareByGeneratedPositionsDeflated,O.getArg(e,"bias",j.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var a=O.getArg(i,"source",null);a!==null&&(a=this._sources.at(a),a=O.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var s=O.getArg(i,"name",null);return s!==null&&(s=this._names.at(s)),{source:a,line:O.getArg(i,"originalLine",null),column:O.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};Q.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};Q.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=O.relative(this.sourceRoot,i));var a;if(this.sourceRoot!=null&&(a=O.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if(a.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!a.path||a.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};Q.prototype.generatedPositionFor=function(e){var r=O.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:O.getArg(e,"line"),originalColumn:O.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",O.compareByOriginalPositions,O.getArg(e,"bias",j.GREATEST_LOWER_BOUND));if(i>=0){var a=this._originalMappings[i];if(a.source===n.source)return{line:O.getArg(a,"generatedLine",null),column:O.getArg(a,"generatedColumn",null),lastColumn:O.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Gt.BasicSourceMapConsumer=Q;function ce(t,e){var r=t;typeof t=="string"&&(r=O.parseSourceMapInput(t));var n=O.getArg(r,"version"),i=O.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new We,this._names=new We;var a={line:-1,column:0};this._sections=i.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var o=O.getArg(s,"offset"),u=O.getArg(o,"line"),l=O.getArg(o,"column");if(u<a.line||u===a.line&&l<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=o,{generatedOffset:{generatedLine:u+1,generatedColumn:l+1},consumer:new j(O.getArg(s,"map"),e)}})}ce.prototype=Object.create(j.prototype);ce.prototype.constructor=j;ce.prototype._version=3;Object.defineProperty(ce.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});ce.prototype.originalPositionFor=function(e){var r={generatedLine:O.getArg(e,"line"),generatedColumn:O.getArg(e,"column")},n=Xr.search(r,this._sections,function(a,s){var o=a.generatedLine-s.generatedOffset.generatedLine;return o||a.generatedColumn-s.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};ce.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};ce.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],a=i.consumer.sourceContentFor(e,!0);if(a)return a}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};ce.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(O.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var a={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return a}}}return{line:null,column:null}};ce.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],a=i.consumer._generatedMappings,s=0;s<a.length;s++){var o=a[s],u=i.consumer._sources.at(o.source);u=O.computeSourceURL(i.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;o.name&&(l=i.consumer._names.at(o.name),this._names.add(l),l=this._names.indexOf(l));var c={source:u,generatedLine:o.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(i.generatedOffset.generatedLine===o.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:l};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}pt(this.__generatedMappings,O.compareByGeneratedPositionsDeflated),pt(this.__originalMappings,O.compareByOriginalPositions)};Gt.IndexedSourceMapConsumer=ce});var da=N(fa=>{var Nu=Br().SourceMapGenerator,Ht=Xe(),ku=/(\r?\n)/,Iu=10,Qe="$$$isSourceNode$$$";function ae(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[Qe]=!0,n!=null&&this.add(n)}ae.fromStringWithSourceMap=function(e,r,n){var i=new ae,a=e.split(ku),s=0,o=function(){var f=h(),d=h()||"";return f+d;function h(){return s<a.length?a[s++]:void 0}},u=1,l=0,c=null;return r.eachMapping(function(f){if(c!==null)if(u<f.generatedLine)m(c,o()),u++,l=0;else{var d=a[s]||"",h=d.substr(0,f.generatedColumn-l);a[s]=d.substr(f.generatedColumn-l),l=f.generatedColumn,m(c,h),c=f;return}for(;u<f.generatedLine;)i.add(o()),u++;if(l<f.generatedColumn){var d=a[s]||"";i.add(d.substr(0,f.generatedColumn)),a[s]=d.substr(f.generatedColumn),l=f.generatedColumn}c=f},this),s<a.length&&(c&&m(c,o()),i.add(a.splice(s).join(""))),r.sources.forEach(function(f){var d=r.sourceContentFor(f);d!=null&&(n!=null&&(f=Ht.join(n,f)),i.setSourceContent(f,d))}),i;function m(f,d){if(f===null||f.source===void 0)i.add(d);else{var h=n?Ht.join(n,f.source):f.source;i.add(new ae(f.originalLine,f.originalColumn,h,d,f.name))}}};ae.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[Qe]||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};ae.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[Qe]||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};ae.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[Qe]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};ae.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};ae.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[Qe]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};ae.prototype.setSourceContent=function(e,r){this.sourceContents[Ht.toSetString(e)]=r};ae.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Qe]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(Ht.fromSetString(i[r]),this.sourceContents[i[r]])};ae.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};ae.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new Nu(e),i=!1,a=null,s=null,o=null,u=null;return this.walk(function(l,c){r.code+=l,c.source!==null&&c.line!==null&&c.column!==null?((a!==c.source||s!==c.line||o!==c.column||u!==c.name)&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:r.line,column:r.column},name:c.name}),a=c.source,s=c.line,o=c.column,u=c.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),a=null,i=!1);for(var m=0,f=l.length;m<f;m++)l.charCodeAt(m)===Iu?(r.line++,r.column=0,m+1===f?(a=null,i=!1):i&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:r.line,column:r.column},name:c.name})):r.column++}),this.walkSourceContents(function(l,c){n.setSourceContent(l,c)}),{code:r.code,map:n}};fa.SourceNode=ae});var ha=N(zt=>{zt.SourceMapGenerator=Br().SourceMapGenerator;zt.SourceMapConsumer=ca().SourceMapConsumer;zt.SourceNode=da().SourceNode});var pa=N((_f,ma)=>{var $u=Object.prototype.toString,Wr=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Yu(t){return $u.call(t).slice(8,-1)==="ArrayBuffer"}function Vu(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return Wr?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}function Pu(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Wr?Buffer.from(t,e):new Buffer(t,e)}function Uu(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Yu(t)?Vu(t,e,r):typeof t=="string"?Pu(t,e):Wr?Buffer.from(t):new Buffer(t)}ma.exports=Uu});var Ra=N((Ie,Kr)=>{var qu=ha().SourceMapConsumer,Qr=require("path"),me;try{me=require("fs"),(!me.existsSync||!me.readFileSync)&&(me=null)}catch{}var ju=pa();function ga(t,e){return t.require(e)}var va=!1,ya=!1,Jr=!1,gt="auto",ke={},vt={},Bu=/^data:application\/json[^,]+base64,/,Oe=[],Le=[];function en(){return gt==="browser"?!0:gt==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Gu(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function Hu(){return typeof process=="object"&&process!==null?process.version:""}function zu(){if(typeof process=="object"&&process!==null)return process.stderr}function Xu(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}function Xt(t){return function(e){for(var r=0;r<t.length;r++){var n=t[r](e);if(n)return n}return null}}var tn=Xt(Oe);Oe.push(function(t){if(t=t.trim(),/^file:/.test(t)&&(t=t.replace(/file:\/\/\/(\w:)?/,function(n,i){return i?"":"/"})),t in ke)return ke[t];var e="";try{if(me)me.existsSync(t)&&(e=me.readFileSync(t,"utf8"));else{var r=new XMLHttpRequest;r.open("GET",t,!1),r.send(null),r.readyState===4&&r.status===200&&(e=r.responseText)}}catch{}return ke[t]=e});function Zr(t,e){if(!t)return e;var r=Qr.dirname(t),n=/^\w+:\/\/[^\/]*/.exec(r),i=n?n[0]:"",a=r.slice(i.length);return i&&/^\/\w\:/.test(a)?(i+="/",i+Qr.resolve(r.slice(i.length),e).replace(/\\/g,"/")):i+Qr.resolve(r.slice(i.length),e)}function Wu(t){var e;if(en())try{var r=new XMLHttpRequest;r.open("GET",t,!1),r.send(null),e=r.readyState===4?r.responseText:null;var n=r.getResponseHeader("SourceMap")||r.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=tn(t);for(var i=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,a,s;s=i.exec(e);)a=s;return a?a[1]:null}var rn=Xt(Le);Le.push(function(t){var e=Wu(t);if(!e)return null;var r;if(Bu.test(e)){var n=e.slice(e.indexOf(",")+1);r=ju(n,"base64").toString(),e=t}else e=Zr(t,e),r=tn(e);return r?{url:e,map:r}:null});function nn(t){var e=vt[t.source];if(!e){var r=rn(t.source);r?(e=vt[t.source]={url:r.url,map:new qu(r.map)},e.map.sourcesContent&&e.map.sources.forEach(function(i,a){var s=e.map.sourcesContent[a];if(s){var o=Zr(e.url,i);ke[o]=s}})):e=vt[t.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(t);if(n.source!==null)return n.source=Zr(e.url,n.source),n}return t}function Da(t){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(t);if(e){var r=nn({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+r.source+":"+r.line+":"+(r.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(t),e?"eval at "+e[1]+" ("+Da(e[2])+")":t}function Qu(){var t,e="";if(this.isNative())e="native";else{t=this.getScriptNameOrSourceURL(),!t&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),t?e+=t:e+="<anonymous>";var r=this.getLineNumber();if(r!=null){e+=":"+r;var n=this.getColumnNumber();n&&(e+=":"+n)}}var i="",a=this.getFunctionName(),s=!0,o=this.isConstructor(),u=!(this.isToplevel()||o);if(u){var l=this.getTypeName();l==="[object Object]"&&(l="null");var c=this.getMethodName();a?(l&&a.indexOf(l)!=0&&(i+=l+"."),i+=a,c&&a.indexOf("."+c)!=a.length-c.length-1&&(i+=" [as "+c+"]")):i+=l+"."+(c||"<anonymous>")}else o?i+="new "+(a||"<anonymous>"):a?i+=a:(i+=e,s=!1);return s&&(i+=" ("+e+")"),i}function Sa(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(r){e[r]=/^(?:is|get)/.test(r)?function(){return t[r].call(t)}:t[r]}),e.toString=Qu,e}function Ea(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var r=t.getFileName()||t.getScriptNameOrSourceURL();if(r){var n=t.getLineNumber(),i=t.getColumnNumber()-1,a=/^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)/,s=a.test(Hu())?0:62;n===1&&i>s&&!en()&&!t.isEval()&&(i-=s);var o=nn({source:r,line:n,column:i});e.curPosition=o,t=Sa(t);var u=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},t.getFileName=function(){return o.source},t.getLineNumber=function(){return o.line},t.getColumnNumber=function(){return o.column+1},t.getScriptNameOrSourceURL=function(){return o.source},t}var l=t.isEval()&&t.getEvalOrigin();return l&&(l=Da(l),t=Sa(t),t.getEvalOrigin=function(){return l}),t}function Ju(t,e){Jr&&(ke={},vt={});for(var r=t.name||"Error",n=t.message||"",i=r+": "+n,a={nextPosition:null,curPosition:null},s=[],o=e.length-1;o>=0;o--)s.push(`
    at `+Ea(e[o],a)),a.nextPosition=a.curPosition;return a.curPosition=a.nextPosition=null,i+s.reverse().join("")}function _a(t){var e=/\n    at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],i=+e[3],a=ke[r];if(!a&&me&&me.existsSync(r))try{a=me.readFileSync(r,"utf8")}catch{a=""}if(a){var s=a.split(/(?:\r\n|\r|\n)/)[n-1];if(s)return r+":"+n+`
`+s+`
`+new Array(i).join(" ")+"^"}}return null}function Zu(t){var e=_a(t),r=zu();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Xu(1)}function Ku(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(r&&!n)return Zu(arguments[1])}return t.apply(this,arguments)}}var el=Oe.slice(0),tl=Le.slice(0);Ie.wrapCallSite=Ea;Ie.getErrorSource=_a;Ie.mapSourcePosition=nn;Ie.retrieveSourceMap=rn;Ie.install=function(t){if(t=t||{},t.environment&&(gt=t.environment,["node","browser","auto"].indexOf(gt)===-1))throw new Error("environment "+gt+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(Oe.length=0),Oe.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(Le.length=0),Le.unshift(t.retrieveSourceMap)),t.hookRequire&&!en()){var e=ga(Kr,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(a,s){return ke[s]=a,vt[s]=void 0,r.call(this,a,s)},e.prototype._compile.__sourceMapSupport=!0)}if(Jr||(Jr="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),va||(va=!0,Error.prepareStackTrace=Ju),!ya){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var i=ga(Kr,"worker_threads");i.isMainThread===!1&&(n=!1)}catch{}n&&Gu()&&(ya=!0,Ku())}};Ie.resetRetrieveHandlers=function(){Oe.length=0,Le.length=0,Oe=el.slice(0),Le=tl.slice(0),rn=Xt(Le),tn=Xt(Oe)}});var xa=N((bf,Z)=>{var rl="1.8.15",wa=0,Ze=function(e){var r=["XXX: "+e].concat(Array.prototype.slice.call(arguments,1));console.error.apply(this,r)},Ze=function(){},Ye;typeof process<"u"&&process.versions&&(process.versions.nw?Ye="nw":process.versions.node&&(Ye="node"));!Ye&&typeof window<"u"&&window.window===window&&(Ye="browser");if(!Ye)throw new Error("unknown runtime environment");var Wt,Se,Je;if(Ye==="browser")Wt={hostname:function(){return window.location.host}},Se={},Je=null;else{Wt=require("os"),Se=require("fs");try{Je=require("dtrace-provider")}catch{Je=null}}var Ee=require("util"),De=require("assert"),_t=require("events").EventEmitter,nl=require("stream");try{St=Vn()}catch{St=null}var St;process.env.BUNYAN_TEST_NO_SAFE_JSON_STRINGIFY&&(St=null);try{Dt=ji()}catch{Dt=null}var Dt;try{Qt=Ra()}catch{Qt=null}var Qt;function $e(t){if(t==null)return t;if(Array.isArray(t))return t.slice();if(typeof t=="object"){var e={};return Object.keys(t).forEach(function(r){e[r]=t[r]}),e}else return t}var J=Ee.format;J||(an=Ee.inspect,ba=/%[sdj%]/g,J=function(e){if(typeof e!="string"){for(var r=[],n=0;n<arguments.length;n++)r.push(an(arguments[n]));return r.join(" ")}for(var n=1,i=arguments,a=i.length,s=String(e).replace(ba,function(u){if(n>=a)return u;switch(u){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":return Ma(i[n++]);case"%%":return"%";default:return u}}),o=i[n];n<a;o=i[++n])o===null||typeof o!="object"?s+=" "+o:s+=" "+an(o);return s});var an,ba;function un(){if(this!==void 0){var t={},e=Error.stackTraceLimit,r=Error.prepareStackTrace;return Error.stackTraceLimit=3,Error.prepareStackTrace=function(n,i){var a=i[2];Qt&&(a=Qt.wrapCallSite(a)),t.file=a.getFileName(),t.line=a.getLineNumber();var s=a.getFunctionName();s&&(t.func=s)},Error.captureStackTrace(this,un),this.stack,Error.stackTraceLimit=e,Error.prepareStackTrace=r,t}}function il(t,e){e||(e="    ");var r=t.split(/\r?\n/g);return e+r.join(`
`+e)}function ln(t,e){if(De.ok(t),e){if(sn[e])return;sn[e]=!0}process.stderr.write(t+`
`)}function al(t){return sn[t]}var sn={};function Aa(){}Aa.prototype.write=function(t){t.level<Rt?console.log(t):t.level<Jt?console.info(t):t.level<Zt?console.warn(t):console.error(t)};var cn=10,fn=20,Rt=30,Jt=40,Zt=50,dn=60,Ke={trace:cn,debug:fn,info:Rt,warn:Jt,error:Zt,fatal:dn},Oa={};Object.keys(Ke).forEach(function(t){Oa[Ke[t]]=t});var yt=void 0,on=Je&&{};function Et(t){var e,r=typeof t;if(r==="string"){if(e=Ke[t.toLowerCase()],!e)throw new Error(J('unknown level name: "%s"',t))}else{if(r!=="number")throw new TypeError(J("cannot resolve level: invalid arg (%s):",r,t));if(t<0||Math.floor(t)!==t)throw new TypeError(J("level is not a positive integer: %s",t));e=t}return e}function sl(t){return t instanceof nl.Writable?!0:typeof t.write=="function"}function B(t,e,r){if(Ze("Logger start:",t),!(this instanceof B))return new B(t,e);var n;if(e!==void 0&&(n=t,t=e,!(n instanceof B)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!t)throw new TypeError("options (object) is required");if(n){if(t.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!t.name)throw new TypeError("options.name (string) is required");if(t.stream&&t.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(t.streams&&!Array.isArray(t.streams))throw new TypeError("invalid options.streams: must be an array");if(t.serializers&&(typeof t.serializers!="object"||Array.isArray(t.serializers)))throw new TypeError("invalid options.serializers: must be an object");if(_t.call(this),n&&r){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),a=0;a<i.length;a++){var s=i[a];f[s]=n.fields[s]}for(var o=Object.keys(t),a=0;a<o.length;a++){var s=o[a];f[s]=t[s]}return}var u=this;if(n){this._level=n._level,this.streams=[];for(var a=0;a<n.streams.length;a++){var l=$e(n.streams[a]);l.closeOnExit=!1,this.streams.push(l)}this.serializers=$e(n.serializers),this.src=n.src,this.fields=$e(n.fields),t.level&&this.level(t.level)}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};if(!yt&&Je){yt=Je.createDTraceProvider("bunyan");for(var c in Ke){var m;on[Ke[c]]=m=yt.addProbe("log-"+c,"char *"),m.dtp=yt}yt.enable()}t.stream?u.addStream({type:"stream",stream:t.stream,closeOnExit:!1,level:t.level}):t.streams?t.streams.forEach(function(d){u.addStream(d,t.level)}):n&&t.level?this.level(t.level):n||(Ye==="browser"?u.addStream({type:"raw",stream:new Aa,closeOnExit:!1,level:t.level}):u.addStream({type:"stream",stream:process.stdout,closeOnExit:!1,level:t.level})),t.serializers&&u.addSerializers(t.serializers),t.src&&(this.src=!0),Ze("Logger: ",u);var f=$e(t);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=Wt.hostname()),f.pid||(f.pid=process.pid),Object.keys(f).forEach(function(d){u.fields[d]=f[d]})}Ee.inherits(B,_t);B.prototype.addStream=function(e,r){var n=this;switch(r==null&&(r=Rt),e=$e(e),e.type||(e.stream?e.type="stream":e.path&&(e.type="file")),e.raw=e.type==="raw",e.level!==void 0?e.level=Et(e.level):e.level=Et(r),e.level<n._level&&(n._level=e.level),e.type){case"stream":De.ok(sl(e.stream),'"stream" stream is not writable: '+Ee.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":De.ok(!e.stream,'"rotating-file" stream should not give a "stream"'),De.ok(e.path),De.ok(Dt,'"rotating-file" stream type is not supported: missing "mv" module'),e.stream=new se(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(a){n.emit("error",a,e)}),n.streams.push(e),delete n.haveNonRawStreams};B.prototype.addSerializers=function(e){var r=this;r.serializers||(r.serializers={}),Object.keys(e).forEach(function(n){var i=e[n];if(typeof i!="function")throw new TypeError(J('invalid serializer for "%s" field: must be a function',n));r.serializers[n]=i})};B.prototype.child=function(t,e){return new this.constructor(this,t||{},e)};B.prototype.reopenFileStreams=function(){var t=this;t.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(r){t.emit("error",r,e)}))})};B.prototype.level=function(e){if(e===void 0)return this._level;for(var r=Et(e),n=this.streams.length,i=0;i<n;i++)this.streams[i].level=r;this._level=r};B.prototype.levels=function(e,r){if(e===void 0)return De.equal(r,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,a=0;a<i;a++){var s=this.streams[a];if(s.name===e){n=s;break}}if(!n)throw new Error(J('no stream with name "%s"',e))}if(r===void 0)return n.level;var o=Et(r);n.level=o,o<this._level&&(this._level=o)};B.prototype._applySerializers=function(t,e){var r=this;Ze("_applySerializers: excludeFields",e),Object.keys(this.serializers).forEach(function(n){if(!(t[n]===void 0||e&&e[n])){Ze('_applySerializers; apply to "%s" key',n);try{t[n]=r.serializers[n](t[n])}catch(i){ln(J(`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)),t[n]=J('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',n)}}})};B.prototype._emit=function(t,e){var r;if(this.haveNonRawStreams===void 0){for(this.haveNonRawStreams=!1,r=0;r<this.streams.length;r++)if(!this.streams[r].raw){this.haveNonRawStreams=!0;break}}var n;if((e||this.haveNonRawStreams)&&(n=Ma(t)+Wt.EOL),e)return n;var i=t.level;for(r=0;r<this.streams.length;r++){var a=this.streams[r];a.level<=i&&(Ze('writing log rec "%s" to "%s" stream (%d <= %d): %j',t.msg,a.type,a.level,i,t),a.stream.write(a.raw?t:n))}return n};function La(t,e,r){var n,i,a;r[0]instanceof Error?(i={err:t.serializers&&t.serializers.err?t.serializers.err(r[0]):B.stdSerializers.err(r[0])},n={err:!0},r.length===1?a=[i.err.message]:a=r.slice(1)):typeof r[0]!="object"||Array.isArray(r[0])?(i=null,a=r.slice()):Buffer.isBuffer(r[0])?(i=null,a=r.slice(),a[0]=Ee.inspect(a[0])):(i=r[0],i&&r.length===1&&i.err&&i.err instanceof Error?a=[i.err.message]:a=r.slice(1));var s=$e(t.fields),o=s.level=e,u=i?$e(i):null;return u&&(t.serializers&&t._applySerializers(u,n),Object.keys(u).forEach(function(l){s[l]=u[l]})),s.msg=J.apply(t,a),s.time||(s.time=new Date),t.src&&!s.src&&(s.src=un()),s.v=wa,s}function ol(t,e,r,n){return[t||e._emit(La(e,r,n),!0)]}function et(t){return function(){var e=this,r=null,n=null;if(this._emit){if(arguments.length===0)return this._level<=t}else{var i="unbound";if(!al[i]){var a=un();ln(J("bunyan usage error: %s:%s: attempt to log with an unbound log method: `this` is: %s",a.file,a.line,Ee.inspect(this)),i)}return}for(var s=new Array(arguments.length),o=0;o<s.length;++o)s[o]=arguments[o];this._level<=t&&(n=La(e,t,s),r=this._emit(n)),on&&on[t].fire(ol,r,e,t,s)}}B.prototype.trace=et(cn);B.prototype.debug=et(fn);B.prototype.info=et(Rt);B.prototype.warn=et(Jt);B.prototype.error=et(Zt);B.prototype.fatal=et(dn);B.stdSerializers={};B.stdSerializers.req=function(t){return!t||!t.connection?t:{method:t.method,url:t.originalUrl||t.url,headers:t.headers,remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort}};B.stdSerializers.res=function(t){return!t||!t.statusCode?t:{statusCode:t.statusCode,header:t._header}};function Ta(t){var e=t.stack||t.toString();if(t.cause&&typeof t.cause=="function"){var r=t.cause();r&&(e+=`
Caused by: `+Ta(r))}return e}var Rf=B.stdSerializers.err=function(t){if(!t||!t.stack)return t;var e={message:t.message,name:t.name,stack:Ta(t),code:t.code,signal:t.signal};return e};function ul(){var t=new Set;return function(e,r){return!r||typeof r!="object"?r:t.has(r)?"[Circular]":(t.add(r),r)}}function ll(){var t=[];return function(e,r){return!r||typeof r!="object"?r:t.indexOf(r)!==-1?"[Circular]":(t.push(r),r)}}var Fa=typeof Set<"u"?ul:ll;function Ma(t){try{return JSON.stringify(t)}catch{try{return JSON.stringify(t,Fa())}catch(n){if(St)return St(t);var e=n.stack.split(/\n/g,3).join(`
`);return ln('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+il(J(`%s
%s`,Ee.inspect(t),n.stack)),e),J("(Exception in JSON.stringify(rec): %j. See stderr for details.)",n.message)}}}var se=null;Dt&&(se=function(e){if(this.path=e.path,this.count=e.count==null?10:e.count,De.equal(typeof this.count,"number",J('rotating-file stream "count" is not a number: %j (%s) in %j',this.count,typeof this.count,this)),De.ok(this.count>=0,J('rotating-file stream "count" is not >= 0: %j in %j',this.count,this)),e.period){var r={hourly:"1h",daily:"1d",weekly:"1w",monthly:"1m",yearly:"1y"}[e.period]||e.period,n=/^([1-9][0-9]*)([hdwmy]|ms)$/.exec(r);if(!n)throw new Error(J('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 a=Se.statSync(this.path);i=a.mtime.getTime()}catch{}var s=!1;if(i){var o=this._calcRotTime(0);i<o&&(s=!0)}this.stream=Se.createWriteStream(this.path,{flags:"a",encoding:"utf8"}),this.rotQueue=[],this.rotating=!1,s?(this._debug("rotateAfterOpen -> call rotate()"),this.rotate()):this._setupNextRot()},Ee.inherits(se,_t),se.prototype._debug=function(){if(0)var t;else return!1},se.prototype._setupNextRot=function(){this.rotAt=this._calcRotTime(1),this._setRotationTimer()},se.prototype._setRotationTimer=function(){var t=this,e=this.rotAt-Date.now(),r=2147483647;e>r&&(e=r),this.timeout=setTimeout(function(){t._debug("_setRotationTimer timeout -> call rotate()"),t.rotate()},e),typeof this.timeout.unref=="function"&&this.timeout.unref()},se.prototype._calcRotTime=function(e){this._debug("_calcRotTime: %s%s",this.periodNum,this.periodScope);var r=new Date;this._debug("  now local: %s",r),this._debug("    now utc: %s",r.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(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),r.getUTCHours()+e);break;case"d":this.rotAt?n=this.rotAt+this.periodNum*24*60*60*1e3*e:n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()+e);break;case"w":if(this.rotAt)n=this.rotAt+this.periodNum*7*24*60*60*1e3*e;else{var i=7-r.getUTCDay();e<1&&(i=-r.getUTCDay()),(e>1||e<-1)&&(i+=7*e),n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()+i)}break;case"m":this.rotAt?n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+this.periodNum*e,1):n=Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+e,1);break;case"y":this.rotAt?n=Date.UTC(r.getUTCFullYear()+this.periodNum*e,0,1):n=Date.UTC(r.getUTCFullYear()+e,0,1);break;default:De.fail(J('invalid period scope: "%s"',this.periodScope))}if(this._debug()){this._debug("  **rotAt**: %s (utc: %s)",n,new Date(n).toUTCString());var a=Date.now();this._debug("        now: %s (%sms == %smin == %sh to go)",a,n-a,(n-a)/1e3/60,(n-a)/1e3/60/60)}return n},se.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 r(){var s=e.path+"."+String(a-1);a===0&&(s=e.path),a-=1,e._debug("  rm %s",s),Se.unlink(s,function(o){n()})}function n(){if(e.count===0||a<0)return i();var s=e.path,o=e.path+"."+String(a);a>0&&(s+="."+String(a-1)),a-=1,Se.exists(s,function(u){u?(e._debug("  mv %s %s",s,o),Dt(s,o,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 s=e.rotQueue,o=s.length,u=0;u<o;u++)e.stream.write(s[u]);e.rotQueue=[],e.rotating=!1,e.emit("drain"),e._setupNextRot()}var a=this.count;r()},se.prototype.write=function(e){return this.rotating?(this.rotQueue.push(e),!1):this.stream.write(e)},se.prototype.end=function(e){this.stream.end()},se.prototype.destroy=function(e){this.stream.destroy()},se.prototype.destroySoon=function(e){this.stream.destroySoon()});function tt(t){this.limit=t&&t.limit?t.limit:100,this.writable=!0,this.records=[],_t.call(this)}Ee.inherits(tt,_t);tt.prototype.write=function(t){if(!this.writable)throw new Error("RingBuffer has been ended already");return this.records.push(t),this.records.length>this.limit&&this.records.shift(),!0};tt.prototype.end=function(){arguments.length>0&&this.write.apply(this,Array.prototype.slice.call(arguments)),this.writable=!1};tt.prototype.destroy=function(){this.writable=!1,this.emit("close")};tt.prototype.destroySoon=function(){this.destroy()};Z.exports=B;Z.exports.TRACE=cn;Z.exports.DEBUG=fn;Z.exports.INFO=Rt;Z.exports.WARN=Jt;Z.exports.ERROR=Zt;Z.exports.FATAL=dn;Z.exports.resolveLevel=Et;Z.exports.levelFromName=Ke;Z.exports.nameFromLevel=Oa;Z.exports.VERSION=rl;Z.exports.LOG_VERSION=wa;Z.exports.createLogger=function(e){return new B(e)};Z.exports.RingBuffer=tt;Z.exports.RotatingFileStream=se;Z.exports.safeCycles=Fa});var Na=N((wf,Ca)=>{var cl=Object.prototype.hasOwnProperty,fl=Object.prototype.toString,dl=function(t){var e=typeof t=="function"&&!(t instanceof RegExp)||fl.call(t)==="[object Function]";return!e&&typeof window<"u"&&(e=t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt),e};Ca.exports=function(e,r){if(!dl(r))throw new TypeError("iterator must be a function");var n,i,a=typeof e=="string",s=e.length,o=arguments.length>2?arguments[2]:null;if(s===+s)for(n=0;n<s;n++)o===null?r(a?e.charAt(n):e[n],n,e):r.call(o,a?e.charAt(n):e[n],n,e);else for(i in e)cl.call(e,i)&&(o===null?r(e[i],i,e):r.call(o,e[i],i,e))}});var $a=N((Af,Ia)=>{var ka=Object.prototype.toString;Ia.exports=function(e){var r=ka.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&ka.call(e.callee)==="[object Function]"),n}});var Va=N((Of,Ya)=>{(function(){"use strict";var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=Na(),n=$a(),i=!{toString:null}.propertyIsEnumerable("toString"),a=function(){}.propertyIsEnumerable("prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o;o=function(l){var c=l!==null&&typeof l=="object",m=e.call(l)==="[object Function]",f=n(l),d=[];if(!c&&!m&&!f)throw new TypeError("Object.keys called on a non-object");if(f)r(l,function(b){d.push(b)});else{var h,p=a&&m;for(h in l)!(p&&h==="prototype")&&t.call(l,h)&&d.push(h)}if(i){var w=l.constructor,v=w&&w.prototype===l;r(s,function(b){!(v&&b==="constructor")&&t.call(l,b)&&d.push(b)})}return d},Ya.exports=o})()});var Ua=N((Lf,Pa)=>{Pa.exports=Object.keys||Va()});var ja=N((Tf,qa)=>{qa.exports=hl;function hl(t){return t!==null&&(typeof t=="object"||typeof t=="function")}});var hn=N((Ff,Ba)=>{var ml=Ua(),pl=ja();Ba.exports=gl;function gl(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];if(pl(r))for(var n=ml(r),i=0;i<n.length;i++){var a=n[i];t[a]=r[a]}}return t}});var Xa=N((Mf,za)=>{"use strict";var Ga={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},Ha={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},mn={};Object.keys(Ga).forEach(function(t){mn[t]=function(e){return"\x1B["+Ga[t]+"m"+e+"\x1B[39m"}});Object.keys(Ha).forEach(function(t){mn[t]=function(e){return"\x1B["+Ha[t]+"m"+e+"\x1B[49m"}});za.exports=mn});var Ja=N((xf,Qa)=>{"use strict";var pn={reset:[0,22],bright:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],blink:[5,25],inverse:[7,27]},Wa={};Object.keys(pn).forEach(function(t){Wa[t]=function(e){var r=pn[t][0],n=pn[t][1];return"\x1B["+r+"m"+e+"\x1B["+n+"m"}});Qa.exports=Wa});var vs=N((Cf,gs)=>{"use strict";var ts=require("util"),Te=ts.format,vl=require("http"),yl=hn(),Sl=Xa(),Dl=Ja(),El=yl(Dl,Sl),rs=1,ns=2,is=3,as=4,ss=5,os=6,_l={long:rs,json:ns,inspect:is,simple:as,short:ss,bunyan:os},us=10,ls=20,cs=30,fs=40,ds=50,hs=60,Za={trace:us,debug:ls,info:cs,warn:fs,error:ds,fatal:hs},Rl={},ms={},ps={};Object.keys(Za).forEach(function(t){var e=Za[t];Rl[e]=t,ms[e]=t.toUpperCase(),ps[e]=(t.length===4?" ":"")+t.toUpperCase()});function Ka(t){return!(t.v===null||t.level===null||t.name===null||t.hostname===null||t.pid===null||t.time===null||t.msg===null)}function rt(t){return"  "+t.split(/\r?\n/).join(`
  `)}function bl(t,e){if(!t)return"";var r=El[e];return r?r(t):t}function wl(t,e){return t}function es(t){switch(t){case us:return"TRACE";case ls:return"DEBUG";case cs:return"INFO";case fs:return"WARN";case ds:return"ERROR";case hs:return"FATAL"}}gs.exports=function(e,r){function n(F){var A="";if(F.header)A+=F.header.trimRight();else if(F.headers){F.statusCode&&(A+=Te(`HTTP/1.1 %s %s
`,F.statusCode,vl.STATUS_CODES[F.statusCode]));var E=F.headers;A+=Object.keys(E).map(function(y){return y+": "+E[y]}).join(`
`)}delete F.header,delete F.headers,delete F.statusCode,F.body&&(A+=`

`+(typeof F.body=="object"?JSON.stringify(F.body,null,2):F.body),delete F.body),F.trailer&&(A+=`
`+F.trailer),delete F.trailer,A&&b.push(rt(A)),Object.keys(F).forEach(function(y){e["res."+y]=F[y]})}var i=!1,a,s=e.line,o=r.color?bl:wl,u=isNaN(r.outputMode)?_l[r.outputMode]:r.outputMode;switch(u){case ss:i=!0;case rs:if(!Ka(e))return s+`
`;delete e.v,i&&e.time[10]=="T"?(a=e.time.substr(11),a=o(a,"brightBlack")):a=o("["+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=ps[e.level]||"LVL"+e.level;if(r.color){var m=r.colorFromLevel||{10:"brightBlack",20:"brightBlack",30:"cyan",40:"magenta",50:"red",60:"inverse"};c=o(c,m[e.level])}delete e.level;var f="",d,h,p="";e.src&&e.src.file&&(d=e.src,d.func?f=Te(" (%s:%d in %s)",d.file,d.line,d.func):f=Te(" (%s:%d)",d.file,d.line),f=o(f,"green")),delete e.src;var w=e.hostname;delete e.hostname;var v=[],b=[];e.req_id&&v.push("req_id="+e.req_id),delete e.req_id;var C;if(e.msg.indexOf(`
`)!==-1?(C="",b.push(rt(o(e.msg,"cyan")))):C=" "+o(e.msg,"cyan"),delete e.msg,e.req&&typeof e.req=="object"){var T=e.req;delete e.req,h=T.headers,d=Te("%s %s HTTP/%s%s",T.method,T.url,T.httpVersion||"1.1",h?`
`+Object.keys(h).map(function(F){return F+": "+h[F]}).join(`
`):""),delete T.url,delete T.method,delete T.httpVersion,delete T.headers,T.body&&(d+=`

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

`+(typeof x.body=="object"?JSON.stringify(x.body,null,2):x.body),delete x.body),Object.keys(x).forEach(function(F){e["client_req."+F]=x[F]}),b.push(rt(d))}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&&(b.push(rt(e.err.stack)),delete e.err);for(var V=Object.keys(e),Y=0;Y<V.length;Y++){var k=V[Y],L=e[k],q=!1;typeof L!="string"&&(L=JSON.stringify(L,null,2),q=!0),L.indexOf(`
`)!==-1||L.length>50?b.push(rt(k+": "+L)):!q&&(L.indexOf(" ")!=-1||L.length===0)?v.push(k+"="+JSON.stringify(L)):v.push(k+"="+L)}return v=o(v.length?" ("+v.join(", ")+")":"","brightBlack"),b=o(b.length?b.join(`
  --
`)+`
`:"","brightBlack"),i?Te(`%s %s %s:%s%s
%s`,a,c,l,C,v,b):Te(`%s %s: %s on %s%s:%s%s
%s`,a,c,l,w||"<no-hostname>",f,C,v,b);case is:return ts.inspect(e,!1,1/0,!0)+`
`;case os:return r.levelInString&&(e.level=es(e.level)),JSON.stringify(e,null,0)+`
`;case ns:return r.levelInString&&(e.level=es(e.level)),JSON.stringify(e,null,r.jsonIndent)+`
`;case as:return Ka(e)?Te(`%s - %s
`,ms[e.level]||"LVL"+e.level,e.msg):s+`
`;default:throw new Error("unknown output mode: "+r.outputMode)}}});var Ds=N((Nf,Ss)=>{"use strict";var Al=require("stream"),Ol=require("util"),Ll=vs(),Tl=hn(),ys=Al.Writable;Ss.exports=bt;Ol.inherits(bt,ys);function bt(t,e){if(!(this instanceof bt))return new bt(t,e);t=t||{},t.objectMode=!0,ys.call(this,t),this.opts=Tl({outputMode:"short",color:!0,colorFromLevel:{10:"brightBlack",20:"brightBlack",30:"green",40:"magenta",50:"red",60:"brightRed"}},t),this.out=e||process.stdout}bt.prototype._write=function(t,e,r){var n;try{n=JSON.parse(t),this.out.write(Ll(n,this.opts))}catch{this.out.write(t)}r()}});var nt=N((vn,yn)=>{(function(t,e){typeof vn=="object"&&typeof yn<"u"?yn.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(vn,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",s="hour",o="day",u="week",l="month",c="quarter",m="year",f="date",d="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var E=["th","st","nd","rd"],y=A%100;return"["+A+(E[(y-20)%10]||E[y]||E[0])+"]"}},v=function(A,E,y){var R=String(A);return!R||R.length>=E?A:""+Array(E+1-R.length).join(y)+A},b={s:v,z:function(A){var E=-A.utcOffset(),y=Math.abs(E),R=Math.floor(y/60),S=y%60;return(E<=0?"+":"-")+v(R,2,"0")+":"+v(S,2,"0")},m:function A(E,y){if(E.date()<y.date())return-A(y,E);var R=12*(y.year()-E.year())+(y.month()-E.month()),S=E.clone().add(R,l),g=y-S<0,D=E.clone().add(R+(g?-1:1),l);return+(-(R+(y-S)/(g?S-D:D-S))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:l,y:m,w:u,d:o,D:f,h:s,m:a,s:i,ms:n,Q:c}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},C="en",T={};T[C]=w;var x="$isDayjsObject",V=function(A){return A instanceof q||!(!A||!A[x])},Y=function A(E,y,R){var S;if(!E)return C;if(typeof E=="string"){var g=E.toLowerCase();T[g]&&(S=g),y&&(T[g]=y,S=g);var D=E.split("-");if(!S&&D.length>1)return A(D[0])}else{var _=E.name;T[_]=E,S=_}return!R&&S&&(C=S),S||!R&&C},k=function(A,E){if(V(A))return A.clone();var y=typeof E=="object"?E:{};return y.date=A,y.args=arguments,new q(y)},L=b;L.l=Y,L.i=V,L.w=function(A,E){return k(A,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var q=function(){function A(y){this.$L=Y(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[x]=!0}var E=A.prototype;return E.parse=function(y){this.$d=function(R){var S=R.date,g=R.utc;if(S===null)return new Date(NaN);if(L.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var D=S.match(h);if(D){var _=D[2]-1||0,M=(D[7]||"0").substring(0,3);return g?new Date(Date.UTC(D[1],_,D[3]||1,D[4]||0,D[5]||0,D[6]||0,M)):new Date(D[1],_,D[3]||1,D[4]||0,D[5]||0,D[6]||0,M)}}return new Date(S)}(y),this.init()},E.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},E.$utils=function(){return L},E.isValid=function(){return this.$d.toString()!==d},E.isSame=function(y,R){var S=k(y);return this.startOf(R)<=S&&S<=this.endOf(R)},E.isAfter=function(y,R){return k(y)<this.startOf(R)},E.isBefore=function(y,R){return this.endOf(R)<k(y)},E.$g=function(y,R,S){return L.u(y)?this[R]:this.set(S,y)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(y,R){var S=this,g=!!L.u(R)||R,D=L.p(y),_=function(de,X){var ue=L.w(S.$u?Date.UTC(S.$y,X,de):new Date(S.$y,X,de),S);return g?ue:ue.endOf(o)},M=function(de,X){return L.w(S.toDate()[de].apply(S.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(X)),S)},$=this.$W,G=this.$M,re=this.$D,Re="set"+(this.$u?"UTC":"");switch(D){case m:return g?_(1,0):_(31,11);case l:return g?_(1,G):_(0,G+1);case u:var pe=this.$locale().weekStart||0,Me=($<pe?$+7:$)-pe;return _(g?re-Me:re+(6-Me),G);case o:case f:return M(Re+"Hours",0);case s:return M(Re+"Minutes",1);case a:return M(Re+"Seconds",2);case i:return M(Re+"Milliseconds",3);default:return this.clone()}},E.endOf=function(y){return this.startOf(y,!1)},E.$set=function(y,R){var S,g=L.p(y),D="set"+(this.$u?"UTC":""),_=(S={},S[o]=D+"Date",S[f]=D+"Date",S[l]=D+"Month",S[m]=D+"FullYear",S[s]=D+"Hours",S[a]=D+"Minutes",S[i]=D+"Seconds",S[n]=D+"Milliseconds",S)[g],M=g===o?this.$D+(R-this.$W):R;if(g===l||g===m){var $=this.clone().set(f,1);$.$d[_](M),$.init(),this.$d=$.set(f,Math.min(this.$D,$.daysInMonth())).$d}else _&&this.$d[_](M);return this.init(),this},E.set=function(y,R){return this.clone().$set(y,R)},E.get=function(y){return this[L.p(y)]()},E.add=function(y,R){var S,g=this;y=Number(y);var D=L.p(R),_=function(G){var re=k(g);return L.w(re.date(re.date()+Math.round(G*y)),g)};if(D===l)return this.set(l,this.$M+y);if(D===m)return this.set(m,this.$y+y);if(D===o)return _(1);if(D===u)return _(7);var M=(S={},S[a]=e,S[s]=r,S[i]=t,S)[D]||1,$=this.$d.getTime()+y*M;return L.w($,this)},E.subtract=function(y,R){return this.add(-1*y,R)},E.format=function(y){var R=this,S=this.$locale();if(!this.isValid())return S.invalidDate||d;var g=y||"YYYY-MM-DDTHH:mm:ssZ",D=L.z(this),_=this.$H,M=this.$m,$=this.$M,G=S.weekdays,re=S.months,Re=S.meridiem,pe=function(X,ue,ge,be){return X&&(X[ue]||X(R,g))||ge[ue].slice(0,be)},Me=function(X){return L.s(_%12||12,X,"0")},de=Re||function(X,ue,ge){var be=X<12?"AM":"PM";return ge?be.toLowerCase():be};return g.replace(p,function(X,ue){return ue||function(ge){switch(ge){case"YY":return String(R.$y).slice(-2);case"YYYY":return L.s(R.$y,4,"0");case"M":return $+1;case"MM":return L.s($+1,2,"0");case"MMM":return pe(S.monthsShort,$,re,3);case"MMMM":return pe(re,$);case"D":return R.$D;case"DD":return L.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return pe(S.weekdaysMin,R.$W,G,2);case"ddd":return pe(S.weekdaysShort,R.$W,G,3);case"dddd":return G[R.$W];case"H":return String(_);case"HH":return L.s(_,2,"0");case"h":return Me(1);case"hh":return Me(2);case"a":return de(_,M,!0);case"A":return de(_,M,!1);case"m":return String(M);case"mm":return L.s(M,2,"0");case"s":return String(R.$s);case"ss":return L.s(R.$s,2,"0");case"SSS":return L.s(R.$ms,3,"0");case"Z":return D}return null}(X)||D.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(y,R,S){var g,D=this,_=L.p(R),M=k(y),$=(M.utcOffset()-this.utcOffset())*e,G=this-M,re=function(){return L.m(D,M)};switch(_){case m:g=re()/12;break;case l:g=re();break;case c:g=re()/3;break;case u:g=(G-$)/6048e5;break;case o:g=(G-$)/864e5;break;case s:g=G/r;break;case a:g=G/e;break;case i:g=G/t;break;default:g=G}return S?g:L.a(g)},E.daysInMonth=function(){return this.endOf(l).$D},E.$locale=function(){return T[this.$L]},E.locale=function(y,R){if(!y)return this.$L;var S=this.clone(),g=Y(y,R,!0);return g&&(S.$L=g),S},E.clone=function(){return L.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},A}(),F=q.prototype;return k.prototype=F,[["$ms",n],["$s",i],["$m",a],["$H",s],["$W",o],["$M",l],["$y",m],["$D",f]].forEach(function(A){F[A[1]]=function(E){return this.$g(E,A[0],A[1])}}),k.extend=function(A,E){return A.$i||(A(E,q,k),A.$i=!0),k},k.locale=Y,k.isDayjs=V,k.unix=function(A){return k(1e3*A)},k.en=T[C],k.Ls=T,k.p={},k})});var it=N((Sn,Dn)=>{(function(t,e){typeof Sn=="object"&&typeof Dn<"u"?Dn.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(Sn,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,s={},o=function(h){return(h=+h)+(h>68?1900:2e3)},u=function(h){return function(p){this[h]=+p}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(h){(this.zone||(this.zone={})).offset=function(p){if(!p||p==="Z")return 0;var w=p.match(/([+-]|\d\d)/g),v=60*w[1]+(+w[2]||0);return v===0?0:w[0]==="+"?-v:v}(h)}],c=function(h){var p=s[h];return p&&(p.indexOf?p:p.s.concat(p.f))},m=function(h,p){var w,v=s.meridiem;if(v){for(var b=1;b<=24;b+=1)if(h.indexOf(v(b,0,p))>-1){w=b>12;break}}else w=h===(p?"pm":"PM");return w},f={A:[a,function(h){this.afternoon=m(h,!1)}],a:[a,function(h){this.afternoon=m(h,!0)}],Q:[r,function(h){this.month=3*(h-1)+1}],S:[r,function(h){this.milliseconds=100*+h}],SS:[n,function(h){this.milliseconds=10*+h}],SSS:[/\d{3}/,function(h){this.milliseconds=+h}],s:[i,u("seconds")],ss:[i,u("seconds")],m:[i,u("minutes")],mm:[i,u("minutes")],H:[i,u("hours")],h:[i,u("hours")],HH:[i,u("hours")],hh:[i,u("hours")],D:[i,u("day")],DD:[n,u("day")],Do:[a,function(h){var p=s.ordinal,w=h.match(/\d+/);if(this.day=w[0],p)for(var v=1;v<=31;v+=1)p(v).replace(/\[|\]/g,"")===h&&(this.day=v)}],w:[i,u("week")],ww:[n,u("week")],M:[i,u("month")],MM:[n,u("month")],MMM:[a,function(h){var p=c("months"),w=(c("monthsShort")||p.map(function(v){return v.slice(0,3)})).indexOf(h)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[a,function(h){var p=c("months").indexOf(h)+1;if(p<1)throw new Error;this.month=p%12||p}],Y:[/[+-]?\d+/,u("year")],YY:[n,function(h){this.year=o(h)}],YYYY:[/\d{4}/,u("year")],Z:l,ZZ:l};function d(h){var p,w;p=h,w=s&&s.formats;for(var v=(h=p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(k,L,q){var F=q&&q.toUpperCase();return L||w[q]||t[q]||w[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(A,E,y){return E||y.slice(1)})})).match(e),b=v.length,C=0;C<b;C+=1){var T=v[C],x=f[T],V=x&&x[0],Y=x&&x[1];v[C]=Y?{regex:V,parser:Y}:T.replace(/^\[|\]$/g,"")}return function(k){for(var L={},q=0,F=0;q<b;q+=1){var A=v[q];if(typeof A=="string")F+=A.length;else{var E=A.regex,y=A.parser,R=k.slice(F),S=E.exec(R)[0];y.call(L,S),k=k.replace(S,"")}}return function(g){var D=g.afternoon;if(D!==void 0){var _=g.hours;D?_<12&&(g.hours+=12):_===12&&(g.hours=0),delete g.afternoon}}(L),L}}return function(h,p,w){w.p.customParseFormat=!0,h&&h.parseTwoDigitYear&&(o=h.parseTwoDigitYear);var v=p.prototype,b=v.parse;v.parse=function(C){var T=C.date,x=C.utc,V=C.args;this.$u=x;var Y=V[1];if(typeof Y=="string"){var k=V[2]===!0,L=V[3]===!0,q=k||L,F=V[2];L&&(F=V[2]),s=this.$locale(),!k&&F&&(s=w.Ls[F]),this.$d=function(R,S,g,D){try{if(["x","X"].indexOf(S)>-1)return new Date((S==="X"?1e3:1)*R);var _=d(S)(R),M=_.year,$=_.month,G=_.day,re=_.hours,Re=_.minutes,pe=_.seconds,Me=_.milliseconds,de=_.zone,X=_.week,ue=new Date,ge=G||(M||$?1:ue.getDate()),be=M||ue.getFullYear(),Ot=0;M&&!$||(Ot=$>0?$-1:ue.getMonth());var Lt,ir=re||0,ar=Re||0,sr=pe||0,or=Me||0;return de?new Date(Date.UTC(be,Ot,ge,ir,ar,sr,or+60*de.offset*1e3)):g?new Date(Date.UTC(be,Ot,ge,ir,ar,sr,or)):(Lt=new Date(be,Ot,ge,ir,ar,sr,or),X&&(Lt=D(Lt).week(X).toDate()),Lt)}catch{return new Date("")}}(T,Y,x,w),this.init(),F&&F!==!0&&(this.$L=this.locale(F).$L),q&&T!=this.format(Y)&&(this.$d=new Date("")),s={}}else if(Y instanceof Array)for(var A=Y.length,E=1;E<=A;E+=1){V[1]=Y[E-1];var y=w.apply(this,V);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}E===A&&(this.$d=new Date(""))}else b.call(this,C)}}})});var Ls=N((En,_n)=>{(function(t,e){typeof En=="object"&&typeof _n<"u"?_n.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_isBetween=e()})(En,function(){"use strict";return function(t,e,r){e.prototype.isBetween=function(n,i,a,s){var o=r(n),u=r(i),l=(s=s||"()")[0]==="(",c=s[1]===")";return(l?this.isAfter(o,a):!this.isBefore(o,a))&&(c?this.isBefore(u,a):!this.isAfter(u,a))||(l?this.isBefore(o,a):!this.isAfter(o,a))&&(c?this.isAfter(u,a):!this.isBefore(u,a))}}})});var Zs=N((xd,xn)=>{"use strict";var Xs=require("url"),zs=Xs.parse,tr=Xs.Url;xn.exports=Ws;xn.exports.original=mc;function Ws(t){var e=t.url;if(e!==void 0){var r=t._parsedUrl;return Js(e,r)?r:(r=Qs(e),r._raw=e,t._parsedUrl=r)}}function mc(t){var e=t.originalUrl;if(typeof e!="string")return Ws(t);var r=t._parsedOriginalUrl;return Js(e,r)?r:(r=Qs(e),r._raw=e,t._parsedOriginalUrl=r)}function Qs(t){if(typeof t!="string"||t.charCodeAt(0)!==47)return zs(t);for(var e=t,r=null,n=null,i=1;i<t.length;i++)switch(t.charCodeAt(i)){case 63:n===null&&(e=t.substring(0,i),r=t.substring(i+1),n=t.substring(i));break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return zs(t)}var a=tr!==void 0?new tr:{};return a.path=t,a.href=t,a.pathname=e,n!==null&&(a.query=r,a.search=n),a}function Js(t,e){return typeof e=="object"&&e!==null&&(tr===void 0||e instanceof tr)&&e._raw===t}});var Lc={};fo(Lc,{default:()=>nr});module.exports=ho(Lc);var mo=t=>{let e=t.locals.csrfToken||"csrfToken",r=t.locals.user?.uuid?t.locals.user.uuid:"userId",n=t.locals.user?.token?t.locals.user.token:"token",i=t.locals.user?.activeCaseLoadId||"",a=t.locals.pathSuffix||"",s=t.locals.routePrefix||"",o=t.locals.definitions||[],u=t.locals.requestedReports||[],l=t.locals.recentlyViewedReports||[],c=t.locals.bookmarks||[],{bookmarkingEnabled:m,downloadingEnabled:f,definitionsPath:d,dpdPathFromQuery:h,dpdPathFromConfig:p,nestedBaseUrl:w}=t.locals;return{csrfToken:e,userId:r,token:n,definitions:o,requestedReports:u,recentlyViewedReports:l,bookmarks:c,bookmarkingEnabled:m,downloadingEnabled:f,dpdPathFromQuery:h,dpdPathFromConfig:p,definitionsPath:d,pathSuffix:a,routePrefix:s,activeCaseLoadId:i,nestedBaseUrl:w}},po=(t,e)=>(e&&(t.query={...t.query,dataProductDefinitionsPath:e}),t.query),ee={getValues:mo,setDdpPathToReqQuery:po};var kn={renderPolling:async({req:t,res:e,services:r})=>{let{csrfToken:n,userId:i,definitionsPath:a}=ee.getValues(e),{reportId:s,variantId:o,executionId:u,id:l,type:c}=t.params,m=await r.requestedReportService.getReportByExecutionId(u,i),{reportName:f,name:d,variantName:h,description:p,status:w,query:v,timestamp:b,url:C,errorMessage:T,metrics:x,tableId:V}=m;return{title:`${c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()} request status`,pollingRenderData:{reportName:f,name:h||d,executionId:u,id:o||l,description:p,type:c||"report",reportId:s,tableId:V,status:w,definitionPath:a,pollingUrl:t.baseUrl,...v&&{querySummary:v.summary},requestedAt:b.requested,csrfToken:n,...x&&{metrics:x},...C.report?.fullUrl&&{reportUrl:C.report.fullUrl},...C.request.fullUrl&&{requestUrl:C.request.fullUrl},...T&&{errorMessage:T}}}}};var go=()=>[{text:"Column",name:"sortColumn",type:"Radio",options:[],value:null,minimumLength:null,mandatory:!0},{text:"Direction",name:"sortedAsc",type:"Radio",options:[{value:"false",text:"Ascending"},{value:"true",text:"Descending"}],value:"false",minimumLength:null,mandatory:!0}],In={sortByTemplate:go};var Es=ne(xa()),_s=ne(Ds()),Fl=(0,_s.default)({outputMode:"short",color:!1}),Ml=Es.default.createLogger({name:"Digital Prison Reporting:",stream:Fl,level:"debug"}),Fe=Ml;var gn={getCurrentVariantDefinition:(t,e,r)=>{if(!t){Fe.info("No definitions");return}let n,i=t.find(a=>a.id===e);return i&&(n=i.variants.find(a=>r===a.id)),n||void 0},getFieldDisplayName:(t,e)=>{let r=e.split("."),n=t.find(i=>i.name===r[0]);return n?r[1]?`${n.display} ${r[1]}`:n.display:e},getField:(t,e)=>t.find(r=>r.name===e),getReportSummary:async(t,e,r,n)=>(await e.getDefinitions(r,n)).find(a=>a.id===t)};var Ve=ne(nt()),Rs=ne(it());var wt=class{constructor(){this.isoDateRegEx=/^(\d{4}[/-](0?[1-9]|1[012])[/-](0?[1-9]|[12][0-9]|3[01]))/;this.localDateRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/;this.localDateShortYearRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{2}$/;this.localDateTimeRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4} [0-2]\d:[0-5]\d$/;this.localDateTimeShortYearRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{2} [0-2]\d:[0-5]\d$/;this.isoFormat="YYYY-MM-DD";this.localDateFormatInput="D/M/YYYY";this.localDateFormatOutput="DD/MM/YYYY";this.localDateShortYearFormatInput="D/M/YY";this.localDateShortYearFormatOutput="DD/MM/YY";this.localDateTimeFormatInput="D/M/YYYY HH:mm";this.localDateTimeFormatOutput="DD/MM/YYYY HH:mm";this.localDateTimeShortYearFormatInput="D/M/YY HH:mm";this.localDateTimeShortYearFormatOutput="DD/MM/YY HH:mm"}getDateType(e){if(e&&e.match){if(e.match(this.isoDateRegEx))return"iso";if(e.match(this.localDateRegEx))return"local-date";if(e.match(this.localDateShortYearRegEx))return"local-date-short-year";if(e.match(this.localDateTimeRegEx))return"local-datetime";if(e.match(this.localDateTimeShortYearRegEx))return"local-datetime-short-year"}return"none"}getDateWrapper(e){switch(Ve.default.extend(Rs.default),this.getDateType(e)){case"iso":return(0,Ve.default)(e);case"local-date":return(0,Ve.default)(e,this.localDateFormatInput);case"local-date-short-year":return(0,Ve.default)(e,this.localDateShortYearFormatInput);case"local-datetime":return(0,Ve.default)(e,this.localDateTimeFormatInput);case"local-datetime-short-year":return(0,Ve.default)(e,this.localDateTimeShortYearFormatInput);default:return null}}isDate(e){return this.getDateType(e)!=="none"}toDateString(e,r){let n=this.getDateWrapper(e);if(n)switch(r){case"iso":return n.format(this.isoFormat);case"local-date":return n.format(this.localDateFormatOutput);case"local-date-short-year":return n.format(this.localDateShortYearFormatOutput);case"local-datetime":return n.format(this.localDateTimeFormatOutput);case"local-datetime-short-year":return n.format(this.localDateTimeShortYearFormatOutput);default:return Fe.warn(`Invalid date type: ${r}`),null}return e&&Fe.warn(`Could not map non-date value : ${e}`),null}};var ws="~clear~",xl=(t,e,r)=>{let n;e?(n={...t,selectedPage:"1"},Object.keys(e).forEach(a=>{e[a]?n[a]=e[a]:Object.keys(n).filter(s=>s===a||s.startsWith(`${a}.`)).forEach(s=>{n[s]=ws})})):n={selectedPage:"1",pageSize:t.pageSize,sortColumn:t.sortColumn,sortedAsc:t.sortedAsc,dataProductDefinitionsPath:t.dataProductDefinitionsPath};let i={};return Object.keys(n).filter(a=>n[a]).forEach(a=>{i[a]=n[a]}),Cl(i,r)},Cl=(t,e)=>`?${Object.keys(t).flatMap(n=>{let i=e?.find(s=>`filters.${s.name}`===n),a=t[n];return Array.isArray(a)?a.map(s=>`${encodeURI(n)}=${encodeURI(s)}`):i&&i.filter.type.toLowerCase()==="Multiselect".toLowerCase()?a.split(",").map(o=>`${encodeURI(n)}=${encodeURI(o)}`):[`${encodeURI(n)}=${encodeURI(a)}`]}).join("&")}`,As=t=>t&&t!==""?`?dataProductDefinitionsPath=${t}`:"";var Os=xl;var _e="filters.";var oe=ne(nt()),Ms=ne(it()),xs=ne(Ls());var Rn=(t,e,r)=>{let{min:n,max:i}=t,a;n?a=Ts(n,e):a=e;let s;return i?s=Fs(i,r):s=r,{start:a,end:s}},Ts=(t,e)=>{let r=new Date(t);return new Date(e)<r?t:e},Fs=(t,e)=>{let r=new Date(t);return new Date(e)>r?t:e},Nl=t=>{let{min:e,max:r,defaultValue:n}=t,i,a;e&&(i=e),r&&(a=r);let s=/^\d{1,4}-\d{1,2}-\d{2,2} - \d{1,4}-\d{1,2}-\d{1,2}$/,o;return n&&n.match(s)?([i,a]=n.split(" - "),o=Rn(t,i,a)):n?o=n:o=Rn(t,i,a),o};function kl(t){return t.start!==void 0||t.end!==void 0}var Pe={compareMax:Fs,compareMin:Ts,isDateRange:kl,setDateRangeValuesWithinMinMax:Rn,getStartAndEndValueFromDefinition:Nl};oe.default.extend(Ms.default);var Il=(t,e,r,n)=>{oe.default.extend(xs.default);let i=(0,oe.default)(r),a=(0,oe.default)(n),s=t?t.isBetween(i,a,"day","[]"):!0,o=e?e.isBetween(i,a,"day","[]"):!0;return s&&o},Cs=t=>{let e,r;switch(t){case"none":e="",r="";break;case"yesterday":e=(0,oe.default)(),r=e.subtract(1,"day");break;case"tomorrow":r=(0,oe.default)(),e=r.add(1,"day");break;case"last-week":e=(0,oe.default)(),r=e.subtract(1,"week");break;case"next-week":r=(0,oe.default)(),e=r.add(1,"week");break;case"last-month":e=(0,oe.default)(),r=e.subtract(1,"month");break;case"next-month":r=(0,oe.default)(),e=r.add(1,"month");break;default:break}return{endDate:e,startDate:r}},$l=(t,e,r)=>{let n=e.query[`${r}${t.name}.start`],i=e.query[`${r}${t.name}.end`],a=e.query[`${r}${t.name}.relative-duration`];return{start:n||t.min,end:i||t.max,...a&&{relative:a}}},Yl=(t,e)=>{let r=e.split(".")[0],n=Object.keys(t.body).filter(a=>a.includes(r)).map(a=>({name:a,value:t.body[a]})),i={start:"",end:""};return n.forEach(a=>{a.name.includes("start")&&(i.start=a.value),a.name.includes("end")&&(i.end=a.value)}),{value:i,name:r}},Vl=(t,e)=>{let r={start:"",end:""},{start:n,end:i}=t.value;return n&&(r.start=(0,oe.default)(n,"D/M/YYYY").format("YYYY-MM-DD").toString()),i&&(r.end=(0,oe.default)(i,"D/M/YYYY").format("YYYY-MM-DD").toString()),{...e,value:r}},Ns=(t,e)=>{t||(t="1977-05-25"),e||(e="9999-01-01");let r=ks();return r.forEach(n=>{if(n.value){let{endDate:i,startDate:a}=Cs(n.value);Il(a,i,t,e)||(n.disabled=!0)}}),r.filter(n=>n.value!=="none").every(n=>n.value===null||n.disabled)&&(r=[]),r},Pl=t=>{let r=ks().find(n=>n.value===t);return r?r.text:""},ks=()=>[{value:"none",text:"None"},{value:"yesterday",text:"Yesterday"},{value:"tomorrow",text:"Tomorrow"},{value:"last-week",text:"Last week"},{value:"next-week",text:"Next week"},{value:"last-month",text:"Last month"},{value:"next-month",text:"Next month"}],Ul=(t,e)=>{let r=Pe.getStartAndEndValueFromDefinition(t),n=Ns(t.min,t.max);return{...e,min:t.min,max:t.max,relativeOptions:n,value:r}},ql=(t,e,r)=>{let n=t.defaultValue.split(" - "),i;return n.length>=1&&(i=`${r}${e}.start=${n[0]}`,n.length>=2&&(i=`${i}&${r}${e}.end=${n[1]}`)),i},fe={calcDates:Cs,getRelativeDateOptions:Ns,getFilterFromDefinition:Ul,setValueFromRequest:$l,getQueryFromDefinition:ql,mapRelativeValue:Pl,setDefaultValue:Yl,setFilterValueFromDefault:Vl};var jl=(t,e)=>{let r=[void 0,null,""];return t.filter(n=>n.value&&Object.prototype.hasOwnProperty.call(n.value,"start")&&!r.includes(n.value.start)||n.value&&Object.prototype.hasOwnProperty.call(n.value,"end")&&!r.includes(n.value.end)||n.value&&!Object.prototype.hasOwnProperty.call(n.value,"start")&&!Object.prototype.hasOwnProperty.call(n.value,"end")).filter(n=>n.value&&n.value!=="no-filter").map(n=>{let i=`${n.value}`,a=[`"${i}"`],s=[`${e}${n.name}`],o="",u=!1,l;n.type.toLowerCase()==="DateRange".toLowerCase()&&({key:s,value:a,disabled:u,cantRemoveClass:o,displayValue:i,constraints:l}=Is(n,e)),n.type.toLowerCase()==="GranularDateRange".toLowerCase()&&({key:s,value:a,disabled:u,cantRemoveClass:o,displayValue:i,constraints:l}=Vs(n,e)),n.type.toLowerCase()==="Date".toLowerCase()&&({key:s,value:a,disabled:u,cantRemoveClass:o,displayValue:i,constraints:l}=Bl(n,e)),(n.type.toLowerCase()==="Autocomplete".toLowerCase()||n.type.toLowerCase()==="Radio".toLowerCase()||n.type.toLowerCase()==="Select".toLowerCase())&&({key:s,value:a,displayValue:i}=$s(n,e)),n.type.toLowerCase()==="Multiselect".toLowerCase()&&({key:s,value:a,displayValue:i}=Ys(n,e));let c;return u?c=`Selected Filter: ${n.text}: ${i}. This filter cant be removed. Update the filter input to change the value`:c=`Selected Filter: ${n.text}: ${i}. Click to clear this filter`,{text:n.text,displayValue:i,key:JSON.stringify(s),value:a,disabled:u,constraints:l,classes:`interactive-remove-filter-button${o}`,attributes:{"aria-label":c}}})},Is=(t,e)=>{let r=t.value.start||"Open start",n=t.value.end||"Open end",i=`${e}${t.name}`,a=[`${i}.start`,`${i}.end`],s=[`"${r}"`,`"${n}"`],o=`${r} - ${n}`;t.value.relative&&(a.push(`${i}.relative-duration`),s.push(`"${t.value.relative}"`),o=fe.mapRelativeValue(t.value.relative));let u=bn(t,a),{disabled:l,cantRemoveClass:c,displayValue:m}=Ps(t,s,o);return{key:a,value:s,displayValue:m||o,disabled:l,cantRemoveClass:c,constraints:u}},bn=(t,e,r=!1)=>{let n=[],{min:i,max:a}=t;return i&&n.push({key:e[0],value:i}),a&&!r&&n.push({key:e[1],value:a}),n.length?n:void 0},$s=(t,e)=>{let n=t.options.find(s=>s.value===t.value).text,i=[`${e}${t.name}`],a=[`"${t.value}"`];return{key:i,value:a,displayValue:n}},Ys=(t,e)=>{let n=t.value.split(","),i=n.map(o=>t.options.find(l=>l.value===o).text).filter((o,u)=>u<3).join(", ");i=n.length>3?`${i} + ${n.length-3} more`:i;let a=n.map(o=>`"${o}"`);return{key:[`${e}${t.name}`],value:a,displayValue:i}},Vs=(t,e)=>{let r=t.value.start||"Open start",n=t.value.end||"Open end",i=t.value.quickFilter?.value,a=`${e}${t.name}`,s=[`${a}.start`,`${a}.end`,`${a}.granularity`],o=[`"${r}"`,`"${n}"`,`"${t.value.granularity.value}"`],u=bn(t,s),l,c=t.value.granularity.display;i&&i!=="none"?(s.push(`${a}.quick-filter`),o.push(`"${t.value.quickFilter.value}"`),l=`${t.value.quickFilter.display}: ${c}`):l=`${r} - ${n}: ${c}`;let{disabled:m,cantRemoveClass:f,displayValue:d}=Ps(t,o,l);return{key:s,value:o,displayValue:d||l,disabled:m,constraints:u,cantRemoveClass:f}},Bl=(t,e)=>{let r=[`${e}${t.name}`],n=`${t.value}`,i=[`"${n}"`],a=bn(t,r,!0),{disabled:s,cantRemoveClass:o,displayValue:u}=Gl(t,i,n);return{key:r,value:i,displayValue:u||n,disabled:s,constraints:a,cantRemoveClass:o}},Ps=(t,e,r)=>{let{min:n,max:i}=t;return n&&e[0].includes(n)&&i&&e[1].includes(i)?{disabled:!0,cantRemoveClass:" interactive-remove-filter-button--disabled",displayValue:`${r} (maximum range)`}:{disabled:!1,cantRemoveClass:"",displayValue:r}},Gl=(t,e,r)=>{let{min:n,max:i}=t;if(n&&e[0].includes(n)||i&&e[0].includes(i)){let a;return e[0].includes(n)&&(a="min"),e[0].includes(i)&&(a="max"),{disabled:!0,cantRemoveClass:" interactive-remove-filter-button--disabled",displayValue:`${r} (${a} date)`}}return{disabled:!1,cantRemoveClass:"",displayValue:r}},Hl=(t,e)=>{let{query:r}=t,n="filters.";return e.filter(i=>r[`filters.${i.name}`]||r[`filters.${i.name}.start`]||r[`filters.${i.name}.end`]).map(i=>{let{value:a}=i;return i.type.toLowerCase()==="Multiselect".toLowerCase()&&(a=Ys(i,"filters").displayValue),(i.type.toLowerCase()==="Autocomplete".toLowerCase()||i.type.toLowerCase()==="Radio".toLowerCase()||i.type.toLowerCase()==="Select".toLowerCase())&&(a=$s(i,n).displayValue),i.type.toLowerCase()==="DateRange".toLowerCase()&&(a=Is(i,n).displayValue),i.type.toLowerCase()==="GranularDateRange".toLowerCase()&&(a=Vs(i,n).displayValue),{id:i.name,name:i.text,value:a}})},Us={getSelectedFilters:jl,getQuerySummary:Hl};var wn=ne(nt()),qs=ne(it());wn.default.extend(qs.default);var js=t=>{let{defaultValue:e,min:r,max:n}=t,i;return e&&(i=e,r&&(i=Pe.compareMin(r,i)),n&&(i=Pe.compareMax(n,i))),i},zl=(t,e,r)=>{let{min:n,max:i,mandatory:a}=t,s=e.query[`${r}${t.name}`],o=s;return a&&!s&&(o=n||i||"1977-05-25"),o},Xl=(t,e)=>{let r=t.value?(0,wn.default)(t.value,"D/M/YYYY").format("YYYY-MM-DD").toString():"";return{...e,value:r}},Wl=(t,e)=>({...e,value:js(t),min:t.min,max:t.max}),Kt={setDateValueWithinMinMax:js,getFilterFromDefinition:Wl,setValueFromRequest:zl,setFilterValueFromDefault:Xl};var I=ne(nt()),Bs=ne(it());I.default.extend(Bs.default);var An=(t,e,r)=>{let n,i;switch(t){case"daily":n=!1,i=!1;break;case"monthly":{let a=(0,I.default)(e).startOf("month"),s=(0,I.default)(r).endOf("month");n=!a.isSame(e,"day"),i=!s.isSame(r,"day")}break;case"annually":{let a=(0,I.default)(e).startOf("year"),s=(0,I.default)(r).endOf("year");n=!a.isSame(e,"day"),i=!s.isSame(r,"day")}break;default:n=!1,i=!1;break}return{start:n,end:i}},On=()=>[{value:"none",text:"None"},{value:"today",text:"Today"},{value:"past",text:"Past:",disabled:!0},{value:"yesterday",text:"Yesterday"},{value:"last-seven-days",text:"Last 7 days"},{value:"last-thirty-days",text:"Last 30 days"},{value:"last-month",text:"Last month"},{value:"last-full-month",text:"Last full month"},{value:"last-ninety-days",text:"Last 90 days"},{value:"last-three-months",text:"Last 3 months"},{value:"last-full-three-months",text:"Last full 3 months"},{value:"last-six-months",text:"Last 6 months"},{value:"last-full-six-months",text:"Last full 6 months"},{value:"last-year",text:"Last year"},{value:"last-full-year",text:"Last full year"},{value:"future",text:"Future:",disabled:!0},{value:"tomorrow",text:"Tomorrow"},{value:"next-seven-days",text:"Next 7 days"},{value:"next-thirty-days",text:"Next 30 days"},{value:"next-month",text:"Next month"},{value:"next-full-month",text:"Next full month"},{value:"next-ninety-days",text:"Next 90 days"},{value:"next-three-months",text:"Next 3 months"},{value:"next-full-three-months",text:"Next full 3 months"},{value:"next-six-months",text:"Next 6 months"},{value:"next-full-six-months",text:"Next full 6 months"},{value:"next-year",text:"Next year"},{value:"next-full-year",text:"Next full year"}],Ln=()=>[{value:"hourly",text:"Hourly"},{value:"daily",text:"Daily"},{value:"monthly",text:"Monthly"},{value:"annually",text:"Annually"}],Ql=(t,e)=>{let r=e,n=["annually","monthly"],i=["annually"];return t.includes("month")&&i.includes(t)&&(r="monthly"),t.includes("day")&&n.includes(t)&&(r="daily"),r},Tn=t=>{let e,r,n;switch(t){case"today":r=(0,I.default)(),e=(0,I.default)(),n="daily";break;case"yesterday":r=(0,I.default)().subtract(1,"day"),e=(0,I.default)().subtract(1,"day"),n="daily";break;case"last-seven-days":r=(0,I.default)(),e=r.subtract(7,"day").add(1,"day"),n="daily";break;case"last-thirty-days":r=(0,I.default)(),e=r.subtract(30,"day").add(1,"day"),n="daily";break;case"last-month":r=(0,I.default)(),e=r.subtract(1,"month").add(1,"day"),n="monthly";break;case"last-full-month":r=(0,I.default)().subtract(1,"month").endOf("month"),e=r.startOf("month"),n="monthly";break;case"last-ninety-days":r=(0,I.default)(),e=r.subtract(90,"day").add(1,"day"),n="daily";break;case"last-three-months":r=(0,I.default)(),e=r.subtract(3,"month").add(1,"day"),n="monthly";break;case"last-full-three-months":r=(0,I.default)().subtract(1,"month").endOf("month"),e=r.subtract(2,"month").startOf("month"),n="monthly";break;case"last-six-months":r=(0,I.default)(),e=r.subtract(6,"month").add(1,"day"),n="monthly";break;case"last-full-six-months":r=(0,I.default)().subtract(1,"month").endOf("month"),e=r.subtract(6,"month").startOf("month"),n="monthly";break;case"last-year":r=(0,I.default)(),e=r.subtract(1,"year").add(1,"day"),n="annually";break;case"last-full-year":r=(0,I.default)().subtract(1,"year").endOf("year"),e=r.startOf("year"),n="annually";break;case"tomorrow":r=(0,I.default)().add(1,"day"),e=(0,I.default)().add(1,"day"),n="daily";break;case"next-seven-days":e=(0,I.default)(),r=(0,I.default)().add(7,"day").subtract(1,"day"),n="daily";break;case"next-thirty-days":e=(0,I.default)(),r=(0,I.default)().add(30,"day").subtract(1,"day"),n="daily";break;case"next-month":e=(0,I.default)(),r=(0,I.default)().add(1,"month").subtract(1,"day"),n="monthly";break;case"next-full-month":e=(0,I.default)().add(1,"month").startOf("month"),r=e.endOf("month"),n="monthly";break;case"next-ninety-days":e=(0,I.default)(),r=(0,I.default)().add(90,"day").subtract(1,"day"),n="daily";break;case"next-three-months":e=(0,I.default)(),r=(0,I.default)().add(3,"month").subtract(1,"day"),n="monthly";break;case"next-full-three-months":e=(0,I.default)().add(1,"month").startOf("month"),r=e.add(2,"month").endOf("month"),n="monthly";break;case"next-year":e=(0,I.default)(),r=(0,I.default)().add(1,"year").subtract(1,"day"),n="annually";break;case"next-full-year":e=(0,I.default)().add(1,"year").startOf("year"),r=e.endOf("year"),n="annually";break;default:r=(0,I.default)(),e=(0,I.default)(),n="daily";break}return{start:e.format("YYYY-MM-DD").toString(),end:r.format("YYYY-MM-DD").toString(),granularity:n}},At=(t,e)=>e.find(n=>n.value===t).text||t,Jl=(t,e,r)=>{let{preventDefault:n}=e.query,i=e.query[`${r}${t.name}.quick-filter`],a=e.query[`${r}${t.name}.granularity`],s,o;i&&i!=="none"?({start:s,end:o}=Tn(i),a=Ql(i,a)):(a=e.query[`${r}${t.name}.granularity`],s=e.query[`${r}${t.name}.start`],o=e.query[`${r}${t.name}.end`]);let u=n?null:t.value?.start,l=n?null:t.value?.end,c=n?"daily":t.value?.granularity.value,m=n?"none":t.value?.quickFilter.value,f=Ln(),d=On(),h=s||u||t.min,p=o||l||t.max,w=a||c,v=i||m;return{start:h,end:p,granularity:{value:w,display:At(w,f)},quickFilter:{value:v,display:At(v,d)},partialDate:{...An(w,h,p)}}},Zl=(t,e)=>{let r=e.split(".")[0],n=Object.keys(t.body).filter(a=>a.includes(r)).map(a=>({name:a,value:t.body[a]})),i={start:"",end:"",granularity:null,quickFilter:null};return n.forEach(a=>{a.name.includes("start")&&(i.start=a.value),a.name.includes("end")&&(i.end=a.value),a.name.includes("granularity")&&(i.granularity=a.value),a.name.includes("granularity")&&(i.quickFilter=a.value)}),i=i.start!==""&&i.end!==""&&i.granularity&&i.quickFilter?i:"",{value:i,name:r}},Kl=(t,e)=>{let{granularity:r,quickFilter:n,start:i,end:a}=t.value,s={start:i?(0,I.default)(i,"D/M/YYYY").format("YYYY-MM-DD").toString():"",end:a?(0,I.default)(a,"D/M/YYYY").format("YYYY-MM-DD").toString():"",granularity:{value:r,display:e.granularityOptions.find(o=>o.value===r)?.text},quickFilter:{value:n,display:e.quickFilterOptions.find(o=>o.value===n)?.text}};return{...e,value:s}},ec=(t,e)=>{let r,n=t.defaultQuickFilterValue,i=Ln(),a=On();if(n){let{start:s,end:o,granularity:u}=Tn(n);r={start:s,end:o,granularity:{value:u,display:At(u,i)},quickFilter:{value:n,display:At(n,a)},partialDate:{...An(u,s,o)}}}else{r=Pe.getStartAndEndValueFromDefinition(t);let s=r.granularity?r.granularity.value:t.defaultGranularity||"daily";r={...r,granularity:{value:s,display:At(s,i)},quickFilter:{value:"none",display:"None"},partialDate:{...An(s,r.start,r.end)}}}return{...e,min:t.min,max:t.max,value:r,quickFilterOptions:On(),granularityOptions:Ln()}},tc=(t,e,r,n)=>{let i=[];if(t.defaultQuickFilterValue){let{start:a,end:s,granularity:o}=Tn(t.defaultQuickFilterValue);i.push(`${r}${e}.quick-filter=${t.defaultQuickFilterValue}`),i.push(`${r}${e}.granularity=${o}`),i.push(`${r}${e}.start=${a}`),i.push(`${r}${e}.end=${s}`)}else t.defaultGranularity&&n?(i.push(`${r}${e}.granularity=${t.defaultGranularity}`),i.push(`${n}`)):t.defaultGranularity&&i.push(`${r}${e}.granularity=${t.defaultGranularity}`);return i.join("&")},at={getFilterFromDefinition:ec,setValueFromRequest:Jl,getQueryFromDefinition:tc,setDefaultValue:Zl,setFilterValueFromDefault:Kl};var rc=(t,e,r)=>{let n=e.query[`${r}${t.name}`],i,a;return n?.length&&(i=Array.isArray(n)?n:[n],a=i.join(",")),{requestfilterValue:a||null,requestfilterValues:i||[]}},nc=(t,e,r)=>(t.defaultValue?t.defaultValue.split(","):[]).map(i=>`${r}${e}=${i}`).join("&"),ic=(t,e)=>{let n=t.value.split(","),i=n.map(o=>t.options.find(l=>l.value===o).text).filter((o,u)=>u<3).join(", ");i=n.length>3?`${i} + ${n.length-3} more`:i;let a=n.map(o=>`"${o}"`);return{key:[`${e}${t.name}`],value:a,displayValue:i}},Fn={getQueryFromDefinition:nc,setValueFromRequest:rc,getMultiselectValues:ic};var Gs=(t,e,r="filters.")=>{let{preventDefault:n}=e.query;return Object.keys(e.query).every(i=>!i.includes(r))&&!n?t:t.map(i=>{let a,s;i.type.toLowerCase()==="DateRange".toLowerCase()?a=fe.setValueFromRequest(i,e,r):i.type.toLowerCase()==="GranularDateRange".toLowerCase()?a=at.setValueFromRequest(i,e,r):i.type.toLowerCase()==="Date".toLowerCase()?a=Kt.setValueFromRequest(i,e,r):i.type.toLowerCase()==="Multiselect".toLowerCase()?{requestfilterValue:a,requestfilterValues:s}=Fn.setValueFromRequest(i,e,r):a=e.query[`${r}${i.name}`];let o=null;return a?o=a:n&&(o=null),{...i,value:o,...s&&{values:s}}})},ac=(t,e)=>{let r=t.some(n=>e.findIndex(a=>a.name===n.name)!==-1);return t.map(n=>{let i=e.find(o=>o.name===n.name),a={...n},s=n.type.toLocaleLowerCase();if(s==="Multiselect".toLocaleLowerCase()){let o=r?"":a.value;o=i?i.value:o;let u=r?[]:a.values;u=i?i.value.split(","):u,a={...a,value:o,values:u}}else if(s==="Date".toLocaleLowerCase()){let o=r?"":a.value;i=i||{...i,value:o},a=Kt.setFilterValueFromDefault(i,a)}else if(s==="DateRange".toLocaleLowerCase()){let o=r?{start:"",end:""}:a.value;i=i||{...i,value:o},a=fe.setFilterValueFromDefault(i,a)}else if(s==="GranularDateRange".toLocaleLowerCase()){let o=r?{start:"",end:"",granularity:"",quickFilter:""}:a.value;i=i||{...i,value:o},a=at.setFilterValueFromDefault(i,a)}else{let o=r?"":a.value;o=i?i.value:o,a={...n,value:o}}return a})},sc=(t,e)=>{let r=t.filter(n=>n.filter);return e&&(r=r.filter(n=>n.filter.interactive)),r.filter(n=>n.filter&&n.filter.defaultValue).map(n=>{let{filter:i}=n;if(i.type.toLowerCase()==="DateRange".toLowerCase())return fe.getQueryFromDefinition(i,n.name,_e);if(i.type.toLowerCase()==="Multiselect".toLowerCase())return Fn.getQueryFromDefinition(i,n.name,_e);if(i.type.toLowerCase()==="GranularDateRange".toLowerCase()){let a=fe.getQueryFromDefinition(i,n.name,_e);return at.getQueryFromDefinition(i,n.name,_e,a)}return`${_e}${n.name}=${i.defaultValue}`}).join("&")},oc=async(t,e,r)=>{let{token:n,definitionsPath:i}=ee.getValues(e),{reportId:a,id:s,type:o}=t.body,l=await(o==="report"?r.reportingService:r.dashboardService).getDefinition(n,a,s,i),c=o==="report"?l.variant.specification.fields:l.filterFields,m=Object.keys(t.body).filter(d=>d.includes("filters.")).map(d=>({name:d.replace("filters.",""),value:t.body[d]})).map(d=>{let h=d.name.split(".")[0],p=c.find(b=>b.name===h),{value:w,name:v}=d;if(p){let b=p.filter?.type.toLocaleLowerCase();b==="Multiselect".toLocaleLowerCase()&&(w=d.value.join(",")),b==="DateRange".toLocaleLowerCase()&&({value:w,name:v}=fe.setDefaultValue(t,v)),b==="GranularDateRange".toLocaleLowerCase()&&({name:v,value:w}=at.setDefaultValue(t,v))}return{name:v,value:w}}),f=Array.from(new Set(m.map(d=>d.name))).map(d=>m.find(h=>h.name===d));return f=f.filter(d=>d.value!==""),f},uc=(t,e)=>{let{activeCaseLoadId:r}=ee.getValues(t);return e.forEach(n=>{n.type.toLocaleLowerCase()==="Autocomplete".toLocaleLowerCase()&&n.text.toLocaleLowerCase().includes("establishment")&&r.length&&(n.value=r)}),e},Hs=(t,e)=>t.filter(r=>r.filter).filter(r=>{if(e!==void 0){let n=r.filter.interactive;return n===void 0?!e:e===n}return!0}).map(r=>{let{display:n,name:i,filter:a}=r,{type:s,staticOptions:o,dynamicOptions:u,defaultValue:l,mandatory:c,pattern:m}=a,f=o?o.map(p=>({value:p.name,text:p.display})):[],d={text:n,name:i,type:s,value:l||null,minimumLength:u?u.minimumLength:null,dynamicResourceEndpoint:null,mandatory:c||!1,pattern:m},h={value:"no-filter",text:"None",disabled:!1};switch(s){case"Autocomplete".toLowerCase():d={...d,options:f};break;case"Radio":c||f.unshift(h),d={...d,options:f};break;case"Select":{c||f.unshift(h),f.unshift({value:"",text:"Select your option",disabled:!0,selected:!0}),d={...d,options:f};break}case"Multiselect".toLowerCase():d={...d,options:f,values:l?l.split(","):[]};break;case"DateRange".toLowerCase():d=fe.getFilterFromDefinition(a,d);break;case"Date".toLowerCase():d=Kt.getFilterFromDefinition(a,d);break;case"GranularDateRange".toLocaleLowerCase():{let p=a;d=at.getFilterFromDefinition(p,d);break}default:break}return d}),lc=(t,e,r,n)=>{let i={},{fields:a}=e.specification,{preventDefault:s}=n.query;if(Object.keys(t.filters).length===0&&!s&&a.filter(u=>u.filter&&u.filter.defaultValue).forEach(u=>{if(u.filter.type.toLowerCase()==="DateRange".toLowerCase()){let l=u.filter.defaultValue.split(" - ");l.length>=1&&(i[`${_e}${u.name}.start`]=l[0],l.length>=2&&(i[`${_e}${u.name}.end`]=l[1]))}else i[`${_e}${u.name}`]=u.filter.defaultValue}),Object.keys(i).length>0){let u=Os(t.toRecordWithFilterPrefix(),i,a);return r.redirect(`${n.baseUrl}${n.path}${u}`),!0}return!1},cc=async({fields:t,req:e,interactive:r=!1,prefix:n="filters."})=>{let i=await Hs(t,r),a=Gs(i,e),s=Us.getSelectedFilters(a,n);return{filters:a,selectedFilters:s}},Ue={getFiltersFromDefinition:Hs,setFilterValuesFromRequest:Gs,getFilters:cc,setFilterQueryFromFilterDefinition:sc,redirectWithDefaultFilters:lc,setFilterValuesFromSavedDefaults:ac,setUserDefinedDefaultValuesForReport:oc,setUserContextDefaults:uc};var fc=(t,e)=>{if(!e){let r=In.sortByTemplate(),n=t.filter(i=>i.sortable).map(i=>{i.defaultsort&&(r[0].value=i.name);let a={value:i.name,text:i.display};return i.sortDirection&&(r[1].options[0].value=String(i.sortDirection==="asc"),r[1].options[1].value=String(i.sortDirection!=="asc")),a});if(n.length)return r[0].options=n,r}return[]},dc=(t,e,r,n,i,a)=>{let{startDate:s,endDate:o}=fe.calcDates(e),u=s?s.format("YYYY-MM-DD").toString():"",l=o?o.format("YYYY-MM-DD").toString():"",c=t.split(".")[1],m=a.find(d=>d.name===c);r[`filters.${c}.start`]=u,r[`filters.${c}.end`]=l,n[t]=e;let f=`${e.charAt(0).toUpperCase()+e.slice(1).replace("-"," ")}`;return f=`${f} (${u} - ${l})`,i.push({name:`${m.display}`,value:f}),{querySummary:i,filterData:n,query:r}},er={renderFilters:async(t,e)=>({filters:Ue.getFiltersFromDefinition(t,!1),sortBy:fc(t,e)}),setQueryFromFilters:(t,e)=>{let r={},n={},i=[],a={},s=new wt,o=new URLSearchParams(t.body.search);return Object.keys(t.body).filter(u=>u!=="_csrf"&&t.body[u]!=="").forEach(u=>{let l=u.replace("filters.",""),c=t.body[u];if(u.startsWith("filters.")&&c!==""&&!r[u]&&c!=="no-filter")if(u.includes("relative-duration"))({query:r,filterData:n,querySummary:i}=dc(u,c,r,n,i,e));else{let m=o.getAll(u);m=!m||m.length===0?c:m,m=m.length===1?`${m[0]}`:`${m}`,r[u]=m,n[l]=m;let f;if(s.isDate(c)){f=s.toDateString(c,"local-date");let h=s.toDateString(c,"iso");r[u]=h,n[l]=h}let d=gn.getFieldDisplayName(e,l);i.push({name:d||l,value:f||m})}else if(u.startsWith("sort")){r[u]=c,a[u]=c;let m=gn.getField(e,c),f="Sort Direction",d=c==="true"?"Ascending":"Descending";m&&(f="Sort Column",d=m.display),i.push({name:f,value:d})}}),{query:r,filterData:n,querySummary:i,sortData:a}}};var Mn=async({storeService:t,userId:e,id:r,search:n})=>{let i=await t.getAllReportsById(r,e),a=hc(n,i);a.length&&await Promise.all(a.map(async s=>{await await t.removeReport(s,e)}))},hc=(t,e)=>{let r=[],n=new URLSearchParams(t);return e.forEach(i=>{let a=[],s=new URLSearchParams(i.url.request.search);s.entries.length===n.entries.length&&n.forEach((o,u)=>{let l=s.has(u,o);a.push(l)}),a.every(Boolean)&&r.push(i.executionId)}),r};var eo=ne(Zs());var st=class{constructor(e){this.build=()=>this.userStoreItem;this.initialiseItem=()=>this.addReportData({type:this.requestFormData.type,reportId:this.requestFormData.reportId,reportName:this.requestFormData.reportName,description:this.requestFormData.description,id:this.requestFormData.id,name:this.requestFormData.name});this.addReportData=({type:e,reportId:r,reportName:n,description:i,id:a,name:s})=>(this.userStoreItem={type:e,reportId:r,reportName:n,description:i,id:a,name:s,timestamp:{}},this);this.addExecutionData=e=>(this.userStoreItem={...this.userStoreItem,...e},this);this.addChildExecutionData=e=>(this.userStoreItem={...this.userStoreItem,childExecutionData:e},this);this.addFilters=e=>{let r=new URLSearchParams(e).toString();return this.userStoreItem={...this.userStoreItem,filters:{data:e,queryString:r}},this};this.addSortData=e=>{let r=new URLSearchParams(e).toString();return this.userStoreItem={...this.userStoreItem,sortBy:{data:e,queryString:r}},this};this.addRequestUrls=e=>{let{origin:r,pathname:n,search:i,href:a,defaultInteractiveQueryString:s}=this.requestFormData,{executionId:o,dataProductDefinitionsPath:u,dpdPathFromQuery:l}=this.userStoreItem,c=l?`${As(u)}`:"",m=e.baseUrl.replace("/filters",`/${o}/status`),f=`${r}${m}`;return this.userStoreItem={...this.userStoreItem,url:{origin:r,request:{fullUrl:a,pathname:n,search:i},polling:{fullUrl:f,pathname:m},report:{...s?.length&&{search:c.length?`${c}&${s}`:`?${s}`,default:`?${s}`}}}},this};this.addAsyncUrls=e=>(this.userStoreItem={...this.userStoreItem,url:e},this);this.addReportUrls=e=>{let r=e.get("host"),n=`${e.protocol}://${e.get("host")}${e.originalUrl}`,i=(0,eo.default)(e);return this.userStoreItem={...this.userStoreItem,url:{origin:r||this.userStoreItem.url.origin,...this.userStoreItem.url?.request&&{request:this.userStoreItem.url.request},...this.userStoreItem.url?.polling&&{polling:this.userStoreItem.url.polling},report:{...this.userStoreItem.url?.report&&this.userStoreItem.url.report,fullUrl:n,...i.search&&{search:i.search}}}},this};this.addLoadType=e=>(this.userStoreItem={...this.userStoreItem,loadType:e},this);this.addQuery=e=>(this.userStoreItem={...this.userStoreItem,query:{data:e.query,summary:e.querySummary}},this);this.addInteractiveQuery=e=>(e&&(this.userStoreItem={...this.userStoreItem,interactiveQuery:{data:e.query,summary:e.querySummary}}),this);this.addStatus=e=>(this.userStoreItem={...this.userStoreItem,status:e},this);this.addMetrics=e=>(this.userStoreItem={...this.userStoreItem,metrics:e.map(r=>({name:r.display}))},this);this.addTimestamp=()=>{let{status:e}=this.userStoreItem,r=new Date;switch(e){case"FAILED":this.userStoreItem.timestamp.failed=r;break;case"EXPIRED":this.userStoreItem.timestamp.expired=r;break;case"ABORTED":this.userStoreItem.timestamp.aborted=r;break;case"FINISHED":this.userStoreItem.timestamp.completed=r;break;case"SUBMITTED":this.userStoreItem.timestamp.requested=r;break;case"STARTED":case"PICKED":break;default:this.userStoreItem.timestamp.lastViewed=r;break}return this};this.addDefinitionsPath=(e,r)=>(e&&(this.userStoreItem={...this.userStoreItem,dataProductDefinitionsPath:e,dpdPathFromQuery:r}),this);this.requestFormData=e,this.requestFormData&&this.initialiseItem()}};var pc=async({req:t,res:e,services:r,queryData:n,executionData:i,childExecutionData:a})=>{let{search:s,id:o,type:u}=t.body,{userId:l,definitionsPath:c,dpdPathFromQuery:m}=ee.getValues(e);await Mn({storeService:r.requestedReportService,userId:l,id:o,search:s}),await Mn({storeService:r.recentlyViewedService,userId:l,id:o,search:s});let f=t.body,d;switch(u){case"report":d=new st(f).addExecutionData(i).addChildExecutionData(a).addFilters(n.filterData).addSortData(n.sortData).addDefinitionsPath(c,m).addRequestUrls(t).addQuery(n).addStatus("SUBMITTED").addTimestamp().build();break;case"dashboard":{d=new st(f).addExecutionData(i).addChildExecutionData(a).addFilters(n.filterData).addDefinitionsPath(c,m).addRequestUrls(t).addQuery(n).addStatus("SUBMITTED").addTimestamp().addMetrics(JSON.parse(t.body.sections)).build();break}default:break}await r.requestedReportService.addReport(l,d)};async function gc(t,e,r,n,i,a){return Promise.all(t.map(s=>e.requestAsyncReport(r,n,s.id,{...i.query,dataProductDefinitionsPath:a}).then(o=>{let{executionId:u,tableId:l}=o;return{executionId:u,tableId:l,variantId:s.id}})))}var vc=async({req:t,res:e,token:r,dashboardService:n,reportingService:i})=>{let{definitionsPath:a}=ee.getValues(e),{reportId:s,id:o,type:u}=t.body,l,c,m,f,d,h=[];u==="report"&&(d=await i.getDefinition(r,s,o,a),l=d?d.variant.specification.fields:[],c=er.setQueryFromFilters(t,l),{executionId:m,tableId:f}=await i.requestAsyncReport(r,s,o,{...c.query,dataProductDefinitionsPath:a}),h=d.variant.childVariants??[]),u==="dashboard"&&(d=await n.getDefinition(r,s,o,a),l=d?d.filterFields:[],c=er.setQueryFromFilters(t,l),{executionId:m,tableId:f}=await n.requestAsyncDashboard(r,s,o,{...c.query,dataProductDefinitionsPath:a}));let p=await gc(h,i,r,s,c,a);return{executionData:{executionId:m,tableId:f},childExecutionData:p,queryData:c}},yc=async({token:t,reportId:e,definitionPath:r,services:n,definition:i})=>{let o=(await n.reportingService.getDefinitions(t,r)).find(f=>f.id===e).name,{name:u,description:l,sections:c,filterFields:m}=i;return{reportName:o,name:u,description:l,sections:c||[],fields:m}},Sc=async t=>({definition:t,reportName:t.name,name:t.variant.name,description:t.variant.description||t.description,template:t.variant.specification,fields:t?.variant?.specification?.fields,interactive:t?.variant?.interactive}),Dc=async(t,e,r,n)=>{let{token:i,definitionsPath:a}=ee.getValues(e),{reportId:s,id:o,variantId:u,type:l}=t.params;return await(l==="report"?n.reportingService:n.dashboardService).getDefinition(i,s,u||o,a)},Ec=async(t,e,r,n,i,a)=>{let{reportId:s,id:o}=t.params,u=await er.renderFilters(r,n);u.filters=Ue.setUserContextDefaults(e,u.filters);let l=await i.defaultFilterValuesService.get(a,s,o);return l&&(u.filters=Ue.setFilterValuesFromSavedDefaults(u.filters,l)),u.filters=Ue.setFilterValuesFromRequest(u.filters,t),{filtersData:u,defaultFilterValues:l}},to={request:async({req:t,res:e,services:r})=>{let{token:n}=ee.getValues(e),i={req:t,res:e,token:n},{executionData:a,queryData:s,childExecutionData:o}=await vc({...i,dashboardService:r.dashboardService,reportingService:r.reportingService});return a&&await pc({req:t,res:e,services:r,queryData:s,executionData:a,childExecutionData:o}),a.executionId},cancelRequest:async({req:t,res:e,services:r})=>{let{token:n,userId:i,definitionsPath:a}=ee.getValues(e),{reportId:s,id:o,executionId:u,type:l}=t.params,c;l==="report"&&(c=r.reportingService),l==="dashboard"&&(c=r.dashboardService);let m=await c.cancelAsyncRequest(n,s,o,u,a);m&&m.cancellationSucceeded&&await r.requestedReportService.updateStatus(u,i,"ABORTED")},renderRequest:async({req:t,res:e,services:r,next:n})=>{try{let{token:i,csrfToken:a,definitionsPath:s,dpdPathFromQuery:o,userId:u}=ee.getValues(e),{reportId:l,type:c,id:m}=t.params,{definition:f}=e.locals,d=t.query.defaultsSaved,h={token:i,reportId:l,definitionPath:s,services:r},p,w,v,b,C,T,x,V,Y,k;c==="report"&&({name:p,reportName:w,description:v,fields:C,interactive:x}=await Sc(f)),c==="dashboard"&&({name:p,reportName:w,description:v,sections:T,fields:C}=await yc({...h,definition:f})),C&&({filtersData:Y,defaultFilterValues:k}=await Ec(t,e,C,x,r,u),V=Ue.setFilterQueryFromFilterDefinition(C,!0));let L={reportName:w,name:p,description:v,reportId:l,id:m,...o&&{definitionPath:s},...V?.length&&{defaultInteractiveQueryString:V},csrfToken:a,template:b,sections:T,hasDefaults:k?.length,defaultsSaved:d,type:c};return{title:`Request ${c}`,filtersDescription:`Customise your ${c} using the filters below and submit your request.`,filtersData:Y,reportData:L}}catch(i){return n(i),!1}},getFiltersFromReqBody:t=>Object.keys(t.body).filter(e=>e.includes("filters.")).filter(e=>!!t.body[e]).map(e=>({name:e,value:t.body[e]})),getDefintionByType:Dc};var rr=ne(nt()),ro=ne(it());rr.default.extend(ro.default);var _c=["ABORTED","FAILED","EXPIRED"],Rc=["SUBMITTED","STARTED","PICKED"];function bc(t){return Promise.all(t).then(e=>{let r=e.find(i=>typeof i.status=="number"||_c.includes(i.status));if(r)return r;let n=e.find(i=>Rc.includes(i.status));return n||e[0]})}var wc=async(t,e,r,n,i)=>{let{definitionsPath:a}=ee.getValues(r),{type:s,reportId:o,executionId:u,id:l,tableId:c}=e.body,f=(await t.requestedReportService.getReportByExecutionId(u,i)).childExecutionData??[];s==="report"&&f.push({executionId:u,tableId:c,variantId:l});let d=f.map(p=>t.reportingService.getAsyncReportStatus(n,o,p.variantId,p.executionId,a,p.tableId));s==="dashboard"&&d.push(t.dashboardService.getAsyncStatus(n,o,l,u,a,c));let h=await bc(d);return{status:h.status,statusResponse:h}},no=async({req:t,res:e,services:r})=>{let{token:n,userId:i}=ee.getValues(e),{status:a,requestedAt:s}=t.body,o=["READY","EXPIRED","FAILED"],u,l,c;try{if({status:u,statusResponse:c}=await wc(r,t,e,n,i),Ac({requestedAt:s,compareTime:new Date,durationMins:15})&&!o.includes(u))throw new Error("Request taking too long. Request Halted");if(u==="FAILED"){Fe.error(`Error: ${JSON.stringify(c.error)}`);let{userMessage:m,developerMessage:f}=c.error;m||f?l=c.error:l={developerMessage:c.error}}}catch(m){Fe.error(`Error: ${JSON.stringify(m)}`);let{data:f}=m;l=f||{userMessage:m.message},u=a==="FINISHED"?"EXPIRED":"FAILED"}return typeof u=="number"&&(u="FAILED"),{status:u,...l&&{errorMessage:l}}};var Ac=({requestedAt:t,compareTime:e,durationMins:r})=>{let n=(0,rr.default)(e),i=(0,rr.default)(t);return n.diff(i,"minutes")>=r};var io={getRequestStatus:async({req:t,res:e,services:r})=>{let{executionId:n,status:i}=t.body,a=e.locals.user?.uuid?e.locals.user.uuid:"userId",s=await no({req:t,res:e,services:r});return i!==s.status&&(await r.requestedReportService.updateStatus(n,a,s.status,s.errorMessage),s.reportData=await r.requestedReportService.getReportByExecutionId(n,a)),s},filterReports:t=>!t.timestamp.lastViewed};var Cn={handleError:(t,e)=>{let r=ao(t);return Oc(r,e)}},Oc=(t,e)=>{let r=ao(t),n="FAILED",i;return r.userMessage.includes("TypeError:")&&(i="There is an issue in the client. This has been reported to admin staff"),r.userMessage.includes("The stored report or dashboard was not found.")&&(n="EXPIRED",i=`This ${e} has expired`),{status:n,developerMessage:r.developerMessage,userMessage:i||r.userMessage}},ao=t=>{if(t&&t.data)return t.data;if(t&&t.message){let e=t;return{status:500,userMessage:`${e.name}: ${e.message}`,developerMessage:e.stack}}return t};var nr=class{constructor(e,r){this.GET=async(e,r,n)=>{try{let i=await kn.renderPolling({req:e,res:r,services:this.services,next:n});r.render("dpr/routes/journeys/request-report/status/view",{layoutPath:this.layoutPath,...i})}catch(i){e.body.title="Failed to retrieve report status",e.body.errorDescription="We were unable to retrieve the report status:",e.body.error=Cn.handleError(i),n()}};this.POST=async(e,r,n)=>{try{let i=await io.getRequestStatus({req:e,res:r,services:this.services});r.send({status:i.status})}catch{r.send({status:"FAILED"})}};this.DELETE=async(e,r,n)=>{try{await to.cancelRequest({req:e,res:r,services:this.services}),r.end()}catch(i){e.body.title="Failed to abort request",e.body.errorDescription="We were unable to abort the report request for the following reason:",e.body.error=Cn.handleError(i),n()}};this.layoutPath=e,this.services=r}};
/*! Bundled license information:

parseurl/index.js:
  (*!
   * parseurl
   * Copyright(c) 2014 Jonathan Ong
   * Copyright(c) 2014-2017 Douglas Christopher Wilson
   * MIT Licensed
   *)
*/
//# sourceMappingURL=controller.js.map