@testiny/cli 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/README.md +89 -89
- package/{LICENSES.txt → licenses.txt} +1 -1
- package/package.json +21 -21
- package/testiny-importer.js +2 -2
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright Mategra GmbH - All rights reserved
|
|
2
|
-
|
|
3
|
-
Intended only for use with Testiny SaaS platform
|
|
4
|
-
https://www.testiny.io/terms-of-use/
|
|
1
|
+
Copyright Mategra GmbH - All rights reserved
|
|
2
|
+
|
|
3
|
+
Intended only for use with Testiny SaaS platform
|
|
4
|
+
https://www.testiny.io/terms-of-use/
|
package/README.md
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
# Testiny CLI
|
|
2
|
-
|
|
3
|
-
Use the Testiny CLI to import test cases and test runs into your Testiny Organization.
|
|
4
|
-
|
|
5
|
-
- Test cases can be imported from CSV files (see example below)
|
|
6
|
-
- Test runs can be imported from CSV, JUnit and Playwright JSON
|
|
7
|
-
|
|
8
|
-
## Quick Start
|
|
9
|
-
|
|
10
|
-
- Create an API key with write permissions on the project you want to import to
|
|
11
|
-
- Set the API key as the TESTINY_API_KEY environment variable or pass with ``--apikey``
|
|
12
|
-
- Running just ``testiny-importer testcase`` or ``testiny-importer testrun`` command prompts for required options
|
|
13
|
-
|
|
14
|
-
## General Options
|
|
15
|
-
|
|
16
|
-
```plain
|
|
17
|
-
Usage: testiny-importer [options] [command]
|
|
18
|
-
|
|
19
|
-
Options:
|
|
20
|
-
--app <url> App endpoint to use (default: "https://app.testiny.io/")
|
|
21
|
-
-P, --project <nameOrKey> Target project id or key
|
|
22
|
-
-y, --confirm Do not prompt for confirmation before starting import
|
|
23
|
-
--disable-custom-fields Disable custom field import. Will fail if required custom fields
|
|
24
|
-
with no defaults are enabled
|
|
25
|
-
--disable-tc-keys Disable test case import key hints
|
|
26
|
-
--disable-nested-folders Disable nesting of imported folders (flat mode)
|
|
27
|
-
--folder-separator <token> Token for folder name separation (default ' > ')
|
|
28
|
-
--duplicates <duplicate mode> Controls how duplicates are detected (choices: "off", "title",
|
|
29
|
-
"folder_title", default: "folder_title")
|
|
30
|
-
--licenses Show included package licenses
|
|
31
|
-
--apikey <apiKey> The API key to use. Not recommended - use the environment variable
|
|
32
|
-
TESTINY_API_KEY or TESTINY_IMPORT_API_KEY instead
|
|
33
|
-
-h, --help display help for command
|
|
34
|
-
|
|
35
|
-
Commands:
|
|
36
|
-
testcase [options] Import testcases (with folders)
|
|
37
|
-
testrun [options] Import test case results as a testrun
|
|
38
|
-
help [command] display help for command
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Importing Test Cases
|
|
42
|
-
|
|
43
|
-
```plain
|
|
44
|
-
Usage: testiny-importer testcase [options]
|
|
45
|
-
|
|
46
|
-
Import testcases (with folders)
|
|
47
|
-
|
|
48
|
-
Options:
|
|
49
|
-
--csv <file> Import this CSV file
|
|
50
|
-
--csv-encoding <encoding> CSV file encoding (default: "utf8")
|
|
51
|
-
--steps <step mode> Controls how steps are imported (choices: "off", "rows", "newlines", "numbered", "numbered_bracket")
|
|
52
|
-
-h, --help display help for command
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Importing Test Runs
|
|
56
|
-
|
|
57
|
-
```plain
|
|
58
|
-
Usage: testiny-importer testrun [options]
|
|
59
|
-
|
|
60
|
-
Import test case results as a testrun
|
|
61
|
-
|
|
62
|
-
Options:
|
|
63
|
-
--csv <file> Import this CSV file
|
|
64
|
-
--csv-encoding <encoding> CSV file encoding (default: "utf8")
|
|
65
|
-
--junit <file> Import this JUnit XML file
|
|
66
|
-
--playwright <file> Import this Playwright JSON file
|
|
67
|
-
--name <test run name> Name of the test run (use %date, %host and %source as placeholders)
|
|
68
|
-
--update Allow run with given name to be updated, otherwise creates a new run with that name (default: false)
|
|
69
|
-
--close Close the testrun after a successful import (default: false)
|
|
70
|
-
--folder <folder name> Override folder name for all created testcases
|
|
71
|
-
--testplan <nameOrKey> Target testplan id or title
|
|
72
|
-
--testcases <tc mode> Controls how testcases are created if no existing TC is found (choices: "ignore", "fail", "create",
|
|
73
|
-
default: "create")
|
|
74
|
-
-h, --help display help for command
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Example Files
|
|
78
|
-
|
|
79
|
-
CSV Example for importing test cases
|
|
80
|
-
|
|
81
|
-
```csv
|
|
82
|
-
folder,title,precondition,steps,expected_result
|
|
83
|
-
"Folder Name", "Test case title", "Precondition text, can be empty", "Steps text (depends on step mode setting)", "Expected result, can be empty"
|
|
84
|
-
"Folder Name > Subfolder Name", "Another test case title", "", "Folders can be nested by using the folder separator token", ""
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Bundled licenses
|
|
88
|
-
|
|
89
|
-
For licenses of bundled dependencies, please see LICENSE.txt in the package directory
|
|
1
|
+
# Testiny CLI
|
|
2
|
+
|
|
3
|
+
Use the Testiny CLI to import test cases and test runs into your Testiny Organization.
|
|
4
|
+
|
|
5
|
+
- Test cases can be imported from CSV files (see example below)
|
|
6
|
+
- Test runs can be imported from CSV, JUnit and Playwright JSON
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
- Create an API key with write permissions on the project you want to import to
|
|
11
|
+
- Set the API key as the TESTINY_API_KEY environment variable or pass with ``--apikey``
|
|
12
|
+
- Running just ``testiny-importer testcase`` or ``testiny-importer testrun`` command prompts for required options
|
|
13
|
+
|
|
14
|
+
## General Options
|
|
15
|
+
|
|
16
|
+
```plain
|
|
17
|
+
Usage: testiny-importer [options] [command]
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
--app <url> App endpoint to use (default: "https://app.testiny.io/")
|
|
21
|
+
-P, --project <nameOrKey> Target project id or key
|
|
22
|
+
-y, --confirm Do not prompt for confirmation before starting import
|
|
23
|
+
--disable-custom-fields Disable custom field import. Will fail if required custom fields
|
|
24
|
+
with no defaults are enabled
|
|
25
|
+
--disable-tc-keys Disable test case import key hints
|
|
26
|
+
--disable-nested-folders Disable nesting of imported folders (flat mode)
|
|
27
|
+
--folder-separator <token> Token for folder name separation (default ' > ')
|
|
28
|
+
--duplicates <duplicate mode> Controls how duplicates are detected (choices: "off", "title",
|
|
29
|
+
"folder_title", default: "folder_title")
|
|
30
|
+
--licenses Show included package licenses
|
|
31
|
+
--apikey <apiKey> The API key to use. Not recommended - use the environment variable
|
|
32
|
+
TESTINY_API_KEY or TESTINY_IMPORT_API_KEY instead
|
|
33
|
+
-h, --help display help for command
|
|
34
|
+
|
|
35
|
+
Commands:
|
|
36
|
+
testcase [options] Import testcases (with folders)
|
|
37
|
+
testrun [options] Import test case results as a testrun
|
|
38
|
+
help [command] display help for command
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Importing Test Cases
|
|
42
|
+
|
|
43
|
+
```plain
|
|
44
|
+
Usage: testiny-importer testcase [options]
|
|
45
|
+
|
|
46
|
+
Import testcases (with folders)
|
|
47
|
+
|
|
48
|
+
Options:
|
|
49
|
+
--csv <file> Import this CSV file
|
|
50
|
+
--csv-encoding <encoding> CSV file encoding (default: "utf8")
|
|
51
|
+
--steps <step mode> Controls how steps are imported (choices: "off", "rows", "newlines", "numbered", "numbered_bracket")
|
|
52
|
+
-h, --help display help for command
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Importing Test Runs
|
|
56
|
+
|
|
57
|
+
```plain
|
|
58
|
+
Usage: testiny-importer testrun [options]
|
|
59
|
+
|
|
60
|
+
Import test case results as a testrun
|
|
61
|
+
|
|
62
|
+
Options:
|
|
63
|
+
--csv <file> Import this CSV file
|
|
64
|
+
--csv-encoding <encoding> CSV file encoding (default: "utf8")
|
|
65
|
+
--junit <file> Import this JUnit XML file
|
|
66
|
+
--playwright <file> Import this Playwright JSON file
|
|
67
|
+
--name <test run name> Name of the test run (use %date, %host and %source as placeholders)
|
|
68
|
+
--update Allow run with given name to be updated, otherwise creates a new run with that name (default: false)
|
|
69
|
+
--close Close the testrun after a successful import (default: false)
|
|
70
|
+
--folder <folder name> Override folder name for all created testcases
|
|
71
|
+
--testplan <nameOrKey> Target testplan id or title
|
|
72
|
+
--testcases <tc mode> Controls how testcases are created if no existing TC is found (choices: "ignore", "fail", "create",
|
|
73
|
+
default: "create")
|
|
74
|
+
-h, --help display help for command
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Example Files
|
|
78
|
+
|
|
79
|
+
CSV Example for importing test cases
|
|
80
|
+
|
|
81
|
+
```csv
|
|
82
|
+
folder,title,precondition,steps,expected_result
|
|
83
|
+
"Folder Name", "Test case title", "Precondition text, can be empty", "Steps text (depends on step mode setting)", "Expected result, can be empty"
|
|
84
|
+
"Folder Name > Subfolder Name", "Another test case title", "", "Folders can be nested by using the folder separator token", ""
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Bundled licenses
|
|
88
|
+
|
|
89
|
+
For licenses of bundled dependencies, please see LICENSE.txt in the package directory
|
|
@@ -894,7 +894,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
894
894
|
|
|
895
895
|
================================================================================
|
|
896
896
|
Package: papaparse
|
|
897
|
-
Version: 5.
|
|
897
|
+
Version: 5.3.2
|
|
898
898
|
Repository: (https://github.com/mholt/PapaParse)
|
|
899
899
|
|
|
900
900
|
The MIT License (MIT)
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@testiny/cli",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"description": "A command-line client for Testiny",
|
|
5
|
-
"main": "./testiny-importer.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"testiny-importer": "./testiny-importer.js"
|
|
8
|
-
},
|
|
9
|
-
"homepage": "https://www.testiny.io/",
|
|
10
|
-
"engines": {
|
|
11
|
-
"node": ">=16.0.0"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"testiny",
|
|
15
|
-
"testmanagement",
|
|
16
|
-
"testautomation"
|
|
17
|
-
],
|
|
18
|
-
"author": "Mategra GmbH",
|
|
19
|
-
"devDependencies": {},
|
|
20
|
-
"dependencies": {}
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@testiny/cli",
|
|
3
|
+
"version": "1.5.2",
|
|
4
|
+
"description": "A command-line client for Testiny",
|
|
5
|
+
"main": "./testiny-importer.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"testiny-importer": "./testiny-importer.js"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://www.testiny.io/",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=16.0.0"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"testiny",
|
|
15
|
+
"testmanagement",
|
|
16
|
+
"testautomation"
|
|
17
|
+
],
|
|
18
|
+
"author": "Mategra GmbH",
|
|
19
|
+
"devDependencies": {},
|
|
20
|
+
"dependencies": {}
|
|
21
|
+
}
|
package/testiny-importer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
"use strict";var Q1e=Object.create;var jy=Object.defineProperty;var xF=Object.getOwnPropertyDescriptor;var eye=Object.getOwnPropertyNames;var tye=Object.getPrototypeOf,rye=Object.prototype.hasOwnProperty;var iye=(e,t,r)=>t in e?jy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var nye=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of eye(t))!rye.call(e,n)&&n!==r&&jy(e,n,{get:()=>t[n],enumerable:!(i=xF(t,n))||i.enumerable});return e};var fe=(e,t,r)=>(r=e!=null?Q1e(tye(e)):{},nye(t||!e||!e.__esModule?jy(r,"default",{value:e,enumerable:!0}):r,e));var E=(e,t,r,i)=>{for(var n=i>1?void 0:i?xF(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=(i?s(t,r,n):s(n))||n);return i&&n&&jy(t,r,n),n};var ei=(e,t,r)=>(iye(e,typeof t!="symbol"?t+"":t,r),r),SF=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var $F=(e,t,r)=>(SF(e,t,"read from private field"),r?r.call(e):t.get(e)),AF=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Gw=(e,t,r,i)=>(SF(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r);var fo=c(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly.ValidationMetadata=void 0;var Zw=class{constructor(t){this.groups=[],this.each=!1,this.context=void 0,this.type=t.type,this.name=t.name,this.target=t.target,this.propertyName=t.propertyName,this.constraints=t==null?void 0:t.constraints,this.constraintCls=t.constraintCls,this.validationTypeOptions=t.validationTypeOptions,t.validationOptions&&(this.message=t.validationOptions.message,this.groups=t.validationOptions.groups,this.always=t.validationOptions.always,this.each=t.validationOptions.each,this.context=t.validationOptions.context)}};Ly.ValidationMetadata=Zw});var wF=c(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.ValidationSchemaToMetadataTransformer=void 0;var aye=fo(),Kw=class{transform(t){let r=[];return Object.keys(t.properties).forEach(i=>{t.properties[i].forEach(n=>{let a={message:n.message,groups:n.groups,always:n.always,each:n.each},s={type:n.type,name:n.name,target:t.name,propertyName:i,constraints:n.constraints,validationTypeOptions:n.options,validationOptions:a};r.push(new aye.ValidationMetadata(s))})}),r}};By.ValidationSchemaToMetadataTransformer=Kw});var IF=c(Vy=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});Vy.convertToArray=void 0;function sye(e){return e instanceof Map?Array.from(e.values()):Array.isArray(e)?e:Array.from(e)}Vy.convertToArray=sye});var EF=c(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});Uy.getGlobal=void 0;function oye(){if(typeof globalThis<"u")return globalThis;if(typeof global<"u")return global;if(typeof window<"u")return window;if(typeof self<"u")return self}Uy.getGlobal=oye});var CF=c(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});zy.isPromise=void 0;function uye(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}zy.isPromise=uye});var Jw=c(po=>{"use strict";var lye=po&&po.__createBinding||(Object.create?function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]}),Yw=po&&po.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&lye(t,e,r)};Object.defineProperty(po,"__esModule",{value:!0});Yw(IF(),po);Yw(EF(),po);Yw(CF(),po)});var $i=c(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.getMetadataStorage=wd.MetadataStorage=void 0;var cye=wF(),dye=Jw(),Hy=class{constructor(){this.validationMetadatas=new Map,this.constraintMetadatas=new Map}get hasValidationMetaData(){return!!this.validationMetadatas.size}addValidationSchema(t){new cye.ValidationSchemaToMetadataTransformer().transform(t).forEach(i=>this.addValidationMetadata(i))}addValidationMetadata(t){let r=this.validationMetadatas.get(t.target);r?r.push(t):this.validationMetadatas.set(t.target,[t])}addConstraintMetadata(t){let r=this.constraintMetadatas.get(t.target);r?r.push(t):this.constraintMetadatas.set(t.target,[t])}groupByPropertyName(t){let r={};return t.forEach(i=>{r[i.propertyName]||(r[i.propertyName]=[]),r[i.propertyName].push(i)}),r}getTargetValidationMetadatas(t,r,i,n,a){let s=p=>typeof p.always<"u"?p.always:p.groups&&p.groups.length?!1:i,o=p=>!!(n&&(!a||!a.length)&&p.groups&&p.groups.length),l=(this.validationMetadatas.get(t)||[]).filter(p=>p.target!==t&&p.target!==r?!1:s(p)?!0:o(p)?!1:a&&a.length>0?p.groups&&!!p.groups.find(h=>a.indexOf(h)!==-1):!0),d=[];for(let[p,h]of this.validationMetadatas.entries())t.prototype instanceof p&&d.push(...h);let m=d.filter(p=>typeof p.target=="string"||p.target===t||p.target instanceof Function&&!(t.prototype instanceof p.target)?!1:s(p)?!0:o(p)?!1:a&&a.length>0?p.groups&&!!p.groups.find(h=>a.indexOf(h)!==-1):!0).filter(p=>!l.find(h=>h.propertyName===p.propertyName&&h.type===p.type));return l.concat(m)}getTargetValidatorConstraints(t){return this.constraintMetadatas.get(t)||[]}};wd.MetadataStorage=Hy;function fye(){let e=(0,dye.getGlobal)();return e.classValidatorMetadataStorage||(e.classValidatorMetadataStorage=new Hy),e.classValidatorMetadataStorage}wd.getMetadataStorage=fye});var Qw=c(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});Wy.ValidationError=void 0;var Xw=class{toString(t=!1,r=!1,i="",n=!1){let a=t?"\x1B[1m":"",s=t?"\x1B[22m":"",o=()=>{var l;return(n?Object.values:Object.keys)((l=this.constraints)!==null&&l!==void 0?l:{}).join(", ")},u=l=>` - property ${a}${i}${l}${s} has failed the following constraints: ${a}${o()}${s}
|
|
3
3
|
`;if(r){let l=Number.isInteger(+this.property)?`[${this.property}]`:`${i?".":""}${this.property}`;return this.constraints?u(l):this.children?this.children.map(d=>d.toString(t,!0,`${i}${l}`,n)).join(""):""}else return`An instance of ${a}${this.target?this.target.constructor.name:"an object"}${s} has failed the validation:
|
|
4
4
|
`+(this.constraints?u(this.property):"")+(this.children?this.children.map(l=>l.toString(t,!0,this.property,n)).join(""):"")}};Wy.ValidationError=Xw});var Ai=c(Gy=>{"use strict";Object.defineProperty(Gy,"__esModule",{value:!0});Gy.ValidationTypes=void 0;var mo=class{static isValid(t){return t!=="isValid"&&t!=="getMessage"&&Object.keys(this).map(r=>this[r]).indexOf(t)!==-1}};Gy.ValidationTypes=mo;mo.CUSTOM_VALIDATION="customValidation";mo.NESTED_VALIDATION="nestedValidation";mo.PROMISE_VALIDATION="promiseValidation";mo.CONDITIONAL_VALIDATION="conditionalValidation";mo.WHITELIST="whitelistValidation";mo.IS_DEFINED="isDefined"});var kF=c(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.ValidationUtils=Id.constraintToString=void 0;function TF(e){return Array.isArray(e)?e.join(", "):(typeof e=="symbol"&&(e=e.description),`${e}`)}Id.constraintToString=TF;var eI=class{static replaceMessageSpecialTokens(t,r){let i;return t instanceof Function?i=t(r):typeof t=="string"&&(i=t),i&&Array.isArray(r.constraints)&&r.constraints.forEach((n,a)=>{i=i.replace(new RegExp(`\\$constraint${a+1}`,"g"),TF(n))}),i&&r.value!==void 0&&r.value!==null&&typeof r.value=="string"&&(i=i.replace(/\$value/g,r.value)),i&&(i=i.replace(/\$property/g,r.property)),i&&(i=i.replace(/\$target/g,r.targetName)),i}};Id.ValidationUtils=eI});var PF=c(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});Ky.ValidationExecutor=void 0;var OF=Qw(),wi=Ai(),pye=kF(),Zy=Jw(),mye=$i(),tI=class{constructor(t,r){this.validator=t,this.validatorOptions=r,this.awaitingPromises=[],this.ignoreAsyncValidations=!1,this.metadataStorage=(0,mye.getMetadataStorage)()}execute(t,r,i){var n,a;!this.metadataStorage.hasValidationMetaData&&((n=this.validatorOptions)===null||n===void 0?void 0:n.enableDebugMessages)===!0&&console.warn(`No validation metadata found. No validation will be performed. There are multiple possible reasons:
|
|
@@ -227,7 +227,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
227
227
|
(end of wrapped stack)
|
|
228
228
|
`+this.stack),this.meta=a}toString(){return`${this.code}(${this.status}): ${this.message}`}};function hae(e){return e.message??e+""}function kot(e){return e==="AUTH_INVALID_USER_OR_PASSWORD"||e==="AUTH_INACTIVE_USER"||e==="AUTH_UNCONFIRMED_USER"||e==="AUTH_UNSUPPORTED_AUTH_TYPE"||e==="AUTH_TOKEN_EXPIRED"||e==="API_ACCESS_DENIED"?403:e==="API_INVALID_REQUEST"||e==="API_INVALID_INPUT"||e==="API_INVALID_INPUT_DATA"||e==="API_INPUT_DATA_CONFLICT"||e==="API_STORAGE_QUOTA_EXCEEDED"?400:500}var _9t=process.env.NODE_ENV||"development";function RA(){return _9t==="development"}var lc=Object.create(null);Object.defineProperty(lc,"toString",{value:()=>"[record]",configurable:!1,enumerable:!1,writable:!1});Object.defineProperty(lc,"valueOf",{value:()=>"[record]",configurable:!1,enumerable:!1,writable:!1});Object.defineProperty(lc,"toLocaleString",{value:()=>"[record]",configurable:!1,enumerable:!1,writable:!1});Object.defineProperty(lc,"isPrototypeOf",{value:()=>!1,configurable:!1,enumerable:!1,writable:!1});Object.defineProperty(lc,"hasOwnProperty",{value:()=>!1,configurable:!1,enumerable:!1,writable:!1});Object.freeze(lc);function ye(e){return e?Object.assign(Object.create(lc),e):Object.create(lc)}function r0e(e){return e?Object.keys(e):[]}function Ep(e){return r0e(e).map(t=>e[t])}function FA(e){return e!==void 0&&e!=null}function T7(e){return typeof e!="object"||e===null?!1:Object.keys(e).length>0}var Cp=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","prototype","toLocaleString","toString","valueOf"]);function k7(e){return Object.freeze(e),Object.freeze(e.prototype),e}function ot(e){return e==null?[]:Array.isArray(e)?e:[e]}function qA(e){let t=new Set(e);return Array.from(t.values())}function i0e(e){for(let t=e.length-1;t>0;t--)e[t-1]===e[t]&&e.splice(t,1);return e}function n0e(...e){if(e.length===0)return new Set;let t=new Set;for(let r of e)if(r!=null)for(let i of r)t.add(i);return t}function O7(...e){if(e.length===0)return new Set;e=e.filter(i=>i);let t=new Set;for(let i of e[0])e.every(n=>r(i,n))&&t.add(i);function r(i,n){return n?Array.isArray(n)?n.includes(i):n.has(i):!0}return t}function P7(e,t){e=Array.isArray(e)?new Set(e):e,t=Array.isArray(t)?new Set(t):t;for(let r of e.values())if(!t.has(r))return!1;return!0}function a0e(e,t){!e||typeof e!="object"||Array.isArray(e)||!t||Object.keys(e).forEach(r=>{let i=r;t(i,e[i],n=>e[i]=n,e)})}function N7(e,...t){for(let r=0;r<e.length;r++)t.some(i=>e[r]===i)&&e.splice(r--,1);return e}async function jA(e,t,r){let i=t.batchSize??Math.max(1,Math.floor(e.length/t.maxConcurrent));if(i<=0)throw new Error("Batch size must be positive");if(e.length<=i)return r(e,0);let n=t.maxConcurrent<=1,a=[];for(let s=0;s<e.length;s+=i){let o=r(e.slice(s,s+i),Math.floor(s/i));n?await o:(a.push(Promise.resolve(o)),a.length>=t.maxConcurrent&&(await Promise.all(a),a.splice(0)))}a.length>0&&await Promise.all(a)}var Tt=fe(Ct());var d0e=fe(Ct());function di(e,t){return new gs(e??"schema",!0,t)}var no=class extends Error{constructor(t){super(t)}},$e=class extends no{constructor(r,i){super(`${r} at ${i.join(".")}`);this.path=i}},l0e=Symbol("JsonSchema"),M7=Symbol("JsonPublishedSchema");function s0e(e,t){let r=e;return r[l0e]=!0,r[M7]=t,e}var gs=class{constructor(t,r,i){this.name=t;this.isPublished=r;if(i){this.allowExtra=i.allowExtra,this.validator=i.validator,this.allowOverride=!0;for(let[n,a]of i.specs.entries())this.specs.set(n,a)}this.validator=this.createObjectValidator(this),this.jsonSchema=s0e({type:"object",title:r?t:void 0,properties:{}},r)}specs=new Map;validator;allowExtra=!1;allowOverride=!1;contextProp;jsonSchema;object(t,r){let i,n;typeof t=="function"?(i="",n=t):(i=t,n=r);let a=new gs(i,!1);return n(a),this.updateJsonSchema(i,!0,a.jsonSchema),this.setupValidationFunc(i,this.createObjectValidator(a)),this.contextProp=i,this}record(t,r,i){let n,a,s;typeof t=="string"?(n=t,typeof r=="function"&&typeof i!="function"?(a=void 0,s=r):(a=r,s=i)):(n="",typeof t=="function"&&typeof r!="function"?(a=void 0,s=t):(a=t,s=r));let o=new gs(n+"_record",!1);return this.setupValidationFunc(n,this.createRecordValidator(a,o)),s(o),this.updateJsonSchema(n,!0,{type:"object",additionalProperties:o.jsonSchema,properties:{}}),this}array(t,r,i){let n="",a,s,o;return typeof t=="function"||Array.isArray(t)?(n="",a=t,o=r):typeof r=="function"||Array.isArray(r)?(n=t,a=r,o=i):typeof t=="object"&&!Array.isArray(t)?(n="",s=t,o=r):typeof r=="object"&&!Array.isArray(r)&&(n=t,s=r,o=i),this.setupArray(n,a,o,s,!1),this.contextProp=n,this}arrayOrOne(t,r,i){let n="",a,s,o;return typeof t=="function"?(n="",a=t,o=r):typeof r=="function"?(n=t,a=r,o=i):typeof t=="object"?(n="",s=t,o=r):typeof r=="object"&&(n=t,s=r,o=i),this.setupArrayOrOne(n,a,o,s,!1),this.contextProp=n,this}string(t,r,i){let n,a,s,o;return typeof t=="string"?(n=t,u(r),typeof i=="object"&&(a=i)):(n="",u(t),typeof r=="object"&&(a=r)),this.setupValidationFunc(n,this.createStringValidator(a,o,s)),this.updateJsonSchema(n,!0,{type:"string",format:a==null?void 0:a.formatHint,enum:a==null?void 0:a.values,minLength:a==null?void 0:a.minLen,maxLength:a==null?void 0:a.maxLen}),this.contextProp=n,this;function u(l){l instanceof RegExp&&(o=l),typeof l=="function"&&(s=l),typeof l=="object"&&(a=l)}}number(t,r){let i,n,a;return typeof t=="string"?(i=t,s(r)):(i="",s(t)),this.setupValidationFunc(i,this.createNumberValidator(n,a)),this.updateJsonSchema(i,!0,{type:n!=null&&n.integer?"integer":"number",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative||n!=null&&n.positive?0:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function s(o){typeof o=="function"&&(a=o),typeof o=="object"&&(n=o)}}integer(t,r){let i,n,a;return typeof t=="string"?(i=t,s(r)):(i="",s(t)),this.setupValidationFunc(i,this.createNumberValidator({...n,integer:!0},a)),this.updateJsonSchema(i,!0,{type:"integer",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative?0:n!=null&&n.positive?1:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function s(o){typeof o=="function"&&(a=o),typeof o=="object"&&(n=o)}}bool(t){let r=typeof t=="string"?t:"";return this.setupValidationFunc(r,this.createBooleanValidator(void 0)),this.updateJsonSchema(r,!0,{type:"boolean"}),this.contextProp=r,this}basic(t){let r=typeof t=="string"?t:"";return this.setupValidationFunc(r,this.createBasicValueValidator()),this.updateJsonSchema(r,!0,{nullable:!0,oneOf:[{type:"string"},{type:"number"},{type:"boolean"}]}),this.contextProp=r,this}is(t,r){let i,n;typeof t=="string"?(i=[t],n=r):Array.isArray(t)?(i=t,n=r):(i=[""],n=t);for(let a of i)this.setupValidationFunc(a,n.validator),this.updateJsonSchema(a,!0,n.jsonSchema);return i.length===1&&(this.contextProp=i[0]),this}objectOpt(t,r){let i,n;typeof t=="function"?(i="",n=t):(i=t,n=r);let a=new gs(i,!1);return n(a),this.setupValidationFunc(i,this.createOptValidator(this.createObjectValidator(a))),this.updateJsonSchema(i,!1,a.jsonSchema),this.contextProp=i,this}recordOpt(t,r,i){let n,a,s;typeof t=="string"?(n=t,typeof r=="function"&&typeof i!="function"?(a=void 0,s=r):(a=r,s=i)):(n="",typeof t=="function"&&typeof r!="function"?(a=void 0,s=t):(a=t,s=r));let o=new gs(n+"_record",!1);return this.setupValidationFunc(n,this.createOptValidator(this.createRecordValidator(a,o))),this.updateJsonSchema(n,!1,{type:"object",additionalProperties:o.jsonSchema,properties:{}}),s(o),this}arrayOpt(t,r,i){let n="",a,s,o;return typeof t=="function"||Array.isArray(t)?(n="",a=t,o=r):typeof r=="function"||Array.isArray(r)?(n=t,a=r,o=i):typeof t=="object"&&!Array.isArray(t)?(n="",s=t,o=r):typeof r=="object"&&!Array.isArray(r)&&(n=t,s=r,o=i),this.setupArray(n,a,o,s,!0),this.contextProp=n,this}arrayOrOneOpt(t,r,i){let n="",a,s,o;return typeof t=="function"?(n="",a=t,o=r):typeof r=="function"?(n=t,a=r,o=i):typeof t=="object"?(n="",s=t,o=r):typeof r=="object"&&(n=t,s=r,o=i),this.setupArrayOrOne(n,a,o,s,!0),this.contextProp=n,this}stringOpt(t,r,i){let n,a,s,o;return typeof t=="string"?(n=t,u(r),typeof i=="object"&&(a=i)):(n="",u(t),typeof r=="object"&&(a=r)),this.setupValidationFunc(n,this.createOptValidator(this.createStringValidator(a,o,s))),this.updateJsonSchema(n,!1,{type:"string",format:a==null?void 0:a.formatHint,enum:a==null?void 0:a.values}),this.contextProp=n,this;function u(l){l instanceof RegExp&&(o=l),typeof l=="function"&&(s=l),typeof l=="object"&&(a=l)}}numberOpt(t,r){let i,n,a;return typeof t=="string"?(i=t,s(r)):(i="",s(t)),this.setupValidationFunc(i,this.createOptValidator(this.createNumberValidator(n,a))),this.updateJsonSchema(i,!1,{type:n!=null&&n.integer?"integer":"number",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative||n!=null&&n.positive?0:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function s(o){typeof o=="function"&&(a=o),typeof o=="object"&&(n=o)}}integerOpt(t,r){let i,n,a;return typeof t=="string"?(i=t,s(r)):(i="",s(t)),this.setupValidationFunc(i,this.createOptValidator(this.createNumberValidator({...n,integer:!0},a))),this.updateJsonSchema(i,!1,{type:"integer",minimum:(n==null?void 0:n.min)??(n!=null&&n.nonNegative?0:n!=null&&n.positive?1:void 0),maximum:(n==null?void 0:n.max)??(n!=null&&n.negative?0:void 0)}),this.contextProp=i,this;function s(o){typeof o=="function"&&(a=o),typeof o=="object"&&(n=o)}}boolOpt(t){let r=typeof t=="string"?t:"";return this.setupValidationFunc(r,this.createOptValidator(this.createBooleanValidator(void 0))),this.updateJsonSchema(r,!1,{type:"boolean"}),this.contextProp=r,this}optIs(t,r){let i,n;return typeof t=="string"?(i=t,n=r):(i="",n=t),this.setupValidationFunc(i,this.createOptValidator(n.validator)),this.updateJsonSchema(i,!1,n.jsonSchema),this.contextProp=i,this}isTrue(t){let r=typeof t=="string"?t:"";return this.setupValidationFunc(r,this.createBooleanValidator(!0)),this.updateJsonSchema(r,!0,{type:"boolean",enum:[!0]}),this.contextProp=r,this}isFalse(t){let r=typeof t=="string"?t:"";return this.setupValidationFunc(r,this.createBooleanValidator(!1)),this.updateJsonSchema(r,!0,{type:"boolean",enum:[!1]}),this.contextProp=r,this}isNull(t){let r=typeof t=="string"?t:"";return this.setupValidationFunc(r,this.createNullValidator()),this.updateJsonSchema(r,!0,{type:"string",nullable:!0,maxLength:0}),this.contextProp=r,this}isNotDefined(t){let r=typeof t=="string"?t:"";return this.setupValidationFunc(r,this.createUndefinedValidator()),this.updateJsonSchema(r,!1,{not:{required:[r]}}),this.contextProp=r,this}isAny(t){let r=typeof t=="string"?t:"";return this.setupValidationFunc(r,this.createAnyValidator()),this.updateJsonSchema(r,!1,{}),this.contextProp=r,this}allowExtraProps(){return this.allowExtra=!0,this}oneOf(...t){let r,i;if(typeof t[0]=="string"?(r=t[0],i=t.slice(1)):(r="",i=t),i.length===0)throw new no(`Must specify at least one alternative for prop '${r}'`);let n=i.map((a,s)=>{let o=new gs(`alt${s}`,!1);return a(o),o});return this.setupValidationFunc(r,this.createAlternativesValidator(n.map(a=>a.validator))),this.updateJsonSchema(r,!0,{oneOf:n.map(a=>a.jsonSchema)}),this.contextProp=r,this}build(){return this.contextProp=void 0,this}setupValidationFunc(t,r){if(t){if(!this.allowOverride&&this.specs.has(t))throw new no(`Property '${t}' is already defined`);this.specs.set(t,r)}else{if(this.specs.size>0)throw new no("Cannot replace schema root if props have defined previously");this.validator=r}}setupArray(t,r,i,n,a){if(r){let s=Array.isArray(r)?r:[r];if(s.length===0)throw new no("Element definitions must contain at least one schema");let o=[];for(let l of s){let d=new gs(`${t}_element`,!1);if(l(d),!d.validator)throw new no(`Missing root definition in array element schema (at '${t}')`);o.push(d)}let u=this.createArrayValidator(o,i??ye());this.setupValidationFunc(t,a?this.createOptValidator(u):u),s.length===1?this.updateJsonSchema(t,!a,{type:"array",items:o[0].jsonSchema,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen}):this.updateJsonSchema(t,!a,{type:"array",prefixItems:o.map(l=>l.jsonSchema),items:!1,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen})}else if(n){let s=this.createArrayValidator([n],i??ye());this.setupValidationFunc(t,a?this.createOptValidator(s):s),this.updateJsonSchema(t,!a,{type:"array",items:n.jsonSchema,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen})}}setupArrayOrOne(t,r,i,n,a){let s;if(r){let o=new gs(`${t}_element`,!1);if(r(o),!o.validator)throw new no(`Missing root definition in array element schema (at '${t}')`);let u=this.createArrayOrOneValidator(o,i??ye());s=o.jsonSchema,this.setupValidationFunc(t,a?this.createOptValidator(u):u)}else if(n){let o=this.createArrayOrOneValidator(n,i??ye());this.setupValidationFunc(t,a?this.createOptValidator(o):o),s=n.jsonSchema}else throw new Error("Internal error - No definition or nested schema");this.updateJsonSchema(t,!a,{oneOf:[s,{type:"array",items:s,minItems:i==null?void 0:i.minLen,maxItems:i==null?void 0:i.maxLen}]})}assertContextProp(){let t=this.contextProp,r=this.specs.get(t);if(!t||!r)throw new no("Missing previously defined property for opt()");return{prop:t,spec:r}}doc(t,r){if(this.contextProp&&this.jsonSchema.type==="object"){this.jsonSchema.properties??=ye();let i=this.jsonSchema.properties[this.contextProp];i.description=t,i.default=r}else this.contextProp||(this.jsonSchema.description=t,this.jsonSchema.default=r);return this}validate(t,r){return this.validator(t,{depth:0,maxDepth:(r==null?void 0:r.maxDepth)??100,path:[this.name],allowCycles:(r==null?void 0:r.allowCycles)??!1,seen:[new Set]},!1),t}toJsonSchema(t){let r=this.jsonSchema;return JSON.parse(JSON.stringify(this.jsonSchema,(i,n)=>{if(typeof n=="object"&&n[l0e]){let a=n;if(n===r)return i?{$ref:"#"}:n;if(n[M7])return{$ref:t+a.title}}return n}))}createObjectValidator(t){return function(i,n,a){if(typeof i!="object"||i===null){if(a)return!1;throw new $e("Expected object",n.path)}o0e(i,n);let s=n.seen.at(-1);s&&s.add(i);for(let[o,u]of t.specs.entries()){let l=i[o];if(s&&l!==null&&typeof l=="object"&&s.has(l)){if(!n.allowCycles)throw new $e("Cycle detected",[...n.path,o]);continue}n.path.push(o),n.depth++;try{if(n.depth>n.maxDepth)throw new $e("Maximum object depth reached",n.path);if(!u(l,n,a))return!1}finally{n.path.pop(),n.depth--}}if(!t.allowExtra){for(let o of Object.keys(i))if(!t.specs.get(o)){if(a)return!1;throw new $e(`Unexpected object property '${o}'`,n.path)}}return!0}}createRecordValidator(t,r){let i=t instanceof RegExp?n=>t.test(n):t;return function(a,s,o){if(typeof a!="object"||a===null){if(o)return!1;throw new $e("Expected record object",s.path)}o0e(a,s);let u=s.seen.at(-1);u&&u.add(a);for(let l of Object.keys(a)){if(i&&!i(l)){if(o)return!1;throw new $e(`Unexpected record property name '${l}' not matching '${i.name||"propValidator"}'`,s.path)}let d=a[l];if(u&&d!==null&&typeof d=="object"&&u.has(d)){if(!s.allowCycles)throw new $e("Cycle detected",[...s.path,l]);continue}s.path.push(l),s.depth++;try{if(s.depth>s.maxDepth)throw new $e("Maximum object depth reached",s.path);let f=r.validator;if(!f(d,s,o))return!1}finally{s.path.pop(),s.depth--}}return!0}}createArrayValidator(t,r){return function(n,a,s){if(!Array.isArray(n)){if(s)return!1;throw new $e("Expected array",a.path)}if(r){if(r.len!==void 0&&r.len!==n.length){if(s)return!1;throw new $e(`Expected array length ${r.len} but actual is ${n.length}`,a.path)}if(r.minLen!==void 0&&r.minLen>n.length){if(s)return!1;throw new $e(`Expected minimum array length ${r.minLen} but actual is ${n.length}`,a.path)}if(r.maxLen!==void 0&&r.maxLen<n.length){if(s)return!1;throw new $e(`Expected maximum array length ${r.maxLen} but actual is ${n.length}`,a.path)}}let o=a.seen.at(-1);o&&o.add(n);let u=t.at(-1),l=t.length===1?n.length:Math.max(t.length,n.length);for(let d=0;d<l;d++){let f=n[d];if(o&&f!==null&&typeof f=="object"&&o.has(f)){if(!a.allowCycles)throw new $e("Cycle detected",[...a.path,d.toString()]);continue}a.path.push(d.toString()),a.depth++;try{if(a.depth>a.maxDepth)throw new $e("Maximum object depth reached",a.path);let m=(t[d]??u).validator;if(!m(f,a,s))return!1}finally{a.path.pop(),a.depth--}}return!0}}createStringValidator(t,r,i){return function(a,s,o){if(typeof a!="string")if(t!=null&&t.allowToString)a=`${a}`;else{if(o)return!1;throw new $e("Expected string",s.path)}if(typeof a!="string")return!1;if(t){if(t.len!==void 0&&t.len!==a.length){if(o)return!1;throw new $e(`Expected string length ${t.len} but actual is ${a.length}`,s.path)}if(t.minLen!==void 0&&t.minLen>a.length){if(o)return!1;throw new $e(`Expected string min length ${t.minLen} but actual is ${a.length}`,s.path)}if(t.maxLen!==void 0&&t.maxLen<a.length){if(o)return!1;throw new $e(`Expected string max length ${t.maxLen} but actual is ${a.length}`,s.path)}if(t.values&&!t.values.includes(a)){if(o)return!1;throw new $e(`String must have one of the allowed values: ${t.values.join("|")}`,s.path)}if(t.value&&t.value!==a){if(o)return!1;throw new $e(`String must have the following value: '${t.value}'`,s.path)}}if(r&&!r.test(a)){if(o)return!1;throw new $e(`Value '${mae(a,200)}' does not match required regular expression`,s.path)}if(i){let u=u0e(i,a);if(u){if(o)return!1;throw new $e(`Invalid string: ${u}`,s.path)}}return!0}}createNumberValidator(t,r){return function(n,a,s){if(typeof n!="number"){if(s)return!1;throw new $e("Expected number",a.path)}if(t){if(t.integer&&!Number.isSafeInteger(n)){if(s)return!1;throw new $e(`Expected integer number but actual is ${n}`,a.path)}if(t.positive&&n<=0){if(s)return!1;throw new $e(`Expected number with positive value but actual is ${n}`,a.path)}if(t.nonNegative&&n<0){if(s)return!1;throw new $e(`Expected number with non-negative value but actual is ${n}`,a.path)}if(t.min!==void 0&&t.min>n){if(s)return!1;throw new $e(`Expected number min value ${t.min} but actual is ${n}`,a.path)}if(t.max!==void 0&&t.max<n){if(s)return!1;throw new $e(`Expected number max value ${t.max} but actual is ${n}`,a.path)}if(t.allowNotFinite!==!0&&!Number.isFinite(n)){if(s)return!1;throw new $e(`Expected number with finite value but actual is ${n}`,a.path)}if(t.negative&&n>=0){if(s)return!1;throw new $e(`Expected number with negative value but actual is ${n}`,a.path)}if(t.values&&!t.values.includes(n)){if(s)return!1;throw new $e(`Number must have one of the allowed values: ${t.values.join("|")}`,a.path)}}if(r){let o=u0e(r,n);if(o){if(s)return!1;throw new $e(`Invalid number: ${o}`,a.path)}}return!0}}createBooleanValidator(t){return function(i,n,a){if(typeof i!="boolean"){if(a)return!1;throw new $e("Expected boolean",n.path)}let s=t===void 0||i===t;if(!s&&!a)throw new $e(`Expected boolean value ${t}`,n.path);return s}}createNullValidator(){return function(r,i,n){if(r!==null){if(n)return!1;throw new $e("Expected null",i.path)}return!0}}createUndefinedValidator(){return function(r,i,n){if(r!==void 0){if(n)return!1;throw new $e("Expected undefined",i.path)}return!0}}createBasicValueValidator(){return function(r,i,n){let a=typeof r;if(a!=="string"&&a!=="number"&&a!=="boolean"&&r!==null){if(n)return!1;throw new $e("Expected basic value",i.path)}return!0}}createAnyValidator(){return function(r,i,n){return!0}}createOptValidator(t){return function(i,n,a){return i===void 0?!0:t(i,n,a)}}createOrNullValidator(t){return function(i,n,a){return i===null?!0:t(i,n,a)}}createOptOrNullValidator(t){return function(i,n,a){return i==null?!0:t(i,n,a)}}createAlternativesValidator(t){return function(i,n,a){let s=[];for(let o of t)try{if(n.seen&&n.seen.push(new Set),o(i,n,!0))return!0}finally{n.seen&&n.seen.pop()}if(a)return!1;for(let o of t)try{o(i,n,!1)}catch(u){s.push(u.message)}throw new $e(`Validation failed because no alternatives match: '${s.join(", ")}'`,n.path)}}createArrayOrOneValidator(t,r){let i=this.createArrayValidator([t],r),n=t.validator;return function(s,o,u){if(Array.isArray(s)){if(!i(s,o,u))return!1}else if(!n(s,o,u))return!1;return!0}}updateJsonSchema(t,r,i){if(t){let n=this.jsonSchema;if(n.type!=="object")throw new Error("Internal error: wrong json schema base type: "+n.type);n.properties??=ye(),n.properties[t]=i,r&&(n.required??=[],n.required.push(t))}else{let n=this.jsonSchema.title;this.jsonSchema=s0e(i,!!i[M7]),this.jsonSchema.title??=n}}};function o0e(e,t){if(Object.prototype.hasOwnProperty.call(e,"__proto__")||e.prototype!==void 0)throw new $e("Unexpected forbidden prototype property",t.path)}function u0e(e,t){try{let r=e(t);if(r===!1)throw new Error(`'${e.name||"Value"}' validation failed`);if(Array.isArray(r))throw new Error(r.join(", "));if(typeof r=="string")throw new Error(r)}catch(r){return r.message}}var LA=["eq","not_eq","like","not_like","in","not_in","like_in","not_like_in","gt","lt","lte","gte","range","has_any","has_all"];var Jt=e=>/^[$a-z][$a-z0-9_.]*$/i.test(e)&&!Cp.has(e),Tp=e=>!Cp.has(e),x9t=e=>!Cp.has(e),j1=e=>typeof e=="string"&&e.length===24&&e[23]==="Z"&&(0,d0e.isISO8601)(e),c0e=di("ByKeysValue").basic().doc("Any basic JSON value (string, number, boolean, null)"),S9t=di("FkIds").record(x9t,e=>e.integer()).doc("Entity ids for mapped entities, e.g. testcase_id"),Xu=di("ByKeys");Xu.record(Jt,e=>e.oneOf(t=>t.arrayOrOne(c0e),t=>t.object(r=>r.string("op",{values:LA}).doc("The comparison/matching operation to perform on the value: "+LA.join(", ")).arrayOrOne("value",c0e).doc("The target value(s) or pattern").isNotDefined("col")),t=>t.object(r=>r.string("op",{values:LA}).doc("The comparison/matching operation to perform on the value: "+LA.join(", ")).isNotDefined("value").string("col",Jt).doc("The target column/prop name (instead of fixed value)")),t=>t.arrayOrOne(Xu))).doc("Describes matching/filtering conditions");var D7=di("MapJoin");D7.arrayOrOneOpt("entities",e=>e.string(Tp,{allowToString:!0})).doc("The list of entity names which are part of the mapping (for mapping relationship tables)").stringOpt("entity",Tp,{allowToString:!0}).doc("The entity name (for direct mapping via a foreign key)").arrayOrOneOpt("ids",e=>e.is(S9t)).doc("A list of id tuples to filter by").boolOpt("inverse").doc("Inverts the result to retrieve non-mapped entities",!1).optIs("filter",Xu).doc("The filter expression applied to the mapping relationship entity").optIs("resultFilter",Xu).doc("The filter expression applied to the result entity (if 'result' is set)").boolOpt("countOnly").doc("Only returns a count instead of a list of entities",!1).boolOpt("idOnly").doc("Only retrieves entity ids, omitting all other columns",!1).boolOpt("optional").doc("Indicates that the mapping is optional and may be 'null' in the result",!1).boolOpt("includeDeleted").doc("Includes deleted member entities in the mapping search result",!1).boolOpt("includeLargeValues").doc("Includes 'large' column/prop values (if available)",!1).boolOpt("omit").doc("Omit the mapping result from result entities - For intermediate nested mappings").stringOpt("result",Tp,{allowToString:!0}).doc("The entity to use as the result instead of the mapping relationship entity data").arrayOrOneOpt("map",D7).doc("Nested mapping starting from one of the member entities of this mapping");var f0e=di("DataReadParams").objectOpt("pagination",e=>e.integerOpt("offset").doc("The offset the result starts at",0).integerOpt("pageAtId").doc("Selects the page with the given id in the result, given a limit (= page size)").integerOpt("inflate").doc("Adds a number of items before the start offset and after the limit (for pagination use)").integerOpt("limit").doc("The maximum number of result rows")).doc("Pagination settings control how much data from a result is fetched").arrayOpt("order",e=>e.oneOf(t=>t.string("order",{value:"seq"}).doc("Ordering by a pre-defined value sequence - the partial ordering of the given values in the result is preserved").string("column",Jt).doc("The name of the column to order by").array("seq",r=>r.number()),t=>t.string("column",Jt).doc("The name of the column to order by").string("order",{values:["asc","desc"]}).doc("Either 'asc'ending or 'desc'ending order for the given column"))).doc("Controls the ordering of the result").boolOpt("includeTotalCount").doc("Includes the total result count if pagination options were given").optIs("filter",Xu).doc("Filter/search terms").arrayOpt("computedColumns",e=>e.string(Jt)).doc("List of computed columns to include (by default includes all)").integerOpt("id",{nonNegative:!0}).doc("Only return the entity with the given id, returns one or none").arrayOpt("ids",e=>e.integer({nonNegative:!0})).doc("Only return the entities with the given ids").arrayOrOneOpt("map",D7).doc("Map expression to expand properties or relationships with other entities").boolOpt("includeDeleted").doc("Includes soft-deleted entitites in the result (if applicable)").boolOpt("includeLargeValues").doc("Includes 'large' column/prop values (if available)",!1).stringOpt("asOf",j1).doc("Perform a history query given the asOf timestamp (if available)").boolOpt("idOnly").doc("Only returns ids in the result, omitting all other properties").boolOpt("countOnly").doc("Returns only the length of the result list instead of the result list itself").build(),wzt=di("WithId").integer("id").doc("The unique entity id").allowExtraProps();function R7(e){let t=e;return t.ctors?t.ctors.map(r=>r.entityName).sort():Array.isArray(e)?e.map(r=>typeof r!="string"?r.entityName:r).sort():typeof e!="string"?e.entityName:e}var F7=0,$9t=2147483647;function BA(e){return e!==void 0&&Number.isSafeInteger(e)&&e<=$9t&&e!==F7}function Qu(e){let t=e;return t[ft]??=ye(),t[ft].traits??=[],t[ft].traits.push(e),e}function L1(e,t){var i,n;let r=((i=e[ft])==null?void 0:i.traits)??((n=e.constructor[ft])==null?void 0:n.traits);return r?r.find&&!!r.find(a=>a.name===t.name):!1}var el=class extends Error{},VA=class extends el{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},UA=class extends el{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},zA=class extends el{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},tl=class extends el{},kp=class extends el{constructor(t){super(`Invalid unit ${t}`)}},Xt=class extends el{},vs=class extends el{constructor(){super("Zone is an abstract class")}};var H="numeric",ys="short",Xr="long",dc={year:H,month:H,day:H},B1={year:H,month:ys,day:H},q7={year:H,month:ys,day:H,weekday:ys},V1={year:H,month:Xr,day:H},U1={year:H,month:Xr,day:H,weekday:Xr},z1={hour:H,minute:H},H1={hour:H,minute:H,second:H},W1={hour:H,minute:H,second:H,timeZoneName:ys},G1={hour:H,minute:H,second:H,timeZoneName:Xr},Z1={hour:H,minute:H,hourCycle:"h23"},K1={hour:H,minute:H,second:H,hourCycle:"h23"},Y1={hour:H,minute:H,second:H,hourCycle:"h23",timeZoneName:ys},J1={hour:H,minute:H,second:H,hourCycle:"h23",timeZoneName:Xr},X1={year:H,month:H,day:H,hour:H,minute:H},Q1={year:H,month:H,day:H,hour:H,minute:H,second:H},ey={year:H,month:ys,day:H,hour:H,minute:H},ty={year:H,month:ys,day:H,hour:H,minute:H,second:H},j7={year:H,month:ys,day:H,weekday:ys,hour:H,minute:H},ry={year:H,month:Xr,day:H,hour:H,minute:H,timeZoneName:ys},iy={year:H,month:Xr,day:H,hour:H,minute:H,second:H,timeZoneName:ys},ny={year:H,month:Xr,day:H,weekday:Xr,hour:H,minute:H,timeZoneName:Xr},ay={year:H,month:Xr,day:H,weekday:Xr,hour:H,minute:H,second:H,timeZoneName:Xr};var jr=class{get type(){throw new vs}get name(){throw new vs}get ianaName(){return this.name}get isUniversal(){throw new vs}offsetName(t,r){throw new vs}formatOffset(t,r){throw new vs}offset(t){throw new vs}equals(t){throw new vs}get isValid(){throw new vs}};var L7=null,ao=class extends jr{static get instance(){return L7===null&&(L7=new ao),L7}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:i}){return WA(t,r,i)}formatOffset(t,r){return fc(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}};var ZA={};function A9t(e){return ZA[e]||(ZA[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ZA[e]}var w9t={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function I9t(e,t){let r=e.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,n,a,s,o,u,l,d]=i;return[s,n,a,o,u,l,d]}function E9t(e,t){let r=e.formatToParts(t),i=[];for(let n=0;n<r.length;n++){let{type:a,value:s}=r[n],o=w9t[a];a==="era"?i[o]=s:Ae(o)||(i[o]=parseInt(s,10))}return i}var GA={},Bt=class extends jr{static create(t){return GA[t]||(GA[t]=new Bt(t)),GA[t]}static resetCache(){GA={},ZA={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Bt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:r,locale:i}){return WA(t,r,i,this.name)}formatOffset(t,r){return fc(this.offset(t),r)}offset(t){let r=new Date(t);if(isNaN(r))return NaN;let i=A9t(this.name),[n,a,s,o,u,l,d]=i.formatToParts?E9t(i,r):I9t(i,r);o==="BC"&&(n=-Math.abs(n)+1);let m=sy({year:n,month:a,day:s,hour:u===24?0:u,minute:l,second:d,millisecond:0}),p=+r,h=p%1e3;return p-=h>=0?h:1e3+h,(m-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};var p0e={};function C9t(e,t={}){let r=JSON.stringify([e,t]),i=p0e[r];return i||(i=new Intl.ListFormat(e,t),p0e[r]=i),i}var B7={};function V7(e,t={}){let r=JSON.stringify([e,t]),i=B7[r];return i||(i=new Intl.DateTimeFormat(e,t),B7[r]=i),i}var U7={};function T9t(e,t={}){let r=JSON.stringify([e,t]),i=U7[r];return i||(i=new Intl.NumberFormat(e,t),U7[r]=i),i}var z7={};function k9t(e,t={}){let{base:r,...i}=t,n=JSON.stringify([e,i]),a=z7[n];return a||(a=new Intl.RelativeTimeFormat(e,t),z7[n]=a),a}var oy=null;function O9t(){return oy||(oy=new Intl.DateTimeFormat().resolvedOptions().locale,oy)}function P9t(e){let t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(r===-1)return[e];{let i,n;try{i=V7(e).resolvedOptions(),n=e}catch{let u=e.substring(0,r);i=V7(u).resolvedOptions(),n=u}let{numberingSystem:a,calendar:s}=i;return[n,a,s]}}function N9t(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function M9t(e){let t=[];for(let r=1;r<=12;r++){let i=ne.utc(2016,r,1);t.push(e(i))}return t}function D9t(e){let t=[];for(let r=1;r<=7;r++){let i=ne.utc(2016,11,13+r);t.push(e(i))}return t}function KA(e,t,r,i,n){let a=e.listingMode(r);return a==="error"?null:a==="en"?i(t):n(t)}function R9t(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}var H7=class{constructor(t,r,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:n,floor:a,...s}=i;if(!r||Object.keys(s).length>0){let o={useGrouping:!1,...i};i.padTo>0&&(o.minimumIntegerDigits=i.padTo),this.inf=T9t(t,o)}}format(t){if(this.inf){let r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{let r=this.floor?Math.floor(t):Op(t,3);return vt(r,this.padTo)}}},W7=class{constructor(t,r,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let s=-1*(t.offset/60),o=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Bt.create(o).valid?(n=o,this.dt=t):(n="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,n=t.zone.name):(n="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let a={...this.opts};a.timeZone=a.timeZone||n,this.dtf=V7(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:i}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},G7=class{constructor(t,r,i){this.opts={style:"long",...i},!r&&YA()&&(this.rtf=k9t(t,i))}format(t,r){return this.rtf?this.rtf.format(t,r):m0e(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},Me=class{static fromOpts(t){return Me.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,r,i,n=!1){let a=t||Fe.defaultLocale,s=a||(n?"en-US":O9t()),o=r||Fe.defaultNumberingSystem,u=i||Fe.defaultOutputCalendar;return new Me(s,o,u,a)}static resetCache(){oy=null,B7={},U7={},z7={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:i}={}){return Me.create(t,r,i)}constructor(t,r,i,n){let[a,s,o]=P9t(t);this.locale=a,this.numberingSystem=r||s||null,this.outputCalendar=i||o||null,this.intl=N9t(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=R9t(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Me.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1,i=!0){return KA(this,t,i,Z7,()=>{let n=r?{month:t,day:"numeric"}:{month:t},a=r?"format":"standalone";return this.monthsCache[a][t]||(this.monthsCache[a][t]=M9t(s=>this.extract(s,n,"month"))),this.monthsCache[a][t]})}weekdays(t,r=!1,i=!0){return KA(this,t,i,K7,()=>{let n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},a=r?"format":"standalone";return this.weekdaysCache[a][t]||(this.weekdaysCache[a][t]=D9t(s=>this.extract(s,n,"weekday"))),this.weekdaysCache[a][t]})}meridiems(t=!0){return KA(this,void 0,t,()=>Y7,()=>{if(!this.meridiemCache){let r={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ne.utc(2016,11,13,9),ne.utc(2016,11,13,19)].map(i=>this.extract(i,r,"dayperiod"))}return this.meridiemCache})}eras(t,r=!0){return KA(this,t,r,J7,()=>{let i={era:t};return this.eraCache[t]||(this.eraCache[t]=[ne.utc(-40,1,1),ne.utc(2017,1,1)].map(n=>this.extract(n,i,"era"))),this.eraCache[t]})}extract(t,r,i){let n=this.dtFormatter(t,r),a=n.formatToParts(),s=a.find(o=>o.type.toLowerCase()===i);return s?s.value:null}numberFormatter(t={}){return new H7(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new W7(t,this.intl,r)}relFormatter(t={}){return new G7(this.intl,this.isEnglish(),t)}listFormatter(t={}){return C9t(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}};var Q7=null,yt=class extends jr{static get utcInstance(){return Q7===null&&(Q7=new yt(0)),Q7}static instance(t){return t===0?yt.utcInstance:new yt(t)}static parseSpecifier(t){if(t){let r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new yt(rd(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${fc(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${fc(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return fc(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};var Pp=class extends jr{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function bs(e,t){let r;if(Ae(e)||e===null)return t;if(e instanceof jr)return e;if(h0e(e)){let i=e.toLowerCase();return i==="default"?t:i==="local"||i==="system"?ao.instance:i==="utc"||i==="gmt"?yt.utcInstance:yt.parseSpecifier(i)||Bt.create(e)}else return so(e)?yt.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new Pp(e)}var g0e=()=>Date.now(),v0e="system",y0e=null,b0e=null,_0e=null,x0e=60,S0e,Fe=class{static get now(){return g0e}static set now(t){g0e=t}static set defaultZone(t){v0e=t}static get defaultZone(){return bs(v0e,ao.instance)}static get defaultLocale(){return y0e}static set defaultLocale(t){y0e=t}static get defaultNumberingSystem(){return b0e}static set defaultNumberingSystem(t){b0e=t}static get defaultOutputCalendar(){return _0e}static set defaultOutputCalendar(t){_0e=t}static get twoDigitCutoffYear(){return x0e}static set twoDigitCutoffYear(t){x0e=t%100}static get throwOnInvalid(){return S0e}static set throwOnInvalid(t){S0e=t}static resetCaches(){Me.resetCache(),Bt.resetCache()}};function Ae(e){return typeof e>"u"}function so(e){return typeof e=="number"}function uy(e){return typeof e=="number"&&e%1===0}function h0e(e){return typeof e=="string"}function $0e(e){return Object.prototype.toString.call(e)==="[object Date]"}function YA(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function A0e(e){return Array.isArray(e)?e:[e]}function eR(e,t,r){if(e.length!==0)return e.reduce((i,n)=>{let a=[t(n),n];return i&&r(i[0],a[0])===i[0]?i:a},null)[1]}function w0e(e,t){return t.reduce((r,i)=>(r[i]=e[i],r),{})}function pc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function oo(e,t,r){return uy(e)&&e>=t&&e<=r}function F9t(e,t){return e-t*Math.floor(e/t)}function vt(e,t=2){let r=e<0,i;return r?i="-"+(""+-e).padStart(t,"0"):i=(""+e).padStart(t,"0"),i}function rl(e){if(!(Ae(e)||e===null||e===""))return parseInt(e,10)}function mc(e){if(!(Ae(e)||e===null||e===""))return parseFloat(e)}function ly(e){if(!(Ae(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Op(e,t,r=!1){let i=10**t;return(r?Math.trunc:Math.round)(e*i)/i}function id(e){return e%4===0&&(e%100!==0||e%400===0)}function nd(e){return id(e)?366:365}function Np(e,t){let r=F9t(t-1,12)+1,i=e+(t-r)/12;return r===2?id(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function sy(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Mp(e){let t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,r=e-1,i=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return t===4||i===3?53:52}function cy(e){return e>99?e:e>Fe.twoDigitCutoffYear?1900+e:2e3+e}function WA(e,t,r,i=null){let n=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(a.timeZone=i);let s={timeZoneName:t,...a},o=new Intl.DateTimeFormat(r,s).formatToParts(n).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function rd(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let i=parseInt(t,10)||0,n=r<0||Object.is(r,-0)?-i:i;return r*60+n}function tR(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Xt(`Invalid unit value ${e}`);return t}function Dp(e,t){let r={};for(let i in e)if(pc(e,i)){let n=e[i];if(n==null)continue;r[t(i)]=tR(n)}return r}function fc(e,t){let r=Math.trunc(Math.abs(e/60)),i=Math.trunc(Math.abs(e%60)),n=e>=0?"+":"-";switch(t){case"short":return`${n}${vt(r,2)}:${vt(i,2)}`;case"narrow":return`${n}${r}${i>0?`:${i}`:""}`;case"techie":return`${n}${vt(r,2)}${vt(i,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function dy(e){return w0e(e,["hour","minute","second","millisecond"])}var q9t=["January","February","March","April","May","June","July","August","September","October","November","December"],rR=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],j9t=["J","F","M","A","M","J","J","A","S","O","N","D"];function Z7(e){switch(e){case"narrow":return[...j9t];case"short":return[...rR];case"long":return[...q9t];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var iR=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],nR=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],L9t=["M","T","W","T","F","S","S"];function K7(e){switch(e){case"narrow":return[...L9t];case"short":return[...nR];case"long":return[...iR];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Y7=["AM","PM"],B9t=["Before Christ","Anno Domini"],V9t=["BC","AD"],U9t=["B","A"];function J7(e){switch(e){case"narrow":return[...U9t];case"short":return[...V9t];case"long":return[...B9t];default:return null}}function I0e(e){return Y7[e.hour<12?0:1]}function E0e(e,t){return K7(t)[e.weekday-1]}function C0e(e,t){return Z7(t)[e.month-1]}function T0e(e,t){return J7(t)[e.year<0?0:1]}function m0e(e,t,r="always",i=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&a){let f=e==="days";switch(t){case 1:return f?"tomorrow":`next ${n[e][0]}`;case-1:return f?"yesterday":`last ${n[e][0]}`;case 0:return f?"today":`this ${n[e][0]}`;default:}}let s=Object.is(t,-0)||t<0,o=Math.abs(t),u=o===1,l=n[e],d=i?u?l[1]:l[2]||l[1]:u?n[e][0]:e;return s?`${o} ${d} ago`:`in ${o} ${d}`}function k0e(e,t){let r="";for(let i of e)i.literal?r+=i.val:r+=t(i.val);return r}var z9t={D:dc,DD:B1,DDD:V1,DDDD:U1,t:z1,tt:H1,ttt:W1,tttt:G1,T:Z1,TT:K1,TTT:Y1,TTTT:J1,f:X1,ff:ey,fff:ry,ffff:ny,F:Q1,FF:ty,FFF:iy,FFFF:ay},bt=class{static create(t,r={}){return new bt(t,r)}static parseFormat(t){let r=null,i="",n=!1,a=[];for(let s=0;s<t.length;s++){let o=t.charAt(s);o==="'"?(i.length>0&&a.push({literal:n||/^\s+$/.test(i),val:i}),r=null,i="",n=!n):n||o===r?i+=o:(i.length>0&&a.push({literal:/^\s+$/.test(i),val:i}),i=o,r=o)}return i.length>0&&a.push({literal:n||/^\s+$/.test(i),val:i}),a}static macroTokenToFormatOpts(t){return z9t[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}formatDateTime(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r}).format()}formatDateTimeParts(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r}).formatToParts()}formatInterval(t,r={}){return this.loc.dtFormatter(t.start,{...this.opts,...r}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r}).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return vt(t,r);let i={...this.opts};return r>0&&(i.padTo=r),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,r){let i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(p,h)=>this.loc.extract(t,p,h),s=p=>t.isOffsetFixed&&t.offset===0&&p.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,p.format):"",o=()=>i?I0e(t):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(p,h)=>i?C0e(t,p):a(h?{month:p}:{month:p,day:"numeric"},"month"),l=(p,h)=>i?E0e(t,p):a(h?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),d=p=>{let h=bt.macroTokenToFormatOpts(p);return h?this.formatWithSystemDefault(t,h):p},f=p=>i?T0e(t,p):a({era:p},"era"),m=p=>{switch(p){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return o();case"d":return n?a({day:"numeric"},"day"):this.num(t.day);case"dd":return n?a({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?a({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?a({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return n?a({month:"numeric"},"month"):this.num(t.month);case"MM":return n?a({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return n?a({year:"numeric"},"year"):this.num(t.year);case"yy":return n?a({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?a({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?a({year:"numeric"},"year"):this.num(t.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return d(p)}};return k0e(bt.parseFormat(r),m)}formatDurationFromString(t,r){let i=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=u=>l=>{let d=i(l);return d?this.num(u.get(d),l.length):l},a=bt.parseFormat(r),s=a.reduce((u,{literal:l,val:d})=>l?u:u.concat(d),[]),o=t.shiftTo(...s.map(i).filter(u=>u));return k0e(a,n(o))}};var Qt=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var P0e=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Fp(...e){let t=e.reduce((r,i)=>r+i.source,"");return RegExp(`^${t}$`)}function qp(...e){return t=>e.reduce(([r,i,n],a)=>{let[s,o,u]=a(t,n);return[{...r,...s},o||i,u]},[{},null,1]).slice(0,2)}function jp(e,...t){if(e==null)return[null,null];for(let[r,i]of t){let n=r.exec(e);if(n)return i(n)}return[null,null]}function N0e(...e){return(t,r)=>{let i={},n;for(n=0;n<e.length;n++)i[e[n]]=rl(t[r+n]);return[i,null,r+n]}}var M0e=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,H9t=`(?:${M0e.source}?(?:\\[(${P0e.source})\\])?)?`,aR=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,D0e=RegExp(`${aR.source}${H9t}`),sR=RegExp(`(?:T${D0e.source})?`),W9t=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,G9t=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Z9t=/(\d{4})-?(\d{3})/,K9t=N0e("weekYear","weekNumber","weekDay"),Y9t=N0e("year","ordinal"),J9t=/(\d{4})-(\d\d)-(\d\d)/,R0e=RegExp(`${aR.source} ?(?:${M0e.source}|(${P0e.source}))?`),X9t=RegExp(`(?: ${R0e.source})?`);function Rp(e,t,r){let i=e[t];return Ae(i)?r:rl(i)}function Q9t(e,t){return[{year:Rp(e,t),month:Rp(e,t+1,1),day:Rp(e,t+2,1)},null,t+3]}function Lp(e,t){return[{hours:Rp(e,t,0),minutes:Rp(e,t+1,0),seconds:Rp(e,t+2,0),milliseconds:ly(e[t+3])},null,t+4]}function fy(e,t){let r=!e[t]&&!e[t+1],i=rd(e[t+1],e[t+2]),n=r?null:yt.instance(i);return[{},n,t+3]}function py(e,t){let r=e[t]?Bt.create(e[t]):null;return[{},r,t+1]}var eEt=RegExp(`^T?${aR.source}$`),tEt=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function rEt(e){let[t,r,i,n,a,s,o,u,l]=e,d=t[0]==="-",f=u&&u[0]==="-",m=(p,h=!1)=>p!==void 0&&(h||p&&d)?-p:p;return[{years:m(mc(r)),months:m(mc(i)),weeks:m(mc(n)),days:m(mc(a)),hours:m(mc(s)),minutes:m(mc(o)),seconds:m(mc(u),u==="-0"),milliseconds:m(ly(l),f)}]}var iEt={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function oR(e,t,r,i,n,a,s){let o={year:t.length===2?cy(rl(t)):rl(t),month:rR.indexOf(r)+1,day:rl(i),hour:rl(n),minute:rl(a)};return s&&(o.second=rl(s)),e&&(o.weekday=e.length>3?iR.indexOf(e)+1:nR.indexOf(e)+1),o}var nEt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function aEt(e){let[,t,r,i,n,a,s,o,u,l,d,f]=e,m=oR(t,n,i,r,a,s,o),p;return u?p=iEt[u]:l?p=0:p=rd(d,f),[m,new yt(p)]}function sEt(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var oEt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,uEt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,lEt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function O0e(e){let[,t,r,i,n,a,s,o]=e;return[oR(t,n,i,r,a,s,o),yt.utcInstance]}function cEt(e){let[,t,r,i,n,a,s,o]=e;return[oR(t,o,r,i,n,a,s),yt.utcInstance]}var dEt=Fp(W9t,sR),fEt=Fp(G9t,sR),pEt=Fp(Z9t,sR),mEt=Fp(D0e),F0e=qp(Q9t,Lp,fy,py),hEt=qp(K9t,Lp,fy,py),gEt=qp(Y9t,Lp,fy,py),vEt=qp(Lp,fy,py);function q0e(e){return jp(e,[dEt,F0e],[fEt,hEt],[pEt,gEt],[mEt,vEt])}function j0e(e){return jp(sEt(e),[nEt,aEt])}function L0e(e){return jp(e,[oEt,O0e],[uEt,O0e],[lEt,cEt])}function B0e(e){return jp(e,[tEt,rEt])}var yEt=qp(Lp);function V0e(e){return jp(e,[eEt,yEt])}var bEt=Fp(J9t,X9t),_Et=Fp(R0e),xEt=qp(Lp,fy,py);function U0e(e){return jp(e,[bEt,F0e],[_Et,xEt])}var SEt="Invalid Duration",z0e={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},$Et={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...z0e},fi=146097/400,Bp=146097/4800,AEt={years:{quarters:4,months:12,weeks:fi/7,days:fi,hours:fi*24,minutes:fi*24*60,seconds:fi*24*60*60,milliseconds:fi*24*60*60*1e3},quarters:{months:3,weeks:fi/28,days:fi/4,hours:fi*24/4,minutes:fi*24*60/4,seconds:fi*24*60*60/4,milliseconds:fi*24*60*60*1e3/4},months:{weeks:Bp/7,days:Bp,hours:Bp*24,minutes:Bp*24*60,seconds:Bp*24*60*60,milliseconds:Bp*24*60*60*1e3},...z0e},ad=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],wEt=ad.slice(0).reverse();function hc(e,t,r=!1){let i={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new xe(i)}function IEt(e){return e<0?Math.floor(e):Math.ceil(e)}function H0e(e,t,r,i,n){let a=e[n][r],s=t[r]/a,o=Math.sign(s)===Math.sign(i[n]),u=!o&&i[n]!==0&&Math.abs(s)<=1?IEt(s):Math.trunc(s);i[n]+=u,t[r]-=u*a}function EEt(e,t){wEt.reduce((r,i)=>Ae(t[i])?r:(r&&H0e(e,t,r,t,i),i),null)}function CEt(e){let t={};for(let[r,i]of Object.entries(e))i!==0&&(t[r]=i);return t}var xe=class{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,i=r?AEt:$Et;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||Me.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(t,r){return xe.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new Xt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new xe({values:Dp(t,xe.normalizeUnit),loc:Me.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(so(t))return xe.fromMillis(t);if(xe.isDuration(t))return t;if(typeof t=="object")return xe.fromObject(t);throw new Xt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[i]=B0e(t);return i?xe.fromObject(i,r):xe.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){let[i]=V0e(t);return i?xe.fromObject(i,r):xe.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new Xt("need to specify a reason the Duration is invalid");let i=t instanceof Qt?t:new Qt(t,r);if(Fe.throwOnInvalid)throw new zA(i);return new xe({invalid:i})}static normalizeUnit(t){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!r)throw new kp(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){let i={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?bt.create(this.loc,i).formatDurationFromString(this,t):SEt}toHuman(t={}){let r=ad.map(i=>{let n=this.values[i];return Ae(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:i.slice(0,-1)}).format(n)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Op(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let r=this.toMillis();if(r<0||r>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};let i=this.shiftTo("hours","minutes","seconds","milliseconds"),n=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(n+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||i.milliseconds!==0)&&(n+=".SSS"));let a=i.toFormat(n);return t.includePrefix&&(a="T"+a),a}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let r=xe.fromDurationLike(t),i={};for(let n of ad)(pc(r.values,n)||pc(this.values,n))&&(i[n]=r.get(n)+this.get(n));return hc(this,{values:i},!0)}minus(t){if(!this.isValid)return this;let r=xe.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;let r={};for(let i of Object.keys(this.values))r[i]=tR(t(this.values[i],i));return hc(this,{values:r},!0)}get(t){return this[xe.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Dp(t,xe.normalizeUnit)};return hc(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:i,matrix:n}={}){let s={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:n,conversionAccuracy:i};return hc(this,s)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return EEt(this.matrix,t),hc(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=CEt(this.normalize().shiftToAll().toObject());return hc(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>xe.normalizeUnit(s));let r={},i={},n=this.toObject(),a;for(let s of ad)if(t.indexOf(s)>=0){a=s;let o=0;for(let l in i)o+=this.matrix[l][s]*i[l],i[l]=0;so(n[s])&&(o+=n[s]);let u=Math.trunc(o);r[s]=u,i[s]=(o*1e3-u*1e3)/1e3;for(let l in n)ad.indexOf(l)>ad.indexOf(s)&&H0e(this.matrix,n,l,r,s)}else so(n[s])&&(i[s]=n[s]);for(let s in i)i[s]!==0&&(r[a]+=s===a?i[s]:i[s]/this.matrix[a][s]);return hc(this,{values:r},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return hc(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(let i of ad)if(!r(this.values[i],t.values[i]))return!1;return!0}};var Vp="Invalid Interval";function TEt(e,t){return!e||!e.isValid?Je.invalid("missing or invalid start"):!t||!t.isValid?Je.invalid("missing or invalid end"):t<e?Je.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}var Je=class{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,r=null){if(!t)throw new Xt("need to specify a reason the Interval is invalid");let i=t instanceof Qt?t:new Qt(t,r);if(Fe.throwOnInvalid)throw new UA(i);return new Je({invalid:i})}static fromDateTimes(t,r){let i=Up(t),n=Up(r),a=TEt(i,n);return a??new Je({start:i,end:n})}static after(t,r){let i=xe.fromDurationLike(r),n=Up(t);return Je.fromDateTimes(n,n.plus(i))}static before(t,r){let i=xe.fromDurationLike(r),n=Up(t);return Je.fromDateTimes(n.minus(i),n)}static fromISO(t,r){let[i,n]=(t||"").split("/",2);if(i&&n){let a,s;try{a=ne.fromISO(i,r),s=a.isValid}catch{s=!1}let o,u;try{o=ne.fromISO(n,r),u=o.isValid}catch{u=!1}if(s&&u)return Je.fromDateTimes(a,o);if(s){let l=xe.fromISO(n,r);if(l.isValid)return Je.after(a,l)}else if(u){let l=xe.fromISO(i,r);if(l.isValid)return Je.before(o,l)}}return Je.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;let r=this.start.startOf(t),i=this.end.startOf(t);return Math.floor(i.diff(r,t).get(t))+(i.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?Je.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];let r=t.map(Up).filter(s=>this.contains(s)).sort(),i=[],{s:n}=this,a=0;for(;n<this.e;){let s=r[a]||this.e,o=+s>+this.e?this.e:s;i.push(Je.fromDateTimes(n,o)),n=o,a+=1}return i}splitBy(t){let r=xe.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:i}=this,n=1,a,s=[];for(;i<this.e;){let o=this.start.plus(r.mapUnits(u=>u*n));a=+o>+this.e?this.e:o,s.push(Je.fromDateTimes(i,a)),i=a,n+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let r=this.s>t.s?this.s:t.s,i=this.e<t.e?this.e:t.e;return r>=i?null:Je.fromDateTimes(r,i)}union(t){if(!this.isValid)return this;let r=this.s<t.s?this.s:t.s,i=this.e>t.e?this.e:t.e;return Je.fromDateTimes(r,i)}static merge(t){let[r,i]=t.sort((n,a)=>n.s-a.s).reduce(([n,a],s)=>a?a.overlaps(s)||a.abutsStart(s)?[n,a.union(s)]:[n.concat([a]),s]:[n,s],[[],null]);return i&&r.push(i),r}static xor(t){let r=null,i=0,n=[],a=t.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),s=Array.prototype.concat(...a),o=s.sort((u,l)=>u.time-l.time);for(let u of o)i+=u.type==="s"?1:-1,i===1?r=u.time:(r&&+r!=+u.time&&n.push(Je.fromDateTimes(r,u.time)),r=null);return Je.merge(n)}difference(...t){return Je.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Vp}toLocaleString(t=dc,r={}){return this.isValid?bt.create(this.s.loc.clone(r),t).formatInterval(this):Vp}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Vp}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Vp}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Vp}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:Vp}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):xe.invalid(this.invalidReason)}mapEndpoints(t){return Je.fromDateTimes(t(this.s),t(this.e))}};var il=class{static hasDST(t=Fe.defaultZone){let r=ne.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return Bt.isValidZone(t)}static normalizeZone(t){return bs(t,Fe.defaultZone)}static months(t="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||Me.create(r,i,a)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||Me.create(r,i,a)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||Me.create(r,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||Me.create(r,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Me.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return Me.create(r,null,"gregory").eras(t)}static features(){return{relative:YA()}}};function W0e(e,t){let r=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=r(t)-r(e);return Math.floor(xe.fromMillis(i).as("days"))}function kEt(e,t,r){let i=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{let d=W0e(u,l);return(d-d%7)/7}],["days",W0e]],n={},a=e,s,o;for(let[u,l]of i)r.indexOf(u)>=0&&(s=u,n[u]=l(e,t),o=a.plus(n),o>t?(n[u]--,e=a.plus(n)):e=o);return[e,n,o,s]}function G0e(e,t,r,i){let[n,a,s,o]=kEt(e,t,r),u=t-n,l=r.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);l.length===0&&(s<t&&(s=n.plus({[o]:1})),s!==n&&(a[o]=(a[o]||0)+u/(s-n)));let d=xe.fromObject(a,i);return l.length>0?xe.fromMillis(u,i).shiftTo(...l).plus(d):d}var uR={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},Z0e={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},OEt=uR.hanidec.replace(/[\[|\]]/g,"").split("");function K0e(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(e[r].search(uR.hanidec)!==-1)t+=OEt.indexOf(e[r]);else for(let n in Z0e){let[a,s]=Z0e[n];i>=a&&i<=s&&(t+=i-a)}}return parseInt(t,10)}else return t}function pi({numberingSystem:e},t=""){return new RegExp(`${uR[e||"latn"]}${t}`)}var PEt="missing Intl.DateTimeFormat.formatToParts support";function Re(e,t=r=>r){return{regex:e,deser:([r])=>t(K0e(r))}}var NEt=String.fromCharCode(160),X0e=`[ ${NEt}]`,Q0e=new RegExp(X0e,"g");function MEt(e){return e.replace(/\./g,"\\.?").replace(Q0e,X0e)}function Y0e(e){return e.replace(/\./g,"").replace(Q0e," ").toLowerCase()}function _s(e,t){return e===null?null:{regex:RegExp(e.map(MEt).join("|")),deser:([r])=>e.findIndex(i=>Y0e(r)===Y0e(i))+t}}function J0e(e,t){return{regex:e,deser:([,r,i])=>rd(r,i),groups:t}}function JA(e){return{regex:e,deser:([t])=>t}}function DEt(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function REt(e,t){let r=pi(t),i=pi(t,"{2}"),n=pi(t,"{3}"),a=pi(t,"{4}"),s=pi(t,"{6}"),o=pi(t,"{1,2}"),u=pi(t,"{1,3}"),l=pi(t,"{1,6}"),d=pi(t,"{1,9}"),f=pi(t,"{2,4}"),m=pi(t,"{4,6}"),p=y=>({regex:RegExp(DEt(y.val)),deser:([_])=>_,literal:!0}),g=(y=>{if(e.literal)return p(y);switch(y.val){case"G":return _s(t.eras("short",!1),0);case"GG":return _s(t.eras("long",!1),0);case"y":return Re(l);case"yy":return Re(f,cy);case"yyyy":return Re(a);case"yyyyy":return Re(m);case"yyyyyy":return Re(s);case"M":return Re(o);case"MM":return Re(i);case"MMM":return _s(t.months("short",!0,!1),1);case"MMMM":return _s(t.months("long",!0,!1),1);case"L":return Re(o);case"LL":return Re(i);case"LLL":return _s(t.months("short",!1,!1),1);case"LLLL":return _s(t.months("long",!1,!1),1);case"d":return Re(o);case"dd":return Re(i);case"o":return Re(u);case"ooo":return Re(n);case"HH":return Re(i);case"H":return Re(o);case"hh":return Re(i);case"h":return Re(o);case"mm":return Re(i);case"m":return Re(o);case"q":return Re(o);case"qq":return Re(i);case"s":return Re(o);case"ss":return Re(i);case"S":return Re(u);case"SSS":return Re(n);case"u":return JA(d);case"uu":return JA(o);case"uuu":return Re(r);case"a":return _s(t.meridiems(),0);case"kkkk":return Re(a);case"kk":return Re(f,cy);case"W":return Re(o);case"WW":return Re(i);case"E":case"c":return Re(r);case"EEE":return _s(t.weekdays("short",!1,!1),1);case"EEEE":return _s(t.weekdays("long",!1,!1),1);case"ccc":return _s(t.weekdays("short",!0,!1),1);case"cccc":return _s(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return J0e(new RegExp(`([+-]${o.source})(?::(${i.source}))?`),2);case"ZZZ":return J0e(new RegExp(`([+-]${o.source})(${i.source})?`),2);case"z":return JA(/[a-z_+-/]{1,256}?/i);case" ":return JA(/[^\S\n\r]/);default:return p(y)}})(e)||{invalidReason:PEt};return g.token=e,g}var FEt={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function qEt(e,t){let{type:r,value:i}=e;if(r==="literal"){let s=/^\s+$/.test(i);return{literal:!s,val:s?" ":i}}let n=t[r],a=FEt[r];if(typeof a=="object"&&(a=a[n]),a)return{literal:!1,val:a}}function jEt(e){return[`^${e.map(r=>r.regex).reduce((r,i)=>`${r}(${i.source})`,"")}$`,e]}function LEt(e,t,r){let i=e.match(t);if(i){let n={},a=1;for(let s in r)if(pc(r,s)){let o=r[s],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(n[o.token.val[0]]=o.deser(i.slice(a,a+u))),a+=u}return[i,n]}else return[i,{}]}function BEt(e){let t=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,i;return Ae(e.z)||(r=Bt.create(e.z)),Ae(e.Z)||(r||(r=new yt(e.Z)),i=e.Z),Ae(e.q)||(e.M=(e.q-1)*3+1),Ae(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Ae(e.u)||(e.S=ly(e.u)),[Object.keys(e).reduce((a,s)=>{let o=t(s);return o&&(a[o]=e[s]),a},{}),r,i]}var lR=null;function VEt(){return lR||(lR=ne.fromMillis(1555555555555)),lR}function UEt(e,t){if(e.literal)return e;let r=bt.macroTokenToFormatOpts(e.val),i=fR(r,t);return i==null||i.includes(void 0)?e:i}function cR(e,t){return Array.prototype.concat(...e.map(r=>UEt(r,t)))}function dR(e,t,r){let i=cR(bt.parseFormat(r),e),n=i.map(s=>REt(s,e)),a=n.find(s=>s.invalidReason);if(a)return{input:t,tokens:i,invalidReason:a.invalidReason};{let[s,o]=jEt(n),u=RegExp(s,"i"),[l,d]=LEt(t,u,o),[f,m,p]=d?BEt(d):[null,null,void 0];if(pc(d,"a")&&pc(d,"H"))throw new tl("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:i,regex:u,rawMatches:l,matches:d,result:f,zone:m,specificOffset:p}}}function ege(e,t,r){let{result:i,zone:n,specificOffset:a,invalidReason:s}=dR(e,t,r);return[i,n,a,s]}function fR(e,t){return e?bt.create(t,e).formatDateTimeParts(VEt()).map(n=>qEt(n,e)):null}var tge=[0,31,59,90,120,151,181,212,243,273,304,334],rge=[0,31,60,91,121,152,182,213,244,274,305,335];function mi(e,t){return new Qt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ige(e,t,r){let i=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let n=i.getUTCDay();return n===0?7:n}function nge(e,t,r){return r+(id(e)?rge:tge)[t-1]}function age(e,t){let r=id(e)?rge:tge,i=r.findIndex(a=>a<t),n=t-r[i];return{month:i+1,day:n}}function XA(e){let{year:t,month:r,day:i}=e,n=nge(t,r,i),a=ige(t,r,i),s=Math.floor((n-a+10)/7),o;return s<1?(o=t-1,s=Mp(o)):s>Mp(t)?(o=t+1,s=1):o=t,{weekYear:o,weekNumber:s,weekday:a,...dy(e)}}function pR(e){let{weekYear:t,weekNumber:r,weekday:i}=e,n=ige(t,1,4),a=nd(t),s=r*7+i-n-3,o;s<1?(o=t-1,s+=nd(o)):s>a?(o=t+1,s-=nd(t)):o=t;let{month:u,day:l}=age(o,s);return{year:o,month:u,day:l,...dy(e)}}function QA(e){let{year:t,month:r,day:i}=e,n=nge(t,r,i);return{year:t,ordinal:n,...dy(e)}}function mR(e){let{year:t,ordinal:r}=e,{month:i,day:n}=age(t,r);return{year:t,month:i,day:n,...dy(e)}}function sge(e){let t=uy(e.weekYear),r=oo(e.weekNumber,1,Mp(e.weekYear)),i=oo(e.weekday,1,7);return t?r?i?!1:mi("weekday",e.weekday):mi("week",e.week):mi("weekYear",e.weekYear)}function oge(e){let t=uy(e.year),r=oo(e.ordinal,1,nd(e.year));return t?r?!1:mi("ordinal",e.ordinal):mi("year",e.year)}function hR(e){let t=uy(e.year),r=oo(e.month,1,12),i=oo(e.day,1,Np(e.year,e.month));return t?r?i?!1:mi("day",e.day):mi("month",e.month):mi("year",e.year)}function gR(e){let{hour:t,minute:r,second:i,millisecond:n}=e,a=oo(t,0,23)||t===24&&r===0&&i===0&&n===0,s=oo(r,0,59),o=oo(i,0,59),u=oo(n,0,999);return a?s?o?u?!1:mi("millisecond",n):mi("second",i):mi("minute",r):mi("hour",t)}var vR="Invalid DateTime",uge=864e13;function ew(e){return new Qt("unsupported zone",`the zone "${e.name}" is not supported`)}function yR(e){return e.weekData===null&&(e.weekData=XA(e.c)),e.weekData}function my(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new ne({...r,...t,old:r})}function gge(e,t,r){let i=e-t*60*1e3,n=r.offset(i);if(t===n)return[i,t];i-=(n-t)*60*1e3;let a=r.offset(i);return n===a?[i,n]:[e-Math.min(n,a)*60*1e3,Math.max(n,a)]}function lge(e,t){e+=t*60*1e3;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function rw(e,t,r){return gge(sy(e),t,r)}function cge(e,t){let r=e.o,i=e.c.year+Math.trunc(t.years),n=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:i,month:n,day:Math.min(e.c.day,Np(i,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=xe.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=sy(a),[u,l]=gge(o,r,e.zone);return s!==0&&(u+=s,l=e.zone.offset(u)),{ts:u,o:l}}function hy(e,t,r,i,n,a){let{setZone:s,zone:o}=r;if(e&&Object.keys(e).length!==0||t){let u=t||o,l=ne.fromObject(e,{...r,zone:u,specificOffset:a});return s?l:l.setZone(o)}else return ne.invalid(new Qt("unparsable",`the input "${n}" can't be parsed as ${i}`))}function tw(e,t,r=!0){return e.isValid?bt.create(Me.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function bR(e,t){let r=e.c.year>9999||e.c.year<0,i="";return r&&e.c.year>=0&&(i+="+"),i+=vt(e.c.year,r?6:4),t?(i+="-",i+=vt(e.c.month),i+="-",i+=vt(e.c.day)):(i+=vt(e.c.month),i+=vt(e.c.day)),i}function dge(e,t,r,i,n,a){let s=vt(e.c.hour);return t?(s+=":",s+=vt(e.c.minute),(e.c.second!==0||!r)&&(s+=":")):s+=vt(e.c.minute),(e.c.second!==0||!r)&&(s+=vt(e.c.second),(e.c.millisecond!==0||!i)&&(s+=".",s+=vt(e.c.millisecond,3))),n&&(e.isOffsetFixed&&e.offset===0&&!a?s+="Z":e.o<0?(s+="-",s+=vt(Math.trunc(-e.o/60)),s+=":",s+=vt(Math.trunc(-e.o%60))):(s+="+",s+=vt(Math.trunc(e.o/60)),s+=":",s+=vt(Math.trunc(e.o%60)))),a&&(s+="["+e.zone.ianaName+"]"),s}var vge={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},zEt={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},HEt={ordinal:1,hour:0,minute:0,second:0,millisecond:0},yge=["year","month","day","hour","minute","second","millisecond"],WEt=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],GEt=["year","ordinal","hour","minute","second","millisecond"];function fge(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new kp(e);return t}function pge(e,t){let r=bs(t.zone,Fe.defaultZone),i=Me.fromObject(t),n=Fe.now(),a,s;if(Ae(e.year))a=n;else{for(let l of yge)Ae(e[l])&&(e[l]=vge[l]);let o=hR(e)||gR(e);if(o)return ne.invalid(o);let u=r.offset(n);[a,s]=rw(e,u,r)}return new ne({ts:a,zone:r,loc:i,o:s})}function mge(e,t,r){let i=Ae(r.round)?!0:r.round,n=(s,o)=>(s=Op(s,i||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(s,o)),a=s=>r.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(r.unit)return n(a(r.unit),r.unit);for(let s of r.units){let o=a(s);if(Math.abs(o)>=1)return n(o,s)}return n(e>t?-0:0,r.units[r.units.length-1])}function hge(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}var ne=class{constructor(t){let r=t.zone||Fe.defaultZone,i=t.invalid||(Number.isNaN(t.ts)?new Qt("invalid input"):null)||(r.isValid?null:ew(r));this.ts=Ae(t.ts)?Fe.now():t.ts;let n=null,a=null;if(!i)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[n,a]=[t.old.c,t.old.o];else{let o=r.offset(this.ts);n=lge(this.ts,o),i=Number.isNaN(n.year)?new Qt("invalid input"):null,n=i?null:n,a=i?null:o}this._zone=r,this.loc=t.loc||Me.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=a,this.isLuxonDateTime=!0}static now(){return new ne({})}static local(){let[t,r]=hge(arguments),[i,n,a,s,o,u,l]=r;return pge({year:i,month:n,day:a,hour:s,minute:o,second:u,millisecond:l},t)}static utc(){let[t,r]=hge(arguments),[i,n,a,s,o,u,l]=r;return t.zone=yt.utcInstance,pge({year:i,month:n,day:a,hour:s,minute:o,second:u,millisecond:l},t)}static fromJSDate(t,r={}){let i=$0e(t)?t.valueOf():NaN;if(Number.isNaN(i))return ne.invalid("invalid input");let n=bs(r.zone,Fe.defaultZone);return n.isValid?new ne({ts:i,zone:n,loc:Me.fromObject(r)}):ne.invalid(ew(n))}static fromMillis(t,r={}){if(so(t))return t<-uge||t>uge?ne.invalid("Timestamp out of range"):new ne({ts:t,zone:bs(r.zone,Fe.defaultZone),loc:Me.fromObject(r)});throw new Xt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(so(t))return new ne({ts:t*1e3,zone:bs(r.zone,Fe.defaultZone),loc:Me.fromObject(r)});throw new Xt("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let i=bs(r.zone,Fe.defaultZone);if(!i.isValid)return ne.invalid(ew(i));let n=Fe.now(),a=Ae(r.specificOffset)?i.offset(n):r.specificOffset,s=Dp(t,fge),o=!Ae(s.ordinal),u=!Ae(s.year),l=!Ae(s.month)||!Ae(s.day),d=u||l,f=s.weekYear||s.weekNumber,m=Me.fromObject(r);if((d||o)&&f)throw new tl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new tl("Can't mix ordinal dates with month/day");let p=f||s.weekday&&!d,h,g,y=lge(n,a);p?(h=WEt,g=zEt,y=XA(y)):o?(h=GEt,g=HEt,y=QA(y)):(h=yge,g=vge);let _=!1;for(let J of h){let ue=s[J];Ae(ue)?_?s[J]=g[J]:s[J]=y[J]:_=!0}let A=p?sge(s):o?oge(s):hR(s),w=A||gR(s);if(w)return ne.invalid(w);let R=p?pR(s):o?mR(s):s,[V,ae]=rw(R,a,i),B=new ne({ts:V,zone:i,o:ae,loc:m});return s.weekday&&d&&t.weekday!==B.weekday?ne.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${B.toISO()}`):B}static fromISO(t,r={}){let[i,n]=q0e(t);return hy(i,n,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[i,n]=j0e(t);return hy(i,n,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[i,n]=L0e(t);return hy(i,n,r,"HTTP",r)}static fromFormat(t,r,i={}){if(Ae(t)||Ae(r))throw new Xt("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:a=null}=i,s=Me.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),[o,u,l,d]=ege(s,t,r);return d?ne.invalid(d):hy(o,u,i,`format ${r}`,t,l)}static fromString(t,r,i={}){return ne.fromFormat(t,r,i)}static fromSQL(t,r={}){let[i,n]=U0e(t);return hy(i,n,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new Xt("need to specify a reason the DateTime is invalid");let i=t instanceof Qt?t:new Qt(t,r);if(Fe.throwOnInvalid)throw new VA(i);return new ne({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let i=fR(t,Me.fromObject(r));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(t,r={}){return cR(bt.parseFormat(t),Me.fromObject(r)).map(n=>n.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?yR(this).weekYear:NaN}get weekNumber(){return this.isValid?yR(this).weekNumber:NaN}get weekday(){return this.isValid?yR(this).weekday:NaN}get ordinal(){return this.isValid?QA(this.c).ordinal:NaN}get monthShort(){return this.isValid?il.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?il.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?il.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?il.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return id(this.year)}get daysInMonth(){return Np(this.year,this.month)}get daysInYear(){return this.isValid?nd(this.year):NaN}get weeksInWeekYear(){return this.isValid?Mp(this.weekYear):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:i,calendar:n}=bt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:i,outputCalendar:n}}toUTC(t=0,r={}){return this.setZone(yt.instance(t),r)}toLocal(){return this.setZone(Fe.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:i=!1}={}){if(t=bs(t,Fe.defaultZone),t.equals(this.zone))return this;if(t.isValid){let n=this.ts;if(r||i){let a=t.offset(this.ts),s=this.toObject();[n]=rw(s,a,t)}return my(this,{ts:n,zone:t})}else return ne.invalid(ew(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:i}={}){let n=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:i});return my(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Dp(t,fge),i=!Ae(r.weekYear)||!Ae(r.weekNumber)||!Ae(r.weekday),n=!Ae(r.ordinal),a=!Ae(r.year),s=!Ae(r.month)||!Ae(r.day),o=a||s,u=r.weekYear||r.weekNumber;if((o||n)&&u)throw new tl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&n)throw new tl("Can't mix ordinal dates with month/day");let l;i?l=pR({...XA(this.c),...r}):Ae(r.ordinal)?(l={...this.toObject(),...r},Ae(r.day)&&(l.day=Math.min(Np(l.year,l.month),l.day))):l=mR({...QA(this.c),...r});let[d,f]=rw(l,this.o,this.zone);return my(this,{ts:d,o:f})}plus(t){if(!this.isValid)return this;let r=xe.fromDurationLike(t);return my(this,cge(this,r))}minus(t){if(!this.isValid)return this;let r=xe.fromDurationLike(t).negate();return my(this,cge(this,r))}startOf(t){if(!this.isValid)return this;let r={},i=xe.normalizeUnit(t);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break;case"milliseconds":break}if(i==="weeks"&&(r.weekday=1),i==="quarters"){let n=Math.ceil(this.month/3);r.month=(n-1)*3+1}return this.set(r)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,r={}){return this.isValid?bt.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,t):vR}toLocaleString(t=dc,r={}){return this.isValid?bt.create(this.loc.clone(r),t).formatDateTime(this):vR}toLocaleParts(t={}){return this.isValid?bt.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:r=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;let s=t==="extended",o=bR(this,s);return o+="T",o+=dge(this,s,r,i,n,a),o}toISODate({format:t="extended"}={}){return this.isValid?bR(this,t==="extended"):null}toISOWeekDate(){return tw(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:r=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:a=!1,format:s="extended"}={}){return this.isValid?(n?"T":"")+dge(this,s==="extended",r,t,i,a):null}toRFC2822(){return tw(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return tw(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?bR(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:r=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(r||t)&&(i&&(n+=" "),r?n+="z":t&&(n+="ZZ")),tw(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():vR}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};let r={...this.c};return t.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,r="milliseconds",i={}){if(!this.isValid||!t.isValid)return xe.invalid("created by diffing an invalid DateTime");let n={locale:this.locale,numberingSystem:this.numberingSystem,...i},a=A0e(r).map(xe.normalizeUnit),s=t.valueOf()>this.valueOf(),o=s?this:t,u=s?t:this,l=G0e(o,u,a,n);return s?l.negate():l}diffNow(t="milliseconds",r={}){return this.diff(ne.now(),t,r)}until(t){return this.isValid?Je.fromDateTimes(this,t):this}hasSame(t,r){if(!this.isValid)return!1;let i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(r)<=i&&i<=n.endOf(r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let r=t.base||ne.fromObject({},{zone:this.zone}),i=t.padding?this<r?-t.padding:t.padding:0,n=["years","months","days","hours","minutes","seconds"],a=t.unit;return Array.isArray(t.unit)&&(n=t.unit,a=void 0),mge(r,this.plus(i),{...t,numeric:"always",units:n,unit:a})}toRelativeCalendar(t={}){return this.isValid?mge(t.base||ne.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(ne.isDateTime))throw new Xt("min requires all arguments be DateTimes");return eR(t,r=>r.valueOf(),Math.min)}static max(...t){if(!t.every(ne.isDateTime))throw new Xt("max requires all arguments be DateTimes");return eR(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,i={}){let{locale:n=null,numberingSystem:a=null}=i,s=Me.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});return dR(s,t,r)}static fromStringExplain(t,r,i={}){return ne.fromFormatExplain(t,r,i)}static get DATE_SHORT(){return dc}static get DATE_MED(){return B1}static get DATE_MED_WITH_WEEKDAY(){return q7}static get DATE_FULL(){return V1}static get DATE_HUGE(){return U1}static get TIME_SIMPLE(){return z1}static get TIME_WITH_SECONDS(){return H1}static get TIME_WITH_SHORT_OFFSET(){return W1}static get TIME_WITH_LONG_OFFSET(){return G1}static get TIME_24_SIMPLE(){return Z1}static get TIME_24_WITH_SECONDS(){return K1}static get TIME_24_WITH_SHORT_OFFSET(){return Y1}static get TIME_24_WITH_LONG_OFFSET(){return J1}static get DATETIME_SHORT(){return X1}static get DATETIME_SHORT_WITH_SECONDS(){return Q1}static get DATETIME_MED(){return ey}static get DATETIME_MED_WITH_SECONDS(){return ty}static get DATETIME_MED_WITH_WEEKDAY(){return j7}static get DATETIME_FULL(){return ry}static get DATETIME_FULL_WITH_SECONDS(){return iy}static get DATETIME_HUGE(){return ny}static get DATETIME_HUGE_WITH_SECONDS(){return ay}};function Up(e){if(ne.isDateTime(e))return e;if(e&&e.valueOf&&so(e.valueOf()))return ne.fromJSDate(e);if(e&&typeof e=="object")return ne.fromObject(e);throw new Xt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var sd="1970-01-01T00:00:00.000Z",_R;function SR(){return(_R==null?void 0:_R())??new Date().toISOString()}function gy(){return ne.fromISO(SR(),{zone:"utc"})}function bge(e){if(e!==void 0)return e.toUTC().toISO()}function _ge(e){if(e instanceof ne)return e;if(e!=null)return ne.fromJSDate(new Date(e)).toUTC()}function xR(e,t,r){let i=0;return i+=e*3600+t*60+r,i}function xge(e){if(e.includes(".")||e.includes(","))return NaN;let t=e.match(/^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/);if(t)return xR(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]));let r=e.match(/^([0-5]?[0-9]):([0-5]?[0-9])$/);if(r)return xR(0,parseInt(r[1]),parseInt(r[2]));let i=e.match(/^((?:\s*)\d+\s*(?:h|hr))?((?:\s*)\d+\s*(?:m|min))?((?:\s*)\d+\s*(?:s|sec))?(?:\s*)$/);return i?xR(parseInt(i[1])||0,parseInt(i[2])||0,parseInt(i[3])||0):NaN}function G(e,t){return function(r,i){let n=r.constructor;n[ft]??=ye();let a=n[ft].docProps=n[ft].docProps||ye();a[i]={description:e,omit:!1,...t}}}function od(){return function(e,t){let r=e.constructor;r[ft]??=ye();let i=r[ft].docProps=r[ft].docProps||ye();i[t]={description:"",omit:!0}}}var Sge=/^_?[a-z0-9]+(_[a-z0-9]+)*$/,ft=Symbol("MetaProp");function nt(e,t,r,i,n){if(!Sge.test(e))throw new Error("Internal error: invalid table name in entity definition: "+e);if(!Sge.test(t))throw new Error("Internal error: invalid entity name in entity definition: "+t);let a=i??"ENTITY",o=class{id=0;key(){return`${o.keyPrefix}${BA(this.id)?this.id:"New"}`}initialize(l){vy(this,l)}static get tableName(){return e}static get entityName(){return t}static get parentSchemas(){return r}static idName=`${t}_id`;static keyPrefix=`${a}-`;static urlPrefix=a.toLowerCase();static allowCustomFields=(n==null?void 0:n.allowCustomFields)??!1;static toJSON(){return t}static toString(){return t}static[ft]=ye()},s=o;return E([(0,Tt.IsInt)(),(0,Tt.IsOptional)(),G("The unique entity id - must be a positive integer")],s.prototype,"id",2),k7(s)}function gc(e,t,...r){let i=typeof t=="function"?(r.unshift(t),{}):t;class n{static mapName=e;static mapTableName=r.map(s=>s.entityName).sort().join("_")+"_map";static ctors=r;static parentSchemas=Array.from(n0e(r.map(s=>s.parentSchemas).flat()));static toJSON(){return e}static toString(){return e}static allowCustomFields=(i==null?void 0:i.allowCustomFields)??!1;static[ft]=ye();initialize(s){s&&vy(this,s)}}for(let a of r)if(a===void 0)throw new Error("An entity constructor is undefined");if(qA(r).length!==r.length)throw new Error("Entity constructors must be distinct");return k7(n)}function It(e){class t extends e{is_deleted=!1}return E([(0,Tt.IsOptional)(),Ar(),G("If the entity has been soft-deleted this value is true")],t.prototype,"is_deleted",2),Qu(t)}var XWt=Symbol("ConflictTagMissing");function vc(e){class t extends e{_etag=""}return E([(0,Tt.IsOptional)(),(0,Tt.IsString)(),G("A tag for detecting conflicting modifications - current value must be passed along in an update (or update must be forced)")],t.prototype,"_etag",2),Qu(t)}function Xe(e){class t extends e{created_at=sd;created_by=0;modified_at=void 0;modified_by=0;deleted_at=void 0;deleted_by=0}return E([(0,Tt.IsISO8601)(),(0,Tt.IsOptional)(),G("The creation time for this entity or mapping value",{example:sd})],t.prototype,"created_at",2),E([(0,Tt.IsInt)(),(0,Tt.IsOptional)(),G("The creator user id of this entity or mapping value - or zero if created by the system",{example:0})],t.prototype,"created_by",2),E([(0,Tt.IsISO8601)(),(0,Tt.IsOptional)(),G("The last modification time for this entity or mapping value",{example:sd})],t.prototype,"modified_at",2),E([(0,Tt.IsInt)(),(0,Tt.IsOptional)(),G("The id of the user who last modified or undeleted this entity or mapping value - or zero if modified by the system",{example:0})],t.prototype,"modified_by",2),E([(0,Tt.IsISO8601)(),(0,Tt.IsOptional)(),G("The soft-deletion time for this entity or mapping value",{example:sd})],t.prototype,"deleted_at",2),E([(0,Tt.IsInt)(),(0,Tt.IsOptional)(),G("The id of the user who deleted this entity or mapping value - or zero if deleted by the system",{example:0})],t.prototype,"deleted_by",2),Qu(t)}function _t(e){class t extends e{}return Qu(t)}function zp(e,t,r,i){let n=e.constructor;n[ft]??=ye();let a=n[ft].typeConverters=n[ft].typeConverters||ye();a[t]=a[t]||[],a[t].push({from:r,to:i})}function vy(e,t,r=!0){if(t){for(let i in t)(i in e||typeof t[i]=="object"||i.startsWith("cf__"))&&!Cp.has(i)&&typeof e[i]!="function"&&(e[i]=t[i]);if(!r){let i=Object.keys(e);for(let n of i)n in t||delete e[n]}}}function ud(){return function(e,t){zp(e,t,KEt,YEt)}}function ld(){return function(e,t){zp(e,t,XEt,aw)}}function Ar(){return function(e,t){zp(e,t,JEt,aw)}}function $ge(){return function(e,t){zp(e,t,aw,iw)}}function xs(){return function(e,t){zp(e,t,aw,iw)}}function nw(){return function(e,t){zp(e,t,iw,iw)}}function KEt(e,t){let r=e[t];typeof r=="string"&&(e[t]=JSON.parse(r))}function YEt(e,t){let r=e[t];typeof r=="object"&&(e[t]=JSON.stringify(r))}function JEt(e,t){let r=e[t];typeof r=="string"?e[t]=r==="true"||r==="True"||r==="1":typeof r=="number"?e[t]=r!==0:r===null&&(e[t]=!1)}function Age(e,t){let r=e[t];typeof r=="string"?e[t]=r==="true"||r==="True"||r==="1":typeof r=="number"&&(e[t]=r!==0)}function XEt(e,t){let r=e[t];typeof r=="string"?e[t]=Number.parseInt(r):typeof r=="number"?e[t]=r:r!==void 0&&(e[t]=0)}var yy="",wge=yy+yy;function $R(e,t){let r=e[t];typeof r=="string"&&(e[t]=r.length>0?r.slice(1,r.length-1).split(wge):[])}function AR(e,t){let r=e[t];if(Array.isArray(r)){let i=r.map(n=>(typeof n=="string"?n:`${n}`).replaceAll(yy,"")).filter(n=>n).sort();i0e(i),i.length===0?e[t]="":e[t]=yy+i.join(wge)+yy}}function iw(e,t){delete e[t]}function aw(e,t){}var Ige=(0,Tge.wrapper)(g2),QEt="/api/v1",Ege=60*1e3,De=class{endpointUrl;timeout=Ege;notifications=void 0;apiKey=void 0;enableCookies=!0;customHeaders=ye();static get numPendingRequests(){return De._numPendingRequests}static clearCookies(){var t;(t=De.cookieJar)==null||t.removeAllCookiesSync()}static getCookies(){var t;return((t=De.cookieJar)==null?void 0:t.toJSON())??{}}static setCookies(t){De.cookieJar=t}static configureWithUrl(t){let r=new URL(t);De.configureDefaults({default:{host:r.hostname,port:r.port?Number.parseInt(r.port):r.protocol==="https:"?443:80,protocol:r.protocol},services:{}})}static setBasicAuth(t,r){this.basicAuth={username:t,password:r}}static configureDefaults(t){t??={default:{},services:{}},De.services={default:{}},r("default",t.default,{}),a0e(t.services,(i,n)=>r(i,n,t.default));function r(i,n,a){typeof document=="object"?(n.protocol??=document.location.protocol.replace(/:/,""),n.host??=document.location.hostname,n.port??=document.location.port?parseInt(document.location.port):document.location.protocol==="https:"?443:80):(n.protocol??="http",n.protocol=n.protocol.replace(/:/,""),n.host??="localhost",n.port??=n.protocol==="https"?443:80),De.services[i]={...a,baseUrl:`${n.protocol}://${n.host}:${n.port}${n.api??QEt}`,timeout:n.timeout??Ege}}}constructor(t,r="default"){let i=De.services[r]??De.services.default;t?this.endpointUrl=$g(t.includes("://")?t:`${i.baseUrl}/${JS(t,"/")}`,"/"):this.endpointUrl=i.baseUrl,this.timeout=i.timeout}useNotificationsBase(t,r,i,n,a){this.notifications||(this.notifications=t,t.dataInserted.pipe((0,cd.filter)(s=>i.includes(s.entity))).subscribe(s=>{n&&s.values.forEach(o=>n(o)),r.insert.next(s)}),t.dataUpdated.pipe((0,cd.filter)(s=>i.includes(s.entity))).subscribe(s=>{n&&s.values.forEach(o=>n(o)),r.update.next(s)}),t.dataDeleted.pipe((0,cd.filter)(s=>i.includes(s.entity))).subscribe(s=>{a&&s.values.forEach(a),r.delete.next(s)}),t.dataUndeleted.pipe((0,cd.filter)(s=>i.includes(s.entity))).subscribe(s=>{n&&s.values.forEach(o=>n(o)),r.undelete.next(s)}),t.dataMapped.pipe((0,cd.filter)(s=>O7(i,s.entities).size>0)).subscribe(r.map),t.dataUnmapped.pipe((0,cd.filter)(s=>O7(i,s.entities).size>0)).subscribe(r.unmap))}async get(t,r){return this.internalRequest("get",t,void 0,r)}async post(t,r,i){return this.internalRequest("post",t,r,i)}async put(t,r,i){return this.internalRequest("put",t,r,i)}async delete(t,r,i){return this.internalRequest("delete",t,r,i)}async uploadBinary(t,r,i,n,a){try{return De.onNumPendingChange.next(++De._numPendingRequests),(await Ige.post(`${this.endpointUrl}/${JS(t,"/")}${Cge(n)}`,r,{headers:{Accept:"application/json","Content-Type":i},responseType:"json",withCredentials:!0,jar:this.enableCookies?De.cookieJar:void 0,auth:De.basicAuth,maxRedirects:0,onUploadProgress:a?o=>a(o.loaded??0,o.total??0):void 0})).data}catch(s){let o=this.formatError(s);throw De.onNetworkError.next(o),o}finally{De.onNumPendingChange.next(--De._numPendingRequests)}}strongify(t,r,i=!0){return Array.isArray(t)?t.map(a=>this.toClassObject(a,r,i)):this.toClassObject(t,r,i)}toClassObject(t,r,i=!0){let n=new r;return vy(n,t,i),n}async internalRequest(t,r,i,n){var a;try{De.onNumPendingChange.next(++De._numPendingRequests),De.cookieJar=De.cookieJar??((a=De.cookieJarFactory)==null?void 0:a.call(De));let s=`${this.endpointUrl}/${JS(r,"/")}${Cge(n)}`;return(await Ige.request({url:s,data:i,method:t,responseType:"json",withCredentials:!0,maxRedirects:0,timeout:this.timeout,jar:this.enableCookies?De.cookieJar:void 0,auth:De.basicAuth,headers:{Accept:"application/json","Content-Type":"application/json","x-tab-hint":De.tabHint,"x-wf-client":De.clientInfo,...this.apiKey?{"x-api-key":this.apiKey}:void 0,...this.customHeaders}})).data}catch(s){let o=this.formatError(s);throw De.onNetworkError.next(o),o}finally{De.onNumPendingChange.next(--De._numPendingRequests)}}formatError(t){if(t.response){let r=t.response,i=r.data;throw new ap((i==null?void 0:i.code)??"API_INTERNAL_ERROR",(i==null?void 0:i.message)??r.statusText,r.status,i==null?void 0:i.stack,i==null?void 0:i.meta)}else throw new ap("API_INTERNAL_ERROR",t.message??`Request failed (${t})`,0)}},He=De;ei(He,"services"),ei(He,"basicAuth"),ei(He,"cookieJar"),ei(He,"cookieJarFactory"),ei(He,"_numPendingRequests",0),ei(He,"tabHint",YS()),ei(He,"clientInfo","unknown"),ei(He,"onNetworkError",new wR.Subject),ei(He,"onNumPendingChange",new wR.Subject);He.configureDefaults();function Cge(e){if(!e||Object.keys(e).length===0)return"";return"?"+Object.keys(e).map(r=>e[r]!==void 0?`${encodeURIComponent(r)}=${encodeURIComponent(t(e[r]))}`:"").filter(r=>r).join("&");function t(r){return Array.isArray(r)?r.map(i=>t(i)).join(","):typeof r=="string"?r:typeof r=="number"?r.toString():typeof r=="boolean"?r?"1":"0":""}}var Hp=class extends He{constructor(t){super(t,"auth")}async login(t,r,i,n,a){return await this.post("/auth/login",{...a,email:t,password:r,tenant:i,remember:n??!1})}async getLoginInfo(t){return await this.post("/auth/login/info",{email:t})}async getTenantUserLoginStatus(){return await this.get("/auth/login/tenant-status")}async logout(){await this.post("/auth/logout",{})}async logoutAll(t){await this.post(`/auth/logout-all?keep_current=${t?"1":"0"}`,{})}async switchToTenant(t){return await this.post("/auth/switch/"+encodeURIComponent(t),{})}async changePassword(t,r,i){return await this.post("/account/changepassword",{email:t,password:r,newPassword:i})}async changeEmail(t,r,i){return await this.post("/account/changeemail",{currentEmail:t,password:r,newEmail:i})}async changeEmailConfirm(t){await this.post("/account/changeemail/confirm",{token:t})}async me(){try{return await this.get("/account/me")}catch(t){return{loggedIn:!1,requestFailed:!0,error:hae(t)}}}async updateData(t){return await this.put("/account/userdata",t)}async recover(t){await this.post("/account/recover",{email:t})}async recoverConfirm(t,r){await this.post("/account/recover/confirm/"+t,{newPassword:r})}async register(t){await this.post("/signup/register",t)}async checkTenantName(t){return await this.get("/signup/register/check/tenant/"+encodeURIComponent(t))}async checkEmail(t){return await this.get("/signup/register/check/email/"+encodeURIComponent(t))}async invite(t,r,i,n,a){await this.post("/signup/invite",{email:t,tenant:r,firstName:a==null?void 0:a.firstName,lastName:a==null?void 0:a.lastName,initialRoleId:i,initialRoleProjectId:n})}async uninvite(t,r){await this.post("/signup/uninvite",{email:t,tenant:r})}async getInviteInfo(t){return await this.get("/signup/invite/info/"+encodeURIComponent(t))}async getRegisterInfo(t){return await this.get("/signup/register/info/"+encodeURIComponent(t))}async registerConfirm(t,r){await this.post("/signup/register/confirm/"+encodeURIComponent(t),r)}async inviteConfirm(t){await this.post("/signup/invite/confirm",{token:t})}async inviteConfirmCreate(t,r,i,n,a){await this.post("/signup/invite/confirm",{token:t,userDisplayName:n,newPassword:a,firstName:r,lastName:i})}async resend(t){await this.post("/signup/register/confirm-resend",{email:t})}};var gi=fe(Ct());var hi=fe(Ct());function yc(e,t){let r=(t==null?void 0:t.context)??[];for(let i=0;i<e.length;i++)r[`constraint${i+1}`]=e[i];return{...t,context:r}}function kge(e,t){return hi.MinLength(e,yc([e],t))}function Ce(e,t){return hi.MaxLength(e,yc([e],t))}function sw(e,t){return hi.Min(e,yc([e],t))}function Oge(e,t){return hi.Max(e,yc([e],t))}function Pge(e,t){return hi.Matches(e,yc([e],t))}function Oe(e,t){return function(r,i){let n=r.constructor;n[ft]??=ye(),n[ft].trackedEntities??=[],n.ctors?n[ft].trackedEntities.push({type:"map_prop",propName:i,sourceEntityName:r.constructor.mapName,targetEntityName:e,withHistory:L1(r.constructor,_t),hintOnly:t??!1}):n[ft].trackedEntities.push({type:"prop",propName:i,sourceEntityName:r.constructor.entityName,targetEntityName:e,withHistory:L1(r.constructor,_t),hintOnly:t??!1})}}var Et=fe(Ct());var eCt=/[\\/:*?"<>|]+/g,tCt=/^(|nul|prn|con|lpt[0-9]|com[0-9]|\.)(\.|$)/i;function rCt(e){return typeof e=="string"&&!e.match(eCt)&&!e.match(tCt)}function Nge(e){return(0,Et.ValidateBy)({name:"isValidFilename",validator:{validate:rCt,defaultMessage:(0,Et.buildMessage)(t=>t+"Value '$value' is not a valid filename",e)}},e)}function IR(e,t){return typeof e=="string"&&(0,Et.minLength)(e.trim().replace(/\p{Cf}/u,""),t)}function nl(e,t){let r=yc([e],t);return(0,Et.ValidateBy)({name:"minLengthTrimmed",constraints:[e],validator:{validate:(i,n)=>IR(i,n==null?void 0:n.constraints[0]),defaultMessage:(0,Et.buildMessage)(i=>i+"Trimmed $property must be longer than or equal to $constraint1 characters",r)}},r)}function iCt(e,t){return typeof e=="string"&&(0,Et.maxLength)(e.trim(),t)}function Mge(e,t){let r=yc([e],t);return(0,Et.ValidateBy)({name:"maxLengthTrimmed",constraints:[e],validator:{validate:(i,n)=>iCt(i,n==null?void 0:n.constraints[0]),defaultMessage:(0,Et.buildMessage)(i=>i+"Trimmed $property must be shorter than or equal to $constraint1 characters",r)}},r)}function Dge(e){return(0,Et.ValidateBy)({name:"isWord",validator:{validate:(t,r)=>dae(t),defaultMessage:(0,Et.buildMessage)(t=>t+"$property must only contain numbers, letters and underscores",e)}},e)}function Rge(e){return(0,Et.ValidateBy)({name:"startsWithLetter",validator:{validate:(t,r)=>fae(t),defaultMessage:(0,Et.buildMessage)(t=>t+"$property must start with a letter",e)}},e)}function Fge(e,t){return(0,Et.ValidateBy)({name:"isValidId",validator:{validate:(r,i)=>typeof r=="number"&&(BA(r)||!!e&&r===0),defaultMessage:(0,Et.buildMessage)(r=>r+"$property must be a valid entity id",t)}},t)}function qge(e,t){let r;return(0,Et.ValidateBy)({name:"isSchema",validator:{validate:(i,n)=>{try{return r=void 0,e.validate(i,{allowCycles:!0}),!0}catch(a){return r=a,!1}},defaultMessage:(0,Et.buildMessage)(i=>i+`$property must be a valid '${e.name}'.${r!==void 0?" "+r:""}`,t)}},t)}var bc=class extends vc(Xe(It(nt("projects","project",["tenant"],"P")))){owner_user_id=0;name="";project_key=void 0;description="";constructor(t){super(),this.initialize(t)}};E([Oe("user"),(0,gi.IsInt)(),G("Reserved for future use")],bc.prototype,"owner_user_id",2),E([(0,gi.IsString)(),nl(3),Ce(40),G("The project name")],bc.prototype,"name",2),E([(0,gi.IsString)(),(0,gi.IsOptional)(),nl(2),Mge(5),(0,gi.IsAlphanumeric)(),(0,gi.IsUppercase)(),G("An optional project shorthand key",{nullable:!0,example:"PRO"})],bc.prototype,"project_key",2),E([(0,gi.IsString)(),G("An optional descriptive text for the project")],bc.prototype,"description",2);var md=fe(Sg());var by=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Bge=new Set,ER=typeof process=="object"&&process?process:{},Vge=(e,t,r,i)=>{typeof ER.emitWarning=="function"?ER.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)},uw=globalThis.AbortController,jge=globalThis.AbortSignal,Lge;if(typeof uw>"u"){jge=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},uw=class{constructor(){t()}signal=new jge;abort(i){var n,a;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);(a=(n=this.signal).onabort)==null||a.call(n,i)}}};let e=((Lge=ER.env)==null?void 0:Lge.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{e&&(e=!1,Vge("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var nCt=e=>!Bge.has(e),BGt=Symbol("type"),_c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Uge=e=>_c(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Gp:null:null,Gp=class extends Array{constructor(t){super(t),this.fill(0)}},Zp,Wp=class{heap;length;static create(t){let r=Uge(t);if(!r)return[];Gw(Wp,Zp,!0);let i=new Wp(t,r);return Gw(Wp,Zp,!1),i}constructor(t,r){if(!$F(Wp,Zp))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},ow=Wp;Zp=new WeakMap,AF(ow,Zp,!1);var Kp=class{#p;#c;#y;#m;#T;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#h;#n;#r;#e;#u;#d;#o;#a;#g;#s;#S;#$;#v;#b;#w;#l;static unsafeExposeInternals(t){return{starts:t.#$,ttls:t.#v,sizes:t.#S,keyMap:t.#n,keyList:t.#r,valList:t.#e,next:t.#u,prev:t.#d,get head(){return t.#o},get tail(){return t.#a},free:t.#g,isBackgroundFetch:r=>t.#t(r),backgroundFetch:(r,i,n,a)=>t.#P(r,i,n,a),moveToTail:r=>t.#C(r),indexes:r=>t.#_(r),rindexes:r=>t.#x(r),isStale:r=>t.#f(r)}}get max(){return this.#p}get maxSize(){return this.#c}get calculatedSize(){return this.#h}get size(){return this.#i}get fetchMethod(){return this.#T}get dispose(){return this.#y}get disposeAfter(){return this.#m}constructor(t){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:u,dispose:l,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:m,maxSize:p=0,maxEntrySize:h=0,sizeCalculation:g,fetchMethod:y,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:R,ignoreFetchAbort:V}=t;if(r!==0&&!_c(r))throw new TypeError("max option must be a nonnegative integer");let ae=r?Uge(r):Array;if(!ae)throw new Error("invalid max value: "+r);if(this.#p=r,this.#c=p,this.maxEntrySize=h||this.#c,this.sizeCalculation=g,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#T=y,this.#w=!!y,this.#n=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new ae(r),this.#d=new ae(r),this.#o=0,this.#a=0,this.#g=ow.create(r),this.#i=0,this.#h=0,typeof l=="function"&&(this.#y=l),typeof d=="function"?(this.#m=d,this.#s=[]):(this.#m=void 0,this.#s=void 0),this.#b=!!this.#y,this.#l=!!this.#m,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!V,this.maxEntrySize!==0){if(this.#c!==0&&!_c(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!_c(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=_c(n)||n===0?n:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!_c(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#p===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#p&&!this.#c){let B="LRU_CACHE_UNBOUNDED";nCt(B)&&(Bge.add(B),Vge("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,Kp))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#N(){let t=new Gp(this.#p),r=new Gp(this.#p);this.#v=t,this.#$=r,this.#M=(a,s,o=by.now())=>{if(r[a]=s!==0?o:0,t[a]=s,s!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#f(a)&&this.delete(this.#r[a])},s+1);u.unref&&u.unref()}},this.#I=a=>{r[a]=t[a]!==0?by.now():0},this.#A=(a,s)=>{if(t[s]){let o=t[s],u=r[s];a.ttl=o,a.start=u,a.now=i||n();let l=a.now-u;a.remainingTTL=o-l}};let i=0,n=()=>{let a=by.now();if(this.ttlResolution>0){i=a;let s=setTimeout(()=>i=0,this.ttlResolution);s.unref&&s.unref()}return a};this.getRemainingTTL=a=>{let s=this.#n.get(a);if(s===void 0)return 0;let o=t[s],u=r[s];if(o===0||u===0)return 1/0;let l=(i||n())-u;return o-l},this.#f=a=>t[a]!==0&&r[a]!==0&&(i||n())-r[a]>t[a]}#I=()=>{};#A=()=>{};#M=()=>{};#f=()=>!1;#q(){let t=new Gp(this.#p);this.#h=0,this.#S=t,this.#E=r=>{this.#h-=t[r],t[r]=0},this.#D=(r,i,n,a)=>{if(this.#t(i))return 0;if(!_c(n))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(n=a(i,r),!_c(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#k=(r,i,n)=>{if(t[r]=i,this.#c){let a=this.#c-t[r];for(;this.#h>a;)this.#O(!0)}this.#h+=t[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#h)}}#E=t=>{};#k=(t,r,i)=>{};#D=(t,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#_({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#a;!(!this.#R(r)||((t||!this.#f(r))&&(yield r),r===this.#o));)r=this.#d[r]}*#x({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#o;!(!this.#R(r)||((t||!this.#f(r))&&(yield r),r===this.#a));)r=this.#u[r]}#R(t){return t!==void 0&&this.#n.get(this.#r[t])===t}*entries(){for(let t of this.#_())this.#e[t]!==void 0&&this.#r[t]!==void 0&&!this.#t(this.#e[t])&&(yield[this.#r[t],this.#e[t]])}*rentries(){for(let t of this.#x())this.#e[t]!==void 0&&this.#r[t]!==void 0&&!this.#t(this.#e[t])&&(yield[this.#r[t],this.#e[t]])}*keys(){for(let t of this.#_()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*rkeys(){for(let t of this.#x()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*values(){for(let t of this.#_())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}*rvalues(){for(let t of this.#x())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}[Symbol.iterator](){return this.entries()}find(t,r={}){for(let i of this.#_()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;if(a!==void 0&&t(a,this.#r[i],this))return this.get(this.#r[i],r)}}forEach(t,r=this){for(let i of this.#_()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;a!==void 0&&t.call(r,a,this.#r[i],this)}}rforEach(t,r=this){for(let i of this.#x()){let n=this.#e[i],a=this.#t(n)?n.__staleWhileFetching:n;a!==void 0&&t.call(r,a,this.#r[i],this)}}purgeStale(){let t=!1;for(let r of this.#x({allowStale:!0}))this.#f(r)&&(this.delete(this.#r[r]),t=!0);return t}dump(){let t=[];for(let r of this.#_({allowStale:!0})){let i=this.#r[r],n=this.#e[r],a=this.#t(n)?n.__staleWhileFetching:n;if(a===void 0||i===void 0)continue;let s={value:a};if(this.#v&&this.#$){s.ttl=this.#v[r];let o=by.now()-this.#$[r];s.start=Math.floor(Date.now()-o)}this.#S&&(s.size=this.#S[r]),t.unshift([i,s])}return t}load(t){this.clear();for(let[r,i]of t){if(i.start){let n=Date.now()-i.start;i.start=by.now()-n}this.set(r,i.value,i)}}set(t,r,i={}){var m,p,h;if(r===void 0)return this.delete(t),this;let{ttl:n=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,d=this.#D(t,r,i.size||0,o);if(this.maxEntrySize&&d>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(t),this;let f=this.#i===0?void 0:this.#n.get(t);if(f===void 0)f=this.#i===0?this.#a:this.#g.length!==0?this.#g.pop():this.#i===this.#p?this.#O(!1):this.#i,this.#r[f]=t,this.#e[f]=r,this.#n.set(t,f),this.#u[this.#a]=f,this.#d[f]=this.#a,this.#a=f,this.#i++,this.#k(f,d,u),u&&(u.set="add"),l=!1;else{this.#C(f);let g=this.#e[f];if(r!==g){if(this.#w&&this.#t(g)?g.__abortController.abort(new Error("replaced")):s||(this.#b&&((m=this.#y)==null||m.call(this,g,t,"set")),this.#l&&((p=this.#s)==null||p.push([g,t,"set"]))),this.#E(f),this.#k(f,d,u),this.#e[f]=r,u){u.set="replace";let y=g&&this.#t(g)?g.__staleWhileFetching:g;y!==void 0&&(u.oldValue=y)}}else u&&(u.set="update")}if(n!==0&&!this.#v&&this.#N(),this.#v&&(l||this.#M(f,n,a),u&&this.#A(u,f)),!s&&this.#l&&this.#s){let g=this.#s,y;for(;y=g==null?void 0:g.shift();)(h=this.#m)==null||h.call(this,...y)}return this}pop(){var t;try{for(;this.#i;){let r=this.#e[this.#o];if(this.#O(!0),this.#t(r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(this.#l&&this.#s){let r=this.#s,i;for(;i=r==null?void 0:r.shift();)(t=this.#m)==null||t.call(this,...i)}}}#O(t){var a,s;let r=this.#o,i=this.#r[r],n=this.#e[r];return this.#w&&this.#t(n)?n.__abortController.abort(new Error("evicted")):(this.#b||this.#l)&&(this.#b&&((a=this.#y)==null||a.call(this,n,i,"evict")),this.#l&&((s=this.#s)==null||s.push([n,i,"evict"]))),this.#E(r),t&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#g.push(r)),this.#i===1?(this.#o=this.#a=0,this.#g.length=0):this.#o=this.#u[r],this.#n.delete(i),this.#i--,r}has(t,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,a=this.#n.get(t);if(a!==void 0){let s=this.#e[a];if(this.#t(s)&&s.__staleWhileFetching===void 0)return!1;if(this.#f(a))n&&(n.has="stale",this.#A(n,a));else return i&&this.#I(a),n&&(n.has="hit",this.#A(n,a)),!0}else n&&(n.has="miss");return!1}peek(t,r={}){let{allowStale:i=this.allowStale}=r,n=this.#n.get(t);if(n!==void 0&&(i||!this.#f(n))){let a=this.#e[n];return this.#t(a)?a.__staleWhileFetching:a}}#P(t,r,i,n){let a=r===void 0?void 0:this.#e[r];if(this.#t(a))return a;let s=new uw,{signal:o}=i;o==null||o.addEventListener("abort",()=>s.abort(o.reason),{signal:s.signal});let u={signal:s.signal,options:i,context:n},l=(g,y=!1)=>{let{aborted:_}=s.signal,A=i.ignoreFetchAbort&&g!==void 0;if(i.status&&(_&&!y?(i.status.fetchAborted=!0,i.status.fetchError=s.signal.reason,A&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),_&&!A&&!y)return f(s.signal.reason);let w=p;return this.#e[r]===p&&(g===void 0?w.__staleWhileFetching?this.#e[r]=w.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,g,u.options))),g},d=g=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=g),f(g)),f=g=>{let{aborted:y}=s.signal,_=y&&i.allowStaleOnFetchAbort,A=_||i.allowStaleOnFetchRejection,w=A||i.noDeleteOnFetchRejection,R=p;if(this.#e[r]===p&&(!w||R.__staleWhileFetching===void 0?this.delete(t):_||(this.#e[r]=R.__staleWhileFetching)),A)return i.status&&R.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw g},m=(g,y)=>{var A;let _=(A=this.#T)==null?void 0:A.call(this,t,a,u);_&&_ instanceof Promise&&_.then(w=>g(w),y),s.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(g(),i.allowStaleOnFetchAbort&&(g=w=>l(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let p=new Promise(m).then(l,d),h=Object.assign(p,{__abortController:s,__staleWhileFetching:a,__returned:void 0});return r===void 0?(this.set(t,h,{...u.options,status:void 0}),r=this.#n.get(t)):this.#e[r]=h,h}#t(t){if(!this.#w)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof uw}async fetch(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:g,forceRefresh:y=!1,status:_,signal:A}=r;if(!this.#w)return _&&(_.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:a,status:_});let w={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:a,ttl:s,noDisposeOnSet:o,size:u,sizeCalculation:l,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:h,ignoreFetchAbort:p,status:_,signal:A},R=this.#n.get(t);if(R===void 0){_&&(_.fetch="miss");let V=this.#P(t,R,w,g);return V.__returned=V}else{let V=this.#e[R];if(this.#t(V)){let be=i&&V.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",be&&(_.returnedStale=!0)),be?V.__staleWhileFetching:V.__returned=V}let ae=this.#f(R);if(!y&&!ae)return _&&(_.fetch="hit"),this.#C(R),n&&this.#I(R),_&&this.#A(_,R),V;let B=this.#P(t,R,w,g),ue=B.__staleWhileFetching!==void 0&&i;return _&&(_.fetch=ae?"stale":"refresh",ue&&ae&&(_.returnedStale=!0)),ue?B.__staleWhileFetching:B.__returned=B}}get(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:s}=r,o=this.#n.get(t);if(o!==void 0){let u=this.#e[o],l=this.#t(u);return s&&this.#A(s,o),this.#f(o)?(s&&(s.get="stale"),l?(s&&i&&u.__staleWhileFetching!==void 0&&(s.returnedStale=!0),i?u.__staleWhileFetching:void 0):(a||this.delete(t),s&&i&&(s.returnedStale=!0),i?u:void 0)):(s&&(s.get="hit"),l?u.__staleWhileFetching:(this.#C(o),n&&this.#I(o),u))}else s&&(s.get="miss")}#F(t,r){this.#d[r]=t,this.#u[t]=r}#C(t){t!==this.#a&&(t===this.#o?this.#o=this.#u[t]:this.#F(this.#d[t],this.#u[t]),this.#F(this.#a,t),this.#a=t)}delete(t){var i,n,a,s;let r=!1;if(this.#i!==0){let o=this.#n.get(t);if(o!==void 0)if(r=!0,this.#i===1)this.clear();else{this.#E(o);let u=this.#e[o];this.#t(u)?u.__abortController.abort(new Error("deleted")):(this.#b||this.#l)&&(this.#b&&((i=this.#y)==null||i.call(this,u,t,"delete")),this.#l&&((n=this.#s)==null||n.push([u,t,"delete"]))),this.#n.delete(t),this.#r[o]=void 0,this.#e[o]=void 0,o===this.#a?this.#a=this.#d[o]:o===this.#o?this.#o=this.#u[o]:(this.#u[this.#d[o]]=this.#u[o],this.#d[this.#u[o]]=this.#d[o]),this.#i--,this.#g.push(o)}}if(this.#l&&((a=this.#s)!=null&&a.length)){let o=this.#s,u;for(;u=o==null?void 0:o.shift();)(s=this.#m)==null||s.call(this,...u)}return r}clear(){var t,r,i;for(let n of this.#x({allowStale:!0})){let a=this.#e[n];if(this.#t(a))a.__abortController.abort(new Error("deleted"));else{let s=this.#r[n];this.#b&&((t=this.#y)==null||t.call(this,a,s,"delete")),this.#l&&((r=this.#s)==null||r.push([a,s,"delete"]))}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#v&&this.#$&&(this.#v.fill(0),this.#$.fill(0)),this.#S&&this.#S.fill(0),this.#o=0,this.#a=0,this.#g.length=0,this.#h=0,this.#i=0,this.#l&&this.#s){let n=this.#s,a;for(;a=n==null?void 0:n.shift();)(i=this.#m)==null||i.call(this,...a)}}};function zge(e,t){let r=t-e;return Math.round(e+r/2+r/10*(Math.random()-.5))}function CR(e,t){return e=e.trim(),/^[-+]?(\d+)$/.test(e)?Number.parseInt(e,t):NaN}function TR(e){return e=e.trim().replaceAll(",","."),/^[-]?(0|[1-9][0-9]*)(\.[0-9]*)?(e[+-]?[0-9]+)?$/i.test(e)?Number.parseFloat(e):NaN}function kR(e){return Number.isFinite(e)?e:null}var _y=Object.freeze({});var fd=class{constructor(t,r,i){this.maxAgeSec=r;if(!t||!r&&r!==0)throw new Error("Internal error - Cache must have maxKeys>0, maxAge>=0");this.internalCache=new Kp({max:t,ttl:1e3*r,updateAgeOnGet:!1}),aCt(this.internalCache,r,t),this.keyTransform=i}internalCache;keyTransform;hitCounter=0;missCounter=0;get metrics(){let t=this.hitCounter+this.missCounter;return{gauge:[this.internalCache.size,t>0?this.hitCounter/t:0],counter:[this.hitCounter,this.missCounter]}}get(t){var n;let r=((n=this.keyTransform)==null?void 0:n.call(this,t))??t,i=this.internalCache.get(r);return i!==void 0?this.hitCounter++:this.missCounter++,i!==_y?i:null}set(t,r,i=0){var a;let n=((a=this.keyTransform)==null?void 0:a.call(this,t))??t;if(r!==void 0){let s=i>0&&this.maxAgeSec>i?1e3*i:void 0;this.internalCache.set(n,r!==null?r:_y,{ttl:s})}else this.internalCache.delete(n);return r}getOrSet(t,r){let i=this.get(t);return i||this.set(t,r)}has(t){var i;let r=((i=this.keyTransform)==null?void 0:i.call(this,t))??t;return this.internalCache.has(r)}del(t){var i;let r=((i=this.keyTransform)==null?void 0:i.call(this,t))??t;this.internalCache.delete(r)}clear(){this.internalCache.clear()}find(t){let r=[];return this.internalCache.forEach(i=>{i!==_y&&t(i)&&r.push(i)}),r}purge(t){let r=[];this.internalCache.forEach((i,n)=>{i!==_y&&t(i)&&r.push(n)});for(let i of r)this.internalCache.delete(i)}purgeStale(){return this.internalCache.purgeStale()}forEach(t){this.internalCache.forEach((r,i)=>{t(r!==_y?r:null,i)})}get count(){return this.internalCache.size}};function aCt(e,t,r){if(t>0&&r>10){let i=setInterval(()=>{e.purgeStale()},1e3*zge(t/3,t/2));typeof i=="object"&&i.unref()}}var pd=fe(Sg());var OR="data-changed",PR="data-mapped";function Hge(e){return e.categories.subject===OR}function Wge(e){return e.categories.subject===PR}var lw=class{constructor(t){this.filter=t}currentFilter=void 0;notificationClient=void 0;notificationSubscription=void 0;setup(t){var r;this.notificationClient=t,(r=this.notificationSubscription)==null||r.unsubscribe(),this.notificationSubscription=t.messageReceived().subscribe(i=>this.processMessage(i)),this.currentFilter&&t.addOrReplaceSubscription(this.currentFilter,this.currentFilter)}setCurrentProject(t){let r={projectId:[t,0],...this.filter};this.currentFilter=this.notificationClient?this.notificationClient.addOrReplaceSubscription(r,this.currentFilter):r}};var NR=class extends lw{dataInserted=new pd.Subject;dataUpdated=new pd.Subject;dataDeleted=new pd.Subject;dataUndeleted=new pd.Subject;dataMapped=new pd.Subject;dataUnmapped=new pd.Subject;constructor(){super({subject:[OR,PR]})}processMessage(t){if(Hge(t)&&t.data){let r={...t.data,origin:t.to.tokenId===t.data.byTokenId&&(t.data.byTabHint===He.tabHint||!t.data.byTabHint)?"self":"other"};t.data.op==="insert"?this.dataInserted.next(r):t.data.op==="update"?this.dataUpdated.next(r):t.data.op==="delete"?this.dataDeleted.next(r):t.data.op==="undelete"&&this.dataUndeleted.next(r)}else if(Wge(t)&&t.data){let r={...t.data,origin:t.to.tokenId===t.data.byTokenId&&(t.data.byTabHint===He.tabHint||!t.data.byTabHint)?"self":"other"};t.data.op==="map"?this.dataMapped.next(r):t.data.op==="unmap"&&this.dataUnmapped.next(r)}}},sCt=new NR;function Yp(){return sCt}function oCt(){let e,t,r=new Promise((i,n)=>{e=i,t=n});return r.catch(()=>{}),r.resolve=e,r.reject=t,r}var cw=class{acquired;get isFree(){return this.acquired===void 0}async acquire(){for(;this.acquired;)await this.acquired;this.acquired=oCt()}release(){if(!this.acquired)throw new Error("Trying to release a non-acquired mutex.");this.acquired.resolve(),this.acquired=void 0}async waitForRelease(){this.acquired&&await this.acquired}},aZt=Symbol("timed out");var sZt=Symbol("error caught");var Gge=1e3,Zge=8*3600,uCt=500;var MR=class extends He{serviceName;ctor;entityCache=new fd(Gge,Zge);cachePrefillMutex=new cw;nextCachePrefillTime=gy();findCachedMutexes=new Map;cacheDeleted;events;uniqueCacheKeys=[];constructor(t,r,i,n){super(i,n),this.ctor=r,this.cacheDeleted=L1(r,It),this.serviceName=t,this.events={insert:new md.Subject,update:new md.Subject,delete:new md.Subject,undelete:new md.Subject,map:new md.Subject,unmap:new md.Subject},this.useNotifications(Yp())}useNotifications(t){this.useNotificationsBase(t,this.events,[this.ctor.entityName],r=>{let i=["id",...this.uniqueCacheKeys];for(let n of i){let a=r[n];FA(a)&&this.entityCache.set(`${n}:${a}`,r)}},r=>{if(this.cacheDeleted){let i=this.entityCache.find(n=>(n==null?void 0:n.id)===r.id);for(let n of i)n.is_deleted=!0}else this.entityCache.purge(i=>(i==null?void 0:i.id)===r.id)})}async findOne(t){if(typeof t=="object"){let i={...t};return i.pagination=i.pagination??{},i.pagination.limit=1,(await this.find(i)).data[0]}if(!t)throw new Error("findOne needs a valid id as an argument");return(await this.find({id:t})).data[0]}async findIds(t){let r=await this.find({...t,idOnly:!0});return{...r,data:r.data.map(i=>i.id)}}async find(t,r){t=lCt(t);let i=JSON.stringify(t),n=i.length>=uCt?await this.post(`/${this.serviceName}/find`,t):await this.get(`/${this.serviceName}`,{q:i});return t!=null&&t.idOnly||(n.data=n.data.map(a=>this.toClassObject(a,r??this.ctor))),n}async count(t,r){return(await this.find({...t,countOnly:!0},r)).meta.count}async findCached(t,r,i,n=!1){if(i||await this.cachePrefillMutex.waitForRelease(),t===void 0&&r===void 0){let u=new Set,l=this.entityCache.find(f=>f!==null),d=[];for(let f of l)!u.has(f.id)&&(n||!this.cacheDeleted||!f.is_deleted)&&(d.push(f),u.add(f.id));return d}let a=ot(t);r??="id";let s=`keys:${a.join(",")}; byKey:${String(r)??""}; ${n}`;for(;;){let u=this.findCachedMutexes.get(s);if(u===void 0)break;await u}let o=new Map;for(let u of a){let l=`${String(r)}:${u}`,d=this.entityCache.get(l);d!==void 0&&(d===null||n||!this.cacheDeleted||!d.is_deleted)&&o.set(u,d)}if(!i){let u=["id",...this.uniqueCacheKeys];if(!u.includes(r))throw new Error("Invalid cache key for entity");let l=a.filter(f=>!o.has(f));if(l.length>0){let m=(async h=>{let g=r==="id"?await this.find({ids:l}):await this.find({filter:{[r]:{op:"in",value:l}},includeDeleted:n});for(let y of g.data){o.set(y[r],y);for(let _ of h){let A=`${_}:${y[r]}`;this.entityCache.set(A,y)}}})(u),p=m.catch(()=>{});this.findCachedMutexes.set(s,p);try{await m}finally{this.findCachedMutexes.delete(s)}}a.filter(f=>!o.has(f)).forEach(f=>{let m=`${String(r)}:${f}`;n?this.entityCache.set(m,null):this.entityCache.getOrSet(m,null)})}return Array.isArray(t)?a.map(u=>o.get(u)).filter(FA):o.get(a[0])??void 0}async prefillCache(t){if(ot(t==null?void 0:t.map).find(r=>r.result))throw new Error("Internal error: prefilled entities must be of the same type as data client");await this.cachePrefillMutex.acquire();try{let r=gy();if(r>=this.nextCachePrefillTime){let i=await this.find({...t,pagination:{limit:Gge},idOnly:!1,includeTotalCount:!1,countOnly:!1,order:void 0,includeDeleted:(t==null?void 0:t.includeDeleted)??this.cacheDeleted}),n=["id",...this.uniqueCacheKeys];for(let a of i.data)for(let s of n){let o=a[s];if(FA(o)){let u=`${s}:${o}`;this.entityCache.set(u,a)}}this.nextCachePrefillTime=r.plus({seconds:Zge})}}finally{this.cachePrefillMutex.release()}return this.entityCache.count}purgeCache(){this.entityCache.clear()}async insert(t){t=this.strongify(t,this.ctor,!1);let r=await this.post(`/${this.serviceName}/${Array.isArray(t)?"bulk":""}`,t),i=Array.isArray(r)?r:this.strongify(r,this.ctor),n=ot(i);return this.notifications&&this.dispatch(this.notifications.dataInserted,{values:n,batchIndex:0}),i}async update(t,r=!1){t=this.strongify(t,this.ctor,!1);let i=r?"?force=1":"",n=await this.put(`/${this.serviceName}/${Array.isArray(t)?"bulk":t.id}${i}`,t),a=Array.isArray(n)?n:this.strongify(n,this.ctor),s=ot(a);return this.notifications&&this.dispatch(this.notifications.dataUpdated,{values:s,batchIndex:0}),a}async remove(t){let i=Array.isArray(t)?await this.delete(`/${this.serviceName}/bulk`,void 0,{ids:t.map(a=>a.id).join(",").toString()}):await this.delete(`/${this.serviceName}/${t.id}`),n=ot(i);return this.notifications&&this.dispatch(this.notifications.dataDeleted,{values:n,batchIndex:0}),i}async undelete(t){let r=Array.isArray(t)?await this.post(`/${this.serviceName}/bulk/undelete`,t.map(a=>({id:a.id}))):await this.post(`/${this.serviceName}/undelete/${t.id}`,{}),i=Array.isArray(r)?r:this.strongify(r,this.ctor),n=ot(i);return this.notifications&&this.dispatch(this.notifications.dataUndeleted,{values:n,batchIndex:0}),i}async addMappings(t,r,i){return this.executeMappings(i?"add_or_update":"add",t,ot(r))}async updateMappings(t,r){return this.executeMappings("update",t,ot(r))}async removeMappings(t,r){return this.executeMappings("delete",t,ot(r))}async addMapping(t,r,i){return this.addMappings(t,[r],i)}async updateMapping(t,r){return this.updateMappings(t,[r])}async removeMapping(t,r){return this.removeMappings(t,[r])}async executeMappings(t,r,i){let n=R7(r);await this.post(`/${this.serviceName}/mapping/bulk/${n.join(":")}?op=${t}`,i),this.notifications&&this.dispatchMappingEvents(t,r,i)}dispatchMappingEvents(t,r,i){let n=R7(r);if(t!=="update")t==="add"||t==="add_or_update"?this.dispatch(this.notifications.dataMapped,{values:i,mapOp:t,entities:n,batchIndex:0}):this.dispatch(this.notifications.dataUnmapped,{values:i,entities:n,mapOp:t,batchIndex:0});else{let a=i.filter(o=>!T7(o.newIds)),s=i.filter(o=>T7(o.newIds));a.length>0&&this.dispatch(this.notifications.dataMapped,{values:a,mapOp:t,entities:n,batchIndex:0}),s.length>0&&(this.dispatch(this.notifications.dataUnmapped,{values:s.map(o=>({...o,ids:{...o.ids,...o.newIds},mapped:void 0})),entities:n,mapOp:t,batchIndex:0}),this.dispatch(this.notifications.dataMapped,{values:s.map(o=>({...o,ids:{...o.ids,...o.newIds}})),entities:n,mapOp:"add",batchIndex:0}))}}dispatch(t,r){let i=JSON.parse(JSON.stringify(r));setTimeout(()=>{t.next({...i,origin:"local",byTokenId:"LOCAL",byUserId:0,entity:this.ctor.entityName})},1)}},vi=class extends MR{constructor(t,r,i,n){super(t,r,i,n)}async findOne(t){return super.findOne(t)}async find(t,r){return super.find(t,r)}async findIds(t){return super.findIds(t)}async count(t,r){return super.count(t,r)}async findCached(t,r,i,n){return typeof t=="boolean"&&(n=t,t=void 0),super.findCached(t,r,i,n)}async prefillCache(t){return super.prefillCache(t)}async insert(t){return super.insert(t)}async update(t,r=!1){return super.update(t,r)}async remove(t){return super.remove(t)}async undelete(t){return super.undelete(t)}async addMappings(t,r,i){return super.addMappings(t,r,i)}async removeMappings(t,r){return super.removeMappings(t,r)}async updateMappings(t,r){return super.updateMappings(t,r)}async addMapping(t,r,i){return super.addMapping(t,r,i)}async updateMapping(t,r){return super.updateMapping(t,r)}async removeMapping(t,r){return super.removeMapping(t,r)}};function lCt(e){return e||{}}var dw=class extends vi{constructor(t){super("project",bc,t)}};var tve=fe(Ct());var pw=fe(Ct());var fw=1e15,Yge=1e8;function Jp(e){class t extends e{sort_index=0}return E([(0,pw.IsInt)(),Oge(fw),sw(-fw),G(`An integer sort index for natural ordering of this entity or mapping value - value must in range (${-fw+1},${fw-1})`)],t.prototype,"sort_index",2),Qu(t)}function mr(e){class t extends e{project_id=0}return E([Oe("project"),Fge(),G("The project id this entity or mapping belongs to")],t.prototype,"project_id",2),Qu(t)}var Kge=3;function yi(e){class t extends e{title=""}return E([(0,pw.IsString)(),nl(Kge),Ce(200),G(`A descriptive title for this entity or mapping (3 to ${Kge} characters)`,{example:"A Descriptive Title"})],t.prototype,"title",2),Qu(t)}function Xge(e){let t=Symbol(e+"Attribute");return[function(r){return function(i,n){(i.constructor[t]??=[]).push({prop:n,data:r})}},function(r){return Jge(r,t).map(i=>i.prop)},function(r,i){var n;return(n=Jge(r,t).find(a=>a.prop===i))==null?void 0:n.data}]}function Jge(e,t){let r=typeof e=="function";if(!e||typeof e!="object"&&!r)return[];let i=r?e:e.constructor;return(i==null?void 0:i[t])??[]}var xy=(g=>(g.Code="code",g.Grid="t",g.GridRow="tr",g.GridCell="td",g.Heading="h1",g.Image="img",g.Link="a",g.ListItem="li",g.ListOrdered="ol",g.ListUnordered="ul",g.Paragraph="p",g.QuickCopy="cp",g.Table="table",g.TableRow="row",g.TableCell="cell",g))(xy||{}),me=xy,Qge={[me.Paragraph]:{childTypes:[me.Link,me.QuickCopy,me.Image],disallowedAncestors:[],canBeRoot:!0,canHaveText:!0},[me.Heading]:{childTypes:[me.Link,me.QuickCopy],disallowedAncestors:["h1"],canBeRoot:!0,canHaveText:!0},[me.QuickCopy]:{childTypes:[],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0},[me.Code]:{childTypes:[],disallowedAncestors:[],canBeRoot:!0,canHaveText:!0},[me.Link]:{childTypes:[],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0},[me.Image]:{childTypes:[],disallowedAncestors:["li"],canBeRoot:!1,canHaveText:!1},[me.Grid]:{childTypes:[me.GridRow],disallowedAncestors:[],canBeRoot:!0,canHaveText:!1},[me.GridRow]:{childTypes:[me.GridCell],disallowedAncestors:[],canBeRoot:!1,canHaveText:!1},[me.GridCell]:{childTypes:[me.Paragraph,me.ListUnordered,me.ListOrdered,me.Heading,me.Code],disallowedAncestors:[],canBeRoot:!1,canHaveText:!1},[me.ListUnordered]:{childTypes:[me.ListItem],disallowedAncestors:["ul","ol","table"],canBeRoot:!0,canHaveText:!1},[me.ListOrdered]:{childTypes:[me.ListItem],disallowedAncestors:["ul","ol","table"],canBeRoot:!0,canHaveText:!1},[me.ListItem]:{childTypes:[me.QuickCopy,me.Link],disallowedAncestors:[],canBeRoot:!1,canHaveText:!0},[me.Table]:{childTypes:[me.TableRow],disallowedAncestors:[me.Table,me.ListOrdered,me.ListUnordered,me.Heading],canBeRoot:!0,canHaveText:!1},[me.TableRow]:{childTypes:[me.TableCell],disallowedAncestors:[me.ListOrdered,me.ListUnordered,me.Heading],canBeRoot:!1,canHaveText:!1},[me.TableCell]:{childTypes:[me.Paragraph,me.ListUnordered,me.ListOrdered,me.Heading,me.Code],disallowedAncestors:[me.ListOrdered,me.ListUnordered,me.Heading],canBeRoot:!1,canHaveText:!0}};function eve(){return{t:"p",children:[{text:""}]}}var[Ss,tKt]=Xge("DocumentText");function Xp(e,t){return JSON.stringify({v:1,t:"slate",c:e},(r,i)=>r[0]!=="_"?i:void 0,t)}var mw=fe(Ct());var hd=5e3,ur=class extends _t(mr(vc(Xe(It(Jp(yi(nt("testcase_folders","testcase_folder",["tenant"],"TCF")))))))){testcase_folder_parent_id=0;description="";constructor(t){super(),this.initialize(t)}};E([Oe("testcase_folder"),(0,mw.IsInt)(),G("The id of the folder's parent in the tree structure (no cycles allowed)")],ur.prototype,"testcase_folder_parent_id",2),E([(0,mw.IsString)(),Ss(),Ce(hd),Oe("blob",!0),G("An optional description for this test case folder (can be a rich text document)")],ur.prototype,"description",2);var $s=class extends _t(Xe(mr(It(yi(nt("testplans","testplan",["tenant"],"TP")))))){description="";$testrun_count=0;$last_testrun_created=null;$open_testrun_count=0;$query_count=0;constructor(t){super(),this.initialize(t)}};E([(0,tve.IsString)(),Ss(),Ce(hd),Oe("blob",!0),G("An optional description for this test plan (can be a rich text document)")],$s.prototype,"description",2),E([xs(),ld(),G("The number of test runs linked to this test plan - read only")],$s.prototype,"$testrun_count",2),E([xs(),G("The time the last test run was created from this test plan - read only")],$s.prototype,"$last_testrun_created",2),E([xs(),ld(),G("The number of open test runs linked to this test plan - read only")],$s.prototype,"$open_testrun_count",2),E([xs(),ld(),G("The number of tset case queries linked to this test plan - read only")],$s.prototype,"$query_count",2);var hw=class extends vi{constructor(t){super("testplan",$s,t)}};var gd=fe(Sg());var Sy=fe(Ct());var bi=class extends nt("permission_groups","permission_group",["central","tenant"]){name="";description="";is_builtin=!1;constructor(t){super(),this.initialize(t)}};E([(0,Sy.IsString)(),Ce(100)],bi.prototype,"name",2),E([(0,Sy.IsString)(),Ce(1e3)],bi.prototype,"description",2),E([(0,Sy.IsBoolean)(),Ar()],bi.prototype,"is_builtin",2);var $y=fe(Ct());var _i=class extends nt("permission_roles","permission_role",["central","tenant"]){name="";description="";is_builtin=!1;constructor(t){super(),this.initialize(t)}};E([(0,$y.IsString)(),Ce(100)],_i.prototype,"name",2),E([(0,$y.IsString)(),Ce(1e3)],_i.prototype,"description",2),E([(0,$y.IsBoolean)(),Ar()],_i.prototype,"is_builtin",2);var Ay=class extends He{events;constructor(t){super(t),this.events={insert:new gd.Subject,update:new gd.Subject,delete:new gd.Subject,undelete:new gd.Subject,map:new gd.Subject,unmap:new gd.Subject},this.useNotifications(Yp())}useNotifications(t){this.useNotificationsBase(t,this.events,[bi.entityName,_i.entityName])}async getPermissions(t){return(await this.get(`/permission/me?project_id=${t}`)).permissions}async getProjectPermissions(){return await this.get("/permission/me/projects")}async getUsersWithPermissions(t,r){return r=ot(r),(await this.get(`/permission/users?project_id=${t}&permissions=${encodeURIComponent(r.join(","))}`)).users}async getUserPermissions(t,r=0){return(await this.get(`/permission/user/${t}?project_id=${r}`)).permissions}async getGroups(){let t=await this.get("/permission/groups");return this.strongify(t,bi)}async getRoles(){let t=await this.get("/permission/roles");return this.strongify(t,_i)}async getRoleUsers(t){return(await this.get(`/permission/users/role/${t}`)).users}async getGroupUsers(t){return(await this.get(`/permission/users/group/${t}`)).users}async getUserRoles(t,r){let i=await this.get(`/permission/roles/user/${t}?project_id=${r}`);return this.strongify(i,_i)}async getAllUserRoles(){return await this.get("/permission/users/roles")}async getUserGroups(t){let r=await this.get(`/permission/groups/user/${t}`);return this.strongify(r,bi)}async getRoleGroups(t){let r=await this.get(`/permission/groups/role/${t}`);return this.strongify(r,bi)}async getGroupRoles(t,r){let i=await this.get(`/permission/roles/group/${t}?project_id=${r}`);return this.strongify(i,_i)}async getAllPermissions(){return(await this.get("/permission/all")).permissions}async getRolePermissions(t,r=0){return(await this.get(`/permission/role/${t}?project_id=${r}`)).permissions}async getGroupPermissions(t,r=0){return(await this.get(`/permission/group/${t}?project_id=${r}`)).permissions}async addRole(t){let r=await this.post("/permission/role",t);return this.strongify(r,_i)}async addGroup(t){let r=await this.post("/permission/group",t);return this.strongify(r,bi)}async addUserRole(t,r,i){await this.post(`/permission/role/${t}/user/${r}?project_id=${i}`,{})}async setUserRolesForProject(t,r,i){await this.post("/permission/user-roles",{subjectId:t,roleIds:r,projectId:i})}async setGroupRolesForProject(t,r,i){await this.post("/permission/group-roles",{subjectId:t,roleIds:r,projectId:i})}async addUserToGroup(t,r){await this.post(`/permission/group/${t}/user/${r}`,{})}async addGroupRole(t,r,i){await this.post(`/permission/role/${t}/group/${r}?project_id=${i}`,{})}async addRolePermission(t,r,i=0){await this.post(`/permission/role/${t}/permission/${r}?project_id=${i}`,{})}async updateRole(t){let r=await this.put("/permission/role",t);return this.strongify(r,_i)}async updateGroup(t){let r=await this.put("/permission/group",t);return this.strongify(r,bi)}async removeUserRole(t,r,i){await this.delete(`/permission/role/${t}/user/${r}?project_id=${i}`)}async removeUserFromGroup(t,r){await this.delete(`/permission/group/${t}/user/${r}`)}async removeRole(t){await this.delete(`/permission/role/${t}`)}async removeGroup(t){await this.delete(`/permission/group/${t}`)}async removeGroupRole(t,r,i){await this.delete(`/permission/role/${t}/group/${r}?project_id=${i}`)}async removeRolePermission(t,r,i=0){await this.delete(`/permission/role/${t}/permission/${r}?project_id=${i}`)}};var DR=(h=>(h.UNSET="",h.CAN_READ="CAN_READ",h.CAN_MANAGE_TENANT="CAN_MANAGE_TENANT",h.CAN_MANAGE_USERS="CAN_MANAGE_USERS",h.CAN_MANAGE_PROJECTS="CAN_MANAGE_PROJECTS",h.CAN_CREATE_TESTCASES="CAN_CREATE_TESTCASES",h.CAN_DELETE_TESTCASES="CAN_DELETE_TESTCASES",h.CAN_RUN_TESTCASES="CAN_RUN_TESTCASES",h.CAN_COMMENT="CAN_COMMENT",h.CAN_CREATE_TESTPLANS="CAN_CREATE_TESTPLANS",h.CAN_DELETE_TESTPLANS="CAN_DELETE_TESTPLANS",h.CAN_MANAGE_AGENTS="CAN_MANAGE_AGENTS",h.CAN_ACT_AS_AGENT="CAN_ACT_AS_AGENT",h.CAN_MANAGE_BILLING="CAN_MANAGE_BILLING",h))(DR||{}),HKt=RR(Ep(DR)).filter(e=>e!==""),WKt=RR(["CAN_READ"]),GKt=RR(["CAN_COMMENT","CAN_READ"]);function RR(e){return qA(e).sort()}var FR=5e3;var rve=["auto","off","rows","row_blocks","newlines","numbered","numbered_bracket","asterisk","duplicate"],wy=["title","steps","folder","folder_description","expected_result","precondition"],ive=[["title","name"],["steps","test steps","test_steps"],["folder","parent_folder_name","parent_folder","section hierarchy"],["folder_description","folder_desc"],["expected_result","expected_results","expected results","expected result"],["precondition","preconditions"],["key","id"]];var nve=["title"];var ave=["title","result"];var sve=fe(LR());var gw=class{async prepareImport(t,r){var s;let i=(0,sve.parse)(await r.fileReader(t.csvFile,t.encoding??"utf8"),{header:!0,skipEmptyLines:!0});r.log(`CSV import: ${r.hl(i.data.length.toString())} rows`);let n=[];for(let o of i.errors){let u=((s=o.row)==null?void 0:s.toString())??"unknown";r.log(`CSV parse error: ${r.hlError(o.message)} at row ${r.hl(u)}`),n.push(`${o.type} in line ${u}: ${o.message}`)}let a=i.data;return a.length===0&&r.log(r.hlSuccess("No rows found to be imported")),{rows:a.map((o,u)=>({idx:u,values:ye(o)})),fields:i.meta.fields??[],errors:n.length>0?n:void 0}}};var qve=fe(JR());var vw=class{async prepareImport(t,r){try{let d=function(f,m){var h,g,y,_,A,w,R,V,ae,B;let p=f;if(p.name&&p.cases)for(let J of p.cases.case){let ue=yTt(J.custom),be={idx:o++,values:ye({...ue.values,title:J.title,folder:m.map(x=>x.title),folder_description:m.map(x=>x.description??""),precondition:[((h=J.custom)==null?void 0:h.preconds)??""],steps:((y=(g=J.custom)==null?void 0:g.steps_separated)==null?void 0:y.step.map(x=>{var I;return((I=x.content)==null?void 0:I.trim())??""}))??((A=(_=J.custom)==null?void 0:_.steps)==null?void 0:A.trim())??"",expected_result:((R=(w=J.custom)==null?void 0:w.steps_separated)==null?void 0:R.step.map(x=>{var I;return((I=x.expected)==null?void 0:I.trim())??""}))??((ae=(V=J.custom)==null?void 0:V.expected)==null?void 0:ae.trim())??""})};ue.fields.forEach(x=>u.add(x));let _e=x=>{var U;let I=(U=J[x])==null?void 0:U.toString().trim();I!==void 0&&(be.values[x]=I,u.add(x))};_e("priority"),_e("estimate"),_e("references");let S=(B=J.type)==null?void 0:B.toLocaleUpperCase();S!==void 0&&(be.values.testcase_type=S,u.add("testcase_type")),l.push(be)}if(!(!f.sections||!f.sections.section))for(let J of f.sections.section)d(J,[...m,{title:J.name,description:J.description}])};var i=d;let n=new qve.XMLParser({ignoreAttributes:!1,trimValues:!1,attributeNamePrefix:"_",textNodeName:"TEXT",parseAttributeValue:!1,parseTagValue:!1,isArray:f=>f==="section"||f==="case"||f==="step"}),a=await r.fileReader(t.xmlFile,"utf8"),{suite:s}=n.parse(a);if(!s||!s.sections||!s.id)return r.log(r.hlError("XML file is not a Testrail XML export file - nothing imported")),{rows:[],errors:["XML file is not a Testrail XML export file"],fields:[]};let o=0,u=new Set(["title","folder","precondition","steps","expected_result"]),l=[];return d(s,[]),r.log(`Testrail XML import: ${r.hl(l.length.toString())} rows`),l.length===0&&r.log(r.hlError("Testrail XML file contains no testcases - nothing imported")),{rows:l,fields:Array.from(u)}}catch(n){throw new Error(`XML parsing error: ${n.message}`)}}};function yTt(e){if(!e)return{values:{},fields:[]};let t=[],r=ye();for(let i of Object.keys(e)){let n=e[i];n.id!==void 0&&n.value!==void 0&&(r[i]=n.value.trim(),t.push(i))}return{values:r,fields:t}}var jve=fe(LR());var yw=class{async prepareImport(t,r){var s;let i=(0,jve.parse)(await r.fileReader(t.csvFile,t.encoding??"utf8"),{header:!0,skipEmptyLines:!0}),n=[];for(let o of i.errors){let u=((s=o.row)==null?void 0:s.toString())??"unknown";r.log(`CSV parse error: ${r.hlError(o.message)} at row ${r.hl(u)}`),n.push(`${o.type} in line ${u}: ${o.message}`)}r.log(`CSV import: ${r.hl(i.data.length.toString())} rows`);let a=i.data;return a.length===0&&r.log(r.hlSuccess("No results found to be imported")),{rows:a.map((o,u)=>({idx:u,values:ye(o)})),fields:i.meta.fields??[],errors:n.length>0?n:void 0}}};var Bve=fe(JR());var bw=class{async prepareImport(t,r){try{let i=new Bve.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"_",textNodeName:"TEXT",parseAttributeValue:!1,parseTagValue:!1}),n=await r.fileReader(t.xmlFile,"utf8"),a=i.parse(n);if(!a||!a.testsuite&&!a.testsuites)return r.log(r.hlError("XML file is not a JUnit file - nothing imported")),{rows:[],fields:[],errors:["XML file is not a JUnit file"]};let s=0,o=[],u=a.testsuites?ot(a.testsuites.testsuite):a.testsuite?ot(a.testsuite):[];for(let l of u){let d=ot(l==null?void 0:l.testcase).map(f=>{let m=!f._classname||f._name===f._classname||f._classname.includes(l._name)?f._name:`${f._classname} - ${f._name}`;return m.startsWith(l._name)&&m.length>l._name.length+2&&(m=m.substring(l._name.length).trim()),{idx:s++,values:ye({title:m,folder:l._name??"",result:f.error||f.failure?"failed":"passed",comment:Lve(f.error)||Lve(f.failure)})}});o.push(...d)}return r.log(`JUnit XML import: ${r.hl(o.length.toString())} rows`),o.length===0?(r.log(r.hlError("JUnit file contains no testcases - nothing imported")),{rows:[],fields:[]}):{rows:o,fields:["title","folder","result","comment"]}}catch(i){throw new Error(`XML parsing error: ${i.message}`)}}};function Lve(e){return e?typeof e=="string"?e:`${e._message?e._message+`
|
|
229
229
|
`:""}${e.TEXT}`:""}var Vve=require("fs/promises");var _w=class{async prepareImport(t,r){try{let l=function(m,p){let h=m.title??"",g=m.file??"",y=m.suites??[],_=m.specs??[],A=h&&h!==g?[...p,h]:p;y.forEach(w=>l(w,A)),_.forEach(w=>d(w,A))},d=function(m,p){m.tests.forEach(h=>f(h,p,m.title??""))},f=function(m,p,h){let g=m.projectName??"",y=m.results??[];if(y.length>0){let _=y.at(-1),A={idx:o++,values:ye({title:`${h} [${g}]`,folder:p,result:m.status!=="expected"?"failed":"passed",comment:m.status!=="expected"?_Tt(_):""})};u.push(A)}};var i=l,n=d,a=f;let s=JSON.parse(await(0,Vve.readFile)(t.jsonFile,"utf-8"));(!s||!s.suites)&&r.log(r.hlError("Playwright JSON file is invalid - missing suites key"));let o=0,u=[];return l(s,[]),r.log(`Playwright JSON import: ${r.hl(u.length.toString())} rows`),u.length===0?(r.log(r.hlError("Playwright file contains no testcases - nothing imported")),{rows:[],fields:[],errors:["Playwright file contains no testcases"]}):{rows:u,fields:["title","folder","result","comment"]}}catch(s){throw new Error(`Playwright JSON parsing error: ${s.message}`)}}},bTt=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","gm");function _Tt(e){return`${e.status} `+e.errors.map(t=>t.message.slice(0,1e4).replace(bTt,"")).join(`
|
|
230
|
-
`)}var Zve=fe(zve());var ATt=["count","count_distinct","sum","min","max","avg","maxGroup","minGroup"],XR=di("DurationSpec").numberOpt("years").numberOpt("months").numberOpt("days").numberOpt("hours").numberOpt("minutes").numberOpt("seconds"),EYt=di("DataAnalysisParams").record("tables",Jt,e=>e.arrayOrOne(t=>t.string(Tp),{minLen:1})).recordOpt("columns",Jt,e=>e.arrayOrOne(t=>t.string(Jt))).record("aggr",Jt,e=>e.record(Jt,t=>t.arrayOrOne(r=>r.string({values:ATt}),{minLen:1}))).stringOpt("groupAggrOn",Jt).recordOpt("group",Jt,e=>e.arrayOrOne(t=>t.string(Jt))).recordOpt("order",Jt,e=>e.arrayOrOne(t=>t.string(r=>Jt(r[0]==="-"?r.substring(1):r)))).recordOpt("alias",Jt,e=>e.string(Jt)).arrayOpt("optionalTables",e=>e.string(Tp)).optIs("filter",Xu).objectOpt("time",e=>e.oneOf("from",t=>t.string(j1),t=>t.is(XR)).oneOf("to",t=>t.string(j1),t=>t.is(XR),t=>t.string({value:"now"})).oneOf("steps",t=>t.integer({nonNegative:!0}),t=>t.is(XR))).stringOpt("asOf",j1).integerOpt("projectId",{nonNegative:!0}).boolOpt("withComputed").boolOpt("includeDeleted");function Hve(e){let t=ne.fromISO(SR());if(typeof e!="string"){let r=xe.fromObject(e);return r.toMillis()>0?t.minus(r):t.plus(r)}else return e==="now"?t:ne.fromISO(e,{zone:"utc"})}var xw=class extends Map{getOrSet(t,r){let i=this.get(t);return i===void 0&&(i=typeof r=="function"?r():r,this.set(t,i)),i}upsert(t,r,i){let n=this.get(t);return n===void 0&&(n=typeof i=="function"?i():i),r(n),n!==void 0&&this.set(t,n),n}keyList(){return Array.from(this.keys())}valueList(){return Array.from(this.values())}};var Kve=15*60,wTt=15*60;var Wve=!1,Gve=new fd(100,Kve),$w=new fd(100,wTt),Cy=new xw,As=class extends He{constructor(t){super(t),ITt()}async analyze(t,r){ETt(t),r=As.inferCacheOpts(r,t);let i=As.queryCache(t,r);return i?(i.cached=!0,i):(i=await this.post("/analyze",t),As.updateCache(t,i,r),i)}static queryCache(t,r){if(r.mode===3){let i=Sw(t);return Gve.get(i)}else if(r.mode===2){let i=Sw(t);return $w.get(i)}}static updateCache(t,r,i){var n,a;if(i.mode===3){let s=Sw(t);Gve.set(s,r)}else if(i.mode===2){if((((n=i.watchedEntities)==null?void 0:n.length)??0)<=0)throw new Error("Validation mode requires watchedEntities");let s=Sw(t);$w.set(s,r),(a=i.watchedEntities)==null||a.forEach(o=>{Cy.getOrSet(o,()=>new Set).add(s)})}}static inferCacheOpts(t,r){return t??={mode:1,watchedEntities:[]},t.mode===4&&(t.mode=!r.time||Hve(r.time.to)>ne.now().minus(xe.fromObject({seconds:Kve}))?2:3),t}};function ITt(){if(!Wve){let i=function(a){let s=Cy.get(a.entity);s==null||s.forEach(o=>$w.del(o)),Cy.delete(a.entity)},n=function(a){for(let s of a.entities){let o=Cy.get(s);o==null||o.forEach(u=>$w.del(u)),Cy.delete(s)}};var e=i,t=n;let r=Yp();r.dataInserted.subscribe(i),r.dataUpdated.subscribe(i),r.dataDeleted.subscribe(i),r.dataUndeleted.subscribe(i),r.dataMapped.subscribe(n),r.dataUnmapped.subscribe(n),Wve=!0}}function Sw(e){return(0,Zve.default)(JSON.stringify(e))}function ETt(e){for(let t of Object.keys(e.tables)){let r=e.tables[t];if(typeof r!="function")continue;let i=r.tableName;e.tables[t]=i??r.ctors.map(n=>n.tableName)}}var ww=class extends He{async execute(t){return await this.post("/data-batch",t)}build(){return new QR(this)}},QR=class{constructor(t){this.client=t;this.p={steps:[]}}p;get isEmpty(){return this.p.steps.length===0}async execute(){if(this.isEmpty)return{};let t=ye(),r=this.p.steps.filter(n=>{if(n.op==="analyze"){let a=As.inferCacheOpts(n.opts,n.params),s=As.queryCache(n.params,a);if(s)return s.cached=!0,t[n.as]=s,!1}return!0}),i=r.length>0?await this.client.execute({...this.p,steps:r}):ye();for(let n of r)if(n.op==="analyze"){let a=As.inferCacheOpts(n.opts,n.params);i[n.as]&&As.updateCache(n.params,i[n.as],a)}return{...t,...i}}if(t,r){return t?r(this):this}read(t,r){return this.p.steps.push({op:"read",as:"",entity:t,readParams:r,result:!1}),this}analyze(t,r){return this.p.steps.push({op:"analyze",as:"",params:t,opts:r}),this}insert(t,r){let{entity:i,_inputData:n}=Aw(r,t);return this.p.steps.push({op:"insert",entity:i,inputData:n,result:!1}),this}update(t,r){let{entity:i,_inputData:n}=Aw(r,t);return this.p.steps.push({op:"update",entity:i,inputData:n,result:!1}),this}delete(t,r){let{entity:i,_inputData:n}=Aw(r,t,"idsOnly");return this.p.steps.push({op:"delete",entity:i,inputData:n}),this}undelete(t,r){let{entity:i,_inputData:n}=Aw(r,t,"idsOnly");return this.p.steps.push({op:"undelete",entity:i,inputData:n,result:!1}),this}mapAdd(t,r){let i=Array.isArray(t)?t:t.ctors;return this.p.steps.push({op:"map",mapOp:"add",sourceEntity:i[0],entities:i,mappings:r}),this}mapUpdate(t,r){let i=Array.isArray(t)?t:t.ctors;return this.p.steps.push({op:"map",mapOp:"update",sourceEntity:i[0],entities:i,mappings:r}),this}mapAddOrUpdate(t,r){let i=Array.isArray(t)?t:t.ctors;return this.p.steps.push({op:"map",mapOp:"add_or_update",sourceEntity:i[0],entities:i,mappings:r}),this}mapDelete(t,r){var n;let i=Array.isArray(t)?t:t.ctors;return this.p.steps.push({op:"map",mapOp:"delete",sourceEntity:i[0],entities:i,mappings:(n=r[0])!=null&&n.ids?r:r.map(a=>({ids:a}))}),this}asResult(t){let r=this.current;return r&&(r.op==="read"||r.op==="insert"||r.op==="update"||r.op==="undelete"||r.op==="map"||r.op==="analyze")&&(r.as=t,r.result=!0),this}as(t){let r=this.current;return r&&(r.op==="read"||r.op==="insert"||r.op==="update"||r.op==="undelete")&&(r.as=t,r.result=!1),this}fromSource(t,r){let i=this.current;if(i&&typeof t=="string"&&(i.op==="delete"||i.op==="update"||i.op==="undelete"))i.from=t,i.inputData=void 0;else if(i&&r&&i.op==="map"){let n=i.entities.findIndex(a=>(typeof a=="string"?a:a.entityName)===r.entityName);n>=0&&(i.from??=[],i.from[n]=t)}return this}get current(){return this.p.steps[this.p.steps.length-1]}};function Aw(e,t,r){var i;if(Array.isArray(t)){let n=(i=t==null?void 0:t[0])==null?void 0:i.constructor;if(!n)throw new Error("Internal error: Cannot autoresolve entity ctor");return{entity:n,_inputData:r?Yve(t):t}}else{if(t)return{entity:t,_inputData:r?Yve(e):e};throw new Error("Invalid arguments")}}function Yve(e){return e?e.map(t=>({id:t.id})):void 0}var Vt=fe(Ct());var Jve=5e3,eF=3e4,CTt=2*eF,Iw=(r=>(r.Text="TEXT",r.Steps="STEPS",r))(Iw||{}),iJt=Ep(Iw),Te=class extends _t(mr(vc(Xe(It(Jp(yi(nt("testcases","testcase",["tenant"],"TC",{allowCustomFields:!0})))))))){owner_user_id=0;$owner_name="";type="";description="";template="STEPS";precondition_text=void 0;content_text=void 0;steps_text=void 0;expected_result_text=void 0;priority=void 0;status=void 0;testcase_type=void 0;automation=void 0;estimate=void 0;constructor(t){super(),this.initialize(t)}};E([Oe("user"),(0,Vt.IsInt)(),G("The global user id of the test case owner")],Te.prototype,"owner_user_id",2),E([xs(),G("The resolved display name of the owner user - read only")],Te.prototype,"$owner_name",2),E([(0,Vt.IsString)(),Ce(30),(0,Vt.IsOptional)(),G("Reserved for future use")],Te.prototype,"type",2),E([(0,Vt.IsString)(),Ce(Jve),(0,Vt.IsOptional)(),od(),G("Reserved for future use")],Te.prototype,"description",2),E([(0,Vt.IsString)(),(0,Vt.IsEnum)(Iw),G("The template type used for the test case: STEPS or TEXT")],Te.prototype,"template",2),E([(0,Vt.IsString)(),Ss(),(0,Vt.IsOptional)(),Ce(Jve),Oe("blob",!0),G("A description of the precondition required for the test case (can be a rich text document)",{example:""})],Te.prototype,"precondition_text",2),E([(0,Vt.IsString)(),Ss(),(0,Vt.IsOptional)(),Ce(CTt),Oe("blob",!0),G("The test case content - used with template STEPS (can be a rich text document)",{example:""})],Te.prototype,"content_text",2),E([(0,Vt.IsString)(),Ss(),(0,Vt.IsOptional)(),Ce(eF),Oe("blob",!0),G("The test case content - used with template TEXT (can be a rich text document)",{example:""})],Te.prototype,"steps_text",2),E([(0,Vt.IsString)(),Ss(),(0,Vt.IsOptional)(),Ce(eF),Oe("blob",!0),G("The test case expected result - used with template TEXT (can be a rich text document)",{example:""})],Te.prototype,"expected_result_text",2),E([G("The test case priority (This is a builtin-custom field)",{example:1})],Te.prototype,"priority",2),E([G("The test case status (This is a builtin-custom field)",{example:""})],Te.prototype,"status",2),E([G("The test case type (This is a builtin-custom field)",{example:""})],Te.prototype,"testcase_type",2),E([G("The test case automation status (This is a builtin-custom field)",{example:""})],Te.prototype,"automation",2),E([G("A test case time estimate (This is a builtin-custom field)",{example:100})],Te.prototype,"estimate",2);var Ew=class extends vi{constructor(t){super("testcase",Te,t)}};var Cw=class extends vi{constructor(t){super("testcase-folder",ur,t)}};var xi=fe(Ct());var wr=class extends _t(mr(vc(Xe(It(yi(nt("testruns","testrun",["tenant"],"TR",{allowCustomFields:!0}))))))){testplan_id=void 0;closed_at=void 0;is_closed=!1;description=void 0;constructor(t){super(),this.initialize(t)}};E([Oe("testplan"),(0,xi.IsInt)(),(0,xi.IsOptional)(),G("The optional id of the test plan this test run is associated with",{example:0})],wr.prototype,"testplan_id",2),E([(0,xi.IsOptional)(),(0,xi.IsISO8601)(),G("The time this run was closed - all referenced test case data uses this as a historic timestamp",{example:sd})],wr.prototype,"closed_at",2),E([Ar(),(0,xi.IsBoolean)(),G("Whether the test run is closed or not - closed runs can not be modified until reopened")],wr.prototype,"is_closed",2),E([(0,xi.IsString)(),Ss(),Ce(hd),Oe("blob",!0),(0,xi.IsOptional)(),G("An optional description for this test run (can be a rich text document)",{example:""})],wr.prototype,"description",2);var Tw=class extends vi{constructor(t){super("testrun",wr,t)}};var xt=fe(Ct());var tF=class{map=new Map;get size(){return this.map.size}get(t){return this.map.get(t)}has(t){return this.map.has(t)}set(t,r){this.map.set(t,Array.isArray(r)?r:[r])}delete(t){return this.map.delete(t)}add(t,r){let i=this.map.get(t);i||this.map.set(t,i=[]),i.push(r)}addAll(t,r){let i=this.map.get(t);i||this.map.set(t,i=[]),i.push(...r)}remove(t,r){let i=this.get(t);if(i===void 0)return!1;let n=typeof r=="function",a=r,s=!1;for(let o=i.length-1;o>=0;o--){let u=i[o];(n&&a(u)||!n&&u===r)&&(i.splice(o,1),s=!0)}return i.length===0&&this.delete(t),s}[Symbol.iterator](){return this.map[Symbol.iterator]()}keys(){return Array.from(this.map.keys())}entries(){return Array.from(this.map.entries())}forEach(t){this.map.forEach(t)}clear(){this.map.clear()}};var KJt=RA()?150:50,YJt=RA()?60:20,kw=200;var Xve=100,kTt=1e4,Ow="cf__",OTt=new RegExp(`^(?!${Ow})`);var Pw={string:{type:"string",isMultiValued:!1,validator:t1e,convFromString:e=>e},multi_string:{type:"multi_string",isMultiValued:!0,validator:e=>e1e(e,Xve),convFromDb:$R,convToDb:AR,convFromString:e=>Qve(e)},text:{type:"text",isMultiValued:!1,validator:e=>typeof e=="string"&&e.length<=kTt,convFromString:e=>e},boolean:{type:"boolean",isMultiValued:!1,validator:e=>typeof e=="boolean",convFromDb:Age,convFromString:e=>e==="true"||e==="True"||e==="1"},integer:{type:"integer",isMultiValued:!1,validator:e=>(0,xt.isInt)(e),convFromString:e=>kR(CR(e))},number:{type:"number",isMultiValued:!1,validator:e=>(0,xt.isNumber)(e,{allowNaN:!1}),convFromString:e=>kR(TR(e))},date:{type:"date",isMultiValued:!1,validator:e=>(0,xt.isISO8601)(e),convToDb:(e,t)=>e[t]!==void 0?e[t]=new Date(e[t]).toISOString():void 0,convFromString:e=>bge(_ge(e))},duration:{type:"duration",isMultiValued:!1,validator:e=>(0,xt.isNumber)(e,{allowNaN:!1}),convFromString:e=>PTt(e)},tag:{type:"tag",isMultiValued:!0,validator:e=>e1e(e,Xve),convFromDb:$R,convToDb:AR,convFromString:e=>Qve(e)},user_id:{type:"user_id",isMultiValued:!1,validator:e=>(0,xt.isInt)(e)&&e!==0,convFromString:e=>CR(e)},url:{type:"url",isMultiValued:!1,validator:e=>typeof e=="string"&&(0,xt.isURL)(e),convFromString:e=>e}};function Qve(e){let t=e.split(";");return t=t.length<=1?e.split(","):t,t.map(r=>r.trim()).filter(r=>r)}function PTt(e,t="seconds"){e=e.trim();let r=TR(e);return isNaN(r)?xge(e):r<0?NaN:t==="seconds"?r:r*60}function t1e(e){return typeof e=="string"&&e.length<=kw}function e1e(e,t){return Array.isArray(e)&&e.every(t1e)&&e.length<=t}var ws=class extends Jp(Xe(nt("custom_fields","custom_field",["tenant"],"CF"))){table="";name="";display_name=void 0;type="string";is_builtin=!1;options={projectIds:[],required:!1,visible:!1,includeByDefault:!1,allowCustomValues:!1,description:""};constructor(t){super(),this.initialize(t)}};E([(0,xt.IsString)(),Ce(40)],ws.prototype,"table",2),E([Pge(OTt),(0,xt.IsLowercase)(),nl(3),Ce(28),(0,xt.IsString)(),Dge(),Rge()],ws.prototype,"name",2),E([(0,xt.IsString)(),(0,xt.IsOptional)(),Ce(40)],ws.prototype,"display_name",2),E([(0,xt.IsString)()],ws.prototype,"type",2),E([(0,xt.IsBoolean)(),Ar()],ws.prototype,"is_builtin",2),E([ud()],ws.prototype,"options",2);function r1e(e){return e.startsWith(Ow)?e.substring(Ow.length):e}function yd(e){return e.is_builtin?e.name:Ow+e.name}function NTt(e,t,r){var a;let i=Array.isArray(e);return(r!==void 0?r:i)?i&&P7(e,(t.fixedValues??[]).map(s=>s.value)):!!((a=t.fixedValues)!=null&&a.find(s=>s.value===e))}var MTt=e=>{var t;return((t=Pw[e.type])==null?void 0:t.validator)??(()=>!0)},DTt=(e,t,r,i=!1,n=!1,a=MTt)=>{let s=e.type;if(!(s?Pw[s]:void 0))return[];if(i){if(r==null)return[t?t(`settings.custom_field_mgmt.types.${s}_invalid`,{ns:"common"}):`Invalid value for required field of type '${s}'`];if(Array.isArray(r)){if(!(0,xt.arrayNotEmpty)(r))return[t?t("arrayNotEmpty",{ns:"validation"}):"Must have at least one entry"]}else if(!IR(`${r}`,1))return[t?t("minLengthTrimmed",{constraint1:1,ns:"validation"}):"Must have at least length 1"]}else if(r===void 0)return[];return n&&!r?[]:!e.options.allowCustomValues&&e.options.fixedValues&&!NTt(r,e.options)?[t?t("settings.custom_field_mgmt.error_not_fixed_value",{ns:"common"}):"Value must be one of the allowed values"]:r!==null&&a(e)(r)?[]:s==="string"&&`${r}`.length>kw?[t?t("maxLength",{constraint1:kw,valueLength:`${r}`.length,ns:"validation"}):`Value is longer than ${kw} characters`]:[t?t(`settings.custom_field_mgmt.types.${s}_invalid`,{ns:"common"}):`Invalid value for field of type '${s}'`]};function i1e(e,t,r,i,n){let a=e.filter(o=>o.table===r),s=[];for(let o of a){let u=yd(o),l=i&&i[u],d=DTt(o,t,l,!n&&o.options.required,!0);d.length>0&&s.push({field:o,property:u,propertyValue:l,message:d.join(". ")})}return s}var Nw=class extends He{constructor(t){super(t)}async getCustomFieldsMetadata(){return await this.get("/custom-field/all")}async createCustomField(t){let r=await this.post("/custom-field",t);return this.strongify(r,ws)}async updateCustomField(t){let r=await this.put("/custom-field",ot(t)),i=this.strongify(r,ws);return Array.isArray(t)?i:i[0]}async purgeCustomFieldAndData(t){await this.delete(`/custom-field/purge/${t.id}`)}};var pF=fe(Ct());var Qr=fe(c1e());function v1e(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var xd=v1e();function zTt(e){xd=e}var y1e=/[&<>"']/,HTt=new RegExp(y1e.source,"g"),b1e=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,WTt=new RegExp(b1e.source,"g"),GTt={"&":"&","<":"<",">":">",'"':""","'":"'"},d1e=e=>GTt[e];function hr(e,t){if(t){if(y1e.test(e))return e.replace(HTt,d1e)}else if(b1e.test(e))return e.replace(WTt,d1e);return e}var ZTt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _1e(e){return e.replace(ZTt,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}var KTt=/(^|[^\[])\^/g;function Qe(e,t){e=typeof e=="string"?e:e.source,t=t||"";let r={replace:(i,n)=>(n=n.source||n,n=n.replace(KTt,"$1"),e=e.replace(i,n),r),getRegex:()=>new RegExp(e,t)};return r}var YTt=/[^\w:]/g,JTt=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f1e(e,t,r){if(e){let i;try{i=decodeURIComponent(_1e(r)).replace(YTt,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!JTt.test(r)&&(r=tkt(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}var Dw={},XTt=/^[^:]+:\/*[^/]*$/,QTt=/^([^:]+:)[\s\S]*$/,ekt=/^([^:]+:\/*[^/]*)[\s\S]*$/;function tkt(e,t){Dw[" "+e]||(XTt.test(e)?Dw[" "+e]=e+"/":Dw[" "+e]=Rw(e,"/",!0)),e=Dw[" "+e];let r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(QTt,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(ekt,"$1")+t:e+t}var Fw={exec:function(){}};function p1e(e,t){let r=e.replace(/\|/g,(a,s,o)=>{let u=!1,l=s;for(;--l>=0&&o[l]==="\\";)u=!u;return u?"|":" |"}),i=r.split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function Rw(e,t,r){let i=e.length;if(i===0)return"";let n=0;for(;n<i;){let a=e.charAt(i-n-1);if(a===t&&!r)n++;else if(a!==t&&r)n++;else break}return e.slice(0,i-n)}function rkt(e,t){if(e.indexOf(t[1])===-1)return-1;let r=e.length,i=0,n=0;for(;n<r;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&(i--,i<0))return n;return-1}function ikt(e,t){!e||e.silent||(t&&console.warn("marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async"),(e.sanitize||e.sanitizer)&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options"),(e.highlight||e.langPrefix!=="language-")&&console.warn("marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight."),e.mangle&&console.warn("marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`."),e.baseUrl&&console.warn("marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url."),e.smartypants&&console.warn("marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants."),e.xhtml&&console.warn("marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml."),(e.headerIds||e.headerPrefix)&&console.warn("marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`."))}function m1e(e,t){if(t<1)return"";let r="";for(;t>1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function h1e(e,t,r,i){let n=t.href,a=t.title?hr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;let o={type:"link",raw:r,href:n,title:a,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,o}return{type:"image",raw:r,href:n,title:a,text:hr(s)}}function nkt(e,t){let r=e.match(/^(\s+)(?:```)/);if(r===null)return t;let i=r[1];return t.split(`
|
|
230
|
+
`)}var Zve=fe(zve());var ATt=["count","count_distinct","sum","min","max","avg","maxGroup","minGroup"],XR=di("DurationSpec").numberOpt("years").numberOpt("months").numberOpt("days").numberOpt("hours").numberOpt("minutes").numberOpt("seconds"),EYt=di("DataAnalysisParams").record("tables",Jt,e=>e.arrayOrOne(t=>t.string(Tp),{minLen:1})).recordOpt("columns",Jt,e=>e.arrayOrOne(t=>t.string(Jt))).record("aggr",Jt,e=>e.record(Jt,t=>t.arrayOrOne(r=>r.string({values:ATt}),{minLen:1}))).stringOpt("groupAggrOn",Jt).recordOpt("group",Jt,e=>e.arrayOrOne(t=>t.string(Jt))).recordOpt("order",Jt,e=>e.arrayOrOne(t=>t.string(r=>Jt(r[0]==="-"?r.substring(1):r)))).recordOpt("alias",Jt,e=>e.string(Jt)).arrayOpt("optionalTables",e=>e.string(Tp)).optIs("filter",Xu).objectOpt("time",e=>e.oneOf("from",t=>t.string(j1),t=>t.is(XR)).oneOf("to",t=>t.string(j1),t=>t.is(XR),t=>t.string({value:"now"})).oneOf("steps",t=>t.integer({nonNegative:!0}),t=>t.is(XR))).stringOpt("asOf",j1).integerOpt("projectId",{nonNegative:!0}).boolOpt("withComputed").boolOpt("includeDeleted");function Hve(e){let t=ne.fromISO(SR());if(typeof e!="string"){let r=xe.fromObject(e);return r.toMillis()>0?t.minus(r):t.plus(r)}else return e==="now"?t:ne.fromISO(e,{zone:"utc"})}var xw=class extends Map{getOrSet(t,r){let i=this.get(t);return i===void 0&&(i=typeof r=="function"?r():r,this.set(t,i)),i}upsert(t,r,i){let n=this.get(t);return n===void 0&&(n=typeof i=="function"?i():i),r(n),n!==void 0&&this.set(t,n),n}keyList(){return Array.from(this.keys())}valueList(){return Array.from(this.values())}};var Kve=15*60,wTt=15*60;var Wve=!1,Gve=new fd(100,Kve),$w=new fd(100,wTt),Cy=new xw,As=class extends He{constructor(t){super(t),ITt()}async analyze(t,r){ETt(t),r=As.inferCacheOpts(r,t);let i=As.queryCache(t,r);return i?(i.cached=!0,i):(i=await this.post("/analyze",t),As.updateCache(t,i,r),i)}static queryCache(t,r){if(r.mode===3){let i=Sw(t);return Gve.get(i)}else if(r.mode===2){let i=Sw(t);return $w.get(i)}}static updateCache(t,r,i){var n,a;if(i.mode===3){let s=Sw(t);Gve.set(s,r)}else if(i.mode===2){if((((n=i.watchedEntities)==null?void 0:n.length)??0)<=0)throw new Error("Validation mode requires watchedEntities");let s=Sw(t);$w.set(s,r),(a=i.watchedEntities)==null||a.forEach(o=>{Cy.getOrSet(o,()=>new Set).add(s)})}}static inferCacheOpts(t,r){return t??={mode:1,watchedEntities:[]},t.mode===4&&(t.mode=!r.time||Hve(r.time.to)>ne.now().minus(xe.fromObject({seconds:Kve}))?2:3),t}};function ITt(){if(!Wve){let i=function(a){let s=Cy.get(a.entity);s==null||s.forEach(o=>$w.del(o)),Cy.delete(a.entity)},n=function(a){for(let s of a.entities){let o=Cy.get(s);o==null||o.forEach(u=>$w.del(u)),Cy.delete(s)}};var e=i,t=n;let r=Yp();r.dataInserted.subscribe(i),r.dataUpdated.subscribe(i),r.dataDeleted.subscribe(i),r.dataUndeleted.subscribe(i),r.dataMapped.subscribe(n),r.dataUnmapped.subscribe(n),Wve=!0}}function Sw(e){return(0,Zve.default)(JSON.stringify(e))}function ETt(e){for(let t of Object.keys(e.tables)){let r=e.tables[t];if(typeof r!="function")continue;let i=r.tableName;e.tables[t]=i??r.ctors.map(n=>n.tableName)}}var ww=class extends He{async execute(t){return await this.post("/data-batch",t)}build(){return new QR(this)}},QR=class{constructor(t){this.client=t;this.p={steps:[]}}p;get isEmpty(){return this.p.steps.length===0}async execute(){if(this.isEmpty)return{};let t=ye(),r=this.p.steps.filter(n=>{if(n.op==="analyze"){let a=As.inferCacheOpts(n.opts,n.params),s=As.queryCache(n.params,a);if(s)return s.cached=!0,t[n.as]=s,!1}return!0}),i=r.length>0?await this.client.execute({...this.p,steps:r}):ye();for(let n of r)if(n.op==="analyze"){let a=As.inferCacheOpts(n.opts,n.params);i[n.as]&&As.updateCache(n.params,i[n.as],a)}return{...t,...i}}if(t,r){return t?r(this):this}read(t,r){return this.p.steps.push({op:"read",as:"",entity:t,readParams:r,result:!1}),this}analyze(t,r){return this.p.steps.push({op:"analyze",as:"",params:t,opts:r}),this}insert(t,r){let{entity:i,_inputData:n}=Aw(r,t);return this.p.steps.push({op:"insert",entity:i,inputData:n,result:!1}),this}update(t,r){let{entity:i,_inputData:n}=Aw(r,t);return this.p.steps.push({op:"update",entity:i,inputData:n,result:!1}),this}delete(t,r){let{entity:i,_inputData:n}=Aw(r,t,"idsOnly");return this.p.steps.push({op:"delete",entity:i,inputData:n}),this}undelete(t,r){let{entity:i,_inputData:n}=Aw(r,t,"idsOnly");return this.p.steps.push({op:"undelete",entity:i,inputData:n,result:!1}),this}mapAdd(t,r){let i=Array.isArray(t)?t:t.ctors;return this.p.steps.push({op:"map",mapOp:"add",sourceEntity:i[0],entities:i,mappings:r}),this}mapUpdate(t,r){let i=Array.isArray(t)?t:t.ctors;return this.p.steps.push({op:"map",mapOp:"update",sourceEntity:i[0],entities:i,mappings:r}),this}mapAddOrUpdate(t,r){let i=Array.isArray(t)?t:t.ctors;return this.p.steps.push({op:"map",mapOp:"add_or_update",sourceEntity:i[0],entities:i,mappings:r}),this}mapDelete(t,r){var n;let i=Array.isArray(t)?t:t.ctors;return this.p.steps.push({op:"map",mapOp:"delete",sourceEntity:i[0],entities:i,mappings:(n=r[0])!=null&&n.ids?r:r.map(a=>({ids:a}))}),this}asResult(t){let r=this.current;return r&&(r.op==="read"||r.op==="insert"||r.op==="update"||r.op==="undelete"||r.op==="map"||r.op==="analyze")&&(r.as=t,r.result=!0),this}as(t){let r=this.current;return r&&(r.op==="read"||r.op==="insert"||r.op==="update"||r.op==="undelete")&&(r.as=t,r.result=!1),this}fromSource(t,r){let i=this.current;if(i&&typeof t=="string"&&(i.op==="delete"||i.op==="update"||i.op==="undelete"))i.from=t,i.inputData=void 0;else if(i&&r&&i.op==="map"){let n=i.entities.findIndex(a=>(typeof a=="string"?a:a.entityName)===r.entityName);n>=0&&(i.from??=[],i.from[n]=t)}return this}get current(){return this.p.steps[this.p.steps.length-1]}};function Aw(e,t,r){var i;if(Array.isArray(t)){let n=(i=t==null?void 0:t[0])==null?void 0:i.constructor;if(!n)throw new Error("Internal error: Cannot autoresolve entity ctor");return{entity:n,_inputData:r?Yve(t):t}}else{if(t)return{entity:t,_inputData:r?Yve(e):e};throw new Error("Invalid arguments")}}function Yve(e){return e?e.map(t=>({id:t.id})):void 0}var Vt=fe(Ct());var Jve=5e3,eF=3e4,CTt=2*eF,Iw=(r=>(r.Text="TEXT",r.Steps="STEPS",r))(Iw||{}),iJt=Ep(Iw),Te=class extends _t(mr(vc(Xe(It(Jp(yi(nt("testcases","testcase",["tenant"],"TC",{allowCustomFields:!0})))))))){owner_user_id=0;$owner_name="";type="";description="";template="STEPS";precondition_text=void 0;content_text=void 0;steps_text=void 0;expected_result_text=void 0;priority=void 0;status=void 0;testcase_type=void 0;automation=void 0;estimate=void 0;constructor(t){super(),this.initialize(t)}};E([Oe("user"),(0,Vt.IsInt)(),G("The global user id of the test case owner")],Te.prototype,"owner_user_id",2),E([xs(),G("The resolved display name of the owner user - read only")],Te.prototype,"$owner_name",2),E([(0,Vt.IsString)(),Ce(30),(0,Vt.IsOptional)(),G("Reserved for future use")],Te.prototype,"type",2),E([(0,Vt.IsString)(),Ce(Jve),(0,Vt.IsOptional)(),od(),G("Reserved for future use")],Te.prototype,"description",2),E([(0,Vt.IsString)(),(0,Vt.IsEnum)(Iw),G("The template type used for the test case: STEPS or TEXT")],Te.prototype,"template",2),E([(0,Vt.IsString)(),Ss(),(0,Vt.IsOptional)(),Ce(Jve),Oe("blob",!0),G("A description of the precondition required for the test case (can be a rich text document)",{example:""})],Te.prototype,"precondition_text",2),E([(0,Vt.IsString)(),Ss(),(0,Vt.IsOptional)(),Ce(CTt),Oe("blob",!0),G("The test case content - used with template STEPS (can be a rich text document)",{example:""})],Te.prototype,"content_text",2),E([(0,Vt.IsString)(),Ss(),(0,Vt.IsOptional)(),Ce(eF),Oe("blob",!0),G("The test case content - used with template TEXT (can be a rich text document)",{example:""})],Te.prototype,"steps_text",2),E([(0,Vt.IsString)(),Ss(),(0,Vt.IsOptional)(),Ce(eF),Oe("blob",!0),G("The test case expected result - used with template TEXT (can be a rich text document)",{example:""})],Te.prototype,"expected_result_text",2),E([G("The test case priority (This is a builtin-custom field)",{example:1})],Te.prototype,"priority",2),E([G("The test case status (This is a builtin-custom field)",{example:""})],Te.prototype,"status",2),E([G("The test case type (This is a builtin-custom field)",{example:""})],Te.prototype,"testcase_type",2),E([G("The test case automation status (This is a builtin-custom field)",{example:""})],Te.prototype,"automation",2),E([G("A test case time estimate (This is a builtin-custom field)",{example:100})],Te.prototype,"estimate",2);var Ew=class extends vi{constructor(t){super("testcase",Te,t)}};var Cw=class extends vi{constructor(t){super("testcase-folder",ur,t)}};var xi=fe(Ct());var wr=class extends _t(mr(vc(Xe(It(yi(nt("testruns","testrun",["tenant"],"TR",{allowCustomFields:!0}))))))){testplan_id=void 0;closed_at=void 0;is_closed=!1;description=void 0;constructor(t){super(),this.initialize(t)}};E([Oe("testplan"),(0,xi.IsInt)(),(0,xi.IsOptional)(),G("The optional id of the test plan this test run is associated with",{example:0})],wr.prototype,"testplan_id",2),E([(0,xi.IsOptional)(),(0,xi.IsISO8601)(),G("The time this run was closed - all referenced test case data uses this as a historic timestamp",{example:sd})],wr.prototype,"closed_at",2),E([Ar(),(0,xi.IsBoolean)(),G("Whether the test run is closed or not - closed runs can not be modified until reopened")],wr.prototype,"is_closed",2),E([(0,xi.IsString)(),Ss(),Ce(hd),Oe("blob",!0),(0,xi.IsOptional)(),G("An optional description for this test run (can be a rich text document)",{example:""})],wr.prototype,"description",2);var Tw=class extends vi{constructor(t){super("testrun",wr,t)}};var xt=fe(Ct());var tF=class{map=new Map;get size(){return this.map.size}get(t){return this.map.get(t)}has(t){return this.map.has(t)}set(t,r){this.map.set(t,Array.isArray(r)?r:[r])}delete(t){return this.map.delete(t)}add(t,r){let i=this.map.get(t);i||this.map.set(t,i=[]),i.push(r)}addAll(t,r){let i=this.map.get(t);i||this.map.set(t,i=[]),i.push(...r)}remove(t,r){let i=this.get(t);if(i===void 0)return!1;let n=typeof r=="function",a=r,s=!1;for(let o=i.length-1;o>=0;o--){let u=i[o];(n&&a(u)||!n&&u===r)&&(i.splice(o,1),s=!0)}return i.length===0&&this.delete(t),s}[Symbol.iterator](){return this.map[Symbol.iterator]()}keys(){return Array.from(this.map.keys())}entries(){return Array.from(this.map.entries())}forEach(t){this.map.forEach(t)}clear(){this.map.clear()}};var KJt=RA()?150:50,YJt=RA()?60:20,kw=200;var Xve=100,kTt=1e4,Ow="cf__",OTt=new RegExp(`^(?!${Ow})`);var Pw={string:{type:"string",isMultiValued:!1,validator:t1e,convFromString:e=>e},multi_string:{type:"multi_string",isMultiValued:!0,validator:e=>e1e(e,Xve),convFromDb:$R,convToDb:AR,convFromString:e=>Qve(e)},text:{type:"text",isMultiValued:!1,validator:e=>typeof e=="string"&&e.length<=kTt,convFromString:e=>e},boolean:{type:"boolean",isMultiValued:!1,validator:e=>typeof e=="boolean",convFromDb:Age,convFromString:e=>e==="true"||e==="True"||e==="1"},integer:{type:"integer",isMultiValued:!1,validator:e=>(0,xt.isInt)(e),convFromString:e=>kR(CR(e))},number:{type:"number",isMultiValued:!1,validator:e=>(0,xt.isNumber)(e,{allowNaN:!1}),convFromString:e=>kR(TR(e))},date:{type:"date",isMultiValued:!1,validator:e=>(0,xt.isISO8601)(e),convToDb:(e,t)=>e[t]!==void 0?e[t]=new Date(e[t]).toISOString():void 0,convFromString:e=>bge(_ge(e))},duration:{type:"duration",isMultiValued:!1,validator:e=>(0,xt.isNumber)(e,{allowNaN:!1}),convFromString:e=>PTt(e)},tag:{type:"tag",isMultiValued:!0,validator:e=>e1e(e,Xve),convFromDb:$R,convToDb:AR,convFromString:e=>Qve(e)},user_id:{type:"user_id",isMultiValued:!1,validator:e=>(0,xt.isInt)(e)&&e!==0,convFromString:e=>CR(e)},url:{type:"url",isMultiValued:!1,validator:e=>typeof e=="string"&&(0,xt.isURL)(e),convFromString:e=>e}};function Qve(e){let t=e.split(";");return t=t.length<=1?e.split(","):t,t.map(r=>r.trim()).filter(r=>r)}function PTt(e,t="seconds"){e=e.trim();let r=TR(e);return isNaN(r)?xge(e):r<0?NaN:t==="seconds"?r:r*60}function t1e(e){return typeof e=="string"&&e.length<=kw}function e1e(e,t){return Array.isArray(e)&&e.every(t1e)&&e.length<=t}var ws=class extends Jp(Xe(nt("custom_fields","custom_field",["tenant"],"CF"))){table="";name="";display_name=void 0;type="string";is_builtin=!1;options={projectIds:[],required:!1,visible:!1,includeByDefault:!1,allowCustomValues:!1,description:""};constructor(t){super(),this.initialize(t)}};E([(0,xt.IsString)(),Ce(40)],ws.prototype,"table",2),E([Pge(OTt),(0,xt.IsLowercase)(),nl(3),Ce(28),(0,xt.IsString)(),Dge(),Rge()],ws.prototype,"name",2),E([(0,xt.IsString)(),(0,xt.IsOptional)(),Ce(40)],ws.prototype,"display_name",2),E([(0,xt.IsString)()],ws.prototype,"type",2),E([(0,xt.IsBoolean)(),Ar()],ws.prototype,"is_builtin",2),E([ud()],ws.prototype,"options",2);function r1e(e){return e.startsWith(Ow)?e.substring(Ow.length):e}function yd(e){return e.is_builtin?e.name:Ow+e.name}function NTt(e,t,r){var a;let i=Array.isArray(e);return(r!==void 0?r:i)?i&&P7(e,(t.fixedValues??[]).map(s=>s.value)):!!((a=t.fixedValues)!=null&&a.find(s=>s.value===e))}var MTt=e=>{var t;return((t=Pw[e.type])==null?void 0:t.validator)??(()=>!0)},DTt=(e,t,r,i=!1,n=!1,a=MTt)=>{let s=e.type;if(!(s?Pw[s]:void 0))return[];if(i){if(r==null)return[t?t(`settings.custom_field_mgmt.types.${s}_invalid`,{ns:"common"}):`Invalid value for required field of type '${s}'`];if(Array.isArray(r)){if(!(0,xt.arrayNotEmpty)(r))return[t?t("arrayNotEmpty",{ns:"validation"}):"Must have at least one entry"]}else if(!IR(`${r}`,1))return[t?t("minLengthTrimmed",{constraint1:1,ns:"validation"}):"Must have at least length 1"]}else if(r===void 0)return[];return n&&!r?[]:!e.options.allowCustomValues&&e.options.fixedValues&&!NTt(r,e.options)?[t?t("settings.custom_field_mgmt.error_not_fixed_value",{ns:"common"}):"Value must be one of the allowed values"]:r!==null&&a(e)(r)?[]:s==="string"&&`${r}`.length>kw?[t?t("maxLength",{constraint1:kw,valueLength:`${r}`.length,ns:"validation"}):`Value is longer than ${kw} characters`]:[t?t(`settings.custom_field_mgmt.types.${s}_invalid`,{ns:"common"}):`Invalid value for field of type '${s}'`]};function i1e(e,t,r,i){let n=e.filter(s=>s.table===r),a=[];for(let s of n){let o=yd(s),u=i&&i[o],l=DTt(s,t,u,s.options.required&&!s.options.defaultValue,!0);l.length>0&&a.push({field:s,property:o,propertyValue:u,message:l.join(". ")})}return a}var Nw=class extends He{constructor(t){super(t)}async getCustomFieldsMetadata(){return await this.get("/custom-field/all")}async createCustomField(t){let r=await this.post("/custom-field",t);return this.strongify(r,ws)}async updateCustomField(t){let r=await this.put("/custom-field",ot(t)),i=this.strongify(r,ws);return Array.isArray(t)?i:i[0]}async purgeCustomFieldAndData(t){await this.delete(`/custom-field/purge/${t.id}`)}};var pF=fe(Ct());var Qr=fe(c1e());function v1e(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var xd=v1e();function zTt(e){xd=e}var y1e=/[&<>"']/,HTt=new RegExp(y1e.source,"g"),b1e=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,WTt=new RegExp(b1e.source,"g"),GTt={"&":"&","<":"<",">":">",'"':""","'":"'"},d1e=e=>GTt[e];function hr(e,t){if(t){if(y1e.test(e))return e.replace(HTt,d1e)}else if(b1e.test(e))return e.replace(WTt,d1e);return e}var ZTt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _1e(e){return e.replace(ZTt,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}var KTt=/(^|[^\[])\^/g;function Qe(e,t){e=typeof e=="string"?e:e.source,t=t||"";let r={replace:(i,n)=>(n=n.source||n,n=n.replace(KTt,"$1"),e=e.replace(i,n),r),getRegex:()=>new RegExp(e,t)};return r}var YTt=/[^\w:]/g,JTt=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f1e(e,t,r){if(e){let i;try{i=decodeURIComponent(_1e(r)).replace(YTt,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!JTt.test(r)&&(r=tkt(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}var Dw={},XTt=/^[^:]+:\/*[^/]*$/,QTt=/^([^:]+:)[\s\S]*$/,ekt=/^([^:]+:\/*[^/]*)[\s\S]*$/;function tkt(e,t){Dw[" "+e]||(XTt.test(e)?Dw[" "+e]=e+"/":Dw[" "+e]=Rw(e,"/",!0)),e=Dw[" "+e];let r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(QTt,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(ekt,"$1")+t:e+t}var Fw={exec:function(){}};function p1e(e,t){let r=e.replace(/\|/g,(a,s,o)=>{let u=!1,l=s;for(;--l>=0&&o[l]==="\\";)u=!u;return u?"|":" |"}),i=r.split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function Rw(e,t,r){let i=e.length;if(i===0)return"";let n=0;for(;n<i;){let a=e.charAt(i-n-1);if(a===t&&!r)n++;else if(a!==t&&r)n++;else break}return e.slice(0,i-n)}function rkt(e,t){if(e.indexOf(t[1])===-1)return-1;let r=e.length,i=0,n=0;for(;n<r;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&(i--,i<0))return n;return-1}function ikt(e,t){!e||e.silent||(t&&console.warn("marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async"),(e.sanitize||e.sanitizer)&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options"),(e.highlight||e.langPrefix!=="language-")&&console.warn("marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight."),e.mangle&&console.warn("marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`."),e.baseUrl&&console.warn("marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url."),e.smartypants&&console.warn("marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants."),e.xhtml&&console.warn("marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml."),(e.headerIds||e.headerPrefix)&&console.warn("marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`."))}function m1e(e,t){if(t<1)return"";let r="";for(;t>1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function h1e(e,t,r,i){let n=t.href,a=t.title?hr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;let o={type:"link",raw:r,href:n,title:a,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,o}return{type:"image",raw:r,href:n,title:a,text:hr(s)}}function nkt(e,t){let r=e.match(/^(\s+)(?:```)/);if(r===null)return t;let i=r[1];return t.split(`
|
|
231
231
|
`).map(n=>{let a=n.match(/^\s+/);if(a===null)return n;let[s]=a;return s.length>=i.length?n.slice(i.length):n}).join(`
|
|
232
232
|
`)}var _d=class{constructor(t){this.options=t||xd}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Rw(i,`
|
|
233
233
|
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],n=nkt(i,r[3]||"");return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:n}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(/#$/.test(i)){let n=Rw(i,"#");(this.options.pedantic||!n||/ $/.test(n))&&(i=n.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=r[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;let a=this.lexer.blockTokens(i);return this.lexer.state.top=n,{type:"blockquote",raw:r[0],tokens:a,text:i}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i,n,a,s,o,u,l,d,f,m,p,h,g=r[1].trim(),y=g.length>1,_={type:"list",raw:"",ordered:y,start:y?+g.slice(0,-1):"",loose:!1,items:[]};g=y?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=y?g:"[*+-]");let A=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(r=A.exec(t))||this.rules.block.hr.test(t)));){if(i=r[0],t=t.substring(i.length),d=r[2].split(`
|