@budibase/cli 3.26.1 → 3.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1378,7 +1378,7 @@ Caused by: `+v.stack+`
|
|
|
1378
1378
|
\x1B[36mat `+r[i].toString()+"\x1B[39m";return n}return t&&(n+=" \x1B[36m"+d$t(t)+"\x1B[39m"),n}s(X9u,"formatColor");function d$t(e){return j9u(H9u,e[0])+":"+e[1]+":"+e[2]}s(d$t,"formatLocation");function TQe(){var e=Error.stackTraceLimit,t={},r=Error.prepareStackTrace;Error.prepareStackTrace=Z9u,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(t);var n=t.stack.slice(1);return Error.prepareStackTrace=r,Error.stackTraceLimit=e,n}s(TQe,"getStack");function Z9u(e,t){return t}s(Z9u,"prepareObjectStackTrace");function e5u(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");var r=V9u(e.length),n=TQe(),i=U9(n[1]);i.name=e.name;var o=new Function("fn","log","deprecate","message","site",`"use strict"
|
|
1379
1379
|
return function (`+r+`) {log.call(deprecate, message, site)
|
|
1380
1380
|
return fn.apply(this, arguments)
|
|
1381
|
-
}`)(e,wQe,this,t,i);return o}s(e5u,"wrapfunction");function t5u(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable");var i=this,o=TQe(),a=U9(o[1]);a.name=t,"value"in n&&(n=G9u(e,t,r));var c=n.get,u=n.set;typeof c=="function"&&(n.get=s(function(){return wQe.call(i,r,a),c.apply(this,arguments)},"getter")),typeof u=="function"&&(n.set=s(function(){return wQe.call(i,r,a),u.apply(this,arguments)},"setter")),Object.defineProperty(e,t,n)}s(t5u,"wrapproperty");function VWi(e,t,r){var n=new Error,i;return Object.defineProperty(n,"constructor",{value:VWi}),Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(n,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,get:function(){return i!==void 0?i:i=$9u.call(this,r)},set:s(function(a){i=a},"setter")}),n}s(VWi,"DeprecationError")});var YWi=g((dyf,WWi)=>{"use strict";WWi.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?r5u:n5u);function r5u(e,t){return e.__proto__=t,e}s(r5u,"setProtoOf");function n5u(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=t[r]);return e}s(n5u,"mixinProperties")});var KWi=g((pyf,i5u)=>{i5u.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}});var ZWi=g((hyf,XWi)=>{"use strict";var f$t=KWi();XWi.exports=Lv;Lv.message=f$t;Lv.code=s5u(f$t);Lv.codes=o5u(f$t);Lv.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};Lv.empty={204:!0,205:!0,304:!0};Lv.retry={502:!0,503:!0,504:!0};function s5u(e){var t={};return Object.keys(e).forEach(s(function(n){var i=e[n],o=Number(n);t[i.toLowerCase()]=o},"forEachCode")),t}s(s5u,"createMessageToStatusCodeMap");function o5u(e){return Object.keys(e).map(s(function(r){return Number(r)},"mapCode"))}s(o5u,"createStatusCodeList");function a5u(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Lv.code,t))throw new Error('invalid status message: "'+e+'"');return Lv.code[t]}s(a5u,"getStatusCode");function JWi(e){if(!Object.prototype.hasOwnProperty.call(Lv.message,e))throw new Error("invalid status code: "+e);return Lv.message[e]}s(JWi,"getStatusMessage");function Lv(e){if(typeof e=="number")return JWi(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?a5u(e):JWi(t)}s(Lv,"status")});var t8i=g((gyf,e8i)=>{"use strict";e8i.exports=c5u;function c5u(e){return e.split(" ").map(function(t){return t.slice(0,1).toUpperCase()+t.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}s(c5u,"toIdentifier")});var o8i=g((yyf,FQ)=>{"use strict";var u5u=zWi()("http-errors"),r8i=YWi(),q9=ZWi(),p$t=_T(),l5u=t8i();FQ.exports=CQe;FQ.exports.HttpError=d5u();FQ.exports.isHttpError=p5u(FQ.exports.HttpError);m5u(FQ.exports,q9.codes,FQ.exports.HttpError);function n8i(e){return+(String(e).charAt(0)+"00")}s(n8i,"codeClass");function CQe(){for(var e,t,r=500,n={},i=0;i<arguments.length;i++){var o=arguments[i],a=typeof o;if(a==="object"&&o instanceof Error)e=o,r=e.status||e.statusCode||r;else if(a==="number"&&i===0)r=o;else if(a==="string")t=o;else if(a==="object")n=o;else throw new TypeError("argument #"+(i+1)+" unsupported type "+a)}typeof r=="number"&&(r<400||r>=600)&&u5u("non-error status code; use only 4xx or 5xx status codes"),(typeof r!="number"||!q9.message[r]&&(r<400||r>=600))&&(r=500);var c=CQe[r]||CQe[n8i(r)];e||(e=c?new c(t):new Error(t||q9.message[r]),Error.captureStackTrace(e,CQe)),(!c||!(e instanceof c)||e.status!==r)&&(e.expose=r<500,e.status=e.statusCode=r);for(var u in n)u!=="status"&&u!=="statusCode"&&(e[u]=n[u]);return e}s(CQe,"createError");function d5u(){function e(){throw new TypeError("cannot construct abstract class")}return s(e,"HttpError"),p$t(e,Error),e}s(d5u,"createHttpErrorConstructor");function f5u(e,t,r){var n=s8i(t);function i(o){var a=o??q9.message[r],c=new Error(a);return Error.captureStackTrace(c,i),r8i(c,i.prototype),Object.defineProperty(c,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(c,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),c}return s(i,"ClientError"),p$t(i,e),i8i(i,n),i.prototype.status=r,i.prototype.statusCode=r,i.prototype.expose=!0,i}s(f5u,"createClientErrorConstructor");function p5u(e){return s(function(r){return!r||typeof r!="object"?!1:r instanceof e?!0:r instanceof Error&&typeof r.expose=="boolean"&&typeof r.statusCode=="number"&&r.status===r.statusCode},"isHttpError")}s(p5u,"createIsHttpErrorFunction");function h5u(e,t,r){var n=s8i(t);function i(o){var a=o??q9.message[r],c=new Error(a);return Error.captureStackTrace(c,i),r8i(c,i.prototype),Object.defineProperty(c,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(c,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),c}return s(i,"ServerError"),p$t(i,e),i8i(i,n),i.prototype.status=r,i.prototype.statusCode=r,i.prototype.expose=!1,i}s(h5u,"createServerErrorConstructor");function i8i(e,t){var r=Object.getOwnPropertyDescriptor(e,"name");r&&r.configurable&&(r.value=t,Object.defineProperty(e,"name",r))}s(i8i,"nameFunc");function m5u(e,t,r){t.forEach(s(function(i){var o,a=l5u(q9.message[i]);switch(n8i(i)){case 400:o=f5u(r,a,i);break;case 500:o=h5u(r,a,i);break}o&&(e[i]=o,e[a]=o)},"forEachCode"))}s(m5u,"populateConstructorExports");function s8i(e){return e.substr(-5)!=="Error"?e+"Error":e}s(s8i,"toClassName")});var A$t=g(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.pathToRegexp=Oh.tokensToRegexp=Oh.regexpToFunction=Oh.match=Oh.tokensToFunction=Oh.compile=Oh.parse=void 0;function g5u(e){for(var t=[],r=0;r<e.length;){var n=e[r];if(n==="*"||n==="+"||n==="?"){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if(n==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if(n==="{"){t.push({type:"OPEN",index:r,value:e[r++]});continue}if(n==="}"){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(n===":"){for(var i="",o=r+1;o<e.length;){var a=e.charCodeAt(o);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||a===95){i+=e[o++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=o;continue}if(n==="("){var c=1,u="",o=r+1;if(e[o]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(o));for(;o<e.length;){if(e[o]==="\\"){u+=e[o++]+e[o++];continue}if(e[o]===")"){if(c--,c===0){o++;break}}else if(e[o]==="("&&(c++,e[o+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(o));u+=e[o++]}if(c)throw new TypeError("Unbalanced pattern at ".concat(r));if(!u)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:u}),r=o;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}s(g5u,"lexer");function h$t(e,t){t===void 0&&(t={});for(var r=g5u(e),n=t.prefixes,i=n===void 0?"./":n,o=t.delimiter,a=o===void 0?"/#?":o,c=[],u=0,l=0,d="",f=s(function(H){if(l<r.length&&r[l].type===H)return r[l++].value},"tryConsume"),p=s(function(H){var $=f(H);if($!==void 0)return $;var X=r[l],ue=X.type,L=X.index;throw new TypeError("Unexpected ".concat(ue," at ").concat(L,", expected ").concat(H))},"mustConsume"),h=s(function(){for(var H="",$;$=f("CHAR")||f("ESCAPED_CHAR");)H+=$;return H},"consumeText"),A=s(function(H){for(var $=0,X=a;$<X.length;$++){var ue=X[$];if(H.indexOf(ue)>-1)return!0}return!1},"isSafe"),y=s(function(H){var $=c[c.length-1],X=H||($&&typeof $=="string"?$:"");if($&&!X)throw new TypeError('Must have text between two parameters, missing text after "'.concat($.name,'"'));return!X||A(X)?"[^".concat(XP(a),"]+?"):"(?:(?!".concat(XP(X),")[^").concat(XP(a),"])+?")},"safePattern");l<r.length;){var S=f("CHAR"),b=f("NAME"),x=f("PATTERN");if(b||x){var O=S||"";i.indexOf(O)===-1&&(d+=O,O=""),d&&(c.push(d),d=""),c.push({name:b||u++,prefix:O,suffix:"",pattern:x||y(O),modifier:f("MODIFIER")||""});continue}var N=S||f("ESCAPED_CHAR");if(N){d+=N;continue}d&&(c.push(d),d="");var T=f("OPEN");if(T){var O=h(),B=f("NAME")||"",F=f("PATTERN")||"",j=h();p("CLOSE"),c.push({name:B||(F?u++:""),pattern:B&&!F?y(O):F,prefix:O,suffix:j,modifier:f("MODIFIER")||""});continue}p("END")}return c}s(h$t,"parse");Oh.parse=h$t;function A5u(e,t){return a8i(h$t(e,t),t)}s(A5u,"compile");Oh.compile=A5u;function a8i(e,t){t===void 0&&(t={});var r=m$t(t),n=t.encode,i=n===void 0?function(u){return u}:n,o=t.validate,a=o===void 0?!0:o,c=e.map(function(u){if(typeof u=="object")return new RegExp("^(?:".concat(u.pattern,")$"),r)});return function(u){for(var l="",d=0;d<e.length;d++){var f=e[d];if(typeof f=="string"){l+=f;continue}var p=u?u[f.name]:void 0,h=f.modifier==="?"||f.modifier==="*",A=f.modifier==="*"||f.modifier==="+";if(Array.isArray(p)){if(!A)throw new TypeError('Expected "'.concat(f.name,'" to not repeat, but got an array'));if(p.length===0){if(h)continue;throw new TypeError('Expected "'.concat(f.name,'" to not be empty'))}for(var y=0;y<p.length;y++){var S=i(p[y],f);if(a&&!c[d].test(S))throw new TypeError('Expected all "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(S,'"'));l+=f.prefix+S+f.suffix}continue}if(typeof p=="string"||typeof p=="number"){var S=i(String(p),f);if(a&&!c[d].test(S))throw new TypeError('Expected "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(S,'"'));l+=f.prefix+S+f.suffix;continue}if(!h){var b=A?"an array":"a string";throw new TypeError('Expected "'.concat(f.name,'" to be ').concat(b))}}return l}}s(a8i,"tokensToFunction");Oh.tokensToFunction=a8i;function y5u(e,t){var r=[],n=g$t(e,r,t);return c8i(n,r,t)}s(y5u,"match");Oh.match=y5u;function c8i(e,t,r){r===void 0&&(r={});var n=r.decode,i=n===void 0?function(o){return o}:n;return function(o){var a=e.exec(o);if(!a)return!1;for(var c=a[0],u=a.index,l=Object.create(null),d=s(function(p){if(a[p]===void 0)return"continue";var h=t[p-1];h.modifier==="*"||h.modifier==="+"?l[h.name]=a[p].split(h.prefix+h.suffix).map(function(A){return i(A,h)}):l[h.name]=i(a[p],h)},"_loop_1"),f=1;f<a.length;f++)d(f);return{path:c,index:u,params:l}}}s(c8i,"regexpToFunction");Oh.regexpToFunction=c8i;function XP(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}s(XP,"escapeString");function m$t(e){return e&&e.sensitive?"":"i"}s(m$t,"flags");function _5u(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=r.exec(e.source);i;)t.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=r.exec(e.source);return e}s(_5u,"regexpToRegexp");function E5u(e,t,r){var n=e.map(function(i){return g$t(i,t,r).source});return new RegExp("(?:".concat(n.join("|"),")"),m$t(r))}s(E5u,"arrayToRegexp");function b5u(e,t,r){return u8i(h$t(e,r),t,r)}s(b5u,"stringToRegexp");function u8i(e,t,r){r===void 0&&(r={});for(var n=r.strict,i=n===void 0?!1:n,o=r.start,a=o===void 0?!0:o,c=r.end,u=c===void 0?!0:c,l=r.encode,d=l===void 0?function($){return $}:l,f=r.delimiter,p=f===void 0?"/#?":f,h=r.endsWith,A=h===void 0?"":h,y="[".concat(XP(A),"]|$"),S="[".concat(XP(p),"]"),b=a?"^":"",x=0,O=e;x<O.length;x++){var N=O[x];if(typeof N=="string")b+=XP(d(N));else{var T=XP(d(N.prefix)),B=XP(d(N.suffix));if(N.pattern)if(t&&t.push(N),T||B)if(N.modifier==="+"||N.modifier==="*"){var F=N.modifier==="*"?"?":"";b+="(?:".concat(T,"((?:").concat(N.pattern,")(?:").concat(B).concat(T,"(?:").concat(N.pattern,"))*)").concat(B,")").concat(F)}else b+="(?:".concat(T,"(").concat(N.pattern,")").concat(B,")").concat(N.modifier);else{if(N.modifier==="+"||N.modifier==="*")throw new TypeError('Can not repeat "'.concat(N.name,'" without a prefix and suffix'));b+="(".concat(N.pattern,")").concat(N.modifier)}else b+="(?:".concat(T).concat(B,")").concat(N.modifier)}}if(u)i||(b+="".concat(S,"?")),b+=r.endsWith?"(?=".concat(y,")"):"$";else{var j=e[e.length-1],H=typeof j=="string"?S.indexOf(j[j.length-1])>-1:j===void 0;i||(b+="(?:".concat(S,"(?=").concat(y,"))?")),H||(b+="(?=".concat(S,"|").concat(y,")"))}return new RegExp(b,m$t(r))}s(u8i,"tokensToRegexp");Oh.tokensToRegexp=u8i;function g$t(e,t,r){return e instanceof RegExp?_5u(e,t):Array.isArray(e)?E5u(e,t,r):b5u(e,t,r)}s(g$t,"pathToRegexp");Oh.pathToRegexp=g$t});var f8i=g((vyf,d8i)=>{"use strict";var{parse:S5u,format:v5u}=require("node:url"),{pathToRegexp:l8i,compile:w5u,parse:T5u}=A$t();d8i.exports=class{static{s(this,"Layer")}constructor(t,r,n,i={}){this.opts=i,this.name=this.opts.name||null,this.methods=[],this.paramNames=[],this.stack=Array.isArray(n)?n:[n];for(let o of r){let a=this.methods.push(o.toUpperCase());this.methods[a-1]==="GET"&&this.methods.unshift("HEAD")}for(let o=0;o<this.stack.length;o++){let c=typeof this.stack[o];if(c!=="function")throw new Error(`${r.toString()} \`${this.opts.name||t}\`: \`middleware\` must be a function, not \`${c}\``)}this.path=t,this.regexp=l8i(t,this.paramNames,this.opts)}match(t){return this.regexp.test(t)}params(t,r,n={}){for(let i=r.length,o=0;o<i;o++)if(this.paramNames[o]){let a=r[o];a&&a.length>0&&(n[this.paramNames[o].name]=a&&C5u(a))}return n}captures(t){return this.opts.ignoreCaptures?[]:t.match(this.regexp).slice(1)}url(t,r){let n=t,i=this.path.replace(/\(\.\*\)/g,"");typeof t!="object"&&(n=Array.prototype.slice.call(arguments),typeof n[n.length-1]=="object"&&(r=n[n.length-1],n=n.slice(0,-1)));let o=w5u(i,{encode:encodeURIComponent,...r}),a,c=T5u(i),u={};if(Array.isArray(n))for(let l=c.length,d=0,f=0;d<l;d++)c[d].name&&(u[c[d].name]=n[f++]);else c.some(l=>l.name)?u=t:r||(r=t);return a=o(u),r&&r.query?(a=S5u(a),typeof r.query=="string"?a.search=r.query:(a.search=void 0,a.query=r.query),v5u(a)):a}param(t,r){let{stack:n}=this,i=this.paramNames,o=s(function(u,l){return r.call(this,u.params[t],u,l)},"middleware");o.param=t;let a=i.map(function(u){return u.name}),c=a.indexOf(t);return c>-1&&n.some((u,l)=>{if(!u.param||a.indexOf(u.param)>c)return n.splice(l,0,o),!0}),this}setPrefix(t){return this.path&&(this.path=this.path!=="/"||this.opts.strict===!0?`${t}${this.path}`:t,this.paramNames=[],this.regexp=l8i(this.path,this.paramNames,this.opts)),this}};function C5u(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}s(C5u,"safeDecodeURIComponent")});var g8i=g((Tyf,m8i)=>{"use strict";var I5u=require("node:http"),y$t=JO()("koa-router"),x5u=jWi(),p8i=o8i(),{pathToRegexp:R5u}=A$t(),_$t=f8i(),h8i=I5u.METHODS.map(e=>e.toLowerCase()),F9=class e{static{s(this,"Router")}constructor(t={}){if(!(this instanceof e))return new e(t);this.opts=t,this.methods=this.opts.methods||["HEAD","OPTIONS","GET","PUT","PATCH","POST","DELETE"],this.exclusive=!!this.opts.exclusive,this.params={},this.stack=[],this.host=this.opts.host}static url(t,...r){return _$t.prototype.url.apply({path:t},r)}use(...t){let r=this,n;if(Array.isArray(t[0])&&typeof t[0][0]=="string"){let o=t[0];for(let a of o)r.use.apply(r,[a,...t.slice(1)]);return this}let i=typeof t[0]=="string";i&&(n=t.shift());for(let o of t)if(o.router){let a=Object.assign(Object.create(e.prototype),o.router,{stack:[...o.router.stack]});for(let c=0;c<a.stack.length;c++){let u=a.stack[c],l=Object.assign(Object.create(_$t.prototype),u);n&&l.setPrefix(n),r.opts.prefix&&l.setPrefix(r.opts.prefix),r.stack.push(l),a.stack[c]=l}if(r.params){let c=Object.keys(r.params);for(let u of c)a.param(u,r.params[u])}}else{let a=[];R5u(r.opts.prefix||"",a);let c=!!(r.opts.prefix&&a.length>0);r.register(n||"([^/]*)",[],o,{end:!1,ignoreCaptures:!i&&!c})}return this}prefix(t){t=t.replace(/\/$/,""),this.opts.prefix=t;for(let r=0;r<this.stack.length;r++)this.stack[r].setPrefix(t);return this}middleware(){let t=this,r=s((n,i)=>{if(y$t("%s %s",n.method,n.path),!t.matchHost(n.host))return i();let a=t.opts.routerPath||n.newRouterPath||n.path||n.routerPath,c=t.match(a,n.method);if(n.matched?n.matched.push.apply(n.matched,c.path):n.matched=c.path,n.router=t,!c.route)return i();let u=c.pathAndMethod,l=u[u.length-1];n._matchedRoute=l.path,l.name&&(n._matchedRouteName=l.name);let d=(t.exclusive?[l]:u).reduce((f,p)=>(f.push((h,A)=>(h.captures=p.captures(a,h.captures),h.request.params=p.params(a,h.captures,h.params),h.params=h.request.params,h.routerPath=p.path,h.routerName=p.name,h._matchedRoute=p.path,p.name&&(h._matchedRouteName=p.name),A())),[...f,...p.stack]),[]);return x5u(d)(n,i)},"dispatch");return r.router=this,r}routes(){return this.middleware()}allowedMethods(t={}){let r=this.methods;return(n,i)=>i().then(()=>{let o={};if(n.matched&&(!n.status||n.status===404)){for(let c=0;c<n.matched.length;c++){let u=n.matched[c];for(let l=0;l<u.methods.length;l++){let d=u.methods[l];o[d]=d}}let a=Object.keys(o);if(r.includes(n.method)){if(a.length>0){if(n.method==="OPTIONS")n.status=200,n.body="",n.set("Allow",a.join(", "));else if(!o[n.method]){if(t.throw)throw typeof t.methodNotAllowed=="function"?t.methodNotAllowed():new p8i.MethodNotAllowed;n.status=405,n.set("Allow",a.join(", "))}}}else{if(t.throw)throw typeof t.notImplemented=="function"?t.notImplemented():new p8i.NotImplemented;n.status=501,n.set("Allow",a.join(", "))}}})}all(t,r,n){if(typeof r=="string"?n=Array.prototype.slice.call(arguments,2):(n=Array.prototype.slice.call(arguments,1),r=t,t=null),typeof r!="string"&&!(r instanceof RegExp)&&(!Array.isArray(r)||r.length===0))throw new Error("You have to provide a path when adding an all handler");return this.register(r,h8i,n,{name:t}),this}redirect(t,r,n){if((typeof t=="symbol"||t[0]!=="/")&&(t=this.url(t),t instanceof Error))throw t;if((typeof r=="symbol"||r[0]!=="/"&&!r.includes("://"))&&(r=this.url(r),r instanceof Error))throw r;return this.all(t,i=>{i.redirect(r),i.status=n||301})}register(t,r,n,i={}){let o=this,{stack:a}=this;if(Array.isArray(t)){for(let u of t)o.register.call(o,u,r,n,i);return this}let c=new _$t(t,r,n,{end:i.end===!1?i.end:!0,name:i.name,sensitive:i.sensitive||this.opts.sensitive||!1,strict:i.strict||this.opts.strict||!1,prefix:i.prefix||this.opts.prefix||"",ignoreCaptures:i.ignoreCaptures});this.opts.prefix&&c.setPrefix(this.opts.prefix);for(let u=0;u<Object.keys(this.params).length;u++){let l=Object.keys(this.params)[u];c.param(l,this.params[l])}return a.push(c),y$t("defined route %s %s",c.methods,c.path),c}route(t){let r=this.stack;for(let n=r.length,i=0;i<n;i++)if(r[i].name&&r[i].name===t)return r[i];return!1}url(t,...r){let n=this.route(t);return n?n.url.apply(n,r):new Error(`No route found for name: ${String(t)}`)}match(t,r){let n=this.stack,i,o={path:[],pathAndMethod:[],route:!1};for(let a=n.length,c=0;c<a;c++)i=n[c],y$t("test %s %s",i.path,i.regexp),i.match(t)&&(o.path.push(i),(i.methods.length===0||i.methods.includes(r))&&(o.pathAndMethod.push(i),i.methods.length>0&&(o.route=!0)));return o}matchHost(t){let{host:r}=this;if(!r)return!0;if(!t)return!1;if(typeof r=="string")return t===r;if(typeof r=="object"&&r instanceof RegExp)return r.test(t)}param(t,r){this.params[t]=r;for(let n=0;n<this.stack.length;n++)this.stack[n].param(t,r);return this}};for(let e of h8i)F9.prototype[e]=function(t,r,n){if(typeof r=="string"||r instanceof RegExp?n=Array.prototype.slice.call(arguments,2):(n=Array.prototype.slice.call(arguments,1),r=t,t=null),typeof r!="string"&&!(r instanceof RegExp)&&(!Array.isArray(r)||r.length===0))throw new Error(`You have to provide a path when adding a ${e} handler`);return this.register(r,[e],n,{name:t}),this};F9.prototype.del=F9.prototype.delete;m8i.exports=F9});var R8i=g((g_f,x8i)=>{"use strict";var Q5u=[].indexOf;x8i.exports=function(e,t){if(Q5u)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}});var O8i=g((exports,module)=>{"use strict";var indexOf=R8i(),iFrame=null,Object_keys=s(function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},"Object_keys"),forEach=s(function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},"forEach"),defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch{return function(t,r,n){t[r]=n}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape","window","document"];function Context(){}s(Context,"Context");Context.prototype={};var Script=exports.Script=s(function(t){if(!(this instanceof Script))return new Script(t);iFrame||(iFrame=document.createElement("iframe"),iFrame.setAttribute("sandbox","allow-scripts allow-same-origin"),iFrame.style||(iFrame.style={}),iFrame.style.display="none",document.body.appendChild(iFrame)),this.code=t,this.iFrame=iFrame},"NodeScript");Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=this.iFrame.contentWindow,r=Object_keys(t);let n=[];var i=t.eval,o=t.execScript;forEach(Object_keys(e),function(u){if(t[u]!==void 0){let l={key:u,value:t[u]};n.push(l)}t[u]=e[u]}),!i&&o&&(o.call(t,"null"),i=t.eval);var a=Object_keys(t),c=i.call(t,this.code);return forEach(Object_keys(t),function(u){(u in e||indexOf(a,u)===-1)&&(indexOf(globals,u)===-1?e[u]=t[u]:defineProp(e,u,t[u])),indexOf(r,u)===-1&&delete t[u]}),forEach(n,function(u){t[u.key]=u.value}),c};Script.prototype.runInThisContext=function(){return eval(this.code)};Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return forEach(Object_keys(t),function(n){e[n]=t[n]}),r};forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}});exports.createScript=function(e){return exports.Script(e)};exports.createContext=Script.createContext=function(e){var t=new Context;return typeof e=="object"&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}});var zm=g(Zy=>{"use strict";Zy.__esModule=!0;Zy.extend=k8i;Zy.indexOf=$5u;Zy.escapeExpression=z5u;Zy.isEmpty=W5u;Zy.createFrame=Y5u;Zy.blockParams=K5u;Zy.appendContextPath=J5u;var j5u={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},H5u=/[&<>"'`=]/g,G5u=/[&<>"'`=]/;function V5u(e){return j5u[e]}s(V5u,"escapeChar");function k8i(e){for(var t=1;t<arguments.length;t++)for(var r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&(e[r]=arguments[t][r]);return e}s(k8i,"extend");var T$t=Object.prototype.toString;Zy.toString=T$t;var w$t=s(function(t){return typeof t=="function"},"isFunction");w$t(/x/)&&(Zy.isFunction=w$t=s(function(e){return typeof e=="function"&&T$t.call(e)==="[object Function]"},"isFunction"));Zy.isFunction=w$t;var N8i=Array.isArray||function(e){return e&&typeof e=="object"?T$t.call(e)==="[object Array]":!1};Zy.isArray=N8i;function $5u(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}s($5u,"indexOf");function z5u(e){if(typeof e!="string"){if(e&&e.toHTML)return e.toHTML();if(e==null)return"";if(!e)return e+"";e=""+e}return G5u.test(e)?e.replace(H5u,V5u):e}s(z5u,"escapeExpression");function W5u(e){return!e&&e!==0?!0:!!(N8i(e)&&e.length===0)}s(W5u,"isEmpty");function Y5u(e){var t=k8i({},e);return t._parent=e,t}s(Y5u,"createFrame");function K5u(e,t){return e.path=t,e}s(K5u,"blockParams");function J5u(e,t){return(e?e+".":"")+t}s(J5u,"appendContextPath")});var xb=g((IQe,D8i)=>{"use strict";IQe.__esModule=!0;var C$t=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function I$t(e,t){var r=t&&t.loc,n=void 0,i=void 0,o=void 0,a=void 0;r&&(n=r.start.line,i=r.end.line,o=r.start.column,a=r.end.column,e+=" - "+n+":"+o);for(var c=Error.prototype.constructor.call(this,e),u=0;u<C$t.length;u++)this[C$t[u]]=c[C$t[u]];Error.captureStackTrace&&Error.captureStackTrace(this,I$t);try{r&&(this.lineNumber=n,this.endLineNumber=i,Object.defineProperty?(Object.defineProperty(this,"column",{value:o,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:a,enumerable:!0})):(this.column=o,this.endColumn=a))}catch{}}s(I$t,"Exception");I$t.prototype=new Error;IQe.default=I$t;D8i.exports=IQe.default});var B8i=g((xQe,P8i)=>{"use strict";xQe.__esModule=!0;var x$t=zm();xQe.default=function(e){e.registerHelper("blockHelperMissing",function(t,r){var n=r.inverse,i=r.fn;if(t===!0)return i(this);if(t===!1||t==null)return n(this);if(x$t.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):n(this);if(r.data&&r.ids){var o=x$t.createFrame(r.data);o.contextPath=x$t.appendContextPath(r.data.contextPath,r.name),r={data:o}}return i(t,r)})};P8i.exports=xQe.default});var L8i=g((RQe,M8i)=>{"use strict";RQe.__esModule=!0;function X5u(e){return e&&e.__esModule?e:{default:e}}s(X5u,"_interopRequireDefault");var Jue=zm(),Z5u=xb(),eKu=X5u(Z5u);RQe.default=function(e){e.registerHelper("each",function(t,r){if(!r)throw new eKu.default("Must pass iterator to #each");var n=r.fn,i=r.inverse,o=0,a="",c=void 0,u=void 0;r.data&&r.ids&&(u=Jue.appendContextPath(r.data.contextPath,r.ids[0])+"."),Jue.isFunction(t)&&(t=t.call(this)),r.data&&(c=Jue.createFrame(r.data));function l(A,y,S){c&&(c.key=A,c.index=y,c.first=y===0,c.last=!!S,u&&(c.contextPath=u+A)),a=a+n(t[A],{data:c,blockParams:Jue.blockParams([t[A],A],[u+A,null])})}if(s(l,"execIteration"),t&&typeof t=="object")if(Jue.isArray(t))for(var d=t.length;o<d;o++)o in t&&l(o,o,o===t.length-1);else if(typeof Symbol=="function"&&t[Symbol.iterator]){for(var f=[],p=t[Symbol.iterator](),h=p.next();!h.done;h=p.next())f.push(h.value);t=f;for(var d=t.length;o<d;o++)l(o,o,o===t.length-1)}else(function(){var A=void 0;Object.keys(t).forEach(function(y){A!==void 0&&l(A,o-1),A=y,o++}),A!==void 0&&l(A,o-1,!0)})();return o===0&&(a=i(this)),a})};M8i.exports=RQe.default});var q8i=g((OQe,U8i)=>{"use strict";OQe.__esModule=!0;function tKu(e){return e&&e.__esModule?e:{default:e}}s(tKu,"_interopRequireDefault");var rKu=xb(),nKu=tKu(rKu);OQe.default=function(e){e.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new nKu.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};U8i.exports=OQe.default});var H8i=g((kQe,j8i)=>{"use strict";kQe.__esModule=!0;function iKu(e){return e&&e.__esModule?e:{default:e}}s(iKu,"_interopRequireDefault");var F8i=zm(),sKu=xb(),Q8i=iKu(sKu);kQe.default=function(e){e.registerHelper("if",function(t,r){if(arguments.length!=2)throw new Q8i.default("#if requires exactly one argument");return F8i.isFunction(t)&&(t=t.call(this)),!r.hash.includeZero&&!t||F8i.isEmpty(t)?r.inverse(this):r.fn(this)}),e.registerHelper("unless",function(t,r){if(arguments.length!=2)throw new Q8i.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})})};j8i.exports=kQe.default});var V8i=g((NQe,G8i)=>{"use strict";NQe.__esModule=!0;NQe.default=function(e){e.registerHelper("log",function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)t.push(arguments[n]);var i=1;r.hash.level!=null?i=r.hash.level:r.data&&r.data.level!=null&&(i=r.data.level),t[0]=i,e.log.apply(e,t)})};G8i.exports=NQe.default});var z8i=g((DQe,$8i)=>{"use strict";DQe.__esModule=!0;DQe.default=function(e){e.registerHelper("lookup",function(t,r,n){return t&&n.lookupProperty(t,r)})};$8i.exports=DQe.default});var Y8i=g((PQe,W8i)=>{"use strict";PQe.__esModule=!0;function oKu(e){return e&&e.__esModule?e:{default:e}}s(oKu,"_interopRequireDefault");var Xue=zm(),aKu=xb(),cKu=oKu(aKu);PQe.default=function(e){e.registerHelper("with",function(t,r){if(arguments.length!=2)throw new cKu.default("#with requires exactly one argument");Xue.isFunction(t)&&(t=t.call(this));var n=r.fn;if(Xue.isEmpty(t))return r.inverse(this);var i=r.data;return r.data&&r.ids&&(i=Xue.createFrame(r.data),i.contextPath=Xue.appendContextPath(r.data.contextPath,r.ids[0])),n(t,{data:i,blockParams:Xue.blockParams([t],[i&&i.contextPath])})})};W8i.exports=PQe.default});var R$t=g(BQe=>{"use strict";BQe.__esModule=!0;BQe.registerDefaultHelpers=vKu;BQe.moveHelperToHooks=wKu;function HQ(e){return e&&e.__esModule?e:{default:e}}s(HQ,"_interopRequireDefault");var uKu=B8i(),lKu=HQ(uKu),dKu=L8i(),fKu=HQ(dKu),pKu=q8i(),hKu=HQ(pKu),mKu=H8i(),gKu=HQ(mKu),AKu=V8i(),yKu=HQ(AKu),_Ku=z8i(),EKu=HQ(_Ku),bKu=Y8i(),SKu=HQ(bKu);function vKu(e){lKu.default(e),fKu.default(e),hKu.default(e),gKu.default(e),yKu.default(e),EKu.default(e),SKu.default(e)}s(vKu,"registerDefaultHelpers");function wKu(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])}s(wKu,"moveHelperToHooks")});var J8i=g((MQe,K8i)=>{"use strict";MQe.__esModule=!0;var TKu=zm();MQe.default=function(e){e.registerDecorator("inline",function(t,r,n,i){var o=t;return r.partials||(r.partials={},o=s(function(a,c){var u=n.partials;n.partials=TKu.extend({},u,r.partials);var l=t(a,c);return n.partials=u,l},"ret")),r.partials[i.args[0]]=i.fn,o})};K8i.exports=MQe.default});var X8i=g(O$t=>{"use strict";O$t.__esModule=!0;O$t.registerDefaultDecorators=RKu;function CKu(e){return e&&e.__esModule?e:{default:e}}s(CKu,"_interopRequireDefault");var IKu=J8i(),xKu=CKu(IKu);function RKu(e){xKu.default(e)}s(RKu,"registerDefaultDecorators")});var k$t=g((LQe,Z8i)=>{"use strict";LQe.__esModule=!0;var OKu=zm(),j9={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:s(function(t){if(typeof t=="string"){var r=OKu.indexOf(j9.methodMap,t.toLowerCase());r>=0?t=r:t=parseInt(t,10)}return t},"lookupLevel"),log:s(function(t){if(t=j9.lookupLevel(t),typeof console<"u"&&j9.lookupLevel(j9.level)<=t){var r=j9.methodMap[t];console[r]||(r="log");for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];console[r].apply(console,i)}},"log")};LQe.default=j9;Z8i.exports=LQe.default});var eYi=g(N$t=>{"use strict";N$t.__esModule=!0;N$t.createNewLookupObject=NKu;var kKu=zm();function NKu(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return kKu.extend.apply(void 0,[Object.create(null)].concat(t))}s(NKu,"createNewLookupObject")});var D$t=g(Zue=>{"use strict";Zue.__esModule=!0;Zue.createProtoAccessControl=MKu;Zue.resultIsAllowed=LKu;Zue.resetLoggedProperties=qKu;function DKu(e){return e&&e.__esModule?e:{default:e}}s(DKu,"_interopRequireDefault");var tYi=eYi(),PKu=k$t(),BKu=DKu(PKu),UQe=Object.create(null);function MKu(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:tYi.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:tYi.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}}s(MKu,"createProtoAccessControl");function LKu(e,t,r){return rYi(typeof e=="function"?t.methods:t.properties,r)}s(LKu,"resultIsAllowed");function rYi(e,t){return e.whitelist[t]!==void 0?e.whitelist[t]===!0:e.defaultValue!==void 0?e.defaultValue:(UKu(t),!1)}s(rYi,"checkWhiteList");function UKu(e){UQe[e]!==!0&&(UQe[e]=!0,BKu.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+`" because it is not an "own property" of its parent.
|
|
1381
|
+
}`)(e,wQe,this,t,i);return o}s(e5u,"wrapfunction");function t5u(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable");var i=this,o=TQe(),a=U9(o[1]);a.name=t,"value"in n&&(n=G9u(e,t,r));var c=n.get,u=n.set;typeof c=="function"&&(n.get=s(function(){return wQe.call(i,r,a),c.apply(this,arguments)},"getter")),typeof u=="function"&&(n.set=s(function(){return wQe.call(i,r,a),u.apply(this,arguments)},"setter")),Object.defineProperty(e,t,n)}s(t5u,"wrapproperty");function VWi(e,t,r){var n=new Error,i;return Object.defineProperty(n,"constructor",{value:VWi}),Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(n,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,get:function(){return i!==void 0?i:i=$9u.call(this,r)},set:s(function(a){i=a},"setter")}),n}s(VWi,"DeprecationError")});var YWi=g((dyf,WWi)=>{"use strict";WWi.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?r5u:n5u);function r5u(e,t){return e.__proto__=t,e}s(r5u,"setProtoOf");function n5u(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=t[r]);return e}s(n5u,"mixinProperties")});var KWi=g((pyf,i5u)=>{i5u.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}});var ZWi=g((hyf,XWi)=>{"use strict";var f$t=KWi();XWi.exports=Lv;Lv.message=f$t;Lv.code=s5u(f$t);Lv.codes=o5u(f$t);Lv.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};Lv.empty={204:!0,205:!0,304:!0};Lv.retry={502:!0,503:!0,504:!0};function s5u(e){var t={};return Object.keys(e).forEach(s(function(n){var i=e[n],o=Number(n);t[i.toLowerCase()]=o},"forEachCode")),t}s(s5u,"createMessageToStatusCodeMap");function o5u(e){return Object.keys(e).map(s(function(r){return Number(r)},"mapCode"))}s(o5u,"createStatusCodeList");function a5u(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Lv.code,t))throw new Error('invalid status message: "'+e+'"');return Lv.code[t]}s(a5u,"getStatusCode");function JWi(e){if(!Object.prototype.hasOwnProperty.call(Lv.message,e))throw new Error("invalid status code: "+e);return Lv.message[e]}s(JWi,"getStatusMessage");function Lv(e){if(typeof e=="number")return JWi(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?a5u(e):JWi(t)}s(Lv,"status")});var t8i=g((gyf,e8i)=>{"use strict";e8i.exports=c5u;function c5u(e){return e.split(" ").map(function(t){return t.slice(0,1).toUpperCase()+t.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}s(c5u,"toIdentifier")});var o8i=g((yyf,FQ)=>{"use strict";var u5u=zWi()("http-errors"),r8i=YWi(),q9=ZWi(),p$t=_T(),l5u=t8i();FQ.exports=CQe;FQ.exports.HttpError=d5u();FQ.exports.isHttpError=p5u(FQ.exports.HttpError);m5u(FQ.exports,q9.codes,FQ.exports.HttpError);function n8i(e){return+(String(e).charAt(0)+"00")}s(n8i,"codeClass");function CQe(){for(var e,t,r=500,n={},i=0;i<arguments.length;i++){var o=arguments[i],a=typeof o;if(a==="object"&&o instanceof Error)e=o,r=e.status||e.statusCode||r;else if(a==="number"&&i===0)r=o;else if(a==="string")t=o;else if(a==="object")n=o;else throw new TypeError("argument #"+(i+1)+" unsupported type "+a)}typeof r=="number"&&(r<400||r>=600)&&u5u("non-error status code; use only 4xx or 5xx status codes"),(typeof r!="number"||!q9.message[r]&&(r<400||r>=600))&&(r=500);var c=CQe[r]||CQe[n8i(r)];e||(e=c?new c(t):new Error(t||q9.message[r]),Error.captureStackTrace(e,CQe)),(!c||!(e instanceof c)||e.status!==r)&&(e.expose=r<500,e.status=e.statusCode=r);for(var u in n)u!=="status"&&u!=="statusCode"&&(e[u]=n[u]);return e}s(CQe,"createError");function d5u(){function e(){throw new TypeError("cannot construct abstract class")}return s(e,"HttpError"),p$t(e,Error),e}s(d5u,"createHttpErrorConstructor");function f5u(e,t,r){var n=s8i(t);function i(o){var a=o??q9.message[r],c=new Error(a);return Error.captureStackTrace(c,i),r8i(c,i.prototype),Object.defineProperty(c,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(c,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),c}return s(i,"ClientError"),p$t(i,e),i8i(i,n),i.prototype.status=r,i.prototype.statusCode=r,i.prototype.expose=!0,i}s(f5u,"createClientErrorConstructor");function p5u(e){return s(function(r){return!r||typeof r!="object"?!1:r instanceof e?!0:r instanceof Error&&typeof r.expose=="boolean"&&typeof r.statusCode=="number"&&r.status===r.statusCode},"isHttpError")}s(p5u,"createIsHttpErrorFunction");function h5u(e,t,r){var n=s8i(t);function i(o){var a=o??q9.message[r],c=new Error(a);return Error.captureStackTrace(c,i),r8i(c,i.prototype),Object.defineProperty(c,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(c,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),c}return s(i,"ServerError"),p$t(i,e),i8i(i,n),i.prototype.status=r,i.prototype.statusCode=r,i.prototype.expose=!1,i}s(h5u,"createServerErrorConstructor");function i8i(e,t){var r=Object.getOwnPropertyDescriptor(e,"name");r&&r.configurable&&(r.value=t,Object.defineProperty(e,"name",r))}s(i8i,"nameFunc");function m5u(e,t,r){t.forEach(s(function(i){var o,a=l5u(q9.message[i]);switch(n8i(i)){case 400:o=f5u(r,a,i);break;case 500:o=h5u(r,a,i);break}o&&(e[i]=o,e[a]=o)},"forEachCode"))}s(m5u,"populateConstructorExports");function s8i(e){return e.slice(-5)==="Error"?e:e+"Error"}s(s8i,"toClassName")});var A$t=g(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.pathToRegexp=Oh.tokensToRegexp=Oh.regexpToFunction=Oh.match=Oh.tokensToFunction=Oh.compile=Oh.parse=void 0;function g5u(e){for(var t=[],r=0;r<e.length;){var n=e[r];if(n==="*"||n==="+"||n==="?"){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if(n==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if(n==="{"){t.push({type:"OPEN",index:r,value:e[r++]});continue}if(n==="}"){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(n===":"){for(var i="",o=r+1;o<e.length;){var a=e.charCodeAt(o);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||a===95){i+=e[o++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=o;continue}if(n==="("){var c=1,u="",o=r+1;if(e[o]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(o));for(;o<e.length;){if(e[o]==="\\"){u+=e[o++]+e[o++];continue}if(e[o]===")"){if(c--,c===0){o++;break}}else if(e[o]==="("&&(c++,e[o+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(o));u+=e[o++]}if(c)throw new TypeError("Unbalanced pattern at ".concat(r));if(!u)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:u}),r=o;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}s(g5u,"lexer");function h$t(e,t){t===void 0&&(t={});for(var r=g5u(e),n=t.prefixes,i=n===void 0?"./":n,o=t.delimiter,a=o===void 0?"/#?":o,c=[],u=0,l=0,d="",f=s(function(H){if(l<r.length&&r[l].type===H)return r[l++].value},"tryConsume"),p=s(function(H){var $=f(H);if($!==void 0)return $;var X=r[l],ue=X.type,L=X.index;throw new TypeError("Unexpected ".concat(ue," at ").concat(L,", expected ").concat(H))},"mustConsume"),h=s(function(){for(var H="",$;$=f("CHAR")||f("ESCAPED_CHAR");)H+=$;return H},"consumeText"),A=s(function(H){for(var $=0,X=a;$<X.length;$++){var ue=X[$];if(H.indexOf(ue)>-1)return!0}return!1},"isSafe"),y=s(function(H){var $=c[c.length-1],X=H||($&&typeof $=="string"?$:"");if($&&!X)throw new TypeError('Must have text between two parameters, missing text after "'.concat($.name,'"'));return!X||A(X)?"[^".concat(XP(a),"]+?"):"(?:(?!".concat(XP(X),")[^").concat(XP(a),"])+?")},"safePattern");l<r.length;){var S=f("CHAR"),b=f("NAME"),x=f("PATTERN");if(b||x){var O=S||"";i.indexOf(O)===-1&&(d+=O,O=""),d&&(c.push(d),d=""),c.push({name:b||u++,prefix:O,suffix:"",pattern:x||y(O),modifier:f("MODIFIER")||""});continue}var N=S||f("ESCAPED_CHAR");if(N){d+=N;continue}d&&(c.push(d),d="");var T=f("OPEN");if(T){var O=h(),B=f("NAME")||"",F=f("PATTERN")||"",j=h();p("CLOSE"),c.push({name:B||(F?u++:""),pattern:B&&!F?y(O):F,prefix:O,suffix:j,modifier:f("MODIFIER")||""});continue}p("END")}return c}s(h$t,"parse");Oh.parse=h$t;function A5u(e,t){return a8i(h$t(e,t),t)}s(A5u,"compile");Oh.compile=A5u;function a8i(e,t){t===void 0&&(t={});var r=m$t(t),n=t.encode,i=n===void 0?function(u){return u}:n,o=t.validate,a=o===void 0?!0:o,c=e.map(function(u){if(typeof u=="object")return new RegExp("^(?:".concat(u.pattern,")$"),r)});return function(u){for(var l="",d=0;d<e.length;d++){var f=e[d];if(typeof f=="string"){l+=f;continue}var p=u?u[f.name]:void 0,h=f.modifier==="?"||f.modifier==="*",A=f.modifier==="*"||f.modifier==="+";if(Array.isArray(p)){if(!A)throw new TypeError('Expected "'.concat(f.name,'" to not repeat, but got an array'));if(p.length===0){if(h)continue;throw new TypeError('Expected "'.concat(f.name,'" to not be empty'))}for(var y=0;y<p.length;y++){var S=i(p[y],f);if(a&&!c[d].test(S))throw new TypeError('Expected all "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(S,'"'));l+=f.prefix+S+f.suffix}continue}if(typeof p=="string"||typeof p=="number"){var S=i(String(p),f);if(a&&!c[d].test(S))throw new TypeError('Expected "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(S,'"'));l+=f.prefix+S+f.suffix;continue}if(!h){var b=A?"an array":"a string";throw new TypeError('Expected "'.concat(f.name,'" to be ').concat(b))}}return l}}s(a8i,"tokensToFunction");Oh.tokensToFunction=a8i;function y5u(e,t){var r=[],n=g$t(e,r,t);return c8i(n,r,t)}s(y5u,"match");Oh.match=y5u;function c8i(e,t,r){r===void 0&&(r={});var n=r.decode,i=n===void 0?function(o){return o}:n;return function(o){var a=e.exec(o);if(!a)return!1;for(var c=a[0],u=a.index,l=Object.create(null),d=s(function(p){if(a[p]===void 0)return"continue";var h=t[p-1];h.modifier==="*"||h.modifier==="+"?l[h.name]=a[p].split(h.prefix+h.suffix).map(function(A){return i(A,h)}):l[h.name]=i(a[p],h)},"_loop_1"),f=1;f<a.length;f++)d(f);return{path:c,index:u,params:l}}}s(c8i,"regexpToFunction");Oh.regexpToFunction=c8i;function XP(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}s(XP,"escapeString");function m$t(e){return e&&e.sensitive?"":"i"}s(m$t,"flags");function _5u(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=r.exec(e.source);i;)t.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=r.exec(e.source);return e}s(_5u,"regexpToRegexp");function E5u(e,t,r){var n=e.map(function(i){return g$t(i,t,r).source});return new RegExp("(?:".concat(n.join("|"),")"),m$t(r))}s(E5u,"arrayToRegexp");function b5u(e,t,r){return u8i(h$t(e,r),t,r)}s(b5u,"stringToRegexp");function u8i(e,t,r){r===void 0&&(r={});for(var n=r.strict,i=n===void 0?!1:n,o=r.start,a=o===void 0?!0:o,c=r.end,u=c===void 0?!0:c,l=r.encode,d=l===void 0?function($){return $}:l,f=r.delimiter,p=f===void 0?"/#?":f,h=r.endsWith,A=h===void 0?"":h,y="[".concat(XP(A),"]|$"),S="[".concat(XP(p),"]"),b=a?"^":"",x=0,O=e;x<O.length;x++){var N=O[x];if(typeof N=="string")b+=XP(d(N));else{var T=XP(d(N.prefix)),B=XP(d(N.suffix));if(N.pattern)if(t&&t.push(N),T||B)if(N.modifier==="+"||N.modifier==="*"){var F=N.modifier==="*"?"?":"";b+="(?:".concat(T,"((?:").concat(N.pattern,")(?:").concat(B).concat(T,"(?:").concat(N.pattern,"))*)").concat(B,")").concat(F)}else b+="(?:".concat(T,"(").concat(N.pattern,")").concat(B,")").concat(N.modifier);else{if(N.modifier==="+"||N.modifier==="*")throw new TypeError('Can not repeat "'.concat(N.name,'" without a prefix and suffix'));b+="(".concat(N.pattern,")").concat(N.modifier)}else b+="(?:".concat(T).concat(B,")").concat(N.modifier)}}if(u)i||(b+="".concat(S,"?")),b+=r.endsWith?"(?=".concat(y,")"):"$";else{var j=e[e.length-1],H=typeof j=="string"?S.indexOf(j[j.length-1])>-1:j===void 0;i||(b+="(?:".concat(S,"(?=").concat(y,"))?")),H||(b+="(?=".concat(S,"|").concat(y,")"))}return new RegExp(b,m$t(r))}s(u8i,"tokensToRegexp");Oh.tokensToRegexp=u8i;function g$t(e,t,r){return e instanceof RegExp?_5u(e,t):Array.isArray(e)?E5u(e,t,r):b5u(e,t,r)}s(g$t,"pathToRegexp");Oh.pathToRegexp=g$t});var f8i=g((vyf,d8i)=>{"use strict";var{parse:S5u,format:v5u}=require("node:url"),{pathToRegexp:l8i,compile:w5u,parse:T5u}=A$t();d8i.exports=class{static{s(this,"Layer")}constructor(t,r,n,i={}){this.opts=i,this.name=this.opts.name||null,this.methods=[],this.paramNames=[],this.stack=Array.isArray(n)?n:[n];for(let o of r){let a=this.methods.push(o.toUpperCase());this.methods[a-1]==="GET"&&this.methods.unshift("HEAD")}for(let o=0;o<this.stack.length;o++){let c=typeof this.stack[o];if(c!=="function")throw new Error(`${r.toString()} \`${this.opts.name||t}\`: \`middleware\` must be a function, not \`${c}\``)}this.path=t,this.regexp=l8i(t,this.paramNames,this.opts)}match(t){return this.regexp.test(t)}params(t,r,n={}){for(let i=r.length,o=0;o<i;o++)if(this.paramNames[o]){let a=r[o];a&&a.length>0&&(n[this.paramNames[o].name]=a&&C5u(a))}return n}captures(t){return this.opts.ignoreCaptures?[]:t.match(this.regexp).slice(1)}url(t,r){let n=t,i=this.path.replace(/\(\.\*\)/g,"");typeof t!="object"&&(n=Array.prototype.slice.call(arguments),typeof n[n.length-1]=="object"&&(r=n[n.length-1],n=n.slice(0,-1)));let o=w5u(i,{encode:encodeURIComponent,...r}),a,c=T5u(i),u={};if(Array.isArray(n))for(let l=c.length,d=0,f=0;d<l;d++)c[d].name&&(u[c[d].name]=n[f++]);else c.some(l=>l.name)?u=t:r||(r=t);return a=o(u),r&&r.query?(a=S5u(a),typeof r.query=="string"?a.search=r.query:(a.search=void 0,a.query=r.query),v5u(a)):a}param(t,r){let{stack:n}=this,i=this.paramNames,o=s(function(u,l){return r.call(this,u.params[t],u,l)},"middleware");o.param=t;let a=i.map(function(u){return u.name}),c=a.indexOf(t);return c>-1&&n.some((u,l)=>{if(!u.param||a.indexOf(u.param)>c)return n.splice(l,0,o),!0}),this}setPrefix(t){return this.path&&(this.path=this.path!=="/"||this.opts.strict===!0?`${t}${this.path}`:t,this.paramNames=[],this.regexp=l8i(this.path,this.paramNames,this.opts)),this}};function C5u(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}s(C5u,"safeDecodeURIComponent")});var g8i=g((Tyf,m8i)=>{"use strict";var I5u=require("node:http"),y$t=JO()("koa-router"),x5u=jWi(),p8i=o8i(),{pathToRegexp:R5u}=A$t(),_$t=f8i(),h8i=I5u.METHODS.map(e=>e.toLowerCase()),F9=class e{static{s(this,"Router")}constructor(t={}){if(!(this instanceof e))return new e(t);this.opts=t,this.methods=this.opts.methods||["HEAD","OPTIONS","GET","PUT","PATCH","POST","DELETE"],this.exclusive=!!this.opts.exclusive,this.params={},this.stack=[],this.host=this.opts.host}static url(t,...r){return _$t.prototype.url.apply({path:t},r)}use(...t){let r=this,n;if(Array.isArray(t[0])&&typeof t[0][0]=="string"){let o=t[0];for(let a of o)r.use.apply(r,[a,...t.slice(1)]);return this}let i=typeof t[0]=="string";i&&(n=t.shift());for(let o of t)if(o.router){let a=Object.assign(Object.create(e.prototype),o.router,{stack:[...o.router.stack]});for(let c=0;c<a.stack.length;c++){let u=a.stack[c],l=Object.assign(Object.create(_$t.prototype),u);n&&l.setPrefix(n),r.opts.prefix&&l.setPrefix(r.opts.prefix),r.stack.push(l),a.stack[c]=l}if(r.params){let c=Object.keys(r.params);for(let u of c)a.param(u,r.params[u])}}else{let a=[];R5u(r.opts.prefix||"",a);let c=!!(r.opts.prefix&&a.length>0);r.register(n||"([^/]*)",[],o,{end:!1,ignoreCaptures:!i&&!c})}return this}prefix(t){t=t.replace(/\/$/,""),this.opts.prefix=t;for(let r=0;r<this.stack.length;r++)this.stack[r].setPrefix(t);return this}middleware(){let t=this,r=s((n,i)=>{if(y$t("%s %s",n.method,n.path),!t.matchHost(n.host))return i();let a=t.opts.routerPath||n.newRouterPath||n.path||n.routerPath,c=t.match(a,n.method);if(n.matched?n.matched.push.apply(n.matched,c.path):n.matched=c.path,n.router=t,!c.route)return i();let u=c.pathAndMethod,l=u[u.length-1];n._matchedRoute=l.path,l.name&&(n._matchedRouteName=l.name);let d=(t.exclusive?[l]:u).reduce((f,p)=>(f.push((h,A)=>(h.captures=p.captures(a,h.captures),h.request.params=p.params(a,h.captures,h.params),h.params=h.request.params,h.routerPath=p.path,h.routerName=p.name,h._matchedRoute=p.path,p.name&&(h._matchedRouteName=p.name),A())),[...f,...p.stack]),[]);return x5u(d)(n,i)},"dispatch");return r.router=this,r}routes(){return this.middleware()}allowedMethods(t={}){let r=this.methods;return(n,i)=>i().then(()=>{let o={};if(n.matched&&(!n.status||n.status===404)){for(let c=0;c<n.matched.length;c++){let u=n.matched[c];for(let l=0;l<u.methods.length;l++){let d=u.methods[l];o[d]=d}}let a=Object.keys(o);if(r.includes(n.method)){if(a.length>0){if(n.method==="OPTIONS")n.status=200,n.body="",n.set("Allow",a.join(", "));else if(!o[n.method]){if(t.throw)throw typeof t.methodNotAllowed=="function"?t.methodNotAllowed():new p8i.MethodNotAllowed;n.status=405,n.set("Allow",a.join(", "))}}}else{if(t.throw)throw typeof t.notImplemented=="function"?t.notImplemented():new p8i.NotImplemented;n.status=501,n.set("Allow",a.join(", "))}}})}all(t,r,n){if(typeof r=="string"?n=Array.prototype.slice.call(arguments,2):(n=Array.prototype.slice.call(arguments,1),r=t,t=null),typeof r!="string"&&!(r instanceof RegExp)&&(!Array.isArray(r)||r.length===0))throw new Error("You have to provide a path when adding an all handler");return this.register(r,h8i,n,{name:t}),this}redirect(t,r,n){if((typeof t=="symbol"||t[0]!=="/")&&(t=this.url(t),t instanceof Error))throw t;if((typeof r=="symbol"||r[0]!=="/"&&!r.includes("://"))&&(r=this.url(r),r instanceof Error))throw r;return this.all(t,i=>{i.redirect(r),i.status=n||301})}register(t,r,n,i={}){let o=this,{stack:a}=this;if(Array.isArray(t)){for(let u of t)o.register.call(o,u,r,n,i);return this}let c=new _$t(t,r,n,{end:i.end===!1?i.end:!0,name:i.name,sensitive:i.sensitive||this.opts.sensitive||!1,strict:i.strict||this.opts.strict||!1,prefix:i.prefix||this.opts.prefix||"",ignoreCaptures:i.ignoreCaptures});this.opts.prefix&&c.setPrefix(this.opts.prefix);for(let u=0;u<Object.keys(this.params).length;u++){let l=Object.keys(this.params)[u];c.param(l,this.params[l])}return a.push(c),y$t("defined route %s %s",c.methods,c.path),c}route(t){let r=this.stack;for(let n=r.length,i=0;i<n;i++)if(r[i].name&&r[i].name===t)return r[i];return!1}url(t,...r){let n=this.route(t);return n?n.url.apply(n,r):new Error(`No route found for name: ${String(t)}`)}match(t,r){let n=this.stack,i,o={path:[],pathAndMethod:[],route:!1};for(let a=n.length,c=0;c<a;c++)i=n[c],y$t("test %s %s",i.path,i.regexp),i.match(t)&&(o.path.push(i),(i.methods.length===0||i.methods.includes(r))&&(o.pathAndMethod.push(i),i.methods.length>0&&(o.route=!0)));return o}matchHost(t){let{host:r}=this;if(!r)return!0;if(!t)return!1;if(typeof r=="string")return t===r;if(typeof r=="object"&&r instanceof RegExp)return r.test(t)}param(t,r){this.params[t]=r;for(let n=0;n<this.stack.length;n++)this.stack[n].param(t,r);return this}};for(let e of h8i)F9.prototype[e]=function(t,r,n){if(typeof r=="string"||r instanceof RegExp?n=Array.prototype.slice.call(arguments,2):(n=Array.prototype.slice.call(arguments,1),r=t,t=null),typeof r!="string"&&!(r instanceof RegExp)&&(!Array.isArray(r)||r.length===0))throw new Error(`You have to provide a path when adding a ${e} handler`);return this.register(r,[e],n,{name:t}),this};F9.prototype.del=F9.prototype.delete;m8i.exports=F9});var R8i=g((g_f,x8i)=>{"use strict";var Q5u=[].indexOf;x8i.exports=function(e,t){if(Q5u)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}});var O8i=g((exports,module)=>{"use strict";var indexOf=R8i(),iFrame=null,Object_keys=s(function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},"Object_keys"),forEach=s(function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},"forEach"),defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch{return function(t,r,n){t[r]=n}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape","window","document"];function Context(){}s(Context,"Context");Context.prototype={};var Script=exports.Script=s(function(t){if(!(this instanceof Script))return new Script(t);iFrame||(iFrame=document.createElement("iframe"),iFrame.setAttribute("sandbox","allow-scripts allow-same-origin"),iFrame.style||(iFrame.style={}),iFrame.style.display="none",document.body.appendChild(iFrame)),this.code=t,this.iFrame=iFrame},"NodeScript");Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=this.iFrame.contentWindow,r=Object_keys(t);let n=[];var i=t.eval,o=t.execScript;forEach(Object_keys(e),function(u){if(t[u]!==void 0){let l={key:u,value:t[u]};n.push(l)}t[u]=e[u]}),!i&&o&&(o.call(t,"null"),i=t.eval);var a=Object_keys(t),c=i.call(t,this.code);return forEach(Object_keys(t),function(u){(u in e||indexOf(a,u)===-1)&&(indexOf(globals,u)===-1?e[u]=t[u]:defineProp(e,u,t[u])),indexOf(r,u)===-1&&delete t[u]}),forEach(n,function(u){t[u.key]=u.value}),c};Script.prototype.runInThisContext=function(){return eval(this.code)};Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return forEach(Object_keys(t),function(n){e[n]=t[n]}),r};forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}});exports.createScript=function(e){return exports.Script(e)};exports.createContext=Script.createContext=function(e){var t=new Context;return typeof e=="object"&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}});var zm=g(Zy=>{"use strict";Zy.__esModule=!0;Zy.extend=k8i;Zy.indexOf=$5u;Zy.escapeExpression=z5u;Zy.isEmpty=W5u;Zy.createFrame=Y5u;Zy.blockParams=K5u;Zy.appendContextPath=J5u;var j5u={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},H5u=/[&<>"'`=]/g,G5u=/[&<>"'`=]/;function V5u(e){return j5u[e]}s(V5u,"escapeChar");function k8i(e){for(var t=1;t<arguments.length;t++)for(var r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&(e[r]=arguments[t][r]);return e}s(k8i,"extend");var T$t=Object.prototype.toString;Zy.toString=T$t;var w$t=s(function(t){return typeof t=="function"},"isFunction");w$t(/x/)&&(Zy.isFunction=w$t=s(function(e){return typeof e=="function"&&T$t.call(e)==="[object Function]"},"isFunction"));Zy.isFunction=w$t;var N8i=Array.isArray||function(e){return e&&typeof e=="object"?T$t.call(e)==="[object Array]":!1};Zy.isArray=N8i;function $5u(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}s($5u,"indexOf");function z5u(e){if(typeof e!="string"){if(e&&e.toHTML)return e.toHTML();if(e==null)return"";if(!e)return e+"";e=""+e}return G5u.test(e)?e.replace(H5u,V5u):e}s(z5u,"escapeExpression");function W5u(e){return!e&&e!==0?!0:!!(N8i(e)&&e.length===0)}s(W5u,"isEmpty");function Y5u(e){var t=k8i({},e);return t._parent=e,t}s(Y5u,"createFrame");function K5u(e,t){return e.path=t,e}s(K5u,"blockParams");function J5u(e,t){return(e?e+".":"")+t}s(J5u,"appendContextPath")});var xb=g((IQe,D8i)=>{"use strict";IQe.__esModule=!0;var C$t=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function I$t(e,t){var r=t&&t.loc,n=void 0,i=void 0,o=void 0,a=void 0;r&&(n=r.start.line,i=r.end.line,o=r.start.column,a=r.end.column,e+=" - "+n+":"+o);for(var c=Error.prototype.constructor.call(this,e),u=0;u<C$t.length;u++)this[C$t[u]]=c[C$t[u]];Error.captureStackTrace&&Error.captureStackTrace(this,I$t);try{r&&(this.lineNumber=n,this.endLineNumber=i,Object.defineProperty?(Object.defineProperty(this,"column",{value:o,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:a,enumerable:!0})):(this.column=o,this.endColumn=a))}catch{}}s(I$t,"Exception");I$t.prototype=new Error;IQe.default=I$t;D8i.exports=IQe.default});var B8i=g((xQe,P8i)=>{"use strict";xQe.__esModule=!0;var x$t=zm();xQe.default=function(e){e.registerHelper("blockHelperMissing",function(t,r){var n=r.inverse,i=r.fn;if(t===!0)return i(this);if(t===!1||t==null)return n(this);if(x$t.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):n(this);if(r.data&&r.ids){var o=x$t.createFrame(r.data);o.contextPath=x$t.appendContextPath(r.data.contextPath,r.name),r={data:o}}return i(t,r)})};P8i.exports=xQe.default});var L8i=g((RQe,M8i)=>{"use strict";RQe.__esModule=!0;function X5u(e){return e&&e.__esModule?e:{default:e}}s(X5u,"_interopRequireDefault");var Jue=zm(),Z5u=xb(),eKu=X5u(Z5u);RQe.default=function(e){e.registerHelper("each",function(t,r){if(!r)throw new eKu.default("Must pass iterator to #each");var n=r.fn,i=r.inverse,o=0,a="",c=void 0,u=void 0;r.data&&r.ids&&(u=Jue.appendContextPath(r.data.contextPath,r.ids[0])+"."),Jue.isFunction(t)&&(t=t.call(this)),r.data&&(c=Jue.createFrame(r.data));function l(A,y,S){c&&(c.key=A,c.index=y,c.first=y===0,c.last=!!S,u&&(c.contextPath=u+A)),a=a+n(t[A],{data:c,blockParams:Jue.blockParams([t[A],A],[u+A,null])})}if(s(l,"execIteration"),t&&typeof t=="object")if(Jue.isArray(t))for(var d=t.length;o<d;o++)o in t&&l(o,o,o===t.length-1);else if(typeof Symbol=="function"&&t[Symbol.iterator]){for(var f=[],p=t[Symbol.iterator](),h=p.next();!h.done;h=p.next())f.push(h.value);t=f;for(var d=t.length;o<d;o++)l(o,o,o===t.length-1)}else(function(){var A=void 0;Object.keys(t).forEach(function(y){A!==void 0&&l(A,o-1),A=y,o++}),A!==void 0&&l(A,o-1,!0)})();return o===0&&(a=i(this)),a})};M8i.exports=RQe.default});var q8i=g((OQe,U8i)=>{"use strict";OQe.__esModule=!0;function tKu(e){return e&&e.__esModule?e:{default:e}}s(tKu,"_interopRequireDefault");var rKu=xb(),nKu=tKu(rKu);OQe.default=function(e){e.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new nKu.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};U8i.exports=OQe.default});var H8i=g((kQe,j8i)=>{"use strict";kQe.__esModule=!0;function iKu(e){return e&&e.__esModule?e:{default:e}}s(iKu,"_interopRequireDefault");var F8i=zm(),sKu=xb(),Q8i=iKu(sKu);kQe.default=function(e){e.registerHelper("if",function(t,r){if(arguments.length!=2)throw new Q8i.default("#if requires exactly one argument");return F8i.isFunction(t)&&(t=t.call(this)),!r.hash.includeZero&&!t||F8i.isEmpty(t)?r.inverse(this):r.fn(this)}),e.registerHelper("unless",function(t,r){if(arguments.length!=2)throw new Q8i.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})})};j8i.exports=kQe.default});var V8i=g((NQe,G8i)=>{"use strict";NQe.__esModule=!0;NQe.default=function(e){e.registerHelper("log",function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)t.push(arguments[n]);var i=1;r.hash.level!=null?i=r.hash.level:r.data&&r.data.level!=null&&(i=r.data.level),t[0]=i,e.log.apply(e,t)})};G8i.exports=NQe.default});var z8i=g((DQe,$8i)=>{"use strict";DQe.__esModule=!0;DQe.default=function(e){e.registerHelper("lookup",function(t,r,n){return t&&n.lookupProperty(t,r)})};$8i.exports=DQe.default});var Y8i=g((PQe,W8i)=>{"use strict";PQe.__esModule=!0;function oKu(e){return e&&e.__esModule?e:{default:e}}s(oKu,"_interopRequireDefault");var Xue=zm(),aKu=xb(),cKu=oKu(aKu);PQe.default=function(e){e.registerHelper("with",function(t,r){if(arguments.length!=2)throw new cKu.default("#with requires exactly one argument");Xue.isFunction(t)&&(t=t.call(this));var n=r.fn;if(Xue.isEmpty(t))return r.inverse(this);var i=r.data;return r.data&&r.ids&&(i=Xue.createFrame(r.data),i.contextPath=Xue.appendContextPath(r.data.contextPath,r.ids[0])),n(t,{data:i,blockParams:Xue.blockParams([t],[i&&i.contextPath])})})};W8i.exports=PQe.default});var R$t=g(BQe=>{"use strict";BQe.__esModule=!0;BQe.registerDefaultHelpers=vKu;BQe.moveHelperToHooks=wKu;function HQ(e){return e&&e.__esModule?e:{default:e}}s(HQ,"_interopRequireDefault");var uKu=B8i(),lKu=HQ(uKu),dKu=L8i(),fKu=HQ(dKu),pKu=q8i(),hKu=HQ(pKu),mKu=H8i(),gKu=HQ(mKu),AKu=V8i(),yKu=HQ(AKu),_Ku=z8i(),EKu=HQ(_Ku),bKu=Y8i(),SKu=HQ(bKu);function vKu(e){lKu.default(e),fKu.default(e),hKu.default(e),gKu.default(e),yKu.default(e),EKu.default(e),SKu.default(e)}s(vKu,"registerDefaultHelpers");function wKu(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])}s(wKu,"moveHelperToHooks")});var J8i=g((MQe,K8i)=>{"use strict";MQe.__esModule=!0;var TKu=zm();MQe.default=function(e){e.registerDecorator("inline",function(t,r,n,i){var o=t;return r.partials||(r.partials={},o=s(function(a,c){var u=n.partials;n.partials=TKu.extend({},u,r.partials);var l=t(a,c);return n.partials=u,l},"ret")),r.partials[i.args[0]]=i.fn,o})};K8i.exports=MQe.default});var X8i=g(O$t=>{"use strict";O$t.__esModule=!0;O$t.registerDefaultDecorators=RKu;function CKu(e){return e&&e.__esModule?e:{default:e}}s(CKu,"_interopRequireDefault");var IKu=J8i(),xKu=CKu(IKu);function RKu(e){xKu.default(e)}s(RKu,"registerDefaultDecorators")});var k$t=g((LQe,Z8i)=>{"use strict";LQe.__esModule=!0;var OKu=zm(),j9={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:s(function(t){if(typeof t=="string"){var r=OKu.indexOf(j9.methodMap,t.toLowerCase());r>=0?t=r:t=parseInt(t,10)}return t},"lookupLevel"),log:s(function(t){if(t=j9.lookupLevel(t),typeof console<"u"&&j9.lookupLevel(j9.level)<=t){var r=j9.methodMap[t];console[r]||(r="log");for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];console[r].apply(console,i)}},"log")};LQe.default=j9;Z8i.exports=LQe.default});var eYi=g(N$t=>{"use strict";N$t.__esModule=!0;N$t.createNewLookupObject=NKu;var kKu=zm();function NKu(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return kKu.extend.apply(void 0,[Object.create(null)].concat(t))}s(NKu,"createNewLookupObject")});var D$t=g(Zue=>{"use strict";Zue.__esModule=!0;Zue.createProtoAccessControl=MKu;Zue.resultIsAllowed=LKu;Zue.resetLoggedProperties=qKu;function DKu(e){return e&&e.__esModule?e:{default:e}}s(DKu,"_interopRequireDefault");var tYi=eYi(),PKu=k$t(),BKu=DKu(PKu),UQe=Object.create(null);function MKu(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:tYi.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:tYi.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}}s(MKu,"createProtoAccessControl");function LKu(e,t,r){return rYi(typeof e=="function"?t.methods:t.properties,r)}s(LKu,"resultIsAllowed");function rYi(e,t){return e.whitelist[t]!==void 0?e.whitelist[t]===!0:e.defaultValue!==void 0?e.defaultValue:(UKu(t),!1)}s(rYi,"checkWhiteList");function UKu(e){UQe[e]!==!0&&(UQe[e]=!0,BKu.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+`" because it is not an "own property" of its parent.
|
|
1382
1382
|
You can add a runtime option to disable the check or this warning:
|
|
1383
1383
|
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}s(UKu,"logUnexpecedPropertyAccessOnce");function qKu(){Object.keys(UQe).forEach(function(e){delete UQe[e]})}s(qKu,"resetLoggedProperties")});var FQe=g(eC=>{"use strict";eC.__esModule=!0;eC.HandlebarsEnvironment=M$t;function nYi(e){return e&&e.__esModule?e:{default:e}}s(nYi,"_interopRequireDefault");var GQ=zm(),FKu=xb(),P$t=nYi(FKu),QKu=R$t(),jKu=X8i(),HKu=k$t(),qQe=nYi(HKu),GKu=D$t(),VKu="4.7.8";eC.VERSION=VKu;var $Ku=8;eC.COMPILER_REVISION=$Ku;var zKu=7;eC.LAST_COMPATIBLE_COMPILER_REVISION=zKu;var WKu={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};eC.REVISION_CHANGES=WKu;var B$t="[object Object]";function M$t(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},QKu.registerDefaultHelpers(this),jKu.registerDefaultDecorators(this)}s(M$t,"HandlebarsEnvironment");M$t.prototype={constructor:M$t,logger:qQe.default,log:qQe.default.log,registerHelper:s(function(t,r){if(GQ.toString.call(t)===B$t){if(r)throw new P$t.default("Arg not supported with multiple helpers");GQ.extend(this.helpers,t)}else this.helpers[t]=r},"registerHelper"),unregisterHelper:s(function(t){delete this.helpers[t]},"unregisterHelper"),registerPartial:s(function(t,r){if(GQ.toString.call(t)===B$t)GQ.extend(this.partials,t);else{if(typeof r>"u")throw new P$t.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=r}},"registerPartial"),unregisterPartial:s(function(t){delete this.partials[t]},"unregisterPartial"),registerDecorator:s(function(t,r){if(GQ.toString.call(t)===B$t){if(r)throw new P$t.default("Arg not supported with multiple decorators");GQ.extend(this.decorators,t)}else this.decorators[t]=r},"registerDecorator"),unregisterDecorator:s(function(t){delete this.decorators[t]},"unregisterDecorator"),resetLoggedPropertyAccesses:s(function(){GKu.resetLoggedProperties()},"resetLoggedPropertyAccesses")};var YKu=qQe.default.log;eC.log=YKu;eC.createFrame=GQ.createFrame;eC.logger=qQe.default});var sYi=g((QQe,iYi)=>{"use strict";QQe.__esModule=!0;function L$t(e){this.string=e}s(L$t,"SafeString");L$t.prototype.toString=L$t.prototype.toHTML=function(){return""+this.string};QQe.default=L$t;iYi.exports=QQe.default});var oYi=g(U$t=>{"use strict";U$t.__esModule=!0;U$t.wrapHelper=KKu;function KKu(e,t){if(typeof e!="function")return e;var r=s(function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=t(i),e.apply(this,arguments)},"wrapper");return r}s(KKu,"wrapHelper")});var dYi=g(eB=>{"use strict";eB.__esModule=!0;eB.checkRevision=r7u;eB.template=n7u;eB.wrapProgram=jQe;eB.resolvePartial=i7u;eB.invokePartial=s7u;eB.noop=uYi;function JKu(e){return e&&e.__esModule?e:{default:e}}s(JKu,"_interopRequireDefault");function XKu(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}s(XKu,"_interopRequireWildcard");var ZKu=zm(),tO=XKu(ZKu),e7u=xb(),rO=JKu(e7u),nO=FQe(),aYi=R$t(),t7u=oYi(),cYi=D$t();function r7u(e){var t=e&&e[0]||1,r=nO.COMPILER_REVISION;if(!(t>=nO.LAST_COMPATIBLE_COMPILER_REVISION&&t<=nO.COMPILER_REVISION))if(t<nO.LAST_COMPATIBLE_COMPILER_REVISION){var n=nO.REVISION_CHANGES[r],i=nO.REVISION_CHANGES[t];throw new rO.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+i+").")}else throw new rO.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}s(r7u,"checkRevision");function n7u(e,t){if(!t)throw new rO.default("No environment passed to template");if(!e||!e.main)throw new rO.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var r=e.compiler&&e.compiler[0]===7;function n(a,c,u){u.hash&&(c=tO.extend({},c,u.hash),u.ids&&(u.ids[0]=!0)),a=t.VM.resolvePartial.call(this,a,c,u);var l=tO.extend({},u,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),d=t.VM.invokePartial.call(this,a,c,l);if(d==null&&t.compile&&(u.partials[u.name]=t.compile(a,e.compilerOptions,t),d=u.partials[u.name](c,l)),d!=null){if(u.indent){for(var f=d.split(`
|
|
1384
1384
|
`),p=0,h=f.length;p<h&&!(!f[p]&&p+1===h);p++)f[p]=u.indent+f[p];d=f.join(`
|
|
@@ -1495,7 +1495,7 @@ ${e}
|
|
|
1495
1495
|
</style>
|
|
1496
1496
|
`,a=!1,c,u,l=[];if(i){let f=`${e}.pre-svelte5`;Zi.default.writeFileSync(f,t),Zi.default.writeFileSync(e,o),a=!0,c=t,u=o,l.push(`Updated ${e} to use <svelte:boundary>, $$restProps, and error UI.`)}else l.push(`${e} already looks Svelte 5 compatible (uses <svelte:boundary> with no legacy Boundary.js wrapper).`);let d=Sf.default.join(Sf.default.dirname(e),"Boundary.js");if(Zi.default.existsSync(d))try{Zi.default.unlinkSync(d),a=!0,l.push("Removed legacy lib/Boundary.js (incompatible with Svelte 5).")}catch(f){console.log("Failed to delete legacy Boundary.js:",f instanceof Error?f.message:f)}return{changed:a,before:c,after:u,message:l.join(" ")}}s(iil,"migrateWrapper");function sil(){let e=Sf.default.join(process.cwd(),"package.json");if(!Zi.default.existsSync(e))return{changed:!1,message:"package.json not found"};let t=Zi.default.readFileSync(e,"utf8"),r;try{r=JSON.parse(t)}catch(d){return{changed:!1,message:`Invalid package.json: ${d?.message||"parse error"}`}}let n=JSON.stringify(r,null,2),i=typeof r.version=="string"?r.version.trim():void 0,o=MXi(i);r.dependencies||(r.dependencies={}),r.dependencies.svelte="^5.0.0",r.peerDependencies={...r.peerDependencies||{},svelte:"^5.0.0"};let a=r.devDependencies||{};a.rollup="^4.21.0",a["@rollup/plugin-commonjs"]="^25.0.7",a["@rollup/plugin-node-resolve"]="^15.2.3",a["rollup-plugin-svelte"]="^7.2.3",a["@budibase/backend-core"]&&(a["@budibase/backend-core"]="^2.8.0"),a["npm-run-all"]&&delete a["npm-run-all"],r.devDependencies=a,r.dependencies?.["@crownframework/svelte-error-boundary"]&&delete r.dependencies["@crownframework/svelte-error-boundary"],r.scripts||(r.scripts={}),r.scripts.build="rollup -c rollup.config.mjs",r.scripts.watch="rollup -cw rollup.config.mjs",o&&(r.version=o);let c=JSON.stringify(r,null,2);if(n===c)return{changed:!1,message:"package.json already appears Svelte 5 ready. Skipping."};Zi.default.writeFileSync(`${e}.pre-svelte5`,t),Zi.default.writeFileSync(e,`${c}
|
|
1497
1497
|
`);let u=i&&o?` (version ${i} -> ${o})`:"",l=o?`Updated package.json for Svelte 5, Rollup 4, scripts, and version bump${u}.`:"Updated package.json for Svelte 5, Rollup 4, and scripts.";return{changed:!0,before:n,after:c,message:l}}s(sil,"migratePackageJson");function QXi(){let e=Sf.default.join(process.cwd(),".github","workflows");return Zi.default.existsSync(e)?Zi.default.readdirSync(e).filter(r=>r.endsWith(".yml")||r.endsWith(".yaml")).map(r=>Sf.default.join(".github","workflows",r)):[]}s(QXi,"findWorkflowFiles");function oil(){let e=QXi();if(e.length===0)return{changed:!1,message:"No GitHub workflow files found in .github/workflows/ - skipping node version migration."};let t=[],r=!1;for(let n of e){let i=Sf.default.join(process.cwd(),n),o=Zi.default.readFileSync(i,"utf8");if(!/node-version:\s*['"]?16['"]?/g.test(o))continue;let c=o.replace(/node-version:\s*['"]?16['"]?/g,"node-version: 18");if(c!==o){let u=`${i}.pre-svelte5`;Zi.default.writeFileSync(u,o),Zi.default.writeFileSync(i,c),r=!0,t.push(`Updated ${n}: node-version 16 -> 18`)}}return r?{changed:!0,message:t.join("; ")}:{changed:!1,message:"No workflow files with node-version: 16 found - skipping node version migration."}}s(oil,"migrateNodeVersion");function ail(){let e=Sf.default.join(process.cwd(),"schema.json");if(!Zi.default.existsSync(e))return{changed:!1,message:"schema.json not found - skipping schema metadata migration."};let t=Zi.default.readFileSync(e,"utf8"),r;try{r=JSON.parse(t)}catch(u){return{changed:!1,message:`Invalid schema.json: ${u?.message||"parse error"}`}}let n=r&&typeof r.metadata=="object"&&!Array.isArray(r.metadata)?r.metadata:{};if(!(n?.svelteMajor!==5))return{changed:!1,message:"schema.json metadata already includes svelteMajor: 5. Skipping."};let o=JSON.stringify(r,null,2),a={...n,svelteMajor:5};r.metadata=a;let c=JSON.stringify(r,null,2);return Zi.default.writeFileSync(`${e}.pre-svelte5`,t),Zi.default.writeFileSync(e,`${c}
|
|
1498
|
-
`),{changed:!0,before:o,after:c,message:"Updated schema.json metadata to include svelteMajor: 5."}}s(ail,"migrateSchemaJson");async function jXi(){let e=[],t=Zi.default.readFileSync("package.json","utf8"),r=JSON.parse(t),n=r?.dependencies?.svelte?.startsWith("^5")||r?.peerDependencies?.svelte?.startsWith("^5"),i=typeof r?.version=="string"?r.version.trim():void 0,o=MXi(i);n?e.push("package.json appears to already depend on Svelte 5."):e.push("Will bump svelte to ^5.0.0 and align dev/peer dependencies."),r?.dependencies?.["@crownframework/svelte-error-boundary"]&&e.push("Detected @crownframework/svelte-error-boundary; migration will replace it with <svelte:boundary> in lib/Wrapper.svelte."),o&&i&&o!==i&&e.push(`Will bump package.json version from ${i} to ${o}.`);let a=LXi(),c="unknown";if(a){let A=Zi.default.readFileSync(a,"utf8");UXi(A)?(c="looks-new",e.push(`Rollup config ${a} already looks Svelte 5-ready.`)):(c="needs-migration",e.push("Will write Rollup 4 / Svelte 5 config and rename to rollup.config.mjs."))}else c="unknown",e.push("No rollup config found - will create rollup.config.mjs.");let u=FXi(),l="not-found";u?Zi.default.readFileSync(u,"utf8").includes("<svelte:boundary>")?(l="looks-new",e.push(`${u} already uses <svelte:boundary>.`)):(l="needs-migration",e.push(`Will update ${u} to use <svelte:boundary>, $$restProps, and error UI.`)):e.push("No wrapper.svelte found - skipping wrapper migration.");let d="unknown";if(Zi.default.existsSync("schema.json"))try{let A=Zi.default.readFileSync("schema.json","utf8"),y=JSON.parse(A);(y&&typeof y.metadata=="object"&&!Array.isArray(y.metadata)?y.metadata:{}).svelteMajor===5?(d="looks-new",e.push("schema.json metadata already declares svelteMajor: 5.")):(d="needs-migration",e.push("Will update schema.json metadata to set svelteMajor: 5."))}catch(A){d="unknown",e.push(`schema.json could not be parsed - please fix JSON before migration (${A?.message||"parse error"}).`)}else d="not-found",e.push("schema.json not found - cannot update metadata.");let f=n?"looks-new":"needs-migration",p="not-found",h=QXi();if(h.length>0){let A=!1,y=!1;for(let S of h){let b=Sf.default.join(process.cwd(),S),x=Zi.default.readFileSync(b,"utf8");/node-version:\s*['"]?16['"]?/.test(x)&&(A=!0),/node-version:\s*['"]?(18|20|22)['"]?/.test(x)&&(y=!0)}A?(p="needs-migration",e.push("Will update GitHub workflow files: node-version 16 -> 18.")):y?(p="looks-new",e.push("GitHub workflow files already use node-version 18 or higher.")):(p="looks-new",e.push("GitHub workflow files found but no node-version: 16 detected."))}else e.push("No GitHub workflow files found in .github/workflows/ - skipping node version check.");return{report:e,rollup:c,packageJson:f,wrapper:l,schema:d,nodeVersion:p,canBuildAfter:!0,rollupFile:a,wrapperFile:u,pkg:r}}s(jXi,"analysePluginForSvelte5");async function HXi(){let e=await nil();if(e.message.includes("Failed to retrieve canonical rollup.config.mjs from skeleton"))return{pkgRes:{changed:!1,message:"Skipped package.json migration due to Rollup template failure."},schemaRes:{changed:!1,message:"Skipped schema.json migration due to Rollup template failure."},rollupRes:e,wrapperRes:{changed:!1,message:"Skipped wrapper migration due to Rollup template failure."},nodeVersionRes:{changed:!1,message:"Skipped node version migration due to Rollup template failure."}};let t=iil(),r=ail(),n=sil(),i=oil();return{pkgRes:n,schemaRes:r,rollupRes:e,wrapperRes:t,nodeVersionRes:i}}s(HXi,"runSvelte5Migration");var GXi=require("child_process");var cil=require("find-free-port");function uil(e){let t=[],r=[];for(let n of new Set(e.filter(Boolean)))if(dO.default.existsSync(n))try{dO.default.unlinkSync(n),t.push(n)}catch(i){r.push({path:n,error:i instanceof Error?i.message:String(i)})}return{deleted:t,failed:r}}s(uil,"cleanupPreSvelte5Backups");function VXi(){if(!dO.default.existsSync("package.json"))throw new Error("Please run in a plugin directory - must contain package.json");if(!dO.default.existsSync("schema.json"))throw new Error("Please run in a plugin directory - must contain schema.json")}s(VXi,"checkInPlugin");async function lil(e){return dO.default.readdirSync(process.cwd()).find(r=>r===".git")?!1:(console.log(yi(`By default the plugin will be created in the directory "${e}"`)),console.log(yi("if you are already in an empty directory, such as a new Git repo, you can disable this functionality.")),Yv("Create top level directory?"))}s(lil,"askAboutTopLevel");async function dil(e){let t=e.init||e;if(!t||!cKt.includes(t)){console.log(Wo("Please provide a type to init, either 'component', 'datasource' or 'automation'."));return}console.log(yi("Lets get some details about your new plugin:"));let r=await EB("Name",`budibase-${t}`);if(dO.default.existsSync(r)){console.log(Wo("Directory by plugin name already exists, pick a new name."));return}let n=await EB("Description",`An amazing Budibase ${t}!`),i=await EB("Version","1.0.0"),o=await lil(r);console.log(yi("Retrieving project...")),await jje(t,r),await NXi(t,r,n,i),console.log(yi("Installing dependencies...")),await a5("install",(0,Hje.join)(process.cwd(),r)),o?console.log(yi(`Plugin created in directory "${r}"`)):($He(r,process.cwd()),console.log(yi("Plugin created in current directory."))),Sde(mC.PluginInit,{type:t,name:r,description:n,version:i})}s(dil,"init");async function r8t(){VXi(),console.log(yi("Verifying plugin..."));let e=dO.default.readFileSync("schema.json","utf8"),t=dO.default.readFileSync("package.json","utf8"),r,n;try{let i=JSON.parse(e),o=JSON.parse(t);if(!o.name||!o.version||!o.description)throw new Error("package.json is missing one of 'name', 'version' or 'description'.");return r=o.name,n=o.version,DBe.validate(i),{name:r,version:n}}catch(i){i&&i.message&&i.message.includes("not valid JSON")?console.log(Wo(`schema.json is not valid JSON: ${i.message}`)):console.log(Wo(`Invalid schema/package.json: ${i.message}`))}}s(r8t,"verify");async function fil(){let e=await r8t();if(!e?.name)return;console.log(Sa("Verified!")),console.log(yi("Building plugin...")),await a5("build");let t=(0,Hje.join)("dist",`${e.name}-${e.version}.tar.gz`);console.log(Sa(`Build complete - output in: ${t}`))}s(fil,"build");async function pil(){let e=await r8t();if(!e?.name)return;let t=(0,Hje.join)("dist",`${e.name}-${e.version}.tar.gz`);console.log(yi(`Watching - build in: ${t}`));try{await a5("watch")}catch{console.log(Sa("Watch exited."))}}s(pil,"watch");async function hil(){let e=await EB("Directory to watch","./"),[t]=await cil(1e4),r="admin";await Ide({init:"quick",single:!0,watchPluginDir:e,genUser:r,port:t,silent:!0}),await Tj(),console.log(Sa("Configuration has been written to docker-compose.yaml")),console.log(Sa("Development environment started successfully - connect at: ")+yi(`http://localhost:${t}`)),console.log(Sa("Use the following credentials to login:")),console.log(Sa("Email: ")+yi(cGe)),console.log(Sa("Password: ")+yi(r))}s(hil,"dev");async function mil(e){VXi();let t=!!e?.yes,r=!!e?.force,n=!1;try{n=!!(0,GXi.execSync)("git status --porcelain",{encoding:"utf8"}).trim()}catch{}if(n&&!r&&(console.log(yi("Your git working directory is not clean. Commit or stash changes, or re-run with --force.")),!await Yv("Proceed with migration anyway?"))){console.log(yi("Migration aborted."));return}console.log(yi("Analyzing plugin for Svelte 5 migration..."));let i=await jXi();console.log(yi("Proposed changes:"));for(let u of i.report)console.log(yi(" - "+u));let o=["package.json.pre-svelte5","schema.json.pre-svelte5",i.rollupFile?`${i.rollupFile}.pre-svelte5`:void 0,i.wrapperFile?`${i.wrapperFile}.pre-svelte5`:void 0];if(!t&&!await Yv("Apply these changes now?")){console.log(yi("Migration aborted by user."));return}console.log(yi("Applying migrations..."));let a=await HXi();if(a.rollupRes?.message?.includes("Failed to retrieve canonical rollup.config.mjs from skeleton")){console.log(Wo(a.rollupRes.message));return}if(a.pkgRes?.message&&console.log(yi(a.pkgRes.message)),a.schemaRes?.message&&console.log(yi(a.schemaRes.message)),a.rollupRes?.message&&console.log(yi(a.rollupRes.message)),a.wrapperRes?.message&&console.log(yi(a.wrapperRes.message)),console.log(yi("Installing updated dependencies...")),await a5("install"),console.log(yi("Re-verifying plugin...")),!(await r8t())?.name){console.log(Wo("Verification failed after migration."));return}console.log(yi("Attempting build..."));try{await a5("build");let u=uil(o.filter(l=>!!l));console.log(Sa("Migration completed. Your plugin was migrated to Svelte 5 and built successfully.")),u.deleted.length&&console.log(yi(`Removed ${u.deleted.length} pre-svelte5 backup file(s): ${u.deleted.join(", ")}`)),u.failed.length&&console.log(yi(`Failed to remove ${u.failed.length} pre-svelte5 backup file(s): ${u.failed.map(l=>`${l.path} (${l.error})`).join(", ")}`))}catch(u){console.log(Wo(`Build failed after migration. Please review the errors above. ${u?.message||""}`))}}s(mil,"migrateSvelte5");var $Xi=new Wv("plugins").addHelp("Custom plugins for Budibase, init, build and verify your components and datasources with this tool.").addSubOption("--init [type]","Init a new plugin project, with a type of either component or datasource.",dil).addSubOption("--build","Build your plugin, this will verify and produce a final tarball for your project.",fil).addSubOption("--watch","Automatically build any changes to your plugin.",pil).addSubOption("--dev","Run a development environment which automatically watches the current directory.",hil).addSubOption("--migrate-svelte5","Migrate this plugin to the Svelte 5-compatible Budibase plugin format.",mil,[{command:"--yes",help:"Skip confirmation prompts during migration."},{command:"--force",help:"Proceed even if the git working directory is not clean (creates .pre-svelte5 backups during migration, removed on success)."}]);function zXi(){return[SJt,J7t,I8i,$Xi]}s(zXi,"getCommands");var YXi=require("commander");Id();var WXi="3.26.1";async function Ail(){let e=new YXi.Command().addHelpCommand("help",w5("Help with Budibase commands.")).helpOption(!1).version(WXi);for(let t of zXi())t.configure(e);await e.parseAsync(process.argv)}s(Ail,"init");var yil=["exit","SIGINT","SIGUSR1","SIGUSR2","uncaughtException"];yil.forEach(e=>{process.on(e,t=>{t&&!isNaN(t)||t&&(console.error(Wo("Failed to run CLI command - please report with the following message:")),console.error(Wo(t)))})});Ail().catch(e=>{console.error("Unexpected error - ",e)});
|
|
1498
|
+
`),{changed:!0,before:o,after:c,message:"Updated schema.json metadata to include svelteMajor: 5."}}s(ail,"migrateSchemaJson");async function jXi(){let e=[],t=Zi.default.readFileSync("package.json","utf8"),r=JSON.parse(t),n=r?.dependencies?.svelte?.startsWith("^5")||r?.peerDependencies?.svelte?.startsWith("^5"),i=typeof r?.version=="string"?r.version.trim():void 0,o=MXi(i);n?e.push("package.json appears to already depend on Svelte 5."):e.push("Will bump svelte to ^5.0.0 and align dev/peer dependencies."),r?.dependencies?.["@crownframework/svelte-error-boundary"]&&e.push("Detected @crownframework/svelte-error-boundary; migration will replace it with <svelte:boundary> in lib/Wrapper.svelte."),o&&i&&o!==i&&e.push(`Will bump package.json version from ${i} to ${o}.`);let a=LXi(),c="unknown";if(a){let A=Zi.default.readFileSync(a,"utf8");UXi(A)?(c="looks-new",e.push(`Rollup config ${a} already looks Svelte 5-ready.`)):(c="needs-migration",e.push("Will write Rollup 4 / Svelte 5 config and rename to rollup.config.mjs."))}else c="unknown",e.push("No rollup config found - will create rollup.config.mjs.");let u=FXi(),l="not-found";u?Zi.default.readFileSync(u,"utf8").includes("<svelte:boundary>")?(l="looks-new",e.push(`${u} already uses <svelte:boundary>.`)):(l="needs-migration",e.push(`Will update ${u} to use <svelte:boundary>, $$restProps, and error UI.`)):e.push("No wrapper.svelte found - skipping wrapper migration.");let d="unknown";if(Zi.default.existsSync("schema.json"))try{let A=Zi.default.readFileSync("schema.json","utf8"),y=JSON.parse(A);(y&&typeof y.metadata=="object"&&!Array.isArray(y.metadata)?y.metadata:{}).svelteMajor===5?(d="looks-new",e.push("schema.json metadata already declares svelteMajor: 5.")):(d="needs-migration",e.push("Will update schema.json metadata to set svelteMajor: 5."))}catch(A){d="unknown",e.push(`schema.json could not be parsed - please fix JSON before migration (${A?.message||"parse error"}).`)}else d="not-found",e.push("schema.json not found - cannot update metadata.");let f=n?"looks-new":"needs-migration",p="not-found",h=QXi();if(h.length>0){let A=!1,y=!1;for(let S of h){let b=Sf.default.join(process.cwd(),S),x=Zi.default.readFileSync(b,"utf8");/node-version:\s*['"]?16['"]?/.test(x)&&(A=!0),/node-version:\s*['"]?(18|20|22)['"]?/.test(x)&&(y=!0)}A?(p="needs-migration",e.push("Will update GitHub workflow files: node-version 16 -> 18.")):y?(p="looks-new",e.push("GitHub workflow files already use node-version 18 or higher.")):(p="looks-new",e.push("GitHub workflow files found but no node-version: 16 detected."))}else e.push("No GitHub workflow files found in .github/workflows/ - skipping node version check.");return{report:e,rollup:c,packageJson:f,wrapper:l,schema:d,nodeVersion:p,canBuildAfter:!0,rollupFile:a,wrapperFile:u,pkg:r}}s(jXi,"analysePluginForSvelte5");async function HXi(){let e=await nil();if(e.message.includes("Failed to retrieve canonical rollup.config.mjs from skeleton"))return{pkgRes:{changed:!1,message:"Skipped package.json migration due to Rollup template failure."},schemaRes:{changed:!1,message:"Skipped schema.json migration due to Rollup template failure."},rollupRes:e,wrapperRes:{changed:!1,message:"Skipped wrapper migration due to Rollup template failure."},nodeVersionRes:{changed:!1,message:"Skipped node version migration due to Rollup template failure."}};let t=iil(),r=ail(),n=sil(),i=oil();return{pkgRes:n,schemaRes:r,rollupRes:e,wrapperRes:t,nodeVersionRes:i}}s(HXi,"runSvelte5Migration");var GXi=require("child_process");var cil=require("find-free-port");function uil(e){let t=[],r=[];for(let n of new Set(e.filter(Boolean)))if(dO.default.existsSync(n))try{dO.default.unlinkSync(n),t.push(n)}catch(i){r.push({path:n,error:i instanceof Error?i.message:String(i)})}return{deleted:t,failed:r}}s(uil,"cleanupPreSvelte5Backups");function VXi(){if(!dO.default.existsSync("package.json"))throw new Error("Please run in a plugin directory - must contain package.json");if(!dO.default.existsSync("schema.json"))throw new Error("Please run in a plugin directory - must contain schema.json")}s(VXi,"checkInPlugin");async function lil(e){return dO.default.readdirSync(process.cwd()).find(r=>r===".git")?!1:(console.log(yi(`By default the plugin will be created in the directory "${e}"`)),console.log(yi("if you are already in an empty directory, such as a new Git repo, you can disable this functionality.")),Yv("Create top level directory?"))}s(lil,"askAboutTopLevel");async function dil(e){let t=e.init||e;if(!t||!cKt.includes(t)){console.log(Wo("Please provide a type to init, either 'component', 'datasource' or 'automation'."));return}console.log(yi("Lets get some details about your new plugin:"));let r=await EB("Name",`budibase-${t}`);if(dO.default.existsSync(r)){console.log(Wo("Directory by plugin name already exists, pick a new name."));return}let n=await EB("Description",`An amazing Budibase ${t}!`),i=await EB("Version","1.0.0"),o=await lil(r);console.log(yi("Retrieving project...")),await jje(t,r),await NXi(t,r,n,i),console.log(yi("Installing dependencies...")),await a5("install",(0,Hje.join)(process.cwd(),r)),o?console.log(yi(`Plugin created in directory "${r}"`)):($He(r,process.cwd()),console.log(yi("Plugin created in current directory."))),Sde(mC.PluginInit,{type:t,name:r,description:n,version:i})}s(dil,"init");async function r8t(){VXi(),console.log(yi("Verifying plugin..."));let e=dO.default.readFileSync("schema.json","utf8"),t=dO.default.readFileSync("package.json","utf8"),r,n;try{let i=JSON.parse(e),o=JSON.parse(t);if(!o.name||!o.version||!o.description)throw new Error("package.json is missing one of 'name', 'version' or 'description'.");return r=o.name,n=o.version,DBe.validate(i),{name:r,version:n}}catch(i){i&&i.message&&i.message.includes("not valid JSON")?console.log(Wo(`schema.json is not valid JSON: ${i.message}`)):console.log(Wo(`Invalid schema/package.json: ${i.message}`))}}s(r8t,"verify");async function fil(){let e=await r8t();if(!e?.name)return;console.log(Sa("Verified!")),console.log(yi("Building plugin...")),await a5("build");let t=(0,Hje.join)("dist",`${e.name}-${e.version}.tar.gz`);console.log(Sa(`Build complete - output in: ${t}`))}s(fil,"build");async function pil(){let e=await r8t();if(!e?.name)return;let t=(0,Hje.join)("dist",`${e.name}-${e.version}.tar.gz`);console.log(yi(`Watching - build in: ${t}`));try{await a5("watch")}catch{console.log(Sa("Watch exited."))}}s(pil,"watch");async function hil(){let e=await EB("Directory to watch","./"),[t]=await cil(1e4),r="admin";await Ide({init:"quick",single:!0,watchPluginDir:e,genUser:r,port:t,silent:!0}),await Tj(),console.log(Sa("Configuration has been written to docker-compose.yaml")),console.log(Sa("Development environment started successfully - connect at: ")+yi(`http://localhost:${t}`)),console.log(Sa("Use the following credentials to login:")),console.log(Sa("Email: ")+yi(cGe)),console.log(Sa("Password: ")+yi(r))}s(hil,"dev");async function mil(e){VXi();let t=!!e?.yes,r=!!e?.force,n=!1;try{n=!!(0,GXi.execSync)("git status --porcelain",{encoding:"utf8"}).trim()}catch{}if(n&&!r&&(console.log(yi("Your git working directory is not clean. Commit or stash changes, or re-run with --force.")),!await Yv("Proceed with migration anyway?"))){console.log(yi("Migration aborted."));return}console.log(yi("Analyzing plugin for Svelte 5 migration..."));let i=await jXi();console.log(yi("Proposed changes:"));for(let u of i.report)console.log(yi(" - "+u));let o=["package.json.pre-svelte5","schema.json.pre-svelte5",i.rollupFile?`${i.rollupFile}.pre-svelte5`:void 0,i.wrapperFile?`${i.wrapperFile}.pre-svelte5`:void 0];if(!t&&!await Yv("Apply these changes now?")){console.log(yi("Migration aborted by user."));return}console.log(yi("Applying migrations..."));let a=await HXi();if(a.rollupRes?.message?.includes("Failed to retrieve canonical rollup.config.mjs from skeleton")){console.log(Wo(a.rollupRes.message));return}if(a.pkgRes?.message&&console.log(yi(a.pkgRes.message)),a.schemaRes?.message&&console.log(yi(a.schemaRes.message)),a.rollupRes?.message&&console.log(yi(a.rollupRes.message)),a.wrapperRes?.message&&console.log(yi(a.wrapperRes.message)),console.log(yi("Installing updated dependencies...")),await a5("install"),console.log(yi("Re-verifying plugin...")),!(await r8t())?.name){console.log(Wo("Verification failed after migration."));return}console.log(yi("Attempting build..."));try{await a5("build");let u=uil(o.filter(l=>!!l));console.log(Sa("Migration completed. Your plugin was migrated to Svelte 5 and built successfully.")),u.deleted.length&&console.log(yi(`Removed ${u.deleted.length} pre-svelte5 backup file(s): ${u.deleted.join(", ")}`)),u.failed.length&&console.log(yi(`Failed to remove ${u.failed.length} pre-svelte5 backup file(s): ${u.failed.map(l=>`${l.path} (${l.error})`).join(", ")}`))}catch(u){console.log(Wo(`Build failed after migration. Please review the errors above. ${u?.message||""}`))}}s(mil,"migrateSvelte5");var $Xi=new Wv("plugins").addHelp("Custom plugins for Budibase, init, build and verify your components and datasources with this tool.").addSubOption("--init [type]","Init a new plugin project, with a type of either component or datasource.",dil).addSubOption("--build","Build your plugin, this will verify and produce a final tarball for your project.",fil).addSubOption("--watch","Automatically build any changes to your plugin.",pil).addSubOption("--dev","Run a development environment which automatically watches the current directory.",hil).addSubOption("--migrate-svelte5","Migrate this plugin to the Svelte 5-compatible Budibase plugin format.",mil,[{command:"--yes",help:"Skip confirmation prompts during migration."},{command:"--force",help:"Proceed even if the git working directory is not clean (creates .pre-svelte5 backups during migration, removed on success)."}]);function zXi(){return[SJt,J7t,I8i,$Xi]}s(zXi,"getCommands");var YXi=require("commander");Id();var WXi="3.26.3";async function Ail(){let e=new YXi.Command().addHelpCommand("help",w5("Help with Budibase commands.")).helpOption(!1).version(WXi);for(let t of zXi())t.configure(e);await e.parseAsync(process.argv)}s(Ail,"init");var yil=["exit","SIGINT","SIGUSR1","SIGUSR2","uncaughtException"];yil.forEach(e=>{process.on(e,t=>{t&&!isNaN(t)||t&&(console.error(Wo("Failed to run CLI command - please report with the following message:")),console.error(Wo(t)))})});Ail().catch(e=>{console.error("Unexpected error - ",e)});
|
|
1499
1499
|
/*! Bundled license information:
|
|
1500
1500
|
|
|
1501
1501
|
lodash/lodash.js:
|