@squiz/component-cli-lib 1.22.1-alpha.11 → 1.22.1-alpha.13

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.
@@ -5,33 +5,33 @@
5
5
  4 timing config:load:defaults Completed in 2ms
6
6
  5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
7
7
  6 timing config:load:builtin Completed in 1ms
8
- 7 timing config:load:cli Completed in 2ms
8
+ 7 timing config:load:cli Completed in 1ms
9
9
  8 timing config:load:env Completed in 1ms
10
10
  9 info found workspace root at /builds/developer-experience/cmp
11
11
  10 timing config:load:file:/builds/developer-experience/cmp/.npmrc Completed in 0ms
12
- 11 timing config:load:project Completed in 19ms
13
- 12 timing config:load:file:/root/.npmrc Completed in 0ms
12
+ 11 timing config:load:project Completed in 20ms
13
+ 12 timing config:load:file:/root/.npmrc Completed in 1ms
14
14
  13 timing config:load:user Completed in 1ms
15
- 14 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
16
- 15 timing config:load:global Completed in 0ms
15
+ 14 timing config:load:file:/usr/local/etc/npmrc Completed in 1ms
16
+ 15 timing config:load:global Completed in 1ms
17
17
  16 timing config:load:setEnvs Completed in 1ms
18
- 17 timing config:load Completed in 28ms
19
- 18 timing npm:load:configload Completed in 28ms
20
- 19 timing npm:load:mkdirpcache Completed in 1ms
21
- 20 timing npm:load:mkdirplogs Completed in 0ms
18
+ 17 timing config:load Completed in 29ms
19
+ 18 timing npm:load:configload Completed in 29ms
20
+ 19 timing npm:load:mkdirpcache Completed in 0ms
21
+ 20 timing npm:load:mkdirplogs Completed in 1ms
22
22
  21 verbose title npm run compile
23
23
  22 verbose argv "run" "compile" "--"
24
24
  23 timing npm:load:setTitle Completed in 1ms
25
25
  24 timing config:load:flatten Completed in 4ms
26
- 25 timing npm:load:display Completed in 6ms
27
- 26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-04-11T04_37_38_586Z-
28
- 27 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-04-11T04_37_38_586Z-debug-0.log
29
- 28 timing npm:load:logFile Completed in 4ms
26
+ 25 timing npm:load:display Completed in 5ms
27
+ 26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-04-11T23_54_49_852Z-
28
+ 27 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-04-11T23_54_49_852Z-debug-0.log
29
+ 28 timing npm:load:logFile Completed in 3ms
30
30
  29 timing npm:load:timers Completed in 0ms
31
31
  30 timing npm:load:configScope Completed in 0ms
32
32
  31 timing npm:load Completed in 42ms
33
33
  32 silly logfile done cleaning log files
34
- 33 timing command:run Completed in 4085ms
34
+ 33 timing command:run Completed in 3818ms
35
35
  34 verbose exit 0
36
- 35 timing npm Completed in 4140ms
36
+ 35 timing npm Completed in 3873ms
37
37
  36 info ok
package/lib/index.js CHANGED
@@ -60,7 +60,7 @@ ${g}`),f.pop(),`{${q}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";
60
60
  `),stack:t.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(t)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:$H.loadavg(),uptime:$H.uptime()}}getTrace(t){return(t?UH.parse(t):UH.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(t){if(!this.handlers.has(t)){t.handleExceptions=!0;let r=new $Pe(t);this.handlers.set(t,r),this.logger.pipe(r)}}_uncaughtException(t){let r=this.getAllInfo(t),n=this._getExceptionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(t):this.logger.exitOnError,s;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),i=!1);function a(){MI("doExit",i),MI("process._exiting",process._exiting),i&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(a);LPe(n,(o,c)=>{let u=zPe(c),l=o.transport||o;function p(d){return()=>{MI(d),u()}}l._ending=!0,l.once("finish",p("finished")),l.once("error",p("error"))},()=>i&&a()),this.logger.log(r),i&&(s=setTimeout(a,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(t=>(t.transport||t).handleExceptions)}}});var FI=S((PKe,BH)=>{"use strict";var GH=require("os"),UPe=zw(),DI=of()("winston:rejection"),VPe=NI(),HH=jI(),GPe=qI();BH.exports=class{constructor(t){if(!t)throw new Error("Logger is required to handle rejections");this.logger=t,this.handlers=new Map}handle(...t){t.forEach(r=>{if(Array.isArray(r))return r.forEach(n=>this._addHandler(n));this._addHandler(r)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(t=>this.logger.unpipe(t)))}getAllInfo(t){let r=null;return t&&(r=typeof t=="string"?t:t.message),{error:t,level:"error",message:[`unhandledRejection: ${r||"(no error message)"}`,t&&t.stack||" No stack trace"].join(`
61
61
  `),stack:t&&t.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(t)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:GH.loadavg(),uptime:GH.uptime()}}getTrace(t){return(t?HH.parse(t):HH.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(t){if(!this.handlers.has(t)){t.handleRejections=!0;let r=new GPe(t);this.handlers.set(t,r),this.logger.pipe(r)}}_unhandledRejection(t){let r=this.getAllInfo(t),n=this._getRejectionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(t):this.logger.exitOnError,s;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),i=!1);function a(){DI("doExit",i),DI("process._exiting",process._exiting),i&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(a);UPe(n,(o,c)=>{let u=VPe(c),l=o.transport||o;function p(d){return()=>{DI(d),u()}}l._ending=!0,l.once("finish",p("finished")),l.once("error",p("error"))},()=>i&&a()),this.logger.log(r),i&&(s=setTimeout(a,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(t=>(t.transport||t).handleRejections)}}});var KH=S((CKe,WH)=>{"use strict";WH.exports=class{constructor(t){if(!t)throw new Error("Logger is required for profiling.");this.logger=t,this.start=Date.now()}done(...t){typeof t[t.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),t.pop());let r=typeof t[t.length-1]=="object"?t.pop():{};return r.level=r.level||"info",r.durationMs=Date.now()-this.start,this.logger.write(r)}}});var ZH=S((TKe,XH)=>{"use strict";var{Stream:HPe,Transform:BPe}=kc(),JH=zw(),{LEVEL:Hi,SPLAT:YH}=rr(),QH=TI(),WPe=kI(),KPe=FI(),JPe=aI(),YPe=KH(),{warn:QPe}=NP(),XPe=Mw(),ZPe=/%[scdjifoO%]/g,$w=class extends BPe{constructor(t){super({objectMode:!0}),this.configure(t)}child(t){let r=this;return Object.create(r,{write:{value:function(n){let i=Object.assign({},t,n);n instanceof Error&&(i.stack=n.stack,i.message=n.message),r.write(i)}}})}configure({silent:t,format:r,defaultMeta:n,levels:i,level:s="info",exitOnError:a=!0,transports:o,colors:c,emitErrs:u,formatters:l,padLevels:p,rewriters:d,stripColors:m,exceptionHandlers:f,rejectionHandlers:h}={}){if(this.transports.length&&this.clear(),this.silent=t,this.format=r||this.format||AP()(),this.defaultMeta=n||null,this.levels=i||this.levels||XPe.npm.levels,this.level=s,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new WPe(this),this.rejections=new KPe(this),this.profilers={},this.exitOnError=a,o&&(o=Array.isArray(o)?o:[o],o.forEach(_=>this.add(_))),c||u||l||p||d||m)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
62
62
  `));f&&this.exceptions.handle(f),h&&this.rejections.handle(h)}isLevelEnabled(t){let r=LI(this.levels,t);if(r===null)return!1;let n=LI(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=r:this.transports.findIndex(s=>{let a=LI(this.levels,s.level);return a===null&&(a=n),a>=r})!==-1}log(t,r,...n){if(arguments.length===1)return t[Hi]=t.level,this._addDefaultMeta(t),this.write(t),this;if(arguments.length===2)return r&&typeof r=="object"?(r[Hi]=r.level=t,this._addDefaultMeta(r),this.write(r),this):(r={[Hi]:t,level:t,message:r},this._addDefaultMeta(r),this.write(r),this);let[i]=n;if(typeof i=="object"&&i!==null&&!(r&&r.match&&r.match(ZPe))){let a=Object.assign({},this.defaultMeta,i,{[Hi]:t,[YH]:n,level:t,message:r});return i.message&&(a.message=`${a.message} ${i.message}`),i.stack&&(a.stack=i.stack),this.write(a),this}return this.write(Object.assign({},this.defaultMeta,{[Hi]:t,[YH]:n,level:t,message:r})),this}_transform(t,r,n){if(this.silent)return n();t[Hi]||(t[Hi]=t.level),!this.levels[t[Hi]]&&this.levels[t[Hi]]!==0&&console.error("[winston] Unknown logger level: %s",t[Hi]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",t);try{this.push(this.format.transform(t,this.format.options))}finally{this._writableState.sync=!1,n()}}_final(t){let r=this.transports.slice();JH(r,(n,i)=>{if(!n||n.finished)return setImmediate(i);n.once("finish",i),n.end()},t)}add(t){let r=!QH(t)||t.log.length>2?new JPe({transport:t}):t;if(!r._writableState||!r._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",r),this._onEvent("warn",r),this.pipe(r),t.handleExceptions&&this.exceptions.handle(),t.handleRejections&&this.rejections.handle(),this}remove(t){if(!t)return this;let r=t;return(!QH(t)||t.log.length>2)&&(r=this.transports.filter(n=>n.transport===t)[0]),r&&this.unpipe(r),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){QPe.deprecated("setLevels")}query(t,r){typeof t=="function"&&(r=t,t={}),t=t||{};let n={},i=Object.assign({},t.query||{});function s(o,c){t.query&&typeof o.formatQuery=="function"&&(t.query=o.formatQuery(i)),o.query(t,(u,l)=>{if(u)return c(u);typeof o.formatResults=="function"&&(l=o.formatResults(l,t.format)),c(null,l)})}function a(o,c){s(o,(u,l)=>{c&&(l=u||l,l&&(n[o.name]=l),c()),c=null})}JH(this.transports.filter(o=>!!o.query),a,()=>r(null,n))}stream(t={}){let r=new HPe,n=[];return r._streams=n,r.destroy=()=>{let i=n.length;for(;i--;)n[i].destroy()},this.transports.filter(i=>!!i.stream).forEach(i=>{let s=i.stream(t);s&&(n.push(s),s.on("log",a=>{a.transport=a.transport||[],a.transport.push(i.name),r.emit("log",a)}),s.on("error",a=>{a.transport=a.transport||[],a.transport.push(i.name),r.emit("error",a)}))}),r}startTimer(){return new YPe(this)}profile(t,...r){let n=Date.now();if(this.profilers[t]){let i=this.profilers[t];delete this.profilers[t],typeof r[r.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),r.pop());let s=typeof r[r.length-1]=="object"?r.pop():{};return s.level=s.level||"info",s.durationMs=n-i,s.message=s.message||t,this.write(s)}return this.profilers[t]=n,this}handleExceptions(...t){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...t)}unhandleExceptions(...t){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...t)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
63
- `))}_onEvent(t,r){function n(i){t==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(t,i,r)}r["__winston"+t]||(r["__winston"+t]=n.bind(this),r.on(t,r["__winston"+t]))}_addDefaultMeta(t){this.defaultMeta&&Object.assign(t,this.defaultMeta)}};function LI(e,t){let r=e[t];return!r&&r!==0?null:r}Object.defineProperty($w.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});XH.exports=$w});var zI=S((OKe,e6)=>{"use strict";var{LEVEL:eIe}=rr(),tIe=Mw(),rIe=ZH(),nIe=of()("winston:create-logger");function iIe(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}e6.exports=function(e={}){e.levels=e.levels||tIe.npm.levels;class t extends rIe{constructor(i){super(i)}}let r=new t(e);return Object.keys(e.levels).forEach(function(n){if(nIe('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}t.prototype[n]=function(...i){let s=this||r;if(i.length===1){let[a]=i,o=a&&a.message&&a||{message:a};return o.level=o[eIe]=n,s._addDefaultMeta(o),s.write(o),this||r}return i.length===0?(s.log(n,""),s):s.log(n,...i)},t.prototype[iIe(n)]=function(){return(this||r).isLevelEnabled(n)}}),r}});var r6=S((jKe,t6)=>{"use strict";var sIe=zI();t6.exports=class{constructor(t={}){this.loggers=new Map,this.options=t}add(t,r){if(!this.loggers.has(t)){r=Object.assign({},r||this.options);let n=r.transports||this.options.transports;r.transports=n?n.slice():[];let i=sIe(r);i.on("close",()=>this._delete(t)),this.loggers.set(t,i)}return this.loggers.get(t)}get(t,r){return this.add(t,r)}has(t){return!!this.loggers.has(t)}close(t){if(t)return this._removeLogger(t);this.loggers.forEach((r,n)=>this._removeLogger(n))}_removeLogger(t){if(!this.loggers.has(t))return;this.loggers.get(t).close(),this._delete(t)}_delete(t){this.loggers.delete(t)}}});var Uw=S(bt=>{"use strict";var n6=OP(),{warn:Lc}=NP();bt.version=jV().version;bt.transports=OH();bt.config=Mw();bt.addColors=n6.levels;bt.format=n6.format;bt.createLogger=zI();bt.ExceptionHandler=kI();bt.RejectionHandler=FI();bt.Container=r6();bt.Transport=va();bt.loggers=new bt.Container;var bs=bt.createLogger();Object.keys(bt.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>bt[e]=(...t)=>bs[e](...t));Object.defineProperty(bt,"level",{get(){return bs.level},set(e){bs.level=e}});Object.defineProperty(bt,"exceptions",{get(){return bs.exceptions}});["exitOnError"].forEach(e=>{Object.defineProperty(bt,e,{get(){return bs[e]},set(t){bs[e]=t}})});Object.defineProperty(bt,"default",{get(){return{exceptionHandlers:bs.exceptionHandlers,rejectionHandlers:bs.rejectionHandlers,transports:bs.transports}}});Lc.deprecated(bt,"setLevels");Lc.forFunctions(bt,"useFormat",["cli"]);Lc.forProperties(bt,"useFormat",["padLevels","stripColors"]);Lc.forFunctions(bt,"deprecated",["addRewriter","addFilter","clone","extend"]);Lc.forProperties(bt,"deprecated",["emitErrs","levelLength"]);Lc.moved(bt,"createLogger","Logger")});var i6=S(ui=>{"use strict";var oIe=ui&&ui.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ui,"__esModule",{value:!0});ui.getHumanFormat=ui.errorFormatting=ui.getJsonFormat=void 0;var Rs=oIe(Uw());function aIe(){return Rs.default.format.combine(Rs.default.format.errors(),Rs.default.format.json(),Rs.default.format.timestamp({alias:"time"}))}ui.getJsonFormat=aIe;ui.errorFormatting=Rs.default.format.printf(e=>`${e.timestamp} ${e.level}: ${e.stack||e.message}`);function cIe(){return Rs.default.format.combine(Rs.default.format.colorize(),Rs.default.format.timestamp(),Rs.default.format.errors({stack:!0}),ui.errorFormatting)}ui.getHumanFormat=cIe});var df=S(Ao=>{"use strict";var lIe=Ao&&Ao.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.getLogger=Ao.Logger=void 0;var s6=lIe(Uw()),o6=i6(),uIe=Uw();Object.defineProperty(Ao,"Logger",{enumerable:!0,get:function(){return uIe.Logger}});function dIe(e){var t;let r=e.format==="human"?(0,o6.getHumanFormat)():(0,o6.getJsonFormat)();return s6.default.createLogger({defaultMeta:{...e.meta,name:e.name},format:r,transports:[new s6.default.transports.Console({silent:(t=e.silent)!==null&&t!==void 0?t:process.env.NODE_ENV==="test"})]})}Ao.getLogger=dIe});var UI=S(Vw=>{"use strict";Object.defineProperty(Vw,"__esModule",{value:!0});Vw.CloudflareApiKeyService=void 0;var a6=d5(),c6=$m(),pIe=df(),zc={keys:[],"matrix-keys":[]},l6,fIe=7*24*3600*1e3,$I=class{constructor(t,r){this.secretName=t,this.secretsClient=new a6.SecretsManagerClient({region:"ap-southeast-2"}),r||(r=(0,pIe.getLogger)({name:"CloudflareApiKeyService"})),this.logger=r}keyIsValid(t){if(zc.keys.length==0)throw new c6.UnAuthenticatedRequestError("No api keys to check against");return zc.keys.includes(t)}matrixKeyIsValid(t){if(zc["matrix-keys"].length==0)throw new c6.UnAuthenticatedRequestError("No api keys to check against");return zc["matrix-keys"].includes(t)}async getValidApiKeys(){let t;try{t=await this.secretsClient.send(new a6.GetSecretValueCommand({SecretId:this.secretName}))}catch(r){throw console.error(r),new Error("Failed to request api key from aws"+r.message)}try{if(!t.SecretString)throw new Error("cloudflare api key SecretString undefined");let r=JSON.parse(t.SecretString);if(r.keys)return r;throw new Error("api keys retrieved and decoded successfully but contained no values")}catch{throw new Error("failed to decode cloudflare api key values")}}async refreshApiKeys(){this.logger.info("refreshing keys"),zc=await this.getValidApiKeys(),this.logger.info(`number of valid keys found: ${zc.keys.length}`),l6||(l6=setInterval(async()=>{await this.refreshApiKeys()},fIe))}};Vw.CloudflareApiKeyService=$I});var GI=S(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});Gw.DevelopmentApiKeyService=void 0;var VI=class{keyIsValid(){return!0}matrixKeyIsValid(){return!0}};Gw.DevelopmentApiKeyService=VI});var d6=S(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});Hw.getApiKeyService=void 0;var u6=_1(),mIe=UI(),hIe=GI();function _Ie(e){let t=(0,u6.getNodeEnv)();switch(t){case"development":return new hIe.DevelopmentApiKeyService;case"production":if(e==null)throw new Error("invalid production state, need to have deploymentEnvironment and squiz region set");return new mIe.CloudflareApiKeyService(`dx-${e.deploymentEnvironment}-${e.squizRegion}-cmp-cloudflare-keys`);default:(0,u6.never)(t)}}Hw.getApiKeyService=_Ie});var p6=S(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});Bw.apiKeyMiddleware=void 0;var vIe=$m();function gIe(e){return function(t,r,n){let i=t.header("x-api-key");if(t.path=="/health"){n();return}if(e.keyIsValid(i)||e.matrixKeyIsValid(i)){n();return}throw new vIe.UnAuthenticatedRequestError("API KEY IS INVALID")}}Bw.apiKeyMiddleware=gIe});var HI=S(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});Ww.applyDefaultRulesToCacheControlObject=void 0;var xs=BI();function yIe(e){let t={...e};return t["max-age"]!==void 0&&(t["max-age"]=(0,xs.ensureBetween)(t["max-age"],xs.MIN_CACHE_SECONDS,xs.MAX_CACHE_SECONDS)),t["s-maxage"]!==void 0&&(t["s-maxage"]=(0,xs.ensureBetween)(t["s-maxage"],xs.MIN_CACHE_SECONDS,xs.MAX_CACHE_SECONDS)),t["min-fresh"]!==void 0&&(t["min-fresh"]=(0,xs.ensureBetween)(t["min-fresh"],xs.MIN_CACHE_SECONDS,xs.MAX_CACHE_SECONDS)),delete t["no-store"],delete t["no-cache"],t}Ww.applyDefaultRulesToCacheControlObject=yIe});var WI=S(Kw=>{"use strict";Object.defineProperty(Kw,"__esModule",{value:!0});Kw.cacheControlToString=void 0;function SIe(e){let t=[];for(let r of Object.keys(e)){let n=e[r];typeof n=="boolean"&&n===!0?t.push(r):(typeof n=="number"?n=n.toString():typeof n=="string"&&(n=`"${n}"`),t.push(`${r}=${n}`))}return t.join(", ")}Kw.cacheControlToString=SIe});var KI=S(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});Jw.parseCacheControl=void 0;function wIe(e){let t=e.split(/,(?=(?:[^"]|"[^"]*")*$)/),r={};for(let n of t){let[i,s]=n.split("="),a=i.trim(),o=s!==void 0?s.trim():void 0,c=EIe(o),u=bIe(c,a);r[a]=u}return r}Jw.parseCacheControl=wIe;function EIe(e){return e===void 0?e:e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e}function bIe(e,t){if(t==="max-age"||t==="s-maxage"||t==="min-fresh"||t==="stale-while-revalidate"||t==="stale-if-error")if(e){let r=parseInt(e,10);return isNaN(r)?e||!0:r}else return 0;return e===void 0?!0:e}});var BI=S(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.ensureBetween=bn.parseAndSanitiseCacheControlHeader=bn.DEFAULT_CACHE_CONTROL_HEADER=bn.MAX_CACHE_SECONDS=bn.MIN_CACHE_SECONDS=void 0;var RIe=HI(),f6=WI(),xIe=KI();bn.MIN_CACHE_SECONDS=30;bn.MAX_CACHE_SECONDS=m6(30);bn.DEFAULT_CACHE_CONTROL_HEADER=(0,f6.cacheControlToString)({public:!0,"max-age":m6(30)});function AIe(e){if(!e)return bn.DEFAULT_CACHE_CONTROL_HEADER;let t=(0,xIe.parseCacheControl)(e);return t=(0,RIe.applyDefaultRulesToCacheControlObject)(t),(0,f6.cacheControlToString)(t)}bn.parseAndSanitiseCacheControlHeader=AIe;function PIe(e,t,r){return Math.max(t,Math.min(e,r))}bn.ensureBetween=PIe;function m6(e){return e*60}});var h6=S(Bi=>{"use strict";var IIe=Bi&&Bi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Yw=Bi&&Bi.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&IIe(t,e,r)};Object.defineProperty(Bi,"__esModule",{value:!0});Yw(BI(),Bi);Yw(KI(),Bi);Yw(HI(),Bi);Yw(WI(),Bi)});var v6=S(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0})});var g6=S(Wi=>{"use strict";var CIe=Wi&&Wi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),TIe=Wi&&Wi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),OIe=Wi&&Wi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&CIe(t,e,r);return TIe(t,e),t};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.v1=void 0;Wi.v1=OIe(v6())});var JI=S((KKe,NIe)=>{NIe.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namesapce of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var y6=S($c=>{"use strict";var jIe=$c&&$c.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($c,"__esModule",{value:!0});$c.v1=void 0;var qIe=jIe(JI());$c.v1=qIe.default});var w6=S(S6=>{"use strict";Object.defineProperty(S6,"__esModule",{value:!0})});var E6=S(Ki=>{"use strict";var MIe=Ki&&Ki.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),kIe=Ki&&Ki.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),DIe=Ki&&Ki.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&MIe(t,e,r);return kIe(t,e),t};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.v1=void 0;Ki.v1=DIe(w6())});var YI=S((XKe,FIe)=>{FIe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/TextNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{title:"FormattedNodeFontProperties",type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}}},required:["type","tag","children"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"}},required:["type","matrixDomain","matrixAssetId"]}}}});var b6=S(Uc=>{"use strict";var LIe=Uc&&Uc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Uc,"__esModule",{value:!0});Uc.v1=void 0;var zIe=LIe(YI());Uc.v1=zIe.default});var QI=S((exports,module)=>{(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof exports=="object"?exports.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:exports,()=>(()=>{var __webpack_modules__={604:function(e){typeof self<"u",e.exports=(()=>{"use strict";var t={d:(x,P)=>{for(var G in P)t.o(P,G)&&!t.o(x,G)&&Object.defineProperty(x,G,{enumerable:!0,get:P[G]})},o:(x,P)=>Object.prototype.hasOwnProperty.call(x,P),r:x=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})}},r={};function n(x){return x==="#"||x===""||Array.isArray(x)&&x.length===0||!1}t.r(r),t.d(r,{default:()=>T,get:()=>p,isRoot:()=>n,join:()=>N,remove:()=>E,removeUndefinedItems:()=>y,set:()=>_,split:()=>l});let i=/~1/g,s=/~0/g,a=/\/+/g,o=/(^[#/]*|\/+$)/g;function c(x){return x.replace(i,"/").replace(s,"~")}function u(x){return c(decodeURIComponent(x))}function l(x){if(x==null||typeof x!="string"||n(x))return Array.isArray(x)?x:[];let P=x.indexOf("#")>=0?u:c,G=(x=(x=x.replace(a,"/")).replace(o,"")).split("/");for(let D=0,H=G.length;D<H;D+=1)G[D]=P(G[D]);return G}function p(x,P,G){if(P==null||x==null)return G;if(n(P))return x;let D=d(x,l(P));return D===void 0?G:D}function d(x,P){let G=P.shift();if(x!==void 0)return G!==void 0?d(x[G],P):x}let m=/^\[.*\]$/,f=/^\[(.+)\]$/;function h(x,P){return x==="__proto__"||x=="constructor"&&P.length>0&&P[0]=="prototype"}function _(x,P,G){if(P==null)return x;let D=l(P);if(D.length===0)return x;x==null&&(x=m.test(D[0])?[]:{});let H,B,ee=x;for(;D.length>1;)H=D.shift(),B=m.test(D[0]),h(H,D)||(ee=v(ee,H,B));return H=D.pop(),g(ee,H,G),x}function g(x,P,G){let D,H=P.match(f);P==="[]"&&Array.isArray(x)?x.push(G):H?(D=H.pop(),x[D]=G):x[P]=G}function v(x,P,G){if(x[P]!=null)return x[P];let D=G?[]:{};return g(x,P,D),D}function y(x){let P=0,G=0;for(;P+G<x.length;)x[P+G]===void 0&&(G+=1),x[P]=x[P+G],P+=1;return x.length=x.length-G,x}function E(x,P,G){let D=l(P),H=D.pop(),B=p(x,D);return B&&delete B[H],Array.isArray(B)&&G!==!0&&y(B),x}let q=/\/+/g,C=/~/g,M=/\//g;function F(x,P){if(x.length===0)return P?"#":"";for(let G=0,D=x.length;G<D;G+=1)x[G]=x[G].replace(C,"~0").replace(M,"~1"),P&&(x[G]=encodeURIComponent(x[G]));return((P?"#/":"/")+x.join("/")).replace(q,"/")}function N(x,...P){let G=[];if(Array.isArray(x))return F(x,arguments[1]===!0);let D=arguments[arguments.length-1],H=typeof D=="boolean"?D:x&&x[0]==="#";for(let ee=0,O=arguments.length;ee<O;ee+=1)G.push.apply(G,l(arguments[ee]));let B=[];for(let ee=0,O=G.length;ee<O;ee+=1)if(G[ee]===".."){if(B.length===0)return H?"#":"";B.pop()}else B.push(G[ee]);return F(B,H)}let T={get:p,set:_,remove:E,join:N,split:l,splitLast:function(x){let P=l(x);if(P.length===0)return typeof x=="string"&&x[0]==="#"?["#",P[0]]:["",void 0];if(P.length===1)return x[0]==="#"?["#",P[0]]:["",P[0]];let G=P.pop();return[N(P,x[0]==="#"),G]},isRoot:n,removeUndefinedItems:y};return r})()},723:(e,t,r)=>{"use strict";let n=r(802);var i;(function(s){s.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],s.defaultParser=new n.Parser(s.RULES,{debug:!1});let a=/^(!|&)/,o=/(\?|\+|\*)$/,c=/^%/;function u(v,y){if(typeof v=="string"){if(a.test(v))return"";if(c.test(v)){let E=o.exec(v),q=E?E[0]+" ":"";return function(M,F){let N=n.findRuleByName(M,F);return N&&N.bnf.length==1&&N.bnf[0].length==1&&(N.bnf[0][0]instanceof RegExp||N.bnf[0][0][0]=='"'||N.bnf[0][0][0]=="'")}(v,y)?l(v,y)+q:"("+l(v,y)+")"+q}return v}return v.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function l(v,y){let E=n.findRuleByName(v,y);return E?E.bnf.map(q=>function(C,M){return C.map(F=>u(F,M)).join(" ")}(q,y)).join(" | "):"RULE_NOT_FOUND {"+v+"}"}function p(v){let y=[];return v.grammarRules.forEach(E=>{if(!/^%/.test(E.name)){let q=E.recover?" /* { recoverUntil="+E.recover+" } */":"";y.push(E.name+" ::= "+l(E.name,v)+q)}}),y.join(`
63
+ `))}_onEvent(t,r){function n(i){t==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(t,i,r)}r["__winston"+t]||(r["__winston"+t]=n.bind(this),r.on(t,r["__winston"+t]))}_addDefaultMeta(t){this.defaultMeta&&Object.assign(t,this.defaultMeta)}};function LI(e,t){let r=e[t];return!r&&r!==0?null:r}Object.defineProperty($w.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});XH.exports=$w});var zI=S((OKe,e6)=>{"use strict";var{LEVEL:eIe}=rr(),tIe=Mw(),rIe=ZH(),nIe=of()("winston:create-logger");function iIe(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}e6.exports=function(e={}){e.levels=e.levels||tIe.npm.levels;class t extends rIe{constructor(i){super(i)}}let r=new t(e);return Object.keys(e.levels).forEach(function(n){if(nIe('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}t.prototype[n]=function(...i){let s=this||r;if(i.length===1){let[a]=i,o=a&&a.message&&a||{message:a};return o.level=o[eIe]=n,s._addDefaultMeta(o),s.write(o),this||r}return i.length===0?(s.log(n,""),s):s.log(n,...i)},t.prototype[iIe(n)]=function(){return(this||r).isLevelEnabled(n)}}),r}});var r6=S((jKe,t6)=>{"use strict";var sIe=zI();t6.exports=class{constructor(t={}){this.loggers=new Map,this.options=t}add(t,r){if(!this.loggers.has(t)){r=Object.assign({},r||this.options);let n=r.transports||this.options.transports;r.transports=n?n.slice():[];let i=sIe(r);i.on("close",()=>this._delete(t)),this.loggers.set(t,i)}return this.loggers.get(t)}get(t,r){return this.add(t,r)}has(t){return!!this.loggers.has(t)}close(t){if(t)return this._removeLogger(t);this.loggers.forEach((r,n)=>this._removeLogger(n))}_removeLogger(t){if(!this.loggers.has(t))return;this.loggers.get(t).close(),this._delete(t)}_delete(t){this.loggers.delete(t)}}});var Uw=S(bt=>{"use strict";var n6=OP(),{warn:Lc}=NP();bt.version=jV().version;bt.transports=OH();bt.config=Mw();bt.addColors=n6.levels;bt.format=n6.format;bt.createLogger=zI();bt.ExceptionHandler=kI();bt.RejectionHandler=FI();bt.Container=r6();bt.Transport=va();bt.loggers=new bt.Container;var bs=bt.createLogger();Object.keys(bt.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>bt[e]=(...t)=>bs[e](...t));Object.defineProperty(bt,"level",{get(){return bs.level},set(e){bs.level=e}});Object.defineProperty(bt,"exceptions",{get(){return bs.exceptions}});["exitOnError"].forEach(e=>{Object.defineProperty(bt,e,{get(){return bs[e]},set(t){bs[e]=t}})});Object.defineProperty(bt,"default",{get(){return{exceptionHandlers:bs.exceptionHandlers,rejectionHandlers:bs.rejectionHandlers,transports:bs.transports}}});Lc.deprecated(bt,"setLevels");Lc.forFunctions(bt,"useFormat",["cli"]);Lc.forProperties(bt,"useFormat",["padLevels","stripColors"]);Lc.forFunctions(bt,"deprecated",["addRewriter","addFilter","clone","extend"]);Lc.forProperties(bt,"deprecated",["emitErrs","levelLength"]);Lc.moved(bt,"createLogger","Logger")});var i6=S(ui=>{"use strict";var oIe=ui&&ui.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ui,"__esModule",{value:!0});ui.getHumanFormat=ui.errorFormatting=ui.getJsonFormat=void 0;var Rs=oIe(Uw());function aIe(){return Rs.default.format.combine(Rs.default.format.errors(),Rs.default.format.json(),Rs.default.format.timestamp({alias:"time"}))}ui.getJsonFormat=aIe;ui.errorFormatting=Rs.default.format.printf(e=>`${e.timestamp} ${e.level}: ${e.stack||e.message}`);function cIe(){return Rs.default.format.combine(Rs.default.format.colorize(),Rs.default.format.timestamp(),Rs.default.format.errors({stack:!0}),ui.errorFormatting)}ui.getHumanFormat=cIe});var df=S(Ao=>{"use strict";var lIe=Ao&&Ao.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.getLogger=Ao.Logger=void 0;var s6=lIe(Uw()),o6=i6(),uIe=Uw();Object.defineProperty(Ao,"Logger",{enumerable:!0,get:function(){return uIe.Logger}});function dIe(e){var t;let r=e.format==="human"?(0,o6.getHumanFormat)():(0,o6.getJsonFormat)();return s6.default.createLogger({defaultMeta:{...e.meta,name:e.name},format:r,transports:[new s6.default.transports.Console({silent:(t=e.silent)!==null&&t!==void 0?t:process.env.NODE_ENV==="test"})]})}Ao.getLogger=dIe});var UI=S(Vw=>{"use strict";Object.defineProperty(Vw,"__esModule",{value:!0});Vw.CloudflareApiKeyService=void 0;var a6=d5(),c6=$m(),pIe=df(),zc={keys:[],"matrix-keys":[]},l6,fIe=7*24*3600*1e3,$I=class{constructor(t,r){this.secretName=t,this.secretsClient=new a6.SecretsManagerClient({region:"ap-southeast-2"}),r||(r=(0,pIe.getLogger)({name:"CloudflareApiKeyService"})),this.logger=r}keyIsValid(t){if(zc.keys.length==0)throw new c6.UnAuthenticatedRequestError("No api keys to check against");return zc.keys.includes(t)}matrixKeyIsValid(t){if(zc["matrix-keys"].length==0)throw new c6.UnAuthenticatedRequestError("No api keys to check against");return zc["matrix-keys"].includes(t)}async getValidApiKeys(){let t;try{t=await this.secretsClient.send(new a6.GetSecretValueCommand({SecretId:this.secretName}))}catch(r){throw console.error(r),new Error("Failed to request api key from aws"+r.message)}try{if(!t.SecretString)throw new Error("cloudflare api key SecretString undefined");let r=JSON.parse(t.SecretString);if(r.keys)return r;throw new Error("api keys retrieved and decoded successfully but contained no values")}catch{throw new Error("failed to decode cloudflare api key values")}}async refreshApiKeys(){this.logger.info("refreshing keys"),zc=await this.getValidApiKeys(),this.logger.info(`number of valid keys found: ${zc.keys.length}`),l6||(l6=setInterval(async()=>{await this.refreshApiKeys()},fIe))}};Vw.CloudflareApiKeyService=$I});var GI=S(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});Gw.DevelopmentApiKeyService=void 0;var VI=class{keyIsValid(){return!0}matrixKeyIsValid(){return!0}};Gw.DevelopmentApiKeyService=VI});var d6=S(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});Hw.getApiKeyService=void 0;var u6=_1(),mIe=UI(),hIe=GI();function _Ie(e){let t=(0,u6.getNodeEnv)();switch(t){case"development":return new hIe.DevelopmentApiKeyService;case"production":if(e==null)throw new Error("invalid production state, need to have deploymentEnvironment and squiz region set");return new mIe.CloudflareApiKeyService(`dx-${e.deploymentEnvironment}-${e.squizRegion}-cmp-cloudflare-keys`);default:(0,u6.never)(t)}}Hw.getApiKeyService=_Ie});var p6=S(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});Bw.apiKeyMiddleware=void 0;var vIe=$m();function gIe(e){return function(t,r,n){let i=t.header("x-api-key");if(t.path=="/health"){n();return}if(e.keyIsValid(i)||e.matrixKeyIsValid(i)){n();return}throw new vIe.UnAuthenticatedRequestError("API KEY IS INVALID")}}Bw.apiKeyMiddleware=gIe});var HI=S(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});Ww.applyDefaultRulesToCacheControlObject=void 0;var xs=BI();function yIe(e){let t={...e};return t["max-age"]!==void 0&&(t["max-age"]=(0,xs.ensureBetween)(t["max-age"],xs.MIN_CACHE_SECONDS,xs.MAX_CACHE_SECONDS)),t["s-maxage"]!==void 0&&(t["s-maxage"]=(0,xs.ensureBetween)(t["s-maxage"],xs.MIN_CACHE_SECONDS,xs.MAX_CACHE_SECONDS)),t["min-fresh"]!==void 0&&(t["min-fresh"]=(0,xs.ensureBetween)(t["min-fresh"],xs.MIN_CACHE_SECONDS,xs.MAX_CACHE_SECONDS)),delete t["no-store"],delete t["no-cache"],t}Ww.applyDefaultRulesToCacheControlObject=yIe});var WI=S(Kw=>{"use strict";Object.defineProperty(Kw,"__esModule",{value:!0});Kw.cacheControlToString=void 0;function SIe(e){let t=[];for(let r of Object.keys(e)){let n=e[r];typeof n=="boolean"&&n===!0?t.push(r):(typeof n=="number"?n=n.toString():typeof n=="string"&&(n=`"${n}"`),t.push(`${r}=${n}`))}return t.join(", ")}Kw.cacheControlToString=SIe});var KI=S(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});Jw.parseCacheControl=void 0;function wIe(e){let t=e.split(/,(?=(?:[^"]|"[^"]*")*$)/),r={};for(let n of t){let[i,s]=n.split("="),a=i.trim(),o=s!==void 0?s.trim():void 0,c=EIe(o),u=bIe(c,a);r[a]=u}return r}Jw.parseCacheControl=wIe;function EIe(e){return e===void 0?e:e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e}function bIe(e,t){if(t==="max-age"||t==="s-maxage"||t==="min-fresh"||t==="stale-while-revalidate"||t==="stale-if-error")if(e){let r=parseInt(e,10);return isNaN(r)?e||!0:r}else return 0;return e===void 0?!0:e}});var BI=S(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.ensureBetween=bn.parseAndSanitiseCacheControlHeader=bn.DEFAULT_CACHE_CONTROL_HEADER=bn.MAX_CACHE_SECONDS=bn.MIN_CACHE_SECONDS=void 0;var RIe=HI(),f6=WI(),xIe=KI();bn.MIN_CACHE_SECONDS=30;bn.MAX_CACHE_SECONDS=m6(30);bn.DEFAULT_CACHE_CONTROL_HEADER=(0,f6.cacheControlToString)({public:!0,"max-age":m6(30)});function AIe(e){if(!e)return bn.DEFAULT_CACHE_CONTROL_HEADER;let t=(0,xIe.parseCacheControl)(e);return t=(0,RIe.applyDefaultRulesToCacheControlObject)(t),(0,f6.cacheControlToString)(t)}bn.parseAndSanitiseCacheControlHeader=AIe;function PIe(e,t,r){return Math.max(t,Math.min(e,r))}bn.ensureBetween=PIe;function m6(e){return e*60}});var h6=S(Bi=>{"use strict";var IIe=Bi&&Bi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Yw=Bi&&Bi.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&IIe(t,e,r)};Object.defineProperty(Bi,"__esModule",{value:!0});Yw(BI(),Bi);Yw(KI(),Bi);Yw(HI(),Bi);Yw(WI(),Bi)});var v6=S(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0})});var g6=S(Wi=>{"use strict";var CIe=Wi&&Wi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),TIe=Wi&&Wi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),OIe=Wi&&Wi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&CIe(t,e,r);return TIe(t,e),t};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.v1=void 0;Wi.v1=OIe(v6())});var JI=S((KKe,NIe)=>{NIe.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namesapce of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var y6=S($c=>{"use strict";var jIe=$c&&$c.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($c,"__esModule",{value:!0});$c.v1=void 0;var qIe=jIe(JI());$c.v1=qIe.default});var w6=S(S6=>{"use strict";Object.defineProperty(S6,"__esModule",{value:!0})});var E6=S(Ki=>{"use strict";var MIe=Ki&&Ki.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),kIe=Ki&&Ki.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),DIe=Ki&&Ki.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&MIe(t,e,r);return kIe(t,e),t};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.v1=void 0;Ki.v1=DIe(w6())});var YI=S((XKe,FIe)=>{FIe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/TextNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{title:"FormattedNodeFontProperties",type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}}},required:["type","tag","children"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"}},required:["type","matrixDomain","matrixAssetId"]}}}});var b6=S(Uc=>{"use strict";var LIe=Uc&&Uc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Uc,"__esModule",{value:!0});Uc.v1=void 0;var zIe=LIe(YI());Uc.v1=zIe.default});var QI=S((exports,module)=>{(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof exports=="object"?exports.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:exports,()=>(()=>{var __webpack_modules__={604:function(e){typeof self<"u",e.exports=(()=>{"use strict";var t={d:(x,P)=>{for(var G in P)t.o(P,G)&&!t.o(x,G)&&Object.defineProperty(x,G,{enumerable:!0,get:P[G]})},o:(x,P)=>Object.prototype.hasOwnProperty.call(x,P),r:x=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})}},r={};function n(x){return x==="#"||x===""||Array.isArray(x)&&x.length===0||!1}t.r(r),t.d(r,{default:()=>T,get:()=>p,isRoot:()=>n,join:()=>N,remove:()=>E,removeUndefinedItems:()=>y,set:()=>_,split:()=>l});let i=/~1/g,s=/~0/g,a=/\/+/g,o=/(^[#/]*|\/+$)/g;function c(x){return x.replace(i,"/").replace(s,"~")}function u(x){return c(decodeURIComponent(x))}function l(x){if(x==null||typeof x!="string"||n(x))return Array.isArray(x)?x:[];let P=x.indexOf("#")>=0?u:c,G=(x=(x=x.replace(a,"/")).replace(o,"")).split("/");for(let D=0,H=G.length;D<H;D+=1)G[D]=P(G[D]);return G}function p(x,P,G){if(P==null||x==null)return G;if(n(P))return x;let D=d(x,l(P));return D===void 0?G:D}function d(x,P){let G=P.shift();if(x!==void 0)return G!==void 0?d(x[G],P):x}let m=/^\[.*\]$/,f=/^\[(.+)\]$/;function h(x,P){return x==="__proto__"||x=="constructor"&&P.length>0&&P[0]=="prototype"}function _(x,P,G){if(P==null)return x;let D=l(P);if(D.length===0)return x;x==null&&(x=m.test(D[0])?[]:{});let H,B,ee=x;for(;D.length>1;)H=D.shift(),B=m.test(D[0]),h(H,D)||(ee=v(ee,H,B));return H=D.pop(),g(ee,H,G),x}function g(x,P,G){let D,H=P.match(f);P==="[]"&&Array.isArray(x)?x.push(G):H?(D=H.pop(),x[D]=G):x[P]=G}function v(x,P,G){if(x[P]!=null)return x[P];let D=G?[]:{};return g(x,P,D),D}function y(x){let P=0,G=0;for(;P+G<x.length;)x[P+G]===void 0&&(G+=1),x[P]=x[P+G],P+=1;return x.length=x.length-G,x}function E(x,P,G){let D=l(P),H=D.pop(),B=p(x,D);return B&&delete B[H],Array.isArray(B)&&G!==!0&&y(B),x}let q=/\/+/g,C=/~/g,M=/\//g;function F(x,P){if(x.length===0)return P?"#":"";for(let G=0,D=x.length;G<D;G+=1)x[G]=x[G].replace(C,"~0").replace(M,"~1"),P&&(x[G]=encodeURIComponent(x[G]));return((P?"#/":"/")+x.join("/")).replace(q,"/")}function N(x,...P){let G=[];if(Array.isArray(x))return F(x,arguments[1]===!0);let D=arguments[arguments.length-1],H=typeof D=="boolean"?D:x&&x[0]==="#";for(let ee=0,O=arguments.length;ee<O;ee+=1)G.push.apply(G,l(arguments[ee]));let B=[];for(let ee=0,O=G.length;ee<O;ee+=1)if(G[ee]===".."){if(B.length===0)return H?"#":"";B.pop()}else B.push(G[ee]);return F(B,H)}let T={get:p,set:_,remove:E,join:N,split:l,splitLast:function(x){let P=l(x);if(P.length===0)return typeof x=="string"&&x[0]==="#"?["#",P[0]]:["",void 0];if(P.length===1)return x[0]==="#"?["#",P[0]]:["",P[0]];let G=P.pop();return[N(P,x[0]==="#"),G]},isRoot:n,removeUndefinedItems:y};return r})()},723:(e,t,r)=>{"use strict";let n=r(802);var i;(function(s){s.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],s.defaultParser=new n.Parser(s.RULES,{debug:!1});let a=/^(!|&)/,o=/(\?|\+|\*)$/,c=/^%/;function u(v,y){if(typeof v=="string"){if(a.test(v))return"";if(c.test(v)){let E=o.exec(v),q=E?E[0]+" ":"";return function(M,F){let N=n.findRuleByName(M,F);return N&&N.bnf.length==1&&N.bnf[0].length==1&&(N.bnf[0][0]instanceof RegExp||N.bnf[0][0][0]=='"'||N.bnf[0][0][0]=="'")}(v,y)?l(v,y)+q:"("+l(v,y)+")"+q}return v}return v.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function l(v,y){let E=n.findRuleByName(v,y);return E?E.bnf.map(q=>function(C,M){return C.map(F=>u(F,M)).join(" ")}(q,y)).join(" | "):"RULE_NOT_FOUND {"+v+"}"}function p(v){let y=[];return v.grammarRules.forEach(E=>{if(!/^%/.test(E.name)){let q=E.recover?" /* { recoverUntil="+E.recover+" } */":"";y.push(E.name+" ::= "+l(E.name,v)+q)}}),y.join(`
64
64
  `)}s.emit=p;let d=0;function m(v){return new RegExp(v.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function f(v,y,E){let q=null,C=[];return y.children.forEach((M,F)=>{M.type=="Minus"&&function(T,x){throw console.log("reberia restar "+x+" a "+T),new Error("Difference not supported yet")}(q,M);let N=y.children[F+1];switch(N=N&&N.type=="PrimaryDecoration"&&N.text||"",M.type){case"SubItem":let T="%"+(E+d++);h(v,M,T),C.push(""+T+N);break;case"NCName":case"StringLiteral":C.push(""+M.text+N);break;case"CharCode":case"CharClass":if(N){let x={name:"%"+(E+d++),bnf:[[m(M.text)]]};v.push(x),C.push(""+x.name+N)}else C.push(m(M.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+M.type+" -> "+JSON.stringify(M.text))}q=M}),C}function h(v,y,E){let q=y.children.filter(F=>F.type=="SequenceOrDifference").map(F=>f(v,F,E)),C={name:E,bnf:q},M=null;q.forEach(F=>{M=M||F.recover,delete F.recover}),E.indexOf("%")==0&&(C.fragment=!0),M&&(C.recover=M),v.push(C)}function _(v,y=s.defaultParser){let E=y.getAST(v);if(!E)throw new Error("Could not parse "+v);if(E.errors&&E.errors.length)throw E.errors[0];let q=[];return E.children.filter(C=>C.type=="Production").map(C=>{let M=C.children.filter(F=>F.type=="NCName")[0].text;h(q,C,M)}),q}s.getRules=_,s.Transform=function(v,y=s.defaultParser){return _(v.join(""),y)};class g extends n.Parser{constructor(y,E){super(_(y,E&&E.debugRulesParser===!0?new n.Parser(s.RULES,{debug:!0}):s.defaultParser),E)}emitSource(){return p(this)}}s.Parser=g})(i||(i={})),t.Z=i},802:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Parser=exports.findRuleByName=exports.parseRuleName=exports.escapeRegExp=exports.readToken=void 0;let UPPER_SNAKE_RE=/^[A-Z0-9_]+$/,decorationRE=/(\?|\+|\*)$/,preDecorationRE=/^(@|&|!)/,WS_RULE="WS",TokenError_1=__webpack_require__(239);function readToken(e,t){let r=t.exec(e);return r&&r.index==0?r[0].length==0&&t.source.length>0?null:{type:null,text:r[0],rest:e.substr(r[0].length),start:0,end:r[0].length-1,fullText:r[0],errors:[],children:[],parent:null}:null}function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function fixRest(e){e.rest="",e.children&&e.children.forEach(t=>fixRest(t))}function fixPositions(e,t){e.start+=t,e.end+=t,e.children&&e.children.forEach(r=>fixPositions(r,e.start))}function agregateErrors(e,t){t.errors&&t.errors.length&&t.errors.forEach(r=>e.push(r)),t.children&&t.children.forEach(r=>agregateErrors(e,r))}function parseRuleName(e){let t=decorationRE.exec(e),r=preDecorationRE.exec(e),n=t&&t[0]||"",i=r&&r[0]||"",s={raw:e,name:e.replace(decorationRE,"").replace(preDecorationRE,""),isOptional:n=="?"||n=="*",allowRepetition:n=="+"||n=="*",atLeastOne:n=="+",lookupPositive:i=="&",lookupNegative:i=="!",pinned:i=="@",lookup:!1,isLiteral:!1};return s.isLiteral=s.name[0]=="'"||s.name[0]=='"',s.lookup=s.lookupNegative||s.lookupPositive,s}function findRuleByName(e,t){let r=parseRuleName(e);return t.cachedRules[r.name]||null}function stripRules(e,t){if(e.children){let r=e.children.filter(n=>n.type&&t.test(n.type));for(let n=0;n<r.length;n++){let i=e.children.indexOf(r[n]);i!=-1&&e.children.splice(i,1)}e.children.forEach(n=>stripRules(n,t))}}exports.readToken=readToken,exports.escapeRegExp=escapeRegExp,exports.parseRuleName=parseRuleName,exports.findRuleByName=findRuleByName;let ignoreMissingRules=["EOF"];class Parser{constructor(e,t){this.grammarRules=e,this.options=t,this.cachedRules={},this.debug=!!t&&t.debug===!0;let r=[],n=[];if(e.forEach(i=>{let s=parseRuleName(i.name);if(s.name in this.cachedRules)r.push("Duplicated rule "+s.name);else{if(this.cachedRules[s.name]=i,i.bnf&&i.bnf.length)i.bnf.forEach(a=>{if(typeof a[0]=="string"&&parseRuleName(a[0]).name==i.name){let o="Left recursion is not allowed, rule: "+i.name;r.indexOf(o)==-1&&r.push(o)}a.forEach(o=>{if(typeof o=="string"){let c=parseRuleName(o);c.isLiteral||n.indexOf(c.name)!=-1||ignoreMissingRules.indexOf(c.name)!=-1||n.push(c.name)}})});else{let a="Missing rule content, rule: "+i.name;r.indexOf(a)==-1&&r.push(a)}WS_RULE==i.name&&(i.implicitWs=!1),i.implicitWs&&n.indexOf(WS_RULE)==-1&&n.push(WS_RULE),i.recover&&n.indexOf(i.recover)==-1&&n.push(i.recover)}}),n.forEach(i=>{i in this.cachedRules||r.push("Missing rule "+i)}),r.length)throw new Error(r.join(`
65
65
  `))}getAST(e,t){t||(t=this.grammarRules.filter(n=>!n.fragment&&n.name.indexOf("%")!=0)[0].name);let r=this.parse(e,t);if(r){agregateErrors(r.errors,r),fixPositions(r,0),stripRules(r,/^%/),this.options&&this.options.keepUpperRules||stripRules(r,UPPER_SNAKE_RE);let n=r.rest;n&&new TokenError_1.TokenError(`Unexpected end of input:
66
66
  `+n,r),fixRest(r),r.rest=n}return r}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(txt,target,recursion=0){let out=null,type=parseRuleName(target),expr,printable=this.debug&&!UPPER_SNAKE_RE.test(type.name);printable&&console.log(new Array(recursion).join("\u2502 ")+"Trying to get "+target+" from "+JSON.stringify(txt.split(`
@@ -238,7 +238,7 @@ safe-buffer/index.js:
238
238
  */
239
239
  /**
240
240
  * @title @squiz/content-api
241
- * @version 1.22.1-alpha.11
241
+ * @version 1.22.1-alpha.13
242
242
  * @license ISC
243
243
  * @baseUrl /
244
244
  * @contact