@squiz/component-cli-lib 1.22.1-alpha.7 → 1.22.1-alpha.9

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.
@@ -1,7 +1,7 @@
1
1
  0 verbose cli /usr/local/bin/node /usr/local/bin/npm
2
2
  1 info using npm@9.5.0
3
3
  2 info using node@v18.15.0
4
- 3 timing npm:load:whichnode Completed in 2ms
4
+ 3 timing npm:load:whichnode Completed in 1ms
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
@@ -9,29 +9,29 @@
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 20ms
12
+ 11 timing config:load:project Completed in 18ms
13
13
  12 timing config:load:file:/root/.npmrc Completed in 1ms
14
14
  13 timing config:load:user Completed in 1ms
15
15
  14 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
16
16
  15 timing config:load:global Completed in 0ms
17
17
  16 timing config:load:setEnvs Completed in 1ms
18
- 17 timing config:load Completed in 29ms
19
- 18 timing npm:load:configload Completed in 29ms
18
+ 17 timing config:load Completed in 27ms
19
+ 18 timing npm:load:configload Completed in 27ms
20
20
  19 timing npm:load:mkdirpcache Completed in 0ms
21
- 20 timing npm:load:mkdirplogs 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
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-04T01_19_14_668Z-
28
- 27 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-04-04T01_19_14_668Z-debug-0.log
27
+ 26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-04-05T04_03_57_847Z-
28
+ 27 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-04-05T04_03_57_847Z-debug-0.log
29
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
- 31 timing npm:load Completed in 42ms
32
+ 31 timing npm:load Completed in 40ms
33
33
  32 silly logfile done cleaning log files
34
- 33 timing command:run Completed in 4402ms
34
+ 33 timing command:run Completed in 4287ms
35
35
  34 verbose exit 0
36
- 35 timing npm Completed in 4458ms
36
+ 35 timing npm Completed in 4339ms
37
37
  36 info ok
package/lib/index.js CHANGED
@@ -129,7 +129,9 @@ orPattern ::= S? "," S?
129
129
 
130
130
  S ::= [ ]*
131
131
  `,J=new O.Z.Parser(V),oe=I=>J.getAST(I),ye=(I,b)=>`${I}/${b}`,ne=Object.prototype.toString,ue=/Object|Array/,_e=I=>ue.test(ne.call(I));function Re(I){return new RegExp(I.text.replace(/(^{|}$)/g,""))}function Z(I){return Array.isArray(I)?I.map(function(b,R){return`${R}`}):Object.prototype.toString.call(I)==="[object Object]"?Object.keys(I):[]}let te={mem:[],get(I,b){let R=I[0][b];if(!te.mem.includes(R))return _e(R)&&te.mem.push(R),[R,b,I[0],ye(I[3],b)]},reset(){te.mem.length=0}},de={any(I,b){let R=b[0];return Z(R).map(k=>[R[k],k,R,ye(b[3],k)])},all(I,b){let R=[b];var k,L;return k=b[0],L=(X,re)=>{let ie=te.get(b,re);ie&&R.push(...de.all(I,ie))},Array.isArray(k)?k.forEach(L):Object.prototype.toString.call(k)==="[object Object]"&&Object.keys(k).forEach(function(X){L(k[X],X,k)}),R},regex(I,b){let R=Re(I),k=b[0];return Z(k).filter(L=>R.test(L)).map(L=>[k[L],L,k,ye(b[3],L)])}},Se={escaped:(I,b)=>Se.property(I,b),property:(I,b)=>{let R=I.text;if(b[0]&&b[0][R]!==void 0)return[b[0][R],R,b[0],ye(b[3],R)]},typecheck:(I,b)=>{let R=I.text.replace(/^\?:/,"");if(R==="value")return _e(b[0])?void 0:b;var k;return k=b[0],ne.call(k).match(/\s([^\]]+)\]/).pop().toLowerCase()===R?b:void 0},lookahead:(I,b)=>{let R=!0,k=!1;return I.children.forEach(L=>{if(L.type==="expression"){let X=Se.expression(L,b)!==void 0;R=k===!0?R||X:R&&X}else k=L.type==="orExpr"}),R?b:void 0},expression:(I,b)=>{let R=I.children[0].text,k=I.children[1],L=I.children[2],X=b[0];if(_e(X)!==!1)return function(re,ie,pe){if(ie===void 0)return re!==void 0;let ce,Ee=`${re}`;return pe.type==="regex"?ce=Re(pe).test(Ee):ce=Ee===pe.text,ie.type==="isnot"&&(ce=ce===!1&&re!==void 0),ce}(X[R],k,L)?b:void 0}};function Pe(I,b,R){let k=[],L=I;return b.children.forEach(X=>{if(X.type==="orPattern")return k.push(...L),void(L=I);L=W(L,X,R)}),k.push(...L),k}function Ne(I,b,R){let k=[],L=b.children.find(pe=>pe.type==="quantifier"),X=function(pe){if(pe==null)return 1;if(pe==="*"||pe==="+")return 1/0;let ce=parseInt(pe);return isNaN(ce)?1:ce}(L&&L.text),re=I;L&&L.text==="*"&&k.push(...re);let ie=0;for(;re.length>0&&ie<X;)re=Pe(re,b,R),k.push(...re),ie+=1;return k}function W(I,b,R){let k;return k=b.type==="query"?function(L,X,re){let ie=L;return X.children.forEach(pe=>{if(de[pe.type])ie=function(ce,Ee,ge,Be){let yt=[];for(let Ge=0,st=Ee.length;Ge<st;Ge+=1)yt.push(...ce(ge,Ee[Ge],ge,Be));return yt}(de[pe.type],ie,pe,re);else{if(!Se[pe.type])throw new Error(`Unknown filter ${pe.type}`);ie=function(ce,Ee,ge,Be){let yt=[];for(let Ge=0,st=Ee.length;Ge<st;Ge+=1){let dt=ce(ge,Ee[Ge],Be);dt&&yt.push(dt)}return yt}(Se[pe.type],ie,pe,re)}}),ie}(I,b,R):b.type==="pattern"?Ne(I,b,R):function(L,X,re){let ie=L;return X.children.forEach(pe=>ie=W(ie,pe,re)),ie}(I,b,R),te.reset(),te.mem.push(I),k}let K={value:I=>I.map(b=>b[0]),pointer:I=>I.map(b=>b[3]),all:I=>I,map:I=>{let b={};return I.forEach(R=>b[R[3]]=R[0]),b}};var me;function we(I,b,R=me.VALUE){if(b==null)return[];(b=b.replace(/(\/$)/g,""))===""&&(b="#");let k=oe(b);if(k==null)throw new Error(`empty ast for '${b}'`);if(k.rest!=="")throw new Error(`Failed parsing queryString from: '${k.rest}'`);let L=function(X,re){return te.reset(),te.mem.push(X),W([[X,null,null,"#"]],re)}(I,k);return typeof R=="function"?L.map(X=>R(...X)):K[R]?K[R](L):L}(function(I){I.POINTER="pointer",I.VALUE="value",I.ALL="all",I.MAP="map"})(me||(me={})),we.POINTER=me.POINTER,we.VALUE=me.VALUE,we.ALL=me.ALL,we.MAP=me.MAP;let He=["root","recursion"];function Ce(I,b=[]){return He.includes(I.type)?(I.children.forEach(R=>Ce(R,b)),b):(b.push(I.text),b)}function Je(I){return I==null||I===""?[]:Ce(oe(I))}let At=I=>JSON.parse(JSON.stringify(I)),pr=Object.prototype.toString,sr=I=>pr.call(I).match(/\s([^\]]+)\]/).pop().toLowerCase(),_i=new RegExp(`^("[^"]+"|${$})$`),vi=["string","number","boolean","null"],Qn=/^\[\d*\]$/,Cn=/^\[(\d+)\]$/,Xn=/^".+"$/,Qr=/(^\[\d*\]$|^\d+$)/;function kr(I){return parseInt(I.replace(/^(\[|\]$)/,""))}function Dr(I){return Xn.test(I)?I.replace(/(^"|"$)/g,""):I}function ae(I,b,R,k){let L=I[0];if(/^\[\]$/.test(b)){L.push(R);let X=L.length-1;return[L[X],X,L,`${I[3]}/${X}}`]}if(k==null&&sr(L[b])==="object"&&sr(R)==="object")return[L[b],b,L,`${I[3]}/${b}}`];if(k===jt.INSERT_ITEMS||k==null&&Cn.test(b)){let X=kr(b);return function(re,ie,pe){re.length<=ie?re[ie]=pe:re.splice(ie,0,pe)}(L,X,R),[L[X],X,L,`${I[3]}/${X}}`]}if(k===jt.REPLACE_ITEMS||k==null){let X=kr(b);return L[X]=R,[L[X],X,L,`${I[3]}/${X}}`]}throw new Error(`Unknown array index '${b}' with force-option '${k}'`)}var zs;function jt(I,b,R,k){if(b==null)return At(I);if((b=b.replace(/(\/$)/g,""))==="")return At(R);let L=At(I),X=[[L,null,null,"#"]],re=Je(b),ie=re.pop(),pe=Qn.test(ie)&&Cn.test(ie)===!1;if(_i.test(ie)===!1||pe)throw new Error(`Unsupported query '${b}' ending with non-property`);return re.forEach((ce,Ee)=>{if(ce==="__proto__"||ce==="prototyped"||ce==="constructor")return;if(_i.test(ce)===!1)return void(X=function(yt,Ge){let st=[];return yt.forEach(dt=>st.push(...we(dt[0],Ge,me.ALL))),st}(X,ce));let ge=Ee>=re.length-1?ie:re[Ee+1],Be=Qr.test(ge);X=function(yt,Ge,st,dt){return Ge=Dr(Ge),yt.filter(wt=>!(!Array.isArray(wt[0])||!Qr.test(Ge))||vi.includes(sr(wt[0][Ge]))===!1).map(wt=>{let w=st?[]:{},j=wt[0];return Array.isArray(j)?ae(wt,Ge,w,dt):(j[Ge]=j[Ge]||w,[j[Ge],Ge,j,`${wt[3]}/${Ge}`])})}(X,ce,Be,k)}),X.forEach(ce=>{let Ee=R;sr(R)==="function"&&(Ee=R(ce[3],ie,ce[0],`${ce[3]}/${ie}`));let ge=ce[0];if(Array.isArray(ge))ae(ce,ie,Ee,k);else{let Be=Dr(ie);if(Be==="__proto__"||Be==="prototyped"||Be==="constructor")return;ge[Be]=Ee}}),L}(function(I){I.REPLACE_ITEMS="replace",I.INSERT_ITEMS="insert"})(zs||(zs={})),jt.REPLACE_ITEMS=zs.REPLACE_ITEMS,jt.INSERT_ITEMS=zs.INSERT_ITEMS;let _n={$ref:{type:!1},allOf:{type:!1,definitions:["allOf/*"]},anyOf:{type:!1,definitions:["anyOf/*"]},array:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","items","items/*","additionalItems"],validationKeywords:["minItems","maxItems","uniqueItems"],keywords:["items","additionalItems","minItems","maxItems","uniqueItems"]},boolean:{type:!0},enum:{type:!1},integer:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},not:{type:!1,definitions:["not"]},number:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},null:{type:!0},object:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","properties/*","additionalProperties","patternProperties/*","dependencies/*"],validationKeywords:["minProperties","maxProperties","required"],keywords:["properties","additionalProperties","patternProperties","dependencies","minProperties","maxProperties","required"]},oneOf:{type:!1,definitions:["oneOf/*"]},string:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minLength","maxLength","pattern"]}},$s=Object.keys(_n).filter(I=>_n[I].type===!1),Fr=Object.prototype.hasOwnProperty;function it(I){if(b=I,Object.prototype.toString.call(b)!=="[object Object]")return;var b;if(I.enum)return"enum";if(_n[I.type]||Array.isArray(I.type))return I.type;let R=$s.filter(k=>I[k]);if(R.length===1)return R[0];if(R.length!==0)throw new Error(`Mutiple typeIds [${R.join(", ")}] matched in ${JSON.stringify(I)}`);for(let k=0,L=_n.object.keywords.length;k<L;k+=1){let X=_n.object.keywords[k];if(Fr.call(I,X))return"object"}for(let k=0,L=_n.array.keywords.length;k<L;k+=1){let X=_n.array.keywords[k];if(Fr.call(I,X))return"array"}}function vn(I){let b=[],R=it(I);if(R==null)return b;let k;if(Array.isArray(R)){k={};for(let L=0,X=R.length;L<X;L+=1)Object.assign(k,_n[R[L]])}else k=_n[R];return k.definitions==null||k.definitions.forEach(L=>{we(I,L,(X,re,ie,pe)=>{(ce=>Object.prototype.toString.call(ce)==="[object Object]")(X)&&it(X)&&b.push({pointer:P().join(P().split(pe),!1),def:X})})}),b}function ct(I,b){this.callback(I,b)!==!0&&vn(I).forEach(R=>this.nextTypeDefs(R.def,P().join(b,R.pointer,!1)))}function lt(I,b,R,k="definitions"){let L=b[k];Object.keys(L).forEach(X=>{if(L[X]!==!1&&(re=L[X],Object.prototype.toString.call(re)!=="[object Object]"))var re;else I.nextTypeDefs(L[X],P().join(R,k,X,!1))})}function z(I,b,R="#"){let k={callback:b,nextTypeDefs:ct};k.nextTypeDefs(I,R),I.definitions!=null&&(k.callback=(L,X)=>{b(L,X),L.definitions!=null&&lt(k,L,X)},lt(k,I,R)),I.$defs!=null&&(k.callback=(L,X)=>{b(L,X),L.definitions!=null&&lt(k,L,X)},lt(k,I,R,"$defs"))}let se=/(#|\/)+$/,Q=/#$/,he=/^[^:]+:\/\/[^/]+\//,xe=/\/[^/]*$/,We=/#.*$/;function gt(I,b){return I==null&&b==null?"#":b==null?I.replace(Q,""):I==null?b.replace(Q,""):b[0]==="#"?`${I.replace(We,"")}${b.replace(se,"")}`:he.test(b)?b.replace(Q,""):`${I.replace(xe,"")}/${b.replace(Q,"")}`}let ut=/(#|\/)+$/g,fr=["",null,"#"],Ir=/(#|\/)+$/g;function Zn(I,b,R){if(a(R)==="object"&&(R=R.__ref||R.$ref),R==null)return b;let k,L=R.replace(Ir,"");if(I.remotes[L])return k=I.remotes[L],k&&k.$ref?Zn(I,b,k.$ref):k;if(I.ids[R])return k=(0,x.get)(b,I.ids[R]),k&&k.$ref?Zn(I,b,k.$ref):k;let X=function(re){if(fr.includes(re))return[];if((re=re.replace(ut,"")).indexOf("#")===-1)return[re.replace(ut,"")];if(re.indexOf("#")===0)return[re.replace(ut,"")];let ie=re.split("#");return ie[0]=ie[0].replace(ut,""),ie[1]=`#${ie[1].replace(ut,"")}`,ie}(R);if(X.length===0)return b;if(X.length===1){if(R=X[0],I.remotes[R])return k=I.remotes[R],Zn(I,b,k.$ref);if(I.ids[R])return k=(0,x.get)(b,I.ids[R]),k&&k.$ref?Zn(I,b,k.$ref):k}if(X.length===2){let re=X[0];if(R=X[1],I.remotes[re])return I.remotes[re].getRef?I.remotes[re].getRef(R):Zn(I,I.remotes[re],R);if(I.ids[re])return Zn(I,(0,x.get)(b,I.ids[re]),R)}return k=(0,x.get)(b,I.ids[R]||R),k&&k.$ref?Zn(I,b,k.$ref):k}let Xf="__compiled",Zf="__ref",tb=/(#|\/)+$/g;function em(I,b,R=b,k=!1){if(b===!0||b===!1||b===void 0||b[Xf]!==void 0)return b;let L={ids:{},remotes:I.remotes},X=JSON.stringify(b),re=JSON.parse(X);if(Object.defineProperty(re,Xf,{enumerable:!1,value:!0}),Object.defineProperty(re,"getRef",{enumerable:!1,value:Zn.bind(null,L,re)}),k===!1&&X.includes("$ref")===!1)return re;re!==R&&Object.defineProperty(re,"$defs",{enumerable:!0,value:Object.assign({},R.definitions,R.$defs,re.definitions,re.$defs)});let ie={},pe=()=>re;return z(re,(ce,Ee)=>{var ge;if(ce.$id){if(ce.$id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(Ee)){let st=Ee.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),dt=(0,x.get)(re,st);ce.$id=(ge=dt.$id)!==null&&ge!==void 0?ge:ce.$id}L.ids[ce.$id.replace(tb,"")]=Ee}let Be=(Ee=`#${Ee}`.replace(/##+/,"#")).replace(/\/[^/]+$/,""),yt=Ee.replace(/\/[^/]+\/[^/]+$/,""),Ge=gt(ie[Be]||ie[yt],ce.$id);ie[Ee]=Ge,L.ids[Ge]==null&&(L.ids[Ge]=Ee),ce.$ref&&!ce[Zf]&&(Object.defineProperty(ce,Zf,{enumerable:!1,value:gt(Ge,ce.$ref)}),Object.defineProperty(ce,"getRoot",{enumerable:!1,value:pe}))}),re}function Pl(I,b,R,k=I.rootSchema,L="#"){k=I.resolveRef(k),R(k,b,L);let X=a(b);X==="object"?Object.keys(b).forEach(re=>{let ie=I.step(re,k,b,L),pe=b[re];I.each(pe,R,ie,`${L}/${re}`)}):X==="array"&&b.forEach((re,ie)=>{let pe=I.step(ie,k,b,L);I.each(re,R,pe,`${L}/${ie}`)})}let _t={additionalItemsError:i("AdditionalItemsError"),additionalPropertiesError:i("AdditionalPropertiesError"),anyOfError:i("AnyOfError"),allOfError:i("AllOfError"),constError:i("ConstError"),containsError:i("ContainsError"),containsArrayError:i("ContainsArrayError"),containsAnyError:i("ContainsAnyError"),enumError:i("EnumError"),formatURLError:i("FormatURLError"),formatURIError:i("FormatURIError"),formatURIReferenceError:i("FormatURIReferenceError"),formatURITemplateError:i("FormatURITemplateError"),formatDateError:i("FormatDateaError"),formatDateTimeError:i("FormatDateTimeError"),formatEmailError:i("FormatEmailError"),formatHostnameError:i("FormatHostnameError"),formatIPV4Error:i("FormatIPV4Error"),formatIPV4LeadingZeroError:i("FormatIPV4LeadingZeroError"),formatIPV6Error:i("FormatIPV6Error"),formatIPV6LeadingZeroError:i("FormatIPV6LeadingZeroError"),formatJSONPointerError:i("FormatJSONPointerError"),formatRegExError:i("FormatRegExError"),formatTimeError:i("FormatTimeError"),invalidSchemaError:i("InvalidSchemaError"),invalidDataError:i("InvalidDataError"),invalidTypeError:i("InvalidTypeError"),invalidPropertyNameError:i("InvalidPropertyNameError"),maximumError:i("MaximumError"),maxItemsError:i("MaxItemsError"),maxLengthError:i("MaxLengthError"),maxPropertiesError:i("MaxPropertiesError"),minimumError:i("MinimumError"),minItemsError:i("MinItemsError"),minItemsOneError:i("MinItemsOneError"),minLengthError:i("MinLengthError"),minLengthOneError:i("MinLengthOneError"),minPropertiesError:i("MinPropertiesError"),missingDependencyError:i("MissingDependencyError"),missingOneOfPropertyError:i("MissingOneOfPropertyError"),multipleOfError:i("MultipleOfError"),multipleOneOfError:i("MultipleOneOfError"),noAdditionalPropertiesError:i("NoAdditionalPropertiesError"),notError:i("NotError"),oneOfError:i("OneOfError"),oneOfPropertyError:i("OneOfPropertyError"),patternError:i("PatternError"),patternPropertiesError:i("PatternPropertiesError"),requiredPropertyError:i("RequiredPropertyError"),typeError:i("TypeError"),undefinedValueError:i("UndefinedValueError"),uniqueItemsError:i("UniqueItemsError"),unknownPropertyError:i("UnknownPropertyError"),valueNotEmptyError:i("ValueNotEmptyError")};var rb=__webpack_require__(481),tm=__webpack_require__.n(rb);let nb=new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(([Zz])|([\\+|\\-]([01][0-9]|2[0-3]):[0-5][0-9]))$"),ib=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,sb=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,ob=/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,ab=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,cb=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,lb=[0,31,28,31,30,31,30,31,31,30,31,30,31],ub=/^(?:\/(?:[^~/]|~0|~1)*)*$/,db=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,pb=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,fb=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Il={date:(I,b,R,k)=>{if(typeof R!="string")return;let L=R.match(ab);if(!L)return _t.formatDateTimeError({value:R,pointer:k});let X=+L[1],re=+L[2],ie=+L[3];return re>=1&&re<=12&&ie>=1&&ie<=(re==2&&X%4==0&&(X%100!=0||X%400==0)?29:lb[re])?void 0:_t.formatDateError({value:R,pointer:k})},"date-time":(I,b,R,k)=>{if(typeof R=="string")return R===""||nb.test(R)?new Date(R).toString()==="Invalid Date"?_t.formatDateTimeError({value:R,pointer:k}):void 0:_t.formatDateTimeError({value:R,pointer:k})},email:(I,b,R,k)=>{if(typeof R!="string")return;if(R[0]==='"')return _t.formatEmailError({value:R,pointer:k});let[L,X,...re]=R.split("@");return!L||!X||re.length!==0||L.length>64||X.length>253||L[0]==="."||L.endsWith(".")||L.includes("..")?_t.formatEmailError({value:R,pointer:k}):/^[a-z0-9.-]+$/i.test(X)&&/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(L)&&X.split(".").every(ie=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(ie))?void 0:_t.formatEmailError({value:R,pointer:k})},hostname:(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!ob.test(R))return _t.formatHostnameError({value:R,pointer:k})},ipv4:(I,b,R,k)=>{if(typeof R=="string"&&R!==""){if(R&&R[0]==="0")return _t.formatIPV4LeadingZeroError({value:R,pointer:k});if(!(R.length<=15&&ib.test(R)))return _t.formatIPV4Error({value:R,pointer:k})}},ipv6:(I,b,R,k)=>{if(typeof R=="string"&&R!==""){if(R&&R[0]==="0")return _t.formatIPV6LeadingZeroError({value:R,pointer:k});if(!(R.length<=45&&sb.test(R)))return _t.formatIPV6Error({value:R,pointer:k})}},"json-pointer":(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!ub.test(R))return _t.formatJSONPointerError({value:R,pointer:k})},"relative-json-pointer":(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!db.test(R))return _t.formatJSONPointerError({value:R,pointer:k})},regex:(I,b,R,k)=>{if(typeof R=="string"&&/\\Z$/.test(R)===!1){try{return void new RegExp(R)}catch{}return _t.formatRegExError({value:R,pointer:k})}if(typeof R!="object"&&typeof R!="number"&&!Array.isArray(R))return _t.formatRegExError({value:R,pointer:k})},time:(I,b,R,k)=>{if(typeof R!="string")return;let L=R.match(cb);if(!L)return _t.formatDateTimeError({value:R,pointer:k});let X=+L[1],re=+L[2],ie=+L[3],pe=!!L[5];return(X<=23&&re<=59&&ie<=59||X==23&&re==59&&ie==60)&&pe?void 0:_t.formatTimeError({value:R,pointer:k})},uri:(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!tm().isUri(R))return _t.formatURIError({value:R,pointer:k})},"uri-reference":(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!pb.test(R))return _t.formatURIReferenceError({value:R,pointer:k})},"uri-template":(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!fb.test(R))return _t.formatURITemplateError({value:R,pointer:k})},url:(I,b,R,k)=>{if(R!==""&&!tm().isWebUri(R))return _t.formatURLError({value:R,pointer:k})}},mb={addOptionalProps:!0,removeInvalidData:!1},ei;function Ga(I,b){let{$ref:R}=I;return R==null?!0:(ei[b]==null||ei[b][R]==null?0:ei[b][R])<p.GET_TEMPLATE_RECURSION_LIMIT}function Cl(I,b,R){if(R==null)throw new Error(`missing pointer ${R}`);let{$ref:k}=b;return k==null?b:(ei[R]=ei[R]||{},ei[R][k]=ei[R][k]||0,ei[R][k]+=1,I.resolveRef(b))}function rm(I,b,R,k){if(a(b)!=="object")return Object.assign({pointer:k},b);if(Ga(b,k)===!1&&R==null)return!1;let L=f(Cl(I,b,k));if(Array.isArray(b.anyOf)&&b.anyOf.length>0){if(Ga(b.anyOf[0],`${k}/anyOf/0`)){let X=Cl(I,b.anyOf[0],`${k}/anyOf/0`);L=v(L,X),L.pointer=b.anyOf[0].$ref||L.pointer}delete L.anyOf}if(Array.isArray(b.allOf)){for(let X=0,re=b.allOf.length;X<re;X+=1)Ga(b.allOf[X],`${k}/allOf/${X}`)&&(L=v(L,Cl(I,b.allOf[X],`${k}/allOf/${X}`)),L.pointer=b.allOf[X].$ref||L.pointer);delete L.allOf}return L.pointer=L.pointer||b.$ref||k,L}let nm=I=>I&&typeof I=="object";function ti(I,b,R,k,L){if(R==null)throw new Error(`getTemplate: missing schema for data: ${JSON.stringify(b)}`);if(k==null)throw new Error("Missing pointer");let X=rm(I,R,b,k);if(!nm(X))return;if(k=X.pointer,X==null?void 0:X.const)return X.const;if(Array.isArray(X.oneOf))if(function(pe){switch(a(pe)){case"string":case"array":return pe.length===0;case"null":case"undefined":return!0;case"object":return Object.keys(pe).length===0;default:return!1}}(b)){let pe=X.oneOf[0].type||X.type||X.const&&typeof X.const||a(b);X=Object.assign(Object.assign({},X.oneOf[0]),{type:pe})}else{let pe=F(I,b,X);if(o(pe)){if(b!=null&&L.removeInvalidData!==!0)return b;X=X.oneOf[0],b=void 0}else X=pe}if(!nm(X)||X.type==null)return;let re=Array.isArray(X.type)?function(pe,ce,Ee){if(ce==null){if(Ee!=null){let Be=a(Ee);if(pe.includes(Be))return Be}return pe[0]}let ge=a(ce);return pe.includes(ge)?ge:pe[0]}(X.type,b,X.default):X.type,ie=a(b);return b==null||ie===re||ie==="number"&&re==="integer"||(b=function(pe,ce){if(pe==="string")return JSON.stringify(ce);if(typeof ce!="string")return null;try{if(typeof(ce=JSON.parse(ce))===pe)return ce}catch{}return null}(re,b)),im[re]==null?L.removeInvalidData?void 0:b:im[re](I,X,b,k,L)}let im={null:(I,b,R)=>$o(b,R,null),string:(I,b,R)=>$o(b,R,""),number:(I,b,R)=>$o(b,R,0),integer:(I,b,R)=>$o(b,R,0),boolean:(I,b,R)=>$o(b,R,!1),object:(I,b,R,k,L)=>{var X;let re=b.default===void 0?{}:b.default,ie={},pe=(X=b.required)!==null&&X!==void 0?X:[];if(b.properties&&Object.keys(b.properties).forEach(ce=>{let Ee=R==null||R[ce]==null?re[ce]:R[ce],ge=pe.includes(ce);(Ee!=null||ge||L.addOptionalProps)&&(ie[ce]=ti(I,Ee,b.properties[ce],`${k}/properties/${ce}`,L))}),b.dependencies&&Object.keys(b.dependencies).forEach(ce=>{if(ie[ce]===void 0)return;let Ee=b.dependencies[ce];if(Array.isArray(Ee))return void Ee.forEach(Be=>{ie[Be]=ti(I,ie[Be],b.properties[Be],`${k}/properties/${Be}`,L)});if(a(Ee)!=="object")return;let ge=ti(I,R,Object.assign(Object.assign({},Ee),{type:"object"}),`${k}/dependencies/${ce}`,L);ge&&!o(ge)&&Object.assign(ie,ge)}),R&&Object.keys(R).forEach(ce=>ie[ce]==null&&(ie[ce]=R[ce])),b.if&&(b.then||b.else)){let ce=I.isValid(ie,b.if);if(ce&&b.then){let Ee=I.getTemplate(ie,Object.assign({type:"object"},b.then),L);Object.assign(ie,Ee)}else if(!ce&&b.else){let Ee=I.getTemplate(ie,Object.assign({type:"object"},b.else),L);Object.assign(ie,Ee)}}return ie},array:(I,b,R,k,L)=>{var X,re,ie;let pe=b.default===void 0?[]:b.default;b.minItems=b.minItems||0;let ce=R||[];if(b.items==null)return ce;if(Array.isArray(b.items)){for(let ge=0,Be=Math.max((X=b.minItems)!==null&&X!==void 0?X:0,(ie=(re=b.items)===null||re===void 0?void 0:re.length)!==null&&ie!==void 0?ie:0);ge<Be;ge+=1)ce[ge]=ti(I,ce[ge]==null?pe[ge]:ce[ge],b.items[ge],`${k}/items/${ge}`,L);return ce}if(a(b.items)!=="object")return ce;let Ee=rm(I,b.items,R,k);if(Ee===!1)return ce;if(k=Ee.pointer||k,Ee.oneOf&&ce.length===0){let ge=Ee.oneOf[0];for(let Be=0;Be<b.minItems;Be+=1)ce[Be]=ti(I,ce[Be]==null?pe[Be]:ce[Be],ge,`${k}/oneOf/0`,L);return ce}if(Ee.oneOf&&ce.length>0){let ge=Math.max(b.minItems,ce.length);for(let Be=0;Be<ge;Be+=1){let yt=ce[Be]==null?pe[Be]:ce[Be],Ge=F(I,yt,Ee);Ge==null||o(Ge)?yt!=null&&L.removeInvalidData!==!0?ce[Be]=yt:(yt=void 0,Ge=Ee.oneOf[0],ce[Be]=ti(I,yt,Ge,`${k}/oneOf/${Be}`,L)):ce[Be]=ti(I,yt,Ge,`${k}/oneOf/${Be}`,L)}return ce}if(Ee.type){for(let ge=0,Be=Math.max(b.minItems,ce.length);ge<Be;ge+=1)ce[ge]=ti(I,ce[ge]==null?pe[ge]:ce[ge],Ee,`${k}/items`,L);return ce}return ce}};function $o(I,b,R){return b??(I.const?I.const:I.default===void 0&&Array.isArray(I.enum)?I.enum[0]:I.default===void 0?R:I.default)}let Tl=(I,b,R=I.rootSchema,k=mb)=>(ei={mi:{}},ti(I,b,R,"#",k));function Ol(I,b,R=I.rootSchema,k="#"){return I.validate(b,R,k).length===0}function Nl(I,b){let R=typeof I;if(R!==typeof b)return!1;if(Array.isArray(I)){if(!Array.isArray(b))return!1;let k=I.length;if(k!==b.length)return!1;for(let L=0;L<k;L++)if(!Nl(I[L],b[L]))return!1;return!0}if(R==="object"){if(!I||!b)return I===b;let k=Object.keys(I),L=Object.keys(b);if(k.length!==L.length)return!1;for(let X of k)if(!Nl(I[X],b[X]))return!1;return!0}return I===b}function sm(I){let b=[],R=0,k=I.length;for(;R<k;){let L=I.charCodeAt(R++);if(L>=55296&&L<=56319&&R<k){let X=I.charCodeAt(R++);(64512&X)==56320?b.push(((1023&L)<<10)+(1023&X)+65536):(b.push(L),R--)}else b.push(L)}return b}let jl=p.floatingPointPrecision,hb=Object.prototype.hasOwnProperty,om=(I,b)=>!(I[b]===void 0||!hb.call(I,b)),_b={additionalProperties:(I,b,R,k)=>{if(b.additionalProperties===!0||b.additionalProperties==null||a(b.patternProperties)==="object"&&b.additionalProperties===!1)return;let L=[],X=Object.keys(R).filter(ie=>p.propertyBlacklist.includes(ie)===!1),re=Object.keys(b.properties||{});if(a(b.patternProperties)==="object"){let ie=Object.keys(b.patternProperties).map(pe=>new RegExp(pe));X=X.filter(pe=>{for(let ce=0;ce<ie.length;ce+=1)if(ie[ce].test(pe))return!1;return!0})}for(let ie=0,pe=X.length;ie<pe;ie+=1){let ce=X[ie];if(re.indexOf(ce)===-1){let Ee=typeof b.additionalProperties=="object";if(Ee&&Array.isArray(b.additionalProperties.oneOf)){let ge=I.resolveOneOf(R[ce],b.additionalProperties,`${k}/${ce}`);o(ge)?L.push(I.errors.additionalPropertiesError({schema:b.additionalProperties,property:X[ie],properties:re,pointer:k,errors:ge.data.errors})):L.push(...I.validate(R[ce],ge,k))}else Ee?L.push(...I.validate(R[ce],b.additionalProperties,`${k}/${ce}`)):L.push(I.errors.noAdditionalPropertiesError({property:X[ie],properties:re,pointer:k}))}}return L},allOf:(I,b,R,k)=>{if(Array.isArray(b.allOf)===!1)return;let L=[];return b.allOf.forEach(X=>{L.push(...I.validate(R,X,k))}),L},anyOf:(I,b,R,k)=>{if(Array.isArray(b.anyOf)!==!1){for(let L=0;L<b.anyOf.length;L+=1)if(I.isValid(R,b.anyOf[L]))return;return I.errors.anyOfError({anyOf:b.anyOf,value:R,pointer:k})}},dependencies:(I,b,R,k)=>{if(a(b.dependencies)!=="object")return;let L=[];return Object.keys(R).forEach(X=>{if(b.dependencies[X]===void 0||b.dependencies[X]===!0)return;if(b.dependencies[X]===!1)return void L.push(I.errors.missingDependencyError({pointer:k}));let re,ie=a(b.dependencies[X]);if(ie==="array")re=b.dependencies[X].filter(pe=>R[pe]===void 0).map(pe=>I.errors.missingDependencyError({missingProperty:pe,pointer:k}));else{if(ie!=="object")throw new Error(`Invalid dependency definition for ${k}/${X}. Must be list or schema`);re=I.validate(R,b.dependencies[X],k)}L.push(...re)}),L.length>0?L:void 0},enum:(I,b,R,k)=>{let L=a(R);if(L==="object"||L==="array"){let X=JSON.stringify(R);for(let re=0;re<b.enum.length;re+=1)if(JSON.stringify(b.enum[re])===X)return}else if(b.enum.includes(R))return;return I.errors.enumError({values:b.enum,value:R,pointer:k})},format:(I,b,R,k)=>{if(I.validateFormat[b.format])return I.validateFormat[b.format](I,b,R,k)},items:(I,b,R,k)=>{if(b.items===!1)return Array.isArray(R)&&R.length===0?void 0:I.errors.invalidDataError({pointer:k,value:R});let L=[];for(let X=0;X<R.length;X+=1){let re=R[X],ie=I.step(X,b,R,k);if(o(ie))return[ie];let pe=I.validate(re,ie,`${k}/${X}`);L.push(...pe)}return L},maximum:(I,b,R,k)=>{if(!isNaN(b.maximum))return b.maximum&&b.maximum<R||b.maximum&&b.exclusiveMaximum===!0&&b.maximum===R?I.errors.maximumError({maximum:b.maximum,length:R,pointer:k}):void 0},maxItems:(I,b,R,k)=>{if(!isNaN(b.maxItems))return b.maxItems<R.length?I.errors.maxItemsError({maximum:b.maxItems,length:R.length,pointer:k}):void 0},maxLength:(I,b,R,k)=>{if(isNaN(b.maxLength))return;let L=sm(R).length;return b.maxLength<L?I.errors.maxLengthError({maxLength:b.maxLength,length:L,pointer:k}):void 0},maxProperties:(I,b,R,k)=>{let L=Object.keys(R).length;if(isNaN(b.maxProperties)===!1&&b.maxProperties<L)return I.errors.maxPropertiesError({maxProperties:b.maxProperties,length:L,pointer:k})},minLength:(I,b,R,k)=>{if(isNaN(b.minLength))return;let L=sm(R).length;return b.minLength>L?b.minLength===1?I.errors.minLengthOneError({minLength:b.minLength,length:L,pointer:k}):I.errors.minLengthError({minLength:b.minLength,length:L,pointer:k}):void 0},minimum:(I,b,R,k)=>{if(!isNaN(b.minimum))return b.minimum>R||b.exclusiveMinimum===!0&&b.minimum===R?I.errors.minimumError({minimum:b.minimum,length:R,pointer:k}):void 0},minItems:(I,b,R,k)=>{if(!isNaN(b.minItems))return b.minItems>R.length?b.minItems===1?I.errors.minItemsOneError({minItems:b.minItems,length:R.length,pointer:k}):I.errors.minItemsError({minItems:b.minItems,length:R.length,pointer:k}):void 0},minProperties:(I,b,R,k)=>{if(isNaN(b.minProperties))return;let L=Object.keys(R).length;return b.minProperties>L?I.errors.minPropertiesError({minProperties:b.minProperties,length:L,pointer:k}):void 0},multipleOf:(I,b,R,k)=>{if(!isNaN(b.multipleOf))return R*jl%(b.multipleOf*jl)/jl!=0?I.errors.multipleOfError({multipleOf:b.multipleOf,value:R,pointer:k}):void 0},not:(I,b,R,k)=>{let L=[];return I.validate(R,b.not,k).length===0&&L.push(I.errors.notError({value:R,not:b.not,pointer:k})),L},oneOf:(I,b,R,k)=>{if(Array.isArray(b.oneOf)!==!1)return o(b=I.resolveOneOf(R,b,k))?b:void 0},pattern:(I,b,R,k)=>{if(new RegExp(b.pattern,"u").test(R)===!1)return I.errors.patternError({pattern:b.pattern,description:b.patternExample||b.pattern,received:R,pointer:k})},patternProperties:(I,b,R,k)=>{let L=b.properties||{},X=b.patternProperties;if(a(X)!=="object")return;let re=[],ie=Object.keys(R),pe=Object.keys(X).map(ce=>({regex:new RegExp(ce),patternSchema:X[ce]}));return ie.forEach(ce=>{let Ee=!1;for(let ge=0,Be=pe.length;ge<Be;ge+=1)if(pe[ge].regex.test(ce)){Ee=!0;let yt=I.validate(R[ce],pe[ge].patternSchema,`${k}/${ce}`);yt&&yt.length>0&&re.push(...yt)}L[ce]||Ee===!1&&b.additionalProperties===!1&&re.push(I.errors.patternPropertiesError({key:ce,pointer:k,patterns:Object.keys(X).join(",")}))}),re},properties:(I,b,R,k)=>{let L=[],X=Object.keys(b.properties||{});for(let re=0;re<X.length;re+=1){let ie=X[re];if(om(R,ie)){let pe=I.step(ie,b,R,k),ce=I.validate(R[ie],pe,`${k}/${ie}`);L.push(...ce)}}return L},propertiesRequired:(I,b,R,k)=>{let L=[],X=Object.keys(b.properties||{});for(let re=0;re<X.length;re+=1){let ie=X[re];if(R[ie]===void 0)L.push(I.errors.requiredPropertyError({key:ie,pointer:k}));else{let pe=I.step(ie,b,R,k),ce=I.validate(R[ie],pe,`${k}/${ie}`);L.push(...ce)}}return L},required:(I,b,R,k)=>{if(Array.isArray(b.required)!==!1)return b.required.map(L=>{if(!om(R,L))return I.errors.requiredPropertyError({key:L,pointer:k})})},requiredNotEmpty:(I,b,R,k)=>{if(Array.isArray(b.required)!==!1)return b.required.map(L=>{if(R[L]==null||R[L]==="")return I.errors.valueNotEmptyError({property:L,pointer:`${k}/${L}`})})},uniqueItems:(I,b,R,k)=>{if((Array.isArray(R)&&b.uniqueItems)===!1)return;let L=[];return R.forEach((X,re)=>{for(let ie=re+1;ie<R.length;ie+=1)Nl(X,R[ie])&&L.push(I.errors.uniqueItemsError({pointer:k,itemPointer:`${k}/${re}`,duplicatePointer:`${k}/${ie}`,value:JSON.stringify(X)}))}),L}},am=_b,vb=Object.assign(Object.assign({},am),{contains:(I,b,R,k)=>{if(b.contains===!1)return I.errors.containsArrayError({pointer:k,value:R});if(b.contains===!0)return Array.isArray(R)&&R.length===0?I.errors.containsAnyError({pointer:k}):void 0;if(a(b.contains)==="object"){for(let L=0;L<R.length;L+=1)if(I.isValid(R[L],b.contains))return;return I.errors.containsError({pointer:k,schema:JSON.stringify(b.contains)})}},exclusiveMaximum:(I,b,R,k)=>{if(!isNaN(b.exclusiveMaximum))return b.exclusiveMaximum<=R?I.errors.maximumError({maximum:b.exclusiveMaximum,length:R,pointer:k}):void 0},exclusiveMinimum:(I,b,R,k)=>{if(!isNaN(b.exclusiveMinimum))return b.exclusiveMinimum>=R?I.errors.minimumError({minimum:b.exclusiveMinimum,length:R,pointer:k}):void 0},if:(I,b,R,k)=>{if(b.if==null)return;let L=I.validate(R,b.if,k);return L.length===0&&b.then?I.validate(R,b.then,k):L.length!==0&&b.else?I.validate(R,b.else,k):void 0},maximum:(I,b,R,k)=>{if(!isNaN(b.maximum))return b.maximum&&b.maximum<R?I.errors.maximumError({maximum:b.maximum,length:R,pointer:k}):void 0},minimum:(I,b,R,k)=>{if(!isNaN(b.minimum))return b.minimum>R?I.errors.minimumError({minimum:b.minimum,length:R,pointer:k}):void 0},patternProperties:(I,b,R,k)=>{let L=b.properties||{},X=b.patternProperties;if(a(X)!=="object")return;let re=[],ie=Object.keys(R),pe=Object.keys(X).map(ce=>({regex:new RegExp(ce),patternSchema:X[ce]}));return ie.forEach(ce=>{let Ee=!1;for(let ge=0,Be=pe.length;ge<Be;ge+=1)if(pe[ge].regex.test(ce)){if(Ee=!0,pe[ge].patternSchema===!1)return void re.push(I.errors.patternPropertiesError({key:ce,pointer:k,patterns:Object.keys(X).join(",")}));let yt=I.validate(R[ce],pe[ge].patternSchema,`${k}/${ce}`);yt&&yt.length>0&&re.push(...yt)}L[ce]||Ee===!1&&b.additionalProperties===!1&&re.push(I.errors.patternPropertiesError({key:ce,pointer:k,patterns:Object.keys(X).join(",")}))}),re},propertyNames:(I,b,R,k)=>{if(b.propertyNames===!1)return Object.keys(R).length===0?void 0:I.errors.invalidPropertyNameError({property:Object.keys(R),pointer:k,value:R});if(b.propertyNames===!0||a(b.propertyNames)!=="object")return;let L=[],X=Object.keys(R),re=Object.assign(Object.assign({},b.propertyNames),{type:"string"});return X.forEach(ie=>{let pe=I.validate(ie,re,`${k}/${ie}`);pe.length>0&&L.push(I.errors.invalidPropertyNameError({property:ie,pointer:k,validationError:pe[0],value:R[ie]}))}),L}}),cm=vb;function ql(I,b,R=I.rootSchema,k="#"){let L=!1,X=f(R);for(let re=0;re<R.anyOf.length;re+=1){let ie=I.resolveRef(R.anyOf[re]);I.isValid(b,R.anyOf[re],k)&&(L=!0,X=v(X,ie))}return L===!1?_t.anyOfError({value:b,pointer:k,anyOf:JSON.stringify(R.anyOf)}):(delete X.anyOf,X)}function Tn(I){let b={type:a(I)};return b.type==="object"&&(b.properties={},Object.keys(I).forEach(R=>b.properties[R]=Tn(I[R]))),b.type==="array"&&I.length===1?b.items=Tn(I[0]):b.type==="array"&&(b.items=I.map(Tn)),b}function Ml(I,b,R=I.rootSchema){let k=I.step(b,R,{},"#");return o(k)?k.code==="one-of-error"?k.data.oneOf.map(L=>I.resolveRef(L)):k:[k]}let lm={array:(I,b,R,k,L)=>{let X=a(R.items);if(X==="object")return Array.isArray(R.items.oneOf)?I.resolveOneOf(k[b],R.items,L):Array.isArray(R.items.anyOf)?I.resolveAnyOf(k[b],R.items,L):Array.isArray(R.items.allOf)?I.resolveAllOf(k[b],R.items,L):I.resolveRef(R.items);if(X==="array"){if(R.items[b]===!0)return Tn(k[b]);if(R.items[b]===!1)return _t.invalidDataError({key:b,value:k[b],pointer:L});if(R.items[b])return I.resolveRef(R.items[b]);if(R.additionalItems===!1)return _t.additionalItemsError({key:b,value:k[b],pointer:L});if(R.additionalItems===!0||R.additionalItems===void 0)return Tn(k[b]);if(a(R.additionalItems)==="object")return R.additionalItems;throw new Error(`Invalid schema ${JSON.stringify(R,null,4)} for ${JSON.stringify(k,null,4)}`)}return R.additionalItems!==!1&&k[b]?Tn(k[b]):new Error(`Invalid array schema for ${b} at ${L}`)},object:(I,b,R,k,L)=>{if(Array.isArray(R.oneOf)){let ie=I.resolveOneOf(k,R,L);if(o(R=v(R,ie)))return R}if(Array.isArray(R.anyOf)&&o(R=I.resolveAnyOf(k,R,L))||Array.isArray(R.allOf)&&o(R=I.resolveAllOf(k,R,L)))return R;let X;if(R.properties&&R.properties[b]!==void 0){if(X=I.resolveRef(R.properties[b]),o(X))return X;if(X&&Array.isArray(X.oneOf)){let ie=I.resolveOneOf(k[b],X,`${L}/${b}`),pe=X.oneOf.findIndex(ce=>ce===ie);return ie.variableSchema=!0,ie.oneOfIndex=pe,ie.oneOfSchema=X,ie}if(X)return X}let{dependencies:re}=R;if(a(re)==="object"){let ie=Object.keys(re).filter(pe=>a(re[pe])==="object");for(let pe=0,ce=ie.length;pe<ce;pe+=1){let Ee=ie[pe],ge=Us(I,b,re[Ee],k,`${L}/${Ee}`);if(!o(ge))return ge}}if(R.if&&(R.then||R.else)){let ie=I.isValid(k,R.if);if(ie&&R.then){let pe=Us(I,b,R.then,k,L);if(typeof pe.type=="string"&&pe.type!=="error")return pe}if(!ie&&R.else){let pe=Us(I,b,R.else,k,L);if(typeof pe.type=="string"&&pe.type!=="error")return pe}}if(a(R.patternProperties)==="object"){let ie,pe=Object.keys(R.patternProperties);for(let ce=0,Ee=pe.length;ce<Ee;ce+=1)if(ie=new RegExp(pe[ce]),ie.test(b))return R.patternProperties[pe[ce]]}return a(R.additionalProperties)==="object"?R.additionalProperties:R.additionalProperties===!0?Tn(k[b]):_t.unknownPropertyError({property:b,value:k,pointer:`${L}`})}};function Us(I,b,R,k,L="#"){if(Array.isArray(R.type)){let ie=a(k);return R.type.includes(ie)?lm[ie](I,`${b}`,R,k,L):I.errors.typeError({value:k,pointer:L,expected:R.type,received:ie})}let X=R.type||a(k),re=lm[X];return re?re(I,`${b}`,R,k,L):new Error(`Unsupported schema type ${R.type} for key ${b}`)}let um={array:(I,b,R,k)=>I.typeKeywords.array.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),object:(I,b,R,k)=>I.typeKeywords.object.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),string:(I,b,R,k)=>I.typeKeywords.string.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),integer:(I,b,R,k)=>I.typeKeywords.number.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),number:(I,b,R,k)=>I.typeKeywords.number.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),boolean:(I,b,R,k)=>I.typeKeywords.boolean.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),null:(I,b,R,k)=>I.typeKeywords.null.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k))};var gb=__webpack_require__(63),yb=__webpack_require__.n(gb);function kl(I,b,R=I.rootSchema,k="#"){if(a(R=I.resolveRef(R))==="boolean")return R?[]:[I.errors.invalidDataError({value:b,pointer:k})];if(o(R))return[R];if(R.const!==void 0)return yb()(R.const,b)?[]:[I.errors.constError({value:b,expected:R.const,pointer:k})];let L=function(re,ie){let pe=a(re);return pe==="number"&&(ie==="integer"||Array.isArray(ie)&&ie.includes("integer"))?Number.isInteger(re)||isNaN(re)?"integer":"number":pe}(b,R.type),X=R.type||L;return L===X||Array.isArray(X)&&X.includes(L)?I.validateType[L]==null?[I.errors.invalidTypeError({receivedType:L,pointer:k})]:l(I.validateType[L](I,R,b,k)).filter(c):[I.errors.typeError({received:L,expected:X,value:b,pointer:k})]}let Dl={typeKeywords:{array:["allOf","anyOf","contains","enum","if","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["allOf","anyOf","enum","not","oneOf"],object:["additionalProperties","allOf","anyOf","dependencies","enum","format","if","maxProperties","minProperties","not","oneOf","patternProperties","properties","propertyNames","required"],string:["allOf","anyOf","enum","format","if","maxLength","minLength","not","oneOf","pattern"],number:["allOf","anyOf","enum","exclusiveMaximum","exclusiveMinimum","format","if","maximum","minimum","multipleOf","not","oneOf"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:cm,validateType:um,validateFormat:Il,errors:_t,addRemoteSchema:ee,compileSchema:em,createSchemaOf:Tn,each:Pl,eachSchema:z,getChildSchemaSelection:Ml,getSchema:D,getTemplate:Tl,isValid:Ol,resolveAllOf:q,resolveAnyOf:ql,resolveOneOf:m,resolveRef:N,step:Us,validate:kl};class Sb extends B{constructor(b,R={}){super(v(Dl,R),b)}}let dm=Object.assign(Object.assign({},Dl),{resolveOneOf:F,resolveRef:T});class pm extends B{constructor(b,R={}){super(v(dm,R),b)}}class Ha{constructor(b,R){this.core=new pm(b),this.schema=b,this.data=R,this.cache={}}updateData(b){this.data=b,this.cache={}}updateSchema(b){this.schema=b,this.core.setSchema(b),this.cache={}}get(b,R){if(R){let ie=D(this.core,b,R,this.schema);return f(ie)}if(b==="#")return this.schema;if(this.cache[b])return this.cache[b];let k=P().join(b,".."),L=this.cache[k];L==null&&(L=D(this.core,k,this.data,this.schema),L.variableSchema!==!0&&(this.cache[k]=f(L)));let X=P().split(b).pop(),re=D(this.core,X,P().get(this.data,k),this.cache[k]);return re=f(re),re.variableSchema!==!0&&(this.cache[b]=re),re}}function wb(I,b,R){let{schema:k,pointer:L,onError:X}=Object.assign({schema:I.rootSchema,pointer:"#"},R),re=I.validate(b,k,L);if(X){re=l(re);let ie=function(pe){return function ce(Ee){return Array.isArray(Ee)?((Ee=l(Ee)).forEach(ce),Ee):(o(Ee)&&pe(Ee),Ee)}}(X);for(let pe=0;pe<re.length;pe+=1)re[pe]instanceof Promise?re[pe].then(ie):o(re[pe])&&X(re[pe])}return Promise.all(re).then(l).then(ie=>ie.filter(u)).catch(ie=>{throw console.log("Failed resolving promises",ie.message),console.log(ie.stack),ie})}let fm="__compiled",mm="__ref",Eb=/(#|\/)+$/g,hm={typeKeywords:{array:["allOf","anyOf","enum","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["enum","not","allOf","anyOf","oneOf"],object:["additionalProperties","dependencies","enum","format","minProperties","maxProperties","patternProperties","properties","required","not","oneOf","allOf","anyOf"],string:["allOf","anyOf","enum","format","maxLength","minLength","not","oneOf","pattern"],number:["allOf","anyOf","enum","format","maximum","minimum","multipleOf","not","oneOf"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:am,validateType:{array:(I,b,R,k)=>I.typeKeywords.array.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),object:(I,b,R,k)=>I.typeKeywords.object.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),string:(I,b,R,k)=>I.typeKeywords.string.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),integer:(I,b,R,k)=>I.typeKeywords.number.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),number:(I,b,R,k)=>I.typeKeywords.number.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),boolean:(I,b,R,k)=>I.typeKeywords.boolean.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k)),null:(I,b,R,k)=>I.typeKeywords.null.filter(L=>b&&b[L]!=null).map(L=>I.validateKeyword[L](I,b,R,k))},validateFormat:Il,errors:_t,addRemoteSchema:ee,compileSchema:function(I,b,R=b,k=!1){if(!b||b[fm]!==void 0)return b;let L={ids:{},remotes:I.remotes},X=JSON.stringify(b),re=JSON.parse(X);if(Object.defineProperty(re,fm,{enumerable:!1,value:!0}),Object.defineProperty(re,"getRef",{enumerable:!1,value:Zn.bind(null,L,re)}),k===!1&&X.includes("$ref")===!1)return re;b!==R&&Object.defineProperty(re,"definitions",{enumerable:!1,value:Object.assign({},R.definitions,R.$defs,b.definitions,b.$defs)});let ie={},pe=()=>re;return z(re,(ce,Ee)=>{var ge;if(ce.id){if(ce.id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(Ee)){let st=Ee.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),dt=(0,x.get)(re,st);ce.id=(ge=dt.id)!==null&&ge!==void 0?ge:ce.id}L.ids[ce.id.replace(Eb,"")]=Ee}let Be=(Ee=`#${Ee}`.replace(/##+/,"#")).replace(/\/[^/]+$/,""),yt=Ee.replace(/\/[^/]+\/[^/]+$/,""),Ge=gt(ie[Be]||ie[yt],ce.id);ie[Ee]=Ge,L.ids[Ge]==null&&(L.ids[Ge]=Ee),ce.$ref&&!ce[mm]&&(Object.defineProperty(ce,mm,{enumerable:!1,value:gt(Ge,ce.$ref)}),Object.defineProperty(ce,"getRoot",{enumerable:!1,value:pe}))}),re},createSchemaOf:Tn,each:Pl,eachSchema:z,getChildSchemaSelection:Ml,getSchema:D,getTemplate:Tl,isValid:Ol,resolveAllOf:q,resolveAnyOf:ql,resolveOneOf:m,resolveRef:N,step:Us,validate:kl};class _m extends B{constructor(b,R={}){super(v(hm,R),b)}}let vm={typeKeywords:{array:["allOf","anyOf","contains","enum","if","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["allOf","anyOf","enum","not","oneOf"],object:["additionalProperties","allOf","anyOf","dependencies","enum","format","if","maxProperties","minProperties","not","oneOf","patternProperties","properties","propertyNames","required"],string:["allOf","anyOf","enum","format","if","maxLength","minLength","not","oneOf","pattern"],number:["enum","exclusiveMaximum","exclusiveMinimum","format","maximum","minimum","multipleOf","not","oneOf","allOf","anyOf","if"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:cm,validateType:um,validateFormat:Il,errors:_t,addRemoteSchema:ee,compileSchema:em,createSchemaOf:Tn,each:Pl,eachSchema:z,getChildSchemaSelection:Ml,getSchema:D,getTemplate:Tl,isValid:Ol,resolveAllOf:q,resolveAnyOf:ql,resolveOneOf:m,resolveRef:N,step:Us,validate:kl};class bb extends B{constructor(b,R={}){super(v(vm,R),b)}}let Rb={strings:e}})(),__webpack_exports__})())});var t0=S(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});e0.isMatrixAssetUri=void 0;function tCe(e){return typeof e!="string"?!1:/^matrix-asset:\/\/[a-zA-Z0-9.-]+\/[a-zA-Z0-9\/._-]+\/?([0-9]+(?:\:[0-9a-z\-\._/]+\$?)?)?$/.test(e)}e0.isMatrixAssetUri=tCe});var I6=S(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.customFormatValidators=void 0;var rCe=Zw(),nCe=t0();r0.customFormatValidators={"matrix-asset-uri":(e,t,r)=>{if((0,nCe.isMatrixAssetUri)(r)===!1)throw new rCe.SchemaValidationError(`value "${r}" isn't a valid matrix asset uri`)}}});var oC=S(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.JsonResolutionError=void 0;var sC=class extends Error{constructor(t,r,n){super(`Error resolving JSON at ${r}: ${t.message}`),this.pointer=r,this.value=n}};n0.JsonResolutionError=sC});var q6=S(Ct=>{"use strict";var Co=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.JsonValidationService=Ct.JSONSchemaService=Ct.ManifestV1MetaSchema=Ct.RenderInputMetaSchema=Ct.ComponentInputMetaSchema=Ct.RenderInputSchema=Ct.ComponentInputSchema=void 0;var iCe=Co(QI()),uC=Co(eC()),T6=Co(ZI()),i0=Co(tC()),O6=Co(rC()),pf=Co(P6()),N6=Co(YI()),j6=Co(JI()),aC=Zw(),ff=iC(),Vc=iC(),sCe=I6(),oCe=oC(),wa={...Vc.draft07Config,validateFormat:{...Vc.draft07Config.validateFormat,...sCe.customFormatValidators},errors:{...Vc.draft07Config.errors,enumError(e){let t="[]";return e.values&&Array.isArray(e.values)&&(e.values.length<5?t=`[${e.values.join(", ")}]`:t=`[${e.values.slice(0,5).join(", ")}, ... ${e.values.length-5} more]`),{type:"error",name:"EnumError",code:"enum-error",message:`Expected given value \`${e.value}\` in ${e.pointer}\` to be one of \`${t}\``,data:e}},anyOfError(e){let t=`Value \`${e.value}\` at`;return typeof e.value=="object"&&(t="Object at"),Array.isArray(e.value)&&(t="Array at"),{type:"error",name:"AnyOfError",code:"any-of-error",message:`${t} \`${e.pointer}\` does not match any schema`,data:e}}}},C6=new ff.Draft07(N6.default,wa);Ct.ComponentInputSchema=new ff.Draft({...wa,resolveRef(e,t){let r=Vc.draft07Config.resolveRef(e,t);return r&&(r.type==="FormattedText"?C6.rootSchema:Array.isArray(r.type)&&r.type.includes("FormattedText")?{...e,...C6.rootSchema,type:r.type.filter(n=>n!=="FormattedText").concat(N6.default.type)}:r)}},uC.default);Ct.ComponentInputSchema.addRemoteSchema("DxComponentInputSchema.json/DxContentMetaSchema.json",i0.default);Ct.RenderInputSchema=new ff.Draft({...wa,resolveRef(e,t){let r=Vc.draft07Config.resolveRef(e,t);return r&&(r.type==="FormattedText"?{type:"string"}:Array.isArray(r.type)&&r.type.includes("FormattedText")?{...e,type:r.type.filter(n=>n!=="FormattedText").concat("string")}:r)}});var Ea=new ff.Draft07(j6.default,wa);Ea.addRemoteSchema("DxComponentInputSchema.json/DxContentMetaSchema.json",i0.default);Ea.addRemoteSchema("/DxComponentInputSchema.json",Ct.ComponentInputSchema.getSchema());Ea.addRemoteSchema("/DxComponentIcons.json",T6.default);Ea.addRemoteSchema("/MatrixAssetSchema.json",O6.default);Ea.addRemoteSchema("http://json-schema.org/draft-07/schema",pf.default);Ea.addRemoteSchema("http://json-schema.org/draft-07/schema#",pf.default);Ct.ComponentInputMetaSchema={root:uC.default,remotes:{"DxComponentInputSchema.json/DxContentMetaSchema.json":i0.default}};Ct.RenderInputMetaSchema={root:pf.default};Ct.ManifestV1MetaSchema={root:j6.default,remotes:{"DxComponentInputSchema.json/DxContentMetaSchema.json":i0.default,"/DxComponentInputSchema.json":uC.default,"/DxComponentIcons.json":T6.default,"/MatrixAssetSchema.json":O6.default,"http://json-schema.org/draft-07/schema":pf.default,"http://json-schema.org/draft-07/schema#":pf.default}};var cC=class{constructor(t,r){this.typeResolver=t,this.schema=new ff.Draft({...wa,resolveRef:(n,i)=>this.doResolveRef(n,i),validate:(n,i,s,a)=>wa.validate(n,i,s,a),resolveOneOf:(n,i,s,a)=>wa.resolveOneOf(n,i,s,a)},r.root);for(let[n,i]of Object.entries(r.remotes||{}))this.schema.addRemoteSchema(n,i);for(let n of this.typeResolver.validationSchemaDefinitions)this.schema.addRemoteSchema(`/${n.title}.json`,n),this.schema.addRemoteSchema(`#/${n.title}.json`,n)}doResolveRef(t,r){let n=Vc.draft07Config.resolveRef(t,r);if(!n||!this.typeResolver.isPrimitiveType(n.type))return n;let s={oneOf:this.typeResolver.getValidationSchemaForPrimitive(n.type).map(a=>({$ref:`${a.title}.json`}))};return this.schema.compileSchema(s)}validateInput(t,r=this.schema.rootSchema){r=this.schema.compileSchema(r);let n=this.schema.validate(t,r);return this.processValidationResult(n)}processValidationResult(t){if(t.length>0)throw new aC.SchemaValidationError(t.map(r=>r.message).join(`,
132
- `));return!0}async resolveInput(t,r){let n=[];this.schema.each(t,(s,a,o)=>{if(!this.typeResolver.isResolvableSchema(s))return;let u=s.oneOfSchema.oneOf.map(d=>d.$ref.replace(".json","")).find(d=>this.typeResolver.isPrimitiveType(d));if(!u)return;let l=this.typeResolver.tryGetResolver(u,s);if(!l)return;let p=Promise.resolve().then(()=>l(a)).then(d=>m=>iCe.default.set(m,o,d)).catch(d=>Promise.reject(new oCe.JsonResolutionError(d,o,a)));n.push(p)},r);let i=[];for(let s of await Promise.allSettled(n)){if(s.status==="rejected"){i.push(s.reason);continue}t=s.value(t)}return t}};Ct.JSONSchemaService=cC;var lC=class{validateManifest(t,r){switch(r){case"v1":{let n=Ea.validate(t);return this.processValidationResult(n)}default:throw new aC.SchemaValidationError("Invalid manifest version")}}validateContentSchema(t){return this.processValidationResult(Ct.ComponentInputSchema.validate(t))}validateComponentInput(t,r){let n=Ct.ComponentInputSchema.compileSchema(t),i=Ct.ComponentInputSchema.validate(r,n);return this.processValidationResult(i)}validateRenderInput(t,r){let n=Ct.RenderInputSchema.compileSchema(t),i=Ct.RenderInputSchema.validate(r,n);return this.processValidationResult(i)}processValidationResult(t){if(t.length>0)throw new aC.SchemaValidationError(t.map(r=>r.message).join(`,
132
+ `));return!0}async resolveInput(t,r){let n=[];this.schema.each(t,(s,a,o)=>{if(!this.typeResolver.isResolvableSchema(s))return;let u=s.oneOfSchema.oneOf.map(d=>d.$ref.replace(".json","")).find(d=>this.typeResolver.isPrimitiveType(d));if(!u)return;let l=this.typeResolver.tryGetResolver(u,s);if(!l)return;let p=Promise.resolve().then(()=>l(a)).then(d=>m=>iCe.default.set(m,o,d)).catch(d=>Promise.reject(new oCe.JsonResolutionError(d,o,a)));n.push(p)},r);let i=[];for(let s of await Promise.allSettled(n)){if(s.status==="rejected"){i.push(s.reason);continue}t=s.value(t)}if(i.length)throw new Error(`Error(s) occurred when resolving JSON:
133
+ ${i.join(`
134
+ `)}`);return t}};Ct.JSONSchemaService=cC;var lC=class{validateManifest(t,r){switch(r){case"v1":{let n=Ea.validate(t);return this.processValidationResult(n)}default:throw new aC.SchemaValidationError("Invalid manifest version")}}validateContentSchema(t){return this.processValidationResult(Ct.ComponentInputSchema.validate(t))}validateComponentInput(t,r){let n=Ct.ComponentInputSchema.compileSchema(t),i=Ct.ComponentInputSchema.validate(r,n);return this.processValidationResult(i)}validateRenderInput(t,r){let n=Ct.RenderInputSchema.compileSchema(t),i=Ct.RenderInputSchema.validate(r,n);return this.processValidationResult(i)}processValidationResult(t){if(t.length>0)throw new aC.SchemaValidationError(t.map(r=>r.message).join(`,
133
135
  `));return!0}};Ct.JsonValidationService=lC});var ba=S(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.TypeResolver=To.ResolvableType=To.PrimitiveType=void 0;function aCe(e){return e}To.PrimitiveType=aCe;function cCe(e){return e}To.ResolvableType=cCe;var dC=class{constructor(t,r=[],n={}){this.resolvers=n,this.primitives=new Map(t.map(i=>[i.title,i])),this.resolvables=new Map(r.map(i=>[i.title,i]));for(let[i,s]of Object.entries(n)){if(!this.primitives.has(i))throw new Error("Resolver keys must match a primitive schema");if(!Object.keys(s).every(a=>this.resolvables.has(a)))throw new Error("Primitive resolvers keys must match a resolvable schema")}}get validationSchemaDefinitions(){return[...this.primitives.values(),...this.resolvables.values()]}isPrimitiveType(t){return this.primitives.has(t)}isPrimitiveSchema(t){return this.isPrimitiveType(t.title)}isResolvableSchema(t){return this.resolvables.has(t.title)}getValidationSchemaForPrimitive(t){return[this.primitives.get(t),...this.fetchResolvableSchemasForPrimitive(t)]}*fetchResolvableSchemasForPrimitive(t){for(let r in this.resolvers[t])yield this.resolvables.get(r)}tryGetResolver(t,r){var n;if(t in this.resolvers)return(n=this.resolvers[t])===null||n===void 0?void 0:n[r.title]}};To.TypeResolver=dC});var M6=S(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.TypeResolverBuilder=void 0;var lCe=ba(),mf=class{constructor(){this.primitives=new Set,this.resolvables=new Set,this.resolverMap={}}static new(){return new mf}addPrimitive(t){return this.primitives.add(t),this}addResolver(t,r,n){var i,s,a;return this.primitives.add(t),this.resolvables.add(r),(i=(s=this.resolverMap)[a=t.title])!==null&&i!==void 0||(s[a]={}),this.resolverMap[t.title][r.title]=n,this}build(){return new lCe.TypeResolver(Array.from(this.primitives.values()),Array.from(this.resolvables.values()),this.resolverMap)}};s0.TypeResolverBuilder=mf});var k6=S(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.SquizImageType=void 0;var uCe=ba();o0.SquizImageType=(0,uCe.PrimitiveType)({title:"SquizImage",type:"object",properties:{name:{type:"string"},alt:{type:"string"},caption:{type:"string"},exif:{type:"object",properties:{image:{type:"object"},thumbnail:{type:"object"},exif:{type:"object"},gps:{type:"object"},interoperability:{type:"object"},makernote:{type:"object"}},required:["image","thumbnail","exif","gps","interoperability","makernote"]},imageVariations:{type:"object",properties:{original:{$ref:"#/definitions/SquizImageData"},small:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},medium:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},large:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},aspectRatios:{type:"array",items:{$ref:"#/definitions/SquizImageData"}}},required:["original"]}},required:["name","imageVariations"],definitions:{SquizImageData:{type:"object",properties:{width:{type:"number"},height:{type:"number"},url:{type:"string"},mimeType:{type:"string"},byteSize:{type:"number"},sha1Hash:{type:"string"},aspectRatio:{type:"string"}},required:["width","height","url","mimeType","byteSize","sha1Hash","aspectRatio"]}}})});var F6=S(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.ComponentInputFormattedTextType=Oo.BaseFormattedTextType=Oo.FormattedTextType=void 0;var D6=Io(),pC=ba();Oo.FormattedTextType=(0,pC.PrimitiveType)({...D6.FORMATTED_TEXT_SCHEMAS.v1,title:"FormattedText"});Oo.BaseFormattedTextType=(0,pC.PrimitiveType)({...D6.FORMATTED_TEXT_SCHEMAS.v1,items:{$ref:"#/definitions/BaseFormattedNodes"},title:"FormattedText"});Oo.ComponentInputFormattedTextType=(0,pC.PrimitiveType)({type:"string",title:"FormattedText"})});var L6=S(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});a0.SquizLinkType=void 0;var dCe=ba();a0.SquizLinkType=(0,dCe.PrimitiveType)({title:"SquizLink",type:"object",properties:{name:{type:"string"},url:{type:"string"},target:{type:"string",enum:["_blank","_parent","_self","_top"]}},required:["name","url"]})});var z6=S(As=>{"use strict";var pCe=As&&As.__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]}),fC=As&&As.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&pCe(t,e,r)};Object.defineProperty(As,"__esModule",{value:!0});fC(k6(),As);fC(F6(),As);fC(L6(),As)});var U6=S(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.MatrixAssetLinkType=Gc.MatrixAssetType=void 0;var $6=ba();Gc.MatrixAssetType=(0,$6.ResolvableType)({title:"MatrixAsset",type:"object",properties:{matrixAssetId:{type:"string"},matrixIdentifier:{type:"string"},matrixDomain:{type:"string"}},required:["matrixAssetId","matrixIdentifier"]});Gc.MatrixAssetLinkType=(0,$6.ResolvableType)({title:"MatrixAssetLink",type:"object",properties:{matrixAssetId:{type:"string"},matrixIdentifier:{type:"string"},matrixDomain:{type:"string"},target:{type:"string",enum:["_blank","_parent","_self","_top"]}},required:["matrixAssetId","matrixIdentifier"]})});var V6=S(Ra=>{"use strict";var fCe=Ra&&Ra.__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]}),mCe=Ra&&Ra.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&fCe(t,e,r)};Object.defineProperty(Ra,"__esModule",{value:!0});mCe(U6(),Ra)});var Io=S(St=>{"use strict";var G6=St&&St.__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]}),hCe=St&&St.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),hf=St&&St.__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)&&G6(t,e,r);return hCe(t,e),t},Ji=St&&St.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&G6(t,e,r)};Object.defineProperty(St,"__esModule",{value:!0});St.SUB_SCHEMAS=St.FORMATTED_TEXT_SCHEMAS=St.FORMATTED_TEXT_MODELS=St.MANIFEST_SCHEMAS=St.MANIFEST_MODELS=void 0;St.MANIFEST_MODELS=hf(g6());St.MANIFEST_SCHEMAS=hf(y6());St.FORMATTED_TEXT_MODELS=hf(E6());St.FORMATTED_TEXT_SCHEMAS=hf(b6());Ji(x6(),St);St.SUB_SCHEMAS=hf(A6());Ji(q6(),St);Ji(Zw(),St);Ji(oC(),St);Ji(t0(),St);Ji(t0(),St);Ji(ba(),St);Ji(M6(),St);Ji(z6(),St);Ji(V6(),St)});var H6=S(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.formattedTextToHtmlString=xa.formattedTextToHtmlStringResolvers=void 0;var _Ce=Io();xa.formattedTextToHtmlStringResolvers={tag:async e=>gCe(e),text:async e=>e.value,default:async e=>`<p class="invalid-node-type"> node of type "${e.type}" cannot be converted to html</p>`};async function vCe(e){return await(0,_Ce.resolveFormattedText)(e,xa.formattedTextToHtmlStringResolvers)}xa.formattedTextToHtmlString=vCe;function gCe(e){let t=yCe(e);e.attributes?e.attributes.class=t:e.attributes={class:t};let r=SCe(e.attributes);return`<${e.tag}${r}>${e.children.join("")}</${e.tag}>`}function yCe(e){var t,r,n;let i=wCe(e.font),s=(r=(t=e==null?void 0:e.attributes)===null||t===void 0?void 0:t.class)!==null&&r!==void 0?r:"";return!((n=e==null?void 0:e.formattingOptions)===null||n===void 0)&&n.alignment&&i.push(e.formattingOptions.alignment),i.length>0&&(s+=" "+i.join(" ")),s.trim()}function SCe(e){if(!e)return"";let t="";for(let r in e)e[r]!==""&&(t+=` ${r}="${e[r]}"`);return t}function wCe(e){if(!e)return[];let t=[];return e.bold&&t.push("bold"),e.underline&&t.push("underline"),e.italics&&t.push("italics"),e.color&&t.push(`color-${e.color}`),e.size&&t.push(`size-${e.size}`),e.fontFamily&&t.push(`font-${e.fontFamily}`),t}});var jB=S((_f,Hc)=>{var ECe=200,nB="__lodash_hash_undefined__",iB=9007199254740991,wC="[object Arguments]",bCe="[object Array]",sB="[object Boolean]",oB="[object Date]",RCe="[object Error]",EC="[object Function]",aB="[object GeneratorFunction]",c0="[object Map]",cB="[object Number]",bC="[object Object]",B6="[object Promise]",lB="[object RegExp]",l0="[object Set]",uB="[object String]",dB="[object Symbol]",hC="[object WeakMap]",pB="[object ArrayBuffer]",u0="[object DataView]",fB="[object Float32Array]",mB="[object Float64Array]",hB="[object Int8Array]",_B="[object Int16Array]",vB="[object Int32Array]",gB="[object Uint8Array]",yB="[object Uint8ClampedArray]",SB="[object Uint16Array]",wB="[object Uint32Array]",xCe=/[\\^$.*+?()[\]{}|]/g,ACe=/\w*$/,PCe=/^\[object .+?Constructor\]$/,ICe=/^(?:0|[1-9]\d*)$/,Rt={};Rt[wC]=Rt[bCe]=Rt[pB]=Rt[u0]=Rt[sB]=Rt[oB]=Rt[fB]=Rt[mB]=Rt[hB]=Rt[_B]=Rt[vB]=Rt[c0]=Rt[cB]=Rt[bC]=Rt[lB]=Rt[l0]=Rt[uB]=Rt[dB]=Rt[gB]=Rt[yB]=Rt[SB]=Rt[wB]=!0;Rt[RCe]=Rt[EC]=Rt[hC]=!1;var CCe=typeof global=="object"&&global&&global.Object===Object&&global,TCe=typeof self=="object"&&self&&self.Object===Object&&self,Ps=CCe||TCe||Function("return this")(),EB=typeof _f=="object"&&_f&&!_f.nodeType&&_f,W6=EB&&typeof Hc=="object"&&Hc&&!Hc.nodeType&&Hc,OCe=W6&&W6.exports===EB;function NCe(e,t){return e.set(t[0],t[1]),e}function jCe(e,t){return e.add(t),e}function qCe(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function MCe(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function bB(e,t,r,n){var i=-1,s=e?e.length:0;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function kCe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function DCe(e,t){return e==null?void 0:e[t]}function RB(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function K6(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function RC(e,t){return function(r){return e(t(r))}}function J6(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var FCe=Array.prototype,LCe=Function.prototype,d0=Object.prototype,mC=Ps["__core-js_shared__"],Y6=function(){var e=/[^.]+$/.exec(mC&&mC.keys&&mC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),xB=LCe.toString,No=d0.hasOwnProperty,p0=d0.toString,zCe=RegExp("^"+xB.call(No).replace(xCe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Q6=OCe?Ps.Buffer:void 0,X6=Ps.Symbol,Z6=Ps.Uint8Array,$Ce=RC(Object.getPrototypeOf,Object),UCe=Object.create,VCe=d0.propertyIsEnumerable,GCe=FCe.splice,eB=Object.getOwnPropertySymbols,HCe=Q6?Q6.isBuffer:void 0,BCe=RC(Object.keys,Object),_C=Kc(Ps,"DataView"),vf=Kc(Ps,"Map"),vC=Kc(Ps,"Promise"),gC=Kc(Ps,"Set"),yC=Kc(Ps,"WeakMap"),gf=Kc(Object,"create"),WCe=Ia(_C),KCe=Ia(vf),JCe=Ia(vC),YCe=Ia(gC),QCe=Ia(yC),tB=X6?X6.prototype:void 0,rB=tB?tB.valueOf:void 0;function Pa(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function XCe(){this.__data__=gf?gf(null):{}}function ZCe(e){return this.has(e)&&delete this.__data__[e]}function eTe(e){var t=this.__data__;if(gf){var r=t[e];return r===nB?void 0:r}return No.call(t,e)?t[e]:void 0}function tTe(e){var t=this.__data__;return gf?t[e]!==void 0:No.call(t,e)}function rTe(e,t){var r=this.__data__;return r[e]=gf&&t===void 0?nB:t,this}Pa.prototype.clear=XCe;Pa.prototype.delete=ZCe;Pa.prototype.get=eTe;Pa.prototype.has=tTe;Pa.prototype.set=rTe;function Is(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function nTe(){this.__data__=[]}function iTe(e){var t=this.__data__,r=f0(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():GCe.call(t,r,1),!0}function sTe(e){var t=this.__data__,r=f0(t,e);return r<0?void 0:t[r][1]}function oTe(e){return f0(this.__data__,e)>-1}function aTe(e,t){var r=this.__data__,n=f0(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}Is.prototype.clear=nTe;Is.prototype.delete=iTe;Is.prototype.get=sTe;Is.prototype.has=oTe;Is.prototype.set=aTe;function Bc(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function cTe(){this.__data__={hash:new Pa,map:new(vf||Is),string:new Pa}}function lTe(e){return m0(this,e).delete(e)}function uTe(e){return m0(this,e).get(e)}function dTe(e){return m0(this,e).has(e)}function pTe(e,t){return m0(this,e).set(e,t),this}Bc.prototype.clear=cTe;Bc.prototype.delete=lTe;Bc.prototype.get=uTe;Bc.prototype.has=dTe;Bc.prototype.set=pTe;function Wc(e){this.__data__=new Is(e)}function fTe(){this.__data__=new Is}function mTe(e){return this.__data__.delete(e)}function hTe(e){return this.__data__.get(e)}function _Te(e){return this.__data__.has(e)}function vTe(e,t){var r=this.__data__;if(r instanceof Is){var n=r.__data__;if(!vf||n.length<ECe-1)return n.push([e,t]),this;r=this.__data__=new Bc(n)}return r.set(e,t),this}Wc.prototype.clear=fTe;Wc.prototype.delete=mTe;Wc.prototype.get=hTe;Wc.prototype.has=_Te;Wc.prototype.set=vTe;function gTe(e,t){var r=AC(e)||UTe(e)?kCe(e.length,String):[],n=r.length,i=!!n;for(var s in e)(t||No.call(e,s))&&!(i&&(s=="length"||FTe(s,n)))&&r.push(s);return r}function AB(e,t,r){var n=e[t];(!(No.call(e,t)&&TB(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function f0(e,t){for(var r=e.length;r--;)if(TB(e[r][0],t))return r;return-1}function yTe(e,t){return e&&PB(t,PC(t),e)}function SC(e,t,r,n,i,s,a){var o;if(n&&(o=s?n(e,i,s,a):n(e)),o!==void 0)return o;if(!h0(e))return e;var c=AC(e);if(c){if(o=MTe(e),!t)return NTe(e,o)}else{var u=Aa(e),l=u==EC||u==aB;if(GTe(e))return xTe(e,t);if(u==bC||u==wC||l&&!s){if(RB(e))return s?e:{};if(o=kTe(l?{}:e),!t)return jTe(e,yTe(o,e))}else{if(!Rt[u])return s?e:{};o=DTe(e,u,SC,t)}}a||(a=new Wc);var p=a.get(e);if(p)return p;if(a.set(e,o),!c)var d=r?qTe(e):PC(e);return qCe(d||e,function(m,f){d&&(f=m,m=e[f]),AB(o,f,SC(m,t,r,n,f,e,a))}),o}function STe(e){return h0(e)?UCe(e):{}}function wTe(e,t,r){var n=t(e);return AC(e)?n:MCe(n,r(e))}function ETe(e){return p0.call(e)}function bTe(e){if(!h0(e)||zTe(e))return!1;var t=NB(e)||RB(e)?zCe:PCe;return t.test(Ia(e))}function RTe(e){if(!CB(e))return BCe(e);var t=[];for(var r in Object(e))No.call(e,r)&&r!="constructor"&&t.push(r);return t}function xTe(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function xC(e){var t=new e.constructor(e.byteLength);return new Z6(t).set(new Z6(e)),t}function ATe(e,t){var r=t?xC(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function PTe(e,t,r){var n=t?r(K6(e),!0):K6(e);return bB(n,NCe,new e.constructor)}function ITe(e){var t=new e.constructor(e.source,ACe.exec(e));return t.lastIndex=e.lastIndex,t}function CTe(e,t,r){var n=t?r(J6(e),!0):J6(e);return bB(n,jCe,new e.constructor)}function TTe(e){return rB?Object(rB.call(e)):{}}function OTe(e,t){var r=t?xC(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function NTe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function PB(e,t,r,n){r||(r={});for(var i=-1,s=t.length;++i<s;){var a=t[i],o=n?n(r[a],e[a],a,r,e):void 0;AB(r,a,o===void 0?e[a]:o)}return r}function jTe(e,t){return PB(e,IB(e),t)}function qTe(e){return wTe(e,PC,IB)}function m0(e,t){var r=e.__data__;return LTe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Kc(e,t){var r=DCe(e,t);return bTe(r)?r:void 0}var IB=eB?RC(eB,Object):WTe,Aa=ETe;(_C&&Aa(new _C(new ArrayBuffer(1)))!=u0||vf&&Aa(new vf)!=c0||vC&&Aa(vC.resolve())!=B6||gC&&Aa(new gC)!=l0||yC&&Aa(new yC)!=hC)&&(Aa=function(e){var t=p0.call(e),r=t==bC?e.constructor:void 0,n=r?Ia(r):void 0;if(n)switch(n){case WCe:return u0;case KCe:return c0;case JCe:return B6;case YCe:return l0;case QCe:return hC}return t});function MTe(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&No.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function kTe(e){return typeof e.constructor=="function"&&!CB(e)?STe($Ce(e)):{}}function DTe(e,t,r,n){var i=e.constructor;switch(t){case pB:return xC(e);case sB:case oB:return new i(+e);case u0:return ATe(e,n);case fB:case mB:case hB:case _B:case vB:case gB:case yB:case SB:case wB:return OTe(e,n);case c0:return PTe(e,n,r);case cB:case uB:return new i(e);case lB:return ITe(e);case l0:return CTe(e,n,r);case dB:return TTe(e)}}function FTe(e,t){return t=t??iB,!!t&&(typeof e=="number"||ICe.test(e))&&e>-1&&e%1==0&&e<t}function LTe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zTe(e){return!!Y6&&Y6 in e}function CB(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||d0;return e===r}function Ia(e){if(e!=null){try{return xB.call(e)}catch{}try{return e+""}catch{}}return""}function $Te(e){return SC(e,!0,!0)}function TB(e,t){return e===t||e!==e&&t!==t}function UTe(e){return VTe(e)&&No.call(e,"callee")&&(!VCe.call(e,"callee")||p0.call(e)==wC)}var AC=Array.isArray;function OB(e){return e!=null&&HTe(e.length)&&!NB(e)}function VTe(e){return BTe(e)&&OB(e)}var GTe=HCe||KTe;function NB(e){var t=h0(e)?p0.call(e):"";return t==EC||t==aB}function HTe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=iB}function h0(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function BTe(e){return!!e&&typeof e=="object"}function PC(e){return OB(e)?gTe(e):RTe(e)}function WTe(){return[]}function KTe(){return!1}Hc.exports=$Te});var MB=S((E7e,qB)=>{"use strict";qB.exports=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}});var IC=S(jo=>{"use strict";var JTe=jo&&jo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jo,"__esModule",{value:!0});jo.splitKey=jo.escapeKey=void 0;var YTe=JTe(MB()),QTe=(e,t)=>{let n=["\\",t].map(i=>(0,YTe.default)(i)).join("|");return e.replace(new RegExp(`(${n})`,"g"),"\\$1")};jo.escapeKey=QTe;var XTe=(e,t)=>{if(e.indexOf("\\")<0)return e.split(t);let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s];i?(n+=a,i=!1):a==="\\"?i=!0:a===t[0]&&e.substr(s,t.length)===t?(r.push(n),n="",s+=t.length-1):n+=a}return r.push(n),r};jo.splitKey=XTe});var TC=S(yf=>{"use strict";var ZTe=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yf,"__esModule",{value:!0});var eOe=ZTe(jB()),CC=IC(),kB=(e,t,r)=>{let n=!0,i=(0,CC.splitKey)(t,r).slice(1).reduce((s,a)=>{if(n=s&&a in s,!!n)return s[a]},e);return{exists:n,value:i}},DB=(e,t,r,n)=>{(0,CC.splitKey)(t,n).slice(1).reduce((i,s,a,o)=>{if(a===o.length-1){let c=Array.isArray(r)?(0,eOe.default)(r).map(u=>typeof u=="object"?{}:u):r;i[s]=c}return i[s]},e)},tOe=(e,t,r,n)=>{let i=kB(e,r,n);i.exists&&DB(t,r,i.value,n)},rOe=(e,t,r="~")=>{if(r.length<1)throw new Error("Separator should not be an empty string.");if(r==="\\")throw new Error('Separator cannot be "\\".');if(!t)return e;let n=Object.keys(t),i=n[0]&&n[0].length||0,s={};return n.forEach(a=>{let o=t[a],c=a.substr(i),u=kB(e,c,r);if(u.exists){let l=Array.isArray(u.value)?u.value:{};DB(s,c,l,r),o.forEach(p=>tOe(e,s,`${c}${r}${(0,CC.escapeKey)(p,r)}`,r))}}),s};yf.default=rOe});var zB=S(OC=>{"use strict";Object.defineProperty(OC,"__esModule",{value:!0});var FB=IC(),LB=(e,t,r,n)=>{let i=Object.keys(e);i.length!==0&&(Array.isArray(e)||(t[`${r}`]=i),i.forEach(s=>{let a=e[s];a!==null&&typeof a=="object"&&LB(a,t,`${r}${n}${(0,FB.escapeKey)(s,n)}`,n)}))},nOe=(e,t="$",r="~")=>{if(t.length<1)throw new Error("Prefix should not be an empty string.");if(r.length<1)throw new Error("Separator should not be an empty string.");if(r==="\\")throw new Error('Separator cannot be "\\".');let n=JSON.parse(e),i={};return LB(n,i,(0,FB.escapeKey)(t,r),r),{object:n,map:i}};OC.default=nOe});var $B=S(Sf=>{"use strict";var iOe=Sf&&Sf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sf,"__esModule",{value:!0});var sOe=iOe(TC()),oOe=(e,t,r="~",n)=>JSON.stringify((0,sOe.default)(e,t,r),null,n);Sf.default=oOe});var UB=S(Jc=>{"use strict";var NC=Jc&&Jc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.jsonOrder=void 0;var aOe=NC(TC()),cOe=NC(zB()),lOe=NC($B());Jc.jsonOrder={order:aOe.default,parse:cOe.default,stringify:lOe.default}});var Ot=S(nr=>{"use strict";var uOe=nr&&nr.__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]}),un=nr&&nr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&uOe(t,e,r)};Object.defineProperty(nr,"__esModule",{value:!0});un(ZN(),nr);un(oj(),nr);un(_1(),nr);un(fM(),nr);un(mM(),nr);un(hM(),nr);un(vM(),nr);un(UI(),nr);un(GI(),nr);un(d6(),nr);un(p6(),nr);un(h6(),nr);un(H6(),nr);un(UB(),nr)});var jC=S(VB=>{"use strict";Object.defineProperty(VB,"__esModule",{value:!0})});var HB=S(GB=>{"use strict";Object.defineProperty(GB,"__esModule",{value:!0})});var v0=S(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.ComponentSetComponentVersion=Ca.ComponentSetComponentVersionStatus=void 0;var Yi=Ot(),_0;(function(e){e.active="active",e.excluded="excluded"})(_0=Ca.ComponentSetComponentVersionStatus||(Ca.ComponentSetComponentVersionStatus={}));var qC=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",this.status=_0.active,(0,Yi.assertIsDefined)(t),this.componentSetWebPath=(0,Yi.assertAssign)(t.componentSetWebPath,Yi.assertIsString,"componentSetWebPath must be a string"),this.componentName=(0,Yi.assertAssign)(t.componentName,Yi.assertIsString,"componentName must be a string"),this.componentVersion=(0,Yi.assertAssign)(t.componentVersion,Yi.assertIsString,"componentVersion must be a string"),this.environmentVariables=(0,Yi.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,Yi.assertIsMapOfStringString,{}),t.status===void 0&&(t.status=_0.active),(0,Yi.assertIsEnumValue)(t.status,_0),this.status=t.status}};Ca.ComponentSetComponentVersion=qC});var Os=S((V7e,V9)=>{"use strict";var dOe=Object.create,E0=Object.defineProperty,pOe=Object.getOwnPropertyDescriptor,LC=Object.getOwnPropertyNames,fOe=Object.getPrototypeOf,mOe=Object.prototype.hasOwnProperty,qr=(e,t)=>function(){return e&&(t=(0,e[LC(e)[0]])(e=0)),t},A=(e,t)=>function(){return t||(0,e[LC(e)[0]])((t={exports:{}}).exports,t),t.exports},zC=(e,t)=>{for(var r in t)E0(e,r,{get:t[r],enumerable:!0})},t8=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of LC(t))!mOe.call(e,i)&&i!==r&&E0(e,i,{get:()=>t[i],enumerable:!(n=pOe(t,i))||n.enumerable});return e},Xi=(e,t,r)=>(r=e!=null?dOe(fOe(e)):{},t8(t||!e||!e.__esModule?E0(r,"default",{value:e,enumerable:!0}):r,e)),Ie=e=>t8(E0({},"__esModule",{value:!0}),e),r8=A({"../../node_modules/postgres-array/index.js"(e){"use strict";e.parse=function(n,i){return new t(n,i).parse()};var t=class{constructor(n,i){this.source=n,this.transform=i||r,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var n=this.source[this.position++];return n==="\\"?{value:this.source[this.position++],escaped:!0}:{value:n,escaped:!1}}record(n){this.recorded.push(n)}newEntry(n){var i;(this.recorded.length>0||n)&&(i=this.recorded.join(""),i==="NULL"&&!n&&(i=null),i!==null&&(i=this.transform(i)),this.entries.push(i),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){var n=this.nextCharacter();if(n.value==="=")break}}parse(n){var i,s,a;for(this.consumeDimensions();!this.isEof();)if(i=this.nextCharacter(),i.value==="{"&&!a)this.dimension++,this.dimension>1&&(s=new t(this.source.substr(this.position-1),this.transform),this.entries.push(s.parse(!0)),this.position+=s.position-2);else if(i.value==="}"&&!a){if(this.dimension--,!this.dimension&&(this.newEntry(),n))return this.entries}else i.value==='"'&&!i.escaped?(a&&this.newEntry(!0),a=!a):i.value===","&&!a?this.newEntry():this.record(i.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this.entries}};function r(n){return n}}}),n8=A({"../../node_modules/pg-types/lib/arrayParser.js"(e,t){var r=r8();t.exports={create:function(n,i){return{parse:function(){return r.parse(n,i)}}}}}}),hOe=A({"../../node_modules/postgres-date/index.js"(e,t){"use strict";var r=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,n=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,s=/^-?infinity$/;t.exports=function(p){if(s.test(p))return Number(p.replace("i","I"));var d=r.exec(p);if(!d)return a(p)||null;var m=!!d[8],f=parseInt(d[1],10);m&&(f=c(f));var h=parseInt(d[2],10)-1,_=d[3],g=parseInt(d[4],10),v=parseInt(d[5],10),y=parseInt(d[6],10),E=d[7];E=E?1e3*parseFloat(E):0;var q,C=o(p);return C!=null?(q=new Date(Date.UTC(f,h,_,g,v,y,E)),u(f)&&q.setUTCFullYear(f),C!==0&&q.setTime(q.getTime()-C)):(q=new Date(f,h,_,g,v,y,E),u(f)&&q.setFullYear(f)),q};function a(l){var p=n.exec(l);if(p){var d=parseInt(p[1],10),m=!!p[4];m&&(d=c(d));var f=parseInt(p[2],10)-1,h=p[3],_=new Date(d,f,h);return u(d)&&_.setFullYear(d),_}}function o(l){if(l.endsWith("+00"))return 0;var p=i.exec(l.split(" ")[1]);if(p){var d=p[1];if(d==="Z")return 0;var m=d==="-"?-1:1,f=parseInt(p[2],10)*3600+parseInt(p[3]||0,10)*60+parseInt(p[4]||0,10);return f*m*1e3}}function c(l){return-(l-1)}function u(l){return l>=0&&l<100}}}),_Oe=A({"../../node_modules/xtend/mutable.js"(e,t){t.exports=n;var r=Object.prototype.hasOwnProperty;function n(i){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var o in a)r.call(a,o)&&(i[o]=a[o])}return i}}}),vOe=A({"../../node_modules/postgres-interval/index.js"(e,t){"use strict";var r=_Oe();t.exports=n;function n(v){if(!(this instanceof n))return new n(v);r(this,g(v))}var i=["seconds","minutes","hours","days","months","years"];n.prototype.toPostgres=function(){var v=i.filter(this.hasOwnProperty,this);return this.milliseconds&&v.indexOf("seconds")<0&&v.push("seconds"),v.length===0?"0":v.map(function(y){var E=this[y]||0;return y==="seconds"&&this.milliseconds&&(E=(E+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),E+" "+y},this).join(" ")};var s={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},a=["years","months","days"],o=["hours","minutes","seconds"];n.prototype.toISOString=n.prototype.toISO=function(){var v=a.map(E,this).join(""),y=o.map(E,this).join("");return"P"+v+"T"+y;function E(q){var C=this[q]||0;return q==="seconds"&&this.milliseconds&&(C=(C+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),C+s[q]}};var c="([+-]?\\d+)",u=c+"\\s+years?",l=c+"\\s+mons?",p=c+"\\s+days?",d="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",m=new RegExp([u,l,p,d].map(function(v){return"("+v+")?"}).join("\\s*")),f={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},h=["hours","minutes","seconds","milliseconds"];function _(v){var y=v+"000000".slice(v.length);return parseInt(y,10)/1e3}function g(v){if(!v)return{};var y=m.exec(v),E=y[8]==="-";return Object.keys(f).reduce(function(q,C){var M=f[C],F=y[M];return!F||(F=C==="milliseconds"?_(F):parseInt(F,10),!F)||(E&&~h.indexOf(C)&&(F*=-1),q[C]=F),q},{})}}}),gOe=A({"../../node_modules/postgres-bytea/index.js"(e,t){"use strict";t.exports=function(n){if(/^\\x/.test(n))return new Buffer(n.substr(2),"hex");for(var i="",s=0;s<n.length;)if(n[s]!=="\\")i+=n[s],++s;else if(/[0-7]{3}/.test(n.substr(s+1,3)))i+=String.fromCharCode(parseInt(n.substr(s+1,3),8)),s+=4;else{for(var a=1;s+a<n.length&&n[s+a]==="\\";)a++;for(var o=0;o<Math.floor(a/2);++o)i+="\\";s+=Math.floor(a/2)*2}return new Buffer(i,"binary")}}}),yOe=A({"../../node_modules/pg-types/lib/textParsers.js"(e,t){var r=r8(),n=n8(),i=hOe(),s=vOe(),a=gOe();function o(N){return function(x){return x===null?x:N(x)}}function c(N){return N===null?N:N==="TRUE"||N==="t"||N==="true"||N==="y"||N==="yes"||N==="on"||N==="1"}function u(N){return N?r.parse(N,c):null}function l(N){return parseInt(N,10)}function p(N){return N?r.parse(N,o(l)):null}function d(N){return N?r.parse(N,o(function(T){return E(T).trim()})):null}var m=function(N){if(!N)return null;var T=n.create(N,function(x){return x!==null&&(x=C(x)),x});return T.parse()},f=function(N){if(!N)return null;var T=n.create(N,function(x){return x!==null&&(x=parseFloat(x)),x});return T.parse()},h=function(N){if(!N)return null;var T=n.create(N);return T.parse()},_=function(N){if(!N)return null;var T=n.create(N,function(x){return x!==null&&(x=i(x)),x});return T.parse()},g=function(N){if(!N)return null;var T=n.create(N,function(x){return x!==null&&(x=s(x)),x});return T.parse()},v=function(N){return N?r.parse(N,o(a)):null},y=function(N){return parseInt(N,10)},E=function(N){var T=String(N);return/^\d+$/.test(T)?T:N},q=function(N){return N?r.parse(N,o(JSON.parse)):null},C=function(N){return N[0]!=="("?null:(N=N.substring(1,N.length-1).split(","),{x:parseFloat(N[0]),y:parseFloat(N[1])})},M=function(N){if(N[0]!=="<"&&N[1]!=="(")return null;for(var T="(",x="",P=!1,G=2;G<N.length-1;G++){if(P||(T+=N[G]),N[G]===")"){P=!0;continue}else if(!P)continue;N[G]!==","&&(x+=N[G])}var D=C(T);return D.radius=parseFloat(x),D},F=function(N){N(20,E),N(21,y),N(23,y),N(26,y),N(700,parseFloat),N(701,parseFloat),N(16,c),N(1082,i),N(1114,i),N(1184,i),N(600,C),N(651,h),N(718,M),N(1e3,u),N(1001,v),N(1005,p),N(1007,p),N(1028,p),N(1016,d),N(1017,m),N(1021,f),N(1022,f),N(1231,f),N(1014,h),N(1015,h),N(1008,h),N(1009,h),N(1040,h),N(1041,h),N(1115,_),N(1182,_),N(1185,_),N(1186,s),N(1187,g),N(17,a),N(114,JSON.parse.bind(JSON)),N(3802,JSON.parse.bind(JSON)),N(199,q),N(3807,q),N(3907,h),N(2951,h),N(791,h),N(1183,h),N(1270,h)};t.exports={init:F}}}),SOe=A({"../../node_modules/pg-int8/index.js"(e,t){"use strict";var r=1e6;function n(i){var s=i.readInt32BE(0),a=i.readUInt32BE(4),o="";s<0&&(s=~s+(a===0),a=~a+1>>>0,o="-");var c="",u,l,p,d,m,f;{if(u=s%r,s=s/r>>>0,l=4294967296*u+a,a=l/r>>>0,p=""+(l-r*a),a===0&&s===0)return o+p+c;for(d="",m=6-p.length,f=0;f<m;f++)d+="0";c=d+p+c}{if(u=s%r,s=s/r>>>0,l=4294967296*u+a,a=l/r>>>0,p=""+(l-r*a),a===0&&s===0)return o+p+c;for(d="",m=6-p.length,f=0;f<m;f++)d+="0";c=d+p+c}{if(u=s%r,s=s/r>>>0,l=4294967296*u+a,a=l/r>>>0,p=""+(l-r*a),a===0&&s===0)return o+p+c;for(d="",m=6-p.length,f=0;f<m;f++)d+="0";c=d+p+c}return u=s%r,l=4294967296*u+a,p=""+l%r,o+p+c}t.exports=n}}),wOe=A({"../../node_modules/pg-types/lib/binaryParsers.js"(e,t){var r=SOe(),n=function(h,_,g,v,y){g=g||0,v=v||!1,y=y||function(P,G,D){return P*Math.pow(2,D)+G};var E=g>>3,q=function(P){return v?~P&255:P},C=255,M=8-g%8;_<M&&(C=255<<8-_&255,M=_),g&&(C=C>>g%8);var F=0;g%8+_>=8&&(F=y(0,q(h[E])&C,M));for(var N=_+g>>3,T=E+1;T<N;T++)F=y(F,q(h[T]),8);var x=(_+g)%8;return x>0&&(F=y(F,q(h[N])>>8-x,x)),F},i=function(h,_,g){var v=Math.pow(2,g-1)-1,y=n(h,1),E=n(h,g,1);if(E===0)return 0;var q=1,C=function(F,N,T){F===0&&(F=1);for(var x=1;x<=T;x++)q/=2,(N&1<<T-x)>0&&(F+=q);return F},M=n(h,_,g+1,!1,C);return E==Math.pow(2,g+1)-1?M===0?y===0?1/0:-1/0:NaN:(y===0?1:-1)*Math.pow(2,E-v)*M},s=function(h){return n(h,1)==1?-1*(n(h,15,1,!0)+1):n(h,15,1)},a=function(h){return n(h,1)==1?-1*(n(h,31,1,!0)+1):n(h,31,1)},o=function(h){return i(h,23,8)},c=function(h){return i(h,52,11)},u=function(h){var _=n(h,16,32);if(_==49152)return NaN;for(var g=Math.pow(1e4,n(h,16,16)),v=0,y=[],E=n(h,16),q=0;q<E;q++)v+=n(h,16,64+16*q)*g,g/=1e4;var C=Math.pow(10,n(h,16,48));return(_===0?1:-1)*Math.round(v*C)/C},l=function(h,_){var g=n(_,1),v=n(_,63,1),y=new Date((g===0?1:-1)*v/1e3+9466848e5);return h||y.setTime(y.getTime()+y.getTimezoneOffset()*6e4),y.usec=v%1e3,y.getMicroSeconds=function(){return this.usec},y.setMicroSeconds=function(E){this.usec=E},y.getUTCMicroSeconds=function(){return this.usec},y},p=function(h){for(var _=n(h,32),g=n(h,32,32),v=n(h,32,64),y=96,E=[],q=0;q<_;q++)E[q]=n(h,32,y),y+=32,y+=32;var C=function(F){var N=n(h,32,y);if(y+=32,N==4294967295)return null;var T;if(F==23||F==20)return T=n(h,N*8,y),y+=N*8,T;if(F==25)return T=h.toString(this.encoding,y>>3,(y+=N<<3)>>3),T;console.log("ERROR: ElementType not implemented: "+F)},M=function(F,N){var T=[],x;if(F.length>1){var P=F.shift();for(x=0;x<P;x++)T[x]=M(F,N);F.unshift(P)}else for(x=0;x<F[0];x++)T[x]=C(N);return T};return M(E,v)},d=function(h){return h.toString("utf8")},m=function(h){return h===null?null:n(h,8)>0},f=function(h){h(20,r),h(21,s),h(23,a),h(26,a),h(1700,u),h(700,o),h(701,c),h(16,m),h(1114,l.bind(null,!1)),h(1184,l.bind(null,!0)),h(1e3,p),h(1007,p),h(1016,p),h(1008,p),h(1009,p),h(25,d)};t.exports={init:f}}}),EOe=A({"../../node_modules/pg-types/lib/builtins.js"(e,t){t.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}}}),b0=A({"../../node_modules/pg-types/index.js"(e){var t=yOe(),r=wOe(),n=n8(),i=EOe();e.getTypeParser=o,e.setTypeParser=c,e.arrayParser=n,e.builtins=i;var s={text:{},binary:{}};function a(u){return String(u)}function o(u,l){return l=l||"text",s[l]&&s[l][u]||a}function c(u,l,p){typeof l=="function"&&(p=l,l="text"),s[l][u]=p}t.init(function(u,l){s.text[u]=l}),r.init(function(u,l){s.binary[u]=l})}}),R0=A({"../../node_modules/pg/lib/defaults.js"(e,t){"use strict";t.exports={host:"localhost",user:process.platform==="win32"?process.env.USERNAME:process.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var r=b0(),n=r.getTypeParser(20,"text"),i=r.getTypeParser(1016,"text");t.exports.__defineSetter__("parseInt8",function(s){r.setTypeParser(20,"text",s?r.getTypeParser(23,"text"):n),r.setTypeParser(1016,"text",s?r.getTypeParser(1007,"text"):i)})}}),$C=A({"../../node_modules/pg/lib/utils.js"(e,t){"use strict";var r=require("crypto"),n=R0();function i(f){var h=f.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+h+'"'}function s(f){for(var h="{",_=0;_<f.length;_++)_>0&&(h=h+","),f[_]===null||typeof f[_]>"u"?h=h+"NULL":Array.isArray(f[_])?h=h+s(f[_]):f[_]instanceof Buffer?h+="\\\\x"+f[_].toString("hex"):h+=i(a(f[_]));return h=h+"}",h}var a=function(f,h){if(f==null)return null;if(f instanceof Buffer)return f;if(ArrayBuffer.isView(f)){var _=Buffer.from(f.buffer,f.byteOffset,f.byteLength);return _.length===f.byteLength?_:_.slice(f.byteOffset,f.byteOffset+f.byteLength)}return f instanceof Date?n.parseInputDatesAsUTC?l(f):u(f):Array.isArray(f)?s(f):typeof f=="object"?o(f,h):f.toString()};function o(f,h){if(f&&typeof f.toPostgres=="function"){if(h=h||[],h.indexOf(f)!==-1)throw new Error('circular reference detected while preparing "'+f+'" for query');return h.push(f),a(f.toPostgres(a),h)}return JSON.stringify(f)}function c(f,h){for(f=""+f;f.length<h;)f="0"+f;return f}function u(f){var h=-f.getTimezoneOffset(),_=f.getFullYear(),g=_<1;g&&(_=Math.abs(_)+1);var v=c(_,4)+"-"+c(f.getMonth()+1,2)+"-"+c(f.getDate(),2)+"T"+c(f.getHours(),2)+":"+c(f.getMinutes(),2)+":"+c(f.getSeconds(),2)+"."+c(f.getMilliseconds(),3);return h<0?(v+="-",h*=-1):v+="+",v+=c(Math.floor(h/60),2)+":"+c(h%60,2),g&&(v+=" BC"),v}function l(f){var h=f.getUTCFullYear(),_=h<1;_&&(h=Math.abs(h)+1);var g=c(h,4)+"-"+c(f.getUTCMonth()+1,2)+"-"+c(f.getUTCDate(),2)+"T"+c(f.getUTCHours(),2)+":"+c(f.getUTCMinutes(),2)+":"+c(f.getUTCSeconds(),2)+"."+c(f.getUTCMilliseconds(),3);return g+="+00:00",_&&(g+=" BC"),g}function p(f,h,_){return f=typeof f=="string"?{text:f}:f,h&&(typeof h=="function"?f.callback=h:f.values=h),_&&(f.callback=_),f}var d=function(f){return r.createHash("md5").update(f,"utf-8").digest("hex")},m=function(f,h,_){var g=d(h+f),v=d(Buffer.concat([Buffer.from(g),_]));return"md5"+v};t.exports={prepareValue:function(h){return a(h)},normalizeQueryConfig:p,postgresMd5PasswordHash:m,md5:d}}}),bOe=A({"../../node_modules/pg/lib/sasl.js"(e,t){"use strict";var r=require("crypto");function n(f){if(f.indexOf("SCRAM-SHA-256")===-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let h=r.randomBytes(18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:h,response:"n,,n=*,r="+h,message:"SASLInitialResponse"}}function i(f,h,_){if(f.message!=="SASLInitialResponse")throw new Error("SASL: Last message was not SASLInitialResponse");if(typeof h!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(h==="")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");if(typeof _!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let g=u(_);if(g.nonce.startsWith(f.clientNonce)){if(g.nonce.length===f.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");var v=Buffer.from(g.salt,"base64"),y=r.pbkdf2Sync(h,v,g.iteration,32,"sha256"),E=m(y,"Client Key"),q=d(E),C="n=*,r="+f.clientNonce,M="r="+g.nonce+",s="+g.salt+",i="+g.iteration,F="c=biws,r="+g.nonce,N=C+","+M+","+F,T=m(q,N),x=p(E,T),P=x.toString("base64"),G=m(y,"Server Key"),D=m(G,N);f.message="SASLResponse",f.serverSignature=D.toString("base64"),f.response=F+",p="+P}function s(f,h){if(f.message!=="SASLResponse")throw new Error("SASL: Last message was not SASLResponse");if(typeof h!="string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:_}=l(h);if(_!==f.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function a(f){if(typeof f!="string")throw new TypeError("SASL: text must be a string");return f.split("").map((h,_)=>f.charCodeAt(_)).every(h=>h>=33&&h<=43||h>=45&&h<=126)}function o(f){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(f)}function c(f){if(typeof f!="string")throw new TypeError("SASL: attribute pairs text must be a string");return new Map(f.split(",").map(h=>{if(!/^.=/.test(h))throw new Error("SASL: Invalid attribute pair entry");let _=h[0],g=h.substring(2);return[_,g]}))}function u(f){let h=c(f),_=h.get("r");if(_){if(!a(_))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let g=h.get("s");if(g){if(!o(g))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let v=h.get("i");if(v){if(!/^[1-9][0-9]*$/.test(v))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");let y=parseInt(v,10);return{nonce:_,salt:g,iteration:y}}function l(f){let _=c(f).get("v");if(_){if(!o(_))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:_}}function p(f,h){if(!Buffer.isBuffer(f))throw new TypeError("first argument must be a Buffer");if(!Buffer.isBuffer(h))throw new TypeError("second argument must be a Buffer");if(f.length!==h.length)throw new Error("Buffer lengths must match");if(f.length===0)throw new Error("Buffers cannot be empty");return Buffer.from(f.map((_,g)=>f[g]^h[g]))}function d(f){return r.createHash("sha256").update(f).digest()}function m(f,h){return r.createHmac("sha256",f).update(h).digest()}t.exports={startSession:n,continueSession:i,finalizeSession:s}}}),ROe=A({"../../node_modules/pgpass/node_modules/split2/index.js"(e,t){"use strict";var{Transform:r}=require("stream"),{StringDecoder:n}=require("string_decoder"),i=Symbol("last"),s=Symbol("decoder");function a(p,d,m){let f;if(this.overflow){if(f=this[s].write(p).split(this.matcher),f.length===1)return m();f.shift(),this.overflow=!1}else this[i]+=this[s].write(p),f=this[i].split(this.matcher);this[i]=f.pop();for(let h=0;h<f.length;h++)try{c(this,this.mapper(f[h]))}catch(_){return m(_)}if(this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow){m(new Error("maximum buffer reached"));return}m()}function o(p){if(this[i]+=this[s].end(),this[i])try{c(this,this.mapper(this[i]))}catch(d){return p(d)}p()}function c(p,d){d!==void 0&&p.push(d)}function u(p){return p}function l(p,d,m){switch(p=p||/\r?\n/,d=d||u,m=m||{},arguments.length){case 1:typeof p=="function"?(d=p,p=/\r?\n/):typeof p=="object"&&!(p instanceof RegExp)&&(m=p,p=/\r?\n/);break;case 2:typeof p=="function"?(m=d,d=p,p=/\r?\n/):typeof d=="object"&&(m=d,d=u)}m=Object.assign({},m),m.autoDestroy=!0,m.transform=a,m.flush=o,m.readableObjectMode=!0;let f=new r(m);return f[i]="",f[s]=new n("utf8"),f.matcher=p,f.mapper=d,f.maxLength=m.maxLength,f.skipOverflow=m.skipOverflow||!1,f.overflow=!1,f._destroy=function(h,_){this._writableState.errorEmitted=!1,_(h)},f}t.exports=l}}),xOe=A({"../../node_modules/pgpass/lib/helper.js"(e,t){"use strict";var r=require("path"),n=require("stream").Stream,i=ROe(),s=require("util"),a=5432,o=process.platform==="win32",c=process.stderr,u=56,l=7,p=61440,d=32768;function m(q){return(q&p)==d}var f=["host","port","database","user","password"],h=f.length,_=f[h-1];function g(){var q=c instanceof n&&c.writable===!0;if(q){var C=Array.prototype.slice.call(arguments).concat(`
134
136
  `);c.write(s.format.apply(s,C))}}Object.defineProperty(t.exports,"isWin",{get:function(){return o},set:function(q){o=q}}),t.exports.warnTo=function(q){var C=c;return c=q,C},t.exports.getFileName=function(q){var C=q||process.env,M=C.PGPASSFILE||(o?r.join(C.APPDATA||"./","postgresql","pgpass.conf"):r.join(C.HOME||"./",".pgpass"));return M},t.exports.usePgPass=function(q,C){return Object.prototype.hasOwnProperty.call(process.env,"PGPASSWORD")?!1:o?!0:(C=C||"<unkn>",m(q.mode)?q.mode&(u|l)?(g('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',C),!1):!0:(g('WARNING: password file "%s" is not a plain file',C),!1))};var v=t.exports.match=function(q,C){return f.slice(0,-1).reduce(function(M,F,N){return N==1&&Number(q[F]||a)===Number(C[F])?M&&!0:M&&(C[F]==="*"||C[F]===q[F])},!0)};t.exports.getPassword=function(q,C,M){var F,N=C.pipe(i());function T(G){var D=y(G);D&&E(D)&&v(q,D)&&(F=D[_],N.end())}var x=function(){C.destroy(),M(F)},P=function(G){C.destroy(),g("WARNING: error on reading file: %s",G),M(void 0)};C.on("error",P),N.on("data",T).on("end",x).on("error",P)};var y=t.exports.parseLine=function(q){if(q.length<11||q.match(/^\s+#/))return null;for(var C="",M="",F=0,N=0,T=0,x={},P=!1,G=function(H,B,ee){var O=q.substring(B,ee);Object.hasOwnProperty.call(process.env,"PGPASS_NO_DEESCAPE")||(O=O.replace(/\\([:\\])/g,"$1")),x[f[H]]=O},D=0;D<q.length-1;D+=1){if(C=q.charAt(D+1),M=q.charAt(D),P=F==h-1,P){G(F,N);break}D>=0&&C==":"&&M!=="\\"&&(G(F,N,D+1),N=D+2,F+=1)}return x=Object.keys(x).length===h?x:null,x},E=t.exports.isValidEntry=function(q){for(var C={0:function(x){return x.length>0},1:function(x){return x==="*"?!0:(x=Number(x),isFinite(x)&&x>0&&x<9007199254740992&&Math.floor(x)===x)},2:function(x){return x.length>0},3:function(x){return x.length>0},4:function(x){return x.length>0}},M=0;M<f.length;M+=1){var F=C[M],N=q[f[M]]||"",T=F(N);if(!T)return!1}return!0}}}),AOe=A({"../../node_modules/pgpass/lib/index.js"(e,t){"use strict";var r=require("path"),n=require("fs"),i=xOe();t.exports=function(s,a){var o=i.getFileName();n.stat(o,function(c,u){if(c||!i.usePgPass(u,o))return a(void 0);var l=n.createReadStream(o);i.getPassword(s,l,a)})},t.exports.warnTo=i.warnTo}}),i8=A({"../../node_modules/pg/lib/type-overrides.js"(e,t){"use strict";var r=b0();function n(i){this._types=i||r,this.text={},this.binary={}}n.prototype.getOverrides=function(i){switch(i){case"text":return this.text;case"binary":return this.binary;default:return{}}},n.prototype.setTypeParser=function(i,s,a){typeof s=="function"&&(a=s,s="text"),this.getOverrides(s)[i]=a},n.prototype.getTypeParser=function(i,s){return s=s||"text",this.getOverrides(s)[i]||this._types.getTypeParser(i,s)},t.exports=n}}),POe=A({"../../node_modules/pg-connection-string/index.js"(e,t){"use strict";var r=require("url"),n=require("fs");function i(s){if(s.charAt(0)==="/"){var o=s.split(" ");return{host:o[0],database:o[1]}}var a=r.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(s)?encodeURI(s).replace(/\%25(\d\d)/g,"%$1"):s,!0),o=a.query;for(var c in o)Array.isArray(o[c])&&(o[c]=o[c][o[c].length-1]);var u=(a.auth||":").split(":");if(o.user=u[0],o.password=u.splice(1).join(":"),o.port=a.port,a.protocol=="socket:")return o.host=decodeURI(a.pathname),o.database=a.query.db,o.client_encoding=a.query.encoding,o;o.host||(o.host=a.hostname);var l=a.pathname;if(!o.host&&l&&/^%2f/i.test(l)){var p=l.split("/");o.host=decodeURIComponent(p[0]),l=p.splice(1).join("/")}switch(l&&l.charAt(0)==="/"&&(l=l.slice(1)||null),o.database=l&&decodeURI(l),(o.ssl==="true"||o.ssl==="1")&&(o.ssl=!0),o.ssl==="0"&&(o.ssl=!1),(o.sslcert||o.sslkey||o.sslrootcert||o.sslmode)&&(o.ssl={}),o.sslcert&&(o.ssl.cert=n.readFileSync(o.sslcert).toString()),o.sslkey&&(o.ssl.key=n.readFileSync(o.sslkey).toString()),o.sslrootcert&&(o.ssl.ca=n.readFileSync(o.sslrootcert).toString()),o.sslmode){case"disable":{o.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{o.ssl.rejectUnauthorized=!1;break}}return o}t.exports=i,i.parse=i}}),s8=A({"../../node_modules/pg/lib/connection-parameters.js"(e,t){"use strict";var r=require("dns"),n=R0(),i=POe().parse,s=function(l,p,d){return d===void 0?d=process.env["PG"+l.toUpperCase()]:d===!1||(d=process.env[d]),p[l]||d||n[l]},a=function(){switch(process.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return n.ssl},o=function(l){return"'"+(""+l).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},c=function(l,p,d){var m=p[d];m!=null&&l.push(d+"="+o(m))},u=class{constructor(l){l=typeof l=="string"?i(l):l||{},l.connectionString&&(l=Object.assign({},l,i(l.connectionString))),this.user=s("user",l),this.database=s("database",l),this.database===void 0&&(this.database=this.user),this.port=parseInt(s("port",l),10),this.host=s("host",l),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:s("password",l)}),this.binary=s("binary",l),this.options=s("options",l),this.ssl=typeof l.ssl>"u"?a():l.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=s("client_encoding",l),this.replication=s("replication",l),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=s("application_name",l,"PGAPPNAME"),this.fallback_application_name=s("fallback_application_name",l,!1),this.statement_timeout=s("statement_timeout",l,!1),this.lock_timeout=s("lock_timeout",l,!1),this.idle_in_transaction_session_timeout=s("idle_in_transaction_session_timeout",l,!1),this.query_timeout=s("query_timeout",l,!1),l.connectionTimeoutMillis===void 0?this.connect_timeout=process.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(l.connectionTimeoutMillis/1e3),l.keepAlive===!1?this.keepalives=0:l.keepAlive===!0&&(this.keepalives=1),typeof l.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle=Math.floor(l.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(l){var p=[];c(p,this,"user"),c(p,this,"password"),c(p,this,"port"),c(p,this,"application_name"),c(p,this,"fallback_application_name"),c(p,this,"connect_timeout"),c(p,this,"options");var d=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(c(p,d,"sslmode"),c(p,d,"sslca"),c(p,d,"sslkey"),c(p,d,"sslcert"),c(p,d,"sslrootcert"),this.database&&p.push("dbname="+o(this.database)),this.replication&&p.push("replication="+o(this.replication)),this.host&&p.push("host="+o(this.host)),this.isDomainSocket)return l(null,p.join(" "));this.client_encoding&&p.push("client_encoding="+o(this.client_encoding)),r.lookup(this.host,function(m,f){return m?l(m,null):(p.push("hostaddr="+o(f)),l(null,p.join(" ")))})}};t.exports=u}}),IOe=A({"../../node_modules/pg/lib/result.js"(e,t){"use strict";var r=b0(),n=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,i=class{constructor(s,a){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=a,this.RowCtor=null,this.rowAsArray=s==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(s){var a;s.text?a=n.exec(s.text):a=n.exec(s.command),a&&(this.command=a[1],a[3]?(this.oid=parseInt(a[2],10),this.rowCount=parseInt(a[3],10)):a[2]&&(this.rowCount=parseInt(a[2],10)))}_parseRowAsArray(s){for(var a=new Array(s.length),o=0,c=s.length;o<c;o++){var u=s[o];u!==null?a[o]=this._parsers[o](u):a[o]=null}return a}parseRow(s){for(var a={},o=0,c=s.length;o<c;o++){var u=s[o],l=this.fields[o].name;u!==null?a[l]=this._parsers[o](u):a[l]=null}return a}addRow(s){this.rows.push(s)}addFields(s){this.fields=s,this.fields.length&&(this._parsers=new Array(s.length));for(var a=0;a<s.length;a++){var o=s[a];this._types?this._parsers[a]=this._types.getTypeParser(o.dataTypeID,o.format||"text"):this._parsers[a]=r.getTypeParser(o.dataTypeID,o.format||"text")}}};t.exports=i}}),COe=A({"../../node_modules/pg/lib/query.js"(e,t){"use strict";var{EventEmitter:r}=require("events"),n=IOe(),i=$C(),s=class extends r{constructor(a,o,c){super(),a=i.normalizeQueryConfig(a,o,c),this.text=a.text,this.values=a.values,this.rows=a.rows,this.types=a.types,this.name=a.name,this.binary=a.binary,this.portal=a.portal||"",this.callback=a.callback,this._rowMode=a.rowMode,process.domain&&a.callback&&(this.callback=process.domain.bind(a.callback)),this._result=new n(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this.text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new n(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(a){this._checkForMultirow(),this._result.addFields(a.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(a){let o;if(!this._canceledDueToError){try{o=this._result.parseRow(a.fields)}catch(c){this._canceledDueToError=c;return}this.emit("row",o,this._result),this._accumulateRows&&this._result.addRow(o)}}handleCommandComplete(a,o){this._checkForMultirow(),this._result.addCommandComplete(a),this.rows&&o.sync()}handleEmptyQuery(a){this.rows&&a.sync()}handleError(a,o){if(this._canceledDueToError&&(a=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(a);this.emit("error",a)}handleReadyForQuery(a){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,a);if(this.callback)try{this.callback(null,this._results)}catch(o){process.nextTick(()=>{throw o})}this.emit("end",this._results)}submit(a){if(typeof this.text!="string"&&typeof this.name!="string")return new Error("A query must have either text or a name. Supplying neither is unsupported.");let o=a.parsedStatements[this.name];return this.text&&o&&this.text!==o?new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`):this.values&&!Array.isArray(this.values)?new Error("Query values must be an array"):(this.requiresPreparation()?this.prepare(a):a.query(this.text),null)}hasBeenParsed(a){return this.name&&a.parsedStatements[this.name]}handlePortalSuspended(a){this._getRows(a,this.rows)}_getRows(a,o){a.execute({portal:this.portal,rows:o}),o?a.flush():a.sync()}prepare(a){this.isPreparedStatement=!0,this.hasBeenParsed(a)||a.parse({text:this.text,name:this.name,types:this.types});try{a.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:i.prepareValue})}catch(o){this.handleError(o,a);return}a.describe({type:"P",name:this.portal||""}),this._getRows(a,this.rows)}handleCopyInResponse(a){a.sendCopyFail("No source stream defined")}handleCopyData(a,o){}};t.exports=s}}),o8=A({"../../node_modules/pg-protocol/dist/messages.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:"parseComplete",length:5},e.bindComplete={name:"bindComplete",length:5},e.closeComplete={name:"closeComplete",length:5},e.noData={name:"noData",length:5},e.portalSuspended={name:"portalSuspended",length:5},e.replicationStart={name:"replicationStart",length:4},e.emptyQuery={name:"emptyQuery",length:4},e.copyDone={name:"copyDone",length:4};var t=class extends Error{constructor(h,_,g){super(h),this.length=_,this.name=g}};e.DatabaseError=t;var r=class{constructor(h,_){this.length=h,this.chunk=_,this.name="copyData"}};e.CopyDataMessage=r;var n=class{constructor(h,_,g,v){this.length=h,this.name=_,this.binary=g,this.columnTypes=new Array(v)}};e.CopyResponse=n;var i=class{constructor(h,_,g,v,y,E,q){this.name=h,this.tableID=_,this.columnID=g,this.dataTypeID=v,this.dataTypeSize=y,this.dataTypeModifier=E,this.format=q}};e.Field=i;var s=class{constructor(h,_){this.length=h,this.fieldCount=_,this.name="rowDescription",this.fields=new Array(this.fieldCount)}};e.RowDescriptionMessage=s;var a=class{constructor(h,_){this.length=h,this.parameterCount=_,this.name="parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};e.ParameterDescriptionMessage=a;var o=class{constructor(h,_,g){this.length=h,this.parameterName=_,this.parameterValue=g,this.name="parameterStatus"}};e.ParameterStatusMessage=o;var c=class{constructor(h,_){this.length=h,this.salt=_,this.name="authenticationMD5Password"}};e.AuthenticationMD5Password=c;var u=class{constructor(h,_,g){this.length=h,this.processID=_,this.secretKey=g,this.name="backendKeyData"}};e.BackendKeyDataMessage=u;var l=class{constructor(h,_,g,v){this.length=h,this.processId=_,this.channel=g,this.payload=v,this.name="notification"}};e.NotificationResponseMessage=l;var p=class{constructor(h,_){this.length=h,this.status=_,this.name="readyForQuery"}};e.ReadyForQueryMessage=p;var d=class{constructor(h,_){this.length=h,this.text=_,this.name="commandComplete"}};e.CommandCompleteMessage=d;var m=class{constructor(h,_){this.length=h,this.fields=_,this.name="dataRow",this.fieldCount=_.length}};e.DataRowMessage=m;var f=class{constructor(h,_){this.length=h,this.message=_,this.name="notice"}};e.NoticeMessage=f}}),TOe=A({"../../node_modules/pg-protocol/dist/buffer-writer.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0;var t=class{constructor(r=256){this.size=r,this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(r)}ensure(r){var n=this.buffer.length-this.offset;if(n<r){var i=this.buffer,s=i.length+(i.length>>1)+r;this.buffer=Buffer.allocUnsafe(s),i.copy(this.buffer)}}addInt32(r){return this.ensure(4),this.buffer[this.offset++]=r>>>24&255,this.buffer[this.offset++]=r>>>16&255,this.buffer[this.offset++]=r>>>8&255,this.buffer[this.offset++]=r>>>0&255,this}addInt16(r){return this.ensure(2),this.buffer[this.offset++]=r>>>8&255,this.buffer[this.offset++]=r>>>0&255,this}addCString(r){if(!r)this.ensure(1);else{var n=Buffer.byteLength(r);this.ensure(n+1),this.buffer.write(r,this.offset,"utf-8"),this.offset+=n}return this.buffer[this.offset++]=0,this}addString(r=""){var n=Buffer.byteLength(r);return this.ensure(n),this.buffer.write(r,this.offset),this.offset+=n,this}add(r){return this.ensure(r.length),r.copy(this.buffer,this.offset),this.offset+=r.length,this}join(r){if(r){this.buffer[this.headerPosition]=r;let n=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(n,this.headerPosition+1)}return this.buffer.slice(r?0:5,this.offset)}flush(r){var n=this.join(r);return this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(this.size),n}};e.Writer=t}}),OOe=A({"../../node_modules/pg-protocol/dist/serializer.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=TOe(),r=new t.Writer,n=D=>{r.addInt16(3).addInt16(0);for(let ee of Object.keys(D))r.addCString(ee).addCString(D[ee]);r.addCString("client_encoding").addCString("UTF8");var H=r.addCString("").flush(),B=H.length+4;return new t.Writer().addInt32(B).add(H).flush()},i=()=>{let D=Buffer.allocUnsafe(8);return D.writeInt32BE(8,0),D.writeInt32BE(80877103,4),D},s=D=>r.addCString(D).flush(112),a=function(D,H){return r.addCString(D).addInt32(Buffer.byteLength(H)).addString(H),r.flush(112)},o=function(D){return r.addString(D).flush(112)},c=D=>r.addCString(D).flush(81),u=[],l=D=>{let H=D.name||"";H.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",H,H.length),console.error("This can cause conflicts and silent errors executing queries"));let B=D.types||u;for(var ee=B.length,O=r.addCString(H).addCString(D.text).addInt16(ee),$=0;$<ee;$++)O.addInt32(B[$]);return r.flush(80)},p=new t.Writer,d=function(D,H){for(let B=0;B<D.length;B++){let ee=H?H(D[B],B):D[B];ee==null?(r.addInt16(0),p.addInt32(-1)):ee instanceof Buffer?(r.addInt16(1),p.addInt32(ee.length),p.add(ee)):(r.addInt16(0),p.addInt32(Buffer.byteLength(ee)),p.addString(ee))}},m=(D={})=>{let H=D.portal||"",B=D.statement||"",ee=D.binary||!1,O=D.values||u,$=O.length;return r.addCString(H).addCString(B),r.addInt16($),d(O,D.valueMapper),r.addInt16($),r.add(p.flush()),r.addInt16(ee?1:0),r.flush(66)},f=Buffer.from([69,0,0,0,9,0,0,0,0,0]),h=D=>{if(!D||!D.portal&&!D.rows)return f;let H=D.portal||"",B=D.rows||0,ee=Buffer.byteLength(H),O=4+ee+1+4,$=Buffer.allocUnsafe(1+O);return $[0]=69,$.writeInt32BE(O,1),$.write(H,5,"utf-8"),$[ee+5]=0,$.writeUInt32BE(B,$.length-4),$},_=(D,H)=>{let B=Buffer.allocUnsafe(16);return B.writeInt32BE(16,0),B.writeInt16BE(1234,4),B.writeInt16BE(5678,6),B.writeInt32BE(D,8),B.writeInt32BE(H,12),B},g=(D,H)=>{let ee=4+Buffer.byteLength(H)+1,O=Buffer.allocUnsafe(1+ee);return O[0]=D,O.writeInt32BE(ee,1),O.write(H,5,"utf-8"),O[ee]=0,O},v=r.addCString("P").flush(68),y=r.addCString("S").flush(68),E=D=>D.name?g(68,`${D.type}${D.name||""}`):D.type==="P"?v:y,q=D=>{let H=`${D.type}${D.name||""}`;return g(67,H)},C=D=>r.add(D).flush(100),M=D=>g(102,D),F=D=>Buffer.from([D,0,0,0,4]),N=F(72),T=F(83),x=F(88),P=F(99),G={startup:n,password:s,requestSsl:i,sendSASLInitialResponseMessage:a,sendSCRAMClientFinalMessage:o,query:c,parse:l,bind:m,execute:h,describe:E,close:q,flush:()=>N,sync:()=>T,end:()=>x,copyData:C,copyDone:()=>P,copyFail:M,cancel:_};e.serialize=G}}),NOe=A({"../../node_modules/pg-protocol/dist/buffer-reader.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BufferReader=void 0;var t=Buffer.allocUnsafe(0),r=class{constructor(n=0){this.offset=n,this.buffer=t,this.encoding="utf-8"}setBuffer(n,i){this.offset=n,this.buffer=i}int16(){let n=this.buffer.readInt16BE(this.offset);return this.offset+=2,n}byte(){let n=this.buffer[this.offset];return this.offset++,n}int32(){let n=this.buffer.readInt32BE(this.offset);return this.offset+=4,n}string(n){let i=this.buffer.toString(this.encoding,this.offset,this.offset+n);return this.offset+=n,i}cstring(){let n=this.offset,i=n;for(;this.buffer[i++]!==0;);return this.offset=i,this.buffer.toString(this.encoding,n,i-1)}bytes(n){let i=this.buffer.slice(this.offset,this.offset+n);return this.offset+=n,i}};e.BufferReader=r}}),jOe=A({"../../node_modules/pg-protocol/dist/parser.js"(e){"use strict";var t=e&&e.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var r=o8(),n=NOe(),i=t(require("assert")),s=1,a=4,o=s+a,c=Buffer.allocUnsafe(0),u=class{constructor(l){if(this.buffer=c,this.bufferLength=0,this.bufferOffset=0,this.reader=new n.BufferReader,(l==null?void 0:l.mode)==="binary")throw new Error("Binary mode not supported yet");this.mode=(l==null?void 0:l.mode)||"text"}parse(l,p){this.mergeBuffer(l);let d=this.bufferOffset+this.bufferLength,m=this.bufferOffset;for(;m+o<=d;){let f=this.buffer[m],h=this.buffer.readUInt32BE(m+s),_=s+h;if(_+m<=d){let g=this.handlePacket(m+o,f,h,this.buffer);p(g),m+=_}else break}m===d?(this.buffer=c,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=d-m,this.bufferOffset=m)}mergeBuffer(l){if(this.bufferLength>0){let p=this.bufferLength+l.byteLength;if(p+this.bufferOffset>this.buffer.byteLength){let m;if(p<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)m=this.buffer;else{let f=this.buffer.byteLength*2;for(;p>=f;)f*=2;m=Buffer.allocUnsafe(f)}this.buffer.copy(m,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=m,this.bufferOffset=0}l.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=p}else this.buffer=l,this.bufferOffset=0,this.bufferLength=l.byteLength}handlePacket(l,p,d,m){switch(p){case 50:return r.bindComplete;case 49:return r.parseComplete;case 51:return r.closeComplete;case 110:return r.noData;case 115:return r.portalSuspended;case 99:return r.copyDone;case 87:return r.replicationStart;case 73:return r.emptyQuery;case 68:return this.parseDataRowMessage(l,d,m);case 67:return this.parseCommandCompleteMessage(l,d,m);case 90:return this.parseReadyForQueryMessage(l,d,m);case 65:return this.parseNotificationMessage(l,d,m);case 82:return this.parseAuthenticationResponse(l,d,m);case 83:return this.parseParameterStatusMessage(l,d,m);case 75:return this.parseBackendKeyData(l,d,m);case 69:return this.parseErrorMessage(l,d,m,"error");case 78:return this.parseErrorMessage(l,d,m,"notice");case 84:return this.parseRowDescriptionMessage(l,d,m);case 116:return this.parseParameterDescriptionMessage(l,d,m);case 71:return this.parseCopyInMessage(l,d,m);case 72:return this.parseCopyOutMessage(l,d,m);case 100:return this.parseCopyData(l,d,m);default:i.default.fail(`unknown message code: ${p.toString(16)}`)}}parseReadyForQueryMessage(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.string(1);return new r.ReadyForQueryMessage(p,m)}parseCommandCompleteMessage(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.cstring();return new r.CommandCompleteMessage(p,m)}parseCopyData(l,p,d){let m=d.slice(l,l+(p-4));return new r.CopyDataMessage(p,m)}parseCopyInMessage(l,p,d){return this.parseCopyMessage(l,p,d,"copyInResponse")}parseCopyOutMessage(l,p,d){return this.parseCopyMessage(l,p,d,"copyOutResponse")}parseCopyMessage(l,p,d,m){this.reader.setBuffer(l,d);let f=this.reader.byte()!==0,h=this.reader.int16(),_=new r.CopyResponse(p,m,f,h);for(let g=0;g<h;g++)_.columnTypes[g]=this.reader.int16();return _}parseNotificationMessage(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.int32(),f=this.reader.cstring(),h=this.reader.cstring();return new r.NotificationResponseMessage(p,m,f,h)}parseRowDescriptionMessage(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.int16(),f=new r.RowDescriptionMessage(p,m);for(let h=0;h<m;h++)f.fields[h]=this.parseField();return f}parseField(){let l=this.reader.cstring(),p=this.reader.int32(),d=this.reader.int16(),m=this.reader.int32(),f=this.reader.int16(),h=this.reader.int32(),_=this.reader.int16()===0?"text":"binary";return new r.Field(l,p,d,m,f,h,_)}parseParameterDescriptionMessage(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.int16(),f=new r.ParameterDescriptionMessage(p,m);for(let h=0;h<m;h++)f.dataTypeIDs[h]=this.reader.int32();return f}parseDataRowMessage(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.int16(),f=new Array(m);for(let h=0;h<m;h++){let _=this.reader.int32();f[h]=_===-1?null:this.reader.string(_)}return new r.DataRowMessage(p,f)}parseParameterStatusMessage(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.cstring(),f=this.reader.cstring();return new r.ParameterStatusMessage(p,m,f)}parseBackendKeyData(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.int32(),f=this.reader.int32();return new r.BackendKeyDataMessage(p,m,f)}parseAuthenticationResponse(l,p,d){this.reader.setBuffer(l,d);let m=this.reader.int32(),f={name:"authenticationOk",length:p};switch(m){case 0:break;case 3:f.length===8&&(f.name="authenticationCleartextPassword");break;case 5:if(f.length===12){f.name="authenticationMD5Password";let _=this.reader.bytes(4);return new r.AuthenticationMD5Password(p,_)}break;case 10:f.name="authenticationSASL",f.mechanisms=[];let h;do h=this.reader.cstring(),h&&f.mechanisms.push(h);while(h);break;case 11:f.name="authenticationSASLContinue",f.data=this.reader.string(p-8);break;case 12:f.name="authenticationSASLFinal",f.data=this.reader.string(p-8);break;default:throw new Error("Unknown authenticationOk message type "+m)}return f}parseErrorMessage(l,p,d,m){this.reader.setBuffer(l,d);let f={},h=this.reader.string(1);for(;h!=="\0";)f[h]=this.reader.cstring(),h=this.reader.string(1);let _=f.M,g=m==="notice"?new r.NoticeMessage(p,_):new r.DatabaseError(_,p,m);return g.severity=f.S,g.code=f.C,g.detail=f.D,g.hint=f.H,g.position=f.P,g.internalPosition=f.p,g.internalQuery=f.q,g.where=f.W,g.schema=f.s,g.table=f.t,g.column=f.c,g.dataType=f.d,g.constraint=f.n,g.file=f.F,g.line=f.L,g.routine=f.R,g}};e.Parser=u}}),a8=A({"../../node_modules/pg-protocol/dist/index.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseError=e.serialize=e.parse=void 0;var t=o8();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:function(){return t.DatabaseError}});var r=OOe();Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return r.serialize}});var n=jOe();function i(s,a){let o=new n.Parser;return s.on("data",c=>o.parse(c,a)),new Promise(c=>s.on("end",()=>c()))}e.parse=i}}),c8=A({"../../node_modules/pg/lib/connection.js"(e,t){"use strict";var r=require("net"),n=require("events").EventEmitter,{parse:i,serialize:s}=a8(),a=s.flush(),o=s.sync(),c=s.end(),u=class extends n{constructor(l){super(),l=l||{},this.stream=l.stream||new r.Socket,typeof this.stream=="function"&&(this.stream=this.stream(l)),this._keepAlive=l.keepAlive,this._keepAliveInitialDelayMillis=l.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=l.ssl||!1,this._ending=!1,this._emitMessage=!1;var p=this;this.on("newListener",function(d){d==="message"&&(p._emitMessage=!0)})}connect(l,p){var d=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(l,p),this.stream.once("connect",function(){d._keepAlive&&d.stream.setKeepAlive(!0,d._keepAliveInitialDelayMillis),d.emit("connect")});let m=function(f){d._ending&&(f.code==="ECONNRESET"||f.code==="EPIPE")||d.emit("error",f)};if(this.stream.on("error",m),this.stream.on("close",function(){d.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(f){var h=f.toString("utf8");switch(h){case"S":break;case"N":return d.stream.end(),d.emit("error",new Error("The server does not support SSL connections"));default:return d.stream.end(),d.emit("error",new Error("There was an error establishing an SSL connection"))}var _=require("tls");let g={socket:d.stream};d.ssl!==!0&&(Object.assign(g,d.ssl),"key"in d.ssl&&(g.key=d.ssl.key)),r.isIP(p)===0&&(g.servername=p);try{d.stream=_.connect(g)}catch(v){return d.emit("error",v)}d.attachListeners(d.stream),d.stream.on("error",m),d.emit("sslconnect")})}attachListeners(l){l.on("end",()=>{this.emit("end")}),i(l,p=>{var d=p.name==="error"?"errorMessage":p.name;this._emitMessage&&this.emit("message",p),this.emit(d,p)})}requestSsl(){this.stream.write(s.requestSsl())}startup(l){this.stream.write(s.startup(l))}cancel(l,p){this._send(s.cancel(l,p))}password(l){this._send(s.password(l))}sendSASLInitialResponseMessage(l,p){this._send(s.sendSASLInitialResponseMessage(l,p))}sendSCRAMClientFinalMessage(l){this._send(s.sendSCRAMClientFinalMessage(l))}_send(l){return this.stream.writable?this.stream.write(l):!1}query(l){this._send(s.query(l))}parse(l){this._send(s.parse(l))}bind(l){this._send(s.bind(l))}execute(l){this._send(s.execute(l))}flush(){this.stream.writable&&this.stream.write(a)}sync(){this._ending=!0,this._send(o)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this.stream.end();return}return this.stream.write(c,()=>{this.stream.end()})}close(l){this._send(s.close(l))}describe(l){this._send(s.describe(l))}sendCopyFromChunk(l){this._send(s.copyData(l))}endCopyFrom(){this._send(s.copyDone())}sendCopyFail(l){this._send(s.copyFail(l))}};t.exports=u}}),qOe=A({"../../node_modules/pg/lib/client.js"(e,t){"use strict";var r=require("events").EventEmitter,n=$C(),i=bOe(),s=AOe(),a=i8(),o=s8(),c=COe(),u=R0(),l=c8(),p=class extends r{constructor(d){super(),this.connectionParameters=new o(d),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;var m=d||{};this._Promise=m.Promise||global.Promise,this._types=new a(m.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection=m.connection||new l({stream:m.stream,ssl:this.connectionParameters.ssl,keepAlive:m.keepAlive||!1,keepAliveInitialDelayMillis:m.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=m.binary||u.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=m.connectionTimeoutMillis||0}_errorAllQueries(d){let m=f=>{process.nextTick(()=>{f.handleError(d,this.connection)})};this.activeQuery&&(m(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(m),this.queryQueue.length=0}_connect(d){var m=this,f=this.connection;if(this._connectionCallback=d,this._connecting||this._connected){let h=new Error("Client has already been connected. You cannot reuse a client.");process.nextTick(()=>{d(h)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{f._ending=!0,f.stream.destroy(new Error("timeout expired"))},this._connectionTimeoutMillis)),this.host&&this.host.indexOf("/")===0?f.connect(this.host+"/.s.PGSQL."+this.port):f.connect(this.port,this.host),f.on("connect",function(){m.ssl?f.requestSsl():f.startup(m.getStartupConf())}),f.on("sslconnect",function(){f.startup(m.getStartupConf())}),this._attachListeners(f),f.once("end",()=>{let h=this._ending?new Error("Connection terminated"):new Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(h),this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(h):this._handleErrorEvent(h):this._connectionError||this._handleErrorEvent(h)),process.nextTick(()=>{this.emit("end")})})}connect(d){if(d){this._connect(d);return}return new this._Promise((m,f)=>{this._connect(h=>{h?f(h):m()})})}_attachListeners(d){d.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),d.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),d.on("authenticationSASL",this._handleAuthSASL.bind(this)),d.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),d.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),d.on("backendKeyData",this._handleBackendKeyData.bind(this)),d.on("error",this._handleErrorEvent.bind(this)),d.on("errorMessage",this._handleErrorMessage.bind(this)),d.on("readyForQuery",this._handleReadyForQuery.bind(this)),d.on("notice",this._handleNotice.bind(this)),d.on("rowDescription",this._handleRowDescription.bind(this)),d.on("dataRow",this._handleDataRow.bind(this)),d.on("portalSuspended",this._handlePortalSuspended.bind(this)),d.on("emptyQuery",this._handleEmptyQuery.bind(this)),d.on("commandComplete",this._handleCommandComplete.bind(this)),d.on("parseComplete",this._handleParseComplete.bind(this)),d.on("copyInResponse",this._handleCopyInResponse.bind(this)),d.on("copyData",this._handleCopyData.bind(this)),d.on("notification",this._handleNotification.bind(this))}_checkPgPass(d){let m=this.connection;typeof this.password=="function"?this._Promise.resolve().then(()=>this.password()).then(f=>{if(f!==void 0){if(typeof f!="string"){m.emit("error",new TypeError("Password must be a string"));return}this.connectionParameters.password=this.password=f}else this.connectionParameters.password=this.password=null;d()}).catch(f=>{m.emit("error",f)}):this.password!==null?d():s(this.connectionParameters,f=>{f!==void 0&&(this.connectionParameters.password=this.password=f),d()})}_handleAuthCleartextPassword(d){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(d){this._checkPgPass(()=>{let m=n.postgresMd5PasswordHash(this.user,this.password,d.salt);this.connection.password(m)})}_handleAuthSASL(d){this._checkPgPass(()=>{try{this.saslSession=i.startSession(d.mechanisms),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)}catch(m){this.connection.emit("error",m)}})}_handleAuthSASLContinue(d){try{i.continueSession(this.saslSession,this.password,d.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}catch(m){this.connection.emit("error",m)}}_handleAuthSASLFinal(d){try{i.finalizeSession(this.saslSession,d.data),this.saslSession=null}catch(m){this.connection.emit("error",m)}}_handleBackendKeyData(d){this.processID=d.processID,this.secretKey=d.secretKey}_handleReadyForQuery(d){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let{activeQuery:m}=this;this.activeQuery=null,this.readyForQuery=!0,m&&m.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(d){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(d);this.emit("error",d)}}_handleErrorEvent(d){if(this._connecting)return this._handleErrorWhileConnecting(d);this._queryable=!1,this._errorAllQueries(d),this.emit("error",d)}_handleErrorMessage(d){if(this._connecting)return this._handleErrorWhileConnecting(d);let m=this.activeQuery;if(!m){this._handleErrorEvent(d);return}this.activeQuery=null,m.handleError(d,this.connection)}_handleRowDescription(d){this.activeQuery.handleRowDescription(d)}_handleDataRow(d){this.activeQuery.handleDataRow(d)}_handlePortalSuspended(d){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(d){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(d){this.activeQuery.handleCommandComplete(d,this.connection)}_handleParseComplete(d){this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(d){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(d){this.activeQuery.handleCopyData(d,this.connection)}_handleNotification(d){this.emit("notification",d)}_handleNotice(d){this.emit("notice",d)}getStartupConf(){var d=this.connectionParameters,m={user:d.user,database:d.database},f=d.application_name||d.fallback_application_name;return f&&(m.application_name=f),d.replication&&(m.replication=""+d.replication),d.statement_timeout&&(m.statement_timeout=String(parseInt(d.statement_timeout,10))),d.lock_timeout&&(m.lock_timeout=String(parseInt(d.lock_timeout,10))),d.idle_in_transaction_session_timeout&&(m.idle_in_transaction_session_timeout=String(parseInt(d.idle_in_transaction_session_timeout,10))),d.options&&(m.options=d.options),m}cancel(d,m){if(d.activeQuery===m){var f=this.connection;this.host&&this.host.indexOf("/")===0?f.connect(this.host+"/.s.PGSQL."+this.port):f.connect(this.port,this.host),f.on("connect",function(){f.cancel(d.processID,d.secretKey)})}else d.queryQueue.indexOf(m)!==-1&&d.queryQueue.splice(d.queryQueue.indexOf(m),1)}setTypeParser(d,m,f){return this._types.setTypeParser(d,m,f)}getTypeParser(d,m){return this._types.getTypeParser(d,m)}escapeIdentifier(d){return'"'+d.replace(/"/g,'""')+'"'}escapeLiteral(d){for(var m=!1,f="'",h=0;h<d.length;h++){var _=d[h];_==="'"?f+=_+_:_==="\\"?(f+=_+_,m=!0):f+=_}return f+="'",m===!0&&(f=" E"+f),f}_pulseQueryQueue(){if(this.readyForQuery===!0)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let d=this.activeQuery.submit(this.connection);d&&process.nextTick(()=>{this.activeQuery.handleError(d,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit("drain"))}query(d,m,f){var h,_,g,v,y;if(d==null)throw new TypeError("Client was passed a null or undefined query");return typeof d.submit=="function"?(g=d.query_timeout||this.connectionParameters.query_timeout,_=h=d,typeof m=="function"&&(h.callback=h.callback||m)):(g=this.connectionParameters.query_timeout,h=new c(d,m,f),h.callback||(_=new this._Promise((E,q)=>{h.callback=(C,M)=>C?q(C):E(M)}))),g&&(y=h.callback,v=setTimeout(()=>{var E=new Error("Query read timeout");process.nextTick(()=>{h.handleError(E,this.connection)}),y(E),h.callback=()=>{};var q=this.queryQueue.indexOf(h);q>-1&&this.queryQueue.splice(q,1),this._pulseQueryQueue()},g),h.callback=(E,q)=>{clearTimeout(v),y(E,q)}),this.binary&&!h.binary&&(h.binary=!0),h._result&&!h._result._types&&(h._result._types=this._types),this._queryable?this._ending?(process.nextTick(()=>{h.handleError(new Error("Client was closed and is not queryable"),this.connection)}),_):(this.queryQueue.push(h),this._pulseQueryQueue(),_):(process.nextTick(()=>{h.handleError(new Error("Client has encountered a connection error and is not queryable"),this.connection)}),_)}ref(){this.connection.ref()}unref(){this.connection.unref()}end(d){if(this._ending=!0,!this.connection._connecting)if(d)d();else return this._Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),d)this.connection.once("end",d);else return new this._Promise(m=>{this.connection.once("end",m)})}};p.Query=c,t.exports=p}}),MOe=A({"../../node_modules/pg-pool/index.js"(e,t){"use strict";var r=require("events").EventEmitter,n=function(){},i=(p,d)=>{let m=p.findIndex(d);return m===-1?void 0:p.splice(m,1)[0]},s=class{constructor(p,d,m){this.client=p,this.idleListener=d,this.timeoutId=m}},a=class{constructor(p){this.callback=p}};function o(){throw new Error("Release called on client which has already been released to the pool.")}function c(p,d){if(d)return{callback:d,result:void 0};let m,f,h=function(g,v){g?m(g):f(v)},_=new p(function(g,v){f=g,m=v});return{callback:h,result:_}}function u(p,d){return function m(f){f.client=d,d.removeListener("error",m),d.on("error",()=>{p.log("additional client error after disconnection due to error",f)}),p._remove(d),p.emit("error",f,d)}}var l=class extends r{constructor(p,d){super(),this.options=Object.assign({},p),p!=null&&"password"in p&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:p.password}),p!=null&&p.ssl&&p.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||d||UC().Client,this.Promise=this.options.Promise||global.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_pulseQueue(){if(this.log("pulse queue"),this.ended){this.log("pulse queue ended");return}if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(d=>{this._remove(d.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&&this._isFull())return;let p=this._pendingQueue.shift();if(this._idle.length){let d=this._idle.pop();clearTimeout(d.timeoutId);let m=d.client;m.ref&&m.ref();let f=d.idleListener;return this._acquireClient(m,p,f,!1)}if(!this._isFull())return this.newClient(p);throw new Error("unexpected condition")}_remove(p){let d=i(this._idle,m=>m.client===p);d!==void 0&&clearTimeout(d.timeoutId),this._clients=this._clients.filter(m=>m!==p),p.end(),this.emit("remove",p)}connect(p){if(this.ending){let f=new Error("Cannot use a pool after calling end on the pool");return p?p(f):this.Promise.reject(f)}let d=c(this.Promise,p),m=d.result;if(this._isFull()||this._idle.length){if(this._idle.length&&process.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new a(d.callback)),m;let f=(g,v,y)=>{clearTimeout(_),d.callback(g,v,y)},h=new a(f),_=setTimeout(()=>{i(this._pendingQueue,g=>g.callback===f),h.timedOut=!0,d.callback(new Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return this._pendingQueue.push(h),m}return this.newClient(new a(d.callback)),m}newClient(p){let d=new this.Client(this.options);this._clients.push(d);let m=u(this,d);this.log("checking client timeout");let f,h=!1;this.options.connectionTimeoutMillis&&(f=setTimeout(()=>{this.log("ending client due to timeout"),h=!0,d.connection?d.connection.stream.destroy():d.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"),d.connect(_=>{if(f&&clearTimeout(f),d.on("error",m),_)this.log("client failed to connect",_),this._clients=this._clients.filter(g=>g!==d),h&&(_.message="Connection terminated due to connection timeout"),this._pulseQueue(),p.timedOut||p.callback(_,void 0,n);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!==0){let g=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(d),this._idle.findIndex(y=>y.client===d)!==-1&&this._acquireClient(d,new a((y,E,q)=>q()),m,!1)},this.options.maxLifetimeSeconds*1e3);g.unref(),d.once("end",()=>clearTimeout(g))}return this._acquireClient(d,p,m,!0)}})}_acquireClient(p,d,m,f){f&&this.emit("connect",p),this.emit("acquire",p),p.release=this._releaseOnce(p,m),p.removeListener("error",m),d.timedOut?f&&this.options.verify?this.options.verify(p,p.release):p.release():f&&this.options.verify?this.options.verify(p,h=>{if(h)return p.release(h),d.callback(h,void 0,n);d.callback(void 0,p,p.release)}):d.callback(void 0,p,p.release)}_releaseOnce(p,d){let m=!1;return f=>{m&&o(),m=!0,this._release(p,d,f)}}_release(p,d,m){if(p.on("error",d),p._poolUseCount=(p._poolUseCount||0)+1,this.emit("release",m,p),m||this.ending||!p._queryable||p._ending||p._poolUseCount>=this.options.maxUses){p._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this._remove(p),this._pulseQueue();return}if(this._expired.has(p)){this.log("remove expired client"),this._expired.delete(p),this._remove(p),this._pulseQueue();return}let h;this.options.idleTimeoutMillis&&(h=setTimeout(()=>{this.log("remove idle client"),this._remove(p)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&h.unref()),this.options.allowExitOnIdle&&p.unref(),this._idle.push(new s(p,d,h)),this._pulseQueue()}query(p,d,m){if(typeof p=="function"){let h=c(this.Promise,p);return setImmediate(function(){return h.callback(new Error("Passing a function as the first parameter to pool.query is not supported"))}),h.result}typeof d=="function"&&(m=d,d=void 0);let f=c(this.Promise,m);return m=f.callback,this.connect((h,_)=>{if(h)return m(h);let g=!1,v=y=>{g||(g=!0,_.release(y),m(y))};_.once("error",v),this.log("dispatching query");try{_.query(p,d,(y,E)=>{if(this.log("query dispatched"),_.removeListener("error",v),!g)return g=!0,_.release(y),y?m(y):m(void 0,E)})}catch(y){return _.release(y),m(y)}}),f.result}end(p){if(this.log("ending"),this.ending){let m=new Error("Called end on pool more than once");return p?p(m):this.Promise.reject(m)}this.ending=!0;let d=c(this.Promise,p);return this._endCallback=d.callback,this._pulseQueue(),d.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((p,d)=>p+(this._expired.has(d)?1:0),0)}get totalCount(){return this._clients.length}};t.exports=l}}),kOe=A({"../../node_modules/pg/lib/native/query.js"(e,t){"use strict";var r=require("events").EventEmitter,n=require("util"),i=$C(),s=t.exports=function(o,c,u){r.call(this),o=i.normalizeQueryConfig(o,c,u),this.text=o.text,this.values=o.values,this.name=o.name,this.callback=o.callback,this.state="new",this._arrayMode=o.rowMode==="array",this._emitRowEvents=!1,this.on("newListener",function(l){l==="row"&&(this._emitRowEvents=!0)}.bind(this))};n.inherits(s,r);var a={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};s.prototype.handleError=function(o){var c=this.native.pq.resultErrorFields();if(c)for(var u in c){var l=a[u]||u;o[l]=c[u]}this.callback?this.callback(o):this.emit("error",o),this.state="error"},s.prototype.then=function(o,c){return this._getPromise().then(o,c)},s.prototype.catch=function(o){return this._getPromise().catch(o)},s.prototype._getPromise=function(){return this._promise?this._promise:(this._promise=new Promise(function(o,c){this._once("end",o),this._once("error",c)}.bind(this)),this._promise)},s.prototype.submit=function(o){this.state="running";var c=this;this.native=o.native,o.native.arrayMode=this._arrayMode;var u=function(d,m,f){if(o.native.arrayMode=!1,setImmediate(function(){c.emit("_done")}),d)return c.handleError(d);c._emitRowEvents&&(f.length>1?m.forEach((h,_)=>{h.forEach(g=>{c.emit("row",g,f[_])})}):m.forEach(function(h){c.emit("row",h,f)})),c.state="end",c.emit("end",f),c.callback&&c.callback(null,f)};if(process.domain&&(u=process.domain.bind(u)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));var l=(this.values||[]).map(i.prepareValue);if(o.namedQueries[this.name]){if(this.text&&o.namedQueries[this.name]!==this.text){let d=new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);return u(d)}return o.native.execute(this.name,l,u)}return o.native.prepare(this.name,this.text,l.length,function(d){return d?u(d):(o.namedQueries[c.name]=c.text,c.native.execute(c.name,l,u))})}else if(this.values){if(!Array.isArray(this.values)){let d=new Error("Query values must be an array");return u(d)}var p=this.values.map(i.prepareValue);o.native.query(this.text,p,u)}else o.native.query(this.text,u)}}}),DOe=A({"../../node_modules/pg/lib/native/client.js"(e,t){"use strict";var r=require("pg-native"),n=i8(),i=require("events").EventEmitter,s=require("util"),a=s8(),o=kOe(),c=t.exports=function(u){i.call(this),u=u||{},this._Promise=u.Promise||global.Promise,this._types=new n(u.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;var l=this.connectionParameters=new a(u);this.user=l.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:l.password}),this.database=l.database,this.host=l.host,this.port=l.port,this.namedQueries={}};c.Query=o,s.inherits(c,i),c.prototype._errorAllQueries=function(u){let l=p=>{process.nextTick(()=>{p.native=this.native,p.handleError(u)})};this._hasActiveQuery()&&(l(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(l),this._queryQueue.length=0},c.prototype._connect=function(u){var l=this;if(this._connecting){process.nextTick(()=>u(new Error("Client has already been connected. You cannot reuse a client.")));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(p,d){if(p)return u(p);l.native.connect(d,function(m){if(m)return l.native.end(),u(m);l._connected=!0,l.native.on("error",function(f){l._queryable=!1,l._errorAllQueries(f),l.emit("error",f)}),l.native.on("notification",function(f){l.emit("notification",{channel:f.relname,payload:f.extra})}),l.emit("connect"),l._pulseQueryQueue(!0),u()})})},c.prototype.connect=function(u){if(u){this._connect(u);return}return new this._Promise((l,p)=>{this._connect(d=>{d?p(d):l()})})},c.prototype.query=function(u,l,p){var d,m,f,h,_;if(u==null)throw new TypeError("Client was passed a null or undefined query");if(typeof u.submit=="function")f=u.query_timeout||this.connectionParameters.query_timeout,m=d=u,typeof l=="function"&&(u.callback=l);else if(f=this.connectionParameters.query_timeout,d=new o(u,l,p),!d.callback){let g,v;m=new this._Promise((y,E)=>{g=y,v=E}),d.callback=(y,E)=>y?v(y):g(E)}return f&&(_=d.callback,h=setTimeout(()=>{var g=new Error("Query read timeout");process.nextTick(()=>{d.handleError(g,this.connection)}),_(g),d.callback=()=>{};var v=this._queryQueue.indexOf(d);v>-1&&this._queryQueue.splice(v,1),this._pulseQueryQueue()},f),d.callback=(g,v)=>{clearTimeout(h),_(g,v)}),this._queryable?this._ending?(d.native=this.native,process.nextTick(()=>{d.handleError(new Error("Client was closed and is not queryable"))}),m):(this._queryQueue.push(d),this._pulseQueryQueue(),m):(d.native=this.native,process.nextTick(()=>{d.handleError(new Error("Client has encountered a connection error and is not queryable"))}),m)},c.prototype.end=function(u){var l=this;this._ending=!0,this._connected||this.once("connect",this.end.bind(this,u));var p;return u||(p=new this._Promise(function(d,m){u=f=>f?m(f):d()})),this.native.end(function(){l._errorAllQueries(new Error("Connection terminated")),process.nextTick(()=>{l.emit("end"),u&&u()})}),p},c.prototype._hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"},c.prototype._pulseQueryQueue=function(u){if(this._connected&&!this._hasActiveQuery()){var l=this._queryQueue.shift();if(!l){u||this.emit("drain");return}this._activeQuery=l,l.submit(this);var p=this;l.once("_done",function(){p._pulseQueryQueue()})}},c.prototype.cancel=function(u){this._activeQuery===u?this.native.cancel(function(){}):this._queryQueue.indexOf(u)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(u),1)},c.prototype.ref=function(){},c.prototype.unref=function(){},c.prototype.setTypeParser=function(u,l,p){return this._types.setTypeParser(u,l,p)},c.prototype.getTypeParser=function(u,l){return this._types.getTypeParser(u,l)}}}),BB=A({"../../node_modules/pg/lib/native/index.js"(e,t){"use strict";t.exports=DOe()}}),UC=A({"../../node_modules/pg/lib/index.js"(e,t){"use strict";var r=qOe(),n=R0(),i=c8(),s=MOe(),{DatabaseError:a}=a8(),o=u=>class extends s{constructor(p){super(p,u)}},c=function(u){this.defaults=n,this.Client=u,this.Query=this.Client.Query,this.Pool=o(this.Client),this._pools=[],this.Connection=i,this.types=b0(),this.DatabaseError=a};typeof process.env.NODE_PG_FORCE_NATIVE<"u"?t.exports=new c(BB()):(t.exports=new c(r),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){var u=null;try{u=new c(BB())}catch(l){if(l.code!=="MODULE_NOT_FOUND")throw l}return Object.defineProperty(t.exports,"native",{value:u}),u}}))}}),Rn=A({"../../node_modules/logform/format.js"(e,t){"use strict";var r=class extends Error{constructor(n){super(`Format functions must be synchronous taking a two arguments: (info, opts)
135
137
  Found: ${n.toString().split(`
@@ -236,7 +238,7 @@ safe-buffer/index.js:
236
238
  */
237
239
  /**
238
240
  * @title @squiz/content-api
239
- * @version 1.22.1-alpha.7
241
+ * @version 1.22.1-alpha.9
240
242
  * @license ISC
241
243
  * @baseUrl /
242
244
  * @contact