@squiz/component-cli-lib 1.21.1-alpha.30 → 1.21.1-alpha.31

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,22 +1,22 @@
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
- 5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
7
- 6 timing config:load:builtin Completed in 1ms
6
+ 5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
7
+ 6 timing config:load:builtin Completed in 0ms
8
8
  7 timing config:load:cli Completed in 2ms
9
9
  8 timing config:load:env Completed in 1ms
10
10
  9 info found workspace root at /builds/developer-experience/cmp
11
- 10 timing config:load:file:/builds/developer-experience/cmp/.npmrc Completed in 1ms
12
- 11 timing config:load:project Completed in 21ms
11
+ 10 timing config:load:file:/builds/developer-experience/cmp/.npmrc Completed in 0ms
12
+ 11 timing config:load:project Completed in 19ms
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 30ms
19
- 18 timing npm:load:configload Completed in 30ms
18
+ 17 timing config:load Completed in 27ms
19
+ 18 timing npm:load:configload Completed in 29ms
20
20
  19 timing npm:load:mkdirpcache Completed in 0ms
21
21
  20 timing npm:load:mkdirplogs Completed in 0ms
22
22
  21 verbose title npm run compile
@@ -24,14 +24,14 @@
24
24
  23 timing npm:load:setTitle Completed in 2ms
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-03-21T23_38_35_965Z-
28
- 27 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-03-21T23_38_35_965Z-debug-0.log
29
- 28 timing npm:load:logFile Completed in 3ms
27
+ 26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-03-22T03_53_10_710Z-
28
+ 27 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-03-22T03_53_10_710Z-debug-0.log
29
+ 28 timing npm:load:logFile Completed in 4ms
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 44ms
32
+ 31 timing npm:load Completed in 41ms
33
33
  32 silly logfile done cleaning log files
34
- 33 timing command:run Completed in 4090ms
34
+ 33 timing command:run Completed in 4061ms
35
35
  34 verbose exit 0
36
- 35 timing npm Completed in 4147ms
36
+ 35 timing npm Completed in 4115ms
37
37
  36 info ok
package/lib/index.js CHANGED
@@ -130,7 +130,7 @@ orPattern ::= S? "," S?
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 xt=I=>JSON.parse(JSON.stringify(I)),dr=Object.prototype.toString,nr=I=>dr.call(I).match(/\s([^\]]+)\]/).pop().toLowerCase(),hi=new RegExp(`^("[^"]+"|${$})$`),_i=["string","number","boolean","null"],Jn=/^\[\d*\]$/,In=/^\[(\d+)\]$/,Yn=/^".+"$/,Yr=/(^\[\d*\]$|^\d+$)/;function Mr(I){return parseInt(I.replace(/^(\[|\]$)/,""))}function kr(I){return Yn.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&&nr(L[b])==="object"&&nr(R)==="object")return[L[b],b,L,`${I[3]}/${b}}`];if(k===Nt.INSERT_ITEMS||k==null&&In.test(b)){let X=Mr(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===Nt.REPLACE_ITEMS||k==null){let X=Mr(b);return L[X]=R,[L[X],X,L,`${I[3]}/${X}}`]}throw new Error(`Unknown array index '${b}' with force-option '${k}'`)}var ks;function Nt(I,b,R,k){if(b==null)return xt(I);if((b=b.replace(/(\/$)/g,""))==="")return xt(R);let L=xt(I),X=[[L,null,null,"#"]],re=Je(b),ie=re.pop(),pe=Jn.test(ie)&&In.test(ie)===!1;if(hi.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(hi.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=Yr.test(ge);X=function(yt,Ge,st,dt){return Ge=kr(Ge),yt.filter(wt=>!(!Array.isArray(wt[0])||!Yr.test(Ge))||_i.includes(nr(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;nr(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=kr(ie);if(Be==="__proto__"||Be==="prototyped"||Be==="constructor")return;ge[Be]=Ee}}),L}(function(I){I.REPLACE_ITEMS="replace",I.INSERT_ITEMS="insert"})(ks||(ks={})),Nt.REPLACE_ITEMS=ks.REPLACE_ITEMS,Nt.INSERT_ITEMS=ks.INSERT_ITEMS;let mn={$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"]}},Ds=Object.keys(mn).filter(I=>mn[I].type===!1),Dr=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(mn[I.type]||Array.isArray(I.type))return I.type;let R=Ds.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=mn.object.keywords.length;k<L;k+=1){let X=mn.object.keywords[k];if(Dr.call(I,X))return"object"}for(let k=0,L=mn.array.keywords.length;k<L;k+=1){let X=mn.array.keywords[k];if(Dr.call(I,X))return"array"}}function hn(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,mn[R[L]])}else k=mn[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&&hn(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,pr=["",null,"#"],Pr=/(#|\/)+$/g;function Qn(I,b,R){if(a(R)==="object"&&(R=R.__ref||R.$ref),R==null)return b;let k,L=R.replace(Pr,"");if(I.remotes[L])return k=I.remotes[L],k&&k.$ref?Qn(I,b,k.$ref):k;if(I.ids[R])return k=(0,x.get)(b,I.ids[R]),k&&k.$ref?Qn(I,b,k.$ref):k;let X=function(re){if(pr.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],Qn(I,b,k.$ref);if(I.ids[R])return k=(0,x.get)(b,I.ids[R]),k&&k.$ref?Qn(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):Qn(I,I.remotes[re],R);if(I.ids[re])return Qn(I,(0,x.get)(b,I.ids[re]),R)}return k=(0,x.get)(b,I.ids[R]||R),k&&k.$ref?Qn(I,b,k.$ref):k}let jf="__compiled",qf="__ref",OE=/(#|\/)+$/g;function Mf(I,b,R=b,k=!1){if(b===!0||b===!1||b===void 0||b[jf]!==void 0)return b;let L={ids:{},remotes:I.remotes},X=JSON.stringify(b),re=JSON.parse(X);if(Object.defineProperty(re,jf,{enumerable:!1,value:!0}),Object.defineProperty(re,"getRef",{enumerable:!1,value:Qn.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(OE,"")]=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[qf]&&(Object.defineProperty(ce,qf,{enumerable:!1,value:gt(Ge,ce.$ref)}),Object.defineProperty(ce,"getRoot",{enumerable:!1,value:pe}))}),re}function dl(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 NE=__webpack_require__(481),kf=__webpack_require__.n(NE);let jE=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]))$"),qE=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ME=/^((([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,kE=/^(?=.{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])?)*\.?$/,DE=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,FE=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,LE=[0,31,28,31,30,31,30,31,31,30,31,30,31],zE=/^(?:\/(?:[^~/]|~0|~1)*)*$/,$E=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,UE=/^(?:[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,VE=/^(?:(?:[^\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,pl={date:(I,b,R,k)=>{if(typeof R!="string")return;let L=R.match(DE);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:LE[re])?void 0:_t.formatDateError({value:R,pointer:k})},"date-time":(I,b,R,k)=>{if(typeof R=="string")return R===""||jE.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!==""&&!kE.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&&qE.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&&ME.test(R)))return _t.formatIPV6Error({value:R,pointer:k})}},"json-pointer":(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!zE.test(R))return _t.formatJSONPointerError({value:R,pointer:k})},"relative-json-pointer":(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!$E.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(FE);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!==""&&!kf().isUri(R))return _t.formatURIError({value:R,pointer:k})},"uri-reference":(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!UE.test(R))return _t.formatURIReferenceError({value:R,pointer:k})},"uri-template":(I,b,R,k)=>{if(typeof R=="string"&&R!==""&&!VE.test(R))return _t.formatURITemplateError({value:R,pointer:k})},url:(I,b,R,k)=>{if(R!==""&&!kf().isWebUri(R))return _t.formatURLError({value:R,pointer:k})}},GE={addOptionalProps:!0,removeInvalidData:!1},Xn;function Ma(I,b){let{$ref:R}=I;return R==null?!0:(Xn[b]==null||Xn[b][R]==null?0:Xn[b][R])<p.GET_TEMPLATE_RECURSION_LIMIT}function fl(I,b,R){if(R==null)throw new Error(`missing pointer ${R}`);let{$ref:k}=b;return k==null?b:(Xn[R]=Xn[R]||{},Xn[R][k]=Xn[R][k]||0,Xn[R][k]+=1,I.resolveRef(b))}function Df(I,b,R,k){if(a(b)!=="object")return Object.assign({pointer:k},b);if(Ma(b,k)===!1&&R==null)return!1;let L=f(fl(I,b,k));if(Array.isArray(b.anyOf)&&b.anyOf.length>0){if(Ma(b.anyOf[0],`${k}/anyOf/0`)){let X=fl(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)Ma(b.allOf[X],`${k}/allOf/${X}`)&&(L=v(L,fl(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 Ff=I=>I&&typeof I=="object";function Zn(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=Df(I,R,b,k);if(!Ff(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(!Ff(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)),Lf[re]==null?L.removeInvalidData?void 0:b:Lf[re](I,X,b,k,L)}let Lf={null:(I,b,R)=>ko(b,R,null),string:(I,b,R)=>ko(b,R,""),number:(I,b,R)=>ko(b,R,0),integer:(I,b,R)=>ko(b,R,0),boolean:(I,b,R)=>ko(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]=Zn(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]=Zn(I,ie[Be],b.properties[Be],`${k}/properties/${Be}`,L)});if(a(Ee)!=="object")return;let ge=Zn(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]=Zn(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=Df(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]=Zn(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]=Zn(I,yt,Ge,`${k}/oneOf/${Be}`,L)):ce[Be]=Zn(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]=Zn(I,ce[ge]==null?pe[ge]:ce[ge],Ee,`${k}/items`,L);return ce}return ce}};function ko(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 ml=(I,b,R=I.rootSchema,k=GE)=>(Xn={mi:{}},Zn(I,b,R,"#",k));function hl(I,b,R=I.rootSchema,k="#"){return I.validate(b,R,k).length===0}function _l(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(!_l(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(!_l(I[X],b[X]))return!1;return!0}return I===b}function zf(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 vl=p.floatingPointPrecision,HE=Object.prototype.hasOwnProperty,$f=(I,b)=>!(I[b]===void 0||!HE.call(I,b)),BE={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=zf(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=zf(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*vl%(b.multipleOf*vl)/vl!=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($f(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(!$f(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)_l(X,R[ie])&&L.push(I.errors.uniqueItemsError({pointer:k,itemPointer:`${k}/${re}`,duplicatePointer:`${k}/${ie}`,value:JSON.stringify(X)}))}),L}},Uf=BE,WE=Object.assign(Object.assign({},Uf),{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}}),Vf=WE;function gl(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 Cn(I){let b={type:a(I)};return b.type==="object"&&(b.properties={},Object.keys(I).forEach(R=>b.properties[R]=Cn(I[R]))),b.type==="array"&&I.length===1?b.items=Cn(I[0]):b.type==="array"&&(b.items=I.map(Cn)),b}function yl(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 Gf={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 Cn(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 Cn(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]?Cn(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=Fs(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=Fs(I,b,R.then,k,L);if(typeof pe.type=="string"&&pe.type!=="error")return pe}if(!ie&&R.else){let pe=Fs(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?Cn(k[b]):_t.unknownPropertyError({property:b,value:k,pointer:`${L}`})}};function Fs(I,b,R,k,L="#"){if(Array.isArray(R.type)){let ie=a(k);return R.type.includes(ie)?Gf[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=Gf[X];return re?re(I,`${b}`,R,k,L):new Error(`Unsupported schema type ${R.type} for key ${b}`)}let Hf={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 KE=__webpack_require__(63),JE=__webpack_require__.n(KE);function Sl(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 JE()(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 wl={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:Vf,validateType:Hf,validateFormat:pl,errors:_t,addRemoteSchema:ee,compileSchema:Mf,createSchemaOf:Cn,each:dl,eachSchema:z,getChildSchemaSelection:yl,getSchema:D,getTemplate:ml,isValid:hl,resolveAllOf:q,resolveAnyOf:gl,resolveOneOf:m,resolveRef:N,step:Fs,validate:Sl};class YE extends B{constructor(b,R={}){super(v(wl,R),b)}}let Bf=Object.assign(Object.assign({},wl),{resolveOneOf:F,resolveRef:T});class Wf extends B{constructor(b,R={}){super(v(Bf,R),b)}}class ka{constructor(b,R){this.core=new Wf(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 QE(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 Kf="__compiled",Jf="__ref",XE=/(#|\/)+$/g,Yf={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:Uf,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:pl,errors:_t,addRemoteSchema:ee,compileSchema:function(I,b,R=b,k=!1){if(!b||b[Kf]!==void 0)return b;let L={ids:{},remotes:I.remotes},X=JSON.stringify(b),re=JSON.parse(X);if(Object.defineProperty(re,Kf,{enumerable:!1,value:!0}),Object.defineProperty(re,"getRef",{enumerable:!1,value:Qn.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(XE,"")]=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[Jf]&&(Object.defineProperty(ce,Jf,{enumerable:!1,value:gt(Ge,ce.$ref)}),Object.defineProperty(ce,"getRoot",{enumerable:!1,value:pe}))}),re},createSchemaOf:Cn,each:dl,eachSchema:z,getChildSchemaSelection:yl,getSchema:D,getTemplate:ml,isValid:hl,resolveAllOf:q,resolveAnyOf:gl,resolveOneOf:m,resolveRef:N,step:Fs,validate:Sl};class Qf extends B{constructor(b,R={}){super(v(Yf,R),b)}}let Xf={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:Vf,validateType:Hf,validateFormat:pl,errors:_t,addRemoteSchema:ee,compileSchema:Mf,createSchemaOf:Cn,each:dl,eachSchema:z,getChildSchemaSelection:yl,getSchema:D,getTemplate:ml,isValid:hl,resolveAllOf:q,resolveAnyOf:gl,resolveOneOf:m,resolveRef:N,step:Fs,validate:Sl};class ZE extends B{constructor(b,R={}){super(v(Xf,R),b)}}let eb={strings:e}})(),__webpack_exports__})())});var kw=S(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});Mw.isMatrixAssetUri=void 0;function gPe(e){return typeof e!="string"?!1:/^matrix-asset:\/\/[a-zA-Z0-9.-]+\/[a-zA-Z0-9\/._-]+\/?([0-9]+(?:\:[0-9a-z\-\._/]+\$?)?)?$/.test(e)}Mw.isMatrixAssetUri=gPe});var VH=S(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});Dw.customFormatValidators=void 0;var yPe=qw(),SPe=kw();Dw.customFormatValidators={"matrix-asset-uri":(e,t,r)=>{if((0,SPe.isMatrixAssetUri)(r)===!1)throw new yPe.SchemaValidationError(`value "${r}" isn't a valid matrix asset uri`)}}});var kI=S(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});Fw.JsonResolutionError=void 0;var MI=class extends Error{constructor(t,r,n){super(`Error resolving JSON at ${r}: ${t.message}`),this.pointer=r,this.value=n}};Fw.JsonResolutionError=MI});var JH=S(It=>{"use strict";var xo=It&&It.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(It,"__esModule",{value:!0});It.JsonValidationService=It.JSONSchemaService=It.ManifestV1MetaSchema=It.RenderInputMetaSchema=It.ComponentInputMetaSchema=It.RenderInputSchema=It.ComponentInputSchema=void 0;var wPe=xo(PI()),zI=xo(TI()),HH=xo(CI()),Lw=xo(OI()),BH=xo(NI()),Jp=xo(UH()),WH=xo(AI()),KH=xo(xI()),DI=qw(),Yp=qI(),qc=qI(),EPe=VH(),bPe=kI(),_a={...qc.draft07Config,validateFormat:{...qc.draft07Config.validateFormat,...EPe.customFormatValidators},errors:{...qc.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}}}},GH=new Yp.Draft07(WH.default,_a);It.ComponentInputSchema=new Yp.Draft({..._a,resolveRef(e,t){let r=qc.draft07Config.resolveRef(e,t);return r&&(r.type==="FormattedText"?GH.rootSchema:Array.isArray(r.type)&&r.type.includes("FormattedText")?{...e,...GH.rootSchema,type:r.type.filter(n=>n!=="FormattedText").concat(WH.default.type)}:r)}},zI.default);It.ComponentInputSchema.addRemoteSchema("DxComponentInputSchema.json/DxContentMetaSchema.json",Lw.default);It.RenderInputSchema=new Yp.Draft({..._a,resolveRef(e,t){let r=qc.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 va=new Yp.Draft07(KH.default,_a);va.addRemoteSchema("DxComponentInputSchema.json/DxContentMetaSchema.json",Lw.default);va.addRemoteSchema("/DxComponentInputSchema.json",It.ComponentInputSchema.getSchema());va.addRemoteSchema("/DxComponentIcons.json",HH.default);va.addRemoteSchema("/MatrixAssetSchema.json",BH.default);va.addRemoteSchema("http://json-schema.org/draft-07/schema",Jp.default);va.addRemoteSchema("http://json-schema.org/draft-07/schema#",Jp.default);It.ComponentInputMetaSchema={root:zI.default,remotes:{"DxComponentInputSchema.json/DxContentMetaSchema.json":Lw.default}};It.RenderInputMetaSchema={root:Jp.default};It.ManifestV1MetaSchema={root:KH.default,remotes:{"DxComponentInputSchema.json/DxContentMetaSchema.json":Lw.default,"/DxComponentInputSchema.json":zI.default,"/DxComponentIcons.json":HH.default,"/MatrixAssetSchema.json":BH.default,"http://json-schema.org/draft-07/schema":Jp.default,"http://json-schema.org/draft-07/schema#":Jp.default}};var FI=class{constructor(t,r){this.typeResolver=t,this.schema=new Yp.Draft({..._a,resolveRef:(n,i)=>this.doResolveRef(n,i),validate:(n,i,s,a)=>_a.validate(n,i,s,a),resolveOneOf:(n,i,s,a)=>_a.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=qc.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 DI.SchemaValidationError(t.map(r=>r.message).join(`,
132
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=>wPe.default.set(m,o,d)).catch(d=>Promise.reject(new bPe.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}};It.JSONSchemaService=FI;var LI=class{validateManifest(t,r){switch(r){case"v1":{let n=va.validate(t);return this.processValidationResult(n)}default:throw new DI.SchemaValidationError("Invalid manifest version")}}validateContentSchema(t){return this.processValidationResult(It.ComponentInputSchema.validate(t))}validateComponentInput(t,r){let n=It.ComponentInputSchema.compileSchema(t),i=It.ComponentInputSchema.validate(r,n);return this.processValidationResult(i)}validateRenderInput(t,r){let n=It.RenderInputSchema.compileSchema(t),i=It.RenderInputSchema.validate(r,n);return this.processValidationResult(i)}processValidationResult(t){if(t.length>0)throw new DI.SchemaValidationError(t.map(r=>r.message).join(`,
133
- `));return!0}};It.JsonValidationService=LI});var Mc=S(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.TypeResolver=Ao.ResolvableType=Ao.PrimitiveType=void 0;function RPe(e){return e}Ao.PrimitiveType=RPe;function xPe(e){return e}Ao.ResolvableType=xPe;var $I=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]}};Ao.TypeResolver=$I});var YH=S(zw=>{"use strict";Object.defineProperty(zw,"__esModule",{value:!0});zw.TypeResolverBuilder=void 0;var APe=Mc(),Qp=class{constructor(){this.primitives=new Set,this.resolvables=new Set,this.resolverMap={}}static new(){return new Qp}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 APe.TypeResolver(Array.from(this.primitives.values()),Array.from(this.resolvables.values()),this.resolverMap)}};zw.TypeResolverBuilder=Qp});var QH=S($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});$w.SquizImageType=void 0;var PPe=Mc();$w.SquizImageType=(0,PPe.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 ZH=S(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ComponentInputFormattedTextType=Po.BaseFormattedTextType=Po.FormattedTextType=void 0;var XH=Ro(),UI=Mc();Po.FormattedTextType=(0,UI.PrimitiveType)({...XH.FORMATTED_TEXT_SCHEMAS.v1,title:"FormattedText"});Po.BaseFormattedTextType=(0,UI.PrimitiveType)({...XH.FORMATTED_TEXT_SCHEMAS.v1,items:{$ref:"#/definitions/BaseFormattedNodes"},title:"FormattedText"});Po.ComponentInputFormattedTextType=(0,UI.PrimitiveType)({type:"string",title:"FormattedText"})});var t6=S(Io=>{"use strict";var IPe=Io&&Io.__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]}),e6=Io&&Io.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&IPe(t,e,r)};Object.defineProperty(Io,"__esModule",{value:!0});e6(QH(),Io);e6(ZH(),Io)});var r6=S(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});Uw.MatrixAssetType=void 0;var CPe=Mc();Uw.MatrixAssetType=(0,CPe.ResolvableType)({title:"MatrixAsset",type:"object",properties:{matrixAssetId:{type:"string"},matrixContentIdentifier:{type:"string"},matrixDomain:{type:"string"}},required:["matrixAssetId","matrixContentIdentifier"]})});var n6=S(ga=>{"use strict";var TPe=ga&&ga.__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]}),OPe=ga&&ga.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&TPe(t,e,r)};Object.defineProperty(ga,"__esModule",{value:!0});OPe(r6(),ga)});var Ro=S(St=>{"use strict";var i6=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]}),NPe=St&&St.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xp=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)&&i6(t,e,r);return NPe(t,e),t},Ki=St&&St.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&i6(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=Xp(jH());St.MANIFEST_SCHEMAS=Xp(qH());St.FORMATTED_TEXT_MODELS=Xp(DH());St.FORMATTED_TEXT_SCHEMAS=Xp(FH());Ki(zH(),St);St.SUB_SCHEMAS=Xp($H());Ki(JH(),St);Ki(qw(),St);Ki(kI(),St);Ki(kw(),St);Ki(kw(),St);Ki(Mc(),St);Ki(YH(),St);Ki(t6(),St);Ki(n6(),St)});var s6=S(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.formattedTextToHtmlString=ya.formattedTextToHtmlStringResolvers=void 0;var jPe=Ro();ya.formattedTextToHtmlStringResolvers={tag:async e=>MPe(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 qPe(e){return await(0,jPe.resolveFormattedText)(e,ya.formattedTextToHtmlStringResolvers)}ya.formattedTextToHtmlString=qPe;function MPe(e){let t=kPe(e);e.attributes?e.attributes.class=t:e.attributes={class:t};let r=DPe(e.attributes);return`<${e.tag}${r}>${e.children.join("")}</${e.tag}>`}function kPe(e){var t,r,n;let i=FPe(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 DPe(e){if(!e)return"";let t="";for(let r in e)e[r]!==""&&(t+=` ${r}="${e[r]}"`);return t}function FPe(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 Tt=S(or=>{"use strict";var LPe=or&&or.__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]}),En=or&&or.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&LPe(t,e,r)};Object.defineProperty(or,"__esModule",{value:!0});En(mN(),or);En(wN(),or);En(Bb(),or);En(Iq(),or);En(Cq(),or);En(Tq(),or);En(Nq(),or);En(gI(),or);En(SI(),or);En(AH(),or);En(PH(),or);En(TH(),or);En(s6(),or)});var VI=S(o6=>{"use strict";Object.defineProperty(o6,"__esModule",{value:!0})});var c6=S(a6=>{"use strict";Object.defineProperty(a6,"__esModule",{value:!0})});var Gw=S(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.ComponentSetComponentVersion=Sa.ComponentSetComponentVersionStatus=void 0;var Ji=Tt(),Vw;(function(e){e.active="active",e.excluded="excluded"})(Vw=Sa.ComponentSetComponentVersionStatus||(Sa.ComponentSetComponentVersionStatus={}));var GI=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",this.status=Vw.active,(0,Ji.assertIsDefined)(t),this.componentSetWebPath=(0,Ji.assertAssign)(t.componentSetWebPath,Ji.assertIsString,"componentSetWebPath must be a string"),this.componentName=(0,Ji.assertAssign)(t.componentName,Ji.assertIsString,"componentName must be a string"),this.componentVersion=(0,Ji.assertAssign)(t.componentVersion,Ji.assertIsString,"componentVersion must be a string"),this.environmentVariables=(0,Ji.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,Ji.assertIsMapOfStringString,{}),t.status===void 0&&(t.status=Vw.active),(0,Ji.assertIsEnumValue)(t.status,Vw),this.status=t.status}};Sa.ComponentSetComponentVersion=GI});var Ps=S((gWe,sW)=>{"use strict";var zPe=Object.create,Jw=Object.defineProperty,$Pe=Object.getOwnPropertyDescriptor,JI=Object.getOwnPropertyNames,UPe=Object.getPrototypeOf,VPe=Object.prototype.hasOwnProperty,jr=(e,t)=>function(){return e&&(t=(0,e[JI(e)[0]])(e=0)),t},A=(e,t)=>function(){return t||(0,e[JI(e)[0]])((t={exports:{}}).exports,t),t.exports},YI=(e,t)=>{for(var r in t)Jw(e,r,{get:t[r],enumerable:!0})},v6=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of JI(t))!VPe.call(e,i)&&i!==r&&Jw(e,i,{get:()=>t[i],enumerable:!(n=$Pe(t,i))||n.enumerable});return e},Qi=(e,t,r)=>(r=e!=null?zPe(UPe(e)):{},v6(t||!e||!e.__esModule?Jw(r,"default",{value:e,enumerable:!0}):r,e)),Ie=e=>v6(Jw({},"__esModule",{value:!0}),e),g6=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}}}),y6=A({"../../node_modules/pg-types/lib/arrayParser.js"(e,t){var r=g6();t.exports={create:function(n,i){return{parse:function(){return r.parse(n,i)}}}}}}),GPe=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}}}),HPe=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}}}),BPe=A({"../../node_modules/postgres-interval/index.js"(e,t){"use strict";var r=HPe();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},{})}}}),WPe=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")}}}),KPe=A({"../../node_modules/pg-types/lib/textParsers.js"(e,t){var r=g6(),n=y6(),i=GPe(),s=BPe(),a=WPe();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}}}),JPe=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}}),YPe=A({"../../node_modules/pg-types/lib/binaryParsers.js"(e,t){var r=JPe(),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}}}),QPe=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}}}),Yw=A({"../../node_modules/pg-types/index.js"(e){var t=KPe(),r=YPe(),n=y6(),i=QPe();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})}}),Qw=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=Yw(),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)})}}),QI=A({"../../node_modules/pg/lib/utils.js"(e,t){"use strict";var r=require("crypto"),n=Qw();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}}}),XPe=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}}}),ZPe=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}}),eIe=A({"../../node_modules/pgpass/lib/helper.js"(e,t){"use strict";var r=require("path"),n=require("stream").Stream,i=ZPe(),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(`
133
+ `));return!0}};It.JsonValidationService=LI});var Mc=S(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.TypeResolver=Ao.ResolvableType=Ao.PrimitiveType=void 0;function RPe(e){return e}Ao.PrimitiveType=RPe;function xPe(e){return e}Ao.ResolvableType=xPe;var $I=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]}};Ao.TypeResolver=$I});var YH=S(zw=>{"use strict";Object.defineProperty(zw,"__esModule",{value:!0});zw.TypeResolverBuilder=void 0;var APe=Mc(),Qp=class{constructor(){this.primitives=new Set,this.resolvables=new Set,this.resolverMap={}}static new(){return new Qp}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 APe.TypeResolver(Array.from(this.primitives.values()),Array.from(this.resolvables.values()),this.resolverMap)}};zw.TypeResolverBuilder=Qp});var QH=S($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});$w.SquizImageType=void 0;var PPe=Mc();$w.SquizImageType=(0,PPe.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 ZH=S(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ComponentInputFormattedTextType=Po.BaseFormattedTextType=Po.FormattedTextType=void 0;var XH=Ro(),UI=Mc();Po.FormattedTextType=(0,UI.PrimitiveType)({...XH.FORMATTED_TEXT_SCHEMAS.v1,title:"FormattedText"});Po.BaseFormattedTextType=(0,UI.PrimitiveType)({...XH.FORMATTED_TEXT_SCHEMAS.v1,items:{$ref:"#/definitions/BaseFormattedNodes"},title:"FormattedText"});Po.ComponentInputFormattedTextType=(0,UI.PrimitiveType)({type:"string",title:"FormattedText"})});var t6=S(Io=>{"use strict";var IPe=Io&&Io.__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]}),e6=Io&&Io.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&IPe(t,e,r)};Object.defineProperty(Io,"__esModule",{value:!0});e6(QH(),Io);e6(ZH(),Io)});var r6=S(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});Uw.MatrixAssetType=void 0;var CPe=Mc();Uw.MatrixAssetType=(0,CPe.ResolvableType)({title:"MatrixAsset",type:"object",properties:{matrixAssetId:{type:"string"},matrixIdentifier:{type:"string"},matrixDomain:{type:"string"}},required:["matrixAssetId","matrixIdentifier"]})});var n6=S(ga=>{"use strict";var TPe=ga&&ga.__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]}),OPe=ga&&ga.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&TPe(t,e,r)};Object.defineProperty(ga,"__esModule",{value:!0});OPe(r6(),ga)});var Ro=S(St=>{"use strict";var i6=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]}),NPe=St&&St.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Xp=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)&&i6(t,e,r);return NPe(t,e),t},Ki=St&&St.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&i6(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=Xp(jH());St.MANIFEST_SCHEMAS=Xp(qH());St.FORMATTED_TEXT_MODELS=Xp(DH());St.FORMATTED_TEXT_SCHEMAS=Xp(FH());Ki(zH(),St);St.SUB_SCHEMAS=Xp($H());Ki(JH(),St);Ki(qw(),St);Ki(kI(),St);Ki(kw(),St);Ki(kw(),St);Ki(Mc(),St);Ki(YH(),St);Ki(t6(),St);Ki(n6(),St)});var s6=S(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.formattedTextToHtmlString=ya.formattedTextToHtmlStringResolvers=void 0;var jPe=Ro();ya.formattedTextToHtmlStringResolvers={tag:async e=>MPe(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 qPe(e){return await(0,jPe.resolveFormattedText)(e,ya.formattedTextToHtmlStringResolvers)}ya.formattedTextToHtmlString=qPe;function MPe(e){let t=kPe(e);e.attributes?e.attributes.class=t:e.attributes={class:t};let r=DPe(e.attributes);return`<${e.tag}${r}>${e.children.join("")}</${e.tag}>`}function kPe(e){var t,r,n;let i=FPe(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 DPe(e){if(!e)return"";let t="";for(let r in e)e[r]!==""&&(t+=` ${r}="${e[r]}"`);return t}function FPe(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 Tt=S(or=>{"use strict";var LPe=or&&or.__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]}),En=or&&or.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&LPe(t,e,r)};Object.defineProperty(or,"__esModule",{value:!0});En(mN(),or);En(wN(),or);En(Bb(),or);En(Iq(),or);En(Cq(),or);En(Tq(),or);En(Nq(),or);En(gI(),or);En(SI(),or);En(AH(),or);En(PH(),or);En(TH(),or);En(s6(),or)});var VI=S(o6=>{"use strict";Object.defineProperty(o6,"__esModule",{value:!0})});var c6=S(a6=>{"use strict";Object.defineProperty(a6,"__esModule",{value:!0})});var Gw=S(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.ComponentSetComponentVersion=Sa.ComponentSetComponentVersionStatus=void 0;var Ji=Tt(),Vw;(function(e){e.active="active",e.excluded="excluded"})(Vw=Sa.ComponentSetComponentVersionStatus||(Sa.ComponentSetComponentVersionStatus={}));var GI=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",this.status=Vw.active,(0,Ji.assertIsDefined)(t),this.componentSetWebPath=(0,Ji.assertAssign)(t.componentSetWebPath,Ji.assertIsString,"componentSetWebPath must be a string"),this.componentName=(0,Ji.assertAssign)(t.componentName,Ji.assertIsString,"componentName must be a string"),this.componentVersion=(0,Ji.assertAssign)(t.componentVersion,Ji.assertIsString,"componentVersion must be a string"),this.environmentVariables=(0,Ji.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,Ji.assertIsMapOfStringString,{}),t.status===void 0&&(t.status=Vw.active),(0,Ji.assertIsEnumValue)(t.status,Vw),this.status=t.status}};Sa.ComponentSetComponentVersion=GI});var Ps=S((gWe,sW)=>{"use strict";var zPe=Object.create,Jw=Object.defineProperty,$Pe=Object.getOwnPropertyDescriptor,JI=Object.getOwnPropertyNames,UPe=Object.getPrototypeOf,VPe=Object.prototype.hasOwnProperty,jr=(e,t)=>function(){return e&&(t=(0,e[JI(e)[0]])(e=0)),t},A=(e,t)=>function(){return t||(0,e[JI(e)[0]])((t={exports:{}}).exports,t),t.exports},YI=(e,t)=>{for(var r in t)Jw(e,r,{get:t[r],enumerable:!0})},v6=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of JI(t))!VPe.call(e,i)&&i!==r&&Jw(e,i,{get:()=>t[i],enumerable:!(n=$Pe(t,i))||n.enumerable});return e},Qi=(e,t,r)=>(r=e!=null?zPe(UPe(e)):{},v6(t||!e||!e.__esModule?Jw(r,"default",{value:e,enumerable:!0}):r,e)),Ie=e=>v6(Jw({},"__esModule",{value:!0}),e),g6=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}}}),y6=A({"../../node_modules/pg-types/lib/arrayParser.js"(e,t){var r=g6();t.exports={create:function(n,i){return{parse:function(){return r.parse(n,i)}}}}}}),GPe=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}}}),HPe=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}}}),BPe=A({"../../node_modules/postgres-interval/index.js"(e,t){"use strict";var r=HPe();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},{})}}}),WPe=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")}}}),KPe=A({"../../node_modules/pg-types/lib/textParsers.js"(e,t){var r=g6(),n=y6(),i=GPe(),s=BPe(),a=WPe();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}}}),JPe=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}}),YPe=A({"../../node_modules/pg-types/lib/binaryParsers.js"(e,t){var r=JPe(),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}}}),QPe=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}}}),Yw=A({"../../node_modules/pg-types/index.js"(e){var t=KPe(),r=YPe(),n=y6(),i=QPe();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})}}),Qw=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=Yw(),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)})}}),QI=A({"../../node_modules/pg/lib/utils.js"(e,t){"use strict";var r=require("crypto"),n=Qw();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}}}),XPe=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}}}),ZPe=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}}),eIe=A({"../../node_modules/pgpass/lib/helper.js"(e,t){"use strict";var r=require("path"),n=require("stream").Stream,i=ZPe(),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
134
  `);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}}}),tIe=A({"../../node_modules/pgpass/lib/index.js"(e,t){"use strict";var r=require("path"),n=require("fs"),i=eIe();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}}),S6=A({"../../node_modules/pg/lib/type-overrides.js"(e,t){"use strict";var r=Yw();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}}),rIe=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}}),w6=A({"../../node_modules/pg/lib/connection-parameters.js"(e,t){"use strict";var r=require("dns"),n=Qw(),i=rIe().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}}),nIe=A({"../../node_modules/pg/lib/result.js"(e,t){"use strict";var r=Yw(),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}}),iIe=A({"../../node_modules/pg/lib/query.js"(e,t){"use strict";var{EventEmitter:r}=require("events"),n=nIe(),i=QI(),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}}),E6=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}}),sIe=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}}),oIe=A({"../../node_modules/pg-protocol/dist/serializer.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=sIe(),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}}),aIe=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}}),cIe=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=E6(),n=aIe(),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}}),b6=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=E6();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:function(){return t.DatabaseError}});var r=oIe();Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return r.serialize}});var n=cIe();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}}),R6=A({"../../node_modules/pg/lib/connection.js"(e,t){"use strict";var r=require("net"),n=require("events").EventEmitter,{parse:i,serialize:s}=b6(),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}}),lIe=A({"../../node_modules/pg/lib/client.js"(e,t){"use strict";var r=require("events").EventEmitter,n=QI(),i=XPe(),s=tIe(),a=S6(),o=w6(),c=iIe(),u=Qw(),l=R6(),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}}),uIe=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||XI().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}}),dIe=A({"../../node_modules/pg/lib/native/query.js"(e,t){"use strict";var r=require("events").EventEmitter,n=require("util"),i=QI(),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)}}}),pIe=A({"../../node_modules/pg/lib/native/client.js"(e,t){"use strict";var r=require("pg-native"),n=S6(),i=require("events").EventEmitter,s=require("util"),a=w6(),o=dIe(),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)}}}),l6=A({"../../node_modules/pg/lib/native/index.js"(e,t){"use strict";t.exports=pIe()}}),XI=A({"../../node_modules/pg/lib/index.js"(e,t){"use strict";var r=lIe(),n=Qw(),i=R6(),s=uIe(),{DatabaseError:a}=b6(),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=Yw(),this.DatabaseError=a};typeof process.env.NODE_PG_FORCE_NATIVE<"u"?t.exports=new c(l6()):(t.exports=new c(r),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){var u=null;try{u=new c(l6())}catch(l){if(l.code!=="MODULE_NOT_FOUND")throw l}return Object.defineProperty(t.exports,"native",{value:u}),u}}))}}),bn=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
135
  Found: ${n.toString().split(`
136
136
  `)[0]}
@@ -236,7 +236,7 @@ safe-buffer/index.js:
236
236
  */
237
237
  /**
238
238
  * @title @squiz/content-api
239
- * @version 1.21.1-alpha.30
239
+ * @version 1.21.1-alpha.31
240
240
  * @license ISC
241
241
  * @baseUrl /
242
242
  * @contact